Re: Formatting of function pointer value

Daniel Jacobowitz
2005-07-11T13:08:02Z

On Mon, Jul 11, 2005 at 11:40:21AM +0400, Vladimir Prus wrote:
> Vladimir Prus wrote:
>
> > Ok, the the only advantage of MI is stable output format. Can you tell me
> > how it's achieved? For example, looking at the code that prints function
> > values (what worries me in the first place):
> >
> > fprintf_filtered (stream, "{");
> > type_print (type, "", stream, -1);
> > fprintf_filtered (stream, "} ");
> >
> > As I right in assuming that exactly the same output will be produced for
> > MI mode and for CLI mode? If so, then how MI can be more stable than CLI,
> > if the output is the same?
>
> To clarify more, here's what I get with MI:
>
> -data-evaluate-expression *p3
> ^done,value="{int (int)} 0xb7ee6e9c <__DTOR_END__+4>"
> (gdb)
> -var-create VP3 0 *p3
> ^done,name="VP3",numchild="0",type="int (int)"
> (gdb)
> -var-evaluate-expression VP3
> ^done,value="{int (int)} 0xb7ee6e9c <__DTOR_END__+4>"
>
> The type enclosed in {} is still there.

The intention is that this is a user-readable value, to be displayed.
There's limited facility for computing values with machine-readable
results, probably because there has been limited need for it to date.
You can get some information more precisely - for instance the type.

--
Daniel Jacobowitz
CodeSourcery, LLC