Re: [PATCH 2/4] Add amd64_windows_gregset_reg_offset

Jon Turney
2020-09-18T16:31:56Z

On 20/08/2020 23:08, Simon Marchi wrote:
> On 2020-08-12 3:18 p.m., Jon Turney wrote:
>> Register a gregset_reg_offset array for Cygwin x86_64 core dump parsing
>> (this causes the generic i386_iterate_over_regset_sections() '.reg'
>> section iterator to get installed by i386_gdbarch_init()).

One thing I notice is that, after this change, we now have (for both x86
and x86_64), a mapping between regno and CONTEXT offset both as a
gregset_reg_offset mapping (used when interpreting coredumps) and a
similar mapping fed into windows_set_context_register_offsets() (used on
an inferior process).

There's probably some scope for de-duplication and genericization there.

>> gdb/ChangeLog:
>>
>> 2020-07-01 Jon Turney <jon.turney@dronecode.org.uk>
>>
>> * amd64-windows-tdep.c(amd64_windows_gregset_reg_offset): Add.
>> (amd64_windows_init_abi_common): ... and register.
>
> That looks reasonable. I think i386_iterate_over_regset_sections should
> be made static, if you want to make another (obvious I would say) patch.