PageRenderTime 20ms CodeModel.GetById 16ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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