aboutsummaryrefslogtreecommitdiff
path: root/gdb/x86-64-tdep.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2002-12-21 21:09:58 +0000
committerMark Kettenis <kettenis@gnu.org>2002-12-21 21:09:58 +0000
commit2213a65dbc17284cd192a9775d86b70c918a15b4 (patch)
treeea5f620e428df2b616770c62a3a85cf0afe28480 /gdb/x86-64-tdep.c
parent05816f706ec4cb2e789828fa8edb8ea30593933b (diff)
downloadgdb-2213a65dbc17284cd192a9775d86b70c918a15b4.zip
gdb-2213a65dbc17284cd192a9775d86b70c918a15b4.tar.gz
gdb-2213a65dbc17284cd192a9775d86b70c918a15b4.tar.bz2
* x86-64-tdep.h (x86_64_init_abi): New prototype.
* x86-64-tdep.c (i386_fp_regnum_p): Remove function. (x86_64_init_abi): Make non-static. Set number of pseudo registers to 0. (x86_64_gdbarch_init): Remove function. (_initialize_x86_64_tdep): Renove register_gdbarch_init call. Remove code dealing with dissambly. * x86-64-linux-tdep.c (x86_64_linux_init_abi): New function. (_initialize_x86_64_linux_tdep): New function. * config/i386/x86-64linux.mt (TDEPFILES): Add i386-tdep.o and i386-tdep.o.
Diffstat (limited to 'gdb/x86-64-tdep.c')
-rw-r--r--gdb/x86-64-tdep.c99
1 files changed, 3 insertions, 96 deletions
diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c
index 1a65131..97c3bd9 100644
--- a/gdb/x86-64-tdep.c
+++ b/gdb/x86-64-tdep.c
@@ -175,15 +175,6 @@ x86_64_register_virtual_type (int regno)
return *x86_64_register_info_table[regno].type;
}
-/* FIXME: cagney/2002-11-11: Once the i386 and x86-64 targets are
- merged, this function can go away. */
-int
-i386_fp_regnum_p (int regnum)
-{
- return (regnum < NUM_REGS
- && (FP0_REGNUM && FP0_REGNUM <= (regnum) && (regnum) < FPC_REGNUM));
-}
-
/* x86_64_register_convertible is true if register N's virtual format is
different from its raw format. Note that this definition assumes
that the host supports IEEE 32-bit floats, since it doesn't say
@@ -921,7 +912,7 @@ x86_64_breakpoint_from_pc (CORE_ADDR *pc, int *lenptr)
return breakpoint;
}
-static void
+void
x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
@@ -1025,6 +1016,8 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
/* FIXME: kettenis/20021026: This one is GNU/Linux-specific too. */
set_gdbarch_pc_in_sigtramp (gdbarch, x86_64_linux_in_sigtramp);
+ set_gdbarch_num_pseudo_regs (gdbarch, 0);
+
/* Build call frame information (CFI) from DWARF2 frame debug info. */
set_gdbarch_dwarf2_build_frame_info (gdbarch, dwarf2_build_frame_info);
@@ -1043,81 +1036,9 @@ x86_64_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_in_solib_call_trampoline (gdbarch, in_plt_section);
}
-static struct gdbarch *
-x86_64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
-{
- struct gdbarch_tdep *tdep;
- struct gdbarch *gdbarch;
- enum gdb_osabi osabi = GDB_OSABI_UNKNOWN;
-
- /* Try to determine the OS ABI of the object we're loading. */
- if (info.abfd != NULL)
- osabi = gdbarch_lookup_osabi (info.abfd);
-
- /* Find a candidate among extant architectures. */
- for (arches = gdbarch_list_lookup_by_info (arches, &info);
- arches != NULL;
- arches = gdbarch_list_lookup_by_info (arches->next, &info))
- {
- /* Make sure the OS ABI selection matches. */
- tdep = gdbarch_tdep (arches->gdbarch);
- if (tdep && tdep->osabi == osabi)
- return arches->gdbarch;
- }
-
- /* Allocate space for the new architecture. */
- tdep = XMALLOC (struct gdbarch_tdep);
- gdbarch = gdbarch_alloc (&info, tdep);
-
- tdep->osabi = osabi;
-
- /* FIXME: kettenis/20021025: The following calls are going to
- disappear when we integrate the x86_64 target into the i386
- target. */
-
- set_gdbarch_long_double_format (gdbarch, &floatformat_i387_ext);
-
- set_gdbarch_max_register_raw_size (gdbarch, 16);
- set_gdbarch_max_register_virtual_size (gdbarch, 16);
-
- set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
-
- set_gdbarch_breakpoint_from_pc (gdbarch, x86_64_breakpoint_from_pc);
- set_gdbarch_decr_pc_after_break (gdbarch, 1);
- set_gdbarch_function_start_offset (gdbarch, 0);
-
- set_gdbarch_frame_args_skip (gdbarch, 8);
-
- set_gdbarch_call_dummy_address (gdbarch, entry_point_address);
- set_gdbarch_call_dummy_start_offset (gdbarch, 0);
- set_gdbarch_call_dummy_breakpoint_offset (gdbarch, 0);
- set_gdbarch_call_dummy_breakpoint_offset_p (gdbarch, 1);
- set_gdbarch_call_dummy_length (gdbarch, 0);
- set_gdbarch_call_dummy_p (gdbarch, 1);
- set_gdbarch_call_dummy_words (gdbarch, NULL);
- set_gdbarch_sizeof_call_dummy_words (gdbarch, 0);
- set_gdbarch_fix_call_dummy (gdbarch, generic_fix_call_dummy);
- set_gdbarch_call_dummy_stack_adjust_p (gdbarch, 0);
-
- set_gdbarch_deprecated_pc_in_call_dummy (gdbarch, deprecated_pc_in_call_dummy_at_entry_point);
-
- set_gdbarch_push_dummy_frame (gdbarch, generic_push_dummy_frame);
-
- /* FIXME: kettenis/20021025: These already are the default. */
-
- set_gdbarch_register_virtual_size (gdbarch, generic_register_size);
- set_gdbarch_deprecated_extract_struct_value_address (gdbarch, 0);
-
- x86_64_init_abi (info, gdbarch);
-
- return gdbarch;
-}
-
void
_initialize_x86_64_tdep (void)
{
- register_gdbarch_init (bfd_arch_i386, x86_64_gdbarch_init);
-
/* Initialize the table saying where each register starts in the
register file. */
{
@@ -1130,18 +1051,4 @@ _initialize_x86_64_tdep (void)
offset += x86_64_register_info_table[i].size;
}
}
-
- tm_print_insn = gdb_print_insn_x86_64;
- tm_print_insn_info.mach = bfd_mach_x86_64;
-
- /* Add the variable that controls the disassembly flavour. */
- {
- struct cmd_list_element *new_cmd;
-
- new_cmd = add_set_enum_cmd ("disassembly-flavour", no_class,
- valid_flavours, &disassembly_flavour, "\
-Set the disassembly flavour, the valid values are \"att\" and \"intel\", \
-and the default value is \"att\".", &setlist);
- add_show_from_set (new_cmd, &showlist);
- }
}