[Lldb-commits] [lldb] ded1bad - Fix mixed disassembly showing source lines for "line 0"

Ted Woodward via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 12 09:39:36 PDT 2023


Author: Ted Woodward
Date: 2023-07-12T11:39:11-05:00
New Revision: ded1bad64af0acf312d2464fcc4e826f89a720d0

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

LOG: Fix mixed disassembly showing source lines for "line 0"

"line 0" in a DWARF linetable means something that doesn't have associated
source. The code for mixed disassembly has a comment indicating that
"line 0" should be skipped, but the wrong value was returned. Fix the return
value and add a test to check that we don't incorrectly show source lines
from the beginning of the file.

Reviewed By: jasonmolenda

Differential Revision: https://reviews.llvm.org/D112931

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

Modified: 
    

Removed: 
    


################################################################################
diff  --git a/lldb/test/Shell/Commands/command-disassemble-mixed.c b/lldb/test/Shell/Commands/command-disassemble-mixed.c
new file mode 100644
index 00000000000000..d15832cabd8402
--- /dev/null
+++ b/lldb/test/Shell/Commands/command-disassemble-mixed.c
@@ -0,0 +1,18 @@
+// invalid mixed disassembly line
+
+// RUN: %clang -g %s -o %t
+// RUN: %lldb %t -o "dis -m -n main" -o "exit" | FileCheck %s
+
+// CHECK: int main
+// CHECK: int i
+// CHECK-NOT: invalid mixed disassembly line
+// CHECK: return 0;
+
+int main(int argc, char **argv)
+{
+  int i;
+
+  for (i=0; i < 10; ++i) ;
+
+  return 0;
+}


        


More information about the lldb-commits mailing list