This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] dwarf debug format: Support DW_AT_variable_parameter attribute
- From: Tom Tromey <tromey at redhat dot com>
- To: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- Cc: "'Joel Brobecker'" <brobecker at adacore dot com>, <gdb-patches at sourceware dot org>, "'FPC Core Developer List'" <core at freepascal dot org>
- Date: Wed, 19 May 2010 16:09:20 -0600
- Subject: Re: [RFA] dwarf debug format: Support DW_AT_variable_parameter attribute
- References: <8830.7035308846$1273670829@news.gmane.org> <m34oibvhgh.fsf@fleche.redhat.com> <20100517172758.GJ2805@adacore.com> <000301caf5e7$222ac800$66805800$@muller@ics-cnrs.unistra.fr> <20100517174726.GK2805@adacore.com> <44296.7587885962$1274132782@news.gmane.org> <m3fx1n90ul.fsf@fleche.redhat.com> <28559.2589797036$1274302480@news.gmane.org>
- Reply-to: tromey at redhat dot com
>>>>> "Pierre" == Pierre Muller <pierre.muller@ics-cnrs.unistra.fr> writes:
Pierre> That is what is done for now on Free Pascal,
Pierre> i.e. the debug information generates a reference_type for
Pierre> parameters passed by var.
Pierre> It's not ideal yet, but this is just a matter of
Pierre> twicks inside p-* files...
I suppose it is less than ideal in that the type is exposed to the user.
Another idea would be to augment the DWARF expression evaluator to do an
additional indirection when this bit is set. Though then one must
wonder why the compiler does not simply emit an expression to that
effect.
Pierre> I am unsure about the type allocation procedure,
Pierre> could you just tell me if this looks OK
Pierre> before I resubmit an RFA.
Pierre> + struct type *ref_type;
Pierre> +
Pierre> + ref_type = TYPE_REFERENCE_TYPE (SYMBOL_TYPE (sym));
Pierre> + if (!ref_type)
Pierre> + {
Pierre> + ref_type = alloc_type (objfile);
Pierre> + ref_type = make_reference_type (SYMBOL_TYPE (sym),
Pierre> &ref_type);
Pierre> + }
Just use 'lookup_reference_type (SYMBOL_TYPE (sym))'.
That will handle the details for you.
Tom