summaryrefslogtreecommitdiff
path: root/ld/pdb.h
blob: 18e18e7111a13ffe0543536b546a8430778cb4e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
/* pdb.h - header file for generating PDB CodeView debugging files.
   Copyright (C) 2022-2023 Free Software Foundation, Inc.

   This file is part of the GNU Binutils.

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 3 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
   MA 02110-1301, USA.  */

/* Header files referred to below can be found in Microsoft's PDB
   repository: https://github.com/microsoft/microsoft-pdb.  */

#ifndef PDB_H
#define PDB_H

#include "sysdep.h"
#include "bfd.h"
#include <stdbool.h>
#include <stddef.h>

#define LF_VTSHAPE			0x000a
#define LF_MODIFIER			0x1001
#define LF_POINTER			0x1002
#define LF_PROCEDURE			0x1008
#define LF_MFUNCTION			0x1009
#define LF_ARGLIST			0x1201
#define LF_FIELDLIST			0x1203
#define LF_BITFIELD			0x1205
#define LF_METHODLIST			0x1206
#define LF_BCLASS			0x1400
#define LF_VBCLASS			0x1401
#define LF_IVBCLASS			0x1402
#define LF_INDEX			0x1404
#define LF_VFUNCTAB			0x1409
#define LF_ENUMERATE			0x1502
#define LF_ARRAY			0x1503
#define LF_CLASS			0x1504
#define LF_STRUCTURE			0x1505
#define LF_UNION			0x1506
#define LF_ENUM				0x1507
#define LF_MEMBER			0x150d
#define LF_STMEMBER			0x150e
#define LF_METHOD			0x150f
#define LF_NESTTYPE			0x1510
#define LF_ONEMETHOD			0x1511
#define LF_VFTABLE			0x151d
#define LF_FUNC_ID			0x1601
#define LF_MFUNC_ID			0x1602
#define LF_BUILDINFO			0x1603
#define LF_SUBSTR_LIST			0x1604
#define LF_STRING_ID			0x1605
#define LF_UDT_SRC_LINE			0x1606
#define LF_UDT_MOD_SRC_LINE		0x1607

#define LF_CHAR				0x8000
#define LF_SHORT			0x8001
#define LF_USHORT			0x8002
#define LF_LONG				0x8003
#define LF_ULONG			0x8004
#define LF_QUADWORD			0x8009
#define LF_UQUADWORD			0x800a

#define S_END				0x0006
#define S_FRAMEPROC			0x1012
#define S_OBJNAME			0x1101
#define S_THUNK32			0x1102
#define S_BLOCK32			0x1103
#define S_LABEL32			0x1105
#define S_REGISTER			0x1106
#define S_CONSTANT			0x1107
#define S_UDT				0x1108
#define S_BPREL32			0x110b
#define S_LDATA32			0x110c
#define S_GDATA32 			0x110d
#define S_PUB32				0x110e
#define S_LPROC32			0x110f
#define S_GPROC32			0x1110
#define S_REGREL32			0x1111
#define S_LTHREAD32			0x1112
#define S_GTHREAD32			0x1113
#define S_UNAMESPACE			0x1124
#define S_PROCREF			0x1125
#define S_LPROCREF			0x1127
#define S_FRAMECOOKIE			0x113a
#define S_COMPILE3			0x113c
#define S_ENVBLOCK			0x113d
#define S_LOCAL				0x113e
#define S_DEFRANGE_REGISTER		0x1141
#define S_DEFRANGE_FRAMEPOINTER_REL	0x1142
#define S_DEFRANGE_SUBFIELD_REGISTER	0x1143
#define S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE	0x1144
#define S_DEFRANGE_REGISTER_REL		0x1145
#define S_LPROC32_ID			0x1146
#define S_GPROC32_ID			0x1147
#define S_BUILDINFO			0x114c
#define S_INLINESITE			0x114d
#define S_INLINESITE_END		0x114e
#define S_PROC_ID_END			0x114f
#define S_HEAPALLOCSITE			0x115e

/* PDBStream70 in pdb1.h */
struct pdb_stream_70
{
  uint32_t version;
  uint32_t signature;
  uint32_t age;
  uint8_t guid[16];
};

#define PDB_STREAM_VERSION_VC70		20000404
#define PDB_STREAM_VERSION_VC140	20140508

/* HDR in tpi.h */
struct pdb_tpi_stream_header
{
  uint32_t version;
  uint32_t header_size;
  uint32_t type_index_begin;
  uint32_t type_index_end;
  uint32_t type_record_bytes;
  uint16_t hash_stream_index;
  uint16_t hash_aux_stream_index;
  uint32_t hash_key_size;
  uint32_t num_hash_buckets;
  uint32_t hash_value_buffer_offset;
  uint32_t hash_value_buffer_length;
  uint32_t index_offset_buffer_offset;
  uint32_t index_offset_buffer_length;
  uint32_t hash_adj_buffer_offset;
  uint32_t hash_adj_buffer_length;
};

#define TPI_STREAM_VERSION_80		20040203

#define TPI_FIRST_INDEX			0x1000
#define NUM_TPI_HASH_BUCKETS		0x3ffff

#define NUM_GLOBALS_HASH_BUCKETS	4096

/* NewDBIHdr in dbi.h */
struct pdb_dbi_stream_header
{
  uint32_t version_signature;
  uint32_t version_header;
  uint32_t age;
  uint16_t global_stream_index;
  uint16_t build_number;
  uint16_t public_stream_index;
  uint16_t pdb_dll_version;
  uint16_t sym_record_stream;
  uint16_t pdb_dll_rbld;
  uint32_t mod_info_size;
  uint32_t section_contribution_size;
  uint32_t section_map_size;
  uint32_t source_info_size;
  uint32_t type_server_map_size;
  uint32_t mfc_type_server_index;
  uint32_t optional_dbg_header_size;
  uint32_t ec_substream_size;
  uint16_t flags;
  uint16_t machine;
  uint32_t padding;
};

#define DBI_STREAM_VERSION_70		19990903

/* PSGSIHDR in gsi.h */
struct publics_header
{
  uint32_t sym_hash_size;
  uint32_t addr_map_size;
  uint32_t num_thunks;
  uint32_t thunks_size;
  uint32_t thunk_table;
  uint32_t thunk_table_offset;
  uint32_t num_sects;
};

/* GSIHashHdr in gsi.h */
struct globals_hash_header
{
  uint32_t signature;
  uint32_t version;
  uint32_t entries_size;
  uint32_t buckets_size;
};

/* HRFile in gsi.h */
struct hash_record
{
  uint32_t offset;
  uint32_t reference;
};

#define GLOBALS_HASH_SIGNATURE		0xffffffff
#define GLOBALS_HASH_VERSION_70		0xf12f091a

/* PUBSYM32 in cvinfo.h */
struct pubsym
{
  uint16_t record_length;
  uint16_t record_type;
  uint32_t flags;
  uint32_t offset;
  uint16_t section;
  /* followed by null-terminated string */
} ATTRIBUTE_PACKED;

/* see bitset CV_PUBSYMFLAGS in cvinfo.h */
#define PUBSYM_FUNCTION			0x2

struct optional_dbg_header
{
  uint16_t fpo_stream;
  uint16_t exception_stream;
  uint16_t fixup_stream;
  uint16_t omap_to_src_stream;
  uint16_t omap_from_src_stream;
  uint16_t section_header_stream;
  uint16_t token_map_stream;
  uint16_t xdata_stream;
  uint16_t pdata_stream;
  uint16_t new_fpo_stream;
  uint16_t orig_section_header_stream;
};

#define CV_SIGNATURE_C13		4

#define DEBUG_S_SYMBOLS			0xf1
#define DEBUG_S_LINES			0xf2
#define DEBUG_S_STRINGTABLE		0xf3
#define DEBUG_S_FILECHKSMS		0xf4

#define STRING_TABLE_SIGNATURE		0xeffeeffe
#define STRING_TABLE_VERSION		1

/* VHdr in nmt.h */
struct string_table_header
{
  uint32_t signature;
  uint32_t version;
};

#define SECTION_CONTRIB_VERSION_60	0xf12eba2d

/* SC in dbicommon.h */
struct section_contribution
{
  uint16_t section;
  uint16_t padding1;
  uint32_t offset;
  uint32_t size;
  uint32_t characteristics;
  uint16_t module_index;
  uint16_t padding2;
  uint32_t data_crc;
  uint32_t reloc_crc;
};

/* MODI_60_Persist in dbi.h */
struct module_info
{
  uint32_t unused1;
  struct section_contribution sc;
  uint16_t flags;
  uint16_t module_sym_stream;
  uint32_t sym_byte_size;
  uint32_t c11_byte_size;
  uint32_t c13_byte_size;
  uint16_t source_file_count;
  uint16_t padding;
  uint32_t unused2;
  uint32_t source_file_name_index;
  uint32_t pdb_file_path_name_index;
};

/* filedata in dumpsym7.cpp */
struct file_checksum
{
  uint32_t file_id;
  uint8_t checksum_length;
  uint8_t checksum_type;
} ATTRIBUTE_PACKED;

/* lfModifier in cvinfo.h */
struct lf_modifier
{
  uint16_t size;
  uint16_t kind;
  uint32_t base_type;
  uint16_t modifier;
  uint16_t padding;
} ATTRIBUTE_PACKED;

/* lfPointer in cvinfo.h */
struct lf_pointer
{
  uint16_t size;
  uint16_t kind;
  uint32_t base_type;
  uint32_t attributes;
} ATTRIBUTE_PACKED;

/* lfArgList in cvinfo.h (used for both LF_ARGLIST and LF_SUBSTR_LIST) */
struct lf_arglist
{
  uint16_t size;
  uint16_t kind;
  uint32_t num_entries;
  uint32_t args[];
} ATTRIBUTE_PACKED;

/* lfProc in cvinfo.h */
struct lf_procedure
{
  uint16_t size;
  uint16_t kind;
  uint32_t return_type;
  uint8_t calling_convention;
  uint8_t attributes;
  uint16_t num_parameters;
  uint32_t arglist;
} ATTRIBUTE_PACKED;

/* lfMFunc in cvinfo.h */
struct lf_mfunction
{
  uint16_t size;
  uint16_t kind;
  uint32_t return_type;
  uint32_t containing_class_type;
  uint32_t this_type;
  uint8_t calling_convention;
  uint8_t attributes;
  uint16_t num_parameters;
  uint32_t arglist;
  int32_t this_adjustment;
} ATTRIBUTE_PACKED;

/* lfArray in cvinfo.h */
struct lf_array
{
  uint16_t size;
  uint16_t kind;
  uint32_t element_type;
  uint32_t index_type;
  uint16_t length_in_bytes;
  char name[];
} ATTRIBUTE_PACKED;

/* lfBitfield in cvinfo.h */
struct lf_bitfield
{
  uint16_t size;
  uint16_t kind;
  uint32_t base_type;
  uint8_t length;
  uint8_t position;
} ATTRIBUTE_PACKED;

/* lfMember in cvinfo.h */
struct lf_member
{
  uint16_t kind;
  uint16_t attributes;
  uint32_t type;
  uint16_t offset;
  char name[];
} ATTRIBUTE_PACKED;

/* from bitfield structure CV_prop_t in cvinfo.h */
#define CV_PROP_FORWARD_REF	0x80
#define CV_PROP_SCOPED		0x100
#define CV_PROP_HAS_UNIQUE_NAME	0x200

/* lfClass in cvinfo.h */
struct lf_class
{
  uint16_t size;
  uint16_t kind;
  uint16_t num_members;
  uint16_t properties;
  uint32_t field_list;
  uint32_t derived_from;
  uint32_t vshape;
  uint16_t length;
  char name[];
} ATTRIBUTE_PACKED;

/* lfUnion in cvinfo.h */
struct lf_union
{
  uint16_t size;
  uint16_t kind;
  uint16_t num_members;
  uint16_t properties;
  uint32_t field_list;
  uint16_t length;
  char name[];
} ATTRIBUTE_PACKED;

/* lfEnumerate in cvinfo.h */
struct lf_enumerate
{
  uint16_t kind;
  uint16_t attributes;
  uint16_t value;
  /* then actual value if value >= 0x8000 */
  char name[];
} ATTRIBUTE_PACKED;

/* lfEnum in cvinfo.h */
struct lf_enum
{
  uint16_t size;
  uint16_t kind;
  uint16_t num_elements;
  uint16_t properties;
  uint32_t underlying_type;
  uint32_t field_list;
  char name[];
} ATTRIBUTE_PACKED;

/* lfIndex in cvinfo.h */
struct lf_index
{
  uint16_t kind;
  uint16_t padding;
  uint32_t index;
} ATTRIBUTE_PACKED;

/* lfOneMethod in cvinfo.h */
struct lf_onemethod
{
  uint16_t kind;
  uint16_t method_attribute;
  uint32_t method_type;
  char name[];
} ATTRIBUTE_PACKED;

/* mlMethod in cvinfo.h */
struct lf_methodlist_entry
{
  uint16_t method_attribute;
  uint16_t padding;
  uint32_t method_type;
} ATTRIBUTE_PACKED;

/* lfMethodList in cvinfo.h */
struct lf_methodlist
{
  uint16_t size;
  uint16_t kind;
  struct lf_methodlist_entry entries[];
} ATTRIBUTE_PACKED;

/* lfMethod in cvinfo.h */
struct lf_method
{
  uint16_t kind;
  uint16_t count;
  uint32_t method_list;
  char name[];
} ATTRIBUTE_PACKED;

/* lfBClass in cvinfo.h */
struct lf_bclass
{
  uint16_t kind;
  uint16_t attributes;
  uint32_t base_class_type;
  uint16_t offset;
} ATTRIBUTE_PACKED;

/* lfVFuncTab in cvinfo.h */
struct lf_vfunctab
{
  uint16_t kind;
  uint16_t padding;
  uint32_t type;
} ATTRIBUTE_PACKED;

/* lfVBClass in cvinfo.h */
struct lf_vbclass
{
  uint16_t kind;
  uint16_t attributes;
  uint32_t base_class_type;
  uint32_t virtual_base_pointer_type;
  uint16_t virtual_base_pointer_offset;
  uint16_t virtual_base_vbtable_offset;
} ATTRIBUTE_PACKED;

/* lfSTMember in cvinfo.h */
struct lf_static_member
{
  uint16_t kind;
  uint16_t attributes;
  uint32_t type;
  char name[];
} ATTRIBUTE_PACKED;

/* lfNestType in cvinfo.h */
struct lf_nest_type
{
  uint16_t kind;
  uint16_t padding;
  uint32_t type;
  char name[];
} ATTRIBUTE_PACKED;

/* lfStringId in cvinfo.h */
struct lf_string_id
{
  uint16_t size;
  uint16_t kind;
  uint32_t substring;
  char string[];
} ATTRIBUTE_PACKED;

/* lfBuildInfo in cvinfo.h */
struct lf_build_info
{
  uint16_t size;
  uint16_t kind;
  uint16_t count;
  uint32_t strings[];
} ATTRIBUTE_PACKED;

/* lfFuncId in cvinfo.h */
struct lf_func_id
{
  uint16_t size;
  uint16_t kind;
  uint32_t parent_scope;
  uint32_t function_type;
  char name[];
} ATTRIBUTE_PACKED;

/* lfMFuncId in cvinfo.h */
struct lf_mfunc_id
{
  uint16_t size;
  uint16_t kind;
  uint32_t parent_type;
  uint32_t function_type;
  char name[];
} ATTRIBUTE_PACKED;

/* lfUdtSrcLine in cvinfo.h */
struct lf_udt_src_line
{
  uint16_t size;
  uint16_t kind;
  uint32_t type;
  uint32_t source_file_type;
  uint32_t line_no;
} ATTRIBUTE_PACKED;

/* lfUdtModSrcLine in cvinfo.h */
struct lf_udt_mod_src_line
{
  uint16_t size;
  uint16_t kind;
  uint32_t type;
  uint32_t source_file_string;
  uint32_t line_no;
  uint16_t module_no;
} ATTRIBUTE_PACKED;

/* lfVftable in cvinfo.h */
struct lf_vftable
{
  uint16_t size;
  uint16_t kind;
  uint32_t type;
  uint32_t base_vftable;
  uint32_t offset;
  uint32_t names_len;
  char names[];
} ATTRIBUTE_PACKED;

/* DATASYM32 in cvinfo.h */
struct datasym
{
  uint16_t size;
  uint16_t kind;
  uint32_t type;
  uint32_t offset;
  uint16_t section;
  char name[];
} ATTRIBUTE_PACKED;

/* PROCSYM32 in cvinfo.h */
struct procsym
{
  uint16_t size;
  uint16_t kind;
  uint32_t parent;
  uint32_t end;
  uint32_t next;
  uint32_t proc_len;
  uint32_t debug_start;
  uint32_t debug_end;
  uint32_t type;
  uint32_t offset;
  uint16_t section;
  uint8_t flags;
  char name[];
} ATTRIBUTE_PACKED;

/* REFSYM2 in cvinfo.h */
struct refsym
{
  uint16_t size;
  uint16_t kind;
  uint32_t sum_name;
  uint32_t symbol_offset;
  uint16_t mod;
  char name[];
} ATTRIBUTE_PACKED;

/* UDTSYM in cvinfo.h */
struct udtsym
{
  uint16_t size;
  uint16_t kind;
  uint32_t type;
  char name[];
} ATTRIBUTE_PACKED;

/* CONSTSYM in cvinfo.h */
struct constsym
{
  uint16_t size;
  uint16_t kind;
  uint32_t type;
  uint16_t value;
  /* then actual value if value >= 0x8000 */
  char name[];
} ATTRIBUTE_PACKED;

/* BUILDINFOSYM in cvinfo.h */
struct buildinfosym
{
  uint16_t size;
  uint16_t kind;
  uint32_t type;
} ATTRIBUTE_PACKED;

/* BLOCKSYM32 in cvinfo.h */
struct blocksym
{
  uint16_t size;
  uint16_t kind;
  uint32_t parent;
  uint32_t end;
  uint32_t len;
  uint32_t offset;
  uint16_t section;
  char name[];
} ATTRIBUTE_PACKED;

/* BPRELSYM32 in cvinfo.h */
struct bprelsym
{
  uint16_t size;
  uint16_t kind;
  uint32_t bp_offset;
  uint32_t type;
  char name[];
} ATTRIBUTE_PACKED;

/* REGSYM in cvinfo.h */
struct regsym
{
  uint16_t size;
  uint16_t kind;
  uint32_t type;
  uint16_t reg;
  char name[];
} ATTRIBUTE_PACKED;

/* REGREL32 in cvinfo.h */
struct regrel
{
  uint16_t size;
  uint16_t kind;
  uint32_t offset;
  uint32_t type;
  uint16_t reg;
  char name[];
} ATTRIBUTE_PACKED;

/* LOCALSYM in cvinfo.h */
struct localsym
{
  uint16_t size;
  uint16_t kind;
  uint32_t type;
  uint16_t flags;
  char name[];
} ATTRIBUTE_PACKED;

/* CV_LVAR_ADDR_RANGE in cvinfo.h */
struct lvar_addr_range
{
  uint32_t offset;
  uint16_t section;
  uint16_t length;
} ATTRIBUTE_PACKED;

/* CV_LVAR_ADDR_GAP in cvinfo.h */
struct lvar_addr_gap {
  uint16_t offset;
  uint16_t length;
} ATTRIBUTE_PACKED;

/* DEFRANGESYMREGISTERREL in cvinfo.h */
struct defrange_register_rel
{
  uint16_t size;
  uint16_t kind;
  uint16_t reg;
  uint16_t offset_parent;
  uint32_t offset_register;
  struct lvar_addr_range range;
  struct lvar_addr_gap gaps[];
} ATTRIBUTE_PACKED;

/* DEFRANGESYMFRAMEPOINTERREL in cvinfo.h */
struct defrange_framepointer_rel
{
  uint16_t size;
  uint16_t kind;
  uint32_t offset;
  struct lvar_addr_range range;
  struct lvar_addr_gap gaps[];
} ATTRIBUTE_PACKED;

/* DEFRANGESYMSUBFIELDREGISTER in cvinfo.h */
struct defrange_subfield_register
{
  uint16_t size;
  uint16_t kind;
  uint16_t reg;
  uint16_t attributes;
  uint32_t offset_parent;
  struct lvar_addr_range range;
  struct lvar_addr_gap gaps[];
} ATTRIBUTE_PACKED;

/* DEFRANGESYMREGISTER in cvinfo.h */
struct defrange_register
{
  uint16_t size;
  uint16_t kind;
  uint16_t reg;
  uint16_t attributes;
  struct lvar_addr_range range;
  struct lvar_addr_gap gaps[];
} ATTRIBUTE_PACKED;

/* INLINESITESYM in cvinfo.h */
struct inline_site
{
  uint16_t size;
  uint16_t kind;
  uint32_t parent;
  uint32_t end;
  uint32_t inlinee;
  uint8_t binary_annotations[];
} ATTRIBUTE_PACKED;

/* THUNKSYM32 in cvinfo.h */
struct thunk
{
  uint16_t size;
  uint16_t kind;
  uint32_t parent;
  uint32_t end;
  uint32_t next;
  uint32_t offset;
  uint16_t section;
  uint16_t length;
  uint8_t thunk_type;
  char name[];
} ATTRIBUTE_PACKED;

/* HEAPALLOCSITE in cvinfo.h */
struct heap_alloc_site
{
  uint16_t size;
  uint16_t kind;
  uint32_t offset;
  uint16_t section;
  uint16_t length;
  uint32_t type;
} ATTRIBUTE_PACKED;

/* OBJNAMESYM in cvinfo.h */
struct objname
{
  uint16_t size;
  uint16_t kind;
  uint32_t signature;
  char name[];
} ATTRIBUTE_PACKED;

#define CV_CFL_80386			0x03
#define CV_CFL_X64			0xD0
#define CV_CFL_ARM64			0xF6

#define CV_CFL_LINK			0x07

/* COMPILESYM3 in cvinfo.h */
struct compile3
{
  uint16_t size;
  uint16_t kind;
  uint32_t flags;
  uint16_t machine;
  uint16_t frontend_major;
  uint16_t frontend_minor;
  uint16_t frontend_build;
  uint16_t frontend_qfe;
  uint16_t backend_major;
  uint16_t backend_minor;
  uint16_t backend_build;
  uint16_t backend_qfe;
  char compiler[];
} ATTRIBUTE_PACKED;

/* ENVBLOCKSYM in cvinfo.h */
struct envblock
{
  uint16_t size;
  uint16_t kind;
  uint8_t flags;
  char strings[];
} ATTRIBUTE_PACKED;

extern bool create_pdb_file (bfd *, const char *, const unsigned char *);

#endif