diff options
author | Pavel Labath <pavel@labath.sk> | 2024-11-13 09:56:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-13 09:56:00 +0100 |
commit | 39b2979a434e70a4ce76d4adf91572dcfc9662ff (patch) | |
tree | f46f999c984e0bea1e21bb2c1a77ba22573a7944 /lldb/source/Commands/CommandObjectSource.cpp | |
parent | 12dcaa2e1e6c46d8a1b440d8a836d6b81ab92efb (diff) | |
download | llvm-39b2979a434e70a4ce76d4adf91572dcfc9662ff.zip llvm-39b2979a434e70a4ce76d4adf91572dcfc9662ff.tar.gz llvm-39b2979a434e70a4ce76d4adf91572dcfc9662ff.tar.bz2 |
[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.
Diffstat (limited to 'lldb/source/Commands/CommandObjectSource.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectSource.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
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<SupportFile>(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", |