aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Target/StackFrame.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2021-12-25 22:30:44 +0000
committerDimitry Andric <dim@FreeBSD.org>2021-12-25 22:30:44 +0000
commit77fc4c146f0870ffb09c1afb823ccbe742c5e6ff (patch)
tree5c0eb39553003b9c75a901af6bc4ddabd6f2f28c /lldb/source/Target/StackFrame.cpp
parentf65dcba83ce5035ab88a85fe17628b447eb56e1b (diff)
Diffstat (limited to 'lldb/source/Target/StackFrame.cpp')
-rw-r--r--lldb/source/Target/StackFrame.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/lldb/source/Target/StackFrame.cpp b/lldb/source/Target/StackFrame.cpp
index cba51d266c5b..7b4295158425 100644
--- a/lldb/source/Target/StackFrame.cpp
+++ b/lldb/source/Target/StackFrame.cpp
@@ -1883,14 +1883,32 @@ bool StackFrame::GetStatus(Stream &strm, bool show_frame_info, bool show_source,
if (m_sc.comp_unit && m_sc.line_entry.IsValid()) {
have_debuginfo = true;
if (source_lines_before > 0 || source_lines_after > 0) {
+ uint32_t start_line = m_sc.line_entry.line;
+ if (!start_line && m_sc.function) {
+ FileSpec source_file;
+ m_sc.function->GetStartLineSourceInfo(source_file, start_line);
+ }
+
size_t num_lines =
target->GetSourceManager().DisplaySourceLinesWithLineNumbers(
- m_sc.line_entry.file, m_sc.line_entry.line,
- m_sc.line_entry.column, source_lines_before,
- source_lines_after, "->", &strm);
+ m_sc.line_entry.file, start_line, m_sc.line_entry.column,
+ source_lines_before, source_lines_after, "->", &strm);
if (num_lines != 0)
have_source = true;
// TODO: Give here a one time warning if source file is missing.
+ if (!m_sc.line_entry.line) {
+ ConstString fn_name = m_sc.GetFunctionName();
+
+ if (!fn_name.IsEmpty())
+ strm.Printf(
+ "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();
+ }
}
}
switch (disasm_display) {