Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 208744 - [breakpoints] Unable to set watchpoints on some field declarations
Summary: [breakpoints] Unable to set watchpoints on some field declarations
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 enhancement (vote)
Target Milestone: 3.6 M3   Edit
Assignee: Michael Rennie CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-05 05:33 EST by NoName CLA
Modified: 2009-10-01 12:05 EDT (History)
3 users (show)

See Also:
Michael_Rennie: review? (darin.eclipse)


Attachments
fix (1.87 KB, patch)
2009-10-01 12:04 EDT, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description NoName CLA 2007-11-05 05:33:17 EST
Build ID: I20070921-0919

Steps To Reproduce:
1. Copy the code below
2. Reads the comments to know where to put watchpoints
3. Watchpoints are not set, instead a breakpoint is set for
the next "valid" line (which is dumb i think)


public class Watchpoint {
	double a, b; // unable to set a watchpoint on this line
	
	double c, // unable to set a watchpoint on this line or the next one
	d;
	
	void foo() {
		
	} // for somme unknow reason, this line gets "invalid" watchpoints as breakpoints
}

Workaround:
split the declaration, of 2 fields as 2 different line, and then add the watchpoints.
Comment 1 Darin Wright CLA 2007-11-05 12:51:34 EST
Workaround is to toggle watchpoints in the editor outline.
Comment 2 Michael Rennie CLA 2009-10-01 12:04:58 EDT
Created attachment 148546 [details]
fix

the problem was that our breakpoint location verifier was short-cutting to not process a VariableDeclarationFragment if it had no initializer when there was more than one fragment for a given FieldDeclaration.
Comment 3 Michael Rennie CLA 2009-10-01 12:05:55 EDT
applied patch to HEAD, please verify Darin W