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: [RFA- v2] Testcase for bug report 11531 and fix for Solaris


On Saturday 24 April 2010 16:13:06, Pierre Muller wrote:
>     Work around the problem by removing hardware watchpoints if a step is
>     requested, GDB will check for a hardware watchpoint trigger after the
>     step anyway.  */
> -#define CANNOT_STEP_HW_WATCHPOINTS
> +/* The code related to this macro does not work
> +   anymore. Thus we remove this macro definition.  */
> +/* #define CANNOT_STEP_HW_WATCHPOINTS */

The new comment isn't correct.  I'd like to clarify this, at least
for the archives.

It's not that the code does not work anymore.  The _main_ issue the
workaround handles, is the fact that on older Solaris kernels, when
stepping around a page that has a watchpoint installed, the kernel
would forget the step, and hence, the inferior would run free.  The
workaround should still be preventing that as is.

What no longer works since the workaround was written, is that GDB
used to check if there was any watchpoint that triggered after
all single-steps, regardless of whether the target indicating common
code a watchpoint triggered or not, hence PR 11531.

Obviously, having the inferior randomly running free when the user
does "step" or "next" is worse than missing a watchpoint when
stepping.

If we still wanted to support Solaris <= 2.7, we'd
still want the workaround in some form.  So, it's not that 
it "doesn't work anymore" -- it's that the current workaround
implementation is incomplete because it breaks something else. 
For example, we'd need to somehow make GDB core check for
watchpoints after every single-step on this target.  And, we
would indeed want to make this conditional on the currently
running kernel version, because although it should be relatively
simple to workaround PR11531 (regular watchpoints), by always
checking for watched value changes after all single-steps,
read and write watchpoints, would be harder to unbreak.
(yes, procfs.c doesn't report the stopped data address today,
so read and write watchpoints don't work anyway, but it could
report it, as Solaris' procfs does support that, IIRC).

As nobody said they're still interested in those older Solaris'
kernel, let's indeed just go the simple route of removing the whole
workaround, and not leave that code commented out (as Joel suggested),
but please let's keep finally removing the nm file and the
associated glue for a separate patch.

-- 
Pedro Alves


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