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]

Re: [RFA 1/3] language-specific read_var_value for Ada renamings


>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

Joel>     procedure Foo is
Joel>        GV : Integer renames Pck.Global_Variable;
Joel>     begin
Joel>        Increment (GV); -- STOP
Joel>     end Foo;

Joel>    (1) Variable "GV" does not exist, which is normal, since there is
Joel>        "GV" the renaming of another variable;

Joel>    (2) But to allow the user access to that renaming the same way
Joel>        the code has, the compiler produces an artificial variable
Joel>        whose name encodes the renaming:

Joel>         gv___XR_pck__global_variable___XE

Joel>        For practical reasons, the artificial variable itself is given
Joel>        irrelevant types and addresses.

I think the patch is fine, given that we've already gone pretty far down
this road.

I wonder whether it would be possible to deal with the renaming when
reading symbols.  If it is possible then I think it would be a better
design -- it would let us pretend that all these magic symbols and
whatnot are really just a facet of debuginfo (which, I think we agree,
they really should have been) -- and it would eliminate a number of
virtual methods throughout the core of gdb.  This in turn is a plus
because each virtual method adds to the conceptual load of gdb
maintenance.

Tom


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