summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/qtcreator/debugger/lldbbridge.py10
-rw-r--r--tests/auto/debugger/tst_dumpers.cpp20
2 files changed, 23 insertions, 7 deletions
diff --git a/share/qtcreator/debugger/lldbbridge.py b/share/qtcreator/debugger/lldbbridge.py
index 95b53d3a50..31078f1742 100644
--- a/share/qtcreator/debugger/lldbbridge.py
+++ b/share/qtcreator/debugger/lldbbridge.py
@@ -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__":
diff --git a/tests/auto/debugger/tst_dumpers.cpp b/tests/auto/debugger/tst_dumpers.cpp
index 64604e3d86..ee37bf7051 100644
--- a/tests/auto/debugger/tst_dumpers.cpp
+++ b/tests/auto/debugger/tst_dumpers.cpp
@@ -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")