This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC] examine for TYPE_CODE_REF in pascal language PR 11349
- From: Tom Tromey <tromey at redhat dot com>
- To: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: <gdb-patches at sourceware dot org>
- Date: Fri, 30 Apr 2010 10:58:44 -0600
- Subject: Re: [RFC] examine for TYPE_CODE_REF in pascal language PR 11349
- References: <17731.9300863475$1272644394@news.gmane.org>
- Reply-to: tromey at redhat dot com
>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:
Pierre> -inside x_command, a TYPE_CODE_REF generates a call
Pierre> to value_ind, but this generates possibly several dereferencing
Pierre> if the target type is also a pointer.
Pierre> I do not know what is the expectation for C language
Pierre> here, and I don't even know how to generate code that
Pierre> has variables of type TYPE_CODE_REF from C source.
You need C++ to make a TYPE_CODE_REF. It corresponds to a C++
reference.
Pierre> Should this change be extended to other languages
Pierre> or to all languages?
I think coerce_ref is the right thing to do here for C++. If an
expression evaluates to a reference to a pointer, I would expect the
reference to be ignored and the referred-to pointer to be used instead.
However, the fact that the code is explicitly written to check
TYPE_CODE_REF and use value_ind gives me pause. If you change it to
unconditionally use coerce_ref, do any tests fail?
Tom