This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 3/3] Make symtab.c better styled.
On Sat, 2019-01-12 at 09:26 -0700, Tom Tromey wrote:
> > > > > > "Philippe" == Philippe Waroquiers <philippe.waroquiers@skynet.be> writes:
>
> Philippe> 2019-01-10 Philippe Waroquiers <philippe.waroquiers@skynet.be>
> Philippe> * symtab.c (output_source_filename): Use file name style
> Philippe> to print file name.
> Philippe> (print_symbol_info): Likewise.
> Philippe> (print_msymbol_info): Use address style to print addresses.
>
> Thanks, this is ok.
>
> Philippe> + printf_filtered (" %s\n",
> Philippe> + MSYMBOL_PRINT_NAME (msymbol.minsym));
>
> I suppose this could look at the minsymbol type and use either the
> function or variable styling.
That looks relatively easy to do.
To differentiate between data and text, would the condition
in expand_symtab_containing_pc be ok ?
i.e. variable styling would be used for data, i.e. :
(MSYMBOL_TYPE (msymbol.minsym) == mst_data
|| MSYMBOL_TYPE (msymbol.minsym) == mst_bss
|| MSYMBOL_TYPE (msymbol.minsym) == mst_abs
|| MSYMBOL_TYPE (msymbol.minsym) == mst_file_data
|| MSYMBOL_TYPE (msymbol.minsym) == mst_file_bss))
and function name styling would be used for the rest i.e.:
mst_text, /* Generally executable instructions */
mst_text_gnu_ifunc, /* Executable code returning address
of executable code */
mst_data_gnu_ifunc, /* Executable code returning address
of executable code */
mst_slot_got_plt, /* GOT entries for .plt sections */
mst_solib_trampoline, /* Shared library trampoline code */
mst_file_text, /* Static version of mst_text */
Philippe