[Lldb-commits] [lldb] [lldb] Fixing edge cases in "command source" (PR #126526)

via lldb-commits lldb-commits at lists.llvm.org
Mon Feb 10 10:12:15 PST 2025


================
@@ -784,14 +784,12 @@ class CommandObjectSourceList : public CommandObjectParsed {
 
       if (sc.block == nullptr) {
         // Not an inlined function
-        sc.function->GetStartLineSourceInfo(start_file, start_line);
-        if (start_line == 0) {
-          result.AppendErrorWithFormat("Could not find line information for "
-                                       "start of function: \"%s\".\n",
-                                       source_info.function.GetCString());
-          return 0;
-        }
-        sc.function->GetEndLineSourceInfo(end_file, end_line);
+        auto expected_info = sc.function->GetSourceInfo();
+        if (!expected_info)
+          result.AppendError(llvm::toString(expected_info.takeError()));
----------------
jimingham wrote:

This probably also means we're missing a test for when this fails?

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


More information about the lldb-commits mailing list