青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

C++ Programmer's Cookbook

{C++ 基礎} {C++ 高級} {C#界面,C++核心算法} {設計模式} {C#基礎}

調試breakpoint高級

breakpoint的右鍵菜單:
o_tiaoshi2.jpg

Tracepoints

When you have a "mystery" bug to solve, tracepoints are a vital part of your debugging arsenal. Single stepping and looking through code can be S-L-O-O-O-O-W and if you don't even know what you're looking for, it can consume hours and hours of effort. Tracepoints really speed things up. They're like breakpoints that don't break. In a way, they go back to the old "printf debugging" -- but you don't need to make code changes and recompile to change them.

To set a tracepoint, first set a breakpoint, then right-click on the red dot that appears in the margin and choose When Hit:

In the dialog that appears, click the Print A Message box and edit the starter message you are given. You can include any expression in braces and it will be evaluated when control reaches the tracepoint:

Leave the Continue Execution box checked so that you don't break. Tracepoints are identified by red diamonds instead of red dots:

The output from the tracepoints appears in the output window of your debug session:

You can set up something suspicious, let it run, then pore through the tracepoint output and see what you learn. It's a huge timesaver when you're tackling a "we don't even know where to start" bug. Plus, if the issue is related to threading or async issues in any way (and you know me, I keep preaching we will all be facing async issues eventually) then you don't have to worry that pausing execution suppresses the collisions. I recently helped a client solve a big hairy this-stuff-fails-for-our-biggest-customer-only bug using tracepoints... and a few other tricks I will cover in upcoming posts.

Conditional breakpoints

Conditional breakpoints were another really important tool in solving a recent "only happens at the big installations" bug in a big and complicated C++ application. We wanted to debug the code with as few rebuilds as possible and we really didn't know how parts of it worked at all. Tracepoints helped us to figure out a lot of it in a short time. We didn't have a decent repro case though, so here's what we did:

  • created a script to add an audit table and some triggers that write to it
  • created a script to remove those triggers and the table
  • created a batch file to run a server in verbose mode, and redirect the output to a text file (remembering DOS commands sure can be helpful...   myapp.exe -verbose >logfile.txt was the magic phrase.)
  • wrote some instructions for the support guy to grab a backup of the database, run the first script, run the batch file, let it run all night, then in the morning grab another backup of the database, run the second script, and stop the batch file.

Now we ran some queries on the morning version of the database to confirm that at least one X was missing a Y that should have been calculated overnight. We even had the Xid. Thanks to the tracepoint work of the previous day we knew where to be suspicious. A little digging in the trigger output told us whether the problem was "didn't get added" or "got added, but then got deleted". The last step was conditional breakpoints. These let us say "only stop here when you're processing the X with this Xid."

This really saves time when you just need to drill into what's happening in the case that is going wrong. You get to it by right clicking the red dot or diamond and choosing Condition.


One more breakpoint tip - hit count

Conditional breakpoints are cool when you know the value of one variable that is associated with trouble: this only blows up when Xid is 1234. They can also be used to reduce the boredom of single stepping. Say you've got some loop that goes around a few hundred times building up some string or array or something. You don't want to keep going round and round and round... it would be nice to jump ahead to halfway through, for example, and see how things are looking. Now if this is a for loop with a handy named variable, say

 

for (int i = 0; i<1000; i++)

 

Then you can use a conditional breakpoint and say "stop when i is 200". Or you could be clever and stop when i % 200 is 0 -- so that's every 200 times. But what if there's no i? What if you're going through a file or a recordset/dataset/resultset and you're going until the end? You don't want to add some fake variable that gets incremented each time through the loop, just so you can set a breakpoint that breaks on certain values of that variable. Instead you want to use the hit count property of the breakpoint. Just right click the red dot and choose Hit Count. There you can set the breakpoint to break whenever it's hit, just the 10th time it's hit, every tenth time (10, 20, 30 etc) or every time after the 10th time Or, of course, whatever number you want instead of 10:

Don't debug the slow way when there are tools to make you so much faster!

Filter   下次再介紹:

o_tiaoshi.jpg


注意:c#的也可以用的啊....



來自:http://www.gregcons.com/KateBlog/CategoryView.aspx?category=C%2B%2B

posted on 2006-08-16 14:47 夢在天涯 閱讀(3068) 評論(0)  編輯 收藏 引用 所屬分類: CPlusPlusC#/.NETVS2005/2008

公告

EMail:itech001#126.com

導航

統計

  • 隨筆 - 461
  • 文章 - 4
  • 評論 - 746
  • 引用 - 0

常用鏈接

隨筆分類

隨筆檔案

收藏夾

Blogs

c#(csharp)

C++(cpp)

Enlish

Forums(bbs)

My self

Often go

Useful Webs

Xml/Uml/html

搜索

  •  

積分與排名

  • 積分 - 1818523
  • 排名 - 5

最新評論

閱讀排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
      <noscript id="pjuwb"></noscript>
            <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
              <dd id="pjuwb"></dd>
              <abbr id="pjuwb"></abbr>
              久久久久久夜| 欧美激情一二区| 欧美一级大片在线免费观看| 欧美亚洲一区| 亚洲欧美中文日韩v在线观看| 亚洲欧美日本另类| 亚洲永久在线| 久久久久国产一区二区| 欧美成人精品激情在线观看 | 一本综合精品| 亚洲欧美综合一区| 亚洲成人在线网站| 欧美在线不卡| 久久综合九色欧美综合狠狠| 欧美女同视频| 韩国免费一区| 中国成人亚色综合网站| 久久―日本道色综合久久| 久久在线视频在线| 欧美激情一区二区三区全黄 | 久久久免费精品| 亚洲高清免费视频| 久久精品国产亚洲一区二区三区| 亚洲人成网站色ww在线| 亚洲欧美日产图| 久久成人精品一区二区三区| 国产精品成av人在线视午夜片| 在线成人性视频| 久久国产精品亚洲77777| 久久中文字幕一区| 亚洲午夜精品一区二区| 亚洲欧洲日本在线| 欧美成人视屏| 欧美怡红院视频| 99在线精品视频在线观看| 亚洲校园激情| 国产精品久久99| 亚洲在线视频免费观看| 亚洲精品视频一区二区三区| 欧美精品videossex性护士| 久久av一区二区三区漫画| 亚洲尤物在线| 洋洋av久久久久久久一区| 欧美一区二区高清在线观看| 国产专区精品视频| 美国十次了思思久久精品导航| 亚欧美中日韩视频| 一区二区三区日韩在线观看| 日韩亚洲欧美综合| 国产精品vip| 亚洲国产精品久久久| 欧美精品日韩一本| 久久综合色播五月| 欧美福利一区二区| 亚洲男人影院| 欧美在线一区二区三区| 亚洲欧美日韩一区二区三区在线| 欧美韩日亚洲| 亚洲成色777777在线观看影院| 国产主播精品在线| 香蕉久久精品日日躁夜夜躁| 欧美诱惑福利视频| 午夜日韩视频| 国产精品永久免费| 国产伦精品一区二区三区高清版| 91久久精品日日躁夜夜躁国产| 亚洲电影免费| 亚洲毛片一区| 一本到12不卡视频在线dvd| 美女图片一区二区| 亚洲欧美色一区| 一本色道久久综合| 国产一区二区高清视频| 欧美激情精品久久久久久| 国产综合网站| 久久精品视频在线看| 一区二区高清视频| 欧美午夜影院| 亚洲欧美日韩视频二区| 国产精品手机在线| 欧美国产一区二区在线观看| 亚洲高清在线观看一区| 欧美成人精品激情在线观看| 欧美ed2k| 国产亚洲欧美一区在线观看| 欧美一区在线看| 一区二区三区精品| 欧美在线资源| 国产亚洲欧美另类一区二区三区| 亚洲综合国产激情另类一区| 国产综合第一页| 久久日韩粉嫩一区二区三区| 亚洲欧美成人一区二区在线电影| 国产精品看片你懂得| 亚洲激情av| 亚洲永久免费观看| 国语自产精品视频在线看8查询8| 久久人人97超碰精品888| 亚洲黄网站黄| 午夜老司机精品| 亚洲国产mv| 国产精品护士白丝一区av| 欧美在线视频导航| 亚洲精品在线视频观看| 久久av资源网| 99爱精品视频| 欧美电影免费| 先锋影音一区二区三区| 欧美寡妇偷汉性猛交| 亚洲欧美在线免费| 91久久综合亚洲鲁鲁五月天| 久久精品99| 日韩一级免费| 国产综合精品| 国产精品久久久久7777婷婷| 久久不射电影网| 亚洲六月丁香色婷婷综合久久| 久久一区二区三区国产精品| 亚洲最新合集| 亚洲——在线| 亚洲国产日韩欧美在线动漫| 久久精品视频免费| 亚洲午夜女主播在线直播| 欧美成人资源| 欧美在线视频二区| 亚洲综合色丁香婷婷六月图片| 亚洲成色999久久网站| 国产精品自拍小视频| 欧美精品电影在线| 每日更新成人在线视频| 性欧美办公室18xxxxhd| 一区二区福利| 99在线精品视频| 亚洲国产日韩精品| 欧美好骚综合网| 麻豆精品传媒视频| 久久看片网站| 久久精品视频在线免费观看| 欧美亚洲午夜视频在线观看| 亚洲欧美国产高清| 亚洲一区二区黄色| 亚洲视频一区| 亚洲一级在线观看| 亚洲一区精品视频| 亚洲综合激情| 午夜国产欧美理论在线播放| 亚洲一级黄色片| 亚洲视频自拍偷拍| 亚洲制服av| 欧美在线一级视频| 久久久久成人精品| 亚洲精品极品| 国产日韩在线一区二区三区| 欧美成人综合网站| 欧美激情一区二区三区蜜桃视频 | 老牛嫩草一区二区三区日本| 久久激情五月激情| 久久亚洲一区| 亚洲在线观看免费视频| 亚洲欧美久久久| 久久精品国产69国产精品亚洲| 久久久久国产成人精品亚洲午夜| 久久久精品一区二区三区| 久久综合色8888| 91久久精品www人人做人人爽| 亚洲人成7777| 亚洲一级黄色av| 久久久www成人免费毛片麻豆| 久久综合色8888| 欧美日韩一区在线| 久久裸体视频| 欧美激情第五页| 国产精品影音先锋| 亚洲高清在线精品| 亚洲一线二线三线久久久| 欧美中文字幕在线| 欧美激情精品久久久久久大尺度 | 亚洲成人在线视频网站| 亚洲精品久久久久| 午夜精品一区二区三区在线| 美女日韩在线中文字幕| 亚洲高清资源综合久久精品| 久久久99爱| 亚洲国产精品久久91精品| 亚洲男女毛片无遮挡| 久久午夜视频| 99国产精品私拍| 久久久久久久欧美精品| 欧美色视频在线| 欧美另类高清视频在线| 国产欧美精品一区二区三区介绍| 欧美日韩小视频| 在线播放豆国产99亚洲| 亚洲婷婷综合色高清在线| 美女网站在线免费欧美精品| 一区二区不卡在线视频 午夜欧美不卡在 | 99精品久久久| 久久先锋影音av| 亚洲一区二区欧美日韩| 欧美激情一区二区三区在线视频|