Re: [patch] i386-nto-tdep.c: Add support for xmm registers.

Joel Brobecker
2009-06-11T15:09:42Z

> * i386-nto-tdep.c (i386_nto_target): Remove definition.
> (i386nto_regset_id): Add case for SSE register set.
> (i386nto_register_area): Correctly calculate offsets and sizes for all
> supported registers.
> (I386_NTO_SIGCONTEXT_OFFSET): Remove macro definition.
> (i386nto_sigcontext_addr): Use better method of retrieving sigcontext
> pointer.
> (init_i386nto_ops): Remove i386_nto_target.
> (i386nto_init_abi): Remove nto_svr4_so_ops indirection. Properly setup
> tdep params sc_reg_offset and sc_num_regs. Remove nto_svr4_so_ops and
> make changes accordingly.

I won't pretend I understand everything you do in this patch, but
the pieces that are related to registers and sigcontext seem to be
sensible.

However, I found a few hunks which I think are not related to XMM
register support, but rather to shared library support...

> -/* Target vector for QNX NTO x86. */
> -static struct nto_target_ops i386_nto_target;

For next time, it'll be easier for me to review your patches if you leave
this sort of cleanup for a future patch...

> static void
> i386nto_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
> {
> struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
> - static struct target_so_ops nto_svr4_so_ops;

Seems unrelated to the patch, no? Same question regarding the hunk
below:

> @@ -279,31 +345,17 @@ i386nto_init_abi (struct gdbarch_info in
> set_solib_svr4_fetch_link_map_offsets
> (gdbarch, svr4_ilp32_fetch_link_map_offsets);
>
> - /* Initialize this lazily, to avoid an initialization order
> - dependency on solib-svr4.c's _initialize routine. */
> - if (nto_svr4_so_ops.in_dynsym_resolve_code == NULL)
> - {
> - nto_svr4_so_ops = svr4_so_ops;
> + /* Our loader handles solib relocations differently than svr4. */
> + svr4_so_ops.relocate_section_addresses = nto_relocate_section_addresses;
>
> - /* Our loader handles solib relocations differently than svr4. */
> - nto_svr4_so_ops.relocate_section_addresses
> - = nto_relocate_section_addresses;
> -
> - /* Supply a nice function to find our solibs. */
> - nto_svr4_so_ops.find_and_open_solib
> - = nto_find_and_open_solib;
> -
> - /* Our linker code is in libc. */
> - nto_svr4_so_ops.in_dynsym_resolve_code
> - = nto_in_dynsym_resolve_code;
> - }
> - set_solib_ops (gdbarch, &nto_svr4_so_ops);
> + /* Supply a nice function to find our solibs. */
> + svr4_so_ops.find_and_open_solib = nto_find_and_open_solib;
>
> - nto_set_target (&i386_nto_target);
> -}
> + /* Our linker code is in libc. */
> + svr4_so_ops.in_dynsym_resolve_code = nto_in_dynsym_resolve_code;
>
> -/* Provide a prototype to silence -Wmissing-prototypes. */
> -extern initialize_file_ftype _initialize_i386nto_tdep;
> + set_solib_ops (gdbarch, &svr4_so_ops);
> +}
>
> void
> _initialize_i386nto_tdep (void)

--
Joel