]> Cypherpunks repositories - gostls13.git/commitdiff
debug/macho: handle missing __debug_str section
authorKeith Randall <khr@golang.org>
Thu, 13 Mar 2014 21:04:29 +0000 (14:04 -0700)
committerKeith Randall <khr@golang.org>
Thu, 13 Mar 2014 21:04:29 +0000 (14:04 -0700)
debug/elf does the same thing, use []byte{} for
any missing sections.

Fixes #7510

LGTM=rsc
R=golang-codereviews, iant
CC=golang-codereviews, rsc
https://golang.org/cl/75230043

src/pkg/debug/macho/file.go

index 2b19f7f658fcf617fc95f784c42628c8e86b43b9..eefb74444265b1007a497424ee9a31f6d85c6efd 100644 (file)
@@ -11,7 +11,6 @@ import (
        "bytes"
        "debug/dwarf"
        "encoding/binary"
-       "errors"
        "fmt"
        "io"
        "os"
@@ -481,7 +480,7 @@ func (f *File) DWARF() (*dwarf.Data, error) {
                name = "__debug_" + name
                s := f.Section(name)
                if s == nil {
-                       return nil, errors.New("missing Mach-O section " + name)
+                       continue
                }
                b, err := s.Data()
                if err != nil && uint64(len(b)) < s.Size {