This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: Problems with hardware watchpoint on ia32.
- To: Eli Zaretskii <eliz at is dot elta dot co dot il>
- Subject: Re: Problems with hardware watchpoint on ia32.
- From: Jim Blandy <jimb at zwingli dot cygnus dot com>
- Date: 21 Mar 2000 11:45:00 -0500
- Cc: hjl at lucon dot org, gdb at sourceware dot cygnus dot com, gdb-patches at sourceware dot cygnus dot com
- References: <20000307132401.A20282@valinux.com><200003081008.FAA16481@indy.delorie.com><20000308084304.A3150@lucon.org><200003091210.HAA19857@indy.delorie.com>
> Here are the patches, after which you can set hardware watchpoints on
> bit fields. You will notice that these patches also augment the
> lazy-value trick suggested by Jim Blandy as a means to watch struct
> members; this is because that trick doesn't work for bit fields, and
> because I regard it generally fragile as far as watchpoints are
> considered (we depend on the assumption that GDB doesn't evaluate
> parent structures, but nothing in GDB's code suggests that this
> assumption will hold).
I hasten to point out that it's not *my* trick. :) That's just the
way the watchpoint code works.
Eli's test of the value's type is incorrect if the watch expression
contains a structure comparison, like (foo == bar) || (something
else), where foo and bar are structures. In that case, there will be
a value of type "struct", not at the end of the value list, but which
should be watched in its entirety.
To say that "nothing in GDB's code suggests that this assumption will
hold" is too passive. We should instead say, "Nothing in GDB's code
suggests that it would be difficult to make this assumption hold;
therefore, since it would be useful if it did hold, we will extend the
description of struct value with the requirement that non-lazy values
should contain only the portions of the objects actually used."