JDevlieghere created this revision.
JDevlieghere added reviewers: labath, friss, aprantl.
Herald added a project: LLDB.
Pass the DSYMUTIL and SDKROOT variables on the command line instead of the
environment. This makes it easier to reproduce the make invocation during
development.
Repository:
rLLDB LLDB
https://reviews.llvm.org/D68812
Files:
lldb/packages/Python/lldbsuite/test/plugins/builder_base.py
Index: lldb/packages/Python/lldbsuite/test/plugins/builder_base.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/plugins/builder_base.py
+++ lldb/packages/Python/lldbsuite/test/plugins/builder_base.py
@@ -104,6 +104,23 @@
else:
return ""
+def getDsymutilSpec():
+ """
+ Helper function to return the key-value string to specify the dsymutil
+ used for the make system.
+ """
+ if "DSYMUTIL" in os.environ:
+ return "DSYMUTIL={}".format(os.environ["DSYMUTIL"])
+ return "";
+
+def getSDKRootSpec():
+ """
+ Helper function to return the key-value string to specify the SDK root
+ used for the make system.
+ """
+ if "SDKROOT" in os.environ:
+ return "SDKROOT={}".format(os.environ["SDKROOT"])
+ return "";
def getCmdLine(d):
"""
@@ -145,8 +162,13 @@
testname=None):
"""Build the binaries the default way."""
commands = []
- commands.append(getMake(testdir, testname) + ["all",
getArchSpec(architecture),
- getCCSpec(compiler), getCmdLine(dictionary)])
+ commands.append(getMake(testdir, testname) +
+ ["all",
+ getArchSpec(architecture),
+ getCCSpec(compiler),
+ getDsymutilSpec(),
+ getSDKRootSpec(),
+ getCmdLine(dictionary)])
runBuildCommands(commands, sender=sender)
@@ -164,8 +186,12 @@
"""Build the binaries with dwarf debug info."""
commands = []
commands.append(getMake(testdir, testname) +
- ["MAKE_DSYM=NO", getArchSpec(architecture),
- getCCSpec(compiler), getCmdLine(dictionary)])
+ ["MAKE_DSYM=NO",
+ getArchSpec(architecture),
+ getCCSpec(compiler),
+ getDsymutilSpec(),
+ getSDKRootSpec(),
+ getCmdLine(dictionary)])
runBuildCommands(commands, sender=sender)
# True signifies that we can handle building dwarf.
@@ -182,9 +208,12 @@
"""Build the binaries with dwarf debug info."""
commands = []
commands.append(getMake(testdir, testname) +
- ["MAKE_DSYM=NO", "MAKE_DWO=YES",
+ ["MAKE_DSYM=NO",
+ "MAKE_DWO=YES",
getArchSpec(architecture),
getCCSpec(compiler),
+ getDsymutilSpec(),
+ getSDKRootSpec(),
getCmdLine(dictionary)])
runBuildCommands(commands, sender=sender)
@@ -206,6 +235,8 @@
"MAKE_GMODULES=YES",
getArchSpec(architecture),
getCCSpec(compiler),
+ getDsymutilSpec(),
+ getSDKRootSpec(),
getCmdLine(dictionary)])
lldbtest.system(commands, sender=sender)
Index: lldb/packages/Python/lldbsuite/test/plugins/builder_base.py
===================================================================
--- lldb/packages/Python/lldbsuite/test/plugins/builder_base.py
+++ lldb/packages/Python/lldbsuite/test/plugins/builder_base.py
@@ -104,6 +104,23 @@
else:
return ""
+def getDsymutilSpec():
+ """
+ Helper function to return the key-value string to specify the dsymutil
+ used for the make system.
+ """
+ if "DSYMUTIL" in os.environ:
+ return "DSYMUTIL={}".format(os.environ["DSYMUTIL"])
+ return "";
+
+def getSDKRootSpec():
+ """
+ Helper function to return the key-value string to specify the SDK root
+ used for the make system.
+ """
+ if "SDKROOT" in os.environ:
+ return "SDKROOT={}".format(os.environ["SDKROOT"])
+ return "";
def getCmdLine(d):
"""
@@ -145,8 +162,13 @@
testname=None):
"""Build the binaries the default way."""
commands = []
- commands.append(getMake(testdir, testname) + ["all", getArchSpec(architecture),
- getCCSpec(compiler), getCmdLine(dictionary)])
+ commands.append(getMake(testdir, testname) +
+ ["all",
+ getArchSpec(architecture),
+ getCCSpec(compiler),
+ getDsymutilSpec(),
+ getSDKRootSpec(),
+ getCmdLine(dictionary)])
runBuildCommands(commands, sender=sender)
@@ -164,8 +186,12 @@
"""Build the binaries with dwarf debug info."""
commands = []
commands.append(getMake(testdir, testname) +
- ["MAKE_DSYM=NO", getArchSpec(architecture),
- getCCSpec(compiler), getCmdLine(dictionary)])
+ ["MAKE_DSYM=NO",
+ getArchSpec(architecture),
+ getCCSpec(compiler),
+ getDsymutilSpec(),
+ getSDKRootSpec(),
+ getCmdLine(dictionary)])
runBuildCommands(commands, sender=sender)
# True signifies that we can handle building dwarf.
@@ -182,9 +208,12 @@
"""Build the binaries with dwarf debug info."""
commands = []
commands.append(getMake(testdir, testname) +
- ["MAKE_DSYM=NO", "MAKE_DWO=YES",
+ ["MAKE_DSYM=NO",
+ "MAKE_DWO=YES",
getArchSpec(architecture),
getCCSpec(compiler),
+ getDsymutilSpec(),
+ getSDKRootSpec(),
getCmdLine(dictionary)])
runBuildCommands(commands, sender=sender)
@@ -206,6 +235,8 @@
"MAKE_GMODULES=YES",
getArchSpec(architecture),
getCCSpec(compiler),
+ getDsymutilSpec(),
+ getSDKRootSpec(),
getCmdLine(dictionary)])
lldbtest.system(commands, sender=sender)
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits