summaryrefslogtreecommitdiffstats
path: root/test/Scripts/coff-dump.py
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-09-15 03:58:51 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-09-15 03:58:51 +0000
commit00002796bbb11f58435b9f43d63fd6d0657fc3a5 (patch)
tree13bc4feb7b3044e3acc1d6110a30bea6c7483e58 /test/Scripts/coff-dump.py
parent9c0c5c16e98827d9d7bc4c1eb4e5e08a967bb9c6 (diff)
downloadexternal_llvm-00002796bbb11f58435b9f43d63fd6d0657fc3a5.zip
external_llvm-00002796bbb11f58435b9f43d63fd6d0657fc3a5.tar.gz
external_llvm-00002796bbb11f58435b9f43d63fd6d0657fc3a5.tar.bz2
test: Fix coff-dump section array indicies to 1 based to match file format.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113928 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Scripts/coff-dump.py')
-rwxr-xr-xtest/Scripts/coff-dump.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/test/Scripts/coff-dump.py b/test/Scripts/coff-dump.py
index 38fc3bb..7868c00 100755
--- a/test/Scripts/coff-dump.py
+++ b/test/Scripts/coff-dump.py
@@ -73,7 +73,7 @@ file = ('struct', [
(0x4000, 'IMAGE_FILE_UP_SYSTEM_ONLY', ),
(0x8000, 'IMAGE_FILE_BYTES_REVERSED_HI', ),
])),
- ('Sections', ('array', 'NumberOfSections', ('struct', [
+ ('Sections', ('array', '1', 'NumberOfSections', ('struct', [
('Name', ('scalar', '<8s', secname)),
('VirtualSize', ('scalar', '<L', '%d' )),
('VirtualAddress', ('scalar', '<L', '%d' )),
@@ -123,7 +123,7 @@ file = ('struct', [
(0x80000000, 'IMAGE_SCN_MEM_WRITE'),
])),
('SectionData', ('ptr', 'PointerToRawData', ('blob', 'SizeOfRawData'))),
- ('Relocations', ('ptr', 'PointerToRelocations', ('array', 'NumberOfRelocations', ('struct', [
+ ('Relocations', ('ptr', 'PointerToRelocations', ('array', '0', 'NumberOfRelocations', ('struct', [
('VirtualAddress', ('scalar', '<L', '0x%X')),
('SymbolTableIndex', ('scalar', '<L', '%d' )),
('Type', ('enum', '<H', '%d', ('MachineType', {
@@ -463,18 +463,20 @@ def handle_struct(entry):
return newFields
def handle_array(entry):
- length = entry[1]
- element = entry[2]
+ start_index = entry[1]
+ length = entry[2]
+ element = entry[3]
newItems = []
write("[\n")
indent()
+ start_index = read_value(start_index)
value = read_value(length)
for index in xrange(value):
- write("%d = "%index)
+ write("%d = " % (index + start_index))
value = handle_element(element)
write("\n")
newItems.append(value)