This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: Patch for allowing calling pascal-methods (fpc)
- From: Tom Tromey <tromey at redhat dot com>
- To: Joost van der Sluis <joost at cnoc dot nl>
- Cc: gdb at sourceware dot org, Pierre Free Pascal <pierre at freepascal dot org>
- Date: Wed, 05 Oct 2011 12:14:22 -0600
- Subject: Re: Patch for allowing calling pascal-methods (fpc)
- References: <1316548459.13994.7.camel@feddie.cnoc.lan>
>>>>> "Joost" == Joost van der Sluis <joost@cnoc.nl> writes:
Joost> More digging convinced me that the actual problem is in
Joost> lookup_struct_elt_type.
Could you explain why?
I am not sure that applying this patch is ok. It is generic code, so
this change may negatively affect other languages -- it is hard to be
sure without replicating your analysis.
Perhaps some other Pascal-specific fix would be more obviously safe.
Do you have copyright papers in place? If not, contact me off-list to
get started.
Joost> Attached is a patch which makes it possible for gdb to call methods and
Joost> print the result. A testsuite-run did not show any regressions. The
Joost> patch also contains a test with an example.
Patches should go to gdb-patches and have a ChangeLog entry.
See gdb/CONTRIBUTE.
Joost> + if (t_method_name && (strcmp_iw (t_method_name, name) == 0))
Joost> + {
Joost> + if (TYPE_FN_FIELDLIST_LENGTH(type, i) == 1)
Joost> + {
Joost> + return TYPE_FN_FIELD_TYPE (TYPE_FN_FIELDLIST1 (type, i), 0);
Joost> + }
Joost> + else if (!(noerr))
Joost> + error (_("Could not determine which %s has to be used."), name);
This seems iffy for C++.
Tom