This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Small clean up of use_displaced_stepping
- From: Simon Marchi <simon dot marchi at polymtl dot ca>
- To: Kevin Buettner <kevinb at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 2 Mar 2020 15:59:27 -0500
- Subject: Re: [PATCH] Small clean up of use_displaced_stepping
- Dkim-filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 022KxSq1007593
- References: <20200227224424.270604-1-simon.marchi@polymtl.ca> <20200229194124.6534e0ec@f31-4.lan>
On 2020-02-29 9:41 p.m., Kevin Buettner wrote:
> On Thu, 27 Feb 2020 17:44:24 -0500
> Simon Marchi <simon.marchi@polymtl.ca> wrote:
>
>> This function returns the result of a quite big condition. I think it
>> would be more redeable if it was broken up in smaller pieces and
>
> s/redeable/readable/
Fixed.
>> commented. This is what this patch does.
>>
>> I also introduced gdbarch_supports_displaced_stepping, since it shows
>> the intent better than checking for gdbarch_displaced_step_copy_insn_p.
>> I also used that new function in displaced_step_prepare_throw.
>>
>> I also updated the comment on top of can_use_displaced_stepping, which
>> seemed a bit outdated with respect to non-stop. The comment likely
>> dates from before it was possible to have targets that always operate
>> non-stop under the hood, even when the user-visible mode is all-stop.
>>
>> No functional changes intended.
>>
>> gdb/ChangeLog:
>>
>> * infrun.c (gdbarch_supports_displaced_stepping): New.
>> (use_displaced_stepping): Break up conditions in smaller pieces.
>> Use gdbarch_supports_displaced_stepping.
>> (displaced_step_prepare_throw): Use
>> gdbarch_supports_displaced_stepping.
>
> I read through the patch. It appears to be equivalent to the terse
> conditional that used to be there. I find it much easier to understand
> now. Thanks for doing this.
Thanks for the review, I pushed the patch.
Simon