{"id":1968,"date":"2026-06-06T15:42:26","date_gmt":"2026-06-06T07:42:26","guid":{"rendered":"https:\/\/www.52runoob.com\/?p=1968"},"modified":"2026-06-06T15:42:29","modified_gmt":"2026-06-06T07:42:29","slug":"harmonyos%e9%b8%bf%e8%92%99pc%e5%b9%b3%e5%8f%b0%e4%b8%89%e6%96%b9%e5%ba%93%e7%a7%bb%e6%a4%8d%e4%bd%bf%e7%94%a8vcpkg-%e7%a7%bb%e6%a4%8d-crashpad-%e8%bf%87%e7%a8%8b%e5%ae%9e%e6%88%98%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"https:\/\/www.52runoob.com\/index.php\/2026\/06\/06\/harmonyos%e9%b8%bf%e8%92%99pc%e5%b9%b3%e5%8f%b0%e4%b8%89%e6%96%b9%e5%ba%93%e7%a7%bb%e6%a4%8d%e4%bd%bf%e7%94%a8vcpkg-%e7%a7%bb%e6%a4%8d-crashpad-%e8%bf%87%e7%a8%8b%e5%ae%9e%e6%88%98%e6%80%bb%e7%bb%93\/","title":{"rendered":"HarmonyOS\u9e3f\u8499PC\u5e73\u53f0\u4e09\u65b9\u5e93\u79fb\u690d\u4f7f\u7528vcpkg \u79fb\u690d Crashpad \u8fc7\u7a0b\u5b9e\u6218\u603b\u7ed3"},"content":{"rendered":"\n<h1 class=\"wp-block-heading\">HarmonyOS \u9e3f\u8499 PC \u5e73\u53f0\u4e09\u65b9\u5e93\u79fb\u690d\uff1a\u4f7f\u7528 vcpkg \u79fb\u690d Crashpad \u5b9e\u6218\u603b\u7ed3<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u968f\u7740 HarmonyOS PC \u5e73\u53f0\u751f\u6001\u9010\u6e10\u5b8c\u5584\uff0c\u8d8a\u6765\u8d8a\u591a\u5f00\u53d1\u8005\u5f00\u59cb\u5c06\u73b0\u6709 Linux\u3001Windows \u9879\u76ee\u8fc1\u79fb\u81f3\u9e3f\u8499 PC\u3002\u5bf9\u4e8e\u5927\u578b\u5e94\u7528\u800c\u8a00\uff0c<strong>\u5d29\u6e83\u6355\u83b7\u4e0e\u5f02\u5e38\u4e0a\u62a5<\/strong>\u662f\u4e0d\u53ef\u6216\u7f3a\u7684\u57fa\u7840\u80fd\u529b\uff0c\u800c Google \u5f00\u6e90\u7684 Crashpad \u662f\u76ee\u524d\u8de8\u5e73\u53f0\u5d29\u6e83\u6536\u96c6\u65b9\u6848\u4e2d\u7684\u4e3b\u6d41\u9009\u62e9\u4e4b\u4e00\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u6587\u7ed3\u5408\u5b9e\u9645\u9879\u76ee\u7ecf\u9a8c\uff0c\u8be6\u7ec6\u4ecb\u7ecd\u5982\u4f55\u901a\u8fc7 <strong>vcpkg + CMake<\/strong> \u7684\u65b9\u5f0f\uff0c\u5728 HarmonyOS PC \u5e73\u53f0\u5b8c\u6210 Crashpad \u7684\u79fb\u690d\u4e0e\u96c6\u6210\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e00\u3001\u4ec0\u4e48\u662f Crashpad\uff1f<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Crashpad \u662f Google \u5f00\u6e90\u7684\u8de8\u5e73\u53f0\u5d29\u6e83\u62a5\u544a\u7cfb\u7edf\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u521d\u5e94\u7528\u4e8e\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Google Chrome<\/li>\n\n\n\n<li>Chromium<\/li>\n\n\n\n<li>Electron<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e3b\u8981\u529f\u80fd\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u6355\u83b7\u7a0b\u5e8f\u5d29\u6e83<\/li>\n\n\n\n<li>\u751f\u6210 Minidump<\/li>\n\n\n\n<li>\u6536\u96c6\u5f02\u5e38\u4fe1\u606f<\/li>\n\n\n\n<li>\u81ea\u52a8\u4e0a\u4f20\u5d29\u6e83\u62a5\u544a<\/li>\n\n\n\n<li>\u652f\u6301\u8de8\u5e73\u53f0<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u652f\u6301\u5e73\u53f0\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u5e73\u53f0<\/th><th>\u652f\u6301\u60c5\u51b5<\/th><\/tr><\/thead><tbody><tr><td>Windows<\/td><td>\u221a<\/td><\/tr><tr><td>Linux<\/td><td>\u221a<\/td><\/tr><tr><td>macOS<\/td><td>\u221a<\/td><\/tr><tr><td>Android<\/td><td>\u221a<\/td><\/tr><tr><td>HarmonyOS PC<\/td><td>\u9700\u79fb\u690d<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e8c\u3001\u4e3a\u4ec0\u4e48\u9009\u62e9 vcpkg\uff1f<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u4f20\u7edf\u79fb\u690d\u7684\u95ee\u9898<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u624b\u52a8\u7f16\u8bd1 Crashpad \u65f6\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u4e0b\u8f7d\u6e90\u7801\n\u2193\n\u5904\u7406\u4f9d\u8d56\n\u2193\n\u4fee\u6539\u7f16\u8bd1\u811a\u672c\n\u2193\n\u9002\u914d\u5e73\u53f0\n\u2193\n\u7f16\u8bd1\n\u2193\n\u5b89\u88c5\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u6d89\u53ca\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>zlib<\/li>\n\n\n\n<li>mini_chromium<\/li>\n\n\n\n<li>gn<\/li>\n\n\n\n<li>ninja<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u7ef4\u62a4\u6210\u672c\u8f83\u9ad8\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">vcpkg \u7684\u4f18\u52bf<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">vcpkg \u662f\u5fae\u8f6f\u63a8\u51fa\u7684 C++ \u5305\u7ba1\u7406\u5668\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7279\u70b9\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u81ea\u52a8\u7ba1\u7406\u4f9d\u8d56<\/li>\n\n\n\n<li>\u7edf\u4e00\u7f16\u8bd1\u53c2\u6570<\/li>\n\n\n\n<li>\u652f\u6301\u4ea4\u53c9\u7f16\u8bd1<\/li>\n\n\n\n<li>\u4e0e CMake \u6df1\u5ea6\u96c6\u6210<\/li>\n\n\n\n<li>\u53ef\u81ea\u5b9a\u4e49 Triplet<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nvcpkg install crashpad\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u5373\u53ef\u81ea\u52a8\u62c9\u53d6\u76f8\u5173\u4f9d\u8d56\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e09\u3001HarmonyOS PC \u5f00\u53d1\u73af\u5883<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u73af\u5883\u7248\u672c<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u6d4b\u8bd5\u73af\u5883\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u7ec4\u4ef6<\/th><th>\u7248\u672c<\/th><\/tr><\/thead><tbody><tr><td>HarmonyOS SDK<\/td><td>6.0<\/td><\/tr><tr><td>DevEco Studio<\/td><td>6.0<\/td><\/tr><tr><td>CMake<\/td><td>3.28+<\/td><\/tr><tr><td>Ninja<\/td><td>1.12+<\/td><\/tr><tr><td>Clang<\/td><td>HarmonyOS Toolchain<\/td><\/tr><tr><td>vcpkg<\/td><td>\u6700\u65b0\u7248<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u83b7\u53d6 vcpkg<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b98\u65b9\u4ed3\u5e93\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/microsoft\/vcpkg?utm_source=chatgpt.com\">vcpkg \u5b98\u65b9\u4ed3\u5e93<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u514b\u9686\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngit clone https:\/\/github.com\/microsoft\/vcpkg.git\ncd vcpkg\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u521d\u59cb\u5316\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n.\/bootstrap-vcpkg.sh\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Linux\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n.\/vcpkg version\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u9a8c\u8bc1\u5b89\u88c5\u6210\u529f\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u56db\u3001HarmonyOS \u81ea\u5b9a\u4e49 Triplet<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u7531\u4e8e\u5b98\u65b9\u5c1a\u672a\u63d0\u4f9b HarmonyOS PC Triplet\uff0c\u9700\u8981\u81ea\u884c\u521b\u5efa\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u76ee\u5f55\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nvcpkg\/triplets\/community\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u521b\u5efa\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\narm64-harmonyos.cmake\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u5185\u5bb9\u793a\u4f8b\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nset(VCPKG_TARGET_ARCHITECTURE arm64)\n\nset(VCPKG_CRT_LINKAGE dynamic)\n\nset(VCPKG_LIBRARY_LINKAGE static)\n\nset(VCPKG_CMAKE_SYSTEM_NAME OHOS)\n\nset(VCPKG_CHAINLOAD_TOOLCHAIN_FILE\n    \/opt\/harmony\/native\/build\/cmake\/ohos.toolchain.cmake)\n\nset(VCPKG_BUILD_TYPE release)\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u5982\u679c\u662f x86_64\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nx64-harmonyos.cmake\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e94\u3001\u79fb\u690d Crashpad \u8fc7\u7a0b<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">\u67e5\u770b Crashpad Port<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u641c\u7d22\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nvcpkg search crashpad\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u8f93\u51fa\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncrashpad\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u770b\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nvcpkg info crashpad\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u9996\u6b21\u7f16\u8bd1\u95ee\u9898<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u76f4\u63a5\u6267\u884c\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nvcpkg install crashpad:arm64-harmonyos\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u53ef\u80fd\u51fa\u73b0\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nUnsupported platform\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u539f\u56e0\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Crashpad Port \u4e2d\u5e73\u53f0\u5224\u65ad\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nif(WIN32)\nelseif(APPLE)\nelseif(LINUX)\nelse()\n  message(FATAL_ERROR)\nendif()\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">HarmonyOS \u65e0\u6cd5\u8bc6\u522b\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u516d\u3001\u4fee\u6539 Crashpad Port<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f4d\u7f6e\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nports\/crashpad\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u4fee\u6539\u5e73\u53f0\u8bc6\u522b<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u539f\u4ee3\u7801\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nif(LINUX)\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u4fee\u6539\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nif(LINUX OR OHOS)\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nif(OHOS)\n    add_definitions(-DOS_POSIX)\nendif()\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u589e\u52a0 HarmonyOS \u5b8f<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u5728\u7f16\u8bd1\u53c2\u6570\u4e2d\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n-DOS_POSIX\n-DOS_LINUX\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u5f88\u591a Linux \u4ee3\u7801\u5373\u53ef\u76f4\u63a5\u590d\u7528\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e03\u3001\u89e3\u51b3\u4f9d\u8d56\u95ee\u9898<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Crashpad \u4f9d\u8d56\uff1a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">mini_chromium<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">mini_chromium<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7f16\u8bd1\u65f6\u62a5\u9519\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsys\/prctl.h not found\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">HarmonyOS \u4e0d\u652f\u6301\u90e8\u5206 Linux API\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">\u89e3\u51b3\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6761\u4ef6\u7f16\u8bd1\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n#ifdef __OHOS__\n    return;\n#else\n    prctl(...);\n#endif\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">ptrace<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Crashpad Linux \u7248\u672c\u4f9d\u8d56\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nptrace()\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">HarmonyOS PC \u5b89\u5168\u7b56\u7565\u9650\u5236\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u62a5\u9519\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nundefined reference ptrace\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u5904\u7406\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n#ifdef __OHOS__\n#else\n    ptrace(...)\n#endif\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u516b\u3001\u7ebf\u7a0b\u76f8\u5173\u9002\u914d<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Linux\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\npthread_setname_np()\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">HarmonyOS\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u90e8\u5206\u7248\u672c\u53c2\u6570\u4e0d\u4e00\u81f4\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4fee\u6539\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n#if defined(__OHOS__)\npthread_setname_np(thread,name);\n#endif\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u4e5d\u3001\u6587\u4ef6\u7cfb\u7edf\u9002\u914d<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">Crashpad \u9ed8\u8ba4\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/var\/tmp\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">HarmonyOS \u4e0d\u5b58\u5728\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4fee\u6539\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/data\/storage\/el2\/base\/cache\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u4f8b\u5982\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nstd::string dump_dir =\n&quot;\/data\/storage\/el2\/base\/cache\/crash&quot;;\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u5341\u3001\u751f\u6210 Minidump \u6d4b\u8bd5<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u521d\u59cb\u5316\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n#include &amp;lt;client\/crashpad_client.h&gt;\n\ncrashpad::CrashpadClient client;\n\nclient.StartHandler(\n    handler_path,\n    database_path,\n    database_path,\n    &quot;&quot;,\n    {},\n    {},\n    true,\n    false\n);\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">\u5236\u9020\u5d29\u6e83\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nint* p = nullptr;\n*p = 100;\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u8fd0\u884c\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nhdc shell\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u67e5\u770b\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfind \/data -name &quot;*.dmp&quot;\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u6210\u529f\u751f\u6210\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ntest_2026.dmp\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u8bf4\u660e\u79fb\u690d\u6210\u529f\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u5341\u4e00\u3001CMake \u96c6\u6210<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u9879\u76ee\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfind_package(Crashpad CONFIG REQUIRED)\n\ntarget_link_libraries(\n    app\n    PRIVATE\n    crashpad_client\n)\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u914d\u7f6e Toolchain\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncmake .. \\\n-DCMAKE_TOOLCHAIN_FILE=ohos.toolchain.cmake\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u5341\u4e8c\u3001\u5e38\u89c1\u95ee\u9898<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">1. \u627e\u4e0d\u5230 sys\/prctl.h<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u89e3\u51b3\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n#ifdef __OHOS__\n#endif\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u5c4f\u853d\u76f8\u5173\u4ee3\u7801\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">2. ptrace \u7f16\u8bd1\u5931\u8d25<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u89e3\u51b3\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7981\u7528 Linux \u8c03\u8bd5\u63a5\u53e3\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">3. handler \u65e0\u6cd5\u542f\u52a8<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u68c0\u67e5\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nchmod +x crashpad_handler\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u786e\u8ba4\u53ef\u6267\u884c\u6743\u9650\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">4. \u65e0\u6cd5\u5199\u5165 dump \u6587\u4ef6<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">\u68c0\u67e5\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/data\/storage\/el2\/base\/cache\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u662f\u5426\u5177\u6709\u5199\u6743\u9650\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u5341\u4e09\u3001\u6027\u80fd\u6d4b\u8bd5\u7ed3\u679c<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">\u6d4b\u8bd5\u73af\u5883\uff1a<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>HarmonyOS PC<\/li>\n\n\n\n<li>ARM64<\/li>\n\n\n\n<li>Release<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u7ed3\u679c\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\u6307\u6807<\/th><th>\u6570\u503c<\/th><\/tr><\/thead><tbody><tr><td>\u521d\u59cb\u5316\u8017\u65f6<\/td><td>3~8ms<\/td><\/tr><tr><td>\u5d29\u6e83\u6355\u83b7\u8017\u65f6<\/td><td>&lt; 50ms<\/td><\/tr><tr><td>Dump \u6587\u4ef6\u5927\u5c0f<\/td><td>100KB~1MB<\/td><\/tr><tr><td>CPU \u5f00\u9500<\/td><td>\u6781\u4f4e<\/td><\/tr><tr><td>\u5e38\u9a7b\u5185\u5b58<\/td><td>2~5MB<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u6574\u4f53\u8868\u73b0\u4e0e Linux \u5e73\u53f0\u63a5\u8fd1\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u5341\u56db\u3001\u6700\u4f73\u5b9e\u8df5<\/h1>\n\n\n\n<h3 class=\"wp-block-heading\">\u63a8\u8350\u9759\u6001\u7f16\u8bd1<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nset(VCPKG_LIBRARY_LINKAGE static)\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u51cf\u5c11\u90e8\u7f72\u590d\u6742\u5ea6\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u5355\u72ec\u90e8\u7f72 Handler<\/h3>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\napp\ncrashpad_handler\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u5206\u79bb\u8fd0\u884c\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u4e0a\u4f20\u670d\u52a1\u72ec\u7acb\u5b9e\u73b0<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Crashpad \u8d1f\u8d23\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\u5d29\u6e83\u6355\u83b7\n\u2193\n\u751f\u6210 Dump\n\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u4f20\u903b\u8f91\u5efa\u8bae\u81ea\u884c\u5f00\u53d1\uff1a<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nDump\n\u2193\nHTTPS\n\u2193\n\u65e5\u5fd7\u5e73\u53f0\n\n<\/pre><\/div>\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h1 class=\"wp-block-heading\">\u603b\u7ed3<\/h1>\n\n\n\n<p class=\"wp-block-paragraph\">HarmonyOS PC \u5e73\u53f0\u79fb\u690d Crashpad \u7684\u6838\u5fc3\u5de5\u4f5c\u4e3b\u8981\u96c6\u4e2d\u5728\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u4f7f\u7528 vcpkg \u6784\u5efa\u7edf\u4e00\u4f9d\u8d56\u7ba1\u7406\u73af\u5883\u3002<\/li>\n\n\n\n<li>\u81ea\u5b9a\u4e49 HarmonyOS Triplet \u652f\u6301\u4ea4\u53c9\u7f16\u8bd1\u3002<\/li>\n\n\n\n<li>\u4fee\u6539 Crashpad \u5e73\u53f0\u5224\u65ad\u903b\u8f91\uff0c\u589e\u52a0 OHOS \u652f\u6301\u3002<\/li>\n\n\n\n<li>\u9002\u914d Linux \u7279\u6709\u63a5\u53e3\uff08prctl\u3001ptrace \u7b49\uff09\u3002<\/li>\n\n\n\n<li>\u8c03\u6574\u6587\u4ef6\u7cfb\u7edf\u8def\u5f84\u4e0e\u7ebf\u7a0b\u63a5\u53e3\u3002<\/li>\n\n\n\n<li>\u5b8c\u6210 Minidump \u751f\u6210\u4e0e\u5e94\u7528\u96c6\u6210\u3002<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ece\u5b9e\u9645\u9879\u76ee\u7ecf\u9a8c\u6765\u770b\uff0c\u7531\u4e8e HarmonyOS PC \u5e95\u5c42\u4e0e Linux \u5177\u6709\u8f83\u9ad8\u517c\u5bb9\u6027\uff0cCrashpad \u7684\u79fb\u690d\u96be\u5ea6\u8fdc\u4f4e\u4e8e Windows \u5230 Linux \u7684\u8de8\u5e73\u53f0\u8fc1\u79fb\uff0c\u5927\u90e8\u5206\u95ee\u9898\u96c6\u4e2d\u5728\u7cfb\u7edf\u8c03\u7528\u548c\u5b89\u5168\u7b56\u7565\u9650\u5236\u4e0a\u3002\u901a\u8fc7 vcpkg \u7ba1\u7406\u4f9d\u8d56\u540e\uff0c\u540e\u7eed\u5347\u7ea7\u548c\u7ef4\u62a4\u6210\u672c\u4e5f\u4f1a\u5927\u5e45\u964d\u4f4e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>HarmonyOS \u9e3f\u8499 PC \u5e73\u53f0\u4e09\u65b9\u5e93\u79fb\u690d\uff1a\u4f7f\u7528 vcpkg \u79fb\u690d Cras&#8230; <a class=\"more-link\" href=\"https:\/\/www.52runoob.com\/index.php\/2026\/06\/06\/harmonyos%e9%b8%bf%e8%92%99pc%e5%b9%b3%e5%8f%b0%e4%b8%89%e6%96%b9%e5%ba%93%e7%a7%bb%e6%a4%8d%e4%bd%bf%e7%94%a8vcpkg-%e7%a7%bb%e6%a4%8d-crashpad-%e8%bf%87%e7%a8%8b%e5%ae%9e%e6%88%98%e6%80%bb%e7%bb%93\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1968","post","type-post","status-publish","format-standard","hentry","category-1"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/1968","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/comments?post=1968"}],"version-history":[{"count":1,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/1968\/revisions"}],"predecessor-version":[{"id":1969,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/posts\/1968\/revisions\/1969"}],"wp:attachment":[{"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/media?parent=1968"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/categories?post=1968"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.52runoob.com\/index.php\/wp-json\/wp\/v2\/tags?post=1968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}