Skip to content

Commit deda5f2

Browse files
committed
Merge pull request #14296 from JuliaLang/yyc/trap-debugger
Use SIGTRAP to raise debugger on unix
2 parents 8764e63 + 4b3a016 commit deda5f2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/signals-unix.c

+3
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,9 @@ void jl_install_default_signal_handlers(void)
474474
if (signal(SIGPIPE, SIG_IGN) == SIG_ERR) {
475475
jl_error("fatal error: Couldn't set SIGPIPE");
476476
}
477+
if (signal(SIGTRAP, SIG_IGN) == SIG_ERR) {
478+
jl_error("fatal error: Couldn't set SIGTRAP");
479+
}
477480

478481
allocate_segv_handler();
479482

src/sys.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ JL_DLLEXPORT void jl_raise_debugger(void)
720720
if (IsDebuggerPresent() == 1)
721721
DebugBreak();
722722
#else
723-
kill(getpid(), SIGINT);
723+
raise(SIGTRAP);
724724
#endif // _OS_WINDOWS_
725725
}
726726

0 commit comments

Comments
 (0)