0.2.2
Copyright © 2005 Linus McCabe
Abstract
Gubed PHP Debugger is a visual debugger for PHP. It supports stepping through code, breakpoints and watches amongst other thing. This is the documentation for Gubed, aimed for both end users and developers.
Table of Contents
Gubed PHP Debugger is a visual debugger for PHP. This means that it will help you follow the flow of execution in your scripts to find logical errors or understand why the script behaves in certain ways.
Gubed consists of many parts that work in symbiosis to bring you a working debugger environment. Those parts are
The Server Scripts
The Client
The Proxy
There are also things that you need that are not part of Gubed
A PHP enabled web server
A web browser
Rather than using a special version of PHP or a PHP module, Gubed needs a directory with a few PHP scripts on the web server that is the core of Gubed. These scripts are always required.
In order to control Gubed, you will need either the client included with Gubed or a third party client that supports Gubed, like Quanta+. You may chose any client, but at least one is needed.
The proxy is an optional part of your Gubed setup. It is needed when the web server and the client are unable to communicate with each other directly. In this case, the proxy is set up as communication link between the server scripts and the client.
It is important to realize that the proxy isn't always required, and since it adds extra overhead, don't use it unless you need to.
Why you need a web server is probably obvious, and most likely you already have a working server running, otherwise you will need to fix that first.
What might be less obvious is that you also need a browser to initiate debug sessions, and this is also where the genereated output of your scripts will be displayed.
Any browser (or software capable of generating a http-request) will do, but if you use Firefox, you can also use the Gubed Firefox plugin to make life easier.
A typical debug session starts by launching the Gubed client, then using the browser to browse to the Gubed scripts on the webserver and entering the url of the script to be debugged.
As seen on the image, the browser sends a HTTP request to the Gubed scripts with information of what is going to be debugged. The Gubed scripts then contacts the client which displays the source code of the script in question. Depending on user actions, the client will then tell the script to start executing, changing variables, etc.
When the script is done executing (or forced to quite premature by the user), the output generated by the script is displayed in the browser.
Table of Contents
The server installation is fairly simple. Copy the ServerScripts
directory of
the Gubed archive to your webroot (or some other place in the web tree that you'd rather have it in)
If you're using some installation package, like the Windows installer, it might prompt you for a location to install the server scripts when you're installing the client.
It is important to realize that putting Gubed on a public server poses a security risk. Partly because if someone manages to hack it and make it contact their debug client, they can control how your scripts work and thus gain access to things they are not supposed to have access to.
Gubed also includes some scripts to help debugging Gubed it self, and upon request, these scripts scans the filesystem and displays the source of php files.
You have to protect your Gubed web tree , for example by using your webservers
buildt in security handling. The very least you should do is to remove the debug
directory
of the Gubed web tree to prevent anyone from scanning your system for PHP files. (On the other hand, if
your directory or server is protected, the develop
directory might come in hand if
you require support or experience problems.)
Before you can start using Gubed, you'll have to configure the server scripts.
In the Gubed ServerScripts directory on your server, there is a file called
localsettings_dist.php
. Rename this file
to localsettings.php
and open it in a text editor.
If you're not running the client and the server on the same computer, you will need to specify what computer the client (or proxy, if you use it) is on by altering the following line
$gbdDebugServer = "localhost";
You can also change the port used
$gbdDebugPort = 8016; // 8016 is Gubed default
Gubed uses a directory for cacheing the parsed PHP files so they wont need to be reparsed every time they are used. If you do not wish to use this feature, you can set the cache dir to a blank string, you can also change it to another location than the default one (which is the default temp dir).
$GLOBALS['gbd']['cachedir'] = '/tmp/GubedCache/';
Last but no least, you can specify one or many filename patterns of files that you don't want Gubed to debug. The default settings makes Gubed not debug Smarty or ADOdb.
It's generally a good idea to be careful of what you put here, in case the non-debugged code genereates errors, Gubed might get confused.
$GLOBALS['gbd']['gbdNoDebug'] = Array( '.*?adodb\.inc\.php', '.*?Smarty\.class\.php', );
To be able to use Gubed you need one of the available clients. There is one client included in the Gubed distribution, which works on Windows and Linux. If you use an operating system that can run KDE applications, you can also chose to use Quanta+ as a client (or ide).
Skip to the specific section for Gubed client or Quanta+
The included Gubed client requires wxWdigets to run.
The sources for the Gubed client can be downloaded from the Sourceforge project page at http://sourceforge.net/projects/gubed/download.
You'll need to get one of the complete archives to get the client source, ie
either GubedVERSION.tar.bz2
or GubedVERSION.tar.gz
.
(The GubedServer packages contain only the Gubed server parts)
Unpack the sources and start compilation, for example:
$ tar -xjvf Gubed0.2.2.tar.bz2 $ cd Gubed0.2.2/Clients/wxGubed/ $ ./autogen.sh $ ./configure $ make
You do not need to install it to try it out, so either do:
$ make install $ gbdclient
to install it then start it, or
$ src/gbdclient
to try it without installing.
The first thing you need to do with your fresh Gubed installation is to change the settings to suit your needs. The settings are reached by the Ctrl-O). menu.
-> (You'll find three tabs in the settings dialog: Connection, Debug behaviour and GUI.
Specify wether to use the proxy or not (it's recommended to get it to work without proxy to start with, since the setup is easier) If you use the proxy, specify what address (hostname or ip) it's running on and what port its listening to.
If you chose not to use proxy, chose which port the client should listen to.
Here you can chose what types of errors Gubed should halt on. Recommended settings are E_WARNING and all E_USER_-settings. If you also chose E_NOTICE Gubed will, amongst other things, halt on every undefined variable used, which is usually not wanted.
To install Quanta+, please refer to the Quanta+ installation instructions at http://kdewebdev.org.
Most likely, you'll be able to get precompiled Quanta+ binaries for your system.
For information on how to use Gubed with Quanta+ please see the Quanta+ documentation.
For Windows, there are precompiled binaries for the client and the installation package can also install the server scripts if you want it to.
Just download the installation package from http://sourceforge.net/projects/gubed/download and follow the instructions in the setup program.
The Gubed Proxy is made for people who either can not connect directly to the client from the php server or people who wish to have a static hostname to connect to when debugging.
Currently, it only handles one user, but in the future it should be extended to handle any number of developers connecting through the proxy.
To use the proxy, first of all it needs to be compiled and installed. Currently, there are instructions for Linux only.
To compile the proxy, do something like
$ cd Proxy $. /autogen.sh $ ./configure $ make
Then either run the proxy directly from the src subdirectory
$ ./src/gbdproxy
or install it
$ make install
The proxy has two main settings that you need to care about; debugport and commandport.
debugport specifies what port the proxy awaits scripts to connect to when they wish to be debugged.
commandport specifies what port the proxy awaits the Gubed client program to connect to to control the debugging process.
Either specify the arguments on the commandline like:
gbdproxy --commandport 8016 --debugport 8026
or make a .gubedproxy file in your home directory specifying those arguments.
The proxy also has settings for what level of output it should generate, mainly used for debugging.
Table of Contents
The first time you try Gubed it is a good idea to try it with the included test scripts, to get a feel for what Gubed is capable of and how it works.
The Gubed testbench has a few different simple scripts to try out Gubed with.
Start by launching the Gubed client, you will be presented with an empty screen like shown below.
In the top you see a menubar and a toolbar, for a full explanation of all the actions available here see the client reference section. Below the toolbar is a treeview to the left, the source view to the right and the log output at the bottom.
In the toolbar, there are three buttons that resembles the buttons of an audio player. In gubed, these buttons are called trace, run and pause. When a script is running, you use these buttons to control the execution of the script. Trace, makes the script go slowly through the code showing you every line it executes and constantly updates watched variables. Run, executes the script faster and halts only on breakpoints and errors. Pause halts the script, so you can gain control for example if it has entered an eternal loop.
Since no script is currently running, the buttons will control what state the debugger should start the next script in. If pause is not already activated (you cant press it), press it. This means the next script you debug will start in paused mode.
Next, open up a browser. Enter the url of the Gubed directory on the server and click on the testbench link. in the menu to the left, you can chose between different tests. Start the first test by clicking the "Launch the breakpoints test with Gubed activated" link.
Once you do this, the Gubed client should start working. If it doesent, and you get an error in the browser that the script couldn't connect to the client, make sure you configured it right (see the server installation section of this manual).
As you can see, the source of the script appeared to the right and the first line has a little arrow to the left of it.
Now you can click the
button in the toolbar to single step your way through the code, or click to make it execute the script.You can also click in to the right of the linenumbers in the source view to set bookmarks and breakpoints in the code.
If you wish to kill the script premature, there is the
button for that.Since you now have Gubed up and running, you can either try the different test scripts more or go on to debug your own scripts.
To start debugging your own script, enter the url of the Gubed directory on the server and click on the StartSession link.
On the StartSession page, you can either enter the path of the script you wish to debug or the URL of it.
Ifyou chose to enter the path, it should be relative to your web server root, ie /test/index.php
. The equivalent URL would have been http://myserver/test/index.php.
Once you entered the filename or URL and pressed 'Debug', the script debugging is started. Once the script is run and done, the output will be altered so any local links will be adjusted to make use of debugging as well. This way, you can debug multi step sessions and similar.
For those fortunate ones out there that uses Firefox, there is an extension available from the Gubed website.
The extension will rewrite any url to toggle between debug mode an non debug mode, so you wont have to go to the StartSession page.
Table of Contents
The client has four major areas, in the top there is the menu and toolbar where the debugging is controlled.
To the left, there is a tree view wih variables and watches. To the right of the watch tree, is he source code pane where the sources of the scripts are shown.
At the bottom is a tab control with a log of whats happening (warnings and errors will be logged here), a view of the current breakpoints and a backtrace view.
Ctrl-O)
-> (Opens a file selector dialog where you can open a source file. Gubed brings up the source files from the server as it needs to, but sometimes you want to do it manually to set a breakpoint before you launch the script.
Ctrl-W)
-> (Closes the current (visible) script source.
->
If the proxy is not being used, this action makes the client start listening for connectios. This happens automatically at startup, but should the port be occupied by other software, you can try to start listening again with this action.
When the proxy is used, this action tries to connect to the proxy.
Ctrl-N)
-> (Disconnects from the proxy
Ctrl-Shift-O)
-> (This brings up the settings dialog.
Ctrl-Q)
-> (Quits the client
->
This enters the trace mode. If no script is being executed, the next one debugged will start in trace mode if this action is activated. If a script is being executed, it will enter trace mode immediately.
In trace mode, every line of execution is displayed and the watches are constantly being updated.
Ctrl-R)
-> (Enters run mode. If no script is being executed, the next one debugged will start in run mode if this action is activated. If a script is being debugged and in trace mode or paused, it will start running.
The exection will remain in run mode until it's either paused by the user, or the execution stumbles on an error or a breakpoint.
Ctrl-P)
-> (Pauses a currently running script. If no script is being debugged, the next one will start in paused mode.
Ctrl-K)
-> (Kills the currently running script immediately.
Ctrl-1)
-> (Executes the next line of execution. If it's a function call, the function will not be entered but executed in full.
Ctrl-2)
-> (Executed the next line of execution. If it's a function call or file inclusion, it will be entered for further single stepping.
Ctrl-3)
-> (Executes the rest of the instructions in the current execution depth and halts once it returns to a higher level. Ie, if it's inside a function, it executed the rest of the function and halts on the command after the function call.
Ctrl-4)
-> (Skips the next line of execution as if it wasn't there.
Ctrl-E)
-> (Requests the contents of the current scope from the scrip and displays it in the 'Shown variables' tree.
->
Opens a dialog where you can enter a variable that you wish to see the current value of. For example “$test”.
->
Opens a dialog where you can enter an expression that you wish to see the current return value of. For example “myFunc($test)”.
->
Shows the current $this if there is one. The contents will be displayed in the 'Shown Variables' tree.
The rest of the items in the
menu are convenience options to show the contents of $_SERVER, $_ENV, $_SESSION, $GLOBALS, $_REQUEST, $_GET, $_POST and $_FILES.Ctrl-J)
-> (Opens a dialog where you can enter a variable that you wish to put on the watch list. For example “$test”.
Ctrl-V)
-> (Opens a dialog where you can enter an expression that you wish to put on the watch list. For example “myFunc($test)”.
Ctrl-T)
-> (Puts $this on the watch list.
The rest of the items in the
menu are convenience menues to put the contents of $_SERVER, $_ENV, $_SESSION, $GLOBALS, $_REQUEST, $_GET, $_POST and $_FILES on the watch list.Ctrl-C)
-> (Opens a the conditional breakpoint dialog
Ctrl-X)
-> (Toggles a breakpoint on the line of the cursor
Ctrl-,)
-> (Jumps to the next breakpoint
Ctrl-,)
-> (Jumps to the previous breakpoint
->
Jumps to the current line of execution (when paused).
Ctrl-B)
-> (Toggles a bookmark on the line of the cursor
Ctrl-0)
-> (Jumps to the next bookmark
Ctrl-9)
-> (Jumps to the previous bookmark
->
Toggles verbose logging on and off. Mainly used for debugging.
Ctrl-A)
-> (Clears the log
Ctrl-S)
-> (Saves the log to disk, in case you want to show your grandchildren.
Table of Contents
When the developer sends a http request to the Gubed StartSession script, the first thing
Gubed does is to read the original sourcecode of the script, parse it and insert call
to a debugging function called gbdGubed()
.
If the code looked like
echo "Check if we have a page"; if(isset($_REQUEST['page'])) echo $_REQUEST['page'];
it will be converted to (in memory, disk file is left untouched)
if(gbdGubed()) echo "Check if we have a page"; if(gbdGubed()) if(isset($_REQUEST['page'])) { if(gbdGubed()) echo $_REQUEST['page']; }
Second, it launches the altered script and every other statement in the script
is now a call to gbdGubed()
which returns true of false depending on wether
the line of code should be executed or not.
The gbdGubed()
function takes a few arguments, for example:
source code identifier (ie full path and filename)
current line number
currently set variables
gbdGubed()
tries to communicate with the debug client program and dies
if it fails. If the connection to the debug client is still alive, it send information
about what file and line it is executing and asks for further instructions.
The most common instruction is 'next' which tells the client to keep on
executing next instruction.
When the client receives a request from the script it updates the sourcecode view to indicate what line the script is currently at. Next, it will check if it is currently on a breakpoint, if any conditional breakpoints are true or if the developer has given any certain instructions. If there are no breakpoints and no instructions from developer, the client will tell the script either to wait for further instructions (if the developer has enabled the step mode) or keep executing (if the developer has enabled the run mode)
This will keep on until the script reaches it's end.
Throughout the whole process, the developer can give instructions to the server. Instructions include setting and clearing breakpoints, enable run or step mode, viewing variables and more.
This part of the documentation described the internal communication protocol of Gubed.
Script - The server side part of Gubed
Client - The user interface part of Gubed.
Proxy - An optional proxy, it needs to be used when the script can't connect to the client directly.
The script opens a TCP/IP connection to the host on the configured port, then it await's orders. To the script, it's transparent wether a proxy is used or not.
The client either waits for incoming connections, or does a connect itself if the proxy is used.
The proxy does nothing but forwarding the data between the script and the client.
Commands are sent in the forms of “command:datalength;data”. The data is in the form of a php serialized array with only string keys and only string or integer values.
So to send the command that tells the client about what the current file and line is, the scripts will send “activeline:98;a:2:{s:4:"line";i:0;s:8:"filename";s:53:"/mnt/hdc1/projects/mccwms2/sites/linus/html/index.php";}”.
The client can then parse the serialized array for arguments it needs, in this case “filename” and “line”
The client sends commands to the script in the same way.
NAME.
breakpoint
ARGS.
type - either "line", "change" or "true", ie break on a line, changed expression or when expression is true
filename - (conditional/line) for line breakpoints this is the file where the breakpoint should be located/occur, for conditional breakpoints it's an optional filename and halting will only occur if execution is currently in that file
line - (line) what line the breakpoint is at
class - (conditional) only break if the condition is true and in a method of an object of this class (optional)
function - (conditional) only break if the condition is true and in a function name like this (optional)
expression - (conditional) what expression to evaluate, for example ($a == 12)
DESCRIPTION.
breakpoint tells the sctipt to set a breakpoint in the specified file on the specified line, or to add a conditional breakpoint with the specified expression.
The script might reply with a removebreakpoint command in case the breakpoint is not ok
SEE ALSO.
NAME.
die
ARGS.
none
DESCRIPTION.
Tells the script to die. Execution will stop immediately.
SEE ALSO.
NAME.
getvariable
ARGS.
variable - expression to get value of, for example "$t"
DESCRIPTION.
Requests the value/result of an expression
SEE ALSO.
NAME.
havesource
ARGS.
none
DESCRIPTION.
During initialization, the client tells the script what file is to be entered and the client responds with a 'havesource' if it already knows about the source of the file.
SEE ALSO.
NAME.
next
ARGS.
none
DESCRIPTION.
Tells the script to execute the next instruction and proceed to the next one. This command will step into function calls and include files.
SEE ALSO.
NAME.
processphp
ARGS.
command - php commands to process
DESCRIPTION.
Tells the script to execute a few php commands and return the result
SEE ALSO.
NAME.
reinitialize
ARGS.
none
DESCRIPTION.
Tells the script to reinitialize, the client can request this action if it was closed down and reopened during script execution (can happen when the proxy is used) Or if the script tells the client to show a line that it doesent know of (and the source can't be loaded form disk)
SEE ALSO.
NAME.
removebreakpoint
ARGS.
type - either "line", "change" or "true", ie break on a line, changed expression or when expression is true
filename - (conditional/line) for line breakpoints this is the file where the breakpoint should be located/occur, for conditional breakpoints it's an optional filename and halting will only occur if execution is currently in that file
line - (line) what line the breakpoint is at
class - (conditional) only break if the condition is true and in a method of an object of this class (optional)
function - (conditional) only break if the condition is true and in a function name like this (optional)
expression - (conditional) what expression to evaluate, for example ($a == 12)
DESCRIPTION.
Removes a breakpoint
SEE ALSO.
NAME.
run
ARGS.
none
DESCRIPTION.
Tells the script to execute as fast as possible. Watches and current position won't be updated until the script is paused or it enters trace mode.
SEE ALSO.
NAME.
sendactiveline
ARGS.
none
DESCRIPTION.
Tells the script to send the currently active file and line
SEE ALSO.
NAME.
sendbacktrace
ARGS.
none
DESCRIPTION.
Tells the script to send the current backtrace
SEE ALSO.
NAME.
sendprotocolversion
ARGS.
none
DESCRIPTION.
Tells the script to send it's protocol version
SEE ALSO.
NAME.
sendsource
ARGS.
filename - what source is requested
DESCRIPTION.
During initialization, the client tells the script what file is to be entered and the client responds with a 'sendsource' if it wants the script to send the sourcecode of the file.
SEE ALSO.
NAME.
sentwatches
ARGS.
key - some kind of key that needs to be returned. hmm..
DESCRIPTION.
The script confirms that all watches were received
SEE ALSO.
NAME.
setdisplaydelay
ARGS.
DESCRIPTION.
Set the display delay when in trace mode. Note that setting this to zero does not mean trace == run, trace will still be slower due to watch updates and other things.
SEE ALSO.
NAME.
seterrormask
ARGS.
errormask - the type of errors that should halt execution
DESCRIPTION.
Sets the errormask, a combination of * E_WARNING (2) * E_NOTICE (8) * E_USER_ERROR (256) * E_USER_WARNING (512) * E_USER_NOTICE (1024)
Other PHP error types are not handable
SEE ALSO.
error, http://se.php.net/manual/en/ref.errorfunc.php#errorfunc.constants
NAME.
setvariable
ARGS.
variable - varibale to change value of
value - new value
DESCRIPTION.
Tells the script about an expression that needs to be executed. Mainly to set contents of variables.
SEE ALSO.
NAME.
skip
ARGS.
none
DESCRIPTION.
Tells the script to skip the next instruction as if it wasn't there and move on to the next one.
SEE ALSO.
NAME.
stepout
ARGS.
none
DESCRIPTION.
Tells the script to execute the rest of the instructions in the current function or include file and halt again when it reaches the calling/including place.
SEE ALSO.
NAME.
stepover
ARGS.
none
DESCRIPTION.
Tells the script to execute the next instruction and proceed to the next one. This command will not step into function calls and include files.
SEE ALSO.
NAME.
trace
ARGS.
none
DESCRIPTION.
Tells the script to constantly tell the client about the current line of execution and update watches, etc. As if the user was constantly pressing 'next'.
SEE ALSO.
NAME.
backtrace
ARGS.
backtrace - backtrace in the form of a serialized array
DESCRIPTION.
Informs the client of the current backtrace
SEE ALSO.
http://php.net/serialize
NAME.
commandme
ARGS.
filename - current file
line - current line of execution
DESCRIPTION.
tells the client the script is halted (For any reason. Can also be during 'trace') and needs to be updated. The client should update it's views and request watches, and backtrace. Then either reply with a "wait" or "next" command.
SEE ALSO.
wait, next, sendwatches, sendbacktrace
NAME.
conditionalbreak
ARGS.
none
DESCRIPTION.
Execution is halted due to a conditional breakpoint and the client should set its internal execution status to paused.
The status of all conditional breakpoints will follow.
SEE ALSO.
NAME.
end
ARGS.
filename - name of the file that reached the end
DESCRIPTION.
Tells the client the end of an include file was reached.
The client should forward this information to the user in verbose mode.
SEE ALSO.
NAME.
error
ARGS.
filename - file where the error occurred
line - code line where the error occurred
errnum - php error number of the error
errmsg - php error message of the error
DESCRIPTION.
Tells the client an error occurred in the script and that execution is halted because of it. Which kind of errors halts execution depends on the current settings.
the arguments are currently separated by colons
NAME.
forcebreak
ARGS.
none
DESCRIPTION.
This command tells the client execution is halted due to a forced (ie, hardcoded \* STOP *\) breakpoint.
The client should set its internal execution status to paused.
SEE ALSO.
NAME.
getrunmode
ARGS.
none
DESCRIPTION.
Upon receiving this command, the client should send the current run mode (pause, run, trace) as well as current error mask (seterrormask)
This is part of the initial communication when a script started to execute and it needs to know what run mode the user has requested as well as what errors to halt on.
SEE ALSO.
NAME.
initialize
ARGS.
filename - filename of the script entered
checksum - checksum of the script entered (using this, the the client can tell if it needs to refresh it's source view)
DESCRIPTION.
initialize tells the client a new script was entered and needs to be displayed. The client can then chose to load the script from disk or request it's sourcecode from Gubed.
The client should reply with either a 'havesource' or a 'sendsource' command, to indicate if it needs the source sent or not.
NAME.
parsefailed
ARGS.
filename - name of the file that failed to parse.
DESCRIPTION.
Tells the client and execution was halted (ie killed) because of a parse error.
This either means there are errors in the php code, or that Gubed's parser was unable to parse the file(s).
SEE ALSO.
NAME.
parsetime
ARGS.
filename - what file was parsed
time - parse time in ms
DESCRIPTION.
This command is informational only and tells the client how long time it took to parse a file.
Should be displayed in verbose mode only.
SEE ALSO.
NAME.
processoutput
ARGS.
output - what output a phpprocess command generated
DESCRIPTION.
Returns the output of a phpprocess command previously sent.
SEE ALSO.
NAME.
protocolversion
ARGS.
version - what protocol version the script uses
DESCRIPTION.
To make sure the client and the script speaks the same language, the scripts tells the client what version of the protocol it's using. The client should compare this to it's own internal version and kill the script if they do not match.
SEE ALSO.
NAME.
sendbreakpoints
ARGS.
none
DESCRIPTION.
Tells the client the script needs to know about all breakpoints the client knows of. Usually takes place when a new debugging session starts.
The client should respond by sending all breakpoints and conditional breakpoints one by one.
SEE ALSO.
breakpoint, conditionalbreakpoint
NAME.
sentwatches
ARGS.
key - id key
DESCRIPTION.
Tells the client all watches are sent, in case it needs to do cleaning up or similar.
SEE ALSO.
NAME.
setactiveline
ARGS.
DESCRIPTION.
Tells the client the current file and line of execution
SEE ALSO.
NAME.
showcondition
ARGS.
type - either "change" or "true", if it is a break on changed expression or when expression is true
filename - an optional filename and halting will only occur if execution is currently in that file
class - only break if the condition is true and in a method of an object of this class
function - only break if the condition is true and in a function name like this
expression - what expression to evaluate, for example ($a == 12)
value - what value the expression currently evaluates to
DESCRIPTION.
Tells the client about the condition (value) of a conditional breakpoint expression.
SEE ALSO.
NAME.
source
ARGS.
filename - the filename of the sent source
sourcecode - the sourcecode of the file
DESCRIPTION.
This commands sends the sourcecode of a file to the client.
SEE ALSO.
NAME.
status
ARGS.
message - clear text message to be displayed
args - number of args in the message string (%X%)
arg1 - first arg to replace %1%
argX - etc
DESCRIPTION.
A message from Gubed to the user. In interntionalizationable english. String can hold placeholders like %1% ... %X% that will be replaces by arg1 ... argX
SEE ALSO.
NAME.
variable
ARGS.
variable - contents of a php variable that was requested
DESCRIPTION.
This command tells the client the value of a variable.
The data comes in PHP's serialized form, see http://php.net/serialize
SEE ALSO.
http://php.net/serialize
2005-07-11: 0.2.2
General
* Fixed parser bug for T_ARRAY lines (thanks to Iassen Hristov who
reported).
* Fixed problem with undefined Gubed variable (thank to Jerome Rouer
for reporting).
2005-07-05: 0.2.1
General
* Added postprocessing developer tools for Gubed developers.
* Added htmlmix test in testbench.
* Gubed should now be able to handle html files and parse them as well,
ie if you have a mix of html and php pages, the html pages can now
submit to a debugged php script.
* Fixed several typos and errors in the documentation.
* Fixed bug that prevented breakpoints from taking place when tracing
(Thanks Alessandro Pasotti for reporting).
* Changed the default server, now the server is set to the address of the
computer making the http-request.
ServerScripts
* Fixed html postprocessing so that it works better with javascript links
(thanks John Hughes for reporting).
* Applied Aaron McDonald's __FILE__ patch, which fixes some issues with
the __FILE__ constant.
* Fixed bug where forms would submit to the form page rather than the
action target.
* Fixed bug with include_dir (PATH_SEPARATOR), thanks to Laurent
Laville for the patch!
* Fixed problem with https urls, thanks to Daniel Heule for reporting!
2005-04-28: 0.2.0
No major problems reported with 0.1.5, thus a stable release.
2005-04-09: 0.1.5
General
* Reorganized the CVS tree, it's now one single module for client,
server scripts, proxy and documentation.
* Wrote better documentation and structured the changes file
* Redesigned and rewrote communication protocol
* Added functionality to execute commands while in paused mode.
* Renamed the linux client to gbdclient and the proxy to gbdproxy
(Windows client is still called Gubed.exe)
Client
* Renamed 'Run' to 'Trace' and 'Leap' to 'Run' and thus fixing one
of the greatest Gubed confusions (hopefully ;)
* Added documentation to the help menu
* Reorganized breakpoint list and backtrace and put them in separate
lists instead of the watch tree. You can double click on a breakpoint
or a backtrace line to jump to that file and line (as long as it's opened
in Gubed already)
* Added a textbox below the log to type commands to execute. The
result of the command is shown in the log.
ServerScripts
* Replaced all short open tags
* Reorganized and cleaned up a bit, added a stylesheet
* Added documentation link on main page
* Fixed bug in for() loops whithout specified post expression
* If a parser error occurs, Gubed now tries to execute the original file instead.
If there was really a parser error in the file, the error output in the
browser will be better. If there was no error in the file, it might be
possible to debug the rest of the script.
2005-03-10: 0.1.4
* 0.1.3rc3 seemed good enough for a stable release, enjoy!
* A couple of compilation fixes for wxWidgets 2.5
2005-02-10: 0.1.3rc3
* Removed the 'config' line from gbdNoDebug.txt - this would
cause some scripts to bug out (gbdNoDebug.txt is a two-bladed
sword)
2005-02-10: 0.1.3rc2
* Fixed bug where require_once/include_once would include the
file more than once.
* Available files in dir in StartSession are now sorted.
* Parse errors are now reported better in the clients.
* Applied Aaron McDonald's patch that fixes the recently introduced
for-loop bug (for loops with function calls weren't parsed
correctly).
2005-01-30: 0.1.3rc1
* Minor fixes in the testbench.
* Gubed now steps on the post expression of "for" loops.
* Fixed StartSession to support apache aliases. This will only work
when php is running as an apache module, and is quite untested.
Thanks to Felix Rabinovich for suggestion how to implement it.
* Fixed StartSession to show php files if a dir is specified without an
an index.php.
* Fixed StartSession so it doesent try to alter output thats not html
documents.
* Implemented timing of the different subsections of gubed, the
timings are sent as extra X-Gubed-... headers.
* Implemented parsecache. localsettings.php can now be used
to set cachedir (defaults to [tmpdir]/gubedcache) or set it
to an empty string to disable the cache. If the right file exists
in the cache and it's newer than the source file, the cache file
will be read and used rather than the document being reparsed.
There is currently no cleanup of the cache dir implemented.
* Improved regexptest page, it's now possible to scan just one
directory. Thanks Daniel Enright for contributing the code!
* No longer need to enter index.php as part of path to debug
* It's now possible to enter full addresses in StartSession (ie
http://myserver/path/script.php as well as /path/script.php)
* Fixed bug where parts of html comments would be outputted
(thanks to Carl at NaranyaWeb for reporting)
* Slight performance improvement when no conditional
breakpoints are used.
* Fixed warnings about pass-by-reference for PHP5, thanks
to Lothar May for reporting!
* Fixed several parser bugs in GubedParserPre42
* Added debug info page for bug reports
* Exit handler will now tell about parsing errors
* Fixed several parser errors like 'return include...'.
* Made StartSession parse the output also when execution is
stopped premature.
* Added possibility to see upcoming function calls, meaning
you can watch it (add watch on $gbdNextInst) or break on
certain instructions (add conditional bp on $gbdNextInst ==
'function'). Only works for functions that are first on the line.
* Fixed StartSession to work with files that die()s or exit()s
2004-10-13: 0.1.2
* Added history to the StartSession page
* Added backtrace for PHP versions 4.3.0 and later
* Added 'Step over' for PHP versions 4.3.0 and later
* Added 'Step out' for PHP versions 4.3.0 and later
* Fixed toolbar and menu to better reflect current state
* Added manual open and close for source files
* Added path mapping dialog when opening files
2004-09-06: 0.1.1
* Fixed StartSession, it should now work with php standalone, just launch
with "php /path/to/StartSession.php /path/to/Script.php".
* wxGubed now tries to get focus when an error or breakpoint occurs.
* Made viewing of "$this" work with PHP5.
* Fixed parser bug when php end was on a line with // styled comment.
Thanks Juraj Variny for reporting!
* Fixes for Windows, both wx client and server parts. Thanks Jeff Burke
for helping out and testing!
2004-08-24: 0.1.0
* Improved conditional breakpoints, they can now break either on true
or change and optionally only in certain files, classes or functions.
* Improved StartSession and it now handles anchors, forms and http re-
direction. It's also much more userfriendly.
* Improvements for new PHP5 structures
* Parser bugfixes
* When leaping, warnings and info messages are no longer shown, for
better performance. While running or singlestepping, the are still shown.
* Improved documentation, introductionpage, testbench and parsertester.
* Fixed bug in StartSession for forms
* Removed the copy of the quanta subdirectory in the documentation, the
page can be found on http://www.hoernerfranzracing.de/kde/gubed.html
instead.
2004-06-03: 0.0.10
* Added conditional breakpoints.
* Now uses wxSTC when available, this mean syntax highlighted code and
some other improvements.
* Added some support for PHP in CLI mode.
* Fixed parser problems when script used @include, case; (semicolon instead
of colon) and do {} while(). This means that PEAR (at least my version ;)
works with gubed now.
* Tested Gubed with PHP5, seemed to work quite well.
* Sourcecode is now sent in one big batch rather than line by line
* Added experimental new method of invoking the debugger - StartSession.php.
This script can be requested with the url
'.../Gubed/StartSession.php?gbdScript=/path/file.php' and then
/webroot/path/file.php will be debugged (no need to add inclusion of
Gubed.php in file.php). Seems to work, but the output needs to be parsed
for links and actions that are altered to use StartSession as well.
* Now times the entire execution time - quite useless when singlestepping,
but good to test performance while developing Gubed ;)
* Fixed Makefile.am bug that linked in the wrong order on some systems.
* Added some more convenience menues for watches and varables.
* Restructured the watch-tree to show watches, shown variables and conditional
breakpoints.
* You can now chose wether you want the tabs to the left or on the top of the
source.
* Added some more output to configure to more clearly state how Gubed will be
built.
* Made filenames look better in tabs
2004-05-21: 0.0.9
* Restructured the protocol, it's now enough with client and PHP-Scripts,
the server part is no longer needed..
Since wxWidgets prior to current CVS did not use SO_REUSEADDR, you
might run into problems if you use older versions of wxWidgets (ie, you
won't be able to start a new listening wxClient on the same port until
the timeout period is over).
* The protocol is no longer dependent on linebreaks when sending data from
script to client, so variable with linebreaks can be shown properly
* The server is now changed to be a proxy server for Gubed, so you can
still use Gubed through NATs or if you want a static (client independent)
IP/host in your GubedGlobals.php/localsettings.php configuration.
* Implemented que-system when many connection attempts are made. If
script is started when another one is already running, it will wait
until the first one finnishes. (Does currently not work with the proxy)
* Jump to bookmark/breakpoint now jumps across files
* Changed the layout of the settings dialog
* Fixed better handling of connect/disconnect toolbuttons and menues
* Restart is no longer needed for changes to the connection settings to kick in
* Implemented protocol version handling. A script can't be debugged unless
the gubed php-parts version is the same as the client's.
* The php-parts now reads the file 'localsettings.php' from the gubed dir
if it exists. This file wont be overwritten by the distribution or CVS
so it's a good place to put configuration settings in, like the host ip.
* When leaping, the client wont show all files traveresed any more, only
ones where execution is interrupted.
* wxClient now has a verbose setting that logs more info the output
2004-05-02: 0.0.8
* Better support for watching function calls, you can now see both
text output and return value
* Less error prone when setting value of variables
* Better defaults for errormask (No halt on notices)
* Config file now accepts arguments without the leading dashes
* Bugfixes
2004-04-30: 0.0.7
* This version didnt make it to the real world
2004-04-30: 0.0.6
* Improved variable handling - you can now watch expressions as well
* Improved finding files included from path
* Added some variable testcode to GubedTest
* Remembered to update version string in help-text :)
2004-04-22: 0.0.5
* Made new parser for PHP with parser functions enabled
* Speed improvements
* Added some helper menues as well as menu item to enter variable to watch
* Bugfixes
2003-12-21: 0.0.4
* Improved toolbar internals
* Added tooltips (ejyann)
* Added makefile and adaptions for vc7 (ejyann)
* Adaptions for gcc 2.95 (ejyann)
* Reorganized sources for autotools
* Changed path and include handling
* Improved errorhandling for unmanaged sources
* Bugfixes
2003-05-26: 0.0.3
* Improved php parser code
* Improved error reporting, especially of unhandled scripts (includes)
* Improved variable watching, now supports more datatypes (like objects)
* Fixed bug that crashes gbdwxClient at refresh of watches
* Fixed some gui issues
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.