gdb golang,你如何打印基类信息?

时间:2017-05-25 08:37:53

标签: go gdb

当我调试protoc-gen-go时,我想打印 generator.FileDescriptor 的基类信息,它的基类是 github.com/golang/protobuf/ protoc-GEN-去/ descriptor.FileDescriptorProto

gdb打印类型:

ptype file

gdb输出:

type = struct generator.FileDescriptor {
struct github.com/golang/protobuf/protoc-gen-go/descriptor.FileDescriptorProto **github.com/golang/protobuf/protoc-gen-go/descriptor.FileDescriptorProto;
struct []*generator.Descriptor desc;
struct []*generator.EnumDescriptor enum;
struct []*generator.ExtensionDescriptor ext;
struct []*generator.ImportedDescriptor imp;
map[string]*github.com/golang/protobuf/protoc-gen-go/descriptor.SourceCodeInfo_Location comments;
map[generator.Object][]generator.symbol exported;
int index;
bool proto3;

} *

现在我要打印基类 descriptor.FileDescriptorProto 信息,怎么做?我是golang编程的初学者。我试着遵循礼仪,但都没有工作。

ptype file.github.com/golang/protobuf/protoc-gen-go/descriptor.FileDescriptorProto
ptype file.*github.com/golang/protobuf/protoc-gen-go/descriptor.FileDescriptorProto
ptype file.FileDescriptorProto
ptype file.*FileDescriptorProto
...

如何打印 file * FileDescriptor 的基类信息,此类在包生成器中定义。

提前致谢!

0 个答案:

没有答案