aboutsummaryrefslogtreecommitdiff
path: root/src/debug/dwarf/buf.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2019-05-02 22:15:05 -0700
committerIan Lance Taylor <iant@golang.org>2019-09-03 17:37:24 +0000
commitadf20ee3c5f75139bebca6f4515719c304963a69 (patch)
tree817fef8a1b9fe1861f40266ceb0c6de11ba073c2 /src/debug/dwarf/buf.go
parent663680b3d45a276fc2f246c61deeb79acf634591 (diff)
downloadgo-adf20ee3c5f75139bebca6f4515719c304963a69.tar.xz
debug/dwarf, debug/elf: support DWARF 5
Change-Id: I6e9d47865c198299d497911c58235cd40f775e34 Reviewed-on: https://go-review.googlesource.com/c/go/+/175138 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com>
Diffstat (limited to 'src/debug/dwarf/buf.go')
-rw-r--r--src/debug/dwarf/buf.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/debug/dwarf/buf.go b/src/debug/dwarf/buf.go
index 24d266db10..3e6ce293fd 100644
--- a/src/debug/dwarf/buf.go
+++ b/src/debug/dwarf/buf.go
@@ -99,6 +99,18 @@ func (b *buf) uint16() uint16 {
return b.order.Uint16(a)
}
+func (b *buf) uint24() uint32 {
+ a := b.bytes(3)
+ if a == nil {
+ return 0
+ }
+ if b.dwarf.bigEndian {
+ return uint32(a[2]) | uint32(a[1])<<8 | uint32(a[0])<<16
+ } else {
+ return uint32(a[0]) | uint32(a[1])<<8 | uint32(a[2])<<16
+ }
+}
+
func (b *buf) uint32() uint32 {
a := b.bytes(4)
if a == nil {