/* Native support code for PPC AIX, for GDB the GNU debugger.
- Copyright (C) 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+ Copyright (C) 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
Free Software Foundation, Inc.
#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
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 = 0;
+ 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;
rs6000_software_single_step (struct frame_info *frame)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
+ struct address_space *aspace = get_frame_address_space (frame);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int ii, insn;
CORE_ADDR loc;
/* ignore invalid breakpoint. */
if (breaks[ii] == -1)
continue;
- insert_single_step_breakpoint (gdbarch, breaks[ii]);
+ insert_single_step_breakpoint (gdbarch, aspace, breaks[ii]);
}
errno = 0; /* FIXME, don't ignore errors! */