Re: basic_string::append() acting weird at release mode
From: Mark Davis [MSFT] (markda_at_online.microsoft.com)
Date: 02/28/04
- Previous message: Mark Davis [MSFT]: "Re: Applying a member function to a range of elements"
- In reply to: Igor Tandetnik: "Re: basic_string::append() acting weird at release mode"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 28 Feb 2004 01:57:00 GMT
As Igor mentions, you should turn off optimizations if you want to debug
your release build.
Debugging a release build is often useful because the debug and release
compilers behave differently (e.g. variables are initialised by the debug
compiler, but not release - a common problem).
Mark Davis (MSFT)
-- This posting is provided "AS IS" with no warranties, and confers no rights. Use of included information and code is subject to the terms specified at http://www.microsoft.com/info/cpyright.htm. -------------------- >From: "Igor Tandetnik" <itandetnik@mvps.org> >References: <5fc41c7e.0402251647.175eee12@posting.google.com> >Subject: Re: basic_string::append() acting weird at release mode >Date: Wed, 25 Feb 2004 19:57:43 -0500 >Lines: 35 >X-Priority: 3 >X-MSMail-Priority: Normal >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 >X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 >Message-ID: <#mtGMOA$DHA.2664@TK2MSFTNGP09.phx.gbl> >Newsgroups: microsoft.public.vc.stl >NNTP-Posting-Host: 142.winstar.net 207.98.207.142 >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl >Xref: cpmsftngxa06.phx.gbl microsoft.public.vc.stl:22102 >X-Tomcat-NG: microsoft.public.vc.stl > >"ph0ngwh0ng" <ph0ngwh0ng@hotmail.com> wrote in message >news:5fc41c7e.0402251647.175eee12@posting.google.com... >> Stepping into the code with F10, when I step over tstrKey.append(...), >> the step cursor jumps to the end of the function(the } ). Pressing >> F10 again sends the step cursor back to tstrkey.append(...). I have >> to press F10 9 times after this to have the step cursor going to >> RegOpenKeyEx(). Also, pressing F11 instead reveals the same >> behaviour, in addition that stepping into basic_string::append(const >> _Elem *_Ptr) leads me in basic_string::append(const _Elem *_Ptr, >> size_type _Count) instead. > >That's to be expected when stepping through Release build (why do you >want to, anyway?) The optimizer can rearrange code in odd ways, so that >the resulting machine code bears just a sligh resemblance to the >original source. As a result, there's no good way to associate line >numbers with machine instructions - that's why the current execution >point jumps back and forth when single-stepping. > >> When I'm finally at the end of the function, the step cursor goes into >> >> (seccook.c) >> void __declspec(naked) __fastcall __security_check_cookie(DWORD_PTR >> cookie) >> { > >That's the buffer overrun check introduced by /GS option. You asked for >it - you got it. >-- >With best wishes, > Igor Tandetnik > >"For every complex problem, there is a solution that is simple, neat, >and wrong." H.L. Mencken > > >
- Previous message: Mark Davis [MSFT]: "Re: Applying a member function to a range of elements"
- In reply to: Igor Tandetnik: "Re: basic_string::append() acting weird at release mode"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|