aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2009-02-16 03:16:24 +0000
committerPedro Alves <palves@redhat.com>2009-02-16 03:16:24 +0000
commit959b87241d85b42da82c45ecc4bc904895092730 (patch)
tree2907c74deb6dcb97ec313592635b253a0098f7a6 /gdb/gdbarch.c
parentdaily update (diff)
downloadbinutils-gdb-959b87241d85b42da82c45ecc4bc904895092730.tar.gz
binutils-gdb-959b87241d85b42da82c45ecc4bc904895092730.tar.bz2
binutils-gdb-959b87241d85b42da82c45ecc4bc904895092730.zip
* corelow.c (core_close): Don't hardcode the core's pid.
(core_open): Find core threads before calling post_create_inferior. (add_to_thread_list, get_core_register_section): Take into account systems where the regset section names encode the pid of the inferior. * gdbarch.sh (core_reg_section_encodes_pid): New gdbarch setting. * gdbarch.h, gdbarch.c: Regenerate. * amd64-sol2-tdep.c (amd64_sol2_init_abi): Set it. * i386-sol2-tdep.c (i386_sol2_init_abi): Set it. * sparc-sol2-tdep.c (sparc32_sol2_init_abi): Set it. * sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Set it.
Diffstat (limited to 'gdb/gdbarch.c')
-rw-r--r--gdb/gdbarch.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index b8e825825ae..1b4a6f4d31b 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -223,6 +223,7 @@ struct gdbarch
gdbarch_register_reggroup_p_ftype *register_reggroup_p;
gdbarch_fetch_pointer_argument_ftype *fetch_pointer_argument;
gdbarch_regset_from_core_section_ftype *regset_from_core_section;
+ int core_reg_section_encodes_pid;
struct core_regset_section * core_regset_sections;
gdbarch_core_xfer_shared_libraries_ftype *core_xfer_shared_libraries;
int vtable_function_descriptors;
@@ -356,6 +357,7 @@ struct gdbarch startup_gdbarch =
default_register_reggroup_p, /* register_reggroup_p */
0, /* fetch_pointer_argument */
0, /* regset_from_core_section */
+ 0, /* core_reg_section_encodes_pid */
0, /* core_regset_sections */
0, /* core_xfer_shared_libraries */
0, /* vtable_function_descriptors */
@@ -609,6 +611,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of register_reggroup_p, invalid_p == 0 */
/* Skip verify of fetch_pointer_argument, has predicate */
/* Skip verify of regset_from_core_section, has predicate */
+ /* Skip verify of core_reg_section_encodes_pid, invalid_p == 0 */
/* Skip verify of core_xfer_shared_libraries, has predicate */
/* Skip verify of vtable_function_descriptors, invalid_p == 0 */
/* Skip verify of vbit_in_delta, invalid_p == 0 */
@@ -736,6 +739,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
"gdbarch_dump: core_read_description = <%s>\n",
host_address_to_string (gdbarch->core_read_description));
fprintf_unfiltered (file,
+ "gdbarch_dump: core_reg_section_encodes_pid = %s\n",
+ plongest (gdbarch->core_reg_section_encodes_pid));
+ fprintf_unfiltered (file,
"gdbarch_dump: core_regset_sections = %s\n",
host_address_to_string (gdbarch->core_regset_sections));
fprintf_unfiltered (file,
@@ -2899,6 +2905,23 @@ set_gdbarch_regset_from_core_section (struct gdbarch *gdbarch,
gdbarch->regset_from_core_section = regset_from_core_section;
}
+int
+gdbarch_core_reg_section_encodes_pid (struct gdbarch *gdbarch)
+{
+ gdb_assert (gdbarch != NULL);
+ /* Skip verify of core_reg_section_encodes_pid, invalid_p == 0 */
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_core_reg_section_encodes_pid called\n");
+ return gdbarch->core_reg_section_encodes_pid;
+}
+
+void
+set_gdbarch_core_reg_section_encodes_pid (struct gdbarch *gdbarch,
+ int core_reg_section_encodes_pid)
+{
+ gdbarch->core_reg_section_encodes_pid = core_reg_section_encodes_pid;
+}
+
struct core_regset_section *
gdbarch_core_regset_sections (struct gdbarch *gdbarch)
{