Commit e9237c20 authored by hjk's avatar hjk
Browse files

Debugger: Work on LLDB auto-test on Linux



Write the full command to a temporary file for easier re-use.
Un-ignore the first stop, this does not seem to be needed in
the new async setup.

In some cases LLDB is not able to extract the even the top most
frame of the stopped thread (happened 2 out of 100 runs of the
QDateTime dumper). It's unclear why. For now just report the fact.

Change-Id: I76a63bc288f1ae6f5bd9b9604a47f051912b93d7
Reviewed-by: default avatarhjk <hjk@theqtcompany.com>
parent 885c8f8f
......@@ -1764,10 +1764,6 @@ class Tester(Dumper):
savedReport = self.report
self.report = lambda stuff: 0
ignoreStops = 1
if sys.platform == "darwin":
ignoreStops = 0
error = lldb.SBError()
launchInfo = lldb.SBLaunchInfo([])
launchInfo.SetWorkingDirectory(os.getcwd())
......@@ -1792,12 +1788,23 @@ class Tester(Dumper):
#warn('event={type="%s",data="%s",msg="%s",flavor="%s",state="%s"}'
# % (event.GetType(), out.GetData(), msg, flavor, state))
state = lldb.SBProcess.GetStateFromEvent(event)
if state == lldb.eStateExited:
if state == lldb.eStateExited: # 10
break
if state == lldb.eStateStopped:
if ignoreStops == 0:
if state == lldb.eStateStopped: # 5
stoppedThread = self.firstStoppedThread()
if stoppedThread is None:
warn("NO STOPPED THREAD FOUND")
for i in xrange(0, self.process.GetNumThreads()):
thread = self.process.GetThreadAtIndex(i)
reason = thread.GetStopReason()
warn("THREAD: %s REASON: %s" % (thread, reason))
continue
try:
frame = stoppedThread.GetFrameAtIndex(0)
break
ignoreStops -= 1
except:
warn("NO FRAME FOUND FOR THREAD %s" % stoppedThread)
else:
warn('TIMEOUT')
......@@ -1810,6 +1817,12 @@ class Tester(Dumper):
# This seems highly fragile and depending on the "No-ops" in the
# event handling above.
self.process.SetSelectedThread(stoppedThread)
frame = stoppedThread.GetFrameAtIndex(0)
#file = fileName(frame.line_entry.file)
#line = frame.line_entry.line
#warn('LOCATION={file="%s",line="%s",addr="%s"}'
# % (file, line, frame.pc))
self.report = savedReport
self.reportVariables()
self.report("@NS@%s@" % self.qtNamespace())
......
......@@ -1263,7 +1263,11 @@ void tst_Dumpers::dumper()
<< QString::fromUtf8(m_debuggerBinary)
<< t->buildPath + QLatin1String("/doit")
<< QString::fromUtf8(expanded);
qDebug() << exe.constData() << ' ' << qPrintable(args.join(QLatin1String(" ")));
QFile fullLldb(t->buildPath + QLatin1String("/lldbcommand.txt"));
fullLldb.setPermissions(QFile::ReadOwner|QFile::WriteOwner|QFile::ExeOwner|QFile::ReadGroup|QFile::ReadOther);
fullLldb.open(QIODevice::WriteOnly);
fullLldb.write(exe + ' ' + args.join(QLatin1String(" ")).toUtf8());
fullLldb.close();
}
t->input = cmds;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment