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] Fix bug when doing ptype of a tagged-type variable


This patch solves a problem that is apparent when trying to do a ptype
of a "tagged type". Tagged type in Ada are the equivalent of classes
in C++. The symptoms is that GDB was not printing the name of the
parent class:

      (gdb) ptype derived
      type = new (null) with record
          attribute: integer;
      end record

There were a couple of issues.  I documented my changes using comments
that should explain what was going on.

2008-09-10  Joel Brobecker  <brobecker@adacore.com>

        * ada-lang.c (ada_parent_type): Add handling of the case where
        the _parent field is a pointer and/or has a parallel XVS type.
        (ada_evaluate_subexp) [OP_VAR_VALUE]: When doing an
        EVAL_AVOID_SIDE_EFFECTS evaluation of a tagged type, return
        the type of the tag instead of doing forcing an EVAL_NORMAL
        expression evaluation.

Tested on x86-linux. Checked in.

-- 
Joel

Attachment: 02-tagged_type.diff
Description: Text document


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