[lldb-dev] RFC: siginfo reading/writing support

Greg Clayton via lldb-dev lldb-dev at lists.llvm.org
Fri Jan 28 15:39:01 PST 2022


The other idea would be to allow the Platform subclasses to be able to fill in some fixed variable names when asked.

So if the user typed either:

(lldb) frame variable $platform.siginfo
(lldb) expression $platform.siginfo

We would have the name lookup mechanism check with the current platform if the string starts with "$platform" for the current target and ask it _first_ if it knows anything about this name. If the linux platform recognizes it, it can create one however it wants to and return the variable all filled in. We could use this same mechanism for other things like the uncaught exceptions for C++ (GDB has a way of vending info on these exceptions in certain cases too.


> On Jan 13, 2022, at 9:09 AM, Jim Ingham via lldb-dev <lldb-dev at lists.llvm.org> wrote:
> 
> You are really going to make a lldb_private::CompilerType, since that’s what backs the Type & ultimately the SBTypes.  There’s a self-contained example where we make a CompilerType to represent the pairs in the synthetic child provider for NSDictionaries in the function GetLLDBNSPairType in NSDictionary.cpp.  And then you can follow the use of that function to see how that gets turned into a Type.
> 
> Also, the whole job of the DWARF parser is to make up CompilerTypes out of information from external sources, so if you need other examples for how to add elements to a CompilerType the DWARF parser is replete with them.
> 
> Jim
> 
>> On Jan 13, 2022, at 4:03 AM, Michał Górny <mgorny at gentoo.org> wrote:
>> 
>> On Wed, 2022-01-12 at 11:22 -0800, Jim Ingham wrote:
>>> If we can’t always get our hands on the siginfo type, we will have to cons that type up by hand.  But we would have had to do that if we were implementing this feature in the expression parser anyway, and we already hand-make types to hand out in SBValues for a bunch of the synthetic child providers already, so that’s a well trodden path.
>> 
>> Could you point me to some example I could base my code on?  ;-)
>> 
>> -- 
>> Best regards,
>> Michał Górny
>> 
> 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev



More information about the lldb-dev mailing list