• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            S.l.e!ep.¢%

            像打了激速一樣,以四倍的速度運(yùn)轉(zhuǎn),開心的工作
            簡(jiǎn)單、開放、平等的公司文化;尊重個(gè)性、自由與個(gè)人價(jià)值;
            posts - 1098, comments - 335, trackbacks - 0, articles - 1
              C++博客 :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理
            [轉(zhuǎn)]配置GDB以支持查看stl容器數(shù)據(jù)
            2009-09-08 10:04
            http://blog.chinaunix.net/u1/44543/showart_1953788.html

            ?
            2. #cat dbinit_stl_views-1.03.txt >> ~/.gdbinit
            ?
            3. 若正處于gdb中,運(yùn)行命令:
            ?? (gdb) source ~/.gdbinit
            ?
            4. 例如,如下代碼:
            bugging.cpp

            #include<vector>
            usingnamespacestd;

            int main()
            {
            vector<int> vec;
            vec.push_back(2);
            vec.push_back(3);
            vec.push_back(4);
            return 0;
            }

            ?
            編譯:
            ?

            #g++-o bugging -g bugging.cpp

            gdb調(diào)試:

            # gdb bugging
            GNU gdb 6.8
            Copyright (C) 2008 Free Software Foundation, Inc.
            License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

            This is free software: you are free to change and redistribute it.
            There is NO WARRANTY, to the extent permitted by law. Type "show copying"
            and"show warranty"for details.
            This GDB was configured as "i486-slackware-linux"...
            (gdb) help pvector
            Prints std::vector<T> information.
            Syntax: pvector <vector><idx1><idx2>
            Note: idx, idx1 and idx2 must be in acceptable range [0..<vector>.size()-1].
            Examples:
            pvector v - Prints vector content, size, capacity and T typedef
            pvector v 0 - Prints element[idx] from vector
            pvector v 1 2 - Prints elements in range [idx1..idx2] from vector
            (gdb)break main
            Breakpoint 1 at 0x80485c6:file bugging.cpp,line 6.
            (gdb) run
            Starting program:/root/learn/c++/bugging

            Breakpoint 1, main () at bugging.cpp:6
            6????????vector<int> vec;
            (gdb) n
            7????????vec.push_back(2);
            (gdb)
            8????????vec.push_back(3);
            (gdb) pvector
            Prints std::vector<T> information.
            Syntax: pvector <vector><idx1><idx2>
            Note: idx, idx1 and idx2 must be in acceptable range [0..<vector>.size()-1].
            Examples:
            pvector v - Prints vector content, size, capacity and T typedef
            pvector v 0 - Prints element[idx] from vector
            pvector v 1 2 - Prints elements in range [idx1..idx2] from vector
            (gdb) pvector vec
            elem[0]: $1 = 2
            Vector size = 1
            Vector capacity = 1
            Element type =int*
            (gdb) n
            9????????vec.push_back(4);
            (gdb)
            10????????return 0;
            (gdb) pvector vec
            elem[0]: $2 = 2
            elem[1]: $3 = 3
            elem[2]: $4 = 4
            Vector size = 3
            Vector capacity = 4
            Element type =int*
            (gdb)

            5. 默認(rèn)情況下gdb不能用[]查看stl容器的數(shù)據(jù)元素,提示如下錯(cuò)誤:

            (gdb) print vec[0]
            One of the arguments you tried to pass to operator[] could not be converted to what the function wants.

            亚洲精品tv久久久久久久久| 久久国产综合精品五月天| 久久午夜夜伦鲁鲁片免费无码影视| 久久综合久久性久99毛片| 中文字幕无码av激情不卡久久| 国内精品综合久久久40p| 久久久久人妻一区精品色| 日本精品久久久久中文字幕8| 久久久99精品一区二区| 久久人人爽人人人人片av| 欧美一区二区三区久久综| 色综合色天天久久婷婷基地| 一级做a爰片久久毛片免费陪 | 国产产无码乱码精品久久鸭 | 久久综合亚洲欧美成人| 97超级碰碰碰碰久久久久| 久久只有这精品99| 婷婷久久综合九色综合98| 97精品伊人久久大香线蕉| 久久亚洲国产中v天仙www | 久久久久亚洲av无码专区喷水 | 偷偷做久久久久网站| 国产精品99久久久久久人| 中文精品99久久国产| 婷婷综合久久狠狠色99h| 欧美日韩精品久久久久| 99久久综合狠狠综合久久| 一本久久知道综合久久| 精品久久久久久国产牛牛app| 熟妇人妻久久中文字幕| 怡红院日本一道日本久久 | 日韩欧美亚洲综合久久影院d3| 狠狠色丁香久久婷婷综合蜜芽五月| 91精品国产色综合久久| 久久人人添人人爽添人人片牛牛| 四虎国产精品免费久久5151| 色欲av伊人久久大香线蕉影院| 色欲综合久久躁天天躁| 99久久精品免费国产大片| 精品综合久久久久久888蜜芽| 久久久久亚洲AV无码观看|