1LLVM-PDBUTIL(1)                      LLVM                      LLVM-PDBUTIL(1)
2
3
4

NAME

6       llvm-pdbutil - PDB File forensics and diagnostics
7
8Synopsis
9
10Description
11
12Subcommands
13
14pretty
15
16Summary
17
18Options
19
20Filtering and Sorting Options
21
22Symbol Type Options
23
24Other Options
25
26dump
27
28Summary
29
30Options
31
32MSF Container Options
33
34Module & File Options
35
36Symbol Options
37
38Type Record Options
39
40Miscellaneous Options
41
42bytes
43
44Summary
45
46Options
47
48MSF File Options
49
50PDB Stream Options
51
52DBI Stream Options
53
54Module Options
55
56Type Record Options
57
58pdb2yaml
59
60Summary
61
62Options
63
64yaml2pdb
65
66Summary
67
68Options
69
70merge
71
72Summary
73
74Options
75

SYNOPSIS

77       llvm-pdbutil [subcommand] [options]
78

DESCRIPTION

80       Display  types, symbols, CodeView records, and other information from a
81       PDB file, as well as manipulate and create PDB files.  llvm-pdbutil  is
82       normally  used  by FileCheck-based tests to test LLVM's PDB reading and
83       writing functionality, but can also be used for general PDB file inves‐
84       tigation and forensics, or as a replacement for cvdump.
85

SUBCOMMANDS

87       llvm-pdbutil  is  separated into several subcommands each tailored to a
88       different purpose.  A brief summary of each command follows, with  more
89       detail in the sections that follow.
90
91pretty  -  Dump symbol and type information in a format that tries
92            to look as much like the original source code as possible.
93
94dump - Dump low level types and structures from the PDB file,  in‐
95            cluding CodeView records, hash tables, PDB streams, etc.
96
97bytes  -  Dump  data  from the PDB file's streams, records, types,
98            symbols, etc as raw bytes.
99
100yaml2pdb - Given a yaml description of a PDB file, produce a valid
101            PDB file that matches that description.
102
103pdb2yaml  -  For  a  given PDB file, produce a YAML description of
104            some or all of the file in a  way  that  the  PDB  can  be  recon‐
105            structed.
106
107merge  - Given two PDBs, produce a third PDB that is the result of
108            merging the two input PDBs.
109
110   pretty
111       IMPORTANT:
112          The pretty subcommand is built on the Windows DIA SDK, and  as  such
113          is not supported on non-Windows platforms.
114
115       USAGE: llvm-pdbutil pretty [options] <input PDB file>
116
117   Summary
118       The pretty subcommand displays a very high level representation of your
119       program's debug info.  Since it is built on the Windows DIA  SDK  which
120       is the standard API that Windows tools and debuggers query debug infor‐
121       mation, it presents a more authoritative view of how a debugger is  go‐
122       ing  to  interpret  your  debug  information than a mode which displays
123       low-level CodeView records.
124
125   Options
126   Filtering and Sorting Options
127       NOTE:
128          exclude filters take priority over include filters.  So if a  filter
129          matches both an include and an exclude rule, then it is excluded.
130
131       -exclude-compilands=<string>
132              When dumping compilands, compiland source-file contributions, or
133              per-compiland symbols, this  option  instructs  llvm-pdbutil  to
134              omit any compilands that match the specified regular expression.
135
136       -exclude-symbols=<string>
137              When  dumping global, public, or per-compiland symbols, this op‐
138              tion instructs llvm-pdbutil to omit any symbols that  match  the
139              specified regular expression.
140
141       -exclude-types=<string>
142              When  dumping  types, this option instructs llvm-pdbutil to omit
143              any types that match the specified regular expression.
144
145       -include-compilands=<string>
146              When dumping compilands, compiland source-file contributions, or
147              per-compiland  symbols,  limit  the initial search to only those
148              compilands that match the specified regular expression.
149
150       -include-symbols=<string>
151              When dumping global, public, or per-compiland symbols, limit the
152              initial  search  to  only those symbols that match the specified
153              regular expression.
154
155       -include-types=<string>
156              When dumping types, limit the initial search to only those types
157              that match the specified regular expression.
158
159       -min-class-padding=<uint>
160              Only  display  types  that have at least the specified amount of
161              alignment padding, accounting for padding in  base  classes  and
162              aggregate field members.
163
164       -min-class-padding-imm=<uint>
165              Only  display  types  that have at least the specified amount of
166              alignment padding, ignoring padding in base classes  and  aggre‐
167              gate field members.
168
169       -min-type-size=<uint>
170              Only display types T where sizeof(T) is greater than or equal to
171              the specified amount.
172
173       -no-compiler-generated
174              Don't show compiler generated types and symbols
175
176       -no-enum-definitions
177              When dumping an enum, don't show the full enum (e.g.  the  indi‐
178              vidual enumerator values).
179
180       -no-system-libs
181              Don't show symbols from system libraries
182
183   Symbol Type Options
184       -all   Implies all other options in this category.
185
186       -class-definitions=<format>
187              Displays class definitions in the specified format.
188
189                 =all      - Display all class members including data, constants, typedefs, functions, etc (default)
190                 =layout   - Only display members that contribute to class size.
191                 =none     - Don't display class definitions (e.g. only display the name and base list)
192
193       -class-order
194              Displays classes in the specified order.
195
196                 =none            - Undefined / no particular sort order (default)
197                 =name            - Sort classes by name
198                 =size            - Sort classes by size
199                 =padding         - Sort classes by amount of padding
200                 =padding-pct     - Sort classes by percentage of space consumed by padding
201                 =padding-imm     - Sort classes by amount of immediate padding
202                 =padding-pct-imm - Sort classes by percentage of space consumed by immediate padding
203
204       -class-recurse-depth=<uint>
205              When  dumping class definitions, stop after recursing the speci‐
206              fied number of times.  The default is 0, which is no limit.
207
208       -classes
209              Display classes
210
211       -compilands
212              Display compilands (e.g. object files)
213
214       -enums Display enums
215
216       -externals
217              Dump external (e.g. exported) symbols
218
219       -globals
220              Dump global symbols
221
222       -lines Dump the mappings between source lines and code addresses.
223
224       -module-syms
225              Display symbols (variables, functions, etc) for each compiland
226
227       -sym-types=<types>
228              Type of symbols to dump  when  -globals,  -externals,  or  -mod‐
229              ule-syms is specified. (default all)
230
231                 =thunks - Display thunk symbols
232                 =data   - Display data symbols
233                 =funcs  - Display function symbols
234                 =all    - Display all symbols (default)
235
236       -symbol-order=<order>
237              For symbols dumped via the -module-syms, -globals, or -externals
238              options, sort the results in specified order.
239
240                 =none - Undefined / no particular sort order
241                 =name - Sort symbols by name
242                 =size - Sort symbols by size
243
244       -typedefs
245              Display typedef types
246
247       -types Display all types (implies -classes, -enums, -typedefs)
248
249   Other Options
250       -color-output
251              Force color output on or off.  By default, color if used if out‐
252              putting to a terminal.
253
254       -load-address=<uint>
255              When  displaying  relative virtual addresses, assume the process
256              is loaded at the given address and display what would be the ab‐
257              solute address.
258
259   dump
260       USAGE: llvm-pdbutil dump [options] <input PDB file>
261
262   Summary
263       The  dump subcommand displays low level information about the structure
264       of a PDB file.  It is used heavily by  LLVM's  testing  infrastructure,
265       but  can  also  be used for PDB forensics.  It serves a role similar to
266       that of Microsoft's cvdump tool.
267
268       NOTE:
269          The dump subcommand exposes internal details of the file format.  As
270          such,  the reader should be familiar with The PDB File Format before
271          using this command.
272
273   Options
274   MSF Container Options
275       -streams
276              dump a summary of all of the streams in the PDB file.
277
278       -stream-blocks
279              In conjunction with -streams,  add  information  to  the  output
280              about what blocks the specified stream occupies.
281
282       -summary
283              Dump MSF and PDB header information.
284
285   Module & File Options
286       -modi=<uint>
287              For  all  options  that dump information from each module/compi‐
288              land, limit to the specified module.
289
290       -files Dump the source files that contribute to each displayed module.
291
292       -il    Dump inlinee  line  information  (DEBUG_S_INLINEELINES  CodeView
293              subsection)
294
295       -l     Dump line information (DEBUG_S_LINES CodeView subsection)
296
297       -modules
298              Dump compiland information
299
300       -xme   Dump  cross  module  exports (DEBUG_S_CROSSSCOPEEXPORTS CodeView
301              subsection)
302
303       -xmi   Dump cross module  imports  (DEBUG_S_CROSSSCOPEIMPORTS  CodeView
304              subsection)
305
306   Symbol Options
307       -globals
308              dump global symbol records
309
310       -global-extras
311              dump  additional  information  about  the  globals, such as hash
312              buckets and hash values.
313
314       -publics
315              dump public symbol records
316
317       -public-extras
318              dump additional information about  the  publics,  such  as  hash
319              buckets and hash values.
320
321       -symbols
322              dump symbols (functions, variables, etc) for each module dumped.
323
324       -sym-data
325              For  each  symbol  record dumped as a result of the -symbols op‐
326              tion, display the full bytes of the record in binary as well.
327
328   Type Record Options
329       -types Dump CodeView type records from TPI stream
330
331       -type-extras
332              Dump additional information from the TPI stream, such as  hashes
333              and the type index offsets array.
334
335       -type-data
336              For  each  type  record  dumped,  display  the full bytes of the
337              record in binary as well.
338
339       -type-index=<uint>
340              Only dump types with the specified type index.
341
342       -ids   Dump CodeView type records from IPI stream.
343
344       -id-extras
345              Dump additional information from the IPI stream, such as  hashes
346              and the type index offsets array.
347
348       -id-data
349              For  each ID record dumped, display the full bytes of the record
350              in binary as well.
351
352       -id-index=<uint>
353              only dump ID records with the specified hexadecimal type index.
354
355       -dependents
356              When used in conjunction with -type-index  or  -id-index,  dumps
357              the  entire  dependency graph for the specified index instead of
358              just the single record with the specified index.   For  example,
359              if  type  index 0x4000 is a function whose return type has index
360              0x3000, and you specify -dependents=0x4000, then this would dump
361              both records (as well as any other dependents in the tree).
362
363   Miscellaneous Options
364       -all   Implies most other options.
365
366       -section-contribs
367              Dump section contributions.
368
369       -section-headers
370              Dump image section headers.
371
372       -section-map
373              Dump section map.
374
375       -string-table
376              Dump PDB string table.
377
378   bytes
379       USAGE: llvm-pdbutil bytes [options] <input PDB file>
380
381   Summary
382       Like  the  dump subcommand, the bytes subcommand displays low level in‐
383       formation about the structure of a PDB file, but it is  used  for  even
384       deeper  forensics.   The bytes subcommand finds various structures in a
385       PDB file based on the command line options specified, and dumps them in
386       hex.  Someone working on support for emitting PDBs would use this heav‐
387       ily, for example, to compare one PDB  against  another  PDB  to  ensure
388       byte-for-byte  compatibility.   It  is not enough to simply compare the
389       bytes of an entire file, or an entire  stream  because  it's  perfectly
390       fine for the same structure to exist at different locations in two dif‐
391       ferent PDBs, and "finding" the structure is half the battle.
392
393   Options
394   MSF File Options
395       -block-range=<start[-end]>
396              Dump binary data from specified range of MSF file blocks.
397
398       -byte-range=<start[-end]>
399              Dump binary data from specified range of bytes in the file.
400
401       -fpm   Dump the MSF free page map.
402
403       -stream-data=<string>
404              Dump  binary  data  from  the  specified  streams.   Format   is
405              SN[:Start][@Size].   For  example,  -stream-data=7:3@12 dumps 12
406              bytes from stream 7, starting at offset 3 in the stream.
407
408   PDB Stream Options
409       -name-map
410              Dump bytes of PDB Name Map
411
412   DBI Stream Options
413       -ec    Dump the edit and continue map substream of the DBI stream.
414
415       -files Dump the file info substream of the DBI stream.
416
417       -modi  Dump the modi substream of the DBI stream.
418
419       -sc    Dump section contributions substream of the DBI stream.
420
421       -sm    Dump the section map from the DBI stream.
422
423       -type-server
424              Dump the type server map from the DBI stream.
425
426   Module Options
427       -mod=<uint>
428              Limit all options in this category to the specified  module  in‐
429              dex.   By default, options in this category will dump bytes from
430              all modules.
431
432       -chunks
433              Dump the bytes of each module's C13 debug subsection.
434
435       -split-chunks
436              When specified with -chunks, split the C13 debug subsection into
437              a  separate  chunk for each subsection type, and dump them sepa‐
438              rately.
439
440       -syms  Dump the symbol record substream from each module.
441
442   Type Record Options
443       -id=<uint>
444              Dump the record from the IPI stream with the given type index.
445
446       -type=<uint>
447              Dump the record from the TPI stream with the given type index.
448
449   pdb2yaml
450       USAGE: llvm-pdbutil pdb2yaml [options] <input PDB file>
451
452   Summary
453   Options
454   yaml2pdb
455       USAGE: llvm-pdbutil yaml2pdb [options] <input YAML file>
456
457   Summary
458       Generate a PDB file from a YAML description.  The YAML  syntax  is  not
459       described  here.   Instead,  use  llvm-pdbutil pdb2yaml and examine the
460       output for an example starting point.
461
462   Options
463       -pdb=<file-name>
464
465       Write the resulting PDB to the specified file.
466
467   merge
468       USAGE: llvm-pdbutil merge [options] <input PDB file 1> <input PDB  file
469       2>
470
471   Summary
472       Merge two PDB files into a single file.
473
474   Options
475       -pdb=<file-name>
476
477       Write the resulting PDB to the specified file.
478

AUTHOR

480       Maintained by the LLVM Team (https://llvm.org/).
481
483       2003-2023, LLVM Project
484
485
486
487
48816                                2023-07-20                   LLVM-PDBUTIL(1)
Impressum