aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2010-07-07 12:28:32 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2010-07-07 12:28:32 +0000
commit2f2241f14651e177f430128c5d22755628a7d91d (patch)
treeac595c3b2b60b437ba98bf2b2451141e6ecbdc72 /gdb
parent9176f4dfdcdd71ae2179d676244e1609b9962447 (diff)
downloadgdb-2f2241f14651e177f430128c5d22755628a7d91d.zip
gdb-2f2241f14651e177f430128c5d22755628a7d91d.tar.gz
gdb-2f2241f14651e177f430128c5d22755628a7d91d.tar.bz2
* linux-nat.c (linux_nat_do_thread_registers): Use section size
from gdbarch_core_regset_sections also for .reg if present. * amd64-linux-tdep.c (amd64_linux_regset_sections): Fix incorrect section size for .reg. * ppc-linux-tdep.c (ppc_linux_vsx_regset_sections): Likewise. (ppc_linux_vmx_regset_sections): Likewise. (ppc_linux_fp_regset_sections): Likewise. (ppc64_linux_vsx_regset_sections): New variable. (ppc64_linux_vmx_regset_sections): Likewise. (ppc64_linux_fp_regset_sections): Likewise. (ppc_linux_init_abi): Install core_regset_section lists appropriate for current word size.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog16
-rw-r--r--gdb/amd64-linux-tdep.c2
-rw-r--r--gdb/linux-nat.c57
-rw-r--r--gdb/ppc-linux-tdep.c66
4 files changed, 98 insertions, 43 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 4bb3be4..9408b1c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,19 @@
+2010-07-07 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * linux-nat.c (linux_nat_do_thread_registers): Use section size
+ from gdbarch_core_regset_sections also for .reg if present.
+
+ * amd64-linux-tdep.c (amd64_linux_regset_sections): Fix incorrect
+ section size for .reg.
+ * ppc-linux-tdep.c (ppc_linux_vsx_regset_sections): Likewise.
+ (ppc_linux_vmx_regset_sections): Likewise.
+ (ppc_linux_fp_regset_sections): Likewise.
+ (ppc64_linux_vsx_regset_sections): New variable.
+ (ppc64_linux_vmx_regset_sections): Likewise.
+ (ppc64_linux_fp_regset_sections): Likewise.
+ (ppc_linux_init_abi): Install core_regset_section lists appropriate
+ for current word size.
+
2010-07-06 Joel Brobecker <brobecker@adacore.com>
* server.c (myresume): Make static.
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 1eac4c6..ed75f97 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -52,7 +52,7 @@
/* Supported register note sections. */
static struct core_regset_section amd64_linux_regset_sections[] =
{
- { ".reg", 144, "general-purpose" },
+ { ".reg", 27 * 8, "general-purpose" },
{ ".reg2", 512, "floating-point" },
{ ".reg-xstate", I386_XSTATE_MAX_SIZE, "XSAVE extended state" },
{ NULL, 0 }
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 201d804..93adfcd 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -4134,8 +4134,6 @@ linux_nat_do_thread_registers (bfd *obfd, ptid_t ptid,
char *note_data, int *note_size,
enum target_signal stop_signal)
{
- gdb_gregset_t gregs;
- gdb_fpregset_t fpregs;
unsigned long lwp = ptid_get_lwp (ptid);
struct gdbarch *gdbarch = target_gdbarch;
struct regcache *regcache = get_thread_arch_regcache (ptid, gdbarch);
@@ -4153,21 +4151,6 @@ linux_nat_do_thread_registers (bfd *obfd, ptid_t ptid,
core_regset_p = gdbarch_regset_from_core_section_p (gdbarch);
sect_list = gdbarch_core_regset_sections (gdbarch);
- if (core_regset_p
- && (regset = gdbarch_regset_from_core_section (gdbarch, ".reg",
- sizeof (gregs))) != NULL
- && regset->collect_regset != NULL)
- regset->collect_regset (regset, regcache, -1,
- &gregs, sizeof (gregs));
- else
- fill_gregset (regcache, &gregs, -1);
-
- note_data = (char *) elfcore_write_prstatus (obfd,
- note_data,
- note_size,
- lwp,
- stop_signal, &gregs);
-
/* The loop below uses the new struct core_regset_section, which stores
the supported section names and sizes for the core file. Note that
note PRSTATUS needs to be treated specially. But the other notes are
@@ -4175,12 +4158,6 @@ linux_nat_do_thread_registers (bfd *obfd, ptid_t ptid,
if (core_regset_p && sect_list != NULL)
while (sect_list->sect_name != NULL)
{
- /* .reg was already handled above. */
- if (strcmp (sect_list->sect_name, ".reg") == 0)
- {
- sect_list++;
- continue;
- }
regset = gdbarch_regset_from_core_section (gdbarch,
sect_list->sect_name,
sect_list->size);
@@ -4188,12 +4165,16 @@ linux_nat_do_thread_registers (bfd *obfd, ptid_t ptid,
gdb_regset = xmalloc (sect_list->size);
regset->collect_regset (regset, regcache, -1,
gdb_regset, sect_list->size);
- note_data = (char *) elfcore_write_register_note (obfd,
- note_data,
- note_size,
- sect_list->sect_name,
- gdb_regset,
- sect_list->size);
+
+ if (strcmp (sect_list->sect_name, ".reg") == 0)
+ note_data = (char *) elfcore_write_prstatus
+ (obfd, note_data, note_size,
+ lwp, stop_signal, gdb_regset);
+ else
+ note_data = (char *) elfcore_write_register_note
+ (obfd, note_data, note_size,
+ sect_list->sect_name, gdb_regset,
+ sect_list->size);
xfree (gdb_regset);
sect_list++;
}
@@ -4203,6 +4184,24 @@ linux_nat_do_thread_registers (bfd *obfd, ptid_t ptid,
the new support, the code below should be deleted. */
else
{
+ gdb_gregset_t gregs;
+ gdb_fpregset_t fpregs;
+
+ if (core_regset_p
+ && (regset = gdbarch_regset_from_core_section (gdbarch, ".reg",
+ sizeof (gregs))) != NULL
+ && regset->collect_regset != NULL)
+ regset->collect_regset (regset, regcache, -1,
+ &gregs, sizeof (gregs));
+ else
+ fill_gregset (regcache, &gregs, -1);
+
+ note_data = (char *) elfcore_write_prstatus (obfd,
+ note_data,
+ note_size,
+ lwp,
+ stop_signal, &gregs);
+
if (core_regset_p
&& (regset = gdbarch_regset_from_core_section (gdbarch, ".reg2",
sizeof (fpregs))) != NULL
diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
index 130707f..8fc8512 100644
--- a/gdb/ppc-linux-tdep.c
+++ b/gdb/ppc-linux-tdep.c
@@ -516,7 +516,7 @@ ppc64_standard_linkage1_target (struct frame_info *frame,
static struct core_regset_section ppc_linux_vsx_regset_sections[] =
{
- { ".reg", 268, "general-purpose" },
+ { ".reg", 48 * 4, "general-purpose" },
{ ".reg2", 264, "floating-point" },
{ ".reg-ppc-vmx", 544, "ppc Altivec" },
{ ".reg-ppc-vsx", 256, "POWER7 VSX" },
@@ -525,7 +525,7 @@ static struct core_regset_section ppc_linux_vsx_regset_sections[] =
static struct core_regset_section ppc_linux_vmx_regset_sections[] =
{
- { ".reg", 268, "general-purpose" },
+ { ".reg", 48 * 4, "general-purpose" },
{ ".reg2", 264, "floating-point" },
{ ".reg-ppc-vmx", 544, "ppc Altivec" },
{ NULL, 0}
@@ -533,7 +533,31 @@ static struct core_regset_section ppc_linux_vmx_regset_sections[] =
static struct core_regset_section ppc_linux_fp_regset_sections[] =
{
- { ".reg", 268, "general-purpose" },
+ { ".reg", 48 * 4, "general-purpose" },
+ { ".reg2", 264, "floating-point" },
+ { NULL, 0}
+};
+
+static struct core_regset_section ppc64_linux_vsx_regset_sections[] =
+{
+ { ".reg", 48 * 8, "general-purpose" },
+ { ".reg2", 264, "floating-point" },
+ { ".reg-ppc-vmx", 544, "ppc Altivec" },
+ { ".reg-ppc-vsx", 256, "POWER7 VSX" },
+ { NULL, 0}
+};
+
+static struct core_regset_section ppc64_linux_vmx_regset_sections[] =
+{
+ { ".reg", 48 * 8, "general-purpose" },
+ { ".reg2", 264, "floating-point" },
+ { ".reg-ppc-vmx", 544, "ppc Altivec" },
+ { NULL, 0}
+};
+
+static struct core_regset_section ppc64_linux_fp_regset_sections[] =
+{
+ { ".reg", 48 * 8, "general-purpose" },
{ ".reg2", 264, "floating-point" },
{ NULL, 0}
};
@@ -1507,6 +1531,19 @@ ppc_linux_init_abi (struct gdbarch_info info,
set_gdbarch_gcore_bfd_target (gdbarch, "elf32-powerpcle");
else
set_gdbarch_gcore_bfd_target (gdbarch, "elf32-powerpc");
+
+ /* Supported register sections. */
+ if (tdesc_find_feature (info.target_desc,
+ "org.gnu.gdb.power.vsx"))
+ set_gdbarch_core_regset_sections (gdbarch,
+ ppc_linux_vsx_regset_sections);
+ else if (tdesc_find_feature (info.target_desc,
+ "org.gnu.gdb.power.altivec"))
+ set_gdbarch_core_regset_sections (gdbarch,
+ ppc_linux_vmx_regset_sections);
+ else
+ set_gdbarch_core_regset_sections (gdbarch,
+ ppc_linux_fp_regset_sections);
}
if (tdep->wordsize == 8)
@@ -1533,20 +1570,23 @@ ppc_linux_init_abi (struct gdbarch_info info,
set_gdbarch_gcore_bfd_target (gdbarch, "elf64-powerpcle");
else
set_gdbarch_gcore_bfd_target (gdbarch, "elf64-powerpc");
+
+ /* Supported register sections. */
+ if (tdesc_find_feature (info.target_desc,
+ "org.gnu.gdb.power.vsx"))
+ set_gdbarch_core_regset_sections (gdbarch,
+ ppc64_linux_vsx_regset_sections);
+ else if (tdesc_find_feature (info.target_desc,
+ "org.gnu.gdb.power.altivec"))
+ set_gdbarch_core_regset_sections (gdbarch,
+ ppc64_linux_vmx_regset_sections);
+ else
+ set_gdbarch_core_regset_sections (gdbarch,
+ ppc64_linux_fp_regset_sections);
}
set_gdbarch_regset_from_core_section (gdbarch, ppc_linux_regset_from_core_section);
set_gdbarch_core_read_description (gdbarch, ppc_linux_core_read_description);
- /* Supported register sections. */
- if (tdesc_find_feature (info.target_desc,
- "org.gnu.gdb.power.vsx"))
- set_gdbarch_core_regset_sections (gdbarch, ppc_linux_vsx_regset_sections);
- else if (tdesc_find_feature (info.target_desc,
- "org.gnu.gdb.power.altivec"))
- set_gdbarch_core_regset_sections (gdbarch, ppc_linux_vmx_regset_sections);
- else
- set_gdbarch_core_regset_sections (gdbarch, ppc_linux_fp_regset_sections);
-
/* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map);