aboutsummaryrefslogtreecommitdiffstats
path: root/share/qtcreator/debugger
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-03-25 17:12:01 +0100
committerhjk <hjk@qt.io>2019-04-01 09:28:04 +0000
commit94d79ba3b5d61692e3d32962a7937068f62262df (patch)
tree6de480b6655860a05d2b4170a95b1b6bb10dd571 /share/qtcreator/debugger
parent6ad90c7daa6ec287ad1b9351bd2fc27f6b860843 (diff)
Debugger: Fix "Break on Abort" with GDB > 8.1
GDB 8.1 changed behavior when specifying breakpoints, it now tries to pattern-match function names, hitting e.g. 'Foo::abort()' for 'b ::abort'. While the API exposes a way to opt-out of the new behavior there's no way to tell when to do that other than trial-and-error. Task-number: QTBUG-73993 Change-Id: Ied2e640e65e40df6eac50117db890bd4b51d36ab Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'share/qtcreator/debugger')
-rw-r--r--share/qtcreator/debugger/gdbbridge.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/share/qtcreator/debugger/gdbbridge.py b/share/qtcreator/debugger/gdbbridge.py
index cc5961be87..f9e1eb138c 100644
--- a/share/qtcreator/debugger/gdbbridge.py
+++ b/share/qtcreator/debugger/gdbbridge.py
@@ -892,16 +892,33 @@ class Dumper(DumperBase):
def createSpecialBreakpoints(self, args):
self.specialBreakpoints = []
def newSpecial(spec):
+ # GDB < 8.1 does not have the 'qualified' parameter here,
+ # GDB >= 8.1 applies some generous pattern matching, hitting
+ # e.g. also Foo::abort() when asking for '::abort'
+ class Pre81SpecialBreakpoint(gdb.Breakpoint):
+ def __init__(self, spec):
+ super(Pre81SpecialBreakpoint, self).__init__(spec,
+ gdb.BP_BREAKPOINT, internal=True)
+ self.spec = spec
+
+ def stop(self):
+ print("Breakpoint on '%s' hit." % self.spec)
+ return True
+
class SpecialBreakpoint(gdb.Breakpoint):
def __init__(self, spec):
- super(SpecialBreakpoint, self).\
- __init__(spec, gdb.BP_BREAKPOINT, internal=True)
+ super(SpecialBreakpoint, self).__init__(spec,
+ gdb.BP_BREAKPOINT, internal=True, qualified=True)
self.spec = spec
def stop(self):
print("Breakpoint on '%s' hit." % self.spec)
return True
- return SpecialBreakpoint(spec)
+
+ try:
+ return SpecialBreakpoint(spec)
+ except:
+ return Pre81SpecialBreakpoint(spec)
# FIXME: ns is accessed too early. gdb.Breakpoint() has no
# 'rbreak' replacement, and breakpoints created with