{"id":163694,"date":"2020-10-05T04:25:06","date_gmt":"2020-10-04T20:25:06","guid":{"rendered":"http:\/\/4563.org\/?p=163694"},"modified":"2020-10-05T04:25:06","modified_gmt":"2020-10-04T20:25:06","slug":"%e5%85%b3%e4%ba%8e-gdb-%e6%9f%a5%e7%9c%8b-stl-%e5%85%83%e7%b4%a0%e5%80%bc","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=163694","title":{"rendered":"\u5173\u4e8e GDB \u67e5\u770b STL \u5143\u7d20\u503c"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u5173\u4e8e GDB \u67e5\u770b STL \u5143\u7d20\u503c               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : yanyanlongxia <\/span>  <span><i><\/i> 1<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\u6211\u60f3\u77e5\u9053\u5982\u4f55\u7528 GDB \u67e5\u770b C++ STL \u5bb9\u5668\uff08\u5982 map \u3001priority _ queue)\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u7684\u503c\u3002<\/p>\n<p>\u7f51\u4e0a\u4e5f\u6709\u4e00\u4e2a\u65b9\u6cd5\uff0c\u5c31\u662f\u4e0b\u8f7d\u4e00\u4e2a\u811a\u672c\uff0c\u66ff\u6362\u914d\u7f6e\uff0c\u6211\u5728\u672c\u673a\u4e5f\u662f\u8fd9\u4e48\u8bbe\u7f6e\u7684\u3002<\/p>\n<p>\u53ef\u662f\uff0c\u6211\u4eec\u9a6c\u4e0a\u5c31\u8981\u8003\u8bd5\u4e86\uff0c\u6211\u4eb2\u6d4b\u8003\u573a\u7535\u8111\u91cc\u6ca1\u6709\u90a3\u4e2a\u811a\u672c\uff08\u8003\u8bd5\u4e5f\u4e0d\u53ef\u80fd\u5f00\u7f51\uff09\uff0c\u6211\u60f3\u77e5\u9053\u8003\u8bd5\u65f6\u5982\u4f55\u4f7f\u7528 GDB \u67e5\u770b STL \u5143\u7d20\u7684\u503c\uff08\u5f53\u7136\u53ef\u4ee5\u76f4\u63a5\u5199\u51fd\u6570\u8f93\u51fa\uff0c\u4f46\u662f\u603b\u89c9\u5f97\u8fd9\u6837\u592a\u70e6\u4e86\uff09<\/p>\n<p>\u8003\u8bd5\u73af\u5883\uff1a \u7cfb\u7edf\uff1aUbuntu 14.04 LTS \u3002 \u5185\u7f6e\u8f6f\u4ef6\uff08\u90fd\u662f\u7eaf\u51c0\u7684\uff09\uff1avim \u3001 gedit \u3001g++\/gcc&amp;gdb \u3001guide \u3001python3 \u2026\u2026\uff08\u53cd\u6b63\u5176\u4ed6\u7684\u5c31\u662f Ubuntu \u81ea\u5e26\u4e86\uff09<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>9<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"3577725\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : ruanimal <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e0d\u61c2\uff0cC++\u5c31\u662f\u9ebb\u70e6                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3577726\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : InkStone <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4f60\u53ef\u4ee5\u8bd5\u4e00\u4e0b\uff0cstl \u7684\u5185\u90e8\u7ed3\u6784\u4e5f\u6ca1\u590d\u6742\u5230\u770b\u4e0d\u5230\u6bcf\u4e2a\u5143\u7d20\u503c\u7684\u5730\u6b65\u2026\u2026\u6211\u8bb0\u5f97\u65e9\u671f\u4e00\u4e9b IDE \u6ca1\u6709\u5bf9 STL \u7684\u652f\u6301\uff0c\u4e5f\u90fd\u662f\u624b\u52a8\u5c55\u5f00\u6765\u770b\u7684\u3002<\/p>\n<p>\u4e0d\u8fc7\u4f60\u4eec\u8fd9\u8003\u8bd5\u4e5f\u592a\u6298\u817e\u4eba\u4e86\u5427\uff0c\u8fde IDE \u90fd\u4e0d\u7ed9\u4e00\u4e2a\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3577727\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : zvl0reqglvd <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             print \u6570\u7ec4\u9996\u5730\u5740 @\u67e5\u770b\u957f\u5ea6                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3577728\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : yanyanlongxia <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @zvl0reqglvd \u8bf7\u95ee\u80fd\u4e3e\u4e2a\u4f8b\u5b50\u5417\uff1f\u8c22\u8c22\u4e86\uff08\u4e3b\u8981\u662f\u6ca1\u592a\u770b\u61c2\uff09                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3577729\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : yanyanlongxia <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @InkStone \u5176\u5b9e\u6211\u5e73\u65f6\u7528\u7684 CLion \u5c31\u81ea\u5e26\u5b8c\u7f8e\u652f\u6301\u67e5\u770b STL\uff0c\u53ea\u662f\u8003\u8bd5\u6ca1\u6709\u2026\u2026                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3577730\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : yanyanlongxia <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7a81\u7136\u53d1\u73b0\u5728\u7a0b\u5e8f\u91cc\u5199\u4e00\u4e2a print \u51fd\u6570\uff0c\u5728 gdb \u91cc\u9762\u9700\u8981\u65f6\u8c03\u7528 call print()\u5c31\u5f88\u7b80\u5355\u2026\u2026                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3577731\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : disk <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             14.04 \u6709\u70b9\u8001\u4e86\uff0c\u4e0d\u77e5\u9053 gdb \u7248\u672c\u662f\u591a\u5c11\uff0c7.0 \u540e\u624d\u652f\u6301 python \u62d3\u5c55\uff0c\u7cfb\u7edf\u81ea\u5e26\u7684\u76f4\u63a5 p STL \u53d8\u91cf\u5c31\u5b8c\u4e8b\u4e86\u3002\u4e0d\u7136\u5c31\u5148 p vec \u770b\u4e0b\u7ed3\u6784\uff0c\u7136\u540e\u6309\u7167\u8f93\u51fa\u7684\u7ed3\u6784 p *(vec._M_impl._M_start)@vec.size()\uff0c\u4e0d\u77e5\u9053\u884c\u4e0d\u884c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3577732\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : yanyanlongxia <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @disk GDB \u7248\u672c\u662f 7.7.1 \u7684\uff0c\u8bf7\u95ee\u80fd\u7ec6\u8bf4\u4e00\u4e0b\u600e\u4e48\u7528\u5417\uff1f\u8c22\u8c22                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"3577733\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : disk <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @yanyanlongxia \u4f60\u9700\u8981\u53bb\u770b\u4e0b GDB \u7684\u4f7f\u7528\u6559\u7a0b\u3002\u8981\u67e5\u770b\u4e00\u4e2a\u53d8\u91cf\uff0c\u4f60\u81f3\u5c11\u9700\u8981\u5b83\u7684\u9996\u5730\u5740\uff0c\u5982\u679c\u662f\u987a\u5e8f\u5b58\u50a8\u8981\u770b\u957f\u5ea6\uff0c\u5982\u679c\u662f\u590d\u6742\u7684\u7ed3\u6784\u8981\u8003\u8651\u6307\u51fa\u7c7b\u578b\u3002\u50cf map \u8fd9\u79cd\u7ea2\u9ed1\u6811\u5b9e\u73b0\u4e0d\u9760\u811a\u672c\u770b\u8d77\u6765\u662f\u5f88\u9ebb\u70e6\u7684\uff0c\u4f60\u53ef\u4ee5\u5199\u4e00\u4e2a print \u51fd\u6570\u628a\u5bb9\u5668\u7684\u5143\u7d20\u904d\u5386\u6253\u5370\u51fa\u6765\uff0c\u7136\u540e\u5728\u8c03\u8bd5\u4e2d\u968f\u65f6 call \u8fd9\u4e2a\u51fd\u6570\u6765\u67e5\u770b\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u5173\u4e8e GDB \u67e5\u770b STL \u5143\u7d20\u503c&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\/163694"}],"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=163694"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/163694\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=163694"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=163694"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=163694"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}