]> Cypherpunks repositories - gostls13.git/commit
debug/dwarf: factor parsing of unit lengths
authorAustin Clements <austin@google.com>
Thu, 5 Mar 2015 20:07:00 +0000 (15:07 -0500)
committerAustin Clements <austin@google.com>
Wed, 11 Mar 2015 21:35:21 +0000 (21:35 +0000)
commit9dfbcd8facae22e2be8bc527e1877b1e23812073
treee5c8d2c9bf218828bd1a55db0360d1b6d0845cba
parentd533e3955db945072ab2dfcca1cab57099569260
debug/dwarf: factor parsing of unit lengths

Many headers in DWARF sections have a "unit length" that can be either
4 bytes or 12 bytes and indicates both the length of the unit and
whether the unit is in 32-bit or 64-bit format.

Currently, we implement unit length parsing in four different places.
Add a "unitLength" method to buf that parses a unit length and use it
in these four places.

Change-Id: I7950b91caaa92aa5e19aa63debc8ae46178ecc4d
Reviewed-on: https://go-review.googlesource.com/7281
Reviewed-by: Nigel Tao <nigeltao@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/debug/dwarf/buf.go
src/debug/dwarf/line.go
src/debug/dwarf/typeunit.go
src/debug/dwarf/unit.go