Welcome to the Builder Academy

Question Learning GDB

More
30 Mar 2023 19:31 #10289 by soth
Learning GDB was created by soth
Hi,
Trying to learn gdb and not really having much luck right now.  I do have one core file and a couple of backtrace files which I know what is causing them, or at least pretty sure.  When I cast darkness a couple of seconds later it will crash and create a backtrace file.  Here is the file.

[code][

[khays@fedora-vm lib]$ cat backtrace.30.03.2023.15\:23\:22
GNU gdb (GDB) Fedora Linux 13.1-1.fc37
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later < 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-redhat-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
< www.gnu.org/software/gdb/bugs/ >.
Find the GDB manual and other documentation resources online at:
    < www.gnu.org/software/gdb/documentation/ >.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from bin/circle...
[New LWP 34886]
Core was generated by `circle -C3 4100'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x000055bca5a84bf9 in ?? ()
(gdb) [khays@fedora-vm lib]$

/code]

I tried looking through the help doc file on debugging, but no luck right now.  Going to try again as I am new to the gdb stuff.  I tried it on stock tba and I must have changed something to cause darkness to crash after the heartbeat happens.

If anyone has any tips on gdb please pass them this way :)

Thanks!

Please Log in or Create an account to join the conversation.

More
30 Mar 2023 19:47 #10290 by soth
Replied by soth on topic Learning GDB
Well I got the bug fixed, seems like I had instances of whirlwind event still declared and not really being used form awhile back.  However I still want/need to learn some basics on debugging.
Code:
[khays@fedora-vm lib]$ cat backtrace.30.03.2023.15\:23\:22 GNU gdb (GDB) Fedora Linux 13.1-1.fc37 Copyright (C) 2023 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <[url=http://gnu.org/licenses/gpl.html]gnu.org/licenses/gpl.html[/url]> 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-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <[url=https://www.gnu.org/software/gdb/bugs/]www.gnu.org/software/gdb/bugs/[/url]>. Find the GDB manual and other documentation resources online at:     <[url=http://www.gnu.org/software/gdb/documentation/]www.gnu.org/software/gdb/documentation/[/url]>. For help, type "help". Type "apropos word" to search for commands related to "word"... Reading symbols from bin/circle... [New LWP 34886] Core was generated by `circle -C3 4100'. Program terminated with signal SIGSEGV, Segmentation fault. #0  0x000055bca5a84bf9 in ?? () (gdb) [khays@fedora-vm lib]$

Please Log in or Create an account to join the conversation.

More
31 Mar 2023 02:26 #10291 by cunning
Replied by cunning on topic Learning GDB
gdb bin/circle lib/<core_file>

backtrace
info local

Those are very useful

Please Log in or Create an account to join the conversation.

More
31 Mar 2023 02:38 #10292 by soth
Replied by soth on topic Learning GDB
Thanks Cunning. I got the first 2 lines, but used list instead of info local and it just started what looked like at the beginning of the code lol.

Kevin

Please Log in or Create an account to join the conversation.

More
31 Mar 2023 02:43 #10293 by soth
Replied by soth on topic Learning GDB
Just doing a bt form the core file does not look like it gives me much or am I missing something in the line output?
Code:
[khays@fedora-vm src]$ sudo gdb ../bin/circle ../lib/core GNU gdb (GDB) Fedora Linux 13.1-1.fc37 Copyright (C) 2023 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-redhat-linux-gnu". Type "show configuration" for configuration details. For bug reporting instructions, please see: <https://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 ../bin/circle... warning: Can't open file /usr/lib/x86_64-linux-gnu/libc-2.31.so during file-backed mapping note processing warning: Can't open file /usr/lib/x86_64-linux-gnu/libcrypt.so.1.1.0 during file-backed mapping note processing warning: Can't open file /usr/lib/x86_64-linux-gnu/ld-2.31.so during file-backed mapping note processing warning: exec file is newer than core file. [New LWP 34886] Core was generated by `circle -C3 4100'. Program terminated with signal SIGSEGV, Segmentation fault. #0  0x000055bca5a84bf9 in ?? () (gdb) backtrace #0  0x000055bca5a84bf9 in ?? () #1  0x000055bca5b9b400 in ?? () #2  0x000055bca7e15200 in ?? () #3  0x0000000000000000 in ?? () (gdb)

Please Log in or Create an account to join the conversation.

More
31 Mar 2023 18:58 #10294 by thomas

Please Log in or Create an account to join the conversation.

Time to create page: 0.241 seconds