Skip to content

Commit efbd587

Browse files
committed
[lldb] Correct elision of line zero in mixed disassembly
When `disassemble --mixed` is run, do not show source for line zero, as intended. Differential Revision: https://reviews.llvm.org/D150383
1 parent 1b11034 commit efbd587

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lldb/source/Core/Disassembler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ bool Disassembler::ElideMixedSourceAndDisassemblyLine(
243243

244244
// Skip any line #0 entries - they are implementation details
245245
if (line.line == 0)
246-
return false;
246+
return true;
247247

248248
ThreadSP thread_sp = exe_ctx.GetThreadSP();
249249
if (thread_sp) {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
extern int do_not_show;
2+
3+
int main() {
4+
int abc = 30;
5+
#line 0
6+
return abc;
7+
}
8+
9+
// RUN: %clang_host -g -x c -o a.out %s
10+
// RUN: %lldb -b -o 'disassemble --mixed -n main' a.out | FileCheck %s
11+
12+
// CHECK: a.out`main:
13+
// CHECK-NOT: do_not_show

0 commit comments

Comments
 (0)