tbot_contrib.gdb
¶
GDB machine for interacting with the GNU debugger.
GDB
Machine¶
- class tbot_contrib.gdb.GDB(host: H, *args: str | Path[H], gdb: str | Path[H] | None = None)[source]¶
-
GDB Machine.
This machine can be used to invoke GDB on a
LinuxShell
and interact with it. The machine will live in a context like any other:from tbot_contrib import gdb with tbot.acquire_lab() as lh: with gdb.GDB(lh, "/usr/bin/echo") as g: # GDB active here ...
You can then send commands to gdb using
gdb.exec()
or drop the user into an interactive GDB session withgdb.interactive()
:with gdb.GDB(lh, "/usr/bin/echo", "hello", "world") as g: # Break on the first getenv g.exec("break", "getenv") g.exec("run") # Not let the user take over and interact with GDB g.interactive()
New in version 0.9.3.