This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: gdb-patches RFA: Fix pascal behavior for class fields
- From: Pedro Alves <palves at redhat dot com>
- To: Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>, "'gdb-patches'" <gdb-patches at sourceware dot org>
- Cc: gpc at gnu dot de
- Date: Fri, 09 Jan 2015 10:52:21 +0000
- Subject: Re: gdb-patches RFA: Fix pascal behavior for class fields
- Authentication-results: sourceware.org; auth=none
- References: <54ae4586 dot 01e3440a dot 7b06 dot fffff844SMTPIN_ADDED_BROKEN at mx dot google dot com> <54AE605A dot 8050308 at redhat dot com> <54ae7f9f dot c323460a dot 36ed dot ffffff30SMTPIN_ADDED_BROKEN at mx dot google dot com> <54AE8914 dot 4010507 at redhat dot com> <54ae911b dot 85e3440a dot 1d96 dot 5ffdSMTPIN_ADDED_BROKEN at mx dot google dot com>
On 01/08/2015 02:15 PM, Pierre Muller wrote:
> For gpc mailing list:
> this email comes as a follow-up of this bug report
> https://sourceware.org/bugzilla/show_bug.cgi?id=17815
>
> The start of the thread can be found at:
> https://sourceware.org/ml/gdb-patches/2015-01/msg00164.html
>
> Pedro asked:
>>>> How about adding this to the test suite?
>>>
>>>
>>> The whole testsuite/gdb.pascal is almost empty,
>>> I never invested time to develop it :(
>>>
>>> At the time I started it, GPC (the GNU pascal compiler)
>>> was still active, but development apparently
>>> stopped since quite some time.
>>>
>>> I am unable to install GPC, which means that I cannot test it.
>>> Would a testsuite that supports only Free Pascal be acceptable?
>>
>> Do you actually mean, whether it's ok for a new
>> test (not test suite) to go in untested on GPC? It certainly is.
>> Better test on FPC than nowhere. :-)
> That is indeed what I meant.
>
>> AFAICS, the tests themselves don't really care which compiler
>> is in use other than for marking xfails; you just call
>> gdb_compile_pascal,
>> and that works with either. That's my impression from quickly
>> skimming testsuite/lib/pascal.exp.
>
> The problem is that GPC and Free Pascal support several
> pascal 'dialects'. But this requires command line options.
>
> The -Mobjfpc option is required for Free Pascal compiler
> to understand class type definition, but is rejected in default mode.
>
> I expect GNU GPC to also reject class in 'normal' mode...
> Maybe someone on the gpc mailing list knows if classes are supported
> by GPC and if it requires a special compiler option.
I'd suggest adding support for a new option to
gdb_compile_pascal, like "objfpc", so you'd compile
the test with:
if {[gdb_compile_pascal ... executable [list debug objfpc]] != "" } {
untested $testfile.exp
return -1
}
You'd teach fpc_compile about the new option:
proc fpc_compile {source dest type options} {
...
foreach i $options {
...
} elseif { $i == "objfpc" } {
append add_flags " -Mobjfpc"
}
...
}
Someone that cares about testing with GNU GPC would then
do the equivalent to gpc_compile, if anything is necessary.
If gpc simply fails to compile the test, it's no biggie,
as gdb_compile_pascal returns false, and the test is
skipped with "untested".
There may be a more generic and common name for the mode,
like "obj-pascal" or something, but I wouldn't know.
Thanks,
Pedro Alves