debugger-utils
to directory X
~/.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:
Other API:
For more info, see API.md.