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]

[RFA/Ada] suppress internally-generated symbols from "info locals"


Hello,

A customer reported that he was seeing strange symbols sometimes when
using the "info locals" command. For instance:

    (gdb) info locals
    my_object = (prev => 0x0, next => 0x0, value => 42)
    <F1b> = (access system.finalization_root.root_controlled) 0xbfcc94d0

This happens at -g3 only.

The second entity should not be visible to the user. We normally always
modify the compiler to stop generating debugging info for these entities,
but we also add guards against them when we easily can to improve the life
of our users who are stuck with an older compiler.  In this case, the
machinery was already in place, so it was easy. I think we also have
other types of symbols that we need to suppress and yet need to be
defined in the debugging info (renames for instance), but I can't
construct a testcase that shows that.

We introduced a new language function (la_symbol_printing_suppressed),
and all languages except Ada have been set to never suppress any symbol.
Ada uses the already defined ada_suppress_symbol_printing. We also
defined a new SYMBOL_PRINTING_SUPPRESSED macro in symtab.h which is
a convenient shortcut more than a symtab macro.  The testcase in
question also uncovered a bug in our ada-lang.c:is_suppressed_name
function, which Paul fixed.

Unfortunately, I cannot submit a testcase this time.

2008-01-13  Paul Hilfinger  <hilfinger@adacore.com>
            Joel Brobecker  <brobecker@adacore.com>

        * language.h (struct language_defn): Add new field
        la_symbol_printing_suppressed.
        (no_symbol_printing_suppressed): Add declaration.
        * langauge.c (no_symbol_printing_suppressed): New function.
        (unknown_language): Set la_symbol_printing_suppressed.
        (auto_language, local_language): Likewise.
        * objc-lang.c (objc_language_defn): Likewise.
        * scm-lang.c (scm_language_defn): Likewise.
        * m2-lang.c (m2_language_defn): Likewise.
        * f-lang.c (f_language_defn): Likewise.
        * jv-lang.c (java_language_defn): Likewise.
        * p-lang.c (pascal_language_defn): Likewise.
        * c-lang.c (c_language_defn, cplus_language_defn, asm_language_defn)
        (minimal_language_defn): Likewise.
        * ada-lang.c (is_suppressed_name): Correct the loop so that it will
        correctly handle cases where the first letter of an identifier is
        capitalized.
        (ada_language_defn): Set la_symbol_printing_suppressed to
        ada_suppress_symbol_printing.
        * symtab.h (SYMBOL_PRINTING_SUPPRESSED): New macro.
        * stack.c (print_block_frame_locals): Do not print symbols that
        should be suppressed.

Tested on x86-linux, no regression.
OK to commit?

Thanks,
-- 
Joel

Attachment: info-locals.diff
Description: Text document


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