pastebin - collaborative debugging tool
rovema.kpaste.net RSS


devel/msnfs41client.bash: Add WinDBG cdb support
Posted by Anonymous on Wed 11th Oct 2023 17:54
raw | new post

  1. From b4f4ffa83a41687bd60752926969474f5e78d23e Mon Sep 17 00:00:00 2001
  2. From: Roland Mainz <roland.mainz@nrubsig.org>
  3. Date: Wed, 11 Oct 2023 15:13:28 +0200
  4. Subject: [PATCH 1/2] devel/msnfs41client.bash: Add WinDBG cdb support
  5.  
  6. Add support for WinDBG's cdb to cygwin/devel/msnfs41client.bash, as
  7. we currently only support compiling the code for Visual Studio (19),
  8. and gdb does not support the Windows PDB debugging format (gdb dwarf
  9. to PDB would be possible via https://github.com/rainers/cv2pdb).
  10.  
  11. Currently this means that the msnfs41client.bash subcommands
  12. "run_daemon" and "sys_run_daemon" require the installation of
  13. WinDBG, so that nfsd_debug.exe always runs under cdb control
  14. (instead of gdb).
  15.  
  16. Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
  17. ---
  18. cygwin/devel/msnfs41client.bash | 27 +++++++++++++++++++++++++--
  19.  1 file changed, 25 insertions(+), 2 deletions(-)
  20.  
  21. diff --git a/cygwin/devel/msnfs41client.bash b/cygwin/devel/msnfs41client.bash
  22. index 7e3f26a..ad77034 100644
  23. --- a/cygwin/devel/msnfs41client.bash
  24. +++ b/cygwin/devel/msnfs41client.bash
  25. @@ -99,7 +99,20 @@ function nfsclient_rundeamon
  26.         set -o xtrace
  27.         set -o nounset
  28.  
  29. -       gdb -ex=run --args nfsd_debug -d 0 --noldap --gid 1616 --uid 1616
  30. +       #
  31. +       # cdb cheat sheet:
  32. +       #
  33. +       # gdb: run  cdb: g
  34. +       # gdb: bt   cdb: kp
  35. +       # gdb: quit cdb: q
  36. +       #
  37. +
  38. +       if false ; then
  39. +               gdb -ex=run --args nfsd_debug -d 0 --noldap --gid 1616 --uid 1616
  40. +       else
  41. +               export _NT_ALT_SYMBOL_PATH="$(cygpath -w "$PWD")"
  42. +               cdb -c "g" "$(cygpath -w "$PWD/nfsd_debug.exe")" -d 2 --noldap --gid 1616 --uid 1616
  43. +       fi
  44.         return $?
  45.  }
  46.  
  47. @@ -108,7 +121,12 @@ function nfsclient_system_rundeamon
  48.         set -o xtrace
  49.         set -o nounset
  50.  
  51. -       su_system gdb -ex=run --args nfsd_debug -d 0 --noldap --gid 1616 --uid 1616
  52. +       if false ; then
  53. +               su_system gdb -ex=run --args nfsd_debug -d 0 --noldap --gid 1616 --uid 1616
  54. +       else
  55. +               export _NT_ALT_SYMBOL_PATH="$(cygpath -w "$PWD")"
  56. +               su_system cdb -c "g" "$(cygpath -w "$PWD/nfsd_debug.exe")" -d 2 --noldap --gid 1616 --uid 1616
  57. +       fi
  58.         return $?
  59.  }
  60.  
  61. @@ -213,6 +231,9 @@ function main
  62.         # "$PATH:/usr/bin:/bin" is used for PsExec where $PATH might be empty
  63.         export PATH="$PWD:$PATH:/usr/bin:/bin"
  64.  
  65. +       # path to WinDBG cdb (fixme: 64bit x86-specific)
  66. +       PATH+=':/cygdrive/c/Program Files (x86)/Windows Kits/10/Debuggers/x64/'
  67. +
  68.         # my own path to pstools
  69.         PATH+=':/home/roland_mainz/work/win_pstools/'
  70.  
  71. @@ -222,6 +243,7 @@ function main
  72.                         return $?
  73.                         ;;
  74.                 'run_deamon' | 'run_daemon')
  75. +                       require_cmd 'cdb.exe' || return 1
  76.                         require_cmd 'nfsd.exe' || return 1
  77.                         require_cmd 'nfsd_debug.exe' || return 1
  78.                         require_cmd 'nfs_mount.exe' || return 1
  79. @@ -229,6 +251,7 @@ function main
  80.                         return $?
  81.                         ;;
  82.                 'sys_run_deamon' | 'sys_run_daemon')
  83. +                       require_cmd 'cdb.exe' || return 1
  84.                         require_cmd 'PsExec.exe' || return 1
  85.                         require_cmd 'nfsd.exe' || return 1
  86.                         require_cmd 'nfsd_debug.exe' || return 1
  87. --
  88. 2.39.0

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}




All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at