[Lldb-commits] [lldb] [lldb] [scripting bridge] 167388 chore: add api to return arch name for target (PR #168273)

via lldb-commits lldb-commits at lists.llvm.org
Sun Nov 16 12:24:27 PST 2025


================
@@ -105,6 +105,20 @@ def test_resolve_file_address(self):
         self.assertIsNotNone(data_section2)
         self.assertEqual(data_section.name, data_section2.name)
 
+    def test_get_arch_name(self):
+        d = {"EXE": "b.out"}
+        self.build(dictionary=d)
+        self.setTearDownCleanup(dictionary=d)
+        target = self.create_simple_target("b.out")
+
+        arch_name = target.arch_name
+        self.assertNotEqual(len(arch_name), 0, "Got an arch name string")
----------------
n2h9 wrote:

I think right now when performing build in tests, it does not take into account architecture from `--arch` or from `self.build`.

I assume it prepares build command in [builder.py:293](https://github.com/llvm/llvm-project/blob/main/lldb/packages/Python/lldbsuite/test/builders/builder.py#L293) which uses [builder.py::getTriple](https://github.com/llvm/llvm-project/blob/main/lldb/packages/Python/lldbsuite/test/builders/builder.py#L27) which does not take into account provided `arch` and always use arch from configuration. 


I can suggest for now to only check that `arch_name` is eq to first part of triple. 
And I could probably create a ticket to investigate / solve this issue with taking into account architecture during test build, what do you think? 


https://github.com/llvm/llvm-project/pull/168273


More information about the lldb-commits mailing list