httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@ai.mit.edu (Robert S. Thau)
Subject Re: is 5.2 okay ?
Date Sun, 09 Jul 1995 10:33:48 GMT
   From: Rob Hartill <hartill@ooo.lanl.gov>
   Date: Sat, 8 Jul 95 9:04:47 MDT

   I had CFLAGS = -g  (it just doesn't show in the final linking stage)
   I threw another in when defining CC to make sure - same results. Also
   tried gcc instead of HPs c89 compiler - no help.

Hmmm... on some systems, -g is required as an option at the link stage
as well, or the debugging information is thrown away.

   gdb -X     ->  

   gdb: unrecognized option `-X'
   Use `gdb --help' for a complete list of options.

Not quite... -X is an option to the *server*, which lets you do things
like:

   % gdb httpd
   GDB is free software and you are welcome to distribute copies of it
    under certain conditions; type "show copying" to see the conditions.
   There is absolutely no warranty for GDB; type "show warranty" for details.
   GDB 4.13 (sparc-sun-sunos4.1.3_U1), 
   Copyright 1994 Free Software Foundation, Inc...
   (gdb) run -X -d /server/root/directory
   ...

to get a *single* "server child" process running under the debugger,
doing the child_main accept loop.  (Basically, it skips all the forks
in http_main, and takes the "child process" code path of each until it
finally winds up in the accept loop).

This is a lousy way to run a server (single threaded!), but it's a
good way to debug one, since you can connect with the client of your
choice (as opposed to, say, running the thing in inetd mode and typing
at it), and you get full access to the debugger command set.

Needless to say, the -X option should *only* be used when running the
server under the debugger; what you get otherwise is a machine that
can only handle one request at a time, a la MacHTTP, and which dies
when you try to restart it.

rst

Mime
View raw message