/* Intel 386 target-dependent stuff.
- Copyright (C) 1988-2021 Free Software Foundation, Inc.
+ Copyright (C) 1988-2023 Free Software Foundation, Inc.
This file is part of GDB.
#include <algorithm>
#include <unordered_set>
#include "producer.h"
+#include "infcall.h"
+#include "maint.h"
/* Register names. */
static int
i386_mmx_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
int mm0_regnum = tdep->mm0_regnum;
if (mm0_regnum < 0)
int
i386_byte_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
regnum -= tdep->al_regnum;
return regnum >= 0 && regnum < tdep->num_byte_regs;
int
i386_word_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
regnum -= tdep->ax_regnum;
return regnum >= 0 && regnum < tdep->num_word_regs;
int
i386_dword_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
int eax_regnum = tdep->eax_regnum;
if (eax_regnum < 0)
int
i386_zmmh_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
int zmm0h_regnum = tdep->zmm0h_regnum;
if (zmm0h_regnum < 0)
int
i386_zmm_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
int zmm0_regnum = tdep->zmm0_regnum;
if (zmm0_regnum < 0)
int
i386_k_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
int k0_regnum = tdep->k0_regnum;
if (k0_regnum < 0)
static int
i386_ymmh_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
int ymm0h_regnum = tdep->ymm0h_regnum;
if (ymm0h_regnum < 0)
int
i386_ymm_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
int ymm0_regnum = tdep->ymm0_regnum;
if (ymm0_regnum < 0)
static int
i386_ymmh_avx512_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
int ymm16h_regnum = tdep->ymm16h_regnum;
if (ymm16h_regnum < 0)
int
i386_ymm_avx512_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
int ymm16_regnum = tdep->ymm16_regnum;
if (ymm16_regnum < 0)
int
i386_bnd_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
int bnd0_regnum = tdep->bnd0_regnum;
if (bnd0_regnum < 0)
int
i386_xmm_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
int num_xmm_regs = I387_NUM_XMM_REGS (tdep);
if (num_xmm_regs == 0)
int
i386_xmm_avx512_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
int num_xmm_avx512_regs = I387_NUM_XMM_AVX512_REGS (tdep);
if (num_xmm_avx512_regs == 0)
static int
i386_mxcsr_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (I387_NUM_XMM_REGS (tdep) == 0)
return 0;
int
i386_fp_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (I387_ST0_REGNUM (tdep) < 0)
return 0;
int
i386_fpc_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (I387_ST0_REGNUM (tdep) < 0)
return 0;
static int
i386_bndr_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (I387_BND0R_REGNUM (tdep) < 0)
return 0;
static int
i386_mpx_ctrl_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (I387_BNDCFGU_REGNUM (tdep) < 0)
return 0;
bool
i386_pkru_regnum_p (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
int pkru_regnum = tdep->pkru_regnum;
if (pkru_regnum < 0)
const char *
i386_pseudo_register_name (struct gdbarch *gdbarch, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (i386_bnd_regnum_p (gdbarch, regnum))
return i386_bnd_names[regnum - tdep->bnd0_regnum];
if (i386_mmx_regnum_p (gdbarch, regnum))
else if (i386_word_regnum_p (gdbarch, regnum))
return i386_word_names[regnum - tdep->ax_regnum];
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
}
/* Convert a dbx register number REG to the appropriate register
static int
i386_dbx_reg_to_regnum (struct gdbarch *gdbarch, int reg)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
/* This implements what GCC calls the "default" register map
(dbx_register_map[]). */
static int
i386_svr4_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
/* This implements the GCC register map that tries to be compatible
with the SVR4 C compiler for DWARF (svr4_dbx_register_map[]). */
compilers to emit usable line notes. */
if (post_prologue_pc
&& (cust != NULL
- && COMPUNIT_PRODUCER (cust) != NULL
- && (producer_is_llvm (COMPUNIT_PRODUCER (cust))
- || producer_is_icc_ge_19 (COMPUNIT_PRODUCER (cust)))))
+ && cust->producer () != NULL
+ && (producer_is_llvm (cust->producer ())
+ || producer_is_icc_ge_19 (cust->producer ()))))
return std::max (start_pc, post_prologue_pc);
}
/* This function is 64-bit safe. */
static CORE_ADDR
-i386_unwind_pc (struct gdbarch *gdbarch, struct frame_info *next_frame)
+i386_unwind_pc (struct gdbarch *gdbarch, frame_info_ptr next_frame)
{
gdb_byte buf[8];
/* Normal frames. */
static void
-i386_frame_cache_1 (struct frame_info *this_frame,
+i386_frame_cache_1 (frame_info_ptr this_frame,
struct i386_frame_cache *cache)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
}
static struct i386_frame_cache *
-i386_frame_cache (struct frame_info *this_frame, void **this_cache)
+i386_frame_cache (frame_info_ptr this_frame, void **this_cache)
{
struct i386_frame_cache *cache;
}
static void
-i386_frame_this_id (struct frame_info *this_frame, void **this_cache,
+i386_frame_this_id (frame_info_ptr this_frame, void **this_cache,
struct frame_id *this_id)
{
struct i386_frame_cache *cache = i386_frame_cache (this_frame, this_cache);
}
static enum unwind_stop_reason
-i386_frame_unwind_stop_reason (struct frame_info *this_frame,
+i386_frame_unwind_stop_reason (frame_info_ptr this_frame,
void **this_cache)
{
struct i386_frame_cache *cache = i386_frame_cache (this_frame, this_cache);
}
static struct value *
-i386_frame_prev_register (struct frame_info *this_frame, void **this_cache,
+i386_frame_prev_register (frame_info_ptr this_frame, void **this_cache,
int regnum)
{
struct i386_frame_cache *cache = i386_frame_cache (this_frame, this_cache);
struct compunit_symtab *cust;
cust = find_pc_compunit_symtab (pc);
- if (cust != NULL && COMPUNIT_EPILOGUE_UNWIND_VALID (cust))
+ if (cust != NULL && cust->epilogue_unwind_valid ())
return 0;
if (target_read_memory (pc, &insn, 1))
static int
i386_epilogue_frame_sniffer (const struct frame_unwind *self,
- struct frame_info *this_frame,
+ frame_info_ptr this_frame,
void **this_prologue_cache)
{
if (frame_relative_level (this_frame) == 0)
}
static struct i386_frame_cache *
-i386_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
+i386_epilogue_frame_cache (frame_info_ptr this_frame, void **this_cache)
{
struct i386_frame_cache *cache;
CORE_ADDR sp;
}
static enum unwind_stop_reason
-i386_epilogue_frame_unwind_stop_reason (struct frame_info *this_frame,
+i386_epilogue_frame_unwind_stop_reason (frame_info_ptr this_frame,
void **this_cache)
{
struct i386_frame_cache *cache =
}
static void
-i386_epilogue_frame_this_id (struct frame_info *this_frame,
+i386_epilogue_frame_this_id (frame_info_ptr this_frame,
void **this_cache,
struct frame_id *this_id)
{
}
static struct value *
-i386_epilogue_frame_prev_register (struct frame_info *this_frame,
+i386_epilogue_frame_prev_register (frame_info_ptr this_frame,
void **this_cache, int regnum)
{
/* Make sure we've initialized the cache. */
static int
i386_stack_tramp_frame_sniffer (const struct frame_unwind *self,
- struct frame_info *this_frame,
+ frame_info_ptr this_frame,
void **this_cache)
{
if (frame_relative_level (this_frame) == 0)
/* Signal trampolines. */
static struct i386_frame_cache *
-i386_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
+i386_sigtramp_frame_cache (frame_info_ptr this_frame, void **this_cache)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
struct i386_frame_cache *cache;
CORE_ADDR addr;
}
static enum unwind_stop_reason
-i386_sigtramp_frame_unwind_stop_reason (struct frame_info *this_frame,
+i386_sigtramp_frame_unwind_stop_reason (frame_info_ptr this_frame,
void **this_cache)
{
struct i386_frame_cache *cache =
}
static void
-i386_sigtramp_frame_this_id (struct frame_info *this_frame, void **this_cache,
+i386_sigtramp_frame_this_id (frame_info_ptr this_frame, void **this_cache,
struct frame_id *this_id)
{
struct i386_frame_cache *cache =
}
static struct value *
-i386_sigtramp_frame_prev_register (struct frame_info *this_frame,
+i386_sigtramp_frame_prev_register (frame_info_ptr this_frame,
void **this_cache, int regnum)
{
/* Make sure we've initialized the cache. */
static int
i386_sigtramp_frame_sniffer (const struct frame_unwind *self,
- struct frame_info *this_frame,
+ frame_info_ptr this_frame,
void **this_prologue_cache)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame));
+ gdbarch *arch = get_frame_arch (this_frame);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (arch);
/* We shouldn't even bother if we don't have a sigcontext_addr
handler. */
\f
static CORE_ADDR
-i386_frame_base_address (struct frame_info *this_frame, void **this_cache)
+i386_frame_base_address (frame_info_ptr this_frame, void **this_cache)
{
struct i386_frame_cache *cache = i386_frame_cache (this_frame, this_cache);
};
static struct frame_id
-i386_dummy_id (struct gdbarch *gdbarch, struct frame_info *this_frame)
+i386_dummy_id (struct gdbarch *gdbarch, frame_info_ptr this_frame)
{
CORE_ADDR fp;
success. */
static int
-i386_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
+i386_get_longjmp_target (frame_info_ptr frame, CORE_ADDR *pc)
{
gdb_byte buf[4];
CORE_ADDR sp, jb_addr;
struct gdbarch *gdbarch = get_frame_arch (frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int jb_pc_offset = gdbarch_tdep (gdbarch)->jb_pc_offset;
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
+ int jb_pc_offset = tdep->jb_pc_offset;
/* If JB_PC_OFFSET is -1, we have no way to find out where the
longjmp will land. */
type = check_typedef (type);
if ((type->code () == TYPE_CODE_DECFLOAT
|| (type->code () == TYPE_CODE_ARRAY && type->is_vector ()))
- && TYPE_LENGTH (type) == 16)
+ && type->length () == 16)
return 1;
if (type->code () == TYPE_CODE_ARRAY)
- return i386_16_byte_align_p (TYPE_TARGET_TYPE (type));
+ return i386_16_byte_align_p (type->target_type ());
if (type->code () == TYPE_CODE_STRUCT
|| type->code () == TYPE_CODE_UNION)
{
for (i = thiscall ? 1 : 0; i < nargs; i++)
{
- int len = TYPE_LENGTH (value_enclosing_type (args[i]));
+ int len = value_enclosing_type (args[i])->length ();
if (write_pass)
{
args_space_used = align_up (args_space_used, 16);
write_memory (sp + args_space_used,
- value_contents_all (args[i]), len);
+ value_contents_all (args[i]).data (), len);
/* The System V ABI says that:
"An argument's size is increased, if necessary, to make it a
/* The 'this' pointer needs to be in ECX. */
if (thiscall)
- regcache->cooked_write (I386_ECX_REGNUM, value_contents_all (args[0]));
+ regcache->cooked_write (I386_ECX_REGNUM,
+ value_contents_all (args[0]).data ());
+
+ /* If the PLT is position-independent, the SYSTEM V ABI requires %ebx to be
+ set to the address of the GOT when doing a call to a PLT address.
+ Note that we do not try to determine whether the PLT is
+ position-independent, we just set the register regardless. */
+ CORE_ADDR func_addr = find_function_addr (function, nullptr, nullptr);
+ if (in_plt_section (func_addr))
+ {
+ struct objfile *objf = nullptr;
+ asection *asect = nullptr;
+ obj_section *osect = nullptr;
+
+ /* Get object file containing func_addr. */
+ obj_section *func_section = find_pc_section (func_addr);
+ if (func_section != nullptr)
+ objf = func_section->objfile;
+
+ if (objf != nullptr)
+ {
+ /* Get corresponding .got.plt or .got section. */
+ asect = bfd_get_section_by_name (objf->obfd.get (), ".got.plt");
+ if (asect == nullptr)
+ asect = bfd_get_section_by_name (objf->obfd.get (), ".got");
+ }
+
+ if (asect != nullptr)
+ /* Translate asection to obj_section. */
+ osect = maint_obj_section_from_bfd_section (objf->obfd.get (),
+ asect, objf);
+
+ if (osect != nullptr)
+ {
+ /* Store the section address in %ebx. */
+ store_unsigned_integer (buf, 4, byte_order, osect->addr ());
+ regcache->cooked_write (I386_EBX_REGNUM, buf);
+ }
+ else
+ {
+ /* If we would only do this for a position-independent PLT, it would
+ make sense to issue a warning here. */
+ }
+ }
/* MarkK wrote: This "+ 8" is all over the place:
(i386_frame_this_id, i386_sigtramp_frame_this_id,
i386_extract_return_value (struct gdbarch *gdbarch, struct type *type,
struct regcache *regcache, gdb_byte *valbuf)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- int len = TYPE_LENGTH (type);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
+ int len = type->length ();
gdb_byte buf[I386_MAX_REGISTER_SIZE];
- if (type->code () == TYPE_CODE_FLT)
+ /* _Float16 and _Float16 _Complex values are returned via xmm0. */
+ if (((type->code () == TYPE_CODE_FLT) && len == 2)
+ || ((type->code () == TYPE_CODE_COMPLEX) && len == 4))
+ {
+ regcache->raw_read (I387_XMM0_REGNUM (tdep), valbuf);
+ return;
+ }
+ else if (type->code () == TYPE_CODE_FLT)
{
if (tdep->st0_regnum < 0)
{
memcpy (valbuf + low_size, buf, len - low_size);
}
else
- internal_error (__FILE__, __LINE__,
- _("Cannot extract return value of %d bytes long."),
+ internal_error (_("Cannot extract return value of %d bytes long."),
len);
}
}
i386_store_return_value (struct gdbarch *gdbarch, struct type *type,
struct regcache *regcache, const gdb_byte *valbuf)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- int len = TYPE_LENGTH (type);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
+ int len = type->length ();
if (type->code () == TYPE_CODE_FLT)
{
valbuf + low_size);
}
else
- internal_error (__FILE__, __LINE__,
- _("Cannot store return value of %d bytes long."), len);
+ internal_error (_("Cannot store return value of %d bytes long."), len);
}
}
\f
static int
i386_reg_struct_return_p (struct gdbarch *gdbarch, struct type *type)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
enum type_code code = type->code ();
- int len = TYPE_LENGTH (type);
+ int len = type->length ();
gdb_assert (code == TYPE_CODE_STRUCT
|| code == TYPE_CODE_UNION
if (struct_convention == pcc_struct_convention
|| (struct_convention == default_struct_convention
- && tdep->struct_return == pcc_struct_return))
+ && tdep->struct_return == pcc_struct_return)
+ || TYPE_HAS_DYNAMIC_LENGTH (type))
return 0;
/* Structures consisting of a single `float', `double' or 'long
static enum return_value_convention
i386_return_value (struct gdbarch *gdbarch, struct value *function,
struct type *type, struct regcache *regcache,
- gdb_byte *readbuf, const gdb_byte *writebuf)
+ struct value **read_value, const gdb_byte *writebuf)
{
enum type_code code = type->code ();
|| code == TYPE_CODE_ARRAY)
&& !i386_reg_struct_return_p (gdbarch, type))
/* Complex double and long double uses the struct return convention. */
- || (code == TYPE_CODE_COMPLEX && TYPE_LENGTH (type) == 16)
- || (code == TYPE_CODE_COMPLEX && TYPE_LENGTH (type) == 24)
+ || (code == TYPE_CODE_COMPLEX && type->length () == 16)
+ || (code == TYPE_CODE_COMPLEX && type->length () == 24)
/* 128-bit decimal float uses the struct return convention. */
- || (code == TYPE_CODE_DECFLOAT && TYPE_LENGTH (type) == 16))
+ || (code == TYPE_CODE_DECFLOAT && type->length () == 16))
{
/* The System V ABI says that:
a record, so the convention applied to records also applies
to arrays. */
- if (readbuf)
+ if (read_value != nullptr)
{
ULONGEST addr;
regcache_raw_read_unsigned (regcache, I386_EAX_REGNUM, &addr);
- read_memory (addr, readbuf, TYPE_LENGTH (type));
+ *read_value = value_at_non_lval (type, addr);
}
return RETURN_VALUE_ABI_RETURNS_ADDRESS;
here. */
if (code == TYPE_CODE_STRUCT && type->num_fields () == 1)
{
- type = check_typedef (type->field (0).type ());
- return i386_return_value (gdbarch, function, type, regcache,
- readbuf, writebuf);
+ struct type *inner_type = check_typedef (type->field (0).type ());
+ enum return_value_convention result
+ = i386_return_value (gdbarch, function, inner_type, regcache,
+ read_value, writebuf);
+ if (read_value != nullptr)
+ deprecated_set_value_type (*read_value, type);
+ return result;
}
- if (readbuf)
- i386_extract_return_value (gdbarch, type, regcache, readbuf);
+ if (read_value != nullptr)
+ {
+ *read_value = allocate_value (type);
+ i386_extract_return_value (gdbarch, type, regcache,
+ value_contents_raw (*read_value).data ());
+ }
if (writebuf)
i386_store_return_value (gdbarch, type, regcache, writebuf);
struct type *
i387_ext_type (struct gdbarch *gdbarch)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (!tdep->i387_ext_type)
{
static struct type *
i386_bnd_type (struct gdbarch *gdbarch)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (!tdep->i386_bnd_type)
static struct type *
i386_zmm_type (struct gdbarch *gdbarch)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (!tdep->i386_zmm_type)
{
int8_t v64_int8[64];
double v8_double[8];
float v16_float[16];
+ float16_t v32_half[32];
bfloat16_t v32_bfloat16[32];
};
#endif
"__gdb_builtin_type_vec512i", TYPE_CODE_UNION);
append_composite_type_field (t, "v32_bfloat16",
init_vector_type (bt->builtin_bfloat16, 32));
+ append_composite_type_field (t, "v32_half",
+ init_vector_type (bt->builtin_half, 32));
append_composite_type_field (t, "v16_float",
init_vector_type (bt->builtin_float, 16));
append_composite_type_field (t, "v8_double",
static struct type *
i386_ymm_type (struct gdbarch *gdbarch)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (!tdep->i386_ymm_type)
{
int8_t v32_int8[32];
double v4_double[4];
float v8_float[8];
+ float16_t v16_half[16];
bfloat16_t v16_bfloat16[16];
};
#endif
"__gdb_builtin_type_vec256i", TYPE_CODE_UNION);
append_composite_type_field (t, "v16_bfloat16",
init_vector_type (bt->builtin_bfloat16, 16));
+ append_composite_type_field (t, "v16_half",
+ init_vector_type (bt->builtin_half, 16));
append_composite_type_field (t, "v8_float",
init_vector_type (bt->builtin_float, 8));
append_composite_type_field (t, "v4_double",
static struct type *
i386_mmx_type (struct gdbarch *gdbarch)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (!tdep->i386_mmx_type)
{
return bt->builtin_int64;
}
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
}
/* Map a cooked register onto a raw register or memory. For the i386,
static int
i386_mmx_regnum_to_fp_regnum (readable_regcache *regcache, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (regcache->arch ());
+ gdbarch *arch = regcache->arch ();
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (arch);
int mmxreg, fpreg;
ULONGEST fstat;
int tos;
{
gdb_byte raw_buf[I386_MAX_REGISTER_SIZE];
enum register_status status;
- gdb_byte *buf = value_contents_raw (result_value);
+ gdb_byte *buf = value_contents_raw (result_value).data ();
if (i386_mmx_regnum_p (gdbarch, regnum))
{
status = regcache->raw_read (fpnum, raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0,
- TYPE_LENGTH (value_type (result_value)));
+ result_value->type ()->length ());
else
memcpy (buf, raw_buf, register_size (gdbarch, regnum));
}
else
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (i386_bnd_regnum_p (gdbarch, regnum))
{
regnum -= tdep->bnd0_regnum;
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
LONGEST upper, lower;
- int size = TYPE_LENGTH (builtin_type (gdbarch)->builtin_data_ptr);
+ int size = builtin_type (gdbarch)->builtin_data_ptr->length ();
lower = extract_unsigned_integer (raw_buf, 8, byte_order);
upper = extract_unsigned_integer (raw_buf + 8, 8, byte_order);
status = regcache->raw_read (gpnum, raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0,
- TYPE_LENGTH (value_type (result_value)));
+ result_value->type ()->length ());
else
memcpy (buf, raw_buf, 2);
}
status = regcache->raw_read (gpnum % 4, raw_buf);
if (status != REG_VALID)
mark_value_bytes_unavailable (result_value, 0,
- TYPE_LENGTH (value_type (result_value)));
+ result_value->type ()->length ());
else if (gpnum >= 4)
memcpy (buf, raw_buf + 1, 1);
else
memcpy (buf, raw_buf, 1);
}
else
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
}
}
}
else
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (i386_bnd_regnum_p (gdbarch, regnum))
{
ULONGEST upper, lower;
- int size = TYPE_LENGTH (builtin_type (gdbarch)->builtin_data_ptr);
+ int size = builtin_type (gdbarch)->builtin_data_ptr->length ();
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
/* New values from input value. */
regcache->raw_write (gpnum % 4, raw_buf);
}
else
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
}
}
i386_ax_pseudo_register_collect (struct gdbarch *gdbarch,
struct agent_expr *ax, int regnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (i386_mmx_regnum_p (gdbarch, regnum))
{
return 0;
}
else
- internal_error (__FILE__, __LINE__, _("invalid regnum"));
+ internal_error (_("invalid regnum"));
return 1;
}
\f
i386_convert_register_p (struct gdbarch *gdbarch,
int regnum, struct type *type)
{
- int len = TYPE_LENGTH (type);
+ int len = type->length ();
/* Values may be spread across multiple registers. Most debugging
formats aren't expressive enough to specify the locations, so
return its contents in TO. */
static int
-i386_register_to_value (struct frame_info *frame, int regnum,
+i386_register_to_value (frame_info_ptr frame, int regnum,
struct type *type, gdb_byte *to,
int *optimizedp, int *unavailablep)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
- int len = TYPE_LENGTH (type);
+ int len = type->length ();
if (i386_fp_regnum_p (gdbarch, regnum))
return i387_register_to_value (frame, regnum, type, to,
REGNUM in frame FRAME. */
static void
-i386_value_to_register (struct frame_info *frame, int regnum,
+i386_value_to_register (frame_info_ptr frame, int regnum,
struct type *type, const gdb_byte *from)
{
- int len = TYPE_LENGTH (type);
+ int len = type->length ();
if (i386_fp_regnum_p (get_frame_arch (frame), regnum))
{
int regnum, const void *gregs, size_t len)
{
struct gdbarch *gdbarch = regcache->arch ();
- const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ const i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
const gdb_byte *regs = (const gdb_byte *) gregs;
int i;
int regnum, void *gregs, size_t len)
{
struct gdbarch *gdbarch = regcache->arch ();
- const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ const i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
gdb_byte *regs = (gdb_byte *) gregs;
int i;
int regnum, const void *fpregs, size_t len)
{
struct gdbarch *gdbarch = regcache->arch ();
- const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ const i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (len == I387_SIZEOF_FXSAVE)
{
int regnum, void *fpregs, size_t len)
{
struct gdbarch *gdbarch = regcache->arch ();
- const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ const i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
if (len == I387_SIZEOF_FXSAVE)
{
void *cb_data,
const struct regcache *regcache)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
cb (".reg", tdep->sizeof_gregset, tdep->sizeof_gregset, &i386_gregset, NULL,
cb_data);
/* Stuff for WIN32 PE style DLL's but is pretty generic really. */
CORE_ADDR
-i386_pe_skip_trampoline_code (struct frame_info *frame,
+i386_pe_skip_trampoline_code (frame_info_ptr frame,
CORE_ADDR pc, char *name)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
routine. */
int
-i386_sigtramp_p (struct frame_info *this_frame)
+i386_sigtramp_p (frame_info_ptr this_frame)
{
CORE_ADDR pc = get_frame_pc (this_frame);
const char *name;
routine. */
static int
-i386_svr4_sigtramp_p (struct frame_info *this_frame)
+i386_svr4_sigtramp_p (frame_info_ptr this_frame)
{
CORE_ADDR pc = get_frame_pc (this_frame);
const char *name;
address of the associated sigcontext (ucontext) structure. */
static CORE_ADDR
-i386_svr4_sigcontext_addr (struct frame_info *this_frame)
+i386_svr4_sigcontext_addr (frame_info_ptr this_frame)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
specified by the "[-]N@" prefix, and it is one of the registers that
we know has an extended variant available, then use the extended
version of the register instead. */
- if (register_size (gdbarch, regnum) < TYPE_LENGTH (p->arg_type)
+ if (register_size (gdbarch, regnum) < p->arg_type->length ()
&& reg_assoc.find (regname) != reg_assoc.end ())
return "e" + regname;
void
i386_svr4_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
/* System V Release 4 uses ELF. */
i386_elf_init_abi (info, gdbarch);
/* i386 register groups. In addition to the normal groups, add "mmx"
and "sse". */
-static struct reggroup *i386_sse_reggroup;
-static struct reggroup *i386_mmx_reggroup;
+static const reggroup *i386_sse_reggroup;
+static const reggroup *i386_mmx_reggroup;
static void
i386_init_reggroups (void)
{
reggroup_add (gdbarch, i386_sse_reggroup);
reggroup_add (gdbarch, i386_mmx_reggroup);
- reggroup_add (gdbarch, general_reggroup);
- reggroup_add (gdbarch, float_reggroup);
- reggroup_add (gdbarch, all_reggroup);
- reggroup_add (gdbarch, save_reggroup);
- reggroup_add (gdbarch, restore_reggroup);
- reggroup_add (gdbarch, vector_reggroup);
- reggroup_add (gdbarch, system_reggroup);
}
int
i386_register_reggroup_p (struct gdbarch *gdbarch, int regnum,
- struct reggroup *group)
+ const struct reggroup *group)
{
- const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ const i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
int fp_regnum_p, mmx_regnum_p, xmm_regnum_p, mxcsr_regnum_p,
ymm_regnum_p, ymmh_regnum_p, ymm_avx512_regnum_p, ymmh_avx512_regnum_p,
bndr_regnum_p, bnd_regnum_p, zmm_regnum_p, zmmh_regnum_p,
/* Get the ARGIth function argument for the current function. */
static CORE_ADDR
-i386_fetch_pointer_argument (struct frame_info *frame, int argi,
+i386_fetch_pointer_argument (frame_info_ptr frame, int argi,
struct type *type)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
struct i386_record_s *ir,
uint32_t iregnum)
{
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
int i;
/* Oza: Because of floating point insn push/pop of fpu stack is going to
ULONGEST addr;
gdb_byte buf[I386_MAX_REGISTER_SIZE];
struct i386_record_s ir;
- struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
uint8_t rex_w = -1;
uint8_t rex_r = 0;
ir.gdbarch = gdbarch;
if (record_debug > 1)
- fprintf_unfiltered (gdb_stdlog, "Process record: i386_process_record "
- "addr = %s\n",
- paddress (gdbarch, ir.addr));
+ gdb_printf (gdb_stdlog, "Process record: i386_process_record "
+ "addr = %s\n",
+ paddress (gdbarch, ir.addr));
/* prefixes */
while (1)
/* XXX */
case 0xcc: /* int3 */
- printf_unfiltered (_("Process record does not support instruction "
- "int3.\n"));
+ gdb_printf (gdb_stderr,
+ _("Process record does not support instruction "
+ "int3.\n"));
ir.addr -= 1;
goto no_support;
break;
if (interrupt != 0x80
|| tdep->i386_intx80_record == NULL)
{
- printf_unfiltered (_("Process record does not support "
- "instruction int 0x%02x.\n"),
- interrupt);
+ gdb_printf (gdb_stderr,
+ _("Process record does not support "
+ "instruction int 0x%02x.\n"),
+ interrupt);
ir.addr -= 2;
goto no_support;
}
/* XXX */
case 0xce: /* into */
- printf_unfiltered (_("Process record does not support "
- "instruction into.\n"));
+ gdb_printf (gdb_stderr,
+ _("Process record does not support "
+ "instruction into.\n"));
ir.addr -= 1;
goto no_support;
break;
break;
case 0x62: /* bound */
- printf_unfiltered (_("Process record does not support "
- "instruction bound.\n"));
+ gdb_printf (gdb_stderr,
+ _("Process record does not support "
+ "instruction bound.\n"));
ir.addr -= 1;
goto no_support;
break;
break;
case 0x0f30: /* wrmsr */
- printf_unfiltered (_("Process record does not support "
- "instruction wrmsr.\n"));
+ gdb_printf (gdb_stderr,
+ _("Process record does not support "
+ "instruction wrmsr.\n"));
ir.addr -= 2;
goto no_support;
break;
case 0x0f32: /* rdmsr */
- printf_unfiltered (_("Process record does not support "
- "instruction rdmsr.\n"));
+ gdb_printf (gdb_stderr,
+ _("Process record does not support "
+ "instruction rdmsr.\n"));
ir.addr -= 2;
goto no_support;
break;
}
if (tdep->i386_sysenter_record == NULL)
{
- printf_unfiltered (_("Process record does not support "
- "instruction sysenter.\n"));
+ gdb_printf (gdb_stderr,
+ _("Process record does not support "
+ "instruction sysenter.\n"));
ir.addr -= 2;
goto no_support;
}
break;
case 0x0f35: /* sysexit */
- printf_unfiltered (_("Process record does not support "
- "instruction sysexit.\n"));
+ gdb_printf (gdb_stderr,
+ _("Process record does not support "
+ "instruction sysexit.\n"));
ir.addr -= 2;
goto no_support;
break;
int ret;
if (tdep->i386_syscall_record == NULL)
{
- printf_unfiltered (_("Process record does not support "
- "instruction syscall.\n"));
+ gdb_printf (gdb_stderr,
+ _("Process record does not support "
+ "instruction syscall.\n"));
ir.addr -= 2;
goto no_support;
}
break;
case 0x0f07: /* sysret */
- printf_unfiltered (_("Process record does not support "
- "instruction sysret.\n"));
+ gdb_printf (gdb_stderr,
+ _("Process record does not support "
+ "instruction sysret.\n"));
ir.addr -= 2;
goto no_support;
break;
break;
case 0xf4: /* hlt */
- printf_unfiltered (_("Process record does not support "
- "instruction hlt.\n"));
+ gdb_printf (gdb_stderr,
+ _("Process record does not support "
+ "instruction hlt.\n"));
ir.addr -= 1;
goto no_support;
break;
return 0;
no_support:
- printf_unfiltered (_("Process record does not support instruction 0x%02x "
- "at address %s.\n"),
- (unsigned int) (opcode),
- paddress (gdbarch, ir.orig_addr));
+ gdb_printf (gdb_stderr,
+ _("Process record does not support instruction 0x%02x "
+ "at address %s.\n"),
+ (unsigned int) (opcode),
+ paddress (gdbarch, ir.orig_addr));
return -1;
}
|| strcmp (name, "real(kind=16)") == 0
|| strcmp (name, "real*16") == 0
|| strcmp (name, "REAL*16") == 0)
- return floatformats_ia64_quad;
+ return floatformats_ieee_quad;
return default_floatformat_for_type (gdbarch, name, len);
}
static int
-i386_validate_tdesc_p (struct gdbarch_tdep *tdep,
+i386_validate_tdesc_p (i386_gdbarch_tdep *tdep,
struct tdesc_arch_data *tdesc_data)
{
const struct target_desc *tdesc = tdep->tdesc;
{
if ((type->code () == TYPE_CODE_INT
|| type->code () == TYPE_CODE_FLT)
- && TYPE_LENGTH (type) > 4)
+ && type->length () > 4)
return 4;
/* Handle x86's funny long double. */
if (type->code () == TYPE_CODE_FLT
- && gdbarch_long_double_bit (gdbarch) == TYPE_LENGTH (type) * 8)
+ && gdbarch_long_double_bit (gdbarch) == type->length () * 8)
return 4;
}
static struct gdbarch *
i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
{
- struct gdbarch_tdep *tdep;
- struct gdbarch *gdbarch;
const struct target_desc *tdesc;
int mm0_regnum;
int ymm0_regnum;
return arches->gdbarch;
/* Allocate space for the new architecture. Assume i386 for now. */
- tdep = XCNEW (struct gdbarch_tdep);
- gdbarch = gdbarch_alloc (&info, tdep);
+ gdbarch *gdbarch
+ = gdbarch_alloc (&info, gdbarch_tdep_up (new i386_gdbarch_tdep));
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (gdbarch);
/* General-purpose registers. */
tdep->gregset_reg_offset = NULL;
set_gdbarch_register_to_value (gdbarch, i386_register_to_value);
set_gdbarch_value_to_register (gdbarch, i386_value_to_register);
- set_gdbarch_return_value (gdbarch, i386_return_value);
+ set_gdbarch_return_value_as_value (gdbarch, i386_return_value);
set_gdbarch_skip_prologue (gdbarch, i386_skip_prologue);
appended to the list first, so that it supercedes the DWARF
unwinder in function epilogues (where the DWARF unwinder
currently fails). */
- frame_unwind_append_unwinder (gdbarch, &i386_epilogue_frame_unwind);
+ if (info.bfd_arch_info->bits_per_word == 32)
+ frame_unwind_append_unwinder (gdbarch, &i386_epilogue_frame_unwind);
/* Hook in the DWARF CFI frame unwinder. This unwinder is appended
to the list before the prologue-based unwinders, so that DWARF
if (!i386_validate_tdesc_p (tdep, tdesc_data.get ()))
{
- xfree (tdep);
gdbarch_free (gdbarch);
return NULL;
}
tdep-> bnd0_regnum = -1;
/* Hook in the legacy prologue-based unwinders last (fallback). */
- frame_unwind_append_unwinder (gdbarch, &i386_stack_tramp_frame_unwind);
- frame_unwind_append_unwinder (gdbarch, &i386_sigtramp_frame_unwind);
- frame_unwind_append_unwinder (gdbarch, &i386_frame_unwind);
+ if (info.bfd_arch_info->bits_per_word == 32)
+ {
+ frame_unwind_append_unwinder (gdbarch, &i386_stack_tramp_frame_unwind);
+ frame_unwind_append_unwinder (gdbarch, &i386_sigtramp_frame_unwind);
+ frame_unwind_append_unwinder (gdbarch, &i386_frame_unwind);
+ }
/* If we have a register mapping, enable the generic core file
support, unless it has already been enabled. */
i386_mpx_bd_base (void)
{
struct regcache *rcache;
- struct gdbarch_tdep *tdep;
ULONGEST ret;
enum register_status regstatus;
rcache = get_current_regcache ();
- tdep = gdbarch_tdep (rcache->arch ());
+ gdbarch *arch = rcache->arch ();
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (arch);
regstatus = regcache_raw_read_unsigned (rcache, tdep->bndcfgu_regnum, &ret);
int
i386_mpx_enabled (void)
{
- const struct gdbarch_tdep *tdep = gdbarch_tdep (get_current_arch ());
+ gdbarch *arch = get_current_arch ();
+ i386_gdbarch_tdep *tdep = gdbarch_tdep<i386_gdbarch_tdep> (arch);
const struct target_desc *tdesc = tdep->tdesc;
return (tdesc_find_feature (tdesc, "org.gnu.gdb.i386.mpx") != NULL);
if (gdbarch_bfd_arch_info (gdbarch)->arch != bfd_arch_i386
|| !i386_mpx_enabled ())
{
- printf_unfiltered (_("Intel Memory Protection Extensions not "
- "supported on this target.\n"));
+ gdb_printf (_("Intel Memory Protection Extensions not "
+ "supported on this target.\n"));
return;
}
if (args == NULL)
{
- printf_unfiltered (_("Address of pointer variable expected.\n"));
+ gdb_printf (_("Address of pointer variable expected.\n"));
return;
}
for (i = 0; i < 4; i++)
bt_entry[i] = read_memory_typed_address (bt_entry_addr
- + i * TYPE_LENGTH (data_ptr_type),
+ + i * data_ptr_type->length (),
data_ptr_type);
i386_mpx_print_bounds (bt_entry);
bt_entry_addr = i386_mpx_get_bt_entry (addr, bd_base);
for (i = 0; i < 2; i++)
bt_entry[i] = read_memory_typed_address (bt_entry_addr
- + i * TYPE_LENGTH (data_ptr_type),
+ + i * data_ptr_type->length (),
data_ptr_type);
bt_entry[0] = (uint64_t) lower;
bt_entry[1] = ~(uint64_t) upper;
for (i = 0; i < 2; i++)
write_memory_unsigned_integer (bt_entry_addr
- + i * TYPE_LENGTH (data_ptr_type),
- TYPE_LENGTH (data_ptr_type), byte_order,
+ + i * data_ptr_type->length (),
+ data_ptr_type->length (), byte_order,
bt_entry[i]);
}
void
_initialize_i386_tdep ()
{
- register_gdbarch_init (bfd_arch_i386, i386_gdbarch_init);
+ gdbarch_register (bfd_arch_i386, i386_gdbarch_init);
/* Add the variable that controls the disassembly flavor. */
add_setshow_enum_cmd ("disassembly-flavor", no_class, valid_flavors,
NULL, /* FIXME: i18n: */
&setlist, &showlist);
- /* Add "mpx" prefix for the set commands. */
-
- add_basic_prefix_cmd ("mpx", class_support, _("\
-Set Intel Memory Protection Extensions specific variables."),
- &mpx_set_cmdlist,
- 0 /* allow-unknown */, &setlist);
-
- /* Add "mpx" prefix for the show commands. */
+ /* Add "mpx" prefix for the set and show commands. */
- add_show_prefix_cmd ("mpx", class_support, _("\
-Show Intel Memory Protection Extensions specific variables."),
- &mpx_show_cmdlist,
- 0 /* allow-unknown */, &showlist);
+ add_setshow_prefix_cmd
+ ("mpx", class_support,
+ _("Set Intel Memory Protection Extensions specific variables."),
+ _("Show Intel Memory Protection Extensions specific variables."),
+ &mpx_set_cmdlist, &mpx_show_cmdlist, &setlist, &showlist);
/* Add "bound" command for the show mpx commands list. */