[Lldb-commits] [PATCH] D118055: [lldb] [gdb-remote] Support getting siginfo via API
Jim Ingham via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Jan 27 14:56:58 PST 2022
jingham added a comment.
Yes, you probably need to make another change, which is actually probably a good idea as well.
The immediate problem is that the default constructed SBValue is empty, it has a null ValueObjectSP, so until you somehow make it valid you can't get a valid error from it, in which to set your error string. By the time you've made a valid SBValue it's too late.
But I think actually you should fix this by having a
ValueObjectSP lldb_private::Thread::GetSiginfoValue()
then the SB API will just wrap that call. That way you can make a real ValueObject, with a real error, and return that at any stage.
That will fix your problem, but the real reason for doing this is that lldb_private code can't call back into the SB API's. So if anybody in lldb_private land needed the ValueObject that wrapped the Siginfo information, which is after all the handiest form in which to have it, they would be out of luck.
I didn't get a chance to review this, sorry about that. But in general, SB API's should not do any more work than is necessary to marshal the incoming arguments & figure out which lldb_private API to dispatch it to. Otherwise you've written code is going to end up getting duplicated somewhere (in a command or somewhere else it's needed...)
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D118055/new/
https://reviews.llvm.org/D118055
More information about the lldb-commits
mailing list