GDB will tell you exactly what's wrong. It's called the debugger because you
debug with it.
If you want to settle for "something you fix over time" then leave it. But
if you want to learn GDB and how to accurately troubleshoot your running
mud, then this is the time to do it.

Start your mud up on some port.
Connect to it with GDB.
gdb ./rom <port>

you get the gdb> prompt.
list cmd_eval_mob
(There's the top of the function)
keep typing list until you see :

case CHK_ODOR: 
   if ( lval_char != NULL && !IS_NPC(lval_char) )
       lval = lval_char->pcdata->bathe; break;

then type 'break <line>' where line number is the if statement.
type 'cont'
The mud is now running.

Trigger the program to run.
GDB should notify you it reached the program line that you wanted to stop
in.
then type 'next' to step through the program while you analyze the variable
contents with 'print' or 'printf'.

What you put into GDB is what you get out of it.
> -----Original Message-----
> From: Tom Whiting [mailto:[EMAIL PROTECTED]
> Sent: Sunday, January 13, 2002 9:57 PM
> To: [email protected]
> Subject: RE: speaking of progs :)
> 
> 
> Well, unfortunately GDB is no help at all. Can't figure out how to get
> it to run the mud, without freezing it, etc. Even if it did 
> run the mud,
> it wouldn't likely be any help in analyzing what's not being 
> done (or is
> being done wrong). A man file would help, but if it's as confusing as
> the refcards, it probably wouldn't help at all.
> Thanks to all who tried. I guess this is just another one of 
> those I'll
> have to figure out over time.
> 
> -------------------------------------------
> TJW: Head tech, Dreamless Realms Mud
> Personal: http://twhiting.kyndig.com
> Mud: http://drealms.kyndig.com
> Snippets http://drealms.kyndig.com/snippets
> Telnet telnet://drealms.kyndig.com:9275
> The OLC2 Pages http://olc.kyndig.com
> -------------------------------------------
> 
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Edwin
> Groothuis
> Sent: Sunday, January 13, 2002 7:28 PM
> To: Tom Whiting
> Cc: [email protected]
> Subject: Re: speaking of progs :)
> 
> 
> On Sun, Jan 13, 2002 at 07:23:08PM -0600, Tom Whiting wrote:
> > It's not causing any kind of a dump at all, it's just not 
> > understanding the trigger. The mud's fine, it doesn't crash, the 
> > trigger just doesn't get recognized.
> 
> That's why you have to run it in GDB, and put breakpoints at the right
> locations. GDB is not only for things which crash, it's also for
> realtime stepping through to the code and inspection of variables and
> memory-space.
> 
> See http://www.refcards.com for a GDB-reference sheet.
> 
> Edwin
> 
> -- 
> Edwin Groothuis   |              Personal website:
> http://www.MavEtJu.org
> [EMAIL PROTECTED] |           Interested in MUDs? Visit Fatal
> Dimensions:
> ------------------+                       
> ------------------+ http://www.FatalDimensions.org/
> 
> -- 
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
> 
> 
> 
> -- 
> ROM mailing list
> [email protected]
> http://www.rom.org/cgi-bin/mailman/listinfo/rom
> 

Reply via email to