keiths / rpms / gdb

Forked from rpms/gdb 5 months ago
Clone
7b8bd72
[RFC/ia64] memory error when reading wrong core file
7b8bd72
http://sourceware.org/ml/gdb-patches/2010-01/msg00645.html
7b8bd72
http://sourceware.org/ml/gdb-patches/2010-02/msg00001.html
7b8bd72
http://sourceware.org/ml/gdb-patches/2010-03/msg00298.html
7b8bd72
http://sourceware.org/ml/gdb-cvs/2010-03/msg00065.html
7b8bd72
c961a8da422283662e09ee498c0598d48fc9d70f
7b8bd72
7b8bd72
--- src/gdb/solib-svr4.c	2010/02/24 00:29:02	1.125
7b8bd72
+++ src/gdb/solib-svr4.c	2010/03/08 07:45:49	1.126
7b8bd72
@@ -868,9 +868,16 @@
7b8bd72
 {
7b8bd72
   struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
7b8bd72
   struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
7b8bd72
+  CORE_ADDR addr = 0;
7b8bd72
+  volatile struct gdb_exception ex;
7b8bd72
 
7b8bd72
-  return read_memory_typed_address (info->debug_base + lmo->r_map_offset,
7b8bd72
-				    ptr_type);
7b8bd72
+  TRY_CATCH (ex, RETURN_MASK_ERROR)
7b8bd72
+    {
7b8bd72
+      addr = read_memory_typed_address (info->debug_base + lmo->r_map_offset,
7b8bd72
+                                        ptr_type);
7b8bd72
+    }
7b8bd72
+  exception_print (gdb_stderr, ex);
7b8bd72
+  return addr;
7b8bd72
 }
7b8bd72
 
7b8bd72
 /* Find r_brk from the inferior's debug base.  */
7b8bd72
### src/gdb/ChangeLog	2010/03/08 01:49:30	1.11441
7b8bd72
### src/gdb/ChangeLog	2010/03/08 07:45:49	1.11442
7b8bd72
## -1,3 +1,10 @@
7b8bd72
+2010-03-08  Joel Brobecker  <brobecker@adacore.com>
7b8bd72
+
7b8bd72
+	Memory error when reading wrong core file.
7b8bd72
+	* solib-svr4.c (solib_svr4_r_map): catch and print all exception
7b8bd72
+	errors while reading the inferior memory, and return zero if
7b8bd72
+	an exception was raised.
7b8bd72
+
7b8bd72
 2010-03-07  Michael Snyder  <msnyder@vmware.com>
7b8bd72
 
7b8bd72
 	* record.c (record_restore): Rename tmpu8 to rectype.