This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] x86_64-windows GDB crash due to fs_base/gs_base registers


On 06/26/2018 10:53 PM, Joel Brobecker wrote:

> ... and then decide whether we want to reorganize a bit the way
> we get the index of each register in the CONTEXT structure. I would
> say that we do want to do something. Perhaps, the path of least
> resistance is to just change the mappings structure from a C array
> to a gdb::array_view as you suggested. I may have a preference for
> the approach I took, but it is a large diff, and it's not clear
> whether it's going to be beneficial in the long run...
> 
> You pick! ;-) I'll take care of your comments if you chose the first
> patch. I'll send a new one if you prefere the gdb::array_view approach.

In all honesty, I'd just leave it alone as is, this sort of array is
used for other targets not just Windows (e.g., amd64fbsd64_r_reg_offset, 
amd64_linux_gregset32_reg_offset).  If we went for safety, we likely
wouldn't have noticed the unnecessary <unavailable> registers.
On the other hand, if we're going for safely, I'm fine with your
version too, I don't really mind your way vs array_view.  Up to you.

I do think that it would be nice if gdbserver is changed in the
same way to avoid further divergence (until some brave soul
spends time merging gdb's and gdbserver's windows-nat.c and
win32-low.c, probably the easiest backends to merge).

Thanks,
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]