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

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

搜索

  •  

積分與排名

  • 積分 - 1811733
  • 排名 - 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无色码中文字幕| 亚洲欧美日本日韩| 欧美福利视频| 99精品国产在热久久下载| 亚洲精品乱码久久久久久按摩观| 欧美顶级艳妇交换群宴| 日韩亚洲欧美成人| 亚洲网址在线| 国模精品娜娜一二三区| 美女精品在线观看| 欧美日韩少妇| 久久久久在线| 欧美人与性动交α欧美精品济南到| 亚洲视频一区| 久久精品在线| 亚洲午夜性刺激影院| 亚洲欧美日韩精品久久亚洲区| 黑人巨大精品欧美一区二区小视频| 女同性一区二区三区人了人一| 欧美精品亚洲二区| 久久精品一二三区| 欧美日韩国产综合新一区| 久久久国产精彩视频美女艺术照福利 | 亚洲剧情一区二区| 在线亚洲伦理| 亚洲精品美女免费| 亚洲一区二区三区免费在线观看 | 影音先锋亚洲一区| 一本一本久久a久久精品综合妖精 一本一本久久a久久精品综合麻豆 | 亚洲午夜视频在线| 久久只精品国产| 欧美在线观看网址综合| 欧美大片在线观看| 久久亚洲色图| 国产精品综合色区在线观看| 亚洲国产精品小视频| 国产真实久久| 亚洲欧美国产高清| 在线视频日韩精品| 麻豆av一区二区三区久久| 久久国产色av| 国产精品一级久久久| 亚洲国产三级| 最新亚洲激情| 久久久久国色av免费看影院| 性做久久久久久| 欧美色播在线播放| 亚洲日本在线观看| 91久久久亚洲精品| 免费观看成人| 欧美激情1区| 在线播放国产一区中文字幕剧情欧美| 亚洲欧美成人一区二区在线电影| 亚洲性av在线| 国产精品大全| 宅男噜噜噜66一区二区| 亚洲一区二区高清| 欧美四级电影网站| 99国内精品久久久久久久软件| 99ri日韩精品视频| 欧美激情1区2区3区| 亚洲激情综合| 一个色综合av| 国产精品久久久久9999高清| 99在线精品视频在线观看| 亚洲一区二区动漫| 国产精品免费看片| 性欧美video另类hd性玩具| 欧美在线亚洲一区| 精品电影在线观看| 老司机午夜免费精品视频 | 欧美在线首页| 亚洲电影视频在线| 麻豆国产va免费精品高清在线| 欧美成人亚洲| 一区二区三区国产| 国产精品美女午夜av| 欧美一区二区三区四区夜夜大片| 久久精品国产免费观看| 在线观看一区二区视频| 欧美成人免费大片| 一区二区三区四区五区精品视频| 亚洲免费影视| 狠狠综合久久| 欧美日韩ab片| 欧美一区二区三区播放老司机| 久久影音先锋| 亚洲视频在线观看免费| 国产日韩欧美三级| 欧美成年人网站| 亚洲图片在线| 欧美高清在线视频| 亚洲一区二区免费看| 国内精品免费午夜毛片| 欧美激情亚洲激情| 欧美一区二区三区免费看| 欧美国产精品va在线观看| 亚洲综合精品| 亚洲国产精品va在线观看黑人| 欧美视频精品一区| 久久婷婷国产综合尤物精品| 一本久久青青| 欧美va亚洲va香蕉在线| 午夜精品久久久久久久久久久| 在线观看成人一级片| 国产精品乱人伦中文| 国产精品区一区| 国产精品一区二区三区久久久| 午夜精品福利在线| 亚洲肉体裸体xxxx137| 久久成人国产| 亚洲午夜激情网页| 91久久精品国产| 国产一区二区三区四区在线观看 | 在线日韩av片| 国产欧美韩国高清| 欧美日本成人| 免费欧美电影| 久久蜜桃精品| 亚洲欧美精品在线| 中日韩美女免费视频网站在线观看| 嫩模写真一区二区三区三州| 久久精品91久久久久久再现| 亚洲手机视频| 亚洲视频第一页| 亚洲免费观看| 亚洲精品在线视频| 亚洲国产乱码最新视频| 在线观看亚洲精品| 在线观看精品一区| 狠狠色狠狠色综合| 国模 一区 二区 三区| 国产精品免费小视频| 国产精品激情av在线播放| 欧美日韩国产色站一区二区三区| 欧美高清在线一区二区| 欧美~级网站不卡| 欧美高清视频一区二区| 久久一区亚洲| 欧美成人情趣视频| 欧美jizzhd精品欧美喷水| 开元免费观看欧美电视剧网站| 久久久视频精品| 米奇777超碰欧美日韩亚洲| 蜜臀av一级做a爰片久久| 欧美成人精品一区二区三区| 欧美精品一区二区三区四区| 欧美—级在线免费片| 欧美三级黄美女| 国产精品狠色婷| 国产亚洲激情视频在线| 国语自产精品视频在线看一大j8 | 中文一区在线| 亚洲嫩草精品久久| 香港久久久电影| 久久精品一二三区| 久热国产精品视频| 欧美国产日本高清在线| 亚洲欧洲三级电影| 亚洲香蕉在线观看| 久久精品免费| 欧美激情在线免费观看| 国产精品成人国产乱一区| 国产日韩精品久久| 在线免费精品视频| 亚洲最新在线视频| 久久国产精品99久久久久久老狼| 免费视频一区| 一本在线高清不卡dvd| 欧美一二三区在线观看| 免费在线看成人av| 国产精品久久久久久久久久尿 | 欧美电影免费| 这里只有精品电影| 久久久久久久国产| 欧美日韩亚洲国产精品| 国产一区亚洲| 一本色道久久综合亚洲精品小说 | 日韩一级精品| 久久久午夜电影| 日韩亚洲欧美中文三级| 久久精品论坛| 国产精品卡一卡二| 亚洲激情不卡| 久久久久久久999| 中文精品视频一区二区在线观看| 久久久久九九九九| 国产精品久久久久久久9999| 亚洲国产一区二区三区高清 | 亚洲一区二区视频| 麻豆久久婷婷| 欧美一区2区视频在线观看| 欧美日韩国产一区二区三区| 影音先锋日韩有码| 欧美伊人久久大香线蕉综合69| 最新日韩中文字幕| 久久综合激情| 永久免费精品影视网站| 香蕉精品999视频一区二区 | 亚洲精品一区中文|