YukiPowa 5 Posted March 29, 2015 Share Posted March 29, 2015 Hello! I've never seen the above tutorial, yet useful!Full application server administrator for help when they have a game.core without doubt that the answer is and precisely.So here, the very easy, the command to type is: gdb. Exemple : gdb /usr/metin2/share/game /usr/metin2/channel1/game.core This command will tell you where does the error through the .core.Or at least it will help you to know or just the problem. IMPORTANT: You must not have a game to strip debug! Good bye 3 Link to comment Share on other sites More sharing options...
Alina 234 Posted March 29, 2015 Share Posted March 29, 2015 Thank you very much for sharing! You can also run the gamefile with gdb. This all requires that you're building your gamefile with debug support of course Otherwise backtracing can produce bad results. gdb game run Then you can reproduce the bug and see what happens. gdb can help a lot when fixing game crashes Link to comment Share on other sites More sharing options...
Ken 904 Posted March 29, 2015 Share Posted March 29, 2015 Thank you very much for sharing! You can also run the gamefile with gdb. This all requires that you're building your gamefile with debug support of course Otherwise backtracing can produce bad results. gdb game run Then you can reproduce the bug and see what happens. gdb can help a lot when fixing game crashes Extra information ; When your program is run via gdb and system give crash, gdb is stopped and show the line.. Kind Regards Ken 1 Do not be sorry, be better. Link to comment Share on other sites More sharing options...
Remix 45 Posted March 29, 2015 Share Posted March 29, 2015 You don't have to run the game in gdb again. Just backtrace it. Link to comment Share on other sites More sharing options...
Night 366 Posted March 29, 2015 Share Posted March 29, 2015 you can backtrace it using : bt for full backtrace use : bt full Link to comment Share on other sites More sharing options...
Mashkin 16 Posted March 30, 2015 Share Posted March 30, 2015 You should note that FreeBSD is not really good with cross-platform compiling/debugging. Since game files are usually compiled for x86 (32bit), debugging on an x86-64 machine is quite hard. I usually use an x86 VM or server for debugging instead of messing with this issue. Link to comment Share on other sites More sharing options...
Ira™ 41 Posted March 30, 2015 Share Posted March 30, 2015 What are you talking here, this is not any tutorial. What you say is only 30% as game.core analyzes. There is nothing, that do bt full. Carry On. 1 Link to comment Share on other sites More sharing options...
Remix 45 Posted March 30, 2015 Share Posted March 30, 2015 Since game files are usually compiled for x84 (32bit), debugging on an x86-64 machine is quite hard. That's why you should always use a 32bit OS to debug it. Link to comment Share on other sites More sharing options...
Think 117 Posted March 30, 2015 Share Posted March 30, 2015 You should note that FreeBSD is not really good with cross-platform compiling/debugging. Since game files are usually compiled for x84 (32bit), debugging on an x86-64 machine is quite hard. I usually use an x86 VM or server for debugging instead of messing with this issue. Interestingly we debug perfectly on a 64bit machine having a 32bit game compiled. Link to comment Share on other sites More sharing options...
Premium Cataclismo 86 Posted April 5, 2015 Premium Share Posted April 5, 2015 I am building my game file using -g flag, but when I am trying to run the game using gdb I get the message: no debugging symbols found. Also, if I am trying to use game.core it says that this file does not exists. I am building the game under 32-bit machine and running it on a 64-bit machine. I don't have -s flag. Link to comment Share on other sites More sharing options...
.Devil. 28 Posted April 6, 2015 Share Posted April 6, 2015 I am building my game file using -g flag, but when I am trying to run the game using gdb I get the message: no debugging symbols found. Also, if I am trying to use game.core it says that this file does not exists. I am building the game under 32-bit machine and running it on a 64-bit machine. I don't have -s flag. You need to read the core as i386 (x86). You can use: set gnutarget i386-marcel-freebsd file game core game.core [...] 1 Link to comment Share on other sites More sharing options...
Premium Cataclismo 86 Posted April 7, 2015 Premium Share Posted April 7, 2015 I am building my game file using -g flag, but when I am trying to run the game using gdb I get the message: no debugging symbols found. Also, if I am trying to use game.core it says that this file does not exists. I am building the game under 32-bit machine and running it on a 64-bit machine. I don't have -s flag. You need to read the core as i386 (x86). You can use: set gnutarget i386-marcel-freebsd file game core game.core [...] I've tried under the same machine where I compiled the core and I got same messages. Link to comment Share on other sites More sharing options...
Thavo 4 Posted April 27, 2015 Share Posted April 27, 2015 "/usr/mt2/game99/game.core" is not a core dump: File format is ambiguous" How do I fix it? Link to comment Share on other sites More sharing options...
YukiPowa 5 Posted April 27, 2015 Author Share Posted April 27, 2015 Your machine virtual is x64 ? Use x86 Link to comment Share on other sites More sharing options...
Night 366 Posted April 27, 2015 Share Posted April 27, 2015 if you use a x64 machine do this : # gdb (gdb) set gnutarget i386-marcel-freebsd (gdb) file game (gdb) core game.core (gdb) bt full (gdb) quit # PS : use bt to get a small amount of info (a summery) it can as well be help full with some info like the time in both syserr and syslog can pretty much clear your bug or give you a general idea about it. edit : thx to martysama0134 3 Link to comment Share on other sites More sharing options...
RatCatcher 77 Posted April 27, 2015 Share Posted April 27, 2015 Extra information ; When your program is run via gdb and system give crash, gdb is stopped and show the line.. Kind Regards Ken Isn't that totally obvious since we're talking about debugging? [likehunting intensifies] Enough is enough Link to comment Share on other sites More sharing options...
Thavo 4 Posted April 27, 2015 Share Posted April 27, 2015 Your machine virtual is x64 ? Use x86 Thanks for answer, there's no other way to use in 64 bits? Link to comment Share on other sites More sharing options...
Night 366 Posted April 27, 2015 Share Posted April 27, 2015 Your machine virtual is x64 ? Use x86 Thanks for answer, there's no other way to use in 64 bits? look at my last post Link to comment Share on other sites More sharing options...
Thavo 4 Posted April 29, 2015 Share Posted April 29, 2015 Your machine virtual is x64 ? Use x86 Thanks for answer, there's no other way to use in 64 bits? look at my last post When I write : file /usr/server/share/bin/game it shows me the following error Reading symbols from /usr/server/share/bin/game...Dwarf Error: wrong version in compilation unit header (is 4, should be 2) Link to comment Share on other sites More sharing options...
Benhero 23 Posted June 29, 2015 Share Posted June 29, 2015 Hey Everyone. I have a question. What is now the best way to debug a game crash? I want to debug it on a 64 Bit System... I Try gdb but it not work. Follow error appears: GNU gdb 6.1.1 [FreeBSD] 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 "amd64-marcel-freebsd"...Dwarf Error: wrong version in compilation unit header (is 4, should be 2) [in module /usr/games/channel1/channel1_1/game1_1] Thanks for any help! Link to comment Share on other sites More sharing options...
wezt 95 Posted June 29, 2015 Share Posted June 29, 2015 Hi, try to update gdb for last version pkg install gdb-7.9.1 and run it like /usr/local/bin/gdb791 2 Link to comment Share on other sites More sharing options...
Benhero 23 Posted June 29, 2015 Share Posted June 29, 2015 i already update gdb and to run it like this dont work :/ Greatz Link to comment Share on other sites More sharing options...
wezt 95 Posted June 30, 2015 Share Posted June 30, 2015 (edited) Would be nice to see errors which you get with new gdb. If it's the same, then try to compile the game without -O -O2 -O3 flags and with -g flag (you need to check each Makefile). Furthermore I can advice you to make cmd file for gdb and start it with -x argument, gdb.cmd file should contains path to directories with source files, it will help to see c++ code while debugging. Example of my gdb.cmd directory /root/workspace/mainline/extern/include/boost directory /root/workspace/mainline/extern/include directory /root/workspace/mainline/extern/lib directory /root/workspace/mainline/src_gcc49/libdevil directory /root/workspace/mainline/src_gcc49/liblua/include directory /root/workspace/mainline/src_gcc49/libthecore/lib directory /root/workspace/mainline/src_gcc49/libpoly directory /root/workspace/mainline/src_gcc49/libsql directory /root/workspace/mainline/src_gcc49/libgame/lib directory /root/workspace/mainline/src_gcc49/liblua/lib directory /root/workspace/mainline/src_gcc49/game/src directory /root/workspace/mainline/src_gcc49/db/src So after you can start gdb like this: /usr/local/bin/gdb791 -x gdb.cmd Also, as it was told before, do not forget set target architecture (set gnutarget i386-marcel-freebsd in case if binary is 32bit one) Edited June 30, 2015 by wezt 1 Link to comment Share on other sites More sharing options...
Fr3zy94 59 Posted July 1, 2015 Share Posted July 1, 2015 "/usr/home/game/channels/game99/core2/game.core" is not a core dump: File format is ambiguous how i fix this? Link to comment Share on other sites More sharing options...
Benhero 23 Posted July 1, 2015 Share Posted July 1, 2015 (edited) Don't use Stipped gamefile... @wezt don't can make a gdb.cmd because server run on 64Bit system and i compile on a 32Bit system.. don't know how to compile on 64 bit <.< so i can't link source.. But the "/usr/local/bin/gdb7x1" works very well! Thaks Edited July 1, 2015 by Benhero Link to comment Share on other sites More sharing options...
Recommended Posts