Debugging Thinstalled software
Previous Top Next


Debugger Support

Thinstall packaged EXE and DLL files may be debugged using most debuggers including Visual Studio 6 and Visual Studio 2003.

In order to debug applications, the application must be compiled with debug information initially.
When you compile an application with debug information, it contains a hard-coded path to a .pdb file on your development computer. As long as this pdb file exist, you will be able to step through the application and set break points as normal. When copying the application to a different computer, you must either use remote debugging (see below), or ensure that you copy the pdb file to the exact same location as was present on your development machine.

Note, Thinstall also has anti-debugging support which must not be enabled if you wish to debug the application.


Setting breakpoints

You will not be able to set breakpoints in Thinstall packaged EXE files until the application has started execution. It may be useful to put code in your application that looks like this:

main()
{
if (IsDebuggerPresent())
DebugBreak();

...
...
}

This will cause the debugger to stop your application (if you have a debugger attached) as soon as the main() function begins executing. From this point on, you can set breakpoints anywhere in your code and step through the code normally.

It is not possible to set a break point in C++/VB DLLs that are loaded from the virtual file system, and these DLLs will be completely invisible to the debugger applications. We expect to implement a method for setting breakpoints in virtual DLLs in the future. For applications written in .NET, Visual Studio will allow you to set break points in any .NET managed DLL.


Remote Debugging

Applications can be remotely debugged using msvcmon.exe (see Visual Studio documentation). The PDB information for EXE files being debugged remotely can reside on locally. This may be a good option for diagnosing problems in the field.