gdb/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 11 Apr 2012 16:58:57 +0000 (16:58 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Wed, 11 Apr 2012 16:58:57 +0000 (16:58 +0000)
Provide more specific displaced-stepping memory error message.
* infrun.c (displaced_step_prepare): New variable status.  Call
target_read_memory instead of read_memory, provide more specific
error message.

gdb/ChangeLog
gdb/infrun.c

index 1c2e48b243cd350520995bcf3ba5153ef0f73e64..aceef1e8397be6c04fa8c15c38740abfbe855512 100644 (file)
@@ -1,3 +1,10 @@
+2012-04-11  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Provide more specific displaced-stepping memory error message.
+       * infrun.c (displaced_step_prepare): New variable status.  Call
+       target_read_memory instead of read_memory, provide more specific
+       error message.
+
 2012-04-11  Tristan Gingold  <gingold@adacore.com>
 
        PR gdb/13901
index 103ef30c2d7e97cd234d5270da0d0fe5f68ca1ed..62f67c930138d23ef2be8a77478ab2079bbb8edc 100644 (file)
@@ -1296,6 +1296,7 @@ displaced_step_prepare (ptid_t ptid)
   ULONGEST len;
   struct displaced_step_closure *closure;
   struct displaced_step_inferior_state *displaced;
+  int status;
 
   /* We should never reach this function if the architecture does not
      support displaced stepping.  */
@@ -1356,7 +1357,12 @@ displaced_step_prepare (ptid_t ptid)
   displaced->step_saved_copy = xmalloc (len);
   ignore_cleanups = make_cleanup (free_current_contents,
                                  &displaced->step_saved_copy);
-  read_memory (copy, displaced->step_saved_copy, len);
+  status = target_read_memory (copy, displaced->step_saved_copy, len);
+  if (status != 0)
+    throw_error (MEMORY_ERROR,
+                _("Error accessing memory address %s (%s) for "
+                  "displaced-stepping scratch space."),
+                paddress (gdbarch, copy), safe_strerror (status));
   if (debug_displaced)
     {
       fprintf_unfiltered (gdb_stdlog, "displaced: saved %s: ",
This page took 0.030915 seconds and 4 git commands to generate.