https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/74818
>From 32b8d4102f73f7b42792f9c817742d1eba629351 Mon Sep 17 00:00:00 2001 From: Michael Buch <michaelbuc...@gmail.com> Date: Fri, 8 Dec 2023 08:51:32 +0000 Subject: [PATCH 1/4] [lldb][test] TestLocationListLookup.py: skip expr check on unsupported platforms --- .../TestLocationListLookup.py | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py index 07f306a6ed78b..78fdaf939af1d 100644 --- a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py +++ b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py @@ -7,10 +7,7 @@ class LocationListLookupTestCase(TestBase): - @skipIf(oslist=["linux"], archs=["arm"]) - def test_loclist(self): - self.build() - + def launch(self) -> lldb.SBProcess: exe = self.getBuildArtifact("a.out") target = self.dbg.CreateTarget(exe) self.assertTrue(target, VALID_TARGET) @@ -22,6 +19,9 @@ def test_loclist(self): self.assertTrue(process.IsValid()) self.assertTrue(process.is_stopped) + return process + + def check_local_vars(self, process: lldb.SBProcess, check_expr: bool): # Find `bar` on the stack, then # make sure we can read out the local # variables (with both `frame var` and `expr`) @@ -32,5 +32,17 @@ def test_loclist(self): argv.GetDescription(strm) self.assertNotEqual(strm.GetData().find("a.out"), -1) - process.GetSelectedThread().SetSelectedFrame(f.idx) - self.expect_expr("this", result_type="Foo *") + if check_expr: + process.GetSelectedThread().SetSelectedFrame(f.idx) + self.expect_expr("this", result_type="Foo *") + + @skipIf(oslist=["linux"], archs=["arm"]) + @skipIfDarwin + def test_loclist_frame_var(self): + self.build() + self.check_local_vars(self.launch(), check_expr=False) + + @skipUnlessDarwin + def test_loclist_expr(self): + self.build() + self.check_local_vars(self.launch(), check_expr=True) >From 9f71e25c3729962da0ad9697ae077adb04e2b7f9 Mon Sep 17 00:00:00 2001 From: Michael Buch <michaelbuc...@gmail.com> Date: Fri, 8 Dec 2023 08:56:41 +0000 Subject: [PATCH 2/4] fixup! skip on windows --- .../location-list-lookup/TestLocationListLookup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py index 78fdaf939af1d..7ff8934228e2c 100644 --- a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py +++ b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py @@ -38,6 +38,7 @@ def check_local_vars(self, process: lldb.SBProcess, check_expr: bool): @skipIf(oslist=["linux"], archs=["arm"]) @skipIfDarwin + @skipIfWindows # GetDisplayFunctionName returns None def test_loclist_frame_var(self): self.build() self.check_local_vars(self.launch(), check_expr=False) >From 7e8fb51e25190a77ffcc5cb29e5aed9e0669d0fd Mon Sep 17 00:00:00 2001 From: Michael Buch <michaelbuc...@gmail.com> Date: Fri, 8 Dec 2023 08:57:10 +0000 Subject: [PATCH 3/4] fixup! format --- .../location-list-lookup/TestLocationListLookup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py index 7ff8934228e2c..7eb790e5a3066 100644 --- a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py +++ b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py @@ -38,7 +38,7 @@ def check_local_vars(self, process: lldb.SBProcess, check_expr: bool): @skipIf(oslist=["linux"], archs=["arm"]) @skipIfDarwin - @skipIfWindows # GetDisplayFunctionName returns None + @skipIfWindows # GetDisplayFunctionName returns None def test_loclist_frame_var(self): self.build() self.check_local_vars(self.launch(), check_expr=False) >From 9b2ec1eb3280a52f5a0e975efbbb5fcb4daef554 Mon Sep 17 00:00:00 2001 From: Michael Buch <michaelbuc...@gmail.com> Date: Fri, 8 Dec 2023 08:59:37 +0000 Subject: [PATCH 4/4] fixup! unskip on windows and check frame_name --- .../location-list-lookup/TestLocationListLookup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py index 7eb790e5a3066..ccee3bfde3f5d 100644 --- a/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py +++ b/lldb/test/API/functionalities/location-list-lookup/TestLocationListLookup.py @@ -26,7 +26,8 @@ def check_local_vars(self, process: lldb.SBProcess, check_expr: bool): # make sure we can read out the local # variables (with both `frame var` and `expr`) for f in process.GetSelectedThread().frames: - if f.GetDisplayFunctionName().startswith("Foo::bar"): + frame_name = f.GetDisplayFunctionName() + if frame_name is not None and frame_name.startswith("Foo::bar"): argv = f.GetValueForVariablePath("argv").GetChildAtIndex(0) strm = lldb.SBStream() argv.GetDescription(strm) @@ -38,7 +39,6 @@ def check_local_vars(self, process: lldb.SBProcess, check_expr: bool): @skipIf(oslist=["linux"], archs=["arm"]) @skipIfDarwin - @skipIfWindows # GetDisplayFunctionName returns None def test_loclist_frame_var(self): self.build() self.check_local_vars(self.launch(), check_expr=False) _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits