锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久免费黄色,亚洲二区免费,一色屋精品视频在线观看网站http://www.shnenglu.com/lauer3912/category/17748.html娌℃湁鐞嗙敱涓嶅涔?/description>zh-cnSat, 19 Jul 2014 15:01:43 GMTSat, 19 Jul 2014 15:01:43 GMT60Google Breakpad 瀹屽叏瑙f瀽錛堜簩錛?鈥斺?Windows鍓嶅彴瀹炵幇綃?/title><link>http://www.shnenglu.com/lauer3912/archive/2011/11/07/159785.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Mon, 07 Nov 2011 13:36:00 GMT</pubDate><guid>http://www.shnenglu.com/lauer3912/archive/2011/11/07/159785.html</guid><wfw:comment>http://www.shnenglu.com/lauer3912/comments/159785.html</wfw:comment><comments>http://www.shnenglu.com/lauer3912/archive/2011/11/07/159785.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/lauer3912/comments/commentRss/159785.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/lauer3912/services/trackbacks/159785.html</trackback:ping><description><![CDATA[<div><h2>Google Breakpad 瀹屽叏瑙f瀽錛堜簩錛?—— Windows鍓嶅彴瀹炵幇綃?/h2> 2011騫?2鏈?鏃?— Asp J <div><h3>Table of contents for Google Breakpad 瀹屽叏瑙f瀽</h3><ol><li><a title="Google Breakpad 瀹屽叏瑙f瀽錛堜竴錛?—— Windows鍏ラ棬綃?>Google Breakpad 瀹屽叏瑙f瀽錛堜竴錛?—— Windows鍏ラ棬綃?/a></li><li>Google Breakpad 瀹屽叏瑙f瀽錛堜簩錛?—— Windows鍓嶅彴瀹炵幇綃?/li></ol></div> <p>鍘熷垱鏂囩珷錛岃漿杞借鏍囨槑鍑哄錛歋oul Apogee (<a target="_blank">http://bigasp.com</a>)錛岃阿璋€?/p> <p>濂斤紝鐪嬪畬浜?a target="_blank">濡備綍浣跨敤breakpad</a>錛屾垜浠幇鍦ㄧ湅鐪媌reakpad鍦╓indows涓嬪埌搴曟槸濡備綍瀹炵幇鐨勫憿錛?/p> <h3><strong>浠g爜緇撴瀯</strong></h3> <p>鍦ㄦ垜浠潵鐪媌reakpad鏄浣曞疄鐜板叾寮哄ぇ鐨勫姛鑳戒箣鍓嶏紝鎴戜滑鍏堟潵鐪嬩竴涓嬩粬鐨勪唬鐮佺粨鏋勫惂銆?/p> <p>Google breakpad鐨勬簮浠g爜閮藉湪src鐨勭洰褰曚笅錛屼粬鍒嗕負濡備笅鍑犱釜鏂囦歡澶癸細<br /> client錛氳繖涓嬮潰鍖呭惈浜嗗墠鍙板簲鐢ㄧ▼搴忎腑鎹曟崏dump鐨勯儴鍒嗕唬鐮侊紝閲岄潰鎸夌収騫沖彴鍒嗘垚鍚勪釜瀛愭枃浠跺す<br /> common錛氬墠鍙板悗鍙伴兘浼氱敤鍒扮殑閮ㄥ垎鍩虹浠g爜錛屽瓧絎︿覆杞崲錛屽唴瀛樿鍐欙紝md5紲為┈鐨?br /> google_breakpad錛歜reakpad涓叕鍏辯殑澶存枃浠?br /> processor錛氱敤浜庡湪鍚庡彴澶勭悊宕╂簝鐨勬牳蹇冧唬鐮?br /> testing錛氭祴璇曞伐紼?br /> third_party錛氱涓夋柟搴?br /> tools錛氫竴浜涘皬宸ュ叿錛岀敤浜庡鐞哾ump鏂囦歡鍜岀鍙瘋〃</p> <p>鎴戜滑鍏堟潵鐪媁indows涓嬪墠鍙板疄鐜扮殑閮ㄥ垎錛屼篃灝辨槸client鏂囦歡澶逛笅鐨勪唬鐮併?/p> <h3><strong>breakpad鐨勫穿婧冩崟鑾鋒満鍒?/strong></h3> <p>鍦╓indows涓嬫崟鑾峰穿婧冿紝澶у寰堝鏄撲細鎯沖埌閭d釜鎹曡幏緇撴瀯鍖栧紓甯哥殑Api錛?a target="blank" >SetUnhandledExceptionFilter</a>銆?/p> <p>breakpad涓篃浣跨敤浜嗚繖涓狝pi鏉ュ疄鐜扮殑宕╂簝鎹曡幏錛屽彟澶栵紝breakpad榪樻崟鑾蜂簡鍙﹀涓ょC++榪愯搴撴彁渚涚殑宕╂簝錛屼竴縐嶆槸浣跨敤<a target="blank" >_set_purecall_handler</a>鎹曡幏綰櫄鍑芥暟璋冪敤浜х敓鐨勫穿婧冿紝榪樻湁涓縐嶆槸浣跨敤<a target="blank" >_set_invalid_parameter_handler</a>鎹曡幏閿欒鐨勫弬鏁拌皟鐢ㄤ駭鐢熺殑宕╂簝銆?/p> <div><div class="hvzpftn" id="highlighter_32943" cpp"=""><div><a command_help="" help"="">?</a></div><table cellpadding="0" cellspacing="0" border="0"><tbody><tr><td><div number1="" index0="" alt2"="">1</div><div number2="" index1="" alt1"="">2</div><div number3="" index2="" alt2"="">3</div><div number4="" index3="" alt1"="">4</div><div number5="" index4="" alt2"="">5</div><div number6="" index5="" alt1"="">6</div><div number7="" index6="" alt2"="">7</div><div number8="" index7="" alt1"="">8</div><div number9="" index8="" alt2"="">9</div><div number10="" index9="" alt1"="">10</div></td><td><div><div number1="" index0="" alt2"=""><code spaces"="">    </code><code keyword="" bold"="">if</code> <code plain"="">(handler_types & HANDLER_EXCEPTION)</code></div><div number2="" index1="" alt1"=""><code spaces"="">      </code><code plain"="">previous_filter_ = SetUnhandledExceptionFilter(HandleException);</code></div><div number3="" index2="" alt2"=""> </div><div number4="" index3="" alt1"=""><code preprocessor"="">#if _MSC_VER >= 1400  // MSVC 2005/8</code></div><div number5="" index4="" alt2"=""><code spaces"="">    </code><code keyword="" bold"="">if</code> <code plain"="">(handler_types & HANDLER_INVALID_PARAMETER)</code></div><div number6="" index5="" alt1"=""><code spaces"="">      </code><code plain"="">previous_iph_ = _set_invalid_parameter_handler(HandleInvalidParameter);</code></div><div number7="" index6="" alt2"=""><code preprocessor"="">#endif  // _MSC_VER >= 1400</code></div><div number8="" index7="" alt1"=""> </div><div number9="" index8="" alt2"=""><code spaces"="">    </code><code keyword="" bold"="">if</code> <code plain"="">(handler_types & HANDLER_PURECALL)</code></div><div number10="" index9="" alt1"=""><code spaces"="">      </code><code plain"="">previous_pch_ = _set_purecall_handler(HandlePureVirtualCall);</code></div></div></td></tr></tbody></table></div></div> <p>鍙﹀鐢變簬C++榪愯搴撴彁渚涚殑宕╂簝鍥炶皟涓紝騫朵笉浼氭彁渚涘綋鍓嶇殑綰跨▼鐜板満鍜屽穿婧冧俊鎭紝鎵浠reakpad浼氳嚜宸辯敓鎴愬ソ榪欎簺淇℃伅錛岀劧鍚庤姹傜敓鎴恉ump銆?br /> 榪欓噷鍊煎緱涓璇寸殑鏄紝鍦ㄩ潪寮傚父宕╂簝澶勭悊涓紝breakpad鑾峰彇綰跨▼鐜板満浣跨敤鐨勫嚱鏁版槸RtlCaptureContext鑰屼笉鏄疓etThreadContext銆?br /> RtlCaptureContext鍙兘鎹曡幏褰撳墠綰跨▼鐨勭幇鍦猴紝鑰孏etThreadContext鍙互鎹曡幏浠繪剰綰跨▼鐨勭幇鍦猴紝鍙鏈夎繖涓嚎紼嬬殑鍙ユ焺鍗沖彲銆?br /> 浣嗘槸GetThreadContext鏈変袱涓笉濂界殑鍦版柟錛氫笉鑳借幏鍙栧綋鍓嶇嚎紼嬬殑鐜板満錛涜幏鍙栫幇鍦哄墠蹇呴』鍏堢敤SuspendThread鏆傚仠鐩爣綰跨▼銆?br /> 鑰孯tlCaptureContext铏界劧鍙兘鑾峰彇褰撳墠綰跨▼鐨勭幇鍦猴紝浣嗘槸璋冪敤浠栨椂鍙互涓嶇敤鏆傚仠綰跨▼鐨勮繍琛屻?br /> 瀵逛簬breakpad鏉ヨ錛屽穿婧冨彂鐢熷悗瓚婃棭鑾峰彇鐜板満灝辮秺濂斤紝鎵浠reakpad浣跨敤RtlCaptureContext鍑芥暟浣滀負浠栫殑綰跨▼鑾峰彇鍑芥暟銆?/p> <h3><strong>breakpad涓殑C/S緇撴瀯</strong></h3> <p>鐢變簬breakpad鏄湪榪涚▼澶栨姄鍙杁ump錛屾墍浠reakpad闇瑕佸疄鐜頒竴涓狢/S緇撴瀯鏉ュ鐞嗗穿婧冭繘紼嬫姄鍙杁ump鐨勮姹傘?/p> <p><strong>1. breakpad璺ㄨ繘紼嬮氫俊鐨勫疄鐜?br /> </strong>breakpad涓嬌鐢ㄤ簡鍛藉悕綆¢亾鏉ュ疄鐜癐PC銆?/p> <p>鍦ㄥ鎴風錛屽垵濮嬪寲ExceptionHandler鐨勬椂鍊欙紝濡傛灉鎸囧畾浜哖ipeName錛屼篃灝辮〃紺烘鏃墮渶瑕佷嬌鐢ㄨ繘紼嬪鐨刣ump鎶?鍙栵紝ExceptionHandler錛屼細寤虹珛涓涓?nbsp;CrashGenerationClient鐨勫璞★紝鐢辮繖涓璞¤繛鎺ユ湇鍔$錛屽皢鑷繁娉ㄥ唽鍒版湇鍔$涓?鍘匯?br /> 澶у鍙互鍙傜湅exception_handler.cc涓殑ExceptionHandler::Initialize鍑芥暟銆?/p> <p>鍦ㄦ湇鍔$錛屽垵濮嬪寲CrashGenerationServer鐨勬椂鍊欙紝灝變細寤虹珛涓涓懡鍚嶇閬擄紝騫剁瓑寰呭鎴風鏉ヨ繛鎺ャ備竴鏃︽湁瀹㈡埛绔繛鎺ヤ笂鏉ワ紝鏈嶅姟绔細 涓烘瘡涓涓鎴風鐢熸垚涓涓狢lientInfo鐨勫璞★紝涔嬪悗鐢ㄨ繖涓璞℃潵綆$悊鎵鏈夌殑瀹㈡埛绔紝涓鏃︽湁宕╂簝鍙戠敓錛屾湇鍔$閮戒細浠庤繖涓璞′腑鍙栧嚭dump鎵闇瑕佺殑淇?鎭?br /> 澶у鍙互鍙傜湅crash_generation_server.cc涓殑CrashGenerationServer::HandleReadDoneState鍑芥暟銆?/p> <p><strong>2. breakpad鎹曡幏宕╂簝鐢熸垚dump鐨勬祦紼?br /> </strong>breakpad榪涚▼澶栫敓鎴恉ump鐨勬祦紼嬪ぇ姒傚涓嬶細<br /> <strong>google-breakpad-out-of-process-dump:</strong><br /><a target="_blank"><img src="http://bigasp.com/wp-content/uploads/downloads/thumbnails/2011/02/google-breakpad-out-of-process-dump.jpg" alt="google-breakpad-out-of-process-dump" style="max-width:500px;" /></a><br /> 榪欐嫻佺▼鐨勪唬鐮佸氨鏄痗rash_generation_client.cc鍜宑rash_generation_server.cc銆?/p> <p>鏈変袱涓畝鍗曠殑闂錛岃繖閲岃鏄庝竴涓嬶紝楂樻墜浠氨璇風洿鎺ュ拷鐣ュ惂錛屽挬鍝堝搱錛?br /> <strong>鍦ㄦ湇鍔$濡備綍涓哄鎴風鐢熸垚浜嬩歡鍙ユ焺錛?/strong><br /> 浣跨敤DuplicateHandle錛屽嵆鍙妸浠繪剰涓涓唴鏍稿璞$殑鍙ユ焺澶嶅埗鍒板叾浠栬繘紼嬶紝騫朵笖鍙互鎸囧畾浜х敓鐨勫彞鏌勭殑鏉冮檺銆?/p> <p><strong>濡備綍寮傛鐨勭瓑寰呬竴涓簨浠訛紵<br /> </strong>浣跨敤RegisterWaitForSingleObject錛屽嵆鍙紓姝ョ殑絳夊緟涓涓簨浠訛紝褰撲簨浠跺彂鐢熺殑鏃跺欙紝灝卞彲浠ュ洖璋冨埌涓涓寚瀹氱殑鍥?璋冨嚱鏁頒腑錛屼絾鏄娉ㄦ剰鐨勬槸錛孯egisterWaitForSingleObject浼氬湪涓涓柊鐨勭嚎紼嬩腑鏉ョ瓑寰呰繖涓簨浠訛紝姝ゅ寰堝鏄撲駭鐢熷綰跨▼鐨勮皟鐢紝闇 瑕佹敞鎰忕嚎紼嬮棶棰樸?/p> <p><strong>3. 鏈嶅姟绔叧閿暟鎹粨鏋勶細ClientInfo<br /> </strong>ClientInfo鏄湇鍔$涓渶閲嶈鐨勬暟鎹粨鏋勶紝鏈嶅姟绔氳繃瀹冩潵綆$悊鎵鏈夌殑瀹㈡埛绔傚鎴風娉ㄥ唽鏃訛紝浼氫繚瀛樻垨鐢熸垚閲岄潰鎵鏈夌殑淇℃伅錛屽湪瀹㈡埛绔姹傜敓鎴恉ump鐨勬椂鍊欙紝鏈嶅姟绔氨浼氶氳繃ClientInfo鑾峰彇鎵鏈夊鎴風鐨勪俊鎭侰lientInfo涓繚瀛樹簡濡備笅淇℃伅錛?/p> <ul><li>瀹㈡埛绔繘紼媝id鍜屽彞鏌?/li><li>鐢熸垚Minidump鐨勭被鍨?/li><li>鑷畾涔夌殑瀹㈡埛绔俊鎭?/li><li>瀹㈡埛绔穿婧冪殑綰跨▼ID</li><li>瀹㈡埛绔穿婧冪殑淇℃伅</li><li>瀹㈡埛绔姹傚穿婧冩墍浣跨敤鐨勪簨浠跺彞鏌?/li></ul> <p>榪欓噷鏈変竴涓棶棰橈細鍦ㄥ鎴風鍙戠敓宕╂簝鏃訛紝鏈嶅姟鍣ㄥ浣曢氳繃ClientInfo鑾峰彇鍒板鎴風鐨勫穿婧冧俊鎭憿錛?/p> <p>瀹㈡埛绔腑鏈夊嚑涓敤浜庝繚瀛樺穿婧冧俊鎭殑鍙橀噺錛屽湪娉ㄥ唽鏃訛紝瀹㈡埛绔細灝嗚繖鍑犱釜鍙橀噺鐨勫湴鍧鍙戦佽嚦鏈嶅姟绔紝鏈嶅姟绔皢鍏朵繚瀛樺湪ClientInfo涓紝鐒跺悗褰撳穿婧?鍙戠敓鐨勬椂鍊欙紝鏈嶅姟绔氨鍙互閫氳繃ReadProcessMemory璇誨彇瀹㈡埛绔腑鐨勪俊鎭紝浠庤岀敓鎴恉ump銆傝繖鏍峰仛灝遍伩鍏嶄簡姣忔鍙戠敓宕╂簝錛岄兘瑕侀氳繃Pipe 灝嗗穿婧冧俊鎭紶閫掑埌鏈嶅姟绔腑鍘諱簡銆?/p> <p>榪欎簺鍙橀噺鍒嗗埆鏄細宕╂簝鐨勭嚎紼婭D錛孍XCEPTION_POINTERS鍜孧DRawAssertionInfo銆?br /> EXCEPTION_POINTERS鍜孧DRawAssertionInfo鐨勫尯鍒湪浜庯紝寮傚父宕╂簝鐨勪俊鎭細琚啓鍏XCEPTION_POINTERS錛岄潪寮傚父宕╂簝錛堥潪娉曞弬鏁板拰綰櫄鍑芥暟璋冪敤錛夌殑淇℃伅浼氳鍐欏叆MDRawAssertionInfo涓?/p> <h3><strong>dump鏂囦歡鐨勪笂浼?/strong></h3> <p>鍦╞reakpad鐨勫伐紼嬩腑錛屾湁涓涓伐紼嬪彨鍋氾細crash_report_sender錛岄噷闈㈡槸涓涓笂浼犲穿婧冩枃浠剁殑綾伙紝浠栫殑瀹炵幇寰堢畝鍗曪紝浠栦嬌鐢╓indows Internet Api鏉ュ畬鎴恉ump鏂囦歡鐨勪笂浼犮?br /> 鍦ㄤ嬌鐢╟rash_report_sender鏃訛紝鍙互涓哄叾鎸囧畾涓涓猚heckpoint_file銆?/p> <div><div class="hvzpftn" id="highlighter_216810" cpp"=""><div><a command_help="" help"="">?</a></div><table cellpadding="0" cellspacing="0" border="0"><tbody><tr><td><div number1="" index0="" alt2"="">1</div></td><td><div><div number1="" index0="" alt2"=""><code keyword="" bold"="">explicit</code> <code plain"="">CrashReportSender(</code><code keyword="" bold"="">const</code> <code plain"="">wstring &checkpoint_file);</code></div></div></td></tr></tbody></table></div></div> <p>榪欎釜鏂囦歡鍙湁涓涓綔鐢紝灝辨槸鐢ㄦ潵淇濆瓨涓婃涓婁紶宕╂簝鐨勬椂闂村拰浠婂ぉ涓婁紶榪囩殑宕╂簝鐨勬鏁般傞氳繃榪欎釜鏂囦歡錛屾垜浠氨鍙互鏉ヨ緗瘡鏃ヤ笂浼犵殑宕╂簝鐨勬渶澶ф暟閲忋?/p> <div><div class="hvzpftn" id="highlighter_535960" cpp"=""><div><a command_help="" help"="">?</a></div><table cellpadding="0" cellspacing="0" border="0"><tbody><tr><td><div number1="" index0="" alt2"="">1</div><div number2="" index1="" alt1"="">2</div><div number3="" index2="" alt2"="">3</div><div number4="" index3="" alt1"="">4</div><div number5="" index4="" alt2"="">5</div><div number6="" index5="" alt1"="">6</div><div number7="" index6="" alt2"="">7</div><div number8="" index7="" alt1"="">8</div><div number9="" index8="" alt2"="">9</div><div number10="" index9="" alt1"="">10</div><div number11="" index10="" alt2"="">11</div><div number12="" index11="" alt1"="">12</div><div number13="" index12="" alt2"="">13</div><div number14="" index13="" alt1"="">14</div><div number15="" index14="" alt2"="">15</div><div number16="" index15="" alt1"="">16</div><div number17="" index16="" alt2"="">17</div><div number18="" index17="" alt1"="">18</div><div number19="" index18="" alt2"="">19</div><div number20="" index19="" alt1"="">20</div><div number21="" index20="" alt2"="">21</div><div number22="" index21="" alt1"="">22</div><div number23="" index22="" alt2"="">23</div><div number24="" index23="" alt1"="">24</div></td><td><div><div number1="" index0="" alt2"=""><code plain"="">CrashReportSender::CrashReportSender(</code><code keyword="" bold"="">const</code> <code plain"="">wstring &checkpoint_file)</code></div><div number2="" index1="" alt1"=""><code spaces"="">    </code><code plain"="">: checkpoint_file_(checkpoint_file),</code></div><div number3="" index2="" alt2"=""><code spaces"="">      </code><code plain"="">max_reports_per_day_(-1),</code></div><div number4="" index3="" alt1"=""><code spaces"="">      </code><code plain"="">last_sent_date_(-1),</code></div><div number5="" index4="" alt2"=""><code spaces"="">      </code><code plain"="">reports_sent_(0) {</code></div><div number6="" index5="" alt1"=""><code spaces"="">  </code><code color1="" bold"="">FILE</code> <code plain"="">*fd;</code></div><div number7="" index6="" alt2"=""><code spaces"="">  </code><code keyword="" bold"="">if</code> <code plain"="">(OpenCheckpointFile(L</code><code string"="">"r"</code><code plain"="">, &fd) == 0) {</code></div><div number8="" index7="" alt1"=""><code spaces"="">    </code><code plain"="">ReadCheckpoint(fd);</code></div><div number9="" index8="" alt2"=""><code spaces"="">    </code><code functions="" bold"="">fclose</code><code plain"="">(fd);</code></div><div number10="" index9="" alt1"=""><code spaces"="">  </code><code plain"="">}</code></div><div number11="" index10="" alt2"=""><code plain"="">}</code></div><div number12="" index11="" alt1"=""> </div><div number13="" index12="" alt2"=""><code plain"="">ReportResult CrashReportSender::SendCrashReport(</code></div><div number14="" index13="" alt1"=""><code spaces"="">    </code><code keyword="" bold"="">const</code> <code plain"="">wstring &url, </code><code keyword="" bold"="">const</code> <code plain"="">map<wstring, wstring> &parameters,</code></div><div number15="" index14="" alt2"=""><code spaces"="">    </code><code keyword="" bold"="">const</code> <code plain"="">wstring &dump_file_name, wstring *report_code) {</code></div><div number16="" index15="" alt1"=""><code spaces"="">  </code><code color1="" bold"="">int</code> <code plain"="">today = GetCurrentDate();</code></div><div number17="" index16="" alt2"=""><code spaces"="">  </code><code keyword="" bold"="">if</code> <code plain"="">(today == last_sent_date_ &&</code></div><div number18="" index17="" alt1"=""><code spaces"="">      </code><code plain"="">max_reports_per_day_ != -1 &&</code></div><div number19="" index18="" alt2"=""><code spaces"="">      </code><code plain"="">reports_sent_ >= max_reports_per_day_) {</code></div><div number20="" index19="" alt1"=""><code spaces"="">    </code><code keyword="" bold"="">return</code> <code plain"="">RESULT_THROTTLED;</code></div><div number21="" index20="" alt2"=""><code spaces"="">  </code><code plain"="">}</code></div><div number22="" index21="" alt1"=""> </div><div number23="" index22="" alt2"=""><code spaces"="">  </code><code comments"="">// 涓婁紶鏂囦歡閮ㄥ垎浠g爜錛岀渷鐣?/code></div><div number24="" index23="" alt1"=""><code plain"="">}</code></div></div></td></tr></tbody></table></div></div> <p>璋冩暣姣忔棩涓婁紶宕╂簝鐨勬渶澶ф暟閲忕殑鍑芥暟鏄痵et_max_reports_per_day銆?/p> <p>闇瑕佹敞鎰忕殑鏄細鍦ㄤ笂浼燿ump鏂囦歡鐨勬椂鍊欙紝crash_report_sender騫朵笉浼氬dump鏂囦歡榪涜鍒嗘瀽錛岃屾槸鐩存帴涓婁紶鏁翠釜dump鏂囦歡錛?濡傛灉浣犻渶瑕佷笂浼犵殑dump鏂囦歡闈炲父澶х殑璇濓紝鍙互鑰冭檻鎶婂穿婧冨垎鏋愬鐞嗙殑閫昏緫鏀懼叆鍓嶅彴錛岄氳繃鍘婚噸鎴栬呯洿鎺ヤ笂浼犲垎鏋愮粨鏋滐紝鍑忓皯涓婁紶鐨勬枃浠跺ぇ灝忋?/p> <h3><strong>breakpad瀛樺湪鐨勯棶棰?/strong></h3> <h3><span style="font-weight: normal; font-size: 13px;">榪涚▼澶栫敓鎴恉ump鏈夊緢澶氬ソ澶勶紝鍏朵腑鏈澶х殑濂藉灝辨槸涓嶄細琚穿婧冭繘紼嬪獎鍝嶏紝榪欐牱dump鐨勮繃紼嬪氨涓嶅鏄撳嚭閿欙紝浣嗘槸榪欐牱涔熸湁涓瀹氱殑寮婄銆?/span></h3> <p><strong>1. 閮ㄥ垎宕╂簝鏃犳硶鎶撳彇<br /> </strong>鍦ㄤ竴浜涙瀬绔殑宕╂簝錛屽鍫嗘爤婧㈠嚭涔嬬被鐨勫穿婧冿紝榪涚▼澶栨姄鍙杁ump鏈夋椂鍊欎細澶辮觸銆?/p> <p><strong>2. 鏃犳硶鎶撳彇姝婚攣鎴栬呭叾浠栧師鍥犲鑷寸殑榪涚▼鍍墊<br /> </strong>breakpad鐜板湪娌℃湁媯嫻嬭繘紼嬫閿佺殑浠g爜錛屼篃娌℃湁鍦ㄦ湇鍔$鎺у埗瀹㈡埛绔姹俤ump鐨勪唬鐮侊紝鎵浠ョ幇鍦╞reakpad鏃犳硶鎶撳彇姝婚攣絳夎繘紼嬪兊姝葷殑闂銆備笉榪囧洜涓篵reakpad鐨勫畾浣嶆槸澶勭悊宕╂簝錛屽鏋滄湁榪欑闇瑕佺殑绔ラ瀷錛屽彲浠ヨ嚜琛屼慨鏀筨reakpad鐨勪唬鐮侊紝娣誨姞榪欎簺鍔熻兘銆?/p> <p><strong>3. 瀵規湇鍔$鏈変緷璧?br /> </strong>濡傛灉鎸囧畾浜嗗湪浣跨敤榪涚▼澶栨姄鍙杁ump錛宐reakpad瀵規湇鍔$灝辨湁渚濊禆銆備富瑕佷綋鐜板湪鎶撳彇dump鏃訛紝濡傛灉鏈嶅姟绔笉瀛樺湪錛屽鎴風灝嗘棤娉曟甯告姄鍙杁ump錛岀敋鑷蟲湁鏃朵細鍑虹幇闃誨銆?/p> <p>褰撶劧瀵逛簬榪欎簺闂錛岄殢鐫breakpad鐨勫彂灞曡偗瀹氫細瓚婃潵瓚婂畬鍠勩傚鏋滐紝浣犻亣鍒頒簡浜嗚繖浜涢棶棰橈紝鑰屽張緇曡繃涓嶄簡錛岄偅灝辨敼浠g爜錛屽茍涓旀彁浜ょ粰breakpad鍚э紝寮婧愰」鐩氨鏄繖涔堝彂灞曠殑銆?/p> <p>濂斤紝鍒版breakpad鐨刉indows瀹炵幇灝卞凡緇忚瀹屼簡錛屽鏋滄湁紲為┈闂錛岃繕璇峰澶氭寚鏁欍傝阿璋㈠ぇ瀹躲?/p><p style="margin-bottom:0pt; margin-top:0pt; "><a ><span style=" color:#0000ff; text-decoration:underline ;font-family:'瀹嬩綋'; ">鍖椾含寰瘋儨闂ㄤ腑鍖婚櫌</span></a><a ><span style=" color:#0000ff; text-decoration:underline ;font-family:'瀹嬩綋'; ">http://www.0531jsk.com/</span></a><span style=" font-size:10.5000pt; font-family:'瀹嬩綋'; ">寰瘋儨闂ㄤ腑鍖婚櫌</span></p></div><img src ="http://www.shnenglu.com/lauer3912/aggbug/159785.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/lauer3912/" target="_blank">RTY</a> 2011-11-07 21:36 <a href="http://www.shnenglu.com/lauer3912/archive/2011/11/07/159785.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Google Breakpad 瀹屽叏瑙f瀽錛堜竴錛?鈥斺?Windows鍏ラ棬綃?/title><link>http://www.shnenglu.com/lauer3912/archive/2011/11/07/159784.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Mon, 07 Nov 2011 13:34:00 GMT</pubDate><guid>http://www.shnenglu.com/lauer3912/archive/2011/11/07/159784.html</guid><wfw:comment>http://www.shnenglu.com/lauer3912/comments/159784.html</wfw:comment><comments>http://www.shnenglu.com/lauer3912/archive/2011/11/07/159784.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/lauer3912/comments/commentRss/159784.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/lauer3912/services/trackbacks/159784.html</trackback:ping><description><![CDATA[<div><h2>Google Breakpad 瀹屽叏瑙f瀽錛堜竴錛?—— Windows鍏ラ棬綃?/h2> 2011騫?1鏈?3鏃?— Asp J <div><h3>Table of contents for Google Breakpad 瀹屽叏瑙f瀽</h3><ol><li>Google Breakpad 瀹屽叏瑙f瀽錛堜竴錛?—— Windows鍏ラ棬綃?/li><li><a title="Google Breakpad 瀹屽叏瑙f瀽錛堜簩錛?—— Windows鍓嶅彴瀹炵幇綃?>Google Breakpad 瀹屽叏瑙f瀽錛堜簩錛?—— Windows鍓嶅彴瀹炵幇綃?/a></li></ol></div> <p>鍘熷垱鏂囩珷錛岃漿杞借鏍囨槑鍑哄錛歋oul Apogee (<a target="_blank">http://bigasp.com</a>)錛岃阿璋€? </p> <p><a title="Google Breakpad" target="_blank">Google breakpad</a>鏄?涓涓潪甯稿疄鐢ㄧ殑璺ㄥ鉤鍙扮殑宕╂簝杞偍鍜屽垎鏋愭ā鍧楋紝浠栨敮鎸乄indows錛孡inux鍜孧ac鍜孲olaris銆傜敱浜庝粬鏈韓璺ㄥ鉤鍙幫紝鎵浠ュ緢澶х殑鍑忓皯鎴戜滑鍦ㄥ鉤鍙扮Щ 妞嶆椂鐨勫伐浣滐紝姣曠珶宕╂簝杞偍錛屾瘡涓鉤鍙頒笅閮戒笉鍚岋紝浣跨敤璧鋒潵寰堥毦緇熶竴錛岃孏oogle breakpad灝卞府鎴戜滑鍋氬埌浜嗚繖涓鐐癸紝涓嶇鏄摢涓鉤鍙頒笅鐨勫穿婧冿紝閮借兘澶熻繘琛岀粺涓鐨勫垎鏋愩傜幇鍦ㄥ緢澶氬伐紼嬮兘鍦ㄤ嬌鐢ㄤ粬錛氭渶钁楀悕鐨勫嚑涓 Chrome錛孎irefox錛孭icasa鍜孏oogle Earth銆傚彟澶栦粬鐨凩icense鏄疊SD鐨勶紝涔熷氨鏄錛屾垜浠嵆渚挎槸鍦ㄥ晢涓氳蔣浠朵腑浣跨敤錛屼篃鏄悎娉曠殑錛屽搱鍝堬紝榪欎箞濂界殑涓滆タ錛屾垜浠兘鏀捐繃涔堬紵鐜板湪灝辮鎴戜滑鏉?鐪嬬湅榪欎釜紲炲鐨勮蔣浠跺惂銆?/p> <h3><strong>鍘熺悊綆浠?/strong></h3> <p>breakpad鎶撳彇dump鐨勬柟寮忓拰涓鑸垜浠姄鍙杁ump鐨勬柟寮忎笉涓鏍楓傚湪breakpad鐨剋iki涓婃湁涓騫呭浘鍙互寰堝ソ鐨勬鎷粬鐨勫師鐞嗐?/p> <p><img title="breakpad" src="http://google-breakpad.googlecode.com/svn/wiki/breakpad.png" alt="" height="464" width="425" /></p> <p>breakpad鎶婂簲鐢ㄧ▼搴忓垎鎴愪笁涓儴鍒嗭紝浠g爜錛宐reakpad瀹㈡埛绔拰璋冭瘯淇℃伅銆?/p> <p>1. 鍦╞uild system涓紝閫氳繃symbol dumper鐢ㄥ鉤鍙扮浉鍏崇殑璋冭瘯淇℃伅鐢熸垚騫沖彴鏃犲叧鐨剆ymbol鏂囦歡銆傝繖鏍峰仛鐨勫ソ澶勫緢鏄庢樉錛屼竴鏃﹀鉤鍙版棤鍏充簡錛屾墍鏈夊鉤鍙扮殑宕╂簝灝卞彲浠ュ仛緇熶竴鐨勫垎鏋愪簡銆?br /> 2. breakpad閲囧彇榪涚▼澶栬漿鍌ㄥ拰鍒嗘瀽宕╂簝鐨勬柟寮忥紝浠栦嬌鐢–/S緇撴瀯錛屽鎴風鐢ㄦ潵鎹曡幏褰撳墠榪涚▼涓彂鐢熺殑宕╂簝錛屽茍閫氱煡鏈嶅姟绔穿婧冨彂鐢熴傛湇鍔$鐢ㄦ潵鍝嶅簲瀹㈡埛绔紝鎶撳彇dump鏂囦歡銆傝繖鏍峰仛鐨勭洰鐨勬槸涓轟簡鍑忓皯宕╂簝榪涚▼瀵筪ump鐨勫獎鍝嶃?br /> 3. Dump鐢熸垚鍚庤漿鍙戝埌宕╂簝鍒嗘瀽鍣ㄤ腑錛岃繖涓儴鍒嗗彲浠ュ湪鏈湴涔熷彲浠ュ湪鏈嶅姟鍣ㄤ笂錛屼粬瀵笵ump鏂囦歡榪涜瑙f瀽錛岀敓鎴愬彲璇葷殑鍫嗘爤淇℃伅銆?/p> <p>榪欏氨鏄痓reakpad澶勭悊dump澶ф鐨勬祦紼嬨?/p> <p>瀵逛簬鍘熺悊鐨勪粙緇峠oogle鍐欑殑宸茬粡鐩稿綋濂戒簡銆傛洿澶氱殑璇︾粏淇℃伅錛屽彲浠ョ洿鎺ョЩ姝ュ埌<a target="_blank">breakpad鐨剋iki</a>銆?/p> <h3><strong>瀹夎鍜岀紪璇?/strong></h3> <p>breakpad鐨勭紪璇戞瘮杈冩洸鎶橈紝鎵浠ュ湪姝よ褰曚竴涓嬨?/p> <p>緙栬瘧breakpad錛岃紜浣犵殑鏈哄櫒涓婅鏈変互涓嬬殑杞歡錛?br /> 1. <a target="_blank">python 2.4.3</a><a target="_blank"><br /> </a>璇蜂笉瑕佷嬌鐢╬ython3錛屼細鎶ラ敊銆傚彟澶杙ython2涓帹鑽愯繖涓増鏈紝浣跨敤鏂扮殑鐗堟湰鍦ㄧ紪璇戝叾浠杇oogle鐨勫伐紼嬫椂鏈夋椂浼氭姤閿?/p> <p>2. <a target="_blank">Windows SDK 7</a><a target="_blank"><br /> </a>濡傛灉娌℃湁榪欎釜錛岀紪璇戜細鎶ラ敊銆傚彟澶栬繖涓槸鍦ㄧ嚎瀹夎錛屾椂闂村緢涔咃紝鏈濂藉茍琛屽仛鍏朵粬鐨勪簨鎯呫?/p> <p>3. VS2005鐨勮ˉ涓?br /> KB918559<br /> KB926601<br /> KB935225<br /> KB943969<br /> KB947315</p> <p>宸茬粡瀹夎浜嗕互涓婅蔣浠剁殑绔ラ瀷錛屽氨鍙互寮濮嬭繘琛屼笅闈㈢殑宸ヤ綔楦?/p> <p>1. 浣跨敤svn鎶婁唬鐮?a target="_blank">checkout</a>涓嬫潵</p> <div><div class="hvzpftn" id="highlighter_301422" shell"=""><div><a command_help="" help"="">?</a></div><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td><div number1="" index0="" alt2"="">1</div><div number2="" index1="" alt1"="">2</div></td><td><div><div number1="" index0="" alt2"=""><code comments"=""># Non-members may check out a read-only working copy anonymously over HTTP.</code></div><div number2="" index1="" alt1"=""><code plain"="">svn checkout http:</code><code plain"="">//google-breakpad</code><code plain"="">.googlecode.com</code><code plain"="">/svn/trunk/</code> <code plain"="">google-breakpad-</code><code functions"="">read</code><code plain"="">-only</code></div></div></td></tr></tbody></table></div></div> <p>2. 璁劇疆Windows SDK 7<br /> 瑁呰繃鍏朵粬鐗堟湰Windows SDK鐨勭闉嬶紝璁板緱涓瀹氳榪涜榪欎竴姝ワ紝SDK鐨勫畨瑁呯▼搴忥紝騫朵笉浼氬府浣犺緗甐S銆?br /> 榪愯寮濮嬭彍鍗?>紼嬪簭->Microsoft Windows SDK v7.0->Visual Studio Registration->Windows SDK Configuration Tool錛岄夋嫨v7.0錛岀偣鍑籑ake Current銆?/p> <p>3. 涓簆ython璁劇疆鐜鍙橀噺<br /> 鐢變簬breakpad浣跨敤python鏉ョ敓鎴怶indows涓嬬殑宸ョ▼鏂囦歡錛屾墍浠ラ渶瑕佸皢python鎵鍦ㄧ洰褰曪紝璁劇疆鍒扮幆澧冨彉閲廝ATH涓幓銆?/p> <p>4. 鐢熸垚Windows宸ョ▼鏂囦歡</p> <div><div class="hvzpftn" id="highlighter_825083" shell"=""><div><a command_help="" help"="">?</a></div><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td><div number1="" index0="" alt2"="">1</div><div number2="" index1="" alt1"="">2</div><div number3="" index2="" alt2"="">3</div><div number4="" index3="" alt1"="">4</div></td><td><div><div number1="" index0="" alt2"=""><code functions"="">cd</code> <code string"="">"婧愮爜鐩綍/src/tools/gyp"</code></div><div number2="" index1="" alt1"=""> </div><div number3="" index2="" alt2"=""><code comments"=""># 娉ㄦ剰錛屾澶勪笉鑳戒嬌鐢ㄥ叏璺緞錛屼笉鐒朵細鍑洪敊</code></div><div number4="" index3="" alt1"=""><code plain"="">gyp.bat </code><code string"="">"../../client/windows/breakpad_client.gyp"</code></div></div></td></tr></tbody></table></div></div> <p>姝ゆ椂錛屽湪src/client/windows涓嬪氨鍙互鐪嬪埌鐢熸垚濂界殑breakpad_client.sln浜嗐傝繍琛屽惂錛?/p> <p>5. Hello World!<br /> 緙栬瘧build all錛岀幇鍦ㄤ竴鑸槸涓嶄細鎶ラ敊浜嗭紝濡傛灉鎶ラ敊錛岃媯鏌ユ槸涓嶆槸婕忎簡浠涔堟楠わ紝鐗瑰埆鏄ˉ涓併?br /> 緙栬瘧瀹屾垚涔嬪悗錛岃繍琛宑rash_generation_app鍚э紝榪欐槸浠栫殑嫻嬭瘯紼嬪簭錛宒ump鐨勯粯璁や綅緗繚瀛樺湪C:Dumps涓嬶紝璇鋒敞鎰忓厛寤虹珛濂界洰褰曪紝涓嶇劧浼氭棤娉曚嬌鐢ㄣ?br /> 鍚姩嫻嬭瘯紼嬪簭涔嬪悗錛屾鏃惰繕涓嶈兘鎶撳彇dump錛屽洜涓鴻繖涓槸breakpad涓殑鏈嶅姟鍣ㄧ錛岄渶瑕佸啀鍚姩涓涓祴璇曠▼搴忥紝鍦ㄧ浜屼釜嫻嬭瘯紼嬪簭涓紝鎴戜滑灝卞彲浠ヨ瘯楠孋lient鑿滃崟涓殑鍚勭宕╂簝浜嗐傝繖浜涘穿婧冮兘浼氳鎶撲綇杞瓨鍒癈:Dumps鐩綍涓嬨?/p> <h3><strong>濡備綍浣跨敤breakpad</strong></h3> <p> </p> <p>鍦╓indows涓?a target="_blank">浣跨敤breakpad鐨勬柟娉?/a>寰堢畝鍗曪紝鍙渶瑕佸垱寤轟竴涓狤xceptionHandler鐨勭被鍗沖彲錛屽ぇ瀹跺彲浠ュ湪crash_generation_app榪欎釜宸ョ▼涓壘鍒扮ず渚嬩唬鐮侊紝涔熷彲浠ョ洿鎺?a target="_blank">縐繪</a>Wiki錛屼笂闈㈣鐨勪篃寰堣緇嗐?/p> <p>1.榪涚▼鍐呮姄鍙朌ump鏂囦歡</p> <p>榪涚▼鍐呮姄鍙朌ump鏂囦歡鏄渶綆鍗曠殑breakpad鐨勭敤娉曘備嬌鐢ㄦ柟娉曞緢綆鍗曪細</p> <div><div class="hvzpftn" id="highlighter_394770" cpp"=""><div><a command_help="" help"="">?</a></div><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td><div number1="" index0="" alt2"="">1</div><div number2="" index1="" alt1"="">2</div><div number3="" index2="" alt2"="">3</div><div number4="" index3="" alt1"="">4</div><div number5="" index4="" alt2"="">5</div><div number6="" index5="" alt1"="">6</div><div number7="" index6="" alt2"="">7</div><div number8="" index7="" alt1"="">8</div><div number9="" index8="" alt2"="">9</div><div number10="" index9="" alt1"="">10</div><div number11="" index10="" alt2"="">11</div><div number12="" index11="" alt1"="">12</div><div number13="" index12="" alt2"="">13</div><div number14="" index13="" alt1"="">14</div><div number15="" index14="" alt2"="">15</div><div number16="" index15="" alt1"="">16</div><div number17="" index16="" alt2"="">17</div><div number18="" index17="" alt1"="">18</div><div number19="" index18="" alt2"="">19</div><div number20="" index19="" alt1"="">20</div><div number21="" index20="" alt2"="">21</div></td><td><div><div number1="" index0="" alt2"=""><code keyword="" bold"="">const</code> <code plain"="">std::wstring s_strCrashDir = L</code><code string"="">"c:\dumps"</code><code plain"="">;</code></div><div number2="" index1="" alt1"=""> </div><div number3="" index2="" alt2"=""><code color1="" bold"="">bool</code></div><div number4="" index3="" alt1"=""><code plain"="">InitBreakpad()</code></div><div number5="" index4="" alt2"=""><code plain"="">{</code></div><div number6="" index5="" alt1"=""><code spaces"="">    </code><code plain"="">google_breakpad::ExceptionHandler *pCrashHandler =</code></div><div number7="" index6="" alt2"=""><code spaces"="">        </code><code keyword="" bold"="">new</code> <code plain"="">google_breakpad::ExceptionHandler(s_strCrashDir,</code></div><div number8="" index7="" alt1"=""><code spaces"="">        </code><code plain"="">onExceptionFilter,</code></div><div number9="" index8="" alt2"=""><code spaces"="">        </code><code plain"="">onMinidumpDumped,</code></div><div number10="" index9="" alt1"=""><code spaces"="">        </code><code plain"="">NULL,</code></div><div number11="" index10="" alt2"=""><code spaces"="">        </code><code plain"="">google_breakpad::ExceptionHandler::HANDLER_ALL,</code></div><div number12="" index11="" alt1"=""><code spaces"="">        </code><code plain"="">MiniDumpNormal,</code></div><div number13="" index12="" alt2"=""><code spaces"="">        </code><code plain"="">NULL,</code></div><div number14="" index13="" alt1"=""><code spaces"="">        </code><code plain"="">NULL);</code></div><div number15="" index14="" alt2"=""> </div><div number16="" index15="" alt1"=""><code spaces"="">    </code><code keyword="" bold"="">if</code><code plain"="">(pCrashHandler == NULL) {</code></div><div number17="" index16="" alt2"=""><code spaces"="">        </code><code keyword="" bold"="">return</code> <code keyword="" bold"="">false</code><code plain"="">;</code></div><div number18="" index17="" alt1"=""><code spaces"="">    </code><code plain"="">}</code></div><div number19="" index18="" alt2"=""> </div><div number20="" index19="" alt1"=""><code spaces"="">    </code><code keyword="" bold"="">return</code> <code keyword="" bold"="">true</code><code plain"="">;</code></div><div number21="" index20="" alt2"=""><code plain"="">}</code></div></div></td></tr></tbody></table></div></div> <p>2.榪涚▼澶栨姄鍙朌ump鏂囦歡</p> <p>浣跨敤榪涚▼澶栨姄鍙朌ump鏃訛紝闇瑕佹寚瀹氭湇鍔$鍜屽鎴風錛屽湪鏈嶅姟绔腑闇瑕佸垱寤篊rashGenerationServer鐨勫疄渚嬶紝鑰屽湪瀹㈡埛绔腑鍒欏彧闇瑕佸垱寤篍xceptionHandler鍗沖彲銆傛澶栵紝濡傛灉鏈嶅姟绔嚜宸遍渶瑕佹姄榪涚▼鍐呯殑Dump錛岃灝唒ipe鐨勫弬鏁扮疆涓篘ULL銆?/p> <div><div class="hvzpftn" id="highlighter_709395" cpp"=""><div><a command_help="" help"="">?</a></div><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td><div number1="" index0="" alt2"="">1</div><div number2="" index1="" alt1"="">2</div><div number3="" index2="" alt2"="">3</div><div number4="" index3="" alt1"="">4</div><div number5="" index4="" alt2"="">5</div><div number6="" index5="" alt1"="">6</div><div number7="" index6="" alt2"="">7</div><div number8="" index7="" alt1"="">8</div><div number9="" index8="" alt2"="">9</div><div number10="" index9="" alt1"="">10</div><div number11="" index10="" alt2"="">11</div><div number12="" index11="" alt1"="">12</div><div number13="" index12="" alt2"="">13</div><div number14="" index13="" alt1"="">14</div><div number15="" index14="" alt2"="">15</div><div number16="" index15="" alt1"="">16</div><div number17="" index16="" alt2"="">17</div><div number18="" index17="" alt1"="">18</div><div number19="" index18="" alt2"="">19</div><div number20="" index19="" alt1"="">20</div><div number21="" index20="" alt2"="">21</div><div number22="" index21="" alt1"="">22</div><div number23="" index22="" alt2"="">23</div><div number24="" index23="" alt1"="">24</div><div number25="" index24="" alt2"="">25</div><div number26="" index25="" alt1"="">26</div><div number27="" index26="" alt2"="">27</div><div number28="" index27="" alt1"="">28</div><div number29="" index28="" alt2"="">29</div><div number30="" index29="" alt1"="">30</div><div number31="" index30="" alt2"="">31</div><div number32="" index31="" alt1"="">32</div><div number33="" index32="" alt2"="">33</div><div number34="" index33="" alt1"="">34</div><div number35="" index34="" alt2"="">35</div><div number36="" index35="" alt1"="">36</div><div number37="" index36="" alt2"="">37</div><div number38="" index37="" alt1"="">38</div><div number39="" index38="" alt2"="">39</div><div number40="" index39="" alt1"="">40</div><div number41="" index40="" alt2"="">41</div><div number42="" index41="" alt1"="">42</div><div number43="" index42="" alt2"="">43</div><div number44="" index43="" alt1"="">44</div></td><td><div><div number1="" index0="" alt2"=""><code keyword="" bold"="">const</code> <code color1="" bold"="">wchar_t</code> <code plain"="">s_pPipeName[] = L</code><code string"="">"\\.\pipe\breakpad\crash_handler_server"</code><code plain"="">;</code></div><div number2="" index1="" alt1"=""><code keyword="" bold"="">const</code> <code plain"="">std::wstring s_strCrashDir = L</code><code string"="">"c:\dumps"</code><code plain"="">;</code></div><div number3="" index2="" alt2"=""> </div><div number4="" index3="" alt1"=""><code color1="" bold"="">bool</code></div><div number5="" index4="" alt2"=""><code plain"="">InitBreakpad()</code></div><div number6="" index5="" alt1"=""><code plain"="">{</code></div><div number7="" index6="" alt2"=""><code spaces"="">    </code><code plain"="">google_breakpad::CrashGenerationServer *pCrashServer =</code></div><div number8="" index7="" alt1"=""><code spaces"="">        </code><code keyword="" bold"="">new</code> <code plain"="">google_breakpad::CrashGenerationServer(s_pPipeName,</code></div><div number9="" index8="" alt2"=""><code spaces"="">        </code><code plain"="">NULL,</code></div><div number10="" index9="" alt1"=""><code spaces"="">        </code><code plain"="">onClientConnected,</code></div><div number11="" index10="" alt2"=""><code spaces"="">        </code><code plain"="">NULL,</code></div><div number12="" index11="" alt1"=""><code spaces"="">        </code><code plain"="">onClientDumpRequest,</code></div><div number13="" index12="" alt2"=""><code spaces"="">        </code><code plain"="">NULL,</code></div><div number14="" index13="" alt1"=""><code spaces"="">        </code><code plain"="">onClientExited,</code></div><div number15="" index14="" alt2"=""><code spaces"="">        </code><code plain"="">NULL,</code></div><div number16="" index15="" alt1"=""><code spaces"="">        </code><code keyword="" bold"="">true</code><code plain"="">,</code></div><div number17="" index16="" alt2"=""><code spaces"="">        </code><code plain"="">&s_strCrashDir);</code></div><div number18="" index17="" alt1"=""> </div><div number19="" index18="" alt2"=""><code spaces"="">    </code><code keyword="" bold"="">if</code><code plain"="">(pCrashServer == NULL) {</code></div><div number20="" index19="" alt1"=""><code spaces"="">        </code><code keyword="" bold"="">return</code> <code keyword="" bold"="">false</code><code plain"="">;</code></div><div number21="" index20="" alt2"=""><code spaces"="">    </code><code plain"="">}</code></div><div number22="" index21="" alt1"=""> </div><div number23="" index22="" alt2"=""><code spaces"="">    </code><code comments"="">// 濡傛灉宸茬粡鏈嶅姟绔凡緇忓惎鍔ㄤ簡錛屾澶勫惎鍔ㄤ細澶辮觸</code></div><div number24="" index23="" alt1"=""><code spaces"="">    </code><code keyword="" bold"="">if</code><code plain"="">(!pCrashServer->Start()) {</code></div><div number25="" index24="" alt2"=""><code spaces"="">        </code><code keyword="" bold"="">delete</code> <code plain"="">pCrashServer;</code></div><div number26="" index25="" alt1"=""><code spaces"="">        </code><code plain"="">pCrashServer = NULL;</code></div><div number27="" index26="" alt2"=""><code spaces"="">    </code><code plain"="">}</code></div><div number28="" index27="" alt1"=""> </div><div number29="" index28="" alt2"=""><code spaces"="">    </code><code plain"="">google_breakpad::ExceptionHandler *pCrashHandler =</code></div><div number30="" index29="" alt1"=""><code spaces"="">        </code><code keyword="" bold"="">new</code> <code plain"="">google_breakpad::ExceptionHandler(s_strCrashDir,</code></div><div number31="" index30="" alt2"=""><code spaces"="">        </code><code plain"="">onExceptionFilter,</code></div><div number32="" index31="" alt1"=""><code spaces"="">        </code><code plain"="">onMinidumpDumped,</code></div><div number33="" index32="" alt2"=""><code spaces"="">        </code><code plain"="">NULL,</code></div><div number34="" index33="" alt1"=""><code spaces"="">        </code><code plain"="">google_breakpad::ExceptionHandler::HANDLER_ALL,</code></div><div number35="" index34="" alt2"=""><code spaces"="">        </code><code plain"="">MiniDumpNormal,</code></div><div number36="" index35="" alt1"=""><code spaces"="">        </code><code plain"="">(pCrashServer == NULL) ? s_pPipeName : NULL, </code><code comments"="">// 濡傛灉鏄湇鍔$錛屽垯鐩存帴浣跨敤榪涚▼鍐卍ump</code></div><div number37="" index36="" alt2"=""><code spaces"="">        </code><code plain"="">NULL);</code></div><div number38="" index37="" alt1"=""> </div><div number39="" index38="" alt2"=""><code spaces"="">    </code><code keyword="" bold"="">if</code><code plain"="">(pCrashHandler == NULL) {</code></div><div number40="" index39="" alt1"=""><code spaces"="">        </code><code keyword="" bold"="">return</code> <code keyword="" bold"="">false</code><code plain"="">;</code></div><div number41="" index40="" alt2"=""><code spaces"="">    </code><code plain"="">}</code></div><div number42="" index41="" alt1"=""> </div><div number43="" index42="" alt2"=""><code spaces"="">    </code><code keyword="" bold"="">return</code> <code keyword="" bold"="">true</code><code plain"="">;</code></div><div number44="" index43="" alt1"=""><code plain"="">}</code></div></div></td></tr></tbody></table></div></div> <p>浣跨敤breakpad鐨勬椂鍊欙紝鏈変袱涓湴鏂歸渶瑕佹敞鎰忥細<br /> 1. 璁板緱鎶奲reakpad鐨剆olution涓嬬殑鍑犱釜宸ョ▼錛屽寘鍚埌浣犲紑鍙戠殑宸ョ▼涓紝鎴栬呯洿鎺ュ寘鍚粬浠殑lib銆?br /> common錛氬熀紜鍔熻兘錛屽寘鍚竴涓GUID鐨勫皝瑁呭拰http涓婁紶鐨勭被銆?br /> exception_handler錛氱敤鏉ユ崟鑾峰穿婧冪殑綾匯?br /> crash_generation_server錛歜reakpad鐨勬湇鍔$錛岀敤鏉ュ湪浜х敓宕╂簝鏃舵姄鍙杁ump銆?br /> crash_generation_client錛歜reakpad鐨勫鎴風錛岀敤鏉ユ崟鑾峰綋鍓嶈繘紼嬬殑宕╂簝銆?/p> <p>2. 鍦ㄥ垵濮嬪寲breakpad涔嬪墠錛岃寰楀厛鍒涘緩濂絛ump鏂囦歡鐨勭洰褰曪紝涓嶇劧breakpad鏈嶅姟绔皢涓嶈兘姝e父鐨勫啓dump錛岃繖浼氬鑷碽reakpad瀹㈡埛绔湪宕╂簝鏃舵棤闄愮瓑寰呮湇鍔$dump鍐欏畬鐨勬秷鎭紝鏈鍚庡け鍘誨搷搴斻?/p></div><img src ="http://www.shnenglu.com/lauer3912/aggbug/159784.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/lauer3912/" target="_blank">RTY</a> 2011-11-07 21:34 <a href="http://www.shnenglu.com/lauer3912/archive/2011/11/07/159784.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>璋冭瘯Release鍙戝竷鐗堢▼搴忕殑Crash閿欒 錛堣漿錛?/title><link>http://www.shnenglu.com/lauer3912/archive/2011/11/07/159781.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Mon, 07 Nov 2011 13:15:00 GMT</pubDate><guid>http://www.shnenglu.com/lauer3912/archive/2011/11/07/159781.html</guid><wfw:comment>http://www.shnenglu.com/lauer3912/comments/159781.html</wfw:comment><comments>http://www.shnenglu.com/lauer3912/archive/2011/11/07/159781.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/lauer3912/comments/commentRss/159781.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/lauer3912/services/trackbacks/159781.html</trackback:ping><description><![CDATA[<div><h1><a id="viewpost1_TitleUrl" href="../../Walker/articles/146153.html">璋冭瘯Release鍙戝竷鐗堢▼搴忕殑Crash閿欒 錛堣漿錛?/a></h1> <div> <h2><a id="viewpost1_TitleUrl" href="../../woaidongmao/archive/2011/05/10/146092.html">璋冭瘯Release鍙戝竷鐗堢▼搴忕殑Crash閿欒</a> </h2> <div> <p><a title="http://blog.sina.com.cn/s/blog_48f93b530100fsln.html" >http://blog.sina.com.cn/s/blog_48f93b530100fsln.html</a></p> <p> </p> <p>鍦?span>Windows騫沖彴涓嬬敤C++寮鍙戝簲鐢ㄧ▼搴忥紝鏈涓嶆兂瑙佸埌鐨勬儏鍐墊亹鎬曞氨鏄▼搴忓穿婧冿紝鑰岃鎯寵В鍐沖紩璧烽棶棰樼殑bug錛屾渶鍥伴毦鐨勫簲璇ュ氨鏄皟璇時elease鐗堟湰浜嗐傚洜涓簉elease鐗堟湰鏉ュ氨灝戜簡寰堝璋冭瘯淇℃伅錛屾洿浣曞喌涓鑸兘鏄彂甯冨嚭鍘葷敱鐢ㄦ埛浣跨敤錛宑rash鐨勭幇鍦哄緢闅句繚鐣欏拰閲嶇幇銆傛湰鏂囧皢緇欏嚭鍑犱釜瑙e喅鏂規錛屽畬鎴愬release鐗堝簲鐢ㄧ▼搴廲rash閿欒鐨勮皟璇曘傦紙鏈枃鍙璁篧indows騫沖彴MSVC鐜涓嬬殑璋冭瘯錛屽浜庡叾浠栧鉤鍙板拰寮鍙戠幆澧冩病鏈夊叧娉紝璇峰ぇ瀹惰嚜宸卞熼壌鍜屽皾璇曘傦級</span></p> <p> <wbr></p> <p> <wbr> <wbr>  <wbr><strong>鏂規涓錛氬穿婧冨湴鍧</strong> <span><strong><span>+ MAP</span></strong></span><strong>鏂囦歡</strong></p> <p><span> <wbr> <wbr> <wbr> </span>榪欑鏂規鍙兘瀵?span><span>VC7</span>浠ュ墠鐨勭増鏈紑鍙戠殑紼嬪簭浣跨敤銆?span> <wbr></span></span></p> <p><span> <wbr> <wbr> <wbr> <strong>1</strong></span><strong>銆佸穿婧冨湴鍧</strong></p> <p><span> <wbr> <wbr> <wbr> <wbr> <wbr>鎵璋撳穿婧冨湴鍧灝辨槸寮曡搗紼嬪簭宕╂簝鐨勫唴瀛樺湴鍧錛屽湪<span>WinXP</span>涓嬪簲鐢ㄧ▼搴?span>crash</span>鐨勫璇濇濡備笅鍥撅細</span></p> <p align="center"><a target="_blank"><span><span><img title="clip_image001" alt="clip_image001" src="../../images/cppblog_com/woaidongmao/WindowsLiveWriter/ReleaseCrash_A881/clip_image001_0ad42579-f1c9-44ae-b2f8-b50b8a737e0d.jpg" height="181" width="424" border="0" /></span></span></a></p> <p align="center"><a target="_blank"><span><span><img title="clip_image002" alt="clip_image002" src="../../images/cppblog_com/woaidongmao/WindowsLiveWriter/ReleaseCrash_A881/clip_image002_cb3f00fa-aa22-4301-a42c-92c12dff2ea4.jpg" height="120" width="494" border="0" /></span></span></a></p> <p align="center"><a target="_blank"><span><span><img title="clip_image003" alt="clip_image003" src="../../images/cppblog_com/woaidongmao/WindowsLiveWriter/ReleaseCrash_A881/clip_image003_fea81ac9-41ea-42be-a24f-d0fe99dafa80.jpg" height="380" width="494" border="0" /></span></span></a></p> <p><span> <wbr> <wbr> <wbr> </span><span>涓婇潰絎?span>2</span>寮犲浘涓敾綰㈢嚎鐨勫間負<span>crash</span>鐨勪唬鐮佸亸縐誨湴鍧錛岀<span>3</span>寮犲浘涓哄嵆<span>crash</span>緇濆鍦板潃錛涗竴鑸紩璧?span>crash</span>鐨勫師鍥犲涓哄唴瀛樻搷浣滈敊璇紝鎴戜滑鐢ㄨ繖涓や釜鍦板潃鍜?span>MAP</span>鏂囦歡灝辮兘瀹氫綅鍑洪敊鐨勪唬鐮佽銆?/span></p> <p><span> <wbr> <wbr> <wbr> <strong>2</strong></span><strong>銆?span><span>MAP</span>鏂囦歡</span></strong></p> <p><span> <wbr> <wbr> <wbr> MAP</span>鏂囦歡鏄褰曞簲鐢ㄧ▼搴忎俊鎭殑鏂囦歡錛堟枃鏈枃浠訛級錛岄噷闈㈠ぇ姒傚寘鍚簡紼嬪簭鐨勫叏灞絎﹀彿銆佹簮鐮佹ā鍧楀悕銆佹簮鐮佹枃浠跺拰琛屽彿絳変俊鎭紝鑰岃繖浜涗俊鎭兘澶熷府鍔╂垜浠畾浣嶅嚭閿欑殑浠g爜琛屻?/p> <p><span> <wbr> <wbr> <wbr> </span>鎬庢牱鐢熸垚<span><span>MAP</span>鏂囦歡鍛紵浠?span>VC6</span>涓轟緥錛屽湪 <span>Project Settings -> C/C++ <wbr>-> Debug info</span>涓紝閫夋嫨 <span>Line Numbers Only </span>錛涘湪 <span>Project Settings -> Link </span>涓紝閫夋嫨 <span>Generate mapfile</span>欏癸紝騫跺湪<span>Project Options </span>閲岄潰杈撳叆 </span><span>/MAPINFO:LINES</span> 鍜?<span><span>/MAPINFO:EXPORTS</span>錛岄噸鏂扮紪璇戠▼搴忓氨浼氱敓鎴?span>.map</span>鏂囦歡銆?/span></p> <p><span> <wbr> <wbr> <wbr> </span>浠ヤ笂璁劇疆瀵瑰簲鐨勭紪璇戦摼鎺ラ夐」鍒嗗埆鍒嗭細</p> <p><span> <wbr> <wbr> <wbr> </span><strong><span>/Zi</span></strong> — 琛ㄧず鐢熸垚<span><span>pdb</span>璋冭瘯淇℃伅錛?/span></p> <p><span> <wbr> <wbr> <wbr> </span><strong><span>/MAP[:filename]</span></strong> — 琛ㄧず鐢熸垚<span><span>map</span>鏂囦歡鍚嶏紱</span></p> <p><span> <wbr> <wbr> <wbr> </span><strong><span>/MAPINFO:EXPORTS <wbr></span></strong>— 琛ㄧず鐢熸垚鐨?span><span>map</span>鏂囦歡涓姞鍏?span>exported functions</span>錛堢敓鎴?span>DLL</span>鏂囦歡鏃訛級錛?/span></p> <p><span> <wbr> <wbr> <wbr> </span><strong><span>/MAPINFO:LINES <wbr></span></strong>— 琛ㄧず鐢熸垚鐨?span><span>map</span>鏂囦歡涓姞鍏ヤ唬鐮佽淇℃伅銆?/span></p> <p><span> <wbr> <wbr> <wbr> </span>鐢變簬<span><span>/MAPINFO:LINES</span>閫夐」鍦?span>VC8</span>浠ュ悗鐨勭増鏈腑涓嶅啀鏀寔錛屽洜姝ら氳繃<span>MAP</span>鏂囦歡涓殑淇℃伅鍜?span>crash</span>鍦板潃瀹氫綅鍑洪敊浠g爜琛屽氨姣旇緝鍥伴毦浜嗭紝鎵浠ヨ繖縐嶆柟妗堝彧鑳藉湪<span>VC7</span>鍙婁互鍓嶇殑鐗堟湰涓嬌鐢ㄣ?/span></p> <p><span> <wbr> <wbr> <wbr> <wbr>涓涓?span>MAP</span>鏂囦歡鐗囨紺轟緥濡備笅錛?span> <wbr></span></span></p> <p><span> <wbr> <wbr> <wbr> <a target="_blank"><span><span><img title="clip_image004" alt="clip_image004" src="../../images/cppblog_com/woaidongmao/WindowsLiveWriter/ReleaseCrash_A881/clip_image004_fbf07de5-1b63-4473-917f-f6695904c9be.jpg" height="229" width="494" border="0" /></span> <wbr></span></a> <wbr></span></p> <p><span> <wbr> <wbr> <wbr> <a target="_blank"><span><span><img title="clip_image005" alt="clip_image005" src="../../images/cppblog_com/woaidongmao/WindowsLiveWriter/ReleaseCrash_A881/clip_image005_93f97fcb-0900-4f57-baf2-29a04f821fa2.jpg" height="227" width="494" border="0" /></span></span></a></span></p> <p><span> <wbr> <wbr> <wbr> </span><span>鍥句腑<span>Rva+Base</span>鍒楃殑鍦板潃涓鴻琛屽嚱鏁板搴旂殑鍑芥暟緇濆鍦板潃錛?span>Address</span>鍒椾腑鍐掑彿鍚庨潰鐨勫湴鍧涓哄嚱鏁扮浉瀵瑰亸縐誨湴鍧銆?span> <wbr> <wbr> <wbr></span></span></p> <p><span> <wbr> <wbr> <wbr> <strong>3</strong></span><strong>銆佸畾浣?span><span>crash</span>浠g爜</span></strong></p> <p><span> <wbr> <wbr> <wbr> </span>鏈変簡涓婇潰鐨勪粙緇嶏紝瀹氫綅<span><span>crash</span>浠g爜灝卞緢綆鍗曚簡銆傜敤涓嬮潰鐨勫叕寮忔潵榪涜瀹氫綅錛?/span></p> <p><span> <wbr> <wbr> <wbr> </span><strong>宕╂簝琛屽亸縐?<span><span>= </span>宕╂簝鍦板潃 <span>- </span>宕╂簝鍑芥暟緇濆鍦板潃 <span>+ </span>鍑芥暟鐩稿鍋忕Щ</span></strong></p> <p><span> <wbr> <wbr> <wbr> </span>鎴戜滑棣栧厛鏍規嵁宕╂簝鍦板潃錛堢粷瀵瑰湴鍧錛夛紝鎸夌収鎵懼埌絎?span><span>2</span>寮犲浘涓?span>Rva+Base</span>鍒楃殑鍦板潃鎵懼埌鍙戠敓宕╂簝鐨勫嚱鏁幫紙鍗沖穿婧冨湴鍧澶т簬璇ュ嚱鏁拌鐨?span>Rva+Base</span>鍦板潃涓斿皬浜庝笅涓嚱鏁扮殑鍦板潃錛夛紝鐒跺悗鎵懼埌璇ヨ瀵瑰簲鐨勫嚱鏁扮浉瀵瑰亸縐誨湴鍧錛屽甫鍏ュ叕寮忎腑錛屽氨寰楀埌浜嗗穿婧冭鍋忕Щ錛岃鍊艱〃紺哄穿婧冭鐨勪唬鐮佺浉瀵逛簬浠g爜鎵鍦ㄥ嚱鏁扮殑鍋忕Щ閲忋傜敤璇ュ煎幓涓庣<span>3</span>寮犲浘涓搴斿嚱鏁板啋鍙峰悗闈㈢殑鍋忕Щ閲忓幓姣旇緝錛屾渶鎺ヨ繎鐨勫煎墠闈㈢殑閭d釜鍗佽繘鍒舵暟鍗充負浠g爜鎵鍦ㄥ嚱鏁頒腑鐨勮鍙楓?/span></p> <p><span> <wbr> <wbr> <wbr> ok</span>錛屽埌姝ゆ垜浠凡緇忔垚鍔熸壘鍒頒簡宕╂簝鐨勪唬鐮佽錛屽彧涓嶈繃榪欑鏂規硶榪樻槸姣旇緝璐瑰姏錛屽茍涓旈檺鍒舵瘮杈冨錛屾垜浠湅鐪嬩笅闈㈢殑鏂規銆?/p> <p>涓婄瘒緇欏嚭鐨勬柟妗堜竴榪樿琛ュ厖鍑犲彞銆傞氳繃<span>“crash鍦板潃 + MAP鏂囦歡”鏉ュ畾浣嶅嚭閿欎唬鐮佷綅緗櫧鐒墮渶瑕佺粡榪囨瘮杈冨鏉傜殑鍦板潃璁$畻錛屼絾鍗存槸鏈綆鍗曞疄鐜扮殑鏂瑰紡銆傚鏋滀粎浠呮兂閫氳繃宕╂簝鍦板潃瀹氫綅鍑洪敊鐨勫嚱鏁幫紝灝辨洿鍔犳柟渚夸簡銆傛垜鍦ㄧ綉涓婃壘鍒頒竴涓В鏋怣AP鏂囦歡鐨勫皬宸ュ叿錛屽彲浠ラ潪甯告竻鏅扮殑鍒楀嚭姣忎釜鍑芥暟鐨勫湴鍧錛屽茍涓斿彲浠ュ皢鍒嗘瀽琛ㄦ牸瀵煎嚭涓篍xcel鏂囦歡銆傚伐鍏蜂笅杞藉湴鍧錛?a ><span>http://e.ys168.com/?tinyfun</span></a></span>錛屽伐鍏風洰褰曚笅VCMapper.exe銆?/p> <p> <wbr> <wbr> <wbr> 鍙﹀涓婄瘒涓昏鍙傝冧袱綃囨枃绔狅細</p> <p> <wbr> <wbr> <wbr> <a ><span>http://www.vckbase.com/document/viewdoc/?id=908</span></a></p> <p> <wbr> <wbr> <wbr> <a ><span>http://www.vckbase.com/document/viewdoc/?id=1473</span></a></p> <p> <wbr></p> <p> <wbr> <wbr> <wbr> <strong>鏂規浜岋細宕╂簝鍦板潃<span> + MAP鏂囦歡 + COD鏂囦歡</span></strong></p> <p> <wbr> <wbr> <wbr> 鐢變簬<span>VC8浠ュ悗鐨勭増鏈兘涓嶅啀鏀寔MAP鏂囦歡涓駭鐢熶唬鐮佽淇℃伅錛屽洜姝ゆ垜浠鎵懼彟涓縐嶅畾浣嶆柟寮忥細COD鏂囦歡銆?/span></p> <p> <wbr> <wbr> <wbr> <strong><span>1</span></strong><strong>銆?span>COD鏂囦歡</span></strong></p> <p> <wbr> <wbr> <wbr> COD鏂囦歡鏄竴涓寘鍚簡姹囩紪鐮併佷簩榪涘埗鏈哄櫒鐮佸拰婧愪唬鐮佸搴斾俊鎭殑鏂囦歡錛屾瘡涓涓?span>cpp閮藉搴斾竴涓狢OD鏂囦歡銆傞氳繃榪欎釜鏂囦歡錛屾垜浠彲浠ラ潪甯告柟渚垮湴榪涜瀹氫綅銆?/span></p> <p> <wbr> <wbr> <wbr> 鍦?span>VC6涓敓鎴怌OD鏂囦歡鐨勮緗柟寮忎負錛歅roject Settings -> C/C++錛屽湪 Category 涓?Listing Files錛屽湪 Listing file type 緇勫悎妗嗕腑閫?Assembly錛孧achine code錛宎nd source銆傚湪VC8涓敓鎴怌OD鏂囦歡鐨勮緗柟寮忎負錛歅roject Properties -> C/C++ -> Output Files -> Assembler Output 欏癸紝閫夋嫨 Assembly錛孧achine code錛宎nd Source(/Facs)銆?/span></p> <p> <wbr> <wbr> <wbr></p> <p> <wbr> <wbr> <wbr> <strong><span>2</span></strong><strong>銆佸畾浣嶅穿婧冭</strong></p> <p> <wbr> <wbr> <wbr> 涓嬮潰閫氳繃涓句緥榪涜璇存槑銆傜幇鍦ㄦ垜鏈変竴涓熀浜庡璇濇鐨?span>MFC搴旂敤紼嬪簭CrashTest錛屽湪CCrashTestDlg::OnInitDialog鍑芥暟涓啓鍏ュ鑷碿rash鐨勪唬鐮佽鍙ワ紙絎?9琛岋級錛屾簮鏂囦歡濡備笅錛?/span></p> <p> <wbr> <wbr> <wbr> <a target="_blank"><span><span><img title="clip_image006" alt="clip_image006" src="../../images/cppblog_com/woaidongmao/WindowsLiveWriter/ReleaseCrash_A881/clip_image006_887560ee-8b72-42ea-a623-220dcb47ac1f.jpg" height="169" width="360" border="0" /></span></span></a></p> <p> <wbr> <wbr> <wbr> 鏍規嵁宕╂簝鍦板潃錛?span>0x004012A3錛変互鍙奙AP鏂囦歡錛堝畾浣嶇墖孌靛浘鐗囧涓嬶級錛屽畾浣峜rash鍑芥暟涓篛nInitDialog錛涘茍涓旀垜浠彲浠ュ緢瀹規槗鍦拌綆楀嚭宕╂簝鍦板潃鐩稿浜庡穿婧冨嚱鏁扮殑鍋忕Щ閲忎負 0x004012A3 - 0x004011E0 = 0xC3銆?/span></p> <p> <wbr> <wbr> <wbr> <a target="_blank"><span><span><img title="clip_image007" alt="clip_image007" src="../../images/cppblog_com/woaidongmao/WindowsLiveWriter/ReleaseCrash_A881/clip_image007_dc9962ce-f969-4c7f-aa0b-e973cac321ce.jpg" height="36" width="494" border="0" /></span></span></a></p> <p> <wbr> <wbr> <wbr> 鍐嶆潵鐪嬬湅<span>CrashTestDlg.cod鏂囦歡錛屾垜浠牴鎹枃浠朵腑婧愮爜淇℃伅鎵懼埌OnInitDialog鍑芥暟淇℃伅鐗囨錛?/span></p> <p> <wbr> <wbr> <wbr> <a target="_blank"><span><span><img title="clip_image008" alt="clip_image008" src="../../images/cppblog_com/woaidongmao/WindowsLiveWriter/ReleaseCrash_A881/clip_image008_00ac91bc-99ca-4d4f-86cd-b0d1d23bb10a.jpg" height="231" width="494" border="0" /></span></span></a></p> <p> <wbr> <wbr> <wbr> 鍙互鐪嬪埌鍥劇墖涓涓琛屼負<span>OnInitDialog鍑芥暟姹囩紪浠g爜鐨勮搗濮嬭錛涙壘鍒?#8220;int * p = NULL;”榪欎竴鍙ユ簮鐮侊紝鍏跺墠闈㈢殑98琛ㄧず榪欒浠g爜鍦ㄦ簮鏂囦歡涓殑琛屽彿錛屼笅闈㈢殑000c1琛ㄧず鐩稿浜庡嚱鏁板紑濮嬩綅緗殑鍋忕Щ閲忥紝鍚庨潰鐨?#8220;33 c0”涓烘満鍣ㄧ爜錛?#8220;xor eax錛宔ax”涓烘眹緙栫爜銆傞偅涔堟垜浠牴鎹墠闈㈢畻鍑烘潵鐨勫亸縐婚噺0xC3錛屾壘鍒板搴斿嚭閿欑殑璇彞涓?9琛岋細“*p = 5;”銆?/span></p> <p> <wbr> <wbr> <wbr> 鎬葷粨涓涓嬪畾浣嶆楠わ細</p> <p> <wbr> <wbr> <wbr> 1) 鏍規嵁鍏紡 <strong><span>宕╂簝璇彞鍦ㄥ嚱鏁頒腑鍋忕Щ鍦板潃<span> = 宕╂簝鍦板潃 - 宕╂簝鍑芥暟鍦板潃</span></span></strong> 璁$畻鍑哄亸縐婚噺X錛?/p> <p> <wbr> <wbr> <wbr> 2) 鏍規嵁鍏紡 <strong><span>宕╂簝璇彞鍦?span>COD鏂囦歡涓湴鍧 = 宕╂簝鍑芥暟鍦–OD鏂囦歡涓湴鍧 + <wbr>X</span></span></strong> 璁$畻鍑哄湴鍧Y銆傚叾涓穿婧冨嚱鏁板湪COD鏂囦歡涓湴鍧涓篊OD鏂囦歡涓嚱鏁拌搗濮嬫嫭鍙?#8220;{”鍚庨潰琛ㄦ槑鐨勫湴鍧錛屼竴鑸儏鍐典笅涓?x0000錛?/p> <p> <wbr> <wbr> <wbr> 3) 鏍規嵁<span>Y鍦–OD鏂囦歡涓壘鍒板搴斾唬鐮佽銆?/span></p> <p> <wbr> <wbr> <wbr></p> <p> <wbr> <wbr> <wbr> ok錛屾柟妗堜簩浠嬬粛瀹屼簡銆傝繖縐嶆柟娉曟渶澶х殑濂藉鏄病鏈?span>VC寮鍙戠幆澧冪増鏈檺鍒訛紝鑰屼笖COD鏂囦歡閲岄潰鍖呭惈鐨勪俊鎭洿鍔犱赴瀵岋紝涓嶄絾鍙互甯姪鎴戜滑瀹氫綅crash錛岃繕鑳藉府鎴戜滑鍒嗘瀽寰堝涓滆タ銆傚綋鐒訛紝榪欎篃瀵艱嚧緙栬瘧鐢熸垚浜嗗緢澶氫俊鎭枃浠躲?/span></p> <p>鏍規嵁鍓嶉潰涓ょ瘒鍗氭枃錛屾垜浠瀹氫綅宕╂簝琛屼唬鐮侊紝蹇呴』瑕佽嚜宸辨牴鎹浉鍏充俊鎭枃浠惰繘琛岃綆椼傚鏋滈渶瑕佸鐞嗙殑閲忔瘮杈冨ぇ錛屾亹鎬曚細寰堣垂鍔涙皵銆傛湁娌℃湁鏇寸畝鍗曞揩閫熺殑鍔炴硶鍛紵</p> <p> <wbr> <wbr> <wbr> 鏈鐩存帴鐨勬兂娉曞氨鏄啓涓涓皬宸ュ叿錛屾牴鎹鍒欏拰淇℃伅榪涜鑷姩瀹氫綅錛屼笉榪囧紑鍙戣搗鏉ヤ篃鏄璐逛竴鐣姛澶殑銆備護浜哄紑蹇冪殑鏄紝鎴戜滑鍙互鎵懼埌綾諱技鐨勫伐鍏鳳紝鑰屼笖鏄紑婧愬厤璐圭殑錛佺▼搴忓憳鐨勪笘鐣屼篃璁稿緢澶氭椂鍊欓兘鏄繖涔堝崟綰屼箰浜庡垎浜紒</p> <p> <wbr> <wbr> <wbr></p> <p> <wbr> <wbr> <wbr> <strong>鏂規涓夛細宕╂簝鍦板潃<span> + PDB鏂囦歡 + CrashFinder</span></strong></p> <p> <wbr><wbr> <wbr><wbr> <wbr><wbr> CrashFinder鏄竴涓紑婧愬伐鍏鳳紝浣滆呮槸<span>John Robbin錛屽ぇ瀹跺彲浠ュ幓浠栫殑blog涓婂幓鎵懼叧浜嶤rashFinder鐨勪俊鎭傛垜浠繖閲屼互CrashFinder2.5鐗堟湰涓轟緥浠嬬粛錛岀浉鍏蟲枃绔犻摼鎺ヤ負錛?a ><span>http://www.wintellect.com/CS/blogs/jrobbins/archive/2006/04/19/crashfinder-returns.aspx</span></a></span></p> <p> <wbr><wbr> <wbr><wbr> <wbr> <strong><span>1</span></strong><strong>銆?span>PDB鏂囦歡</span></strong></p> <p> <wbr> <wbr> <wbr> PDB錛?span>Program Database錛夋枃浠朵腑鍖呭惈浜唀xe紼嬪簭鎵鏈夌殑璋冭瘯鐩稿叧淇℃伅錛屽叿浣撳彲浠ユ煡闃匨SDN銆傚綋緙栬瘧閫夐」璁劇疆涓?Zi錛岄摼鎺ラ夐」璁劇疆涓?DEBUG錛?OPT:REF鏃訛紝灝變細鐢熸垚宸ョ▼鐨?pdb鏂囦歡銆傚叿浣撳埌VC2005涓紝灝辨槸 Project Propertise -> C/C++ -> General -> Debug Information Format 欏硅緗負 Program Database錛?Zi錛夛紝Linker -> Debugging -> Generate Debug Info 欏硅緗負 Yes錛?Debug錛夛紝Linker -> Optimization -> References <wbr>欏硅緗負 Eliminate <wbr>Unreferenced Data錛?OPT:REF錛夈?/span></p> <p> <wbr> <wbr> <wbr> 鍙璁劇疆浠ヤ笂閫夐」錛?span>release鐗堟湰涔熻兘鐢熸垚PDB鏂囦歡銆傚綋鐒訛紝瀵瑰簲鐨勫簲鐢ㄧ▼搴忎篃浼氱◢澶с?/span></p> <p> <wbr> <wbr> <wbr> <strong><span>2</span></strong><strong>銆?span>CrashFinder</span></strong></p> <p> <wbr> <wbr> <wbr> CrashFinder鑳藉榪愯闇瑕佷袱涓潯浠訛細涓鏄郴緇熷繀欏昏鏈?span>dbghelp.dll鏂囦歡錛涗簩鏄疨DB鏂囦歡蹇呴』涓巈xe鏂囦歡鍦ㄤ竴涓礬寰勪笅銆傚浜巇bghelp.dll錛屼竴鑸湪緋葷粺system32璺緞涓嬮兘鏈夛紝濡傛灉娌℃湁涓嬭澆涓涓斁鍒拌繖涓洰褰曚笅灝卞彲浠ヤ簡銆?/span></p> <p> <wbr> <wbr> <wbr> 鍏堢湅涓涓?span>CrashFinder鐨勭晫闈€?/span></p> <p> <wbr> <wbr> <wbr></p> <p align="center"><a target="_blank"><span><span><img title="clip_image009" alt="clip_image009" src="../../images/cppblog_com/woaidongmao/WindowsLiveWriter/ReleaseCrash_A881/clip_image009_60e666ee-6f31-4132-929c-3ef20c5a9fde.jpg" height="327" width="494" border="0" /></span></span></a></p> <p> <wbr> <wbr> <wbr> 鐢ㄨ搗鏉ヤ篃闈炲父綆鍗曘傞鍏堥夋嫨<span>File->New鎴栫偣鍑誨伐鍏鋒爮鏂板緩鎸夐挳錛岄夋嫨瑕佽皟璇曠殑exe鏂囦歡鎵撳紑錛屼細鍙戠幇exe鍙婃墍渚濊禆鐨刣ll鏂囦歡淇℃伅閮藉凡緇忓姞杞借繘鏉ャ傚湪涓嬪崐閮ㄥ垎鐨勭紪杈戞涓緭鍏ュ穿婧冨湴鍧錛?6榪涘埗錛夛紝鐐瑰彸杈圭殑“Find”鎸夐挳錛屽氨浼氬湪涓嬮潰鏄劇ず宕╂簝鐨勬簮鏂囦歡璺緞銆佸悕縐頒互鍙婂穿婧冩墍鍦ㄨ鍙蜂簡錛屽涓嬪浘鎵紺恒?/span></p> <p align="center"><a target="_blank"><span><span><img title="clip_image010" alt="clip_image010" src="../../images/cppblog_com/woaidongmao/WindowsLiveWriter/ReleaseCrash_A881/clip_image010_4b25ce3c-1bea-4818-be58-230d6cba8a6a.jpg" height="370" width="494" border="0" /></span></span></a></p> <p> <wbr> <wbr> <wbr> 鐢?span>CrashFinder榪涜crash瀹氫綅鐪熺殑闈炲父鏂逛究銆備絾鏄垜鍦ㄤ嬌鐢ㄨ繃紼嬩腑鍙戠幇浜嗕竴涓猙ug錛屾瘡嬈″惎鍔ㄧ▼搴忓悗錛岀洿鎺ユ柊寤虹殑璇濆姞杞借繘鏉ョ殑exe妯″潡閮芥樉紺哄弶錛屾彁紺烘壘涓嶅埌debug symbols銆備絾鏄敤鎵撳紑鎸夐挳闅忎究鎵撳紑涓涓枃浠跺け璐ュ悗錛屽啀鏂板緩灝辮兘鎴愬姛銆傜寽嫻嬪彲鑳芥槸鐩存帴鏂板緩錛屽畾浣峆DB鏂囦歡鏃剁殑璺緞涓嶅寮曡搗鐨勩傛湁婧愮爜錛屼絾鏄噿鐨勭湅浜嗗懙鍛碉紝澶у鎰熷叴瓚e彲浠ヨ瘯涓涓嬨?/span></p> <p> <wbr> <wbr> <wbr> 濂戒簡錛屾柟妗堜笁灝變粙緇嶅埌榪欓噷錛屽悗闈㈣繕鏈夋洿鍔犲己澶х殑鏂規<span> : )</span></p> <p>鍓嶉潰鍑犱釜鏂規閮芥槸鐩存帴瀹氫綅<span>crash鐨勪唬鐮佷綅緗紝浣嗘槸鍦ㄦ瘮杈冨ぇ鍨嬬殑紼嬪簭涓紝鍙煡閬撹繖涓俊鎭繕鏄繙榪滀笉澶熺殑錛屾垜浠笇鏈涚煡閬撴洿澶氬叧浜庤皟鐢ㄥ嚱鏁伴『搴忓強鍙橀噺鍊肩瓑淇℃伅錛屼篃灝辨槸crash鏃惰皟鐢ㄥ爢鏍堜俊鎭?/span></p> <p> <wbr></p> <p> <wbr> <wbr> <wbr> <strong>鏂規鍥涳細<span>SetUnhandledExceptionFil<wbr>ter + StackWalker</span></strong></p> <p> <wbr> <wbr> <wbr> 榪欎釜鏂規闇瑕佽嚜宸卞姩鎵嬪線宸ョ▼閲屾坊鍔犱唬鐮佷簡銆傝瀹炵幇涓婇潰鐨勬兂娉曪紝闇瑕佸仛涓や歡浜嬫儏錛?span>1銆侀渶瑕佸湪crash鏃舵湁鏈轟細瀵圭▼搴忓爢鏍堣繘琛屽鐞嗭紱2銆佸鍫嗘爤淇℃伅榪涜鏀墮泦銆?/span></p> <p> <wbr> <wbr> <wbr> <strong><span>1</span></strong><strong>銆?span>SetUnhandleExceptionFilt<wbr>er鍑芥暟</span></strong></p> <p> <wbr> <wbr> <wbr> Windows騫沖彴涓嬬殑<span>C++紼嬪簭寮傚父閫氬父鍙垎涓轟袱縐嶏細緇撴瀯鍖栧紓甯革紙Structured Exception錛屽彲浠ョ悊瑙d負涓庢搷浣滅郴緇熺浉鍏崇殑寮傚父錛夊拰C++寮傚父銆傚浜庣粨鏋勫寲寮傚父澶勭悊錛圫EH錛夛紝鍙互鎵懼埌寰堝璧勬枡錛屽湪姝や笉緇嗚銆傚浜巆rash閿欒錛屼竴鑸敱鏈姝e父鎹曡幏鐨勫紓甯稿紩璧鳳紝Windows鎿嶄綔緋葷粺鎻愪緵浜嗕竴涓狝PI鍑芥暟鍙互鍦ㄧ▼搴廲rash涔嬪墠鏈夋満浼氬鐞嗚繖浜涘紓甯革紝灝辨槸SetUnhandleExceptionFilt<wbr>er鍑芥暟銆傦紙C++涔熸湁涓涓被浼煎嚱鏁皊et_terminate鍙互澶勭悊鏈鎹曡幏鐨凜++寮傚父銆傦級</span></p> <p> <wbr> <wbr> <wbr> SetUnhandleExceptionFilt<wbr>er鍑芥暟澹版槑濡備笅錛?/p> <p> <wbr> <wbr> <wbr> LPTOP_LEVEL_EXCEPTION_FILTER WINAPI SetUnhandledExceptionFil<wbr>ter(<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> LPTOP_LEVEL_EXCEPTION_FILTER <em>lpTopLevelExceptionFilte<wbr>r</em><br /> <wbr> <wbr> <wbr> );</p> <p> <wbr> <wbr> <wbr> 鍏朵腑<span> LPTOP_LEVEL_EXCEPTION_FILTER 瀹氫箟濡備笅錛?/span></p> <p> <wbr> <wbr> <wbr> typedef LONG (WINAPI *PTOP_LEVEL_EXCEPTION_FILTER)(<br /> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> __in struct _EXCEPTION_POINTERS *ExceptionInfo<br /> <wbr> <wbr> <wbr> );<br /> <wbr> <wbr> <wbr> typedef PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER;</p> <p> <wbr> <wbr> <wbr> 綆鍗曟潵璇達紝<span>SetUnhandleExceptionFilt<wbr>er鍏佽鎴戜滑璁劇疆涓涓嚜宸辯殑鍑芥暟浣滀負鍏ㄥ眬SEH榪囨護鍑芥暟錛屽綋紼嬪簭crash鍓嶄細璋冪敤鎴戜滑鐨勫嚱鏁拌繘琛屽鐞嗐傛垜浠彲浠ュ埄鐢ㄧ殑鏄?_EXCEPTION_POINTERS 緇撴瀯綾誨瀷鐨勫彉閲廍xceptionInfo錛屽畠鍖呭惈浜嗗寮傚父鐨勬弿榪頒互鍙婂彂鐢熷紓甯哥殑綰跨▼鐘舵侊紝榪囨護鍑芥暟鍙互閫氳繃榪斿洖涓嶅悓鐨勫兼潵璁╃郴緇熺戶緇繍琛屾垨閫鍑哄簲鐢ㄧ▼搴忋?/span></p> <p> <wbr> <wbr> <wbr> 鍏充簬<span> SetUnhandleExceptionFilt<wbr>er 鍑芥暟鐨勫叿浣撶敤娉曞拰紺轟緥璇峰弬鑰僊SDN銆?/span></p> <p> <wbr></p> <p> <wbr> <wbr> <wbr> <strong><span>2</span></strong><strong>銆?span>StackWalker</span></strong><br /> <wbr> <wbr> <wbr> 鐜板湪鎴戜滑宸茬粡鏈夋満浼氬彲浠ュ湪<span>crash涔嬪墠瀵圭▼搴忕姸鎬佷俊鎭繘琛屽鐞嗕簡錛屽彧闇瑕佺敓鎴愬茍淇濆瓨鍫嗘爤淇℃伅灝卞ぇ鍔熷憡鎴愪簡銆俉indows鐨刣bghelp.dll搴撴彁渚涗簡涓涓嚱鏁板彲浠ュ緱鍒板綋鍓嶅爢鏍堜俊鎭細StackWalk64錛堝湪Win2K浠ュ墠鐗堟湰涓負StackWalk錛夈傝鍑芥暟澹版槑濡備笅錛?/span></p> <p> <wbr> <wbr> <wbr> BOOL WINAPI StackWalk64(<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> DWORD <em>MachineType</em>,<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> HANDLE <em>hProcess</em>,<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> HANDLE <em>hThread</em>,<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in_out <wbr> <wbr> <wbr> <wbr> <wbr> LPSTACKFRAME64 <em>StackFrame</em>,<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in_out <wbr> <wbr> <wbr> <wbr> <wbr> PVOID <em>ContextRecord</em>,<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> PREAD_PROCESS_MEMORY_ROUTINE64 <em>ReadMemoryRoutine</em>,<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> PFUNCTION_TABLE_ACCESS_ROUTINE64 <em>FunctionTableAccessRouti<wbr>ne</em>,<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> PGET_MODULE_BASE_ROUTINE64 <em>GetModuleBaseRoutine</em>,<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> PTRANSLATE_ADDRESS_ROUTINE64 <em>TranslateAddress</em><br /> <wbr> <wbr> <wbr> );<br /> <wbr> <wbr> <wbr> 璇ュ嚱鏁扮殑鍏蜂綋鐢ㄦ硶鍙互鍙傝?span>MSDN銆傚湪榪欓噷鎺ㄨ崘涓涓墰浜哄啓濂界殑StackWalker錛屽彲浠ョ洿鎺ユ嬁鏉ョ敤錛屽紑婧愮殑銆係tackWalker鎻愪緵浜嗕竴涓熀綾伙紝緇欏嚭浜嗗嚑涓畝鍗曠殑鎺ュ彛錛屽彲浠ユ柟渚垮湴鐢熸垚鍫嗘爤淇℃伅錛屽茍涓旀敮鎸佷竴緋誨垪VC鐗堟湰錛岄潪甯稿ソ鐢ㄣ傛垜浠彲浠ヨ嚜宸卞啓涓涓瓙綾伙紝騫墮噸杞借櫄鍑芥暟OnOutput錛屽氨鍙互灝嗗爢鏍堜俊鎭緭鍑轟負鐗瑰畾鏍煎紡浜嗐係tackWalker鐨勫湴鍧涓猴細<a ><span>http://www.codeproject.com/KB/threads/StackWalker.aspx</span></a></span>銆?/p> <p> <wbr> <wbr> <wbr> 涓嶈繃瀵逛簬<span>Release鐗堟湰鏉ヨ錛孲tackWalk64鍑芥暟鑾峰緱鐨勫爢鏍堜俊鎭湁鍙兘涓嶅畬鏁淬傚鏋滃紓甯告槸鐢盡FC鐨勬ā鍧楁姏鍑猴紝閭d箞鑾峰緱鐨勫爢鏍堝彲鑳界己灝戝墠闈㈣皟鐢ㄦā鍧椾俊鎭傚彟澶栵紝StackWalk64闇瑕佹渶鏂扮殑dbghelp.dll鏂囦歡鏀寔鎵嶈兘宸ヤ綔錛涜姝g‘杈撳嚭crash鐨勫嚱鏁板悕鍜岃鍙鳳紝闇瑕佽pdb鏂囦歡鏀寔銆備互涓婁笉瓚蟲湁鍙兘褰卞搷杈撳嚭淇℃伅鐨勫畬鏁存у拰鏁堟灉錛岃屽浜庡彂甯冨湪澶栫殑紼嬪簭錛岃甯︿笂pdb鏂囦歡鍑犱箮涓嶅彲鑳斤紝鍥犳榪欎釜鏂規榪樻槸鏈夌己鎲劇殑錛屾瘮杈冮傜敤浜庢湰鍦扮殑release鐗堟湰璋冭瘯銆?/span></p> <p> <wbr> <wbr> <wbr> 涓嬩竴綃囨垜浠皢浠嬬粛涓涓洿鍔犲畬鍠勭殑瑙e喅鏂規</p> <p>褰撴垜浠妸鑷繁鐨?span>release鐗堟湰紼嬪簭鍙戝竷鍑哄幓浠ュ悗錛屼竴鑸兘鏄湪鐢ㄦ埛鐨勬満鍣ㄤ笂榪愯銆傝繖縐嶆儏鍐典笅錛屽浜庣鍥涚鏂規錛屽洜涓洪渶瑕乸db鏂囦歡鎵嶈兘澶熸紜敓鎴愬爢鏍堣皟鐢ㄧ殑鍑芥暟琛屽彿鍙婁唬鐮佽鍙鳳紝鍥犳鏂規鍥涘彧閫傜敤浜庢湰鍦皉elease鐗堢殑璋冭瘯錛屽惁鍒欏彧鑳界敓鎴愪笉瀹屾暣鐨勫爢鏍堜俊鎭傚浜庡墠涓夌鏂規錛屽叾瀹炲彧闇瑕佺敤鎴峰憡鐭ュ穿婧冨湴鍧錛岀劧鍚庡湪鏈湴鏌ユ壘crash鍦板潃灝卞彲浠ヤ簡錛屼絾鏄畾浣峜rash鐨勮繃紼嬮潪甯鎬笉鏂逛究錛屽鏋渃rash鐨勬儏鍐墊瘮杈冨錛屽墠涓夌鏂規閮戒笉鍚堥傘傝屼笖錛屽墠涓夌鏂規鍧囦笉鑳界敓鎴愬爢鏍堣皟鐢ㄤ俊鎭紝瀵逛簬debug鐨勪綔鐢ㄦ湁闄愩?/span></p> <p> <wbr> <wbr> <wbr> 涓嬮潰鎴戜滑灝辨潵鐪嬩竴涓洿鍔犲畬鍠勭殑瑙e喅鏂規銆?/p> <p> <wbr></p> <p> <wbr> <wbr> <wbr> <strong>鏂規浜旓細<span>SetUnhandledExceptionFil<wbr><wbr>ter + Minidump</span></strong></p> <p> <wbr> <wbr> <wbr> SetUnhandleExceptionFilt<wbr>er鍑芥暟鎴戜滑宸茬粡浠嬬粛榪囦簡錛屾湰鏂規鐨勬濊礬榪樻槸瑕佸埄鐢ㄦ垜浠嚜宸辯殑寮傚父澶勭悊鍑芥暟錛屾潵鐢熸垚<span>minidump鏂囦歡銆?/span></p> <p> <wbr> <wbr> <wbr> <strong><span>1</span></strong><strong>銆?span>Minidump姒傚康</span></strong></p> <p> <wbr> <wbr> <wbr> minidump錛堝皬瀛樺偍鍣ㄨ漿鍌級鍙互鐞嗚В涓轟竴涓?span>dump鏂囦歡錛岄噷闈㈣褰曚簡鑳藉甯姪璋冭瘯crash鐨勬渶灝忔湁鐢ㄤ俊鎭傚疄闄呬笂錛屽鏋滀綘鍦?緋葷粺灞炴?-> 楂樼駭 -> 鍚姩鍜屾晠闅滄仮澶?-> 璁劇疆 -> 鍐欏叆璋冭瘯淇℃伅 涓夋嫨“灝忓唴瀛樿漿鍌?64 KB)”鐨勮瘽錛屽綋緋葷粺鎰忓鍋滄鏃墮兘浼氬湪C:\Windows\Minidump\璺緞涓嬬敓鎴愪竴涓?dmp鍚庣紑鐨勬枃浠訛紝榪欎釜鏂囦歡灝辨槸minidump鏂囦歡錛屽彧涓嶈繃榪欎釜鏄唴鏍告佺殑minidump銆?/span></p> <p> <wbr> <wbr> <wbr>鎴戜滑瑕佺敓鎴愮殑鏄敤鎴鋒佺殑<span>minidump錛屾枃浠朵腑鍖呭惈浜嗙▼搴忚繍琛岀殑妯″潡淇℃伅銆佺嚎紼嬩俊鎭佸爢鏍堣皟鐢ㄤ俊鎭瓑銆傝屼笖涓轟簡絎﹀悎鍏秏ini鐨勭壒鎬э紝dump鏂囦歡鏄帇緙╄繃鐨勩?/span></p> <p> <wbr> <wbr> <wbr> <strong><span>2</span></strong><strong>銆佺敓鎴?span>minidump鏂囦歡</span></strong></p> <p> <wbr> <wbr> <wbr> 鐢熸垚<span>minidump鏂囦歡鐨凙PI鍑芥暟鏄疢iniDumpWriteDump錛岃鍑芥暟闇瑕乨bghelp.lib鏀寔錛屽叾鍘熷瀷濡備笅:</span></p> <p> <wbr> <wbr> <wbr> BOOL WINAPI MiniDumpWriteDump(<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> HANDLE <em>hProcess</em>,<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> DWORD <em>ProcessId</em>,<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> HANDLE <em>hFile</em>,<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> MINIDUMP_TYPE <em>DumpType</em>,<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> PMINIDUMP_EXCEPTION_INFORMATION <em>ExceptionParam</em>,<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> PMINIDUMP_USER_STREAM_INFORMATION <em>UserStreamParam</em>,<br /> <wbr> <wbr> <wbr> <wbr> <wbr> __in <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> PMINIDUMP_CALLBACK_INFORMATION <em>CallbackParam</em><br /> <wbr> <wbr> <wbr> );</p> <p> <wbr> <wbr> <wbr> 鍦ㄦ垜浠殑寮傚父澶勭悊鍑芥暟涓姞鍏ヤ互涓嬩唬鐮侊細</p> <p> <wbr> <wbr> <wbr> HANDLE hFile = ::CreateFile( _T("E:\\dumpfile.dmp"), GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);<br /> <wbr> <wbr> <wbr> <wbr> if( hFile != INVALID_HANDLE_VALUE)<br /> <wbr> <wbr> <wbr> <wbr> {<br /> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> MINIDUMP_EXCEPTION_INFORMATION einfo;<br /> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> einfo.ThreadId = ::GetCurrentThreadId();<br /> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> einfo.ExceptionPointers = pExInfo;<br /> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> einfo.ClientPointers = FALSE;</p> <p> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> ::MiniDumpWriteDump(::GetCurrentProcess(), ::GetCurrentProcessId(), hFile, MiniDumpNormal, &einfo, NULL, NULL);<br /> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> <wbr> ::CloseHandle(hFile);<br /> <wbr> <wbr> <wbr> <wbr> }</p> <p> <wbr> <wbr> <wbr> 鍏朵腑錛?span>pExInfo鍙橀噺涓哄紓甯稿鐞嗗嚱鏁癙EXCEPTION_POINTERS綾誨瀷鐨勫弬鏁般傚叿浣撹鍙傝僊SDN銆?/span></p> <p> <wbr> <wbr> <wbr> <strong><span>3</span></strong><strong>銆佽皟璇?span>minidump</span></strong></p> <p> <wbr> <wbr> <wbr> <wbr>璋冭瘯<span>dump鏂囦歡棣栧厛闇瑕乸db鏂囦歡錛屽洜姝ゆ垜浠琤uild紼嬪簭鏃墮渶瑕佽緗?Debug Infomation Format 涓?“Program Database錛?Zi錛?#8221;銆傚叾嬈★紝鎴戜滑榪樿紜繚鎵鐢ㄧ殑dump鏂囦歡涓庢簮浠g爜銆乪xe銆乸db鏂囦歡鐗堟湰鏄竴鑷寸殑錛岃繖瑕佹眰鎴戜滑蹇呴』緇存姢濂界▼搴忕増鏈俊鎭?/span></p> <p> <wbr> <wbr> <wbr> 璋冭瘯<span>minidump鏈鏂逛究鐨勭幆澧冨氨鏄疺S浜嗭紝鎴戜滑鍙灝?dmp銆?exe銆?pdb鏂囦歡鏀懼湪涓涓礬寰勪笅錛屼繚璇佹簮浠g爜鏂囦歡鐨勮礬寰勪笌緙栬瘧鏃剁殑璺緞涓鑷村氨鍙互浜嗭紝鍓╀笅鐨勫氨鏄疺S甯垜浠畬鎴愩傚弻鍑?dmp鏂囦歡鎴栬呭湪鏂囦歡鎵撳紑宸ョ▼涓夋嫨“dump files”錛屽姞杞絛ump鏂囦歡錛岀劧鍚庢寜F5榪愯灝辮兘鐩存帴鎭㈠crash鏃剁殑鐜板満浜嗭紝浣犲彲浠ュ畾浣峜rash鐨勪唬鐮侊紝鍙互鏌ョ湅璋冪敤鍫嗘爤錛屽彲浠ユ煡鐪嬬嚎紼嬪拰妯″潡淇℃伅...涓鍒囬兘璺熶綘璁劇疆鏂偣璋冭瘯涓鏍鳳紝澶己澶т簡錛佺湅涓埅鍥懼惂銆?/span></p> <p><a target="_blank"><span><span><img title="clip_image012" alt="clip_image012" src="../../images/cppblog_com/woaidongmao/WindowsLiveWriter/ReleaseCrash_A881/clip_image012_3df8e4ef-d0e8-49d3-a9af-47f58cc713c6.jpg" height="469" width="616" border="0" /></span></span></a></p> <p> <wbr> <wbr> <wbr> 闇瑕佹敞鎰忕殑鏄紝瀵逛簬<span>release鐗堢殑紼嬪簭鏉ヨ錛屽緢澶氫唬鐮佹槸緇忚繃緙栬瘧鍣ㄤ紭鍖栬繃鐨勶紝鍥犳瀹氫綅鐨勬椂鍊欏彲鑳戒細鏈夋墍鍋忓樊錛屽ぇ瀹跺彲浠ヨ冭檻璁劇疆閫夐」鍘繪帀浠g爜浼樺寲銆?/span></p> <p> <wbr> <wbr> <wbr> 鍏朵粬鍙互璋冭瘯<span>minidump鐨勫伐鍏瘋繕鏈塛inDbg絳夛紝澶у鍙互鏌ラ槄鐩稿叧璧勬枡銆?/span></p> <p> <wbr> <wbr> <wbr> 鏈枃涓昏鍙傝冧簡榪欑瘒鏂囩珷錛?span><a ><span>http://vicchina.51.net/research/other/seh/minidumps/intro.htm</span></a></span>銆?/p> <p> <wbr> <wbr> <wbr> 涓嬩竴綃囷紝鎴戜滑灝嗙粰鍑轟竴涓皟璇?span>release鍙戝竷紼嬪簭鐨勫畬緹庤В鍐蟲柟妗堬紝閫傚悎鐢ㄦ埛閲忚緝澶х殑搴旂敤鍙戝竷紼嬪簭鐨勮皟璇曘?/span></p> <p>涓婁竴綃囨垜浠凡緇忕粰鍑轟簡鏂規錛岃兘澶熼潪甯告柟渚跨殑閫氳繃<span>dump鏂囦歡瀵筩rash閿欒榪涜璋冭瘯鍜屽畾浣嶏紱浠庢暣涓祦紼嬩笂鐪嬭繕宸渶鍚庝竴姝ワ紝鍗蟲庢牱鎷垮埌crash鏃朵駭鐢熺殑dump鏂囦歡銆傚鏋滃彲浠ヨ鐢ㄦ埛鎶婃枃浠跺彂閫佽繃鏉ヨ嚜鐒朵笉閿欙紝浣嗗浜庣被浼煎厤璐瑰叡浜蔣浠剁瓑鍦ㄤ簰鑱旂綉涓婂彂甯冪殑紼嬪簭鍛紵鎴戜滑鐨勭敤鎴鋒槸涓嶇‘瀹氱殑錛岃屼笖鐢ㄦ埛閲忔湁鍙兘闈炲父澶э紝鍗充嬌鎴戜滑鑳芥兂鍔炴硶鑱旂郴鍒扮敤鎴鳳紝鎬諱笉鑳芥尐涓幓鏀墮泦crash淇℃伅鍚с?/span></p> <p> <wbr> <wbr> <wbr> 鎴戜滑闇瑕佷竴縐嶆柟妗堬紝鑳藉鎻愪緵<span>crash淇℃伅姹囨姤鍔熻兘銆?/span></p> <p> <wbr> <wbr> <wbr> 鎴戜滑鍙互鏋惰涓鍙版湇鍔″櫒涓撻棬榪涜淇℃伅鏀墮泦錛屽彧瑕佸鎴風鍦?span>crash鏃舵紜眹鎶ュ嵆鍙紝浣嗘槸鐩稿簲鐨勭淮鎶ゆ垚鏈拰寮鍙戦毦搴︿篃涓嶅彲蹇借銆傛湁娌℃湁鏇寸畝鍗曠殑鏂規硶鍛紵榪樿寰楁垜鐨勫崥鏂?#8220;<a target="_blank"><span><span>涓虹▼搴忔坊鍔犺嚜鍔ㄥ彂閫丒mail</span><span>鍔熻兘</span></span></a>”</span>鍚楋紵榪欏氨鏄畝鍗曟湁鏁堢殑鏂規硶錛?/p> <p> <wbr></p> <p> <wbr> <wbr> <wbr> <strong>鏂規鍏細<span>minidump + email</span></strong></p> <p> <wbr> <wbr> <wbr> 鎴戜滑鍙渶瑕佸湪寮傚父澶勭悊鏃訛紝鍏堢敓鎴?span>minidump淇℃伅鏂囦歡錛屽啀鐢╡mail鏂瑰紡灝嗘枃浠跺彂閫佸埌鎸囧畾閭灝辮浜嗐傚墿涓嬬殑灝辨槸鎴戜滑姣忓ぉ鏌ョ湅閭錛屾彁鍙杁ump鏂囦歡榪涜璋冭瘯浜嗐?/span></p> <p> <wbr> <wbr> <wbr> <strong><span>1</span></strong><strong>銆?span>Email鍔熻兘</span></strong></p> <p> <wbr> <wbr> <wbr> 棣栧厛鎴戜滑鏉ョ湅涓涓?span>email鍙戦侀兘闇瑕佸摢浜涚浉鍏充俊鎭?/span></p> <p> <wbr> <wbr> <wbr> a銆佸彂閫佺閭甯愭埛錛?/p> <p> <wbr> <wbr> <wbr> b銆佹帴鏀剁閭甯愭埛錛?/p> <p> <wbr> <wbr> <wbr> c銆?span>email鏍囬錛屼竴鑸簲鏈夎蔣浠跺悕縐板強鐗堟湰淇℃伅錛?/span></p> <p> <wbr> <wbr> <wbr> d銆?span>email姝f枃錛屼竴鑸簲鏈夌畝鍗曠殑crash淇℃伅鎻愮ず錛屼互鍖哄埆涓嶅悓鍘熷洜閫犳垚鐨刢rash錛?/span></p> <p> <wbr> <wbr> <wbr> <wbr>e銆?span>email闄勪歡錛屽綋鐒跺氨鏄垜浠殑dump鏂囦歡浜嗭紝榪樺彲浠ュ姞涓婅蔣浠剁敓鎴愮殑log鏂囦歡絳夈?/span></p> <p> <wbr> <wbr> <wbr> 褰撶劧錛屽浜庢爣棰樺簲璇ュ敖閲忓鍔犱竴浜涗俊鎭尯鍒紩璧?span>crash鐨勫師鍥狅紝姣斿灝哻rash鐨勫湴鍧淇℃伅鍔犲埌鏍囬涓紱鍥犱負褰撴瘡澶╂湁鎴愮櫨涓婂崈鐨刢rash姹囨姤涓婃潵錛岄噸澶嶇殑crash鍗犲ぇ澶氭暟錛屾妸鏃墮棿閮借姳鍦ㄥ尯鍒嗗畠浠韓涓婃湁鐐瑰お嫻垂銆傜敱姝ょ湅鏉ワ紝鍓嶉潰鏂規涓彁鍒扮殑StackWalker榪樻槸鏈変簺鐢ㄥ鐨勶紝鎴戜滑鍙互鐢ㄥ畠鏉ョ敓鎴愪竴浜沜rash鐨勬枃瀛楁弿榪頒俊鎭紝鍐欏埌鏍囬鎴栨鏂囦腑鍘匯?/span></p> <p> <wbr> <wbr> <wbr> dump鏂囦歡鐨勫ぇ灝忔槸鍚﹂傚悎浣滀負閭歡鐨勯檮浠跺憿錛熷疄闄呬笂<span>minidump浜х敓鐨勬枃浠朵竴鑸湪鍑燢鍒板嚑鍗並涔嬮棿錛屼綔涓篹mail鐨勯檮浠舵病鏈変換浣曢棶棰樸?/span></p> <p> <wbr> <wbr> <wbr> 鍏充簬鍙戦?span>email鐩稿叧鎶鏈粏鑺傦紝宸茬粡鍦?#8220;<a target="_blank"><span><span>涓虹▼搴忔坊鍔犺嚜鍔ㄥ彂閫丒mail</span><span>鍔熻兘</span></span></a>”</span>鏂囦腑浠嬬粛浜嗭紝澶у鍙互鍙傝冦傚叾瀹烇紝瀵規帴鍙楅偖綆變腑閭歡鐨勫鐞嗚繕鏄緢璐規椂璐瑰姏鐨勶紝澶у鍙互鑰冭檻鍐欎竴浜涜剼鏈皢澶勭悊嫻佺▼鑷姩鍖栵紝鎻愰珮鏁堢巼銆?/p> <p> <wbr> <wbr> <wbr> <strong><span>2</span></strong><strong>銆?span>google breakpad</span></strong></p> <p> <wbr> <wbr> <wbr> google breakpad鏄竴涓紑婧愮殑璺ㄥ鉤鍙?span>crash report緋葷粺錛屽厜浠庡紑婧愬拰璺ㄥ鉤鍙拌繖涓や釜鐗圭偣涓婃潵鐪嬶紝瀹冨氨瓚充互縐扮殑涓婃槸涓涓畬鍠勮屾湁鏁堢殑宸ュ叿浜嗐傚叾瀹烇紝breakpad鍦ㄦ暣涓猚rash report灞傛涓婄粰鍑轟簡涓涓郴緇熺駭鐨勮В鍐蟲柟妗堬紝涔熷氨鏄瀹冨嚑涔庤兘閫傚簲鍚勭杞歡銆佸悇縐嶅鉤鍙扮殑搴旂敤瑕佹眰銆?/span></p> <p> <wbr> <wbr> <wbr> breakpad鐨勬暣浣撴濊礬璺熶笂闈粙緇嶇殑鏂規鏄浉浼肩殑錛屽彧涓嶈繃鏈鍚庢彁浜?span>dump鏂囦歡鐨勬柟寮忔洿鍔犲畬鍠勩傚ぇ瀹舵湁鍏磋叮鍙互鍘誨畠鐨勫畼鏂圭綉鍧鏌ラ槄鐩稿叧璧勬枡錛?a ><span>http://code.google.com/p/google-breakpad/</span></a></span>銆?/p> <p> <wbr></p> <p> <wbr> <wbr> <wbr> ok錛屽叧浜庤皟璇?span>release鍙戝竷紼嬪簭鐨刢rash閿欒緋誨垪鏂囩珷灝卞啓瀹屼簡銆傝繖鍑犵瘒鏂囩珷緇欏嚭鐨勬柟妗堢敱綆鍗曞埌澶嶆潅錛岀敱綆闄嬪埌瀹屽杽錛屽crash璋冭瘯鏈変簡涓涓瘮杈冨叏闈㈢殑鎬葷粨銆傚綋鐒訛紝鍏朵腑娑夊強鍒扮殑姒傚康鍜屾妧鏈繕寰堝錛岄渶瑕佹垜浠幓涓嶆柇瀛︿範鍜岄鎮燂紝涔熷笇鏈涘ぇ瀹惰兘澶熶簰鐩鎬氦嫻併?/span></p> </div> </div></div><img src ="http://www.shnenglu.com/lauer3912/aggbug/159781.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/lauer3912/" target="_blank">RTY</a> 2011-11-07 21:15 <a href="http://www.shnenglu.com/lauer3912/archive/2011/11/07/159781.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>DevGuide 濡備綍鏈夊姪浜庤胺姝?c + + 嫻嬭瘯妗嗘灦 闃舵瀹炴柦鐗硅壊http://www.shnenglu.com/lauer3912/archive/2011/09/26/156885.htmlRTYRTYMon, 26 Sep 2011 12:55:00 GMThttp://www.shnenglu.com/lauer3912/archive/2011/09/26/156885.htmlhttp://www.shnenglu.com/lauer3912/comments/156885.htmlhttp://www.shnenglu.com/lauer3912/archive/2011/09/26/156885.html#Feedback0http://www.shnenglu.com/lauer3912/comments/commentRss/156885.htmlhttp://www.shnenglu.com/lauer3912/services/trackbacks/156885.html
鎼滅儲 
 瀵逛簬  
DevGuide  
濡備綍鏈夊姪浜庤胺姝?c + + 嫻嬭瘯妗嗘灦 
闃舵瀹炴柦鐗硅壊
鐢?a target="_top" style="color: #0000cc; white-space: nowrap; ">w...@google.com鏇存柊鐨?span title="Thu Aug 19 13:53:46 2010">2010 騫?8 鏈?19 鏃?/span>

濡傛灉鎮ㄦ湁鍏磋叮浜嗚В璋鋒瓕嫻嬭瘯錛屼粠鏉ユ簮錛屾垨媧鵑仯鐨勬兂娉曟垨淇敼欏圭洰銆?寤虹瓚鍐呴儴鏈枃妗e皢鏄綘銆?/p>

綆浠?/font>

棣栧厛錛岃鎴戜滑緇欐偍欏圭洰鐨勪竴浜涜儗鏅?/p>

鍙戠墝

鏍規嵁鏂扮殑 BSD 璁稿彲璇?/a>鎻愪緵鎵鏈夎胺姝屾祴璇曟簮鍜岄緙栬瘧鐨勭▼搴忓寘.

璋鋒瓕嫻嬭瘯紺懼尯

璋鋒瓕嫻嬭瘯紺懼尯宸茬粡瀛樺湪錛屼富瑕佹槸閫忚繃璁ㄨ緇?/a>錛?a rel="nofollow" target="_top" style="color: #0000cc; ">闂璺熻釜鍣?/a>鍜屽箙搴﹁緝灝忥紝婧愪唬鐮佺鐞嗗偍瀛樺簱銆?/font>浣犺偗瀹氶紦鍔卞弬涓庤璁猴紝鎮ㄨ繕鍙互甯姪鎴戜滑淇濇寔楂橀泦鍥㈢殑鏁堟灉鍚庯紝淇冭繘鍦ㄦ澶勫垪鍑虹殑鍑嗗垯銆?/font>

璇峰皢鍙嬪ソ

鏄劇ず鐨勭ぜ璨屽拰灝婇噸浠栦漢鏄湪璋鋒瓕鏂囧寲鐨勯噸瑕佺粍鎴愰儴鍒嗗拰鎴戜滑寮虹儓榧撳姳澶у鍙備笌璋鋒瓕嫻嬭瘯寮鍙戝姞鐩熶笉鎺ュ彈銆?/font>褰撶劧錛岀ぜ璨屽茍涓嶇浉鍚岋紝鏈湁寤鴻鎬у湴涓嶅悓鎰忓鏂癸紝浣嗗畠鎰忓懗鐫鏋氫婦 42 鎶鏈師鍥犳煇欏瑰緩璁彲鑳戒笉鏄渶浣抽夋嫨鏃舵垜浠簲璇ヤ簰鐩稿皧閲嶃?/font>娌℃湁鐞嗙敱鎷姉鎴栬交瑙嗗悜浠諱綍浜虹湡璇氬湴璇曞浘榪涜鐨勮璁轟綔鍑鴻礎鐚?/font>

鑲畾鐨勬槸錛宑 + + 嫻嬭瘯鏄弗鑲冪殑鍟嗕笟鍜屽叾瀹冪殑涓滆タ錛屼絾瀹冧篃鏈夊緢澶氫箰瓚c?/font>璁╂垜浠繚鎸佽繖縐嶆柟寮忋?/font>璁╂垜浠姫鍔涙垚涓烘墍鏈夊紑鏀炬簮鐮佷腑鏈鍙嬪ソ鐨勭ぞ鍖轟箣涓銆?/font>

璁ㄨ璋鋒瓕嫻嬭瘯鐨勪綅緗?/font>

涓濡傛棦寰錛岃璁鴻胺姝屾祴璇曠殑瀹樻柟璋鋒瓕 c + + 嫻嬭瘯妗嗘灦鐨勮璁虹粍銆?/font>浣犱笉蹇呭疄闄呮彁浜や唬鐮侊紝浠ヤ究絳劇害銆?/font>鎮ㄧ殑鍙備笌鏈韓鏄疂璐電殑璐$尞銆?/font>

浣跨敤浠g爜

濡傛灉浣犳兂鎶婁綘鐨勬墜寮勮剰涓庡唴璋鋒瓕嫻嬭瘯鐨勪唬鐮侊紝榪欐槸浣犵殑閮ㄥ垎銆?/p>

絳懼嚭棰犺鐨勬潵婧?/font>

絳懼嚭璋鋒瓕嫻嬭瘯婧愭槸鏈鏈夌敤鐨勫鏋滄偍璁″垝璋冩暣鑷繁銆?/font>璋鋒瓕嫻嬭瘯浣跨敤棰犺瀹㈡埛绔紝浣?Google Code 涓婃壙杞界殑浠諱綍鍏朵粬欏圭洰絳懼嚭婧愩?/font>璇峰浣曞仛榪欎歡浜嬬殑婧愪唬鐮佽闂〉錛屽弬闃呰鎸囦護銆?/font>

浠庢簮浠g爜緙栬瘧

涓鏃︽偍絳懼嚭璇ヤ唬鐮侊紝鎮ㄥ彲浠ユ壘鍒版湁鍏沖浣曠紪璇戝畠鐨?a rel="nofollow" target="_top" style="color: #0000cc; ">鑷堪鏂囦歡涓殑璇存槑銆?/p>

嫻嬭瘯

涓涓祴璇曟鏋舵槸涓嶅ソ錛屽鏋滄湰韜笉褰誨簳鐨勬祴璇曘?/font>嫻嬭瘯搴旂紪鍐欑殑浠諱綍鏂扮殑浠g爜錛屽茍搴斿湪鎻愪氦瀹℃煡涓嶆墦鐮寸幇鏈夌殑嫻嬭瘯楠岃瘉鏇存敼銆?/font>瑕佹墽琛屾祴璇曪紝鎸夌収鑷堪鏂囦歡涓殑璇存槑錛屽茍楠岃瘉涓嶅瓨鍦ㄤ換浣曟晠闅溿?/font>

璐$尞浠g爜

鎴戜滑寰堟縺鍔ㄨ胺姝屾祴璇曠幇鍦ㄦ槸寮婧愮殑鍜屽笇鏈涗粠紺句細寰楀埌寰堝ぇ鐨勪慨琛ョ▼搴忋?/font>鍦ㄦ偍鏈鍠滅埍鐨?IDE 鐐圭噧騫跺紑濮嬪湴鏁插嚮鐫榪欓」鏂板姛鑳戒箣鍓嶏紝涓嶈繃錛岃鑺辨椂闂撮槄璇繪湰鑺傚拰鐞嗚В榪欎竴榪涚▼銆?/font>灝界瀹冪湅璧鋒潵涓ユ牸錛屾垜浠淇濇寔楂樻爣鍑嗙殑璐ㄩ噺鍩烘湰浠g爜銆?/font>

鍙備笌鑰呯殑璁稿彲鍗忚

鎴戜滑鍙互鎺ュ彈浠諱綍浠g爜涔嬪墠錛屾偍蹇呴』娉ㄥ唽鍙備笌鑰呰鍙崗璁?(CLA)銆?/font>鍏辮江浜氭補閰鎬繚鎶ゆ偍鍜屾垜浠?/font>

  • 濡傛灉鎮ㄦ槸涓漢鍐欎綔鍘熷婧愪唬鐮侊紝浣犵煡閬撲綘鑷繁鐨勭煡璇嗕駭鏉冿紝閭d箞浣犻渶瑕佺緗?a rel="nofollow" target="_top" style="color: #0000cc; ">涓埆鍏辮江浜氭補閰?/a>.
  • 濡傛灉浣犲伐浣滅殑鍏徃鎯寵鍏佽鎮ㄥ皢鎮ㄧ殑宸ヤ綔鏈夊姪浜庤胺姝屾祴璇曪紝鐒跺悗灝嗛渶瑕佺緗?a rel="nofollow" target="_top" style="color: #0000cc; ">鍏徃鍏辮江浜氭補閰?/a>.

鎸夌収涓婇潰鐨勪袱涓摼鎺ヨ闂浉搴旂殑鍏辮江浜氭補閰稿拰絳劇講騫惰繑鍥炲畠鐨勮鏄庛?/p>

緙栫爜椋庢牸

鑻ヨ淇濇寔婧愪竴鑷寸殑銆?鍙鐨?diffable 鍜屾槗浜庡悎騫訛紝鎴戜滑浣跨敤鐩稿綋姝繪澘鐨勭紪鐮侀鏍鹼紝濡傜敱google styleguide欏圭洰瀹氫箟銆?/font>棰勮鎵鏈変慨琛ョ▼搴忓皢絎﹀悎鎵榪扮殑椋庢牸鍦ㄨ繖閲?/a>.

鏇存柊鐢熸垚鐨勪唬鐮?/font>

璋鋒瓕嫻嬭瘯鐨勬簮浠g爜鏂囦歡鐨勪竴浜涚敱娉靛伐鍏?錛圥ython 鑴氭湰錛?鐢熸垚銆?/font>濡傛灉鎮ㄩ渶瑕佹洿鏂拌繖浜涙枃浠訛紝璇蜂慨鏀規簮 錛?tt style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; font-size: 12px; max-width: 66em; ">foo.h.pump錛夛紝騫墮噸鏂扮敓鎴愮殑 c + + 鏂囦歡浣跨敤娉點?/font>鎮ㄥ彲浠ラ槄璇?a target="_top" style="color: #0000cc; ">PumpManual鐨勮緇嗕俊鎭?/font>

鎻愪氦鐨勪慨琛ョ▼搴?/font>

璇蜂笉瑕佹彁浜や唬鐮併?/font>涓嬮潰鏄偍闇瑕佸仛浠涔堬細

  1. 閫氬父鎮ㄥ簲榪涜鏇存敼 SVN 鏍戝共鐨勫垎鏀垨鏍囪錛岃屼笉鏄拡瀵瑰悗闈㈢殑涓や釜鐗堟湰鎺у埗錛屽簲琚涓轟富瑕佷負鍙銆?/li>
  2. 鍐沖畾鎮ㄦ兂鎻愪氦鍝簺鐨勪唬鐮併?/font>鎻愪氦搴旇В鍐充竴涓棶棰樹腑鐨?a rel="nofollow" target="_top" style="color: #0000cc; ">Google 嫻嬭瘯闂璺熻釜鍣?/a>鐨勪竴緇勬洿鏀廣?/font>璇蜂笉瑕佹販鍚堝涓昏緫鏇存敼姣忔彁浜わ紝鍥犱負瀹冧嬌鍘嗗彶闅捐拷銆?/font>濡傛灉浣犳兂鏈夋墍鏀瑰彉錛屽湪闂璺熻釜鍣ㄦ病鏈変竴涓浉搴旂殑闂錛岃鍒涘緩涓涓?/font>
  3. 姝ゅ錛屽崗璋冧笌鍥㈤槦鎴愬憳鐨勯棶棰樹笂鍒楀嚭銆?/font>榪欏彲浠ョ‘淇濆伐浣滀笉姝e湪澶嶅埗鍜屾矡閫氫綘鐨勮鍒掓棭涓鑸篃浼氬鑷存洿濂界殑淇ˉ紼嬪簭銆?/font>
  4. 紜繚鎮ㄧ殑浠g爜鍧氬畧璋鋒瓕嫻嬭瘯婧愪唬鐮佹牱寮?/a>.
  5. 紜繚鎮ㄧ殑浠g爜鐨勫崟鍏冩祴璇曘?/li>
  6. 絳懼悕鍙備笌鑰呯殑璁稿彲鍗忚銆?/li>
  7. 鍒涘緩浣跨敤svn diff淇ˉ紼嬪簭鏂囦歡.
  8. 鎴戜滑浣跨敤閲岀壒闊﹀皵榪涜鍩轟簬 web 鐨勪唬鐮佸鏌ャ?/font>鎮ㄥ彲浠ラ槄璇繪湁鍏寵宸ュ叿鍦ㄨ繖閲?/a>銆?/font>褰撴偍鍑嗗灝辯華鏃朵笂, 浼犳偍鐨勪慨琛ョ▼搴忛氳繃鍐墮噾騫墮氱煡googletestframework@googlegroups.com浣滃嚭媯璁ㄣ?/font>鏈夊嚑縐嶆柟娉曞彲浠ヤ笂杞借淇ˉ紼嬪簭銆?/font>鎴戜滑寤鴻浣跨敤upload_gtest.py鑴氭湰涓紝鎮ㄥ彲浠ユ煡鎵?tt style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; font-size: 12px; max-width: 66em; ">鑴氭湰 / SVN 鏍戝共涓殑鏂囦歡澶廣?/font>

璋鋒瓕嫻嬭瘯鐙珛鑷富

璋鋒瓕嫻嬭瘯宸ョ▼鍥㈤槦鐨勫綋鍓嶆垚鍛樼洰鍓嶆槸鍞竴鐨勭嫭绔嬭嚜涓匯?/font>鍦ㄥ悆鑷繁鐨勮瘯鐢ㄧ殑浼熷ぇ浼犵粺錛屾垜浠害浼氳瀹氭瘡涓柊鏉ヨ禋鍙栨潈鎴愪負濮斿憳浼氭寜鐓т笅闈㈢殑榪囩▼鍦ㄦ鏂囨。涓紝璋鋒瓕嫻嬭瘯宸ョ▼鍥㈤槦鎴愬憳緙栧啓浠g爜濮嬬粓寰堝ぇ錛屽茍婕旂ず閲嶅浠栨垨濂圭湡姝h幏鍙栬胺姝屾祴璇曠殑紱呭畻銆?/font>

鍙戝竷榪囩▼

鎴戜滑閬靛驚棰犺鍩轟簬欏圭洰鐨勫吀鍨嬮噴鏀捐繃紼嬶細

  1. 鍒涘緩鍚嶄負閲婃斁 X.Y閲婃斁鍒嗘敮銆?/li>
  2. Bug 鍥哄畾鐨勬爲騫?錛?娣誨姞鐨勫姛鑳?/font>榪欎簺涓埆鐨勪慨琛ョ▼搴忓悎騫跺埌閲婃斁縐戞墠紼沖畾銆?/font>
  3. 涓漢鍗曠偣鍙戣鐗?( Z鍦?tt style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; font-size: 12px; max-width: 66em; ">X.Y.Z) 鎻愬嚭浠庡垎鏀垱寤烘爣絳俱?/li>
  4. 閲嶅姝ラ 2 鍜?3錛屾暣涓竴涓彂甯冨懆鏈?錛堝鐢卞姛鑳芥垨鏃墮棿錛夈?/li>
  5. 榪斿洖鍒版楠?1錛屽垱寤哄彟涓涓増鏈垎鏀紝絳夌瓑銆?/li>

姝ら〉鍩轟簬浠?a rel="nofollow" target="_top" style="color: #0000cc; ">璋鋒瓕 Web 宸ュ叿鍖?/a>欏圭洰鎸囧崡浣?GWT 鏇村ソ銆?/font>闄や簡浣滀負鍒?a rel="nofollow" target="_top" style="color: #0000cc; ">鎸囧嚭錛岃緗戦〉鐨勫唴瀹硅璁稿彲鍒涙柊鐭ヨ瘑鍏變韓緗插悕 2.5 璁稿彲璇?/a>.



RTY 2011-09-26 20:55 鍙戣〃璇勮
]]>
V1_6_FAQ 鎻愮ず鍜屽父瑙侀棶棰樺叧浜庤胺姝?c + + 嫻嬭瘯妗嗘灦http://www.shnenglu.com/lauer3912/archive/2011/09/26/156884.htmlRTYRTYMon, 26 Sep 2011 12:53:00 GMThttp://www.shnenglu.com/lauer3912/archive/2011/09/26/156884.htmlhttp://www.shnenglu.com/lauer3912/comments/156884.htmlhttp://www.shnenglu.com/lauer3912/archive/2011/09/26/156884.html#Feedback0http://www.shnenglu.com/lauer3912/comments/commentRss/156884.htmlhttp://www.shnenglu.com/lauer3912/services/trackbacks/156884.html闃呰鍏ㄦ枃

RTY 2011-09-26 20:53 鍙戣〃璇勮
]]>
V1_6_XcodeGuide 鍦?Mac OS X 涓?Xcode 浣跨敤璋鋒瓕嫻嬭瘯妗嗘灦鎸囧崡 http://www.shnenglu.com/lauer3912/archive/2011/09/26/156882.htmlRTYRTYMon, 26 Sep 2011 12:48:00 GMThttp://www.shnenglu.com/lauer3912/archive/2011/09/26/156882.htmlhttp://www.shnenglu.com/lauer3912/comments/156882.htmlhttp://www.shnenglu.com/lauer3912/archive/2011/09/26/156882.html#Feedback0http://www.shnenglu.com/lauer3912/comments/commentRss/156882.htmlhttp://www.shnenglu.com/lauer3912/services/trackbacks/156882.html
鎼滅儲 
 瀵逛簬  
V1_6_XcodeGuide  
鍦?Mac OS X 涓?Xcode 浣跨敤璋鋒瓕嫻嬭瘯妗嗘灦鎸囧崡 
閮ㄧ講闃舵
鐢?a target="_top" style="color: #0000cc; white-space: nowrap; ">zhanyong...@gmail.com鏇存柊鐨?span title="Mon Apr 18 14:45:17 2011">2011 騫?4 鏈?18 鏃?/span>

鏈寚鍗楀皢浠嬬粛濡備綍鍦?Mac OS X 涓婄殑 Xcode 欏圭洰涓嬌鐢ㄨ胺姝屾祴璇曟鏋躲?/font>鏈暀紼嬪紑濮嬪揩閫熻В閲婁負鏈夌粡楠岀殑鐢ㄦ埛鍋氫粈涔堛?/font>蹇熻搗姝ュ悗鎸囧崡 銆?閮芥彁渚涗簡榪涗竴姝ョ殑瑙i噴姣忎釜姝ラ銆?/font>

蹇熷叆闂?/font>

榪欐槸蹇熸寚鍗楀湪 Xcode 欏圭洰涓嬌鐢ㄨ胺姝屾祴璇曘?/p>

  1. 浣跨敤姝ゅ懡浠ゅ湪緗戠珯涓嬭澆婧愪唬鐮侊細 svn 絳懼嚭 http://googletest.googlecode.com/svn/trunk/ googletest 鍙
  2. 寮鏀句腑鐨?tt style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; font-size: 12px; max-width: 66em; ">gtest.xcodeproj googletest-璇?鍙?xcode/鐩綍騫剁敓鎴?gtest.framework銆?/li>
  3. 鍚嶄負"UnitTests"綾諱技 Xcode 欏圭洰涓垱寤轟竴涓柊鐨?澹沖伐鍏?鐩爣
  4. 灝?gtest.framework 娣誨姞鍒版偍鐨勯」鐩紝騫跺皢鍏舵坊鍔犲埌"UnitTests"鐨?閾炬帴浜岃繘鍒朵笌鍥句功棣?鐢熸垚闃舵
  5. 娣誨姞鎮ㄧ殑鍗曞厓嫻嬭瘯鐨勬簮浠g爜浠?UnitTests"鐨?緙栬瘧鏉ユ簮"鐢熸垚闃舵
  6. 緙栬緫"UnitTests"鍙墽琛屾枃浠跺茍娣誨姞鐜鍙橀噺鍛藉悕涓?DYLD_FRAMEWORK_PATH"鍊肩瓑浜庢鏋跺寘鍚?gtest.framework 鐩稿浜庡凡緙栬瘧鐨勫彲鎵ц鏂囦歡鐨勮礬寰勩?/li>
  7. 鐢熸垚騫惰漿
浠ヤ笅鍚勮妭榪涗竴姝ヨВ閲婃瘡涓繁搴︼紝鏇磋緇嗗湴鎻忚堪浜嗗浣曞畬鎴愬畠鍖呮嫭涓浜涘彉鍖栧湪涓婇潰鍒楀嚭鐨勬楠ゃ?/font>

鑾峰彇婧?/font>

鐩墠錛屾澶勮璁虹殑 gtest.framework 鏍囪鐨勮胺姝屾祴璇曠増鏈腑涓嶅彲鐢紝鍙湁鍦ㄦ爲騫層?/font>瑙i噴鍦ㄨ胺姝屾祴璇?a rel="nofollow" target="_top" style="color: #0000cc; ">緗戠珯錛屼綘鍙互寰楀埌浠g爜浠庡尶鍚?SVN 浣跨敤姝ゅ懡浠わ細

svn checkout http://googletest.googlecode.com/svn/trunk/ googletest-read-only

鎴栬咃紝濡傛灉鎮ㄦ鍦ㄤ嬌鐢ㄩ瑕嗘偍鑷繁鐨勪唬鐮佸簱涓紝鍙互娣誨姞 Google Test 浣滀負澶栭儴鐩稿叧鎬ч瑕嗚祫鏂欏簱銆?/font>鎸夌収榪欑鏂規硶錛岀鍑?svn 瀛樺偍搴擄紝鎵鏈変漢閮借繕灝嗘敹鍒頒竴浠?Google 嫻嬭瘯 錛堢壒瀹氱殑鐗堟湰錛屽鏋滄偍鎰挎剰錛?鑰屼笉蹇呮樉寮忕鍑恒?/font>榪欎竴緇勭殑緇勬垚欏圭洰綆鍗曞茍鍑忓皯澶嶅埗鍒板瓨鍌ㄥ簱涓殑浠g爜銆?/font>

鑻ヨ浣跨敤svn:externals錛屽喅瀹氳灝嗗叿鏈夊閮ㄦ簮椹葷暀銆?/font>鍥犱負浣犳兂瑕佸垎鏀殑涓閮ㄥ垎榪涜鍙戝竷鏃訛紝鎮ㄥ彲浠ラ夋嫨鎶婃爲騫插唴, 澶栭儴婧愩?/font>鐒惰岋紝鎶婂畠縐頒負third-party/googletest/1.0.1綾諱技鐨勭増鏈爣璁扮殑鐩綍涓殑鏍戝共浠ュ錛屾槸鍙︿竴縐嶉夋嫨銆?/font>涓鏃﹀緩绔嬩簡浣嶇疆錛屽垯浣跨敤svn propedit svn:externals _directory_ svn:externals 灞炴ц緗瀛樺偍搴撲腑鐨勭洰褰曘?/font>姝ょ洰褰曚笉鑳藉寘鍚殑浠g爜錛屼絾瀹冪殑鐗堟湰鎺у埗鐨勭埗鐩綍銆?/font>

鍛戒護svn propedit灝嗕細鍑虹幇浣犻瑕嗙紪杈戝櫒涓紝浣跨紪杈戞洿綆鍗曢暱錛岋紙鍙兘澶氳錛?鐨勫睘鎬с?/font>榪欏悓涓縐嶆柟娉曞彲鐢ㄤ簬媯鏌ュ嚭鏍囪鐨勫垎鏀紝閫氳繃浣跨敤鐩稿簲鐨?URL 錛堜緥濡?tt style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; font-size: 12px; max-width: 66em; ">http://googletest.googlecode.com/svn/tags/release-1.0.1錛夈?/font>鍙﹀錛宻vn:externals 灞炴у厑璁哥殑鐗瑰畾淇鐗堢殑鏍戝共涓庤鑼?tt style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; font-size: 12px; max-width: 66em; ">-r_ # # _閫夐」 錛堜緥濡?tt style="font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; font-size: 12px; max-width: 66em; ">鐨勫閮ㄥ璞?src/googletest-r60 http://googletest.googlecode.com/svn/trunk).

榪欓噷鏄竴涓」鐩?(闃呰閫氳繃svn propget) 鏍戝共涓婁嬌鐢?svn:externals 灞炴х殑紺轟緥銆?/font>姝ゅ煎皢絳懼嚭鍒拌胺姝屾祴璇曠殑鍓湰涓誨共/澶栭儴瀵硅薄/src/googletest/鐩綍銆?/font>

[Computer:svn] user$ svn propget svn:externals trunk
externals
/src/googletest http://googletest.googlecode.com/svn/trunk

鍚戦」鐩腑娣誨姞妗嗘灦

涓嬩竴姝ユ槸寤虹珛騫跺皢 gtest.framework 娣誨姞鍒版偍鑷繁鐨勯」鐩?/font>鏈寚鍗楁弿榪頒簡涓嬮潰鐨勪袱縐嶅父鐢ㄦ柟娉曘?/font>

  • 閫夐」 1 ---灝嗚胺姝屾祴璇曟坊鍔犲埌鎮ㄨ嚜宸辯殑欏圭洰錛屾渶綆鍗曠殑鏂規硶灝辨槸鎵撳紑 gtest.xcodeproj (xcode 涓彂鐜拌胺姝屾祴璇曟爲騫茬殑鐩綍錛?鍜屾墜鍔ㄦ瀯寤烘鏋躲?/font>鐒跺悗錛屽皢鐢熸垚鐨勬鏋舵坊鍔犲埌鎮ㄧ殑欏圭洰浣跨敤"娣誨姞-> 鐜版湁妗嗘灦 … …"浠庝笂涓嬫枃鑿滃崟鎴?欏圭洰-> 娣誨姞..."浠庝富鑿滃崟銆?/font>Gtest.framework 鏄彲閲嶅畾浣嶏紝騫跺寘鍚〉鐪夊拰鎮ㄩ渶瑕佽繘琛屾祴璇曠殑鐩爣浠g爜銆?/font>姝ゆ柟娉曡姹傞噸寤烘瘡嬈℃偍鍗囩駭璋鋒瓕嫻嬭瘯鎮ㄧ殑欏圭洰涓?/font>
  • 閫夐」 2 ---濡傛灉鎮ㄦ墦綆楀皢涓虹敓鐨勮胺姝屾祴璇曟爲騫詫紝鍏舵渶鏂扮殑鍔熻兘綰沖叆鎮ㄧ殑鍗曞厓嫻嬭瘯 錛堟垨鑷繁鏄胺姝屾祴璇曞紑鍙戜漢鍛橈級銆?/font>浣犺閲嶅緩妗嗘灦錛屾瘡嬈℃洿鏂版簮銆?/font>瑕佽繖鏍峰仛錛屾偍闇瑕佸皢 gtest.xcodeproj 鏂囦歡錛屾鏋舵湰韜紝娣誨姞鍒版偍鑷繁 Xcode 欏圭洰銆?/font>鐒跺悗錛屼粠鐢熸垚浜у搧欏圭洰鐨勪笁瑙掑艦鍙戠幇錛屾偍鍙互鎵懼埌 gtest.framework錛屽彲浠ユ坊鍔犲埌浣犵殑鐩爣 錛堜互涓嬭璁猴級銆?/font>

浣挎祴璇曠洰鏍?/font>

瑕佸紑濮嬬紪鍐欐祴璇曪紝浣挎柊鐨?澹沖伐鍏?鐩爣銆?/font>姝ょ洰鏍囨ā鏉挎槸 BSD銆?鍙彲銆?鎴栫⒊涓嬪彲鐢ㄣ?/font>娣誨姞鎮ㄧ殑鍗曞厓嫻嬭瘯鐨勭洰鏍?緙栬瘧鏉ユ簮"鐢熸垚闃舵鐨勬簮浠g爜銆?/font>

鎺ヤ笅鏉ワ紝浣犺鍦ㄤ袱縐嶄笉鍚屾柟娉曚腑娣誨姞 gtest.framework錛屽彇鍐充簬鍝釜閫夐」鎮ㄩ夋嫨浠ヤ笂銆?/p>

  • 閫夐」 1 ---鍦ㄧ紪璇戞湡闂達紝Xcode 灝嗛渶瑕佺煡閬撴偍瑕侀摼鎺ュ gtest.framework銆?/font>灝?gtest.framework 娣誨姞鍒版偍鐨勬祴璇曠洰鏍囩殑"閾炬帴浜岃繘鍒朵笌鍥句功棣?鐢熸垚闃舵銆?/font>榪欏皢鍖呮嫭璋鋒瓕嫻嬭瘯澶村湪鏍囬鎼滅儲璺緞涓紝騫跺皢鍛婅瘔閾炬帴鍣ㄥ湪鍝噷鍙互鎵懼埌鐨勫簱銆?/font>
  • 閫夐」 2 ---濡傛灉鎮ㄥ伐浣滅殑鏍戝共錛屼綘涔熻灝?gtest.framework 娣誨姞鍒版偍鐨勬祴璇曠洰鏍囩殑浣?閾炬帴浜岃繘鍒朵笌鍥句功棣?鐢熸垚闃舵銆?/font>姝ゅ錛屼綘瑕佸皢 gtest.framework 浣滀負渚濊禆欏規坊鍔犲埌浣犵殑鍗曞厓嫻嬭瘯鐩爣銆?/font>榪欑鏂瑰紡錛孹code 灝嗙‘淇濊 gtest.framework 鏄埌鐩墠涓烘錛屾瘡嬈℃偍鐨勬瀯寤轟綘鐨勭洰鏍囥?/font>鏈鍚庯紝濡傛灉浣犱笉浣跨敤璋鋒瓕嫻嬭瘯鍏變韓鐢熸垚鐩綍錛屼綘寰楀皢 gtest.framework 澶嶅埗鍒版偍鑷繁鐢熸垚浜у搧鐩綍錛屼嬌鐢?榪愯鑴氭湰"鐢熸垚闃舵銆?/font>

璁劇疆鍙墽琛屾枃浠惰繍琛岀幆澧?/font>

鍙墽琛屽崟鍏冩祴璇曟槸澹崇殑宸ュ叿錛屽洜涓哄畠娌℃湁涓鎹嗭紝鍐呭/妗嗘灦鐨勭洰褰曪紝鍦ㄥ叾涓斁緗?gtest.framework銆?/font>鐩稿弽錛屽繀欏誨湪榪愯鏃跺憡璇夊姩鎬侀摼鎺ュ櫒鎼滅儲涓殑鍙︿竴涓綅緗殑妗嗘灦銆?/font>榪欏彲浠ラ氳繃鍦?緙栬緫媧誨姩鐨勫彲鎵ц鏂囦歡..."涓緗殑"DYLD_FRAMEWORK_PATH"鐨勭幆澧冨彉閲?/font>鍙傛暟閫夐」鍗★紝鍦?璁劇疆鐜鍙橀噺錛?銆?/font>姝ゅ肩殑璺緞鏄洰褰曠殑鍖呭惈 gtest.framework 鐨勮礬寰?錛堢浉瀵規垨緇濆錛夈?/font>

濡傛灉鎮ㄨ繕娌℃湁璁劇疆 DYLD_FRAMEWORK_PATH錛屾紜紝鍙兘浼氬緱鍒拌繖鏍蜂竴鏉℃秷鎭細

[Session started at 2008-08-15 06:23:57 -0600.]
  dyld
: Library not loaded: @loader_path/../Frameworks/gtest.framework/Versions/A/gtest
   
Referenced from: /Users/username/Documents/Sandbox/gtestSample/build/Debug/WidgetFrameworkTest
   
Reason: image not found

瑕佹紜繖涓棶棰橈紝蹇呴』鍖呭惈鍙墽琛屾枃浠朵腑鎸囧畾鐨勭洰褰?浠庡紩鐢細"涓婅堪閿欒娑堟伅涓殑鍊箋?/font>鐒跺悗錛屽湪姝や綅緗殑緇堢錛屽彂鐜板寘鍚?gtest.framework 鐨勭洰褰曠殑鐩稿璺緞銆?/font>榪欏氨鏄綘闇瑕佽緗負 DYLD_FRAMEWORK_PATH 鐨勫箋?/font>

鐢熸垚騫惰漿

鐜板湪錛屽綋鎮ㄥ崟鍑?鐢熸垚璧?錛屽皢浼氭墽琛屾祴璇曘?/font>鍊懼掑嚭榪欐牱鐨勪簨錛?/font>

[Session started at 2008-08-06 06:36:13 -0600.]
[==========] Running 2 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 2 tests from WidgetInitializerTest
[ RUN      ] WidgetInitializerTest.TestConstructor
[       OK ] WidgetInitializerTest.TestConstructor
[ RUN      ] WidgetInitializerTest.TestConversion
[       OK ] WidgetInitializerTest.TestConversion
[----------] Global test environment tear-down
[==========] 2 tests from 1 test case ran.
[  PASSED  ] 2 tests.

The Debugger has exited with status 0.  

鎽樿

鍗曞厓嫻嬭瘯鏄湁浠峰肩殑鏂瑰紡錛岀‘淇濅綘鐨勬暟鎹ā鍨嬩繚鎸佹湁鏁堬紝鍗充嬌鍦ㄥ揩閫熷彂灞曡繃紼嬩腑鎴栭噸鏋勩?/font>璋鋒瓕嫻嬭瘯妗嗘灦鏄紵澶у崟鍏冩祴璇曟鏋訛紝C 鍜?c + + 浜庝竴浣撶殑涓?Xcode 寮鍙戠幆澧冨緢濂姐?/font>



RTY 2011-09-26 20:48 鍙戣〃璇勮
]]>
V1_6_AdvancedGuide 鍏充簬浣跨敤璋鋒瓕 c + + 嫻嬭瘯妗嗘灦鐨勯珮綰х殑涓婚http://www.shnenglu.com/lauer3912/archive/2011/09/26/156881.htmlRTYRTYMon, 26 Sep 2011 12:41:00 GMThttp://www.shnenglu.com/lauer3912/archive/2011/09/26/156881.htmlhttp://www.shnenglu.com/lauer3912/comments/156881.htmlhttp://www.shnenglu.com/lauer3912/archive/2011/09/26/156881.html#Feedback0http://www.shnenglu.com/lauer3912/comments/commentRss/156881.htmlhttp://www.shnenglu.com/lauer3912/services/trackbacks/156881.html闃呰鍏ㄦ枃

RTY 2011-09-26 20:41 鍙戣〃璇勮
]]>
V1_6_Samples 璋鋒瓕 c + + 嫻嬭瘯妗嗘灦鏍鋒湰http://www.shnenglu.com/lauer3912/archive/2011/09/26/156879.htmlRTYRTYMon, 26 Sep 2011 12:30:00 GMThttp://www.shnenglu.com/lauer3912/archive/2011/09/26/156879.htmlhttp://www.shnenglu.com/lauer3912/comments/156879.htmlhttp://www.shnenglu.com/lauer3912/archive/2011/09/26/156879.html#Feedback0http://www.shnenglu.com/lauer3912/comments/commentRss/156879.htmlhttp://www.shnenglu.com/lauer3912/services/trackbacks/156879.html
鎼滅儲 
 瀵逛簬  
V1_6_Samples  
璋鋒瓕 c + + 嫻嬭瘯妗嗘灦鏍鋒湰
鐢?a target="_top" style="color: #0000cc; white-space: nowrap; ">zhanyong...@gmail.com鏇存柊鐨?span title="Mon Apr 18 14:45:17 2011">2011 騫?4 鏈?18 鏃?/span>

濡傛灉浣犳兂鍜屾垜浠竴鏍鳳紝浣犳兂鐪嬩竴浜涜胺姝屾祴璇曠ず渚嬩唬鐮併?/font>Samples 鏂囦歡澶?/a>鍏鋒湁澶ч噺娉ㄩ噴紺轟緥婕旂ず浜嗗浣曚嬌鐢ㄥ悇縐嶈胺姝屾祴璇曞姛鑳姐?/font>

  • 紺轟緥 # 1鏄劇ず浜嗕嬌鐢ㄨ胺姝屾祴璇曟潵嫻嬭瘯 c + + 鍑芥暟鐨勫熀鏈楠ゃ?/li>
  • 紺轟緥 # 2鏄劇ず浜嗕竴綾誨叿鏈夊涓垚鍛樺嚱鏁版洿澶嶆潅鐨勫崟鍏冩祴璇曘?/li>
  • 紺轟緥 # 3浣跨敤嫻嬭瘯澶瑰叿銆?/li>
  • 紺轟緥 # 4緗簬鍩哄噯嫻嬭瘯澶瑰叿銆?鍏變韓嫻嬭瘯閫昏緫鍜屾淳鐢熷す鍏蜂腑閲嶆柊浣跨敤瀹冦?/li>
  • 紺轟緥 # 5鏁欏浣曢氳繃浠庡畠媧劇敓 sub-fixtures 閲嶇敤嫻嬭瘯澶瑰叿鍦ㄥ涓祴璇曠敤渚嬨?/li>
  • # 6 紺轟緥婕旂ず綾誨瀷鍙傛暟嫻嬭瘯銆?/li>
  • 紺轟緥 # 7鏁欏煎弬鏁版祴璇曠殑鍩烘湰鐭ヨ瘑銆?/li>
  • 紺轟緥 # 8鏄劇ず鍊煎弬鏁版祴璇曚腑浣跨敤Combine() 銆?/li>
  • 紺轟緥 # 9鏄劇ず浜嗕嬌鐢?API 淇敼 Google 嫻嬭瘯鎺у埗鍙拌緭鍑虹殑渚﹀惉鍣ㄥ拰媯鏌ユ祴璇曠粨鏋滃強鍏跺弽灝?API 鐨勪嬌鐢ㄣ?/li>
  • 紺轟緥 # 10鏄劇ず渚﹀惉鍣ㄧ殑 API 鏉ュ疄鐜板師濮嬪唴瀛樻硠婕忔嫻嬪櫒鐨勪嬌鐢ㄣ?/li>


RTY 2011-09-26 20:30 鍙戣〃璇勮
]]>
V1_6_Primer 鍏ラ棬璋鋒瓕 c + + 嫻嬭瘯妗嗘灦http://www.shnenglu.com/lauer3912/archive/2011/09/26/156878.htmlRTYRTYMon, 26 Sep 2011 12:28:00 GMThttp://www.shnenglu.com/lauer3912/archive/2011/09/26/156878.htmlhttp://www.shnenglu.com/lauer3912/comments/156878.htmlhttp://www.shnenglu.com/lauer3912/archive/2011/09/26/156878.html#Feedback0http://www.shnenglu.com/lauer3912/comments/commentRss/156878.htmlhttp://www.shnenglu.com/lauer3912/services/trackbacks/156878.html闃呰鍏ㄦ枃

RTY 2011-09-26 20:28 鍙戣〃璇勮
]]>
Google C++ Testing Framework綆浠?/title><link>http://www.shnenglu.com/lauer3912/archive/2011/09/19/156261.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Mon, 19 Sep 2011 13:03:00 GMT</pubDate><guid>http://www.shnenglu.com/lauer3912/archive/2011/09/19/156261.html</guid><wfw:comment>http://www.shnenglu.com/lauer3912/comments/156261.html</wfw:comment><comments>http://www.shnenglu.com/lauer3912/archive/2011/09/19/156261.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/lauer3912/comments/commentRss/156261.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/lauer3912/services/trackbacks/156261.html</trackback:ping><description><![CDATA[<span id="hvzpftn" class="Apple-style-span" style="font-family: verdana, sans-serif; font-size: 12px; line-height: 18px; background-color: #f8fafd; "><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>綆浠嬶細</strong> Google 鎻愪緵涓縐嶇敤浜庝負 C/C++ 杞歡寮鍙戝崟鍏冩祴璇曠殑寮鏀炬簮鐮佹鏋訛紝瀹冨緢鏈夋剰鎬濓紝涔熷緢瀹規槗浣跨敤銆傛湰鏂囦粙緇嶄竴浜涙瘮杈冩湁鐢ㄧ殑 Google C++ Testing Framework 鐗規с傛湰鏂囧熀浜?version 1.4銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>涓轟粈涔堣浣跨敤 Google C++ Testing Framework錛?/strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">浣跨敤榪欎釜妗嗘灦鏈夎澶氬ソ鐞嗙敱銆傛湰鑺傝璁哄叾涓嚑涓?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">鏌愪簺綾誨瀷鐨勬祴璇曟湁緋熺硶鐨勫唴瀛橀棶棰橈紝榪欎簺闂鍙湪鏌愬嚑嬈¤繍琛屾湡闂村嚭鐜般侴oogle 鐨勬祴璇曟鏋朵負澶勭悊榪欑鎯呭喌鎻愪緵浜嗗嚭鑹茬殑鏀寔銆傚彲浠ヤ嬌鐢?Google 妗嗘灦閲嶅榪愯鐩稿悓鐨勬祴璇曚竴鍗冩銆傚綋鍑虹幇鏁呴殰鐨勮抗璞℃椂錛岃嚜鍔ㄥ湴璋冪敤璋冭瘯鍣ㄣ傚彟澶栵紝榪欏彧闇瑕佸湪鍛戒護琛屼笂浼犻掍袱涓紑鍏沖嵆鍙疄鐜幫細--gtest_repeat=1000 --gtest_break_on_failure銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">涓庡叾浠栬澶氭祴璇曟鏋剁浉鍙嶏紝鍙互鎶?Google 嫻嬭瘯妗嗘灦鍐呯疆鐨勬柇璦閮ㄧ講鍦ㄧ鐢ㄤ簡寮傚父澶勭悊錛堥氬父鐢變簬鎬ц兘鍘熷洜錛夌殑杞歡涓傚洜姝わ紝涔熷彲浠ュ湪鏋愭瀯鍑芥暟涓畨鍏ㄥ湴浣跨敤鏂█銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">榪愯嫻嬭瘯寰堢畝鍗曘傚彧闇璋冪敤棰勫畾涔夌殑 RUN_ALL_TESTS 瀹忥紝鑰屼笉闇瑕侀氳繃鍒涘緩鎴栭┍鍔ㄥ崟鐙殑榪愯鍣ㄧ被鏉ユ墽琛屾祴璇曘傝繖姣?CppUnit 絳夋鏋舵柟渚垮浜嗐?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">鍙渶浼犻掍竴涓紑鍏沖嵆鍙敓鎴?Extensible Markup Language (XML) 鎶ュ憡錛?--gtest_output="xml:<file name>"銆傚湪 CppUnit 鍜?CppTest 絳夋鏋朵腑錛岄渶瑕佺紪鍐欏緢澶氫唬鐮佹墠鑳界敓鎴?XML 杈撳嚭銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">鍒涘緩鍩烘湰嫻嬭瘯</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">璇瘋冭檻 娓呭崟 1 鎵紺虹殑騫蟲柟鏍瑰嚱鏁扮殑鍘熷瀷銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>娓呭崟 1. 騫蟲柟鏍瑰嚱鏁扮殑鍘熷瀷</strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">double square-root (const double);</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">瀵逛簬璐熸暟錛岃繖涓緥紼嬭繑鍥?-1銆傛鏁版祴璇曞拰璐熸暟嫻嬭瘯瀵瑰畠閮芥湁鎰忎箟錛屾墍浠ユ垜浠紪鍐欎袱涓祴璇曘傛竻鍗?2 緇欏嚭嫻嬭瘯鐢ㄤ緥銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>娓呭崟 2. 騫蟲柟鏍瑰嚱鏁扮殑鍗曞厓嫻嬭瘯</strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">#include "gtest/gtest.h"</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">TEST (SquareRootTest, PositiveNos) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">EXPECT_EQ (18.0, square-root (324.0));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">EXPECT_EQ (25.4, square-root (645.16));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">EXPECT_EQ (50.3321, square-root (2533.310224));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">TEST (SquareRootTest, ZeroAndNegativeNos) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">ASSERT_EQ (0.0, square-root (0.0));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">ASSERT_EQ (-1, square-root (-22.0));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">娓呭崟 2 鍒涘緩涓涓悕涓?SquareRootTest 鐨勬祴璇曞眰嬈$粨鏋勶紝鐒跺悗鍦ㄥ叾涓坊鍔犱袱涓崟鍏冩祴璇?PositiveNos 鍜?ZeroAndNegativeNos銆俆EST 鏄湪 gtest.h錛堝彲浠ュ湪涓嬭澆鐨勬簮浠g爜涓壘鍒幫級涓畾涔夌殑棰勫畾涔夊畯錛屽畠甯姪瀹氫箟榪欎釜灞傛緇撴瀯銆侲XPECT_EQ 鍜?ASSERT_EQ 涔熸槸瀹?— 瀵逛簬鍓嶈咃紝鍗充嬌鍑虹幇嫻嬭瘯澶辮觸錛屾祴璇曚粛鐒剁戶緇墽琛岋紱瀵逛簬鍚庤咃紝嫻嬭瘯緇堟鎵ц銆傛樉鐒訛紝濡傛灉 0 鐨勫鉤鏂規牴鏄櫎 0 涔嬪鐨勪換浣曟暟瀛楋紝灝辨病蹇呰鍐嶆墽琛屾祴璇曚簡銆傚洜姝わ紝ZeroAndNegativeNos 嫻嬭瘯鍙嬌鐢?ASSERT_EQ錛岃?PositiveNos 嫻嬭瘯浣跨敤 EXPECT_EQ錛屾潵鎶ュ憡瀛樺湪澶氬皯涓祴璇曠敤渚嬫槸騫蟲柟鏍瑰嚱鏁板け璐ヨ屼笉緇堟嫻嬭瘯鐨勬儏鍐點?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>榪愯絎竴涓祴璇?/strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">鏃㈢劧宸茬粡鍒涘緩浜嗙涓涓熀鏈祴璇曪紝鐜板湪灝辮榪愯瀹冧簡銆傛竻鍗?3 鏄繍琛屾祴璇曠殑涓諱緥紼嬨?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>娓呭崟 3. 榪愯騫蟲柟鏍規祴璇?/strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">#include "gtest/gtest.h"</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">TEST(SquareRootTest, PositiveNos) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">EXPECT_EQ (18.0, square-root (324.0));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">EXPECT_EQ (25.4, square-root (645.16));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">EXPECT_EQ (50.3321, square-root (2533.310224));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">TEST (SquareRootTest, ZeroAndNegativeNos) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">ASSERT_EQ (0.0, square-root (0.0));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">ASSERT_EQ (-1, square-root (-22.0));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">int main(int argc, char **argv) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">::testing::InitGoogleTest(&argc, argv);</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">return RUN_ALL_TESTS();</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">欏懼悕鎬濅箟錛?:testing::InitGoogleTest 鏂規硶鐨勪綔鐢ㄥ氨鏄妗嗘灦榪涜鍒濆鍖栵紝蹇呴』鍦ㄨ皟鐢?RUN_ALL_TESTS 涔嬪墠璋冪敤瀹冦傚湪浠g爜涓彧鑳借皟鐢?RUN_ALL_TESTS 涓嬈★紝鍥犱負澶氭璋冪敤浼氫笌妗嗘灦鐨勪竴浜涢珮綰х壒鎬у啿紿侊紝涓嶆敮鎸佽繖縐嶅仛娉曘傛敞鎰忥紝RUN_ALL_TESTS 鑷姩鍦版帰嫻嬪茍榪愯鐢?TEST 瀹忓畾涔夌殑鎵鏈夋祴璇曘傚湪榛樿鎯呭喌涓嬶紝緇撴灉杈撳嚭鍒版爣鍑嗚緭鍑恒傛竻鍗?4 緇欏嚭杈撳嚭銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>娓呭崟 4. 榪愯騫蟲柟鏍規祴璇曠殑杈撳嚭</strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Running main() from user_main.cpp</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[==========] Running 2 tests from 1 test case.</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[----------] Global test environment set-up.</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[----------] 2 tests from SquareRootTest</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ RUN ] SquareRootTest.PositiveNos</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">..\user_sqrt.cpp(6862): error: Value of: sqrt (2533.310224)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Actual: 50.332</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Expected: 50.3321</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ FAILED ] SquareRootTest.PositiveNos (9 ms)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ RUN ] SquareRootTest.ZeroAndNegativeNos</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ OK ] SquareRootTest.ZeroAndNegativeNos (0 ms)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[----------] 2 tests from SquareRootTest (0 ms total)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[----------] Global test environment tear-down</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[==========] 2 tests from 1 test case ran. (10 ms total)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ PASSED ] 1 test.</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ FAILED ] 1 test, listed below:</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ FAILED ] SquareRootTest.PositiveNos</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">1 FAILED TEST</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>Google C++ Testing Framework 鐨勯夐」</strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">鍦?娓呭崟 3 涓紝InitGoogleTest 鍑芥暟鎺ュ彈嫻嬭瘯鍩虹璁炬柦鐨勫弬鏁般傛湰鑺傝璁哄彲浠ラ氳繃嫻嬭瘯妗嗘灦鐨勫弬鏁板疄鐜扮殑涓浜涘姛鑳姐?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">閫氳繃鍦ㄥ懡浠よ涓婁紶閫?--gtest_output="xml:report.xml"錛屽彲浠ユ妸杈撳嚭杞偍涓?XML 鏍煎紡銆傚綋鐒訛紝鍙互鎶?report.xml 鏇挎崲涓烘偍鍠滄鐨勪換浣曟枃浠跺悕銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">鏌愪簺嫻嬭瘯鏈夋椂鍊欎細澶辮觸錛屼絾鏄湪澶у鏁版椂鍊欎細欏哄埄閫氳繃銆傝繖鏄笌鍐呭瓨鎹熷潖鐩稿叧鐨勯棶棰樼殑鍏稿瀷鐗圭偣銆傚鏋滃嬈¤繍琛屾祴璇曪紝灝辮兘澶熸彁楂樺彂鐜板け璐ョ殑鍙兘鎬с傚鏋滃湪鍛戒護琛屼笂浼犻?--gtest_repeat=2 --gtest_break_on_failure錛屽氨閲嶅榪愯鐩稿悓鐨勬祴璇曚袱嬈°傚鏋滄祴璇曞け璐ワ紝浼氳嚜鍔ㄨ皟鐢ㄨ皟璇曞櫒銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">騫朵笉闇瑕佹瘡嬈¢兘榪愯鎵鏈夋祴璇曪紝灝ゅ叾鏄湪淇敼鐨勪唬鐮佸彧褰卞搷鏌愬嚑涓ā鍧楃殑鎯呭喌涓嬨備負浜嗘敮鎸佽繍琛屼竴閮ㄥ垎嫻嬭瘯錛孏oogle 鎻愪緵 --gtest_filter=<test string>銆倀est string 鐨勬牸寮忔槸鐢卞啋鍙?(:) 鍒嗛殧鐨勪竴緋誨垪閫氶厤絎︽ā寮忋備緥濡傦紝--gtest_filter=* 榪愯鎵鏈夋祴璇曪紝鑰?--gtest_filter=SquareRoot* 鍙繍琛?SquareRootTest 嫻嬭瘯銆傚鏋滃笇鏈涘彧榪愯 SquareRootTest 涓殑姝f暟鍗曞厓嫻嬭瘯錛屽簲璇ヤ嬌鐢?--gtest_filter=SquareRootTest.*-SquareRootTest.Zero*銆傛敞鎰忥紝SquareRootTest.* 琛ㄧず灞炰簬 SquareRootTest 鐨勬墍鏈夋祴璇曪紝鑰?-SquareRootTest.Zero* 琛ㄧず涓嶈繍琛屽悕縐頒互 Zero 寮澶寸殑嫻嬭瘯銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">娓呭崟 5 涓殑紺轟緥鐢?gtest_output銆乬test_repeat 鍜?gtest_filter 閫夐」榪愯 SquareRootTest銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>娓呭崟 5. 鐢?gtest_output銆乬test_repeat 鍜?gtest_filter 閫夐」榪愯 SquareRootTest</strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[arpan@tintin] ./test_executable --gtest_output="xml:report.xml" --gtest_repeat=2 --</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">gtest_filter=SquareRootTest.*-SquareRootTest.Zero*</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Repeating all tests (iteration 1) . . .</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Note: Google Test filter = SquareRootTest.*-SquareRootTest.Z*</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[==========] Running 1 test from 1 test case.</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[----------] Global test environment set-up.</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[----------] 1 test from SquareRootTest</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ RUN ] SquareRootTest.PositiveNos</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">..\user_sqrt.cpp (6854): error: Value of: sqrt (2533.310224)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Actual: 50.332</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Expected: 50.3321</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ FAILED ] SquareRootTest.PositiveNos (2 ms)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[----------] 1 test from SquareRootTest (2 ms total)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[----------] Global test environment tear-down</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[==========] 1 test from 1 test case ran. (20 ms total)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ PASSED ] 0 tests.</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ FAILED ] 1 test, listed below:</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ FAILED ] SquareRootTest.PositiveNos</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">1 FAILED TEST</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Repeating all tests (iteration 2) . . .</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Note: Google Test filter = SquareRootTest.*-SquareRootTest.Z*</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[==========] Running 1 test from 1 test case.</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[----------] Global test environment set-up.</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[----------] 1 test from SquareRootTest</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ RUN ] SquareRootTest.PositiveNos</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">..\user_sqrt.cpp (6854): error: Value of: sqrt (2533.310224)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Actual: 50.332</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Expected: 50.3321</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ FAILED ] SquareRootTest.PositiveNos (2 ms)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[----------] 1 test from SquareRootTest (2 ms total)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[----------] Global test environment tear-down</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[==========] 1 test from 1 test case ran. (20 ms total)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ PASSED ] 0 tests.</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ FAILED ] 1 test, listed below:</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ FAILED ] SquareRootTest.PositiveNos</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">1 FAILED TEST</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>涓存椂紱佺敤嫻嬭瘯</strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">鍙互涓存椂紱佺敤嫻嬭瘯鍚楋紵鍙互錛屽彧闇鍦ㄩ昏緫嫻嬭瘯鍚嶆垨鍗曞厓嫻嬭瘯鍚嶅墠闈㈠姞涓?DISABLE_ 鍓嶇紑錛屽畠灝變笉浼氭墽琛屼簡銆傛竻鍗?6 婕旂ず濡備綍紱佺敤 娓呭崟 2 涓殑 PositiveNos 嫻嬭瘯銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>娓呭崟 6. 涓存椂紱佺敤嫻嬭瘯</strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">#include "gtest/gtest.h"</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">TEST (DISABLE_SquareRootTest, PositiveNos) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">EXPECT_EQ (18.0, square-root (324.0));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">EXPECT_EQ (25.4, square-root (645.16));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">EXPECT_EQ (50.3321, square-root (2533.310224));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">OR</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">TEST (SquareRootTest, DISABLE_PositiveNos) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">EXPECT_EQ (18.0, square-root (324.0));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">EXPECT_EQ (25.4, square-root (645.16));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">EXPECT_EQ (50.3321, square-root (2533.310224));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">娉ㄦ剰錛屽鏋滅鐢ㄤ簡浠諱綍嫻嬭瘯錛孏oogle 妗嗘灦浼氬湪嫻嬭瘯鎵ц緇撴潫鏃惰緭鍑鴻鍛婃秷鎭紝瑙?娓呭崟 7銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>娓呭崟 7. Google 璀﹀憡鐢ㄦ埛鍦ㄦ鏋朵腑鏈夌鐢ㄧ殑嫻嬭瘯</strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">1 FAILED TEST</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">YOU HAVE 1 DISABLED TEST</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">濡傛灉甯屾湜緇х畫榪愯紱佺敤鐨勬祴璇曪紝閭d箞鍦ㄥ懡浠よ涓婁紶閫?-gtest_also_run_disabled_tests 閫夐」銆傛竻鍗?8 緇欏嚭榪愯 DISABLE_PositiveNos 嫻嬭瘯鏃剁殑杈撳嚭銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>娓呭崟 8. Google 鍏佽榪愯宸茬粡紱佺敤鐨勬祴璇?/strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[----------] 1 test from DISABLED_SquareRootTest</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ RUN ] DISABLED_SquareRootTest.PositiveNos</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">..\user_sqrt.cpp(6854): error: Value of: square-root (2533.310224)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Actual: 50.332</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Expected: 50.3321</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ FAILED ] DISABLED_SquareRootTest.PositiveNos (2 ms)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[----------] 1 test from DISABLED_SquareRootTest (2 ms total)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ FAILED ] 1 tests, listed below:</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">[ FAILED ] SquareRootTest. PositiveNos</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>鏂█</strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Google 嫻嬭瘯妗嗘灦鎻愪緵涓鏁村棰勫畾涔夌殑鏂█銆傛柇璦鍒嗕負涓ょ被 — 鍚嶇О浠?ASSERT_ 寮澶寸殑鏂█鍜屽悕縐頒互 EXPECT_ 寮澶寸殑鏂█銆傚鏋滀竴涓柇璦澶辮觸錛孉SSERT_* 鏂█浼氱粓姝㈢▼搴忔墽琛岋紝鑰?EXPECT_* 鏂█緇х畫榪愯銆傚綋鏂█澶辮觸鏃訛紝榪欎袱鑰呴兘杈撳嚭鏂囦歡鍚嶃佽鍙峰拰鍙畾鍒剁殑娑堟伅銆傛瘮杈冪畝鍗曠殑鏂█鍖呮嫭 ASSERT_TRUE (condition) 鍜?ASSERT_NE (val1, val2)銆傚墠鑰呮湡鏈涙潯浠舵繪槸鎴愮珛錛岃屽悗鑰呮湡鏈涗袱涓間笉鍖歸厤銆傝繖浜涙柇璦涔熼傜敤浜庣敤鎴峰畾涔夌殑綾誨瀷錛屼絾鏄繀欏昏鐩栫浉搴旂殑姣旇緝鎿嶄綔絎︼紙==銆?=銆?lt;= 絳夌瓑錛夈?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>嫻偣鏁版瘮杈?/strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Google 鎻愪緵 娓呭崟 9 鎵紺虹殑瀹忎互鏀寔嫻偣鏁版瘮杈冦?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>娓呭崟 9. 鐢ㄤ簬嫻偣鏁版瘮杈冪殑瀹?/strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">ASSERT_FLOAT_EQ (expected, actual)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">ASSERT_DOUBLE_EQ (expected, actual)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">ASSERT_NEAR (expected, actual, absolute_range)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">EXPECT_FLOAT_EQ (expected, actual)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">EXPECT_DOUBLE_EQ (expected, actual)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">EXPECT_NEAR (expected, actual, absolute_range)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">涓轟粈涔堥渶瑕佺敤鍗曠嫭鐨勫畯榪涜嫻偣鏁版瘮杈冿紵浣跨敤 ASSERT_EQ 涓嶈鍚楋紵浣跨敤 ASSERT_EQ 鍜岀浉鍏崇殑瀹忓彲鑳藉彲浠ワ紝涔熷彲鑳戒笉琛岋紝浣嗘槸浣跨敤涓撻棬鐢ㄤ簬嫻偣鏁版瘮杈冪殑瀹忔洿濂姐傞氬父錛屼笉鍚岀殑涓ぎ澶勭悊鍗曞厓 (CPU) 鍜屾搷浣滅幆澧冧互涓嶅悓鐨勬柟寮忓瓨鍌ㄦ誕鐐規暟錛岀畝鍗曞湴姣旇緝鏈熸湜鍊煎拰瀹為檯鍊兼槸鏃犳晥鐨勩備緥濡傦紝ASSERT_FLOAT_EQ (2.00001, 2.000011) 浼氶『鍒╅氳繃 — 濡傛灉鐩村埌灝忔暟鐐瑰悗鍥涗綅閮藉尮閰嶏紝Google 灝變笉浼氭姏鍑洪敊璇傚鏋滈渶瑕佹洿綺劇‘鐨勬瘮杈冿紝搴旇浣跨敤 ASSERT_NEAR (2.00001, 2.000011, 0.0000001)錛屽氨浼氬緱鍒?娓呭崟 10 鎵紺虹殑閿欒銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>娓呭崟 10. ASSERT_NEAR 浜х敓鐨勯敊璇秷鎭?/strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Math.cc(68): error: The difference between 2.00001 and 2.000011 is 1e-006, which exceeds</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">0.0000001, where</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">2.00001 evaluates to 2.00001,</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">2.000011 evaluates to 2.00001, and</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">0.0000001 evaluates to 1e-007.</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>姝諱骸嫻嬭瘯</strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Google C++ Testing Framework 鏈変竴綾繪湁瓚g殑鏂█錛圓SSERT_DEATH銆丄SSERT_EXIT 絳夛級錛屽畠浠О涓烘浜℃柇璦銆備嬌鐢ㄨ繖縐嶆柇璦媯鏌ュ湪渚嬬▼鐨勮緭鍏ラ敊璇殑鎯呭喌涓嬫槸鍚﹀彂鍑烘紜殑閿欒娑堟伅錛屾垨鑰呬緥紼嬫槸鍚﹂鍑哄茍榪斿洖姝g‘鐨勯鍑虹爜銆備緥濡傦紝鍦?娓呭崟 3 涓紝褰撴墽琛?square-root (-22.0) 鏃跺簲璇ヤ駭鐢熼敊璇秷鎭紝紼嬪簭閫鍑猴紝榪斿洖鐘舵佸簲璇ユ槸 -1 鑰屼笉鏄?-1.0銆傛竻鍗?11 浣跨敤 ASSERT_EXIT 媯鏌ユ槸鍚︽槸榪欐牱銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>娓呭崟 11. 浣跨敤 Google 妗嗘灦榪愯姝諱骸嫻嬭瘯</strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">#include "gtest/gtest.h"</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">double square-root (double num) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">if (num < 0.0) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">std::cerr << "Error: Negative Input\n";</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">exit(-1);</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">// Code for 0 and +ve numbers follow…</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">TEST (SquareRootTest, ZeroAndNegativeNos) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">ASSERT_EQ (0.0, square-root (0.0));</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">ASSERT_EXIT (square-root (-22.0), ::testing::ExitedWithCode(-1), "Error:</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Negative Input");</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">int main(int argc, char **argv) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">::testing::InitGoogleTest(&argc, argv);</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">return RUN_ALL_TESTS();</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">ASSERT_EXIT 媯鏌ュ嚱鏁版槸鍚﹂鍑哄茍榪斿洖姝g‘鐨勯鍑虹爜錛堝嵆 exit 鎴?_exit 渚嬬▼鐨勫弬鏁幫級錛屽寮曞彿涓殑瀛楃涓插拰鍑芥暟鍙戦佸埌鏍囧噯閿欒鐨勫瓧絎︿覆榪涜姣旇緝銆傛敞鎰忥紝閿欒娑堟伅蹇呴』鍙戦佸埌 std::cerr 鑰屼笉鏄?std::cout銆傛竻鍗?12 緇欏嚭 ASSERT_DEATH 鍜?ASSERT_EXIT 鐨勫師鍨嬨?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>娓呭崟 12. 姝諱骸鏂█鐨勫師鍨?/strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">ASSERT_DEATH(statement, expected_message)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">ASSERT_EXIT(statement, predicate, expected_message)</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Google 鎻愪緵棰勫畾涔夌殑璋撹瘝 ::testing::ExitedWithCode(exit_code)銆傚彧鏈夊湪紼嬪簭閫鍑轟笖閫鍑虹爜涓庤皳璇嶄腑鐨?exit_code 鐩稿悓鐨勬儏鍐典笅錛岃繖涓皳璇嶇殑緇撴灉鎵嶆槸 true銆侫SSERT_DEATH 姣?ASSERT_EXIT 綆鍗曪紱瀹冨彧媯鏌ユ爣鍑嗛敊璇腑鐨勯敊璇秷鎭槸鍚︽槸鐢ㄦ埛鏈熸湜鐨勬秷鎭?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>鐞嗚В嫻嬭瘯瑁呭</strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">鍦ㄦ墽琛屽崟鍏冩祴璇曚箣鍓嶏紝閫氬父瑕佹墽琛屼竴浜涘畾鍒剁殑鍒濆鍖栥備緥濡傦紝濡傛灉甯屾湜搴﹂噺嫻嬭瘯鐨勬椂闂?鍐呭瓨鍗犵敤閲忥紝灝遍渶瑕佹斁緗竴浜涙祴璇曚笓鐢ㄤ唬鐮佷互搴﹂噺榪欎簺鍊箋傝繖灝辨槸瑁呭鐨勭敤閫?— 瀹冧滑甯姪瀹屾垚榪欑瀹氬埗鐨勬祴璇曞垵濮嬪寲銆傛竻鍗?13 緇欏嚭涓涓澶囩被鐨勭ず渚嬨?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>娓呭崟 13. 嫻嬭瘯瑁呭綾?/strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">class myTestFixture1: public ::testing::test {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">public:</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">myTestFixture1( ) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">// initialization code here</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">void SetUp( ) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">// code here will execute just before the test ensues</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">void TearDown( ) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">// code here will be called just after the test completes</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">// ok to through exceptions from here if need be</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">~myTestFixture1( ) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">// cleanup any pending stuff, but no exceptions allowed</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">// put in any custom data members that you need</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">};</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">榪欎釜瑁呭綾繪淳鐢熻嚜 gtest.h 涓0鏄庣殑 ::testing::test 綾匯傛竻鍗?14 鏄嬌鐢ㄨ繖涓澶囩被鐨勭ず渚嬨傛敞鎰忥紝瀹冧嬌鐢?TEST_F 瀹忚屼笉鏄?TEST銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>娓呭崟 14. 瑁呭鐨勪嬌鐢ㄧず渚?/strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">TEST_F (myTestFixture1, UnitTest1) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">….</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">TEST_F (myTestFixture1, UnitTest2) {</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">….</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">}</p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">鍦ㄤ嬌鐢ㄨ澶囨椂錛岃娉ㄦ剰浠ヤ笅鍑犵偣錛?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">鍙互鍦ㄦ瀯閫犲嚱鏁版垨 SetUp 鏂規硶涓墽琛屽垵濮嬪寲鎴栧垎閰嶈祫婧愩傜敱鐢ㄦ埛閫夋嫨鍏蜂綋鏂瑰紡銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">鍙互鍦?TearDown 鎴栨瀽鏋勫嚱鏁頒緥紼嬩腑閲婃斁璧勬簮銆備絾鏄紝濡傛灉闇瑕佸紓甯稿鐞嗭紝閭d箞鍙兘鍦?TearDown 浠g爜涓繘琛岋紝鍥犱負浠庢瀽鏋勫嚱鏁頒腑鎶涘嚭寮傚父浼氬鑷翠笉紜畾鐨勭粨鏋溿?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">鍦ㄤ互鍚庣殑鐗堟湰涓紝Google 鏂█瀹忓彲鑳戒細鍦ㄥ鉤鍙頒笂鎶涘嚭寮傚父銆傚洜姝わ紝涓轟簡渚夸簬緇存姢錛屾渶濂藉湪 TearDown 浠g爜涓嬌鐢ㄦ柇璦瀹忋?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">騫朵笉璺ㄥ涓祴璇曚嬌鐢ㄥ悓涓涓祴璇曡澶囥傚浜庢瘡涓柊鐨勫崟鍏冩祴璇曪紝妗嗘灦鍒涘緩涓涓柊鐨勬祴璇曡澶囥傚湪 娓呭崟 14 涓紝鐢變簬瑕佸垱寤轟袱涓?myFixture1 瀵硅薄錛屾墍浠ヤ袱嬈¤皟鐢?SetUp 渚嬬▼錛堣娉ㄦ剰浣跨敤姝g‘鐨勬嫾鍐欙級銆?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>緇撴潫璇?/strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">鏈枃浠呬粎瑙﹀強浜?Google C++ Testing Framework 鐨勭毊姣涖傚彲浠ヤ粠 Google 緗戠珯鑾峰緱鍏充簬榪欎釜妗嗘灦鐨勮緇嗕俊鎭傚浜庨珮綰у紑鍙戜漢鍛橈紝鎴戝緩璁槄璇?Boost 鍗曞厓嫻嬭瘯妗嗘灦鍜?CppUnit 絳夊紑鏀懼洖褰掓鏋舵柟闈㈢殑鍏朵粬鏂囩珷銆傛洿澶氫俊鎭弬瑙?鍙傝冭祫鏂欍?/p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; "><strong>鍏充簬浣滆?/strong></p><p style="font-size: 14px; line-height: 25px; text-indent: 25px; ">Arpan Sen 鏄嚧鍔涗簬鐢靛瓙璁捐鑷姩鍖栬涓氱殑杞歡寮鍙戦甯伐紼嬪笀銆備粬浣跨敤鍚勭 UNIX 鐗堟湰錛堝寘鎷?Solaris銆丼unOS銆丠P-UX銆両RIX錛屼互鍙?Linux 鍜?Microsoft Windows錛夊凡緇忓騫淬備粬鐑》浜庡悇縐嶈蔣浠舵ц兘浼樺寲鎶鏈佸浘璁哄拰騫惰璁$畻銆侫rpan 鑾峰緱浜嗚蔣浠剁郴緇熺澹浣嶃?/p></span><img src ="http://www.shnenglu.com/lauer3912/aggbug/156261.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/lauer3912/" target="_blank">RTY</a> 2011-09-19 21:03 <a href="http://www.shnenglu.com/lauer3912/archive/2011/09/19/156261.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Google Test Primer 錛氬紑濮嬩嬌鐢℅oogle C++ 嫻嬭瘯妗嗘灦http://www.shnenglu.com/lauer3912/archive/2011/09/16/155965.htmlRTYRTYFri, 16 Sep 2011 13:59:00 GMThttp://www.shnenglu.com/lauer3912/archive/2011/09/16/155965.htmlhttp://www.shnenglu.com/lauer3912/comments/155965.htmlhttp://www.shnenglu.com/lauer3912/archive/2011/09/16/155965.html#Feedback0http://www.shnenglu.com/lauer3912/comments/commentRss/155965.htmlhttp://www.shnenglu.com/lauer3912/services/trackbacks/155965.html闃呰鍏ㄦ枃

RTY 2011-09-16 21:59 鍙戣〃璇勮
]]>
紼嬪簭鍛樼殑鍏遍福 - 璇匯婂崜鏈夋垚鏁堢殑紼嬪簭鍛樸?/title><link>http://www.shnenglu.com/lauer3912/archive/2011/09/15/155812.html</link><dc:creator>RTY</dc:creator><author>RTY</author><pubDate>Wed, 14 Sep 2011 23:36:00 GMT</pubDate><guid>http://www.shnenglu.com/lauer3912/archive/2011/09/15/155812.html</guid><wfw:comment>http://www.shnenglu.com/lauer3912/comments/155812.html</wfw:comment><comments>http://www.shnenglu.com/lauer3912/archive/2011/09/15/155812.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/lauer3912/comments/commentRss/155812.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/lauer3912/services/trackbacks/155812.html</trackback:ping><description><![CDATA[<span id="hvzpftn" class="Apple-style-span" style="color: #333333; font-family: 寰蔣闆呴粦, verdana, Arial, sans-serif; background-color: #ffffff; "><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">鏈榪戣浜嗐婂崜鏈夋垚鏁堢殑紼嬪簭鍛樸嬶紝鎰熻鏀惰幏棰囧ぇ銆傝繖鏄竴鏈啓緇欑▼搴忓憳鐨勯毦寰楃殑濂戒功銆備功涓ぇ閮芥槸涓浜涙祬鏄劇殑閬撶悊錛屼絾浣滆呭皢榪欎簺涓滆タ鍔犱互鏀墮泦銆佸綊綰熾佹葷粨錛屽茍鏈緇堟垚涔︺備綔鑰呬負浜嗘敹闆嗗悇縐嶆彁楂樻晥鐜囩殑宸ュ叿鍜屾柟娉曪紝涓滃瑗胯蛋錛屽彲璋撹垂浜嗕竴鐣嫤蹇冦?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">鎴戣寰楁涔︾涓閮ㄥ垎鎬葷粨鐨勪竴浜涙硶鍒欓潪甯稿ソ錛屾垜鎻愬彇浜嗕竴涓嬶細<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><h3 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; ">娉曞垯錛?nbsp;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></h3><h4 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; ">1.鍔犻熸硶鍒?/h4><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    鍏蟲敞鏈川錛岃岄潪褰㈠紡</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    涓涓簲鐢ㄧ▼搴忓垪琛ㄧ殑鏈夌敤紼嬪害涓庡畠鐨勯暱搴︽垚鍙嶆瘮 <br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    <span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: red; ">紼嬪簭鍛樼殑寰堝鏃墮棿閮芥氮璐瑰湪鎵句笢瑗夸笂</span> <br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    鍗庤屼笉瀹炵殑涓滆タ涓湅涓嶄腑鐢?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    閿洏杈撳叆鎬繪瘮瀵艱埅蹇?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    <span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: red; ">棣栭夐敭鐩樿岄潪榧犳爣</span></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    鍦板潃鏍忔槸Windows璧勬簮綆$悊鍣ㄧ晫闈腑鏈楂樻晥鐨勯儴鍒?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    <span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: red; ">鑺辯偣鏃墮棿鏉ュ涔犱綘鎵嬭竟鐨勬墍鏈夐殣钘忕殑蹇嵎閿?/span></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    鐜鍒囨崲浼氭秷鑰楁椂闂?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    <span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: red; ">鎴愭壒澶嶅埗綺樿創瑕佹瘮鍙嶅澶氭澶嶅埗綺樿創蹇?/span></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    蹇樿鍘嗗彶灝辨剰鍛崇潃浣犲緱鍐嶈緭鍏ヤ竴閬?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    宓屽叆鍥懼艦鍖栧伐鍏風殑鍛戒護鎻愮ず絎﹁浣犻奔涓庣唺鎺屽吋寰?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    鍦ㄤ笂涓嬫枃涓涔營DE蹇嵎閿紝鑰屼笉瑕佸幓鑳岄暱闀跨殑鍒楄〃</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    褰撲綘絎簩嬈¤緭鍏ヤ竴涓鏉傜粨鏋勬椂錛屽皢瀹冨仛鎴愭ā鏉?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    濡傛灉瑕佸澶氳鏂囨湰鍋氬悓鏍風殑鎿嶄綔錛屽氨搴旇鎵懼嚭鍏朵腑鐨勬ā寮忥紝騫舵妸瀹冭褰曚負涓涓畯</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    <span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: red; ">涓嶈鎬繪槸閲嶅杈撳叆鐩稿悓鐨勫懡浠?/span></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    姣忓ぉ鑺變竴鐐圭偣鏃墮棿鏉ヤ嬌姣忎竴澶╅兘鏇撮珮鏁?nbsp;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><h4 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; ">2.涓撴敞娉曞垯</h4><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    <span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: red; ">綺懼姏瓚婇泦涓紝鎬濈淮瓚婄紲瀵?/span></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    鎺掗櫎騫叉壈錛氶殧紱葷瓥鐣ワ紝鍏蟲帀涓嶉渶瑕佺殑鎻愮ず錛屽垱閫犲畨闈欐椂闂?nbsp; <br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    <span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: red; ">鑽夊爢瓚婂ぇ錛屼粠涓壘鍒頒竴鏍歸拡灝辮秺闅?/span></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    涓嶈闂枃浠舵爲錛岃鎼滅儲</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    浣跨敤澶氭樉紺哄櫒</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    铏氭嫙妗岄潰鍙互璁╁師鏈潅涔辨棤绔犵殑涓澶у爢紿楀彛鍙樺緱鏁存磥 <br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><h4 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; ">3.鑷姩鍖栨硶鍒?/h4><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    涓嶈閲嶆柊鍙戞槑杞瓙</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    鐢⊿elenium嫻忚緗戦〉</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    涓嶈嫻垂鏃墮棿鍔ㄦ墜鍘誨仛鍙互琚嚜鍔ㄥ寲鐨勪簨鎯?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    鐢╓indows Power Shell鏇夸唬鎵瑰鐞嗘枃浠?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    椹湇Subversion鍛戒護琛?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    浠ュ垱閫犳х殑鏂瑰紡瑙e喅闂錛屾湁鍔╀簬鍦ㄥ皢鏉ヨВ鍐崇被浼肩殑闂</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    <span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: red; ">鏄惁搴旇鑷姩鍖栫殑鍏抽敭鍦ㄤ簬鎶曡祫鍥炴姤鐜囧拰緙撹В椋庨櫓</span></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    鐮旂┒鎬х殑宸ヤ綔搴旇鏀懼湪鏃墮棿鐩掗噷鍋?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    鍒粰鐗︾墰鍓瘺 <br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><h4 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; ">4.瑙勮寖鎬ф硶鍒?br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></h4><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    瀵逛簬浠諱綍浣犱笉鑷繁鍘繪瀯寤虹殑涓滆タ錛屽彧鍦ㄧ増鏈帶鍒朵腑淇濆瓨涓浠藉壇鏈?br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    浣跨敤鏍囧噯鐨勬瀯寤烘湇鍔″櫒</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    <span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: red; ">閫氳繃澶嶅埗綺樿創鏉ュ鐢ㄦ槸閭伓鐨勶紝涓嶈浣犲鍒剁矘璐寸殑鏄粈涔?/span></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    鍒╃敤铏氭嫙騫沖彴浣塊」鐩緷璧栨爣鍑嗗寲</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    涓嶈璁╁璞?- 鍏崇郴鏄犲皠宸ュ叿錛圤/R鏄犲皠鍣級榪濆弽瑙勮寖鍘熷垯 <br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    閫氳繃鎵╁睍銆傚紑鏀劇被錛坥pen class錛夛紝鎴栬呴儴鍒嗙被錛坧artial class錛?鏉ヤ負鐢熸垚鐨勪唬鐮佸鍔犺涓?br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    濮嬬粓淇濇寔浠g爜鍜屾暟鎹粨鏋勭殑鍚屾</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    <span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: red; ">榪囨椂鐨勬枃妗f瘮娌℃湁鏂囨。鏇寸碂錛屽洜涓哄畠浼氫富鍔ㄨ瀵間綘</span></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    浠諱綍闇瑕佽垂鍔插垱閫犵殑涓滆タ錛岄兘璁╁畠鐨勫垱閫犺呮緗笉鑳?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    <span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: red; ">鐧芥澘 + 鏁扮爜鐩告満寮鴻繃浠諱綍CASE宸ュ叿</span></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    灝介噺鐢熸垚鎵鏈夋妧鏈枃妗?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    <span style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; line-height: 1.5; color: red; ">閲嶅鏄蔣浠跺紑鍙戜腑鏈澶х殑闃誨姏 </span><br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><h3 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; ">宸ュ叿錛?br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></h3><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">涔︿腑錛岃繕鎻愬埌浜嗗ぇ閲忕殑鎻愰珮鏁堢巼鐨勫伐鍏鳳紝閮芥槸闈炲父涓嶉敊鐨勩傜浉淇″緢澶氫漢閮芥湁鑷繁鐨勪竴涓垪琛紝涓嬮潰鏄垜鐢佃剳涓繀涓嶅彲灝戠殑鍑犳杞歡錛?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    1. FireFox 鍙婂叾鍚勭被鎻掍歡<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    2. Launchy鍚姩鍔犻熷櫒</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    3. Total Commander</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    4. ClipX澶氶噸鍓垏鏉?/p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    5. EmEditor鏂囨湰緙栬緫鍣?nbsp;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    6. Vistual Studio鐨刅A鎻掍歡</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    7. Search And Replace</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    8. Everything</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    9. Miranda IM<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">    10. .... <br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><h3 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; ">鎰熻Е錛?nbsp;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></h3><h4 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; ">1. 鎰ゆ掔殑鐚村瓙 <br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></h4><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">鍦ㄤ功涓殑絎簩閮ㄥ垎錛屾彁鍒頒簡寰堝瀹炶返鐩稿叧鐨勫唴瀹廣傝鎴戞劅瑙︽渶娣辯殑鏄?#8220;鎰ゆ掔殑鐚村瓙”鐨勬晠浜嬶細</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">“<em style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">鏃╁湪20涓栫邯60騫翠唬錛堥偅鏃跺欑瀛﹀浠彲浠ュ仛浠諱綍鐤媯鐨勪簨鎯咃級錛岃涓虹瀛﹀浠繘琛屼簡涓欏瑰疄楠屻備粬浠妸浜斿彧鐚村瓙鍜屼竴鏋舵椿姊斁鍦ㄤ竴闂村眿瀛愰噷錛屽茍鍦ㄥぉ鑺辨澘涓婃寕浜嗕竴涓查钑夈傝繖浜涚尨瀛愬緢蹇氨鎯沖埌瀹冧滑鍙互鐖笂姊瓙鍘誨悆棣欒晧錛屼絾姣忓綋瀹冧滑闈犺繎媧繪鐨勬椂鍊欙紝縐戝瀹朵滑灝辯敤鍐版按嫻告弧鏁翠釜灞嬪瓙銆傛垜鎯充綘鑳界寽鍒頒細鍙戠敓浠涔堬細涓緹ゆ劋鎬掔殑鐚村瓙銆傚緢蹇紝鍐嶆病鏈変竴鍙尨瀛愪細鍘婚潬榪戦偅涓瀛愪簡銆?br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></em></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><em style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">涔嬪悗錛岀瀛﹀浠皢鍏朵腑涓鍙尨瀛愭浛鎹㈡垚鍙︿竴鍙病鏈夊繊鍙楄繃鍐版按鎶樼(鐨勬柊鐚村瓙銆傝繖鍙柊鐚村瓙鎵鍋氱殑絎竴浠朵簨灝辨槸鐩村閭f灦姊瓙錛屼絾褰撳畠榪欎箞鍋氭椂鍏朵粬鎵鏈夌尨瀛愰兘鐥涙墦瀹冦傚畠涓嶆槑鐧戒負浠涔堬紝浣嗗緢蹇氨瀛︿箹浜嗭細涓嶈鍘婚潬榪戦偅鏋舵瀛愩傜瀛﹀浠愭笎灝嗘渶鍒濈殑閭d簺鐚村瓙閮芥浛鎹㈡垚鏂扮尨瀛愶紝鐩村埌榪欑兢鐚村瓙涓皝閮芥病鏈夎姘存蹈娉¤繃錛岀劧鑰屽畠浠繕鏄細鍘繪敾鍑諱換浣曢潬榪戞瀛愮殑鐚村瓙銆?/em></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; "><em style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">榪欒鏄庝簡浠涔堬紵杞歡欏圭洰涓澶氭儻渚嬩箣鎵浠ュ瓨鍦紝灝卞洜涓?#8221;鎴戜滑涓鐩存槸閭f牱鍋氱殑“銆傛崲鍙ヨ瘽璇達紝鏄洜涓烘劋鎬掔殑鐚村瓙銆?/em>”</p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">鎴戜滑灝忕粍鍦ㄥ埗瀹欳++鐩稿叧鐨勪唬鐮佽鑼冩椂灝遍亣鍒拌繃鏃犳暟綾諱技鐨勯棶棰樸傛瘮濡傦紝鍦ㄥ埗瀹氬彉閲忕殑鍛藉悕瑙勮寖鏃訛紝鎴戜滑閽堝鏄惁閲囩敤鍖堢墮鍒╁懡鍚嶆硶浜夎浜嗗緢涔呫傛湁鐨勪漢璁や負錛?鍑犱箮浠ュ墠鐪嬪埌鐨勬墍鏈塁++浠g爜閮介噰鐢ㄤ簡鍖堢墮鍒╁懡鍚嶆硶錛岀敋鑷籌紝寰蔣瀹氫箟鐨勬墍鏈堿PI閮戒嬌鐢ㄤ簡姝ょ被鍛藉悕娉曘傚垰寮濮嬶紝鎴戜篃鏄湁鍚屾牱鐨勭枒鎯戙?br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">鍚庢潵錛屾垜浠粡榪囦粩緇嗗垎鏋怌++鍖堢墮鍒╁懡鍚嶆硶鐢辨潵錛屾笎娓愭劅瑙夋垜浠氨鏄偅浜涙劋鎬掔殑鐚村瓙錛岀洸鐩窡浠庡墠浜虹殑鏂瑰紡錛岀己涔忔墦鐮翠紶緇熺殑鍕囨皵銆侰++鏈夌潃鍏剁壒孌婄殑鍘嗗彶鍘熷洜錛屽緢澶氭爣鍑嗕竴鐩存矇娣涓嬫潵騫跺緢灝戞敼鍙樸傛垜浠啀鐪嬬湅鍚庢潵鏂扮敓鐨勯偅浜涚紪紼嬭璦錛孋#, Python…… 閮芥姏寮冧簡鍖堢墮鍒╁懡鍚嶆硶錛屽悓鏃跺啀鐪嬬湅鐜板湪C++鍓嶆部鐨凜++ 0x浠ュ強鐜板湪鍑虹増鐨勪竴浜涗功涓紝涔熸笎娓愭斁寮冧簡瀵瑰寛鐗欏埄鍛藉悕娉曠殑浣跨敤銆傚洜涓虹被鍨嬬殑鎰忎箟鍦ㄥ璞℃ā鍨嬩腑瓚婃潵瓚婂急鍖栥傚洜姝わ紝鏈鍚庢垜浠斁寮冧簡鍖堢墮鍒╁懡鍚嶆硶榪欎釜鑰佸彜钁c?nbsp;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><h4 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; ">2. 鏁忔嵎寮鍙?br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></h4><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">榪欐湰涔﹀甫鏈夊己鐑堢殑ThoughtWorks鑹插僵錛屾晱鎹風殑鎬濇兂璐┛鍏ㄤ功錛屽寘鎷祴璇曢┍鍔ㄨ璁★紝鐧芥澘錛岀粨瀵圭紪紼嬨傝繖涔熻鎴戝鏁忔嵎浜х敓浜嗘洿鍔犲己鐑堢殑鍏磋叮銆?鍏朵腑鏈変竴孌墊祴璇曢┍鍔ㄥ紑鍙慣DD鐨勪竴孌墊晠浜嬶細<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">“<em style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">璁板緱絎竴嬈″拰涓浜涘凡緇忎範鎯簬鍗曞厓嫻嬭瘯鐨勫紑鍙戜漢鍛樹竴璧峰姩鎵嬪紑濮嬩慨鏀逛唬鐮佹椂錛屾垜涔熸槸闈炲父绱у紶錛屽洜涓哄ぇ閲忕殑淇敼寰寰浼氱牬鍧忓緢澶氫笢瑗匡紝浣嗕粬浠湅璧鋒潵涓濇娌℃湁鐘硅鮑銆傞愭笎鍦幫紝鎴戜篃鏀句笅蹇冩潵錛屽洜涓烘垜鎱㈡參鍦拌璇嗗埌錛氭湁浜嗘祴璇曠殑淇濊瘉錛屽畬鍏ㄥ彲浠ユ斁蹇冨ぇ鑳嗗湴鍘諱慨鏀逛唬鐮併?/em>” <br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><h4 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; ">3. 鏈夎叮鐨勬晠浜?nbsp;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></h4><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">涔︿腑榪樻湁涓浜涙湁瓚g殑鏁呬簨錛屾瘮濡備綔鑰呯殑涓涓湅鍙嬪湪鍜屽埆浜虹粨瀵圭紪紼嬫椂錛屼負浜嗗吇鎴愬悓浼翠嬌鐢ㄥ揩鎹烽敭鐨勪範鎯紝姣忓綋鍚屼即鏈嬌鐢ㄥ揩鎹烽敭鏃訛紝浠栭兘浼氳姹傚皢鎿嶄綔鎾ら攢錛岀劧鍚庤姹備嬌鐢ㄥ揩鎹烽敭鍐嶉噸澶嶆搷浣?嬈°傜劧鍚庯紝鍦ㄥ叾鍑剁嫚鐨勭溂紲炰腑錛屽悓浼村緢蹇帉鎻′簡蹇嵎閿?nbsp;<br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " /></p><h3 style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; font-weight: bold; color: #000000; ">鎬葷粨錛?/h3><p style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; ">榪欐湰涔﹀緢钖勶紝钑磋棌鐨勯亾鐞嗗嵈涓嶅皯錛岀浉淇℃瘡涓榪囧畠鐨勪漢閮戒細浠庝腑鏀惰幏銆傝榪囦箣鍚庯紝鎴戜滑涓嶅簲璇ュ眬闄愪簬涔︿腑鎻愬埌鐨勬煇浜涘皬鎶宸э紝 鎴栨槸涔︿腑鏌愪竴涓粏鑺傦紝姣曠珶錛屾彁渚涙晥鐜囩殑鏂規硶鏈夊緢澶氬緢澶氾紝娉曞垯涔熸湁寰堝寰堝錛屼竴鏈功寰堥毦灝嗗叾絀蜂婦瀹屻傛垜浠簲璇ヤ粠涔︿腑鍚稿彇鍏舵濇兂錛屽茍鍦ㄥ疄闄呭伐浣滃拰瀛︿範涓笉鏂葷粨錛屽仛涓涓湡姝g殑“鍗撴湁鎴愭晥鐨勭▼搴忓憳”錛?/p></span><img src ="http://www.shnenglu.com/lauer3912/aggbug/155812.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/lauer3912/" target="_blank">RTY</a> 2011-09-15 07:36 <a href="http://www.shnenglu.com/lauer3912/archive/2011/09/15/155812.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Google Test 鏋舵瀯http://www.shnenglu.com/lauer3912/archive/2011/09/15/155807.htmlRTYRTYWed, 14 Sep 2011 22:40:00 GMThttp://www.shnenglu.com/lauer3912/archive/2011/09/15/155807.htmlhttp://www.shnenglu.com/lauer3912/comments/155807.htmlhttp://www.shnenglu.com/lauer3912/archive/2011/09/15/155807.html#Feedback0http://www.shnenglu.com/lauer3912/comments/commentRss/155807.htmlhttp://www.shnenglu.com/lauer3912/services/trackbacks/155807.htmlhttp://code.google.com/p/googletest/

寮曟枃錛?a >http://www.cnblogs.com/coderzh/archive/2009/04/06/1426755.html

鐜╄漿Google寮婧怌++鍗曞厓嫻嬭瘯妗嗘灦Google Test緋誨垪(gtest)(鎬?

鍓嶆鏃墮棿瀛︿範鍜屼簡瑙d簡涓婫oogle鐨勫紑婧怌++鍗曞厓嫻嬭瘯妗嗘灦Google Test錛岀畝縐癵test錛岄潪甯哥殑涓嶉敊銆?鎴戜滑鍘熸潵浣跨敤鐨勬槸鑷繁瀹炵幇鐨勪竴濂楀崟鍏冩祴璇曟鏋訛紝鍦ㄤ嬌鐢ㄨ繃紼嬩腑錛屽彂鐜拌秺鏉ヨ秺澶氫嬌鐢ㄤ笉渚夸箣澶勶紝鑰岃繖鏍蜂笉渚夸箣澶勶紝gtest鎭版伆寰堝ソ鐨勮В鍐充簡銆?br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />

鍏跺疄gtest鏈韓鐨勫疄鐜板茍涓嶅鏉傦紝鎴戜滑瀹屽叏鍙互妯′豢gtest錛屼笉鏂殑瀹屽杽鎴戜滑鐨勬祴璇曟鏋訛紝 浣嗘渶鍚庢垜浠繕鏄喅瀹氫嬌鐢╣test鍙栦唬鎺夊師鏉ョ殑鑷繁鐨勬祴璇曟鏋訛紝鍘熷洜鏄細

1.涓嶆柇瀹屽杽鎴戜滑鐨勬祴璇曟鏋朵箣鍚庡氨浼氬彂瑙夌浉褰撲簬鎶奼test閲嶆柊鍋氫簡涓閬嶏紝铏界劧杞瓙閫犵殑寰堢埥錛屼絾鏄笉鏄繀瑕佺殑銆?/p>

2.浣跨敤gtest鍙互鍏嶅幓緇存姢嫻嬭瘯妗嗘灦鐨勯夯鐑︼紝璁╂垜浠湁鏇村綺懼姏鎶曞叆鍒版渚嬭璁′笂銆?br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />

3.gtest鎻愰珮浜嗛潪甯稿畬鍠勭殑鍔熻兘錛屽茍涓旂畝鍗曟槗鐢紝鏋佸ぇ鐨勬彁楂樹簡緙栧啓嫻嬭瘯妗堜緥鐨勬晥鐜囥?/p>

gtest鐨勫畼鏂圭綉绔欐槸錛?/p>

http://code.google.com/p/googletest/

浠庡畼鏂圭殑浣跨敤鏂囨。閲岋紝浣犲嚑涔庡彲浠ヨ幏寰椾綘鎯寵鐨勬墍鏈変笢瑗?nbsp;

http://code.google.com/p/googletest/wiki/GoogleTestPrimer

http://code.google.com/p/googletest/wiki/GoogleTestAdvancedGuide 

濡傛灉榪樻兂瀵筭test鍐呴儴鎺釜絀剁珶錛屽氨鎶婂畠鐨勪唬鐮佷笅杞戒笅鏉ョ爺絀跺惂錛岃繖灝辨槸寮婧愮殑濂藉錛屽搱錛?nbsp;

瀹樻柟宸茬粡鏈夊姝ゅ畬澶囩殑鏂囨。浜嗭紝涓轟粈涔堟垜榪樿鍐欏憿錛熶竴鏂歸潰鏄嚜宸辮璁扮瑪璁幫紝濂借鎬т笉濡傜儌絎斿ご錛屼互鍚庤嚜宸辨兂鏌ユ煡涓浜涚敤娉曚篃鍙互鐩存帴鍦ㄨ繖閲屾煡鍒幫紝涓鏂歸潰鏄浜庝笉鎯沖幓鐪嬩竴澶у爢鑻辨枃鏂囨。鐨勬湅鍙嬶紝鍦ㄦ垜榪欓噷鍙互蹇熺殑鎵懼埌gtest鐩稿叧鐨勫唴瀹廣?/p>

涓嬮潰鏄緋誨垪鐨勭洰褰曪細

1.鐜╄漿Google寮婧怌++鍗曞厓嫻嬭瘯妗嗘灦Google Test緋誨垪(gtest)涔嬩竴 - 鍒濊瘑gtest

2.鐜╄漿Google寮婧怌++鍗曞厓嫻嬭瘯妗嗘灦Google Test緋誨垪(gtest)涔嬩簩 - 鏂█

3.鐜╄漿Google寮婧怌++鍗曞厓嫻嬭瘯妗嗘灦Google Test緋誨垪(gtest)涔嬩笁 - 浜嬩歡鏈哄埗

4.鐜╄漿Google寮婧怌++鍗曞厓嫻嬭瘯妗嗘灦Google Test緋誨垪(gtest)涔嬪洓 - 鍙傛暟鍖?/a>

5.鐜╄漿Google寮婧怌++鍗曞厓嫻嬭瘯妗嗘灦Google Test緋誨垪(gtest)涔嬩簲 - 姝諱骸嫻嬭瘯 

6.鐜╄漿Google寮婧怌++鍗曞厓嫻嬭瘯妗嗘灦Google Test緋誨垪(gtest)涔嬪叚 - 榪愯鍙傛暟

7.鐜╄漿Google寮婧怌++鍗曞厓嫻嬭瘯妗嗘灦Google Test緋誨垪(gtest)涔嬩竷 - 娣卞叆瑙f瀽gtest

8.鐜╄漿Google寮婧怌++鍗曞厓嫻嬭瘯妗嗘灦Google Test緋誨垪(gtest)涔嬪叓 - 鎵撻犺嚜宸辯殑鍗曞厓嫻嬭瘯妗嗘灦


棰濆綃囷細

1.gtest涓浣曡煩鍑哄綋鍓嶆祴璇曟渚?/a>

2.緙栧啓浼樼編鐨凣Test嫻嬭瘯妗堜緥

3.gtest 鍙傛暟鍖栨祴璇曚唬鐮佺ず渚?/a> (鍐呭惈瀹屾暣宸ョ▼紺轟緥)

浣滆咃細CoderZh錛?a target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: #0066aa; border-bottom-width: 0px; border-bottom-style: initial; border-bottom-color: initial; ">CoderZh鐨勬妧鏈崥瀹?- 鍗氬鍥?/a>錛?br style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; " />寰崥錛?a target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: #0066aa; border-bottom-width: 0px; border-bottom-style: initial; border-bottom-color: initial; ">http://t.sina.com.cn/coderzh 
鍑哄錛?a target="_blank" style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; text-decoration: none; color: #0066aa; border-bottom-width: 0px; border-bottom-style: initial; border-bottom-color: initial; ">http://coderzh.cnblogs.com
鏂囩珷鐗堟潈褰掓湰浜烘墍鏈夛紝嬈㈣繋杞澆錛屼絾鏈粡浣滆呭悓鎰忓繀欏諱繚鐣欐孌靛0鏄庯紝涓斿湪鏂囩珷欏甸潰鏄庢樉浣嶇疆緇欏嚭鍘熸枃榪炴帴錛屽惁鍒欎繚鐣欒拷絀舵硶寰嬭矗浠葷殑鏉冨埄銆?/p>




RTY 2011-09-15 06:40 鍙戣〃璇勮
]]>
璋堣皥鍗曞厓嫻嬭瘯http://www.shnenglu.com/lauer3912/archive/2011/09/15/155806.htmlRTYRTYWed, 14 Sep 2011 22:37:00 GMThttp://www.shnenglu.com/lauer3912/archive/2011/09/15/155806.htmlhttp://www.shnenglu.com/lauer3912/comments/155806.htmlhttp://www.shnenglu.com/lauer3912/archive/2011/09/15/155806.html#Feedback0http://www.shnenglu.com/lauer3912/comments/commentRss/155806.htmlhttp://www.shnenglu.com/lauer3912/services/trackbacks/155806.html

鍒氭帴瑙﹀崟鍏冩祴璇曟椂錛屾垜瀹炲湪鏄悶涓嶆噦榪欑嫻嬭瘯鍒板簳鏈夊澶х殑鎰忎箟錛屾棤闈為兘鏄竴浜涚畝鍗曠殑ASSERT錛屼絾榪戝勾縐瘡涓浜涚粡楠屾暀璁箣鍚庢垜鎵嶅彂鐜幫紝鍗曞厓嫻嬭瘯榪欑帺鎰忓効鐪熺殑鏄竴縐嶄繚璇佺▼搴忚川閲忕殑寮烘湁鍔涙墜孌點?/p>

涓轟粈涔堣繖鏍瘋錛熶婦涓渶鍏稿瀷鐨勪緥瀛愶紝鏃犺鏄紑鍙戞柊鍔熻兘榪樻槸緇存姢鑰佺▼搴忥紝閮戒笉鍙伩鍏嶇殑瑕佸弽澶嶄慨鏀規煇浜涗唬鐮侊紝閭h鎬庝箞淇濊瘉淇敼鐨勪唬鐮佷笉浼氬紩鍏ユ柊鐨勯棶棰橈紵濡傛灉浣犺浣犵敤浜哄搧鎷呬繚錛岄偅鎴戞湇浜嗐傛垜浠簲璇ラ渶瑕佷竴縐嶅彲闈犵殑鎵嬫鏉ヤ繚璇佷慨鏀逛竴涓狟UG涓嶄細寮曞叆涓や釜涓変釜BUG錛屾垨鑰呬笉浼氳涔嬪墠姝g‘鐨勫姛鑳藉嚭閿欙紝鐢氳嚦鏄笉浼氬紩鍏ヤ箣鍓嶅凡緇忎慨鏀硅繃鐨勫叾瀹傿UG銆傛祴璇曟棤鐤戞槸涓縐嶅緢濂界殑鎵嬫錛屽湪娌℃帉鎻″叾瀹冩洿濂界殑鏂規硶涔嬪墠錛屽緢澶氫漢鍠滄鐢ㄤ漢宸ユ祴璇曪紝鍗崇紪璇?– 榪愯 – 杈撳叆鍏稿瀷鍊?– 鐪嬬▼搴忚繍琛岀粨鏋?– 濡傛灉鍑洪敊 – 淇敼鍚庡啀緙栬瘧……浠庨暱榪滄潵鐪嬶紝榪欑嫻嬭瘯鏂規硶鐨勭己鐐瑰緢鏄庢樉錛?銆佽楁椂鑰楀姏錛屾瘡嬈′慨鏀逛唬鐮佸悗閮介渶瑕佷漢宸ラ噸澶嶆祴璇曟墍鏈夌殑鍏稿瀷鎯呭喌錛?銆佸鏄撳嚭閿欍佹紡嫻嬶紝浜鴻剳澶鏉傦紝浣犲緢闅捐寰楀嚑涓湀鍓嶇殑閭d釜BUG鍒板簳鏄粈涔堟儏鍐碉紝鍥犳娌℃硶嫻嬭瘯錛屼箙鑰屼箙涔嬶紝N涔呭墠鐨勯偅涓狟UG鍙兘鍙堢涓嶇煡楝間笉瑙夌殑閲嶇幇浜嗐傜浉姣斾箣涓嬶紝鍗曞厓嫻嬭瘯鐨勪紭鐐瑰氨鍑告樉鍑烘潵浜嗭紝鎶婇渶瑕佹祴璇曠殑鍏稿瀷鎯呭喌緙栧啓涓烘祴璇曚唬鐮侊紝鐒跺悗緙栬瘧榪愯鍗沖彲瀹屾垚鑷姩鍖栫殑嫻嬭瘯錛屽綋鍙戠幇BUG鍚庯紝鎶婂畠娣誨姞鍒版祴璇曠敤渚嬶紝涓嶄粎鍙互鎻愰珮嫻嬭瘯瑕嗙洊鐜囷紝榪樿兘淇濊瘉浠ュ悗涓嶄細鍐嶆寮曞叆鍚屾牱鐨凚UG錛屾湁浜嗚凍澶熺殑鍗曞厓嫻嬭瘯錛堣鐩栫巼錛夛紝浣犲氨鍙互鐞嗙洿姘斿.鐨勮浠g爜娌¢棶棰橈紒褰撶劧寮曞叆鍗曞厓嫻嬭瘯浼氬湪鍓嶆湡鑺辮垂涓嶅皯鐨勬椂闂存潵緙栧啓嫻嬭瘯浠g爜錛屼絾鐩稿簲鐨勪篃浼氬ぇ澶у噺灝戝悗鏈熺殑緇存姢宸ヤ綔錛屾渶涓昏鐨勬槸鑳藉彲闈犵殑鎻愰珮紼嬪簭鐨勮川閲忥紝鎵浠ユ槸鍊煎緱鐨勶紝鐢氳嚦鏄繀瑕佺殑銆傦紙濡傛灉浣犵紪璇戣繃寮婧愮殑Google Chromium嫻忚鍣紝浣犱細鍙戠幇嫻嬭瘯浠g爜灝卞崰浜嗕笉灝戯紝鍏夋槸緙栬瘧嫻嬭瘯浠g爜灝卞緱鑺卞緢闀跨殑鏃墮棿錛?/p>

闄や簡涓婇潰璇寸殑浼樼偣澶栵紝鍗曞厓嫻嬭瘯榪樻湁涓浜涘叾瀹冪殑濂藉錛屾瘮濡傚府浣犵悊娓呰璁°備竴浜涗漢鍙嶅鍗曞厓嫻嬭瘯灝辨槸鍥犱負璇存垜浠殑搴旂敤澶鏉備簡錛屾病娉曞仛鍗曞厓嫻嬭瘯銆傚叾瀹炰笉涓瀹氭槸搴旂敤澶嶆潅錛岃屾湁鍙兘鏄璁″緱鏈夐棶棰橈紝瀵艱嚧浜嗘病鏈夊彲嫻嬭瘯鎬с傛瘮濡傛湁浜涗漢鍠滄鍦–XXXDialog閲岀紪鍐欐墍鏈夌殑鍔熻兘瀹炵幇錛岃嫻嬭瘯榪欐牱鐨勪唬鐮侊紝蹇呴』寰楀垱寤哄嚭Dialog錛屽彲鑳借繕闇瑕佺偣鍑伙紝榪欐樉鐒舵病娉曞仛鍗曞厓嫻嬭瘯錛屼絾濡傛灉鎶奃ialog鍜屼笟鍔¢昏緫鍒嗗紑璁捐錛岄偅鑷沖皯涓氬姟閫昏緫鏄彲嫻嬭瘯鐨勶紙鏆備笉璁ㄨUI鐨勬祴璇曪級銆傚洜姝よ鍋氬崟鍏冩祴璇曪紝灝卞緱璁捐濂藉悇涓帴鍙o紝淇濊瘉鏌愪釜鎺ュ彛鍙畬鎴愬崟涓鐨勫姛鑳斤紝娌℃湁榪囧鐨勮﹀悎渚濊禆銆?/p>

鍓嶉潰鍙槸娉涙硾鑰岃皥浜嗕竴浜涘崟鍏冩祴璇曠殑鐨瘺錛岄紦鍚逛簡涓浜涗紭鐐癸紝鏈夊叴瓚g殑鑷繁鎵炬洿璇︾粏鐨勮祫鏂欑湅鍚с傚彟鎺ㄨ崘涓涓狦oogle鐨勫紑婧怌++嫻嬭瘯妗嗘灦googletest銆?/p>

RTY 2011-09-15 06:37 鍙戣〃璇勮
]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
              欧美jizzhd精品欧美喷水| 久久久久久久一区二区| 亚洲午夜高清视频| 亚洲视频一区| 亚洲一区在线免费| 欧美一区91| 久久亚洲欧洲| 欧美成人免费在线| 亚洲激情在线观看| 亚洲国产欧美一区二区三区久久| 亚洲国产人成综合网站| 亚洲每日在线| 亚洲婷婷综合色高清在线| 亚洲男人的天堂在线| 久久成人免费| 欧美va天堂在线| 欧美视频亚洲视频| 国产视频亚洲| 亚洲国内在线| 亚洲午夜电影| 久久黄色级2电影| 欧美第一黄网免费网站| 亚洲精品在线观看免费| 亚洲在线黄色| 久久夜色精品一区| 欧美日韩一区二区三区免费| 国产精品日韩欧美综合| 激情五月婷婷综合| 一本久久综合亚洲鲁鲁| 欧美一区二区精品久久911| 老**午夜毛片一区二区三区| 亚洲国产日韩一区| 亚洲一二三区精品| 久久美女艺术照精彩视频福利播放| 欧美69视频| 国产精品欧美日韩一区| 1769国产精品| 亚洲综合视频1区| 美女黄网久久| 亚洲视频专区在线| 另类人畜视频在线| 国产精品亚洲第一区在线暖暖韩国| 精品99一区二区三区| 99精品欧美一区二区蜜桃免费| 午夜视频在线观看一区二区三区| 久久尤物视频| 亚洲天堂免费观看| 毛片精品免费在线观看| 国产精品视频导航| 亚洲精品影院在线观看| 欧美一区二区三区视频在线观看| 欧美激情欧美激情在线五月| 亚洲一区www| 欧美成人午夜激情在线| 国产午夜精品全部视频在线播放| 99国产麻豆精品| 久久人人97超碰国产公开结果| 日韩视频国产视频| 久久综合狠狠综合久久综合88| 国产精品xnxxcom| 亚洲日本电影| 久久亚洲高清| 午夜久久tv| 国产精品qvod| 日韩网站免费观看| 免费欧美电影| 欧美一级理论性理论a| 欧美丝袜一区二区| 亚洲免费黄色| 欧美黑人在线播放| 久久久国产精品亚洲一区| 国产精品视频免费| 亚洲午夜激情| 亚洲精品久久7777| 欧美成人在线免费观看| 一区二区在线观看视频在线观看| 欧美一区二区三区久久精品茉莉花| 亚洲精品欧美专区| 女女同性女同一区二区三区91| 国产一区二区中文| 欧美在现视频| 亚洲在线观看视频| 国产精品美女久久久久av超清| 亚洲最黄网站| 亚洲毛片网站| 欧美日韩视频在线第一区| 亚洲美女色禁图| 欧美激情一区二区久久久| 久久一区二区三区四区五区| 黄色成人在线网址| 久久久视频精品| 欧美在线不卡| 国产一区美女| 麻豆精品一区二区综合av| 久久久91精品国产一区二区精品| 国产午夜精品久久久久久免费视| 欧美一区二区在线观看| 亚洲永久免费| 国产婷婷色综合av蜜臀av| 久久爱www久久做| 午夜久久黄色| 国内精品久久久久久久果冻传媒| 久久aⅴ国产欧美74aaa| 欧美一级视频| 精品成人一区二区| 欧美 亚欧 日韩视频在线| 久久综合99re88久久爱| 亚洲精品乱码久久久久| 亚洲人成人一区二区在线观看 | 欧美体内she精视频在线观看| 99在线精品视频| 日韩亚洲在线观看| 国产精品免费网站在线观看| 欧美一级免费视频| 午夜一区二区三视频在线观看 | 欧美天堂亚洲电影院在线观看 | 免费在线观看一区二区| 美女成人午夜| 9l国产精品久久久久麻豆| 99伊人成综合| 国产欧美在线观看| 免费欧美日韩| 欧美日韩国产在线| 性色一区二区三区| 久久精品亚洲国产奇米99| 亚洲高清在线| 夜夜狂射影院欧美极品| 国产日本欧美一区二区三区| 巨胸喷奶水www久久久免费动漫| 欧美不卡视频一区| 亚洲欧美日本另类| 久久xxxx精品视频| 亚洲精品一区中文| 亚洲一区二区精品在线| 精品福利电影| 99国产精品| 好吊色欧美一区二区三区四区| 亚洲国产日韩欧美在线99| 国产精品麻豆va在线播放| 久久人人看视频| 欧美日韩国产三区| 久久精品一本久久99精品| 欧美成人日韩| 久久狠狠婷婷| 欧美连裤袜在线视频| 久久精品一区二区国产| 欧美精品一区二区三区很污很色的| 欧美一区二区啪啪| 欧美成人午夜| 久久久久久久久久久久久久一区| 欧美国产在线视频| 久久精品一本| 欧美日韩三级一区二区| 老**午夜毛片一区二区三区| 欧美日韩一区二区三区在线视频| 久久综合久久综合九色| 欧美亚州在线观看| 欧美激情一区二区三区高清视频| 国产精品一区在线播放| 91久久国产综合久久蜜月精品| 国产日韩视频| 一本大道久久精品懂色aⅴ| 在线观看日韩av先锋影音电影院| 在线亚洲一区观看| 亚洲人成亚洲人成在线观看| 欧美一区综合| 亚洲欧美999| 欧美电影免费观看高清| 久久综合精品国产一区二区三区| 国产精品美女999| 亚洲精品久久久久久下一站 | 在线中文字幕一区| 亚洲日本久久| 久久免费少妇高潮久久精品99| 欧美一区在线看| 欧美视频日韩视频| 欧美激情在线观看| 狠狠爱成人网| 欧美在线播放视频| 欧美诱惑福利视频| 国产精品久久久久久久久久直播| 91久久夜色精品国产九色| 在线日韩电影| 久久久久久网| 久久综合久久综合九色| 国产一区二区你懂的| 亚洲一区国产精品| 亚洲欧美国内爽妇网| 欧美日韩综合另类| 亚洲欧洲一区二区天堂久久| 亚洲国产精品一区二区久| 久久久综合网站| 美女久久一区| 一区二区亚洲精品| 久久精品一区二区三区不卡牛牛| 久久成人在线| 国产综合视频| 久久不射2019中文字幕| 久久久综合香蕉尹人综合网| 国产亚洲欧美一区二区三区|