Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Remove unused str_backtrace_unavailable variable
@ 2026-05-01  7:31 Luis Machado
  2026-05-01 12:59 ` Tom Tromey
  2026-05-01 14:17 ` Simon Marchi
  0 siblings, 2 replies; 6+ messages in thread
From: Luis Machado @ 2026-05-01  7:31 UTC (permalink / raw)
  To: gdb-patches

The str_backtrace_unavailable variable is initialized but never
used anywhere in the codebase.
---
 gdb/bt-utils.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/gdb/bt-utils.c b/gdb/bt-utils.c
index 7fc8d04f306..21a291c3df3 100644
--- a/gdb/bt-utils.c
+++ b/gdb/bt-utils.c
@@ -146,7 +146,6 @@ gdb_internal_backtrace_1 ()
 #endif
 
 static const char *str_backtrace = "----- Backtrace -----\n";
-static const char *str_backtrace_unavailable = "Backtrace unavailable\n";
 
 #endif /* GDB_PRINT_INTERNAL_BACKTRACE */
 
@@ -157,7 +156,6 @@ gdb_internal_backtrace_init_str ()
 {
 #ifdef GDB_PRINT_INTERNAL_BACKTRACE
   str_backtrace = _("----- Backtrace -----\n");
-  str_backtrace_unavailable = _("Backtrace unavailable\n");
 #endif
 }
 
-- 
2.34.1


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

* Re: [PATCH] Remove unused str_backtrace_unavailable variable
  2026-05-01  7:31 [PATCH] Remove unused str_backtrace_unavailable variable Luis Machado
@ 2026-05-01 12:59 ` Tom Tromey
  2026-05-01 14:17 ` Simon Marchi
  1 sibling, 0 replies; 6+ messages in thread
From: Tom Tromey @ 2026-05-01 12:59 UTC (permalink / raw)
  To: Luis Machado; +Cc: gdb-patches

>>>>> "Luis" == Luis Machado <luis.machado@amd.com> writes:

Luis> The str_backtrace_unavailable variable is initialized but never
Luis> used anywhere in the codebase.

Thanks.

Approved-By: Tom Tromey <tom@tromey.com>

Tom

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

* Re: [PATCH] Remove unused str_backtrace_unavailable variable
  2026-05-01  7:31 [PATCH] Remove unused str_backtrace_unavailable variable Luis Machado
  2026-05-01 12:59 ` Tom Tromey
@ 2026-05-01 14:17 ` Simon Marchi
  2026-05-01 14:20   ` Luis
  2026-05-01 15:50   ` Tom Tromey
  1 sibling, 2 replies; 6+ messages in thread
From: Simon Marchi @ 2026-05-01 14:17 UTC (permalink / raw)
  To: Luis Machado, gdb-patches

On 5/1/26 3:31 AM, Luis Machado wrote:
> The str_backtrace_unavailable variable is initialized but never
> used anywhere in the codebase.
> ---
>  gdb/bt-utils.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/gdb/bt-utils.c b/gdb/bt-utils.c
> index 7fc8d04f306..21a291c3df3 100644
> --- a/gdb/bt-utils.c
> +++ b/gdb/bt-utils.c
> @@ -146,7 +146,6 @@ gdb_internal_backtrace_1 ()
>  #endif
>  
>  static const char *str_backtrace = "----- Backtrace -----\n";
> -static const char *str_backtrace_unavailable = "Backtrace unavailable\n";
>  
>  #endif /* GDB_PRINT_INTERNAL_BACKTRACE */
>  
> @@ -157,7 +156,6 @@ gdb_internal_backtrace_init_str ()
>  {
>  #ifdef GDB_PRINT_INTERNAL_BACKTRACE
>    str_backtrace = _("----- Backtrace -----\n");
> -  str_backtrace_unavailable = _("Backtrace unavailable\n");
>  #endif
>  }

Seems quite obvious to me, but I would wait for Andrew to confirm that
this wasn't meant to be used somewhere.  For instance, in the
libbacktrace_error function.  But I think the message there is clear, so
I'd be fine with just deleting the variable.

Simon

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

* Re: [PATCH] Remove unused str_backtrace_unavailable variable
  2026-05-01 14:17 ` Simon Marchi
@ 2026-05-01 14:20   ` Luis
  2026-05-01 15:50   ` Tom Tromey
  1 sibling, 0 replies; 6+ messages in thread
From: Luis @ 2026-05-01 14:20 UTC (permalink / raw)
  To: Simon Marchi, Luis Machado, gdb-patches

On 01/05/2026 15:17, Simon Marchi wrote:
> On 5/1/26 3:31 AM, Luis Machado wrote:
>> The str_backtrace_unavailable variable is initialized but never
>> used anywhere in the codebase.
>> ---
>>   gdb/bt-utils.c | 2 --
>>   1 file changed, 2 deletions(-)
>>
>> diff --git a/gdb/bt-utils.c b/gdb/bt-utils.c
>> index 7fc8d04f306..21a291c3df3 100644
>> --- a/gdb/bt-utils.c
>> +++ b/gdb/bt-utils.c
>> @@ -146,7 +146,6 @@ gdb_internal_backtrace_1 ()
>>   #endif
>>   
>>   static const char *str_backtrace = "----- Backtrace -----\n";
>> -static const char *str_backtrace_unavailable = "Backtrace unavailable\n";
>>   
>>   #endif /* GDB_PRINT_INTERNAL_BACKTRACE */
>>   
>> @@ -157,7 +156,6 @@ gdb_internal_backtrace_init_str ()
>>   {
>>   #ifdef GDB_PRINT_INTERNAL_BACKTRACE
>>     str_backtrace = _("----- Backtrace -----\n");
>> -  str_backtrace_unavailable = _("Backtrace unavailable\n");
>>   #endif
>>   }
> 
> Seems quite obvious to me, but I would wait for Andrew to confirm that
> this wasn't meant to be used somewhere.  For instance, in the
> libbacktrace_error function.  But I think the message there is clear, so
> I'd be fine with just deleting the variable.

Sorry, I just pushed this. But we can still wait for Andrew to chime in 
and tell us otherwise.

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

* Re: [PATCH] Remove unused str_backtrace_unavailable variable
  2026-05-01 14:17 ` Simon Marchi
  2026-05-01 14:20   ` Luis
@ 2026-05-01 15:50   ` Tom Tromey
  2026-05-01 15:58     ` Machado, Luis
  1 sibling, 1 reply; 6+ messages in thread
From: Tom Tromey @ 2026-05-01 15:50 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Luis Machado, gdb-patches

>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

Simon> Seems quite obvious to me, but I would wait for Andrew to confirm that
Simon> this wasn't meant to be used somewhere.  For instance, in the
Simon> libbacktrace_error function.  But I think the message there is clear, so
Simon> I'd be fine with just deleting the variable.

I considered this before approving but my view is that if it is needed,
it is trivial to revert a deletion like this.

I'd generally consider the removal of an unused object to be obvious,
with the caveats:

1. If it looks like maybe it *ought* to be used, then send an RFA
   instead;
2. Be sure to check Insight as it uses a few things that are otherwise
   unused.

Tom

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

* Re: [PATCH] Remove unused str_backtrace_unavailable variable
  2026-05-01 15:50   ` Tom Tromey
@ 2026-05-01 15:58     ` Machado, Luis
  0 siblings, 0 replies; 6+ messages in thread
From: Machado, Luis @ 2026-05-01 15:58 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi; +Cc: gdb-patches

Thanks for the heads up on Insight. For context, this came up when using llvm.

It got grumpy about the unused-but-initialized value.

________________________________________
From: Tom Tromey <tom@tromey.com>
Sent: Friday, 1 May 2026 16:50
To: Simon Marchi
Cc: Machado, Luis; gdb-patches@sourceware.org
Subject: Re: [PATCH] Remove unused str_backtrace_unavailable variable

Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.


>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes:

Simon> Seems quite obvious to me, but I would wait for Andrew to confirm that
Simon> this wasn't meant to be used somewhere.  For instance, in the
Simon> libbacktrace_error function.  But I think the message there is clear, so
Simon> I'd be fine with just deleting the variable.

I considered this before approving but my view is that if it is needed,
it is trivial to revert a deletion like this.

I'd generally consider the removal of an unused object to be obvious,
with the caveats:

1. If it looks like maybe it *ought* to be used, then send an RFA
   instead;
2. Be sure to check Insight as it uses a few things that are otherwise
   unused.

Tom

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

end of thread, other threads:[~2026-05-01 15:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-01  7:31 [PATCH] Remove unused str_backtrace_unavailable variable Luis Machado
2026-05-01 12:59 ` Tom Tromey
2026-05-01 14:17 ` Simon Marchi
2026-05-01 14:20   ` Luis
2026-05-01 15:50   ` Tom Tromey
2026-05-01 15:58     ` Machado, Luis

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