[PATCH 0/6] MR298: Improve support for types out of PDB files

eric pouech (@epo) wine at gitlab.winehq.org
Wed Jun 22 09:41:14 CDT 2022

Current dbghelp support for reading C/C++ types out of PDB files suffer from some
- several records for the same type (ie struct/class/union/enum with same name)
  can be present in a PDB file. This can happen when recompiling a compilation
  unit after modifying the definition of such type (eg adding a field a struct).
  The PDB file seems to be incrementally modified, and ends up with the old and
  new definition of such type inside the PDB file.
- this of course can lead to erroneous information out of dbghelp. When looking
  for a type by name, dbghelp must return the new definition.
- such errors have been experienced in two situations:
  + some type definition are stored in two different records in PDB file. A
    simple example is 'struct list { struct list* next; };' where the circular
    reference is broken by first generating a forward record for struct list,
    followed by the full definition of struct list (using the forward record
    as the type for the 'next' field. Resolution from forward record to find
    implementation record is done by name lookup.
  + finding a type by its name (SymGetTypeFromName)
- PDB uses the order of elements in its hash table to pick up the "newest" one.
- the incremental linker can also modify the hash table order (but I didn't
  find out yet what triggers it), using specific entries (ie like patching
  the hash table order).

This series:
- improve winedump to dump information stored in stream of types' hash
- cleans up some type handling related code
- modifies type loader out of PDB files to handle correctly the defaults listed


More information about the wine-devel mailing list