Skip to content

Commit 31367a9

Browse files
committed
[lldb/Target] Refine source display warning for artificial locations (NFC)
This is a post-review update for D115313, to rephrase source display warning messages for artificial locations, making them more understandable for the end-user. Differential Revision: https://reviews.llvm.org/D115461 Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent 9b6a93a commit 31367a9

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

lldb/source/Target/StackFrame.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,14 +1909,13 @@ bool StackFrame::GetStatus(Stream &strm, bool show_frame_info, bool show_source,
19091909
ConstString fn_name = m_sc.GetFunctionName();
19101910

19111911
if (!fn_name.IsEmpty())
1912-
strm.Printf("Warning: the current PC is an artificial location "
1913-
"in function %s.",
1914-
fn_name.AsCString());
1915-
else
19161912
strm.Printf(
1917-
"Warning: the current PC is an artificial location "
1918-
"but lldb couldn't associate it with a function in %s.",
1919-
m_sc.line_entry.file.GetFilename().GetCString());
1913+
"Note: this address is compiler-generated code in function "
1914+
"%s that has no source code associated with it.",
1915+
fn_name.AsCString());
1916+
else
1917+
strm.Printf("Note: this address is compiler-generated code that "
1918+
"has no source code associated with it.");
19201919
strm.EOL();
19211920
}
19221921
}

lldb/test/API/source-manager/TestSourceManager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ def test_artificial_source_location(self):
281281

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

0 commit comments

Comments
 (0)