Re: Using GDB..

From: Sammy (samedi@clark.net)
Date: 10/28/96


On Mon, 28 Oct 1996 linebacker@microlink.net wrote:

- Does anyone know of a good book or another source that can teach
- me GDB? I have an inf. loop somewhere in my mud, and I am having
- a hell of a time tracking it down.

The book I mentioned in my last post to the list gives a pretty good
introduction to using gdb.  It's easy to use for endless loop problems
tho.  Load up circle under gdb by entering "gdb circle" (in the bin
directory).  Then type "run -q <port num>".  This will boot the mud.  Use
another window to log onto the mud and wait for it to lock up.  WHen it
does, go back to the gdb window and hit control-C.  You shoulg get the
line that is currently being run, with a line number, a function name, and
a source file name.  You'll probably be in the middle of a for or while
loop.

Useful commands here are backtrace, which shows you the function that
called the current function, and the funcion that called that one, and so
on.  "Up" and "down" move up and down functions.  Print lets you see the
value of variables (ex: "print world[ch->in_room].number").  Then if you
still can't fix it, you at least know where the problem is, so you can
post a copy of the function to the list for community troubleshooting :)

Sam

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/18/00 PST