libctru icon indicating copy to clipboard operation
libctru copied to clipboard

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

Open hYdos opened this issue 3 years ago • 2 comments

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.

hYdos avatar Nov 26 '22 00:11 hYdos

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.

oreo639 avatar Nov 26 '22 00:11 oreo639

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

ian-h-chamberlain avatar Dec 03 '22 14:12 ian-h-chamberlain