----- Original Message -----
Sent: Friday, April 16, 2004 5:02
PM
Subject: [cdt-debug-dev] Silent Failures
When Watchpoint Cannot be Set
Currently, CDT
(v1.2.1), watchpoint representation could be misleading. When CDT fails
to
install a
watchpoint in GDB or when a watchpoint is removed by GDB, the
watchpoint
still shows itself
as being enabled in the breakpoint view. In reality, that
watchpoint
is not there and
will no longer function. So it should either be deleted or be
shown
as disabled by
CDT. Right now it still appears as enabled in the breakpoint
view.
This happens when
one is setting up a watchpoint for a local variable and I
find
the global
variable watchpoint to behave correctly.
In current CDT
(1.2.1), watchpoint on a local variable can only be set when the
variable
is in view of the
execution thread as GDB allows only local variable
watchpoint
to be set in such
a way. The consequence is that
once the variable
is outside the scope of the thread, or when the program
terminates,
the local variable
watchpoint is silently deleted in GDB. However, that
watchpoint
still shows up in
CDT's watchpoint view and will not get re-installed again.
As a side note, I
wonder if local variable watchpoint could be made
more user
friendly. Usually I have to set a breakpoint at the place when the
variable being
watched is in
scope and set the watchpoint when the breakpoint hits. Once the variable
is
out of scope, the
process will have to be repeated to set the watchpoint
again. If the local
variable occurs
within a function getting called mutiple times, then things are pretty
much
impossible.
It will be nice if CDT could automate the process to
reinstall local variable watchpoint
into
GDB.
Tim
Chen
-----------------------------------------------------------------
The opinions are
mine only. They do not reflect the view of my
employer.