Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » debug: conditional watchpoint?
debug: conditional watchpoint? [message #242903] Sat, 14 April 2007 17:38 Go to next message
Eclipse UserFriend
Hi,

I'd very much like to specify a condition for a field watchpoint,
like it is possible for regular breakpoints.
In this case semantics should be: stop when the condition
turns true. It would be perfect, if the debugger even stops
_before_ the field value actually changed, I suppose.

I couldn't find such a wish in bugzilla.
Has this been discussed before?

Stephan
Re: debug: conditional watchpoint? [message #242919 is a reply to message #242903] Mon, 16 April 2007 08:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: krzysztofHMMMMdaniel.gmail.com

Simple workaround:

create setter and put a breakpoint inside...

Chris
Re: debug: conditional watchpoint? [message #243024 is a reply to message #242919] Thu, 19 April 2007 19:29 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

> Simple workaround:
works for simple cases. I know.
 
> create setter and put a breakpoint inside...
what if, e.g., I don't own the code I need to watch?
Or, I don't own code that accesses that field, or
refactoring would be too expensive, or ...


I know many people think direct field access is bad to begin with.
OTOH, there is awfully good code actually using direct field access.
(Actually, I'm referring to the JDT here ;-)

--
Stephan
Re: debug: conditional watchpoint? [message #243039 is a reply to message #243024] Fri, 20 April 2007 01:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kwarner.uneedspeed.net

When you say, "...direct field access..." Do you mean something like:

mySomthing.x where x is a field in MySomething and mySomething is an
instanceOf MySomething?

Rather than:

mySomething.getX()

And what is the computational advantage of one over the other?

Stephan Herrmann wrote:
> Hi,
>
>
>>Simple workaround:
>
> works for simple cases. I know.
>
>
>>create setter and put a breakpoint inside...
>
> what if, e.g., I don't own the code I need to watch?
> Or, I don't own code that accesses that field, or
> refactoring would be too expensive, or ...
>
>
> I know many people think direct field access is bad to begin with.
> OTOH, there is awfully good code actually using direct field access.
> (Actually, I'm referring to the JDT here ;-)
>
> --
> Stephan
Re: debug: conditional watchpoint? [message #243114 is a reply to message #243039] Sun, 22 April 2007 17:04 Go to previous messageGo to next message
Eclipse UserFriend
> When you say, "...direct field access..." Do you mean something like:
>
> mySomthing.x where x is a field in MySomething and mySomething is an
> instanceOf MySomething?
>
> Rather than:
>
> mySomething.getX()
Yes, and even more so: mySomething.x = someXValue
But also: x = someXValue, as a statement within the class defining x.
In other words: all statements that can trigger a watchpoint.

> And what is the computational advantage of one over the other?
This question has been an ideological issue ever since the invention
of object-orientation.

Please note: I didn't mean to raise a discussion, why this is good practice.
I only wanted to discuss:
IF you have code that uses fields directly, debugging would be better
supported if watchpoints had conditions just like breakpoints.
(According to your argument, watchpoints should be abolished altogether ;-)

If you don't believe that code exists which directly accesses fields, please
read the code of the JDT! It is great code, directly accessing fields all
over the place.

Stephan
Re: debug: conditional watchpoint? [message #244096 is a reply to message #243114] Tue, 29 May 2007 11:50 Go to previous message
Eclipse UserFriend
While I don't understand the details, I know that there are problems with
trying to implement conditions on watchpoints, so I don't know if this can
be fixed. Bug 96719 is the enhancement request for conditional breakpoints,
it has been around for a while but we haven't been able to implement it.

In 3.4 if you comment or reopen the bug to remind us (JDT Debug), we will
look at it.

Thanks.

Curtis

"Stephan Herrmann" <stephan@cs.tu-berlin.de> wrote in message
news:f0gikv$n6h$1@build.eclipse.org...
>
>> When you say, "...direct field access..." Do you mean something like:
>>
>> mySomthing.x where x is a field in MySomething and mySomething is an
>> instanceOf MySomething?
>>
>> Rather than:
>>
>> mySomething.getX()
> Yes, and even more so: mySomething.x = someXValue
> But also: x = someXValue, as a statement within the class defining x.
> In other words: all statements that can trigger a watchpoint.
>
>> And what is the computational advantage of one over the other?
> This question has been an ideological issue ever since the invention
> of object-orientation.
>
> Please note: I didn't mean to raise a discussion, why this is good
> practice.
> I only wanted to discuss:
> IF you have code that uses fields directly, debugging would be better
> supported if watchpoints had conditions just like breakpoints.
> (According to your argument, watchpoints should be abolished altogether
> ;-)
>
> If you don't believe that code exists which directly accesses fields,
> please
> read the code of the JDT! It is great code, directly accessing fields all
> over the place.
>
> Stephan
>
>
Previous Topic:Debugger stops at a breakpoint but has "lost its way"
Next Topic:Breakpoint Icons not showing on ruler
Goto Forum:
  


Current Time: Sun May 11 01:49:16 EDT 2025

Powered by FUDForum. Page generated in 0.03863 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top