diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index 8a97e642970..bef97482af6 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -870,6 +870,7 @@ class Dumper(DumperBase): self.startMode_ = args.get('startmode', 1) self.breakOnMain_ = args.get('breakonmain', 0) self.useTerminal_ = args.get('useterminal', 0) + self.firstStop_ = True pargs = self.hexdecode(args.get('processargs', '')) self.processArgs_ = pargs.split('\0') if len(pargs) else [] self.environment_ = args.get('environment', []) @@ -930,6 +931,8 @@ class Dumper(DumperBase): if self.startMode_ == DebuggerStartMode.AttachExternal: attach_info = lldb.SBAttachInfo(self.attachPid_) + if self.breakOnMain_: + self.createBreakpointAtMain() self.process = self.target.Attach(attach_info, error) if not error.Success(): self.reportState('enginerunfailed') @@ -1474,6 +1477,12 @@ class Dumper(DumperBase): self.reportState("inferiorstopok") else: self.reportState("stopped") + if self.firstStop_: + self.firstStop_ = False + if self.useTerminal_: + # When using a terminal, the process will be interrupted on startup. + # We therefore need to continue it here. + self.process.Continue() else: self.reportState(self.stateName(state)) diff --git a/share/qtcreator/debugger/utils.py b/share/qtcreator/debugger/utils.py index fe2e558e711..8019d1e530a 100644 --- a/share/qtcreator/debugger/utils.py +++ b/share/qtcreator/debugger/utils.py @@ -4,6 +4,7 @@ # Debugger start modes. Keep in sync with DebuggerStartMode in debuggerconstants.h +# MT: Why does this not match (anymore?) to debuggerconstants.h : DebuggerStartMode ? class DebuggerStartMode(): ( NoStartMode, diff --git a/src/plugins/debugger/lldb/lldbengine.cpp b/src/plugins/debugger/lldb/lldbengine.cpp index 020c9e7758b..5de46911576 100644 --- a/src/plugins/debugger/lldb/lldbengine.cpp +++ b/src/plugins/debugger/lldb/lldbengine.cpp @@ -279,8 +279,8 @@ void LldbEngine::handleLldbStarted() ? QString::fromLatin1("Attaching to %1 (%2)").arg(attachedPID).arg(attachedMainThreadID) : QString::fromLatin1("Attaching to %1").arg(attachedPID); showMessage(msg, LogMisc); + cmd2.arg("startmode", DebuggerStartMode::AttachToLocalProcess); cmd2.arg("attachpid", attachedPID); - } else { cmd2.arg("startmode", rp.startMode); // it is better not to check the start mode on the python sid (as we would have to duplicate the