Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » How to prevent debug opening the browser?
How to prevent debug opening the browser? [message #85192] Mon, 01 December 2008 12:48 Go to next message
Hell No is currently offline Hell NoFriend
Messages: 8
Registered: July 2009
Junior Member
PDT behavior is currently extremely annoying with xdebug - i hope i am
missing something. Some setting or something.

Expected:
* (start listening for xdebug events - should happen automatically - ie.
always listening. can see some difficulties implementing that - so,
probably not possible currently)
* whenever / whatever i want to debug i tell that to my browser and the
debugger kicks in.

Actually what i get:
* launch debugger
* browser window opens with the mandatory (WHY!?) and meaningless source
file set in settings (i usually use a special file that does nothing to
prevent possibly harmful effects caused by debugger going amok)
* hit F8 to get out of it.
* close the useless browser window that got spawned
* :) here comes the expected part where i can actually use the debuger
sensibly and as needed. (when i want to debug - i tell that to browser and
the next server-event triggers the debugger)
* close debugger
* close another browser spawn.

I would VERY MUCH like to get rid of all the other bullet-points besides
the one with the smiley. Can that be done with 2.* version of PDT?

Managed to get rid of all the other (at least for me) useless spawns that
opened in eclipse itself - just can't get rid of the browser spawn and
first debug run.
Re: How to prevent debug opening the browser? [message #85222 is a reply to message #85192] Mon, 01 December 2008 21:11 Go to previous messageGo to next message
Shawn Clark is currently offline Shawn ClarkFriend
Messages: 70
Registered: July 2009
Member
Dave Kelsey and I have recently had some discussions about this with PDT
2.0. If you look for the topic:

XDebug and Remote Session initiation (JIT) Support

That will give you an update on the state of that work. As well if you
read the second half of the thread on:

PDT / Xdebug / Multiple sub domains

you will see talk about JIT support. What you are wanting is that
functionality and not the default Eclipse debug session starting.

As to why PDT is working the way it is for the non-JIT debug setup...
Xdebug looks for a cookie within the current page request to see if it
should send debug information to the remote host. The only way for that
cookie to exist is for PDT to open up a browser with the cookie
information put into the URL so that Xdebug can set the cookie. Check
out: http://www.xdebug.org/docs/remote and look at the section on HTTP
Debug Sessions. PDT is doing its bests to handle what Xdebug requires to
get a debug session started.

One thing I could see as an improvement is that if you know you are
doing JIT debugging or if you have enabled the xdebug setting for
remote_autostart that you can setup your PDT debug to only listen and
not do the cookie initialization stuff.

Maybe Dave can provide some more insight into this.

--
Shawn Clark

Hell No wrote:
> PDT behavior is currently extremely annoying with xdebug - i hope i am
> missing something. Some setting or something.
>
> Expected:
> * (start listening for xdebug events - should happen automatically - ie.
> always listening. can see some difficulties implementing that - so,
> probably not possible currently)
> * whenever / whatever i want to debug i tell that to my browser and the
> debugger kicks in.
>
> Actually what i get:
> * launch debugger
> * browser window opens with the mandatory (WHY!?) and meaningless source
> file set in settings (i usually use a special file that does nothing to
> prevent possibly harmful effects caused by debugger going amok)
> * hit F8 to get out of it.
> * close the useless browser window that got spawned
> * :) here comes the expected part where i can actually use the debuger
> sensibly and as needed. (when i want to debug - i tell that to browser
> and the next server-event triggers the debugger)
> * close debugger
> * close another browser spawn.
>
> I would VERY MUCH like to get rid of all the other bullet-points besides
> the one with the smiley. Can that be done with 2.* version of PDT?
> Managed to get rid of all the other (at least for me) useless spawns
> that opened in eclipse itself - just can't get rid of the browser spawn
> and first debug run.
>
Re: How to prevent debug opening the browser? [message #86778 is a reply to message #85222] Sun, 14 December 2008 13:14 Go to previous messageGo to next message
Hell No is currently offline Hell NoFriend
Messages: 8
Registered: July 2009
Junior Member
> As to why PDT is working the way it is for the non-JIT debug setup...
> Xdebug looks for a cookie within the current page request to see if it
> should send debug information to the remote host. The only way for that
> cookie to exist is for PDT to open up a browser with the cookie
> information put into the URL so that Xdebug can set the cookie. Check
> out: http://www.xdebug.org/docs/remote and look at the section on HTTP
> Debug Sessions. PDT is doing its bests to handle what Xdebug requires to
> get a debug session started.

That, as far as i can see, is incorrect. I use FF extension XDebug helper
for that. ie i tell trough FF when and where i want to debug - and it
works just fine. It's just the hassle with the bound-to-be-useless initial
debug session spawn (that i exit / ignore / close anyway) that i would
like to be without.

Do not know eclipse inner logic related to that, so can't really know how
or whether this can be done. Logically, there should be no problems (ie
current project + current debug config [just the config] + xdebug
connection spawned by whatever means [FF extension in this case] should be
enough).

One thing i am wondering: eclipse spawn has &KEY=<some number that looks
like time> attached. Does not show up in xdebug communication (visibly)
nor in xdebug documentation. What is it?
Re: How to prevent debug opening the browser? [message #86900 is a reply to message #86778] Tue, 16 December 2008 08:46 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: dkel50.hotnospmail.com

Shawn is correct what he states here. If you use PDT to launch a debug
session that launch is designed to do several things. One is to ensure
that xdebug will activate on the server and the other is to associate
the executed script on the server with that of the script you have
specified in the launch in order to do automated path mapping. In order
for all that to work, PDT invokes the URL you specify in that launch to
ensure the appopriate script is executed and to ensure xdebug activates
by specifying the cookie. This is working as designed (and this was all
designed before the FF extension was available).

It sounds to me like you want to enter the URL yourself in Firefox and
control whether the cookie is on or not via the firefox extension, and
in that case you want to use the remote session initiation/JIT support
in PDT 2.0.0. You can turn this in the PHP Debugger preferences. Now if
you use the FF extension and enable the cookie yourself, then enter the
URL, PDT should receive the xdebug initial handshake and allow you to
debug it.

Alternatively you can change PDT to use the internal browser (Under
preferences, general section) and then the launch will always put the
web page into a single eclipse view (so you won't get multiple FF tabs).

As for the reason KEY is appended to the URL. This was due to Internet
Explorer (which the internal web browser view uses on windows) caching
web pages if the URL was identical. Ie you could change your php code
but the web browser would show the cached page and not execute your
changed code. Putting a KEY value which changes on each launch forces IE
to execute the php code.

Dave Kelsey



Hell No wrote:
>> As to why PDT is working the way it is for the non-JIT debug setup...
>> Xdebug looks for a cookie within the current page request to see if it
>> should send debug information to the remote host. The only way for
>> that cookie to exist is for PDT to open up a browser with the cookie
>> information put into the URL so that Xdebug can set the cookie. Check
>> out: http://www.xdebug.org/docs/remote and look at the section on HTTP
>> Debug Sessions. PDT is doing its bests to handle what Xdebug requires
>> to get a debug session started.
>
> That, as far as i can see, is incorrect. I use FF extension XDebug
> helper for that. ie i tell trough FF when and where i want to debug -
> and it works just fine. It's just the hassle with the
> bound-to-be-useless initial debug session spawn (that i exit / ignore /
> close anyway) that i would like to be without.
>
> Do not know eclipse inner logic related to that, so can't really know
> how or whether this can be done. Logically, there should be no problems
> (ie current project + current debug config [just the config] + xdebug
> connection spawned by whatever means [FF extension in this case] should
> be enough).
>
> One thing i am wondering: eclipse spawn has &KEY=<some number that looks
> like time> attached. Does not show up in xdebug communication (visibly)
> nor in xdebug documentation. What is it?
>
Re: How to prevent debug opening the browser? [message #87007 is a reply to message #86900] Wed, 17 December 2008 08:14 Go to previous messageGo to next message
Hell No is currently offline Hell NoFriend
Messages: 8
Registered: July 2009
Junior Member
> It sounds to me like you want to enter the URL yourself in Firefox and
> control whether the cookie is on or not via the firefox extension, and
> in that case you want to use the remote session initiation/JIT support
> in PDT 2.0.0. You can turn this in the PHP Debugger preferences. Now if
> you use the FF extension and enable the cookie yourself, then enter the
> URL, PDT should receive the xdebug initial handshake and allow you to
> debug it.

Finally managed to find that setting (some-why didn't think that it might
be debugger specific option). Oddly enough i have used it before once, but
lost that eclipse installation and did not know i miss it. I knew there
must be a way - sort of lost hope finding it. Thanks to all involved.

> As for the reason KEY is appended to the URL. This was due to Internet
> Explorer (which the internal web browser view uses on windows) caching
> web pages if the URL was identical. Ie you could change your php code
> but the web browser would show the cached page and not execute your
> changed code. Putting a KEY value which changes on each launch forces IE
> to execute the php code.

Hee... should have seen that coming.
Re: How to prevent debug opening the browser? [message #665122 is a reply to message #86900] Wed, 13 April 2011 11:22 Go to previous message
No real name is currently offline No real nameFriend
Messages: 1
Registered: April 2011
Junior Member
Eclipse User wrote on Tue, 16 December 2008 03:46
Originally posted by: dkel50.hotnospmail.com

Alternatively you can change PDT to use the internal browser (Under
preferences, general section) and then the launch will always put the
web page into a single eclipse view (so you won't get multiple FF tabs).



How? where do I set that please?
under
Prefences -> General -> Web Browser
the "Use internal web browser" is greyed out

[Updated on: Wed, 13 April 2011 11:24]

Report message to a moderator

Previous Topic:configure debugger properly
Next Topic:Debugging not working correctly
Goto Forum:
  


Current Time: Fri Apr 19 06:51:28 GMT 2024

Powered by FUDForum. Page generated in 0.02041 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top