Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Mark Pascal as case-insensitive
@ 2025-11-13 16:28 Tom Tromey
  2025-11-14 11:41 ` Tom de Vries
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2025-11-13 16:28 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

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.

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
-- 
2.51.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Mark Pascal as case-insensitive
  2025-11-13 16:28 [PATCH] Mark Pascal as case-insensitive Tom Tromey
@ 2025-11-14 11:41 ` Tom de Vries
  2025-11-14 12:59   ` Tom de Vries
  0 siblings, 1 reply; 7+ messages in thread
From: Tom de Vries @ 2025-11-14 11:41 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

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.

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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Mark Pascal as case-insensitive
  2025-11-14 11:41 ` Tom de Vries
@ 2025-11-14 12:59   ` Tom de Vries
  2025-11-14 19:08     ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Tom de Vries @ 2025-11-14 12:59 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

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><b>: 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
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Mark Pascal as case-insensitive
  2025-11-14 12:59   ` Tom de Vries
@ 2025-11-14 19:08     ` Tom Tromey
  2025-11-14 22:02       ` Paul Koning
  0 siblings, 1 reply; 7+ messages in thread
From: Tom Tromey @ 2025-11-14 19:08 UTC (permalink / raw)
  To: Tom de Vries; +Cc: Tom Tromey, gdb-patches

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

I also didn't know about this.

We could probably handle this in gdb, maybe by enhancing the
canonicalization step, though other approaches are possible.

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Mark Pascal as case-insensitive
  2025-11-14 19:08     ` Tom Tromey
@ 2025-11-14 22:02       ` Paul Koning
  2025-11-15  2:30         ` Maciej W. Rozycki
  0 siblings, 1 reply; 7+ messages in thread
From: Paul Koning @ 2025-11-14 22:02 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Tom de Vries, gdb-patches



> On Nov 14, 2025, at 2:08 PM, Tom Tromey <tromey@adacore.com> wrote:
> 
> Tom> FWIW, I just found DW_AT_identifier_case:
> Tom> ...
> Tom>  <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
> Tom>     <c>   DW_AT_name        :
> Tom>     ../../../../src/gdb/testsuite/gdb.pascal/hello.pas
> Tom>     <3f>   DW_AT_producer    : Free Pascal 3.2.2 2025/09/10
> Tom>     <5c>   DW_AT_comp_dir    :
> Tom>     /data/vries/gdb/leap-16-0/build/gdb/testsuite/
> Tom>     <8b>   DW_AT_language    : 9        (ANSI Pascal)
> Tom>     <8c>   DW_AT_identifier_case: 3     (case_insensitive)
> Tom>     <8d>   DW_AT_stmt_list   : 0
> Tom>     <91>   DW_AT_low_pc      : 0x401090
> Tom>     <99>   DW_AT_high_pc     : 0x401150
> Tom> ...
> Tom> which enables a finer granularity.  We currently don't support this,
> Tom> but I'm not sure if that's a relevant feature.
> 
> I also didn't know about this.
> 
> We could probably handle this in gdb, maybe by enhancing the
> canonicalization step, though other approaches are possible.
> 
> Tom

Is the purpose of that mechanism to allow individual symbols to be case sensitive, or not?  Neat, but where would that be used?

	paul


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Mark Pascal as case-insensitive
  2025-11-14 22:02       ` Paul Koning
@ 2025-11-15  2:30         ` Maciej W. Rozycki
  2025-11-17 15:03           ` Tom Tromey
  0 siblings, 1 reply; 7+ messages in thread
From: Maciej W. Rozycki @ 2025-11-15  2:30 UTC (permalink / raw)
  To: Paul Koning; +Cc: Tom Tromey, Tom de Vries, gdb-patches

On Fri, 14 Nov 2025, Paul Koning wrote:

> > Tom> FWIW, I just found DW_AT_identifier_case:
> > Tom> ...
> > Tom>  <0><b>: Abbrev Number: 1 (DW_TAG_compile_unit)
> > Tom>     <c>   DW_AT_name        :
> > Tom>     ../../../../src/gdb/testsuite/gdb.pascal/hello.pas
> > Tom>     <3f>   DW_AT_producer    : Free Pascal 3.2.2 2025/09/10
> > Tom>     <5c>   DW_AT_comp_dir    :
> > Tom>     /data/vries/gdb/leap-16-0/build/gdb/testsuite/
> > Tom>     <8b>   DW_AT_language    : 9        (ANSI Pascal)
> > Tom>     <8c>   DW_AT_identifier_case: 3     (case_insensitive)
> > Tom>     <8d>   DW_AT_stmt_list   : 0
> > Tom>     <91>   DW_AT_low_pc      : 0x401090
> > Tom>     <99>   DW_AT_high_pc     : 0x401150
> > Tom> ...
> > Tom> which enables a finer granularity.  We currently don't support this,
> > Tom> but I'm not sure if that's a relevant feature.
> > 
> > I also didn't know about this.
> > 
> > We could probably handle this in gdb, maybe by enhancing the
> > canonicalization step, though other approaches are possible.
> 
> Is the purpose of that mechanism to allow individual symbols to be case 
> sensitive, or not?  Neat, but where would that be used?

 Hmm, linking object modules coming from languages of the opposite symbol 
case sensitivity?  We don't seem to have support for that in the tools or 
the object formats though and a DWARF tag is surely not enough for that.

  Maciej

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] Mark Pascal as case-insensitive
  2025-11-15  2:30         ` Maciej W. Rozycki
@ 2025-11-17 15:03           ` Tom Tromey
  0 siblings, 0 replies; 7+ messages in thread
From: Tom Tromey @ 2025-11-17 15:03 UTC (permalink / raw)
  To: Maciej W. Rozycki; +Cc: Paul Koning, Tom Tromey, Tom de Vries, gdb-patches

>> On Fri, 14 Nov 2025, Paul Koning wrote:

>> Is the purpose of that mechanism to allow individual symbols to be case 
>> sensitive, or not?  Neat, but where would that be used?

Maciej>  Hmm, linking object modules coming from languages of the opposite symbol 
Maciej> case sensitivity?  We don't seem to have support for that in the tools or 
Maciej> the object formats though and a DWARF tag is surely not enough for that.

I think currently the DWARF standard specifies  DW_AT_identifier_case as
applying to the CU, not individual symbols.

However it seems to me that with LTO it would be better to relax this
and allow things like DW_AT_language on functions.  That way gdb could
react correctly when stepping through code where cross-language inlining
has been done.

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-11-17 15:28 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-13 16:28 [PATCH] Mark Pascal as case-insensitive Tom Tromey
2025-11-14 11:41 ` Tom de Vries
2025-11-14 12:59   ` Tom de Vries
2025-11-14 19:08     ` Tom Tromey
2025-11-14 22:02       ` Paul Koning
2025-11-15  2:30         ` Maciej W. Rozycki
2025-11-17 15:03           ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox