From bd997b24f7a7cdb57bb9bf02fbfacef1f59f0f89 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Mon, 27 Jan 2014 10:18:22 -0800 Subject: debug/dwarf, debug/elf: add support for reading DWARF 4 type info In DWARF 4 the debug info for large types is put into .debug_type sections, so that the linker can discard duplicate info. This change adds support for reading type units. Another small change included here is that DWARF 3 supports storing the byte offset of a struct field as a formData rather than a formDwarfBlock. R=golang-codereviews, r CC=golang-codereviews https://golang.org/cl/56300043 --- src/pkg/debug/dwarf/entry.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/pkg/debug/dwarf/entry.go') diff --git a/src/pkg/debug/dwarf/entry.go b/src/pkg/debug/dwarf/entry.go index c0c2889923..934416e6c1 100644 --- a/src/pkg/debug/dwarf/entry.go +++ b/src/pkg/debug/dwarf/entry.go @@ -387,3 +387,15 @@ func (r *Reader) SkipChildren() { } } } + +// clone returns a copy of the reader. This is used by the typeReader +// interface. +func (r *Reader) clone() typeReader { + return r.d.Reader() +} + +// offset returns the current buffer offset. This is used by the +// typeReader interface. +func (r *Reader) offset() Offset { + return r.b.off +} -- cgit v1.3-5-g9baa