diff options
Diffstat (limited to 'src/pkg/debug')
-rw-r--r-- | src/pkg/debug/binary/binary.go | 4 | ||||
-rw-r--r-- | src/pkg/debug/dwarf/buf.go | 6 | ||||
-rw-r--r-- | src/pkg/debug/dwarf/entry.go | 10 | ||||
-rw-r--r-- | src/pkg/debug/elf/elf_test.go | 2 | ||||
-rw-r--r-- | src/pkg/debug/elf/file.go | 2 | ||||
-rw-r--r-- | src/pkg/debug/elf/file_test.go | 32 | ||||
-rw-r--r-- | src/pkg/debug/gosym/pclntab.go | 2 | ||||
-rw-r--r-- | src/pkg/debug/proc/proc_linux.go | 4 |
8 files changed, 31 insertions, 31 deletions
diff --git a/src/pkg/debug/binary/binary.go b/src/pkg/debug/binary/binary.go index 78e9baa17..836a43df0 100644 --- a/src/pkg/debug/binary/binary.go +++ b/src/pkg/debug/binary/binary.go @@ -141,8 +141,8 @@ func sizeof(t reflect.Type) int { } type decoder struct { - order ByteOrder; - buf []byte; + order ByteOrder; + buf []byte; } func (d *decoder) uint8() uint8 { diff --git a/src/pkg/debug/dwarf/buf.go b/src/pkg/debug/dwarf/buf.go index e4cb28e5d..2d8211090 100644 --- a/src/pkg/debug/dwarf/buf.go +++ b/src/pkg/debug/dwarf/buf.go @@ -33,7 +33,7 @@ func (b *buf) uint8() uint8 { return 0; } val := b.data[0]; - b.data = b.data[1 : len(b.data)]; + b.data = b.data[1:len(b.data)]; b.off++; return val; } @@ -44,7 +44,7 @@ func (b *buf) bytes(n int) []byte { return nil; } data := b.data[0:n]; - b.data = b.data[n : len(b.data)]; + b.data = b.data[n:len(b.data)]; b.off += Offset(n); return data; } @@ -95,7 +95,7 @@ func (b *buf) uint64() uint64 { func (b *buf) varint() (c uint64, bits uint) { for i := 0; i < len(b.data); i++ { byte := b.data[i]; - c |= uint64(byte&0x7F) << bits; + c |= uint64(byte&0x7F)<<bits; bits += 7; if byte&0x80 == 0 { b.off += Offset(i+1); diff --git a/src/pkg/debug/dwarf/entry.go b/src/pkg/debug/dwarf/entry.go index 0554a249b..97e58af40 100644 --- a/src/pkg/debug/dwarf/entry.go +++ b/src/pkg/debug/dwarf/entry.go @@ -190,15 +190,15 @@ func (b *buf) entry(atab abbrevTable, ubase Offset) *Entry { case formRefAddr: val = Offset(b.addr()); case formRef1: - val = Offset(b.uint8()) + ubase; + val = Offset(b.uint8())+ubase; case formRef2: - val = Offset(b.uint16()) + ubase; + val = Offset(b.uint16())+ubase; case formRef4: - val = Offset(b.uint32()) + ubase; + val = Offset(b.uint32())+ubase; case formRef8: - val = Offset(b.uint64()) + ubase; + val = Offset(b.uint64())+ubase; case formRefUdata: - val = Offset(b.uint()) + ubase; + val = Offset(b.uint())+ubase; // string case formString: diff --git a/src/pkg/debug/elf/elf_test.go b/src/pkg/debug/elf/elf_test.go index c6cf7bfe4..c48e6d959 100644 --- a/src/pkg/debug/elf/elf_test.go +++ b/src/pkg/debug/elf/elf_test.go @@ -20,7 +20,7 @@ var nameTests = []nameTest{ nameTest{EM_860, "EM_860"}, nameTest{SHN_LOPROC, "SHN_LOPROC"}, nameTest{SHT_PROGBITS, "SHT_PROGBITS"}, - nameTest{SHF_MERGE+SHF_TLS, "SHF_MERGE+SHF_TLS"}, + nameTest{SHF_MERGE + SHF_TLS, "SHF_MERGE+SHF_TLS"}, nameTest{PT_LOAD, "PT_LOAD"}, nameTest{PF_W+PF_R+0x50, "PF_W+PF_R+0x50"}, nameTest{DT_SYMBOLIC, "DT_SYMBOLIC"}, diff --git a/src/pkg/debug/elf/file.go b/src/pkg/debug/elf/file.go index f2d665797..0c5d6f317 100644 --- a/src/pkg/debug/elf/file.go +++ b/src/pkg/debug/elf/file.go @@ -298,7 +298,7 @@ func NewFile(r io.ReaderAt) (*File, os.Error) { var ok bool; s.Name, ok = getString(shstrtab, int(names[i])); if !ok { - return nil, &FormatError{shoff + int64(i*shentsize), "bad section name index", names[i]}; + return nil, &FormatError{shoff+int64(i * shentsize), "bad section name index", names[i]}; } } diff --git a/src/pkg/debug/elf/file_test.go b/src/pkg/debug/elf/file_test.go index 140841b6d..01e638eea 100644 --- a/src/pkg/debug/elf/file_test.go +++ b/src/pkg/debug/elf/file_test.go @@ -32,14 +32,14 @@ var fileTests = []fileTest{ SectionHeader{".text", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR, 0x80483cc, 0x3cc, 0x180, 0x0, 0x0, 0x4, 0x0}, SectionHeader{".fini", SHT_PROGBITS, SHF_ALLOC + SHF_EXECINSTR, 0x804854c, 0x54c, 0xc, 0x0, 0x0, 0x4, 0x0}, SectionHeader{".rodata", SHT_PROGBITS, SHF_ALLOC, 0x8048558, 0x558, 0xa3, 0x0, 0x0, 0x1, 0x0}, - SectionHeader{".data", SHT_PROGBITS, SHF_WRITE+SHF_ALLOC, 0x80495fc, 0x5fc, 0xc, 0x0, 0x0, 0x4, 0x0}, + SectionHeader{".data", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x80495fc, 0x5fc, 0xc, 0x0, 0x0, 0x4, 0x0}, SectionHeader{".eh_frame", SHT_PROGBITS, SHF_ALLOC, 0x8049608, 0x608, 0x4, 0x0, 0x0, 0x4, 0x0}, - SectionHeader{".dynamic", SHT_DYNAMIC, SHF_WRITE+SHF_ALLOC, 0x804960c, 0x60c, 0x98, 0x4, 0x0, 0x4, 0x8}, - SectionHeader{".ctors", SHT_PROGBITS, SHF_WRITE+SHF_ALLOC, 0x80496a4, 0x6a4, 0x8, 0x0, 0x0, 0x4, 0x0}, - SectionHeader{".dtors", SHT_PROGBITS, SHF_WRITE+SHF_ALLOC, 0x80496ac, 0x6ac, 0x8, 0x0, 0x0, 0x4, 0x0}, - SectionHeader{".jcr", SHT_PROGBITS, SHF_WRITE+SHF_ALLOC, 0x80496b4, 0x6b4, 0x4, 0x0, 0x0, 0x4, 0x0}, - SectionHeader{".got", SHT_PROGBITS, SHF_WRITE+SHF_ALLOC, 0x80496b8, 0x6b8, 0x1c, 0x0, 0x0, 0x4, 0x4}, - SectionHeader{".bss", SHT_NOBITS, SHF_WRITE+SHF_ALLOC, 0x80496d4, 0x6d4, 0x20, 0x0, 0x0, 0x4, 0x0}, + SectionHeader{".dynamic", SHT_DYNAMIC, SHF_WRITE + SHF_ALLOC, 0x804960c, 0x60c, 0x98, 0x4, 0x0, 0x4, 0x8}, + SectionHeader{".ctors", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x80496a4, 0x6a4, 0x8, 0x0, 0x0, 0x4, 0x0}, + SectionHeader{".dtors", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x80496ac, 0x6ac, 0x8, 0x0, 0x0, 0x4, 0x0}, + SectionHeader{".jcr", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x80496b4, 0x6b4, 0x4, 0x0, 0x0, 0x4, 0x0}, + SectionHeader{".got", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x80496b8, 0x6b8, 0x1c, 0x0, 0x0, 0x4, 0x4}, + SectionHeader{".bss", SHT_NOBITS, SHF_WRITE + SHF_ALLOC, 0x80496d4, 0x6d4, 0x20, 0x0, 0x0, 0x4, 0x0}, SectionHeader{".comment", SHT_PROGBITS, 0x0, 0x0, 0x6d4, 0x12d, 0x0, 0x0, 0x1, 0x0}, SectionHeader{".debug_aranges", SHT_PROGBITS, 0x0, 0x0, 0x801, 0x20, 0x0, 0x0, 0x1, 0x0}, SectionHeader{".debug_pubnames", SHT_PROGBITS, 0x0, 0x0, 0x821, 0x1b, 0x0, 0x0, 0x1, 0x0}, @@ -75,21 +75,21 @@ var fileTests = []fileTest{ SectionHeader{".rodata", SHT_PROGBITS, SHF_ALLOC, 0x4005a4, 0x5a4, 0x11, 0x0, 0x0, 0x4, 0x0}, SectionHeader{".eh_frame_hdr", SHT_PROGBITS, SHF_ALLOC, 0x4005b8, 0x5b8, 0x24, 0x0, 0x0, 0x4, 0x0}, SectionHeader{".eh_frame", SHT_PROGBITS, SHF_ALLOC, 0x4005e0, 0x5e0, 0xa4, 0x0, 0x0, 0x8, 0x0}, - SectionHeader{".ctors", SHT_PROGBITS, SHF_WRITE+SHF_ALLOC, 0x600688, 0x688, 0x10, 0x0, 0x0, 0x8, 0x0}, - SectionHeader{".dtors", SHT_PROGBITS, SHF_WRITE+SHF_ALLOC, 0x600698, 0x698, 0x10, 0x0, 0x0, 0x8, 0x0}, - SectionHeader{".jcr", SHT_PROGBITS, SHF_WRITE+SHF_ALLOC, 0x6006a8, 0x6a8, 0x8, 0x0, 0x0, 0x8, 0x0}, - SectionHeader{".dynamic", SHT_DYNAMIC, SHF_WRITE+SHF_ALLOC, 0x6006b0, 0x6b0, 0x1a0, 0x6, 0x0, 0x8, 0x10}, - SectionHeader{".got", SHT_PROGBITS, SHF_WRITE+SHF_ALLOC, 0x600850, 0x850, 0x8, 0x0, 0x0, 0x8, 0x8}, - SectionHeader{".got.plt", SHT_PROGBITS, SHF_WRITE+SHF_ALLOC, 0x600858, 0x858, 0x28, 0x0, 0x0, 0x8, 0x8}, - SectionHeader{".data", SHT_PROGBITS, SHF_WRITE+SHF_ALLOC, 0x600880, 0x880, 0x18, 0x0, 0x0, 0x8, 0x0}, - SectionHeader{".bss", SHT_NOBITS, SHF_WRITE+SHF_ALLOC, 0x600898, 0x898, 0x8, 0x0, 0x0, 0x4, 0x0}, + SectionHeader{".ctors", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x600688, 0x688, 0x10, 0x0, 0x0, 0x8, 0x0}, + SectionHeader{".dtors", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x600698, 0x698, 0x10, 0x0, 0x0, 0x8, 0x0}, + SectionHeader{".jcr", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x6006a8, 0x6a8, 0x8, 0x0, 0x0, 0x8, 0x0}, + SectionHeader{".dynamic", SHT_DYNAMIC, SHF_WRITE + SHF_ALLOC, 0x6006b0, 0x6b0, 0x1a0, 0x6, 0x0, 0x8, 0x10}, + SectionHeader{".got", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x600850, 0x850, 0x8, 0x0, 0x0, 0x8, 0x8}, + SectionHeader{".got.plt", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x600858, 0x858, 0x28, 0x0, 0x0, 0x8, 0x8}, + SectionHeader{".data", SHT_PROGBITS, SHF_WRITE + SHF_ALLOC, 0x600880, 0x880, 0x18, 0x0, 0x0, 0x8, 0x0}, + SectionHeader{".bss", SHT_NOBITS, SHF_WRITE + SHF_ALLOC, 0x600898, 0x898, 0x8, 0x0, 0x0, 0x4, 0x0}, SectionHeader{".comment", SHT_PROGBITS, 0x0, 0x0, 0x898, 0x126, 0x0, 0x0, 0x1, 0x0}, SectionHeader{".debug_aranges", SHT_PROGBITS, 0x0, 0x0, 0x9c0, 0x90, 0x0, 0x0, 0x10, 0x0}, SectionHeader{".debug_pubnames", SHT_PROGBITS, 0x0, 0x0, 0xa50, 0x25, 0x0, 0x0, 0x1, 0x0}, SectionHeader{".debug_info", SHT_PROGBITS, 0x0, 0x0, 0xa75, 0x1a7, 0x0, 0x0, 0x1, 0x0}, SectionHeader{".debug_abbrev", SHT_PROGBITS, 0x0, 0x0, 0xc1c, 0x6f, 0x0, 0x0, 0x1, 0x0}, SectionHeader{".debug_line", SHT_PROGBITS, 0x0, 0x0, 0xc8b, 0x13f, 0x0, 0x0, 0x1, 0x0}, - SectionHeader{".debug_str", SHT_PROGBITS, SHF_MERGE+SHF_STRINGS, 0x0, 0xdca, 0xb1, 0x0, 0x0, 0x1, 0x1}, + SectionHeader{".debug_str", SHT_PROGBITS, SHF_MERGE + SHF_STRINGS, 0x0, 0xdca, 0xb1, 0x0, 0x0, 0x1, 0x1}, SectionHeader{".debug_ranges", SHT_PROGBITS, 0x0, 0x0, 0xe80, 0x90, 0x0, 0x0, 0x10, 0x0}, SectionHeader{".shstrtab", SHT_STRTAB, 0x0, 0x0, 0xf10, 0x149, 0x0, 0x0, 0x1, 0x0}, SectionHeader{".symtab", SHT_SYMTAB, 0x0, 0x0, 0x19a0, 0x6f0, 0x24, 0x39, 0x8, 0x18}, diff --git a/src/pkg/debug/gosym/pclntab.go b/src/pkg/debug/gosym/pclntab.go index 458b5243d..24c368616 100644 --- a/src/pkg/debug/gosym/pclntab.go +++ b/src/pkg/debug/gosym/pclntab.go @@ -46,7 +46,7 @@ func (t *LineTable) parse(targetPC uint64, targetLine int) (b []byte, pc uint64, case code <= 128: line -= int(code-64); default: - pc += quantum * uint64(code-128); + pc += quantum*uint64(code-128); continue; } pc += quantum; diff --git a/src/pkg/debug/proc/proc_linux.go b/src/pkg/debug/proc/proc_linux.go index 82291be23..d2c8b8af2 100644 --- a/src/pkg/debug/proc/proc_linux.go +++ b/src/pkg/debug/proc/proc_linux.go @@ -515,7 +515,7 @@ func (ev *debugEvent) doTrap() (threadState, os.Error) { return stopped, err; } - b, ok := t.proc.breakpoints[uintptr(regs.PC()) - uintptr(len(bpinst386))]; + b, ok := t.proc.breakpoints[uintptr(regs.PC())-uintptr(len(bpinst386))]; if !ok { // We must have hit a breakpoint that was actually in // the program. Leave the IP where it is so we don't @@ -1218,7 +1218,7 @@ func (p *process) attachAllThreads() os.Error { if err != nil { // There could have been a race, or // this process could be a zobmie. - statFile, err2 := io.ReadFile(taskPath + "/" + tidStr + "/stat"); + statFile, err2 := io.ReadFile(taskPath+"/"+tidStr+"/stat"); if err2 != nil { switch err2 := err2.(type) { case *os.PathError: |