diff options
author | Ulrich Weigand <uweigand@de.ibm.com> | 2010-01-04 14:57:44 +0000 |
---|---|---|
committer | Ulrich Weigand <uweigand@de.ibm.com> | 2010-01-04 14:57:44 +0000 |
commit | 1b1818e443eb8f134e0bc2f5ec950c8a16df6883 (patch) | |
tree | 8f0f48069e6f1599263926ab5b8028cc94ff2419 | |
parent | dcbf108f79b23f0092a6d3c7cfb13471172e865f (diff) | |
download | gdb-1b1818e443eb8f134e0bc2f5ec950c8a16df6883.zip gdb-1b1818e443eb8f134e0bc2f5ec950c8a16df6883.tar.gz gdb-1b1818e443eb8f134e0bc2f5ec950c8a16df6883.tar.bz2 |
* regset.h (struct core_regset_section): Add HUMAN_NAME.
* i386-linux-tdep.c (i386_linux_regset_sections): Fill in HUMAN_NAME.
* ppc-linux-tdep.c (ppc_linux_vsx_regset_sections): Likewise.
(ppc_linux_vmx_regset_sections): Likewise.
(ppc_linux_fp_regset_sections): Likewise.
* corelow.c (get_core_register_section): Constify arguments.
(get_core_registers): Use gdbarch_core_regset_sections instead
of hard-coded platform-specific register section names.
-rw-r--r-- | gdb/ChangeLog | 12 | ||||
-rw-r--r-- | gdb/corelow.c | 39 | ||||
-rw-r--r-- | gdb/i386-linux-tdep.c | 6 | ||||
-rw-r--r-- | gdb/ppc-linux-tdep.c | 18 | ||||
-rw-r--r-- | gdb/regset.h | 1 |
5 files changed, 52 insertions, 24 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 79fe93a..3d0de47 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,17 @@ 2010-01-04 Ulrich Weigand <uweigand@de.ibm.com> + * regset.h (struct core_regset_section): Add HUMAN_NAME. + * i386-linux-tdep.c (i386_linux_regset_sections): Fill in HUMAN_NAME. + * ppc-linux-tdep.c (ppc_linux_vsx_regset_sections): Likewise. + (ppc_linux_vmx_regset_sections): Likewise. + (ppc_linux_fp_regset_sections): Likewise. + + * corelow.c (get_core_register_section): Constify arguments. + (get_core_registers): Use gdbarch_core_regset_sections instead + of hard-coded platform-specific register section names. + +2010-01-04 Ulrich Weigand <uweigand@de.ibm.com> + * dwarf2loc.c (read_pieced_value): If a piece occupies part of a register, assume the least-signficant part is used. (write_pieced_value): Likewise. diff --git a/gdb/corelow.c b/gdb/corelow.c index 1760e40..039573f 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -508,9 +508,9 @@ deprecated_core_resize_section_table (int num_added) static void get_core_register_section (struct regcache *regcache, - char *name, + const char *name, int which, - char *human_name, + const char *human_name, int required) { static char *section_name = NULL; @@ -591,6 +591,7 @@ static void get_core_registers (struct target_ops *ops, struct regcache *regcache, int regno) { + struct core_regset_section *sect_list; int i; if (!(core_gdbarch && gdbarch_regset_from_core_section_p (core_gdbarch)) @@ -601,16 +602,30 @@ get_core_registers (struct target_ops *ops, return; } - get_core_register_section (regcache, - ".reg", 0, "general-purpose", 1); - get_core_register_section (regcache, - ".reg2", 2, "floating-point", 0); - get_core_register_section (regcache, - ".reg-xfp", 3, "extended floating-point", 0); - get_core_register_section (regcache, - ".reg-ppc-vmx", 3, "ppc Altivec", 0); - get_core_register_section (regcache, - ".reg-ppc-vsx", 4, "POWER7 VSX", 0); + sect_list = gdbarch_core_regset_sections (get_regcache_arch (regcache)); + if (sect_list) + while (sect_list->sect_name != NULL) + { + if (strcmp (sect_list->sect_name, ".reg") == 0) + get_core_register_section (regcache, sect_list->sect_name, + 0, sect_list->human_name, 1); + else if (strcmp (sect_list->sect_name, ".reg2") == 0) + get_core_register_section (regcache, sect_list->sect_name, + 2, sect_list->human_name, 0); + else + get_core_register_section (regcache, sect_list->sect_name, + 3, sect_list->human_name, 0); + + sect_list++; + } + + else + { + get_core_register_section (regcache, + ".reg", 0, "general-purpose", 1); + get_core_register_section (regcache, + ".reg2", 2, "floating-point", 0); + } /* Supply dummy value for all registers not found in the core. */ for (i = 0; i < gdbarch_num_regs (get_regcache_arch (regcache)); i++) diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index 463bc34..5acd229 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -49,9 +49,9 @@ /* Supported register note sections. */ static struct core_regset_section i386_linux_regset_sections[] = { - { ".reg", 144 }, - { ".reg2", 108 }, - { ".reg-xfp", 512 }, + { ".reg", 144, "general-purpose" }, + { ".reg2", 108, "floating-point" }, + { ".reg-xfp", 512, "extended floating-point" }, { NULL, 0 } }; diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index b1a8959..36cedf1 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -516,25 +516,25 @@ ppc64_standard_linkage1_target (struct frame_info *frame, static struct core_regset_section ppc_linux_vsx_regset_sections[] = { - { ".reg", 268 }, - { ".reg2", 264 }, - { ".reg-ppc-vmx", 544 }, - { ".reg-ppc-vsx", 256 }, + { ".reg", 268, "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 ppc_linux_vmx_regset_sections[] = { - { ".reg", 268 }, - { ".reg2", 264 }, - { ".reg-ppc-vmx", 544 }, + { ".reg", 268, "general-purpose" }, + { ".reg2", 264, "floating-point" }, + { ".reg-ppc-vmx", 544, "ppc Altivec" }, { NULL, 0} }; static struct core_regset_section ppc_linux_fp_regset_sections[] = { - { ".reg", 268 }, - { ".reg2", 264 }, + { ".reg", 268, "general-purpose" }, + { ".reg2", 264, "floating-point" }, { NULL, 0} }; diff --git a/gdb/regset.h b/gdb/regset.h index b61758e..9a21ced 100644 --- a/gdb/regset.h +++ b/gdb/regset.h @@ -29,6 +29,7 @@ struct core_regset_section { const char *sect_name; int size; + const char *human_name; }; /* Data structure describing a register set. */ |