This is the mail archive of the gdb-patches@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: [RFAv2 3/3] Make symtab.c better styled.


On 02/12/2019 02:04 PM, Ulrich Weigand wrote:

> I've just checked the current behavior on a ppc64 machine,
> and we do indeed see the (synthetic) dot symbol listed under
> "info functions" and the function descriptor symbol listed
> under "info variables".
> 
>   (gdb) info functions
>   [...]
>   Non-debugging symbols:
>   0x0000000010000514  .main
> 
>   (gdb) info variables
>   [...]
>   Non-debugging symbols:
>   0x0000000010020088  main
> 
> On the other hand, "info symbol main" does dereference the
> function descriptor and returns the code entry point:
> 
>  (gdb) info symbol main
>  .main in section .text of /home/uweigand/a.out
> 
> This all is maybe not perfect, but seems reasonable enough to me.
> I'm not sure it's worth spending much effort trying to "fix"
> anything here.
> 

OK.

> I haven't followed the patch series in detail, do you think it
> would break anything I've outlined above?

So the question becomes a simple cosmetic one.  In this case:

>   (gdb) info variables
>   [...]
>   Non-debugging symbols:
>   0x0000000010020088  main

Should "main" be printed with function style, or variable style.
This basically affects the color used to print the symbol.

In Philippe's patch, we'd print it in variable style.  If we used
msymbol_is_function instead of his "is text symbol" check, we'd
print it in function style.

Thanks,
Pedro Alves


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