================
@@ -0,0 +1,53 @@
+"""
+Test std::source_location summary.
+"""
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class StdSourceLocationTestCase(TestBase):
+ SHARED_BUILD_TESTCASE = False
+ TEST_WITH_PDB_DEBUG_INFO = True
+
+ def do_test(self):
+ lldbutil.run_to_source_breakpoint(
+ self, "// break here", lldb.SBFileSpec("main.cpp")
+ )
+
+ frame = self.frame()
+
+ loc_main = frame.FindVariable("loc_main")
+ self.assertTrue(loc_main.GetError().Success())
+ self.assertRegex(loc_main.summary, r"main\.cpp\":\d+:\d+ \(\"int
main\(\)\"\)")
+
+ loc_foo = frame.FindVariable("loc_foo")
+ self.assertTrue(loc_foo.GetError().Success())
+ self.assertRegex(
+ loc_foo.summary, r"main\.cpp\":\d+:\d+ \(\"std::source_location
foo\(\)\"\)"
----------------
Michael137 wrote:
Hmmm interesting. Looks like clang uses the beginning of the
`[s]td::source_location....` as the column number. Whereas GCC uses the opening
parenthesis.
> I think we can use fixed line numbers, but keep regex for columns. WDYT?
Yea seems like a good compromise
https://github.com/llvm/llvm-project/pull/203185
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits