Memory error when reading wrong core file.
authorJoel Brobecker <brobecker@gnat.com>
Mon, 8 Mar 2010 07:45:49 +0000 (07:45 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Mon, 8 Mar 2010 07:45:49 +0000 (07:45 +0000)
        * solib-svr4.c (solib_svr4_r_map): catch and print all exception
        errors while reading the inferior memory, and return zero if
        an exception was raised.

gdb/ChangeLog
gdb/solib-svr4.c

index 911fcd1eb3370d30025dd97bc3c3c26d02ad7682..39c0c789c374995d5190ca2b6f438b388e6d5ff5 100644 (file)
@@ -1,3 +1,10 @@
+2010-03-08  Joel Brobecker  <brobecker@adacore.com>
+
+       Memory error when reading wrong core file.
+       * solib-svr4.c (solib_svr4_r_map): catch and print all exception
+       errors while reading the inferior memory, and return zero if
+       an exception was raised.
+
 2010-03-07  Michael Snyder  <msnyder@vmware.com>
 
        * record.c (record_restore): Rename tmpu8 to rectype.
index 4317283448819827eed693f1e4b0569abe573047..0c6654f9112ea778bebd7e91406728b82285edcf 100644 (file)
@@ -868,9 +868,16 @@ solib_svr4_r_map (struct svr4_info *info)
 {
   struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
   struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
+  CORE_ADDR addr = 0;
+  volatile struct gdb_exception ex;
 
-  return read_memory_typed_address (info->debug_base + lmo->r_map_offset,
-                                   ptr_type);
+  TRY_CATCH (ex, RETURN_MASK_ERROR)
+    {
+      addr = read_memory_typed_address (info->debug_base + lmo->r_map_offset,
+                                        ptr_type);
+    }
+  exception_print (gdb_stderr, ex);
+  return addr;
 }
 
 /* Find r_brk from the inferior's debug base.  */
This page took 0.038096 seconds and 4 git commands to generate.