I have an application that needs to use GDB/MI to get information about a process. Right now I am setting a breakpoint in main and running the process. By using "info locals" I can get a neat list of the local variables in the current frame. While this is good, I need to be able to see what the global variables are.
Is there a way to do this that isn't too painful? I can use "info variables" and get a list of ALL variables that is way too extensive and could hurt the performance of my application. Is there a simpler way to get a list of the global variables?
EDIT: Added that I'm wanting to use GDB/MI.
According to GDB docs the info variables will print out any variables defined outside of functions. This will include your globals and static variables.
If you know the name of the global, or follow a particular naming pattern, you can provide GDB with regex to narrow it down.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With