473,387 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

"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 2832
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 "Disassembly" 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.microsoft.com> wrote in message
news:iy**************@cpmsftngxa06.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 "Disassembly" 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**************@tk2msftngp13.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 DebuggableAttribute
--
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
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:...
2
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...
5
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...
1
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...
0
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...
3
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
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...
2
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...
1
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...

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.