8000 Add a (small) GDB tips section by smontanaro · Pull Request #977 · python/devguide · GitHub
[go: up one dir, main page]

Skip to content

Add a (small) GDB tips section #977

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Nov 4, 2022
8 changes: 4 additions & 4 deletions advanced-tools/gdb.rst
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,10 @@ to ``~/.gdbinit`` (edit the specific list of paths as appropriate)::
add-auto-load-safe-path ~/devel/py3k:~/devel/py32:~/devel/py27


gdb Tips
GDB Tips
========

Learning to use gdb effectively improves your chances of successfully
Learning to use GDB effectively improves your chances of successfully
debugging problems with Python's internals. The tips here aren't yet
organized in any particular way. Over time, as the section grows,
hopefully useful organization will become apparent.
Expand Down Expand Up @@ -360,9 +360,9 @@ Breaking at Labels
You will most often set breakpoints at the start of functions, but
this approach is less helpful when debugging the runtime virtual
machine, since the main interpreter loop function,
``_PyEval_EvalFrameDefault``, is well over 4000 lines long as of 3.12.
``_PyEval_EvalFrameDefault``, is well over 4,000 lines long as of Python 3.12.
Fortunately, among the `many ways to set breakpoints
<https://sourceware.org/gdb/current/onlinedocs/gdb/Specify-Location.html>`_,
<https://sourceware.org/gdb/onlinedocs/gdb/Specify-Location.html>`_,
you can break at C labels, such as those generated for computed gotos. If you are
debugging an interpreter compiled with computed goto support
(generally true, certainly when using GCC), each instruction will be
Expand Down
0