diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-04-11 16:58:57 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2012-04-11 16:58:57 +0000 |
commit | 9e529e1d3d54431b6e1b0433efe8203887c0580f (patch) | |
tree | 736886402877cbbc3f5ce4ffdbe0c681e65573e1 | |
parent | 4841cf0c4cb8a97e59f2a1c800346b725cb77e6a (diff) | |
download | gdb-9e529e1d3d54431b6e1b0433efe8203887c0580f.zip gdb-9e529e1d3d54431b6e1b0433efe8203887c0580f.tar.gz gdb-9e529e1d3d54431b6e1b0433efe8203887c0580f.tar.bz2 |
gdb/
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.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/infrun.c | 8 |
2 files changed, 14 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1c2e48b..aceef1e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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 diff --git a/gdb/infrun.c b/gdb/infrun.c index 103ef30..62f67c9 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -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: ", |