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

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 夢在天涯 閱讀(3050) 評論(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

搜索

  •  

積分與排名

  • 積分 - 1811735
  • 排名 - 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>
              欧美激情1区| 久久精品论坛| 亚洲区一区二| 欧美精品久久一区二区| 亚洲人成毛片在线播放| 亚洲国产高清自拍| 欧美日韩亚洲激情| 亚洲欧美亚洲| 久久精品青青大伊人av| 亚洲国产导航| 亚洲美女在线一区| 国产精品尤物福利片在线观看| 亚洲欧美日本国产专区一区| 欧美夜福利tv在线| 亚洲第一搞黄网站| 99国产精品久久久久久久成人热| 欧美性感一类影片在线播放| 久久精品女人| 欧美精品福利在线| 久久av一区二区三区| 久久久人人人| 亚洲一区欧美| 久久天天躁夜夜躁狠狠躁2022 | 久久亚洲春色中文字幕| 亚洲精品一区二区三区不| 亚洲视频一区二区在线观看| 国产一区二区三区高清| 亚洲精品视频在线| 狠狠色狠狠色综合日日五| 亚洲伦理精品| 136国产福利精品导航| 亚洲精品中文字幕在线| 国内精品久久久久久 | 午夜亚洲性色福利视频| 久久香蕉国产线看观看网| 在线一区二区日韩| 免费看精品久久片| 久久久www| 国产精品久久久爽爽爽麻豆色哟哟 | 欧美久久电影| 麻豆国产精品va在线观看不卡 | 久久国产精品99国产| 在线亚洲电影| 欧美高清视频一区| 六月婷婷一区| 国产三级欧美三级| 在线视频一区观看| 99精品欧美| 欧美成年人视频网站| 久久亚洲欧美| 国产一区二区三区视频在线观看| 一区二区三区四区蜜桃| 日韩一区二区电影网| 欧美v国产在线一区二区三区| 久久全球大尺度高清视频| 国产欧美精品一区aⅴ影院| 99在线精品免费视频九九视| 99精品免费视频| 欧美人成在线视频| 亚洲精品久久久久久久久久久久 | 欧美理论电影在线播放| 欧美激情国产高清| 亚洲欧洲在线视频| 免费在线一区二区| 亚洲黑丝在线| 日韩亚洲一区二区| 欧美日韩国产黄| 一区二区欧美国产| 亚洲在线观看免费| 国产精品普通话对白| 亚洲网站在线| 久久精品国产免费| 激情视频一区| 久久中文欧美| 亚洲黄色免费网站| 一本色道久久综合亚洲二区三区| 欧美日韩天堂| 亚洲专区一区二区三区| 久久av一区二区三区漫画| 狠狠操狠狠色综合网| 美女网站在线免费欧美精品| 亚洲国产高清一区二区三区| 亚洲一区二区三区久久| 国产精品中文字幕欧美| 久久精品国产99国产精品澳门 | 性欧美大战久久久久久久久| 国产精品一区二区在线观看| 新狼窝色av性久久久久久| 媚黑女一区二区| 亚洲精品欧美| 国产精品久久久久久久久久久久| 欧美亚洲一级片| 久久影视三级福利片| 亚洲伦理一区| 国产欧美日韩精品一区| 蜜桃av一区二区三区| 亚洲色无码播放| 免费看成人av| 亚洲欧美日韩精品久久| **性色生活片久久毛片| 欧美日韩一区二区在线观看| 久久超碰97中文字幕| 亚洲精品看片| 久久人人看视频| 亚洲综合国产| 亚洲国产精品久久久久婷婷老年| 国产精品草莓在线免费观看| 久久久综合视频| 中文精品视频一区二区在线观看| 久久综合久久美利坚合众国| 在线一区观看| 亚洲黄色av一区| 国产欧美欧美| 欧美日韩直播| 免费在线看成人av| 久久国内精品视频| 在线视频日韩| 亚洲精品日韩久久| 欧美福利在线| 久久综合影音| 久久精品九九| 欧美亚洲网站| 亚洲在线观看免费| 99riav1国产精品视频| 在线观看欧美| 一区一区视频| 国产综合色精品一区二区三区 | 欧美专区亚洲专区| 亚洲在线播放电影| 亚洲天堂网在线观看| 亚洲日本欧美在线| 亚洲国产成人精品女人久久久| 久久久综合香蕉尹人综合网| 欧美与黑人午夜性猛交久久久| 亚洲少妇一区| 一本久道久久久| 日韩视频免费观看| 亚洲精品视频啊美女在线直播| 在线观看一区视频| 亚洲丰满在线| 91久久久久久| 亚洲美女在线观看| 一本色道久久| 亚洲午夜视频在线| 亚洲伊人一本大道中文字幕| 亚洲视频在线观看网站| 亚洲午夜久久久| 亚洲综合色视频| 午夜欧美不卡精品aaaaa| 欧美一区二区三区精品| 久久都是精品| 免费日韩av片| 亚洲国产免费| 亚洲最快最全在线视频| 国产精品99久久久久久白浆小说| 一本久道久久综合婷婷鲸鱼| 亚洲午夜一区| 欧美在线视频一区| 老司机67194精品线观看| 欧美成人蜜桃| 国产精品theporn| 国产在线精品自拍| 在线看视频不卡| 日韩一级成人av| 亚洲欧美日韩精品一区二区| 久久久97精品| 亚洲国产精品成人精品| 99国产精品久久久久老师| 中文国产亚洲喷潮| 久久精品主播| 欧美日韩国产bt| 国产一区二区精品久久99| 亚洲国产一区在线| 先锋影音国产一区| 欧美成人国产一区二区 | 欧美一区二区三区视频在线观看| 久久青草福利网站| 日韩午夜免费视频| 久久精品国产第一区二区三区最新章节| 久久综合国产精品| 国产精品国产三级国产aⅴ无密码| 海角社区69精品视频| 99这里只有精品| 久久久久久婷| 日韩一区二区精品| 久久久综合网站| 国产精品日本精品| 99国产精品久久久久久久久久| 久久精品亚洲热| 99国产精品私拍| 久久免费视频这里只有精品| 国产精品久久国产愉拍| 亚洲国产日韩欧美在线动漫| 久久成人精品视频| 99ri日韩精品视频| 母乳一区在线观看| 国内精品美女在线观看| 亚洲免费在线看| 亚洲精品一区二| 欧美高清在线|