Add a darwin platform setting to specify which exceptions debugserver
authorJim Ingham <jingham@apple.com>
Wed, 11 May 2022 22:10:16 +0000 (15:10 -0700)
committerJim Ingham <jingham@apple.com>
Wed, 18 May 2022 17:16:11 +0000 (10:16 -0700)
commitbff4673b41781ec5bff6b96b52cf321d2271726c
tree4a259e5663ec63d18d551c8eaad64b2848702c33
parentececce1b5ec1a83434568591e4c18ac79e4f3631
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
25 files changed:
lldb/include/lldb/Interpreter/OptionValueString.h
lldb/include/lldb/Target/Platform.h
lldb/include/lldb/Utility/StringExtractorGDBRemote.h
lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.h
lldb/source/Plugins/Platform/MacOSX/PlatformMacOSXProperties.td
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/source/Target/Platform.cpp
lldb/source/Utility/StringExtractorGDBRemote.cpp
lldb/test/API/macosx/ignore_exceptions/Makefile [new file with mode: 0644]
lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py [new file with mode: 0644]
lldb/test/API/macosx/ignore_exceptions/main.c [new file with mode: 0644]
lldb/tools/debugserver/source/DNB.cpp
lldb/tools/debugserver/source/DNB.h
lldb/tools/debugserver/source/MacOSX/MachException.cpp
lldb/tools/debugserver/source/MacOSX/MachException.h
lldb/tools/debugserver/source/MacOSX/MachProcess.h
lldb/tools/debugserver/source/MacOSX/MachProcess.mm
lldb/tools/debugserver/source/MacOSX/MachTask.h
lldb/tools/debugserver/source/MacOSX/MachTask.mm
lldb/tools/debugserver/source/RNBContext.cpp
lldb/tools/debugserver/source/RNBContext.h
lldb/tools/debugserver/source/RNBRemote.cpp
lldb/tools/debugserver/source/RNBRemote.h
lldb/tools/debugserver/source/debugserver.cpp