This is a creation in Article, where the information may have evolved or changed.
Problem:
(GDB) source/users/sherlock/documents/go/src/runtime/runtime-gdb.pyloading go Runtime support. Traceback (most recent): 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.
Solution:
1. Git clone https://github.com/golang/example.git
2. Go test-c in the Stringutil directory.
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): 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. Command line
grep runtime gdb.txt | grep type;
5. Draw conclusions
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. Modify the runtime-gdb.py No. 205 line rtype Change to _type
Note: My platform is Mac OS X 10.10.3, go1.4.2
Other platforms may not be
struct []*runtime._type;