Neither of these options did work for me. I did add -g directly to the Makefile, compiled again and attached it to gdb.ilari wrote: EDIT: If you want to make a debug build you can pass the "-debug" parameter to "qmake". Or "CONFIG+=debug" if plain "-debug" doesn't work.
I am no programmer, although I coded a bit in my free time. So I am not sure if the following helps at all.
Here is the output if I try to start a komodo9 vs human game:
Code: Select all
gdb ./cutechess
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./cutechess...sdone.
(gdb) set follow-fork-mode child
(gdb) run
Starting program: /home/tobias/chess/tuning/cutechess/projects/gui/cutechess
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffeaf0a700 (LWP 20223)]
[New Thread 0x7fffdd576700 (LWP 20224)]
[New Thread 0x7fffd7fff700 (LWP 20225)]
[New Thread 0x7fffd53de700 (LWP 20226)]
[New Thread 0x7fffd4bdd700 (LWP 20227)]
[New Thread 0x7fffcd4d1700 (LWP 20228)]
[New Thread 0x7fffcccd0700 (LWP 20229)]
[New Thread 0x7fffcc11b700 (LWP 20230)]
[New process 20231]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
process 20231 is executing new program: /home/tobias/chess/engines/Komodo/komodo-9_11b14c11/Linux/komodo-9.02-linux
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffe1977700 (LWP 20232)]
Thread 2.1 "komodo-9.02-lin" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7ffff7fc0600 (LWP 20231)]
0x00007ffff71f9b64 in fclose@@GLIBC_2.2.5 () from /usr/lib/libc.so.6
(gdb) Engine Komodo 9.02 64-bit(0) failed to respond to ping
Terminating process of engine Komodo 9.02 64-bit(0)
quit
A debugging session is active.
Inferior 2 [process 20231] will be killed.
Quit anyway? (y or n) y
Code: Select all
gdb ./cutechess
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./cutechess...done.
(gdb) set follow-fork-mode child
(gdb) r
Starting program: /home/tobias/chess/tuning/cutechess/projects/gui/cutechess
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffeaf0a700 (LWP 19863)]
[New Thread 0x7fffdd576700 (LWP 19864)]
[New Thread 0x7fffd7fff700 (LWP 19865)]
[New Thread 0x7fffd53de700 (LWP 19866)]
[New Thread 0x7fffd4bdd700 (LWP 19867)]
[New Thread 0x7fffcd4d1700 (LWP 19868)]
[New Thread 0x7fffcccd0700 (LWP 19869)]
[New Thread 0x7fffcc11b700 (LWP 19870)]
[New process 19871]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
process 19871 is executing new program: /home/tobias/chess/engines/Komodo/komodo-8_2cceec89/Linux/komodo-8-linux
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffe1977700 (LWP 19872)]
[Thread 0x7fffe1977700 (LWP 19872) exited]
[Inferior 2 (process 19871) exited normally]
And here you can see it running a game on cutechess-cli
Code: Select all
gdb ./cutechess-cli
GNU gdb (GDB) 7.11.1
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./cutechess-cli...done.
(gdb) set follow-fork-mode child
(gdb) r -engine name="Komodo 9.02 64-bit" cmd=/home/tobias/chess/engines/Komodo/komodo-9_11b14c11/Linux/komodo-9.02-linux -engine name="Stockfish 070916 64 BMI2" cmd=/home/tobias/chess/engines/Stockfish/src/stockfish -each proto=uci tc=5+0.05 -pgnout ./test.pgn
Starting program: /home/tobias/chess/tuning/cutechess/projects/cli/cutechess-cli -engine name="Komodo 9.02 64-bit" cmd=/home/tobias/chess/engines/Komodo/komodo-9_11b14c11/Linux/komodo-9.02-linux -engine name="Stockfish 070916 64 BMI2" cmd=/home/tobias/chess/engines/Stockfish/src/stockfish -each proto=uci tc=5+0.05 -pgnout ./test.pgn
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7ffff2693700 (LWP 20884)]
[New process 20885]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
process 20885 is executing new program: /home/tobias/chess/engines/Komodo/komodo-9_11b14c11/Linux/komodo-9.02-linux
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffe1977700 (LWP 20888)]
Started game 1 of 1 (Komodo 9.02 64-bit vs Stockfish 070916 64 BMI2)
Finished game 1 (Komodo 9.02 64-bit vs Stockfish 070916 64 BMI2): 0-1 {Black mates}
Score of Komodo 9.02 64-bit vs Stockfish 070916 64 BMI2: 0 - 1 - 0 [0.000] 1
ELO difference: -inf +/- nan
Finished match
[Thread 0x7fffe1977700 (LWP 20888) exited]
[Inferior 2 (process 20885) exited normally]
(gdb)


