kima2001 wrote: ↑Fri Apr 26, 2019 4:47 pm
I am trying for a while now to find out how to include newlib functions in my gdb debug session but in vain.
when i step into printf function for instance, i only get the file name and the line number like "../../../newlib/libc/stdio/puts.c " : line 15
Anyone know how to step into newlib function trough gdb ?
The newlib libraries for ESP32 are either compiled into ROM, or pre-built in the "newlib/lib/libc.a" and related files. The
source code is available, but because the library was pre-built there is no matching source code available locally for gdb to step into (the source file paths in the library's debug info don't match anything on your local computer, because the library was built on a different computer).
For newlib functions with debug info available (like the one in your post), it is possible to tell gdb to substitute the path in the debug info for the correct path on your local computer, by using the
gdb substitute path feature. FWIW, I've always found this to be reasonably fiddly and I mostly end up looking up the source code manually. But it is possible.
For newlib code which resides in ROM, there isn't full debug info available so unfortunately there isn't any easy way to have gdb show the matching source.