This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA/m32r] Fix m32r frame analyzer


     }
   else
     func_end = pc + DEFAULT_SEARCH_LIMIT;
-  decode_prologue (pc, func_end, &sal.end);
+
+  /* If pc's location is not readable, just quit. */
+  if (!safe_read_memory_integer (pc, 4, &return_value))
+    return 0;
+
+  decode_prologue (pc, func_end, &sal.end, NULL);
   return sal.end;
 }

The save_read_memory will need to be in decode_prologue and applied to
every memory read as a fetch of PC+/-4 could equally fail.  That means
more interface changes to decode_prologue (return success/fail?).

On fail, it should also return the old PC and not zero - look at
find_function_start_sal for why.

If you make those changes, you can commit.

Andrew



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]