{"id":88329,"date":"2026-07-31T22:48:28","date_gmt":"2026-07-31T14:48:28","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/88329.html"},"modified":"2026-07-31T22:48:28","modified_gmt":"2026-07-31T14:48:28","slug":"linux%e5%bc%80%e5%8f%91%e5%bf%85%e5%a4%87%ef%bc%9avim%e3%80%81gcc%e5%92%8cgdb%e9%ab%98%e6%95%88%e4%b8%89%e4%bb%b6%e5%a5%97","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/88329.html","title":{"rendered":"Linux\u5f00\u53d1\u5fc5\u5907\uff1aVim\u3001GCC\u548cGDB\u9ad8\u6548\u4e09\u4ef6\u5957"},"content":{"rendered":"<p>\u4e4b\u524d\u6211\u5199\u4e86\u5f88\u591a C&#043;&#043; \u8bed\u8a00\u548c\u6570\u636e\u7ed3\u6784\u7684\u77e5\u8bc6&#xff0c;\u4e5f\u5199\u8fc7\u00a0Linux \u7684\u6587\u4ef6\u6743\u9650\u3002\u4eca\u5929&#xff0c;\u6211\u8981\u628a\u76ee\u5149\u6295\u5411\u7a0b\u5e8f\u5458\u7684\u4e09\u4e2a\u6838\u5fc3\u5de5\u5177&#xff1a;\u7f16\u8f91\u5668\u3001\u7f16\u8bd1\u5668\u548c\u8c03\u8bd5\u5668\u3002\u5728 Linux \u4e16\u754c\u91cc&#xff0c;\u6700\u7ecf\u5178\u7684\u7ec4\u5408\u5c31\u662f\u00a0Vim\u3001GCC \u548c GDB\u3002<\/p>\n<p>\u65e0\u8bba\u662f\u521a\u63a5\u89e6 Linux \u5f00\u53d1&#xff0c;\u8fd8\u662f\u60f3\u4ece IDE \u8f6c\u5411\u66f4\u8f7b\u91cf\u3001\u66f4\u7075\u6d3b\u7684\u547d\u4ee4\u884c\u5f00\u53d1\u73af\u5883&#xff0c;\u8fd9\u4e09\u4e2a\u5de5\u5177\u90fd\u503c\u5f97\u82b1\u65f6\u95f4\u719f\u7ec3\u3002\u5b83\u4eec\u867d\u7136\u9700\u8981\u4e00\u5b9a\u7684\u5b66\u4e60\u66f2\u7ebf&#xff0c;\u4f46\u5e26\u6765\u7684\u6548\u7387\u63d0\u5347\u4f1a\u662f\u51e0\u4f55\u7ea7\u7684\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e00\u90e8\u5206&#xff1a;Vim \u2014\u2014 \u5f3a\u5927\u7684\u7ec8\u7aef\u7f16\u8f91\u5668<\/h3>\n<p>Vim&#xff08;Vi IMproved&#xff09;\u662f Linux \u4e0b\u6700\u6d41\u884c\u7684\u6587\u672c\u7f16\u8f91\u5668\u4e4b\u4e00\u3002\u5b83\u7684\u7279\u70b9\u662f\u591a\u6a21\u5f0f\u7f16\u8f91&#xff0c;\u80fd\u8ba9\u624b\u4e0d\u79bb\u5f00\u952e\u76d8&#xff0c;\u7f16\u7a0b\u901f\u5ea6\u5feb\u5f97\u98de\u8d77\u3002\u4f46\u521d\u5b66\u8005\u6700\u5927\u7684\u56f0\u60d1\u5c31\u662f&#xff1a;\u8fdb\u53bb\u4e4b\u540e\u4e0d\u77e5\u9053\u600e\u4e48\u8f93\u5165\u6587\u5b57&#xff0c;\u4e5f\u4e0d\u77e5\u9053\u600e\u4e48\u9000\u51fa\u3002<\/p>\n<h4>1.1 \u6a21\u5f0f&#xff1a;Vim \u7684\u7075\u9b42<\/h4>\n<p>Vim \u6709\u4e09\u79cd\u57fa\u672c\u6a21\u5f0f&#xff1a;<\/p>\n<table>\n<tr>\u6a21\u5f0f\u4f5c\u7528\u5982\u4f55\u8fdb\u5165<\/tr>\n<tbody>\n<tr>\n<td>\u666e\u901a\u6a21\u5f0f&#xff08;Normal&#xff09;<\/td>\n<td>\u6d4f\u89c8\u3001\u590d\u5236\u3001\u7c98\u8d34\u3001\u5220\u9664\u3001\u79fb\u52a8<\/td>\n<td>\u542f\u52a8 Vim \u6216\u6309\u00a0Esc<\/td>\n<\/tr>\n<tr>\n<td>\u63d2\u5165\u6a21\u5f0f&#xff08;Insert&#xff09;<\/td>\n<td>\u50cf\u666e\u901a\u7f16\u8f91\u5668\u4e00\u6837\u8f93\u5165\u6587\u5b57<\/td>\n<td>\u5728\u666e\u901a\u6a21\u5f0f\u4e0b\u6309\u00a0i&#xff08;\u5149\u6807\u524d\u63d2\u5165&#xff09;\u6216\u00a0a&#xff08;\u5149\u6807\u540e\u63d2\u5165&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>\u547d\u4ee4\u884c\u6a21\u5f0f&#xff08;Command&#xff09;<\/td>\n<td>\u4fdd\u5b58\u3001\u9000\u51fa\u3001\u641c\u7d22\u3001\u8bbe\u7f6e<\/td>\n<td>\u5728\u666e\u901a\u6a21\u5f0f\u4e0b\u6309\u00a0:<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u8bb0\u4f4f\u4e00\u6761\u94c1\u5f8b&#xff1a;\u4efb\u4f55\u65f6\u5019\u6309\u00a0Esc\u00a0\u90fd\u4f1a\u56de\u5230\u666e\u901a\u6a21\u5f0f\u3002\u4e0d\u77e5\u9053\u81ea\u5df1\u5728\u54ea\u5c31\u72c2\u6309\u00a0Esc&#xff0c;\u7136\u540e\u91cd\u65b0\u64cd\u4f5c\u3002<\/p>\n<h4>1.2 \u751f\u5b58\u6307\u5357&#xff1a;\u6253\u5f00\u3001\u7f16\u8f91\u3001\u4fdd\u5b58\u3001\u9000\u51fa<\/h4>\n<p>\u6253\u5f00\u6587\u4ef6&#xff1a;<\/p>\n<p>vim hello.cpp<\/p>\n<p>\u8fdb\u5165\u540e&#xff0c;\u4f60\u5904\u5728\u666e\u901a\u6a21\u5f0f\u3002\u6309\u00a0i\u00a0\u8fdb\u5165\u63d2\u5165\u6a21\u5f0f&#xff0c;\u7136\u540e\u53ef\u4ee5\u8f93\u5165\u4ee3\u7801\u3002<\/p>\n<p>\u8f93\u5165\u5b8c\u540e&#xff1a;<\/p>\n<li>\n<p>\u6309\u00a0Esc\u00a0\u56de\u5230\u666e\u901a\u6a21\u5f0f\u3002<\/p>\n<\/li>\n<li>\n<p>\u8f93\u5165\u00a0:w\u00a0\u7136\u540e\u56de\u8f66 \u2192 \u4fdd\u5b58&#xff08;write&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u8f93\u5165\u00a0:q\u00a0\u7136\u540e\u56de\u8f66 \u2192 \u9000\u51fa&#xff08;quit&#xff09;\u3002<\/p>\n<\/li>\n<li>\n<p>\u6216\u8005\u5408\u8d77\u6765\u00a0:wq\u00a0\u2192 \u4fdd\u5b58\u5e76\u9000\u51fa\u3002<\/p>\n<\/li>\n<li>\n<p>\u5982\u679c\u6539\u4e71\u4e86\u60f3\u4e0d\u4fdd\u5b58\u9000\u51fa&#xff1a;:q!\u00a0\u2192 \u5f3a\u5236\u9000\u51fa&#xff0c;\u4e0d\u4fdd\u5b58\u3002<\/p>\n<\/li>\n<h4>1.3 \u5e38\u7528\u79fb\u52a8\u547d\u4ee4&#xff08;\u5728\u666e\u901a\u6a21\u5f0f\u4e0b&#xff09;<\/h4>\n<table>\n<tr>\u6309\u952e\u52a8\u4f5c<\/tr>\n<tbody>\n<tr>\n<td>h\u00a0\/\u00a0j\u00a0\/\u00a0k\u00a0\/\u00a0l<\/td>\n<td>\u5de6 \/ \u4e0b \/ \u4e0a \/ \u53f3&#xff08;\u66ff\u4ee3\u65b9\u5411\u952e&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>w\u00a0\/\u00a0b<\/td>\n<td>\u8df3\u5230\u4e0b\u4e00\u4e2a\u5355\u8bcd\u5f00\u5934 \/ \u4e0a\u4e00\u4e2a\u5355\u8bcd\u5f00\u5934<\/td>\n<\/tr>\n<tr>\n<td>0\u00a0\/\u00a0^\u00a0\/\u00a0$<\/td>\n<td>\u79fb\u5230\u884c\u9996 \/ \u7b2c\u4e00\u4e2a\u975e\u7a7a\u5b57\u7b26 \/ \u884c\u5c3e<\/td>\n<\/tr>\n<tr>\n<td>gg\u00a0\/\u00a0G<\/td>\n<td>\u8df3\u5230\u6587\u4ef6\u5f00\u5934 \/ \u6587\u4ef6\u672b\u5c3e<\/td>\n<\/tr>\n<tr>\n<td>Ctrl&#043;f\u00a0\/\u00a0Ctrl&#043;b<\/td>\n<td>\u5411\u4e0b\u7ffb\u9875 \/ \u5411\u4e0a\u7ffb\u9875<\/td>\n<\/tr>\n<tr>\n<td>:n\u00a0\u7136\u540e\u56de\u8f66<\/td>\n<td>\u8df3\u5230\u7b2c n \u884c<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>1.4 \u5e38\u7528\u7f16\u8f91\u547d\u4ee4&#xff08;\u666e\u901a\u6a21\u5f0f&#xff09;<\/h4>\n<table>\n<tr>\u547d\u4ee4\u4f5c\u7528<\/tr>\n<tbody>\n<tr>\n<td>x<\/td>\n<td>\u5220\u9664\u5149\u6807\u6240\u5728\u5b57\u7b26<\/td>\n<\/tr>\n<tr>\n<td>dd<\/td>\n<td>\u5220\u9664&#xff08;\u526a\u5207&#xff09;\u4e00\u884c<\/td>\n<\/tr>\n<tr>\n<td>yy<\/td>\n<td>\u590d\u5236\u4e00\u884c<\/td>\n<\/tr>\n<tr>\n<td>p<\/td>\n<td>\u7c98\u8d34\u5728\u5149\u6807\u540e<\/td>\n<\/tr>\n<tr>\n<td>u<\/td>\n<td>\u64a4\u9500<\/td>\n<\/tr>\n<tr>\n<td>Ctrl&#043;r<\/td>\n<td>\u91cd\u505a<\/td>\n<\/tr>\n<tr>\n<td>r\u00a0&#043; \u5b57\u7b26<\/td>\n<td>\u66ff\u6362\u5149\u6807\u6240\u5728\u5b57\u7b26<\/td>\n<\/tr>\n<tr>\n<td>&gt;&gt;\u00a0\/\u00a0&lt;&lt;<\/td>\n<td>\u589e\u52a0 \/ \u51cf\u5c11\u7f29\u8fdb<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>1.5 \u641c\u7d22\u4e0e\u66ff\u6362&#xff08;\u547d\u4ee4\u884c\u6a21\u5f0f&#xff09;<\/h4>\n<ul>\n<li>\n<p>\u641c\u7d22&#xff1a;\/\u5173\u952e\u8bcd\u00a0\u56de\u8f66&#xff0c;\u7136\u540e\u00a0n\u00a0\u4e0b\u4e00\u4e2a&#xff0c;N\u00a0\u4e0a\u4e00\u4e2a\u3002<\/p>\n<\/li>\n<li>\n<p>\u66ff\u6362&#xff1a;:s\/\u65e7\/\u65b0\/g\u00a0\u2192 \u66ff\u6362\u5f53\u524d\u884c\u6240\u6709\u3002<br \/>\n:%s\/\u65e7\/\u65b0\/g\u00a0\u2192 \u66ff\u6362\u5168\u6587\u4ef6\u6240\u6709\u3002<br \/>\n\u52a0\u4e0a\u00a0c\u00a0\u53ef\u4ee5\u786e\u8ba4&#xff0c;\u5982\u00a0:%s\/\u65e7\/\u65b0\/gc\u3002<\/p>\n<\/li>\n<\/ul>\n<h4>1.6 \u53ef\u89c6\u5316\u6a21\u5f0f&#xff08;\u591a\u9009&#xff09;<\/h4>\n<p>\u5728\u666e\u901a\u6a21\u5f0f\u4e0b\u6309\u00a0v\u00a0\u8fdb\u5165\u5b57\u7b26\u9009\u62e9&#xff0c;V\u00a0\u884c\u9009\u62e9&#xff0c;Ctrl&#043;v\u00a0\u5757\u9009\u62e9\u3002\u9009\u62e9\u540e\u53ef\u4ee5\u914d\u5408\u00a0d&#xff08;\u5220\u9664&#xff09;\u3001y&#xff08;\u590d\u5236&#xff09;\u3001&gt;&#xff08;\u7f29\u8fdb&#xff09;\u7b49\u3002<\/p>\n<h4>1.7 \u5206\u5c4f\u4e0e\u5207\u6362<\/h4>\n<ul>\n<li>\n<p>\u6c34\u5e73\u5206\u5c4f\u00a0:split \u6587\u4ef6\u540d\u00a0\u6216\u00a0:sp<\/p>\n<\/li>\n<li>\n<p>\u5782\u76f4\u5206\u5c4f\u00a0:vsplit \u6587\u4ef6\u540d\u00a0\u6216\u00a0:vsp<\/p>\n<\/li>\n<li>\n<p>\u5728\u7a97\u53e3\u95f4\u5207\u6362\u00a0Ctrl&#043;w\u00a0\u7136\u540e\u00a0h\/j\/k\/l<\/p>\n<\/li>\n<\/ul>\n<h4>1.8 \u914d\u7f6e Vim<\/h4>\n<p>\u5728\u4f60\u7684\u5bb6\u76ee\u5f55\u521b\u5efa\u00a0.vimrc\u00a0\u6587\u4ef6\u53ef\u4ee5\u4fdd\u5b58\u5e38\u7528\u8bbe\u7f6e&#xff1a;<\/p>\n<p>syntax on           &#034; \u8bed\u6cd5\u9ad8\u4eae<br \/>\nset number          &#034; \u663e\u793a\u884c\u53f7<br \/>\nset tabstop&#061;4       &#034; Tab \u5bbd\u5ea6\u4e3a4<br \/>\nset shiftwidth&#061;4    &#034; \u81ea\u52a8\u7f29\u8fdb\u5bbd\u5ea6<br \/>\nset expandtab       &#034; \u5c06 Tab \u8f6c\u4e3a\u7a7a\u683c<br \/>\nset autoindent      &#034; \u81ea\u52a8\u7f29\u8fdb<br \/>\nset mouse&#061;a         &#034; \u542f\u7528\u9f20\u6807<\/p>\n<p>\u6bcf\u6b21\u542f\u52a8 Vim \u90fd\u4f1a\u81ea\u52a8\u52a0\u8f7d\u8fd9\u4e9b\u914d\u7f6e\u3002<\/p>\n<hr \/>\n<h3>\u7b2c\u4e8c\u90e8\u5206&#xff1a;GCC \u2014\u2014 C\/C&#043;&#043; \u7f16\u8bd1\u5668<\/h3>\n<p>GCC&#xff08;GNU Compiler Collection&#xff09;\u662f Linux \u4e0b\u6700\u6807\u51c6\u7684 C \u548c C&#043;&#043; \u7f16\u8bd1\u5668\u3002\u6211\u4eec\u5e38\u5e38\u76f4\u63a5\u4f7f\u7528\u00a0g&#043;&#043;\u00a0\u547d\u4ee4\u6765\u7f16\u8bd1 C&#043;&#043; \u7a0b\u5e8f\u3002<\/p>\n<h4>2.1 \u4ece\u6e90\u7801\u5230\u53ef\u6267\u884c\u6587\u4ef6<\/h4>\n<p>\u4e00\u4e2a\u6700\u7b80\u5355\u7684\u7f16\u8bd1&#xff1a;<\/p>\n<p>g&#043;&#043; hello.cpp -o hello<\/p>\n<ul>\n<li>\n<p>hello.cpp&#xff1a;\u6e90\u6587\u4ef6\u3002<\/p>\n<\/li>\n<li>\n<p>-o hello&#xff1a;\u6307\u5b9a\u8f93\u51fa\u6587\u4ef6\u540d\u4e3a\u00a0hello&#xff0c;\u4e0d\u5199\u9ed8\u8ba4\u662f\u00a0a.out\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u5b9e\u9645\u4e0a\u7f16\u8bd1\u5206\u4e3a\u56db\u4e2a\u9636\u6bb5&#xff1a;\u9884\u5904\u7406\u3001\u7f16\u8bd1\u3001\u6c47\u7f16\u3001\u94fe\u63a5\u3002g&#043;&#043;\u00a0\u4e00\u6761\u547d\u4ee4\u8d70\u5b8c\u5168\u90e8\u3002<\/p>\n<h4>2.2 \u5e38\u7528\u7f16\u8bd1\u9009\u9879<\/h4>\n<table>\n<tr>\u9009\u9879\u8bf4\u660e<\/tr>\n<tbody>\n<tr>\n<td>-std&#061;c&#043;&#043;11<\/td>\n<td>\u6307\u5b9a C&#043;&#043; \u6807\u51c6&#xff0c;\u53ef\u7528 c&#043;&#043;14\u3001c&#043;&#043;17 \u7b49<\/td>\n<\/tr>\n<tr>\n<td>-Wall<\/td>\n<td>\u6253\u5f00\u51e0\u4e4e\u6240\u6709\u5e38\u7528\u8b66\u544a&#xff08;\u5f3a\u70c8\u5efa\u8bae&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>-Wextra<\/td>\n<td>\u989d\u5916\u8b66\u544a<\/td>\n<\/tr>\n<tr>\n<td>-Werror<\/td>\n<td>\u628a\u8b66\u544a\u5f53\u4f5c\u9519\u8bef\u5904\u7406<\/td>\n<\/tr>\n<tr>\n<td>-g<\/td>\n<td>\u751f\u6210\u8c03\u8bd5\u4fe1\u606f&#xff0c;\u914d\u5408 GDB \u4f7f\u7528<\/td>\n<\/tr>\n<tr>\n<td>-O0\u00a0\/\u00a0-O1\u00a0\/\u00a0-O2\u00a0\/\u00a0-O3<\/td>\n<td>\u4f18\u5316\u7ea7\u522b&#xff0c;0 \u4e0d\u4f18\u5316&#xff0c;3 \u6fc0\u8fdb\u4f18\u5316<\/td>\n<\/tr>\n<tr>\n<td>-I \u76ee\u5f55<\/td>\n<td>\u6dfb\u52a0\u5934\u6587\u4ef6\u641c\u7d22\u8def\u5f84<\/td>\n<\/tr>\n<tr>\n<td>-L \u76ee\u5f55<\/td>\n<td>\u6dfb\u52a0\u5e93\u6587\u4ef6\u641c\u7d22\u8def\u5f84<\/td>\n<\/tr>\n<tr>\n<td>-l \u5e93\u540d<\/td>\n<td>\u94fe\u63a5\u67d0\u4e2a\u5e93&#xff0c;\u5982\u00a0-lpthread&#xff08;pthread \u5e93&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>-c<\/td>\n<td>\u53ea\u7f16\u8bd1\u4e0d\u94fe\u63a5&#xff0c;\u751f\u6210\u00a0.o\u00a0\u76ee\u6807\u6587\u4ef6<\/td>\n<\/tr>\n<tr>\n<td>-D \u5b8f<\/td>\n<td>\u5b9a\u4e49\u5b8f&#xff0c;\u5982\u00a0-DDEBUG<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u793a\u4f8b&#xff1a;\u5f00\u542f\u6240\u6709\u8b66\u544a\u3001\u4f7f\u7528 C&#043;&#043;17\u3001\u8c03\u8bd5\u6a21\u5f0f\u3001\u4f18\u5316 O2<\/p>\n<p>g&#043;&#043; -std&#061;c&#043;&#043;17 -Wall -Wextra -Werror -g -O2 main.cpp -o main<\/p>\n<h4>2.3 \u591a\u6587\u4ef6\u7f16\u8bd1<\/h4>\n<p>\u5047\u5982\u9879\u76ee\u6709\u00a0main.cpp\u3001utils.cpp\u3001utils.h&#xff1a;<\/p>\n<p># \u4e00\u8d77\u7f16\u8bd1<br \/>\ng&#043;&#043; main.cpp utils.cpp -o myapp<\/p>\n<p>\u66f4\u89c4\u8303\u7684\u65b9\u5f0f&#xff1a;\u5148\u7f16\u8bd1\u6bcf\u4e2a\u00a0.cpp\u00a0\u6210\u00a0.o&#xff0c;\u518d\u94fe\u63a5&#xff1a;<\/p>\n<p>g&#043;&#043; -c main.cpp -o main.o<br \/>\ng&#043;&#043; -c utils.cpp -o utils.o<br \/>\ng&#043;&#043; main.o utils.o -o myapp<\/p>\n<p>\u4e3a\u4ec0\u4e48\u8fd9\u6837&#xff1f;\u56e0\u4e3a\u5f53\u4f60\u53ea\u4fee\u6539\u4e86\u00a0main.cpp\u00a0\u65f6&#xff0c;\u53ea\u9700\u8981\u91cd\u65b0\u7f16\u8bd1\u00a0main.o\u00a0\u518d\u94fe\u63a5&#xff0c;\u800c\u65e0\u9700\u91cd\u65b0\u7f16\u8bd1\u00a0utils.cpp&#xff0c;\u8fd9\u5728\u5927\u578b\u9879\u76ee\u4e2d\u80fd\u8282\u7701\u5927\u91cf\u65f6\u95f4\u3002\u901a\u5e38\u914d\u5408\u00a0Makefile\u00a0\u4f7f\u7528\u3002<\/p>\n<h4>2.4 \u751f\u6210\u548c\u4f7f\u7528\u9759\u6001\u5e93 \/ \u52a8\u6001\u5e93<\/h4>\n<p>\u9759\u6001\u5e93&#xff08;.a&#xff09;&#xff1a;<\/p>\n<p>g&#043;&#043; -c utils.cpp -o utils.o<br \/>\nar rcs libutils.a utils.o        # \u521b\u5efa\u9759\u6001\u5e93<br \/>\ng&#043;&#043; main.cpp -L. -lutils -o myapp  # -L. \u5f53\u524d\u76ee\u5f55 -lutils \u94fe\u63a5 libutils.a<\/p>\n<p>\u52a8\u6001\u5e93&#xff08;.so&#xff09;&#xff1a;<\/p>\n<p>g&#043;&#043; -fPIC -c utils.cpp -o utils.o<br \/>\ng&#043;&#043; -shared utils.o -o libutils.so<br \/>\ng&#043;&#043; main.cpp -L. -lutils -o myapp<br \/>\nexport LD_LIBRARY_PATH&#061;.:$LD_LIBRARY_PATH  # \u8fd0\u884c\u524d\u52a0\u5165\u5e93\u8def\u5f84<br \/>\n.\/myapp<\/p>\n<hr \/>\n<h3>\u7b2c\u4e09\u90e8\u5206&#xff1a;GDB \u2014\u2014 GNU \u8c03\u8bd5\u5668<\/h3>\n<p>GDB \u662f\u4e00\u4e2a\u547d\u4ee4\u884c\u7684\u8c03\u8bd5\u5668&#xff0c;\u53ef\u4ee5\u7528\u6765\u8bbe\u7f6e\u65ad\u70b9\u3001\u5355\u6b65\u6267\u884c\u3001\u67e5\u770b\u53d8\u91cf\u503c\u3001\u5206\u6790\u5d29\u6e83\u539f\u56e0\u7b49\u3002\u638c\u63e1\u5b83&#xff0c;\u4f60\u5c31\u4e0d\u5fc5\u518d\u9760\u6ee1\u5c4f\u7684\u00a0cout\u00a0\u6765\u5b9a\u4f4d\u9519\u8bef\u4e86\u3002<\/p>\n<h4>3.1 \u7528\u8c03\u8bd5\u4fe1\u606f\u7f16\u8bd1<\/h4>\n<p>\u5fc5\u987b\u4f7f\u7528\u00a0-g\u00a0\u9009\u9879\u7f16\u8bd1&#xff0c;\u4e14\u5efa\u8bae\u5173\u95ed\u4f18\u5316&#xff08;-O0&#xff09;&#xff0c;\u5426\u5219\u53d8\u91cf\u53ef\u80fd\u88ab\u4f18\u5316\u6389\u6216\u4e71\u5e8f\u6267\u884c\u3002<\/p>\n<p>g&#043;&#043; -g -O0 main.cpp -o main<\/p>\n<h4>3.2 \u542f\u52a8 GDB<\/h4>\n<p>gdb .\/main<\/p>\n<p>\u4f60\u5c06\u8fdb\u5165\u00a0(gdb)\u00a0\u63d0\u793a\u7b26\u3002\u4e0b\u9762\u662f\u6838\u5fc3\u547d\u4ee4\u4e00\u89c8\u3002<\/p>\n<h4>3.3 \u6838\u5fc3\u547d\u4ee4<\/h4>\n<table>\n<tr>\u547d\u4ee4\u7b80\u5199\u529f\u80fd<\/tr>\n<tbody>\n<tr>\n<td>run<\/td>\n<td>r<\/td>\n<td>\u5f00\u59cb\u8fd0\u884c\u7a0b\u5e8f&#xff08;\u53ef\u5e26\u53c2\u6570&#xff0c;\u5982\u00a0run arg1 arg2&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>break \u51fd\u6570\u540d<\/td>\n<td>b main<\/td>\n<td>\u5728\u51fd\u6570\u5165\u53e3\u8bbe\u7f6e\u65ad\u70b9<\/td>\n<\/tr>\n<tr>\n<td>break \u884c\u53f7<\/td>\n<td>b 10<\/td>\n<td>\u5728\u7b2c10\u884c\u8bbe\u7f6e\u65ad\u70b9<\/td>\n<\/tr>\n<tr>\n<td>break \u6587\u4ef6\u540d:\u884c\u53f7<\/td>\n<td>b utils.cpp:5<\/td>\n<td>\u5728\u6307\u5b9a\u6587\u4ef6\u7684\u67d0\u884c\u8bbe\u65ad\u70b9<\/td>\n<\/tr>\n<tr>\n<td>info breakpoints<\/td>\n<td>i b<\/td>\n<td>\u67e5\u770b\u6240\u6709\u65ad\u70b9<\/td>\n<\/tr>\n<tr>\n<td>delete \u65ad\u70b9\u53f7<\/td>\n<td>d 1<\/td>\n<td>\u5220\u96641\u53f7\u65ad\u70b9<\/td>\n<\/tr>\n<tr>\n<td>continue<\/td>\n<td>c<\/td>\n<td>\u7ee7\u7eed\u6267\u884c\u5230\u4e0b\u4e00\u4e2a\u65ad\u70b9<\/td>\n<\/tr>\n<tr>\n<td>step<\/td>\n<td>s<\/td>\n<td>\u5355\u6b65\u6267\u884c&#xff0c;\u4f1a\u8fdb\u5165\u51fd\u6570\u5185\u90e8<\/td>\n<\/tr>\n<tr>\n<td>next<\/td>\n<td>n<\/td>\n<td>\u5355\u6b65\u6267\u884c&#xff0c;\u4e0d\u8fdb\u5165\u51fd\u6570\u5185\u90e8&#xff08;\u8df3\u8fc7\u51fd\u6570&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>finish<\/td>\n<td>fin<\/td>\n<td>\u6267\u884c\u5b8c\u5f53\u524d\u51fd\u6570\u5e76\u8fd4\u56de<\/td>\n<\/tr>\n<tr>\n<td>print \u8868\u8fbe\u5f0f<\/td>\n<td>p x<\/td>\n<td>\u6253\u5370\u53d8\u91cf x \u7684\u503c<\/td>\n<\/tr>\n<tr>\n<td>print *\u6307\u9488<\/td>\n<td>p *ptr<\/td>\n<td>\u6253\u5370\u6307\u9488\u6307\u5411\u7684\u5bf9\u8c61<\/td>\n<\/tr>\n<tr>\n<td>display \u8868\u8fbe\u5f0f<\/td>\n<td>disp x<\/td>\n<td>\u6bcf\u6b21\u5355\u6b65\u90fd\u81ea\u52a8\u663e\u793a x \u7684\u503c<\/td>\n<\/tr>\n<tr>\n<td>list<\/td>\n<td>l<\/td>\n<td>\u663e\u793a\u5f53\u524d\u4f4d\u7f6e\u5468\u56f4\u7684\u6e90\u4ee3\u7801<\/td>\n<\/tr>\n<tr>\n<td>backtrace<\/td>\n<td>bt<\/td>\n<td>\u663e\u793a\u51fd\u6570\u8c03\u7528\u6808&#xff08;\u5d29\u6e83\u65f6\u5fc5\u5907&#xff09;<\/td>\n<\/tr>\n<tr>\n<td>frame \u7f16\u53f7<\/td>\n<td>f 0<\/td>\n<td>\u5207\u6362\u5230\u8c03\u7528\u6808\u4e2d\u7684\u67d0\u4e00\u5c42<\/td>\n<\/tr>\n<tr>\n<td>quit<\/td>\n<td>q<\/td>\n<td>\u9000\u51fa GDB<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>3.4 \u5b9e\u6218\u793a\u4f8b<\/h4>\n<p>\u5047\u8bbe\u6709\u4ee5\u4e0b\u7a0b\u5e8f\u00a0fact.cpp&#xff1a;<\/p>\n<p>#include &lt;iostream&gt;<br \/>\nint factorial(int n) {<br \/>\n    if (n &#061;&#061; 0) return 1;<br \/>\n    return n * factorial(n &#8211; 1);<br \/>\n}<br \/>\nint main() {<br \/>\n    int result &#061; factorial(5);<br \/>\n    std::cout &lt;&lt; result &lt;&lt; std::endl;<br \/>\n    return 0;<br \/>\n}<\/p>\n<p>\u7f16\u8bd1\u5e76\u8c03\u8bd5&#xff1a;<\/p>\n<p>g&#043;&#043; -g -O0 fact.cpp -o fact<br \/>\ngdb .\/fact<\/p>\n<p>\u5728 GDB \u4e2d&#xff1a;<\/p>\n<p>(gdb) break main          \/\/ \u5728 main \u5165\u53e3\u65ad\u70b9<br \/>\n(gdb) run                 \/\/ \u8fd0\u884c&#xff0c;\u505c\u5728 main<br \/>\n(gdb) step                \/\/ \u5355\u6b65&#xff0c;\u4f1a\u8fdb\u5165 factorial \u51fd\u6570<br \/>\n(gdb) print n             \/\/ \u6253\u5370\u53c2\u6570 n \u7684\u503c<br \/>\n(gdb) backtrace           \/\/ \u67e5\u770b\u8c03\u7528\u6808<br \/>\n(gdb) continue            \/\/ \u7ee7\u7eed\u6267\u884c<br \/>\n(gdb) quit                \/\/ \u9000\u51fa<\/p>\n<h4>3.5 \u8c03\u8bd5\u5df2\u5d29\u6e83\u7684\u7a0b\u5e8f&#xff08;core dump&#xff09;<\/h4>\n<p>\u5f53\u7a0b\u5e8f\u5d29\u6e83&#xff08;\u6bb5\u9519\u8bef\u7b49&#xff09;&#xff0c;\u53ef\u4ee5\u5f00\u542f core dump \u751f\u6210&#xff0c;\u7136\u540e\u4e8b\u540e\u8c03\u8bd5\u3002<\/p>\n<p>\u5f00\u542f core dump&#xff08;ulimit&#xff09;&#xff1a;<\/p>\n<p>ulimit -c unlimited<\/p>\n<p>\u8fd0\u884c\u7a0b\u5e8f\u5d29\u6e83\u540e&#xff0c;\u4f1a\u751f\u6210\u00a0core\u00a0\u6587\u4ef6&#xff0c;\u7136\u540e&#xff1a;<\/p>\n<p>gdb .\/main core<br \/>\n(gdb) bt   # \u76f4\u63a5\u67e5\u770b\u5d29\u6e83\u65f6\u7684\u8c03\u7528\u6808&#xff0c;\u975e\u5e38\u9ad8\u6548<\/p>\n<hr \/>\n<h3>\u7b2c\u56db\u90e8\u5206&#xff1a;\u4e09\u8005\u914d\u5408\u7684\u7ecf\u5178\u5de5\u4f5c\u6d41<\/h3>\n<p>\u4e00\u4e2a\u5178\u578b\u7684 C&#043;&#043; \u5f00\u53d1\u6d41\u7a0b&#xff1a;<\/p>\n<li>\n<p>\u4f7f\u7528\u00a0Vim\u00a0\u7f16\u5199\u6e90\u4ee3\u7801&#xff0c;vim main.cpp\u3002<\/p>\n<\/li>\n<li>\n<p>\u7f16\u8bd1\u5e76\u5f00\u542f\u8b66\u544a\u548c\u8c03\u8bd5\u4fe1\u606f&#xff1a;g&#043;&#043; -std&#061;c&#043;&#043;17 -Wall -g -O0 main.cpp -o main\u3002<\/p>\n<\/li>\n<li>\n<p>\u8fd0\u884c&#xff1a;.\/main\u3002<\/p>\n<\/li>\n<li>\n<p>\u5982\u679c\u6709\u6bb5\u9519\u8bef\u6216\u903b\u8f91\u9519\u8bef&#xff0c;\u542f\u52a8\u00a0GDB&#xff1a;gdb .\/main&#xff0c;\u8bbe\u65ad\u70b9&#xff0c;\u8fd0\u884c&#xff0c;\u5355\u6b65&#xff0c;\u67e5\u770b\u53d8\u91cf\u3002<\/p>\n<\/li>\n<li>\n<p>\u4fee\u6539\u4ee3\u7801&#xff0c;\u91cd\u590d\u4ee5\u4e0a\u3002<\/p>\n<\/li>\n<p>\u719f\u7ec3\u4e4b\u540e&#xff0c;\u518d\u52a0\u4e0a\u00a0Makefile\u00a0\u6216&#xff0c;\u5c31\u80fd\u5f62\u6210\u4e00\u5957\u8f7b\u91cf\u3001\u5168\u80fd\u7684 Linux \u5f00\u53d1\u73af\u5883\u3002<\/p>\n<hr \/>\n<h3>\u5c0f\u7ed3<\/h3>\n<ul>\n<li>\n<p>Vim&#xff1a;\u591a\u6a21\u5f0f\u7f16\u8f91\u5668&#xff0c;\u638c\u63e1\u57fa\u672c\u79fb\u52a8\u3001\u7f16\u8f91\u3001\u4fdd\u5b58\u9000\u51fa&#xff0c;\u7136\u540e\u9010\u6b65\u5b66\u4e60\u9ad8\u7ea7\u547d\u4ee4\u3002<\/p>\n<\/li>\n<li>\n<p>GCC&#xff1a;\u7f16\u8bd1\u9a71\u52a8&#xff0c;\u5e38\u7528\u9009\u9879\u00a0-std\u3001-Wall\u3001-g\u3001-O&#xff0c;\u7406\u89e3\u591a\u6587\u4ef6\u7f16\u8bd1\u548c\u5e93\u94fe\u63a5\u3002<\/p>\n<\/li>\n<li>\n<p>GDB&#xff1a;\u547d\u4ee4\u884c\u8c03\u8bd5\u5668&#xff0c;\u6838\u5fc3\u662f\u65ad\u70b9&#xff08;break&#xff09;\u3001\u8fd0\u884c&#xff08;run&#xff09;\u3001\u67e5\u770b&#xff08;print&#xff09;\u3001\u5355\u6b65&#xff08;next\/step&#xff09;\u548c\u8c03\u7528\u6808&#xff08;bt&#xff09;\u3002<\/p>\n<\/li>\n<\/ul>\n<p>\u8fd9\u4e09\u4e2a\u5de5\u5177\u662f Linux \u7f16\u7a0b\u7684\u57fa\u77f3&#xff0c;\u4e5f\u8bb8\u4e00\u5f00\u59cb\u4f1a\u611f\u89c9\u547d\u4ee4\u884c\u4e0d\u591f\u53cb\u597d&#xff0c;\u4f46\u5f53\u4f60\u6295\u5165\u65f6\u95f4\u53bb\u719f\u7ec3&#xff0c;\u5b83\u4eec\u4f1a\u56de\u62a5\u4f60\u4ee5\u6781\u81f4\u7684\u63a7\u5236\u529b\u548c\u7075\u6d3b\u6027\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e4b\u524d\u6211\u5199\u4e86\u5f88\u591a C \u8bed\u8a00\u548c\u6570\u636e\u7ed3\u6784\u7684\u77e5\u8bc6&#xff0c;\u4e5f\u5199\u8fc7\u00a0Linux \u7684\u6587\u4ef6\u6743\u9650\u3002\u4eca\u5929&#xff0c;\u6211\u8981\u628a\u76ee\u5149\u6295\u5411\u7a0b\u5e8f\u5458\u7684\u4e09\u4e2a\u6838\u5fc3\u5de5\u5177&#xff1a;\u7f16\u8f91\u5668\u3001\u7f16\u8bd1\u5668\u548c\u8c03\u8bd5\u5668\u3002\u5728 Linux \u4e16\u754c\u91cc&#xff0c;\u6700\u7ecf\u5178\u7684\u7ec4\u5408\u5c31\u662f\u00a0Vim\u3001GCC \u548c GDB\u3002\u65e0\u8bba\u662f\u521a\u63a5\u89e6 Linux \u5f00\u53d1&#xff0c;\u8fd8\u662f\u60f3\u4ece IDE \u8f6c\u5411\u66f4\u8f7b\u91cf\u3001\u66f4\u7075\u6d3b\u7684\u547d\u4ee4\u884c\u5f00\u53d1\u73af\u5883&#xff0c;\u8fd9\u4e09\u4e2a\u5de5\u5177\u90fd\u503c\u5f97\u82b1\u65f6\u95f4\u719f\u7ec3\u3002\u5b83\u4eec\u867d\u7136\u9700\u8981\u4e00\u5b9a\u7684\u5b66\u4e60\u66f2\u7ebf&#xff0c;\u4f46\u5e26\u6765\u7684\u6548\u7387\u63d0\u5347\u4f1a\u662f\u51e0\u4f55\u7ea7\u7684\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[55,58,1802,190],"topic":[],"class_list":["post-88329","post","type-post","status-publish","format-standard","hentry","category-server","tag-c","tag-linux","tag-vim","tag-190"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Linux\u5f00\u53d1\u5fc5\u5907\uff1aVim\u3001GCC\u548cGDB\u9ad8\u6548\u4e09\u4ef6\u5957 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/88329.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux\u5f00\u53d1\u5fc5\u5907\uff1aVim\u3001GCC\u548cGDB\u9ad8\u6548\u4e09\u4ef6\u5957 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u4e4b\u524d\u6211\u5199\u4e86\u5f88\u591a C \u8bed\u8a00\u548c\u6570\u636e\u7ed3\u6784\u7684\u77e5\u8bc6&#xff0c;\u4e5f\u5199\u8fc7\u00a0Linux \u7684\u6587\u4ef6\u6743\u9650\u3002\u4eca\u5929&#xff0c;\u6211\u8981\u628a\u76ee\u5149\u6295\u5411\u7a0b\u5e8f\u5458\u7684\u4e09\u4e2a\u6838\u5fc3\u5de5\u5177&#xff1a;\u7f16\u8f91\u5668\u3001\u7f16\u8bd1\u5668\u548c\u8c03\u8bd5\u5668\u3002\u5728 Linux \u4e16\u754c\u91cc&#xff0c;\u6700\u7ecf\u5178\u7684\u7ec4\u5408\u5c31\u662f\u00a0Vim\u3001GCC \u548c GDB\u3002\u65e0\u8bba\u662f\u521a\u63a5\u89e6 Linux \u5f00\u53d1&#xff0c;\u8fd8\u662f\u60f3\u4ece IDE \u8f6c\u5411\u66f4\u8f7b\u91cf\u3001\u66f4\u7075\u6d3b\u7684\u547d\u4ee4\u884c\u5f00\u53d1\u73af\u5883&#xff0c;\u8fd9\u4e09\u4e2a\u5de5\u5177\u90fd\u503c\u5f97\u82b1\u65f6\u95f4\u719f\u7ec3\u3002\u5b83\u4eec\u867d\u7136\u9700\u8981\u4e00\u5b9a\u7684\u5b66\u4e60\u66f2\u7ebf&#xff0c;\u4f46\u5e26\u6765\u7684\u6548\u7387\u63d0\u5347\u4f1a\u662f\u51e0\u4f55\u7ea7\u7684\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/88329.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-31T14:48:28+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/88329.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/88329.html\",\"name\":\"Linux\u5f00\u53d1\u5fc5\u5907\uff1aVim\u3001GCC\u548cGDB\u9ad8\u6548\u4e09\u4ef6\u5957 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-31T14:48:28+00:00\",\"dateModified\":\"2026-07-31T14:48:28+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/88329.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/88329.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/88329.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux\u5f00\u53d1\u5fc5\u5907\uff1aVim\u3001GCC\u548cGDB\u9ad8\u6548\u4e09\u4ef6\u5957\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linux\u5f00\u53d1\u5fc5\u5907\uff1aVim\u3001GCC\u548cGDB\u9ad8\u6548\u4e09\u4ef6\u5957 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/88329.html","og_locale":"zh_CN","og_type":"article","og_title":"Linux\u5f00\u53d1\u5fc5\u5907\uff1aVim\u3001GCC\u548cGDB\u9ad8\u6548\u4e09\u4ef6\u5957 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u4e4b\u524d\u6211\u5199\u4e86\u5f88\u591a C \u8bed\u8a00\u548c\u6570\u636e\u7ed3\u6784\u7684\u77e5\u8bc6&#xff0c;\u4e5f\u5199\u8fc7\u00a0Linux \u7684\u6587\u4ef6\u6743\u9650\u3002\u4eca\u5929&#xff0c;\u6211\u8981\u628a\u76ee\u5149\u6295\u5411\u7a0b\u5e8f\u5458\u7684\u4e09\u4e2a\u6838\u5fc3\u5de5\u5177&#xff1a;\u7f16\u8f91\u5668\u3001\u7f16\u8bd1\u5668\u548c\u8c03\u8bd5\u5668\u3002\u5728 Linux \u4e16\u754c\u91cc&#xff0c;\u6700\u7ecf\u5178\u7684\u7ec4\u5408\u5c31\u662f\u00a0Vim\u3001GCC \u548c GDB\u3002\u65e0\u8bba\u662f\u521a\u63a5\u89e6 Linux \u5f00\u53d1&#xff0c;\u8fd8\u662f\u60f3\u4ece IDE \u8f6c\u5411\u66f4\u8f7b\u91cf\u3001\u66f4\u7075\u6d3b\u7684\u547d\u4ee4\u884c\u5f00\u53d1\u73af\u5883&#xff0c;\u8fd9\u4e09\u4e2a\u5de5\u5177\u90fd\u503c\u5f97\u82b1\u65f6\u95f4\u719f\u7ec3\u3002\u5b83\u4eec\u867d\u7136\u9700\u8981\u4e00\u5b9a\u7684\u5b66\u4e60\u66f2\u7ebf&#xff0c;\u4f46\u5e26\u6765\u7684\u6548\u7387\u63d0\u5347\u4f1a\u662f\u51e0\u4f55\u7ea7\u7684\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/88329.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-31T14:48:28+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/88329.html","url":"https:\/\/www.wsisp.com\/helps\/88329.html","name":"Linux\u5f00\u53d1\u5fc5\u5907\uff1aVim\u3001GCC\u548cGDB\u9ad8\u6548\u4e09\u4ef6\u5957 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-31T14:48:28+00:00","dateModified":"2026-07-31T14:48:28+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/88329.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/88329.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/88329.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Linux\u5f00\u53d1\u5fc5\u5907\uff1aVim\u3001GCC\u548cGDB\u9ad8\u6548\u4e09\u4ef6\u5957"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/88329","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=88329"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/88329\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=88329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=88329"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=88329"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=88329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}