devkitPro / libctru

Homebrew development library for Nintendo 3DS/Horizon OS user mode (Arm11)
https://libctru.devkitpro.org/
752 stars 170 forks source link

GDB Debugging Issue: using 'c' and then pressing CTRL + C in GDB points to wrong file #514

Open hYdos opened 1 year ago

hYdos commented 1 year ago

When using the c command in GDB to get the program to continue, GDB for some reason tried pointing to /home/fincs/git/pacman-packages/libctru/src/libctru-2.1.1/libctru/source/services/hid.c:

Full Logs:

Remote debugging using 192.168.0.101:4003
0x00100000 in _start ()
(gdb) c
Continuing.
[New Thread 48.392]

Thread 1 received signal SIGINT, Interrupt.
0x00107004 in ctru::services::hid::Hid::keys_held (self=0x81ffd9c) at src\services/hid.rs:92
92                  KeyPad::from_bits_truncate(keys)
(gdb) c
Continuing.

Thread 1 received signal SIGINT, Interrupt.
0x00104884 in hidScanInput ()
    at /home/fincs/git/pacman-packages/libctru/src/libctru-2.1.1/libctru/source/services/hid.c:204
204     /home/fincs/git/pacman-packages/libctru/src/libctru-2.1.1/libctru/source/services/hid.c: No such file or directory.
oreo639 commented 1 year ago

That's is the debug information from when it was compiled, you can still check what line you paused it on using the file and line number.

ian-h-chamberlain commented 1 year ago

The easiest way to deal with this in my experience is to use a local checkout of libctru and set substitute-path: https://sourceware.org/gdb/onlinedocs/gdb/Source-Path.html#Source-Path