[Lldb-commits] [lldb] Fix a bug with cancelling "attach -w" after you have run a process previously (PR #65822)

via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 8 22:06:01 PDT 2023


bulbazord wrote:

> This is in reply to Alex's comment about why we keep the process around, but the quote this reply didn't seem to work...
> 
> After a process exits you might still want to ask it what its exit status was. Plus there might be other system accounting we've gathered for that process. So until you replace it with another process, you very well might want to ask questions of it. So we can't just destroy it as soon as it exits.

That definitely explains why we persist the previous process even after its finished, but this doesn't sound like there's a technical limitation to actually removing the Process from the Target after it exits. To be more specific, you could either make it so the Process object in `m_process_sp` could be moved out and into another member of Target, or you could just persist the data you care about instead of the entire process.

That might be an alternative to this solution but I'm not sure if that would be any better or more useful than what you're doing here. I'm mostly thinking aloud here (and trying to improve my knowledge of LLDB).

https://github.com/llvm/llvm-project/pull/65822


More information about the lldb-commits mailing list