- Download
debugger-utils
to directoryX
- Put these to your
~/.gdbinit
:
python import sys; sys.path.append('$X/debugger-utils')
$X
is where debugger-utils
lies in.
3. import gdb_utils
in your python script.
# Create a gdb commands in hello.py
import gdb_utils
def hello(who, *args):
"""
Say hello.
"""
print('hello %s', who)
gdb_utils.define(hello)
#(gdb) so hello.py
#(gdb) hello 'world'
For more examples, see example.
GDB commands:
- break
- clear
- commands
- delete
- disable
- define
- enable
- info
- thread
- thread_name
- watch
Other API:
- get_breakpoint
- function
- stop
- register_pprinter
- build_pprinter
- globval
- ty
For more info, see API.md.