NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
dbg-cli & automatic web debugging


Joined: 07 Sep 2004
Posts: 19
Reply with quote
hey all,

I wanted to make it so that dbg-cli was linked to my browser and the launching of a php thread - ie, the workflow would look something like this:

1) run dbg-cli

2) enter urls in the browser

3) break at the beginning of the code's execution.

Stepping through the code should mirror any output that is going to the browser to the screen - at the end of the debugging process, the run should go back into the stage of waiting for the next command to arrive.

How to do this? Also - is there a manual for dbg-cli? Also - what's dbglistener? I'm assuming its the configuration inside the php.ini file that is under the heading [debugger] but I could be wrong.. After all, its not listed as such under phpinfo..

Sort of confused here. If there was a step-by-step guide from installation to setup under the default install of php, this would be much easier to do than it is currently.. the INSTALL under dbg-src stops at enabling dbg.so under php.ini, and doesn't mention anything about the dbg-cli. The dbg-cli page doesn't have any manuals, or examples of editing sessions.

So there is definitely a gap here in documentation.. Could someone 'in the know' fill it in please?

Thanks much,

horos
View user's profileFind all posts by horos22Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
1) run dbg-cli
2) enter urls in the browser
3) break at the beginning of the code's execution.

I'll add this functionality to dbg-cli in the future.
BTW, in phped you can do it easily.

Quote:
Stepping through the code should mirror any output that is going to the browser to the screen - at the end of the debugging process, the run should go back into the stage of waiting for the next command to arrive.
How to do this?

dbg-cli does not display any output produced by the debugged script. Otherwise it would break ability to debug scripts with dbg-cli under DDD debugger. Latter does not like whatsoever strings shown in the interior debugger output.

Quote:
Also - is there a manual for dbg-cli?

All the commands have their own descriptions available with help commandname command. Also take a look at README file which contains some info for beginning.

Quote:
Also - what's dbglistener?

It's another type of dbg client that is supposed to work with an IDE.
It also uses dbgbase library.

Quote:
If there was a step-by-step guide from installation to setup under the default install of php, this would be much easier to do than it is currently..

if you mean dbg modules the installation instructions are in INSTALL and in the FAQ forum on this board.
if you mean dbg client (dbg-cli) take a look at README that comes with it.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
automatic web debugging


Joined: 07 Sep 2004
Posts: 19
Reply with quote
[quote="ddmitrie"]
Quote:
1) run dbg-cli
2) enter urls in the browser
3) break at the beginning of the code's execution.
I'll add this functionality to dbg-cli in the future.
BTW, in phped you can do it easily.


that's fine, but I don't want to have a graphical debugger - I'd much rather have a CLI, preferably one that works with emacs or vim mode.

Quote:
Stepping through the code should mirror any output that is going to the browser to the screen - at the end of the debugging process, the run should go back into the stage of waiting for the next command to arrive.
How to do this?
dbg-cli does not display any output produced by the debugged script. Otherwise it would break ability to debug scripts with dbg-cli under DDD debugger. Latter does not like whatsoever strings shown in the interior debugger output.


how about the option to tail the output to a file? Then I could open up another window and do a 'tail -f' on it.

Quote:
Also - what's dbglistener?
It's another type of dbg client that is supposed to work with an IDE.
It also uses dbgbase library.


so its similar to dbg-cli?

Quote:
if you mean dbg modules the installation instructions are in INSTALL and in the FAQ forum on this board.
if you mean dbg client (dbg-cli) take a look at README that comes with it.


Yeah I did - I'm still not clear on what the workflow is for it. do you need to type in the entire string, ie:

file /usr/local/apache/htdocs/myfile.php?mode=quote&3772, or do you use the browser, or what? What about POST data and interconnected scripts (where the php script creates links that are other php scripts)? What about libphp.so?
View user's profileFind all posts by horos22Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
how about the option to tail the output to a file? Then I could open up another window and do a 'tail -f' on it.

a new command will be added to show the output.

Quote:
so its similar to dbg-cli?

dbglistener is a replacement for dbg-cli to work from an IDE. DbgListener exposes its own software API instead of console front-end.

Quote:
Yeah I did - I'm still not clear on what the workflow is for it. do you need to type in the entire string, ie:
file /usr/local/apache/htdocs/myfile.php?mode=quote&3772

yes file /usr/local/apache/htdocs/myfile.php?mode=quote&3772 should work. DbgCli will replace /usr/local/apache/htdocs with Root URL and run it, in http mode of course, while in CGI mode it runs the file directly using CGI executable provided with appropriate command.

Quote:
What about POST data

POST is not supported in dbg-cli.

Quote:
What about libphp.so?

What do you mean ? Apache module ?
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 07 Sep 2004
Posts: 19
Reply with quote
Quote:
how about the option to tail the output to a file? Then I could open up another window and do a 'tail -f' on it.
a new command will be added to show the output.


thanks... I appreciate that.

Quote:
so its similar to dbg-cli?
dbglistener is a replacement for dbg-cli to work from an IDE. DbgListener exposes its own software API instead of console front-end.


does dbglistener support POST?

Quote:
What about POST data
POST is not supported in dbg-cli.


hmm. Is the a command line equivalent for PHPED available on solaris? (which I assume does support it) If dbg-cli was extended so that it ran via browser and accepted input from browser-spawned processes, would POST be supported? (for my application, post is necessary)

Quote:
What about libphp.so?
What do you mean ? Apache module ?


yes, the CGI module (which is another thing I need to support)

thanks again,

horos
View user's profileFind all posts by horos22Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
does dbglistener support POST?

dbglistener supports debug sessions so you can post from your own browser and have posted page (more precisely corresponding scripts) debugged. With dbg-cli it could be supported too if there was a command like listen_and_wait_until_somebody_pressed_ctrl_C_or_new_debug_session_started.
Quote:
yes, the CGI module (which is another thing I need to support)

no, libphp.so is not CGI module. CGI is a separated executable as far as I know and it is supported. If you mean Apache module it has no relation to the matter. Dbg does not care how you run php, it is loaded as php extension and works either under libphp4.so/libphp5.so or under php executable or whatsoever php engine compiled to.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 07 Sep 2004
Posts: 19
Reply with quote
Quote:
does dbglistener support POST?
dbglistener supports debug sessions so you can post from your own browser and have posted page (more precisely corresponding scripts) debugged. With dbg-cli it could be supported too if there was a command like listen_and_wait_until_somebody_pressed_ctrl_C_or_new_debug_session_started.

[/quote]

ok, is dbglistener open source, ie: could a piece of dbglistener be grafted into dbg-cli?

I'd do it myself except I'm not that great at socket programming..

Quote:
Dbg does not care how you run php, it is loaded as php extension and works either under libphp4.so/libphp5.so or under php executable or whatsoever php engine compiled to.


Perfect, then all I need to get going is the 'listen and wait' function you mention.. Plus figure out what the hell is going wrong with my select.
the fact that dbg-cli is at a different rev-level than dbg doesn't hurt anything, does it? (I've got the most recent versions of both)

Ed
View user's profileFind all posts by horos22Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
the fact that dbg-cli is at a different rev-level than dbg doesn't hurt anything

the major and minor versions should be exactly the same.
Also as far as I remember 2.11.23 (not sure of 2.11.26) have weird problem under sparc and all other bigendian cpus. So you'd better use 2.11.30 only.

Quote:
Perfect, then all I need to get going is the 'listen and wait' function you mention

aha.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 07 Sep 2004
Posts: 19
Reply with quote
Quote:

the major and minor versions should be exactly the same.
Also as far as I remember 2.11.23 (not sure of 2.11.26) has a weird problem under sparc and all other bigendian cpus. So you'd better use 2.11.30 only.


They are exactly the same (major minor versions) but I only could find 2.11.26. At least, that's the latest at sourceforge.net.

Where do you get dbg-2.11.30?

Quote:
Perfect, then all I need to get going is the 'listen and wait' function you mention
aha.


Hmm. I'm not sure if I like 'aha'. You make it sound like this is a difficult thing to do... the same logic should be in dbglistener, right?
View user's profileFind all posts by horos22Send private message
dbg-cli & automatic web debugging
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic