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: [RFC] examine for TYPE_CODE_REF in pascal language PR 11349


>>>>> "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


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