You are not logged in.

#1 2023-03-22 03:48:07

happi0
Member
Registered: 2021-08-29
Posts: 13

How to view user-defined variables in GDB?

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

Board footer

Powered by FluxBB