views:

24

answers:

1

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.

+4  A: 

Compile with debug symbols (-g3) and use:

print &p

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

Matias Valdenegro