From d0e3f5ca98f3d7d3646c5ce57af39d38e92229de Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 3 Jul 2020 18:00:34 +0200 Subject: Fix debugging C++ on iOS devices Partially revert 7f958700a09f09ac124b20d23236ede472b58d87 for 'remote-ios'. The original commit changed the way attaching to a remote server or process works, attempting to make it work with lldb-server on a remote linux device. That breaks connecting to the debugging server on iOS devices. Fixes: QTCREATORBUG-23995 Change-Id: I7a793fa73a564a4ef19cf82e13c2ad50d4247ee3 Reviewed-by: Christian Stenger --- share/qtcreator/debugger/lldbbridge.py | 45 +++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 20 deletions(-) (limited to 'share') diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py index e3d9196345..3350318fbd 100644 --- a/share/qtcreator/debugger/lldbbridge.py +++ b/share/qtcreator/debugger/lldbbridge.py @@ -890,16 +890,15 @@ class Dumper(DumperBase): if (self.startMode_ == DebuggerStartMode.AttachToRemoteServer or self.startMode_ == DebuggerStartMode.AttachToRemoteProcess): + if self.platform_ != 'remote-ios': + # lldb-server expected on remote + remote_channel = 'connect://' + self.remoteChannel_ + connect_options = lldb.SBPlatformConnectOptions(remote_channel) - - remote_channel = 'connect://' + self.remoteChannel_ - connect_options = lldb.SBPlatformConnectOptions(remote_channel) - - res = self.target.GetPlatform().ConnectRemote(connect_options) - DumperBase.warn("CONNECT: %s %s %s" % (res, - self.target.GetPlatform().GetName(), - self.target.GetPlatform().IsConnected())) - + res = self.target.GetPlatform().ConnectRemote(connect_options) + DumperBase.warn("CONNECT: %s %s %s" % (res, + self.target.GetPlatform().GetName(), + self.target.GetPlatform().IsConnected())) broadcaster = self.target.GetBroadcaster() listener = self.debugger.GetListener() @@ -947,17 +946,23 @@ class Dumper(DumperBase): elif (self.startMode_ == DebuggerStartMode.AttachToRemoteServer or self.startMode_ == DebuggerStartMode.AttachToRemoteProcess): - f = lldb.SBFileSpec() - f.SetFilename(self.executable_) - - launchInfo = lldb.SBLaunchInfo(self.processArgs_) - #launchInfo.SetWorkingDirectory(self.workingDirectory_) - launchInfo.SetWorkingDirectory('/tmp') - launchInfo.SetExecutableFile(f, True) - - DumperBase.warn("TARGET: %s" % self.target) - self.process = self.target.Launch(launchInfo, error) - DumperBase.warn("PROCESS: %s" % self.process) + if self.platform_ == 'remote-ios': + self.process = self.target.ConnectRemote( + self.debugger.GetListener(), + self.remoteChannel_, None, error) + else: + # lldb-server expected + f = lldb.SBFileSpec() + f.SetFilename(self.executable_) + + launchInfo = lldb.SBLaunchInfo(self.processArgs_) + #launchInfo.SetWorkingDirectory(self.workingDirectory_) + launchInfo.SetWorkingDirectory('/tmp') + launchInfo.SetExecutableFile(f, True) + + DumperBase.warn("TARGET: %s" % self.target) + self.process = self.target.Launch(launchInfo, error) + DumperBase.warn("PROCESS: %s" % self.process) if not error.Success(): self.report(self.describeError(error)) -- cgit v1.2.3