Debug issues on Linux + Eclipse Kepler + OpenOCD
Posted: Fri May 02, 2014 10:57 am
Hello everybody.
I've just noviced in ChibiOS, so, maybe issue is in me, but not in software, but I faced some problems and questions.
After few days I finally can debug ChibiOS with threads, displayed in debugger space.
I made the following configuration (redundant in some places):



Also I installed ChibiOS debug plugin, extracted from ChibiStudio_Preview5 installation.
So, now I have the following debug space:

As you can see, there are no threads names in main Debug tab, but in ChibiOS/RT debug plugin tab they are named.
Also threads names are shown by GDB on console:
If I change eclipse debug configuration to that:


In some specific conditions (will be described below) I can get correct view of threads in main Debug tab, but, as described in http://chibios.org/dokuwiki/doku.php?id=chibios:community:setup:openocd_chibios ChibiOS debug plugin won't work (List of threads are from previous refresh, with Legacy GDB Hardware Debugging Launcher).

GDB (DSF) Hardware Debugging Launcher can work with correctly displayed threads only after running Legacy GDB Hardware Debugging Launcher. It is still working until computer rebooted or falls to sleep. Detaching target from power source (usb port), restarting OpenOCD or Eclipse does not affect it.
So, after such long preamble, below are the questions:
1. What else should I do to make Legacy GDB Hardware Debugging Launcher display threads names in main Debug tab?
2. Is it possible to make GDB (DSF) Hardware Debugging Launcher work without running Legacy GDB Hardware Debugging Launcher as a kickstarter?
3. Is it possible to make any of them work correctly with connection to OpenOCD via pipe, not with TCP connection?
4. Does the ChibiOS/RT debug plugin exist anywhere else except ChibiStudio installation in precompiled state?
5. Is there any option to make ChibiOS/RT debug plugin run with GDB (DSF) Hardware Debugging Launcher?
Thank you in advance.
I've just noviced in ChibiOS, so, maybe issue is in me, but not in software, but I faced some problems and questions.
After few days I finally can debug ChibiOS with threads, displayed in debugger space.
I made the following configuration (redundant in some places):



Also I installed ChibiOS debug plugin, extracted from ChibiStudio_Preview5 installation.
So, now I have the following debug space:

As you can see, there are no threads names in main Debug tab, but in ChibiOS/RT debug plugin tab they are named.
Also threads names are shown by GDB on console:
Code: Select all
ail@HP:~/workspace/Geometry-RTOS/Debug$ arm-none-eabi-gdb -ex "target extend localhost:3333" -ex "monitor reset halt" -ex "set remote hardware-breakpoint-limit 6" -ex "set remote hardware-watchpoint-limit 4" -ex "file ./Geometry-RTOS.elf" -ex "monitor reset halt" -ex "tbreak main.cpp:434" -ex "continue" -ex "info threads"
GNU gdb (7.6.50.20131218-0ubuntu1+1) 7.6.50.20131218-cvs
Copyright (C) 2013 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-linux-gnu --target=arm-none-eabi".
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".
Remote debugging using localhost:3333
0x08001a0c in ?? ()
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000b20 msp: 0x20000400
A program is being debugged already.
Are you sure you want to change the file? (y or n) y
Reading symbols from ./Geometry-RTOS.elf...done.
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08000b20 msp: 0x20000400
No source file named main.cpp.
Make breakpoint pending on future shared library load? (y or [n]) y
Temporary breakpoint 1 (main.cpp:434) pending.
Continuing.
^C
Program received signal SIGINT, Interrupt.
_idle_thread (p=0x0) at /home/ail/workspace/CHIBIOS/os/kernel/src/chsys.c:61
61 }
[New Thread 536876808]
[New Thread 536877272]
[New Thread 536874736]
[New Thread 536875040]
[New Thread 536875472]
[New Thread 536875904]
[New Thread 536876336]
Id Target Id Frame
8 Thread 536876336 (transmitter : : SLEEPING) chSchGoSleepS (newstate=6 '\006')
at /home/ail/workspace/CHIBIOS/os/kernel/src/chschd.c:122
7 Thread 536875904 (transmitter : : SLEEPING) chSchGoSleepS (newstate=6 '\006')
at /home/ail/workspace/CHIBIOS/os/kernel/src/chschd.c:122
6 Thread 536875472 (receiver : : WTOREVT) chSchGoSleepS (newstate=8 '\b')
at /home/ail/workspace/CHIBIOS/os/kernel/src/chschd.c:122
5 Thread 536875040 (receiver : : WTOREVT) chSchGoSleepS (newstate=8 '\b')
at /home/ail/workspace/CHIBIOS/os/kernel/src/chschd.c:122
4 Thread 536874736 (blinker : : SLEEPING) chSchGoSleepS (newstate=6 '\006')
at /home/ail/workspace/CHIBIOS/os/kernel/src/chschd.c:122
3 Thread 536877272 (No Name : : SUSPENDED) _port_thread_start ()
at /home/ail/workspace/CHIBIOS/os/ports/GCC/ARMCMx/chcore_v7m.c:252
2 Thread 536876808 (main : : SLEEPING) chSchGoSleepS (newstate=6 '\006')
at /home/ail/workspace/CHIBIOS/os/kernel/src/chschd.c:122
* 1 Thread 536876936 (idle : : CURRENT) _idle_thread (p=0x0) at /home/ail/workspace/CHIBIOS/os/kernel/src/chsys.c:61
(gdb) quit
If I change eclipse debug configuration to that:


In some specific conditions (will be described below) I can get correct view of threads in main Debug tab, but, as described in http://chibios.org/dokuwiki/doku.php?id=chibios:community:setup:openocd_chibios ChibiOS debug plugin won't work (List of threads are from previous refresh, with Legacy GDB Hardware Debugging Launcher).

GDB (DSF) Hardware Debugging Launcher can work with correctly displayed threads only after running Legacy GDB Hardware Debugging Launcher. It is still working until computer rebooted or falls to sleep. Detaching target from power source (usb port), restarting OpenOCD or Eclipse does not affect it.
So, after such long preamble, below are the questions:
1. What else should I do to make Legacy GDB Hardware Debugging Launcher display threads names in main Debug tab?
2. Is it possible to make GDB (DSF) Hardware Debugging Launcher work without running Legacy GDB Hardware Debugging Launcher as a kickstarter?
3. Is it possible to make any of them work correctly with connection to OpenOCD via pipe, not with TCP connection?
4. Does the ChibiOS/RT debug plugin exist anywhere else except ChibiStudio installation in precompiled state?
5. Is there any option to make ChibiOS/RT debug plugin run with GDB (DSF) Hardware Debugging Launcher?
Thank you in advance.