Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instruction to suppress SIGUSR1 in Posix with LLDB debugger #1245

Merged
merged 1 commit into from
Feb 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions portable/ThirdParty/GCC/Posix/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
* stdio (printf() and friends) should be called from a single task
* only or serialized with a FreeRTOS primitive such as a binary
* semaphore or mutex.
*
* Note: When using LLDB (the default debugger on macOS) with this port,
* suppress SIGUSR1 to prevent debugger interference. This can be
* done by adding the following line to ~/.lldbinit:
* `process handle SIGUSR1 -n true -p true -s false`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This still does not work for me. I had to set both PASS and STOP to false. NOTIFY had no effect for me

process handle SIGUSR1 -p false -s false
> echo 'process handle SIGUSR1 -n true -p true -s false' > ~/.lldbinit
> lldb build/freertos_posix_example
NAME         PASS     STOP     NOTIFY
===========  =======  =======  =======
SIGUSR1      true     false    true
(lldb) target create "build/freertos_posix_example"
Current executable set to '/Users/johnboiles/Developer/repos/FreeRTOS/freertos-pr1224/build/freertos_posix_example' (arm64).
(lldb) pro la
Process 92245 launched: '/Users/johnboiles/Developer/repos/FreeRTOS/freertos-pr1224/build/freertos_posix_example' (arm64)
Starting FreeRTOS scheduler
FreeRTOS scheduler started
Task Done, ending scheduler
Process 92245 stopped and restarted: thread 1 received signal: SIGUSR1
Process 92245 exited with status = 30 (0x0000001e) Terminated due to signal 30
(lldb) ^D
> echo 'process handle SIGUSR1 -p false -s false' > ~/.lldbinit
> lldb build/freertos_posix_example
NAME         PASS     STOP     NOTIFY
===========  =======  =======  =======
SIGUSR1      false    false    not set
(lldb) target create "build/freertos_posix_example"
Current executable set to '/Users/johnboiles/Developer/repos/FreeRTOS/freertos-pr1224/build/freertos_posix_example' (arm64).
(lldb) pro la
Process 24334 launched: '/Users/johnboiles/Developer/repos/FreeRTOS/freertos-pr1224/build/freertos_posix_example' (arm64)
Starting FreeRTOS scheduler
FreeRTOS scheduler started
Task Done, ending scheduler
Process 24334 stopped and restarted: thread 1 received signal: SIGUSR1
FreeRTOS scheduler exited
Process 24334 exited with status = 0 (0x00000000)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, yes. That seems right! Will update that, thank you.

*----------------------------------------------------------*/
#ifdef __linux__
#define _GNU_SOURCE
Expand Down