Skip to content

Commit 027b7c1

Browse files
committed
Working on symbols documentation
1 parent 3151155 commit 027b7c1

2 files changed

Lines changed: 299 additions & 29 deletions

File tree

docs/source/debug.rst

Lines changed: 116 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
See sample :ref:`sample_debugger`
99

10+
.. note::
11+
12+
If you are interrested by symbols (PDB) handling, go to subsection :ref:`debug_symbols_module`
13+
1014
:class:`Debugger`
1115
"""""""""""""""""
1216

@@ -24,6 +28,13 @@ This means that those methods see the original ``current_process`` memory access
2428
.. automethod:: __init__
2529

2630

31+
:class:`SymbolDebugger`
32+
"""""""""""""""""""""""
33+
34+
.. autoclass:: SymbolDebugger
35+
:members:
36+
:no-inherited-members:
37+
2738

2839
:class:`LocalDebugger`
2940
""""""""""""""""""""""
@@ -43,7 +54,6 @@ There is not much documentation for now as the code might change soon.
4354
:members:
4455

4556

46-
4757
:class:`Breakpoint`
4858
"""""""""""""""""""
4959

@@ -99,4 +109,108 @@ When a breakpoint is hit, its ``trigger`` function is called with the debugger a
99109

100110
.. note::
101111

102-
See sample :ref:`sample_debugger_bp_functionbp`
112+
See sample :ref:`sample_debugger_bp_functionbp`
113+
114+
115+
.. _debug_symbols_module:
116+
117+
:mod:`windows.debug.symbols` -- Using symbols
118+
"""""""""""""""""""""""""""""""""""""""""""""
119+
120+
.. module:: windows.debug.symbols
121+
122+
The :mod:`windows.debug.symbols` module provide classes to load PDB and resolve name/address.
123+
In its current state, this module does not handle types.
124+
125+
.. note::
126+
127+
See sample <TODO>
128+
129+
130+
Configuration
131+
'''''''''''''
132+
133+
In order to be able to automatically download PDB and parse remote ``_NT_SYMBOL_PATH``, a debug version of the DLL `dbghelp.dll` must be used.
134+
(See `MSDN: DbgHelp Versions <https://docs.microsoft.com/en-us/windows/win32/debug/dbghelp-versions>`_)
135+
136+
As it is NOT recommended to replace ``system32/dbghelp.dll``, its path must be provided to PythonForWindows.
137+
This path must be provided before any call to the ``dbghelp.dll`` APIs.
138+
Also, the ``symsrv.dll`` DLL should be present in the same directory as ``dbghelp.dll`` (See `SymSrv Installation <https://docs.microsoft.com/en-us/windows/win32/debug/using-symsrv#installation>`_)
139+
140+
There is 2 ways to pass this information to ``PythonForWindows``:
141+
142+
* Using the function :func:`set_dbghelp_path`
143+
* Using the environment variable ``PFW_DBGHELP_PATH``
144+
* If this variable exists it will simply trigger a call to ``set_dbghelp_path(PFW_DBGHELP_PATH)``
145+
146+
147+
If the given path is a directory, the final path will be computer as ``path\<current_process_bitness>\dbghelp.dll``.
148+
This allow to use the same script (or environment variable) transparently in bot 32b & 64b python interpreters.
149+
150+
.. note::
151+
152+
For example, on my computer my setup is done through the environment variable: ``PFW_DBGHELP_PATH=D:\pysym\bin``
153+
154+
This directory have the following layout:
155+
156+
| $ tree /A /F %PFW_DBGHELP_PATH%
157+
| D:\\PYSYM\\BIN
158+
| \| symsrv.yes
159+
| \|
160+
| +\\-\\-\\-32
161+
| \| dbghelp.dll
162+
| \| symsrv.dll
163+
| \|
164+
| \\\\-\\-\\-64
165+
| dbghelp.dll
166+
| symsrv.dll
167+
168+
169+
Helpers
170+
'''''''
171+
172+
.. autofunction:: set_dbghelp_path
173+
174+
.. autoclass:: SymbolEngine
175+
:members:
176+
177+
178+
:class:`VirtualSymbolHandler`
179+
'''''''''''''''''''''''''''''
180+
181+
.. autoclass:: VirtualSymbolHandler
182+
:show-inheritance:
183+
:members:
184+
:inherited-members:
185+
:special-members: __getitem__
186+
187+
188+
:class:`ProcessSymbolHandler`
189+
'''''''''''''''''''''''''''''
190+
191+
.. autoclass:: ProcessSymbolHandler
192+
:show-inheritance:
193+
:members:
194+
:inherited-members:
195+
:special-members: __getitem__
196+
197+
198+
:class:`SymbolModule`
199+
'''''''''''''''''''''
200+
201+
.. autoclass:: SymbolModule
202+
:show-inheritance:
203+
:members:
204+
:inherited-members:
205+
206+
207+
:class:`SymbolInfo`
208+
'''''''''''''''''''
209+
210+
.. autoclass:: SymbolInfo
211+
:members:
212+
213+
214+
.. autoclass:: SymbolInfoA
215+
:members:
216+
:special-members: __str__, __int__

0 commit comments

Comments
 (0)