--- gdb/arm-tdep.c	2011/04/18 00:53:09	1.1
+++ gdb/arm-tdep.c	2011/04/18 17:21:34	1.2
@@ -1091,8 +1091,14 @@
        current_pc < prologue_end;
        current_pc += 4)
     {
-      unsigned int insn
-	= read_memory_unsigned_integer (current_pc, 4, byte_order_for_code);
+      unsigned int insn;
+      LONGEST tmp;
+      if (!safe_read_memory_integer (current_pc, 4, byte_order_for_code, &tmp))
+	{
+	  /* must not be a real prologue if we can't even read it... */
+	  return unrecognized_pc;
+	}
+      insn = read_memory_unsigned_integer (current_pc, 4, byte_order_for_code);
 
       if (insn == 0xe1a0c00d)		/* mov ip, sp */
 	{
