Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(432)

Delta Between Two Patch Sets: src/pkg/debug/pe/file.go

Issue 4715041: code review 4715041: go/printer: changed max. number of newlines from 3 to 2 (Closed)
Left Patch Set: Created 13 years, 8 months ago
Right Patch Set: diff -r 43f78423340b https://go.googlecode.com/hg/ Created 13 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/debug/elf/elf.go ('k') | src/pkg/ebnf/ebnf.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(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 // Package pe implements access to PE (Microsoft Windows Portable Executable) fi les. 5 // Package pe implements access to PE (Microsoft Windows Portable Executable) fi les.
6 package pe 6 package pe
7 7
8 import ( 8 import (
9 "debug/dwarf" 9 "debug/dwarf"
10 "encoding/binary" 10 "encoding/binary"
(...skipping 17 matching lines...) Expand all
28 VirtualAddress uint32 28 VirtualAddress uint32
29 Size uint32 29 Size uint32
30 Offset uint32 30 Offset uint32
31 PointerToRelocations uint32 31 PointerToRelocations uint32
32 PointerToLineNumbers uint32 32 PointerToLineNumbers uint32
33 NumberOfRelocations uint16 33 NumberOfRelocations uint16
34 NumberOfLineNumbers uint16 34 NumberOfLineNumbers uint16
35 Characteristics uint32 35 Characteristics uint32
36 } 36 }
37 37
38
39 type Section struct { 38 type Section struct {
40 SectionHeader 39 SectionHeader
41 40
42 // Embed ReaderAt for ReadAt method. 41 // Embed ReaderAt for ReadAt method.
43 // Do not embed SectionReader directly 42 // Do not embed SectionReader directly
44 // to avoid having Read and Seek. 43 // to avoid having Read and Seek.
45 // If a client wants Read and Seek it must use 44 // If a client wants Read and Seek it must use
46 // Open() to avoid fighting over the seek offset 45 // Open() to avoid fighting over the seek offset
47 // with other clients. 46 // with other clients.
48 io.ReaderAt 47 io.ReaderAt
(...skipping 12 matching lines...) Expand all
61 60
62 // Data reads and returns the contents of the PE section. 61 // Data reads and returns the contents of the PE section.
63 func (s *Section) Data() ([]byte, os.Error) { 62 func (s *Section) Data() ([]byte, os.Error) {
64 dat := make([]byte, s.sr.Size()) 63 dat := make([]byte, s.sr.Size())
65 n, err := s.sr.ReadAt(dat, 0) 64 n, err := s.sr.ReadAt(dat, 0)
66 return dat[0:n], err 65 return dat[0:n], err
67 } 66 }
68 67
69 // Open returns a new ReadSeeker reading the PE section. 68 // Open returns a new ReadSeeker reading the PE section.
70 func (s *Section) Open() io.ReadSeeker { return io.NewSectionReader(s.sr, 0, 1<< 63-1) } 69 func (s *Section) Open() io.ReadSeeker { return io.NewSectionReader(s.sr, 0, 1<< 63-1) }
71
72 70
73 type FormatError struct { 71 type FormatError struct {
74 off int64 72 off int64
75 msg string 73 msg string
76 val interface{} 74 val interface{}
77 } 75 }
78 76
79 func (e *FormatError) String() string { 77 func (e *FormatError) String() string {
80 msg := e.msg 78 msg := e.msg
81 if e.val != nil { 79 if e.val != nil {
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 } 306 }
309 307
310 // ImportedLibraries returns the names of all libraries 308 // ImportedLibraries returns the names of all libraries
311 // referred to by the binary f that are expected to be 309 // referred to by the binary f that are expected to be
312 // linked with the binary at dynamic link time. 310 // linked with the binary at dynamic link time.
313 func (f *File) ImportedLibraries() ([]string, os.Error) { 311 func (f *File) ImportedLibraries() ([]string, os.Error) {
314 // TODO 312 // TODO
315 // cgo -dynimport don't use this for windows PE, so just return. 313 // cgo -dynimport don't use this for windows PE, so just return.
316 return nil, nil 314 return nil, nil
317 } 315 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b