diff options
| author | Tobias Klauser <tklauser@distanz.ch> | 2018-05-23 14:04:48 +0200 |
|---|---|---|
| committer | Tobias Klauser <tobias.klauser@gmail.com> | 2018-05-23 12:26:19 +0000 |
| commit | 4bb649fba82412c292974a9f9255db1092d7faed (patch) | |
| tree | 3f9b5615f91a0b4694446444054f3a9911aa8c47 /src/debug | |
| parent | 1174ad3a8f6f9d2318ac45fca3cd90f12915cf04 (diff) | |
| download | go-4bb649fba82412c292974a9f9255db1092d7faed.tar.xz | |
debug/pe: gofmt
CL 110555 introduced some changes which were not properly gofmt'ed.
Because the CL was sent via Github the gofmt checks usually performed by
git-codereview didn't catch this (see #24946).
Change-Id: I65c1271620690dbeec88b4ce482d158f7d6df45d
Reviewed-on: https://go-review.googlesource.com/114255
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Diffstat (limited to 'src/debug')
| -rw-r--r-- | src/debug/pe/file.go | 8 | ||||
| -rw-r--r-- | src/debug/pe/pe.go | 29 |
2 files changed, 18 insertions, 19 deletions
diff --git a/src/debug/pe/file.go b/src/debug/pe/file.go index d1b1407f96..6fc1f3a60f 100644 --- a/src/debug/pe/file.go +++ b/src/debug/pe/file.go @@ -269,9 +269,9 @@ func (f *File) ImportedSymbols() ([]string, error) { dd_length = f.OptionalHeader.(*OptionalHeader32).NumberOfRvaAndSizes } - // check that the length of data directory entries is large + // check that the length of data directory entries is large // enough to include the imports directory. - if dd_length < IMAGE_DIRECTORY_ENTRY_IMPORT + 1 { + if dd_length < IMAGE_DIRECTORY_ENTRY_IMPORT+1 { return nil, nil } @@ -287,7 +287,7 @@ func (f *File) ImportedSymbols() ([]string, error) { var ds *Section ds = nil for _, s := range f.Sections { - if s.VirtualAddress <= idd.VirtualAddress && idd.VirtualAddress < s.VirtualAddress + s.VirtualSize { + if s.VirtualAddress <= idd.VirtualAddress && idd.VirtualAddress < s.VirtualAddress+s.VirtualSize { ds = s break } @@ -304,7 +304,7 @@ func (f *File) ImportedSymbols() ([]string, error) { } // seek to the virtual address specified in the import data directory - d = d[idd.VirtualAddress - ds.VirtualAddress:] + d = d[idd.VirtualAddress-ds.VirtualAddress:] // start decoding the import directory var ida []ImportDirectory diff --git a/src/debug/pe/pe.go b/src/debug/pe/pe.go index 9eaf33c310..872c977fe3 100644 --- a/src/debug/pe/pe.go +++ b/src/debug/pe/pe.go @@ -111,20 +111,19 @@ const ( // IMAGE_DIRECTORY_ENTRY constants const ( - IMAGE_DIRECTORY_ENTRY_EXPORT = 0 - IMAGE_DIRECTORY_ENTRY_IMPORT = 1 - IMAGE_DIRECTORY_ENTRY_RESOURCE = 2 - IMAGE_DIRECTORY_ENTRY_EXCEPTION = 3 - IMAGE_DIRECTORY_ENTRY_SECURITY = 4 - IMAGE_DIRECTORY_ENTRY_BASERELOC = 5 - IMAGE_DIRECTORY_ENTRY_DEBUG = 6 - IMAGE_DIRECTORY_ENTRY_ARCHITECTURE = 7 - IMAGE_DIRECTORY_ENTRY_GLOBALPTR = 8 - IMAGE_DIRECTORY_ENTRY_TLS = 9 - IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG = 10 - IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT = 11 - IMAGE_DIRECTORY_ENTRY_IAT = 12 - IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT = 13 + IMAGE_DIRECTORY_ENTRY_EXPORT = 0 + IMAGE_DIRECTORY_ENTRY_IMPORT = 1 + IMAGE_DIRECTORY_ENTRY_RESOURCE = 2 + IMAGE_DIRECTORY_ENTRY_EXCEPTION = 3 + IMAGE_DIRECTORY_ENTRY_SECURITY = 4 + IMAGE_DIRECTORY_ENTRY_BASERELOC = 5 + IMAGE_DIRECTORY_ENTRY_DEBUG = 6 + IMAGE_DIRECTORY_ENTRY_ARCHITECTURE = 7 + IMAGE_DIRECTORY_ENTRY_GLOBALPTR = 8 + IMAGE_DIRECTORY_ENTRY_TLS = 9 + IMAGE_DIRECTORY_ENTRY_LOAD_CONFIG = 10 + IMAGE_DIRECTORY_ENTRY_BOUND_IMPORT = 11 + IMAGE_DIRECTORY_ENTRY_IAT = 12 + IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT = 13 IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR = 14 ) - |
