Files
clang-p2996/lldb/source/Commands/CommandObjectSource.cpp
Vy Nguyen dc25ab389c [lldb]Make list command work with headers when possible. (#139002)
Given this simple test case:

```
// foo.h
extern int* ptr;
inline void g(int x) {
  *ptr = x; // should raise a SIGILL
}
//--------------
// foo.cc
#include "foo.h"
int* ptr;

//--------------
// main.cc

#include "foo.h"

int main() {
  g(123); // Call the inlined function and crash
  return 0;
}

$ clang -g main.cc foo.cc -o main.out
$ lldb main.out
```

When you run `main.out` under lldb, it'd stop inside `void g(int)`
because of the crash.
The stack trace would show that it had crashed in `foo.h`, but if you do
`list foo.h:2`, lldb would complain that it could not find the source
file, which is confusing.

This patch make `list` work with headers.
2025-05-19 11:04:01 -04:00

50 KiB