{"id":36058,"date":"2025-01-16T10:14:00","date_gmt":"2025-01-16T02:14:00","guid":{"rendered":"https:\/\/www.deepin.org\/?p=36058"},"modified":"2025-01-20T10:25:17","modified_gmt":"2025-01-20T02:25:17","slug":"how-to-debug-wine","status":"publish","type":"post","link":"https:\/\/www.deepin.org\/zh\/how-to-debug-wine\/","title":{"rendered":"Wine \u5f00\u53d1\u7cfb\u5217 \u2014\u2014 \u5982\u4f55\u8c03\u8bd5 Wine"},"content":{"rendered":"<img loading=\"lazy\" class=\"alignnone size-full wp-image-36059\" src=\"https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/03-zh.png\" alt=\"\" width=\"900\" height=\"383\" srcset=\"https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/03-zh.png 900w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/03-zh-300x128.png 300w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/03-zh-150x64.png 150w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/03-zh-768x327.png 768w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/03-zh-24x10.png 24w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/03-zh-36x15.png 36w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/03-zh-48x20.png 48w\" sizes=\"(max-width: 900px) 100vw, 900px\" \/><\/p>\n<p>\u672c\u6587\u4e3b\u8981\u4ee5 Wine \u5b98\u7f51\u7684\u8fd9\u7bc7\u6587\u7ae0 \u300a Debugging Wine \u300b \u6765\u8bb2\u89e3\u3002\u5927\u90e8\u5206\u5185\u5bb9\u662f\u5bf9\u8be5\u6587\u7684\u7ffb\u8bd1\uff0c\u4fee\u6b63\u4e86\u539f\u6587\u7684\u4e00\u4e9b\u4e66\u5199\u9519\u8bef\uff0c\u5220\u9664\u4e86\u539f\u6587\u8ddf\u6700\u65b0\u7684 Wine \u4e0d\u9002\u5e94\u7684\u5185\u5bb9\u3002<\/p>\n<h1 style=\"text-align: center;\"><strong>\u4ecb\u7ecd<\/strong><\/h1>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u5e38\u7528\u8c03\u8bd5\u65b9\u6cd5<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">Wine \u4e3a\u8c03\u8bd5\u95ee\u9898\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u3002\u5927\u591a\u6570 Wine \u5f00\u53d1\u4eba\u5458\u66f4\u559c\u6b22\u4f7f\u7528 Wine \u7684\u8c03\u8bd5\u901a\u9053\u6536\u96c6\u65e5\u5fd7\u6765\u89e3\u51b3\u95ee\u9898\u3002\u60a8\u53ef\u4ee5\u5728\u5f00\u53d1\u4eba\u5458\u8c03\u8bd5\u65e5\u5fd7\u4f7f\u7528\u6307\u5357\u4e2d\u4e86\u89e3\u5982\u4f55\u4f7f\u7528\u8c03\u8bd5\u901a\u9053\u6765\u8bb0\u5f55\u65e5\u5fd7\u7684\u66f4\u591a\u5185\u5bb9\u3002\uff08<a href=\"https:\/\/wiki.winehg.org\/Wine\u00a0Developer%27s\u00a0Guide\/Debug\u00a0Logging\">https:\/\/wiki.winehg.org\/Wine\u00a0Developer%27s\u00a0Guide\/Debug\u00a0Logging<\/a>\uff09<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u672c\u6587\u7684\u5269\u4f59\u90e8\u5206\u5c06\u8be6\u7ec6\u4ecb\u7ecd\u00a0Wine \u7684\u5185\u90e8\u8c03\u8bd5\u5668 winedbg \u7684\u4f7f\u7528\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u5728\u5e95\u5c42\u64cd\u4f5c\u7cfb\u7edf\u548c Windows \u4e2d\u7684\u8fdb\u7a0b\u548c\u7ebf\u7a0b<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5728\u6df1\u5165\u8bb2\u89e3 Wine \u7684\u8c03\u8bd5\u4e4b\u524d\uff0c\u4e0b\u9762\u662f Wine \u4e2d\u5bf9\u8fdb\u7a0b\u548c\u7ebf\u7a0b\u5904\u7406\u7684\u5c0f\u6982\u8ff0\u3002\u5fc5\u987b\u6e05\u695a\u7684\u662f\uff0c\u6211\u4eec\u6709\u4e24\u79cd\u4e0d\u540c\u7684\u6a21\u578b\uff1a\u4ece Unix \u89d2\u5ea6\u770b\u5230\u7684\u8fdb\u7a0b\/\u7ebf\u7a0b\uff0c\u4ece Windows \u89d2\u5ea6\u770b\u5230\u7684\u8fdb\u7a0b\/\u7ebf\u7a0b\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6bcf\u4e2a Windows \u7ebf\u7a0b\u90fd\u7528\u4e00\u4e2a Unix \u7ebf\u7a0b\u6765\u5b9e\u73b0\uff0c\u8fd9\u610f\u5473\u7740\u540c\u4e00\u4e2a Windows \u8fdb\u7a0b\u7684\u6240\u6709\u7ebf\u7a0b\u5171\u4eab\u76f8\u540c\u7684 Unix \u8fdb\u7a0b\u5730\u5740\u7a7a\u95f4\u3002\u4ee5\u4e0b:<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section><code>W-process<\/code> \u8868\u793a Windows \u4e2d\u7684\u8fdb\u7a0b<\/section>\n<\/li>\n<li>\n<section><code>U-process<\/code> \u8868\u793a Unix \u4e2d\u7684\u8fdb\u7a0b<\/section>\n<\/li>\n<li>\n<section><code>W-thread<\/code> \u00a0\u8868\u793a Windows \u4e2d\u7684\u7ebf\u7a0b<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4e00\u4e2a<code>W-process<\/code> \u7531\u4e00\u4e2a\u6216\u591a\u4e2a<code>W-thread<\/code> \u7ec4\u6210\u3002\u6bcf\u4e2a<code>W-thread<\/code> \u6620\u5c04\u5230\u4e00\u4e2a\u4e14\u53ea\u6709\u4e00\u4e2a<code>U-process<\/code>\u3002\u540c\u4e00\u4e2a<code>W-process<\/code> \u7684\u6240\u6709<code>U-process<\/code> \u5171\u4eab\u76f8\u540c\u7684\u5730\u5740\u7a7a\u95f4\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6240\u4ee5\u6bcf\u4e2a Unix \u8fdb\u7a0b\u90fd\u53ef\u4ee5\u7528\u4e24\u4e2a\u503c\u6765\u6807\u8bc6:<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section>Unix \u8fdb\u7a0b ID ( \u7b80\u79f0<code>upid<\/code>)<\/section>\n<\/li>\n<li>\n<section>Windows \u7ebf\u7a0b ID (\u7b80\u79f0<code>tid<\/code>)<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6bcf\u4e2a Windows \u8fdb\u7a0b\u8fd8\u5177\u6709 Windows \u8fdb\u7a0b ID \uff08\u7b80\u79f0<code>wpid<\/code>\uff09\u3002\u5fc5\u987b\u6e05\u695a\uff0c<code>upid<\/code> \u548c<code>wpid<\/code> \u662f\u4e0d\u540c\u7684\uff0c\u4e0d\u80fd\u76f8\u4e92\u66ff\u4ee3\u3002<code>wpid<\/code> \u548c<code>tid<\/code> \u662f Windows \u7cfb\u7edf\u5c42\u9762\u5b9a\u4e49\u7684\uff0c\u5b83\u4eec\u4e0d\u80fd\u4e0e\u8fdb\u7a0b\u6216\u7ebf\u7a0b\u53e5\u67c4\u6df7\u6dc6\uff0c\u56e0\u4e3a\u4efb\u4f55\u53e5\u67c4\u90fd\u6307\u5411\u7cfb\u7edf\u5bf9\u8c61\uff08\u5728\u672c\u4f8b\u4e2d\u4e3a\u8fdb\u7a0b\u6216\u7ebf\u7a0b\uff09\u3002\u540c\u4e00\u4e2a\u8fdb\u7a0b\u53ef\u4ee5\u5bf9\u540c\u4e00\u4e2a\u5185\u6838\u5bf9\u8c61\u6709\u591a\u4e2a\u4e0d\u540c\u7684\u53e5\u67c4\u3002\u53e5\u67c4\u53ef\u4ee5\u5b9a\u4e49\u4e3a\u5c40\u90e8\uff08\u503c\u4ec5\u5728\u540c\u4e00\u4e2a\u8fdb\u7a0b\u4e2d\u6709\u6548\uff09\uff0c\u4e5f\u53ef\u4ee5\u5b9a\u4e49\u4e3a\u7cfb\u7edf\u8303\u56f4\u7684\uff08\u4efb\u4f55<code>W-process<\/code>\u00a0\u90fd\u53ef\u4ee5\u4f7f\u7528\u76f8\u540c\u7684\u53e5\u67c4\uff09\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>Wine\u3001\u8c03\u8bd5\u548c Winedbg<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5728 Wine \u4e2d\u8c08\u5230\u8c03\u8bd5\u65f6\uff0c\u81f3\u5c11\u9700\u8981\u8003\u8651\u4e24\u4e2a\u5c42\u6b21\uff1a<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section>Windows \u8c03\u8bd5 API\u3002<\/section>\n<\/li>\n<li>\n<section>Wine \u96c6\u6210\u8c03\u8bd5\u5668\uff0c\u88ab\u79f0\u4e3a\u00a0<strong>winedbg<\/strong>\u3002<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">Wine \u5b9e\u73b0\u4e86\u5927\u591a\u6570 Windows \u8c03\u8bd5 API\u3002\u8c03\u8bd5 API \u7684\u7b2c\u4e00\u90e8\u5206\u5728 KERNEL32.DLL \u4e2d\u5b9e\u73b0\uff0c\u5141\u8bb8\u79f0\u4e3a\u8c03\u8bd5\u5668\u7684<code>W-process<\/code> \u63a7\u5236\u53e6\u4e00\u4e2a\u88ab\u8c03\u8bd5\u7684<code>W-process<\/code> \u7684\u6267\u884c\u3002\u63a7\u5236\u610f\u5473\u7740\u505c\u6b62\/\u6062\u590d\u6267\u884c\u3001\u542f\u7528\/\u7981\u7528\u5355\u6b65\u3001\u8bbe\u7f6e\u65ad\u70b9\u3001\u8bfb\u5199\u5185\u5b58\u7b49\u7b49\u3002\u8c03\u8bd5 API \u7684\u53e6\u4e00\u90e8\u5206\u5728 DBGHELP.DLL \uff08\u4f9d\u8d56 IMGHLP.DLL\uff09 \u4e2d\u5b9e\u73b0\uff0c\u5141\u8bb8\u8c03\u8bd5\u5668\u67e5\u770b\u4efb\u4f55\u6a21\u5757\u4e2d\u7684\u7b26\u53f7\u548c\u7b26\u53f7\u7c7b\u578b\uff08\u5982\u679c\u6a21\u5757\u5df2\u4f7f\u7528\u8c03\u8bd5\u9009\u9879\u7f16\u8bd1\uff09\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>Winedbg<\/strong> \u5c31\u662f\u4e00\u4e2a\u4f7f\u7528\u8fd9\u4e9b API \u7684 Winelib \u5e94\u7528\u7a0b\u5e8f\uff0c\u5141\u8bb8\u8c03\u8bd5\u4efb\u4f55 Wine \u6216 Winelib \u5e94\u7528\u7a0b\u5e8f\u4ee5\u53ca Wine \u672c\u8eab\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u8c03\u8bd5\u6559\u7a0b<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8fd9\u4e9b\u6559\u7a0b\u9488\u5bf9\u7684\u662f\u4e86\u89e3 C \u8bed\u8a00\u7f16\u7a0b\uff0c\u4f46\u521a\u521a\u5f00\u59cb\u53c2\u4e0e\u5f00\u53d1 Wine \u7684\u4eba\u3002\u65e8\u5728\u6f14\u793a\u5f53\u5e94\u7528\u7a0b\u5e8f\u4e0d\u5de5\u4f5c\u65f6\u600e\u6837\u8c03\u8bd5\u95ee\u9898\u3002<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section>\u8c03\u8bd5 Reason 3 - \u4e00\u4e2a\u7b80\u5355\u7684\"\u672a\u5904\u7406\u5f02\u5e38\"\u9519\u8bef\u6d88\u606f\u3002\u4ecb\u7ecd\u4e86\u8c03\u8bd5\u8ddf\u8e2a\u3001shell32.dll \u548c SEH\/\u5f02\u5e38\u8ddf\u8e2a\u3002<\/section>\n<section>https:\/\/wiki.winehq.org\/Debugging_Reason_3<\/section>\n<\/li>\n<li>\n<section>\u8c03\u8bd5 PE Explorer - \u4fee\u590d\u6587\u4ef6\u6253\u5f00\u5bf9\u8bdd\u6846\u4e2d\u7684\u7b80\u5355\u6302\u8d77\uff08\u53e6\u4e00\u4e2a\u00a0shell32 \u9519\u8bef\uff09\u3002\u4ecb\u7ecd\u4e86 winedbg \u7684\u5806\u6808\u56de\u6eaf\u7528\u6cd5\u548c\u4e0d\u540c\u7c7b\u578b\u7684\u9519\u8bef\u7801\u3002<\/section>\n<section>https:\/\/wiki.winehq.org\/Debugging_PE_Explorer<\/section>\n<\/li>\n<li>\n<section>\u8c03\u8bd5 Wild Metal Country - \u67e5\u627e\u6e38\u620f\u5d29\u6e83\u7684\u539f\u56e0\u4ee5\u53ca\u5982\u4f55\u786e\u8ba4\u9519\u8bef\u3002<\/section>\n<section>https:\/\/wiki.winehq.org\/Debugging_Wild_Metal_Country<\/section>\n<\/li>\n<li>\n<section>Anastasius Focht \u63d0\u4ea4\u7684 bug \u62a5\u544a\u91cc\u8be6\u7ec6\u63cf\u8ff0\u4e86\u4ed6\u5982\u4f55\u53d1\u73b0\u95ee\u9898\uff0c\u4ee5\u4e0b\u7f51\u5740\u53ef\u67e5\u770b\u4ed6\u7684 bug \u62a5\u544a\uff1a<\/section>\n<section>http:\/\/bugs.winehq.org\/buglist.cgi?query_format=advanced&amp;amp;emailreporter1=1&amp;amp;emaillongdesc1=1&amp;amp;email1=focht&amp;amp;emailtype1=substring<\/section>\n<section><\/section>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h1 style=\"text-align: center;\"><strong>Winedbg \u542f\u52a8\u65b9\u6cd5<\/strong><\/h1>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u542f\u52a8\u4e00\u4e2a\u8fdb\u7a0b<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4efb\u4f55\u7a0b\u5e8f\uff08\u539f\u751f\u7684 \u00a0Windows \u7a0b\u5e8f\u6216\u94fe\u63a5 Winelib \u7684\u7a0b\u5e8f\uff09\u90fd\u53ef\u4ee5\u7528 winedbg \u6765\u8fd0\u884c\uff0c\u547d\u4ee4\u884c\u9009\u9879\u8ddf Wine \u4e00\u6837\u7684\uff1a<\/p>\n<blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">winedbg telnet.exe<br \/>\nwinedbg hl.exe -windowed<\/p>\n<\/blockquote>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u9644\u52a0\u4e00\u4e2a\u8fdb\u7a0b<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">Winedbg \u4e5f\u53ef\u4ee5\u4e0d\u52a0\u4efb\u4f55\u547d\u4ee4\u884c\u53c2\u6570\u6765\u542f\u52a8: \u6b64\u65f6 winedbg \u4ee5\u6ca1\u6709\u9644\u52a0\u4efb\u4f55\u8fdb\u7a0b\u65b9\u5f0f\u542f\u52a8\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528<code>info proc<\/code> \u547d\u4ee4\u83b7\u53d6\u6b63\u5728\u8fd0\u884c\u7684<code>W-process<\/code>\u00a0\uff08\u53ca\u5176<code>wpid<\/code>\uff09\u7684\u5217\u8868\uff0c\u7136\u540e\u4f7f\u7528<code>attach<\/code> \u547d\u4ee4\u8ddf\u4e00\u4e2a\u8981\u8c03\u8bd5\u7684<code>W-process<\/code>\u7684<code>wpid<\/code> \u53c2\u6570\u3002\u8fd9\u529f\u80fd\u5141\u8bb8\u60a8\u8c03\u8bd5\u5df2\u7ecf\u542f\u52a8\u7684\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u5728\u53d1\u751f\u5f02\u5e38\u7684\u65f6\u5019<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5f53\u51fa\u73b0\u95ee\u9898\u65f6\uff0cWindows \u4f1a\u5c06\u5b83\u4f5c\u4e3a\u5f02\u5e38\u8fdb\u884c\u8ddf\u8e2a\u3002\u6bd4\u5982\u6709\u5206\u6bb5\u8fdd\u4f8b\u3001\u5806\u6808\u6ea2\u51fa\u3001\u9664\u96f6\u7b49\u5f02\u5e38\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u53d1\u751f\u5f02\u5e38\u65f6\uff0cWine \u4f1a\u68c0\u67e5<code>W-process<\/code> \u662f\u5426\u88ab\u8c03\u8bd5\u3002\u5982\u679c\u662f\uff0c\u5f02\u5e38\u4e8b\u4ef6\u5c06\u53d1\u9001\u5230\u8c03\u8bd5\u5668\uff0c\u8c03\u8bd5\u5668\u8d1f\u8d23\u662f\u5426\u4f20\u9012\u8be5\u5f02\u5e38\u3002\u6b64\u673a\u5236\u662f\u6807\u51c6 Windows \u8c03\u8bd5 API \u7684\u4e00\u90e8\u5206\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5982\u679c<code>W-process<\/code> \u6ca1\u6709\u88ab\u8c03\u8bd5\uff0cWine \u4f1a\u5c1d\u8bd5\u542f\u52a8\u8c03\u8bd5\u5668\u3002\u6b64\u8c03\u8bd5\u5668\uff08\u901a\u5e38\u662f winedbg\uff0c\u8bf7\u53c2\u9605\u4e0b\u4e00\u8282\u7684\u914d\u7f6e\u4ee5\u4e86\u89e3\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\uff09\uff0c\u5728\u542f\u52a8\u65f6\u9644\u52a0\u5230\u751f\u6210\u5f02\u5e38\u4e8b\u4ef6\u7684<code>W-process<\/code> \u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u60a8\u53ef\u4ee5\u67e5\u770b\u5f02\u5e38\u7684\u539f\u56e0\uff0c\u5e76\u4fee\u590d\u539f\u56e0\uff08\u548c\u7ee7\u7eed\u6267\u884c\uff09\u6216\u6df1\u5165\u6316\u6398\u4ee5\u4e86\u89e3\u51fa\u9519\u7684\u539f\u56e0\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5982\u679c winedbg \u662f\u6807\u51c6\u8c03\u8bd5\u5668\uff0c\u5219<code>pass<\/code> \u548c<code>cont<\/code> \u547d\u4ee4\u662f\u8ba9\u8fdb\u7a0b\u8fdb\u4e00\u6b65\u5904\u7406\u5f02\u5e38\u4e8b\u4ef6\u7684\u4e24\u79cd\u65b9\u6cd5\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u66f4\u7cbe\u786e\u5730\u8bf4\uff1a\u5f53\u53d1\u751f\u6545\u969c\u65f6\uff08\u5206\u6bb5\u8fdd\u4f8b\u3001\u5806\u6808\u6ea2\u51fa\u2026\u2026\uff09\uff0c\u8be5\u4e8b\u4ef6\u9996\u5148\u53d1\u9001\u5230\u8c03\u8bd5\u5668\uff08\u8fd9\u79f0\u4e3a\u7b2c\u4e00\u6b21\u5f02\u5e38\u5904\u7406\u673a\u4f1a\uff09\u3002\u8c03\u8bd5\u5668\u53ef\u4ee5\u7ed9\u51fa\u4e24\u4e2a\u7b54\u6848\uff1a<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section>continue \u8c03\u8bd5\u5668\u80fd\u591f\u4fee\u590d\u8fd9\u4e2a\u5f02\u5e38\uff0c\u5e76\u4e14\u80fd\u591f\u8ba9\u7a0b\u5e8f\u7ee7\u7eed\u6267\u884c\u3002<\/section>\n<\/li>\n<li>\n<section>pass \u8c03\u8bd5\u5668\u5728\u7b2c\u4e00\u6b21\u5f02\u5e38\u5904\u7406\u673a\u4f1a\u65f6\u4e0d\u80fd\u4fee\u590d\u8fd9\u4e2a\u5f02\u5e38\u3002Wine \u5c06\u5c1d\u8bd5\u904d\u5386\u5f02\u5e38\u5904\u7406\u7a0b\u5e8f\u5217\u8868\uff0c\u67e5\u770b\u5176\u4e2d\u4e00\u4e2a\u5904\u7406\u7a0b\u5e8f\u662f\u5426\u53ef\u4ee5\u5904\u7406\u8be5\u5f02\u5e38\u3002\u5982\u679c\u672a\u627e\u5230\u5f02\u5e38\u5904\u7406\u7a0b\u5e8f\uff0c\u5219\u518d\u6b21\u5c06\u8fd9\u4e2a\u5f02\u5e38\u53d1\u9001\u5230\u8c03\u8bd5\u5668\uff0c\u4ee5\u6307\u793a\u5f02\u5e38\u5904\u7406\u5931\u8d25\u3002<\/section>\n<\/li>\n<\/ul>\n<blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u6ce8\u610f\uff1a<\/strong>\u7531\u4e8e\u67d0\u4e9b Wine \u4ee3\u7801\u4f7f\u7528\u5f02\u5e38\u548c try\/catch \u5757\u6765\u5b9e\u73b0\u67d0\u4e9b\u529f\u80fd\uff0c\u56e0\u6b64\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0bwinedbg \u6536\u5230 segv \u5f02\u5e38\u800c\u505c\u4e0b\u6765\u3002\u4f8b\u5982\uff0c\u4f7f\u7528 IsBadReadPtr \u51fd\u6570\u65f6\u4f1a\u53d1\u751f\u8fd9\u79cd\u60c5\u51b5\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u5e94\u4f7f\u7528<code>pass<\/code> \u547d\u4ee4\uff0c\u4ee5\u4fbf\u7531 IsBadReadPtr \u4e2d\u7684 catch \u5757\u5904\u7406\u5f02\u5e38\u3002<\/p>\n<\/blockquote>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u4e2d\u65ad<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u60a8\u53ef\u4ee5\u5728winedbg \u7a97\u53e3\u540c\u65f6\u6309\u4e0b Ctrl+C \u6765\u505c\u6b62\u6b63\u5728\u8fd0\u884c\u7684\u88ab\u8c03\u8bd5\u7a0b\u5e8f\uff0c\u5e76\u5141\u8bb8\u60a8\u5728 winedbg \u91cc\u9762\u64cd\u4f5c\u88ab\u8c03\u8bd5\u7a0b\u5e8f\u7684\u8fdb\u7a0b\u4e0a\u4e0b\u6587\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u9000\u51fa<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">Wine \u652f\u6301\u65b0\u7684 XP API\uff0c\u5141\u8bb8\u8c03\u8bd5\u5668\u4ece\u88ab\u8c03\u8bd5\u7a0b\u5e8f\u4e0a\u5206\u79bb\uff08\u89c1\u4e0b\u6587\u7684<code>detach<\/code> \u547d\u4ee4\uff09\u3002<\/p>\n<p>&nbsp;<\/p>\n<h1 style=\"text-align: center;\"><strong>\u4f7f\u7528 Wine \u8c03\u8bd5\u5668<\/strong><\/h1>\n<p>\u8fd9\u4e00\u8282\u4ecb\u7ecd\u4ece\u4f55\u5904\u5f00\u59cb\u8c03\u8bd5 Wine\u3002\u5982\u679c\u60a8\u5728\u4efb\u4f55\u65f6\u5019\u5361\u4f4f\u4e86\u5e76\u4e14\u9700\u8981\u5e2e\u52a9\uff0c\u8bf7\u9605\u8bfb Wine \u7528\u6237\u6307\u5357\u4e4b\u5982\u4f55\u62a5\u544a bug \u4e00\u8282\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u5d29\u6e83<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5d29\u6e83\u65f6\u6211\u4eec\u5e38\u770b\u5230\u7c7b\u4f3c\u8fd9\u6837\u7684\u5bf9\u8bdd\u6846\uff1a<\/p>\n<blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">Unhandled exception: page fault on write access to 0x00000000 in 32-bit code (0x0043369e).<br \/>\nRegister dump:<br \/>\nCS:0023 SS:002b DS:002b ES:002b FS:0063 GS:006b<br \/>\nEIP:0043369e ESP:0b3ee90c EBP:0b3ee938 EFLAGS:00010246( \u00a0R- -- \u00a0I \u00a0Z- -P- )<br \/>\nEAX:00000072 EBX:7b8acff4 ECX:00000000 EDX:6f727265<br \/>\nESI:7ba3b37c EDI:7ffa0000<br \/>\nStack dump:<br \/>\n0x0b3ee90c: \u00a07b82ced8 00000000 7ba3b348 7b884401<br \/>\n0x0b3ee91c: \u00a07b883cdc 00000008 00000000 7bc36e7b<br \/>\n0x0b3ee92c: \u00a07b8acff4 7b82ceb9 7b8acff4 0b3eea18<br \/>\n0x0b3ee93c: \u00a07b82ce82 00000000 00000000 00000000<br \/>\n0x0b3ee94c: \u00a000000000 0b3ee968 70d7ed7b 70c50000<br \/>\n0x0b3ee95c: \u00a000000000 0b3eea40 7b87fd40 7b82d0d0<br \/>\nBacktrace:<br \/>\n=&gt;0 0x0043369e in elementclient (+0x3369e) (0x0b3ee938)<br \/>\n1 0x7b82ce82 CONSOLE_SendEventThread+0xe1(pmt=0x0(nil)) [\/usr\/src\/debug\/wine-1.5.14\/dlls\/kernel32\/console.c:1989] in kernel32 (0x0b3eea18)<br \/>\n2 0x7bc76320 call_thread_func_wrapper+0xb() in ntdll (0x0b3eea28)<br \/>\n3 0x7bc7916e call_thread_func+0x7d(entry=0x7b82cda0, arg=0x0(nil), frame=0xb3eeb18) [\/usr\/src\/debug\/wine-1.5.14\/dlls\/ntdll\/signal_i386.c:2522] in ntdll (0x0b3eeaf8)<br \/>\n4 0x7bc762fe RtlRaiseException+0x21() in ntdll (0x0b3eeb18)<br \/>\n5 0x7bc7f3da start_thread+0xe9(info=0x7ffa0fb8) [\/usr\/src\/debug\/wine-1.5.14\/dlls\/ntdll\/thread.c:408] in ntdll (0x0b3ef368)<br \/>\n6 0xf7597adf start_thread+0xce() in libpthread.so.0 (0x0b3ef468)<br \/>\n0x0043369e: movl \u00a0 \u00a0%edx,0x0(%ecx)<br \/>\nModules:<br \/>\nModule \u00a0Address \u00a0 \u00a0 \u00a0 \u00a0 Debug info \u00a0Name (143 modules)<br \/>\nPE \u00a0 \u00a0340000- \u00a03af000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0speedtreert<br \/>\nPE \u00a0 \u00a03b0000- \u00a03d6000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0ftdriver<br \/>\nPE \u00a0 \u00a03e0000- \u00a03e6000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0immwrapper<br \/>\nPE \u00a0 \u00a0400000- \u00a0b87000 \u00a0 Export \u00a0 \u00a0 \u00a0 \u00a0 \u00a0elementclient<br \/>\nPE \u00a0 \u00a0b90000- \u00a0e04000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0elementskill<br \/>\nPE \u00a0 \u00a0e10000- \u00a0e42000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0ifc22<br \/>\nPE \u00a010000000-10016000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0zlibwapi<br \/>\nELF 41f75000-41f7e000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0librt.so.1<br \/>\nELF 41ff9000-42012000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libresolv.so.2<br \/>\nPE \u00a048080000-480a8000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0msls31<br \/>\nPE \u00a065340000-653d2000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0oleaut32<br \/>\nPE \u00a070200000-70294000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0wininet<br \/>\nPE \u00a0702b0000-70328000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0urlmon<br \/>\nPE \u00a070440000-704cf000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0mlang<br \/>\nPE \u00a070bd0000-70c34000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0shlwapi<br \/>\nPE \u00a070c50000-70ef3000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0mshtml<br \/>\nPE \u00a071930000-719b8000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0shdoclc<br \/>\nPE \u00a078130000-781cb000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0msvcr80<br \/>\nELF 79afb000-7b800000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libnvidia-glcore.so.304.51<br \/>\nELF 7b800000-7ba3d000 \u00a0 Dwarf \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 kernel32&lt;elf&gt;<br \/>\n\\-PE \u00a07b810000-7ba3d000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 kernel32<br \/>\nELF 7bc00000-7bcd5000 \u00a0 Dwarf \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ntdll&lt;elf&gt;<br \/>\n\\-PE \u00a07bc10000-7bcd5000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ntdll<br \/>\nELF 7bf00000-7bf04000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0&lt;wine-loader&gt;<br \/>\nELF 7c288000-7c400000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libvorbisenc.so.2<br \/>\nPE \u00a07c420000-7c4a7000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0msvcp80<br \/>\nELF 7c56d000-7c5b6000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0dinput&lt;elf&gt;<br \/>\n\\-PE \u00a07c570000-7c5b6000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 dinput<br \/>\nELF 7c5b6000-7c600000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libdbus-1.so.3<br \/>\nELF 7c70e000-7c715000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libasyncns.so.0<br \/>\nELF 7c715000-7c77e000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libsndfile.so.1<br \/>\nELF 7c77e000-7c7e5000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libpulsecommon-1.1.so<br \/>\nELF 7c7e5000-7c890000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0krnl386.exe16.so<br \/>\nPE \u00a07c7f0000-7c890000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0krnl386.exe16<br \/>\nELF 7c890000-7c900000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0ieframe&lt;elf&gt;<br \/>\n\\-PE \u00a07c8a0000-7c900000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ieframe<br \/>\nELF 7ca00000-7ca1a000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0rasapi32&lt;elf&gt;<br \/>\n\\-PE \u00a07ca10000-7ca1a000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 rasapi32<br \/>\nELF 7ca1a000-7ca21000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libnss_dns.so.2<br \/>\nELF 7ca21000-7ca25000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libnss_mdns4_minimal.so.2<br \/>\nELF 7ca25000-7ca2d000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libogg.so.0<br \/>\nELF 7ca2d000-7ca5a000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libvorbis.so.0<br \/>\nELF 7cd5d000-7cd9c000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libflac.so.8<br \/>\nELF 7cd9c000-7cdea000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libpulse.so.0<br \/>\nELF 7cdfe000-7ce23000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0iphlpapi&lt;elf&gt;<br \/>\n\\-PE \u00a07ce00000-7ce23000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 iphlpapi<br \/>\nELF 7cff1000-7cffd000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libnss_nis.so.2<br \/>\nELF 7d60d000-7d629000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0wsock32&lt;elf&gt;<br \/>\n\\-PE \u00a07d610000-7d629000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 wsock32<br \/>\nELF 7d80d000-7d828000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libnsl.so.1<br \/>\nELF 7d8cf000-7d8db000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libgsm.so.1<br \/>\nELF 7d8db000-7d903000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0winepulse&lt;elf&gt;<br \/>\n\\-PE \u00a07d8e0000-7d903000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 winepulse<br \/>\nELF 7d95c000-7d966000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libwrap.so.0<br \/>\nELF 7d966000-7d96d000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libxtst.so.6<br \/>\nELF 7d96d000-7d992000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0mmdevapi&lt;elf&gt;<br \/>\n\\-PE \u00a07d970000-7d992000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 mmdevapi<br \/>\nELF 7d9b3000-7d9d0000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0msimtf&lt;elf&gt;<br \/>\n\\-PE \u00a07d9c0000-7d9d0000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 msimtf<br \/>\nELF 7d9d0000-7d9e5000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0comm.drv16.so<br \/>\nPE \u00a07d9e0000-7d9e5000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0comm.drv16<br \/>\nELF 7da83000-7db5f000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libgl.so.1<br \/>\nELF 7db60000-7db63000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libx11-xcb.so.1<br \/>\nELF 7db63000-7db78000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0system.drv16.so<br \/>\nPE \u00a07db70000-7db78000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0system.drv16<br \/>\nELF 7db98000-7dca1000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0opengl32&lt;elf&gt;<br \/>\n\\-PE \u00a07dbb0000-7dca1000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 opengl32<br \/>\nELF 7dca1000-7dcb6000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0vdmdbg&lt;elf&gt;<br \/>\n\\-PE \u00a07dcb0000-7dcb6000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 vdmdbg<br \/>\nELF 7dcce000-7dd04000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0uxtheme&lt;elf&gt;<br \/>\n\\-PE \u00a07dcd0000-7dd04000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 uxtheme<br \/>\nELF 7dd04000-7dd0a000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libxfixes.so.3<br \/>\nELF 7dd0a000-7dd15000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libxcursor.so.1<br \/>\nELF 7dd16000-7dd1f000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libjson.so.0<br \/>\nELF 7dd24000-7dd38000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0psapi&lt;elf&gt;<br \/>\n\\-PE \u00a07dd30000-7dd38000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 psapi<br \/>\nELF 7dd78000-7dda1000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libexpat.so.1<br \/>\nELF 7dda1000-7ddd6000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libfontconfig.so.1<br \/>\nELF 7ddd6000-7dde6000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libxi.so.6<br \/>\nELF 7dde6000-7ddef000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libxrandr.so.2<br \/>\nELF 7ddef000-7de11000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libxcb.so.1<br \/>\nELF 7de11000-7df49000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libx11.so.6<br \/>\nELF 7df49000-7df5b000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libxext.so.6<br \/>\nELF 7df5b000-7df75000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libice.so.6<br \/>\nELF 7df75000-7e005000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0winex11&lt;elf&gt;<br \/>\n\\-PE \u00a07df80000-7e005000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 winex11<br \/>\nELF 7e005000-7e0a5000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libfreetype.so.6<br \/>\nELF 7e0a5000-7e0c5000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libtinfo.so.5<br \/>\nELF 7e0c5000-7e0ea000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libncurses.so.5<br \/>\nELF 7e123000-7e1eb000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0crypt32&lt;elf&gt;<br \/>\n\\-PE \u00a07e130000-7e1eb000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 crypt32<br \/>\nELF 7e1eb000-7e235000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0dsound&lt;elf&gt;<br \/>\n\\-PE \u00a07e1f0000-7e235000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 dsound<br \/>\nELF 7e235000-7e2a7000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0ddraw&lt;elf&gt;<br \/>\n\\-PE \u00a07e240000-7e2a7000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ddraw<br \/>\nELF 7e2a7000-7e3e3000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0wined3d&lt;elf&gt;<br \/>\n\\-PE \u00a07e2b0000-7e3e3000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 wined3d<br \/>\nELF 7e3e3000-7e417000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0d3d8&lt;elf&gt;<br \/>\n\\-PE \u00a07e3f0000-7e417000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 d3d8<br \/>\nELF 7e417000-7e43b000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0imm32&lt;elf&gt;<br \/>\n\\-PE \u00a07e420000-7e43b000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 imm32<br \/>\nELF 7e43b000-7e46f000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0ws2_32&lt;elf&gt;<br \/>\n\\-PE \u00a07e440000-7e46f000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ws2_32<br \/>\nELF 7e46f000-7e49a000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0msacm32&lt;elf&gt;<br \/>\n\\-PE \u00a07e470000-7e49a000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 msacm32<br \/>\nELF 7e49a000-7e519000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0rpcrt4&lt;elf&gt;<br \/>\n\\-PE \u00a07e4b0000-7e519000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 rpcrt4<br \/>\nELF 7e519000-7e644000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0ole32&lt;elf&gt;<br \/>\n\\-PE \u00a07e530000-7e644000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ole32<br \/>\nELF 7e644000-7e6f7000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0winmm&lt;elf&gt;<br \/>\n\\-PE \u00a07e650000-7e6f7000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 winmm<br \/>\nELF 7e6f7000-7e7fa000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0comctl32&lt;elf&gt;<br \/>\n\\-PE \u00a07e700000-7e7fa000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 comctl32<br \/>\nELF 7e7fa000-7ea23000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0shell32&lt;elf&gt;<br \/>\n\\-PE \u00a07e810000-7ea23000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 shell32<br \/>\nELF 7ea23000-7eaf9000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0gdi32&lt;elf&gt;<br \/>\n\\-PE \u00a07ea30000-7eaf9000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 gdi32<br \/>\nELF 7eafb000-7eaff000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libnvidia-tls.so.304.51<br \/>\nELF 7eaff000-7eb09000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libxrender.so.1<br \/>\nELF 7eb09000-7eb0f000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libxxf86vm.so.1<br \/>\nELF 7eb0f000-7eb18000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libsm.so.6<br \/>\nELF 7eb18000-7eb32000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0version&lt;elf&gt;<br \/>\n\\-PE \u00a07eb20000-7eb32000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 version<br \/>\nELF 7eb32000-7ec87000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0user32&lt;elf&gt;<br \/>\n\\-PE \u00a07eb40000-7ec87000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 user32<br \/>\nELF 7ec87000-7ecf1000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0advapi32&lt;elf&gt;<br \/>\n\\-PE \u00a07ec90000-7ecf1000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 advapi32<br \/>\nELF 7ecf1000-7ed8f000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0msvcrt&lt;elf&gt;<br \/>\n\\-PE \u00a07ed00000-7ed8f000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 msvcrt<br \/>\nELF 7ef8f000-7ef9c000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libnss_files.so.2<br \/>\nELF 7ef9c000-7efc7000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libm.so.6<br \/>\nELF 7efc8000-7efe5000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libgcc_s.so.1<br \/>\nELF 7efe5000-7f000000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0crtdll&lt;elf&gt;<br \/>\n\\-PE \u00a07eff0000-7f000000 \u00a0 \\ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 crtdll<br \/>\nELF f73d0000-f73d4000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libxinerama.so.1<br \/>\nELF f73d4000-f73d8000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libxau.so.6<br \/>\nELF f73da000-f73df000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libdl.so.2<br \/>\nELF f73df000-f7591000 \u00a0 Dwarf \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 libc.so.6<br \/>\nELF f7591000-f75ab000 \u00a0 Dwarf \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 libpthread.so.0<br \/>\nELF f75ab000-f76ef000 \u00a0 Dwarf \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 libwine.so.1<br \/>\nELF f7722000-f7728000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0libuuid.so.1<br \/>\nELF f7729000-f774a000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0ld-linux.so.2<br \/>\nELF f774a000-f774b000 \u00a0 Deferred \u00a0 \u00a0 \u00a0 \u00a0[vdso].so<br \/>\nThreads:<br \/>\nprocess \u00a0tid \u00a0 \u00a0 \u00a0prio (all id:s are in hex)<br \/>\n00000008 (D) C:\\Perfect World Entertainment\\Perfect World International\\element\\elementclient.exe<br \/>\n00000031 \u00a0 \u00a00 &lt;==<br \/>\n00000035 \u00a0 15<br \/>\n00000012 \u00a0 \u00a00<br \/>\n00000021 \u00a0 \u00a00<br \/>\n00000045 \u00a0 \u00a00<br \/>\n00000044 \u00a0 \u00a00<br \/>\n00000043 \u00a0 \u00a00<br \/>\n00000038 \u00a0 15<br \/>\n00000037 \u00a0 \u00a00<br \/>\n00000036 \u00a0 15<br \/>\n00000034 \u00a0 \u00a00<br \/>\n00000033 \u00a0 \u00a00<br \/>\n00000032 \u00a0 \u00a00<br \/>\n00000027 \u00a0 \u00a00<br \/>\n00000009 \u00a0 \u00a00<br \/>\n0000000e services.exe<br \/>\n0000000b \u00a0 \u00a00<br \/>\n00000020 \u00a0 \u00a00<br \/>\n00000017 \u00a0 \u00a00<br \/>\n00000010 \u00a0 \u00a00<br \/>\n0000000f \u00a0 \u00a00<br \/>\n00000014 winedevice.exe<br \/>\n0000001e \u00a0 \u00a00<br \/>\n0000001b \u00a0 \u00a00<br \/>\n00000016 \u00a0 \u00a00<br \/>\n00000015 \u00a0 \u00a00<br \/>\n0000001c plugplay.exe<br \/>\n00000022 \u00a0 \u00a00<br \/>\n0000001f \u00a0 \u00a00<br \/>\n0000001d \u00a0 \u00a00<br \/>\n00000023 explorer.exe<br \/>\n00000024 \u00a0 \u00a00<\/p>\n<\/blockquote>\n<p>&nbsp;<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8c03\u8bd5\u5d29\u6e83\u7684\u6b65\u9aa4\u3002\u60a8\u53ef\u80fd\u5728\u4efb\u4f55\u6b65\u9aa4\u4e2d\u5d29\u6e83\uff0c\u4f46\u8bf7\u62a5\u544a bug\uff0c\u5e76\u5728 bug \u62a5\u544a\u4e2d\u63d0\u4f9b\u6536\u96c6\u5230\u7684\u5c3d\u53ef\u80fd\u591a\u7684\u4fe1\u606f\u3002<\/p>\n<ol class=\"list-paddingleft-1\">\n<li>\n<section>\u4e86\u89e3\u5d29\u6e83\u7684\u539f\u56e0\u3002\u901a\u5e38\u662f\u9875\u9762\u9519\u8bef\u3001\u8c03\u7528\u4e86Wine \u4e2d\u672a\u5b9e\u73b0\u7684\u51fd\u6570\uff0c\u6216\u7c7b\u4f3c\u7684\u539f\u56e0\u3002\u62a5\u544a\u5d29\u6e83\u65f6\uff0c\u62a5\u544a\u6574\u4e2a\u5d29\u6e83\u8f6c\u50a8\uff0c\u5373\u4f7f\u5b83\u5bf9\u60a8\u6ca1\u6709\u610f\u4e49\u3002(\u5728\u8fd9\u4e2a\u4f8b\u5b50\u91cc\u9762\uff0c\u5728\u5199\u5165 0x0000000 \u65f6\u51fa\u73b0\u9875\u9762\u9519\u8bef\u3002\u6700\u6709\u53ef\u80fd\u7684\u662f Wine \u5c06 NULL \u4f20\u9012\u7ed9\u5e94\u7528\u7a0b\u5e8f\u6216\u7c7b\u4f3c\u95ee\u9898\u3002)<\/section>\n<\/li>\n<li>\n<section>\u786e\u5b9a\u5d29\u6e83\u7684\u539f\u56e0\u3002\u7531\u4e8e\u901a\u5e38\u662f Wine \u5b9e\u73b0\u7684\u51fd\u6570\u6267\u884c\u5931\u8d25\u6216\u8005\u884c\u4e3a\u4e0d\u6b63\u786e\u5bfc\u81f4\u7684\u4e3b\u8981\/\u6b21\u8981\u53cd\u5e94\uff0c\u56e0\u6b64\u4f7f\u7528<code>WINEDEBUG=+relay<\/code> \u73af\u5883\u53d8\u91cf\u91cd\u65b0\u8fd0\u884c Wine\u3002\u8fd9\u5c06\u751f\u6210\u76f8\u5f53\u591a\u7684\u65e5\u5fd7\u8f93\u51fa\uff0c\u4f46\u901a\u5e38\u539f\u56e0\u662f\u4f4d\u4e8e\u6700\u540e\u4e00\u4e2a\u51fd\u6570\u8c03\u7528\u4e2d\u3002\u8fd9\u4e9b\u65e5\u5fd7\u901a\u5e38\u5982\u4e0b\u6240\u793a\uff1a<\/section>\n<\/li>\n<\/ol>\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-36060 aligncenter\" src=\"https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/\u5fae\u4fe1\u56fe\u7247_2025-01-16_100310_196.png\" alt=\"\" width=\"768\" height=\"203\" srcset=\"https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/\u5fae\u4fe1\u56fe\u7247_2025-01-16_100310_196.png 768w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/\u5fae\u4fe1\u56fe\u7247_2025-01-16_100310_196-300x79.png 300w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/\u5fae\u4fe1\u56fe\u7247_2025-01-16_100310_196-150x40.png 150w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/\u5fae\u4fe1\u56fe\u7247_2025-01-16_100310_196-24x6.png 24w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/\u5fae\u4fe1\u56fe\u7247_2025-01-16_100310_196-36x10.png 36w, https:\/\/www.deepin.org\/wp-content\/uploads\/2025\/01\/\u5fae\u4fe1\u56fe\u7247_2025-01-16_100310_196-48x13.png 48w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><\/p>\n<ol class=\"list-paddingleft-1\">\n<li>\n<section>\u5982\u679c\u4f60\u5df2\u7ecf\u53d1\u73b0\u4e86\u4e00\u4e2a\u884c\u4e3a\u4e0d\u6b63\u5e38\u7684 Wine \u51fd\u6570\uff0c\u5c1d\u8bd5\u627e\u51fa\u5b83\u884c\u4e3a\u4e0d\u6b63\u5e38\u7684\u539f\u56e0\u3002\u5728\u6e90\u4ee3\u7801\u4e2d\u67e5\u627e\u51fd\u6570\u3002\u8bd5\u7740\u7406\u89e3\u4f20\u9012\u7684\u51fd\u6570\u53c2\u6570\u3002\u901a\u5e38\u6709\u4e00\u4e2a<code>WINE_DEFAULT_DEBUG_CHANNEL(channel);<\/code> \u5728\u6e90\u6587\u4ef6\u7684\u5f00\u5934\u3002\u4f7f\u7528<code>WINEDEBUG=+xyz,+relay<\/code> \u73af\u5883\u53d8\u91cf\u91cd\u65b0\u8fd0\u884c Wine\u3002\u6709\u65f6\uff0c\u5728\u6e90\u6587\u4ef6\u7684\u5f00\u5934\u4ee5<code>WINE_DECLARE_DEBUG_CHANNEL(channel)<\/code>\u7684\u5f62\u5f0f\u5b9a\u4e49\u4e86\u5176\u4ed6\u8c03\u8bd5\u901a\u9053\uff1b\u5982\u679c\u662f\u8fd9\u6837\uff0c\u6709\u95ee\u9898\u7684\u51fd\u6570\u4e5f\u53ef\u80fd\u4f7f\u7528\u4e86\u8fd9\u4e9b\u5907\u7528\u901a\u9053\u4e4b\u4e00\u3002\u5728\u8be5\u51fd\u6570\u4e2d\u641c\u7d22<code>TRACE_(channel)(\"...\/n\");<\/code> \u5e76\u5c06\u627e\u5230\u7684\u8fd9\u4e9b\u989d\u5916\u7684\u901a\u9053\u6dfb\u52a0\u5230 WINEDEBUG \u73af\u5883\u53d8\u91cf\u91cc\u9762\u3002<\/section>\n<\/li>\n<li>\n<section>\u6709\u5173\u5982\u4f55\u4f7f\u7528 winedbg \u8fdb\u884c\u8c03\u8bd5\u7684\u5176\u4ed6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605\u6e90\u7801<code>programs\/winedbg\/README<\/code>\u3002<\/section>\n<\/li>\n<li>\n<section>\u5982\u679c\u8fd9\u4e9b\u4fe1\u606f\u4e0d\u591f\u6e05\u6670\uff0c\u6216\u8005\u60a8\u60f3\u77e5\u9053\u8be5\u51fd\u6570\u53d1\u751f\u7684\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u5c1d\u8bd5\u4f7f\u7528<code>WINEDEBUG=+all<\/code>\u91cd\u65b0\u8fd0\u884c Wine \uff0c\u8fd9\u5c06\u8f6c\u50a8 Wine \u91cc\u9762\u5305\u542b\u8c03\u8bd5\u4fe1\u606f\u5728\u5185\u7684<strong>\u6240\u6709<\/strong>\u65e5\u5fd7\u3002\u901a\u5e38\u9700\u8981\u9650\u5236\u751f\u6210\u7684\u8c03\u8bd5\u8f93\u51fa\u3002\u8fd9\u53ef\u4ee5\u901a\u8fc7\u7ba1\u9053\u628a\u8f93\u51fa\u65e5\u5fd7\u53d1\u7ed9<code>grep<\/code> \u8fc7\u6ee4\uff0c\u6216\u8005\u4f7f\u7528\u6ce8\u518c\u8868\u9879\u6765\u5b8c\u6210\u3002\u6709\u5173\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605\u4e0b\u6587\u7684<code>\u914d\u7f6e +relay \u884c\u4e3a<\/code> \u4e00\u8282\u3002<\/section>\n<\/li>\n<li>\n<section>\u5982\u679c\u8fd9\u8fd8\u4e0d\u591f\uff0c\u53ef\u4ee5\u5728\u60a8\u8ba4\u4e3a\u76f8\u5173\u7684\u51fd\u6570\u4e2d\u624b\u52a8\u6dfb\u52a0\u66f4\u591a\u8c03\u8bd5\u65e5\u5fd7\u3002\u6709\u5173\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605\u5f00\u53d1\u4eba\u5458\u8c03\u8bd5\u65e5\u5fd7\u4f7f\u7528\u6307\u5357\u3002\u60a8\u4e5f\u53ef\u4ee5\u5c1d\u8bd5\u5728 gdb \u4e2d\u8fd0\u884c\u8be5\u7a0b\u5e8f\uff0c\u4ee3\u66ff\u4f7f\u7528 Wine \u8c03\u8bd5\u5668\u3002\u5982\u679c\u8fd9\u6837\u505a\uff0c\u8bf7\u5728<code>~\/.gdbinit<\/code> \u6587\u4ef6\u91cc\u9762\u589e\u52a0\u8fd9\u53e5<code>handle SIGSEGV nostop noprint<\/code> \u6765\u7981\u7528 gdb \u5bf9<code>seg fault<\/code> \u9519\u8bef\u7684\u5904\u7406\uff08Win16 \u9700\u8981\uff09\u3002<\/section>\n<\/li>\n<li>\n<section>\u60a8\u8fd8\u53ef\u4ee5\u4e3a\u8be5\u51fd\u6570\u8bbe\u7f6e\u65ad\u70b9\u3002\u7528 winedbg \u542f\u52a8\u8c03\u8bd5\u7a0b\u5e8f\u800c\u4e0d\u662f Wine\u3002\u4e00\u65e6\u8c03\u8bd5\u5668\u8fd0\u884c\u8d77\u6765\uff0c\u5728\u547d\u4ee4\u884c\u63d0\u793a\u7b26\u8f93\u5165\u547d\u4ee4:<code>break RegOpenKeyExW<\/code> \uff08\u5c06 RegOpenKeyExW \u66ff\u6362\u6210\u60a8\u8981\u8c03\u8bd5\u7684\u51fd\u6570\uff0c\u533a\u5206\u5927\u5c0f\u5199\uff09\u4ee5\u8bbe\u7f6e\u65ad\u70b9\u3002\u7136\u540e\uff0c\u4f7f\u7528<code>continue<\/code> \u547d\u4ee4\u542f\u52a8\u7a0b\u5e8f\u6b63\u5e38\u6267\u884c\u3002\u7a0b\u5e8f\u8fd0\u884c\u5230\u65ad\u70b9\u4f4d\u7f6e\uff0c\u7a0b\u5e8f\u5c06\u505c\u6b62\uff1b\u5982\u679c\u7a0b\u5e8f\u8fd8\u6ca1\u6709\u8fd0\u884c\u5230\u8be5\u51fd\u6570\u5d29\u6e83\u7684\u90a3\u6b21\u8c03\u7528\uff0c\u518d\u6b21\u4f7f\u7528<code>continue<\/code> \u547d\u4ee4\u7ee7\u7eed\u8fd0\u884c\u7a0b\u5e8f\u76f4\u5230\u8fbe\u5230\u8be5\u51fd\u6570\u5373\u5c06\u5d29\u6e83\u7684\u90a3\u6b21\u8c03\u7528\u3002\u73b0\u5728\uff0c\u60a8\u53ef\u4ee5\u7528\u5355\u6b65\u6267\u884c\u547d\u4ee4\u6765\u7ee7\u7eed\u8fd0\u884c\u7a0b\u5e8f\uff0c\u76f4\u5230\u8fbe\u5230\u5d29\u6e83\u70b9\uff0c\u7136\u540e\u4f7f\u7528\u5176\u4ed6\u8c03\u8bd5\u5668\u547d\u4ee4\u6765\u67e5\u770b\u5bc4\u5b58\u5668\u503c\u548c\u76f8\u5173\u53d8\u91cf\u503c\u7b49\u7b49\u3002<\/section>\n<\/li>\n<\/ol>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u7a0b\u5e8f\u6302\u8d77\uff0c\u6ca1\u6709\u53cd\u5e94<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u7528 winedbg \u542f\u52a8\u7a0b\u5e8f\u800c\u4e0d\u662f Wine \u3002\u5f53\u7a0b\u5e8f\u6ca1\u6709\u53cd\u5e94\u7684\u65f6\u5019\uff0c\u5207\u6362\u5230 winedbg \u7a97\u53e3\uff0c\u5e76\u6309 Ctrl+C \u3002\u8fd9\u5c06\u505c\u6b62\u7a0b\u5e8f\uff0c\u5e76\u5141\u8bb8\u60a8\u8c03\u8bd5\u8be5\u7a0b\u5e8f\uff0c\u5c31\u50cf\u5d29\u6e83\u65f6\u5019\u4e00\u6837\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u7a0b\u5e8f\u5f39\u51fa\u9519\u8bef\u6d88\u606f\u6846<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6709\u65f6\u5019\u7a0b\u5e8f\u4f1a\u4f7f\u7528\u6216\u591a\u6216\u5c11\u7684\u975e\u63cf\u8ff0\u6027\u6d88\u606f\u6846\u62a5\u544a\u5931\u8d25\u3002\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e0e\u5d29\u6e83\u76f8\u540c\u7684\u65b9\u6cd5\u8fdb\u884c\u8c03\u8bd5\uff0c\u4f46\u6709\u4e00\u4e2a\u95ee\u9898\uff0c\u4e3a\u4e86\u8bbe\u7f6e\u6d88\u606f\u6846\uff0c\u7a0b\u5e8f\u4f1a\u591a\u51fa\u5927\u91cf\u7684\u8c03\u8bd5\u65e5\u5fd7\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u7531\u4e8e\u6545\u969c\u901a\u5e38\u53d1\u751f\u5728\u8bbe\u7f6e\u6d88\u606f\u6846\u4e4b\u524d\uff0c\u60a8\u53ef\u4ee5\u542f\u52a8 winedbg \u5e76\u5728 MessageBoxA \uff08\u7531 Win16 \u548c Win32 \u7a0b\u5e8f\u8c03\u7528\uff09\u5904\u8bbe\u7f6e\u65ad\u70b9\uff0c\u7136\u540e\u7ee7\u7eed\u8fd0\u884c\u3002\u7a0b\u5e8f\u5c06\u5728\u8bbe\u7f6e\u6d88\u606f\u6846\u4e4b\u524d\u505c\u6b62\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u60a8\u4e5f\u53ef\u4ee5\u4f7f\u7528\u8fd9\u4e2a\u547d\u4ee4\u6765\u8fd0\u884c\u7a0b\u5e8f:<code>WINEDEBUG=+relay wine program.exe 2&gt;&amp;1 | less -i<\/code>\u7136\u540e\u5728 less \u91cc\u9762\u641c\u7d22 MessageBox \u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u53cd\u6c47\u7f16\u7a0b\u5e8f<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u60a8\u4e5f\u53ef\u4ee5\u5c1d\u8bd5\u53cd\u6c47\u7f16\u6709\u95ee\u9898\u7684\u7a0b\u5e8f\uff0c\u4ee5\u68c0\u67e5\u6ca1\u6709\u516c\u5f00\u7684\u529f\u80fd\u6216\u4f7f\u7528\u5b83\u4eec\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u7406\u89e3\u6c47\u7f16\u4ee3\u7801\u4e3b\u8981\u662f\u4e00\u4e2a\u7ec3\u4e60\u95ee\u9898\u3002Win16 \u51fd\u6570\u5165\u53e3\u901a\u5e38\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">push bp<br \/>\nmov bp, sp<br \/>\n... \u51fd\u6570\u4ee3\u7801 ..<br \/>\nretf XXXX \u00a0 &lt;--------- XXXX \u662f\u51fd\u6570\u53c2\u6570\u7684\u603b\u5b57\u8282\u6570<\/p>\n<\/blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8fd9\u662f\u4e00\u4e2a\u6ca1\u6709\u5c40\u90e8\u53d8\u91cf\u7684 FAR \u51fd\u6570\u3002\u53c2\u6570\u901a\u5e38\u4ece<code>[bp+6]<\/code> \u5f00\u59cb\uff0c\u504f\u79fb\u91cf\u589e\u52a0\u3002\u8bf7\u6ce8\u610f\uff0c\u5bf9\u4e8e\u4f7f\u7528 PASCAL \u8c03\u7528\u7ea6\u5b9a\u5bfc\u51fa\u7684 Win16 \u51fd\u6570,<code>[bp+6]<\/code> \u5c5e\u4e8e\u6700\u53f3\u4fa7\u7684\u53c2\u6570\u3002\u56e0\u6b64\uff0c\u5982\u679c\u6211\u4eec\u4f7f\u7528\u5e26<code>a<\/code> \u548c<code>b<\/code> \u7684<code>strcmp(a,b)<\/code> \u6765\u8bf4\uff0c\u5219\u53c2\u6570<code>b<\/code> \u7684\u5b58\u50a8\u4f4d\u7f6e\u5728<code>[bp+6]<\/code>\uff0c\u53c2\u6570<code>a<\/code> \u7684\u5b58\u50a8\u4f4d\u7f6e\u5728<code>[bp+10]<\/code> \u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5927\u591a\u6570\u51fd\u6570\u7528\u6808\u5b58\u50a8\u5c40\u90e8\u53d8\u91cf\uff1a<\/p>\n<blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">enter 0086, 00<br \/>\n... \u51fd\u6570\u4ee3\u7801 ...<br \/>\nleave<br \/>\nretf XXXX<\/p>\n<\/blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8fd9\u4e0e\u4e0a\u8ff0\u5185\u5bb9\u57fa\u672c\u76f8\u540c\uff0c\u4f46\u8fd8\u6dfb\u52a0\u4e86 0x86 \u5b57\u8282\u7684\u6808\u5b58\u50a8\uff0c\u4f7f\u7528<code>[bp-xx]<\/code> \u8fdb\u884c\u8bbf\u95ee\u3002\u5728\u8c03\u7528\u8be5\u51fd\u6570\u4e4b\u524d\uff0c\u4f7f\u7528\u5982\u4e0b\u6240\u793a\u7684\u4ee3\u7801\u628a\u53c2\u6570\u538b\u5230\u6808\u4e0a\uff1a<\/p>\n<blockquote><p>push word ptr [bp-02] \u00a0 &lt;- \u538b\u5230 [bp+8] \u5904<br \/>\npush di \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &lt;- \u538b\u5230 [bp+6] \u5904<br \/>\ncall KERNEL.LSTRLEN<\/p><\/blockquote>\n<p>\u5728\u8fd9\u91cc\uff0c\u9996\u5148\u538b\u4eba\u9009\u62e9\u5668\u5730\u5740\uff0c\u7136\u540e\u538b\u5165\u4f20\u9012\u7684\u5b57\u7b26\u4e32\u7684\u504f\u79fb\u91cf\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u8c03\u8bd5\u793a\u4f8b<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8ba9\u6211\u4eec\u8c03\u8bd5\u81ed\u540d\u662d\u8457\u7684 WORD SHARE.EXE \u6d88\u606f\u6846\uff1a<\/p>\n<blockquote><p>|marcus@jet $ wine winword.exe<br \/>\n| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0+---------------------------------------------+<br \/>\n| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| ! \u00a0You must leave Windows and load SHARE.EXE|<br \/>\n| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| \u00a0 \u00a0before starting Word. \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|<br \/>\n| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0+---------------------------------------------+<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<blockquote><p>|marcus@jet $ WINEDEBUG=+relay,-debug wine winword.exe<br \/>\n|CallTo32(wndproc=0x40065bc0,hwnd=000001ac,msg=00000081,wp=00000000,lp=00000000)<br \/>\n|Win16 task 'winword': Breakpoint 1 at 0x01d7:0x001a<br \/>\n|CallTo16(func=0127:0070,ds=0927)<br \/>\n|Call WPROCS.24: TASK_RESCHEDULE() ret=00b7:1456 ds=0927<br \/>\n|Ret \u00a0WPROCS.24: TASK_RESCHEDULE() retval=0x8672 ret=00b7:1456 ds=0927<br \/>\n|CallTo16(func=01d7:001a,ds=0927)<br \/>\n| \u00a0 \u00a0 AX=0000 BX=3cb4 CX=1f40 DX=0000 SI=0000 DI=0927 BP=0000 ES=11f7<br \/>\n|Loading symbols: \/home\/marcus\/wine\/wine...<br \/>\n|Stopped on breakpoint 1 at 0x01d7:0x001a<br \/>\n|In 16 bit mode.<br \/>\n|Wine-dbg&amp;gt;break MessageBoxA \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0c \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0&amp;lt;---- Continue<br \/>\n|Call KERNEL.91: INITTASK() ret=0157:0022 ds=08a7<br \/>\n| \u00a0 \u00a0 AX=0000 BX=3cb4 CX=1f40 DX=0000 SI=0000 DI=08a7 ES=11d7 EFL=00000286<br \/>\n|CallTo16(func=090f:085c,ds=0dcf,0x0000,0x0000,0x0000,0x0000,0x0800,0x0000,0x0000,0x0dcf)<br \/>\n|... \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 &amp;lt;----- Much debug output<br \/>\n|Call KERNEL.136: GETDRIVETYPE(0x0000) ret=060f:097b ds=0927<br \/>\n^^^^^^ Drive 0 (A:)<br \/>\n|Ret \u00a0KERNEL.136: GETDRIVETYPE() retval=0x0002 ret=060f:097b ds=0927<br \/>\n^^^^^^ \u00a0DRIVE_REMOVEABLE<br \/>\n(It is a floppy diskdrive.)<\/p>\n<p>|Call KERNEL.136: GETDRIVETYPE(0x0001) ret=060f:097b ds=0927<br \/>\n^^^^^^ Drive 1 (B:)<br \/>\n|Ret \u00a0KERNEL.136: GETDRIVETYPE() retval=0x0000 ret=060f:097b ds=0927<br \/>\n^^^^^^ \u00a0DRIVE_CANNOTDETERMINE<br \/>\n(I don&amp;#039;t have drive B: assigned)<\/p>\n<p>|Call KERNEL.136: GETDRIVETYPE(0x0002) ret=060f:097b ds=0927<br \/>\n^^^^^^^ Drive 2 (C:)<br \/>\n|Ret \u00a0KERNEL.136: GETDRIVETYPE() retval=0x0003 ret=060f:097b ds=0927<br \/>\n^^^^^^ DRIVE_FIXED<br \/>\n(specified as a hard disk)<\/p>\n<p>|Call KERNEL.97: GETTEMPFILENAME(0x00c3,0x09278364&amp;quot;doc&amp;quot;,0x0000,0927:8248) ret=060f:09b1 ds=0927<br \/>\n^^^^^^ \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 ^^^^^ \u00a0 \u00a0 \u00a0 \u00a0^^^^^^^^^<br \/>\n| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|buffer for fname<br \/>\n| \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0|temporary name ~docXXXX.tmp<br \/>\n|Force use of Drive C:.<\/p>\n<p>|Warning: GetTempFileName returns &amp;#039;C:~doc9281.tmp&amp;#039;, which doesn&amp;#039;t seem to be writable.<br \/>\n|Please check your configuration file if this generates a failure.<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>\u54ce\u5440\uff0c\u65e5\u5fd7\u4e2d\u53d1\u73b0\u4e86\u95ee\u9898 (OPENFILE \u5931\u8d25)\uff1a<\/p>\n<blockquote><p>|Ret \u00a0KERNEL.97: GETTEMPFILENAME() retval=0x9281 ret=060f:09b1 ds=0927<br \/>\n^^^^^^ Temporary storage ID<\/p>\n<p>|Call KERNEL.74: OPENFILE(0x09278248&amp;quot;C:~doc9281.tmp&amp;quot;,0927:82da,0x1012) ret=060f:09d8 ds=0927<br \/>\n^^^^^^^^^^^^^^^^ ^^^^^^^^^ ^^^^^^^<br \/>\n|filename \u00a0 \u00a0 \u00a0 \u00a0|OFSTRUCT |open mode:<\/p>\n<p>OF_CREATE|OF_SHARE_EXCLUSIVE|OF_READWRITE<\/p><\/blockquote>\n<p>\u8fd9\u91cc\u5931\u8d25\u7684\u539f\u56e0\u662f\u6211\u7684 C \u76d8\u662f\u53ea\u8bfb\u7684\uff1a<\/p>\n<blockquote><p>|Ret \u00a0KERNEL.74: OPENFILE() retval=0xffff ret=060f:09d8 ds=0927<br \/>\n^^^^^^ HFILE_ERROR16, yes, it failed.<\/p>\n<p>|Call USER.1: MESSAGEBOX(0x0000,0x09278376&amp;quot;You must close Windows and load SHARE.EXE before you start Word.&amp;quot;,0x00000000,0x1030) ret=060f:084f ds=0927<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>\u5e76\u4e14\u5728 MessageBoxA \u7684\u5165\u53e3\u505c\u4e0b\u6765\u4e86\uff1a<\/p>\n<blockquote><p>|Stopped on breakpoint 2 at 0x40189100 (MessageBoxA [msgbox.c:190])<br \/>\n|190 \u00a0 \u00a0 {<\/p><\/blockquote>\n<p>\u4ee3\u7801\u770b\u8d77\u6765\u8981\u627e\u4e00\u4e2a\u53ef\u5199\u78c1\u76d8\uff0c\u5e76\u8bd5\u56fe\u5728\u8be5\u78c1\u76d8\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u3002\u8981\u89e3\u51b3\u6b64 Bug\uff0c\u53ef\u4ee5\u5c06 C \u76d8\u5b9a\u4e49\u4e3a\u7f51\u7edc\u9a71\u52a8\u5668\uff0c\u4e0a\u8ff0\u4ee3\u7801\u5c06\u5ffd\u7565\u8be5\u9a71\u52a8\u5668\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u8c03\u8bd5\u6280\u5de7<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4ee5\u4e0b\u662f\u4e00\u4e9b\u5176\u4ed6\u8c03\u8bd5\u6280\u5de7\uff1a<\/p>\n<section>1. \u5982\u679c\u60a8\u6709\u4e00\u4e2a\u7a0b\u5e8f\u5728\u52a0\u8f7d\u524d\u671f\u5d29\u6e83\uff0c\u4ee5\u81f3\u4e8e\u60a8\u65e0\u6cd5\u6b63\u5e38\u4f7f\u7528 Wine \u8c03\u8bd5\u5668\u6765\u8c03\u8bd5\uff0c\u4f46 Wine \u5df2\u6267\u884c\u8be5\u7a0b\u5e8f\u7684\u542f\u52a8\u4ee3\u7801\uff0c\u5219\u53ef\u4ee5\u4f7f\u7528\u7279\u6b8a\u7684\u6280\u5de7\u3002\u60a8\u5e94\u8be5\u6267\u884c<code>WINEDEBUG=+relay wine program<\/code>\u83b7\u53d6\u7a0b\u5e8f\u5728\u542f\u52a8\u51fd\u6570\u4e2d\u8c03\u7528\u7684\u6240\u6709\u51fd\u6570\u6e05\u5355\u3002\u7136\u540e\u6267\u884c\uff1a<code>winedbg win<\/code><code>file.exe<\/code>\u8fd9\u6837\uff0c\u60a8\u5c31\u8fdb\u5165 winedbg\u3002\u73b0\u5728\uff0c\u60a8\u53ef\u4ee5\u5728 start \u51fd\u6570\u4e2d\u8c03\u7528\u7684\u4efb\u4f55\u51fd\u6570\u4e0a\u8bbe\u7f6e\u65ad\u70b9\uff0c\u7136\u540e\u4e0d\u65ad\u6309 c \u4ee5\u8df3\u8fc7 Winfile \u5bf9\u6b64\u51fd\u6570\u7684\u6b63\u5e38\u8c03\u7528\uff0c\u76f4\u5230\u60a8\u6700\u7ec8\u5230\u8fbe\u6b64\u51fd\u6570\u8c03\u7528\u5d29\u6e83\u7684\u4f4d\u7f6e\u3002\u60a8\u5c31\u53ef\u4ee5\u50cf\u5e73\u5e38\u4e00\u6837\u7ee7\u7eed\u8c03\u8bd5\u8be5\u7a0b\u5e8f\u3002<\/section>\n<p>2. \u5982\u679c\u5c1d\u8bd5\u8fd0\u884c\u7a0b\u5e8f\uff0c\u7a0b\u5e8f\u5728\u5f39\u51fa\u9519\u8bef\u6d88\u606f\u6846\u540e\u5c31\u9000\u51fa\uff0c\u5219\u95ee\u9898\u7684\u539f\u56e0\u901a\u5e38\u53ef\u4ee5\u68c0\u67e5\u5728 MessageBox \u4e4b\u524d\u8c03\u7528\u7684\u4e00\u4e9b\u51fd\u6570\u7684\u8fd4\u56de\u503c\u53d1\u73b0\u3002\u60a8\u5e94\u8be5\u7528\u4e0b\u9762\u7684\u65b9\u5f0f\u91cd\u65b0\u8fd0\u884c\u7a0b\u5e8f:<code>WINEDEBUG=+relay wine program_name &amp;&gt;relmsg<\/code>\u63a5\u7740\u6267\u884c<code>more relmsg<\/code> \u7136\u540e\u641c\u7d22\u6700\u540e\u4e00\u4e2a\u51fa\u73b0\u7684<code>MESSAGEBOX<\/code>\uff0c\u7c7b\u4f3c\u8fd9\u6837\u7684\uff1a<code>Call USER.1: MESSAGEBOX(0x0000,0x01ff1246 \"Runtime error 219 at 0004:1056.\",0x00000000,0x1010) ret=01f7:2160 ds=01ff<\/code>\u5728\u6211\u7684\u4f8b\u5b50\u91cc\u9762\uff0c\u5728\u8c03\u7528<code>MessageBox<\/code> \u51fd\u6570\u4e4b\u524d\u7684\u4ee3\u7801\u7c7b\u4f3c\u8fd9\u6837\uff1a<\/p>\n<blockquote>\n<section>Call KERNEL.96: FREELIBRARY(0x0347) ret=01cf:1033 ds=01ff<br \/>\nCallTo16(func=033f:0072,ds=01ff,0x0000)<br \/>\nRet \u00a0KERNEL.96: FREELIBRARY() retval=0x0001 ret=01cf:1033 ds=01ff<br \/>\nCall KERNEL.96: FREELIBRARY(0x036f) ret=01cf:1043 ds=01ff<br \/>\nCallTo16(func=0367:0072,ds=01ff,0x0000)<br \/>\nRet \u00a0KERNEL.96: FREELIBRARY() retval=0x0001 ret=01cf:1043 ds=01ff<br \/>\nCall KERNEL.96: FREELIBRARY(0x031f) ret=01cf:105c ds=01ff<br \/>\nCallTo16(func=0317:0072,ds=01ff,0x0000)<br \/>\nRet \u00a0KERNEL.96: FREELIBRARY() retval=0x0001 ret=01cf:105c ds=01ff<br \/>\nCall USER.171: WINHELP(0x02ac,0x01ff05b4 \"COMET.HLP\",0x0002,0x00000000) ret=01cf:1070 ds=01ff<br \/>\nCallTo16(func=0117:0080,ds=01ff)<br \/>\nCall WPROCS.24: TASK_RESCHEDULE() ret=00a7:0a2d ds=002b<br \/>\nRet \u00a0WPROCS.24: TASK_RESCHEDULE() retval=0x0000 ret=00a7:0a2d ds=002b<br \/>\nRet \u00a0USER.171: WINHELP() retval=0x0001 ret=01cf:1070 ds=01ff<br \/>\nCall KERNEL.96: FREELIBRARY(0x01be) ret=01df:3e29 ds=01ff<br \/>\nRet \u00a0KERNEL.96: FREELIBRARY() retval=0x0000 ret=01df:3e29 ds=01ff<br \/>\nCall KERNEL.52: FREEPROCINSTANCE(0x02cf00ba) ret=01f7:1460 ds=01ff<br \/>\nRet \u00a0KERNEL.52: FREEPROCINSTANCE() retval=0x0001 ret=01f7:1460 ds=01ff<br \/>\nCall USER.1: MESSAGEBOX(0x0000,0x01ff1246 \"Runtime error 219 at 0004:1056.\",0x00000000,0x1010) ret=01f7:2160 ds=01ff<\/section>\n<\/blockquote>\n<p>\u6211\u8ba4\u4e3a\u672c\u793a\u4f8b\u4e2d\u5bf9 MessageBox \u7684\u8c03\u7528\u4e0d\u662f\u7531\u4ee5\u524d\u8c03\u7528\u7684\u51fd\u6570\u8fd4\u56de\u9519\u8bef\u503c\u5f15\u8d77\u7684\uff08\u7ecf\u5e38\u53d1\u751f\u8fd9\u6837\u7684\u60c5\u51b5\uff09\uff0c\u800c\u662f\u6d88\u606f\u6846\u91cc\u9762\u63d0\u5230\u7684\uff1a<code>0x0004:0x1056<\/code> \u5904\u51fa\u73b0\u8fd0\u884c\u65f6\u9519\u8bef\u3002\u7531\u4e8e\u5730\u5740\u7684\u6bb5\u503c\u4ec5\u4e3a 4\uff0c\u56e0\u6b64\u6211\u8ba4\u4e3a\u8fd9\u53ea\u662f\u4e00\u4e2a\u5185\u90e8\u503c\u3002\u4f46\u504f\u79fb\u5730\u5740\u63ed\u793a\u4e86\u4e00\u4e9b\u975e\u5e38\u6709\u8da3\u7684\u5185\u5bb9\uff0c\u504f\u79fb 0x1056 \u975e\u5e38\u63a5\u8fd1 FREELIBRARY \u7684\u8fd4\u56de\u5730\u5740\uff1a<\/p>\n<blockquote><p>Call KERNEL.96: FREELIBRARY(0x031f) ret=01cf:105c ds=01ff<br \/>\n^^^^<\/p><\/blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5982\u679c\u6bb5 0x0004 \u786e\u5b9e\u662f\u6bb5 0x1cf\uff0c\u6211\u4eec\u53ef\u4ee5\u53cd\u6c47\u7f16\u8c03\u7528 FreeLibrary \u7684\u5730\u5740\uff0c\u5206\u6790\u53d1\u751f\u8fd0\u884c\u65f6\u9519\u8bef\u4e4b\u524d\u7684\u67d0\u4e9b\u884c\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">3. \u5982\u679c\u5e0c\u671b\u8bbe\u7f6e\u67d0\u4e2a\u4f4d\u7f6e\u7684\u65ad\u70b9\uff0c\u4f46\u8be5\u65ad\u70b9\u6240\u5728\u7684\u6a21\u5757\u8fd8\u6ca1\u6709\u6620\u5c04\u5230\u5185\u5b58\u91cc\u9762\uff0c\u5219\u53ef\u4ee5\u5c06\u65ad\u70b9\u8bbe\u7f6e\u4e3a GetVersion16\/32 \u51fd\u6570\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u51fd\u6570\u88ab\u8c03\u7528\u5f88\u9891\u7e41\uff0c\u65ad\u70b9\u505c\u4e0b\u6765\u7684\u65f6\u5019\u6267\u884c<code>continue<\/code> \u547d\u4ee4\u76f4\u5230\u60a8\u80fd\u591f\u8bbe\u7f6e\u6b64\u65ad\u70b9\u800c\u4e0d\u518d\u663e\u793a\u9519\u8bef\u6d88\u606f\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8c03\u8bd5\u5668\u7684\u57fa\u672c\u7528\u6cd5<\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4f7f\u7528<code>winebg myprog.exe<\/code> \u542f\u52a8\u7a0b\u5e8f\u540e\uff0c\u7a0b\u5e8f\u52a0\u8f7d\u5e76\u5728\u8d77\u70b9\u5904\u505c\u6b62\uff0c\u7ec8\u7aef\u663e\u793a winedbg \u547d\u4ee4\u884c\u63d0\u793a\u7b26\u3002\u7136\u540e\uff0c\u60a8\u53ef\u4ee5\u8fd9\u6837\u8bbe\u7f6e\u65ad\u70b9\uff1a<\/p>\n<blockquote><p>b RoutineName (\u6309\u51fd\u6570\u540d\u79f0\u52a0\u65ad\u70b9)\u6216<br \/>\nb *0x812575 \u00a0 (\u6309\u5730\u5740\u52a0\u65ad\u70b9)<\/p><\/blockquote>\n<p>\u7136\u540e\uff0c\u60a8\u8f93\u5165 c\uff08continue\u547d\u4ee4\u7b80\u5199\uff09\u6765\u8fd0\u884c\u7a0b\u5e8f\u3002\u5f53\u5b83\u505c\u5728\u65ad\u70b9\u5904\u540e\uff0c\u60a8\u53ef\u4ee5\u952e\u5165\uff1a<\/p>\n<blockquote><p>step \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0(\u4e00\u6b21\u6b65\u8fdb\u4e00\u884c)\u6216<br \/>\nstepi \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 (\u4e00\u6b21\u6b65\u8fdb\u4e00\u4e2a\u673a\u5668\u6307\u4ee4;\u5b83\u6709\u52a9\u4e8e\u4e86\u89e3386\u57fa\u672c\u6307\u4ee4\u96c6)<br \/>\ninfo reg \u00a0 \u00a0 \u00a0 \u00a0(\u67e5\u770b\u5bc4\u5b58\u5668)<br \/>\ninfo stack \u00a0 \u00a0 \u00a0(\u67e5\u770b\u5806\u6808\u4e2d\u7684\u5341\u516d\u8fdb\u5236\u503c)<br \/>\ninfo local \u00a0 \u00a0 \u00a0(\u67e5\u770b\u5c40\u90e8\u53d8\u91cf)<br \/>\nlist \u884c\u53f7 \u00a0 \u00a0 \u00a0 (\u5217\u51fa\u6e90\u4ee3\u7801)<br \/>\nx \u53d8\u91cf\u540d\u79f0 \u00a0 \u00a0 \u00a0(\u68c0\u67e5\u53d8\u91cf;\u4ec5\u5f53\u4ee3\u7801\u5173\u95ed\u4f18\u5316\u7f16\u8bd1\u65f6\u5019\u6709\u6548)<br \/>\nx 0x4269978 \u00a0 \u00a0 (\u68c0\u67e5\u5185\u5b58\u4f4d\u7f6e\u7684\u5185\u5bb9)<br \/>\n? \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 (\u5e2e\u52a9)<br \/>\nq \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 (\u9000\u51fa)<\/p><\/blockquote>\n<p>\u76f4\u63a5\u6309 Enter\uff0c\u60a8\u53ef\u4ee5\u91cd\u590d\u6700\u540e\u4e00\u4e2a\u547d\u4ee4\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u6709\u7528\u7684\u7a0b\u5e8f<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4e00\u4e9b\u6709\u7528\u7684\u7a0b\u5e8f\uff1a<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section>IDA\uff1aIDA Pro \u662f\u5f3a\u70c8\u63a8\u8350\u7684\uff0c\u4f46\u4e0d\u662f\u514d\u8d39\u7684\u3002<\/section>\n<\/li>\n<li>\n<section>pedump\uff1ahttp:\/\/pedump.me\/\uff0c\u8f6c\u50a8 PE \u683c\u5f0f\u7684 DLL \u7684\u5bfc\u5165\u548c\u5bfc\u51fa\u3002<\/section>\n<\/li>\n<li>\n<section>winedump\uff1a\uff08\u5305\u62ec\u5728 Wine \u4e2d\uff09\uff0c\u8f6c\u50a8 PE \u683c\u5f0f\u7684 DLL \u7684\u5bfc\u5165\u548c\u5bfc\u51fa\u3002\u00a0<\/section>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h1 style=\"text-align: center;\"><strong>\u914d\u7f6e<\/strong><\/h1>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>Windows \u8c03\u8bd5\u914d\u7f6e<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">Windows \u8c03\u8bd5 API \u4f7f\u7528\u8fd9\u4e2a\u6ce8\u518c\u8868\u9879\u6765\u6307\u660e\u53d1\u751f\u672a\u5904\u7406\u5f02\u5e38\u65f6\u8981\u8c03\u7528\u54ea\u4e2a\u8c03\u8bd5\u5668\u3002<\/p>\n<blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">[MACHINE\\\\Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\AeDebug]\n<\/blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6709\u4e24\u4e2a\u503c\u6765\u51b3\u5b9a\u884c\u4e3a\uff1a<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section>Debugger \u6307\u5b9a\u7528\u4e8e\u542f\u52a8\u8c03\u8bd5\u5668\u7684\u547d\u4ee4\u884c\uff08\u5b83\u4f7f\u7528\u4e24\u4e2a printf \u683c\u5f0f\u5360\u4f4d\u7b26 %ld\u00a0\u5c06\u4e0a\u4e0b\u6587\u76f8\u5173\u4fe1\u606f\u4f20\u9012\u7ed9\u8c03\u8bd5\u5668\uff09\u3002\u60a8\u5e94\u8be5\u5728\u8fd9\u91cc\u653e\u7f6e\u4e00\u4e2a\u60a8\u7684\u8c03\u8bd5\u5668\u7684\u5b8c\u6574\u8def\u5f84 ( winedbg \u5f53\u7136\u53ef\u4ee5\u4f7f\u7528\uff0c\u4f46\u4efb\u4f55\u5176\u4ed6\u4f7f\u7528 Windows \u8c03\u8bd5 API \u7684\u8c03\u8bd5\u5668\u4e5f\u53ef\u4ee5 )\u3002\u60a8\u9009\u62e9\u4f7f\u7528\u7684\u8c03\u8bd5\u5668\u7684\u8def\u5f84\u5fc5\u987b\u901a\u8fc7 Wine \u5bb9\u5668\u6839\u76ee\u5f55\u7684 dosdevices \u5b50\u76ee\u5f55\u91cc\u9762\u914d\u7f6e\u7684 DOS \u9a71\u52a8\u5668\u4e4b\u4e00\u8fdb\u884c\u8bbf\u95ee\u3002<\/section>\n<\/li>\n<li>\n<section>Auto \u5982\u679c\u6b64\u503c\u4e3a\u96f6\uff0c\u5728\u53d1\u751f\u672a\u5904\u7406\u5f02\u5e38\u65f6\u5c06\u5f39\u51fa\u5bf9\u8bdd\u6846\u8be2\u95ee\u7528\u6237\u662f\u5426\u5e0c\u671b\u542f\u52a8\u8c03\u8bd5\u5668\u3002\u5426\u5219\uff0c\u8c03\u8bd5\u5668\u5c06\u81ea\u52a8\u542f\u52a8\u3002<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u9ed8\u8ba4\u7684 Wine \u6ce8\u518c\u8868\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">[MACHINE\\\\Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\AeDebug] 957636538<br \/>\n\"Auto\"=dword:00000001<br \/>\n\"Debugger\"=\"winedbg %ld %ld\"<\/p>\n<\/blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u6ce8\u610f 1:<\/strong> \u521b\u5efa\u8fd9\u4e2a\u6ce8\u518c\u8868\u9879\u662f\u5fc5\u9700\u7684\u3002\u5982\u679c\u4e0d\u8fd9\u6837\u505a\uff0c\u5728\u53d1\u751f\u5f02\u5e38\u65f6\u4e0d\u4f1a\u89e6\u53d1\u8c03\u8bd5\u5668\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u6ce8\u610f 2:<\/strong> wineinstall\uff08Wine \u9644\u5e26\u7684\uff09 \u521b\u5efa\u8fd9\u4e2a\u6ce8\u518c\u8868\u9879\u3002\u4f46\u662f\u7531\u4e8e\u5b89\u88c5\u7684\u6ce8\u518c\u8868\u5b58\u5728\u4e00\u4e9b\u9650\u5236\uff0c\u5982\u679c\u5b58\u5728\u4ee5\u524d\u7684 Wine \u5b89\u88c5\uff0c\u5219\u5148\u5220\u9664\u6574\u4e2a<code>[MACHINE\\\\Software\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\AeDebug]<\/code> \uff0c\u518d\u8fd0\u884c wineinstall \u4ee5\u91cd\u65b0\u521b\u5efa\u624d\u662f\u5b89\u5168\u7684\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>Winedbg \u914d\u7f6e<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">Winedbg \u53ef\u901a\u8fc7\u591a\u79cd\u9009\u9879\u8fdb\u884c\u914d\u7f6e\u3002\u8fd9\u4e9b\u9009\u9879\u6309\u7528\u6237\u5b58\u50a8\u5728\u6ce8\u518c\u8868\u4e2d\uff1a<code>[HKCU\\\\Software\\\\Wine\\\\WineDbg]<\/code><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u8fd9\u4e9b\u9009\u9879\u53ef\u4ee5\u5728 winedbg \u91cc\u9762\u8bfb\u53d6\/\u5199\u5165\uff0c\u4f5c\u4e3a\u8c03\u8bd5\u5668\u8868\u8fbe\u5f0f\u7684\u4e00\u90e8\u5206\u3002\u8981\u5f15\u7528\u8fd9\u4e9b\u9009\u9879\u4e4b\u4e00\uff0c\u5176\u540d\u79f0\u5fc5\u987b\u4ee5<code>$<\/code> \u7b26\u53f7\u4e3a\u524d\u7f00\u3002\u4f8b\u5982\uff1a<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><code>set $BreakAllThreadsStartup = 1<\/code><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5c06<code>BreakAllThreadsStartup<\/code> \u9009\u9879\u8bbe\u7f6e\u4e3a TRUE\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u6240\u6709\u9009\u9879\u5728 winedbg \u542f\u52a8\u65f6\u4ece\u6ce8\u518c\u8868\u4e2d\u8bfb\u53d6\uff08\u5982\u679c\u672a\u627e\u5230\u76f8\u5e94\u7684\u503c\uff0c\u5219\u4f7f\u7528\u9ed8\u8ba4\u503c\uff09\uff0c\u5e76\u5728 winedbg \u9000\u51fa\u65f6\u5199\u56de\u6ce8\u518c\u8868\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4e0b\u9762\u662f\u6240\u6709\u9009\u9879\u7684\u5217\u8868\uff1a<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section>BreakAllThreadsStartup \u5982\u679c\u4e3a TRUE \u5219\u5728\u6240\u6709\u7ebf\u7a0b\u542f\u52a8\u65f6\u8c03\u8bd5\u5668\u505c\u6b62\uff1b\u5982\u679c\u4e3a FALSE \u4ec5\u5728\u7ed9\u5b9a\u8fdb\u7a0b\u7684\u7b2c\u4e00\u4e2a\u7ebf\u7a0b\u542f\u52a8\u65f6\u8c03\u8bd5\u5668\u505c\u6b62\u3002\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4e3a FALSE\u3002<\/section>\n<\/li>\n<li>\n<section>BreakOnCritSectTimeOut \u5982\u679c\u4e3a TRUE \u5219\u5f53\u4e34\u754c\u533a\u8d85\u65f6\uff085 \u5206\u949f\uff09\u65f6\u8c03\u8bd5\u5668\u505c\u6b62\uff1b\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4e3a TRUE\u3002<\/section>\n<\/li>\n<li>\n<section>BreakOnAttach \u5982\u679c\u4e3a TRUE \u5219\u5728\u672a\u5904\u7406\u5f02\u5e38\u53d1\u751f\u540e winedbg \u9644\u52a0\u5230\u8fdb\u7a0b\u65f6\uff0c\u5728\u7b2c\u4e00\u4e2a\u9644\u52a0\u4e8b\u4ef6\u4e2d\u505c\u4e0b\u6765\u3002\u7531\u4e8e\u9644\u52a0\u4e8b\u4ef6\u5728\u5f02\u5e38\u4e8b\u4ef6\u7684\u4e0a\u4e0b\u6587\u4e2d\u6ca1\u6709\u610f\u4e49\uff0c\u56e0\u6b64\u8be5\u9009\u9879\u6700\u597d\u662f FALSE\u3002<\/section>\n<\/li>\n<li>\n<section>BreakOnFirstChance \u5f02\u5e38\u751f\u6210\u4e24\u4e2a\u8c03\u8bd5\u4e8b\u4ef6\u3002\u7b2c\u4e00\u4e2a\u662f\u5728\u5f02\u5e38\u53d1\u751f\u4e4b\u540e\u4f20\u9012\u5230\u8c03\u8bd5\u5668\uff08\u79f0\u4e3a\u7b2c\u4e00\u6b21\u673a\u4f1a\uff09\u3002\u8c03\u8bd5\u5668\u53ef\u4ee5\u51b3\u5b9a\u6062\u590d\u6267\u884c\uff08\u901a\u8fc7 winedbg cont \u547d\u4ee4\uff09\u6216\u5c06\u5f02\u5e38\u4f20\u9012\u7ed9\u7a0b\u5e8f\u4e2d\u7684\u5f02\u5e38\u5904\u7406\u7a0b\u5e8f\u94fe\uff08\u5982\u679c\u5b58\u5728\uff09\uff08winedbg \u901a\u8fc7 pass \u547d\u4ee4\uff09\u3002\u5982\u679c\u5f02\u5e38\u5904\u7406\u7a0b\u5e8f\u6ca1\u6709\u5904\u7406\u5f02\u5e38\uff0c\u5219\u5f02\u5e38\u4e8b\u4ef6\u5c06\u518d\u6b21\u53d1\u9001\u5230\u8c03\u8bd5\u5668(\u79f0\u4e3a\u6700\u540e\u4e00\u6b21\u673a\u4f1a)\u3002\u8c03\u8bd5\u5668\u4e0d\u80fd\u4f20\u9012\u6700\u540e\u4e00\u6b21\u673a\u4f1a\u7684\u5f02\u5e38\u3002\u5982\u679c BreakOnFirstChance \u4e3a TRUE \uff0c\u5219\u7b2c\u4e00\u6b21\u673a\u4f1a\u5f02\u5e38\u548c\u6700\u540e\u4e00\u6b21\u673a\u4f1a\u5f02\u5e38\u53d1\u751f\u65f6 winedbg \u90fd\u505c\u6b62\uff1b\u5982\u679c\u4e3a FALSE\uff0c\u4ec5\u5728\u6700\u540e\u4e00\u6b21\u673a\u4f1a\u5f02\u5e38\u662f\u505c\u6b62\u3002<\/section>\n<\/li>\n<\/ul>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u914d\u7f6e +relay \u884c\u4e3a<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5c06<code>WINEDEBUG<\/code> \u8bbe\u7f6e\u4e3a<code>+relay<\/code> \u8c03\u8bd5\u65f6\uff0c\u53ef\u80fd\u4f1a\u5f97\u5230\u5927\u91cf\u8f93\u51fa\u65e5\u5fd7\u3002\u60a8\u53ef\u4ee5\u901a\u8fc7\u628a\u6ce8\u518c\u8868\u4e2d<code>[HKCU\\\\Software\\\\Wine\\\\Debug]<\/code> \u4e0b\u7684 \u00a0<code>RelayExclude<\/code> \u952e\u503c\u8bbe\u7f6e\u4e3a\u7528\u5206\u53f7\u5206\u9694\u7684\u8981\u6392\u9664\u7684\u51fd\u6570\u5217\u8868\uff0c\u4f8b\u5982\uff1a<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><code>\"RtlEnterCriticalSection;RtlLeaveCriticalSection;kernel32.97;kernel32.98\"<\/code><\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><code>RelayInclude<\/code> \u548c<code>RelayExclude<\/code> \u7c7b\u4f3c\uff0c\u53ea\u4e0d\u8fc7\u5217\u51fa\u7684\u51fd\u6570\u5c06\u662f\u8f93\u51fa\u4e2d\u4ec5\u5305\u542b\u7684\u51fd\u6570\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5982\u679c\u5e94\u7528\u7a0b\u5e8f\u4f7f\u7528<code>+relay<\/code> \u8fd0\u884c\u901f\u5ea6\u592a\u6162\u65e0\u6cd5\u83b7\u5f97\u6709\u610f\u4e49\u7684\u8f93\u51fa\uff0c\u5e76\u4e14\u5bf9\u751f\u6210\u7684\u51e0 GB \u7684\u65e5\u5fd7\u6587\u4ef6\u675f\u624b\u65e0\u7b56\uff0c\u4e0d\u786e\u5b9a\u8981\u6392\u9664\u54ea\u4e9b\u51fd\u6570\uff0c\u4e0b\u9762\u662f\u4e00\u4e2a\u6280\u5de7\u3002\u9996\u5148\uff0c\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u4e00\u5206\u949f\u5de6\u53f3\uff0c\u5c06\u5176\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u78c1\u76d8\u4e0a\u7684\u6587\u4ef6\uff1a<\/p>\n<blockquote><p>WINEDEBUG=+relay wine appname.exe &amp;&gt;relay.log<\/p><\/blockquote>\n<p>\u7136\u540e\u8fd0\u884c\u6b64\u547d\u4ee4\u4ee5\u67e5\u770b\u8c03\u7528\u6700\u591a\u7684\u51fd\u6570\uff1a<\/p>\n<blockquote><p>awk -F'(' '{print $1}' &lt; relay.log | awk '{print $2}' | sort | uniq -c | sort<\/p><\/blockquote>\n<p>\u5728\u786e\u4fdd\u8fd9\u4e9b\u51fd\u6570\u4e0d\u76f8\u5173\u540e\u4f7f\u7528<code>RelayExclude<\/code> \u6392\u9664\u8c03\u7528\u6700\u591a\u7684\u51fd\u6570\uff0c\u7136\u540e\u518d\u6b21\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n<p>&nbsp;<\/p>\n<h1 style=\"text-align: center;\"><strong>Winedbg \u8868\u8fbe\u5f0f\u548c\u53d8\u91cf<\/strong><\/h1>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u8868\u8fbe\u5f0f<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">Winedbg \u4e2d\u7684\u8868\u8fbe\u5f0f\u5927\u591a\u4ee5 C \u5f62\u5f0f\u7f16\u5199\u3002\u4f46\u662f\u6709\u4e00\u4e9b\u5dee\u5f02\uff1a<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section>\u6807\u8bc6\u7b26\u7684\u540d\u79f0\u4e2d\u53ef\u4ee5\u52a0\u4e00\u4e2a<code>!<\/code>\uff0c\u8fd9\u4e3b\u8981\u533a\u5206\u4e0d\u540c DLL \u7684\u7b26\u53f7\uff0c\u5982<code>USER32!CreateWindowExA<\/code> \u8868\u793a USER32.DLL \u91cc\u9762\u7684 CreateWindowExA \u51fd\u6570\u3002<\/section>\n<\/li>\n<li>\n<section>\u5728\u5f3a\u5236\u8f6c\u6362\u64cd\u4f5c\u4e2d\uff0c\u5728\u6307\u5b9a\u7ed3\u6784\u6216\u8054\u5408\u65f6\uff0c\u5fc5\u987b\u4f7f\u7528<code>struct<\/code> \u6216<code>union<\/code> \u5173\u952e\u5b57\uff08\u5373\u4f7f\u7a0b\u5e8f\u4f7f\u7528<code>typedef<\/code>\uff09\u3002<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5f53\u6309\u540d\u79f0\u6307\u5b9a\u6807\u8bc6\u7b26\u65f6\uff0c\u5982\u679c\u5b58\u5728\u591a\u4e2a\u76f8\u540c\u540d\u79f0\u7684\u7b26\u53f7\uff0c\u8c03\u8bd5\u5668\u5c06\u63d0\u793a\u7528\u6237\u8981\u9009\u62e9\u54ea\u4e2a\u7b26\u53f7\uff0c\u8f93\u5165\u4f60\u60f3\u8981\u7684\u90a3\u4e2a\u7b26\u53f7\u524d\u9762\u7684\u6570\u5b57\u5e8f\u53f7\u5373\u53ef\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u53d8\u91cf<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">Winedbg \u5b9a\u4e49\u81ea\u5df1\u7684\u53d8\u91cf\u96c6\u3002\u4e0a\u9762\u7684\u914d\u7f6e\u53d8\u91cf\u662f\u5176\u4e2d\u7684\u4e00\u90e8\u5206\u3002\u5176\u4ed6\u5305\u62ec\uff1a<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section><code>$ThreadId<\/code> \u00a0 \u00a0 \u5f53\u524d\u8c03\u8bd5\u7684<code>W-thread<\/code> \u7684 ID<\/section>\n<\/li>\n<li>\n<section><code>$ProcessId<\/code> \u00a0 \u5f53\u524d\u8c03\u8bd5\u7684<code>W-process<\/code> \u7684 ID<\/section>\n<\/li>\n<li>\n<section><code>\u5bc4\u5b58\u5668\u53d8\u91cf<\/code> \u00a0 \u6240\u6709 CPU \u5bc4\u5b58\u5668\u7528\"$\"\u524d\u7f00\u52a0\u5bc4\u5b58\u5668\u540d\u6765\u8bbf\u95ee\u3002\u60a8\u53ef\u4ee5\u4f7f\u7528<code>info regs<\/code> \u6765\u83b7\u53d6 CPU \u5bc4\u5b58\u5668\u7684\u540d\u79f0\u5217\u8868\u3002<\/section>\n<\/li>\n<li>\n<section><code>$ThreadId<\/code> \u548c<code>$ProcessId<\/code>\u53d8\u91cf\u53ef\u4ee5\u5f88\u65b9\u4fbf\u5730\u5728\u6307\u5b9a\u7684\u7ebf\u7a0b\u6216\u8fdb\u7a0b\u4e0a\u8bbe\u7f6e\u6761\u4ef6\u65ad\u70b9\u3002<\/section>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h1 style=\"text-align: center;\"><strong>Winedbg \u547d\u4ee4\u53c2\u8003<\/strong><\/h1>\n<h2><strong>\u6742\u9879<\/strong><\/h2>\n<blockquote><p>abort \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u4e2d\u6b62\u8c03\u8bd5\u5668<br \/>\nquit \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u9000\u51fa\u8c03\u8bd5\u5668<br \/>\nattach N \u00a0 \u00a0 \u00a0 \u00a0\u9644\u52a0\u5230 `W-process` \u8fdb\u7a0b(N \u662f\u5176 ID\uff0c10\u8fdb\u5236\u6570\u5b57\u6216\u5341\u516d\u8fdb\u5236 (0xN))\u3002<br \/>\nID \u53ef\u4ee5\u4f7f\u7528 `info process` \u547d\u4ee4\u83b7\u53d6\u3002\u8bf7\u6ce8\u610f\uff0c`info process` \u547d\u4ee4\u8fd4\u56de\u7684\u662f\u5341\u516d\u8fdb\u5236\u503c\u3002<br \/>\ndetach \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u4ece `W-process` \u8fdb\u7a0b\u5206\u79bb\u3002<br \/>\nhelp \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u6253\u5370\u4e00\u4e9b\u5e2e\u52a9<br \/>\nhelp info \u00a0 \u00a0 \u00a0 \u6253\u5370\u4e00\u4e9b info \u547d\u4ee4\u7684\u5e2e\u52a9<\/p><\/blockquote>\n<h2><strong>\u6d41\u7a0b\u63a7\u5236<\/strong><\/h2>\n<blockquote><p>cont,c \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u7ee7\u7eed\u8fd0\u884c\u76f4\u5230\u4e0b\u4e00\u4e2a\u65ad\u70b9\u6216\u5f02\u5e38\u3002<br \/>\npass \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5c06\u5f02\u5e38\u4e8b\u4ef6\u4f20\u9012\u7ed9\u5f02\u5e38\u5904\u7406\u94fe\u3002<br \/>\nstep,s \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u7ee7\u7eed\u6267\u884c\uff0c\u76f4\u5230\u4e0b\u4e00\u884c&amp;quot;C&amp;quot;\u4ee3\u7801(\u8fdb\u5165\u51fd\u6570\u5185\u90e8)<br \/>\nnext,n \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u7ee7\u7eed\u6267\u884c\uff0c\u76f4\u5230\u4e0b\u4e00\u884c&amp;quot;C&amp;quot;\u4ee3\u7801(\u4e0d\u8fdb\u5165\u51fd\u6570\u5185\u90e8)<br \/>\nstepi,si \u00a0 \u00a0 \u00a0 \u00a0\u6267\u884c\u4e0b\u4e00\u4e2a\u6307\u4ee4(\u8fdb\u5165\u51fd\u6570\u5185\u90e8)<br \/>\nnexti,ni \u00a0 \u00a0 \u00a0 \u00a0\u6267\u884c\u4e0b\u4e00\u4e2a\u6307\u4ee4(\u4e0d\u8fdb\u5165\u51fd\u6570\u5185\u90e8)<br \/>\nfinish,f \u00a0 \u00a0 \u00a0 \u00a0\u6267\u884c\uff0c\u76f4\u5230\u5f53\u524d\u51fd\u6570\u8fd4\u56de<\/p><\/blockquote>\n<p>cont\u3001step\u3001next\u3001stepi\u3001nexti \u547d\u4ee4\u540e\u9762\u53ef\u4ee5\u52a0\u4e00\u4e2a\u6570\u5b57 (N) \u53c2\u6570\uff0c\u8868\u793a\u547d\u4ee4\u6267\u884c N \u6b21\u3002<\/p>\n<h2><strong>\u65ad\u70b9\u3001\u76d1\u89c6\u70b9<\/strong><\/h2>\n<blockquote><p>enable N \u00a0 \u00a0 \u00a0 \u00a0\u542f\u7528\u7f16\u53f7\u4e3a N \u7684\u65ad\u70b9\u6216\u76d1\u89c6\u70b9<br \/>\ndisable N \u00a0 \u00a0 \u00a0 \u7981\u7528\u7f16\u53f7\u4e3a N \u7684\u65ad\u70b9\u6216\u76d1\u89c6\u70b9<br \/>\ndelete N \u00a0 \u00a0 \u00a0 \u00a0\u5220\u9664\u7f16\u53f7\u4e3a N \u7684\u65ad\u70b9\u6216\u76d1\u89c6\u70b9<br \/>\ncond N \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5220\u9664\u7f16\u53f7\u4e3a N \u7684\u65ad\u70b9\u6216\u76d1\u89c6\u70b9\u7684\u6761\u4ef6<br \/>\ncond N expr \u00a0 \u00a0 \u8bbe\u7f6e\u7f16\u53f7\u4e3a N \u7684\u65ad\u70b9\u6216\u76d1\u89c6\u70b9\u7684\u6761\u4ef6\uff1b\u6bcf\u6b21\u65ad\u70b9\u547d\u4e2d\u65f6\uff0c\u90fd\u4f1a\u8ba1\u7b97\u8868\u8fbe\u5f0f expr \uff0c\u5982\u679c\u7ed3\u679c\u4e3a\u96f6\u503c\uff0c\u5219\u4e0d\u89e6\u53d1\u65ad\u70b9\u3002<br \/>\nbreak *N \u00a0 \u00a0 \u00a0 \u00a0\u5728\u5730\u5740 N \u5904\u6dfb\u52a0\u65ad\u70b9<br \/>\nbreak ID \u00a0 \u00a0 \u00a0 \u00a0\u5728\u7b26\u53f7 ID \u7684\u5730\u5740\u6dfb\u52a0\u65ad\u70b9<br \/>\nbreak N \u00a0 \u00a0 \u00a0 \u00a0 \u5728\u5f53\u524d\u6e90\u6587\u4ef6\u7684\u7b2c N \u884c\u6dfb\u52a0\u65ad\u70b9<br \/>\nwatch *N \u00a0 \u00a0 \u00a0 \u00a0\u5728\u5730\u5740 N \u5904\u6dfb\u52a0\u5199\u76d1\u89c6\u70b9<br \/>\nwatch id \u00a0 \u00a0 \u00a0 \u00a0\u5728\u7b26\u53f7 ID \u7684\u5730\u5740\u6dfb\u52a0\u5199\u76d1\u89c6\u70b9<br \/>\ninfo break \u00a0 \u00a0 \u00a0\u5217\u51fa\u6240\u6709\u65ad\u70b9\u6216\u76d1\u89c6\u70b9\u7684\u72b6\u6001<\/p><\/blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u60a8\u53ef\u4ee5\u4f7f\u7528\u7b26\u53f7 EntryPoint \u4ee3\u8868 DLL \u7684\u5165\u53e3\u70b9\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5728\u6309\u7b26\u53f7\u540d\u79f0\u8bbe\u7f6e\u65ad\u70b9\u6216\u76d1\u89c6\u70b9\u65f6\uff0c\u5982\u679c\u627e\u4e0d\u5230\u7b26\u53f7(\u4f8b\u5982\uff0c\u7b26\u53f7\u6240\u5728\u6a21\u5757\u8fd8\u6ca1\u6709\u52a0\u8f7d)\uff0cwinedbg \u5c06\u8bb0\u4f4f\u7b26\u53f7\u7684\u540d\u79f0\uff0c\u5e76\u5728\u6bcf\u6b21\u52a0\u8f7d\u65b0\u6a21\u5757\u65f6\u5c1d\u8bd5\u8bbe\u7f6e\u8be5\u65ad\u70b9\uff08\u76f4\u5230\u6210\u529f\uff09\u3002<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u6808\u5e27\u64cd\u4f5c<\/strong><\/h2>\n<blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">bt \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u6253\u5370\u5f53\u524d\u7ebf\u7a0b\u7684\u8c03\u7528\u6808<br \/>\nbt N \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u6253\u5370\u7ebf\u7a0bID\u4e3a N \u7684\u7ebf\u7a0b\u7684\u8c03\u7528\u5806\u6808(\u6ce8\u610f:\u8fd9\u4e0d\u4f1a\u66f4\u6539\u5f53\u524d\u5e27\u7684\u4f4d\u7f6e\uff0c\u56e0\u4e3a\u5b83\u4eec\u7531down\u548cup\u547d\u4ee4\u64cd\u7eb5)<br \/>\nup \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5f53\u524d\u7ebf\u7a0b\u6808\u4e2d\u5411\u4e0a\u79fb\u52a8\u4e00\u5e27<br \/>\nup \u00a0N \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u5f53\u524d\u7ebf\u7a0b\u6808\u4e2d\u5411\u4e0a\u79fb\u52a8 N \u5e27<br \/>\ndown \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5f53\u524d\u7ebf\u7a0b\u6808\u4e2d\u5411\u4e0b\u79fb\u52a8\u4e00\u5e27<br \/>\ndown N \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5f53\u524d\u7ebf\u7a0b\u6808\u4e2d\u5411\u4e0b\u79fb\u52a8 N \u5e27<br \/>\nframe N \u00a0 \u00a0 \u00a0 \u00a0 \u8bbe\u7f6e N \u4e3a\u5f53\u524d\u7ebf\u7a0b\u6808\u7684\u5f53\u524d\u5e27<br \/>\ninfo local \u00a0 \u00a0 \u00a0\u5217\u51fa\u5f53\u524d\u5e27\u7684\u5c40\u90e8\u53d8\u91cf\u4fe1\u606f<\/p>\n<\/blockquote>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u76ee\u5f55\u548c\u6e90\u6587\u4ef6\u64cd\u4f5c<\/strong><\/h2>\n<blockquote><p>show dir \u00a0 \u00a0 \u00a0 \u00a0\u6253\u5370\u67e5\u627e\u6e90\u6587\u4ef6\u7684\u76ee\u5f55\u5217\u8868<br \/>\ndir pathname \u00a0 \u00a0\u5c06 pathname \u6307\u5b9a\u7684\u76ee\u5f55\u6dfb\u52a0\u5230\u67e5\u627e\u6e90\u6587\u4ef6\u7684\u76ee\u5f55\u5217\u8868\u91cc\u9762<br \/>\ndir \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u6e05\u7a7a\u67e5\u627e\u6e90\u6587\u4ef6\u7684\u76ee\u5f55\u5217\u8868<br \/>\nlist \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5217\u51fa\u5f53\u524d\u4f4d\u7f6e\u5f00\u59cb\u768410\u884c\u6e90\u7801<br \/>\nlist - \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5217\u51fa\u5f53\u524d\u4f4d\u7f6e\u5f80\u540e\u768410\u884c\u6e90\u7801<br \/>\nlist N \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u5217\u51fa\u5f53\u524d\u6587\u4ef6\u4e2d\u4ece N \u884c\u5f00\u59cb\u768410\u884c\u6e90\u7801<br \/>\nlist path:N \u00a0 \u00a0 \u5217\u51fa path \u6307\u5b9a\u7684\u6587\u4ef6\u7684\u7b2cN\u884c\u5f00\u59cb\u768410\u884c\u6e90\u7801<br \/>\nlist id \u00a0 \u00a0 \u00a0 \u00a0 \u5217\u51fa\u51fd\u6570 ID \u768410\u884c\u6e90\u7801<br \/>\nlist *N \u00a0 \u00a0 \u00a0 \u00a0 \u5217\u51fa\u5730\u5740 N \u5f00\u59cb\u768410\u884c\u6e90\u7801<\/p><\/blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u60a8\u8fd8\u53ef\u4ee5\u4f7f\u7528\u9017\u53f7\u5206\u9694\u6765\u6307\u5b9a\u4e00\u6bb5\u8303\u56f4\u3002\u4f8b\u5982\uff1a<\/p>\n<blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">list 123,234 \u00a0 \u00a0 \u00a0 \u00a0\u5217\u51fa\u5f53\u524d\u6587\u4ef6\u7684\u7b2c 123 \u884c\u5230 234 \u884c<br \/>\nlist foo.c:1,56 \u00a0 \u00a0 \u5217\u51fafoo.c\u6587\u4ef6\u7684\u7b2c 1 \u884c\u5230 56 \u884c<\/p>\n<\/blockquote>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u663e\u793a<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u663e\u793a\u662f\u5728\u6267\u884c\u4efb\u4f55 winedbg \u547d\u4ee4\u540e\u8ba1\u7b97\u5e76\u6253\u5370\u7684\u8868\u8fbe\u5f0f\u3002<\/p>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">Winedbg \u5c06\u81ea\u52a8\u68c0\u6d4b\u60a8\u8f93\u5165\u7684\u8868\u8fbe\u5f0f\u662f\u5426\u5305\u542b\u5c40\u90e8\u53d8\u91cf\u3002\u5982\u679c\u5305\u542b\uff0c\u5219\u4ec5\u5f53\u4e0a\u4e0b\u6587\u6240\u5728\u51fd\u6570\u4e0e\u8bbe\u7f6e\u663e\u793a\u8868\u8fbe\u5f0f\u65f6\u6240\u5728\u7684\u51fd\u6570\u4e00\u6837\u65f6\uff0c\u624d\u4f1a\u663e\u793a\u8be5\u5c40\u90e8\u53d8\u91cf\u7684\u503c\u3002<\/p>\n<blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">info display \u00a0 \u00a0 \u00a0 \u00a0\u5217\u51fa\u6240\u6709\u7684\u6d3b\u52a8\u663e\u793a<br \/>\ndisplay \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u67e5\u770b\u6240\u6709\u6d3b\u52a8\u663e\u793a\u7684\u503c(\u5728\u6bcf\u6b21\u8c03\u8bd5\u5668\u505c\u6b62\u65f6\u90fd\u6267\u884c)<br \/>\ndisplay expr \u00a0 \u00a0 \u00a0 \u00a0\u6dfb\u52a0\u8868\u8fbe\u5f0f expr \u7684\u663e\u793a<br \/>\ndisplay \/fmt expr \u00a0 \u6dfb\u52a0\u7ed9\u5b9a\u683c\u5f0f\u6253\u5370 expr \u7684\u503c\u7684\u663e\u793a(\u6709\u5173\u683c\u5f0f\u7684\u66f4\u591a\u4fe1\u606f,\u8bf7\u53c2\u9605\u4e0b\u6587\u7684\u6253\u5370\u547d\u4ee4\u7528\u6cd5)<br \/>\nundisplay N \u00a0 \u00a0 \u00a0 \u00a0 \u5220\u9664\u663e\u793a\u7f16\u53f7\u4e3a N \u7684\u663e\u793a<\/p>\n<\/blockquote>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u53cd\u6c47\u7f16<\/strong><\/h2>\n<blockquote><p>disas \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u4ece\u5f53\u524d\u4f4d\u7f6e\u53cd\u6c47\u7f16<br \/>\ndisas expr \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u4ece expr \u6307\u5b9a\u7684\u5730\u5740\u53cd\u6c47\u7f16<br \/>\ndisas expr,expr \u00a0 \u00a0 \u5728\u4e24\u4e2a expr \u6307\u5b9a\u7684\u5730\u5740\u4e4b\u95f4\u53cd\u6c47\u7f16<\/p><\/blockquote>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u5185\u5b58\uff08\u8bfb\u53d6\u3001\u5199\u5165\u3001\u67e5\u770b\uff09<\/strong><\/h2>\n<blockquote><p>x expr \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u67e5\u770b expr \u6307\u5b9a\u7684\u5730\u5740\u5904\u7684\u5185\u5b58<br \/>\nx \/fmt expr \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u4f7f\u7528\u683c\u5f0f fmt \u67e5\u770b expr \u6307\u5b9a\u7684\u5730\u5740\u5904\u7684\u5185\u5b58<br \/>\nprint expr \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u6253\u5370 expr \u7684\u503c(\u53ef\u80fd\u4f7f\u7528\u5176\u7c7b\u578b)<br \/>\nprint \/fmt expr \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u4f7f\u7528\u683c\u5f0f fmt \u6253\u5370 expr \u7684\u503c<br \/>\nset lval=expr \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u5728 lval \u4e2d\u5199\u5165 expr \u7684\u503c<br \/>\nwhatis expr \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u6253\u5370\u8868\u8fbe\u5f0f expr \u7684 C \u7c7b\u578b<br \/>\nset !symbol_picker interactive \u00a0\u5728\u6253\u5370\u503c\u65f6\uff0c\u5982\u679c\u627e\u5230\u591a\u4e2a\u7b26\u53f7\uff0c\u8be2\u95ee\u7528\u6237\u8981\u9009\u53d6\u54ea\u4e2a\u7b26\u53f7(\u9ed8\u8ba4)<br \/>\nset !symbol_picker scoped \u00a0 \u00a0 \u00a0 \u5728\u6253\u5370\u503c\u65f6\uff0c\u5c40\u90e8\u7b26\u53f7\u4f18\u5148\u4e8e\u5168\u5c40\u7b26\u53f7<\/p><\/blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\"><code>fmt<\/code> \u662f\u5b57\u6bcd\u6216\u4e2a\u6570\u52a0\u5b57\u6bcd(\u4e2a\u6570\u548c\u5b57\u6bcd\u4e4b\u95f4\u6ca1\u6709\u7a7a\u683c)\uff0c\u5176\u4e2d\u5b57\u6bcd\u53ef\u4ee5\u662f\u4ee5\u4e0b\u5b57\u7b26\uff1a<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section>s\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u8868\u793a ASCII \u5b57\u7b26\u4e32<\/section>\n<\/li>\n<li>\n<section>u\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\u8868\u793a Unicode UTF16 \u5b57\u7b26\u4e32<\/section>\n<\/li>\n<li>\n<section>i\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u8868\u793a\u4e00\u4e2a\u6307\u4ee4 (\u53cd\u6c47\u7f16)<\/section>\n<\/li>\n<li>\n<section>d \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u8868\u793a\u5341\u8fdb\u5236\u663e\u793a 32\u4f4d\u7b26\u53f7\u6574\u6570<\/section>\n<\/li>\n<li>\n<section>x \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u8868\u793a\u5341\u516d\u8fdb\u5236\u663e\u793a 32\u4f4d\u65e0\u7b26\u53f7\u6574\u6570<\/section>\n<\/li>\n<li>\n<section>w\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u8868\u793a\u5341\u516d\u8fdb\u5236\u663e\u793a 16\u4f4d\u65e0\u7b26\u53f7\u6574\u6570<\/section>\n<\/li>\n<li>\n<section>b \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u8868\u793a\u5341\u516d\u8fdb\u5236\u663e\u793a 8\u4f4d\u65e0\u7b26\u53f7\u6574\u6570<\/section>\n<\/li>\n<li>\n<section>c \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u8868\u793a ASCII \u5b57\u7b26\uff08\u4ec5\u6253\u5370\u53ef\u6253\u5370\u7684 0x20-0x7f \u4e4b\u95f4\u7684\u5b57\u7b26\uff09<\/section>\n<\/li>\n<li>\n<section>g \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u8868\u793a GUID<\/section>\n<\/li>\n<\/ul>\n<h2><strong>\u67e5\u770b Wine \u5185\u90e8\u4fe1\u606f<\/strong><\/h2>\n<p>info class \u00a0 \u00a0 \u00a0\u5217\u51fa\u5728 Wine \u4e2d\u6ce8\u518c\u7684\u6240\u6709 Windows \u7c7b<br \/>\ninfo class id \u00a0 \u6253\u5370 Windows \u7c7b ID \u4e0a\u7684\u4fe1\u606f<br \/>\ninfo share \u00a0 \u00a0 \u00a0\u5217\u51fa\u8c03\u8bd5\u7a0b\u5e8f\u52a0\u8f7d\u7684\u6240\u6709\u6a21\u5757\u4fe1\u606f(\u5305\u62ec .so \u6587\u4ef6\u3001NE \u548c PE DLL)<br \/>\ninfo share N \u00a0 \u00a0\u6253\u5370\u5730\u5740 N \u5bf9\u5e94\u7684\u6a21\u5757\u7684\u4fe1\u606f<br \/>\ninfo regs \u00a0 \u00a0 \u00a0 \u6253\u5370 CPU \u5bc4\u5b58\u5668\u7684\u503c<br \/>\ninfo all-regs \u00a0 \u6253\u5370\u7684CPU\u548c\u6d6e\u70b9\u5bc4\u5b58\u5668\u7684\u503c<br \/>\ninfo stack \u00a0 \u00a0 \u00a0\u6253\u5370\u6808\u9876\u90e896\u4e2a\u5b57\u8282<br \/>\ninfo map \u00a0 \u00a0 \u00a0 \u00a0\u5217\u51fa\u8c03\u8bd5\u7a0b\u5e8f\u4f7f\u7528\u7684\u6240\u6709\u865a\u62df\u6620\u5c04<br \/>\ninfo map N \u00a0 \u00a0 \u00a0\u5217\u51fa wpid \u4e3a N \u7a0b\u5e8f\u4f7f\u7528\u7684\u6240\u6709\u865a\u62df\u6620\u5c04<br \/>\ninfo wnd \u00a0 \u00a0 \u00a0 \u00a0\u5217\u51fa\u4ece\u684c\u9762\u7a97\u53e3\u5f00\u59cb\u7684\u6240\u6709\u7a97\u53e3\u5c42\u6b21\u7ed3\u6784<br \/>\ninfo wnd N \u00a0 \u00a0 \u00a0\u6253\u5370\u53e5\u67c4\u4e3a N \u7684\u7a97\u53e3\u7684\u4fe1\u606f<br \/>\ninfo process \u00a0 \u00a0\u5217\u51fa\u5f53\u524d\u5bb9\u5668\u91cc\u9762\u7684\u6240\u6709 W-process \u8fdb\u7a0b\u4fe1\u606f<br \/>\ninfo thread \u00a0 \u00a0 \u5217\u51fa\u5f53\u524d\u5bb9\u5668\u91cc\u9762\u7684\u6240\u6709 W-thread \u7ebf\u7a0b\u4fe1\u606f<br \/>\ninfo exception \u00a0\u5217\u51fa\u5f02\u5e38\u5e27(\u4ece\u5f53\u524d\u6808\u5e27\u5f00\u59cb)<\/p>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>\u8c03\u8bd5\u901a\u9053<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5728\u8fdb\u884c\u8c03\u8bd5\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528 set \u547d\u4ee4\u6253\u5f00\u548c\u5173\u95ed\u8c03\u8bd5\u901a\u9053\uff08\u4ec5\u9002\u7528\u4e8e<code>WINEDEBUG<\/code>\u00a0\u73af\u5883\u53d8\u91cf\u4e2d\u6307\u5b9a\u7684\u8c03\u8bd5\u901a\u9053\uff09\u3002\u6709\u5173\u8c03\u8bd5\u901a\u9053\u7684\u66f4\u591a\u8be6\u7ec6\u4fe1\u606f\uff0c\u8bf7\u53c2\u9605 Wine \u5f00\u53d1\u8005\u6307\u5357 \u7b2c 2 \u7ae0\u3002<\/p>\n<blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">set + warn channel \u00a0 \u00a0 \u00a0\u6253\u5f00\u6307\u5b9a\u901a\u9053\u7684 warn \u7c7b\u65e5\u5fd7<br \/>\nset + channel \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u6253\u5f00\u6307\u5b9a\u901a\u9053\u7684 warn\/fixme\/err\/trace \u7c7b\u65e5\u5fd7<br \/>\nset - channel \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u5173\u95ed\u6307\u5b9a\u901a\u9053\u7684 warn\/fixme\/err\/trace \u7c7b\u65e5\u5fd7<br \/>\nset - fixme \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u5173\u95ed`fixme`\u7c7b\u65e5\u5fd7<\/p>\n<\/blockquote>\n<h2 data-tool=\"mdnice\u7f16\u8f91\u5668\"><strong>bt \u547d\u4ee4\u5217\u51fa\u7684\u8c03\u7528\u5806\u6808\u8bf4\u660e<\/strong><\/h2>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4e00\u822c\u60c5\u51b5\u4e0b\uff0cbt \u547d\u4ee4\u8f93\u51fa\u5982\u4e0b\u7684\u4fe1\u606f\uff1a<\/p>\n<blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">Wine-dbg&gt;bt<br \/>\nBacktrace:<br \/>\n=&gt;0 0x7b83c640 UnhandledExceptionFilter(epointers=0x65f948) [\/home\/deepin\/deepin-wine\/dlls\/kernel32\/except.c:426] in kernel32 (0x0065f958)<br \/>\n1 0x7bc7ef39 call_exception_handler+0x28() in ntdll (0x0065f988)<br \/>\n2 0x7bc7ef0b EXC_CallHandler+0x1a() in ntdll (0x0065f9a8)<br \/>\n3 0x7bc7f851 raise_exception+0x3a0(rec=0x65fd58, context=0x65fa8c, first_chance=&lt;is not available&gt;) [\/home\/deepin\/deepin-wine\/dlls\/ntdll\/signal_i386.c:698] in ntdll (0x0065fa18)<br \/>\n4 0x7bc8172e NtRaiseException+0x2d(rec=&lt;couldn't compute location&gt;, context=&lt;couldn't compute location&gt;, first_chance=&lt;couldn't compute location&gt;) [\/home\/deepin\/deepin-wine\/dlls\/ntdll\/signal_i386.c:2840] in ntdll (0x0065fa38)<br \/>\n5 0x7bc81e3b raise_generic_exception+0x2a(rec=&lt;couldn't compute location&gt;, context=&lt;couldn't compute location&gt;) [\/home\/deepin\/deepin-wine\/dlls\/ntdll\/signal_i386.c:2167] in ntdll (0x0065fa78)<br \/>\n6 0xdeadbabe (0x0065fdd8)<br \/>\n7 0x0040138b in a (+0x138a) (0x0065fe68)<br \/>\n8 0x7b85f7ec call_process_entry+0xb() in kernel32 (0x0065fe88)<br \/>\n9 0x7b860769 start_process+0x68(entry=&lt;couldn't compute location&gt;) [\/home\/deepin\/deepin-wine\/dlls\/kernel32\/process.c:1124] in kernel32 (0x0065fec8)<br \/>\n10 0x7bc7eebc call_thread_func_wrapper+0xb() in ntdll (0x0065fedc)<br \/>\n11 0x7bc82069 call_thread_func+0xa8(entry=0x7b860700, arg=0x4014a0, frame=0x65ffec) [\/home\/deepin\/deepin-wine\/dlls\/ntdll\/signal_i386.c:2962] in ntdll (0x0065ffcc)<br \/>\n12 0x7bc7ee9a call_thread_entry_point+0x11() in ntdll (0x0065ffec)<\/p>\n<\/blockquote>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u5176\u4e2d<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section>\u7b2c1\u5217\u7684\u6570\u5b57\u662f\u51fd\u6570\u8c03\u7528\u6808\u7684\u5e27\u53f7\uff0c\u6bd4\u5982\u4e0a\u9762\u7684\u8f93\u51fa\u670913\u5c42\u8c03\u7528\uff0c\u5f53\u524d\u6808\u5e27\u53f7\u662f0\uff0c\u4e5f\u5c31\u662f\u8c03\u7528\u6808\u7684\u6700\u5e95\u5c42\u7684\u51fd\u6570\u3002\u8fd9\u4e2a\u7f16\u53f7\u7684\u7528\u9014\u662f\u7528\u6765\u5207\u6362\u6808\u5e27\u7684\uff0c\u6267\u884c\u547d\u4ee4<code>frame N<\/code> N\u662f\u8981\u67e5\u770b\u7684\u6808\u5e27\u7f16\u53f7\u5c31\u53ef\u4ee5\u5207\u6362\u5230\u6307\u5b9a\u7684\u6808\u5e27\u3002<\/section>\n<\/li>\n<li>\n<section>\u7b2c2\u5217\u662f\u6bcf\u5c42\u8c03\u7528\u6808\u5e27\u7684\u4e0a\u4e00\u5c42\u51fd\u6570\u8fd4\u56de\u5730\u5740\u768416\u8fdb\u5236\u8868\u793a,\uff0c\u6bd4\u5982\u4e0a\u9762\u7684\u8f93\u51fa\u91cc\u9762\u7f16\u53f7\u662f12\u7684\u6808\u5e27\u7684\u7b2c2\u5217\u6570\u5b57\u662f<code>0x7bc7ee9a<\/code> \u5c31\u662f\u8868\u793a\u5728\u51fd\u6570<code>call_thread_entry_point<\/code>\u5185\u90e8\u8c03\u7528\u51fd\u6570<code>call_thread_func<\/code>\u4e4b\u540e\u7684\u8fd4\u56de\u5730\u5740\u3002<\/section>\n<\/li>\n<li>\n<section>\u7b2c3\u5217\u662f\u7b2c2\u5217\u51fd\u6570\u8fd4\u56de\u5730\u5740\u7684\u7b26\u53f7\u540d\u79f0\uff0c\u76ee\u7684\u662f\u589e\u52a0\u53ef\u8bfb\u6027\uff0c\u67092\u79cd\u60c5\u51b5\uff1a<\/section>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section>\u51fd\u6570\u540d\u79f0+\u504f\u79fb\u5730\u5740\u6765\u8868\u793a\uff0c\u6bd4\u5982\u4e0a\u9762\u7684\u6808\u5e2712\u7684<code>call_thread_entry_point+0x11<\/code>\uff1b<\/section>\n<\/li>\n<li>\n<section>\u5982\u679c winedbg \u5c31\u627e\u4e0d\u5230\u5730\u5740\u5bf9\u5e94\u7684\u51fd\u6570\u540d\u79f0\uff0c\u5c31\u7528\u6240\u5728\u51fd\u6570\u6240\u5728\u7684\u6a21\u5757\u540d\u52a0\u4e00\u4e2a\u504f\u79fb\u5730\u5740\u8868\u793a\uff0c \u6bd4\u5982\u4e0a\u9762\u7684\u6808\u5e27\uff17\u7684<code>in a (+0x138a)<\/code> \u8868\u793a\u51fd\u6570\u8c03\u7528\u5730\u5740\u662f\u5728 a \u6a21\u5757\u7684\u9996\u5730\u5740+0x138a\u5b57\u8282\u5904\u3002<\/section>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<section>\u7b2c4\u5217\u662f\u51fd\u6570\u53c2\u6570\uff0c\u5982\u679c\u6ca1\u6709\u8c03\u8bd5\u7b26\u53f7\u6216\u8005\u51fd\u6570\u672c\u8eab\u6ca1\u6709\u53c2\u6570\uff0c\u5c31\u4e0d\u663e\u793a\uff1b\u5bf9\u4e8e\u663e\u793a\u53c2\u6570\u7684\uff0c\u53c2\u6570\u503c\u53ef\u80fd\u8bfb\u53d6\u4e0d\u5230\u7684\u4f1a\u4ee5<code>&lt;couldn't compute location&gt;<\/code>\u548c<code>&lt;is not available&gt;<\/code>\u6765\u8868\u793a\u3002<\/section>\n<\/li>\n<li>\n<section>\u7b2c5\u5217\u662f\u5bf9\u5e94\u7684\u6e90\u7801\uff0c\u5982\u679c\u627e\u4e0d\u5230\u6e90\u7801\uff0c\u5c31\u4e0d\u663e\u793a\u3002<\/section>\n<\/li>\n<li>\n<section><code>in<\/code> \u540e\u9762\u7684\u5355\u8bcd\u540d\u79f0\u662f\u6240\u5728\u7684\u6a21\u5757\uff0c\u6bd4\u5982\u6808\u5e2712\u6240\u5728\u6a21\u5757\u662f ntdll.dll \u3002<\/section>\n<\/li>\n<li>\n<section>\u6700\u540e\u4e00\u5217\u62ec\u53f7\u62ec\u8d77\u6765\u7684\u6570\u5b57\u662f\u5f53\u524d\u6808\u5e27\u7684 ESP \u5bc4\u5b58\u5668\u503c\uff0c\u5373\u5c40\u90e8\u53d8\u91cf\u7684\u8d77\u59cb\u5185\u5b58\u533a\u57df\u3002<\/section>\n<\/li>\n<\/ul>\n<p data-tool=\"mdnice\u7f16\u8f91\u5668\">\u4ece\u4e0a\u9762\u8fd9\u4e2a\u5806\u6808\u6765\u770b\uff0c\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\u5982\u4e0b\u4fe1\u606f\uff1a<\/p>\n<ul class=\"list-paddingleft-1\">\n<li>\n<section>\u7a0b\u5e8f\u662f\u5728\u6267\u884c\u5230 0xdeadbabe \u89e6\u53d1\u4e86\u5f02\u5e38\uff0c\u5f02\u5e38\u4fe1\u606f\u4fdd\u5b58\u5728 raise_exception\u7684 \u7b2c\uff11\u4e2a\u53c2\u6570 rec \u7ed3\u6784\u4f53\u91cc\u9762\u3002<\/section>\n<\/li>\n<li>\n<section>\u8c03\u7528 0xdeadbabe \u7684\u51fd\u6570\u8fd4\u56de\u5730\u5740\u662f<code>0x0040138b<\/code>\u3002\u8be5\u5f02\u5e38\u6ca1\u6709\u5bf9\u5e94\u7684\u5904\u7406\u51fd\u6570\uff0c\u6700\u7ec8\u4ea4\u7531 UnhandledExceptionFilter \u51fd\u6570\u5904\u7406\u3002<\/section>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/distrowatch.com\/table.php?distribution=deepin\">&gt; \u652f\u6301 deepin\uff08\u6df1\u5ea6\uff09\u793e\u533a<\/a>","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u4e3b\u8981\u4ee5 Wine \u5b98\u7f51\u7684\u8fd9\u7bc7\u6587\u7ae0 \u300a Debugging Wine \u300b \u6765\u8bb2\u89e3\u3002\u5927\u90e8\u5206\u5185\u5bb9\u662f\u5bf9\u8be5\u6587\u7684\u7ffb\u8bd1\uff0c\u4fee\u6b63\u4e86\u539f\u6587\u7684\u4e00\u4e9b\u4e66\u5199\u9519\u8bef\uff0c\u5220\u9664\u4e86\u539f\u6587\u8ddf\u6700\u65b0\u7684 Wine \u4e0d\u9002\u5e94\u7684\u5185\u5bb9\u3002 \u4ecb\u7ecd \u5e38\u7528\u8c03\u8bd5\u65b9\u6cd5 Wine \u4e3a\u8c03\u8bd5\u95ee\u9898\u63d0\u4f9b\u4e86\u591a\u79cd\u65b9\u6cd5\u3002\u5927\u591a\u6570 Wine \u5f00\u53d1\u4eba\u5458\u66f4\u559c\u6b22\u4f7f\u7528 Wine \u7684\u8c03\u8bd5\u901a\u9053\u6536\u96c6\u65e5\u5fd7\u6765\u89e3\u51b3\u95ee\u9898\u3002\u60a8\u53ef\u4ee5\u5728\u5f00\u53d1\u4eba\u5458\u8c03\u8bd5\u65e5\u5fd7\u4f7f\u7528\u6307\u5357\u4e2d\u4e86\u89e3\u5982\u4f55\u4f7f\u7528\u8c03\u8bd5\u901a\u9053\u6765\u8bb0\u5f55\u65e5\u5fd7\u7684\u66f4\u591a\u5185\u5bb9\u3002\uff08htt ...<a href=https:\/\/www.deepin.org\/zh\/how-to-debug-wine\/>\u9605\u8bfb\u66f4\u591a<\/a><\/p>\n","protected":false},"author":11164,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[155],"tags":[],"_links":{"self":[{"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/posts\/36058"}],"collection":[{"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/users\/11164"}],"replies":[{"embeddable":true,"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/comments?post=36058"}],"version-history":[{"count":5,"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/posts\/36058\/revisions"}],"predecessor-version":[{"id":36091,"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/posts\/36058\/revisions\/36091"}],"wp:attachment":[{"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/media?parent=36058"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/categories?post=36058"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.deepin.org\/zh\/wp-json\/wp\/v2\/tags?post=36058"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}