aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/rs6000-aix-tdep.c20
2 files changed, 24 insertions, 3 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index fe8bcb7..e56a6a1 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2010-04-20 Joel Brobecker <brobecker@adacore.com>
+ * rs6000-aix-tdep.c: #include exceptions.h.
+ (rs6000_convert_from_func_ptr_addr): If an exception is thrown
+ while reading the memory at ADDR, then ADDR cannot be a function
+ descriptor.
+
+2010-04-20 Joel Brobecker <brobecker@adacore.com>
+
* ada-typeprint.c (ada_print_typedef): New function.
* ada-lang.h (ada_print_typedef): Add declaration.
* ada-lang.c (ada_language_defn): set la_print_typdef field
diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c
index 530c12e..927cfe2 100644
--- a/gdb/rs6000-aix-tdep.c
+++ b/gdb/rs6000-aix-tdep.c
@@ -34,6 +34,7 @@
#include "breakpoint.h"
#include "rs6000-tdep.h"
#include "ppc-tdep.h"
+#include "exceptions.h"
/* Hook for determining the TOC address when calling functions in the
inferior under AIX. The initialization code in rs6000-nat.c sets
@@ -582,9 +583,22 @@ rs6000_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
the target address itself points to a section that is executable. */
if (s && (s->the_bfd_section->flags & SEC_CODE) == 0)
{
- CORE_ADDR pc =
- read_memory_unsigned_integer (addr, tdep->wordsize, byte_order);
- struct obj_section *pc_section = find_pc_section (pc);
+ CORE_ADDR pc;
+ struct obj_section *pc_section;
+ struct gdb_exception e;
+
+ TRY_CATCH (e, RETURN_MASK_ERROR)
+ {
+ pc = read_memory_unsigned_integer (addr, tdep->wordsize, byte_order);
+ }
+ if (e.reason < 0)
+ {
+ /* An error occured during reading. Probably a memory error
+ due to the section not being loaded yet. This address
+ cannot be a function descriptor. */
+ return addr;
+ }
+ pc_section = find_pc_section (pc);
if (pc_section && (pc_section->the_bfd_section->flags & SEC_CODE))
return pc;