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

Unified Diff: gdb/gdbserver/linux-xtensa-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-x86-low.c ('k') | gdb/gdbserver/lynx-i386-low.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gdb/gdbserver/linux-xtensa-low.c
diff --git a/gdb/gdbserver/linux-xtensa-low.c b/gdb/gdbserver/linux-xtensa-low.c
index 34370f98b4c4e02c633ad3a0a6f7799a765e17a2..6083f337a87df86268d167ee21a3d25e212d791d 100644
--- a/gdb/gdbserver/linux-xtensa-low.c
+++ b/gdb/gdbserver/linux-xtensa-low.c
@@ -1,5 +1,5 @@
/* GNU/Linux/Xtensa specific low level interface, for the remote server for GDB.
- Copyright 2007-2012 Free Software Foundation, Inc.
+ Copyright (C) 2007-2013 Free Software Foundation, Inc.
This file is part of GDB.
@@ -22,6 +22,7 @@
/* Defined in auto-generated file reg-xtensa.c. */
void init_registers_xtensa (void);
+extern const struct target_desc *tdesc_xtensa;
#include <sys/ptrace.h>
#include <xtensa-config.h>
@@ -40,19 +41,20 @@ static void
xtensa_fill_gregset (struct regcache *regcache, void *buf)
{
elf_greg_t* rset = (elf_greg_t*)buf;
+ const struct target_desc *tdesc = regcache->tdesc;
int ar0_regnum;
char *ptr;
int i;
/* Take care of AR registers. */
- ar0_regnum = find_regno ("ar0");
+ ar0_regnum = find_regno (tdesc, "ar0");
ptr = (char*)&rset[R_A0];
for (i = ar0_regnum; i < ar0_regnum + XCHAL_NUM_AREGS; i++)
{
collect_register (regcache, i, ptr);
- ptr += register_size(i);
+ ptr += register_size (tdesc, i);
}
/* Loop registers, if hardware has it. */
@@ -74,19 +76,20 @@ static void
xtensa_store_gregset (struct regcache *regcache, const void *buf)
{
const elf_greg_t* rset = (const elf_greg_t*)buf;
+ const struct target_desc *tdesc = regcache->tdesc;
int ar0_regnum;
char *ptr;
int i;
/* Take care of AR registers. */
- ar0_regnum = find_regno ("ar0");
+ ar0_regnum = find_regno (tdesc, "ar0");
ptr = (char *)&rset[R_A0];
for (i = ar0_regnum; i < ar0_regnum + XCHAL_NUM_AREGS; i++)
{
supply_register (regcache, i, ptr);
- ptr += register_size(i);
+ ptr += register_size (tdesc, i);
}
/* Loop registers, if hardware has it. */
@@ -130,7 +133,7 @@ xtensa_store_xtregset (struct regcache *regcache, const void *buf)
}
}
-struct regset_info target_regsets[] = {
+static struct regset_info xtensa_regsets[] = {
{ PTRACE_GETREGS, PTRACE_SETREGS, 0, sizeof (elf_gregset_t),
GENERAL_REGS,
xtensa_fill_gregset, xtensa_store_gregset },
@@ -176,11 +179,41 @@ xtensa_breakpoint_at (CORE_ADDR where)
xtensa_breakpoint, xtensa_breakpoint_len) == 0;
}
+static struct regsets_info xtensa_regsets_info =
+ {
+ xtensa_regsets, /* regsets */
+ 0, /* num_regsets */
+ NULL, /* disabled_regsets */
+ };
+
+static struct usrregs_info xtensa_usrregs_info =
+ {
+ xtensa_num_regs,
+ xtensa_regmap,
+ };
+
+static struct regs_info regs_info =
+ {
+ NULL, /* regset_bitmap */
+ &xtensa_usrregs_info,
+ &xtensa_regsets_info
+ };
+
+static void
+xtensa_arch_setup (void)
+{
+ current_process ()->tdesc = tdesc_xtensa;
+}
+
+static const struct regs_info *
+xtensa_regs_info (void)
+{
+ return &regs_info;
+}
+
struct linux_target_ops the_low_target = {
- init_registers_xtensa,
- 0,
- 0,
- NULL,
+ xtensa_arch_setup,
+ xtensa_regs_info,
0,
0,
NULL, /* fetch_register */
@@ -192,3 +225,13 @@ struct linux_target_ops the_low_target = {
0,
xtensa_breakpoint_at,
};
+
+
+void
+initialize_low_arch (void)
+{
+ /* Initialize the Linux target descriptions. */
+ init_registers_xtensa ();
+
+ initialize_regsets_info (&xtensa_regsets_info);
+}
« no previous file with comments | « gdb/gdbserver/linux-x86-low.c ('k') | gdb/gdbserver/lynx-i386-low.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698