This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 147303 - Breakpoints don't work for JavaScript debugger in PHP
Summary: Breakpoints don't work for JavaScript debugger in PHP
Status: VERIFIED FIXED
Alias: None
Product: javascript
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: All All
: P1 blocker (vote)
Assignee: _ deva
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-15 19:31 UTC by Mikhail Matveev
Modified: 2008-10-05 13:15 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Code example (477 bytes, text/plain)
2008-09-15 19:36 UTC, Mikhail Matveev
Details
Resulting read-only content (213 bytes, text/plain)
2008-09-15 20:01 UTC, Mikhail Matveev
Details
client side embedded jscript in php (121.68 KB, image/png)
2008-09-15 21:24 UTC, _ krystyna
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Matveev 2008-09-15 19:31:44 UTC
Create a simple JavaScript in PHP and run debugger (my example is attached). Set a breakpoint and press Continue button.
Result: the breakpoint is completely ignored.
Comment 1 Mikhail Matveev 2008-09-15 19:36:12 UTC
Created attachment 69899 [details]
Code example
Comment 2 _ deva 2008-09-15 19:43:40 UTC
The breakpoints set in server side pages(like .php and .jsp) are not valid for client side debugging. You will have to
set them in the read only pages that shows up when you do the client side debugging.

What are the steps you followed?

I recommend you the following steps
1)Start the debugging(make sure client side debugging is turned on)
2)In the read-only page that shows up in the editor window, set the required breakpoints
3)refresh the page in the browser
Comment 3 Mikhail Matveev 2008-09-15 19:48:54 UTC
Yes, I set breakpoints in the read-only pages and follow steps you recommend.
At the same time, step-by-step actions (like Step Over - F8) work properly.
Comment 4 _ deva 2008-09-15 19:51:58 UTC
Did u mean the breakpoint is ignored even when set in the read-only page. Can you attach your project and send me in
which file and line number you were setting the breakpoint.
Comment 5 Mikhail Matveev 2008-09-15 20:00:20 UTC
Correct, the breakpoint in the read-only page is ignored.
The project contains only 1 PHP file, and its content is already attached. Now I'm attaching resulting r/o content.
I tried to set breakpoint to any line inside of JavaScript code.
Comment 6 Mikhail Matveev 2008-09-15 20:01:27 UTC
Created attachment 69904 [details]
Resulting read-only content
Comment 7 _ krystyna 2008-09-15 21:22:51 UTC
I cannot reproduce this. I tested this with client-side only on to rule out interference
from server side, especially since this is embedded in php code. Initially,I have
to refresh the page to see the first breakpoint. Browsers shows only "Hello 1" when I 
then press continue in the IDE toolbar, the browser then shows additional "Test Hello 2".
When I press continue again, the remaining code which is NOT javascript is output "Hello3", etc.
So if breakpoints are set on the javascript in the editor's read/only file, it works. 

If I run another Debug process on the same file, not changing the read/only breakpoint as set.
I didn't need to refresh the page again.

Tested in Build 200809151401.  Perhaps there is a misunderstanding about where to set the breakpoint. I 
set my breakpoints on the document.write lines. Setting them on any other lines like Hello1 or Hello3 
would not work as they are not javascript. Is that what you did? Attaching my client-side source read only
page.
Comment 8 _ krystyna 2008-09-15 21:24:19 UTC
Created attachment 69906 [details]
client side embedded jscript in php
Comment 9 Mikhail Matveev 2008-09-16 17:55:42 UTC
No, here is no misunderstanding about where to place breakpoints. I know that they should be placed only on lines
containing JavaScript code.

Below is my system info and exact sequence of steps:

1. Invoke Debug for PHP file, enable Client side debugging.
2. PHP Debugger is started. Click Continue on the debugger toolbar.
3. r/o HTML content is generated. 
4. In Sessions window, make JavaScript debugger to be current.
5. Set a breakpoint on line document.write("Test").
6. Click Pause on the debugger toolbar.
7. Switch to browser (Internet Explorer) and press Refresh.
8. Switch back to the IDE. PHP debugger is restarted. Click Continue on the debugger toolbar.
9. r/o content tab is open and JavaScript debugger is activated. Green line is on the first JavaScript code line
vvv0=0;
10. Click Continue on the debugger toolbar.
Result: debugger is not stopped at the breakpoint line.
Comment 10 Mikhail Matveev 2008-09-16 17:57:48 UTC
Product Version: NetBeans IDE Dev (Build 200809150201)
Java: 1.6.0_04; Java HotSpot(TM) Client VM 10.0-b19
System: Windows XP version 5.1 running on x86; Cp1251; ru_RU (nb)
Comment 11 _ krystyna 2008-09-16 19:00:46 UTC
Okay, good to know this is IE. I had been using Firefox. I do see the issue now, though
Step6 - Pause is not available to me. I used Build 200809151401. 
Comment 12 Quy Nguyen 2008-09-16 19:12:59 UTC
I tried the steps on the latest sources, and they worked for me.  The Pause button is disabled before the first R/O page
is displayed, probably because the JS debugger is still in the STARTING/READY state.
Comment 13 _ krystyna 2008-09-16 19:19:26 UTC
I'll try again withh the latest trunk build that has Deva's fix
for the malformed file url object. I assume that fixes this?
Comment 14 _ deva 2008-09-17 01:10:29 UTC
I found that the problem may be that when the document is loaded partially, we need to set the breakpoints again when
the document is modified. I have fixed this scenario. Try out the latest build and check if it is addressed.
Comment 15 Mikhail Matveev 2008-09-17 18:55:01 UTC
Reproducible in 200809170201. Will check again with later builds.
Comment 16 Mikhail Matveev 2008-10-05 13:15:24 UTC
Verified