diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-12-03 02:17:34 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-12-03 02:17:34 +0000 |
commit | 2fd401c8f190f1fe43e51a7f726f6ed6119a1f96 (patch) | |
tree | 7f76eff391f37fe6467ff4ffbc0c582c9959ea30 /libgo/go/debug/dwarf | |
parent | 02e9018f1616b23f1276151797216717b3564202 (diff) | |
download | gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.zip gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.tar.gz gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.tar.bz2 |
libgo: Update to weekly.2011-11-02.
From-SVN: r181964
Diffstat (limited to 'libgo/go/debug/dwarf')
-rw-r--r-- | libgo/go/debug/dwarf/buf.go | 9 | ||||
-rw-r--r-- | libgo/go/debug/dwarf/entry.go | 10 | ||||
-rw-r--r-- | libgo/go/debug/dwarf/open.go | 7 | ||||
-rw-r--r-- | libgo/go/debug/dwarf/type.go | 7 | ||||
-rw-r--r-- | libgo/go/debug/dwarf/unit.go | 7 |
5 files changed, 15 insertions, 25 deletions
diff --git a/libgo/go/debug/dwarf/buf.go b/libgo/go/debug/dwarf/buf.go index 2d29ceb..6b4af7d 100644 --- a/libgo/go/debug/dwarf/buf.go +++ b/libgo/go/debug/dwarf/buf.go @@ -8,7 +8,6 @@ package dwarf import ( "encoding/binary" - "os" "strconv" ) @@ -20,7 +19,7 @@ type buf struct { off Offset data []byte addrsize int - err os.Error + err error } func makeBuf(d *Data, name string, off Offset, data []byte, addrsize int) buf { @@ -146,9 +145,9 @@ func (b *buf) error(s string) { type DecodeError struct { Name string Offset Offset - Error string + Err string } -func (e DecodeError) String() string { - return "decoding dwarf section " + e.Name + " at offset 0x" + strconv.Itob64(int64(e.Offset), 16) + ": " + e.Error +func (e DecodeError) Error() string { + return "decoding dwarf section " + e.Name + " at offset 0x" + strconv.Itob64(int64(e.Offset), 16) + ": " + e.Err } diff --git a/libgo/go/debug/dwarf/entry.go b/libgo/go/debug/dwarf/entry.go index 549e5c2..2885d8f 100644 --- a/libgo/go/debug/dwarf/entry.go +++ b/libgo/go/debug/dwarf/entry.go @@ -10,7 +10,7 @@ package dwarf -import "os" +import "errors" // a single entry's description: a sequence of attributes type abbrev struct { @@ -29,7 +29,7 @@ type abbrevTable map[uint32]abbrev // ParseAbbrev returns the abbreviation table that starts at byte off // in the .debug_abbrev section. -func (d *Data) parseAbbrev(off uint32) (abbrevTable, os.Error) { +func (d *Data) parseAbbrev(off uint32) (abbrevTable, error) { if m, ok := d.abbrevCache[off]; ok { return m, nil } @@ -232,7 +232,7 @@ func (b *buf) entry(atab abbrevTable, ubase Offset) *Entry { type Reader struct { b buf d *Data - err os.Error + err error unit int lastChildren bool // .Children of last entry returned by Next lastSibling Offset // .Val(AttrSibling) of last entry returned by Next @@ -273,7 +273,7 @@ func (r *Reader) Seek(off Offset) { return } } - r.err = os.NewError("offset out of range") + r.err = errors.New("offset out of range") } // maybeNextUnit advances to the next unit if this one is finished. @@ -289,7 +289,7 @@ func (r *Reader) maybeNextUnit() { // It returns nil, nil when it reaches the end of the section. // It returns an error if the current offset is invalid or the data at the // offset cannot be decoded as a valid Entry. -func (r *Reader) Next() (*Entry, os.Error) { +func (r *Reader) Next() (*Entry, error) { if r.err != nil { return nil, r.err } diff --git a/libgo/go/debug/dwarf/open.go b/libgo/go/debug/dwarf/open.go index d9525f7..9543297 100644 --- a/libgo/go/debug/dwarf/open.go +++ b/libgo/go/debug/dwarf/open.go @@ -7,10 +7,7 @@ // http://dwarfstd.org/doc/dwarf-2.0.0.pdf package dwarf -import ( - "encoding/binary" - "os" -) +import "encoding/binary" // Data represents the DWARF debugging information // loaded from an executable file (for example, an ELF or Mach-O executable). @@ -40,7 +37,7 @@ type Data struct { // The []byte arguments are the data from the corresponding debug section // in the object file; for example, for an ELF object, abbrev is the contents of // the ".debug_abbrev" section. -func New(abbrev, aranges, frame, info, line, pubnames, ranges, str []byte) (*Data, os.Error) { +func New(abbrev, aranges, frame, info, line, pubnames, ranges, str []byte) (*Data, error) { d := &Data{ abbrev: abbrev, aranges: aranges, diff --git a/libgo/go/debug/dwarf/type.go b/libgo/go/debug/dwarf/type.go index 9fa221b..e8ce8d5 100644 --- a/libgo/go/debug/dwarf/type.go +++ b/libgo/go/debug/dwarf/type.go @@ -8,10 +8,7 @@ package dwarf -import ( - "os" - "strconv" -) +import "strconv" // A Type conventionally represents a pointer to any of the // specific Type structures (CharType, StructType, etc.). @@ -254,7 +251,7 @@ func (t *TypedefType) String() string { return t.Name } func (t *TypedefType) Size() int64 { return t.Type.Size() } -func (d *Data) Type(off Offset) (Type, os.Error) { +func (d *Data) Type(off Offset) (Type, error) { if t, ok := d.typeCache[off]; ok { return t, nil } diff --git a/libgo/go/debug/dwarf/unit.go b/libgo/go/debug/dwarf/unit.go index 02cb363..c10d75d 100644 --- a/libgo/go/debug/dwarf/unit.go +++ b/libgo/go/debug/dwarf/unit.go @@ -4,10 +4,7 @@ package dwarf -import ( - "os" - "strconv" -) +import "strconv" // DWARF debug info is split into a sequence of compilation units. // Each unit has its own abbreviation table and address size. @@ -20,7 +17,7 @@ type unit struct { addrsize int } -func (d *Data) parseUnits() ([]unit, os.Error) { +func (d *Data) parseUnits() ([]unit, error) { // Count units. nunit := 0 b := makeBuf(d, "info", 0, d.info, 0) |