Skip to content

[lldb/Target] Refine source display warning for artificial locations (NFC) #3659

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions lldb/source/Target/StackFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1909,14 +1909,13 @@ bool StackFrame::GetStatus(Stream &strm, bool show_frame_info, bool show_source,
ConstString fn_name = m_sc.GetFunctionName();

if (!fn_name.IsEmpty())
strm.Printf("Warning: the current PC is an artificial location "
"in function %s.",
fn_name.AsCString());
else
strm.Printf(
"Warning: the current PC is an artificial location "
"but lldb couldn't associate it with a function in %s.",
m_sc.line_entry.file.GetFilename().GetCString());
"Note: this address is compiler-generated code in function "
"%s that has no source code associated with it.",
fn_name.AsCString());
else
strm.Printf("Note: this address is compiler-generated code that "
"has no source code associated with it.");
strm.EOL();
}
}
Expand Down
6 changes: 3 additions & 3 deletions lldb/test/API/source-manager/TestSourceManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def test_artificial_source_location(self):

self.expect("run", RUN_SUCCEEDED,
substrs=['stop reason = breakpoint', '%s:%d' % (src_file,0),
'Warning: the current PC is an artificial ',
'location in function '
])
'Note: this address is compiler-generated code in '
'function', 'that has no source code associated '
'with it.'])