473,847 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Optimised Debug" in Visual Studio 2003 ?

Sorry if this is the wrong forum...

Does anyone know what the difference is between a debug build and an
optimised debug build in Visual Studio 2003?
Nov 15 '05 #1
5 2855
Hi John,
debug build: will contain debug info, but code is not optimized
debug optimized build: same as above, but code is optimized

To understand the difference between the two, you might want to compile
the sample code I attached (sample.cs) with and without the optimization
turned on.

Then you can compare the IL and notice the differences (not a lot because
this is a very simple code, but it give you an idea). To generate the IL,
you
can you ildasm.exe (provided with VS 2003). You should be able to see that
the optimizer replaced the "if-else" statement with a "switch-case"
statement
(well, if you look carefully :-).

Another way to compare the differences is probably to step into the code
and bring up the "Disassembl y" window...

Hope it helps!

-Matteo

--------------------
From: "John Smith" <JS****@Phoney. com>
Subject: "Optimised Debug" in Visual Studio 2003 ?
Date: Tue, 30 Sep 2003 10:19:23 -0400
Lines: 6

Sorry if this is the wrong forum...

Does anyone know what the difference is between a debug build and an
optimised debug build in Visual Studio 2003?

Nov 15 '05 #2
Yes but what is the need for optmized debug?

since debugger always incurs substancial overhead and the implied assumption
is that efficiency/optimization is necessarily not an issue. If you hold
this statement to be correct then what possible use could optimized debug
serve?

I guess I need a real world example of why you would want to run with this
option considering that if there is a problem in the assembly and you have
built a debug assembly to fish out the issue, you are definitely not
interested in optimizing since the release version will take care of that.

regards

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits/default.htm

"Matteo Taveggia [MSFT]" <bz***@online.m icrosoft.com> wrote in message
news:iy******** ******@cpmsftng xa06.phx.gbl...
Hi John,
debug build: will contain debug info, but code is not optimized
debug optimized build: same as above, but code is optimized

To understand the difference between the two, you might want to compile
the sample code I attached (sample.cs) with and without the optimization
turned on.

Then you can compare the IL and notice the differences (not a lot because
this is a very simple code, but it give you an idea). To generate the IL,
you
can you ildasm.exe (provided with VS 2003). You should be able to see that
the optimizer replaced the "if-else" statement with a "switch-case"
statement
(well, if you look carefully :-).

Another way to compare the differences is probably to step into the code
and bring up the "Disassembl y" window...

Hope it helps!

-Matteo

--------------------
From: "John Smith" <JS****@Phoney. com>
Subject: "Optimised Debug" in Visual Studio 2003 ?
Date: Tue, 30 Sep 2003 10:19:23 -0400
Lines: 6

Sorry if this is the wrong forum...

Does anyone know what the difference is between a debug build and an
optimised debug build in Visual Studio 2003?

Nov 15 '05 #3
Alvin Bruney wrote:
Yes but what is the need for optmized debug?

since debugger always incurs substancial overhead and the implied assumption
is that efficiency/optimization is necessarily not an issue. If you hold
this statement to be correct then what possible use could optimized debug
serve?

I guess I need a real world example of why you would want to run with this
option considering that if there is a problem in the assembly and you have
built a debug assembly to fish out the issue, you are definitely not
interested in optimizing since the release version will take care of that.

regards


Two reasons that I can think off the top of my head:

1) you distribute optimized builds to customers, and you want
corresponding debug symbols so you can do post-mortem debugging for
problems they might encounter;

2) the dreaded (but fortunately rare) situation where the optimized
build behaves differently than the non-optimized.

--
mikeb

Nov 15 '05 #4
Yes that's true. I did that a lot in C++. But since I moved to the web I had
totally forgotten about it. I guess pushing code to a server instead of to a
client's desktop has screwed with my fundamentals.

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"mikeb" <ma************ @mailnull.com> wrote in message
news:#E******** ******@tk2msftn gp13.phx.gbl...
Alvin Bruney wrote:
Yes but what is the need for optmized debug?

since debugger always incurs substancial overhead and the implied assumption is that efficiency/optimization is necessarily not an issue. If you hold
this statement to be correct then what possible use could optimized debug serve?

I guess I need a real world example of why you would want to run with this option considering that if there is a problem in the assembly and you have built a debug assembly to fish out the issue, you are definitely not
interested in optimizing since the release version will take care of that.
regards


Two reasons that I can think off the top of my head:

1) you distribute optimized builds to customers, and you want
corresponding debug symbols so you can do post-mortem debugging for
problems they might encounter;

2) the dreaded (but fortunately rare) situation where the optimized
build behaves differently than the non-optimized.

--
mikeb

Nov 15 '05 #5
hi,

take a look at the DebuggableAttri bute
--
best regards

Peter Koen
-----------------------------------
MCAD, CAI/R, CAI/S, CASE/RS, CAT/RS
http://www.kema.at
Nov 15 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
4309
by: A_StClaire_ | last post by:
I read a section of my text on smart "counting" pointers and found it confusing so I decided to get hands-on. however I'm getting "Debug Assertion Failed... Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)" whenever I run my code below. program works fine after I bypass the msg. any ideas? thx a lot.
2
1692
by: Axel Dahmen | last post by:
Hi, when applying changes to the code and hitting to debug, a MessageBox pops up asking me if I want to build before debugging. Of course I want, that's why I've changed the code... Is there a simple way to suppress this MessageBox in Studio 7 and to start a Build-Debug sequence immediately? TIA, Axel Dahmen
5
2951
by: asdf | last post by:
Hello, I was enjoying working in VS for half a year without any problems and now I cannot debug anymore. Without any really reason my Studio tells me that the page that I want to debug has - No symbols loaded. I use VS v1.7.3088 and .NET framework v1.1.4322 SP1. I work with ASP.NET using VB and I'm trying to set a breakpoint on the ascx.vb file.
1
5884
by: Alexander Walker | last post by:
Hello I have recently published a web application using the "Publish Web Site" option of the solution explorer from Visual Studio 2005, I have published the website so that the pages could not be updated, do I need to set the web.config so that it contains <compilation defaultLanguage="c#" debug="false"> before I publish the web site or can I make this configuration change on the deployment machine after the site has been deployed? ...
0
1112
by: tshad | last post by:
In Asp.net 1.1, how does debug="true" affect your application if you are not compiling your pages into an application? Everything I have seen on this has to do with building an application using Visual Studio. I build my sites with Dreamweaver and don't use code-behind. But I do use the following line in all my pages:
3
3113
by: André | last post by:
Hi, I put that question already, but it's still not very clear to me, so ... Assume following option in web.config= debug="false" but in one aspx page (test.aspx) <%@ debug="true" ..%>
2
2344
by: bbasberg | last post by:
Hello, I am a neophyte with Visual Basic but have been trying to hurry and get up to speed. I used to be able to "step into" code using Debug..step into but for the last couple of days I am unable to. Regardless of where in the code I place my cursor, I hear a microsoft error "thunk" and step into doesn't work. I am using VBA in Access if that matters. here's one possible clue but it may just be a coincidence: I tried some example...
2
1854
by: Joe Stateson | last post by:
I added ajax to an existing web project. It runs fine but hitting F5 (debug) in Visual Studio 2005 slowly consumes resources: Kernel Memory and System Cache grow and I start seeing "Loading symbols for C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\1.0.61025.0___\System.Web.Extensions.dll" in the VS2005 footer. After several hours of coding and debugging it can take 2 minutes before that "loading symbols" finally finishes. ...
1
1180
by: Warren Tang | last post by:
Hi I have to attach to the aspnet_wp.exe frequently. Is there any shortcut or macro for it? Regards Warren
0
9727
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10978
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10643
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10705
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7879
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7050
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5716
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5907
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.