]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/gdbarch.c
* corelow.c (core_close): Don't hardcode the core's pid.
[thirdparty/binutils-gdb.git] / gdb / gdbarch.c
index b8e825825aec43a6c59cf975ed1b08169ccaf7c0..1b4a6f4d31b14466fb5ea54d47025443308bdcfa 100644 (file)
@@ -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 */
@@ -735,6 +738,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
   fprintf_unfiltered (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));
@@ -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)
 {