472,353 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 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 2729
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...
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...
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...
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...
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...
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...
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...
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...
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
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
jalbright99669
by: jalbright99669 | last post by:
Am having a bit of a time with URL Rewrite. I need to incorporate http to https redirect with a reverse proxy. I have the URL Rewrite rules made...
0
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. ...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python...

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.