1
0
mirror of https://github.com/golang/go synced 2024-09-24 19:30:12 -06:00

debug/macho: handle missing __debug_str section

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
This commit is contained in:
Keith Randall 2014-03-13 14:04:29 -07:00
parent 41aa887be5
commit 4c6d2d6aa8

View 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 {