diff options
author | Zax <44502668+hapeeeeee@users.noreply.github.com> | 2025-05-08 22:01:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-08 07:01:16 -0700 |
commit | b5674cb7be1b010be181883601a3674ceef38683 (patch) | |
tree | 4202424bdc38da1db0197c9183abe022f1f67cb7 /lldb/source/Commands/CommandObjectSource.cpp | |
parent | 7eafa5bdb78f371f3173d31df4479c8f7f23d8aa (diff) | |
download | llvm-b5674cb7be1b010be181883601a3674ceef38683.zip llvm-b5674cb7be1b010be181883601a3674ceef38683.tar.gz llvm-b5674cb7be1b010be181883601a3674ceef38683.tar.bz2 |
[lldb] print a notice when `source list` paging reaches the end of th… (#137515)
Diffstat (limited to 'lldb/source/Commands/CommandObjectSource.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectSource.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lldb/source/Commands/CommandObjectSource.cpp b/lldb/source/Commands/CommandObjectSource.cpp index c205813..8c87af5 100644 --- a/lldb/source/Commands/CommandObjectSource.cpp +++ b/lldb/source/Commands/CommandObjectSource.cpp @@ -1067,7 +1067,16 @@ protected: &result.GetOutputStream(), m_options.num_lines, m_options.reverse, GetBreakpointLocations())) { result.SetStatus(eReturnStatusSuccessFinishResult); + } else { + if (target.GetSourceManager().AtLastLine(m_options.reverse)) { + result.AppendNoteWithFormatv( + "Reached {0} of the file, no more to page", + m_options.reverse ? "beginning" : "end"); + } else { + result.AppendNote("No source available"); + } } + } else { if (m_options.num_lines == 0) m_options.num_lines = 10; |