LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 // DWARF type information structures. | 5 // DWARF type information structures. |
6 // The format is heavily biased toward C, but for simplicity | 6 // The format is heavily biased toward C, but for simplicity |
7 // the String methods use a pseudo-Go syntax. | 7 // the String methods use a pseudo-Go syntax. |
8 | 8 |
9 package dwarf | 9 package dwarf |
10 | 10 |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 // Create new array type underneath this
one. | 345 // Create new array type underneath this
one. |
346 t.Type = &ArrayType{Type: t.Type, Count:
max + 1} | 346 t.Type = &ArrayType{Type: t.Type, Count:
max + 1} |
347 } | 347 } |
348 ndim++ | 348 ndim++ |
349 case TagEnumerationType: | 349 case TagEnumerationType: |
350 err = DecodeError{"info", kid.Offset, "cannot ha
ndle enumeration type as array bound"} | 350 err = DecodeError{"info", kid.Offset, "cannot ha
ndle enumeration type as array bound"} |
351 goto Error | 351 goto Error |
352 } | 352 } |
353 } | 353 } |
354 if ndim == 0 { | 354 if ndim == 0 { |
355 » » » err = DecodeError{"info", e.Offset, "missing dimension f
or array"} | 355 » » » // LLVM generates this for x[]. |
356 » » » goto Error | 356 » » » t.Count = -1 |
357 } | 357 } |
358 | 358 |
359 case TagBaseType: | 359 case TagBaseType: |
360 // Basic type. (DWARF v2 §5.1) | 360 // Basic type. (DWARF v2 §5.1) |
361 // Attributes: | 361 // Attributes: |
362 // AttrName: name of base type in programming language of t
he compilation unit [required] | 362 // AttrName: name of base type in programming language of t
he compilation unit [required] |
363 // AttrEncoding: encoding value for type (encFloat etc) [re
quired] | 363 // AttrEncoding: encoding value for type (encFloat etc) [re
quired] |
364 // AttrByteSize: size of type in bytes [required] | 364 // AttrByteSize: size of type in bytes [required] |
365 // AttrBitOffset: for sub-byte types, size in bits | 365 // AttrBitOffset: for sub-byte types, size in bits |
366 // AttrBitSize: for sub-byte types, bit offset of high orde
r bit in the AttrByteSize bytes | 366 // AttrBitSize: for sub-byte types, bit offset of high orde
r bit in the AttrByteSize bytes |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 | 574 |
575 return typ, nil | 575 return typ, nil |
576 | 576 |
577 Error: | 577 Error: |
578 // If the parse fails, take the type out of the cache | 578 // If the parse fails, take the type out of the cache |
579 // so that the next call with this offset doesn't hit | 579 // so that the next call with this offset doesn't hit |
580 // the cache and return success. | 580 // the cache and return success. |
581 d.typeCache[off] = nil, false | 581 d.typeCache[off] = nil, false |
582 return nil, err | 582 return nil, err |
583 } | 583 } |
LEFT | RIGHT |