golang runtime-gdb.py的問題

來源:互聯網
上載者:User
這是一個建立於 的文章,其中的資訊可能已經有所發展或是發生改變。

問題:

(gdb) source /Users/sherlock/documents/go/src/runtime/runtime-gdb.pyLoading Go Runtime support.Traceback (most recent call last):  File "/Users/sherlock/documents/go/src/runtime/runtime-gdb.py", line 205, in <module>    _rctp_type = gdb.lookup_type("struct runtime.rtype").pointer()gdb.error: No struct type named runtime.rtype.

解決方案:

1. git clone https://github.com/golang/example.git

2.在stringutil目錄下 go test -c ./

3.

gdb -q ./stringutil.testReading symbols from ./stringutil.test...done.(gdb) source /usr/src/go/src/runtime/runtime-gdb.pyLoading Go Runtime support.Traceback (most recent call last):  File "/usr/src/go/src/runtime/runtime-gdb.py", line 205, in <module>    _rctp_type = gdb.lookup_type("struct runtime.rtype").pointer()gdb.error: No struct type named runtime.rtype.(gdb) set pagination off(gdb) set logging onCopying output to gdb.txt.(gdb) info types# much output(gdb) quit

4.命令列

grep runtime gdb.txt   | grep type;

5.得出結論

struct []*runtime._type;typedef struct runtime.iface error;typedef struct runtime.iface flag.Value;typedef struct runtime.iface flag.boolFlag;typedef struct runtime.iface fmt.Formatter;typedef struct runtime.iface fmt.GoStringer;typedef struct runtime.iface fmt.Scanner;typedef struct runtime.iface fmt.Stringer;typedef struct runtime.iface fmt.runeUnreader;typedef void (struct runtime.g *) func(*runtime.g);typedef void (struct runtime.stkframe *, void *, bool *) func(*runtime.stkframe, unsafe.Pointer) bool;typedef void (struct []runtime.StackRecord, int *, bool *) func([]runtime.StackRecord) (int, bool);typedef struct runtime.iface interface { runtime.f() };typedef struct runtime.eface interface {};typedef struct runtime.iface io.Reader;typedef struct runtime.iface io.ReaderFrom;typedef struct runtime.iface io.RuneReader;typedef struct runtime.iface io.Writer;typedef struct runtime.iface io.WriterTo;typedef struct hash<string,*runtime/pprof.Profile> * map[string]*runtime/pprof.Profile;typedef struct runtime.iface os.FileInfo;typedef struct runtime.iface os.Signal;typedef struct runtime.iface reflect.Type;typedef struct runtime.iface regexp.input;struct runtime._type;typedef runtime.bucketType;struct runtime.chantype;typedef struct runtime.iface runtime.fInterface;struct runtime.functype;struct runtime.interfacetype;typedef runtime.intptr;struct runtime.maptype;typedef runtime.pageID;struct runtime.ptrtype;struct runtime.slicetype;typedef struct runtime.iface runtime.stringer;struct runtime.typeAlg;typedef runtime.uintreg;struct runtime.uncommontype;typedef struct runtime.iface runtime/pprof.countProfile;typedef struct runtime.iface sort.Interface;typedef struct runtime.iface sync.Locker;

6.修改runtime-gdb.py第205行rtype改成_type

註:我的平台是mac os x 10.10.3 ,go1.4.2

其他平台可能不是

struct []*runtime._type;

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.