Skip to content
January 16, 2012 / Sebastian Solnica

Adplus: handling managed exceptions

In this post I’m going to concentrate on managed exceptions and the ways how we can handle them using Adplus. Some time ago John Robbins in his Bugslayer column wrote a great article about handling specific managed exceptions using Adplus. Although the general concept of the managed exception hasn’t changed (and so the SOS commands) his scripts do not work with the latest installation of Adplus. With the version 6.12 of the Debugging Tools for Windows we received a brand new version of Adplus (7th) which was transformed from a VB script to a .NET application. Although the command line options seems to be compatible with the previous version, the configuration file structure changed significantly. Old scripts need to be rewritten in order to work with the new version. In this post I will not only upgrade John Robbin’s scripts but also show you some (I hope interesting) new features of Adplus.

Read more…

December 9, 2011 / Sebastian Solnica

PDB files out of the debugger

I suppose that I don’t need to stress how important it is to have valid PDB files while debugging. Normally the PDB files are silently loaded by the debugger and you are happy to see all the symbols resolved in your modules window. Unfortunately you may also run into situation when the debugger will not be able to find matching symbols. The reason may be as trivial as a broken Internet connection or much more complicated like mismatched signatures. In this post I’m going to show you how to check your symbol files before debugging as well as how to extract the source file information from them. As there are different ways (and tools) to manipulate the symbol files I will present the ones that I am aware of, but feel free to leave comments about tools that I might have missed and I will try to update the post.

Read more…

November 20, 2011 / Sebastian Solnica

Forget PowerPoint – make a slideshow in… a debugger :)

Few days ago I had a presentation in the Warsaw .NET Group about PDB files. To make the slideshow more attractive (or rather original:)) I decided to replace the PowerPoint with something more connected with the subject, such as… the Visual Studio debugger. The only question was how to actually achieve this. The idea grew in my head after reading a brilliant Mike Stall’s post about debugging dynamically generated code. Mike shows in it how to emit sequence points for a text file of your choice and so bind this file with the generated MSIL. If done correctly, the debugger will load the text file, allowing you to step through its content and at the same time execute the emitted MSIL. So what if we could use the presentation table of contents as our source file and for each title (line of the table of contents) emit MSIL which will present a corresponding slide in the console window? This will actually make the debugger play the role of the PowerPoint:)

Read more…

October 12, 2011 / Sebastian Solnica

Debugging NHibernate: session management

Invalid session management is one of the common problems when using NHibernate and can lead to severe issues such as memory leaks or data inconsistency. In this post I am going to show you how to eliminate those pitfalls using the Visual Studio debugger. We will step through the process of opening and closing the session. We will also have a look at its properties in order to check if entities are correctly persisted. Let’s start then from breaking into the session open event.

Read more…

October 2, 2011 / Sebastian Solnica

Debugging NHibernate: prepare symbol files

To be able to debug the NHibernate source code the debugger must know how to find it. If you are using the 3.0.0 version of NHibernate you may use http://www.symbolsource.org configuring Visual Studio to use their symbol store. If your NHibernate version is different you need to either compile NHibernate on your own and reference the produced binaries in your application build process or make use of the sourcepack script. Here I will describe the second approach (especially because I’m the author of the sourcepack and I need to advertise it somehow ;) ).
Read more…

August 26, 2011 / Sebastian Solnica

Sourcepack released

Yesterday I released a first version of sourcepack. The sourcepack is a powershell script which examines and then modifies the PDB files in the given directory to make them reference the source code archive file. It may be considered as just another tool for indexing the PDB files which uses the archive file (zip, 7z or any other) as a source code repository. So the extract operation will simply consists of calling one of the packer applications (currently 7za.exe) with correct arguments.The processed PDB files may be then copied to the symbols directory (configured in your debugger) and the debugger will seamlessly extract the source files that are needed for you to debug the library code.

I also added a new page to the blog entitled My Projects and I hope that its content will grow as the time flies by:) Enough said, if you are interested in sourcepack please visit sourcepack.codeplex.com and read some documentation.

July 20, 2011 / Sebastian Solnica

Global.asax in ASP.NET

The Global.asax, also known as the ASP.NET application file, is used to handle application-level and session-level events. Although its structure is pretty simple and it’s easy to have one in the project, many developers don’t know exactly how it works. This post aims at revealing some of the mystery behind this file as well as providing you with some good usage examples.
Read more…

April 20, 2011 / Sebastian Solnica

Take advantage of Reference Paths in Visual Studio and debug locally referenced libraries

Are you using NHibernate or other open-source library in your project? I’m pretty sure that you are. Have you ever wondered what’s happening “under the cover” when you call Session.Get or perform a query? You probably did. The problem is that usually all the external assemblies are stored in one directory (libs, packages, reflibs etc.) with no symbol files or sources. In this post I would like to show you how you can benefit from project’s ReferencePath property and debug the source code of your libraries at any time you want.
Read more…

January 16, 2011 / Sebastian Solnica

Remote debugging with Visual Studio 2010

I’ve recently needed to remotely debug a .net desktop application with Visual Studio 2010. After having read the MSDN documentation on this subject I still missed some information. I hope that this post will fill some of these gaps and will help you configure and run the remote debugging tools.
Read more…

December 1, 2010 / Sebastian Solnica

Writing a .net debugger (part 4) – breakpoints

After the last part the mindbg debugger stops at the application entry point, has module symbols loaded and displays source code that is being executed. Today we will gain some more control over the debugging process by using breakpoints. By the end of this post we will be able to stop the debugger on either a function execution or at any source line.
Read more…

Follow

Get every new post delivered to your Inbox.