Commit 8b99e553 authored by hjk's avatar hjk
Browse files

Debugger: Add facility to run dumper test with DYLD_IMAGE_SUFFIX



Change-Id: I5f79436b61a3a04de9b7b669bece2204ac858edb
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 69541442
......@@ -1556,10 +1556,13 @@ def testit():
db.setupInferior({'cmd':'setupInferior','executable':sys.argv[2],'token':1})
launchInfo = lldb.SBLaunchInfo([])
launchInfo.SetWorkingDirectory(os.getcwd())
environmentList = [key + "=" + value for key,value in os.environ.items()]
launchInfo.SetEnvironmentEntries(environmentList, False)
error = lldb.SBError()
listener = db.debugger.GetListener()
db.process = db.target.Launch(listener, None, None, None, None,
None, None, 0, False, error)
db.process = db.target.Launch(launchInfo, error)
stoppedThread = db.firstStoppedThread()
if stoppedThread:
......@@ -1569,6 +1572,7 @@ def testit():
ns = db.qtNamespace()
db.reportVariables()
db.report("@NS@%s@" % ns)
#db.report("ENV=%s" % os.environ.items())
#db.report("DUMPER=%s" % db.qqDumpers)
if __name__ == "__main__":
......
......@@ -546,6 +546,7 @@ struct LldbVersion : VersionBase
struct ForceC {};
struct EigenProfile {};
struct UseDebugImage {};
struct CoreProfile {};
struct CorePrivateProfile {};
......@@ -557,7 +558,7 @@ struct DataBase
DataBase()
: useQt(false), useQHash(false),
forceC(false), engines(DumpTestGdbEngine | DumpTestCdbEngine | DumpTestLldbEngine),
glibcxxDebug(false)
glibcxxDebug(false), useDebugImage(false)
{}
mutable bool useQt;
......@@ -565,6 +566,7 @@ struct DataBase
mutable bool forceC;
mutable int engines;
mutable bool glibcxxDebug;
mutable bool useDebugImage;
mutable GdbVersion neededGdbVersion;
mutable LldbVersion neededLldbVersion;
mutable QtVersion neededQtVersion;
......@@ -632,6 +634,12 @@ public:
return *this;
}
const Data &operator%(const UseDebugImage &) const
{
useDebugImage = true;
return *this;
}
const Data &operator%(const CoreProfile &) const
{
profileExtra +=
......@@ -1122,8 +1130,12 @@ void tst_Dumpers::dumper()
t->input = cmds;
QProcessEnvironment env = m_env;
if (data.useDebugImage)
env.insert(QLatin1String("DYLD_IMAGE_SUFFIX"), QLatin1String("_debug"));
QProcess debugger;
debugger.setProcessEnvironment(m_env);
debugger.setProcessEnvironment(env);
debugger.setWorkingDirectory(t->buildPath);
debugger.start(QString::fromLatin1(exe), args);
QVERIFY(debugger.waitForStarted());
......@@ -3771,8 +3783,8 @@ void tst_Dumpers::dumper_data()
"var.setValue(ha);\n"
"QHostAddress ha1 = var.value<QHostAddress>();\n"
"unused(&ha1);\n")
% CoreProfile()
% Profile("QT += network\n")
% NetworkProfile()
% UseDebugImage()
% Check("ha", "\"127.0.0.1\"", "@QHostAddress")
% Check("ha.a", "2130706433", "@quint32")
% Check("ha.ipString", "\"127.0.0.1\"", "@QString")
......
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