Friday, November 19, 2004

Debugging Delphi 8, VS.NET style 

While I prefer most aspects of the Delphi 8 and C#Builder IDEs over VS.NET 2003, there is one area I prefer in VS.NET. When it comes to debugging I feel that VS.NET has the edge here, especially if you need to inspect the value of a variable which is an array, or contains other classes (either as a collection, array, or exposed instance). VS.NET allows you to drill down a treeview of the variable contents, which makes it a cinch to inspect the value of any property of even the most complex class instance. I do have a QualityCentral request to have similar variable inspection support implemented in Delphi, but this hasn't been done yet.

However all is not lost, thanks to the debugging support shipped with the .NET Framework SDK. In the SDK install directory (which on my PC is C:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\) there is a GUIDebug subdirectory which contains a program called DebugCLR.exe. This allows you to debug any .NET binary, and provides the ability to inspect variables in the same manner as VS.NET. It's even smart enough to allow you to set breakpoints in your Delphi source and step through just as you would in the Delphi IDE. You will have to associate the source code files one by one, and get used to the different keyboard mapping though.

You can even configure the Delphi 8 tools menu to call this, to simplify using it in those times where you need something a little more powerful than Delphi's variable inspection support. To do that follow these steps in the Delphi 8 IDE:-

- Tools|Configure|Tools.
- Click the 'Add...' button.
- Set the 'Title' edit to 'Microsoft CLR Debugger
- Set the 'Program' edit to point to the DebugCLR.exe
- Set the 'Parameters' edit to '$EXENAME'
- Click the 'OK' button to add the debugger to the Tools menu
- Click the 'Close' button to close the Tools Options dialog

There is one caveat here. It seems that DebugCLR won't allow you to debug the exe until you explicitly tell it you want to debug it. To do this, follow these steps :-

- Debug|Program to Debug...
- Click the 'OK' button.

(1) comments

Thursday, November 04, 2004

Hooray for on-demand printing! 

It sounds like Julian Bucknall's excellent Delphi Algorithms and Data Structures book is going to be available again soon.

I regretted not buying it when it was in print, so will have to make sure I don't miss out this time.

(0) comments

Wednesday, November 03, 2004

Every little bit counts 

After reading Allen Bauer's excellent blog post which, among other things, highlighted how many developers are blissfully unaware of any non-Microsoft development tools, I've decided to post Delphi code snippets when posting to .NET related newsgroups or mailing lists. I decided to take this for a test run today when replying to a query on a New Zealand .NET mailing list, and am now sitting back waiting for all the "What the..." responses. :-)

This was also prompted by a reply I got to a query on a .NET third party vendor's peer support newsgroups. I was asking about a problem I'd encountered with using a grid control on an inherited WinForm. Amongst other things, a support rep from the vendor said

"Visual Studio has some pretty severe problems with Visual Inheritance
and collection properties ..."

I never stated I was using VS.NET when developing the WinForm app in question. I was.... but that's not the point. ;-)

Let the battle begin...

(0) comments

This page is powered by Blogger. Isn't yours?