Sunday, November 04, 2007

DILE v0.2.6: VC++ SP1 runtime

A few days ago I tried to run DILE on a Windows XP machine which had only .NET Framework installed. Of course, I got the usual System.IO.FileLoadException. So, I installed the VC++ runtime which is needed because the Dile.Debug.dll is actually a mixed assembly. However, this didn't solve the problem. After searching a little bit on google I noticed that there is a new VC++ runtime which was published together with the Visual Studio SP1. Since I am using Vista, I also installed the SP1 and as a result the Dile.Debug.dll references the new SP1 runtime.

So, please install the VC++ SP1 runtime if you want to use DILE v0.2.6 on a machine which doesn't have Visual Studio SP1 and/or the VC++ components installed.

I have updated the .zip files on Sourceforge (I only changed the readme.txt, nothing else) and fixed the readme.txt to contain the correct links.
So, here is the updated readme.txt file separately, plus the links to the correct runtimes:
x86 VC++ SP1 runtime
x64 VC++ SP1 runtime

Of course, if you have already downloaded DILE v0.2.6, then it is not necessary to download it again, just remember to use the new runtime if you ever receive a FileLoadException.

Labels:

Saturday, September 29, 2007

DILE v0.2.6

I have uploaded a new version of DILE on to Sourceforge.

zip file (x86): dile_v0_2_6_x86.zip
zip file (x64): dile_v0_2_6_x64.zip
readme.txt: readme.txt
license.txt: license.txt
change_log.txt: change_log.txt

There are four main improvements besides several small ones and bug fixes (see the change_log.txt for more details):
  • Generics (type parameters) are now completely supported, which means that the Object Viewer window can inspect and display such types perfectly and expressions that contain type parameters can be evaluated during debugging as well.
  • .NET 2.0 permission sets are now displayed correctly. Earlier I could not find the specification of these; and thus I just displayed the binary content which often resulted in ugly unicode characters. Eventually, I could find the specification and this problem is fixed now.
  • Events are disassembled. This was my mistake, I simply forgot about events... In the Project Explorer the tree now contains an "Events" node where a class' events are collected.
  • Enums are also parsed now and can be used in expressions. However, my implementation differs from Visual Studio's. Mine is not so strict, which means that enum values don't have to be converted to int or their other underlying type. E.g.: TestApplication.TestClass.TestMethod(TestApplication.TestEnum.TestField) is accepted by DILE, it's not necessary to cast the TestApplication.TestEnum.TestFiled to int.



Proper .NET 2.0 permission set (instead of the ugly unicode characters)

Event of a class

New generic instance created by evaluating expression

Calling instance method with type parameter on a generic object

Array of generic objects

Array of generic structs

Calling a method that has its own type parameters but also uses its enclosing generic class's type parameter as well

Passing enum as parameter (instead of int value as earlier)


Here are some of the expressions that I used for testing. These are correctly evaluated by the new version:
TestApplication.GenericClass.Method()
new TestApplication.GenericsTest(5, "test")
new TestApplication.GenericsTest2().GenericMethod(5)
new TestApplication.GenericsTest(5, "test").GenericMethod(6)
new TestApplication.TestClass.NestedClass()
new TestApplication.GenericClass.NestedGenericClass()
new TestApplication.TestClass.NestedClass[] {new TestApplication.TestClass.NestedClass()}
new TestApplication.TestClass[] {new TestApplication.TestClass(1, "one")}
new System.DateTime[] {System.DateTime.Now}
new TestApplication.GenericStruct[] {new TestApplication.GenericStruct(1, "one")}
TestApplication.GenericClass.StaticMethod("test")
TestApplication.GenericClass.NestedGenericClass.StaticGenericMethod("test")
TestApplication.GenericClass.NestedGenericClass.StaticMixedMethod(System.DateTime.Now, 5, null)
new TestApplication.DebugTest.InnerClass[] {new TestApplication.DebugTest.InnerClass(), null}
TestApplication.TestClass.TestMethod(TestApplication.TestEnum.TestField)
new TestApplication.GenericClass(TestApplication.EnumClass.TestField)
System.Text.Encoding.UTF8.GetString(V_0) (V_0 is a byte array)

P.S.: According to SourceForge DILE has been downloaded more than 10,000 times! Wow! Thank you! :-)

Labels:

Wednesday, March 07, 2007

DILE tutorial: basics

Link to the tutorial (3.8 MB!)

Finally, I have finished the first tutorial for DILE. It just shows some basic features of DILE and should be enough to get you started with it.
Basically, the animation shows how to debug a newly created, very simple application (which just adds two numbers). It demonstrates how to start the application in DILE, how to step through the code, check the call stack, loaded modules, local variables/arguments, evaluate expressions and how to use the Object Viewer. There are lots of explaining messages that will - hopefully - make clear why some things work differently in DILE.

Please, let me know of what you think of this tutorial, whether it's really useful, whether I should make more and if yes, then I'd be glad to hear ideas on what should the following ones be about (I have a few more subjects on my mind though). Of course, I'd also like to hear if you think that I should do something differently in such tutorials. And - as always - if you have anything else to say about DILE then just send me an e-mail or leave a comment. :-)

One more thing, if you are planning to link to the tutorial (why would anyone do that though?), then please link to this blog entry. Sooner or later (but rather later...) I will create a homepage for DILE and then I will move the tutorials there also and I'll update the link to it in this post. Thanks!

P.S.: As Sebastian suggested, I have used Wink for creating this Flash animation.

Labels: ,

Saturday, March 03, 2007

Windows Developer Power Tools

At last, I have the time to mention in this blog that THE book has been released. Actually, it was released last year. Here is a picture of the author holding a copy of it and actually, today I have received my copy of it as well (thanks O'Reilly). It's really great feeling to see my name and my tool in a book. :-)

No doubt, the two authors (Jim Holmes and James Avery) are doing everything to make the book more popular. Last month was the Windows Developer Power Tools Day, a podcast has been created by WebDevRadio and an interview with the authors has even been uploaded to Channel 9.
Oh, and don't forget the book's website, where DILE has its own page as well. Btw, you're welcome to vote on it. ;-)

I really hope that book will be/is popular and useful. And perhaps DILE can also get some new users from it. :-)

Labels: ,

Sunday, February 25, 2007

DILE v0.2.5 (64-bit compatible)

First of all, yep, I'm still alive. Lately I have been quite busy, I had quite a lot of things to arrange after moving to Singapore. Finding a proper accomodation was also not easy. But - at last - things seem to settle down and hopefully soon I can get back to my normal life and spend more time on DILE also. :-)

Second, I could not stand the overwhelming demand anymore... Lots of users (means 2) have informed me that DILE is not running on x64 OS. I had a few ideas what can be wrong but in the end I found out that the problem was more serious than I expected. Basically, I made 2 big mistakes:
1. I mixed up IntPtr and uint/int variables in some cases. On x86 processors this didn't cause problem because both are 4-byte data type, but of course on x64 it immedately caused an exception.
2. I didn't know (shame on me) that 64 bit assemblies have different headers. x86 files have PE32 and 64 bit assemblies have PE32+ header. The difference between the two is little, but enough to make my positioning algorithm fail.

The good news is that I have fixed both problems and now DILE is working correctly on x64 OS also. Actually, I have tested it on Windows Server 2003 x64.
There are no other improvements for now though, only a few more bug fixes (see change log).

zip file (x86): dile_v0_2_5_x86.zip
zip file (x64): dile_v0_2_5_x64.zip
readme.txt: readme.txt
license.txt: license.txt
change_log.txt: change_log.txt

Just a few screenshots to keep this old habit + prove that DILE is really x64 compatible:

Disassembled 64-bit assembly

Debugging DILE with DILE on x64 OS


One note: the DockPanelSuite seems to have some problem with x64. Panels look weird for me. But I think it's not a DILE bug. Actually, the second screenshot shows that the DockPanelSuite throws an ArgumentOutOfRangeException.

Next step: making Flash tutorials for DILE...

Labels: ,

Tuesday, November 14, 2006

DILE v0.2.4

Here is the 0.2.4 version of DILE, as I promised earlier. I really hope that it's lot more stable and easier to use now...
As always, the important files first:

zip file: dile_v0_2_4.zip
readme.txt: readme.txt
license.txt: license.txt
change_log.txt: change_log.txt

No doubt, there are two very important improvements: the new Object Viewer window and having context menus almost everywhere. Both of these increase the usability of DILE a lot.
But here are some other improvements in detail (check the change log for a full list):
  • completely rewritten (from "scratch") the Object Viewer form, now it's multi-thread, lot more reliable, it has log functionality, evaluations can be aborted and displayed information is lot more complete (no fields or properties should be missing)
  • changed the structure of displayed nodes in the Project Explorer: types are grouped by namespaces (hopefully this improves usability)
  • redesigned the Quick Search Settings form
  • several panels (modules, threads, local variables, arguments, watch, auto objects, callstack) use lazy-initialization to display information which means that they refresh their contents only when they're visible
  • made evaluation aborting more robust and reliable
  • added set IP (instruction pointer, basically it's like the Set next statement in VS)
  • added Watch Panel (every expression that is added to the panel will be evaluated after each step)
  • added a text displayer form that can be used to display text with or without escape characters, format text as xml or display text as html
  • added context menu to every ListView and DataGrid control; the menu allows you to copy values to clipboard or display them in the text displayer form, and also contains custom actions when available
  • fixed bug: breakpoints were not set in assemblies which had different assembly and module name (e.g.: mscorlib)


And screenshots of the new features:

The new Object Viewer window

Text displayer window

The new context menu

"Set IP" to instruction feature

"Add module to project" option in the Object Viewer


Don't hesitate to contact me with problems or ideas regarding DILE. :-)

Labels:

Tuesday, November 07, 2006

A "little" change... moving to Singapore

This time another personal post.
As you might know, my wife is Indonesian. We have been planning for a while now to move from Hungary back to Asia. And after returning from our trip this June, we have started to seriously look for a job in Singapore. I am really lucky as I have managed to get one there. My visa is already approved, my contract is signed and in the beginning of December (on 4th to be exact) we'll move there.

Both me and my wife agree that Singapore must be a good place for us. For her it will be easier to live there as she can be closer to her parents and she can communicate with other people more easily (Hungarian language is quite difficult and most of the Hungarians can't speak English unfortunately). For me, it's a good opportunity to learn new things and I really like Asia and South-East Asian mentality thus I don't think it'll be difficult to adapt. However, leaving my parents in Hungary won't be easy... :-(

Of course, all this has some effect on DILE as well. Before we move I'll release a new version. No doubt, this should be the best so far. :-)
I've finished all the changes that I planned, and there are some - I believe - really useful new features. I've, for example, completely rewritten the Object Viewer and added context menu almost everywhere.
I have also spent lots of time on trying to find bugs (and fixed all of them). I think it's more stable now.

Actually, in my current workplace for the last 2-3 months most of the time I had to fix bugs and DILE helped a lot. In several cases it "saved life" because I often had to debug on servers where VS wasn't installed. I was also glad to see that some of my collegues were interested in it and tried to use it. At last, I could see where I should improve the program. I even received a feedback letting me know that DILE is a little bit complicated to use for the first time. I'm therefore planning to create some kind of Flash tutorial, but I think I'll have the time for that only after moving to Singapore.

Anyway, once everything is settled in my new place, I'll continue working on DILE. So for now, expect some break but I'll be back! :-)

P.S.: I have changed to the new beta blogger... I hope it won't crash. :-)
P.S.: Does anyone know a good, _free_ tool for recording from screen in Flash format?

Labels: ,

Sunday, August 27, 2006

VS2005 QuickWatch "bug" + DILE v0.2.3

I'll start with the shorter news. I found an interesting "bug" in Visual Studio 2005:

  1. Create a new project in VS2005.
  2. Don't write any code in it, just start debugging.
  3. Write the following expression in the Quick Watch window and get it evaluated:
    new Guid[] {Guid.Empty}
    The displayed value will be an error message:
    "Cannot dereference expression. The pointer is not valid."
    *sigh* I know this error message too well (the "advantages" of developing a debugger :-)).

If you include some code in your project that uses Guids (e.g.: Guid guid = Guid.Empty;) then the expression will be evaluated correctly.

It's really not a huge bug, rather just fun to know about it. :-)
I submitted this problem to Ladybug also.

 

And now the good news: DILE v0.2.3!
The usual files can be found here:

zip file: dile_v0_2_3.zip
readme.txt: readme.txt
license.txt: license.txt
change_log.txt: change_log.txt

The new features are the following:

  • expression evaluation during debugging (generics are not supported yet)
  • startup assembly/program can be specified along with the arguments and working directory
  • debugging can be started with stepping (in such cases DILE will pause the debuggee when the first IL code is hit)
  • run to cursor
  • stop debuggee only when an unhandled exception is thrown
  • filtering debug events that are shown in the Debug Output Panel
  • automatic detection of the .NET Framework version when attaching to a process
  • refreshing displayed processes in the Attach to process window
  • adding not loaded assemblies to the DILE project made easier (right click in the call stack on an "Unknown method..." line and choose "Add the referenced module to the project" option from the popup menu)
  • Object viewer menu to quickly display the Object Viewer window during debugging (shortcut by default: Ctrl + W)

No doubt, I consider the first to be the most important (and that took the most time to implement).
I think a very useful thing during debugging is that it is possible to call methods, check properties and inspect variables and not just local variables or arguments. From now on it is possible to do these kind of things in DILE also. Here are a few example expressions that I used for testing:

5 * -6
1 + 2 * 3 - 10 / 5 * 5
(1 + 2 * 3 - 10 / 5 * 5).ToString()
(-5).ToString()
new object() + "a"
"abc".Length.ToString()
System.Type.GetType("System.String").GUID.ToByteArray()
TestApplication.DebugTest.CreateOperatorTest4("op1") | true
TestApplication.DebugTest.ParamsTest2()
TestApplication.DebugTest.ParamsTest2(5, 6)
System.String.Format("{0}{1}{2}{3}{4}", "a", "b", "c", "d", "e")
new object[] {4, "a", 5}
((System.Exception){exception}).Message

At least these should be evaluated correctly. :-)
Usage of overloaded operators is also implemented, just like automatic conversions (implicit/explicit cast operators are also used if it's necessary).
Currently DILE uses the debugging API that is included in the .NET v1.0/v1.1. This means that the functionality is similar to VS 2003. However, there are some expressions that VS 2003 can't evaluate but DILE can (like creating new arrays).

And as always, here are a few screenshots of the new features:

 


Evaluating a System.String.Format() method call

Evaluating an argument's field (while debugging Windows Live Writer :-))

Specifying startup arguments

New Attach to process window (not necessary to manually choose the .NET Framework version)

Adding a not loaded assembly from the Call Stack Panel

So, that's it. I hope DILE has become more useful and worthed the waiting.

My plans about the next version is, of course, to fix the bugs first of all. And I'll spend some time to make the UI more usable. I'm not very satisfied with the grids... I think there are already lots of useful features in DILE but the UI "is a little bit behind the functionalities". And 1 more thing that I plan to include in the next version is setting the IP and this will mean some UI change as well.

As always, please let me know if you find any bug (I'm sure, both the parser and the evaluator algorithm is not perfect yet), or have any suggestion.

P.S.: I post this entry from Windows Live Writer. I hope the post will really look like in the editor. :-)

Thursday, July 13, 2006

DILE in the Windows Developer Power Tools book

O'Reilly will soon be publishing its new book entitled "Windows Developer Power Tools" by Jim Holmes and James Avery.

Here is an excerpt of what Jim Holmes has got to say about it on his blog:
The book is around 1100 pages of goodness on open source and freeware tools you can use to improve your software development work. The book’s all about using tools to bring value to the entire development cycle from writing code to testing to lifecycle management. We’ve got something like 170 tools from Anthem.NET to Sysinternals RegMon to Bugzilla. We chose tools which help improve the quality of code you write, or help improve your productivity as a developer.


If you wondered why I mentioned all this--which I know you do; is because DILE has got a small article in it (click here to see the table of contents and here for the sample chapters).

A few months ago Jim sent me an e-mail to ask whether I'd like to contribute an article about DILE, so there it is. The book also features other tools, such as: ildasm, Reflector, CLRProfiler, etc. My, those are quite big names there! :-) As for the article about DILE, it is written by me and extensively edited by my wife (and Jim also, I guess :-) ). Anyways I hope it can also serve as a small help/introduction for DILE.

I'm really looking forward to having the book. I'll surely read all the 1100 pages. That's all for now and back to work. I still have to fix a few things about the debug expression evaluation. :-)

Tuesday, May 16, 2006

1 month holiday

Usually I try to avoid writing personal things but this time it has some effect on DILE also. This Wednesday I'll travel to Indonesia for 1 month with my wife to visit her parents. As it is a little bit difficult to get Internet connection there, I'll certainly not be online every day. However, later I'll read all comments/e-mails/forum entries and try to answer them, but don't be suprised if I'll be a few days or weeks late. But as always, let me know if you have any problem or comment about DILE. It's always nice to see that people use what I have made. :-)

About DILE... No doubt, lately I have been a little bit lazy to work on it. But of course, I didn't give up the project. My plan is to have several new features that will make debugging more complete and then start to work on the compiler part.
Here is a screenshot of one of the most important features that will be in the next release:

Evaluating expression during debugging


It is not ready yet though, but I'll finish it after coming back from Indonesia. And there will be some other new things also like starting debugging with stepping (so DILE will stop on the first instruction of the entry method), run to cursor, specifying parameters for the debuggee etc.