C++.Net在Release方式下單步調試時需要修改一些設定,否則變數會有錯位或亂碼,切記!

來源:互聯網
上載者:User
在release狀態下單步調試時變數值會錯位或顯示亂碼,還會跳過整段的代碼,剛開始不明就裡,還以為是VS.NET本身有問題呢,呵呵

補記:
在Release還是可以單步debug的,在Solution Explorer(方案總管)中的工程名稱上點擊右鍵,選擇Properties,在工程屬性表單中修改如下幾處設定:
1、Configuration Properties -> C/C++ -> General,“Debug Information Format”由“Disabled”修改為“Program Database for Edit & Continue (/ZI)”。
2、Configuration Properties -> C/C++ -> Optimization,“Optimization”由“Maximize Speed(/O2)”修改為“Disabled (/Od)”。
3、Configuration Properties -> C/C++ -> Optimization,“Whole Program Optimization”由“Enable link-time code generation(/GL)”修改為“No”。
4、Configuration Properties -> Linker->Debugging,“Generate Debug Info”由“No”修改為“yes”。
這樣調試時就會正常了。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.