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 188844 - Highlighting lines fails in remote debugging session
Summary: Highlighting lines fails in remote debugging session
Status: RESOLVED WORKSFORME
Alias: None
Product: php
Classification: Unclassified
Component: Debugger (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P3 normal with 3 votes (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
: 163958 187284 189517 (view as bug list)
Depends on:
Blocks:
 
Reported: 2010-07-22 04:01 UTC by mikelorant
Modified: 2013-10-20 10:08 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mikelorant 2010-07-22 04:01:32 UTC
When following the guide at:

http://netbeans.org/kb/docs/php/debugging.html

Sample Debugging Session Step 7 is not showing the green line for current line. Also there is no arrow against the line numbers.

All other aspects of debugging work correctly (variables are displayed as I stepped through each line).

Rolling back to NetBeans 6.5.1 fixes this problem.

Can confirm the problem exists in 6.8, 6.9 & Nightly 201007210001.
Comment 1 Filip Zamboj 2010-08-10 16:26:22 UTC
Product Version: NetBeans IDE Dev (Build 100810-c1ee3cfc8e78)

tested on todays build and:
1. works fine on Ubuntu
2. works fine on vista business

@reporter: i don't really think it's a XP only problem (i suppose you use XP from platform field). However, I'll test. Is it debugging as script / webpage / custom config. / remote? any hint, relevant custom configuration will be appreciated. thanks.
Comment 2 mikelorant 2010-08-11 00:10:17 UTC
I was using remote debugging. All I did was follow the debugging guide that I linked to. Tested in a VMware session as well (clean XP install) to verify the bug existed elsewhere.
Comment 3 Filip Zamboj 2010-08-11 11:52:41 UTC
*** Bug 163958 has been marked as a duplicate of this bug. ***
Comment 4 Filip Zamboj 2010-08-11 11:52:44 UTC
*** Bug 187284 has been marked as a duplicate of this bug. ***
Comment 5 Martin Entlicher 2010-08-15 21:03:09 UTC
*** Bug 189517 has been marked as a duplicate of this bug. ***
Comment 6 Filip Zamboj 2010-08-18 00:12:38 UTC
good evening guys, 

so I finally tried to reproduce your problem and I don't have this problem at all. However, I tried very basic example and it works. 

Are you sure your mapping is set correctly? You can find this option in Run Configuration -> Advanced. The problem is to correctly map server paths to project (local) paths, because the file where green line appears is local and the address we have is remote, of course.

more one path mapping on http://blogs.sun.com/netbeansphp/entry/path_mapping_in_php_debugger by Radek Matous. 

I am not closing this bug as "works for me" now, because I want to spend some more time on mapping that could be root of this problem (however nothing has changed for a long time), because we have 4 reports and because it's worthy to try on more OSs. 

I am using todays build.  
Product Version: NetBeans IDE Dev (Build 100818-d827a519a612)
Java: 1.6.0_16; Java HotSpot(TM) 64-Bit Server VM 14.2-b01

local OS: Ubuntu 9.10  
remote OS: MAC OS 10.6.4

any hints/comments on this are more than appreciated. thanks.
Comment 7 mikelorant 2010-08-18 04:18:31 UTC
I had no idea that path mapping even existed. I just spent 15 minutes trying to make it work and failed.

My files on the remote server exist in the following directory:
/home/mikel/dev/framework

That maps to in NetBeans as:
\\azrael\mikel\dev\framework

I have mod_rewrite being used so my project url is:
http://framework.mlvision.com.au

However my sources directory contains an htdocs which is where index.php lives. This makes setting the index file in runtime configuration not possible. If i set it to index.php, it fails to find the index. If I set it to htdocs/index.php, attempted to debug goes to:

http://framework.mlvision.com.au/htdocs/index.php

That URL does not exist.

What surrpises me the most was that NetBeans 6.5.1 worked. Mapping I assume was added in 6.7 which is when this problem started.

Can you clear up how this should be configured?

Also, I am using UNC paths rather than mapping a drive. One of the other bugs marked as a duplicate stated UNC paths didnt work where drive letters did.
Comment 8 rmatous 2010-08-18 09:16:27 UTC
I will evaluate in ASAP. 

For now just information that path mapping wasn't developed with UNC in mind and neither tested this way. 

Anyway I would like to improve automatic mapping to work wherever possible without need user to edit path mapping table. I would also like to review the current implementation. Naturally if time permits.
Comment 9 schlaefer 2010-08-18 10:15:14 UTC
I changed the index.php from the root index.php to further down in the framework chain to the webroot and it works now. So it was a misconfigured mapping in my case.

On the other hand: if the the Breakpoints pane is showing the correct file and line number incl. green arrow (I can double click on it and it brings me to the correct file and location in the main window) maybe the main window can use that information too to make it more robust against mapping errors?
Comment 10 rmatous 2010-08-18 12:50:54 UTC
Ok, thanks for information => P3
Comment 11 MartySchechtman 2010-08-18 14:25:57 UTC
I sent an email last night directly to fzamboj@netbeans.org with screenshots of what is happening in my case.

Unfortunately I called him Flip rather than Filip!  Sorry Filip!!

I think the problem for me might be related to Codeigniter mangling file paths.

For example, on the Call Stack after a break is hit I'm seeing:
file:///usr/home/mschechtman/work/TTI/system/accounting_model.php.Accounting_module->getDetails:273

The actual path is /usr/home/mschechtman/work/TTI/system/accounting_model.php

So it may be a path mapping issue for me too.  I will investigate that further.

Regards,
Marty
Comment 12 Filip Zamboj 2010-08-18 15:00:34 UTC
(In reply to comment #11)
> I sent an email last night directly to fzamboj@netbeans.org with screenshots of
> what is happening in my case.
> 
> Unfortunately I called him Flip rather than Filip!  Sorry Filip!!
No problem :). Your email landed into wrong folder in my client but I found it and will have a look for sure. thanks.
Comment 13 Filip Zamboj 2010-08-19 15:18:49 UTC
OK, I reproduce not highlighted line but only right after I jumped into a function or a file (through require()) using step into action. 

I managed to reproduced the problem when debugger stopped on another line as indicated in call stack but only if the information on server were outdated == not the same as local. In this case xdebug from remote server sends us different line as it is in local file from which netbeans reads. It is developer's problem to make sure that it fits. 

@Marty: I am still trying to get into such a situation as you did but no luck so far.
Comment 14 MartySchechtman 2010-08-20 04:49:12 UTC
Guess what!  It's working!

First of all, thanks to all who have worked on this issue.  It looks like I have wasted everyone's time, and I'm very sorry about that.  But I do think I found a bug in the way Netbeans is connecting to the remote server.  More on that later . . .

Here's what was going on

Run as is set to Remote WebSite

In Project Properties/Run Configuration I have the following:
The Project URL is
   myname.someURL.com

In the Manage Remote Connections box:

The Host name is set to
   myname.someURL.com        << the same s the Project URL

The User name is 
   myname

The Initial Directory is 
   /home/myname/work/TTI

Back in the Project Properties box:

The Upload Directory:
   Left blank.  The line below the text box has:
   sftp://myname.someUrl.com/home/myname/work/TTI

Upload Files:   On Save


Everything looks correct.  And indeed it is as far as remote and local syncing of source files is concerned.  When I save a file within the NetBeans URL, it is immediately copied to the SFTP site.

Now for Advanced Web Configuration box:

I have the Debug URL: Set as Do Not Open Web Browser
I have it this way because I position the website where I want to debug, use the Very Cool Firefox "easy Xdebug" extension to connect to the NetBeans debugger.

Now for the issue:

Path Mapping:

Server Path is set to
   home/myname/work/TTI

Project Path is set to
   /Users/marty/NetBeansProjects/someCompany/

Looks correct.  Everything matches

When I set a breakpoint and execution stops, what's in the Call Stack says:
file:///usr/home/myname/work/TTI/.../someFile.php.Someclass->someFunc:444


I set the Server Path to
    home/myname/work/TTI !!!

On the server, home is soft linked to usr/home

I've been missing this, and it finally dawned on me.  The Server Path looked right, but I was missing the significance of what the Call Stack was saying.

For some reason, the remote debugging does not use the soft link home.  Instead it uses the original path usr/home

And I think that's a bug:  The debugger should use what it's given in the server path, even if it's a soft link.

So I changed the Server in Path Mapping to what was showing in the Call Stack.

And now the debugger works just fine!  The right file is displayed automatically, there is a wonderful little green arrow where the number usually is, and the source line is painted in a wonderful green color.

I am so happy!  Again, thanks to all!

Marty
Comment 15 mikelorant 2010-08-20 06:20:31 UTC
I have resolved the issue by adding a path mapping to a non UNC path. This is related to the issue mentioned here:

http://netbeans.org/bugzilla/show_bug.cgi?id=187284

So I had 2 problems:

1) Missing path mapping.
The documentation does not start until the end about configuring path mapping. This needs to be mentioned earlier on:

http://netbeans.org/kb/docs/php/debugging.html

Some form of note saying this will only work for a local site and if you are doing remote debugging please see the footnote.

2) UNC paths in the path mapping
UNC paths for some reason are breaking path mapping. I can't see any reason why it should have an impact but it does. This probably needs a separate issue opened to deal with that.
Comment 16 Filip Zamboj 2010-09-15 12:32:39 UTC
batch reassigning
Comment 17 Tomas Mysik 2011-06-03 10:19:25 UTC
Batch reassigning.
Comment 18 Tomas Mysik 2011-06-09 13:20:46 UTC
Reassigning to the module owner.
Comment 19 GregJPreece 2012-05-10 10:09:53 UTC
Just confirming that this is present in NetBeans 7.1.2. Again, the fix was to ensure that the path mapping used a full absolute file path for the remote server path. Might I suggest that the wording be changed on the various path/mapping screens to make it clearer whether the program is expecting a URL path or file path, and what paths are allowed? I was caught out using a relative path.
Comment 20 Ondrej Brejla 2012-10-22 14:37:43 UTC
So it works properly and you just had wrong paths set for mapping?
Comment 21 Ondrej Brejla 2012-10-23 08:22:11 UTC
After discussion with some users via email, it seems that it works properly with a proper configuration.
Comment 22 francis_55 2013-10-20 10:08:50 UTC
I had the problem described here. I had tried checking the option "Watches and Baloon evaluation" in Netbeans > Tools > Options > Debugging, despite the warning message that this had been known to trigger unstable behavior. The cursor re-appeared when I cancelled the option.