Improving Debuggability with GDB's Python API
summary
Uses GDB Python API plus libclang to map the stopped file/line into AST cursors, enumerate calls and lambdas, and set temporary breakpoints so single-stepping skips library template internals and lands in user code. Adds frame filters to omit library frames and frame decorators to rewrite ugly template names in backtraces. Implements commands that create/delete breakpoints automatically, produces much shorter, readable stacks, and demonstrates the approach on std::sort with nested vectors of strings.
AI-written summary · about
chapters (7)
- 0:00Introduction
- 0:16The problem with templated libraries
- 0:53Example
- 1:14Setting a breakpoint
- 1:54Using the Python API
- 3:43Frame decorators and frame filters
- 4:53Demo
related talks
41mAdvanced Python Debugging Techniques Using GDB
50mExtending GDB debugger capabilities with Python
50mHow I built a power debugger out of the standard library and things I found on the internet
52mCombining Embedded and Interactive Python in a Debugger: A Case Study
23mTrace functions: Building a tiny debugger
52mCombining Embedded and Interactive Python in a Debugger: A Case Study
24mLet’s Rethink Debugging
28mWhat makes a Python debugger possible and how can we make it 100x faster
