GDB 16.0.90 available for testing

Tom de Vries tdevries@suse.de
Sat Jan 4 11:00:05 GMT 2025


On 1/4/25 11:30, Eli Zaretskii wrote:
>> Date: Fri, 3 Jan 2025 10:05:14 +0000
>> Cc: gdb-patches@sourceware.org
>> From: Luis Machado <luis.machado@arm.com>
>>
>> On 1/2/25 17:40, Eli Zaretskii wrote:
>>>> Date: Sun, 29 Dec 2024 14:54:36 +0200
>>>> From: Eli Zaretskii <eliz@gnu.org>
>>>> Cc: gdb-patches@sourceware.org
>>>>
>>>> 2. Compilation error in event-top.c:
>>>>
>>>>
>>>>         CXX    event-top.o
>>>>       In file included from d:\usr\include\winsock2.h:69,
>>>> 		      from ./../gdbsupport/gdb_select.h:30,
>>>> 		      from event-top.c:43:
>>>>       event-top.c: In function 'fd_set* fd_copy(fd_set*, const fd_set*, int)':
>>>>       event-top.c:1279:22: error: invalid conversion from 'const fd_set*' to 'fd_set*' [-fpermissive]
>>>>        1279 |     if (FD_ISSET (i, src))
>>>> 	   |                      ^
>>>> 	   |                      |
>>>> 	   |                      const fd_set*
>>>>       d:\usr\include\winsock.h:164:50: note:   initializing argument 2 of 'int __FD_ISSET(SOCKET, fd_set*)'
>>>>         164 | __CRT_ALIAS int __FD_ISSET( SOCKET __fd, fd_set *__set )
>>>> 	   |                                          ~~~~~~~~^~~~~
>>>>
>>>> I solved it with an explicit cast, like this:
>>>>
>>>> --- gdb/event-top.c~0	2024-12-29 04:50:07.000000000 +0200
>>>> +++ gdb/event-top.c	2024-12-29 12:33:48.356713700 +0200
>>>> @@ -1276,7 +1276,7 @@ fd_copy (fd_set *dst, const fd_set *src,
>>>>   {
>>>>     FD_ZERO (dst);
>>>>     for (int i = 0; i < n; ++i)
>>>> -    if (FD_ISSET (i, src))
>>>> +    if (FD_ISSET (i, (fd_set *)src))
>>>>         FD_SET (i, dst);
>>>>   
>>>>     return dst;
>>>>
>>>> But I don't know if this will produce problems for other
>>>> implementations of FD_ISSET.
>>>
>>> No one responded to this part.  Is it okay to fix this, or would
>>> someone please try this first on other platforms?
>>>
>>
>> I gave this a try on aarch64-linux and it builds fine. I see no changes to the
>> testsuite.
>>
>>>> 4. Running "maint selftest" finds one failure:
>>>>
>>>>    Running selftest help_doc_invariants.
>>>>    help doc broken invariant: command 'signal-event' help doc has over-long line
>>>>    Self test failed: self-test failed at unittests/command-def-selftests.c:121
>>>>
>>>> I fixed that with the following trivial change:
>>>>
>>>> --- gdb/windows-nat.c~0	2024-12-29 04:50:07.000000000 +0200
>>>> +++ gdb/windows-nat.c	2024-12-29 12:54:32.346946000 +0200
>>>> @@ -3114,9 +3114,9 @@ _initialize_windows_nat ()
>>>>   
>>>>     add_com ("signal-event", class_run, signal_event_command, _("\
>>>>   Signal a crashed process with event ID, to allow its debugging.\n\
>>>> -This command is needed in support of setting up GDB as JIT debugger on \
>>>> -MS-Windows.  The command should be invoked from the GDB command line using \
>>>> -the '-ex' command-line option.  The ID of the event that blocks the \
>>>> +This command is needed in support of setting up GDB as JIT debugger on\n\
>>>> +MS-Windows.  The command should be invoked from the GDB command line using\n\
>>>> +the '-ex' command-line option.  The ID of the event that blocks the\n\
>>>>   crashed process will be supplied by the Windows JIT debugging mechanism."));
>>>>   
>>>>   #ifdef __CYGWIN__
>>>
>>> And what about this one? okay to commit?
>>
>> This looks OK to me, as it is a simple formatting fix for the text. Feel free to
>> push to master and the 16 branch.
>>
>> Approved-By: Luis Machado <luis.machado@arm.com>
> 
> Thanks, I've now installed both changes on the master branch and then
> cherry-picked them to gdb-16-branch.

Hi Eli,

thanks for fixing this.

I suspect that this should be done using a const_cast though, I've 
submitted a  follow-up patch implementing that ( 
https://sourceware.org/pipermail/gdb-patches/2025-January/214463.html ).

Thanks,
- Tom



More information about the Gdb-patches mailing list