Bug 1769 - Hit count watchpoints not always re-enabled (1GLE911)
Summary: Hit count watchpoints not always re-enabled (1GLE911)
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.0   Edit
Hardware: All All
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: Joe Szurszewski CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-10-10 22:19 EDT by Joe Szurszewski CLA
Modified: 2001-10-24 19:16 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Szurszewski CLA 2001-10-10 22:19:01 EDT
JGS (10/10/01 1:46:12 PM)
	Under 203:

public class InfiniteLoop {

	private String string = "foo";
	protected int counter = 0;

     public static void main(String[] args) {
         (new InfiniteLoop()).loop();
     }

     public void loop() {
         int i = 0;
         while (true) {
              System.out.println("Looping " + i + string);
              i++;
              counter++;
              try {
                  Thread.sleep(1000);
              } catch (InterruptedException e) {
              }
         }
     }
}

	-	Set access watchpoint on 'string', modification watchpoint on 'counter'.
	-	Set hit counts on both watchpoints to 2.
	-	Debug
	-	Both watchpoints are hit
	-	After second watchpoint is hit, set hit count on both to 0
	-	Resume.  Notice how only access watchpoint on 'string' is ever
		hit, the modification watchpoint on 'counter' is ignored.
Comment 1 Darin Wright CLA 2001-10-15 11:50:11 EDT
Please investigate.
Comment 2 Jared Burns CLA 2001-10-17 15:23:01 EDT
Please verify.
Comment 3 Jared Burns CLA 2001-10-17 15:27:45 EDT
Oops.
Comment 4 Jared Burns CLA 2001-10-18 16:11:00 EDT
The problem was a ConcurrentModificationException that was coming out of
JavaBreakpoint#changeForTarget. The method was getting a List of requests,
iterating over that List, and updating the requests as necessary. The trouble
was that "updating" often meant replacing the request (removing it from the List
and adding a new request).
When iteration over the list tried to continue (after modifying the list), we
were getting the exception.
Comment 5 Jared Burns CLA 2001-10-18 16:11:43 EDT
Fixed. JavaBreakpoint#changeForTarget now iterates over a clone of the list.
Comment 6 Joe Szurszewski CLA 2001-10-24 19:16:16 EDT
Verified.