NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

[tools] How to define a conditional breakpoint?

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users
View previous topic :: View next topic  
Author Message
Nick Beare
Posted via mailing list.





PostPosted: Thu Sep 10, 2009 11:06 am    Post subject: [tools] How to define a conditional breakpoint? Reply with quote

NetBeans help system describes Setting Conditional Breakpoints. They do work. I have used them in the past.

Just invoke the help system and search on “conditional breakpoint”.

Nick Beare



Market House, 21 Lenten Street, Alton, Hampshire, GU34 1HG
T: +44 (0)1420 89898 F: +44 (0)1420 541223
W: www.causeway.com




From: Iwan Eising [mailto:address-removed]
Sent: 07 September 2009 20:03
To: address-removed
Cc: address-removed
Subject: [nbusers] [tools] How to define a conditional breakpoint?


Hi,

While debuggin my application, I need to set a conditional breakpoint. I have a field in my object named ‘id’ which is a Long (note the capital L). I need to hit a breakpoint when the value of id equals say 198. Now I’ve set in the properties of the breakpoint in the condition part various conditions, but none of them work, since the breakpoint is hit all the time. I tried:

<![if !supportLists]>- <![endif]>myInstance.id.equals(new Long(198))
<![if !supportLists]>- <![endif]>myInstance.id.equals(new Long(198));
<![if !supportLists]>- <![endif]>myInstance.id.longValue() == 198
<![if !supportLists]>- <![endif]>myInstance.id.longValue() == 198;

So my question is: How do I set the breakpoint’s condition such that the debugger will only stop when I meet the condition.

This is all using JavaME SDK 3.0, which I thought would allow for all the cool Java tooling I know and love from JavaSE and JavaEE.

Iwan
--
Follow me on Twitter as: ThreeAxis
Sticktail Games' game IFF: http://www.sticktailgames.com:8080/IFFMobile/
Check my Personal blog on: http://words-from-the-netherlands.blogspot.com/
Check my Psycho Thriller on: http://the-fingers.blogspot.com/
Check my Developer related blog on: http://the-netbeans-experience.blogspot.com/



image001.gif
 Description:
 Filesize:  7.41 KB
 Viewed:  2632 Time(s)

image001.gif


Back to top
Nick Beare
Posted via mailing list.





PostPosted: Thu Sep 10, 2009 12:15 pm    Post subject: [tools] How to define a conditional breakpoint? Reply with quote

On a second read of your email, I suspect you have already read the help!
I have just remembered I only got it to work when I fully qualified classes, variable names etc when referring to them in the conditional expression.

HTH

Nick Beare



Market House, 21 Lenten Street, Alton, Hampshire, GU34 1HG
T: +44 (0)1420 89898 F: +44 (0)1420 541223
W: www.causeway.com




From: Nick Beare [mailto:address-removed]
Sent: 10 September 2009 10:12
To: address-removed
Subject: RE: [nbusers] [tools] How to define a conditional breakpoint?


NetBeans help system describes Setting Conditional Breakpoints. They do work. I have used them in the past.

Just invoke the help system and search on “conditional breakpoint”.

Nick Beare



Market House, 21 Lenten Street, Alton, Hampshire, GU34 1HG
T: +44 (0)1420 89898 F: +44 (0)1420 541223
W: www.causeway.com




From: Iwan Eising [mailto:address-removed]
Sent: 07 September 2009 20:03
To: address-removed
Cc: address-removed
Subject: [nbusers] [tools] How to define a conditional breakpoint?


Hi,

While debuggin my application, I need to set a conditional breakpoint. I have a field in my object named ‘id’ which is a Long (note the capital L). I need to hit a breakpoint when the value of id equals say 198. Now I’ve set in the properties of the breakpoint in the condition part various conditions, but none of them work, since the breakpoint is hit all the time. I tried:

<![if !supportLists]>- <![endif]>myInstance.id.equals(new Long(198))
<![if !supportLists]>- <![endif]>myInstance.id.equals(new Long(198));
<![if !supportLists]>- <![endif]>myInstance.id.longValue() == 198
<![if !supportLists]>- <![endif]>myInstance.id.longValue() == 198;

So my question is: How do I set the breakpoint’s condition such that the debugger will only stop when I meet the condition.

This is all using JavaME SDK 3.0, which I thought would allow for all the cool Java tooling I know and love from JavaSE and JavaEE.

Iwan
--
Follow me on Twitter as: ThreeAxis
Sticktail Games' game IFF: http://www.sticktailgames.com:8080/IFFMobile/
Check my Personal blog on: http://words-from-the-netherlands.blogspot.com/
Check my Psycho Thriller on: http://the-fingers.blogspot.com/
Check my Developer related blog on: http://the-netbeans-experience.blogspot.com/



image001.gif
 Description:
 Filesize:  7.41 KB
 Viewed:  2629 Time(s)

image001.gif


Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo