Hiya,
So the IMAGE_FILE_MACHINE field add in r69 isn't always set in files from the
2003 and XP debugging symbol packs. Since the enumeration doesn't include 0,
tpi_vtypes.py will fail with:
Traceback (most recent call last):
File "tpi_vtypes.py", line 139, in <module>
pdb.STREAM_DBI.load()
File "/home/mike/tmp/pdbparse/trunk/pdbparse/__init__.py", line 215, in load
debug = dbi.parse_stream(self.stream_file)
File "/home/mike/tmp/pdbparse/trunk/pdbparse/dbi.py", line 83, in parse_stream
dbihdr = DBIHeader.parse_stream(stream)
File "/usr/lib64/python2.7/site-packages/construct/core.py", line 129, in parse_stream
return self._parse(stream, AttrDict())
File "/usr/lib64/python2.7/site-packages/construct/core.py", line 553, in _parse
subobj = sc._parse(stream, context)
File "/usr/lib64/python2.7/site-packages/construct/core.py", line 181, in _parse
return self._decode(self.subcon._parse(stream, context), context)
File "/usr/lib64/python2.7/site-packages/construct/adapters.py", line 97, in _decode
raise MappingError("no decoding mapping for %r" % (obj,))
construct.adapters.MappingError: no decoding mapping for 0
I've attached a patch that allows an IMAGE_FILE_MACHINE value of 0, and gives a
warning if it occurs requiring the user to specify an arch pointer size (since
both x86 and x64 2003 pdbs have no machine setting, so we can't just default to
4).
Original issue reported on code.google.com by mike.auty@gmail.com on 15 Mar 2012 at 10:08
Original issue reported on code.google.com by
mike.auty@gmail.com
on 15 Mar 2012 at 10:08Attachments: