{"id":441545,"date":"2021-04-13T14:29:24","date_gmt":"2021-04-13T06:29:24","guid":{"rendered":"http:\/\/4563.org\/?p=441545"},"modified":"2021-04-13T14:29:24","modified_gmt":"2021-04-13T06:29:24","slug":"%e9%ba%bb%e4%ba%86%ef%bc%8c-gdb-%e8%bf%9c%e7%a8%8b%e8%b0%83%e8%af%95%e8%bf%9e%e4%b8%8d%e4%b8%8a","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=441545","title":{"rendered":"\u9ebb\u4e86\uff0c gdb \u8fdc\u7a0b\u8c03\u8bd5\u8fde\u4e0d\u4e0a"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u9ebb\u4e86\uff0c gdb \u8fdc\u7a0b\u8c03\u8bd5\u8fde\u4e0d\u4e0a               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : rainboat <\/span>  <span><i><\/i> 2<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6211\u6709\u4e2a centos8 \u8fdc\u7a0b\u4e3b\u673a\uff0cip \u5730\u5740\u662f\u5b66\u6821\u5206\u914d\u7684\u516c\u7f51\u5730\u5740\uff0c\u5728\u5b66\u6821\u7684\u6559\u80b2\u7f51\u8303\u56f4\u5185\u53ef\u4ee5\u4efb\u610f\u8bbf\u95ee\uff0c\u6700\u8fd1\u4f7f\u7528\u8fd9\u4e2a\u4e1c\u897f\u6765\u8fdc\u7a0b\u8c03\u8bd5 C++\u4ee3\u7801\uff0c\u53d1\u73b0 gdb \u4e00\u76f4\u90fd\u8fde\u4e0d\u4e0a\u3002<\/p>\n<p>\u670d\u52a1\u5668\u7aef\u7aef\u5f00\u542f gdbserver \u7684\u547d\u4ee4\u548c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n<pre><code>gdbserver :1234 nebula-graphd  --flagfile \/home\/xxx\/nebula-graph\/install\/etc\/nebula-graphd.conf Process \/home\/xxx\/nebula-graph\/install\/bin\/nebula-graphd created; pid = 4007 Listening on port 1234 <\/code><\/pre>\n<p>\u7136\u540e\u6211\u4ece MacOS BigSur \u4e0a\u7528 gdb \u547d\u4ee4\u6765\u8fde\u63a5\uff0c\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n<pre><code>(gdb) target remote ip \u5730\u5740:1234 ip \u5730\u5740:1234: Operation timed out.  <\/code><\/pre>\n<p>\u7b80\u800c\u8a00\u4e4b\u5c31\u662f\u6b7b\u6d3b\u90fd\u8fde\u4e0d\u4e0a\u53bb\u3002\u4f46\u662f\u5947\u602a\u7684\u662f\u6211 ssh \u53ef\u4ee5\u8fde\u63a5\u5230\u8fdc\u7a0b\u4e3b\u673a\uff0c\u800c\u4e14\u4f7f\u7528\u8fdc\u7a0b\u4e3b\u673a\u4e0a\u7684 gdb \u5c31\u53ef\u4ee5\u8fde\u63a5\u4e0a\u5f00\u542f\u7684 gdbserver \u3002\u5982\u4e0b\u662f ssh \u5230\u8fdc\u7a0b\u4e3b\u673a\u540e\uff0c\u6267\u884c gdb \u8c03\u8bd5\u7684\u7ed3\u679c\uff1a<\/p>\n<pre><code>(gdb) target remote localhost:1234 Remote debugging using localhost:1234 ... <\/code><\/pre>\n<p>\u6709\u6ca1\u6709\u5927\u4f6c\u78b0\u5230\u8fc7\u8fd9\u79cd\u60c5\u51b5\u5440\uff0c\u4e00\u4e2a\u4eba\u6574\u4e86\u5927\u534a\u5929\uff0c\u5b9e\u5728\u662f\u6574\u4e0d\u660e\u767d\u3002<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>3<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5755034\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : DarkCat123 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             telnet \u770b\u770b\u7aef\u53e3\u901a\u4e0d\u901a\uff0c\u670d\u52a1\u5668\u770b\u770b \u7aef\u53e3\u6709\u6ca1\u6709 listen\uff0c\u68c0\u67e5\u4e24\u8fb9\u9632\u706b\u5899 iptables \u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5755035\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : rainboat <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @DarkCat123 <br \/>\u4f7f\u7528 telnet \u8c8c\u4f3c\u53ef\u4ee5\u901a\uff0c\u4e0b\u9762\u662f\u6267\u884c\u60c5\u51b5<br \/>$ telnet 118.202.11.76 1234<br \/>Trying 118.202.11.76&#8230;<br \/>Connected to 118.202.11.76.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5755036\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : rainboat <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @DarkCat123 \u8c22\u8c22\u5144\u5f1f\uff0c\u662f\u9632\u706b\u5899\u7684\u95ee\u9898\uff0c\u89e3\u51b3\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u9ebb\u4e86\uff0c gdb \u8fdc\u7a0b\u8c03\u8bd5\u8fde\u4e0d\u4e0a \u8cc7&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/441545"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=441545"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/441545\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=441545"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=441545"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=441545"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}