[Lldb-commits] [lldb] [LLDB] Extract process arguments from core dump for Linux (PR #185338)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Thu Apr 16 04:16:12 PDT 2026
================
----------------
DavidSpickett wrote:
There's pros and cons to repeating code, sometimes it is clearer to just repeat things.
In this case I think it would be better to do the `Process` bit once, then conditionally add the core file bit.
Like:
```
else {
strm.Printf("Process %" PRIu64 " %s\n", GetID(), StateAsCString(state));
if (!IsLiveDebugSession()) {
<output them>
}
}
```
And in fact, do we even need to check that we're a live session or not? If we ask for CoreFileArgs from a live session, it'll be empty. So you can do `if (auto core_args = GetCoreFileArgs; core_args && is_verbose)`.
https://github.com/llvm/llvm-project/pull/185338
More information about the lldb-commits
mailing list