Re: [PATCH 1/2] gdb: use get_current_frame consistently in print_stop_location

Tom de Vries
2026-04-10T10:17:33Z

On 4/10/26 10:57 AM, Andrew Burgess wrote:
> Tom de Vries <tdevries@suse.de> writes:
>
>> On 4/9/26 10:54 AM, Andrew Burgess wrote:
>>>> So I'm proposing a change to this patch (attached below, doesn't apply
>>>> to the first but to the second patch) that:
>>>> - introduces a variable print_frame
>>>> - assigns get_selected_frame (nullptr) to print_frame
>>>> - adds a comment explaining how print_frame relates to the stop frame
>>>> - uses print_frame everywhere in the function
>>>>
>>>> I tested the series in combination with the attached patch on
>>>> x86_64-linux, and found no regressions.
>>> Thanks for the great analysis, and explanation, I wasn't aware of this
>>> aspect of bpstat_print. Given this new information, I think your patch
>>> is the right solution.
>>>
>>> Approved-By: Andrew Burgess<aburgess@redhat.com>
>>
>> Hi Andrew,
>>
>> my initial idea here was that the patch I posted could be trivially
>> merged with the first patch, but upon attempting this I ended up
>> re-editing the series. I'm currently testing this, and will submit if
>> that goes ok.
>>
>> The content of the patch series should be what you posted plus
>> aforementioned patch, the changes I made are merely refactoring.
>
> The patch you posted applies on top of my patch #1, but I think it would
> be best if you just merged those two patches together. As you point
> out, my patch moves in the wrong direction. You're patch basically
> reverts mine and does something different, which is the right thing to
> do.

The problem with doing so is that it makes the first patch nonsensical,
in the sense that it results in using the selected frame in one part of
the condition, and the stop pc (corresponding to the current frame or
stop frame) in another part of the condition. So I ended up moving the
patch to the end of the series.

Submitted here (
https://sourceware.org/pipermail/gdb-patches/2026-April/226422.html ).

Thanks,
- Tom