[Lldb-commits] [lldb] [lldb]Make `list` command work with headers when possible. (PR #139002)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Fri May 9 01:57:54 PDT 2025
================
@@ -0,0 +1,57 @@
+## Test that `list header.h:<line>` works correctly when header is available.
+##
+# RUN: split-file %s %t
+
+# RUN: %clang_host -g %t/main_with_inlined.cc %t/foo.cc -o %t/main_with_inlined.out
+# RUN: %clang_host -g %t/main_no_inlined.cc %t/foo.cc -o %t/main_no_inlined.out
+
+# RUN: %lldb %t/main_with_inlined.out -o "list foo.h:2" -o "exit" 2>&1 \
+# RUN: | FileCheck %s --check-prefix=CHECK-INLINED
+
+## Would be nice if this listed the header too - but probably not something
+## we want to support right now.
+# RUN: echo quit | %lldb %t/main_no_inlined.out -o "list foo.h:2" -o "exit" 2>&1 \
+# RUN: | FileCheck %s --check-prefix=CHECK-NO-INLINED
+
+# CHECK-INLINED: 2 extern int* ptr;
+# CHECK-INLINED: 3 void f(int x);
+# CHECK-INLINED: 4
+# CHECK-INLINED: 5 inline void g(int x) {
+# CHECK-INLINED: 6 *ptr = x; // should raise a SIGILL
----------------
DavidSpickett wrote:
If this code is not actually being executed, remove this comment because:
* it doesn't seem relevant to the test case that this code produce a signal when run (`// crash!` would be fine instead, if you want to make it similar to the original example)
* I'm not sure it is SIGILL, looks like SIGSEGV to me, which is going to be distracting for anyone who sees this test fail and has to read it for the first time
https://github.com/llvm/llvm-project/pull/139002
More information about the lldb-commits
mailing list