views:

30

answers:

2

I am using Visual Studio 2008. I don't need to debug some DLLs in my project, so can I disable symbol loading when debugging a Visual C++ program? Does it help to make startup time faster when debugging?

The symbols are all local, so I don't have those slow loading problem, just want to make debugging faster and faster.

For example I am using Qt libraries, when I hit "Starting Debugging", the Output window shows that the symbols for Qt libraries are loaded. If VS can stop loading those symbols, the debugging startup time should be faster. Of course, I still want VS to load symbol for my executable.

A: 

I am not sure what you mean by 'startup'. I assume you are talking about the launching of the actual application. The time to launch the target application is expensive regardless of mode you launch it. It may be less in Release but that will be negligible.

Turning off all symbol paths as mentioned in the other solution is a viable option. However, I am not sure why you are debugging if you do not want symbols for your launched application. Without the applications symbols you will not be able to see where you are in the source code when you are debugging.

If you are looking for a faster debugging experience you can use WinDbg. It comes with the Windows SDK but can also be downloaded seperately. If is a faster UI than Visual Studio, but it is much more cumbersome to use if you are more comfortable with a GUI. WinDbg uses commands to perform almost all tasks, but you can do some great debugging and it is faster in many cases compared to Visual Studio. In the event you want to debug C++\CLI or any managed application (e.g. C#), I would stick with Visual Studio. There is an extension in WinDbg called SOS, but it requires some advanced debugging experience to use correctly.

linuxuser27
It's uhlikely that gain in debugger performance from using WinDbg will outweigh the productivity benefits to OP of continuing to use the full IDE. WinDbg has its place - I still use it for postmortem debugging of nasty bugs in native code like stack overflow or corruption, where the IDE throws up its hands or explodes completely - but in 99% of cases VS will be just fine for native C++ as well as managed code.
Steve Townsend
I mean the start time when hitting "Start Debugging" in Visual Studio. I want to debug my application, but not the DLLs it loads, for example the Qt libraries. Maybe I should try using the release version of the libraries when I am debugging.
fxam
If you want to cut down on launch time remove the symbols of the library in question. In this case, the symbols files (pdbs) are probably right next to the Qt library binaries. Remove them and they will not be loaded. The build type of the binaries is not going to increase your debug launch time to any large degree.
linuxuser27
I actually tries changing to using the release version of Qt libraries, so VS doesn't even try to find the pdb files (although it complains in the Output window when loading the DLLs). It works but I don't know what side-effects I may encounter.
fxam
It does try to load them, that is why it is complaining. There are no side-effects other than not being able to debug into the library in question.
linuxuser27
+1  A: 

Just found out that Visual Studio 2010 actually do what I want.

To load only the symbol for your executable file, without loading other symbols (eg: DLLs):

  1. Go to Tools->Options->Debugging->Symbols
  2. Click "Only specified modules"
  3. Clear "Always load symbols located next to modules"
  4. Click "Specify modules"
  5. Click the new icon
  6. Enter your executable filename (eg: my-awesome-app.exe)

Also found out that Visual Studio 2010 seems to perform better than Visual Studio 2008 when debugging. At least the IDE layout switches back faster when the debugging is stopped.

fxam
+1 Good way of doing it.
linuxuser27