[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCHv3,Hurd] Add hardware watch support

From: Thomas Schwinge
Subject: Re: [PATCHv3,Hurd] Add hardware watch support
Date: Tue, 16 Sep 2014 00:08:01 +0200
User-agent: Notmuch/0.9-101-g81dad07 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu)

Hi Samuel!

On Fri, 12 Sep 2014 19:56:13 +0200, I wrote:
> Many thanks for persisting with this patch.  The GDB testsuite shows a
> pretty good improvement!  I'll try to assess the remaining issues

From a quick scan through the »FAIL:.*watch« matches, the following one
issue should be relevant for a lot of the regressions: given, for
example, the gdb.base/pr11022 test case, on GNU/Linux we see:

    $ gcc [...]/gdb/testsuite/gdb.base/pr11022.c -g -o pr11022
    $ ./gdb -q -ex 'watch x' -ex run pr11022 
    Hardware watchpoint 1: x
    Old value = 0
    New value = 42
    main () at ../../W._C._Handy/gdb/testsuite/gdb.base/pr11022.c:28
    28          j = i;  /* expect HW watchpoint stop */

... whereas on GNU Hurd we see:

    Program received signal SIGTRAP, Trace/breakpoint trap.
    main () at ../../../W._C._Handy/gdb/testsuite/gdb.base/pr11022.c:28
    28          j = i;  /* expect HW watchpoint stop */

You may want to prepend »-ex 'maintenance set show-debug-regs on'« to see
some debugging output (and notice that »watchpoint_hit« is missing on GNU

I tracked this down to gdb/nat/x86-dregs.c:x86_dr_stopped_data_address
and x86_dr_stopped_by_watchpoint not returning the information as
desired, and tracked that in turn down to our kernel interface always
returning zero for DR6, the debug status register.  See the comment in
x86_dr_stopped_data_address for how GDB is using this information.  Do
you agree that thread_get_state(i386_DEBUG_STATE) should be returning the
actual DR6, and where in GNU Mach would we need to copy the DR6 register
into the PCB?


Attachment: pgp8W5j_KShSC.pgp
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]