Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb: fix 32 bit build
@ 2025-04-24 11:47 Guinevere Larsen
  2025-04-24 11:48 ` Guinevere Larsen
  0 siblings, 1 reply; 6+ messages in thread
From: Guinevere Larsen @ 2025-04-24 11:47 UTC (permalink / raw)
  To: gdb-patches; +Cc: Guinevere Larsen

The recent commit dbbb9cfd3708a5b09b449c6cbc4d74dfec13904d added a
message using %ld to print an std::vector::size, which is of size_t
type. on 64 bit machines, size_t will be an unsigned long int, making
%ld work just fine, but on 32 bit ones, size_t will be unsigned int,
which causes build to fail.

This commit fixes that by using %zu instead.
---
 gdb/solib.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/solib.c b/gdb/solib.c
index 5c5cfbdd9b9..85ec6bb2f1e 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1230,7 +1230,7 @@ info_linker_namespace_command (const char *pattern, int from_tty)
 	  break;
 	}
       uiout->message
-	(_ ("There are %ld libraries loaded in linker namespace [[%d]]\n"),
+	(_ ("There are %zu libraries loaded in linker namespace [[%d]]\n"),
 	 solibs_to_print.size (), ns);
       uiout->message
 	(_ ("Displaying libraries for linker namespace [[%d]]:\n"), ns);

base-commit: 8c8e5b1f1abfbce913783da0f1cd1f85c60bd445
-- 
2.49.0


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

* Re: [PATCH] gdb: fix 32 bit build
  2025-04-24 11:47 [PATCH] gdb: fix 32 bit build Guinevere Larsen
@ 2025-04-24 11:48 ` Guinevere Larsen
  2025-04-24 13:21   ` Luis Machado
  0 siblings, 1 reply; 6+ messages in thread
From: Guinevere Larsen @ 2025-04-24 11:48 UTC (permalink / raw)
  To: gdb-patches

On 4/24/25 8:47 AM, Guinevere Larsen wrote:
> The recent commit dbbb9cfd3708a5b09b449c6cbc4d74dfec13904d added a
> message using %ld to print an std::vector::size, which is of size_t
> type. on 64 bit machines, size_t will be an unsigned long int, making
> %ld work just fine, but on 32 bit ones, size_t will be unsigned int,
> which causes build to fail.
>
> This commit fixes that by using %zu instead.

After sending the email I realized I forgot the bug trailer. I'll add

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32901

locally

> ---
>   gdb/solib.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/gdb/solib.c b/gdb/solib.c
> index 5c5cfbdd9b9..85ec6bb2f1e 100644
> --- a/gdb/solib.c
> +++ b/gdb/solib.c
> @@ -1230,7 +1230,7 @@ info_linker_namespace_command (const char *pattern, int from_tty)
>   	  break;
>   	}
>         uiout->message
> -	(_ ("There are %ld libraries loaded in linker namespace [[%d]]\n"),
> +	(_ ("There are %zu libraries loaded in linker namespace [[%d]]\n"),
>   	 solibs_to_print.size (), ns);
>         uiout->message
>   	(_ ("Displaying libraries for linker namespace [[%d]]:\n"), ns);
>
> base-commit: 8c8e5b1f1abfbce913783da0f1cd1f85c60bd445


-- 
Cheers,
Guinevere Larsen
She/Her/Hers


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

* Re: [PATCH] gdb: fix 32 bit build
  2025-04-24 11:48 ` Guinevere Larsen
@ 2025-04-24 13:21   ` Luis Machado
  2025-04-24 18:50     ` Guinevere Larsen
  0 siblings, 1 reply; 6+ messages in thread
From: Luis Machado @ 2025-04-24 13:21 UTC (permalink / raw)
  To: Guinevere Larsen, gdb-patches

On 4/24/25 12:48, Guinevere Larsen wrote:
> On 4/24/25 8:47 AM, Guinevere Larsen wrote:
>> The recent commit dbbb9cfd3708a5b09b449c6cbc4d74dfec13904d added a
>> message using %ld to print an std::vector::size, which is of size_t
>> type. on 64 bit machines, size_t will be an unsigned long int, making
>> %ld work just fine, but on 32 bit ones, size_t will be unsigned int,
>> which causes build to fail.

Pedantically...

s/build/the build

>>
>> This commit fixes that by using %zu instead.
> 
> After sending the email I realized I forgot the bug trailer. I'll add
> 
> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32901
> 
> locally
> 
>> ---
>>   gdb/solib.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/gdb/solib.c b/gdb/solib.c
>> index 5c5cfbdd9b9..85ec6bb2f1e 100644
>> --- a/gdb/solib.c
>> +++ b/gdb/solib.c
>> @@ -1230,7 +1230,7 @@ info_linker_namespace_command (const char *pattern, int from_tty)
>>         break;
>>       }
>>         uiout->message
>> -    (_ ("There are %ld libraries loaded in linker namespace [[%d]]\n"),
>> +    (_ ("There are %zu libraries loaded in linker namespace [[%d]]\n"),
>>        solibs_to_print.size (), ns);
>>         uiout->message
>>       (_ ("Displaying libraries for linker namespace [[%d]]:\n"), ns);
>>
>> base-commit: 8c8e5b1f1abfbce913783da0f1cd1f85c60bd445
> 
>

Thanks for the quick patch. This is OK.

Tested-By: Luis Machado <luis.machado@arm.com>
Approved-By: Luis Machado <luis.machado@arm.com>


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

* Re: [PATCH] gdb: fix 32 bit build
  2025-04-24 13:21   ` Luis Machado
@ 2025-04-24 18:50     ` Guinevere Larsen
  2025-04-25 11:05       ` Luis Machado
  0 siblings, 1 reply; 6+ messages in thread
From: Guinevere Larsen @ 2025-04-24 18:50 UTC (permalink / raw)
  To: Luis Machado, gdb-patches

On 4/24/25 10:21 AM, Luis Machado wrote:
> On 4/24/25 12:48, Guinevere Larsen wrote:
>> On 4/24/25 8:47 AM, Guinevere Larsen wrote:
>>> The recent commit dbbb9cfd3708a5b09b449c6cbc4d74dfec13904d added a
>>> message using %ld to print an std::vector::size, which is of size_t
>>> type. on 64 bit machines, size_t will be an unsigned long int, making
>>> %ld work just fine, but on 32 bit ones, size_t will be unsigned int,
>>> which causes build to fail.
> Pedantically...
>
> s/build/the build
>
>>> This commit fixes that by using %zu instead.
>> After sending the email I realized I forgot the bug trailer. I'll add
>>
>> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32901
>>
>> locally
>>
>>> ---
>>>    gdb/solib.c | 2 +-
>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/gdb/solib.c b/gdb/solib.c
>>> index 5c5cfbdd9b9..85ec6bb2f1e 100644
>>> --- a/gdb/solib.c
>>> +++ b/gdb/solib.c
>>> @@ -1230,7 +1230,7 @@ info_linker_namespace_command (const char *pattern, int from_tty)
>>>          break;
>>>        }
>>>          uiout->message
>>> -    (_ ("There are %ld libraries loaded in linker namespace [[%d]]\n"),
>>> +    (_ ("There are %zu libraries loaded in linker namespace [[%d]]\n"),
>>>         solibs_to_print.size (), ns);
>>>          uiout->message
>>>        (_ ("Displaying libraries for linker namespace [[%d]]:\n"), ns);
>>>
>>> base-commit: 8c8e5b1f1abfbce913783da0f1cd1f85c60bd445
>>
> Thanks for the quick patch. This is OK.
>
> Tested-By: Luis Machado <luis.machado@arm.com>
> Approved-By: Luis Machado <luis.machado@arm.com>
>
thanks for the quick review, I've pushed the patch!

-- 
Cheers,
Guinevere Larsen
She/Her/Hers


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

* Re: [PATCH] gdb: fix 32 bit build
  2025-04-24 18:50     ` Guinevere Larsen
@ 2025-04-25 11:05       ` Luis Machado
  2025-04-25 11:40         ` Guinevere Larsen
  0 siblings, 1 reply; 6+ messages in thread
From: Luis Machado @ 2025-04-25 11:05 UTC (permalink / raw)
  To: Guinevere Larsen, gdb-patches

On 4/24/25 19:50, Guinevere Larsen wrote:
> On 4/24/25 10:21 AM, Luis Machado wrote:
>> On 4/24/25 12:48, Guinevere Larsen wrote:
>>> On 4/24/25 8:47 AM, Guinevere Larsen wrote:
>>>> The recent commit dbbb9cfd3708a5b09b449c6cbc4d74dfec13904d added a
>>>> message using %ld to print an std::vector::size, which is of size_t
>>>> type. on 64 bit machines, size_t will be an unsigned long int, making
>>>> %ld work just fine, but on 32 bit ones, size_t will be unsigned int,
>>>> which causes build to fail.
>> Pedantically...
>>
>> s/build/the build
>>
>>>> This commit fixes that by using %zu instead.
>>> After sending the email I realized I forgot the bug trailer. I'll add
>>>
>>> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32901
>>>
>>> locally
>>>
>>>> ---
>>>>    gdb/solib.c | 2 +-
>>>>    1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/gdb/solib.c b/gdb/solib.c
>>>> index 5c5cfbdd9b9..85ec6bb2f1e 100644
>>>> --- a/gdb/solib.c
>>>> +++ b/gdb/solib.c
>>>> @@ -1230,7 +1230,7 @@ info_linker_namespace_command (const char *pattern, int from_tty)
>>>>          break;
>>>>        }
>>>>          uiout->message
>>>> -    (_ ("There are %ld libraries loaded in linker namespace [[%d]]\n"),
>>>> +    (_ ("There are %zu libraries loaded in linker namespace [[%d]]\n"),
>>>>         solibs_to_print.size (), ns);
>>>>          uiout->message
>>>>        (_ ("Displaying libraries for linker namespace [[%d]]:\n"), ns);
>>>>
>>>> base-commit: 8c8e5b1f1abfbce913783da0f1cd1f85c60bd445
>>>
>> Thanks for the quick patch. This is OK.
>>
>> Tested-By: Luis Machado <luis.machado@arm.com>
>> Approved-By: Luis Machado <luis.machado@arm.com>
>>
> thanks for the quick review, I've pushed the patch!
> 

Just checking, was this pushed? I noticed the bug wasn't updated. And then I
couldn't find it with git log.

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

* Re: [PATCH] gdb: fix 32 bit build
  2025-04-25 11:05       ` Luis Machado
@ 2025-04-25 11:40         ` Guinevere Larsen
  0 siblings, 0 replies; 6+ messages in thread
From: Guinevere Larsen @ 2025-04-25 11:40 UTC (permalink / raw)
  To: Luis Machado, gdb-patches

On 4/25/25 8:05 AM, Luis Machado wrote:
> On 4/24/25 19:50, Guinevere Larsen wrote:
>> On 4/24/25 10:21 AM, Luis Machado wrote:
>>> On 4/24/25 12:48, Guinevere Larsen wrote:
>>>> On 4/24/25 8:47 AM, Guinevere Larsen wrote:
>>>>> The recent commit dbbb9cfd3708a5b09b449c6cbc4d74dfec13904d added a
>>>>> message using %ld to print an std::vector::size, which is of size_t
>>>>> type. on 64 bit machines, size_t will be an unsigned long int, making
>>>>> %ld work just fine, but on 32 bit ones, size_t will be unsigned int,
>>>>> which causes build to fail.
>>> Pedantically...
>>>
>>> s/build/the build
>>>
>>>>> This commit fixes that by using %zu instead.
>>>> After sending the email I realized I forgot the bug trailer. I'll add
>>>>
>>>> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32901
>>>>
>>>> locally
>>>>
>>>>> ---
>>>>>     gdb/solib.c | 2 +-
>>>>>     1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/gdb/solib.c b/gdb/solib.c
>>>>> index 5c5cfbdd9b9..85ec6bb2f1e 100644
>>>>> --- a/gdb/solib.c
>>>>> +++ b/gdb/solib.c
>>>>> @@ -1230,7 +1230,7 @@ info_linker_namespace_command (const char *pattern, int from_tty)
>>>>>           break;
>>>>>         }
>>>>>           uiout->message
>>>>> -    (_ ("There are %ld libraries loaded in linker namespace [[%d]]\n"),
>>>>> +    (_ ("There are %zu libraries loaded in linker namespace [[%d]]\n"),
>>>>>          solibs_to_print.size (), ns);
>>>>>           uiout->message
>>>>>         (_ ("Displaying libraries for linker namespace [[%d]]:\n"), ns);
>>>>>
>>>>> base-commit: 8c8e5b1f1abfbce913783da0f1cd1f85c60bd445
>>> Thanks for the quick patch. This is OK.
>>>
>>> Tested-By: Luis Machado <luis.machado@arm.com>
>>> Approved-By: Luis Machado <luis.machado@arm.com>
>>>
>> thanks for the quick review, I've pushed the patch!
>>
> Just checking, was this pushed? I noticed the bug wasn't updated. And then I
> couldn't find it with git log.
>
Hi Luis,

I was sure that this was pushed, but what happened instead was that I 
juggled my branches incorrectly, and instead pushed this (unapproved) 
patch instead: 
https://inbox.sourceware.org/gdb-patches/20250424120553.1783279-1-guinevere@redhat.com/T/#u 


I'll revert that and push this one instead. I shouldn't git when I'm 
that tired, it seems...

-- 
Cheers,
Guinevere Larsen
She/Her/Hers


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

end of thread, other threads:[~2025-04-25 11:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-04-24 11:47 [PATCH] gdb: fix 32 bit build Guinevere Larsen
2025-04-24 11:48 ` Guinevere Larsen
2025-04-24 13:21   ` Luis Machado
2025-04-24 18:50     ` Guinevere Larsen
2025-04-25 11:05       ` Luis Machado
2025-04-25 11:40         ` Guinevere Larsen

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