From 39b2979a434e70a4ce76d4adf91572dcfc9662ff Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Wed, 13 Nov 2024 09:56:00 +0100 Subject: [lldb] Fix source display for artificial locations (#115876) When retrieving the location of the function declaration, we were dropping the file component on the floor, which resulted in an amusingly confusing situation were we displayed the file containing the implementation of the function, but used the line number of the declaration. This patch fixes that. It required a small refactor Function::GetStartLineSourceLineInfo to return a SupportFile (instead of just the file spec), which in turn necessitated changes in a couple of other places as well. --- lldb/source/Commands/CommandObjectSource.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'lldb/source/Commands/CommandObjectSource.cpp') diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index 86c090f..c8295fd 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -784,9 +784,7 @@ protected: if (sc.block == nullptr) { // Not an inlined function - FileSpec function_file_spec; - sc.function->GetStartLineSourceInfo(function_file_spec, start_line); - start_file = std::make_shared(function_file_spec); + sc.function->GetStartLineSourceInfo(start_file, start_line); if (start_line == 0) { result.AppendErrorWithFormat("Could not find line information for " "start of function: \"%s\".\n", -- cgit v1.1