0

There is gdb.lookup_type("SomeType") in GDB python API as listed blow, but I cannot find a way to get the source file and line number where the type is defined, much like what the GDB command info types ^SomeType$ does. Is it possible via GDB python API without invoking into the info types command?

https://sourceware.org/gdb/onlinedocs/gdb/Types-In-Python.html#Types-In-Python

2
  • 1
    Try gdb.lookup_static_symbol("SomeType"), you should get a gdb.Symbol of the type, with symtab and line fields. Commented Dec 17, 2022 at 13:31
  • @ssbssa gdb.lookup_static_symbol("SomeType") seems working, thanks. Commented Dec 17, 2022 at 19:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.