Issue |
156427
|
Summary |
lldb should show the command line of the program that lead to a core dump being created
|
Labels |
enhancement,
lldb
|
Assignees |
|
Reporter |
DavidSpickett
|
Split out from https://github.com/llvm/llvm-project/issues/156305#issuecomment-3244232802.
When GDB loads a core file it will show you the command line used to run the program that crashed and lead to creating the core file:
```
$ gdb /tmp/test.o -c core
<...>
[New LWP 452399]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
Core was generated by `/tmp/test.o 1 2 3'. <<<<< This one.
Program terminated with signal SIGTRAP, Trace/breakpoint trap.
```
LLDB does not, though you can get to them if you have the symbols:
```
$ ./bin/lldb /tmp/test.o --core core
(lldb) target create "/tmp/test.o" --core "core"
Core file '/home/david.spickett/build-llvm-aarch64/core' (aarch64) was loaded.
(lldb) print *((char**)argv + 0)
(char *) 0x0000ffffe429a5a1 "/tmp/test.o"
```
According to https://developers.redhat.com/articles/2025/02/10/3-improvements-gdb-16s-core-file-loading#improved_discovery_of_executable_and_arguments, GDB has been doing this using the content of `NT_PRPSINFO`, but this is sometimes truncated, and now uses something in `NT_AUXV` which is more verbose. I do not know which entry.
It would also be nice to have a way to get to these later in a session. We have a setting for launch arguments but that's for launching new processes.
Perhaps we could put this command line in one of the `target status / process status` outputs. Not easy to discover, but you have something at least.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs