This is the mail archive of the gdb-patches@sourceware.org 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: [patch] More suggestive displaced-stepping memory error message


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 (éå)


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