Small GDB problem

Posted by Dark_Trunks on Wed 03 Jul 2002 05:00 PM — 5 posts, 19,718 views.

Australia #0
I've been trying to setup a new skill and thought I finally got everything working when I descover that it crashes in seemingly random locations. So I figure hey why not give GDB a go.
Now I have a new problem: It wont run past line 159 in comm.c
Why is it doing this? There seems to be a breakpoint on that line that I cant disable - everytime I do, it just puts it back again.

I can step past it and get up to about line 272 when it will go back to 159.

Here is the code in and around those lins:

 	152	int port;
 	153	
 	154	#ifdef WIN32
 	155	  int mainthread( int argc, char **argv )
 	156	#else
 	157	  int main( int argc, char **argv )
 	158	#endif
	159	{
-	160	    struct timeval now_time;
 	161	    char hostn[128];
 	162	
 	163	    /*
 	164	     * Memory debugging if needed.
 	165	     */
 	166	#if defined(MALLOC_DEBUG)
 	167	    malloc_debug( 2 );
 	168	#endif
 	169	
...
 	259		if (err)
 	260		{
 	261		    fprintf(stderr, "Error %i on WSAStartup\n", err);
 	262		    exit(1);
 	263		}
 	264	
 	265		/* standard termination signals */
 	266		signal(SIGINT, (void *) bailout);
 	267		signal(SIGTERM, (void *) bailout);
 	268	  }
 	269	#endif /* WIN32 */
 	270	
-	271	    log_string("Booting Database");
-	272	    boot_db( );


Any help here would be greatly appreciated.
Amended on Wed 03 Jul 2002 05:04 PM by Dark_Trunks
Australia #1
OK, well I fixed that problem with a little intuitive fiddling, but now I have another question: When the SMAUG server crashes (Segmentation Fault) does it usually cause GDB to fill up the memory and hense make everything run extremely slow? Or is that just my slow system?
Australia Forum Administrator #2
Using GDB would take memory, yes, and if you are running it with smallish amounts of memory it might make the system slower. However normally you only use GDB after a crash, so it isn't too big an issue.
Australia #3
OK well I have 128MB in my system, and I was watching my task manager while it was doing it. The memory usage for gdb got higher than 90MB when I decided to stop it.

So how do I use it after the crash? I've tried to open the stackdump file and it doesnt work.
Australia Forum Administrator #4
You should be able to specify both the executable and the dump, something like this:

gdb smaug coredump