On Tue, 2008-05-27 at 12:09 -0500, Ryan Neufeld wrote:
> Ran gdb on tpserver.
> Commands I entered:
> gdb ./tpserver-cpp
> game ruleset=risk
> game load
> network start.

<snip>

> Program received signal EXC_BAD_ACCESS, Could not access memory.
> Reason: KERN_PROTECTION_FAILURE at address: 0x00000004
> 0x00062bb0 in TurnTimer::secondsToEOT ()
> (gdb) 

You now want to do the following

(gdb) bt

Which will give you a backtrace of result.

(gdb) bt full

Will give you a backtrace with all the variable values printed. You
probably want to compile with debugging turned on to get more
information out of the process too (I'm unsure of the correct way to do
this with tpserver-cpp). It should give you line numbers and an exact
location.

Another useful command is the "print" which lets you look at the
contents of the variable.

Say you stopped the the following code,

      for (int i = 0; i < t.getsize(); i++) {
--->>   printf("Hello\n");
      }

You could do a print to find out the value of I when it died.
(gdb) print i

There are some good gdb tutorials on the web. DDD is probably a little
more easier to use.

Hope this helps.

Tim 'Mithro' Ansell



_______________________________________________
tp-devel mailing list
[email protected]
http://www.thousandparsec.net/tp/mailman.php/listinfo/tp-devel

Reply via email to