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

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

搜索

  •  

積分與排名

  • 積分 - 1817663
  • 排名 - 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>
              国产精品亚洲一区二区三区在线| 欧美日韩视频一区二区| 伊人成人在线视频| 欧美大片在线观看一区| 免费中文字幕日韩欧美| 亚洲精品护士| 一区二区激情视频| 国产婷婷色一区二区三区四区 | 一区二区三区视频在线播放| 亚洲一区二区三区视频| 亚洲国产小视频在线观看| 亚洲午夜高清视频| 在线高清一区| 亚洲欧美在线高清| 99在线|亚洲一区二区| 久久久噜噜噜久久中文字免| 亚洲线精品一区二区三区八戒| 久久久免费观看视频| 欧美亚洲视频在线观看| 欧美高清不卡在线| 欧美aⅴ99久久黑人专区| 国产精品久久久久久久久免费 | 黄色成人在线| 欧美自拍丝袜亚洲| 欧美中文字幕不卡| 欧美三级电影一区| 亚洲精品小视频在线观看| 最新日韩精品| 欧美精品入口| 亚洲自拍偷拍色片视频| 亚洲香蕉伊综合在人在线视看| 欧美激情va永久在线播放| 久久一区二区精品| 亚洲欧洲精品一区二区| 欧美日本二区| 亚洲永久在线观看| 久久国内精品视频| 亚洲国产日韩美| 欧美日韩国产综合在线| 亚洲调教视频在线观看| 鲁大师影院一区二区三区| 在线观看欧美亚洲| 欧美黄污视频| 欧美在线www| 亚洲靠逼com| 免费久久久一本精品久久区| 在线综合+亚洲+欧美中文字幕| 欧美日韩一区在线| 欧美α欧美αv大片| 亚洲一区视频| 亚洲第一福利视频| 亚洲欧洲另类国产综合| 国产精品久久综合| 欧美啪啪成人vr| 久久久久免费观看| 欧美亚洲一区在线| 亚洲欧美日韩综合aⅴ视频| 亚洲高清在线| 欧美99在线视频观看| 久久免费黄色| 性色av一区二区三区| 一本色道久久综合亚洲精品不 | 国产日韩欧美成人| 欧美日韩精品二区第二页| 久久久亚洲国产天美传媒修理工| 亚洲女ⅴideoshd黑人| 亚洲最新色图| 亚洲视频在线视频| 日韩视频一区二区在线观看| 亚洲激情av| 亚洲色图自拍| 亚洲尤物影院| 久久精品女人的天堂av| 久久久久久久久久久久久9999| 久久成人资源| 欧美激情第3页| 国产精品美女久久久免费| 国产欧美一区二区精品忘忧草| 欧美视频二区36p| 国产午夜精品一区理论片飘花 | 欧美日韩在线播放三区四区| 欧美日韩一级大片网址| 国产日韩欧美中文| 日韩视频精品在线| 欧美一区二区三区在线免费观看| 久久国产精品久久久| 欧美日韩精品在线视频| 国产精品资源| 一本色道久久88精品综合| 欧美亚洲专区| 亚洲人成毛片在线播放| 欧美在线视频网站| 国产精品www网站| 91久久综合| 免费av成人在线| 欧美综合国产| 国产精品久久久久久av福利软件| 在线播放国产一区中文字幕剧情欧美| 亚洲一区二区三区四区五区黄| 欧美成人在线免费视频| 久久精品官网| 国产一区二区三区在线观看免费视频| 一区二区成人精品 | 欧美xxx在线观看| 亚洲巨乳在线| 亚洲精品久久久久久下一站 | 欧美一区二区视频网站| 中文一区二区| 国产精品看片你懂得| 欧美一区二区三区免费观看视频| 亚洲精品在线看| 欧美精品在线极品| 亚洲一二三区在线观看| 日韩视频一区二区三区在线播放| 欧美日韩国产三级| 欧美一区激情| 欧美gay视频激情| 亚洲影院免费观看| 久久久久久九九九九| 99精品福利视频| 亚洲综合久久久久| 一区二区三区在线看| 亚洲精品一区二| 国产欧美日韩中文字幕在线| 欧美激情在线有限公司| 国产精品国产三级国产普通话99| 欧美一级理论性理论a| 久久久久免费视频| 亚洲一区二区成人| 久久嫩草精品久久久久| 亚洲一品av免费观看| 久久久久综合网| 久久国产99| 国产精品日韩在线一区| 亚洲韩国日本中文字幕| 国产亚洲视频在线| 亚洲午夜国产成人av电影男同| 在线观看欧美日本| 亚洲欧美中文日韩在线| 亚洲日本理论电影| 久久精品在线视频| 羞羞漫画18久久大片| 欧美日韩a区| 欧美激情在线免费观看| 在线观看视频亚洲| 久久av老司机精品网站导航| 久久国产精品一区二区三区四区| 国产精品福利在线观看| 一区二区三区偷拍| 亚洲欧美电影在线观看| 国产精品盗摄久久久| 亚洲永久在线| 免费日韩成人| 一区电影在线观看| 国产精品激情| 久久精品二区三区| 亚洲欧洲在线看| 午夜精品国产更新| 在线日韩电影| 久久综合伊人| 午夜久久久久| 亚洲精品1区2区| 久久精品久久综合| 亚洲激情二区| 国产亚洲精品福利| 欧美精品亚洲精品| 久久亚洲欧洲| 一区二区三区精品视频在线观看| 久久免费视频网站| 99精品欧美一区二区蜜桃免费| 国产精品久久久久久妇女6080| 久久精品99无色码中文字幕| 亚洲精品中文字幕女同| 男男成人高潮片免费网站| 亚洲免费视频在线观看| 国产综合在线看| 欧美日韩国产影院| 噜噜噜噜噜久久久久久91| 欧美影视一区| 午夜在线精品| 午夜精品短视频| 香蕉久久夜色| 性8sex亚洲区入口| 小嫩嫩精品导航| 亚洲视屏在线播放| 午夜精品久久久久久久蜜桃app | 久久av红桃一区二区小说| 亚洲天堂av高清| 亚洲在线观看免费| 欧美一区国产一区| 久久成人一区| 另类综合日韩欧美亚洲| 欧美激情一区二区三区高清视频| 欧美 日韩 国产在线 | 久久久精品动漫| 另类春色校园亚洲| 亚洲国产精品久久人人爱蜜臀| 91久久精品网| 亚洲欧美日本精品| 久久综合网hezyo|