This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] More suggestive displaced-stepping memory error message
- From: Yao Qi <yao at codesourcery dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Wed, 11 Apr 2012 07:31:35 +0800
- Subject: Re: [patch] More suggestive displaced-stepping memory error message
- References: <20120410191955.GB31331@host2.jankratochvil.net>
On 04/11/2012 03:19 AM, Jan Kratochvil wrote:
> - 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 buffer, you may want to temporarily "
> + "turn it off if there is only one inferior thread."),
The error message is not clear to me. Why "one inferior thread" matters
here? If GDB is unable to do displaced-stepping due to unavailable
scratch pad, user has no choice except disable displaced-stepping for a
moment, and turn it on later.
> + paddress (target_gdbarch, copy), safe_strerror (status));
^^^^^^^^^^^^^^ why not `gdbarch'?
Think a little more, is it a little over-strict and less user-friendly
in this case? If I got such error message like "turn it off temporarily
and turn it on later", I can turn displaced-stepping off, but I don't
know when to turn it on again. Probably, GDB can be smart enough to not
use displaced stepping when get error on accessing scratch pad. So far,
displaced_step_prepare returns 1 for success and 0 for queued request.
We can add one more return value -1 for `unable to do displaced
stepping', so that caller can go non-displaced-stepping path.
--
Yao (éå)