aboutsummaryrefslogtreecommitdiff
path: root/lldb/test/API/python_api
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2021-01-21 12:32:07 -0800
committerJim Ingham <jingham@apple.com>2021-01-25 12:53:37 -0800
commitf05dc40c31d1883b46b8bb60547087db2f4c03e3 (patch)
tree98d45da2881d85e3f9f1b102a4855c07ed40597a /lldb/test/API/python_api
parent0f0462cacf34aa88ae71a13c4199c1b1e70f3ee6 (diff)
downloadllvm-f05dc40c31d1883b46b8bb60547087db2f4c03e3.zip
llvm-f05dc40c31d1883b46b8bb60547087db2f4c03e3.tar.gz
llvm-f05dc40c31d1883b46b8bb60547087db2f4c03e3.tar.bz2
Fix SBDebugger::CreateTargetWithFileAndArch to accept LLDB_ARCH_DEFAULT.
The API docs in SBDebugger.i claim this should work but it doesn't. This should fix it. Differential Revision: https://reviews.llvm.org/D95164
Diffstat (limited to 'lldb/test/API/python_api')
-rw-r--r--lldb/test/API/python_api/target/TestTargetAPI.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/lldb/test/API/python_api/target/TestTargetAPI.py b/lldb/test/API/python_api/target/TestTargetAPI.py
index f058a0a..9501bdb 100644
--- a/lldb/test/API/python_api/target/TestTargetAPI.py
+++ b/lldb/test/API/python_api/target/TestTargetAPI.py
@@ -476,3 +476,15 @@ class TargetAPITestCase(TestBase):
desc2 = get_description(symbol2)
self.assertTrue(desc1 and desc2 and desc1 == desc2,
"The two addresses should resolve to the same symbol")
+ def test_default_arch(self):
+ """ Test the other two target create methods using LLDB_ARCH_DEFAULT. """
+ self.build()
+ exe = self.getBuildArtifact("a.out")
+ target = self.dbg.CreateTargetWithFileAndArch(exe, lldb.LLDB_ARCH_DEFAULT)
+ self.assertTrue(target.IsValid(), "Default arch made a valid target.")
+ # This should also work with the target's triple:
+ target2 = self.dbg.CreateTargetWithFileAndArch(exe, target.GetTriple())
+ self.assertTrue(target2.IsValid(), "Round trip with triple works")
+ # And this triple should work for the FileAndTriple API:
+ target3 = self.dbg.CreateTargetWithFileAndTargetTriple(exe, target.GetTriple())
+ self.assertTrue(target3.IsValid())