Howto DEBUG for dummies
Posted: 26 Jun 2005, 00:42
Well lets start. ive started to write that because lot of people dont know how.and i think getting a debugger output is a lot easier for dev to solve the issue.
then il explain it for linux user
then il explain it for linux user
- Well at first get yourself a debugger.Maybe install it with your ditro tool. or get it here http://www.gnu.org/software/gdb/gdb.html.
Nice is it Installed?,right. lets start.
First lets launch gdb
Nice you should have somethink like that$ gdb tmw
Lets run the game now.i suggest you to run tmw in windowed mode.to see the gdb terminal at the same time.GNU gdb 6.1
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or 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.
This GDB was configured as "i686-pc-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1".
(gdb)
lets type
Now the game should start normaly.now try to figure how the bug as been provoked.What it crashed?...nice is what we need.(gdb) run
Starting program:/usr/bin/tmw
well if it crash you should get an output like that.
No dont close the game yet(if its still open).Program received signal SIGSEGV, Segmentation fault.
Being::isMonster (this=0x7f) at being.cpp:371
371 return job > 200;
Well its a good start but try to get something more detailed.
Just do us a little "where" or "bt"
yea thats the info we need.now get them and post them on irc or the forum.(gdb) where
#0 Being::isMonster (this=0x7f) at being.cpp:371
#1 0x080b59f4 in do_input () at game.cpp:598
#2 0x080ba451 in game () at game.cpp:140
#3 0x080be299 in main (argc=1, argv=0x7f) at main.cpp:396
well now its time to quit.(gdb) quit