0

I have a python gdb script that finds a pointer to some important value.

I want to call gdb print command to have this value assigned to value history for future references in other debug commands.

How to do it?

I know that I can define python function that will return this value - but I really want gdb command for backward compatibility with old gdb scripts.

uuu777
  • 765
  • 4
  • 21

1 Answers1

0

Generate python string and call gdb.execute

tmpVal = long(pointer)
tmpStr = "print (Xxxx *)0x{:x}".format(tmpVal)
gdb.execute(tmpStr)
uuu777
  • 765
  • 4
  • 21