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]

[commit/Ada] handle homonyms better


This patch add the missing piece for better handling of homonyms.
Before applying the patch, GDB might fails to print the type info
of a given type, simply because the same type name is used to
define another type in a different scope...

    (gdb) ptype local_type
    No definition of "local_type" in current context.

The source of the problem was the fact that the compiler had to
be modified so that the "linkage" name of each type name is unique.
To do that, a sequence number can be added in the middle of the
type name suffix.  This patch adds handling for that extra number.
The encoding used is described in details in the compiler source
exp_dbug.ads.

2008-01-04  Joel Brobecker  <brobecker@adacore.com>

        * ada-lang.c (is_name_suffix): Handle middle-name numeric suffixes
        that are used to differentiate homonyms.

I also wrote a testcase:

2008-01-04  Joel Brobecker  <brobecker@adacore.com>

        * gdb.ada/homonym/homonym.ads, gdb.ada/homonym/homonym.adb,
        gdb.ada/homonym/homonym_main.adb: New files.
        * gdb.ada/homonym.exp: New testcase.

Tested on x86-linux, no regression. Checked in.

OK, that's all for today ;-)
-- 
Joel

Attachment: homonym.diff
Description: Text document

Attachment: homonym-tc.diff
Description: Text document


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