Re: basic_string::append() acting weird at release mode

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Mark Davis [MSFT] (markda_at_online.microsoft.com)
Date: 02/28/04

  • Next message: Jonathan Turkanis: "Re: Boost with VC 7.1?"
    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
    >
    >
    >
    

  • Next message: Jonathan Turkanis: "Re: Boost with VC 7.1?"

    Relevant Pages

    • Re: debugging in release mode
      ... As long as the optimizing compiler is helping my bugs to appear, ... shows the differences between the default debug mode and the default release ... and then turn off optimizations and turn on generation of debug ...
      (microsoft.public.vc.mfc)
    • Re: debugging in release mode
      ... The idea that source code was in the .exe was my misconception. ... The alert is a callback. ... SInce I now know that it is not giving away any secrets to deliver debug ... and then turn off optimizations and turn on generation of debug ...
      (microsoft.public.vc.mfc)
    • Re: CObArray with huge number of elements
      ... Add calls SetAtGrow. ... In the debug mode, the larger GrowBy is, the slower it runs. ... version wtih all optimizations disabled. ... >> CObArray things; ...
      (microsoft.public.vc.mfc)
    • Re: CObArray with huge number of elements
      ... > dw.SetSize(0, GrowBy); ... >In the debug mode, the larger GrowBy is, the slower it runs. ... >version wtih all optimizations disabled. ... >MVP Tips: http://www.flounder.com/mvp_tips.htm ...
      (microsoft.public.vc.mfc)
    • Re: Touch Screen Experts Please Have A Look
      ... I think the serial port is sensing signal from somewhere? ... image works as perfect as ever with these motherboard so no point of debug. ... > Also are You really sure that You can see the cursor? ... It looks like you serial driver reports some ...
      (microsoft.public.windowsce.platbuilder)