Saturday, February 20, 2010

Using KDevelop for debugging only

As you might know, KDevelop has an integrated gdb debugger. But it a bit difficult to set up the launch configuration, especially when not using KDevelop for coding.
There is now an easy way to run the kdevelop debugger only:
kdevelop --debug gdb executable --args-to-executable

When running that command kdevelop starts, runs the executable and breaks in main. You then can do the usual debugging.


Another thing I implemented is a resizable variable tooltip, with that you can look even at vallules like this one:


Tuesday, February 16, 2010

Css Language Support Update

I'm here at the KDevelop/Kate/Okteta sprint here in Berlin. Having a great time here :D
One thing I made progress on is Css Language Support, it is now supported in style elements embedded in html. Additionally outline navigation works now as expected:


Code completion still works ofcourse:

It's now in a pretty usable state, so you might want to try it.

Saturday, February 13, 2010

KDevelop XDebug (Php Debugger)

Another important part of a Web IDE is a debugger. The KDevelop XDebug Plugin is a frontend for the php debugger xdebug, and just had it's first beta release.
I'll explain in this post how to set it up.

Prerequisites:

  • Php
  • XDebug extension
  • xdebug configured to accept remote connections

    • xdebug.remote_enable = 1
    • xdebug.remote_host = localhost (yourhost if on remote server)
  • KDevplatform, KDevelop
  • The following KDevelop Plugins:
    • executescript
    • executebrowser
    • xdebug
    (download here)

Debugging a CLI Script

1. Create Launch Configuration

  • Run » Configure Launches...
  • add Launch Configuration (+)
  • choose Type "Script Application"
  • enter interpreter "php"
  • enter script path
  • activate the new Launch Configuration in Run » Current Launch Config
You may test the Launch Configuration now by executing it (Run » Execute Launch)

2. Start Debugger

  • Set a breakpoint (Run » Toggle Breakpoint, or rightclick on icon border in editor
  • Run » Debug Launch
  • Happy Debugging :D
The debug session is stopped once the script has ended.

Debugging a Website

1. Create Launch Configuration

  • Run » Configure Launches...
  • add Launch Configuration (+)
  • choose Type "Browser Application"
  • enter server host and path
  • activate the new Launch Configuration in Run » Current Launch Config
You may test the Launch Configuration now by executing it (Run » Execute Launch)

2. Start Debugger

  • Set a breakpoint (Run » Toggle Breakpoint, or rightclick on icon border in editor
  • Run » Debug Launch
  • Happy Debugging :D
The debug session continues the script has ended, you can navigate in the browser to debug further scripts. To end the session execute Run » Stop Jobs.

Remote debugging is possible too, but that is not described in this tutorial.

If you have problems with configuration, or find any other problem send a mail to kdevelop-devel _at_ kdevelop.org.

Sunday, February 7, 2010

KDevelop Php Update

I finished today the (for me) most missing feature in the KDevelop Php language plugin. It fixes parsing problems that occur when a project is initially parsed and the code makes heavy use of classes together with an autoloader. That means no include() statements for parent classes or static function calls. (Typical when using eg. Zend Framewok)

Previously code completion was broken until you manually forced a reparse, now this reparsing is automatically done once a identifier is not found - the file is added to the parse queue with very low priority - and the base class will be parsed meanwhile - and found correctly in the second pass.

Credits for this should mainly go to Hamish - who implemented that more or less the same way in Java language support.

As KDevelop is currently frozen for Beta8 I couldn't commit yet, until then I created a temporary git repository.