aboutsummaryrefslogtreecommitdiff
path: root/lldb/tools/debugserver/source/debugserver.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2022-05-11 15:10:16 -0700
committerJim Ingham <jingham@apple.com>2022-05-18 10:16:11 -0700
commitbff4673b41781ec5bff6b96b52cf321d2271726c (patch)
tree4a259e5663ec63d18d551c8eaad64b2848702c33 /lldb/tools/debugserver/source/debugserver.cpp
parentececce1b5ec1a83434568591e4c18ac79e4f3631 (diff)
downloadllvm-bff4673b41781ec5bff6b96b52cf321d2271726c.zip
llvm-bff4673b41781ec5bff6b96b52cf321d2271726c.tar.gz
llvm-bff4673b41781ec5bff6b96b52cf321d2271726c.tar.bz2
Add a darwin platform setting to specify which exceptions debugserver
should not receive as exceptions (some will get converted to BSD signals instead). This is really the only stable way to ensure that a Mach exception gets converted to it's equivalent BSD signal. For programs that rely on BSD signal handlers, this has to happen or you can't even get the program to invoke the signal handler when under the debugger. This builds on a previous solution to this problem which required you start debugserver with the -U flag. This was not very discoverable and required lldb be the one to launch debugserver, which is not always the case. Differential Revision: https://reviews.llvm.org/D125434
Diffstat (limited to 'lldb/tools/debugserver/source/debugserver.cpp')
-rw-r--r--lldb/tools/debugserver/source/debugserver.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/tools/debugserver/source/debugserver.cpp b/lldb/tools/debugserver/source/debugserver.cpp
index 8719871..cbff6ac 100644
--- a/lldb/tools/debugserver/source/debugserver.cpp
+++ b/lldb/tools/debugserver/source/debugserver.cpp
@@ -368,7 +368,7 @@ RNBRunLoopMode RNBRunLoopLaunchAttaching(RNBRemote *remote,
DNBLogThreadedIf(LOG_RNB_MINIMAL, "%s Attaching to pid %i...", __FUNCTION__,
attach_pid);
char err_str[1024];
- pid = DNBProcessAttach(attach_pid, NULL, ctx.GetUnmaskSignals(), err_str,
+ pid = DNBProcessAttach(attach_pid, NULL, ctx.GetIgnoredExceptions(), err_str,
sizeof(err_str));
g_pid = pid;
@@ -1275,7 +1275,7 @@ int main(int argc, char *argv[]) {
break;
case 'U':
- ctx.SetUnmaskSignals(true);
+ ctx.AddDefaultIgnoredExceptions();
break;
case '2':
@@ -1574,7 +1574,7 @@ int main(int argc, char *argv[]) {
RNBLogSTDOUT("Attaching to process %s...\n", attach_pid_name.c_str());
nub_process_t pid = DNBProcessAttachByName(
- attach_pid_name.c_str(), timeout_ptr, ctx.GetUnmaskSignals(),
+ attach_pid_name.c_str(), timeout_ptr, ctx.GetIgnoredExceptions(),
err_str, sizeof(err_str));
g_pid = pid;
if (pid == INVALID_NUB_PROCESS) {