Can you step through code with GDB over UART? ("No symbol table")

hamishcunningham
Posts: 11
Joined: Mon Jun 05, 2017 7:50 pm

Can you step through code with GDB over UART? ("No symbol table")

Postby hamishcunningham » Fri Apr 20, 2018 8:41 am

hi folks!

Am I right in thinking that when debugging with GDB over the serial line it isn't possible to step through code?
Or am I missing some compiler flag?

I can get a backtrace, but when I try "info locals" or "step" it complains about missing info...

Output below; I'm running ESP IDF f586f5e from Ubuntu 12.04 with a C++ build that includes
the flags "-Og -ggdb"...

I've watched Neil Kolban's video https://www.youtube.com/watch?v=p63VEYS7ZUw (Thanks Neil!)
and only difference I see with his output is that my backtrace starts with an undefined location:
#0 0x400014fd in ?? ()
whereas I think his has a decoded address... Perhaps I'm missing something?

Code attached.

Thanks!
Hamish


[D][main.cpp:16] minapp_setup(): minapp setup
Guru Meditation Error: Core 1 panic'ed (LoadProhibited)
. Exception was unhandled.
Core 1 register dump:
PC : 0x400014fd PS : 0x00060330 A0 : 0x800daa4c A1 : 0x3ffb86e0
A2 : 0x00000000 A3 : 0xfffffffc A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x00000000 A9 : 0x3ffb86a0
A10 : 0x00000000 A11 : 0xffffffff A12 : 0x00000004 A13 : 0x00000001
A14 : 0x3ffb8820 A15 : 0x00000003 SAR : 0x00000004 EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff

Backtrace: 0x400014fd:0x3ffb86e0 0x400daa49:0x3ffb86f0 0x400d2d55:0x3ffb8a00 0x400d2785:0x3ffb8a50 0x400d27ab:0x3ffb8a70
0x400daa49: _vfprintf_r at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/vfprintf.c:1529

0x400d2d55: printf at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdio/../../../.././newlib/libc/stdio/printf.c:58

0x400d2785: minapp_setup() at /home/hamish/unfishy/minapp/main/./main.cpp:20

0x400d27ab: minapp_task(void*) at /home/hamish/unfishy/minapp/main/./main.cpp:29


Entering gdb stub now.
$T0b#e6GNU gdb (crosstool-NG crosstool-ng-1.22.0-80-g6c4433a) 7.10
Copyright (C) 2015 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 "--host=x86_64-build_pc-linux-gnu --target=xtensa-esp32-elf".
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 /home/hamish/unfishy/minapp/build/minapp.elf...done.
Remote debugging using /dev/ttyUSB0
0x400014fd in ?? ()
(gdb) bt
#0 0x400014fd in ?? ()
#1 0x400daa4c in _vfprintf_r (data=<optimized out>, fp=<optimized out>, fmt0=<optimized out>, ap=...) at ../../../.././newlib/libc/stdio/vfprintf.c:1529
#2 0x400d2d58 in printf (fmt=0x3f402da8 "%s") at ../../../.././newlib/libc/stdio/printf.c:58
#3 0x400d2788 in minapp_setup () at /home/hamish/unfishy/minapp/main/./main.cpp:20
#4 0x400d27ae in minapp_task (pvParameter=0x0) at /home/hamish/unfishy/minapp/main/./main.cpp:29
(gdb) info locals
No symbol table info available.
(gdb) step
Cannot find bounds of current function
(gdb)
Attachments
main.cpp
(1005 Bytes) Downloaded 955 times

User avatar
kolban
Posts: 1683
Joined: Mon Nov 16, 2015 4:43 pm
Location: Texas, USA

Re: Can you step through code with GDB over UART? ("No symbol table")

Postby kolban » Sat Apr 21, 2018 4:49 am

Howdy Hamish,
This is about the best docs on GDB stub I have seen:

http://esp-idf.readthedocs.io/en/latest ... or-gdbstub

As that doc says, you can read memory and variables, look at stack frames and otherwise interrogate the memory state of a crashed application. But ... that's it. If you need to step through your executing code then my belief is that the JTAG functions are what you will want to investigate.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32

hamishcunningham
Posts: 11
Joined: Mon Jun 05, 2017 7:50 pm

Re: Can you step through code with GDB over UART? ("No symbol table")

Postby hamishcunningham » Sun Apr 22, 2018 7:58 pm

Thanks Neil!

Who is online

Users browsing this forum: No registered users and 101 guests