Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1327)

Unified Diff: debug/dwarf/buf.go

Issue 107630043: code review 107630043: ogle/dwarf/debug: add PCToSPOffset (Closed)
Patch Set: diff -r 5ff4bcb86e53 https://code.google.com/p/ogle Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | debug/dwarf/frame.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: debug/dwarf/buf.go
===================================================================
--- a/debug/dwarf/buf.go
+++ b/debug/dwarf/buf.go
@@ -54,6 +54,14 @@
return buf{d, d.order, format, name, off, data, nil}
}
+func (b *buf) slice(length int) buf {
+ n := *b
+ data := b.data
+ b.skip(length) // Will validate length.
+ n.data = data[:length]
+ return n
+}
+
func (b *buf) uint8() uint8 {
if len(b.data) < 1 {
b.error("underflow")
@@ -78,6 +86,8 @@
func (b *buf) skip(n int) { b.bytes(n) }
+// string returns the NUL-terminated (C-like) string at the start of the buffer.
+// The terminal NUL is discarded.
func (b *buf) string() string {
for i := 0; i < len(b.data); i++ {
if b.data[i] == 0 {
« no previous file with comments | « no previous file | debug/dwarf/frame.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b