You are not logged in.
Hi everyone,
I often forget the names of variables I set when using GDB for debugging. Is there a way to view the user-defined variables in GDB?
I tried using the
info locals
, but it only shows the automatic variables in the current scope. I also tried
info variables
, but it shows all variables, including system variables and function arguments.
Is there a command or option in GDB that allows me to view only the variables I set myself? Or perhaps a way to filter the output of info variables to show only user-defined variables?
Thank you in advance for your help!
Offline
Might be a little late, but you could try putting a prefix before your variable name to distinguish them from other variables. Something like
userdef-whatever
Then run
info variables | grep userdef
to get a list of the variables you defined.
Offline