Skip to content

Commit 2d66140

Browse files
committed
[lldb] print a notice when source list paging reaches the end of the file
1 parent 46e7347 commit 2d66140

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

lldb/source/Core/SourceManager.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,8 +360,11 @@ size_t SourceManager::DisplayMoreWithLineNumbers(
360360
GetDefaultFileAndLine();
361361

362362
if (last_file_sp) {
363-
if (m_last_line == UINT32_MAX)
364-
return 0;
363+
if (m_last_line == UINT32_MAX) {
364+
Stream::ByteDelta delta(*s);
365+
s->Printf("note: reached the end of current file, no more to page\n");
366+
return *delta;
367+
}
365368

366369
if (reverse && m_last_line == 1)
367370
return 0;
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# RUN: %clang_host -g -O0 %S/Inputs/sigchld.c -o %t.out
2+
# RUN: %lldb %t.out -b -s %s | FileCheck %s
3+
4+
b main
5+
r
6+
list
7+
# CHECK: assert (child_pid != -1);
8+
9+
list
10+
# CHECK: printf("signo = %d\n", SIGCHLD);
11+
12+
list
13+
# CHECK: return 0;
14+
15+
list
16+
# CHECK: note: reached the end of current file, no more to page

0 commit comments

Comments
 (0)