jingham created this revision. jingham added reviewers: JDevlieghere, mib. Herald added a project: All. jingham requested review of this revision. Herald added a project: LLDB. Herald added a subscriber: lldb-commits.
EXC_SYSCALL has the same problem as EXC_BAD_INSTRUCTION and EXC_BAD_ACCESS, they all should get turned into BSD signals when forwarded to the host port, but lldb isn't allowed to do that from the outside. So the only way to get that to happen is to have debugserver not listen for them. I overlooked them when originally adding the ignored-exception setting. I added some tests to make sure we accept the ones we accept and don't accept the ones we shouldn't - because lldb needs them to operate. I didn't add an end-to-end test for EXC_SYSCALL because it's actually quite hard to get the kernel to generate this exception - most of the time is goes straight to a SIGSYS. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D151843 Files: lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py Index: lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py =================================================================== --- lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py +++ lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py @@ -30,10 +30,22 @@ "EXC_BAD_AXESS", error=True, ) - # Now set ourselves to ignore some exceptions. The test depends on ignoring EXC_BAD_ACCESS, but I passed a couple - # to make sure they parse: + # Make sure that we don't accept exceptions that lldb/debugserver need: + self.match( + "settings set platform.plugin.darwin.ignored-exceptions EXC_BREAKPOINT", + "EXC_BREAKPOINT", + error=True, + ) + # Make sure that we don't accept exceptions that lldb/debugserver need: + self.match( + "settings set platform.plugin.darwin.ignored-exceptions EXC_SOFT_SIGNAL", + "EXC_SOFT_SIGNAL", + error=True, + ) + # Now set ourselves to ignore some exceptions. The test depends on ignoring EXC_BAD_ACCESS, but I passed all the + # ones we currently accept to make sure they parse: self.runCmd( - "settings set platform.plugin.darwin.ignored-exceptions EXC_BAD_ACCESS|EXC_ARITHMETIC" + "settings set platform.plugin.darwin.ignored-exceptions EXC_BAD_ACCESS|EXC_BAD_INSTRUCTION|EXC_ARITHMETIC|EXC_RESOURCE|EXC_GUARD|EXC_SYSCALL" ) (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint( self, "Stop here to get things going", self.main_source_file Index: lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -63,7 +63,8 @@ || candidate == "EXC_BAD_INSTRUCTION" || candidate == "EXC_ARITHMETIC" || candidate == "EXC_RESOURCE" - || candidate == "EXC_GUARD")) { + || candidate == "EXC_GUARD" + || candidate == "EXC_SYSCALL")) { error.SetErrorStringWithFormat("invalid exception type: '%s'", candidate.str().c_str()); return error;
Index: lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py =================================================================== --- lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py +++ lldb/test/API/macosx/ignore_exceptions/TestIgnoredExceptions.py @@ -30,10 +30,22 @@ "EXC_BAD_AXESS", error=True, ) - # Now set ourselves to ignore some exceptions. The test depends on ignoring EXC_BAD_ACCESS, but I passed a couple - # to make sure they parse: + # Make sure that we don't accept exceptions that lldb/debugserver need: + self.match( + "settings set platform.plugin.darwin.ignored-exceptions EXC_BREAKPOINT", + "EXC_BREAKPOINT", + error=True, + ) + # Make sure that we don't accept exceptions that lldb/debugserver need: + self.match( + "settings set platform.plugin.darwin.ignored-exceptions EXC_SOFT_SIGNAL", + "EXC_SOFT_SIGNAL", + error=True, + ) + # Now set ourselves to ignore some exceptions. The test depends on ignoring EXC_BAD_ACCESS, but I passed all the + # ones we currently accept to make sure they parse: self.runCmd( - "settings set platform.plugin.darwin.ignored-exceptions EXC_BAD_ACCESS|EXC_ARITHMETIC" + "settings set platform.plugin.darwin.ignored-exceptions EXC_BAD_ACCESS|EXC_BAD_INSTRUCTION|EXC_ARITHMETIC|EXC_RESOURCE|EXC_GUARD|EXC_SYSCALL" ) (target, process, thread, bkpt) = lldbutil.run_to_source_breakpoint( self, "Stop here to get things going", self.main_source_file Index: lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp =================================================================== --- lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp +++ lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp @@ -63,7 +63,8 @@ || candidate == "EXC_BAD_INSTRUCTION" || candidate == "EXC_ARITHMETIC" || candidate == "EXC_RESOURCE" - || candidate == "EXC_GUARD")) { + || candidate == "EXC_GUARD" + || candidate == "EXC_SYSCALL")) { error.SetErrorStringWithFormat("invalid exception type: '%s'", candidate.str().c_str()); return error;
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits