This is the mail archive of the gdb-patches@sources.redhat.com 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]

[RFC/RFA] Set current language when dumping symtab


Hello,

One of our users tried to use the "maint print symbols syms" command
to dump all the symbols in a text format, and that caused a crash on
x86-windows. The reason for the crash is that dump_symtab() indirectly
uses the current language vector to analyze the symbols and then do
the printing. The symtab language may be different from the current
language, so the current language needs to be temporarily adjusted
during the printing. This is what the attached patch does.

2005-05-02  Joel Brobecker  <brobecker@adacore.com>

        * symmisc.c (dump_symtab_1): Renamed from dump_symtab.
        (dump_symtab): New function.
        * Makefile.in (symmisc.o): Add dependency on ui-out.h.

Tested on x86-linux, no regression.
You'll notice that I formally tested the change on x86-linux, as
running the testsuite on x86-windows just takes forever (I never had
the patience to wait till the end), but I did verify that this fixes
the problem, and that the output using the language assocated to each
symtab we're printing.

Also, I think we need to do the same for print_msymbols() and
print_psymbols(). I'm a bit in a rush at the moment, so I'm sending
this patch as is for now. I'll understand if I need to rework it later
to include the minsyms and psyms. I thought it might already be useful
to others as is. Just let me know.

Thanks,
-- 
Joel

Attachment: symmisc.c.diff
Description: Text document


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