summaryrefslogtreecommitdiff
path: root/lldb
diff options
context:
space:
mode:
authorDave Lee <davelee.com@gmail.com>2023-05-11 10:04:55 -0700
committerDave Lee <davelee.com@gmail.com>2023-05-11 13:24:32 -0700
commitefbd5870402b53dc8aeee2d087db3109d198e3dc (patch)
treede274bb6508b32609c827a63fd9521e64dd3ac21 /lldb
parent1b11034c672fc90d35b4bc0e93f3507657b14094 (diff)
downloadllvm-efbd5870402b53dc8aeee2d087db3109d198e3dc.tar.gz
[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
Diffstat (limited to 'lldb')
-rw-r--r--lldb/source/Core/Disassembler.cpp2
-rw-r--r--lldb/test/Shell/Commands/command-disassemble-mixed.test13
2 files changed, 14 insertions, 1 deletions
diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp
index 797d30a520f3..db91dc59ddfa 100644
--- a/lldb/source/Core/Disassembler.cpp
+++ b/lldb/source/Core/Disassembler.cpp
@@ -243,7 +243,7 @@ bool Disassembler::ElideMixedSourceAndDisassemblyLine(
// Skip any line #0 entries - they are implementation details
if (line.line == 0)
- return false;
+ return true;
ThreadSP thread_sp = exe_ctx.GetThreadSP();
if (thread_sp) {
diff --git a/lldb/test/Shell/Commands/command-disassemble-mixed.test b/lldb/test/Shell/Commands/command-disassemble-mixed.test
new file mode 100644
index 000000000000..d27cdb1cb5a1
--- /dev/null
+++ b/lldb/test/Shell/Commands/command-disassemble-mixed.test
@@ -0,0 +1,13 @@
+extern int do_not_show;
+
+int main() {
+ int abc = 30;
+#line 0
+ return abc;
+}
+
+// RUN: %clang_host -g -x c -o a.out %s
+// RUN: %lldb -b -o 'disassemble --mixed -n main' a.out | FileCheck %s
+
+// CHECK: a.out`main:
+// CHECK-NOT: do_not_show