aboutsummaryrefslogtreecommitdiff
path: root/gdb/solib-svr4.c
diff options
context:
space:
mode:
authorJoel Brobecker <brobecker@gnat.com>2010-03-08 07:45:49 +0000
committerJoel Brobecker <brobecker@gnat.com>2010-03-08 07:45:49 +0000
commit08597104eb26d23340f42ccd610ce6d24015e501 (patch)
tree246ea61d5e64dfa9395c376c85fe227661fea009 /gdb/solib-svr4.c
parentec6dbf37039f379951bcd79d7ddc9e9bd6708524 (diff)
downloadgdb-08597104eb26d23340f42ccd610ce6d24015e501.zip
gdb-08597104eb26d23340f42ccd610ce6d24015e501.tar.gz
gdb-08597104eb26d23340f42ccd610ce6d24015e501.tar.bz2
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.
Diffstat (limited to 'gdb/solib-svr4.c')
-rw-r--r--gdb/solib-svr4.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 4317283..0c6654f 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -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. */