Patch for allowing calling pascal-methods (fpc)
Tom Tromey
tromey@redhat.com
Wed Oct 5 18:14:00 GMT 2011
>>>>> "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
More information about the Gdb
mailing list