{"id":202,"date":"2016-09-15T03:29:15","date_gmt":"2016-09-15T03:29:15","guid":{"rendered":""},"modified":"2016-09-15T03:29:15","modified_gmt":"2016-09-15T03:29:15","slug":"","status":"publish","type":"post","link":"http:\/\/weizn.net\/?p=202","title":{"rendered":"[\u8f6c]\u5728\u5d4c\u5165\u5f0f\u4e2d\u4f7f\u7528gdbserver"},"content":{"rendered":"<p><span style=\"font-size:14px;\">\u4e00\uff1a\u51c6\u5907<\/span><br \/>\n<span style=\"font-size:14px;\">PC\u673a\uff1a172.16.7.153<\/span><br \/>\n<span style=\"font-size:14px;\">broad\uff1a172.16.7.155<\/span><br \/>\n<span style=\"font-size:14px;\"># ifconfig<\/span><br \/>\n<span style=\"font-size:14px;\">eth0 &nbsp; &nbsp; &nbsp;Link encap:Ethernet &nbsp;HWaddr 00:07:63:00:00:0B &nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inet addr:172.16.7.155 &nbsp;Bcast:172.16.7.255 &nbsp;Mask:255.255.255.0<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UP BROADCAST RUNNING MULTICAST &nbsp;MTU:1500 &nbsp;Metric:1<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RX packets:5481 errors:0 dropped:0 overruns:0 frame:0<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TX packets:10689 errors:0 dropped:0 overruns:0 carrier:0<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; collisions:0 txqueuelen:1000&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RX bytes:452971 (442.3 KiB) &nbsp;TX bytes:881042 (860.3 KiB)<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Interrupt:16<\/span><br \/>\n<span style=\"font-size:14px;\">lo &nbsp; &nbsp; &nbsp; &nbsp;Link encap:Local Loopback &nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inet addr:127.0.0.1 &nbsp;Mask:255.0.0.0<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; UP LOOPBACK RUNNING &nbsp;MTU:16436 &nbsp;Metric:1<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RX packets:0 errors:0 dropped:0 overruns:0 frame:0<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; TX packets:0 errors:0 dropped:0 overruns:0 carrier:0<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; collisions:0 txqueuelen:0&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; RX bytes:0 (0.0 B) &nbsp;TX bytes:0 (0.0 B)<\/span><br \/>\n<span style=\"font-size:14px;\"># gdbserver&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">Usage: &nbsp;gdbserver COMM PROG [ARGS &#8230;]<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; gdbserver COMM &#8211;attach PID<\/span><br \/>\n<span style=\"font-size:14px;\">COMM may either be a tty device (for serial debugging), or&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">HOST:PORT to listen for a TCP connection.<\/span><br \/>\n<span style=\"font-size:14px;\">Exiting<\/span><br \/>\n<span style=\"font-size:14px;\">#&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u4e8c\uff1a\u5728board\u4e0a\u542f\u52a8gdbserver<\/span><br \/>\n<span style=\"font-size:14px;\"># pwd &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\/usr\/local\/bin<\/span><br \/>\n<span style=\"font-size:14px;\"># ls<\/span><br \/>\n<span style=\"font-size:14px;\">fat32format &nbsp;fdisk &nbsp; &nbsp; &nbsp; &nbsp;mke2fs &nbsp; &nbsp; &nbsp; swapp &nbsp; &nbsp; &nbsp; &nbsp;unzip &nbsp; &nbsp; &nbsp; &nbsp;zip<\/span><br \/>\n<span style=\"font-size:14px;\"># gdbserver 172.16.7.153:1234 swapp<\/span><br \/>\n<span style=\"font-size:14px;\">\u5728\u8fd9\u91cc swapp &nbsp;\u8981\u4f7f\u7528 \u7edd\u5bf9\u8def\u5f84<\/span><br \/>\n<span style=\"font-size:14px;\">root@ubuntu10:\/work\/7405\/trunk2\/swapp# mipsel-linux-gdb swapp<\/span><br \/>\n<span style=\"font-size:14px;\">\u4e09\uff1a\u5728PC\u4e0a\u4f7f\u7528gdb<\/span><br \/>\n<span style=\"font-size:14px;\">root@ubuntu10:\/work\/7405\/trunk2# mipsel-linux-gdb swapp\/swapp<\/span><br \/>\n<span style=\"font-size:14px;\">GNU gdb 6.6.0.20070423-cvs<\/span><br \/>\n<span style=\"font-size:14px;\">Copyright (C) 2006 Free Software Foundation, Inc.<\/span><br \/>\n<span style=\"font-size:14px;\">GDB is free software, covered by the GNU General Public License, and you are<\/span><br \/>\n<span style=\"font-size:14px;\">welcome to change it and\/or distribute copies of it under certain conditions.<\/span><br \/>\n<span style=\"font-size:14px;\">Type &#8220;show copying&#8221; to see the conditions.<\/span><br \/>\n<span style=\"font-size:14px;\">There is absolutely no warranty for GDB. &nbsp;Type &#8220;show warranty&#8221; for details.<\/span><br \/>\n<span style=\"font-size:14px;\">This GDB was configured as &#8220;&#8211;host=mipsel-linux &#8211;target=mipsel-linux-uclibc&#8221;&#8230;<\/span><br \/>\n<span style=\"font-size:14px;\">(gdb) target remote 172.16.7.155:1234<\/span><br \/>\n<span style=\"font-size:14px;\">gdb\u7684\u4e00\u4e9b\u547d\u4ee4\uff1a\u4e0b\u9762\u662f\u4e00\u7bc7\u4ecb\u7ecdGDB\u547d\u4ee4\u7684\u6587\u7ae0\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">\u672c\u6587\u6765\u81eaCSDN\u535a\u5ba2\uff0c\u8f6c\u8f7d\u8bf7\u6807\u660e\u51fa\u5904\uff1ahttp:\/\/blog.csdn.net\/samehai\/archive\/2007\/09\/27\/1803521.aspx<\/span><br \/>\n<span style=\"font-size:14px;\">\u540d\u79f0<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; gdb &#8211; GNU \u8c03\u8bd5\u5668<\/span><br \/>\n<span style=\"font-size:14px;\">\u63d0\u8981<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; gdb &nbsp; &nbsp;[-help] [-nx] [-q] [-batch] [-cd=dir] [-f] [-b bps]<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; [-tty=dev] [-s symfile] [-e prog] [-se prog] [-c<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; core] [-x cmds] [-d dir] [prog[core|procID]]<\/span><br \/>\n<span style=\"font-size:14px;\">\u63cf\u8ff0<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; \u8c03\u8bd5\u5668\uff08\u5982GDB\uff09\u7684\u76ee\u7684\u662f\u5141\u8bb8\u4f60\u5728\u7a0b\u5e8f\u8fd0\u884c\u65f6\u8fdb\u5165\u5230\u67d0\u4e2a\u7a0b\u5e8f\u5185\u90e8\u53bb\u770b\u770b\u8be5\u7a0b\u5e8f\u5728\u505a\u4ec0\u4e48\uff0c\u6216\u8005\u5728\u8be5\u7a0b\u5e8f\u5d29\u6e83\u65f6\u5b83\u5728\u505a\u4ec0\u4e48\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; GDB\u4e3b\u8981\u53ef\u4ee5\u505a4\u5927\u7c7b\u4e8b\uff08\u52a0\u4e0a\u4e00\u4e9b\u5176\u4ed6\u7684\u8f85\u52a9\u5de5\u4f5c\uff09\uff0c\u4ee5\u5e2e\u52a9\u7528\u6237\u5728\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u53d1\u73b0bug\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o &nbsp;\u542f\u52a8\u60a8\u7684\u7a0b\u5e8f\uff0c\u5e76\u5217\u51fa\u53ef\u80fd\u4f1a\u5f71\u54cd\u5b83\u8fd0\u884c\u7684\u4e00\u4e9b\u4fe1\u606f<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o &nbsp;\u4f7f\u60a8\u7684\u7a0b\u5e8f\u5728\u7279\u5b9a\u6761\u4ef6\u4e0b\u505c\u6b62\u4e0b\u6765<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o &nbsp;\u5f53\u7a0b\u5e8f\u505c\u4e0b\u6765\u7684\u65f6\u5019\uff0c\u68c0\u67e5\u53d1\u751f\u4e86\u4ec0\u4e48<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; o &nbsp;\u5bf9\u7a0b\u5e8f\u505a\u51fa\u76f8\u5e94\u7684\u8c03\u6574\uff0c\u8fd9\u6837\u60a8\u5c31\u80fd\u5c1d\u8bd5\u7ea0\u6b63\u4e00\u4e2a\u9519\u8bef\u5e76\u7ee7\u7eed\u53d1\u73b0\u5176\u5b83\u9519\u8bef<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; \u60a8\u80fd\u4f7f\u7528GDB\u8c03\u8bd5\u7528C\u3001C++\u3001Modula-2\u5199\u7684\u7a0b\u5e8f\u3002\u7b49GNU Fortran\u7f16\u8bd1\u5668\u51c6\u5907\u597d\u8fc7\u540e\uff0cGDB\u5c06\u63d0\u4f9b\u5bf9Fortran\u7684\u652f\u6301<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; GDB\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u65b9\u5f0f\u4e0b\u8f93\u5165gdb\u6765\u6267\u884c\u3002\u542f\u52a8\u8fc7\u540e\uff0cGDB\u4f1a\u4ece\u7ec8\u7aef\u8bfb\u53d6\u547d\u4ee4\uff0c\u76f4\u5230\u60a8\u8f93\u5165GDB\u547d\u4ee4quit\u4f7fGDB\u9000\u51fa\u3002\u60a8\u80fd\u901a\u8fc7GDB\u547d\u4ee4help\u83b7\u53d6\u5728\u7ebf\u5e2e\u52a9\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; \u60a8\u80fd\u4ee5\u65e0\u53c2\u6570\u65e0\u9009\u9879\u7684\u5f62\u5f0f\u8fd0\u884cGDB\uff0c\u4e0d\u8fc7\u901a\u5e38\u7684\u60c5\u51b5\u662f\u4ee5\u4e00\u5230\u4e24\u4e2a\u53c2\u6570\u8fd0\u884cGDB\uff0c\u4ee5\u5f85\u8c03\u8bd5\u7684\u53ef\u6267\u884c\u7a0b\u5e8f\u540d\u4e3a\u53c2\u6570<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; gdb \u7a0b\u5e8f\u540d<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; \u60a8\u80fd\u7528\u4e24\u4e2a\u53c2\u6570\u6765\u8fd0\u884cGDB\uff0c\u53ef\u6267\u884c\u7a0b\u5e8f\u540d\u4e0ecore\u6587\u4ef6(\u8bd1\u6ce8\uff1a\u4e0d\u77e5\u9053\u600e\u4e48\u7ffb\u8bd1\u597d\uff0c\u5c31\u4e0d\u7ffb\u8bd1\u4e86)\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; gdb \u7a0b\u5e8f\u540d core<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; \u60a8\u53ef\u4ee5\u4ee5\u8fdb\u7a0bID\u4f5c\u4e3a\u7b2c\u4e8c\u4e2a\u53c2\u6570\uff0c\u4ee5\u8c03\u5f0f\u4e00\u4e2a\u6b63\u5728\u8fd0\u884c\u7684\u8fdb\u7a0b<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; gdb \u7a0b\u5e8f\u540d 1234<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; \u5c06\u4f1a\u628agdb\u9644\u5728\u8fdb\u7a0b1234\u4e4b\u4e0a(\u9664\u975e\u60a8\u6b63\u597d\u6709\u4e2a\u6587\u4ef6\u53eb1234\uff0cgdb\u603b\u662f\u5148\u67e5\u627ecore\u6587\u4ef6)<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;\u4e0b\u9762\u662f\u4e00\u4e9b\u6700\u5e38\u7528\u7684GDB\u547d\u4ee4:<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;file [filename]<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u88c5\u5165\u60f3\u8981\u8c03\u8bd5\u7684\u53ef\u6267\u884c\u6587\u4ef6<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;kill [filename]<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u7ec8\u6b62\u6b63\u5728\u8c03\u8bd5\u7684\u7a0b\u5e8f<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;break [file:]function<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5728(file\u6587\u4ef6\u7684)function\u51fd\u6570\u4e2d\u8bbe\u7f6e\u4e00\u4e2a\u65ad\u70b9<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;clear<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5220\u9664\u4e00\u4e2a\u65ad\u70b9\uff0c\u8fd9\u4e2a\u547d\u4ee4\u9700\u8981\u6307\u5b9a\u4ee3\u7801\u884c\u6216\u8005\u51fd\u6570\u540d\u4f5c\u4e3a\u53c2\u6570<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;run [arglist]<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u8fd0\u884c\u60a8\u7684\u7a0b\u5e8f (\u5982\u679c\u6307\u5b9a\u4e86arglist,\u5219\u5c06arglist\u4f5c\u4e3a\u53c2\u6570\u8fd0\u884c\u7a0b\u5e8f)<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;bt Backtrace: \u663e\u793a\u7a0b\u5e8f\u5806\u6808\u4fe1\u606f<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;print expr<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u6253\u5370\u8868\u8fbe\u5f0f\u7684\u503c<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;continue<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u7ee7\u7eed\u8fd0\u884c\u60a8\u7684\u7a0b\u5e8f (\u5728\u505c\u6b62\u4e4b\u540e\uff0c\u6bd4\u5982\u5728\u4e00\u4e2a\u65ad\u70b9\u4e4b\u540e)<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;list<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5217\u51fa\u4ea7\u751f\u6267\u884c\u6587\u4ef6\u7684\u6e90\u4ee3\u7801\u7684\u4e00\u90e8\u5206<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;next<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5355\u6b65\u6267\u884c (\u5728\u505c\u6b62\u4e4b\u540e); \u8df3\u8fc7\u51fd\u6570\u8c03\u7528<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;nexti<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u6267\u884c\u4e0b\u4e00\u884c\u7684\u6e90\u4ee3\u7801\u4e2d\u7684\u4e00\u6761\u6c47\u7f16\u6307\u4ee4<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;set<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u8bbe\u7f6e\u53d8\u91cf\u7684\u503c\u3002\u4f8b\u5982\uff1aset nval=54 \u5c06\u628a54\u4fdd\u5b58\u5230nval\u53d8\u91cf\u4e2d<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;step<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5355\u6b65\u6267\u884c (\u5728\u505c\u6b62\u4e4b\u540e); \u8fdb\u5165\u51fd\u6570\u8c03\u7528<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;stepi<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u7ee7\u7eed\u6267\u884c\u7a0b\u5e8f\u4e0b\u4e00\u884c\u6e90\u4ee3\u7801\u4e2d\u7684\u6c47\u7f16\u6307\u4ee4\u3002\u5982\u679c\u662f\u51fd\u6570\u8c03\u7528\uff0c\u8fd9\u4e2a\u547d\u4ee4\u5c06\u8fdb\u5165\u51fd\u6570\u7684\u5185\u90e8\uff0c\u5355\u6b65\u6267\u884c\u51fd\u6570\u4e2d\u7684\u6c47\u7f16\u4ee3\u7801<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;watch<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u4f7f\u4f60\u80fd\u76d1\u89c6\u4e00\u4e2a\u53d8\u91cf\u7684\u503c\u800c\u4e0d\u7ba1\u5b83\u4f55\u65f6\u88ab\u6539\u53d8<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;rwatch<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u6307\u5b9a\u4e00\u4e2a\u53d8\u91cf\uff0c\u5982\u679c\u8fd9\u4e2a\u53d8\u91cf\u88ab\u8bfb\uff0c\u5219\u6682\u505c\u7a0b\u5e8f\u8fd0\u884c\uff0c\u5728\u8c03\u8bd5\u5668\u4e2d\u663e\u793a\u4fe1\u606f\uff0c\u5e76\u7b49\u5f85\u4e0b\u4e00\u4e2a\u8c03\u8bd5\u547d\u4ee4\u3002\u53c2\u8003rwatch\u548cwatch\u547d\u4ee4<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;awatch<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u6307\u5b9a\u4e00\u4e2a\u53d8\u91cf\uff0c\u5982\u679c\u8fd9\u4e2a\u53d8\u91cf\u88ab\u8bfb\u6216\u8005\u88ab\u5199\uff0c\u5219\u6682\u505c\u7a0b\u5e8f\u8fd0\u884c\uff0c\u5728\u8c03\u8bd5\u5668\u4e2d\u663e\u793a\u4fe1\u606f\uff0c\u5e76\u7b49\u5f85\u4e0b\u4e00\u4e2a\u8c03\u8bd5\u547d\u4ee4\u3002\u53c2\u8003rwatch\u548cwatch\u547d\u4ee4<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;Ctrl-C<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5728\u5f53\u524d\u4f4d\u7f6e\u505c\u6b62\u6267\u884c\u6b63\u5728\u6267\u884c\u7684\u7a0b\u5e8f\uff0c\u65ad\u70b9\u5728\u5f53\u524d\u884c<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;disable<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u7981\u6b62\u65ad\u70b9\u529f\u80fd\uff0c\u8fd9\u4e2a\u547d\u4ee4\u9700\u8981\u7981\u6b62\u7684\u65ad\u70b9\u5728\u65ad\u70b9\u5217\u8868\u7d22\u5f15\u503c\u4f5c\u4e3a\u53c2\u6570<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;display<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5728\u65ad\u70b9\u7684\u505c\u6b62\u7684\u5730\u65b9\uff0c\u663e\u793a\u6307\u5b9a\u7684\u8868\u8fbe\u5f0f\u7684\u503c\u3002(\u663e\u793a\u53d8\u91cf)<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;undisplay<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5220\u9664\u4e00\u4e2adisplay\u8bbe\u7f6e\u7684\u53d8\u91cf\u663e\u793a\u3002\u8fd9\u4e2a\u547d\u4ee4\u9700\u8981\u5c06display list\u4e2d\u7684\u7d22\u5f15\u505a\u53c2\u6570<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;enable<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5141\u8bb8\u65ad\u70b9\u529f\u80fd\uff0c\u8fd9\u4e2a\u547d\u4ee4\u9700\u8981\u5141\u8bb8\u7684\u65ad\u70b9\u5728\u65ad\u70b9\u5217\u8868\u7d22\u5f15\u503c\u4f5c\u4e3a\u53c2\u6570<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;finish<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u7ee7\u7eed\u6267\u884c\uff0c\u76f4\u5230\u5f53\u524d\u51fd\u6570\u8fd4\u56de<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;ignore<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5ffd\u7565\u67d0\u4e2a\u65ad\u70b9\u5236\u5b9a\u7684\u6b21\u6570\u3002\u4f8b\uff1aignore 4 23 \u5ffd\u7565\u65ad\u70b94\u768423\u6b21\u8fd0\u884c\uff0c\u5728\u7b2c24\u6b21\u7684\u65f6\u5019\u4e2d\u65ad<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;info [name]<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u67e5\u770bname\u4fe1\u606f<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;load<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u52a8\u6001\u8f7d\u5165\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u5230\u8c03\u8bd5\u5668<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;xbreak<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5728\u5f53\u524d\u51fd\u6570\u7684\u9000\u51fa\u7684\u70b9\u4e0a\u8bbe\u7f6e\u4e00\u4e2a\u65ad\u70b9<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;whatis<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u663e\u793a\u53d8\u91cf\u7684\u503c\u548c\u7c7b\u578b<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;ptype<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u663e\u793a\u53d8\u91cf\u7684\u7c7b\u578b<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;return<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5f3a\u5236\u4ece\u5f53\u524d\u51fd\u6570\u8fd4\u56de<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;txbreak<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5728\u5f53\u524d\u51fd\u6570\u7684\u9000\u51fa\u7684\u70b9\u4e0a\u8bbe\u7f6e\u4e00\u4e2a\u4e34\u65f6\u7684\u65ad\u70b9(\u53ea\u53ef\u4f7f\u7528\u4e00\u6b21)<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;make<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u4f7f\u4f60\u80fd\u4e0d\u9000\u51fa gdb \u5c31\u53ef\u4ee5\u91cd\u65b0\u4ea7\u751f\u53ef\u6267\u884c\u6587\u4ef6<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;shell<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u4f7f\u4f60\u80fd\u4e0d\u79bb\u5f00 gdb \u5c31\u6267\u884c UNIX shell \u547d\u4ee4<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;help [name]<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u663e\u793aGDB\u547d\u4ee4\u7684\u4fe1\u606f\uff0c\u6216\u8005\u663e\u793a\u5982\u4f55\u4f7f\u7528GDB\u7684\u603b\u4f53\u4fe1\u606f<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;quit<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u9000\u51fagdb.<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;\u8981\u5f97\u5230\u6240\u6709\u4f7f\u7528GDB\u7684\u8d44\u6599\uff0c\u8bf7\u53c2\u8003Using GDB: A Guide to the GNU<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;Source-Level &nbsp;Debugger, &nbsp;by Richard M. Stallman and Roland<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;H. Pesch. &nbsp;\u5f53\u7528info\u67e5\u770b\u7684\u65f6\u5019\uff0c\u4e5f\u80fd\u770b\u5230\u76f8\u540c\u7684\u6587\u7ae0<\/span><br \/>\n<span style=\"font-size:14px;\">\u9009\u9879<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; \u4efb\u4f55\u53c2\u6570\u800c\u975e\u9009\u9879\u6307\u660e\u4e86\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u53cacore \u6587\u4ef6(\u6216\u8005\u8fdb\u7a0bID)\uff1b\u6240<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; \u9047\u5230\u7684\u7b2c\u4e00\u4e2a\u672a\u5173\u8054\u9009\u9879\u6807\u5fd7\u7684\u53c2\u6570\u4e0e &#8216;-se&#8217; \u9009\u9879\u7b49\u4ef7\uff0c\u7b2c\u4e8c\u4e2a\uff0c\u5982\u679c\u5b58<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; \u5728\uff0c\u4e14\u662f\u4e00\u4e2a\u6587\u4ef6\u7684\u540d\u5b57\uff0c\u5219\u7b49\u4ef7\u4e0e &#8216;-c&#8217; \u9009\u9879\u3002\u8bb8\u591a\u9009\u9879\u90fd\u6709\u4e00\u4e2a\u957f\u683c\u5f0f<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; \u4e0e\u77ed\u683c\u5f0f\uff1b\u90fd\u4f1a\u5728\u8fd9\u91cc\u8868\u793a\u51fa\u6765\u3002\u5982\u679c\u4f60\u628a\u4e00\u4e2a\u957f\u683c\u5f0f\u622a\u77ed\uff0c\u53ea\u8981\u4e0d\u5f15\u8d77\u6b67<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; \u4e49\uff0c\u90a3\u4e48\u5b83\u8fd8\u662f\u53ef\u4ee5\u88ab\u8bc6\u522b\u3002(\u5982\u679c\u4f60\u613f\u610f\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528 &#8216;+&#8217; \u800c\u975e &#8216;-&#8216; \u6807<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; \u8bb0\u9009\u9879\u53c2\u6570\uff0c\u4e0d\u8fc7\u6211\u4eec\u5728\u4f8b\u5b50\u4e2d\u4ecd\u7136\u9075\u4ece\u901a\u5e38\u7684\u60ef\u4f8b)<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; -help<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-h &nbsp; &nbsp; \u5217\u51fa\u6240\u6709\u9009\u9879\uff0c\u5e76\u9644\u7b80\u8981\u8bf4\u660e\u3002 &nbsp;&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-symbols=file<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-s file<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u8bfb\u51fa\u6587\u4ef6\uff08file\uff09\u4e2d\u7684\u7b26\u53f7\u8868\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-write&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5f00\u901a(enable)\u5f80\u53ef\u6267\u884c\u6587\u4ef6\u548c\u6838\u5fc3\u6587\u4ef6\u5199\u7684\u6743\u9650\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-exec=file<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-e file<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5728\u9002\u5f53\u65f6\u5019\u628aFile\u4f5c\u4e3a\u53ef\u6267\u884c\u7684\u6587\u4ef6\u6267\u884c\uff0c\u6765\u68c0\u6d4b\u4e0ecore dump\u7ed3\u5408\u7684\u6570\u636e\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;\uff0dse File<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u4eceFile\u8bfb\u53d6\u7b26\u53f7\u8868\u5e76\u628a\u5b83\u4f5c\u4e3a\u53ef\u6267\u884c\u6587\u4ef6\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;\uff0dcore File<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-c File<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u628aFile\u4f5c\u4e3acore dump\u6765\u6267\u884c\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;\uff0dcommand=File<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-x File<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u4eceFile\u4e2d\u6267\u884cGDB\u547d\u4ee4\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;\uff0ddirectory=Directory<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-d Directory<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u628aDicrctory\u52a0\u5165\u6e90\u6587\u4ef6\u641c\u7d22\u7684\u8def\u5f84\u4e2d\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-nx<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-n<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u4e0d\u4ece\u4efb\u4f55.gdbinit\u521d\u59cb\u5316\u6587\u4ef6\u4e2d\u6267\u884c\u547d\u4ee4\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u8fd9\u4e9b\u6587\u4ef6\u4e2d\u7684\u547d\u4ee4\u662f\u5728\u6240\u6709\u547d\u4ee4\u9009\u9879\u548c\u53c2\u6570\u5904\u7406\u5b8c\u540e\u624d\u6267\u884c\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-quiet<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-q<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8220;Quiet&#8221;.\u4e0d\u8f93\u5165\u4ecb\u7ecd\u548c\u7248\u6743\u4fe1\u606f\u3002\u8fd9\u4e9b\u4fe1\u606f\u8f93\u51fa\u5728batch\u6a21\u5f0f\u4e0b\u4e5f\u88ab\u5173\u95ed\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-batch<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u8fd0\u884cbatch\u6a21\u5f0f\u3002\u5728\u5904\u7406\u5b8c\u6240\u6709\u7528&#8217;-x&#8217;\u9009\u9879\u6307\u5b9a\u7684\u547d\u4ee4\u6587\u4ef6(\u8fd8\u6709&#8217;.gdbi-nit&#8217;,\u5982\u679c\u6ca1\u7981\u7528)\u540e\u9000\u51fa\uff0c\u5e76\u8fd4\u56de\u72b6\u6001\u78010.\u5982\u679c\u5728\u547d\u4ee4\u6587\u4ef6\u4e2d\u7684\u547d\u4ee4\u88ab<\/span><br \/>\n<span style=\"font-size:14px;\">\u6267\u884c\u65f6\u53d1\u751f\u9519\u8bef\uff0c\u5219\u9000\u51fa\uff0c\u5e76\u8fd4\u56de\u72b6\u6001\u7801\u975e0.batch\u6a21\u5f0f\u5bf9\u4e8e\u8fd0\u884cGDB\u4f5c\u4e3a\u8fc7\u6ee4\u5668\u4e5f\u8bb8\u5f88\u6709\u7528,\u6bd4\u5982\u8981\u4ece\u53e6\u4e00\u53f0\u7535\u8111\u4e0a\u4e0b\u8f7d\u5e76\u8fd0\u884c\u4e00\u4e2a\u7a0b\u5e8f;\u4e3a\u4e86\u8ba9\u8fd9\u4e9b\u66f4\u6709\u7528,\u5f53<\/span><br \/>\n<span style=\"font-size:14px;\">\u5728batch\u6a21\u5f0f\u4e0b\u8fd0\u884c\u65f6,\u6d88\u606f:Program exited normally.(\u4e0d\u8bba\u4ec0\u4e48\u65f6\u5019,\u4e00\u4e2a\u7a0b\u5e8f\u5728GDB\u63a7\u5236\u4e0b\u7ec8\u6b62\u8fd0\u884c,\u8fd9\u6761\u6d88\u606f\u90fd\u4f1a\u6b63\u5e38\u53d1\u51fa.),\u5c06\u4e0d\u4f1a\u53d1\u51fa.<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-cd=Directory<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u8fd0\u884cGDB,\u4f7f\u7528Directory\u4f5c\u4e3a\u5b83\u7684\u5de5\u4f5c\u76ee\u5f55,\u53d6\u4ee3\u5f53\u524d\u5de5\u4f5c\u76ee\u5f55.<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-fullname<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-f<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u5f53Emacs\u8ba9GDB\u4f5c\u4e3a\u4e00\u4e2a\u5b50\u8fdb\u7a0b\u8fd0\u884c\u65f6,\u8bbe\u7f6e\u8fd9\u4e2a\u9009\u9879.\u5b83\u544a\u8bc9GDB\u6bcf\u5f53\u4e00\u4e2a\u5806\u6808\u7ed3\u6784(\u6808\u5e27)\u663e\u793a\u51fa\u6765(\u5305\u62ec\u6bcf\u6b21\u7a0b\u5e8f\u505c\u6b62)\u5c31\u7528\u6807\u51c6\u7684,\u8ba4\u540c\u7684\u65b9\u5f0f<\/span><br \/>\n<span style=\"font-size:14px;\">\u8f93\u51fa\u6587\u4ef6\u5168\u540d\u548c\u884c\u53f7.\u8fd9\u91cc,\u8ba4\u540c\u7684\u683c\u5f0f\u770b\u8d77\u6765\u50cf\u4e24\u4e2a&#8217; 32&#8217;\u5b57\u7b26,\u7d27\u8ddf\u6587\u4ef6\u540d,\u884c\u53f7\u548c\u5b57\u7b26\u4f4d\u7f6e(\u7531\u5192\u53f7,\u6362\u884c\u7b26\u5206\u9694).Emacs\u540cGDB\u7684\u63a5\u53e3\u7a0b\u5e8f\u4f7f\u7528\u8fd9\u4e24\u4e2a&#8217; 32&#8217;\u5b57<\/span><br \/>\n<span style=\"font-size:14px;\">\u7b26\u4f5c\u4e3a\u4e00\u4e2a\u7b26\u53f7\u4e3a\u6846\u67b6\u6765\u663e\u793a\u6e90\u4ee3\u7801.<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-b Bps<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u8bbe\u7f6e\u884c\u901f(\u6ce2\u7279\u7387\u6216bits\/s).\u5728\u8fdc\u7a0b\u8c03\u8bd5\u4e2dGDB\u5728\u4efb\u4f55\u4e32\u884c\u63a5\u53e3\u4e2d\u4f7f\u7528\u7684\u884c\u901f.<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp;-tty=Device<\/span><br \/>\n<span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u4f7f\u7528Device\u4f5c\u4e3a\u4f60\u7a0b\u5e8f\u8fd0\u884c\u7684\u6807\u51c6\u8f93\u5165\u8f93\u51fa.<\/span><\/p>\n<p><span style=\"font-size:14px;\">gdb\u4e3b\u8981\u8c03\u8bd5\u7684\u662fC\/C++\u7684\u7a0b\u5e8f\u3002\u8981\u8c03\u8bd5C\/C++\u7684\u7a0b\u5e8f\uff0c\u9996\u5148\u5728\u7f16\u8bd1\u65f6\uff0c\u5fc5\u987b\u8981\u628a\u8c03\u8bd5\u4fe1\u606f\u52a0\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u3002\u4f7f\u7528\u7f16\u8bd1\u5668(cc\/gcc\/g++)\u7684 -g \u53c2\u6570\u5373\u53ef\u3002\u5982\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">[david@DAVID david]$ gcc -g hello.c -o hello<\/span><br \/>\n<span style=\"font-size:14px;\">[david@DAVID david]$ g++ -g hello.cpp -o hello<\/span><br \/>\n<span style=\"font-size:14px;\">\u5982\u679c\u6ca1\u6709-g\uff0c\u5c06\u770b\u4e0d\u89c1\u7a0b\u5e8f\u7684\u51fd\u6570\u540d\u548c\u53d8\u91cf\u540d\uff0c\u4ee3\u66ff\u5b83\u4eec\u7684\u5168\u662f\u8fd0\u884c\u65f6\u7684\u5185\u5b58\u5730\u5740\u3002\u5f53\u7528-g\u628a\u8c03\u8bd5\u4fe1\u606f\u52a0\u5165\uff0c\u5e76\u6210\u529f\u7f16\u8bd1\u76ee\u6807\u4ee3\u7801\u4ee5\u540e\uff0c\u770b\u770b\u5982\u4f55\u7528gdb\u6765\u8c03\u8bd5\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u542f\u52a8gdb\u7684\u65b9\u6cd5\u6709\u4ee5\u4e0b\u51e0\u79cd\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">1. gdb&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">program\u4e5f\u5c31\u662f\u6267\u884c\u6587\u4ef6\uff0c\u4e00\u822c\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">2. gdb core<\/span><br \/>\n<span style=\"font-size:14px;\">\u7528gdb\u540c\u65f6\u8c03\u8bd5\u4e00\u4e2a\u8fd0\u884c\u7a0b\u5e8f\u548ccore\u6587\u4ef6\uff0ccore\u662f\u7a0b\u5e8f\u975e\u6cd5\u6267\u884c\u540e\uff0ccore dump\u540e\u4ea7\u751f\u7684\u6587\u4ef6\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">3. gdb&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u5982\u679c\u7a0b\u5e8f\u662f\u4e00\u4e2a\u670d\u52a1\u7a0b\u5e8f\uff0c\u90a3\u4e48\u53ef\u4ee5\u6307\u5b9a\u8fd9\u4e2a\u670d\u52a1\u7a0b\u5e8f\u8fd0\u884c\u65f6\u7684\u8fdb\u7a0bID\u3002gdb\u4f1a\u81ea\u52a8attach\u4e0a\u53bb\uff0c\u5e76\u8c03\u8bd5\u5b83\u3002program\u5e94\u8be5\u5728PATH\u73af\u5883\u53d8\u91cf\u4e2d\u641c\u7d22\u5f97\u5230\u3002&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">gdb\u542f\u52a8\u65f6\uff0c\u53ef\u4ee5\u52a0\u4e0a\u4e00\u4e9bgdb\u7684\u542f\u52a8\u5f00\u5173\uff0c\u8be6\u7ec6\u7684\u5f00\u5173\u53ef\u4ee5\u7528gdb -help\u67e5\u770b\u3002\u4e0b\u9762\u53ea\u5217\u4e3e\u4e00\u4e9b\u6bd4\u8f83\u5e38\u7528\u7684\u53c2\u6570\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">-symbols&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">-s&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u4ece\u6307\u5b9a\u6587\u4ef6\u4e2d\u8bfb\u53d6\u7b26\u53f7\u8868\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">-se file&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u4ece\u6307\u5b9a\u6587\u4ef6\u4e2d\u8bfb\u53d6\u7b26\u53f7\u8868\u4fe1\u606f\uff0c\u5e76\u628a\u5b83\u7528\u5728\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">-core&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">-c&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u8c03\u8bd5\u65f6core dump\u7684core\u6587\u4ef6\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">-directory&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">-d&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u52a0\u5165\u4e00\u4e2a\u6e90\u6587\u4ef6\u7684\u641c\u7d22\u8def\u5f84\u3002\u9ed8\u8ba4\u641c\u7d22\u8def\u5f84\u662f\u73af\u5883\u53d8\u91cf\u4e2dPATH\u6240\u5b9a\u4e49\u7684\u8def\u5f84\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">4.1.1 &nbsp;gdb\u7684\u547d\u4ee4\u6982\u8c8c<\/span><br \/>\n<span style=\"font-size:14px;\">\u542f\u52a8gdb\u540e\uff0c\u8fdb\u5165gdb\u7684\u8c03\u8bd5\u73af\u5883\u4e2d\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528gdb\u7684\u547d\u4ee4\u5f00\u59cb\u8c03\u8bd5\u7a0b\u5e8f\u4e86\u3002gdb\u7684\u547d\u4ee4\u53ef\u4ee5\u4f7f\u7528help\u547d\u4ee4\u6765\u67e5\u770b\uff0c\u5982\u4e0b\u6240\u793a\uff1a &nbsp;&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">[david@DAVID david]$ gdb<\/span><br \/>\n<span style=\"font-size:14px;\">GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)<\/span><br \/>\n<span style=\"font-size:14px;\">Copyright 2003 Free Software Foundation, Inc.<\/span><br \/>\n<span style=\"font-size:14px;\">gdb is free software, covered by the GNU General Public License, and you are<\/span><br \/>\n<span style=\"font-size:14px;\">welcome to change it and\/or distribute copies of it under certain conditions.<\/span><br \/>\n<span style=\"font-size:14px;\">Type &#8220;show copying&#8221; to see the conditions.<\/span><br \/>\n<span style=\"font-size:14px;\">There is absolutely no warranty for gdb. &nbsp;Type &#8220;show warranty&#8221; for details.<\/span><br \/>\n<span style=\"font-size:14px;\">This gdb was configured as &#8220;i386-redhat-Linux-gnu&#8221;.<\/span><br \/>\n<span style=\"font-size:14px;\">(gdb) help<\/span><br \/>\n<span style=\"font-size:14px;\">List of classes of commands:<\/span><br \/>\n<span style=\"font-size:14px;\">aliases &#8212; Aliases of other commands<\/span><br \/>\n<span style=\"font-size:14px;\">breakpoints &#8212; Making program stop at certain points<\/span><br \/>\n<span style=\"font-size:14px;\">data &#8212; Examining data<\/span><br \/>\n<span style=\"font-size:14px;\">files &#8212; Specifying and examining files<\/span><br \/>\n<span style=\"font-size:14px;\">internals &#8212; Maintenance commands<\/span><br \/>\n<span style=\"font-size:14px;\">obscure &#8212; Obscure features<\/span><br \/>\n<span style=\"font-size:14px;\">running &#8212; Running the program<\/span><br \/>\n<span style=\"font-size:14px;\">stack &#8212; Examining the stack<\/span><br \/>\n<span style=\"font-size:14px;\">status &#8212; Status inquiries<\/span><br \/>\n<span style=\"font-size:14px;\">support &#8212; Support facilities<\/span><br \/>\n<span style=\"font-size:14px;\">tracepoints &#8212; Tracing of program execution without stopping the program<\/span><br \/>\n<span style=\"font-size:14px;\">user-defined &#8212; User-defined commands<\/span><br \/>\n<span style=\"font-size:14px;\">Type &#8220;help&#8221; followed by a class name for a list of commands in that class.<\/span><br \/>\n<span style=\"font-size:14px;\">Type &#8220;help&#8221; followed by command name for full documentation.<\/span><br \/>\n<span style=\"font-size:14px;\">Command name abbreviations are allowed if unambiguous.<\/span><br \/>\n<span style=\"font-size:14px;\">(gdb)<\/span><br \/>\n<span style=\"font-size:14px;\">gdb\u7684\u547d\u4ee4\u5f88\u591a\uff0cgdb\u5c06\u4e4b\u5206\u6210\u8bb8\u591a\u79cd\u7c7b\u3002help\u547d\u4ee4\u53ea\u662f\u5217\u51fagdb\u7684\u547d\u4ee4\u79cd\u7c7b\uff0c\u5982\u679c\u8981\u770b\u5176\u4e2d\u7684\u547d\u4ee4\uff0c\u53ef\u4ee5\u4f7f\u7528help \u547d\u4ee4\u3002\u5982\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">(gdb) help data<\/span><br \/>\n<span style=\"font-size:14px;\">\u4e5f\u53ef\u4ee5\u76f4\u63a5\u7528help [command]\u6765\u67e5\u770b\u547d\u4ee4\u7684\u5e2e\u52a9\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">gdb\u4e2d\uff0c\u8f93\u5165\u547d\u4ee4\u65f6\uff0c\u53ef\u4ee5\u4e0d\u7528\u8f93\u5165\u5168\u90e8\u547d\u4ee4\uff0c\u53ea\u7528\u8f93\u5165\u547d\u4ee4\u7684\u524d\u51e0\u4e2a\u5b57\u7b26\u5c31\u53ef\u4ee5\u4e86\u3002\u5f53\u7136\uff0c\u547d\u4ee4\u7684\u524d\u51e0\u4e2a\u5b57\u7b26\u5e94\u8be5\u6807\u5fd7\u7740\u4e00\u4e2a\u60df\u4e00\u7684\u547d\u4ee4\uff0c\u5728Linux\u4e0b\uff0c\u53ef\u4ee5\u6309\u4e24\u6b21TAB\u952e\u6765\u8865\u9f50\u547d\u4ee4\u7684\u5168\u79f0\uff0c\u5982\u679c\u6709\u91cd\u590d\u7684\uff0c\u90a3\u4e48gdb\u4f1a\u628a\u5b83\u5168\u90e8\u5217\u51fa\u6765\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u793a\u4f8b\u4e00\uff1a\u5728\u8fdb\u5165\u51fd\u6570func\u65f6\uff0c\u8bbe\u7f6e\u4e00\u4e2a\u65ad\u70b9\u3002\u53ef\u4ee5\u8f93\u5165break func\uff0c\u6216\u662f\u76f4\u63a5\u8f93\u5165b func\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">(gdb) b func<\/span><br \/>\n<span style=\"font-size:14px;\">Breakpoint 1 at 0x804832e: file test.c, line 5.<\/span><br \/>\n<span style=\"font-size:14px;\">(gdb)<\/span><br \/>\n<span style=\"font-size:14px;\">\u793a\u4f8b\u4e8c\uff1a\u8f93\u5165b\u6309\u4e24\u6b21TAB\u952e\uff0c\u4f60\u4f1a\u770b\u5230\u6240\u6709b\u5f00\u5934\u7684\u547d\u4ee4\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">(gdb) b<\/span><br \/>\n<span style=\"font-size:14px;\">backtrace &nbsp;break &nbsp;bt<\/span><br \/>\n<span style=\"font-size:14px;\">\u8981\u9000\u51fagdb\u65f6\uff0c\u53ea\u7528\u8f93\u5165quit\u6216\u5176\u7b80\u79f0q\u5c31\u884c\u4e86\u3002&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">4.1.2 &nbsp;gdb\u4e2d\u8fd0\u884cLinux\u7684shell\u7a0b\u5e8f<\/span><br \/>\n<span style=\"font-size:14px;\">\u5728gdb\u73af\u5883\u4e2d\uff0c\u53ef\u4ee5\u6267\u884cLinux\u7684shell\u547d\u4ee4\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">shell&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u8c03\u7528Linux\u7684shell\u6765\u6267\u884c\uff0c\u73af\u5883\u53d8\u91cfSHELL\u4e2d\u5b9a\u4e49\u7684Linux\u7684shell\u5c06\u4f1a\u7528\u6765\u6267\u884c\u3002\u5982\u679cSHELL\u6ca1\u6709\u5b9a\u4e49\uff0c\u90a3\u5c31\u4f7f\u7528Linux\u7684\u6807\u51c6shell\uff1a\/bin\/sh(\u5728Windows\u4e2d\u4f7f\u7528Command.com\u6216cmd.exe)\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u8fd8\u6709\u4e00\u4e2agdb\u547d\u4ee4\u662fmake\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">make&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u53ef\u4ee5\u5728gdb\u4e2d\u6267\u884cmake\u547d\u4ee4\u6765\u91cd\u65b0build\u81ea\u5df1\u7684\u7a0b\u5e8f\u3002\u8fd9\u4e2a\u547d\u4ee4\u7b49\u4ef7\u4e8eshell make \u3002 &nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">4.1.3 &nbsp;\u5728gdb\u4e2d\u8fd0\u884c\u7a0b\u5e8f<\/span><br \/>\n<span style=\"font-size:14px;\">\u5f53\u4ee5gdb \u65b9\u5f0f\u542f\u52a8gdb\u540e\uff0cgdb\u4f1a\u5728PATH\u8def\u5f84\u548c\u5f53\u524d\u76ee\u5f55\u4e2d\u641c\u7d22\u7684\u6e90\u6587\u4ef6\u3002\u5982\u8981\u786e\u8ba4gdb\u662f\u5426\u8bfb\u5230\u6e90\u6587\u4ef6\uff0c\u53ef\u4f7f\u7528l\u6216list\u547d\u4ee4\uff0c\u770b\u770bgdb\u662f\u5426\u80fd\u5217\u51fa\u6e90\u4ee3\u7801\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u5728gdb\u4e2d\uff0c\u8fd0\u884c\u7a0b\u5e8f\u4f7f\u7528r\u6216\u662frun\u547d\u4ee4\u3002\u7a0b\u5e8f\u7684\u8fd0\u884c\uff0c\u6709\u53ef\u80fd\u9700\u8981\u8bbe\u7f6e\u4e0b\u9762\u56db\u65b9\u9762\u7684\u4e8b\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">1. \u7a0b\u5e8f\u8fd0\u884c\u53c2\u6570<\/span><br \/>\n<span style=\"font-size:14px;\">set args \u53ef\u6307\u5b9a\u8fd0\u884c\u65f6\u53c2\u6570\u3002\u5982\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">set args 10 20 30 40 50<\/span><br \/>\n<span style=\"font-size:14px;\">show args \u547d\u4ee4\u53ef\u4ee5\u67e5\u770b\u8bbe\u7f6e\u597d\u7684\u8fd0\u884c\u53c2\u6570\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">2. \u8fd0\u884c\u73af\u5883<\/span><br \/>\n<span style=\"font-size:14px;\">path<\/span><br \/>\n<span style=\"font-size:14px;\">\u53ef\u8bbe\u5b9a\u7a0b\u5e8f\u7684\u8fd0\u884c\u8def\u5f84\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">show paths \u67e5\u770b\u7a0b\u5e8f\u7684\u8fd0\u884c\u8def\u5f84\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">set environment varname [=value] \u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u3002\u5982\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">set env USER=hchen<\/span><br \/>\n<span style=\"font-size:14px;\">show environment [varname] \u67e5\u770b\u73af\u5883\u53d8\u91cf\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">3. \u5de5\u4f5c\u76ee\u5f55<\/span><br \/>\n<span style=\"font-size:14px;\">cd<\/span><br \/>\n<span style=\"font-size:14px;\">\u76f8\u5f53\u4e8eshell\u7684cd\u547d\u4ee4\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">pwd \u663e\u793a\u5f53\u524d\u7684\u6240\u5728\u76ee\u5f55\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">4. \u7a0b\u5e8f\u7684\u8f93\u5165\u8f93\u51fa<\/span><br \/>\n<span style=\"font-size:14px;\">info terminal \u663e\u793a\u7a0b\u5e8f\u7528\u5230\u7684\u7ec8\u7aef\u7684\u6a21\u5f0f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u4f7f\u7528\u91cd\u5b9a\u5411\u63a7\u5236\u7a0b\u5e8f\u8f93\u51fa\u3002\u5982\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">run &gt; outfile<\/span><br \/>\n<span style=\"font-size:14px;\">tty\u547d\u4ee4\u53ef\u4ee5\u6307\u5199\u8f93\u5165\u8f93\u51fa\u7684\u7ec8\u7aef\u8bbe\u5907\u3002\u5982\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">tty \/dev\/ttyb<\/span><br \/>\n<span style=\"font-size:14px;\">4.1.4 &nbsp;\u8c03\u8bd5\u5df2\u8fd0\u884c\u7684\u7a0b\u5e8f<\/span><br \/>\n<span style=\"font-size:14px;\">\u8c03\u8bd5\u5df2\u7ecf\u8fd0\u884c\u7684\u7a0b\u5e8f\u6709\u4e24\u79cd\u65b9\u6cd5\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">\u25cf &nbsp; &nbsp; &nbsp; \u5728Linux\u4e0b\u7528ps(\u7b2c\u4e00\u7ae0\u5df2\u7ecf\u5bf9ps\u4f5c\u4e86\u4ecb\u7ecd)\u67e5\u770b\u6b63\u5728\u8fd0\u884c\u7684\u7a0b\u5e8f\u7684PID(\u8fdb\u7a0bID)\uff0c\u7136\u540e\u7528gdb PID\u683c\u5f0f\u6302\u63a5\u6b63\u5728\u8fd0\u884c\u7684\u7a0b\u5e8f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u25cf &nbsp; &nbsp; &nbsp; \u5148\u7528gdb \u5173\u8054\u4e0a\u6e90\u4ee3\u7801\uff0c\u5e76\u8fdb\u884cgdb\uff0c\u5728gdb\u4e2d\u7528attach\u547d\u4ee4\u6765\u6302\u63a5\u8fdb\u7a0b\u7684PID\uff0c\u5e76\u7528detach\u6765\u53d6\u6d88\u6302\u63a5\u7684\u8fdb\u7a0b\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">4.1.5 &nbsp;\u6682\u505c\/\u6062\u590d\u7a0b\u5e8f\u8fd0\u884c<\/span><br \/>\n<span style=\"font-size:14px;\">\u8c03\u8bd5\u7a0b\u5e8f\u4e2d\uff0c\u6682\u505c\u7a0b\u5e8f\u8fd0\u884c\u662f\u5fc5\u9700\u7684\uff0cgdb\u53ef\u4ee5\u65b9\u4fbf\u5730\u6682\u505c\u7a0b\u5e8f\u7684\u8fd0\u884c\u3002\u53ef\u4ee5\u8bbe\u7f6e\u7a0b\u5e8f\u5728\u54ea\u884c\u505c\u4f4f\uff0c\u5728\u4ec0\u4e48\u6761\u4ef6\u4e0b\u505c\u4f4f\uff0c\u5728\u6536\u5230\u4ec0\u4e48\u4fe1\u53f7\u65f6\u505c\u5f80\u7b49\uff0c\u4ee5\u4fbf\u4e8e\u7528\u6237\u67e5\u770b\u8fd0\u884c\u65f6\u7684\u53d8\u91cf\uff0c\u4ee5\u53ca\u8fd0\u884c\u65f6\u7684\u6d41\u7a0b\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u5f53\u8fdb\u7a0b\u88abgdb\u505c\u4f4f\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528info program \u6765\u67e5\u770b\u7a0b\u5e8f\u662f\u5426\u5728\u8fd0\u884c\u3001\u8fdb\u7a0b\u53f7\u3001\u88ab\u6682\u505c\u7684\u539f\u56e0\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u5728gdb\u4e2d\uff0c\u6709\u4ee5\u4e0b\u51e0\u79cd\u6682\u505c\u65b9\u5f0f\uff1a\u65ad\u70b9(BreakPoint)\u3001\u89c2\u5bdf\u70b9(WatchPoint)\u3001\u6355\u6349\u70b9(CatchPoint)\u3001\u4fe1\u53f7(Signals)\u53ca\u7ebf\u7a0b\u505c\u6b62(Thread Stops)\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u5982\u679c\u8981\u6062\u590d\u7a0b\u5e8f\u8fd0\u884c\uff0c\u53ef\u4ee5\u4f7f\u7528c\u6216\u662fcontinue\u547d\u4ee4\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">1. \u8bbe\u7f6e\u65ad\u70b9(BreakPoint) &nbsp;&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u7528break\u547d\u4ee4\u6765\u8bbe\u7f6e\u65ad\u70b9\u3002\u6709\u4e0b\u9762\u51e0\u79cd\u8bbe\u7f6e\u65ad\u70b9\u7684\u65b9\u6cd5\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">break&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u5728\u8fdb\u5165\u6307\u5b9a\u51fd\u6570\u65f6\u505c\u4f4f\u3002C++\u4e2d\u53ef\u4ee5\u4f7f\u7528class::function\u6216function(type,type)\u683c\u5f0f\u6765\u6307\u5b9a\u51fd\u6570\u540d\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">break&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u5728\u6307\u5b9a\u884c\u53f7\u505c\u4f4f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">break +offset&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">break -offset&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u5728\u5f53\u524d\u884c\u53f7\u7684\u524d\u9762\u6216\u540e\u9762\u7684offset\u884c\u505c\u4f4f\u3002offiset\u4e3a\u81ea\u7136\u6570\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">break filename:linenum&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u5728\u6e90\u6587\u4ef6filename\u7684linenum\u884c\u5904\u505c\u4f4f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">break filename:function&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u5728\u6e90\u6587\u4ef6filename\u7684function\u51fd\u6570\u7684\u5165\u53e3\u5904\u505c\u4f4f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">break *address<\/span><br \/>\n<span style=\"font-size:14px;\">\u5728\u7a0b\u5e8f\u8fd0\u884c\u7684\u5185\u5b58\u5730\u5740\u5904\u505c\u4f4f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">break&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u8be5\u547d\u4ee4\u6ca1\u6709\u53c2\u6570\u65f6\uff0c\u8868\u793a\u5728\u4e0b\u4e00\u6761\u6307\u4ee4\u5904\u505c\u4f4f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">break &#8230; if&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">condition\u8868\u793a\u6761\u4ef6\uff0c\u5728\u6761\u4ef6\u6210\u7acb\u65f6\u505c\u4f4f\u3002\u6bd4\u5982\u5728\u5faa\u73af\u4f53\u4e2d\uff0c\u53ef\u4ee5\u8bbe\u7f6ebreak if i=100\uff0c\u8868\u793a\u5f53i\u4e3a100\u65f6\u505c\u4f4f\u7a0b\u5e8f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u67e5\u770b\u65ad\u70b9\u65f6\uff0c\u53ef\u4f7f\u7528info\u547d\u4ee4\uff0c\u5982\u4e0b\u6240\u793a(\u6ce8\uff1an\u8868\u793a\u65ad\u70b9\u53f7)\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">info breakpoints [n]&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">info break [n] &nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">2. \u8bbe\u7f6e\u89c2\u5bdf\u70b9(WatchPoint) &nbsp;&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u89c2\u5bdf\u70b9\u4e00\u822c\u7528\u6765\u89c2\u5bdf\u67d0\u4e2a\u8868\u8fbe\u5f0f(\u53d8\u91cf\u4e5f\u662f\u4e00\u79cd\u8868\u8fbe\u5f0f)\u7684\u503c\u662f\u5426\u53d8\u5316\u4e86\u3002\u5982\u679c\u6709\u53d8\u5316\uff0c\u9a6c\u4e0a\u505c\u4f4f\u7a0b\u5e8f\u3002\u6709\u4e0b\u9762\u7684\u51e0\u79cd\u65b9\u6cd5\u6765\u8bbe\u7f6e\u89c2\u5bdf\u70b9\uff1a &nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">watch&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u4e3a\u8868\u8fbe\u5f0f(\u53d8\u91cf)expr\u8bbe\u7f6e\u4e00\u4e2a\u89c2\u5bdf\u70b9\u3002\u4e00\u65e6\u8868\u8fbe\u5f0f\u503c\u6709\u53d8\u5316\u65f6\uff0c\u9a6c\u4e0a\u505c\u4f4f\u7a0b\u5e8f\u3002 &nbsp; &nbsp;&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">rwatch&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u5f53\u8868\u8fbe\u5f0f(\u53d8\u91cf)expr\u88ab\u8bfb\u65f6\uff0c\u505c\u4f4f\u7a0b\u5e8f\u3002 &nbsp; &nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">awatch&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u5f53\u8868\u8fbe\u5f0f(\u53d8\u91cf)\u7684\u503c\u88ab\u8bfb\u6216\u88ab\u5199\u65f6\uff0c\u505c\u4f4f\u7a0b\u5e8f\u3002&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">info watchpoints<\/span><br \/>\n<span style=\"font-size:14px;\">\u5217\u51fa\u5f53\u524d\u8bbe\u7f6e\u7684\u6240\u6709\u89c2\u5bdf\u70b9\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">3. \u8bbe\u7f6e\u6355\u6349\u70b9(CatchPoint)<\/span><br \/>\n<span style=\"font-size:14px;\">\u53ef\u8bbe\u7f6e\u6355\u6349\u70b9\u6765\u8865\u6349\u7a0b\u5e8f\u8fd0\u884c\u65f6\u7684\u4e00\u4e9b\u4e8b\u4ef6\u3002\u5982\u8f7d\u5165\u5171\u4eab\u5e93(\u52a8\u6001\u94fe\u63a5\u5e93)\u6216\u662fC++\u7684\u5f02\u5e38\u3002\u8bbe\u7f6e\u6355\u6349\u70b9\u7684\u683c\u5f0f\u4e3a\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">catch&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u5f53event\u53d1\u751f\u65f6\uff0c\u505c\u4f4f\u7a0b\u5e8f\u3002event\u53ef\u4ee5\u662f\u4e0b\u9762\u7684\u5185\u5bb9\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">\u25cf &nbsp; &nbsp; &nbsp; throw &nbsp;\u4e00\u4e2aC++\u629b\u51fa\u7684\u5f02\u5e38 (throw\u4e3a\u5173\u952e\u5b57)\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u25cf &nbsp; &nbsp; &nbsp; catch &nbsp;\u4e00\u4e2aC++\u6355\u6349\u5230\u7684\u5f02\u5e38 (catch\u4e3a\u5173\u952e\u5b57)\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u25cf &nbsp; &nbsp; &nbsp; exec &nbsp;\u8c03\u7528\u7cfb\u7edf\u8c03\u7528exec\u65f6(exec\u4e3a\u5173\u952e\u5b57\uff0c\u76ee\u524d\u6b64\u529f\u80fd\u53ea\u5728HP-UX\u4e0b\u6709\u7528)\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u25cf &nbsp; &nbsp; &nbsp; fork &nbsp;\u8c03\u7528\u7cfb\u7edf\u8c03\u7528fork\u65f6(fork\u4e3a\u5173\u952e\u5b57\uff0c\u76ee\u524d\u6b64\u529f\u80fd\u53ea\u5728HP-UX\u4e0b\u6709\u7528)\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u25cf &nbsp; &nbsp; &nbsp; vfork &nbsp;\u8c03\u7528\u7cfb\u7edf\u8c03\u7528vfork\u65f6(vfork\u4e3a\u5173\u952e\u5b57\uff0c\u76ee\u524d\u6b64\u529f\u80fd\u53ea\u5728HP-UX\u4e0b\u6709)\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u25cf &nbsp; &nbsp; &nbsp; load \u6216 load &nbsp; \u8f7d\u5165\u5171\u4eab\u5e93(\u52a8\u6001\u94fe\u63a5\u5e93)\u65f6 (load\u4e3a\u5173\u952e\u5b57\uff0c\u76ee\u524d\u6b64\u529f\u80fd\u53ea\u5728HP-UX\u4e0b\u6709\u7528)\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u25cf &nbsp; &nbsp; &nbsp; unload \u6216 unload &nbsp; \u5378\u8f7d\u5171\u4eab\u5e93(\u52a8\u6001\u94fe\u63a5\u5e93)\u65f6 (unload\u4e3a\u5173\u952e\u5b57\uff0c\u76ee\u524d\u6b64\u529f\u80fd\u53ea\u5728HP-UX\u4e0b\u6709\u7528)\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">tcatch&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u53ea\u8bbe\u7f6e\u4e00\u6b21\u6355\u6349\u70b9\uff0c\u5f53\u7a0b\u5e8f\u505c\u4f4f\u4ee5\u540e\uff0c\u5e94\u70b9\u88ab\u81ea\u52a8\u5220\u9664\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">4. \u7ef4\u62a4\u505c\u6b62\u70b9<\/span><br \/>\n<span style=\"font-size:14px;\">\u4e0a\u9762\u8bf4\u4e86\u5982\u4f55\u8bbe\u7f6e\u7a0b\u5e8f\u7684\u505c\u6b62\u70b9\uff0cgdb\u4e2d\u7684\u505c\u6b62\u70b9\u4e5f\u5c31\u662f\u4e0a\u8ff0\u7684\u4e09\u7c7b\u3002\u5728gdb\u4e2d\uff0c\u5982\u679c\u89c9\u5f97\u5df2\u5b9a\u4e49\u597d\u7684\u505c\u6b62\u70b9\u6ca1\u6709\u7528\u4e86\uff0c\u53ef\u4ee5\u4f7f\u7528delete\u3001clear\u3001disable\u3001enable\u8fd9\u51e0\u4e2a\u547d\u4ee4\u6765\u8fdb\u884c\u7ef4\u62a4\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">Clear<\/span><br \/>\n<span style=\"font-size:14px;\">\u6e05\u9664\u6240\u6709\u7684\u5df2\u5b9a\u4e49\u7684\u505c\u6b62\u70b9\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">clear&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">clear&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u6e05\u9664\u6240\u6709\u8bbe\u7f6e\u5728\u51fd\u6570\u4e0a\u7684\u505c\u6b62\u70b9\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">clear&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">clear&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u6e05\u9664\u6240\u6709\u8bbe\u7f6e\u5728\u6307\u5b9a\u884c\u4e0a\u7684\u505c\u6b62\u70b9\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">delete [breakpoints] [range&#8230;]<\/span><br \/>\n<span style=\"font-size:14px;\">\u5220\u9664\u6307\u5b9a\u7684\u65ad\u70b9\uff0cbreakpoints\u4e3a\u65ad\u70b9\u53f7\u3002\u5982\u679c\u4e0d\u6307\u5b9a\u65ad\u70b9\u53f7\uff0c\u5219\u8868\u793a\u5220\u9664\u6240\u6709\u7684\u65ad\u70b9\u3002range \u8868\u793a\u65ad\u70b9\u53f7\u7684\u8303\u56f4(\u5982:3-7)\u3002\u5176\u7b80\u5199\u547d\u4ee4\u4e3ad\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u6bd4\u5220\u9664\u66f4\u597d\u7684\u4e00\u79cd\u65b9\u6cd5\u662fdisable\u505c\u6b62\u70b9\u3002disable\u4e86\u7684\u505c\u6b62\u70b9\uff0cgdb\u4e0d\u4f1a\u5220\u9664\uff0c\u5f53\u8fd8\u9700\u8981\u65f6\uff0cenable\u5373\u53ef\uff0c\u5c31\u597d\u50cf\u56de\u6536\u7ad9\u4e00\u6837\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">disable [breakpoints] [range&#8230;]<\/span><br \/>\n<span style=\"font-size:14px;\">disable\u6240\u6307\u5b9a\u7684\u505c\u6b62\u70b9\uff0cbreakpoints\u4e3a\u505c\u6b62\u70b9\u53f7\u3002\u5982\u679c\u4ec0\u4e48\u90fd\u4e0d\u6307\u5b9a\uff0c\u8868\u793adisable\u6240\u6709\u7684\u505c\u6b62\u70b9\u3002\u7b80\u5199\u547d\u4ee4\u662fdis.<\/span><br \/>\n<span style=\"font-size:14px;\">enable [breakpoints] [range&#8230;]<\/span><br \/>\n<span style=\"font-size:14px;\">enable\u6240\u6307\u5b9a\u7684\u505c\u6b62\u70b9\uff0cbreakpoints\u4e3a\u505c\u6b62\u70b9\u53f7\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">enable [breakpoints] once range&#8230;<\/span><br \/>\n<span style=\"font-size:14px;\">enable\u6240\u6307\u5b9a\u7684\u505c\u6b62\u70b9\u4e00\u6b21\uff0c\u5f53\u7a0b\u5e8f\u505c\u6b62\u540e\uff0c\u8be5\u505c\u6b62\u70b9\u9a6c\u4e0a\u88abgdb\u81ea\u52a8disable\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">enable [breakpoints] delete range&#8230;<\/span><br \/>\n<span style=\"font-size:14px;\">enable\u6240\u6307\u5b9a\u7684\u505c\u6b62\u70b9\u4e00\u6b21\uff0c\u5f53\u7a0b\u5e8f\u505c\u6b62\u540e\uff0c\u8be5\u505c\u6b62\u70b9\u9a6c\u4e0a\u88abgdb\u81ea\u52a8\u5220\u9664\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">5. \u505c\u6b62\u6761\u4ef6\u7ef4\u62a4<\/span><br \/>\n<span style=\"font-size:14px;\">\u524d\u9762\u5728\u4ecb\u7ecd\u8bbe\u7f6e\u65ad\u70b9\u65f6\uff0c\u63d0\u5230\u8fc7\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u6761\u4ef6\uff0c\u5f53\u6761\u4ef6\u6210\u7acb\u65f6\uff0c\u7a0b\u5e8f\u81ea\u52a8\u505c\u6b62\u3002\u8fd9\u662f\u4e00\u4e2a\u975e\u5e38\u5f3a\u5927\u7684\u529f\u80fd\uff0c\u8fd9\u91cc\uff0c\u4e13\u95e8\u4ecb\u7ecd\u8fd9\u4e2a\u6761\u4ef6\u7684\u76f8\u5173\u7ef4\u62a4\u547d\u4ee4\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u4e00\u822c\u6765\u8bf4\uff0c\u4e3a\u65ad\u70b9\u8bbe\u7f6e\u4e00\u4e2a\u6761\u4ef6\uff0c\u53ef\u4f7f\u7528if\u5173\u952e\u8bcd\uff0c\u540e\u9762\u8ddf\u5176\u65ad\u70b9\u6761\u4ef6\u3002\u5e76\u4e14\uff0c\u6761\u4ef6\u8bbe\u7f6e\u597d\u540e\uff0c\u53ef\u4ee5\u7528condition\u547d\u4ee4\u6765\u4fee\u6539\u65ad\u70b9\u7684\u6761\u4ef6(\u53ea\u6709break\u548cwatch\u547d\u4ee4\u652f\u6301if\uff0ccatch\u76ee\u524d\u6682\u4e0d\u652f\u6301if)\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">condition&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u4fee\u6539\u65ad\u70b9\u53f7\u4e3abnum\u7684\u505c\u6b62\u6761\u4ef6\u4e3aexpression\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">condition&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u6e05\u9664\u65ad\u70b9\u53f7\u4e3abnum\u7684\u505c\u6b62\u6761\u4ef6\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u8fd8\u6709\u4e00\u4e2a\u6bd4\u8f83\u7279\u6b8a\u7684\u7ef4\u62a4\u547d\u4ee4ignore\uff0c\u53ef\u4ee5\u6307\u5b9a\u7a0b\u5e8f\u8fd0\u884c\u65f6\uff0c\u5ffd\u7565\u505c\u6b62\u6761\u4ef6\u51e0\u6b21\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">ignore&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u8868\u793a\u5ffd\u7565\u65ad\u70b9\u53f7\u4e3abnum\u7684\u505c\u6b62\u6761\u4ef6count\u6b21\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">6. \u4e3a\u505c\u6b62\u70b9\u8bbe\u5b9a\u8fd0\u884c\u547d\u4ee4<\/span><br \/>\n<span style=\"font-size:14px;\">\u53ef\u4ee5\u4f7f\u7528gdb\u63d0\u4f9b\u7684command\u547d\u4ee4\u6765\u8bbe\u7f6e\u505c\u6b62\u70b9\u7684\u8fd0\u884c\u547d\u4ee4\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5f53\u8fd0\u884c\u7684\u7a0b\u5e8f\u5728\u88ab\u505c\u4f4f\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u8ba9\u5176\u81ea\u52a8\u8fd0\u884c\u4e00\u4e9b\u522b\u7684\u547d\u4ee4\uff0c\u8fd9\u5f88\u6709\u5229\u884c\u81ea\u52a8\u5316\u8c03\u8bd5\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">commands [bnum]<\/span><br \/>\n<span style=\"font-size:14px;\">&#8230; command-list &#8230;<\/span><br \/>\n<span style=\"font-size:14px;\">end<\/span><br \/>\n<span style=\"font-size:14px;\">\u4e3a\u65ad\u70b9\u53f7bnum\u6307\u5b9a\u4e00\u4e2a\u547d\u4ee4\u5217\u8868\u3002\u5f53\u7a0b\u5e8f\u88ab\u8be5\u65ad\u70b9\u505c\u4f4f\u65f6\uff0cgdb\u4f1a\u4f9d\u6b21\u8fd0\u884c\u547d\u4ee4\u5217\u8868\u4e2d\u7684\u547d\u4ee4\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u4f8b\u5982\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">break foo if x&gt;0<\/span><br \/>\n<span style=\"font-size:14px;\">commands<\/span><br \/>\n<span style=\"font-size:14px;\">printf &#8220;x is %d\\n&#8221;,x<\/span><br \/>\n<span style=\"font-size:14px;\">continue<\/span><br \/>\n<span style=\"font-size:14px;\">end<\/span><br \/>\n<span style=\"font-size:14px;\">\u65ad\u70b9\u8bbe\u7f6e\u5728\u51fd\u6570foo\u4e2d\uff0c\u65ad\u70b9\u6761\u4ef6\u662fx&gt;0\uff0c\u5982\u679c\u7a0b\u5e8f\u88ab\u65ad\u4f4f\u540e\uff0c\u4e5f\u5c31\u662f\u4e00\u65e6x\u7684\u503c\u5728foo\u51fd\u6570\u4e2d\u5927\u4e8e0\uff0cgdb\u4f1a\u81ea\u52a8\u6253\u5370\u51fax\u7684\u503c\uff0c\u5e76\u7ee7\u7eed\u8fd0\u884c\u7a0b\u5e8f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u5982\u679c\u8981\u6e05\u9664\u65ad\u70b9\u4e0a\u7684\u547d\u4ee4\u5e8f\u5217\uff0c\u90a3\u4e48\u53ea\u8981\u7b80\u5355\u5730\u6267\u884c\u4e00\u4e0bcommands\u547d\u4ee4\uff0c\u5e76\u76f4\u63a5\u5728\u8f93\u5165end\u5c31\u884c\u4e86\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">7. \u65ad\u70b9\u83dc\u5355<\/span><br \/>\n<span style=\"font-size:14px;\">\u5728C++\u4e2d\uff0c\u53ef\u80fd\u4f1a\u91cd\u590d\u51fa\u73b0\u540c\u4e00\u4e2a\u540d\u5b57\u7684\u51fd\u6570\u82e5\u5e72\u6b21(\u51fd\u6570\u91cd\u8f7d)\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0cbreak \u4e0d\u80fd\u544a\u8bc9gdb\u8981\u505c\u5728\u54ea\u4e2a\u51fd\u6570\u7684\u5165\u53e3\u3002\u5f53\u7136\uff0c\u53ef\u4ee5\u4f7f\u7528break \uff0c\u4e5f\u5c31\u662f\u628a\u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b\u544a\u8bc9gdb\uff0c\u4ee5\u6307\u5b9a\u4e00\u4e2a\u51fd\u6570\u3002\u5426\u5219\u7684\u8bdd\uff0cgdb\u4f1a\u5217\u51fa\u4e00\u4e2a\u65ad\u70b9\u83dc\u5355\u4f9b\u7528\u6237\u9009\u62e9\u6240\u9700\u8981\u7684\u65ad\u70b9\u3002\u53ea\u8981\u8f93\u5165\u83dc\u5355\u5217\u8868\u4e2d\u7684\u7f16\u53f7\u5c31\u53ef\u4ee5\u4e86\u3002\u5982\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">(gdb) b String::after<\/span><br \/>\n<span style=\"font-size:14px;\">[0] cancel<\/span><br \/>\n<span style=\"font-size:14px;\">[1] all<\/span><br \/>\n<span style=\"font-size:14px;\">[2] file:String.cc; line number:867<\/span><br \/>\n<span style=\"font-size:14px;\">[3] file:String.cc; line number:860<\/span><br \/>\n<span style=\"font-size:14px;\">[4] file:String.cc; line number:875<\/span><br \/>\n<span style=\"font-size:14px;\">[5] file:String.cc; line number:853<\/span><br \/>\n<span style=\"font-size:14px;\">[6] file:String.cc; line number:846<\/span><br \/>\n<span style=\"font-size:14px;\">[7] file:String.cc; line number:735<\/span><br \/>\n<span style=\"font-size:14px;\">&gt; 2 4 6<\/span><br \/>\n<span style=\"font-size:14px;\">Breakpoint 1 at 0xb26c: file String.cc, line 867.<\/span><br \/>\n<span style=\"font-size:14px;\">Breakpoint 2 at 0xb344: file String.cc, line 875.<\/span><br \/>\n<span style=\"font-size:14px;\">Breakpoint 3 at 0xafcc: file String.cc, line 846.<\/span><br \/>\n<span style=\"font-size:14px;\">Multiple breakpoints were set.<\/span><br \/>\n<span style=\"font-size:14px;\">Use the &#8220;delete&#8221; command to delete unwanted<\/span><br \/>\n<span style=\"font-size:14px;\">breakpoints.<\/span><br \/>\n<span style=\"font-size:14px;\">(gdb) &nbsp; &nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u53ef\u89c1\uff0cgdb\u5217\u51fa\u4e86\u6240\u6709after\u7684\u91cd\u8f7d\u51fd\u6570\uff0c\u9009\u4e00\u4e0b\u5217\u8868\u7f16\u53f7\u5c31\u884c\u4e86\u30020\u8868\u793a\u653e\u5f03\u8bbe\u7f6e\u65ad\u70b9\uff0c1\u8868\u793a\u6240\u6709\u51fd\u6570\u90fd\u8bbe\u7f6e\u65ad\u70b9\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">8. \u6062\u590d\u7a0b\u5e8f\u8fd0\u884c\u548c\u5355\u6b65\u8c03\u8bd5<\/span><br \/>\n<span style=\"font-size:14px;\">\u5f53\u7a0b\u5e8f\u88ab\u505c\u4f4f\u540e\uff0c\u53ef\u4ee5\u7528continue\u547d\u4ee4\u6062\u590d\u7a0b\u5e8f\u7684\u8fd0\u884c\u76f4\u5230\u7a0b\u5e8f\u7ed3\u675f\uff0c\u6216\u4e0b\u4e00\u4e2a\u65ad\u70b9\u5230\u6765\u3002\u4e5f\u53ef\u4ee5\u4f7f\u7528step\u6216next\u547d\u4ee4\u5355\u6b65\u8ddf\u8e2a\u7a0b\u5e8f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">continue [ignore-count]<\/span><br \/>\n<span style=\"font-size:14px;\">c [ignore-count]<\/span><br \/>\n<span style=\"font-size:14px;\">fg [ignore-count]<\/span><br \/>\n<span style=\"font-size:14px;\">\u6062\u590d\u7a0b\u5e8f\u8fd0\u884c\uff0c\u76f4\u5230\u7a0b\u5e8f\u7ed3\u675f\uff0c\u6216\u662f\u4e0b\u4e00\u4e2a\u65ad\u70b9\u5230\u6765\u3002ignore-count\u8868\u793a\u5ffd\u7565\u5176\u540e\u7684\u65ad\u70b9\u6b21\u6570\u3002continue\uff0cc\uff0cfg\u4e09\u4e2a\u547d\u4ee4\u90fd\u662f\u4e00\u6837\u7684\u610f\u601d\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">step&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u5355\u6b65\u8ddf\u8e2a\uff0c\u5982\u679c\u6709\u51fd\u6570\u8c03\u7528\uff0c\u5b83\u4f1a\u8fdb\u5165\u8be5\u51fd\u6570\u3002\u8fdb\u5165\u51fd\u6570\u7684\u524d\u63d0\u662f\uff0c\u6b64\u51fd\u6570\u88ab\u7f16\u8bd1\u6709debug\u4fe1\u606f\u3002\u5f88\u50cfVC\u7b49\u5de5\u5177\u4e2d\u7684step in\u3002\u540e\u9762\u53ef\u4ee5\u52a0count\u4e5f\u53ef\u4ee5\u4e0d\u52a0\uff0c\u4e0d\u52a0\u8868\u793a\u4e00\u6761\u6761\u5730\u6267\u884c\uff0c\u52a0\u8868\u793a\u6267\u884c\u540e\u9762\u7684count\u6761\u6307\u4ee4\uff0c\u7136\u540e\u518d\u505c\u4f4f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">next&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\u540c\u6837\u5355\u6b65\u8ddf\u8e2a\uff0c\u5982\u679c\u6709\u51fd\u6570\u8c03\u7528\uff0c\u5b83\u4e0d\u4f1a\u8fdb\u5165\u8be5\u51fd\u6570(\u5f88\u50cfVC\u7b49\u5de5\u5177\u4e2d\u7684step over)\u3002\u540e\u9762\u53ef\u4ee5\u52a0count\u4e5f\u53ef\u4ee5\u4e0d\u52a0\uff0c\u4e0d\u52a0\u8868\u793a\u4e00\u6761\u6761\u5730\u6267\u884c\uff0c\u52a0\u8868\u793a\u6267\u884c\u540e\u9762\u7684count\u6761\u6307\u4ee4\uff0c\u7136\u540e\u518d\u505c\u4f4f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">set step-mode<\/span><br \/>\n<span style=\"font-size:14px;\">set step-mode on<\/span><br \/>\n<span style=\"font-size:14px;\">\u6253\u5f00step-mode\u6a21\u5f0f\u3002\u5728\u8fdb\u884c\u5355\u6b65\u8ddf\u8e2a\u65f6\uff0c\u7a0b\u5e8f\u4e0d\u4f1a\u56e0\u4e3a\u6ca1\u6709debug\u4fe1\u606f\u800c\u4e0d\u505c\u4f4f\u3002\u8fd9\u4e2a\u53c2\u6570\u6709\u5f88\u5229\u4e8e\u67e5\u770b\u673a\u5668\u7801\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">set step-mod off<\/span><br \/>\n<span style=\"font-size:14px;\">\u5173\u95edstep-mode\u6a21\u5f0f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">finish<\/span><br \/>\n<span style=\"font-size:14px;\">\u8fd0\u884c\u7a0b\u5e8f\uff0c\u76f4\u5230\u5f53\u524d\u51fd\u6570\u5b8c\u6210\u8fd4\u56de\u3002\u5e76\u6253\u5370\u51fd\u6570\u8fd4\u56de\u65f6\u7684\u5806\u6808\u5730\u5740\u548c\u8fd4\u56de\u503c\u53ca\u53c2\u6570\u503c\u7b49\u4fe1\u606f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">until \u6216 u<\/span><br \/>\n<span style=\"font-size:14px;\">\u5f53\u538c\u5026\u4e86\u5728\u4e00\u4e2a\u5faa\u73af\u4f53\u5185\u5355\u6b65\u8ddf\u8e2a\u65f6\uff0c\u8fd9\u4e2a\u547d\u4ee4\u53ef\u4ee5\u8fd0\u884c\u7a0b\u5e8f\u76f4\u5230\u9000\u51fa\u5faa\u73af\u4f53\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">stepi \u6216 si<\/span><br \/>\n<span style=\"font-size:14px;\">nexti \u6216 ni<\/span><br \/>\n<span style=\"font-size:14px;\">\u5355\u6b65\u8ddf\u8e2a\u4e00\u6761\u673a\u5668\u6307\u4ee4\u3002\u4e00\u6761\u7a0b\u5e8f\u4ee3\u7801\u6709\u53ef\u80fd\u7531\u6570\u6761\u673a\u5668\u6307\u4ee4\u5b8c\u6210\uff0cstepi\u548cnexti\u53ef\u4ee5\u5355\u6b65\u6267\u884c\u673a\u5668\u6307\u4ee4\u3002\u4e0e\u4e4b\u4e00\u6837\u6709\u76f8\u540c\u529f\u80fd\u7684\u547d\u4ee4\u662fdisplay\/i $pc\uff0c\u5f53\u8fd0\u884c\u5b8c\u8fd9\u4e2a\u547d\u4ee4\u540e\uff0c\u5355\u6b65\u8ddf\u8e2a\u4f1a\u5728\u663e\u793a\u51fa\u7a0b\u5e8f\u4ee3\u7801\u7684\u540c\u65f6\u663e\u793a\u51fa\u673a\u5668\u6307\u4ee4(\u4e5f\u5c31\u662f\u6c47\u7f16\u4ee3\u7801)\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">9. \u4fe1\u53f7(Signals)<\/span><br \/>\n<span style=\"font-size:14px;\">\u4fe1\u53f7\u662f\u4e00\u79cd\u8f6f\u4e2d\u65ad\uff0c\u662f\u4e00\u79cd\u5904\u7406\u5f02\u6b65\u4e8b\u4ef6\u7684\u65b9\u6cd5\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">\u4e00\u822c\u6765\u8bf4\uff0c\u64cd\u4f5c\u7cfb\u7edf\u90fd\u652f\u6301\u8bb8\u591a\u4fe1\u53f7\uff0c\u5c24\u5176\u662fLinux\uff0c\u6bd4\u8f83\u91cd\u8981\u7684\u5e94\u7528\u7a0b\u5e8f\u4e00\u822c\u90fd\u4f1a\u5904\u7406\u4fe1\u53f7\u3002Linux\u5b9a\u4e49\u4e86\u8bb8\u591a\u4fe1\u53f7\uff0c\u6bd4\u5982SIGINT\u8868\u793a\u4e2d\u65ad\u5b57\u7b26\u4fe1\u53f7\uff0c\u4e5f\u5c31\u662fCtrl+C\u7684\u4fe1\u53f7\uff0cSIGBUS\u8868\u793a\u786c\u4ef6\u6545\u969c\u7684\u4fe1\u53f7\uff1bSIGCHLD\u8868\u793a\u5b50\u8fdb\u7a0b\u72b6\u6001\u6539\u53d8\u4fe1\u53f7\uff1bSIGKILL\u8868\u793a\u7ec8\u6b62\u7a0b\u5e8f\u8fd0\u884c\u7684\u4fe1\u53f7\u7b49\u3002\u4fe1\u53f7\u91cf\u7f16\u7a0b\u662fUNIX\u4e0b\u975e\u5e38\u91cd\u8981\u7684\u4e00\u79cd\u6280\u672f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">gdb\u6709\u80fd\u529b\u5728\u8c03\u8bd5\u7a0b\u5e8f\u7684\u65f6\u5019\u5904\u7406\u4efb\u4f55\u4e00\u79cd\u4fe1\u53f7\u3002\u53ef\u4ee5\u544a\u8bc9gdb\u9700\u8981\u5904\u7406\u54ea\u4e00\u79cd\u4fe1\u53f7\uff1b\u53ef\u4ee5\u8981\u6c42gdb\u6536\u5230\u6240\u6307\u5b9a\u7684\u4fe1\u53f7\u65f6\uff0c\u9a6c\u4e0a\u505c\u4f4f\u6b63\u5728\u8fd0\u884c\u7684\u7a0b\u5e8f\uff0c\u4ee5\u4f9b\u7528\u6237\u8fdb\u884c\u8c03\u8bd5\u3002\u53ef\u7528gdb\u7684handle\u547d\u4ee4\u6765\u5b8c\u6210\u8fd9\u4e00\u529f\u80fd\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">handle&nbsp;<\/span><br \/>\n<span style=\"font-size:14px;\">\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\u5b9a\u4e49\u4e00\u4e2a\u8981\u5904\u7406\u4fe1\u53f7\u7684\u8303\u56f4(\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)\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\u4e2d\u7684\u4e00\u4e2a\u6216\u591a\u4e2a\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">nostop<\/span><br \/>\n<span style=\"font-size:14px;\">\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\u663e\u793a\u51fa\u6d88\u606f\u544a\u8bc9\u7528\u6237\u6536\u5230\u8fd9\u79cd\u4fe1\u53f7\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">stop<\/span><br \/>\n<span style=\"font-size:14px;\">\u5f53\u88ab\u8c03\u8bd5\u7684\u7a0b\u5e8f\u6536\u5230\u4fe1\u53f7\u65f6\uff0cgdb\u4f1a\u505c\u4f4f\u7a0b\u5e8f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">print<\/span><br \/>\n<span style=\"font-size:14px;\">\u5f53\u88ab\u8c03\u8bd5\u7684\u7a0b\u5e8f\u6536\u5230\u4fe1\u53f7\u65f6\uff0cgdb\u4f1a\u663e\u793a\u51fa\u4e00\u6761\u4fe1\u606f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">noprint<\/span><br \/>\n<span style=\"font-size:14px;\">\u5f53\u88ab\u8c03\u8bd5\u7684\u7a0b\u5e8f\u6536\u5230\u4fe1\u53f7\u65f6\uff0cgdb\u4e0d\u4f1a\u544a\u8bc9\u7528\u6237\u6536\u5230\u4fe1\u53f7\u7684\u4fe1\u606f\u3002<\/span><br \/>\n<span style=\"font-size:14px;\">Pass<\/span><br \/>\n<span style=\"font-size:14px;\">noignore<\/span><br \/>\n<span style=\"font-size:14px;\">\u5f53\u88ab\u8c03\u8bd5\u7684<\/span><br \/>\n<span style=\"font-size:14px;\">\u8fd9\u91cc\u662f\u4e00\u7bc7\u591a\u7ebf\u7a0b\u8c03\u8bd5\u7684\u6587\u7ae0\uff1a<\/span><br \/>\n<span style=\"font-size:14px;\">http:\/\/www.linuxforum.net\/forum\/showflat.php?Cat=&amp;Board=program&amp;Number=692404&amp;page=0&amp;view=collapsed&amp;sb=&amp;o=&amp;fpart=1&amp;vc=1<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p><span style=\"font-size:14px;\">\u4e00\uff1a\u51c6\u5907<\/span><br \/><span style=\"font-size:14px;\">PC\u673a\uff1a172.16.7.153<\/span><br \/><span style=\"font-size:14px;\">broad\uff1a172.16.7.155<\/span><br \/><span style=\"font-size:14px;\"># ifconfig<\/span><br \/><span style=\"font-size:14px;\">eth0 &nbsp; &nbsp; &nbsp;Link encap:Ethernet &nbsp;HWaddr 00:07:63:00:00:0B &nbsp;<\/span><br \/><span style=\"font-size:14px;\">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inet addr:172.16.7.155 &nbsp;Bcast:&#8230;<\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[328],"tags":[],"class_list":["post-202","post","type-post","status-publish","format-standard","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v16.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>[\u8f6c]\u5728\u5d4c\u5165\u5f0f\u4e2d\u4f7f\u7528gdbserver - Wayne&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/weizn.net\/?p=202\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"[\u8f6c]\u5728\u5d4c\u5165\u5f0f\u4e2d\u4f7f\u7528gdbserver - Wayne&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"\u4e00\uff1a\u51c6\u5907PC\u673a\uff1a172.16.7.153broad\uff1a172.16.7.155# ifconfigeth0 &nbsp; &nbsp; &nbsp;Link encap:Ethernet &nbsp;HWaddr 00:07:63:00:00:0B &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inet addr:172.16.7.155 &nbsp;Bcast:...\" \/>\n<meta property=\"og:url\" content=\"http:\/\/weizn.net\/?p=202\" \/>\n<meta property=\"og:site_name\" content=\"Wayne&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2016-09-15T03:29:15+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"zinan\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebSite\",\"@id\":\"http:\/\/weizn.net\/#website\",\"url\":\"http:\/\/weizn.net\/\",\"name\":\"Wayne&#039;s Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\/\/weizn.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"WebPage\",\"@id\":\"http:\/\/weizn.net\/?p=202#webpage\",\"url\":\"http:\/\/weizn.net\/?p=202\",\"name\":\"[\\u8f6c]\\u5728\\u5d4c\\u5165\\u5f0f\\u4e2d\\u4f7f\\u7528gdbserver - Wayne&#039;s Blog\",\"isPartOf\":{\"@id\":\"http:\/\/weizn.net\/#website\"},\"datePublished\":\"2016-09-15T03:29:15+00:00\",\"dateModified\":\"2016-09-15T03:29:15+00:00\",\"breadcrumb\":{\"@id\":\"http:\/\/weizn.net\/?p=202#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/weizn.net\/?p=202\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/weizn.net\/?p=202#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\\u9996\\u9875\",\"item\":\"http:\/\/weizn.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"[\\u8f6c]\\u5728\\u5d4c\\u5165\\u5f0f\\u4e2d\\u4f7f\\u7528gdbserver\"}]},{\"@type\":\"Article\",\"@id\":\"http:\/\/weizn.net\/?p=202#article\",\"isPartOf\":{\"@id\":\"http:\/\/weizn.net\/?p=202#webpage\"},\"author\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"headline\":\"[\\u8f6c]\\u5728\\u5d4c\\u5165\\u5f0f\\u4e2d\\u4f7f\\u7528gdbserver\",\"datePublished\":\"2016-09-15T03:29:15+00:00\",\"dateModified\":\"2016-09-15T03:29:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\/\/weizn.net\/?p=202#webpage\"},\"wordCount\":2141,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\"},\"articleSection\":[\"ASM\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\/\/weizn.net\/?p=202#respond\"]}]},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264\",\"name\":\"zinan\",\"logo\":{\"@id\":\"http:\/\/weizn.net\/#personlogo\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"[\u8f6c]\u5728\u5d4c\u5165\u5f0f\u4e2d\u4f7f\u7528gdbserver - Wayne&#039;s Blog","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":"http:\/\/weizn.net\/?p=202","og_locale":"zh_CN","og_type":"article","og_title":"[\u8f6c]\u5728\u5d4c\u5165\u5f0f\u4e2d\u4f7f\u7528gdbserver - Wayne&#039;s Blog","og_description":"\u4e00\uff1a\u51c6\u5907PC\u673a\uff1a172.16.7.153broad\uff1a172.16.7.155# ifconfigeth0 &nbsp; &nbsp; &nbsp;Link encap:Ethernet &nbsp;HWaddr 00:07:63:00:00:0B &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; inet addr:172.16.7.155 &nbsp;Bcast:...","og_url":"http:\/\/weizn.net\/?p=202","og_site_name":"Wayne&#039;s Blog","article_published_time":"2016-09-15T03:29:15+00:00","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"zinan","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"11 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebSite","@id":"http:\/\/weizn.net\/#website","url":"http:\/\/weizn.net\/","name":"Wayne&#039;s Blog","description":"","publisher":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/weizn.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"WebPage","@id":"http:\/\/weizn.net\/?p=202#webpage","url":"http:\/\/weizn.net\/?p=202","name":"[\u8f6c]\u5728\u5d4c\u5165\u5f0f\u4e2d\u4f7f\u7528gdbserver - Wayne&#039;s Blog","isPartOf":{"@id":"http:\/\/weizn.net\/#website"},"datePublished":"2016-09-15T03:29:15+00:00","dateModified":"2016-09-15T03:29:15+00:00","breadcrumb":{"@id":"http:\/\/weizn.net\/?p=202#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["http:\/\/weizn.net\/?p=202"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/weizn.net\/?p=202#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"http:\/\/weizn.net\/"},{"@type":"ListItem","position":2,"name":"[\u8f6c]\u5728\u5d4c\u5165\u5f0f\u4e2d\u4f7f\u7528gdbserver"}]},{"@type":"Article","@id":"http:\/\/weizn.net\/?p=202#article","isPartOf":{"@id":"http:\/\/weizn.net\/?p=202#webpage"},"author":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"headline":"[\u8f6c]\u5728\u5d4c\u5165\u5f0f\u4e2d\u4f7f\u7528gdbserver","datePublished":"2016-09-15T03:29:15+00:00","dateModified":"2016-09-15T03:29:15+00:00","mainEntityOfPage":{"@id":"http:\/\/weizn.net\/?p=202#webpage"},"wordCount":2141,"commentCount":0,"publisher":{"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264"},"articleSection":["ASM"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/weizn.net\/?p=202#respond"]}]},{"@type":["Person","Organization"],"@id":"http:\/\/weizn.net\/#\/schema\/person\/e88bc12c590502d8b6249326f960b264","name":"zinan","logo":{"@id":"http:\/\/weizn.net\/#personlogo"}}]}},"_links":{"self":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/202","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=202"}],"version-history":[{"count":0,"href":"http:\/\/weizn.net\/index.php?rest_route=\/wp\/v2\/posts\/202\/revisions"}],"wp:attachment":[{"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=202"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/weizn.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}