lisette-stdlib 0.1.11

Little language inspired by Rust that compiles to Go
Documentation
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
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
// Generated by Lisette bindgen
// Source: debug/dwarf (Go stdlib)
// Go: 1.25.5
// Lisette: 0.1.11

import "go:encoding/binary"

pub enum Attr: uint32 {
  AttrAbstractOrigin = 0x31,
  AttrAccessibility = 0x32,
  AttrAddrBase = 0x73,
  AttrAddrClass = 0x33,
  AttrAlignment = 0x88,
  AttrAllocated = 0x4E,
  AttrArtificial = 0x34,
  AttrAssociated = 0x4F,
  AttrBaseTypes = 0x35,
  AttrBinaryScale = 0x5B,
  AttrBitOffset = 0x0C,
  AttrBitSize = 0x0D,
  AttrByteSize = 0x0B,
  AttrCallAllCalls = 0x7A,
  AttrCallAllSourceCalls = 0x7B,
  AttrCallAllTailCalls = 0x7C,
  AttrCallColumn = 0x57,
  AttrCallDataLocation = 0x85,
  AttrCallDataValue = 0x86,
  AttrCallFile = 0x58,
  AttrCallLine = 0x59,
  AttrCallOrigin = 0x7F,
  AttrCallPC = 0x81,
  AttrCallParameter = 0x80,
  AttrCallReturnPC = 0x7D,
  AttrCallTailCall = 0x82,
  AttrCallTarget = 0x83,
  AttrCallTargetClobbered = 0x84,
  AttrCallValue = 0x7E,
  AttrCalling = 0x36,
  AttrCommonRef = 0x1A,
  AttrCompDir = 0x1B,
  AttrConstExpr = 0x6C,
  AttrConstValue = 0x1C,
  AttrContainingType = 0x1D,
  AttrCount = 0x37,
  AttrDataBitOffset = 0x6B,
  AttrDataLocation = 0x50,
  AttrDataMemberLoc = 0x38,
  AttrDecimalScale = 0x5C,
  AttrDecimalSign = 0x5E,
  AttrDeclColumn = 0x39,
  AttrDeclFile = 0x3A,
  AttrDeclLine = 0x3B,
  AttrDeclaration = 0x3C,
  AttrDefaultValue = 0x1E,
  AttrDefaulted = 0x8B,
  AttrDeleted = 0x8A,
  AttrDescription = 0x5A,
  AttrDigitCount = 0x5F,
  AttrDiscr = 0x15,
  AttrDiscrList = 0x3D,
  AttrDiscrValue = 0x16,
  AttrDwoName = 0x76,
  AttrElemental = 0x66,
  AttrEncoding = 0x3E,
  AttrEndianity = 0x65,
  AttrEntrypc = 0x52,
  AttrEnumClass = 0x6D,
  AttrExplicit = 0x63,
  AttrExportSymbols = 0x89,
  AttrExtension = 0x54,
  AttrExternal = 0x3F,
  AttrFrameBase = 0x40,
  AttrFriend = 0x41,
  AttrHighpc = 0x12,
  AttrIdentifierCase = 0x42,
  AttrImport = 0x18,
  AttrInline = 0x20,
  AttrIsOptional = 0x21,
  AttrLanguage = 0x13,
  AttrLinkageName = 0x6E,
  AttrLocation = 0x02,
  AttrLoclistsBase = 0x8C,
  AttrLowerBound = 0x22,
  AttrLowpc = 0x11,
  AttrMacroInfo = 0x43,
  AttrMacros = 0x79,
  AttrMainSubprogram = 0x6A,
  AttrMutable = 0x61,
  AttrName = 0x03,
  AttrNamelistItem = 0x44,
  AttrNoreturn = 0x87,
  AttrObjectPointer = 0x64,
  AttrOrdering = 0x09,
  AttrPictureString = 0x60,
  AttrPriority = 0x45,
  AttrProducer = 0x25,
  AttrPrototyped = 0x27,
  AttrPure = 0x67,
  AttrRanges = 0x55,
  AttrRank = 0x71,
  AttrRecursive = 0x68,
  AttrReference = 0x77,
  AttrReturnAddr = 0x2A,
  AttrRnglistsBase = 0x74,
  AttrRvalueReference = 0x78,
  AttrSegment = 0x46,
  AttrSibling = 0x01,
  AttrSignature = 0x69,
  AttrSmall = 0x5D,
  AttrSpecification = 0x47,
  AttrStartScope = 0x2C,
  AttrStaticLink = 0x48,
  AttrStmtList = 0x10,
  AttrStrOffsetsBase = 0x72,
  AttrStride = 0x51,
  AttrStrideSize = 0x2E,
  AttrStringLength = 0x19,
  AttrStringLengthBitSize = 0x6F,
  AttrStringLengthByteSize = 0x70,
  AttrThreadsScaled = 0x62,
  AttrTrampoline = 0x56,
  AttrType = 0x49,
  AttrUpperBound = 0x2F,
  AttrUseLocation = 0x4A,
  AttrUseUTF8 = 0x53,
  AttrVarParam = 0x4B,
  AttrVirtuality = 0x4C,
  AttrVisibility = 0x17,
  AttrVtableElemLoc = 0x4D,
}

pub const AttrAbstractOrigin: Attr = 0x31

pub const AttrAccessibility: Attr = 0x32

pub const AttrAddrBase: Attr = 0x73

pub const AttrAddrClass: Attr = 0x33

pub const AttrAlignment: Attr = 0x88

pub const AttrAllocated: Attr = 0x4E

pub const AttrArtificial: Attr = 0x34

pub const AttrAssociated: Attr = 0x4F

pub const AttrBaseTypes: Attr = 0x35

pub const AttrBinaryScale: Attr = 0x5B

pub const AttrBitOffset: Attr = 0x0C

pub const AttrBitSize: Attr = 0x0D

pub const AttrByteSize: Attr = 0x0B

pub const AttrCallAllCalls: Attr = 0x7A

pub const AttrCallAllSourceCalls: Attr = 0x7B

pub const AttrCallAllTailCalls: Attr = 0x7C

pub const AttrCallColumn: Attr = 0x57

pub const AttrCallDataLocation: Attr = 0x85

pub const AttrCallDataValue: Attr = 0x86

pub const AttrCallFile: Attr = 0x58

pub const AttrCallLine: Attr = 0x59

pub const AttrCallOrigin: Attr = 0x7F

pub const AttrCallPC: Attr = 0x81

pub const AttrCallParameter: Attr = 0x80

pub const AttrCallReturnPC: Attr = 0x7D

pub const AttrCallTailCall: Attr = 0x82

pub const AttrCallTarget: Attr = 0x83

pub const AttrCallTargetClobbered: Attr = 0x84

pub const AttrCallValue: Attr = 0x7E

pub const AttrCalling: Attr = 0x36

pub const AttrCommonRef: Attr = 0x1A

pub const AttrCompDir: Attr = 0x1B

pub const AttrConstExpr: Attr = 0x6C

pub const AttrConstValue: Attr = 0x1C

pub const AttrContainingType: Attr = 0x1D

pub const AttrCount: Attr = 0x37

pub const AttrDataBitOffset: Attr = 0x6B

pub const AttrDataLocation: Attr = 0x50

pub const AttrDataMemberLoc: Attr = 0x38

pub const AttrDecimalScale: Attr = 0x5C

pub const AttrDecimalSign: Attr = 0x5E

pub const AttrDeclColumn: Attr = 0x39

pub const AttrDeclFile: Attr = 0x3A

pub const AttrDeclLine: Attr = 0x3B

pub const AttrDeclaration: Attr = 0x3C

pub const AttrDefaultValue: Attr = 0x1E

pub const AttrDefaulted: Attr = 0x8B

pub const AttrDeleted: Attr = 0x8A

pub const AttrDescription: Attr = 0x5A

pub const AttrDigitCount: Attr = 0x5F

pub const AttrDiscr: Attr = 0x15

pub const AttrDiscrList: Attr = 0x3D

pub const AttrDiscrValue: Attr = 0x16

pub const AttrDwoName: Attr = 0x76

pub const AttrElemental: Attr = 0x66

pub const AttrEncoding: Attr = 0x3E

pub const AttrEndianity: Attr = 0x65

pub const AttrEntrypc: Attr = 0x52

pub const AttrEnumClass: Attr = 0x6D

pub const AttrExplicit: Attr = 0x63

pub const AttrExportSymbols: Attr = 0x89

pub const AttrExtension: Attr = 0x54

pub const AttrExternal: Attr = 0x3F

pub const AttrFrameBase: Attr = 0x40

pub const AttrFriend: Attr = 0x41

pub const AttrHighpc: Attr = 0x12

pub const AttrIdentifierCase: Attr = 0x42

pub const AttrImport: Attr = 0x18

pub const AttrInline: Attr = 0x20

pub const AttrIsOptional: Attr = 0x21

pub const AttrLanguage: Attr = 0x13

pub const AttrLinkageName: Attr = 0x6E

pub const AttrLocation: Attr = 0x02

pub const AttrLoclistsBase: Attr = 0x8C

pub const AttrLowerBound: Attr = 0x22

pub const AttrLowpc: Attr = 0x11

pub const AttrMacroInfo: Attr = 0x43

pub const AttrMacros: Attr = 0x79

pub const AttrMainSubprogram: Attr = 0x6A

pub const AttrMutable: Attr = 0x61

pub const AttrName: Attr = 0x03

pub const AttrNamelistItem: Attr = 0x44

pub const AttrNoreturn: Attr = 0x87

pub const AttrObjectPointer: Attr = 0x64

pub const AttrOrdering: Attr = 0x09

pub const AttrPictureString: Attr = 0x60

pub const AttrPriority: Attr = 0x45

pub const AttrProducer: Attr = 0x25

pub const AttrPrototyped: Attr = 0x27

pub const AttrPure: Attr = 0x67

pub const AttrRanges: Attr = 0x55

pub const AttrRank: Attr = 0x71

pub const AttrRecursive: Attr = 0x68

pub const AttrReference: Attr = 0x77

pub const AttrReturnAddr: Attr = 0x2A

pub const AttrRnglistsBase: Attr = 0x74

pub const AttrRvalueReference: Attr = 0x78

pub const AttrSegment: Attr = 0x46

pub const AttrSibling: Attr = 0x01

pub const AttrSignature: Attr = 0x69

pub const AttrSmall: Attr = 0x5D

pub const AttrSpecification: Attr = 0x47

pub const AttrStartScope: Attr = 0x2C

pub const AttrStaticLink: Attr = 0x48

pub const AttrStmtList: Attr = 0x10

pub const AttrStrOffsetsBase: Attr = 0x72

pub const AttrStride: Attr = 0x51

pub const AttrStrideSize: Attr = 0x2E

pub const AttrStringLength: Attr = 0x19

pub const AttrStringLengthBitSize: Attr = 0x6F

pub const AttrStringLengthByteSize: Attr = 0x70

pub const AttrThreadsScaled: Attr = 0x62

pub const AttrTrampoline: Attr = 0x56

pub const AttrType: Attr = 0x49

pub const AttrUpperBound: Attr = 0x2F

pub const AttrUseLocation: Attr = 0x4A

pub const AttrUseUTF8: Attr = 0x53

pub const AttrVarParam: Attr = 0x4B

pub const AttrVirtuality: Attr = 0x4C

pub const AttrVisibility: Attr = 0x17

pub const AttrVtableElemLoc: Attr = 0x4D

pub enum Class: int {
  ClassAddrPtr = 15,
  ClassAddress = 1,
  ClassBlock = 2,
  ClassConstant = 3,
  ClassExprLoc = 4,
  ClassFlag = 5,
  ClassLinePtr = 6,
  ClassLocList = 16,
  ClassLocListPtr = 7,
  ClassMacPtr = 8,
  ClassRangeListPtr = 9,
  ClassReference = 10,
  ClassReferenceAlt = 13,
  ClassReferenceSig = 11,
  ClassRngList = 17,
  ClassRngListsPtr = 18,
  ClassStrOffsetsPtr = 19,
  ClassString = 12,
  ClassStringAlt = 14,
  ClassUnknown = 0,
}

pub const ClassAddrPtr: Class = 15

pub const ClassAddress: Class = 1

pub const ClassBlock: Class = 2

pub const ClassConstant: Class = 3

pub const ClassExprLoc: Class = 4

pub const ClassFlag: Class = 5

pub const ClassLinePtr: Class = 6

pub const ClassLocList: Class = 16

pub const ClassLocListPtr: Class = 7

pub const ClassMacPtr: Class = 8

pub const ClassRangeListPtr: Class = 9

pub const ClassReference: Class = 10

pub const ClassReferenceAlt: Class = 13

pub const ClassReferenceSig: Class = 11

pub const ClassRngList: Class = 17

pub const ClassRngListsPtr: Class = 18

pub const ClassStrOffsetsPtr: Class = 19

pub const ClassString: Class = 12

pub const ClassStringAlt: Class = 14

pub const ClassUnknown: Class = 0

pub enum Tag: uint32 {
  TagAccessDeclaration = 0x23,
  TagArrayType = 0x01,
  TagAtomicType = 0x47,
  TagBaseType = 0x24,
  TagCallSite = 0x48,
  TagCallSiteParameter = 0x49,
  TagCatchDwarfBlock = 0x25,
  TagClassType = 0x02,
  TagCoarrayType = 0x44,
  TagCommonDwarfBlock = 0x1A,
  TagCommonInclusion = 0x1B,
  TagCompileUnit = 0x11,
  TagCondition = 0x3F,
  TagConstType = 0x26,
  TagConstant = 0x27,
  TagDwarfProcedure = 0x36,
  TagDynamicType = 0x46,
  TagEntryPoint = 0x03,
  TagEnumerationType = 0x04,
  TagEnumerator = 0x28,
  TagFileType = 0x29,
  TagFormalParameter = 0x05,
  TagFriend = 0x2A,
  TagGenericSubrange = 0x45,
  TagImmutableType = 0x4B,
  TagImportedDeclaration = 0x08,
  TagImportedModule = 0x3A,
  TagImportedUnit = 0x3D,
  TagInheritance = 0x1C,
  TagInlinedSubroutine = 0x1D,
  TagInterfaceType = 0x38,
  TagLabel = 0x0A,
  TagLexDwarfBlock = 0x0B,
  TagMember = 0x0D,
  TagModule = 0x1E,
  TagMutableType = 0x3E,
  TagNamelist = 0x2B,
  TagNamelistItem = 0x2C,
  TagNamespace = 0x39,
  TagPackedType = 0x2D,
  TagPartialUnit = 0x3C,
  TagPointerType = 0x0F,
  TagPtrToMemberType = 0x1F,
  TagReferenceType = 0x10,
  TagRestrictType = 0x37,
  TagRvalueReferenceType = 0x42,
  TagSetType = 0x20,
  TagSharedType = 0x40,
  TagSkeletonUnit = 0x4A,
  TagStringType = 0x12,
  TagStructType = 0x13,
  TagSubprogram = 0x2E,
  TagSubrangeType = 0x21,
  TagSubroutineType = 0x15,
  TagTemplateAlias = 0x43,
  TagTemplateTypeParameter = 0x2F,
  TagTemplateValueParameter = 0x30,
  TagThrownType = 0x31,
  TagTryDwarfBlock = 0x32,
  TagTypeUnit = 0x41,
  TagTypedef = 0x16,
  TagUnionType = 0x17,
  TagUnspecifiedParameters = 0x18,
  TagUnspecifiedType = 0x3B,
  TagVariable = 0x34,
  TagVariant = 0x19,
  TagVariantPart = 0x33,
  TagVolatileType = 0x35,
  TagWithStmt = 0x22,
}

pub const TagAccessDeclaration: Tag = 0x23

pub const TagArrayType: Tag = 0x01

pub const TagAtomicType: Tag = 0x47

pub const TagBaseType: Tag = 0x24

pub const TagCallSite: Tag = 0x48

pub const TagCallSiteParameter: Tag = 0x49

pub const TagCatchDwarfBlock: Tag = 0x25

pub const TagClassType: Tag = 0x02

pub const TagCoarrayType: Tag = 0x44

pub const TagCommonDwarfBlock: Tag = 0x1A

pub const TagCommonInclusion: Tag = 0x1B

pub const TagCompileUnit: Tag = 0x11

pub const TagCondition: Tag = 0x3F

pub const TagConstType: Tag = 0x26

pub const TagConstant: Tag = 0x27

pub const TagDwarfProcedure: Tag = 0x36

pub const TagDynamicType: Tag = 0x46

pub const TagEntryPoint: Tag = 0x03

pub const TagEnumerationType: Tag = 0x04

pub const TagEnumerator: Tag = 0x28

pub const TagFileType: Tag = 0x29

pub const TagFormalParameter: Tag = 0x05

pub const TagFriend: Tag = 0x2A

pub const TagGenericSubrange: Tag = 0x45

pub const TagImmutableType: Tag = 0x4B

pub const TagImportedDeclaration: Tag = 0x08

pub const TagImportedModule: Tag = 0x3A

pub const TagImportedUnit: Tag = 0x3D

pub const TagInheritance: Tag = 0x1C

pub const TagInlinedSubroutine: Tag = 0x1D

pub const TagInterfaceType: Tag = 0x38

pub const TagLabel: Tag = 0x0A

pub const TagLexDwarfBlock: Tag = 0x0B

pub const TagMember: Tag = 0x0D

pub const TagModule: Tag = 0x1E

pub const TagMutableType: Tag = 0x3E

pub const TagNamelist: Tag = 0x2B

pub const TagNamelistItem: Tag = 0x2C

pub const TagNamespace: Tag = 0x39

pub const TagPackedType: Tag = 0x2D

pub const TagPartialUnit: Tag = 0x3C

pub const TagPointerType: Tag = 0x0F

pub const TagPtrToMemberType: Tag = 0x1F

pub const TagReferenceType: Tag = 0x10

pub const TagRestrictType: Tag = 0x37

pub const TagRvalueReferenceType: Tag = 0x42

pub const TagSetType: Tag = 0x20

pub const TagSharedType: Tag = 0x40

pub const TagSkeletonUnit: Tag = 0x4A

pub const TagStringType: Tag = 0x12

pub const TagStructType: Tag = 0x13

pub const TagSubprogram: Tag = 0x2E

pub const TagSubrangeType: Tag = 0x21

pub const TagSubroutineType: Tag = 0x15

pub const TagTemplateAlias: Tag = 0x43

pub const TagTemplateTypeParameter: Tag = 0x2F

pub const TagTemplateValueParameter: Tag = 0x30

pub const TagThrownType: Tag = 0x31

pub const TagTryDwarfBlock: Tag = 0x32

pub const TagTypeUnit: Tag = 0x41

pub const TagTypedef: Tag = 0x16

pub const TagUnionType: Tag = 0x17

pub const TagUnspecifiedParameters: Tag = 0x18

pub const TagUnspecifiedType: Tag = 0x3B

pub const TagVariable: Tag = 0x34

pub const TagVariant: Tag = 0x19

pub const TagVariantPart: Tag = 0x33

pub const TagVolatileType: Tag = 0x35

pub const TagWithStmt: Tag = 0x22

pub fn New(
  abbrev: Slice<uint8>,
  aranges: Slice<uint8>,
  frame: Slice<uint8>,
  info: Slice<uint8>,
  line: Slice<uint8>,
  pubnames: Slice<uint8>,
  ranges: Slice<uint8>,
  str: Slice<uint8>,
) -> Result<Ref<Data>, error>

/// An AddrType represents a machine address type.
pub struct AddrType {
  pub BasicType: BasicType,
}

/// An ArrayType represents a fixed size array type.
pub struct ArrayType {
  pub CommonType: CommonType,
  pub Type: Option<Type>,
  pub StrideBitSize: int64,
  pub Count: int64,
}

/// A BasicType holds fields common to all basic types.
/// 
/// See the documentation for [StructField] for more info on the interpretation of
/// the BitSize/BitOffset/DataBitOffset fields.
pub struct BasicType {
  pub CommonType: CommonType,
  pub BitSize: int64,
  pub BitOffset: int64,
  pub DataBitOffset: int64,
}

/// A BoolType represents a boolean type.
pub struct BoolType {
  pub BasicType: BasicType,
}

/// A CharType represents a signed character type.
pub struct CharType {
  pub BasicType: BasicType,
}

/// A CommonType holds fields common to multiple types.
/// If a field is not known or not applicable for a given type,
/// the zero value is used.
pub struct CommonType {
  pub ByteSize: int64,
  pub Name: string,
}

/// A ComplexType represents a complex floating point type.
pub struct ComplexType {
  pub BasicType: BasicType,
}

/// Data represents the DWARF debugging information
/// loaded from an executable file (for example, an ELF or Mach-O executable).
pub type Data

pub struct DecodeError {
  pub Name: string,
  pub Offset: Offset,
  pub Err: string,
}

/// A DotDotDotType represents the variadic ... function parameter.
pub struct DotDotDotType {
  pub CommonType: CommonType,
}

/// An entry is a sequence of attribute/value pairs.
pub struct Entry {
  pub Offset: Offset,
  pub Tag: Tag,
  pub Children: bool,
  pub Field: Slice<Field>,
}

/// An EnumType represents an enumerated type.
/// The only indication of its native integer type is its ByteSize
/// (inside [CommonType]).
pub struct EnumType {
  pub CommonType: CommonType,
  pub EnumName: string,
  pub Val: Slice<Option<Ref<EnumValue>>>,
}

/// An EnumValue represents a single enumeration value.
pub struct EnumValue {
  pub Name: string,
  pub Val: int64,
}

/// A Field is a single attribute/value pair in an [Entry].
/// 
/// A value can be one of several "attribute classes" defined by DWARF.
/// The Go types corresponding to each class are:
/// 
/// 	DWARF class       Go type        Class
/// 	-----------       -------        -----
/// 	address           uint64         ClassAddress
/// 	block             []byte         ClassBlock
/// 	constant          int64          ClassConstant
/// 	flag              bool           ClassFlag
/// 	reference
/// 	  to info         dwarf.Offset   ClassReference
/// 	  to type unit    uint64         ClassReferenceSig
/// 	string            string         ClassString
/// 	exprloc           []byte         ClassExprLoc
/// 	lineptr           int64          ClassLinePtr
/// 	loclistptr        int64          ClassLocListPtr
/// 	macptr            int64          ClassMacPtr
/// 	rangelistptr      int64          ClassRangeListPtr
/// 
/// For unrecognized or vendor-defined attributes, [Class] may be
/// [ClassUnknown].
pub struct Field {
  pub Attr: Attr,
  pub Val: Unknown,
  pub Class: Class,
}

/// A FloatType represents a floating point type.
pub struct FloatType {
  pub BasicType: BasicType,
}

/// A FuncType represents a function type.
pub struct FuncType {
  pub CommonType: CommonType,
  pub ReturnType: Option<Type>,
  pub ParamType: Slice<Option<Type>>,
}

/// An IntType represents a signed integer type.
pub struct IntType {
  pub BasicType: BasicType,
}

/// A LineEntry is a row in a DWARF line table.
pub struct LineEntry {
  pub Address: uint64,
  pub OpIndex: int,
  pub File: Option<Ref<LineFile>>,
  pub Line: int,
  pub Column: int,
  pub IsStmt: bool,
  pub BasicBlock: bool,
  pub PrologueEnd: bool,
  pub EpilogueBegin: bool,
  pub ISA: int,
  pub Discriminator: int,
  pub EndSequence: bool,
}

/// A LineFile is a source file referenced by a DWARF line table entry.
pub struct LineFile {
  pub Name: string,
  pub Mtime: uint64,
  pub Length: int,
}

/// A LineReader reads a sequence of [LineEntry] structures from a DWARF
/// "line" section for a single compilation unit. LineEntries occur in
/// order of increasing PC and each [LineEntry] gives metadata for the
/// instructions from that [LineEntry]'s PC to just before the next
/// [LineEntry]'s PC. The last entry will have the [LineEntry.EndSequence] field set.
pub type LineReader

/// A LineReaderPos represents a position in a line table.
pub type LineReaderPos

/// An Offset represents the location of an [Entry] within the DWARF info.
/// (See [Reader.Seek].)
pub struct Offset(uint32)

/// A PtrType represents a pointer type.
pub struct PtrType {
  pub CommonType: CommonType,
  pub Type: Option<Type>,
}

/// A QualType represents a type that has the C/C++ "const", "restrict", or "volatile" qualifier.
pub struct QualType {
  pub CommonType: CommonType,
  pub Qual: string,
  pub Type: Option<Type>,
}

/// A Reader allows reading [Entry] structures from a DWARF “info” section.
/// The [Entry] structures are arranged in a tree. The [Reader.Next] function
/// return successive entries from a pre-order traversal of the tree.
/// If an entry has children, its Children field will be true, and the children
/// follow, terminated by an [Entry] with [Tag] 0.
pub type Reader

/// A StructField represents a field in a struct, union, or C++ class type.
/// 
/// # Bit Fields
/// 
/// The BitSize, BitOffset, and DataBitOffset fields describe the bit
/// size and offset of data members declared as bit fields in C/C++
/// struct/union/class types.
/// 
/// BitSize is the number of bits in the bit field.
/// 
/// DataBitOffset, if non-zero, is the number of bits from the start of
/// the enclosing entity (e.g. containing struct/class/union) to the
/// start of the bit field. This corresponds to the DW_AT_data_bit_offset
/// DWARF attribute that was introduced in DWARF 4.
/// 
/// BitOffset, if non-zero, is the number of bits between the most
/// significant bit of the storage unit holding the bit field to the
/// most significant bit of the bit field. Here "storage unit" is the
/// type name before the bit field (for a field "unsigned x:17", the
/// storage unit is "unsigned"). BitOffset values can vary depending on
/// the endianness of the system. BitOffset corresponds to the
/// DW_AT_bit_offset DWARF attribute that was deprecated in DWARF 4 and
/// removed in DWARF 5.
/// 
/// At most one of DataBitOffset and BitOffset will be non-zero;
/// DataBitOffset/BitOffset will only be non-zero if BitSize is
/// non-zero. Whether a C compiler uses one or the other
/// will depend on compiler vintage and command line options.
/// 
/// Here is an example of C/C++ bit field use, along with what to
/// expect in terms of DWARF bit offset info. Consider this code:
/// 
/// 	struct S {
/// 		int q;
/// 		int j:5;
/// 		int k:6;
/// 		int m:5;
/// 		int n:8;
/// 	} s;
/// 
/// For the code above, one would expect to see the following for
/// DW_AT_bit_offset values (using GCC 8):
/// 
/// 	       Little   |     Big
/// 	       Endian   |    Endian
/// 	                |
/// 	"j":     27     |     0
/// 	"k":     21     |     5
/// 	"m":     16     |     11
/// 	"n":     8      |     16
/// 
/// Note that in the above the offsets are purely with respect to the
/// containing storage unit for j/k/m/n -- these values won't vary based
/// on the size of prior data members in the containing struct.
/// 
/// If the compiler emits DW_AT_data_bit_offset, the expected values
/// would be:
/// 
/// 	"j":     32
/// 	"k":     37
/// 	"m":     43
/// 	"n":     48
/// 
/// Here the value 32 for "j" reflects the fact that the bit field is
/// preceded by other data members (recall that DW_AT_data_bit_offset
/// values are relative to the start of the containing struct). Hence
/// DW_AT_data_bit_offset values can be quite large for structs with
/// many fields.
/// 
/// DWARF also allow for the possibility of base types that have
/// non-zero bit size and bit offset, so this information is also
/// captured for base types, but it is worth noting that it is not
/// possible to trigger this behavior using mainstream languages.
pub struct StructField {
  pub Name: string,
  pub Type: Option<Type>,
  pub ByteOffset: int64,
  pub ByteSize: int64,
  pub BitOffset: int64,
  pub DataBitOffset: int64,
  pub BitSize: int64,
}

/// A StructType represents a struct, union, or C++ class type.
pub struct StructType {
  pub CommonType: CommonType,
  pub StructName: string,
  pub Kind: string,
  pub Field: Slice<Option<Ref<StructField>>>,
  pub Incomplete: bool,
}

/// A Type conventionally represents a pointer to any of the
/// specific Type structures ([CharType], [StructType], etc.).
pub interface Type {
  fn Common() -> Ref<CommonType>
  fn Size() -> int64
  fn String() -> string
}

/// A TypedefType represents a named type.
pub struct TypedefType {
  pub CommonType: CommonType,
  pub Type: Option<Type>,
}

/// A UcharType represents an unsigned character type.
pub struct UcharType {
  pub BasicType: BasicType,
}

/// A UintType represents an unsigned integer type.
pub struct UintType {
  pub BasicType: BasicType,
}

/// An UnspecifiedType represents an implicit, unknown, ambiguous or nonexistent type.
pub struct UnspecifiedType {
  pub BasicType: BasicType,
}

/// An UnsupportedType is a placeholder returned in situations where we
/// encounter a type that isn't supported.
pub struct UnsupportedType {
  pub CommonType: CommonType,
  pub Tag: Tag,
}

/// A VoidType represents the C void type.
pub struct VoidType {
  pub CommonType: CommonType,
}

/// ErrUnknownPC is the error returned by LineReader.ScanPC when the
/// seek PC is not covered by any entry in the line table.
pub var ErrUnknownPC: error

impl AddrType {
  fn Basic(self: Ref<AddrType>) -> Ref<BasicType>

  fn Common(self: Ref<AddrType>) -> Ref<CommonType>

  fn Size(self: Ref<AddrType>) -> int64

  fn String(self: Ref<AddrType>) -> string
}

impl ArrayType {
  fn Common(self: Ref<ArrayType>) -> Ref<CommonType>

  fn Size(self: Ref<ArrayType>) -> int64

  fn String(self: Ref<ArrayType>) -> string
}

impl Attr {
  fn GoString(self) -> string

  fn String(self) -> string
}

impl BasicType {
  fn Basic(self: Ref<BasicType>) -> Ref<BasicType>

  fn Common(self: Ref<BasicType>) -> Ref<CommonType>

  fn Size(self: Ref<BasicType>) -> int64

  fn String(self: Ref<BasicType>) -> string
}

impl BoolType {
  fn Basic(self: Ref<BoolType>) -> Ref<BasicType>

  fn Common(self: Ref<BoolType>) -> Ref<CommonType>

  fn Size(self: Ref<BoolType>) -> int64

  fn String(self: Ref<BoolType>) -> string
}

impl CharType {
  fn Basic(self: Ref<CharType>) -> Ref<BasicType>

  fn Common(self: Ref<CharType>) -> Ref<CommonType>

  fn Size(self: Ref<CharType>) -> int64

  fn String(self: Ref<CharType>) -> string
}

impl Class {
  fn GoString(self) -> string

  fn String(self) -> string
}

impl CommonType {
  fn Common(self: Ref<CommonType>) -> Ref<CommonType>

  fn Size(self: Ref<CommonType>) -> int64
}

impl ComplexType {
  fn Basic(self: Ref<ComplexType>) -> Ref<BasicType>

  fn Common(self: Ref<ComplexType>) -> Ref<CommonType>

  fn Size(self: Ref<ComplexType>) -> int64

  fn String(self: Ref<ComplexType>) -> string
}

impl Data {
  /// AddSection adds another DWARF section by name. The name should be a
  /// DWARF section name such as ".debug_addr", ".debug_str_offsets", and
  /// so forth. This approach is used for new DWARF sections added in
  /// DWARF 5 and later.
  fn AddSection(self: Ref<Data>, name: string, contents: Slice<uint8>) -> Result<(), error>

  /// AddTypes will add one .debug_types section to the DWARF data. A
  /// typical object with DWARF version 4 debug info will have multiple
  /// .debug_types sections. The name is used for error reporting only,
  /// and serves to distinguish one .debug_types section from another.
  fn AddTypes(self: Ref<Data>, name: string, types: Slice<uint8>) -> Result<(), error>

  /// LineReader returns a new reader for the line table of compilation
  /// unit cu, which must be an [Entry] with tag [TagCompileUnit].
  /// 
  /// If this compilation unit has no line table, it returns nil, nil.
  fn LineReader(self: Ref<Data>, cu: Ref<Entry>) -> Result<Ref<LineReader>, error>

  /// Ranges returns the PC ranges covered by e, a slice of [low,high) pairs.
  /// Only some entry types, such as [TagCompileUnit] or [TagSubprogram], have PC
  /// ranges; for others, this will return nil with no error.
  fn Ranges(self: Ref<Data>, e: Ref<Entry>) -> Result<Slice<Slice<uint64>>, error>

  /// Reader returns a new Reader for [Data].
  /// The reader is positioned at byte offset 0 in the DWARF “info” section.
  fn Reader(self: Ref<Data>) -> Ref<Reader>

  /// Type reads the type at off in the DWARF “info” section.
  fn Type(self: Ref<Data>, off: Offset) -> Result<Type, error>
}

impl DecodeError {
  fn Error(self) -> string
}

impl DotDotDotType {
  fn Common(self: Ref<DotDotDotType>) -> Ref<CommonType>

  fn Size(self: Ref<DotDotDotType>) -> int64

  fn String(self: Ref<DotDotDotType>) -> string
}

impl Entry {
  /// AttrField returns the [Field] associated with attribute [Attr] in
  /// [Entry], or nil if there is no such attribute.
  fn AttrField(self: Ref<Entry>, a: Attr) -> Option<Ref<Field>>

  /// Val returns the value associated with attribute [Attr] in [Entry],
  /// or nil if there is no such attribute.
  /// 
  /// A common idiom is to merge the check for nil return with
  /// the check that the value has the expected dynamic type, as in:
  /// 
  /// 	v, ok := e.Val(AttrSibling).(int64)
  fn Val(self: Ref<Entry>, a: Attr) -> Unknown
}

impl EnumType {
  fn Common(self: Ref<EnumType>) -> Ref<CommonType>

  fn Size(self: Ref<EnumType>) -> int64

  fn String(self: Ref<EnumType>) -> string
}

impl FloatType {
  fn Basic(self: Ref<FloatType>) -> Ref<BasicType>

  fn Common(self: Ref<FloatType>) -> Ref<CommonType>

  fn Size(self: Ref<FloatType>) -> int64

  fn String(self: Ref<FloatType>) -> string
}

impl FuncType {
  fn Common(self: Ref<FuncType>) -> Ref<CommonType>

  fn Size(self: Ref<FuncType>) -> int64

  fn String(self: Ref<FuncType>) -> string
}

impl IntType {
  fn Basic(self: Ref<IntType>) -> Ref<BasicType>

  fn Common(self: Ref<IntType>) -> Ref<CommonType>

  fn Size(self: Ref<IntType>) -> int64

  fn String(self: Ref<IntType>) -> string
}

impl LineReader {
  /// Files returns the file name table of this compilation unit as of
  /// the current position in the line table. The file name table may be
  /// referenced from attributes in this compilation unit such as
  /// [AttrDeclFile].
  /// 
  /// Entry 0 is always nil, since file index 0 represents "no file".
  /// 
  /// The file name table of a compilation unit is not fixed. Files
  /// returns the file table as of the current position in the line
  /// table. This may contain more entries than the file table at an
  /// earlier position in the line table, though existing entries never
  /// change.
  fn Files(self: Ref<LineReader>) -> Slice<Ref<LineFile>>

  /// Next sets *entry to the next row in this line table and moves to
  /// the next row. If there are no more entries and the line table is
  /// properly terminated, it returns [io.EOF].
  /// 
  /// Rows are always in order of increasing entry.Address, but
  /// entry.Line may go forward or backward.
  fn Next(self: Ref<LineReader>, entry: Ref<LineEntry>) -> Result<(), error>

  /// Reset repositions the line table reader at the beginning of the
  /// line table.
  fn Reset(self: Ref<LineReader>)

  /// Seek restores the line table reader to a position returned by [LineReader.Tell].
  /// 
  /// The argument pos must have been returned by a call to [LineReader.Tell] on this
  /// line table.
  fn Seek(self: Ref<LineReader>, pos: LineReaderPos)

  /// SeekPC sets *entry to the [LineEntry] that includes pc and positions
  /// the reader on the next entry in the line table. If necessary, this
  /// will seek backwards to find pc.
  /// 
  /// If pc is not covered by any entry in this line table, SeekPC
  /// returns [ErrUnknownPC]. In this case, *entry and the final seek
  /// position are unspecified.
  /// 
  /// Note that DWARF line tables only permit sequential, forward scans.
  /// Hence, in the worst case, this takes time linear in the size of the
  /// line table. If the caller wishes to do repeated fast PC lookups, it
  /// should build an appropriate index of the line table.
  fn SeekPC(self: Ref<LineReader>, pc: uint64, entry: Ref<LineEntry>) -> Result<(), error>

  /// Tell returns the current position in the line table.
  fn Tell(self: Ref<LineReader>) -> LineReaderPos
}

impl PtrType {
  fn Common(self: Ref<PtrType>) -> Ref<CommonType>

  fn Size(self: Ref<PtrType>) -> int64

  fn String(self: Ref<PtrType>) -> string
}

impl QualType {
  fn Common(self: Ref<QualType>) -> Ref<CommonType>

  fn Size(self: Ref<QualType>) -> int64

  fn String(self: Ref<QualType>) -> string
}

impl Reader {
  /// AddressSize returns the size in bytes of addresses in the current compilation
  /// unit.
  fn AddressSize(self: Ref<Reader>) -> int

  /// ByteOrder returns the byte order in the current compilation unit.
  fn ByteOrder(self: Ref<Reader>) -> binary.ByteOrder

  /// Next reads the next entry from the encoded entry stream.
  /// It returns nil, nil when it reaches the end of the section.
  /// It returns an error if the current offset is invalid or the data at the
  /// offset cannot be decoded as a valid [Entry].
  fn Next(self: Ref<Reader>) -> Result<Ref<Entry>, error>

  /// Seek positions the [Reader] at offset off in the encoded entry stream.
  /// Offset 0 can be used to denote the first entry.
  fn Seek(self: Ref<Reader>, off: Offset)

  /// SeekPC returns the [Entry] for the compilation unit that includes pc,
  /// and positions the reader to read the children of that unit.  If pc
  /// is not covered by any unit, SeekPC returns [ErrUnknownPC] and the
  /// position of the reader is undefined.
  /// 
  /// Because compilation units can describe multiple regions of the
  /// executable, in the worst case SeekPC must search through all the
  /// ranges in all the compilation units. Each call to SeekPC starts the
  /// search at the compilation unit of the last call, so in general
  /// looking up a series of PCs will be faster if they are sorted. If
  /// the caller wishes to do repeated fast PC lookups, it should build
  /// an appropriate index using the Ranges method.
  fn SeekPC(self: Ref<Reader>, pc: uint64) -> Result<Ref<Entry>, error>

  /// SkipChildren skips over the child entries associated with
  /// the last [Entry] returned by [Reader.Next]. If that [Entry] did not have
  /// children or [Reader.Next] has not been called, SkipChildren is a no-op.
  fn SkipChildren(self: Ref<Reader>)
}

impl StructType {
  fn Common(self: Ref<StructType>) -> Ref<CommonType>

  fn Defn(self: Ref<StructType>) -> string

  fn Size(self: Ref<StructType>) -> int64

  fn String(self: Ref<StructType>) -> string
}

impl Tag {
  fn GoString(self) -> string

  fn String(self) -> string
}

impl TypedefType {
  fn Common(self: Ref<TypedefType>) -> Ref<CommonType>

  fn Size(self: Ref<TypedefType>) -> int64

  fn String(self: Ref<TypedefType>) -> string
}

impl UcharType {
  fn Basic(self: Ref<UcharType>) -> Ref<BasicType>

  fn Common(self: Ref<UcharType>) -> Ref<CommonType>

  fn Size(self: Ref<UcharType>) -> int64

  fn String(self: Ref<UcharType>) -> string
}

impl UintType {
  fn Basic(self: Ref<UintType>) -> Ref<BasicType>

  fn Common(self: Ref<UintType>) -> Ref<CommonType>

  fn Size(self: Ref<UintType>) -> int64

  fn String(self: Ref<UintType>) -> string
}

impl UnspecifiedType {
  fn Basic(self: Ref<UnspecifiedType>) -> Ref<BasicType>

  fn Common(self: Ref<UnspecifiedType>) -> Ref<CommonType>

  fn Size(self: Ref<UnspecifiedType>) -> int64

  fn String(self: Ref<UnspecifiedType>) -> string
}

impl UnsupportedType {
  fn Common(self: Ref<UnsupportedType>) -> Ref<CommonType>

  fn Size(self: Ref<UnsupportedType>) -> int64

  fn String(self: Ref<UnsupportedType>) -> string
}

impl VoidType {
  fn Common(self: Ref<VoidType>) -> Ref<CommonType>

  fn Size(self: Ref<VoidType>) -> int64

  fn String(self: Ref<VoidType>) -> string
}