Bug 204564 - Debug events raised from breakpoint ctor
Summary: Debug events raised from breakpoint ctor
Status: RESOLVED FIXED
Alias: None
Product: DLTK
Classification: Technology
Component: Common (show other bugs)
Version: 0.95   Edit
Hardware: PC Windows Vista
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Andrey Platov CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2007-09-25 11:38 EDT by Johan Compagner CLA
Modified: 2010-06-11 07:31 EDT (History)
1 user (show)

See Also:


Attachments
creating the right watch expression (1.49 KB, patch)
2007-09-25 11:39 EDT, Johan Compagner CLA
alex.panchenko: iplog+
Details | Diff
the public method call when still constructing the object. (81.90 KB, image/png)
2007-09-25 11:40 EDT, Johan Compagner CLA
alex.panchenko: iplog-
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johan Compagner CLA 2007-09-25 11:38:57 EDT
First the patch:

Sometimes when i do see an expression comming in in the javascript debugger side (see point 2 why most of the time the expression is just empty) i see things like "var x" so including the var and so on.

I looked at the code and there was code to strip it but that code was not reallly correct, the patch that is attached should fix that.


Most of the time the expressions where empty, i was first looking for that why that does happen. I attached a picture where it is very clear that there is something wrong, ScriptWatchPoint has this constructor:

public ScriptWatchpoint(String debugModelId, IResource resource,
			int lineNumber, int start, int end, String fieldName)
			throws CoreException {
		super(debugModelId, resource, lineNumber, start, end, true);
		this.setFieldName(fieldName);
	}

so the field name is set after the super call, but the super call already does getFieldName (see picture) from inside the super call. This is at least incorrect java behavior (that methods of an not constructed object are already called again) but also because of that the expression isn't constructed right.
So as far as i can see the fire of breakpoint created (or adding of the breakpoint to the breakpoint manager) shoudn't be done in the breakpoint itself. But always from the outside world after the constructor call.
Comment 1 Johan Compagner CLA 2007-09-25 11:39:56 EDT
Created attachment 79140 [details]
creating the right watch expression
Comment 2 Johan Compagner CLA 2007-09-25 11:40:57 EDT
Created attachment 79141 [details]
the public method call when still constructing the object.
Comment 3 Andrey Platov CLA 2007-09-26 11:03:13 EDT
Hi Johan, thank you for exploring this, patch applied and I'll take care of Breakpoint ctors. 

Comment 4 Andrey Platov CLA 2008-05-26 03:06:02 EDT
bulk version set: 0.95
Comment 5 Johan Compagner CLA 2009-05-08 08:35:00 EDT
constructor behavior is already refactored