This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: MI and anonymous unions


Daniel Jacobowitz wrote:

> On Wed, Nov 15, 2006 at 12:38:16PM +0300, Vladimir Prus wrote:
>> Traversing it with MI eventually gives:
>> 
>>   -var-list-children V.public
>>   
^done,numchild="1",children=[child={name="V.public.",exp="",numchild="1",
>>                  type="union {...}"}]
>>     (gdb)
>>     -var-list-children V.public.
>>     ^done,numchild="1",children=[
>>          child={name="V.public..public",exp="public",numchild="2"}]
>>      (gdb)
>>      -var-list-children V.public..public
>>      .....
>> 
>> Although this kinda works, I'm pretty sure UI won't be happy about empty
>> expression for a variable object, and if you have two anonymous unions,
>> you can't even address them.
> 
> I'm not sure what to do for the empty expression.  There's nothing we
> can put there which would act like a named union, since you need one
> less period - hmm, we were just discussing an MI command to recreate
> expressions the other day...
> 
> How do people use the exp="" result?  Should it be "<anonymous>"?

KDevelop uses it to construct the full expression, which will obviously
break. I'm not sure about Eclipse, I think it does the same.

But given that there's no way to put anything there that can be used to
recreate expression, I don't see much difference. "<anonymous>" would work
better if this is to be shown in some UI, I think.

>> How about using some unique identifier for variable objects corresponding
>> for anonymous unions? Say "@N"?
> 
> That sounds reasonable.

Ok.

- Volodya


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]