Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: gdb/gdbserver/linux-tile-low.c

Issue 124383005: GDB 7.6.50 (Closed) Base URL: http://git.chromium.org/native_client/nacl-gdb.git@upstream
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gdb/gdbserver/linux-tic6x-low.c ('k') | gdb/gdbserver/linux-x86-low.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/gdbserver/linux-tile-low.c
diff --git a/gdb/gdbserver/linux-tile-low.c b/gdb/gdbserver/linux-tile-low.c
index e7c7d112ca7c0faa6597f9662c885a77bf5b660e..8efb34eee888000e95d05d15b19332ac4df6f9f1 100644
--- a/gdb/gdbserver/linux-tile-low.c
+++ b/gdb/gdbserver/linux-tile-low.c
@@ -1,6 +1,6 @@
/* GNU/Linux/TILE-Gx specific low level interface, GDBserver.
- Copyright (C) 2012 Free Software Foundation, Inc.
+ Copyright (C) 2012-2013 Free Software Foundation, Inc.
This file is part of GDB.
@@ -20,10 +20,16 @@
#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);
+extern const struct target_desc *tdesc_tilegx;
+
+/* Defined in auto-generated file reg-tilegx32.c. */
+void init_registers_tilegx32 (void);
+extern const struct target_desc *tdesc_tilegx32;
#define tile_num_regs 65
@@ -103,7 +109,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,22 +119,64 @@ 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[] =
+static struct regset_info tile_regsets[] =
{
- { PTRACE_GETREGS, PTRACE_SETREGS, 0, tile_num_regs * 4,
+ { PTRACE_GETREGS, PTRACE_SETREGS, 0, tile_num_regs * 8,
GENERAL_REGS, tile_fill_gregset, tile_store_gregset },
{ 0, 0, 0, -1, -1, NULL, NULL }
};
+static struct regsets_info tile_regsets_info =
+ {
+ tile_regsets, /* regsets */
+ 0, /* num_regsets */
+ NULL, /* disabled_regsets */
+ };
+
+static struct usrregs_info tile_usrregs_info =
+ {
+ tile_num_regs,
+ tile_regmap,
+ };
+
+static struct regs_info regs_info =
+ {
+ NULL, /* regset_bitmap */
+ &tile_usrregs_info,
+ &tile_regsets_info,
+ };
+
+static const struct regs_info *
+tile_regs_info (void)
+{
+ return &regs_info;
+}
+
+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)
+ current_process ()->tdesc = tdesc_tilegx32;
+ else
+ current_process ()->tdesc = tdesc_tilegx;
+}
+
+
struct linux_target_ops the_low_target =
{
- init_registers_tile,
- tile_num_regs,
- tile_regmap,
- NULL,
+ tile_arch_setup,
+ tile_regs_info,
tile_cannot_fetch_register,
tile_cannot_store_register,
NULL,
@@ -140,3 +188,12 @@ struct linux_target_ops the_low_target =
0,
tile_breakpoint_at,
};
+
+void
+initialize_low_arch (void)
+{
+ init_registers_tilegx32();
+ init_registers_tilegx();
+
+ initialize_regsets_info (&tile_regsets_info);
+}
« no previous file with comments | « gdb/gdbserver/linux-tic6x-low.c ('k') | gdb/gdbserver/linux-x86-low.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698