diff options
author | hjk <hjk@qt.io> | 2024-04-29 18:46:04 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2024-05-02 15:36:26 +0000 |
commit | d3fb3a163c97dfa3a2c9b41dbdd0307522968628 (patch) | |
tree | b2e2ce957947f88d86b1713fb08cb446eecdd914 /share/qtcreator | |
parent | 67ab041903bead454187b75e6ee5621f4854e0cb (diff) |
Debugger: Ignore stops in libart.so and other Android runtime specific places
From https://issuetracker.google.com/issues/240007217#comment17
"Some a background on the technical aspect of SEGVs:
Android Runtime (ART) uses SEGV for various internal purposes (it
triggers a SEGV and handles it without crashing the app, the app doesn't
know it happened). When the native debugger is connected, the debugger
must intercept all SEGV signals.
When running the debugger on Android API level 27 and newer, we make the
debugger skip these SEGV signals (i.e., forward them to be handled by
ART), because we know how to handle real SEGV signals inside ART. For
older Android versions (26 or older), we did not have this support, so
the debugger stops at every SEGV (i.e., it cannot know if the signal is
a real crash or an ART-internal thing)."
Arguably, this should be caught by the LLDB Android platform bits, but...
Task-number: QTCREATORBUG-30759
Task-number: QTCREATORBUG-29928
Task-number: QTCREATORBUG-30080
Change-Id: I8cabe4a0675c596a9617520aff0d62ad11321f0e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Diffstat (limited to 'share/qtcreator')
-rw-r--r-- | share/qtcreator/debugger/lldbbridge.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 7809a6a3dc..f2387ac913 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -1456,6 +1456,21 @@ class Dumper(DumperBase): if bp is not None: self.reportBreakpointUpdate(bp) + def wantAutoContinue(self, frame): + if self.platform_ != 'remote-android': + return False + funcname = frame.GetFunctionName() + if funcname and funcname.startswith('java.'): + return True + module = frame.GetModule() + filespec = module.GetPlatformFileSpec() # Not GetFileSpec + filename = filespec.GetFilename() + if filename == 'libart.so': + return True + if funcname == None and not frame.line_entry.file.IsValid() and filename == None: + return True + return False + def handleEvent(self, event): if lldb.SBBreakpoint.EventIsBreakpointEvent(event): self.handleBreakpointEvent(event) @@ -1490,8 +1505,12 @@ class Dumper(DumperBase): if state == lldb.eStateStopped: stoppedThread = self.firstStoppedThread() if stoppedThread: - #self.report("STOPPED THREAD: %s" % stoppedThread) frame = stoppedThread.GetFrameAtIndex(0) + if self.wantAutoContinue(frame): + #self.warn("AUTO CONTINUE") + error = self.process.Continue() + return + #self.report("FRAME: %s" % frame) function = frame.GetFunction() functionName = function.GetName() |