Jan
31
2008
0

Debugging Javascript

I have always used Firebug (a firefox extension) to debug my javascript applications.  However, it appears that the Dojo 1.0.x libraries load javascript via AJAX mechanisms.  Firebug does not support the debugging of JavaScript that is loaded via AJAX.

Luckily there is a workaround.   There is another firefox extension by the name of fireclipse that patches firebug to handle this situation.

It can be downloaded and installed from here: Fireclipse

Additional Configuration:
1. Go to the “Script” tab inside Firebug
2. Open the “Options” menu located near the right side of the window
3. Select the following: “Show eval() sources”, “Use Last Line for eval() names”, and “Decompile scripts from Source”

Written by admin in: Uncategorized |
Jan
04
2008
0

Remote Debugging with PHP

A few years ago I found a way to do remote debugging with Komodo and XDebug. However, my latest efforts to repeat that have been futile.

I decided to go down a different route this time and try it with EasyEclipse for PHP. NOTE: for this entry I am using WAMP5 on my local machine.
Here is what I did.

  1. Install EasyEclipse for PHP (Link)
  2. Download the DBG Archive and unpack it. Place the dll-x.x.x file (renamed to just .dll) into your php directory where all the other ext DLLs are located – just match the dll file up with the PHP version you have. (Note: you probably just need the dbg modules rather than the listener).
  3. Enable the debugger in your PHP.ini file by doing the following
    1. [debugger]
      debugger.enabled = true
      debugger.profiler_enabled = true
      debugger.JIT_host = clienthost
      debugger.JIT_port = 7869
  4. Check for the debugger by going to your phpinfo() and seeing if the “with DBG v2.15.5, (c) etc by Dmitri Dmitrienko” line is there (or some variation thereof).
  5. Next get the PHP Eclipse plugin for EasyEclipse.
  6. One installed, you will want to configure PHP Eclipse for your Environment
    1. Window->Preferences
    2. PHPeclipse Web Development->PHP External Tools
      1. Setup the PHP command path and parser command
    3. PHPeclipse Web Development->PHP External Tools->Apache
      1. Setup the current paths to Apache, the httpd.conf file, and your etc/hosts file
    4. PHPeclipse Web Development->PHP External Tools->MySQL
      1. Setup the current paths to MySQL
    5. PHPeclipse Web Development->Project Defaults
      1. Setup up your default Localhost and Document Root
  7. Now create a PHP Project in Eclipse
    1. File->New->Project…
    2. Select PHP->PHP Project
    3. Give it a name
    4. Uncheck the Use default location and place your document root in there
    5. Click Finish
    6. Create an index.php file if one does not already exist
    7. Populate the file with the following code:
      1. print(”How are you doing”);
        print(”I am Fine”);
        debugBreak();
        print(”Thanks for Asking”);
        print(”Anytime”);
        print(”BYE!”);
    8. Create a debug running instance
      1. Run->Debug…
      2. Click on the Arguments tab
        1. Uncheck “Use default working directory” and replace the working directory with your DocumentRoot
      3. Click on the Environment Tab
        1. Select the correct path to your PHP interpreter
        2. On the Remote Debug subtab check “Remote Debug” and “Open with dBGSesssion URL in internal browser”
        3. Set your correct sourcepath
        4. Set your mapped paths. (eg. Local: c:\wamp\www\index.php Remote: http://local.localhost.com/index.php)
      4. Click Apply and the Debug
      5. You should now be able to step into your script. It should break where you entered the “debugBreak()” call.

NOTE:  You can also hit breakpoints through any browser, if you include the following request string:

  • ?DBGSESSID=1@clienthost:10001
Written by admin in: Uncategorized |
Jan
04
2008
0

Get Bigger: Expanding your VMWare Hard Drive

I recently needed to expand the main drive that one of my Virtual Machines was using. I didn’t find any built in menu options that allowed this, but I did find that VMWare has an external utility that does this for you.

Information on the Virtual Disk Manager can be found on their website at:

WMWare Virtual Disk Manager

A sample command to expand a virtual disk looks like this:

vmware-vdiskmanager -x 12GB C:\PATH_TO_DISK\The_Disk_In_Question.vmdk

This command resized the disk to be 12GB.The new size of the virtual Disk will be 10 GB in this example.

The utility ships with VMWare Workstation, which I use.

Now, be aware, this doesn’t fulfill all your hopes and dreams – at least not mine.  The utility does not preserve snapshots.  You’ll be reduced to one disk image.  If you have a large snapshot tree, like myself, you will only want to expand your drive if you have no other options.

Written by admin in: Uncategorized |