Re: [PATCH] Mark Pascal as case-insensitive

Tom de Vries
2025-11-14T12:59:50Z

On 11/14/25 12:41 PM, Tom de Vries wrote:
> On 11/13/25 5:28 PM, Tom Tromey wrote:
>> The Pascal language is not case-sensitive, so implement the
>> appropriate language method.  This fixes gdb.pascal failures with
>> -gw3.
>>
>> I wasn't sure if -gw3 should be the default so I've left it as-is.
>>
>
> Hi,
>
> I've tried out the patch with:
> ...
> $ make check TESTS=gdb.pascal/*.exp RUNTESTFLAGS=--target_board=unix/
> gdb:debug_flags=-gw2
> ...
> and likewise with -gw3, and the results look good.
>
> LGTM.
>

FWIW, I just found DW_AT_identifier_case:
...
<0>: Abbrev Number: 1 (DW_TAG_compile_unit)
<c> DW_AT_name :
../../../../src/gdb/testsuite/gdb.pascal/hello.pas
<3f> DW_AT_producer : Free Pascal 3.2.2 2025/09/10
<5c> DW_AT_comp_dir :
/data/vries/gdb/leap-16-0/build/gdb/testsuite/
<8b> DW_AT_language : 9 (ANSI Pascal)
<8c> DW_AT_identifier_case: 3 (case_insensitive)
<8d> DW_AT_stmt_list : 0
<91> DW_AT_low_pc : 0x401090
<99> DW_AT_high_pc : 0x401150
...
which enables a finer granularity. We currently don't support this, but
I'm not sure if that's a relevant feature.

Thanks,
- Tom

> Approved-By: Tom de Vries <tdevries@suse.de>
>
> Thanks,
> - Tom
>
>
>> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33617
>> ---
>>   gdb/p-lang.h | 3 +++
>>   1 file changed, 3 insertions(+)
>>
>> diff --git a/gdb/p-lang.h b/gdb/p-lang.h
>> index 87430bad13c..f3bb329bc02 100644
>> --- a/gdb/p-lang.h
>> +++ b/gdb/p-lang.h
>> @@ -154,6 +154,9 @@ class pascal_language : public language_defn
>>     bool range_checking_on_by_default () const override
>>     { return true; }
>> +  enum case_sensitivity case_sensitivity () const override
>> +  { return case_sensitive_off; }
>> +
>>   private:
>>     /* Print the character C on STREAM as part of the contents of a
>> literal
>>
>> base-commit: a85f1da7a82fef8c74737089b5845bfd2d97996c
>