[Lldb-commits] [PATCH] D106226: [lldb] Improve error message when "lldb attach" fails

APOORV SACHAN via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Wed Jul 21 15:37:30 PDT 2021


apoos-maximus added a comment.

In D106226#2886627 <https://reviews.llvm.org/D106226#2886627>, @DavidSpickett wrote:

> It changes whether the output goes to stdout or stderr and whether we set the return status to failed. So I would merge it into one call to `AppendErrorWithFormat`.

Thanks a lot for passing on this knowledge.

>> The error object is being returned by the Attach() call on line:399 so, should this message be handled by the Attach() function and not by DoExecute() ?
>
> Go to https://lldb.llvm.org/python_reference/index.html, search for `SBTarget` and you'll see a few attach methods there. They call Target Attach so if you added it there they'd also get it. Which seems like a good thing to me. (but see my other comment about platforms)



> Would it be possible to move this message further down into Target::Attach to a place where we know the target kind? (that would also answer your question about what level it should be at)
>
> If you could return a status from that level with this message then you'd only see it where it makes sense.

Looks like target related information is available in `TargetProperties` class whom `Target` class is inheriting so perhaps a decision based on target-type could be made there. I will explore further into this, as in which property(s) can be used and how and have an update.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D106226/new/

https://reviews.llvm.org/D106226



More information about the lldb-commits mailing list