ModiStream.rst 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. =====================================
  2. The Module Information Stream
  3. =====================================
  4. .. contents::
  5. :local:
  6. .. _modi_stream_intro:
  7. Introduction
  8. ============
  9. The Module Info Stream (henceforth referred to as the Modi stream) contains
  10. information about a single module (object file, import library, etc that
  11. contributes to the binary this PDB contains debug information about. There
  12. is one modi stream for each module, and the mapping between modi stream index
  13. and module is contained in the :doc:`DBI Stream <DbiStream>`. The modi stream
  14. for a single module contains line information for the compiland, as well as
  15. all CodeView information for the symbols defined in the compiland. Finally,
  16. there is a "global refs" substream which is not well understood.
  17. .. _modi_stream_layout:
  18. Stream Layout
  19. =============
  20. A modi stream is laid out as follows:
  21. .. code-block:: c++
  22. struct ModiStream {
  23. uint32_t Signature;
  24. uint8_t Symbols[SymbolSize-4];
  25. uint8_t C11LineInfo[C11Size];
  26. uint8_t C13LineInfo[C13Size];
  27. uint32_t GlobalRefsSize;
  28. uint8_t GlobalRefs[GlobalRefsSize];
  29. };
  30. - **Signature** - Unknown. In practice only the value of ``4`` has been
  31. observed. It is hypothesized that this value corresponds to the set of
  32. ``CV_SIGNATURE_xx`` defines in ``cvinfo.h``, with the value of ``4``
  33. meaning that this module has C13 line information (as opposed to C11 line
  34. information). A corollary of this is that we expect to only ever see
  35. C13 line info, and that we do not understand the format of C11 line info.
  36. - **Symbols** - The :ref:`CodeView Symbol Substream <modi_symbol_substream>`.
  37. ``SymbolSize`` is equal to the value of ``SymByteSize`` for the
  38. corresponding module's entry in the :ref:`Module Info Substream
  39. <dbi_mod_info_substream>` of the :doc:`DBI Stream <DbiStream>`.
  40. - **C11LineInfo** - A block containing CodeView line information in C11
  41. format. ``C11Size`` is equal to the value of ``C11ByteSize`` from the
  42. :ref:`Module Info Substream <dbi_mod_info_substream>` of the
  43. :doc:`DBI Stream <DbiStream>`. If this value is ``0``, then C11 line
  44. information is not present. As mentioned previously, the format of
  45. C11 line info is not understood and we assume all line in modern PDBs
  46. to be in C13 format.
  47. - **C13LineInfo** - A block containing CodeView line information in C13
  48. format. ``C13Size`` is equal to the value of ``C13ByteSize`` from the
  49. :ref:`Module Info Substream <dbi_mod_info_substream>` of the
  50. :doc:`DBI Stream <DbiStream>`. If this value is ``0``, then C13 line
  51. information is not present.
  52. - **GlobalRefs** - The meaning of this substream is not understood.
  53. .. _modi_symbol_substream:
  54. The CodeView Symbol Substream
  55. =============================
  56. The CodeView Symbol Substream. This is an array of variable length
  57. records describing the functions, variables, inlining information,
  58. and other symbols defined in the compiland. The entire array consumes
  59. ``SymbolSize-4`` bytes. The format of a CodeView Symbol Record (and
  60. thusly, an array of CodeView Symbol Records) is described in
  61. :doc:`CodeViewSymbols`.