allewwaly / pdbparse

Automatically exported from code.google.com/p/pdbparse
1 stars 0 forks source link

new base type in visual studio 12? #16

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
we encountered an error parsing a pdb created by visual studio 12

$ python pdb_tpi_vtypes.py ConsoleApplication1.pdb 
Traceback (most recent call last):
  File "pdb_tpi_vtypes.py", line 157, in <module>
    pdb.STREAM_TPI.load()
  File "/usr/local/lib/python2.7/dist-packages/pdbparse/__init__.py", line 221, in load
    tpis = tpi.parse_stream(self.stream_file,unnamed_hack,elim_fwdrefs)
  File "/usr/local/lib/python2.7/dist-packages/pdbparse/tpi.py", line 1081, in parse_stream
    resolve_typerefs(t, types, min) for t in types[i].substructs
  File "/usr/local/lib/python2.7/dist-packages/pdbparse/tpi.py", line 1013, in resolve_typerefs
    setattr(leaf, attr, base_type._decode(ref,{}))
  File "/usr/local/lib/python2.7/dist-packages/construct-2.5.1-py2.7.egg/construct/adapters.py", line 99, in _decode
    obj, self.subcon.name))
construct.adapters.MappingError: no decoding mapping for 12 [base_type]

The same exe compiled with visual studio 2010 is handled fine. i attached both 
the problematic one (ConsoleApplication1.pdb) and the one that is ok 
(ConsoleApplication1_vc2010.pdb)

Original issue reported on code.google.com by michael.hale@gmail.com on 12 Nov 2013 at 1:24

Attachments:

GoogleCodeExporter commented 9 years ago
If you look at the thing it's trying to parse, it seems pretty clear something 
has gone more fundamentally wrong:

{'leaf_type': 'LF_FIELDLIST',
 'length': 70,
 'substructs': [{'fldattr': {'access': 'public',
    'compgenx': False,
    'mprop': 'MTvanilla',
    'noconstruct': False,
    'noinherit': False,
    'pseudo': False},
   'index': {'count': 0,
    'derived': 'T_NOTYPE',
    'fieldlist': 'T_NOTYPE',
    'leaf_type': 'LF_STRUCTURE',
    'length': 38,
    'name': 'Enum',
    'prop': {'cnested': False,
     'ctor': False,
     'fwdref': True,
     'isnested': False,
     'opassign': False,
     'opcast': False,
     'ovlops': False,
     'packed': False,
     'reserved': 1,
     'scoped': False},
    'size': 0,
    'tpi_idx': 5125,
    'vshape': 'T_NOTYPE'},
   'leaf_type': 'LF_BCLASS',
   'name': '\xf2\xf1\x11\x15\x1b',
   'offset': 0},
  {'leaf_type': 'LF_VFUNCTAB', 'type': 12}],
 'tpi_idx': 5138}

The name is garbage that looks like it includes the padding of one of the value 
types. So I'd guess something about the type stream has changed in VS2012, but 
I can't say what without looking into it more deeply.

Original comment by moo...@gmail.com on 3 Apr 2014 at 8:49