aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/linux-tile-low.c
diff options
context:
space:
mode:
authorJiong Wang <jiwang@sourceware.org>2013-02-27 14:58:18 +0000
committerJiong Wang <jiwang@sourceware.org>2013-02-27 14:58:18 +0000
commite1f58301ddf98b17ab9f2d94e0e636e2893a7a1e (patch)
tree34f42bc75f2f42699fc59f988e0e433df2f24559 /gdb/gdbserver/linux-tile-low.c
parent4fcd89fc75ae350bd8697799352c02ece46fca52 (diff)
downloadgdb-e1f58301ddf98b17ab9f2d94e0e636e2893a7a1e.zip
gdb-e1f58301ddf98b17ab9f2d94e0e636e2893a7a1e.tar.gz
gdb-e1f58301ddf98b17ab9f2d94e0e636e2893a7a1e.tar.bz2
gdb/
* regformats/reg-tilegx.dat (name): Change abi name to "tilegx". * regformats/reg-tilegx32.dat: New. gdbserver/ * Makefile.in (clean): Remove reg-tilegx.c, reg-tilegx32.c. (reg-tilegx32.c): New rule. * configure.srv (tilegx-*-linux*): Add reg-tilegx32.o to srv_regobj. * linux-tile-low.c (tile_arch_setup): New function. Invoke different register info initializer according to elf class. (init_registers_tilgx32): New function. The tilegx32 register info initializer. (tile_fill_gregset): Use "uint_reg_t" to represent register size. (tile_store_gregset): Likewise.
Diffstat (limited to 'gdb/gdbserver/linux-tile-low.c')
-rw-r--r--gdb/gdbserver/linux-tile-low.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/gdb/gdbserver/linux-tile-low.c b/gdb/gdbserver/linux-tile-low.c
index c73bdf2..f242675 100644
--- a/gdb/gdbserver/linux-tile-low.c
+++ b/gdb/gdbserver/linux-tile-low.c
@@ -20,10 +20,13 @@
#include "server.h"
#include "linux-low.h"
+#include <arch/abi.h>
#include <sys/ptrace.h>
-/* Defined in auto-generated file reg-tile.c. */
-void init_registers_tile (void);
+/* Defined in auto-generated file reg-tilegx.c. */
+void init_registers_tilegx (void);
+/* Defined in auto-generated file reg-tilegx32.c. */
+void init_registers_tilegx32 (void);
#define tile_num_regs 65
@@ -103,7 +106,7 @@ tile_fill_gregset (struct regcache *regcache, void *buf)
for (i = 0; i < tile_num_regs; i++)
if (tile_regmap[i] != -1)
- collect_register (regcache, i, ((unsigned int *) buf) + tile_regmap[i]);
+ collect_register (regcache, i, ((uint_reg_t *) buf) + tile_regmap[i]);
}
static void
@@ -113,7 +116,7 @@ tile_store_gregset (struct regcache *regcache, const void *buf)
for (i = 0; i < tile_num_regs; i++)
if (tile_regmap[i] != -1)
- supply_register (regcache, i, ((unsigned long *) buf) + tile_regmap[i]);
+ supply_register (regcache, i, ((uint_reg_t *) buf) + tile_regmap[i]);
}
struct regset_info target_regsets[] =
@@ -123,9 +126,27 @@ struct regset_info target_regsets[] =
{ 0, 0, 0, -1, -1, NULL, NULL }
};
+static void
+tile_arch_setup (void)
+{
+ int pid = pid_of (get_thread_lwp (current_inferior));
+ unsigned int machine;
+ int is_elf64 = linux_pid_exe_is_elf_64_file (pid, &machine);
+
+ if (sizeof (void *) == 4)
+ if (is_elf64 > 0)
+ error (_("Can't debug 64-bit process with 32-bit GDBserver"));
+
+ if (!is_elf64)
+ init_registers_tilegx32();
+ else
+ init_registers_tilegx();
+}
+
+
struct linux_target_ops the_low_target =
{
- init_registers_tile,
+ tile_arch_setup,
tile_num_regs,
tile_regmap,
NULL,