DogDog
DogDog

Reputation: 4920

How do I get the address of a certain variable in gdb

How do I get the address of a certain variable in gdb, with the command line that is.

Edit :

It doesn't work in constructor.

Upvotes: 0

Views: 112

Answers (1)

Dr. Snoopy
Dr. Snoopy

Reputation: 56407

Compile with debug symbols (-g3) and use:

print &p

With p being the variable you want to take the address of.

Upvotes: 4

Related Questions