[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Need help with stack smash

On 08/27/2009 01:42 PM, Roland McGrath wrote:
Note that this means what it says: if your expression contains a symbol
that goes out of scope before the change happens, then the watchpoint
will be forgotten, because the value of the expression will change from
being a value to being not-a-thing.  So you would need to set the watch
on the address in memory of what you're trying to watch, and not
necessarily on its symbolic name.

Indeed.  Usually the convenient thing to do is:

(gdb) p&foo->bar
$22 = (int *) 0x12345
(gdb) watch *$22

Thanks, but my trouble though is what to watch. My thought was to watch the location of the guard variable that the stack protector code checks, but I have no idea how to find that out.

Orion Poplawski
Technical Manager                     303-415-9701 x222
NWRA/CoRA Division                    FAX: 303-415-9702
3380 Mitchell Lane                  orion cora nwra com
Boulder, CO 80301              http://www.cora.nwra.com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]