{"id":725,"date":"2017-11-30T16:26:10","date_gmt":"2017-11-30T08:26:10","guid":{"rendered":"https:\/\/damogame.cn:15443\/?p=725"},"modified":"2017-11-30T16:26:10","modified_gmt":"2017-11-30T08:26:10","slug":"gdb%e8%b0%83%e8%af%95%e5%91%bd%e4%bb%a4%e7%9a%84%e4%bd%bf%e7%94%a8%e5%8f%8a%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"https:\/\/i007.cc\/wordpress\/archives\/725","title":{"rendered":"gdb\u8c03\u8bd5\u547d\u4ee4\u7684\u4f7f\u7528\u53ca\u603b\u7ed3"},"content":{"rendered":"<div class=\"title\">\n<p>\u4f5c\u8005\uff1a \u5b57\u4f53\uff1a[<a>\u589e\u52a0<\/a>\u00a0<a>\u51cf\u5c0f<\/a>] \u7c7b\u578b\uff1a\u8f6c\u8f7d \u65f6\u95f4\uff1a2013-05-04<a href=\"http:\/\/www.jb51.net\/article\/36393.htm#comments\">\u00a0\u6211\u8981\u8bc4\u8bba<\/a><\/p>\n<\/div>\n<div class=\"art_desc mt10\">\n<div id=\"art_demo\">gdb\u662f\u4e00\u4e2a\u5728UNIX\u73af\u5883\u4e0b\u7684\u547d\u4ee4\u884c\u8c03\u8bd5\u5de5\u5177\u3002\u5982\u679c\u9700\u8981\u4f7f\u7528gdb\u8c03\u8bd5\u7a0b\u5e8f\uff0c\u8bf7\u5728gcc\u65f6\u52a0\u4e0a-g\u9009\u9879\u3002\u4e0b\u9762\u7684\u547d\u4ee4\u90e8\u5206\u662f\u7b80\u5316\u7248\uff0c\u6bd4\u5982\u4f7f\u7528l\u4ee3\u66fflist\u7b49\u7b49<\/div>\n<\/div>\n<div class=\"lbd clearfix\">\n<div id=\"_ddcsea2m61j\">\n<div id=\"hbacxd\">\n<div><abbr><\/abbr><iframe loading=\"lazy\" src=\"http:\/\/pos.baidu.com\/s?hei=100&amp;wid=680&amp;di=u2866688&amp;ltu=http%3A%2F%2Fwww.jb51.net%2Farticle%2F36393.htm&amp;chi=1&amp;pcs=1731x852&amp;pss=1731x8214&amp;psr=1920x1080&amp;ps=954x370&amp;ari=2&amp;cja=false&amp;dc=2&amp;dai=1&amp;dtm=HTML_POST&amp;ant=0&amp;tcn=1512030250&amp;dri=0&amp;ltr=https%3A%2F%2Fwww.baidu.com%2Flink%3Furl%3DRmTqS5acwhDJ0-5uUd6eMhSkBCLFmxUUQmgSYBXUiqrs4X8LOdFGmACS3Jw9cx9L%26wd%3D%26eqid%3D84aaf1830000ecef000000045a1fa8f7&amp;cmi=5&amp;tlm=1512030250&amp;dis=0&amp;drs=1&amp;cdo=-1&amp;cec=GBK&amp;cce=true&amp;ti=gdb%E8%B0%83%E8%AF%95%E5%91%BD%E4%BB%A4%E7%9A%84%E4%BD%BF%E7%94%A8%E5%8F%8A%E6%80%BB%E7%BB%93_C%20%E8%AF%AD%E8%A8%80_%E8%84%9A%E6%9C%AC%E4%B9%8B%E5%AE%B6&amp;cfv=0&amp;col=zh-CN&amp;par=1920x1028&amp;pis=-1x-1&amp;tpr=1512030250301&amp;cpl=4&amp;exps=111000&amp;ccd=24\" width=\"680\" height=\"100\" frameborder=\"0\" scrolling=\"no\" data-mce-fragment=\"1\"><\/iframe><\/div>\n<\/div>\n<\/div>\n<\/div>\n<div id=\"content\">\n<p><strong>1.\u57fa\u672c\u547d\u4ee4<\/strong><\/p>\n<p>1\uff09\u8fdb\u5165GDB\u3000\u3000#gdb test<\/p>\n<p>test\u662f\u8981\u8c03\u8bd5\u7684\u7a0b\u5e8f\uff0c\u7531gcc test.c -g -o test\u751f\u6210\u3002\u8fdb\u5165\u540e\u63d0\u793a\u7b26\u53d8\u4e3a(gdb) \u3002<\/p>\n<p>2\uff09\u67e5\u770b\u6e90\u7801\u3000\u3000(gdb) l<\/p>\n<p>\u6e90\u7801\u4f1a\u8fdb\u884c\u884c\u53f7\u63d0\u793a\u3002<\/p>\n<p>\u5982\u679c\u9700\u8981\u67e5\u770b\u5728\u5176\u4ed6\u6587\u4ef6\u4e2d\u5b9a\u4e49\u7684\u51fd\u6570\uff0c\u5728l\u540e\u52a0\u4e0a\u51fd\u6570\u540d\u5373\u53ef\u5b9a\u4f4d\u5230\u8fd9\u4e2a\u51fd\u6570\u7684\u5b9a\u4e49\u53ca\u67e5\u770b\u9644\u8fd1\u7684\u5176\u4ed6\u6e90\u7801\u3002\u6216\u8005\uff1a\u4f7f\u7528\u65ad\u70b9\u6216\u5355\u6b65\u8fd0\u884c\uff0c\u5230\u67d0\u4e2a\u51fd\u6570\u5904\u4f7f\u7528s\u8fdb\u5165\u8fd9\u4e2a\u51fd\u6570\u3002<\/p>\n<p>3\uff09\u8bbe\u7f6e\u65ad\u70b9\u3000\u3000(gdb) b 6<\/p>\n<p>\u8fd9\u6837\u4f1a\u5728\u8fd0\u884c\u5230\u6e90\u7801\u7b2c6\u884c\u65f6\u505c\u6b62\uff0c\u53ef\u4ee5\u67e5\u770b\u53d8\u91cf\u7684\u503c\u3001\u5806\u6808\u60c5\u51b5\u7b49\uff1b\u8fd9\u4e2a\u884c\u53f7\u662fgdb\u7684\u884c\u53f7\u3002<\/p>\n<p>4\uff09\u67e5\u770b\u65ad\u70b9\u5904\u60c5\u51b5\u3000\u3000(gdb)\u00a0info b<\/p>\n<p>\u53ef\u4ee5\u952e\u5165&#8221;info b&#8221;\u6765\u67e5\u770b\u65ad\u70b9\u5904\u60c5\u51b5\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u591a\u4e2a\u65ad\u70b9\uff1b<\/p>\n<p>5\uff09\u8fd0\u884c\u4ee3\u7801\u3000\u3000(gdb)\u00a0r<\/p>\n<p>6\uff09\u663e\u793a\u53d8\u91cf\u503c\u3000\u3000(gdb)\u00a0p n<\/p>\n<p>\u5728\u7a0b\u5e8f\u6682\u505c\u65f6\uff0c\u952e\u5165&#8221;p \u53d8\u91cf\u540d&#8221;(print)\u5373\u53ef\uff1b<\/p>\n<p>GDB\u5728\u663e\u793a\u53d8\u91cf\u503c\u65f6\u90fd\u4f1a\u5728\u5bf9\u5e94\u503c\u4e4b\u524d\u52a0\u4e0a&#8221;$N&#8221;\u6807\u8bb0\uff0c\u5b83\u662f\u5f53\u524d\u53d8\u91cf\u503c\u7684\u5f15\u7528\u6807\u8bb0\uff0c\u4ee5\u540e\u82e5\u60f3\u518d\u6b21\u5f15\u7528\u6b64\u53d8\u91cf\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5\u5199\u4f5c&#8221;$N&#8221;\uff0c\u800c\u65e0\u9700\u5199\u5197\u957f\u7684\u53d8\u91cf\u540d\uff1b<\/p>\n<p>7\uff09\u89c2\u5bdf\u53d8\u91cf\u3000\u3000(gdb)\u00a0watch n<\/p>\n<p>\u5728\u67d0\u4e00\u5faa\u73af\u5904\uff0c\u5f80\u5f80\u5e0c\u671b\u80fd\u591f\u89c2\u5bdf\u4e00\u4e2a\u53d8\u91cf\u7684\u53d8\u5316\u60c5\u51b5\uff0c\u8fd9\u65f6\u5c31\u53ef\u4ee5\u952e\u5165\u547d\u4ee4&#8221;watch&#8221;\u6765\u89c2\u5bdf\u53d8\u91cf\u7684\u53d8\u5316\u60c5\u51b5\uff0cGDB\u5728&#8221;n&#8221;\u8bbe\u7f6e\u4e86\u89c2\u5bdf\u70b9\uff1b<\/p>\n<p>8\uff09\u5355\u6b65\u8fd0\u884c\u3000\u3000(gdb)\u00a0n<\/p>\n<p>9\uff09\u7a0b\u5e8f\u7ee7\u7eed\u8fd0\u884c\u3000\u3000(gdb)\u00a0c<\/p>\n<p>\u4f7f\u7a0b\u5e8f\u7ee7\u7eed\u5f80\u4e0b\u8fd0\u884c\uff0c\u76f4\u5230\u518d\u6b21\u9047\u5230\u65ad\u70b9\u6216\u7a0b\u5e8f\u7ed3\u675f\uff1b<\/p>\n<p>10\uff09\u9000\u51faGDB\u3000\u3000(gdb)\u00a0q<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>2.\u65ad\u70b9\u8c03\u8bd5<\/strong><\/h2>\n<p>\u547d\u4ee4\u683c\u5f0f\u3000\u3000\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u4f8b\u5b50\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u3000\u3000\u3000\u3000\u3000\u3000\u4f5c\u7528<\/p>\n<p>break + \u8bbe\u7f6e\u65ad\u70b9\u7684\u884c\u53f7\u3000\u3000break n\u3000\u3000\u3000\u3000\u3000\u3000\u5728n\u884c\u5904\u8bbe\u7f6e\u65ad\u70b9<\/p>\n<p>tbreak + \u884c\u53f7\u6216\u51fd\u6570\u540d\u3000\u3000tbreak n\/func\u3000\u3000\u3000\u3000\u8bbe\u7f6e\u4e34\u65f6\u65ad\u70b9\uff0c\u5230\u8fbe\u540e\u88ab\u81ea\u52a8\u5220\u9664<\/p>\n<p>break + filename + \u884c\u53f7\u3000\u3000break main.c:10\u3000\u3000\u7528\u4e8e\u5728\u6307\u5b9a\u6587\u4ef6\u5bf9\u5e94\u884c\u8bbe\u7f6e\u65ad\u70b9<\/p>\n<p>break + &lt;0x&#8230;&gt;\u3000\u3000break 0x3400a\u3000\u3000\u3000\u3000\u3000\u3000\u7528\u4e8e\u5728\u5185\u5b58\u67d0\u4e00\u4f4d\u7f6e\u5904\u6682\u505c<\/p>\n<p>break + \u884c\u53f7 + if + \u6761\u4ef6\u3000\u3000break 10 if i==3\u3000\u3000\u3000\u7528\u4e8e\u8bbe\u7f6e\u6761\u4ef6\u65ad\u70b9\uff0c\u5728\u5faa\u73af\u4e2d\u4f7f\u7528\u975e\u5e38\u65b9\u4fbf<\/p>\n<p>info breakpoints\/watchpoints [n]\u3000\u3000info break\u3000\u3000n\u8868\u793a\u65ad\u70b9\u53f7\uff0c\u67e5\u770b\u65ad\u70b9\/\u89c2\u5bdf\u70b9\u7684\u60c5\u51b5<\/p>\n<p>clear + \u8981\u6e05\u9664\u7684\u65ad\u70b9\u884c\u53f7\u3000\u3000clear 10\u3000\u3000\u3000\u3000\u7528\u4e8e\u6e05\u9664\u5bf9\u5e94\u884c\u7684\u65ad\u70b9\uff0c\u8981\u7ed9\u51fa\u65ad\u70b9\u7684\u884c\u53f7\uff0c\u6e05\u9664\u65f6GDB\u4f1a\u7ed9\u51fa\u63d0\u793a<\/p>\n<p>delete + \u8981\u6e05\u9664\u7684\u65ad\u70b9\u7f16\u53f7\u3000\u3000delete 3\u3000\u3000\u3000\u3000\u7528\u4e8e\u6e05\u9664\u65ad\u70b9\u548c\u81ea\u52a8\u663e\u793a\u7684\u8868\u8fbe\u5f0f\u7684\u547d\u4ee4\uff0c\u8981\u7ed9\u51fa\u65ad\u70b9\u7684\u7f16\u53f7\uff0c\u6e05\u9664\u65f6GDB\u4e0d\u4f1a\u7ed9\u51fa\u4efb\u4f55\u63d0\u793a<\/p>\n<p>disable\/enable + \u65ad\u70b9\u7f16\u53f7\u3000\u3000disable 3\u3000\u3000\u3000\u3000\u8ba9\u6240\u8bbe\u65ad\u70b9\u6682\u65f6\u5931\u6548\/\u4f7f\u80fd\uff0c\u5982\u679c\u8981\u8ba9\u591a\u4e2a\u7f16\u53f7\u5904\u7684\u65ad\u70b9\u5931\u6548\/\u4f7f\u80fd\uff0c\u53ef\u5c06\u7f16\u53f7\u4e4b\u95f4\u7528\u7a7a\u683c\u9694\u5f00<\/p>\n<p>awatch\/watch + \u53d8\u91cf\u3000\u3000awatch\/watch i\u3000\u3000\u3000\u3000\u8bbe\u7f6e\u4e00\u4e2a\u89c2\u5bdf\u70b9\uff0c\u5f53\u53d8\u91cf\u88ab\u8bfb\u51fa\u6216\u5199\u5165\u65f6\u7a0b\u5e8f\u88ab\u6682\u505c<\/p>\n<p>rwatch + \u53d8\u91cf\u3000\u3000\u3000\u3000\u3000\u3000rwatch i\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u8bbe\u7f6e\u4e00\u4e2a\u89c2\u5bdf\u70b9\uff0c\u5f53\u53d8\u91cf\u88ab\u8bfb\u51fa\u65f6\uff0c\u7a0b\u5e8f\u88ab\u6682\u505c<\/p>\n<p>catch\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u8bbe\u7f6e\u6355\u6349\u70b9\u6765\u8865\u6349\u7a0b\u5e8f\u8fd0\u884c\u65f6\u7684\u4e00\u4e9b\u4e8b\u4ef6\u3002\u5982\uff1a\u8f7d\u5165\u5171\u4eab\u5e93\uff08\u52a8\u6001\u94fe\u63a5\u5e93\uff09\u6216\u662fC++\u7684\u5f02\u5e38<\/p>\n<p>tcatch\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u53ea\u8bbe\u7f6e\u4e00\u6b21\u6355\u6349\u70b9\uff0c\u5f53\u7a0b\u5e8f\u505c\u4f4f\u4ee5\u540e\uff0c\u5e94\u70b9\u88ab\u81ea\u52a8\u5220\u9664<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>3.\u6570\u636e\u547d\u4ee4<\/strong><\/h2>\n<p>display +\u8868\u8fbe\u5f0f\u3000\u3000display a\u3000\u3000\u7528\u4e8e\u663e\u793a\u8868\u8fbe\u5f0f\u7684\u503c\uff0c\u6bcf\u5f53\u7a0b\u5e8f\u8fd0\u884c\u5230\u65ad\u70b9\u5904\u90fd\u4f1a\u663e\u793a\u8868\u8fbe\u5f0f\u7684\u503c<\/p>\n<p>info display\u3000\u3000\u3000\u3000\u3000\u3000\u7528\u4e8e\u663e\u793a\u5f53\u524d\u6240\u6709\u8981\u663e\u793a\u503c\u7684\u8868\u8fbe\u5f0f\u7684\u60c5\u51b5<\/p>\n<p>delete + display \u7f16\u53f7\u3000\u3000delete 3\u3000\u3000\u7528\u4e8e\u5220\u9664\u4e00\u4e2a\u8981\u663e\u793a\u503c\u7684\u8868\u8fbe\u5f0f\uff0c\u88ab\u5220\u9664\u7684\u8868\u8fbe\u5f0f\u5c06\u4e0d\u88ab\u663e\u793a<\/p>\n<p>disable\/enable + display \u7f16\u53f7\u3000\u3000disable\/enable 3\u3000\u3000\u4f7f\u4e00\u4e2a\u8981\u663e\u793a\u503c\u7684\u8868\u8fbe\u5f0f\u6682\u65f6\u5931\u6548\/\u4f7f\u80fd<\/p>\n<p>undisplay + display \u7f16\u53f7\u3000\u3000undisplay 3\u3000\u3000\u7528\u4e8e\u7ed3\u675f\u67d0\u4e2a\u8868\u8fbe\u5f0f\u503c\u7684\u663e\u793a<\/p>\n<p>whatis + \u53d8\u91cf\u3000\u3000whatis i\u3000\u3000\u663e\u793a\u67d0\u4e2a\u8868\u8fbe\u5f0f\u7684\u6570\u636e\u7c7b\u578b<\/p>\n<p>print(p) + \u53d8\u91cf\/\u8868\u8fbe\u5f0f\u3000\u3000p n\u3000\u3000\u7528\u4e8e\u6253\u5370\u53d8\u91cf\u6216\u8868\u8fbe\u5f0f\u7684\u503c<\/p>\n<p>set + \u53d8\u91cf = \u53d8\u91cf\u503c\u3000\u3000set i = 3\u3000\u3000\u6539\u53d8\u7a0b\u5e8f\u4e2d\u67d0\u4e2a\u53d8\u91cf\u7684\u503c<\/p>\n<p>\u5728\u4f7f\u7528print\u547d\u4ee4\u65f6\uff0c\u53ef\u4ee5\u5bf9\u53d8\u91cf\u6309\u6307\u5b9a\u683c\u5f0f\u8fdb\u884c\u8f93\u51fa\uff0c\u5176\u547d\u4ee4\u683c\u5f0f\u4e3aprint \/\u53d8\u91cf\u540d + \u683c\u5f0f<\/p>\n<p>\u5176\u4e2d\u5e38\u7528\u7684\u53d8\u91cf\u683c\u5f0f\uff1ax\uff1a\u5341\u516d\u8fdb\u5236\uff1bd\uff1a\u5341\u8fdb\u5236\uff1bu\uff1a\u65e0\u7b26\u53f7\u6570\uff1bo\uff1a\u516b\u8fdb\u5236\uff1bc\uff1a\u5b57\u7b26\u683c\u5f0f\uff1bf\uff1a\u6d6e\u70b9\u6570\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>4.\u8c03\u8bd5\u8fd0\u884c\u73af\u5883\u76f8\u5173\u547d\u4ee4<\/strong><\/h2>\n<p>set args\u3000\u3000set args arg1 arg2\u3000\u3000\u8bbe\u7f6e\u8fd0\u884c\u53c2\u6570<\/p>\n<p>show args\u3000\u3000show args\u3000\u3000\u53c2\u770b\u8fd0\u884c\u53c2\u6570<\/p>\n<p>set width + \u6570\u76ee\u3000\u3000set width 70\u3000\u3000\u8bbe\u7f6eGDB\u7684\u884c\u5bbd<\/p>\n<p>cd + \u5de5\u4f5c\u76ee\u5f55\u3000\u3000cd ..\/\u3000\u3000\u5207\u6362\u5de5\u4f5c\u76ee\u5f55<\/p>\n<p>run\u3000\u3000r\/run\u3000\u3000\u7a0b\u5e8f\u5f00\u59cb\u6267\u884c<\/p>\n<p>step(s)\u3000\u3000s\u3000\u3000\u8fdb\u5165\u5f0f\uff08\u4f1a\u8fdb\u5165\u5230\u6240\u8c03\u7528\u7684\u5b50\u51fd\u6570\u4e2d\uff09\u5355\u6b65\u6267\u884c\uff0c\u8fdb\u5165\u51fd\u6570\u7684\u524d\u63d0\u662f\uff0c\u6b64\u51fd\u6570\u88ab\u7f16\u8bd1\u6709debug\u4fe1\u606f<\/p>\n<p>next(n)\u3000\u3000n\u3000\u3000\u975e\u8fdb\u5165\u5f0f\uff08\u4e0d\u4f1a\u8fdb\u5165\u5230\u6240\u8c03\u7528\u7684\u5b50\u51fd\u6570\u4e2d\uff09\u5355\u6b65\u6267\u884c<\/p>\n<p>finish\u3000\u3000finish\u3000\u3000\u4e00\u76f4\u8fd0\u884c\u5230\u51fd\u6570\u8fd4\u56de\u5e76\u6253\u5370\u51fd\u6570\u8fd4\u56de\u65f6\u7684\u5806\u6808\u5730\u5740\u548c\u8fd4\u56de\u503c\u53ca\u53c2\u6570\u503c\u7b49\u4fe1\u606f<\/p>\n<p>until + \u884c\u6570\u3000\u3000u 3\u3000\u3000\u8fd0\u884c\u5230\u51fd\u6570\u67d0\u4e00\u884c<\/p>\n<p>continue(c)\u3000\u3000c\u3000\u3000\u6267\u884c\u5230\u4e0b\u4e00\u4e2a\u65ad\u70b9\u6216\u7a0b\u5e8f\u7ed3\u675f<\/p>\n<p>return &lt;\u8fd4\u56de\u503c&gt;\u3000\u3000return 5\u3000\u3000\u6539\u53d8\u7a0b\u5e8f\u6d41\u7a0b\uff0c\u76f4\u63a5\u7ed3\u675f\u5f53\u524d\u51fd\u6570\uff0c\u5e76\u5c06\u6307\u5b9a\u503c\u8fd4\u56de<\/p>\n<p>call + \u51fd\u6570\u3000\u3000call func\u3000\u3000\u5728\u5f53\u524d\u4f4d\u7f6e\u6267\u884c\u6240\u8981\u8fd0\u884c\u7684\u51fd\u6570<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>5.\u5806\u6808\u76f8\u5173\u547d\u4ee4<\/strong><\/h2>\n<p>backtrace\/bt\u3000\u3000bt\u3000\u3000\u7528\u6765\u6253\u5370\u6808\u5e27\u6307\u9488\uff0c\u4e5f\u53ef\u4ee5\u5728\u8be5\u547d\u4ee4\u540e\u52a0\u4e0a\u8981\u6253\u5370\u7684\u6808\u5e27\u6307\u9488\u7684\u4e2a\u6570\uff0c\u67e5\u770b\u7a0b\u5e8f\u6267\u884c\u5230\u6b64\u65f6\uff0c\u662f\u7ecf\u8fc7\u54ea\u4e9b\u51fd\u6570\u547c\u53eb\u7684\u7a0b\u5e8f\uff0c\u7a0b\u5e8f\u201c\u8c03\u7528\u5806\u6808\u201d\u662f\u5f53\u524d\u51fd\u6570\u4e4b\u524d\u7684\u6240\u6709\u5df2\u8c03\u7528\u51fd\u6570\u7684\u5217\u8868\uff08\u5305\u62ec\u5f53\u524d\u51fd\u6570\uff09\u3002\u6bcf\u4e2a\u51fd\u6570\u53ca\u5176\u53d8\u91cf\u90fd\u88ab\u5206\u914d\u4e86\u4e00\u4e2a\u201c\u5e27\u201d\uff0c\u6700\u8fd1\u8c03\u7528\u7684\u51fd\u6570\u5728 0 \u53f7\u5e27\u4e2d\uff08\u201c\u5e95\u90e8\u201d\u5e27\uff09<\/p>\n<p>frame\u3000\u3000frame 1\u3000\u3000\u7528\u4e8e\u6253\u5370\u6307\u5b9a\u6808\u5e27<\/p>\n<p>info reg\u3000\u3000info reg\u3000\u3000\u67e5\u770b\u5bc4\u5b58\u5668\u4f7f\u7528\u60c5\u51b5<\/p>\n<p>info stack\u3000\u3000info stack\u3000\u3000\u67e5\u770b\u5806\u6808\u4f7f\u7528\u60c5\u51b5<\/p>\n<p>up\/down\u3000\u3000up\/down\u3000\u3000\u8df3\u5230\u4e0a\u4e00\u5c42\/\u4e0b\u4e00\u5c42\u51fd\u6570<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>6.\u8df3\u8f6c\u6267\u884c<\/strong><\/h2>\n<p>jump \u00a0\u6307\u5b9a\u4e0b\u4e00\u6761\u8bed\u53e5\u7684\u8fd0\u884c\u70b9\u3002\u53ef\u4ee5\u662f\u6587\u4ef6\u7684\u884c\u53f7\uff0c\u53ef\u4ee5\u662ffile:line\u683c\u5f0f\uff0c\u53ef\u4ee5\u662f+num\u8fd9\u79cd\u504f\u79fb\u91cf\u683c\u5f0f\u3002\u8868\u5f0f\u7740\u4e0b\u4e00\u6761\u8fd0\u884c\u8bed\u53e5\u4ece\u54ea\u91cc\u5f00\u59cb\u3002\u76f8\u5f53\u4e8e\u6539\u53d8\u4e86PC\u5bc4\u5b58\u5668\u5185\u5bb9\uff0c\u5806\u6808\u5185\u5bb9\u5e76\u6ca1\u6709\u6539\u53d8\uff0c\u8de8\u51fd\u6570\u8df3\u8f6c\u5bb9\u6613\u53d1\u751f\u9519\u8bef\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>7.\u4fe1\u53f7\u547d\u4ee4<\/strong><\/h2>\n<p>signal \u3000\u3000signal\u00a0SIGXXX \u3000\u3000\u4ea7\u751fXXX\u4fe1\u53f7\uff0c\u5982SIGINT\u3002\u4e00\u79cd\u901f\u67e5Linux\u67e5\u8be2\u4fe1\u53f7\u7684\u65b9\u6cd5\uff1a# kill -l<\/p>\n<p>handle\u00a0\u3000\u3000\u5728GDB\u4e2d\u5b9a\u4e49\u4e00\u4e2a\u4fe1\u53f7\u5904\u7406\u3002\u4fe1\u53f7\u53ef\u4ee5\u4ee5SIG\u5f00\u5934\u6216\u4e0d\u4ee5SIG\u5f00\u5934\uff0c\u53ef\u4ee5\u7528\u5b9a\u4e49\u4e00\u4e2a\u8981\u5904\u7406\u4fe1\u53f7\u7684\u8303\u56f4\uff08\u5982\uff1aSIGIO-SIGKILL\uff0c\u8868\u793a\u5904\u7406\u4eceSIGIO\u4fe1\u53f7\u5230SIGKILL\u7684\u4fe1\u53f7\uff0c\u5176\u4e2d\u5305\u62ecSIGIO\uff0cSIGIOT\uff0cSIGKILL\u4e09\u4e2a\u4fe1\u53f7\uff09\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528\u5173\u952e\u5b57all\u6765\u6807\u660e\u8981\u5904\u7406\u6240\u6709\u7684\u4fe1\u53f7\u3002\u4e00\u65e6\u88ab\u8c03\u8bd5\u7684\u7a0b\u5e8f\u63a5\u6536\u5230\u4fe1\u53f7\uff0c\u8fd0\u884c\u7a0b\u5e8f\u9a6c\u4e0a\u4f1a\u88abGDB\u505c\u4f4f\uff0c\u4ee5\u4f9b\u8c03\u8bd5\u3002\u5176\u53ef\u4ee5\u662f\u4ee5\u4e0b\u51e0\u79cd\u5173\u952e\u5b57\u7684\u4e00\u4e2a\u6216\u591a\u4e2a\uff1a<br \/>\nnostop\/stop<br \/>\n\u5f53\u88ab\u8c03\u8bd5\u7684\u7a0b\u5e8f\u6536\u5230\u4fe1\u53f7\u65f6\uff0cGDB\u4e0d\u4f1a\u505c\u4f4f\u7a0b\u5e8f\u7684\u8fd0\u884c\uff0c\u4f46\u4f1a\u6253\u51fa\u6d88\u606f\u544a\u8bc9\u4f60\u6536\u5230\u8fd9\u79cd\u4fe1\u53f7\/GDB\u4f1a\u505c\u4f4f\u4f60\u7684\u7a0b\u5e8f<br \/>\nprint\/noprint<br \/>\n\u5f53\u88ab\u8c03\u8bd5\u7684\u7a0b\u5e8f\u6536\u5230\u4fe1\u53f7\u65f6\uff0cGDB\u4f1a\u663e\u793a\u51fa\u4e00\u6761\u4fe1\u606f\/GDB\u4e0d\u4f1a\u544a\u8bc9\u4f60\u6536\u5230\u4fe1\u53f7\u7684\u4fe1\u606f<br \/>\npass<br \/>\nnoignore<br \/>\n\u5f53\u88ab\u8c03\u8bd5\u7684\u7a0b\u5e8f\u6536\u5230\u4fe1\u53f7\u65f6\uff0cGDB\u4e0d\u5904\u7406\u4fe1\u53f7\u3002\u8fd9\u8868\u793a\uff0cGDB\u4f1a\u628a\u8fd9\u4e2a\u4fe1\u53f7\u4ea4\u7ed9\u88ab\u8c03\u8bd5\u7a0b\u5e8f\u4f1a\u5904\u7406\u3002<br \/>\nnopass<br \/>\nignore<br \/>\n\u5f53\u88ab\u8c03\u8bd5\u7684\u7a0b\u5e8f\u6536\u5230\u4fe1\u53f7\u65f6\uff0cGDB\u4e0d\u4f1a\u8ba9\u88ab\u8c03\u8bd5\u7a0b\u5e8f\u6765\u5904\u7406\u8fd9\u4e2a\u4fe1\u53f7\u3002<br \/>\ninfo signals<br \/>\ninfo handle<br \/>\n\u53ef\u4ee5\u67e5\u770b\u54ea\u4e9b\u4fe1\u53f7\u88abGDB\u5904\u7406\uff0c\u5e76\u4e14\u53ef\u4ee5\u770b\u5230\u7f3a\u7701\u7684\u5904\u7406\u65b9\u5f0f<\/p>\n<p>single\u547d\u4ee4\u548cshell\u7684kill\u547d\u4ee4\u4e0d\u540c\uff0c\u7cfb\u7edf\u7684kill\u547d\u4ee4\u53d1\u4fe1\u53f7\u7ed9\u88ab\u8c03\u8bd5\u7a0b\u5e8f\u65f6\uff0c\u662f\u7531GDB\u622a\u83b7\u7684\uff0c\u800csingle\u547d\u4ee4\u6240\u53d1\u51fa\u4e00\u4fe1\u53f7\u5219\u662f\u76f4\u63a5\u53d1\u7ed9\u88ab\u8c03\u8bd5\u7a0b\u5e8f\u7684\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>8.\u8fd0\u884cShell\u547d\u4ee4<\/strong><\/h2>\n<p>\u5982(gdb)shell ls\u6765\u8fd0\u884cls\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>9.\u66f4\u591a\u7a0b\u5e8f\u8fd0\u884c\u9009\u9879\u548c\u8c03\u8bd5<\/strong><\/h2>\n<p>1\u3001\u7a0b\u5e8f\u8fd0\u884c\u53c2\u6570\u3002<br \/>\nset args \u53ef\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u3002\uff08\u5982\uff1aset args 10 20 30 40 50\uff09<br \/>\nshow args \u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u8bbe\u7f6e\u597d\u7684\u8fd0\u884c\u53c2\u6570\u3002<br \/>\n2\u3001\u8fd0\u884c\u73af\u5883\u3002<br \/>\npath\u00a0\u53ef\u8bbe\u5b9a\u7a0b\u5e8f\u7684\u8fd0\u884c\u8def\u5f84\u3002<br \/>\nshow paths \u67e5\u770b\u7a0b\u5e8f\u7684\u8fd0\u884c\u8def\u5f84\u3002<\/p>\n<p>set environment varname [=value] \u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u3002\u5982\uff1aset env USER=hchen<\/p>\n<p>show environment [varname] \u67e5\u770b\u73af\u5883\u53d8\u91cf\u3002<\/p>\n<p>3\u3001\u5de5\u4f5c\u76ee\u5f55\u3002<\/p>\n<p>cd\u3000\u3000 \u00a0\u76f8\u5f53\u4e8eshell\u7684cd\u547d\u4ee4\u3002<\/p>\n<p>pwd\u3000\u3000\u663e\u793a\u5f53\u524d\u7684\u6240\u5728\u76ee\u5f55\u3002<br \/>\n4\u3001\u7a0b\u5e8f\u7684\u8f93\u5165\u8f93\u51fa\u3002<br \/>\ninfo terminal \u663e\u793a\u4f60\u7a0b\u5e8f\u7528\u5230\u7684\u7ec8\u7aef\u7684\u6a21\u5f0f\u3002<br \/>\n\u4f7f\u7528\u91cd\u5b9a\u5411\u63a7\u5236\u7a0b\u5e8f\u8f93\u51fa\u3002\u5982\uff1arun &gt; outfile<br \/>\ntty\u547d\u4ee4\u53ef\u4ee5\u6307\u5199\u8f93\u5165\u8f93\u51fa\u7684\u7ec8\u7aef\u8bbe\u5907\u3002\u5982\uff1atty \/dev\/ttyb<\/p>\n<p>5\u3001\u8c03\u8bd5\u5df2\u8fd0\u884c\u7684\u7a0b\u5e8f<\/p>\n<p>\u4e24\u79cd\u65b9\u6cd5\uff1a<br \/>\n(1)\u5728UNIX\u4e0b\u7528ps\u67e5\u770b\u6b63\u5728\u8fd0\u884c\u7684\u7a0b\u5e8f\u7684PID\uff08\u8fdb\u7a0bID\uff09\uff0c\u7136\u540e\u7528gdb PID\u683c\u5f0f\u6302\u63a5\u6b63\u5728\u8fd0\u884c\u7684\u7a0b\u5e8f\u3002<br \/>\n(2)\u5148\u7528gdb \u5173\u8054\u4e0a\u6e90\u4ee3\u7801\uff0c\u5e76\u8fdb\u884cgdb\uff0c\u5728gdb\u4e2d\u7528attach\u547d\u4ee4\u6765\u6302\u63a5\u8fdb\u7a0b\u7684PID\u3002\u5e76\u7528detach\u6765\u53d6\u6d88\u6302\u63a5\u7684\u8fdb\u7a0b\u3002<\/p>\n<p>6\u3001\u6682\u505c \/ \u6062\u590d\u7a0b\u5e8f\u8fd0\u884c\u3000\u3000\u5f53\u8fdb\u7a0b\u88abgdb\u505c\u4f4f\u65f6\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528info program \u6765\u67e5\u770b\u7a0b\u5e8f\u7684\u662f\u5426\u5728\u8fd0\u884c\uff0c\u8fdb\u7a0b\u53f7\uff0c\u88ab\u6682\u505c\u7684\u539f\u56e0\u3002\u00a0\u5728gdb\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u6709\u4ee5\u4e0b\u51e0\u79cd\u6682\u505c\u65b9\u5f0f\uff1a\u65ad\u70b9\uff08BreakPoint\uff09\u3001\u89c2\u5bdf\u70b9\uff08WatchPoint\uff09\u3001\u6355\u6349\u70b9\uff08CatchPoint\uff09\u3001\u4fe1\u53f7\uff08Signals\uff09\u3001\u7ebf\u7a0b\u505c\u6b62\uff08Thread Stops\uff09\uff0c\u5982\u679c\u8981\u6062\u590d\u7a0b\u5e8f\u8fd0\u884c\uff0c\u53ef\u4ee5\u4f7f\u7528c\u6216\u662fcontinue\u547d\u4ee4\u3002<\/p>\n<p>7\u3001\u7ebf\u7a0b\uff08Thread Stops\uff09<\/p>\n<p>\u5982\u679c\u7a0b\u5e8f\u662f\u591a\u7ebf\u7a0b\uff0c\u53ef\u4ee5\u5b9a\u4e49\u65ad\u70b9\u662f\u5426\u5728\u6240\u6709\u7684\u7ebf\u7a0b\u4e0a\uff0c\u6216\u662f\u5728\u67d0\u4e2a\u7279\u5b9a\u7684\u7ebf\u7a0b\u3002<br \/>\nbreak thread<br \/>\nbreak thread if &#8230;<br \/>\nlinespec\u6307\u5b9a\u4e86\u65ad\u70b9\u8bbe\u7f6e\u5728\u7684\u6e90\u7a0b\u5e8f\u7684\u884c\u53f7\u3002threadno\u6307\u5b9a\u4e86\u7ebf\u7a0b\u7684ID\uff0c\u6ce8\u610f\uff0c\u8fd9\u4e2aID\u662fGDB\u5206\u914d\u7684\uff0c\u53ef\u4ee5\u901a\u8fc7\u201cinfo threads\u201d\u547d\u4ee4\u6765\u67e5\u770b\u6b63\u5728\u8fd0\u884c\u7a0b\u5e8f\u4e2d\u7684\u7ebf\u7a0b\u4fe1\u606f\u3002\u5982\u679c\u4e0d\u6307\u5b9athread \u5219\u8868\u793a\u65ad\u70b9\u8bbe\u5728\u6240\u6709\u7ebf\u7a0b\u4e0a\u9762\u3002\u8fd8\u53ef\u4ee5\u4e3a\u67d0\u7ebf\u7a0b\u6307\u5b9a\u65ad\u70b9\u6761\u4ef6\u3002\u5982\uff1a<br \/>\n(gdb) break frik.c:13 thread 28 if bartab &gt; lim<br \/>\n\u5f53\u4f60\u7684\u7a0b\u5e8f\u88abGDB\u505c\u4f4f\u65f6\uff0c\u6240\u6709\u7684\u8fd0\u884c\u7ebf\u7a0b\u90fd\u4f1a\u88ab\u505c\u4f4f\u3002\u8fd9\u65b9\u4fbf\u67e5\u770b\u8fd0\u884c\u7a0b\u5e8f\u7684\u603b\u4f53\u60c5\u51b5\u3002\u800c\u5728\u4f60\u6062\u590d\u7a0b\u5e8f\u8fd0\u884c\u65f6\uff0c\u6240\u6709\u7684\u7ebf\u7a0b\u4e5f\u4f1a\u88ab\u6062\u590d\u8fd0\u884c\u3002<\/p>\n<p>&nbsp;<\/p>\n<h2><strong>10.\u8c03\u8bd5core\u6587\u4ef6<\/strong><\/h2>\n<p>Core Dump\uff1aCore\u7684\u610f\u601d\u662f\u5185\u5b58\uff0cDump\u7684\u610f\u601d\u662f\u6254\u51fa\u6765\uff0c\u5806\u51fa\u6765\u3002\u5f00\u53d1\u548c\u4f7f\u7528Unix\u7a0b\u5e8f\u65f6\uff0c\u6709\u65f6\u7a0b\u5e8f\u83ab\u540d\u5176\u5999\u7684down\u4e86\uff0c\u5374\u6ca1\u6709\u4efb\u4f55\u7684\u63d0\u793a(\u6709\u65f6\u5019\u4f1a\u63d0\u793acore dumped)\uff0c\u8fd9\u65f6\u5019\u53ef\u4ee5\u67e5\u770b\u4e00\u4e0b\u6709\u6ca1\u6709\u5f62\u5982core.\u8fdb\u7a0b\u53f7\u7684\u6587\u4ef6\u751f\u6210\uff0c\u8fd9\u4e2a\u6587\u4ef6\u4fbf\u662f\u64cd\u4f5c\u7cfb\u7edf\u628a\u7a0b\u5e8fdown\u6389\u65f6\u7684\u5185\u5b58\u5185\u5bb9\u6254\u51fa\u6765\u751f\u6210\u7684, \u5b83\u53ef\u4ee5\u505a\u4e3a\u8c03\u8bd5\u7a0b\u5e8f\u7684\u53c2\u8003<\/p>\n<p>(1)\u751f\u6210Core\u6587\u4ef6<\/p>\n<div>\u3000\u3000\u4e00\u822c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0ccore file\u7684\u5927\u5c0f\u88ab\u8bbe\u7f6e\u4e3a\u4e860\uff0c\u8fd9\u6837\u7cfb\u7edf\u5c31\u4e0ddump\u51facore file\u4e86\u3002\u4fee\u6539\u540e\u624d\u80fd\u751f\u6210core\u6587\u4ef6\u3002<\/div>\n<p>#\u8bbe\u7f6ecore\u5927\u5c0f\u4e3a\u65e0\u9650<br \/>\nulimit -c unlimited<br \/>\n#\u8bbe\u7f6e\u6587\u4ef6\u5927\u5c0f\u4e3a\u65e0\u9650<br \/>\nulimit unlimited<\/p>\n<p>\u8fd9\u4e9b\u9700\u8981\u6709root\u6743\u9650, \u5728ubuntu\u4e0b\u6bcf\u6b21\u91cd\u65b0\u6253\u5f00\u4e2d\u65ad\u90fd\u9700\u8981\u91cd\u65b0\u8f93\u5165\u4e0a\u9762\u7684\u7b2c\u4e00\u6761\u547d\u4ee4, \u6765\u8bbe\u7f6ecore\u5927\u5c0f\u4e3a\u65e0\u9650<\/p>\n<p>core\u6587\u4ef6\u751f\u6210\u8def\u5f84:\u8f93\u5165\u53ef\u6267\u884c\u6587\u4ef6\u8fd0\u884c\u547d\u4ee4\u7684\u540c\u4e00\u8def\u5f84\u4e0b\u3002\u82e5\u7cfb\u7edf\u751f\u6210\u7684core\u6587\u4ef6\u4e0d\u5e26\u5176\u4ed6\u4efb\u4f55\u6269\u5c55\u540d\u79f0\uff0c\u5219\u5168\u90e8\u547d\u540d\u4e3acore\u3002\u65b0\u7684core\u6587\u4ef6\u751f\u6210\u5c06\u8986\u76d6\u539f\u6765\u7684core\u6587\u4ef6\u3002<\/p>\n<p>1\uff09\/proc\/sys\/kernel\/core_uses_pid\u53ef\u4ee5\u63a7\u5236core\u6587\u4ef6\u7684\u6587\u4ef6\u540d\u4e2d\u662f\u5426\u6dfb\u52a0pid\u4f5c\u4e3a\u6269\u5c55\u3002\u6587\u4ef6\u5185\u5bb9\u4e3a1\uff0c\u8868\u793a\u6dfb\u52a0pid\u4f5c\u4e3a\u6269\u5c55\u540d\uff0c\u751f\u6210\u7684core\u6587\u4ef6\u683c\u5f0f\u4e3acore.xxxx\uff1b\u4e3a0\u5219\u8868\u793a\u751f\u6210\u7684core\u6587\u4ef6\u540c\u4e00\u547d\u540d\u4e3acore\u3002<br \/>\n\u53ef\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u4fee\u6539\u6b64\u6587\u4ef6\uff1a<br \/>\necho &#8220;1&#8221; &gt; \/proc\/sys\/kernel\/core_uses_pid<\/p>\n<p>2\uff09proc\/sys\/kernel\/core_pattern\u53ef\u4ee5\u63a7\u5236core\u6587\u4ef6\u4fdd\u5b58\u4f4d\u7f6e\u548c\u6587\u4ef6\u540d\u683c\u5f0f\u3002<br \/>\n\u53ef\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\u4fee\u6539\u6b64\u6587\u4ef6\uff1a<br \/>\necho &#8220;\/corefile\/core-%e-%p-%t&#8221; &gt; core_pattern\uff0c\u53ef\u4ee5\u5c06core\u6587\u4ef6\u7edf\u4e00\u751f\u6210\u5230\/corefile\u76ee\u5f55\u4e0b\uff0c\u4ea7\u751f\u7684\u6587\u4ef6\u540d\u4e3acore-\u547d\u4ee4\u540d-pid-\u65f6\u95f4\u6233<br \/>\n\u4ee5\u4e0b\u662f\u53c2\u6570\u5217\u8868:<br \/>\n%p &#8211; insert pid into filename \u6dfb\u52a0pid<br \/>\n%u &#8211; insert current uid into filename \u6dfb\u52a0\u5f53\u524duid<br \/>\n%g &#8211; insert current gid into filename \u6dfb\u52a0\u5f53\u524dgid<br \/>\n%s &#8211; insert signal that caused the coredump into the filename \u6dfb\u52a0\u5bfc\u81f4\u4ea7\u751fcore\u7684\u4fe1\u53f7<br \/>\n%t &#8211; insert UNIX time that the coredump occurred into filename \u6dfb\u52a0core\u6587\u4ef6\u751f\u6210\u65f6\u7684unix\u65f6\u95f4<br \/>\n%h &#8211; insert hostname where the coredump happened into filename \u6dfb\u52a0\u4e3b\u673a\u540d<br \/>\n%e &#8211; insert coredumping executable name into filename \u6dfb\u52a0\u547d\u4ee4\u540d<\/p>\n<p>(2)\u7528gdb\u67e5\u770bcore\u6587\u4ef6<\/p>\n<p>\u53d1\u751fcore dump\u4e4b\u540e, \u7528gdb\u8fdb\u884c\u67e5\u770bcore\u6587\u4ef6\u7684\u5185\u5bb9, \u4ee5\u5b9a\u4f4d\u6587\u4ef6\u4e2d\u5f15\u53d1core dump\u7684\u884c.<br \/>\ngdb [exec file] [core file]<br \/>\n\u5982:<br \/>\ngdb .\/test core<\/p>\n<p>\u6216gdb .\/a.out<br \/>\ncore-file core.xxxx<br \/>\ngdb\u540e, \u7528bt\u547d\u4ee4backtrace\u6216where\u67e5\u770b\u7a0b\u5e8f\u8fd0\u884c\u5230\u54ea\u91cc, \u6765\u5b9a\u4f4dcore dump\u7684\u6587\u4ef6-&gt;\u884c.<\/p>\n<p>\u5f85\u8c03\u8bd5\u7684\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u5728\u7f16\u8bd1\u7684\u65f6\u5019\u9700\u8981\u52a0-g\uff0ccore\u6587\u4ef6\u624d\u80fd\u6b63\u5e38\u663e\u793a\u51fa\u9519\u4fe1\u606f<\/p>\n<p>1\uff09gdb -core=core.xxxx<br \/>\nfile .\/a.out<br \/>\nbt<br \/>\n2\uff09gdb -c core.xxxx<br \/>\nfile .\/a.out<br \/>\nbt<\/p>\n<p>(3)\u7528gdb\u5b9e\u65f6\u89c2\u5bdf\u67d0\u8fdb\u7a0bcrash\u4fe1\u606f<\/p>\n<p>\u542f\u52a8\u8fdb\u7a0b<br \/>\ngdb -p PID<br \/>\nc<br \/>\n\u8fd0\u884c\u8fdb\u7a0b\u81f3crash<br \/>\ngdb\u4f1a\u663e\u793acrash\u4fe1\u606f<br \/>\nbt<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u8005\uff1a \u5b57\u4f53\uff1a[\u589e\u52a0\u00a0\u51cf\u5c0f] \u7c7b\u578b\uff1a\u8f6c\u8f7d<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"colormag_page_container_layout":"default_layout","colormag_page_sidebar_layout":"default_layout","footnotes":""},"categories":[],"tags":[118],"class_list":["post-725","post","type-post","status-publish","format-standard","hentry","tag-02-"],"_links":{"self":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/725","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/comments?post=725"}],"version-history":[{"count":0,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/posts\/725\/revisions"}],"wp:attachment":[{"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/media?parent=725"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/categories?post=725"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/i007.cc\/wordpress\/wp-json\/wp\/v2\/tags?post=725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}