Re: [PATCH 2/2 v5] Fix reverse stepping multiple contiguous PC ranges over the line table.

Simon Marchi via Gdb-patches
2023-06-23T17:49:45Z

On 6/22/23 16:38, Carl Love wrote:
> Simon:
>
> On Mon, 2023-06-19 at 13:58 -0400, Simon Marchi wrote:
> <snip>
>
>>
> 100644
>>> --- a/gdb/infrun.c
>>> +++ b/gdb/infrun.c
>>> @@ -114,6 +114,9 @@ static struct async_event_handler
>>> *infrun_async_inferior_event_token;
>>> Starts off as -1, indicating "never enabled/disabled". */
>>> static int infrun_is_async = -1;
>>>
>>> +static CORE_ADDR update_line_range_start (CORE_ADDR pc,
>>> + struct
>>> execution_control_state *ecs);
>>> +
>>
>> This forward-declaration is not needed.
>
> I tried removing the forward-declaration and the compile fails with the
> message:
>
> ../../binutils-gdb-reverse-multiple-contiguous/gdb/infrun.c:6773:1:
> error: no previous declaration for ‘CORE_ADDR
> update_line_range_start(CORE_ADDR, execution_control_state*)’ [-
> Werror=missing-declarations]
> 6773 | update_line_range_start (CORE_ADDR pc, struct
> execution_control_state *ecs)
> | ^~~~~~~~~~~~~~~~~~~~~~~
> cc1plus: all warnings being treated as errors
> make[2]: *** [Makefile:1922: infrun.o] Error 1
> make[2]: Leaving directory '/home/carll/GDB/build-reverse-multiple-
> contiguous/gdb'
> make[1]: *** [Makefile:13569: all-gdb] Error 2
> make[1]: Leaving directory '/home/carll/GDB/build-reverse-multiple-
> contiguous'
> make: *** [Makefile:1005: all] Error 2
>
> Leaving the forward declaration in the code.

Because you need to put "static" at the other place (line 6813).

Simon