DOOManiac <[EMAIL PROTECTED]> writes:
> Anyone have luck w/ debugging a Linux server?
I've read this thread I think a run_in_debugger-script of some sort
will save you a lot of time. I used to use something like this when
debugging Science & Industry, but I don't have a dedicated server
installed right now, so it's untested.
-------------8<-------------------------------------
#!/bin/sh
# Peter Bortas, 2005
#
# You are welcome to do whatever you want with this script.
#
# Valve should feel especially welcome to include something similar in
# the next SDK release to avoid having the "how do a debug" question
# pop up all the time.
# Ignore some signals that we don't want the debugger to stop on.
echo >.gdbinit handle SIGPIPE nostop noprint pass
echo >>.gdbinit handle SIGUSR1 nostop noprint pass
echo >>.gdbinit handle SIGUSR2 nostop noprint pass
echo >>.gdbinit handle SIGLWP nostop noprint pass
echo >>.gdbinit handle SIG38 nostop noprint pass
echo >>.gdbinit handle SIG39 nostop noprint pass
# Check where the script is so it can be run from anywhere.
hlds_l_path="`dirname $0`"
# Make sure the server finds additional shared objects
if [ "${LD_LIBRARY_PATH}" ]; then
LD_LIBRARY_PATH=${hlds_l_path}:${LD_LIBRARY_PATH}
else
LD_LIBRARY_PATH=${hlds_l_path}
fi
export LD_LIBRARY_PATH
hlds_bin="${hlds_l_path}/srcds_i486"
echo >>.gdbinit "run $@"
echo "Executing in gdb: $hlds_bin $@"
gdb $hlds_bin
rm .gdbinit
-------------8<-------------------------------------
Save it in the same directory as the hlds binary. Call it
"hlds_debug" or something, run chmod a+x on it and then just use it as
you would the normal server binary:
/usr/steam/hlds_l/hlds_debug -game espionage -norestart
The server will start automaticly and run until you send a break or it
fails to the debugger.
--
Peter Bortas http://peter.bortas.org
_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please
visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders