Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Remove some "stabsread" references
@ 2026-07-16 20:17 Tom Tromey
  2026-07-23 15:31 ` Guinevere Larsen
  0 siblings, 1 reply; 3+ messages in thread
From: Tom Tromey @ 2026-07-16 20:17 UTC (permalink / raw)
  To: gdb-patches; +Cc: Tom Tromey

I noticed a stray reference to "stabsread".  This patch removes these.

I also removed a bit of Ada code that, I believe, was only relevant to
the stabs reader.
---
 gdb/ada-lang.c | 5 -----
 gdb/gdbtypes.h | 4 ++--
 gdb/symtab.h   | 4 +---
 3 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 85b08af8c06..b6de3b9e0fb 100644
--- a/gdb/ada-lang.c
+++ b/gdb/ada-lang.c
@@ -3328,11 +3328,6 @@ ada_index_type (struct type *type, int n, const char *name)
 	  type = type->target_type ();
 	}
       result_type = ada_check_typedef (type)->index_type ()->target_type ();
-      /* FIXME: The stabs type r(0,0);bound;bound in an array type
-	 has a target type of TYPE_CODE_UNDEF.  We compensate here, but
-	 perhaps stabsread.c would make more sense.  */
-      if (result_type && result_type->code () == TYPE_CODE_UNDEF)
-	result_type = NULL;
     }
   else
     {
diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
index 572bf6d3d6f..f2132e63e8c 100644
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -1611,8 +1611,8 @@ struct fn_fieldlist
 {
 
   /* The overloaded name.
-     This is generally allocated in the objfile's obstack.
-     However stabsread.c sometimes uses malloc.  */
+     This is generally allocated in the objfile's obstack, but it
+     could also be statically allocated.  */
 
   const char *name;
 
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 7b96b8c989c..6443216fd7f 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -803,9 +803,7 @@ struct minimal_symbol : public general_symbol_info
     m_target_flag_2 = target_flag_2;
   }
 
-  /* Size of this symbol.  stabs_end_psymtab in stabsread.c uses this
-     information to calculate the end of the partial symtab based on the
-     address of the last symbol plus the size of the last symbol.  */
+  /* Size of this symbol.  */
 
   unsigned long m_size;
 

base-commit: a9b7bbb1729d5ac6d3623bfe56a54d8b9936f160
-- 
2.55.0


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

* Re: [PATCH] Remove some "stabsread" references
  2026-07-16 20:17 [PATCH] Remove some "stabsread" references Tom Tromey
@ 2026-07-23 15:31 ` Guinevere Larsen
  2026-07-23 16:01   ` Tom Tromey
  0 siblings, 1 reply; 3+ messages in thread
From: Guinevere Larsen @ 2026-07-23 15:31 UTC (permalink / raw)
  To: Tom Tromey, gdb-patches

On 7/16/26 5:17 PM, Tom Tromey wrote:
> I noticed a stray reference to "stabsread".  This patch removes these.
>
> I also removed a bit of Ada code that, I believe, was only relevant to
> the stabs reader.

This seems pretty obvious. Especially since the comment in symtab.h (at 
least to me), implies that m_size is only used for stabsread, so it 
feels more accurate now.

Reviewed-By: Guinevere Larsen <guinevere@redhat.com>

> ---
>   gdb/ada-lang.c | 5 -----
>   gdb/gdbtypes.h | 4 ++--
>   gdb/symtab.h   | 4 +---
>   3 files changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
> index 85b08af8c06..b6de3b9e0fb 100644
> --- a/gdb/ada-lang.c
> +++ b/gdb/ada-lang.c
> @@ -3328,11 +3328,6 @@ ada_index_type (struct type *type, int n, const char *name)
>   	  type = type->target_type ();
>   	}
>         result_type = ada_check_typedef (type)->index_type ()->target_type ();
> -      /* FIXME: The stabs type r(0,0);bound;bound in an array type
> -	 has a target type of TYPE_CODE_UNDEF.  We compensate here, but
> -	 perhaps stabsread.c would make more sense.  */
> -      if (result_type && result_type->code () == TYPE_CODE_UNDEF)
> -	result_type = NULL;
>       }
>     else
>       {
> diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h
> index 572bf6d3d6f..f2132e63e8c 100644
> --- a/gdb/gdbtypes.h
> +++ b/gdb/gdbtypes.h
> @@ -1611,8 +1611,8 @@ struct fn_fieldlist
>   {
>   
>     /* The overloaded name.
> -     This is generally allocated in the objfile's obstack.
> -     However stabsread.c sometimes uses malloc.  */
> +     This is generally allocated in the objfile's obstack, but it
> +     could also be statically allocated.  */
>   
>     const char *name;
>   
> diff --git a/gdb/symtab.h b/gdb/symtab.h
> index 7b96b8c989c..6443216fd7f 100644
> --- a/gdb/symtab.h
> +++ b/gdb/symtab.h
> @@ -803,9 +803,7 @@ struct minimal_symbol : public general_symbol_info
>       m_target_flag_2 = target_flag_2;
>     }
>   
> -  /* Size of this symbol.  stabs_end_psymtab in stabsread.c uses this
> -     information to calculate the end of the partial symtab based on the
> -     address of the last symbol plus the size of the last symbol.  */
> +  /* Size of this symbol.  */
>   
>     unsigned long m_size;
>   
>
> base-commit: a9b7bbb1729d5ac6d3623bfe56a54d8b9936f160


-- 
Cheers,
Guinevere Larsen
it/its
she/her (deprecated)


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

* Re: [PATCH] Remove some "stabsread" references
  2026-07-23 15:31 ` Guinevere Larsen
@ 2026-07-23 16:01   ` Tom Tromey
  0 siblings, 0 replies; 3+ messages in thread
From: Tom Tromey @ 2026-07-23 16:01 UTC (permalink / raw)
  To: Guinevere Larsen; +Cc: Tom Tromey, gdb-patches

>>>>> "Guinevere" == Guinevere Larsen <guinevere@redhat.com> writes:

Guinevere> On 7/16/26 5:17 PM, Tom Tromey wrote:
>> I noticed a stray reference to "stabsread".  This patch removes these.
>> 
>> I also removed a bit of Ada code that, I believe, was only relevant to
>> the stabs reader.

Guinevere> This seems pretty obvious. Especially since the comment in symtab.h
Guinevere> (at least to me), implies that m_size is only used for stabsread, so
Guinevere> it feels more accurate now.

Guinevere> Reviewed-By: Guinevere Larsen <guinevere@redhat.com>

Thank you, I'm going to check this in.

Tom

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

end of thread, other threads:[~2026-07-23 16:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-07-16 20:17 [PATCH] Remove some "stabsread" references Tom Tromey
2026-07-23 15:31 ` Guinevere Larsen
2026-07-23 16:01   ` Tom Tromey

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