/doc/source/debugging.txt

https://bitbucket.org/tortoisehg/hgtk/ · Plain Text · 95 lines · 63 code · 32 blank · 0 comment · 0 complexity · 8f131330d6e7ced9ae103bd49c2a79ce MD5 · raw file

  1. Debugging
  2. =========
  3. .. module:: debugging
  4. :synopsis: Debug problems in shell extension or dialogs
  5. Dialogs
  6. -------
  7. Stderr is being captured to a buffer that is being inspected at program
  8. exit. If any serious errors (tracebacks, etc) are found in the stderr
  9. buffer the entire contents are sent to the bug report tool so the user
  10. can (should) report a bug. If you suspect there are errors that are not
  11. being reported, you can set the environment variable **THGDEBUG** to any
  12. value to disable the stderr buffering.
  13. If you have a bit of Python knowledge, you can also use::
  14. hgtk --debugger <command>
  15. To disable the forking behavior of hgtk, you can either set an
  16. environment variable **THG_HGTK_SPAWN**, or add the command line
  17. parameter '--nofork'.
  18. Windows
  19. ~~~~~~~
  20. To debug the changelog viewer, for instance, enter these commands
  21. into a :command:`cmd.exe` window, while inside the repository::
  22. set THGDEBUG=1
  23. hgtk --nofork log
  24. Linux/MacOSX
  25. ~~~~~~~~~~~~
  26. To debug the changelog viewer, for instance, enter these commands
  27. into your shell window, while inside the repository::
  28. export THGDEBUG=1
  29. hgtk --nofork log
  30. Shell Extension
  31. ---------------
  32. The debugging mechanisms depend on your platform.
  33. Windows
  34. ~~~~~~~
  35. See also http://msdn.microsoft.com/en-us/library/cc144064(VS.85).aspx
  36. for some info bits about Running and Testing Shell Extensions on Windows
  37. The :command:`DbgView` tool from the SysInternals suite will capture
  38. debug messages from the shell extension. However, the shell
  39. extension does not emit debugging info by default. It must be enabled
  40. by setting the registry key defined in
  41. :file:`win32/shellext/DebugShellExt.reg` in the TortoiseHg source
  42. repository. You can double-click on this file to load the key into your
  43. registry.
  44. Another option is to exit the :command:`ThgTaskbar` system tray
  45. application and start it from the command line. It will emit some debug
  46. information to the console.
  47. Nautilus
  48. ~~~~~~~~
  49. Debugging is done via the environment variable DEBUG_THG
  50. * to test in a separate process::
  51. DEBUG_THG=Ne TMPDIR=/tmp/anydir/ --no-desktop nautilus [path]
  52. * to test in the main instance::
  53. nautilus -q
  54. DEBUG_THG=NOe nautilus
  55. * permanent debugging, set DEBUG_THG in a file which is read on session
  56. start (~/.profile, ~/.xprofile)
  57. Upper case characters in DEBUG_THG specify modules. Only *O* and *N*
  58. for *OverlayCache* and *Nautilus*, respectively, are supported module
  59. names. Lower case characters imply parts. Only *e* is supported,
  60. implying *error* messages.
  61. To restart nautilus, chose either
  62. 1) killall nautilus (the session restarts nautilus automatically, stdin and stdout go to ~/.xsession-errors)
  63. 2) nautilus -q; nautilus (stdin and stdout are on the console)