Did you know… How to load only specified symbols when you want to? – #302

Continuing with yesterday’s tip, there’s another option to configure when and how symbols are loaded.

Above the option to load symbols when the dialog closes, there’s an option to load only the symbols specified in the Symbol File Locations when you load symbols manually.

Search above locations only when symbols loaded manually option

If you really want Visual Studio to wait until you tell it to load symbols, this is the option for you. Recall from an earlier tip how to load symbols manually.

If this option is enabled, the load symbols when dialog closed option is disabled as it is a no-op.

I believe this is a tip only for VS2008, as i do not recall this option back in the 2005 days. I really need Internet connectivity whenever i write tips =D

Technorati Tags: VS2008Tip

Did you know… You can cache symbols locally to disk? – #301

And here we go… beyond the #300 mark…

Under Tools – Options – Debugging – Symbols, there’s this checkbox

image

Whenever I use a symbol server, meaning that I’m loading symbols from somewhere that isn’t on my machine, like a UNC share, I do two things:

  1. Uncheck load symbols when this dialog is closed – i prefer to wait until the moment i need to load symbols
  2. I specify a cache location on disk to copy the symbol files to.

You never know when you won’t have access to the symbol server, so i prefer to use this option so  i can always keep going, just in case. i’m curious if anyone has a reason why not to use it.

Technorati Tags: VS2005Tip,VS2008Tip

Did you know… How to delay loading symbols?–#300

In May 2007, when Rob Caron and I put together the game plan for Tip of the Day, I agreed I would do the series for a year, ending with tip #300. All good things must come to an end. In the past couple of months, a “rumor” started going around within Microsoft that I had planned to stop the series. I laugh at the “rumor” because it was true. A long story short, I recently made an agreement with the messenger from the powers that be that I would keep going. I don’t know exactly how far up the management chain the command “keep sara going” came from. One of these days I’ll have to find out who issued the request.

I don’t want Tip of the Day to “jumped the shark” (an expression when a TV sitcom produces an episode that clearly indicates the series should end) or more recently for those who have seen the last Indiana Jones movie “Nuking the Fridge.” When I feel I have no more generic IDE tips to share, I’ll end the series and do something creative with the existing content. I still have two other feature areas after generic IDE debugging tips to cover, even if I didn’t personally test every in and out. When I’m finished with those feature areas, my story about Visual Studio will be complete.

And since it is tip #300, I refuse to make any references to the 300 movie.

and now for today’s tip, Same Tip of the Day Time, Same Tip of the Day RSS feed…

Yesterday’s tip discussed how to load symbols via the Modules window. There’s another way to load symbols via Tools – Options.

Go to Tools – Options – Debugging – Symbols page. Then press the New Folder button to represent where VS should look for symbols. If you followed yesterday’s tip, you’ll see this folder represented here.

Add symbol file locations

Now for today’s tip, if you don’t want all the symbols to load immediately, in case you need to do some other action, here’s how to delay.

At the bottom of this tools options page, there are there’s a checkbox Load symbols using the updated settings when this dialog is closed. To delay loading the symbols, uncheck this checkbox before pressing the OK button.

image

When you are ready to load symbols, go to the Modules window or check the checkbox.

Technorati Tags: VS2005Tip,VS2008Tip

Did you know… How to load symbols from the Modules window? – #299

When you use Tools – Attach to Process, you’ll see the Modules window pop up. From here you can right-click and choose “Load Symbols”

Load Symbols from Modules window

From here the Find Symbols dialog box pops up, asking you to provide the location of the .pdb file. Actually, you only need to provide the folder location. As soon as Visual Studio sees the .pdb file, it’ll automatically grab it from you in the dialog.

Symbols loaded in the modules window

Technorati Tags: VS2005Tip,VS2008Tip

Did you know… How to hide or show the Script Debugging Disabled warning message? – #298

Internet Explorer has an option to disable script debugging. If you try to debug your javascript, and this option in IE is enabled, you’ll get the following warning message:

Script debugging warning message

If you want to hide (or show) this warning, go to Tools – Options – Debugging – General, and check the “Warn if script debugging is disabled on launch”

Warn if script debugging is disabled on launch option

I believe this is for VS2008 only.

Technorati Tags: VS2008Tip

Did you know… How to show or hide the “No Debugging Information” warning? – #297

If you try to debug an application that you do not have symbols for, or if you’ve disabled the option “” you get the following error message.

No Debugging Information warning message

If you want to prevent this warning from showing up (or need to get it back), go to Tools – Options – Debugging – General and you’ll find the Warn if no symbols on launch (Native only)

warn if no symbols on launch

Technorati Tags: VS2005Tip,VS2008Tip

Did you know… You can debug an executable that isn’t a part of a Visual Studio project without using Tools – Attach to Process? – #296

And yet another, “I would have never thought to do that” feature in Visual Studio.

There’s the standard Tools – Attach to Process dialog that allows you to attach and debug any process currently running on your machine. But if you’re trying to debug an issue that occurs at startup (meaning the application fails or crashes before you can attach to it) or if the application finishes too quickly before you can attach, there’s still a way to debug it.

Go to File – Open Project and give it the name of the executable. Yes, even thought it isn’t a “project” per se, like a .proj or .sln, the dialog will accept an executable.

Opening notepad.exe as a VS project

Now you’ll see the executable opened in Solution Explorer as a project.

notepad in solution explorer as a project

Just hit F5 as usual to start the executable.

Technorati Tags: VS2005Tip,VS2008Tip

Did you know… How to debug your optimized code? – #295

I kinda gave a sneak peek at this option in Tip #290, but here’s the real use, if I understood the explanation correctly.

Suppress JIT optimization on module load (managed only)

Your production code is set to use optimizations, but you need to debug it. If you check this option, it will disable your optimizations but without changing your project settings.

Technorati Tags: VS2005Tip,VS2008Tip

Did you know… How to disable the “the source file is different from when the module was built” warning dialog – #294

Sometimes you have different source code files from the version that built your code. Ideally you want the sources to be the same, so you know exactly what is going on with your code. but it happens that you know the particular method hasn’t changed or you know exactly what the diff is.

Or maybe you want to prevent this from happening, because you are not cool with it.

Go to Tools – Options – Debugging – General, and uncheck the “Require source files to exactly match the original version.”

Require source files to exactly match the original version

When this option is unchecked, you can use source code files that don’t match the original, as shown below with the current statement highlight not fully extending the line.

Source code that differs from original, as current statement highlight doesn't expand entire line

and when it is checked, you get this error message.  Pressing the default “No” button will bring up a File browse dialog to locate your source files.

Warning prompt for different source code

Technorati Tags: VS2005Tip,VS2008Tip

Did you know… How to highlight the entire source code line when either the a breakpoint is set or the line is the current statement – #293

Hooray!!! A tip that’s more IDE-centric than debugger-centric!

Under Tools – Options – Debugging – General, there’s the option “Highlight entire source line for breakpoints and current statement.”

Highlight entire source line for breakpoints and current statement

When checked, you’ll see the entire line highlighted, as shown below:

breakpoint highlight extends across editor

When unchecked, you’ll only see the red circle in the indicator margin, as shown below:

no breakpoint highlight, just a red circle

Technorati Tags: VS2005Tip,VS2008Tip