使用gdb在Linux上进行FreeRTOS调试,SIGTRAP问题

时间:2019-06-13 09:33:17

标签: linux multithreading gdb freertos

我正在使用FreeRTOS开发适用于Linux和嵌入式设备的应用程序。

该应用程序运行良好,但由于遇到断点后无法恢复,调试受到严重阻碍。

这是gdb的成绩单:

(gdb) break /mnt/d/alfie/gb/monorepo/freertos/queue.c:1244
Breakpoint 2 at 0x408ebc: file /mnt/d/alfie/gb/monorepo/freertos/queue.c, line 1244.
(gdb) start
Temporary breakpoint 3 at 0x4021fd: file /mnt/d/alfie/gb/monorepo/linux/app/main.c, line 55.
Starting program: /mnt/d/alfie/gb/monorepo/linux/app/AppLinux
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".

Temporary breakpoint 3, main () at /mnt/d/alfie/gb/monorepo/linux/app/main.c:55
55          LL_INFO(1, "Starting FreeRTOS!");
(gdb) c
Continuing.
[INFO] Starting FreeRTOS! (/mnt/d/alfie/gb/monorepo/linux/app/main.c:55)
Running as PID: 20862
[New Thread 0x7ffffeaf0700 (LWP 20863)]
[New Thread 0x7ffffe2e0700 (LWP 20864)]
[New Thread 0x7ffffdad0700 (LWP 20865)]
[New Thread 0x7ffffd2c0700 (LWP 20866)]
[INFO] Scheduler starting (/mnt/d/alfie/gb/monorepo/linux/app/main.c:74)
[New Thread 0x7ffffcab0700 (LWP 20867)]
Timer Resolution for Run TimeStats is 100 ticks per second.
[New Thread 0x7ffff7ff0700 (LWP 20868)]
[Switching to Thread 0x7ffffdad0700 (LWP 20865)]

Thread 4 "AppLinux" hit Breakpoint 2, xQueueGenericReceive (xQueue=0x69c420, pvBuffer=0x0, xTicksToWait=0, xJustPeeking=0)
    at /mnt/d/alfie/gb/monorepo/freertos/queue.c:1244
1244            configASSERT( pxQueue );
(gdb) c
Continuing.

Thread 4 "AppLinux" received signal SIGTRAP, Trace/breakpoint trap.
<signal handler called>
(gdb)

此时,程序不想继续。尝试继续操作时,它将一遍又一遍地打印以下内容:

Thread 4 "AppLinux" received signal SIGTRAP, Trace/breakpoint trap.

我不确定这是线程问题(pthreads)还是FreeRTOS正在使用中断/ SIGTRAP来导致这种情况发生。

非常感谢任何帮助。

0 个答案:

没有答案
相关问题