#include "record.h"
#include "record-full.h"
-#include <stdint.h>
-
#include "features/i386/i386.c"
#include "features/i386/i386-avx.c"
#include "features/i386/i386-mpx.c"
return gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
}
-/* Convert SVR4 register number REG to the appropriate register number
+/* Convert SVR4 DWARF register number REG to the appropriate register number
used by GDB. */
static int
-i386_svr4_reg_to_regnum (struct gdbarch *gdbarch, int reg)
+i386_svr4_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
case 45: return I386_GS_REGNUM;
}
- /* This will hopefully provoke a warning. */
- return gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
+ return -1;
+}
+
+/* Wrapper on i386_svr4_dwarf_reg_to_regnum to return
+ num_regs + num_pseudo_regs for other debug formats. */
+
+static int
+i386_svr4_reg_to_regnum (struct gdbarch *gdbarch, int reg)
+{
+ int regnum = i386_svr4_dwarf_reg_to_regnum (gdbarch, reg);
+
+ if (regnum == -1)
+ return gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
+ return regnum;
}
\f
struct regcache *regs)
{
size_t len = gdbarch_max_insn_length (gdbarch);
- gdb_byte *buf = xmalloc (len);
+ gdb_byte *buf = (gdb_byte *) xmalloc (len);
read_memory (from, buf, len);
struct i386_frame_cache *cache;
if (*this_cache)
- return *this_cache;
+ return (struct i386_frame_cache *) *this_cache;
cache = i386_alloc_frame_cache ();
*this_cache = cache;
CORE_ADDR sp;
if (*this_cache)
- return *this_cache;
+ return (struct i386_frame_cache *) *this_cache;
cache = i386_alloc_frame_cache ();
*this_cache = cache;
gdb_byte buf[4];
if (*this_cache)
- return *this_cache;
+ return (struct i386_frame_cache *) *this_cache;
cache = i386_alloc_frame_cache ();
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- const gdb_byte *regs = gregs;
+ const gdb_byte *regs = (const gdb_byte *) gregs;
int i;
gdb_assert (len >= tdep->sizeof_gregset);
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
const struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- gdb_byte *regs = gregs;
+ gdb_byte *regs = (gdb_byte *) gregs;
int i;
gdb_assert (len >= tdep->sizeof_gregset);
return 0;
len = s - start - 1;
- regname = alloca (len + 1);
+ regname = (char *) alloca (len + 1);
strncpy (regname, start, len);
regname[len] = '\0';
return 0;
len_base = s - start;
- base = alloca (len_base + 1);
+ base = (char *) alloca (len_base + 1);
strncpy (base, start, len_base);
base[len_base] = '\0';
++s;
len_index = s - start;
- index = alloca (len_index + 1);
+ index = (char *) alloca (len_index + 1);
strncpy (index, start, len_index);
index[len_index] = '\0';
string. */
static int
-i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch,
- CORE_ADDR addr, int *isize, char **msg)
+i386_fast_tracepoint_valid_at (struct gdbarch *gdbarch, CORE_ADDR addr,
+ char **msg)
{
int len, jumplen;
static struct ui_file *gdb_null = NULL;
/* Check for fit. */
len = gdb_print_insn (gdbarch, addr, gdb_null, NULL);
- if (isize)
- *isize = len;
if (len < jumplen)
{
set_gdbarch_sdb_reg_to_regnum (gdbarch, i386_dbx_reg_to_regnum);
/* Use the SVR4 register numbering scheme for DWARF 2. */
- set_gdbarch_dwarf2_reg_to_regnum (gdbarch, i386_svr4_reg_to_regnum);
+ set_gdbarch_dwarf2_reg_to_regnum (gdbarch, i386_svr4_dwarf_reg_to_regnum);
/* We don't set gdbarch_stab_reg_to_regnum, since ECOFF doesn't seem to
be in use on any of the supported i386 targets. */
set_gdbarch_insn_is_jump (gdbarch, i386_insn_is_jump);
/* Hook in ABI-specific overrides, if they have been registered. */
- info.tdep_info = (void *) tdesc_data;
+ info.tdep_info = tdesc_data;
gdbarch_init_osabi (info, gdbarch);
if (!i386_validate_tdesc_p (tdep, tdesc_data))
if (gdbarch_ptr_bit (gdbarch) == 64)
{
- mpx_bd_mask = MPX_BD_MASK;
+ mpx_bd_mask = (CORE_ADDR) MPX_BD_MASK;
bd_ptr_r_shift = 20;
bd_ptr_l_shift = 3;
bt_select_r_shift = 3;
bt_select_l_shift = 5;
- bt_mask = MPX_BT_MASK;
+ bt_mask = (CORE_ADDR) MPX_BT_MASK;
+
+ if ( sizeof (CORE_ADDR) == 4)
+ error (_("bound table examination not supported\
+ for 64-bit process with 32-bit GDB"));
}
else
{
struct type *data_ptr_type = builtin_type (gdbarch)->builtin_data_ptr;
if (!i386_mpx_enabled ())
- error (_("Intel(R) Memory Protection Extensions not\
- supported on this target."));
+ {
+ printf_unfiltered (_("Intel(R) Memory Protection Extensions not "
+ "supported on this target.\n"));
+ return;
+ }
if (args == NULL)
- error (_("Address of pointer variable expected."));
+ {
+ printf_unfiltered (_("Address of pointer variable expected.\n"));
+ return;
+ }
addr = parse_and_eval_address (args);
static void
set_mpx_cmd (char *args, int from_tty)
{
- help_list (mpx_set_cmdlist, "set mpx", all_commands, gdb_stdout);
+ help_list (mpx_set_cmdlist, "set mpx ", all_commands, gdb_stdout);
}
/* Helper function for the CLI commands. */
add_prefix_cmd ("mpx", class_support, set_mpx_cmd, _("\
Set Intel(R) Memory Protection Extensions specific variables."),
- &mpx_set_cmdlist, "set tdesc ",
+ &mpx_set_cmdlist, "set mpx ",
0 /* allow-unknown */, &setlist);
/* Add "mpx" prefix for the show commands. */