Tim
Tim

Reputation: 1479

Getting the addresses of all currently used variables with gdb

I know that it is possible to output the names of all global and static variables (and their size in case of static arrays) using the command info variables in gdb. I also know that the address of a variable can be displayed using info address.

Is it possible to display a list of all addresses at which variables are stored? This could be used for example to know which array is stored in memory just before a corrupted array.

Upvotes: 0

Views: 468

Answers (1)

dbrank0
dbrank0

Reputation: 9476

For globals you don't need gdb for this.

Just to nm -n yourbinary.

Upvotes: 1

Related Questions