/* This file was created with the aid of ``gdbarch.sh''.
- The bourn shell script ``gdbarch.sh'' creates the files
+ The Bourne shell script ``gdbarch.sh'' creates the files
``new-gdbarch.c'' and ``new-gdbarch.h and then compares them
against the existing ``gdbarch.[hc]''. Any differences found
being reported.
If editing this file, please also run gdbarch.sh and merge any
- changes into that script. Conversely, when makeing sweeping changes
+ changes into that script. Conversely, when making sweeping changes
to this file, modifying gdbarch.sh and using its output may prove
easier. */
verify_gdbarch(): Confirm that the target updated the field
correctly.
- gdbarch_dump(): Add a fprintf_unfiltered call to so that the new
+ gdbarch_dump(): Add a fprintf_unfiltered call so that the new
field is dumped out
``startup_gdbarch()'': Append an initial value to the static
*/
- int bfd_vma_bit;
- int ptr_bit;
int short_bit;
int int_bit;
int long_bit;
int float_bit;
int double_bit;
int long_double_bit;
+ int ptr_bit;
+ int addr_bit;
+ int bfd_vma_bit;
int ieee_float;
gdbarch_read_pc_ftype *read_pc;
gdbarch_write_pc_ftype *write_pc;
int fp0_regnum;
int npc_regnum;
int nnpc_regnum;
+ gdbarch_stab_reg_to_regnum_ftype *stab_reg_to_regnum;
+ gdbarch_ecoff_reg_to_regnum_ftype *ecoff_reg_to_regnum;
+ gdbarch_dwarf_reg_to_regnum_ftype *dwarf_reg_to_regnum;
+ gdbarch_sdb_reg_to_regnum_ftype *sdb_reg_to_regnum;
+ gdbarch_dwarf2_reg_to_regnum_ftype *dwarf2_reg_to_regnum;
gdbarch_register_name_ftype *register_name;
int register_size;
int register_bytes;
gdbarch_saved_pc_after_call_ftype *saved_pc_after_call;
gdbarch_frame_num_args_ftype *frame_num_args;
gdbarch_stack_align_ftype *stack_align;
+ int extra_stack_alignment_needed;
gdbarch_reg_struct_has_addr_ftype *reg_struct_has_addr;
gdbarch_save_dummy_frame_tos_ftype *save_dummy_frame_tos;
const struct floatformat * float_format;
const struct floatformat * double_format;
const struct floatformat * long_double_format;
+ gdbarch_convert_from_func_ptr_addr_ftype *convert_from_func_ptr_addr;
};
/*per-architecture data-pointers and swap regions */
0, NULL, NULL,
/* Multi-arch values */
- 8 * sizeof (void*),
- 8 * sizeof (void*),
8 * sizeof (short),
8 * sizeof (int),
8 * sizeof (long),
8 * sizeof (float),
8 * sizeof (double),
8 * sizeof (long double),
+ 8 * sizeof (void*),
+ 8 * sizeof (void*),
+ 8 * sizeof (void*),
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
0,
0,
0,
0,
0,
0,
+ 0,
+ 0,
/* startup_gdbarch() */
};
struct gdbarch *current_gdbarch = &startup_gdbarch;
-/* Create a new ``struct gdbarch'' based in information provided by
+/* Create a new ``struct gdbarch'' based on information provided by
``struct gdbarch_info''. */
struct gdbarch *
gdbarch->byte_order = info->byte_order;
/* Force the explicit initialization of these. */
+ gdbarch->short_bit = 2*TARGET_CHAR_BIT;
+ gdbarch->int_bit = 4*TARGET_CHAR_BIT;
+ gdbarch->long_bit = 4*TARGET_CHAR_BIT;
+ gdbarch->long_long_bit = 2*TARGET_LONG_BIT;
+ gdbarch->float_bit = 4*TARGET_CHAR_BIT;
+ gdbarch->double_bit = 8*TARGET_CHAR_BIT;
+ gdbarch->long_double_bit = 2*TARGET_DOUBLE_BIT;
+ gdbarch->ptr_bit = TARGET_INT_BIT;
gdbarch->bfd_vma_bit = TARGET_ARCHITECTURE->bits_per_address;
+ gdbarch->read_pc = generic_target_read_pc;
+ gdbarch->write_pc = generic_target_write_pc;
+ gdbarch->read_fp = generic_target_read_fp;
+ gdbarch->write_fp = generic_target_write_fp;
+ gdbarch->read_sp = generic_target_read_sp;
+ gdbarch->write_sp = generic_target_write_sp;
gdbarch->num_regs = -1;
gdbarch->sp_regnum = -1;
gdbarch->fp_regnum = -1;
gdbarch->fp0_regnum = -1;
gdbarch->npc_regnum = -1;
gdbarch->nnpc_regnum = -1;
+ gdbarch->stab_reg_to_regnum = no_op_reg_to_regnum;
+ gdbarch->ecoff_reg_to_regnum = no_op_reg_to_regnum;
+ gdbarch->dwarf_reg_to_regnum = no_op_reg_to_regnum;
+ gdbarch->sdb_reg_to_regnum = no_op_reg_to_regnum;
+ gdbarch->dwarf2_reg_to_regnum = no_op_reg_to_regnum;
gdbarch->register_name = legacy_register_name;
gdbarch->register_size = -1;
gdbarch->register_bytes = -1;
gdbarch->remote_translate_xfer_address = generic_remote_translate_xfer_address;
gdbarch->frame_args_skip = -1;
gdbarch->frameless_function_invocation = generic_frameless_function_invocation_not;
+ gdbarch->extra_stack_alignment_needed = 1;
+ gdbarch->convert_from_func_ptr_addr = default_convert_from_func_ptr_addr;
/* gdbarch_alloc() */
return gdbarch;
if (gdbarch->bfd_arch_info == NULL)
internal_error ("verify_gdbarch: bfd_arch_info unset");
/* Check those that need to be defined for the given multi-arch level. */
+ /* Skip verify of short_bit, invalid_p == 0 */
+ /* Skip verify of int_bit, invalid_p == 0 */
+ /* Skip verify of long_bit, invalid_p == 0 */
+ /* Skip verify of long_long_bit, invalid_p == 0 */
+ /* Skip verify of float_bit, invalid_p == 0 */
+ /* Skip verify of double_bit, invalid_p == 0 */
+ /* Skip verify of long_double_bit, invalid_p == 0 */
+ /* Skip verify of ptr_bit, invalid_p == 0 */
+ if (gdbarch->addr_bit == 0)
+ gdbarch->addr_bit = TARGET_PTR_BIT;
/* Skip verify of bfd_vma_bit, invalid_p == 0 */
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->ptr_bit == 0))
- internal_error ("gdbarch: verify_gdbarch: ptr_bit invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->short_bit == 0))
- internal_error ("gdbarch: verify_gdbarch: short_bit invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->int_bit == 0))
- internal_error ("gdbarch: verify_gdbarch: int_bit invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->long_bit == 0))
- internal_error ("gdbarch: verify_gdbarch: long_bit invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->long_long_bit == 0))
- internal_error ("gdbarch: verify_gdbarch: long_long_bit invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->float_bit == 0))
- internal_error ("gdbarch: verify_gdbarch: float_bit invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->double_bit == 0))
- internal_error ("gdbarch: verify_gdbarch: double_bit invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->long_double_bit == 0))
- internal_error ("gdbarch: verify_gdbarch: long_double_bit invalid");
/* Skip verify of ieee_float, invalid_p == 0 */
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->read_pc == 0))
- internal_error ("gdbarch: verify_gdbarch: read_pc invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->write_pc == 0))
- internal_error ("gdbarch: verify_gdbarch: write_pc invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->read_fp == 0))
- internal_error ("gdbarch: verify_gdbarch: read_fp invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->write_fp == 0))
- internal_error ("gdbarch: verify_gdbarch: write_fp invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->read_sp == 0))
- internal_error ("gdbarch: verify_gdbarch: read_sp invalid");
- if ((GDB_MULTI_ARCH >= 1)
- && (gdbarch->write_sp == 0))
- internal_error ("gdbarch: verify_gdbarch: write_sp invalid");
+ /* Skip verify of read_pc, invalid_p == 0 */
+ /* Skip verify of write_pc, invalid_p == 0 */
+ /* Skip verify of read_fp, invalid_p == 0 */
+ /* Skip verify of write_fp, invalid_p == 0 */
+ /* Skip verify of read_sp, invalid_p == 0 */
+ /* Skip verify of write_sp, invalid_p == 0 */
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->num_regs == -1))
internal_error ("gdbarch: verify_gdbarch: num_regs invalid");
/* Skip verify of fp0_regnum, invalid_p == 0 */
/* Skip verify of npc_regnum, invalid_p == 0 */
/* Skip verify of nnpc_regnum, invalid_p == 0 */
+ /* Skip verify of stab_reg_to_regnum, invalid_p == 0 */
+ /* Skip verify of ecoff_reg_to_regnum, invalid_p == 0 */
+ /* Skip verify of dwarf_reg_to_regnum, invalid_p == 0 */
+ /* Skip verify of sdb_reg_to_regnum, invalid_p == 0 */
+ /* Skip verify of dwarf2_reg_to_regnum, invalid_p == 0 */
/* Skip verify of register_name, invalid_p == 0 */
if ((GDB_MULTI_ARCH >= 2)
&& (gdbarch->register_size == -1))
&& (gdbarch->frame_num_args == 0))
internal_error ("gdbarch: verify_gdbarch: frame_num_args invalid");
/* Skip verify of stack_align, has predicate */
+ /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
/* Skip verify of reg_struct_has_addr, has predicate */
/* Skip verify of save_dummy_frame_tos, has predicate */
if (gdbarch->float_format == 0)
gdbarch->double_format = default_double_format (gdbarch);
if (gdbarch->long_double_format == 0)
gdbarch->long_double_format = &floatformat_unknown;
+ /* Skip verify of convert_from_func_ptr_addr, invalid_p == 0 */
}
"gdbarch_dump: TARGET_BYTE_ORDER # %s\n",
XSTRING (TARGET_BYTE_ORDER));
#endif
-#ifdef TARGET_BFD_VMA_BIT
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
- XSTRING (TARGET_BFD_VMA_BIT));
-#endif
-#ifdef TARGET_PTR_BIT
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_PTR_BIT # %s\n",
- XSTRING (TARGET_PTR_BIT));
-#endif
#ifdef TARGET_SHORT_BIT
fprintf_unfiltered (file,
"gdbarch_dump: TARGET_SHORT_BIT # %s\n",
"gdbarch_dump: TARGET_LONG_DOUBLE_BIT # %s\n",
XSTRING (TARGET_LONG_DOUBLE_BIT));
#endif
+#ifdef TARGET_PTR_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_PTR_BIT # %s\n",
+ XSTRING (TARGET_PTR_BIT));
+#endif
+#ifdef TARGET_ADDR_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_ADDR_BIT # %s\n",
+ XSTRING (TARGET_ADDR_BIT));
+#endif
+#ifdef TARGET_BFD_VMA_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_BFD_VMA_BIT # %s\n",
+ XSTRING (TARGET_BFD_VMA_BIT));
+#endif
#ifdef IEEE_FLOAT
fprintf_unfiltered (file,
"gdbarch_dump: IEEE_FLOAT # %s\n",
"gdbarch_dump: NNPC_REGNUM # %s\n",
XSTRING (NNPC_REGNUM));
#endif
+#ifdef STAB_REG_TO_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "STAB_REG_TO_REGNUM(stab_regnr)",
+ XSTRING (STAB_REG_TO_REGNUM (stab_regnr)));
+#endif
+#ifdef ECOFF_REG_TO_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "ECOFF_REG_TO_REGNUM(ecoff_regnr)",
+ XSTRING (ECOFF_REG_TO_REGNUM (ecoff_regnr)));
+#endif
+#ifdef DWARF_REG_TO_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DWARF_REG_TO_REGNUM(dwarf_regnr)",
+ XSTRING (DWARF_REG_TO_REGNUM (dwarf_regnr)));
+#endif
+#ifdef SDB_REG_TO_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "SDB_REG_TO_REGNUM(sdb_regnr)",
+ XSTRING (SDB_REG_TO_REGNUM (sdb_regnr)));
+#endif
+#ifdef DWARF2_REG_TO_REGNUM
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "DWARF2_REG_TO_REGNUM(dwarf2_regnr)",
+ XSTRING (DWARF2_REG_TO_REGNUM (dwarf2_regnr)));
+#endif
#ifdef REGISTER_NAME
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"STACK_ALIGN(sp)",
XSTRING (STACK_ALIGN (sp)));
#endif
+#ifdef EXTRA_STACK_ALIGNMENT_NEEDED
+ fprintf_unfiltered (file,
+ "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED # %s\n",
+ XSTRING (EXTRA_STACK_ALIGNMENT_NEEDED));
+#endif
#ifdef REG_STRUCT_HAS_ADDR
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
"gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT # %s\n",
XSTRING (TARGET_LONG_DOUBLE_FORMAT));
#endif
+#ifdef CONVERT_FROM_FUNC_PTR_ADDR
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "CONVERT_FROM_FUNC_PTR_ADDR(addr)",
+ XSTRING (CONVERT_FROM_FUNC_PTR_ADDR (addr)));
+#endif
#ifdef TARGET_ARCHITECTURE
if (TARGET_ARCHITECTURE != NULL)
fprintf_unfiltered (file,
"gdbarch_dump: TARGET_BYTE_ORDER = %ld\n",
(long) TARGET_BYTE_ORDER);
#endif
-#ifdef TARGET_BFD_VMA_BIT
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_BFD_VMA_BIT = %ld\n",
- (long) TARGET_BFD_VMA_BIT);
-#endif
-#ifdef TARGET_PTR_BIT
- fprintf_unfiltered (file,
- "gdbarch_dump: TARGET_PTR_BIT = %ld\n",
- (long) TARGET_PTR_BIT);
-#endif
#ifdef TARGET_SHORT_BIT
fprintf_unfiltered (file,
"gdbarch_dump: TARGET_SHORT_BIT = %ld\n",
"gdbarch_dump: TARGET_LONG_DOUBLE_BIT = %ld\n",
(long) TARGET_LONG_DOUBLE_BIT);
#endif
+#ifdef TARGET_PTR_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_PTR_BIT = %ld\n",
+ (long) TARGET_PTR_BIT);
+#endif
+#ifdef TARGET_ADDR_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_ADDR_BIT = %ld\n",
+ (long) TARGET_ADDR_BIT);
+#endif
+#ifdef TARGET_BFD_VMA_BIT
+ fprintf_unfiltered (file,
+ "gdbarch_dump: TARGET_BFD_VMA_BIT = %ld\n",
+ (long) TARGET_BFD_VMA_BIT);
+#endif
#ifdef IEEE_FLOAT
fprintf_unfiltered (file,
"gdbarch_dump: IEEE_FLOAT = %ld\n",
"gdbarch_dump: NNPC_REGNUM = %ld\n",
(long) NNPC_REGNUM);
#endif
+#ifdef STAB_REG_TO_REGNUM
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: STAB_REG_TO_REGNUM = 0x%08lx\n",
+ (long) current_gdbarch->stab_reg_to_regnum
+ /*STAB_REG_TO_REGNUM ()*/);
+#endif
+#ifdef ECOFF_REG_TO_REGNUM
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: ECOFF_REG_TO_REGNUM = 0x%08lx\n",
+ (long) current_gdbarch->ecoff_reg_to_regnum
+ /*ECOFF_REG_TO_REGNUM ()*/);
+#endif
+#ifdef DWARF_REG_TO_REGNUM
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DWARF_REG_TO_REGNUM = 0x%08lx\n",
+ (long) current_gdbarch->dwarf_reg_to_regnum
+ /*DWARF_REG_TO_REGNUM ()*/);
+#endif
+#ifdef SDB_REG_TO_REGNUM
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SDB_REG_TO_REGNUM = 0x%08lx\n",
+ (long) current_gdbarch->sdb_reg_to_regnum
+ /*SDB_REG_TO_REGNUM ()*/);
+#endif
+#ifdef DWARF2_REG_TO_REGNUM
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: DWARF2_REG_TO_REGNUM = 0x%08lx\n",
+ (long) current_gdbarch->dwarf2_reg_to_regnum
+ /*DWARF2_REG_TO_REGNUM ()*/);
+#endif
#ifdef REGISTER_NAME
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
(long) CALL_DUMMY_START_OFFSET);
#endif
#ifdef CALL_DUMMY_BREAKPOINT_OFFSET
- fprintf_unfiltered (file,
- "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
- (long) CALL_DUMMY_BREAKPOINT_OFFSET);
+ if (CALL_DUMMY_BREAKPOINT_OFFSET_P)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CALL_DUMMY_BREAKPOINT_OFFSET = 0x%08lx\n",
+ (long) CALL_DUMMY_BREAKPOINT_OFFSET);
#endif
#ifdef CALL_DUMMY_BREAKPOINT_OFFSET_P
fprintf_unfiltered (file,
(long) current_gdbarch->stack_align
/*STACK_ALIGN ()*/);
#endif
+#ifdef EXTRA_STACK_ALIGNMENT_NEEDED
+ fprintf_unfiltered (file,
+ "gdbarch_dump: EXTRA_STACK_ALIGNMENT_NEEDED = %ld\n",
+ (long) EXTRA_STACK_ALIGNMENT_NEEDED);
+#endif
#ifdef REG_STRUCT_HAS_ADDR
if (GDB_MULTI_ARCH)
fprintf_unfiltered (file,
fprintf_unfiltered (file,
"gdbarch_dump: TARGET_LONG_DOUBLE_FORMAT = %ld\n",
(long) TARGET_LONG_DOUBLE_FORMAT);
+#endif
+#ifdef CONVERT_FROM_FUNC_PTR_ADDR
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: CONVERT_FROM_FUNC_PTR_ADDR = 0x%08lx\n",
+ (long) current_gdbarch->convert_from_func_ptr_addr
+ /*CONVERT_FROM_FUNC_PTR_ADDR ()*/);
#endif
if (current_gdbarch->dump_tdep != NULL)
current_gdbarch->dump_tdep (current_gdbarch, file);
return gdbarch->byte_order;
}
-int
-gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
-{
- /* Skip verify of bfd_vma_bit, invalid_p == 0 */
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
- return gdbarch->bfd_vma_bit;
-}
-
-void
-set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
- int bfd_vma_bit)
-{
- gdbarch->bfd_vma_bit = bfd_vma_bit;
-}
-
-int
-gdbarch_ptr_bit (struct gdbarch *gdbarch)
-{
- if (gdbarch->ptr_bit == 0)
- internal_error ("gdbarch: gdbarch_ptr_bit invalid");
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
- return gdbarch->ptr_bit;
-}
-
-void
-set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
- int ptr_bit)
-{
- gdbarch->ptr_bit = ptr_bit;
-}
-
int
gdbarch_short_bit (struct gdbarch *gdbarch)
{
- if (gdbarch->short_bit == 0)
- internal_error ("gdbarch: gdbarch_short_bit invalid");
+ /* Skip verify of short_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_short_bit called\n");
return gdbarch->short_bit;
int
gdbarch_int_bit (struct gdbarch *gdbarch)
{
- if (gdbarch->int_bit == 0)
- internal_error ("gdbarch: gdbarch_int_bit invalid");
+ /* Skip verify of int_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_int_bit called\n");
return gdbarch->int_bit;
int
gdbarch_long_bit (struct gdbarch *gdbarch)
{
- if (gdbarch->long_bit == 0)
- internal_error ("gdbarch: gdbarch_long_bit invalid");
+ /* Skip verify of long_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_long_bit called\n");
return gdbarch->long_bit;
int
gdbarch_long_long_bit (struct gdbarch *gdbarch)
{
- if (gdbarch->long_long_bit == 0)
- internal_error ("gdbarch: gdbarch_long_long_bit invalid");
+ /* Skip verify of long_long_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_long_long_bit called\n");
return gdbarch->long_long_bit;
int
gdbarch_float_bit (struct gdbarch *gdbarch)
{
- if (gdbarch->float_bit == 0)
- internal_error ("gdbarch: gdbarch_float_bit invalid");
+ /* Skip verify of float_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_float_bit called\n");
return gdbarch->float_bit;
int
gdbarch_double_bit (struct gdbarch *gdbarch)
{
- if (gdbarch->double_bit == 0)
- internal_error ("gdbarch: gdbarch_double_bit invalid");
+ /* Skip verify of double_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_double_bit called\n");
return gdbarch->double_bit;
int
gdbarch_long_double_bit (struct gdbarch *gdbarch)
{
- if (gdbarch->long_double_bit == 0)
- internal_error ("gdbarch: gdbarch_long_double_bit invalid");
+ /* Skip verify of long_double_bit, invalid_p == 0 */
if (gdbarch_debug >= 2)
fprintf_unfiltered (gdb_stdlog, "gdbarch_long_double_bit called\n");
return gdbarch->long_double_bit;
gdbarch->long_double_bit = long_double_bit;
}
+int
+gdbarch_ptr_bit (struct gdbarch *gdbarch)
+{
+ /* Skip verify of ptr_bit, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_ptr_bit called\n");
+ return gdbarch->ptr_bit;
+}
+
+void
+set_gdbarch_ptr_bit (struct gdbarch *gdbarch,
+ int ptr_bit)
+{
+ gdbarch->ptr_bit = ptr_bit;
+}
+
+int
+gdbarch_addr_bit (struct gdbarch *gdbarch)
+{
+ if (gdbarch->addr_bit == 0)
+ internal_error ("gdbarch: gdbarch_addr_bit invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_addr_bit called\n");
+ return gdbarch->addr_bit;
+}
+
+void
+set_gdbarch_addr_bit (struct gdbarch *gdbarch,
+ int addr_bit)
+{
+ gdbarch->addr_bit = addr_bit;
+}
+
+int
+gdbarch_bfd_vma_bit (struct gdbarch *gdbarch)
+{
+ /* Skip verify of bfd_vma_bit, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_bfd_vma_bit called\n");
+ return gdbarch->bfd_vma_bit;
+}
+
+void
+set_gdbarch_bfd_vma_bit (struct gdbarch *gdbarch,
+ int bfd_vma_bit)
+{
+ gdbarch->bfd_vma_bit = bfd_vma_bit;
+}
+
int
gdbarch_ieee_float (struct gdbarch *gdbarch)
{
gdbarch->nnpc_regnum = nnpc_regnum;
}
+int
+gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch, int stab_regnr)
+{
+ if (gdbarch->stab_reg_to_regnum == 0)
+ internal_error ("gdbarch: gdbarch_stab_reg_to_regnum invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_stab_reg_to_regnum called\n");
+ return gdbarch->stab_reg_to_regnum (stab_regnr);
+}
+
+void
+set_gdbarch_stab_reg_to_regnum (struct gdbarch *gdbarch,
+ gdbarch_stab_reg_to_regnum_ftype stab_reg_to_regnum)
+{
+ gdbarch->stab_reg_to_regnum = stab_reg_to_regnum;
+}
+
+int
+gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch, int ecoff_regnr)
+{
+ if (gdbarch->ecoff_reg_to_regnum == 0)
+ internal_error ("gdbarch: gdbarch_ecoff_reg_to_regnum invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_ecoff_reg_to_regnum called\n");
+ return gdbarch->ecoff_reg_to_regnum (ecoff_regnr);
+}
+
+void
+set_gdbarch_ecoff_reg_to_regnum (struct gdbarch *gdbarch,
+ gdbarch_ecoff_reg_to_regnum_ftype ecoff_reg_to_regnum)
+{
+ gdbarch->ecoff_reg_to_regnum = ecoff_reg_to_regnum;
+}
+
+int
+gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dwarf_regnr)
+{
+ if (gdbarch->dwarf_reg_to_regnum == 0)
+ internal_error ("gdbarch: gdbarch_dwarf_reg_to_regnum invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf_reg_to_regnum called\n");
+ return gdbarch->dwarf_reg_to_regnum (dwarf_regnr);
+}
+
+void
+set_gdbarch_dwarf_reg_to_regnum (struct gdbarch *gdbarch,
+ gdbarch_dwarf_reg_to_regnum_ftype dwarf_reg_to_regnum)
+{
+ gdbarch->dwarf_reg_to_regnum = dwarf_reg_to_regnum;
+}
+
+int
+gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch, int sdb_regnr)
+{
+ if (gdbarch->sdb_reg_to_regnum == 0)
+ internal_error ("gdbarch: gdbarch_sdb_reg_to_regnum invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_sdb_reg_to_regnum called\n");
+ return gdbarch->sdb_reg_to_regnum (sdb_regnr);
+}
+
+void
+set_gdbarch_sdb_reg_to_regnum (struct gdbarch *gdbarch,
+ gdbarch_sdb_reg_to_regnum_ftype sdb_reg_to_regnum)
+{
+ gdbarch->sdb_reg_to_regnum = sdb_reg_to_regnum;
+}
+
+int
+gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int dwarf2_regnr)
+{
+ if (gdbarch->dwarf2_reg_to_regnum == 0)
+ internal_error ("gdbarch: gdbarch_dwarf2_reg_to_regnum invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_dwarf2_reg_to_regnum called\n");
+ return gdbarch->dwarf2_reg_to_regnum (dwarf2_regnr);
+}
+
+void
+set_gdbarch_dwarf2_reg_to_regnum (struct gdbarch *gdbarch,
+ gdbarch_dwarf2_reg_to_regnum_ftype dwarf2_reg_to_regnum)
+{
+ gdbarch->dwarf2_reg_to_regnum = dwarf2_reg_to_regnum;
+}
+
char *
gdbarch_register_name (struct gdbarch *gdbarch, int regnr)
{
gdbarch->stack_align = stack_align;
}
+int
+gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch)
+{
+ /* Skip verify of extra_stack_alignment_needed, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_extra_stack_alignment_needed called\n");
+ return gdbarch->extra_stack_alignment_needed;
+}
+
+void
+set_gdbarch_extra_stack_alignment_needed (struct gdbarch *gdbarch,
+ int extra_stack_alignment_needed)
+{
+ gdbarch->extra_stack_alignment_needed = extra_stack_alignment_needed;
+}
+
int
gdbarch_reg_struct_has_addr_p (struct gdbarch *gdbarch)
{
gdbarch->long_double_format = long_double_format;
}
+CORE_ADDR
+gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
+{
+ if (gdbarch->convert_from_func_ptr_addr == 0)
+ internal_error ("gdbarch: gdbarch_convert_from_func_ptr_addr invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_convert_from_func_ptr_addr called\n");
+ return gdbarch->convert_from_func_ptr_addr (addr);
+}
+
+void
+set_gdbarch_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
+ gdbarch_convert_from_func_ptr_addr_ftype convert_from_func_ptr_addr)
+{
+ gdbarch->convert_from_func_ptr_addr = convert_from_func_ptr_addr;
+}
+
-/* Keep a registrary of per-architecture data-pointers required by GDB
+/* Keep a registry of per-architecture data-pointers required by GDB
modules. */
struct gdbarch_data
struct gdbarch_data_registration *next;
};
-struct gdbarch_data_registrary
+struct gdbarch_data_registry
{
int nr;
struct gdbarch_data_registration *registrations;
};
-struct gdbarch_data_registrary gdbarch_data_registrary =
+struct gdbarch_data_registry gdbarch_data_registry =
{
0, NULL,
};
register_gdbarch_data (gdbarch_data_ftype *init)
{
struct gdbarch_data_registration **curr;
- for (curr = &gdbarch_data_registrary.registrations;
+ for (curr = &gdbarch_data_registry.registrations;
(*curr) != NULL;
curr = &(*curr)->next);
(*curr) = XMALLOC (struct gdbarch_data_registration);
(*curr)->next = NULL;
(*curr)->init = init;
(*curr)->data = XMALLOC (struct gdbarch_data);
- (*curr)->data->index = gdbarch_data_registrary.nr++;
+ (*curr)->data->index = gdbarch_data_registry.nr++;
return (*curr)->data;
}
init_gdbarch_data (struct gdbarch *gdbarch)
{
struct gdbarch_data_registration *rego;
- gdbarch->nr_data = gdbarch_data_registrary.nr + 1;
+ gdbarch->nr_data = gdbarch_data_registry.nr + 1;
gdbarch->data = xmalloc (sizeof (void*) * gdbarch->nr_data);
- for (rego = gdbarch_data_registrary.registrations;
+ for (rego = gdbarch_data_registry.registrations;
rego != NULL;
rego = rego->next)
{
-/* Keep a registrary of swaped data required by GDB modules. */
+/* Keep a registry of swapped data required by GDB modules. */
struct gdbarch_swap
{
struct gdbarch_swap_registration *next;
};
-struct gdbarch_swap_registrary
+struct gdbarch_swap_registry
{
int nr;
struct gdbarch_swap_registration *registrations;
};
-struct gdbarch_swap_registrary gdbarch_swap_registrary =
+struct gdbarch_swap_registry gdbarch_swap_registry =
{
0, NULL,
};
gdbarch_swap_ftype *init)
{
struct gdbarch_swap_registration **rego;
- for (rego = &gdbarch_swap_registrary.registrations;
+ for (rego = &gdbarch_swap_registry.registrations;
(*rego) != NULL;
rego = &(*rego)->next);
(*rego) = XMALLOC (struct gdbarch_swap_registration);
{
struct gdbarch_swap_registration *rego;
struct gdbarch_swap **curr = &gdbarch->swap;
- for (rego = gdbarch_swap_registrary.registrations;
+ for (rego = gdbarch_swap_registry.registrations;
rego != NULL;
rego = rego->next)
{
}
-/* Keep a registrary of the architectures known by GDB. */
+/* Keep a registry of the architectures known by GDB. */
struct gdbarch_registration
{
struct gdbarch_registration *next;
};
-static struct gdbarch_registration *gdbarch_registrary = NULL;
+static struct gdbarch_registration *gdbarch_registry = NULL;
static void
append_name (const char ***buf, int *nr, const char *name)
int nr_arches = 0;
const char **arches = NULL;
struct gdbarch_registration *rego;
- for (rego = gdbarch_registrary;
+ for (rego = gdbarch_registry;
rego != NULL;
rego = rego->next)
{
{
struct gdbarch_registration **curr;
const struct bfd_arch_info *bfd_arch_info;
- /* Check that BFD reconizes this architecture */
+ /* Check that BFD recognizes this architecture */
bfd_arch_info = bfd_lookup_arch (bfd_architecture, 0);
if (bfd_arch_info == NULL)
{
internal_error ("gdbarch: Attempt to register unknown architecture (%d)", bfd_architecture);
}
/* Check that we haven't seen this architecture before */
- for (curr = &gdbarch_registrary;
+ for (curr = &gdbarch_registry;
(*curr) != NULL;
curr = &(*curr)->next)
{
(*curr)->dump_tdep = dump_tdep;
(*curr)->arches = NULL;
(*curr)->next = NULL;
- /* When non- multi-arch, install what ever target dump routine we've
- been provided - hopefully that routine has been writen correct
+ /* When non- multi-arch, install whatever target dump routine we've
+ been provided - hopefully that routine has been written correctly
and works regardless of multi-arch. */
if (!GDB_MULTI_ARCH && dump_tdep != NULL
&& startup_gdbarch.dump_tdep == NULL)
failed. */
int
-gdbarch_update (struct gdbarch_info info)
+gdbarch_update_p (struct gdbarch_info info)
{
struct gdbarch *new_gdbarch;
struct gdbarch_list **list;
/* A default for abfd? */
/* Find the target that knows about this architecture. */
- for (rego = gdbarch_registrary;
+ for (rego = gdbarch_registry;
rego != NULL;
rego = rego->next)
if (rego->bfd_architecture == info.bfd_architecture)