[Lldb-commits] [lldb] efbd587 - [lldb] Correct elision of line zero in mixed disassembly

Dave Lee via lldb-commits lldb-commits at lists.llvm.org
Thu May 11 13:24:38 PDT 2023


Author: Dave Lee
Date: 2023-05-11T13:24:32-07:00
New Revision: efbd5870402b53dc8aeee2d087db3109d198e3dc

URL: https://github.com/llvm/llvm-project/commit/efbd5870402b53dc8aeee2d087db3109d198e3dc
DIFF: https://github.com/llvm/llvm-project/commit/efbd5870402b53dc8aeee2d087db3109d198e3dc.diff

LOG: [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

Added: 
    lldb/test/Shell/Commands/command-disassemble-mixed.test

Modified: 
    lldb/source/Core/Disassembler.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp
index 797d30a520f33..db91dc59ddfac 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 0000000000000..d27cdb1cb5a16
--- /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


        


More information about the lldb-commits mailing list