Executing a CLI command from Python

Paul Koning paulkoning@comcast.net
Thu Feb 16 00:29:33 GMT 2023



> On Feb 15, 2023, at 5:25 PM, Jan Vrany via Gdb <gdb@sourceware.org> wrote:
> 
> On Wed, 2023-02-15 at 16:50 -0500, Paul Koning via Gdb wrote:
>> I looked through the Python GDB API documentation but didn't see this: is there a way for Python code to ask GDB to execute a command?
>> 
>> For example, I want to look up information about a kernel module (addresses etc.) then issue an "add-symbol-file" command using parameters constructed from what was looked up.
>> 
> I think this can be done with gdb.execute ():
> 
> https://sourceware.org/gdb/current/onlinedocs/gdb.html/Basic-Python.html#Basic-Python

Sure looks like it.  Thanks Jan.  I didn't think to look in "basic" for that feature.

	paul




More information about the Gdb mailing list