eclipse-threadx / threadx

Eclipse ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications.
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/threadx/index.md
MIT License
2.8k stars 768 forks source link

debugging demo_threadx on WSL2 #317

Closed mendez23 closed 7 months ago

mendez23 commented 7 months ago

Hello!

On WSL2, threadx sample program demo_threadx compiles and runs ok. However I'm unable to debug the program -- after setting breakpoint and running the program, the IDE notifies that "Exception has occurred. User defined signal 1" and stops at line 403 sigsuspend(&_tx_linux_thread_wait_mask); in void _tx_linux_thread_suspend_handler(int sig) tx_initialize_low_level.c

If continued, the program runs few steps and then stops again..

  1. Is there an explanation to this behavior?
  2. Is there a recommended workaround so debug session can continue?

Thanks in advance!

TiejunMS commented 7 months ago

You can use following gdb command to bypass the signals used by ThreadX for Linux port.

handle SIGUSR1 noprint
handle SIGUSR2 noprint
handle SIG32 noprint

Those signals are used to suspend and resume native pthread.

mendez23 commented 7 months ago

@TiejunMS it works; thank you!