gdb: watchpoints, find where it was changed

Posted by Zeno on Tue 12 Apr 2005 05:37 PM — 3 posts, 9,492 views.

USA #0
Getting closer to finding out this password bug:
(gdb) watch ch
Hardware watchpoint 3: ch
(gdb) c
Continuing.
Hardware watchpoint 3: ch

Old value = (CHAR_DATA *) 0x80b2dbb
New value = (CHAR_DATA *) 0x0
nanny (d=0x9aac280, argument=0xbfe77f10 "Zofar") at comm.c:1998
1998        switch ( d->connected )
(gdb) c
Continuing.
Hardware watchpoint 3: ch

Old value = (CHAR_DATA *) 0x0
New value = (CHAR_DATA *) 0x99d8808
nanny (d=0x9aac280, argument=0x81d3700 "Xio") at comm.c:2075
2075            if ( ch )
(gdb) bt
#0  nanny (d=0x9aac280, argument=0x81d3700 "Xio") at comm.c:2075
#1  0x080b3fbb in game_loop () at comm.c:969
#2  0x080b33af in main (argc=8, argv=0xbfe78350) at comm.c:340


I need to find out why Xio was entered in nanny. Xio is the one who Zofar is ignoring. How would I do that with gdb?
Australia Forum Administrator #1
You can do conditional breakpoints, but it sounds like somehow having someone on an ignore list is corrupting the login process. Is it possible that when you look up an ignore list it changes ch from the current character to the ignored one?
USA #2
That is what it seems to be doing, but where how and why I have to find out. It seems that the call to nanny is:
nanny(d, cmdline);

And since nanny was called with "Xio", it was something to do with that for some reason. But I never modified ignore or password functions.