Home | History | Annotate | Download | only in codeview
      1    CV8 structures (for x86 and AMD64) - used by MSVC 8 (2005)
      2    Everything listed in the order MASM seems to output it in.
      3 
      4 .debug$S: symbol and line number information
      5     4 bytes - version (4)
      6 
      7 Each major portion of DEBUG$S starts with 4 byte type, 4 byte length
      8 (in bytes following the length field).  Each set is 4-byte aligned with 0s at
      9 the end (not included in length).
     10 
     11 0x000000F3: source filename string table
     12     1 byte - 0 (0th filename)
     13     0-terminated filename strings, 1 for each source file
     14 
     15 0x000000F4: source file info
     16     for each source file:
     17         4 bytes - offset of filename in source filename string table
     18 	{2 bytes - checksum type/length? (0x0110)
     19 	 16 bytes - MD5 checksum of source file} OR
     20 	{2 bytes - no checksum (0)}
     21 	2 bytes - 0 (padding?)
     22 
     23 0x000000F2: line numbers for section
     24     4 bytes - start offset in section (SECREL to section start)
     25     2 bytes - section index (SECTION to section start)
     26     2 bytes - pad/align (0)
     27     4 bytes - section length covered by line number info
     28     4 bytes - offset of source file in source file info table
     29     4 bytes - number of line number pairs
     30     4 bytes - number of bytes of line number pairs + 12
     31 
     32     followed by pairs of:
     33       4 bytes - offset in section
     34       4 bytes - line number; if high bit is set,
     35                 end of statement/breakpointable (?) - e.g. lines containing
     36 	        just labels should have line numbers
     37 
     38 0x000000F1: symbol information
     39     enclosed data per below
     40     (each element starts with 2 byte length, 2 byte type)
     41     basically slightly updated versions of CV5 symbol info with 0-terminated
     42     rather than length-prefixed strings
     43 
     44 0x1101 : Name of object file
     45     4 byte signature (0 for asm)
     46     0-terminated object filename
     47 0x1116 : creator signature (compile flag)
     48     4 bytes - language (3=Masm)
     49     4 bytes - target processor (0xD0 = AMD64)
     50     4 bytes - flags
     51     4 bytes - version
     52     2 bytes - ?
     53     0-terminated string containing creator name
     54     pairs of 0-terminated strings - keys/values
     55     from CL:
     56 	cwd - current working directory
     57 	cl - full path of compiler executable
     58 	cmd - full args (one long string, double-quoted args if needed)
     59 	src - relative path to source (from cwd)
     60 	pdb - full path to pdb file
     61     ML doesn't output any pairs
     62     pairs list terminated with two empty strings
     63 0x1105 : Code Label 16:32/64
     64     4 bytes SECREL of symbol
     65     2 bytes SECTION of symbol
     66     1 byte - flags
     67     0-terminated string containing symbol name
     68 0x110C : local data 16:32/64
     69     4 bytes type index of symbol
     70     4 bytes SECREL of symbol
     71     2 bytes SECTION of symbol
     72     0-terminated string containing symbol name
     73 0x110D : global data 16:32/64
     74     4 bytes type index of symbol
     75     4 bytes SECREL of symbol
     76     2 bytes SECTION of symbol
     77     0-terminated string containing symbol name
     78 0x1110 : local/global (?) procedure start 16:32/64
     79     4 bytes - parent
     80     4 bytes - pend
     81     4 bytes - pnext
     82     4 bytes - procedure length (bytes)
     83     4 bytes - debug start (offset from procedure start to frame setup)
     84     4 bytes - debug end (offset from procedure start to frame cleanup)
     85     4 bytes - type index of procedure type
     86     4 bytes - offset of procedure (SECREL of symbol)
     87     2 bytes - segment of procedure (SECTION of symbol)
     88     1 byte - flags
     89     0-terminated string containing procedure name
     90 
     91 .debug$T: type information
     92     4 bytes - version (4)
     93     followed by type information per CV5 spec, padded to 4-byte boundaries
     94 
     95