This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 1/3] language-specific read_var_value for Ada renamings
- From: Tom Tromey <tromey at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 01 Mar 2012 12:51:40 -0700
- Subject: Re: [RFA 1/3] language-specific read_var_value for Ada renamings
- References: <1330546034-27156-1-git-send-email-brobecker@adacore.com> <1330546034-27156-2-git-send-email-brobecker@adacore.com>
>>>>> "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