gdb command argument related question

Arpan arpananand@gmail.com
Wed May 10 10:50:16 GMT 2023


Hi,

I am a new user of GDB. after some understanding from google, i could write
my gdb commands in a python file by name "myFile.py" and use it as below:

main.py:
subprocess.Popen(["arm-none-eabi-gdb-py.exe", "--command=main3.py"])

myFile.py:
import gdb
import sys
import os
print("gdb loading executable")
gdb.execute('some executable file')
gdb.Breakpoint('some function_name')
gdb.execute("c")
etc

my question is, how do i pass some arguments to myFile.py from main.py? is
it even possible? If yes, then please share some examples for the same.

one more question is, if I have some methods defined in myFile.py, can I
access them in main.py? If so, how?

Any help on these queries would be really appreciated.


Thanks & Regards,
Arpan


More information about the Gdb mailing list