From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Kettenis To: Jiri Smid Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA]: x86_64 target - multiarch Date: Wed, 05 Sep 2001 15:31:00 -0000 Message-id: References: X-SW-Source: 2001-09/msg00045.html Hi Jiri, This starts looking good. A few notes though. * i386-tdep.h: Is it really necessary to include all those FPU register numbers in `struct gdbarch_tdep'? At the moment you use at least the same order for most things as the standard i386 register numbering scheme, so I think you can remove a few variables from `struct gdbarch_tdep' and define the register numbers relative to the remaining variables. For example you could remove fctrl_regnum, fstat_regnum, etc. and do #define FCTRL_REGNUM FIRST_FPU_CTRL_REGNUM #define FSTAT_REGNUM FIRST_FPU_CTRL_REGNUM + 1 etc. * x86_64-linux-nat.c: Including is considered bad practice. You can probably use instead of and instead of . There is a while load of backwards compatibility stuff in this file that's probably unecessary on x86_64. You probably copied it from i386-linux-nat.c, where this stuff is necessary to be able to run GDB on Linux 2.0, and with older versions of glibc. I assume that all Linux kernels that run on the x86_64 have the PTRACE_GETREGS, PTRACE_GETFPREGS, PTRACE_GETFPXREGS, etc. requests, so you can probably get rid of all the HAVE_PTRACE_XXX hackery. The code to fetch registers directly from the U area (fetch_register, old_fetch_inferior_registers) can probably be removed too. child_resume() and child_xfer_memory appear to have some formatting problems. Might be related to using tabs instead of spaces. Eli already pointed out that the you should try to use the generic hardware watchpoint support in i386-nat.c instead of rolling your own here. Check the current i386-linux-nat.c to see how you can use that stuff. * x86_64-nat.c: If you get rid of the U area register reading code above, the stuff in this file shouldn't be necessary anymore (at least in theory). * x86_64-tdep.c: The implementation of x86_64_register_convert_to_virtual() is almost certainly wrong. However, the floating-point stuff is a bit in flux right now, and you might want to fix this later, when things have settled a bit. Please fix merge_classes() to use an ISO C function definition. Again some formatting problems. Mark