2

I would like to access preprocessor macro definitions using GDB's embedded Python interpreter. Is there a Python macro API for GDB?

in GDB you can do:

gdb> info macro MACRO

But there is no mention of a Python API for macro's in the documentation.

https://sourceware.org/gdb/onlinedocs/gdb/Python-API.html

Also I came across a few messages about development of a Python macro API.

https://sourceware.org/ml/gdb-patches/2011-08/msg00441.html

It mentions a py-macro.c file. But it is nowhere to be found in the current gdb source code.

1 Answer 1

1

it is nowhere to be found in the current gdb source code.

It doesn't appear that the patches have ever been approved or committed, so you are out of luck.

You can of course try to apply the patches to current GDB, or even GDB current as of the time patches were sent.

Sign up to request clarification or add additional context in comments.

Comments

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.