summaryrefslogtreecommitdiff
path: root/libdwarf/libdwarf.h
blob: 128bd1ed170b652f1e0d778693de5d4031af53a4 (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
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
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
/*

  Copyright (C) 2000-2010 Silicon Graphics, Inc.  All Rights Reserved.
  Portions Copyright 2007-2010 Sun Microsystems, Inc. All rights reserved.
  Portions Copyright 2008-2011 David Anderson. All rights reserved.
  Portions Copyright 2008-2010 Arxan Technologies, Inc. All rights reserved.
  Portions Copyright 2010 SN Systems Ltd. All rights reserved.

  This program is free software; you can redistribute it and/or modify it
  under the terms of version 2.1 of the GNU Lesser General Public License
  as published by the Free Software Foundation.

  This program is distributed in the hope that it would be useful, but
  WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  Further, this software is distributed without any warranty that it is
  free of the rightful claim of any third person regarding infringement
  or the like.  Any license provided herein, whether implied or
  otherwise, applies only to this software file.  Patent licenses, if
  any, provided herein do not apply to combinations of this program with
  other software, or any other product whatsoever.

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

  Contact information:  Silicon Graphics, Inc., 1500 Crittenden Lane,
  Mountain View, CA 94043, or:

  http://www.sgi.com

  For further information regarding this notice, see:

  http://oss.sgi.com/projects/GenInfo/NoticeExplan

*/


#ifndef _LIBDWARF_H
#define _LIBDWARF_H
#ifdef __cplusplus
extern "C" {
#endif
/*
    libdwarf.h  
    $Revision: #9 $ $Date: 2008/01/17 $

    For libdwarf producers and consumers

    The interface is defined as having 8-byte signed and unsigned
    values so it can handle 64-or-32bit target on 64-or-32bit host.
    Addr is the native size: it represents pointers on
    the host machine (not the target!).

    This contains declarations for types and all producer
    and consumer functions.

    Function declarations are written on a single line each here
    so one can use grep  to each declaration in its entirety.
    The declarations are a little harder to read this way, but...

*/

struct Elf;
typedef struct Elf* dwarf_elf_handle;

/* To enable printing with printf regardless of the
   actual underlying data type, we define the DW_PR_xxx macros. 
   To ensure uses of DW_PR_DUx or DW_PR_DSx look the way you want
   ensure the right DW_PR_XZEROS define is uncommented.
*/
/*#define DW_PR_XZEROS "" */
#define DW_PR_XZEROS "08" 
#if (_MIPS_SZLONG == 64)
/* Special case for MIPS, so -64 (LP64) build gets simple -long-.
   Non-MIPS LP64 or ILP64 environments should probably ensure
   _MIPS_SZLONG set to 64 everywhere this header is #included.
*/
typedef int             Dwarf_Bool;         /* boolean type */
typedef unsigned long   Dwarf_Off;          /* 4 or 8 byte file offset */
typedef unsigned long   Dwarf_Unsigned;     /* 4 or 8 byte unsigned value */
typedef unsigned short  Dwarf_Half;         /* 2 byte unsigned value */
typedef unsigned char   Dwarf_Small;        /* 1 byte unsigned value */
typedef signed   long   Dwarf_Signed;       /* 4 or 8 byte signed value */
typedef unsigned long   Dwarf_Addr;         /* target memory address */
#define  DW_PR_DUx  "lx"
#define  DW_PR_DSx  "lx"
#define  DW_PR_DUu  "lu"
#define  DW_PR_DSd  "ld"

#else /* 32-bit */
/* This is for ILP32, allowing i/o of 64bit dwarf info.
   Also should be fine for LP64 and ILP64 cases.
*/
typedef int                 Dwarf_Bool;     /* boolean type */
typedef unsigned long long  Dwarf_Off;      /* 8 byte file offset */
typedef unsigned long long  Dwarf_Unsigned; /* 8 byte unsigned value*/
typedef unsigned short      Dwarf_Half;     /* 2 byte unsigned value */
typedef unsigned char       Dwarf_Small;    /* 1 byte unsigned value */
typedef signed   long long  Dwarf_Signed;   /* 8 byte signed value */
typedef unsigned long long  Dwarf_Addr;     /* target memory address */
#define  DW_PR_DUx  "llx"
#define  DW_PR_DSx  "llx"
#define  DW_PR_DUu  "llu"
#define  DW_PR_DSd  "lld"
#endif
#ifdef HAVE_NONSTANDARD_PRINTF_64_FORMAT
/* Windows does not use std C formatting, so allow it. */
#undef DW_PR_DUx
#undef DW_PR_DSx
#undef DW_PR_DUu
#undef DW_PR_DSd
#define  DW_PR_DUx  "I64x"
#define  DW_PR_DSx  "I64x"
#define  DW_PR_DUu  "I64u"
#define  DW_PR_DSd  "I64d"
#endif /* HAVE_NONSTANDARD_FORMAT */

typedef void*        Dwarf_Ptr;          /* host machine pointer */

/* Used for DW_FORM_ref_sig8. It is not a string, it
   is 8 bytes of a signature one would use to find
   a type unit. See dwarf_formsig8()
*/
typedef struct  {
    char signature[8];
} Dwarf_Sig8;

/* Contains info on an uninterpreted block of data
*/
typedef struct {
    Dwarf_Unsigned  bl_len;         /* length of block */
    Dwarf_Ptr       bl_data;        /* uninterpreted data */
    Dwarf_Small     bl_from_loclist; /*non-0 if loclist, else debug_info*/
    Dwarf_Unsigned  bl_section_offset; /* Section (not CU) offset
        which 'data' comes from. */
} Dwarf_Block;


/* location record
*/
typedef struct {
    Dwarf_Small     lr_atom;        /* location operation */
    Dwarf_Unsigned  lr_number;      /* operand */
    Dwarf_Unsigned  lr_number2;     /* for OP_BREGx */
    Dwarf_Unsigned  lr_offset;      /* offset in locexpr for OP_BRA etc */
} Dwarf_Loc;


/* location description
*/
typedef struct {
    Dwarf_Addr      ld_lopc;        /* beginning of active range */ 
    Dwarf_Addr      ld_hipc;        /* end of active range */
    Dwarf_Half      ld_cents;       /* count of location records */
    Dwarf_Loc*      ld_s;           /* pointer to list of same */
    Dwarf_Small     ld_from_loclist; 
        /* non-0 if loclist, else debug_info*/

    Dwarf_Unsigned  ld_section_offset; /* Section (not CU) offset
        where loc-expr begins*/
} Dwarf_Locdesc;

/*  First appears in DWARF3.
    The dwr_addr1/addr2 data is either an offset (DW_RANGES_ENTRY)
    or an address (dwr_addr2 in DW_RANGES_ADDRESS_SELECTION) or
    both are zero (DW_RANGES_END).
*/
enum Dwarf_Ranges_Entry_Type { DW_RANGES_ENTRY, 
    DW_RANGES_ADDRESS_SELECTION,
    DW_RANGES_END 
};
typedef struct {
    Dwarf_Addr dwr_addr1;
    Dwarf_Addr dwr_addr2; 
    enum Dwarf_Ranges_Entry_Type  dwr_type;
} Dwarf_Ranges;

/* Frame description instructions expanded.
*/
typedef struct {
    Dwarf_Small     fp_base_op;
    Dwarf_Small     fp_extended_op;
    Dwarf_Half      fp_register;

    /*  Value may be signed, depends on op. 
        Any applicable data_alignment_factor has
        not been applied, this is the  raw offset. */
    Dwarf_Unsigned  fp_offset;
    Dwarf_Off       fp_instr_offset;
} Dwarf_Frame_Op; /* DWARF2 */

typedef struct {
    Dwarf_Small     fp_base_op;
    Dwarf_Small     fp_extended_op;
    Dwarf_Half      fp_register;

    /*  Value may be signed, depends on op. 
        Any applicable data_alignment_factor has
        not been applied, this is the  raw offset. */
    Dwarf_Unsigned  fp_offset_or_block_len; 
    Dwarf_Small     *fp_expr_block;

    Dwarf_Off       fp_instr_offset;
} Dwarf_Frame_Op3;  /* DWARF3 and DWARF2 compatible */

/*  ***IMPORTANT NOTE, TARGET DEPENDENCY ****
    DW_REG_TABLE_SIZE must be at least as large as
    the number of registers
    (DW_FRAME_LAST_REG_NUM) as defined in dwarf.h
    Preferably identical to DW_FRAME_LAST_REG_NUM.
    Ensure [0-DW_REG_TABLE_SIZE] does not overlap 
    DW_FRAME_UNDEFINED_VAL or DW_FRAME_SAME_VAL. 
    Also ensure DW_FRAME_REG_INITIAL_VALUE is set to what
    is appropriate to your cpu.
    For various CPUs  DW_FRAME_UNDEFINED_VAL is correct
    as the value for DW_FRAME_REG_INITIAL_VALUE.

    For consumer apps, this can be set dynamically: see
    dwarf_set_frame_rule_table_size(); */
#ifndef DW_REG_TABLE_SIZE
#define DW_REG_TABLE_SIZE  66
#endif

/* For MIPS, DW_FRAME_SAME_VAL is the correct default value 
   for a frame register value. For other CPUS another value
   may be better, such as DW_FRAME_UNDEFINED_VAL.
   See dwarf_set_frame_rule_table_size
*/
#ifndef DW_FRAME_REG_INITIAL_VALUE
#define DW_FRAME_REG_INITIAL_VALUE DW_FRAME_SAME_VAL
#endif

/* Taken as meaning 'undefined value', this is not
   a column or register number.
   Only present at libdwarf runtime in the consumer
   interfaces. Never on disk.
   DW_FRAME_* Values present on disk are in dwarf.h
   Ensure this is > DW_REG_TABLE_SIZE (the reg table
   size is changeable at runtime with the *reg3() interfaces,
   and this value must be greater than the reg table size).
*/
#define DW_FRAME_UNDEFINED_VAL          1034

/* Taken as meaning 'same value' as caller had, not a column
   or register number.
   Only present at libdwarf runtime in the consumer
   interfaces. Never on disk.
   DW_FRAME_* Values present on disk are in dwarf.h
   Ensure this is > DW_REG_TABLE_SIZE (the reg table
   size is changeable at runtime with the *reg3() interfaces,
   and this value must be greater than the reg table size).
*/
#define DW_FRAME_SAME_VAL               1035

/* For DWARF3 consumer interfaces, make the CFA a column with no
   real table number.  This is what should have been done
   for the DWARF2 interfaces.  This actually works for
   both DWARF2 and DWARF3, but see the libdwarf documentation
   on Dwarf_Regtable3 and  dwarf_get_fde_info_for_reg3()
   and  dwarf_get_fde_info_for_all_regs3()  
   Do NOT use this with the older dwarf_get_fde_info_for_reg()
   or dwarf_get_fde_info_for_all_regs() consumer interfaces.
   Must be higher than any register count for *any* ABI
   (ensures maximum applicability with minimum effort).
   Ensure this is > DW_REG_TABLE_SIZE (the reg table
   size is changeable at runtime with the *reg3() interfaces,
   and this value must be greater than the reg table size).
   Only present at libdwarf runtime in the consumer
   interfaces. Never on disk.
*/
#define DW_FRAME_CFA_COL3               1436

/* The following are all needed to evaluate DWARF3 register rules.
*/
#define DW_EXPR_OFFSET 0  /* DWARF2 only sees this. */
#define DW_EXPR_VAL_OFFSET 1
#define DW_EXPR_EXPRESSION 2
#define DW_EXPR_VAL_EXPRESSION 3

typedef struct Dwarf_Regtable_Entry_s {
    /*  For each index i (naming a hardware register with dwarf number
        i) the following is true and defines the value of that register:

        If dw_regnum is Register DW_FRAME_UNDEFINED_VAL  
            it is not DWARF register number but
            a place holder indicating the register has no defined value.
        If dw_regnum is Register DW_FRAME_SAME_VAL 
            it  is not DWARF register number but
            a place holder indicating the register has the same
            value in the previous frame.

            DW_FRAME_UNDEFINED_VAL, DW_FRAME_SAME_VAL are
            only present at libdwarf runtime. Never on disk.
            DW_FRAME_* Values present on disk are in dwarf.h

        Otherwise: the register number is a DWARF register number
            (see ABI documents for how this translates to hardware/
            software register numbers in the machine hardware)
            and the following applies:

            if dw_value_type == DW_EXPR_OFFSET (the only case for dwarf2):
                If dw_offset_relevant is non-zero, then
                    the value is stored at at the address CFA+N where 
                    N is a signed offset. 
                    Rule: Offset(N)
                If dw_offset_relevant is zero, then the value of the register
                    is the value of (DWARF) register number dw_regnum.
                    Rule: register(F)
            Other values of dw_value_type are an error.
    */
    Dwarf_Small         dw_offset_relevant;

    /* For DWARF2, always 0 */
    Dwarf_Small         dw_value_type; 

    Dwarf_Half          dw_regnum;

    /*  The data type here should  the larger of Dwarf_Addr
        and Dwarf_Unsigned and Dwarf_Signed. */
    Dwarf_Addr          dw_offset;
} Dwarf_Regtable_Entry;

typedef struct Dwarf_Regtable_s {
    struct Dwarf_Regtable_Entry_s rules[DW_REG_TABLE_SIZE];
} Dwarf_Regtable;

/* opaque type. Functional interface shown later. */
struct Dwarf_Reg_value3_s;
typedef struct Dwarf_Reg_value3_s Dwarf_Reg_Value3; 

typedef struct Dwarf_Regtable_Entry3_s {
/*  For each index i (naming a hardware register with dwarf number
    i) the following is true and defines the value of that register:

        If dw_regnum is Register DW_FRAME_UNDEFINED_VAL  
            it is not DWARF register number but
            a place holder indicating the register has no defined value.
        If dw_regnum is Register DW_FRAME_SAME_VAL 
            it  is not DWARF register number but
            a place holder indicating the register has the same
            value in the previous frame.

            DW_FRAME_UNDEFINED_VAL, DW_FRAME_SAME_VAL and
            DW_FRAME_CFA_COL3 are only present at libdwarf runtime. 
            Never on disk.
            DW_FRAME_* Values present on disk are in dwarf.h
            Because DW_FRAME_SAME_VAL and DW_FRAME_UNDEFINED_VAL 
            and DW_FRAME_CFA_COL3 are definable at runtime 
            consider the names symbolic in this comment, not absolute.

        Otherwise: the register number is a DWARF register number
            (see ABI documents for how this translates to hardware/
            software register numbers in the machine hardware)
            and the following applies:

        In a cfa-defining entry (rt3_cfa_rule) the regnum is the
        CFA 'register number'. Which is some 'normal' register,
        not DW_FRAME_CFA_COL3, nor DW_FRAME_SAME_VAL, nor 
        DW_FRAME_UNDEFINED_VAL.

        If dw_value_type == DW_EXPR_OFFSET (the only  possible case for 
        dwarf2):
            If dw_offset_relevant is non-zero, then
                the value is stored at at the address 
                CFA+N where N is a signed offset. 
                dw_regnum is the cfa register rule which means
                one ignores dw_regnum and uses the CFA appropriately.
                So dw_offset_or_block_len is a signed value, really,
                and must be printed/evaluated as such.
                Rule: Offset(N)
            If dw_offset_relevant is zero, then the value of the register
                is the value of (DWARF) register number dw_regnum.
                Rule: register(R)
        If dw_value_type  == DW_EXPR_VAL_OFFSET
            the  value of this register is CFA +N where N is a signed offset.
            dw_regnum is the cfa register rule which means
            one ignores dw_regnum and uses the CFA appropriately.
            Rule: val_offset(N)
        If dw_value_type  == DW_EXPR_EXPRESSION
            The value of the register is the value at the address
            computed by evaluating the DWARF expression E.
            Rule: expression(E)
            The expression E byte stream is pointed to by dw_block_ptr.
            The expression length in bytes is given by
            dw_offset_or_block_len.
        If dw_value_type  == DW_EXPR_VAL_EXPRESSION
            The value of the register is the value
            computed by evaluating the DWARF expression E.
            Rule: val_expression(E)
            The expression E byte stream is pointed to by dw_block_ptr.
            The expression length in bytes is given by
            dw_offset_or_block_len.
        Other values of dw_value_type are an error.
*/
    Dwarf_Small         dw_offset_relevant;
    Dwarf_Small         dw_value_type; 
    Dwarf_Half          dw_regnum;
    Dwarf_Unsigned      dw_offset_or_block_len;
    Dwarf_Ptr           dw_block_ptr;

}Dwarf_Regtable_Entry3;

/*  For the DWARF3 version, moved the DW_FRAME_CFA_COL
    out of the array and into its own struct.  
    Having it part of the array is not very easy to work
    with from a portability point of view: changing
    the number for every architecture is a pain (if one fails
    to set it correctly a register rule gets clobbered when
    setting CFA).  With MIPS it just happened to be easy to use 
    DW_FRAME_CFA_COL (it was wrong conceptually but it was easy...).

    rt3_rules and rt3_reg_table_size must be filled in before 
    calling libdwarf.  Filled in with a pointer to an array 
    (pointer and array  set up by the calling application) 
    of rt3_reg_table_size Dwarf_Regtable_Entry3_s structs.   
    libdwarf does not allocate or deallocate space for the
    rules, you must do so.   libdwarf will initialize the
    contents rules array, you do not need to do so (though
    if you choose to initialize the array somehow that is ok:
    libdwarf will overwrite your initializations with its own).

*/
typedef struct Dwarf_Regtable3_s {
    struct Dwarf_Regtable_Entry3_s   rt3_cfa_rule;

    Dwarf_Half                       rt3_reg_table_size;
    struct Dwarf_Regtable_Entry3_s * rt3_rules;
} Dwarf_Regtable3;


/*  Use for DW_EPXR_STANDARD., DW_EXPR_VAL_OFFSET. 
    Returns DW_DLV_OK if the value is available.
    If DW_DLV_OK returns the regnum and offset thru the pointers
    (which the consumer must use appropriately). 
*/
int dwarf_frame_get_reg_register(struct Dwarf_Regtable_Entry3_s *reg_in,
    Dwarf_Small *offset_relevant,
    Dwarf_Half *regnum_out,
    Dwarf_Signed *offset_out);

/*  Use for DW_EXPR_EXPRESSION, DW_EXPR_VAL_EXPRESSION.
    Returns DW_DLV_OK if the value is available.
    The caller must pass in the address of a valid
    Dwarf_Block (the caller need not initialize it).
*/
int dwarf_frame_get_reg_expression(struct Dwarf_Regtable_Entry3_s *reg_in,
    Dwarf_Block *block_out);


/*  For DW_DLC_SYMBOLIC_RELOCATIONS output to caller 
    v2, adding drd_length: some relocations are 4 and
    some 8 bytes (pointers are 8, section offsets 4) in
    some dwarf environments. (MIPS relocations are all one
    size in any given ABI.) Changing drd_type to an unsigned char
    to keep struct size down.
*/
enum Dwarf_Rel_Type {
    dwarf_drt_none,        /* Should not get to caller */
    dwarf_drt_data_reloc,  /* Simple normal relocation. */
    dwarf_drt_segment_rel, /* Special reloc, exceptions. */
    /* dwarf_drt_first_of_length_pair  and drt_second 
        are for for the  .word end - begin case. */
    dwarf_drt_first_of_length_pair,
    dwarf_drt_second_of_length_pair
};

typedef struct Dwarf_P_Marker_s * Dwarf_P_Marker;
struct Dwarf_P_Marker_s {
    Dwarf_Unsigned ma_marker;
    Dwarf_Unsigned ma_offset;
};

typedef struct Dwarf_Relocation_Data_s  * Dwarf_Relocation_Data;
struct Dwarf_Relocation_Data_s {
    unsigned char drd_type;   /* Cast to/from Dwarf_Rel_Type
        to keep size small in struct. */
    unsigned char drd_length; /* Length in bytes of data being 
        relocated. 4 for 32bit data,
        8 for 64bit data. */
    Dwarf_Unsigned       drd_offset; /* Where the data to reloc is. */
    Dwarf_Unsigned       drd_symbol_index;
};

typedef struct Dwarf_P_String_Attr_s  * Dwarf_P_String_Attr;
struct Dwarf_P_String_Attr_s {
    Dwarf_Unsigned        sa_offset;  /* Offset of string attribute data */
    Dwarf_Unsigned        sa_nbytes;  
};
    

/* Opaque types for Consumer Library. */
typedef struct Dwarf_Debug_s*      Dwarf_Debug;
typedef struct Dwarf_Die_s*        Dwarf_Die;
typedef struct Dwarf_Line_s*       Dwarf_Line;
typedef struct Dwarf_Global_s*     Dwarf_Global;
typedef struct Dwarf_Func_s*       Dwarf_Func;
typedef struct Dwarf_Type_s*       Dwarf_Type;
typedef struct Dwarf_Var_s*        Dwarf_Var;
typedef struct Dwarf_Weak_s*       Dwarf_Weak;
typedef struct Dwarf_Error_s*      Dwarf_Error;
typedef struct Dwarf_Attribute_s*  Dwarf_Attribute;
typedef struct Dwarf_Abbrev_s*       Dwarf_Abbrev;
typedef struct Dwarf_Fde_s*         Dwarf_Fde;
typedef struct Dwarf_Cie_s*         Dwarf_Cie;
typedef struct Dwarf_Arange_s*       Dwarf_Arange;

/* Opaque types for Producer Library. */
typedef struct Dwarf_P_Debug_s*           Dwarf_P_Debug;
typedef struct Dwarf_P_Die_s*           Dwarf_P_Die;
typedef struct Dwarf_P_Attribute_s*    Dwarf_P_Attribute;
typedef struct Dwarf_P_Fde_s*        Dwarf_P_Fde;
typedef struct Dwarf_P_Expr_s*        Dwarf_P_Expr;
typedef Dwarf_Unsigned                Dwarf_Tag;


/* error handler function
*/
typedef void  (*Dwarf_Handler)(Dwarf_Error /*error*/, Dwarf_Ptr /*errarg*/); 


/* Begin libdwarf Object File Interface declarations.

As of February 2008 there are multiple dwarf_reader object access
initialization methods available:
The traditional dwarf_elf_init() and dwarf_init()  and dwarf_finish() 
    which assume libelf and POSIX file access. 
An object-file and library agnostic dwarf_object_init() and dwarf_object_finish()
    which allow the coder to provide object access routines
    abstracting away the elf interface.  So there is no dependence in the
    reader code on the object format and no dependence on libelf.
    See the code in dwarf_elf_access.c  and dwarf_original_elf_init.c 
    to see an example of initializing the structures mentioned below.

Projects using dwarf_elf_init() or dwarf_init() can ignore
the Dwarf_Obj_Access* structures entirely as all these details
are completed for you.

*/

typedef struct Dwarf_Obj_Access_Interface_s   Dwarf_Obj_Access_Interface;
typedef struct Dwarf_Obj_Access_Methods_s     Dwarf_Obj_Access_Methods;
typedef struct Dwarf_Obj_Access_Section_s     Dwarf_Obj_Access_Section;


/*  Used in the get_section interface function
    in Dwarf_Obj_Access_Section_s.  Since libdwarf
    depends on standard DWARF section names an object
    format that has no such names (but has some
    method of setting up 'sections equivalents')
    must arrange to return standard DWARF section
    names in the 'name' field.  libdwarf does
    not free the strings in 'name'. */
struct Dwarf_Obj_Access_Section_s {
    /*  addr is the virtual address of the first byte of
        the section data.  Usually zero when the address
        makes no sense for a given section. */
    Dwarf_Addr     addr;

    /* Size in bytes of the section. */
    Dwarf_Unsigned size;

    /*  Having an accurate section name makes debugging of libdwarf easier. 
        and is essential to find the .debug_ sections.  */
    const char*    name;
    /*  Set link to zero if it is meaningless.  If non-zero
        it should be a link to a rela section or from symtab
        to strtab.  In Elf it is sh_link. */
    Dwarf_Unsigned link;
    /*  Elf sections that are tables have a non-zero entrysize so
        the count of entries can be calculated even without
        the right structure definition. If your object format
        does not have this data leave this zero. */
    Dwarf_Unsigned entrysize;
};

/*  Returned by the get_endianness function in 
    Dwarf_Obj_Access_Methods_s. */
typedef enum {
    DW_OBJECT_MSB,
    DW_OBJECT_LSB
} Dwarf_Endianness;

/*  The functions we need to access object data from libdwarf are declared here.

    In these function pointer declarations
    'void *obj' is intended to be a pointer (the object field in  
    Dwarf_Obj_Access_Interface_s)
    that hides the library-specific and object-specific data that makes
    it possible to handle multiple object formats and multiple libraries. 
    It's not required that one handles multiple such in a single libdwarf
    archive/shared-library (but not ruled out either).
    See  dwarf_elf_object_access_internals_t and dwarf_elf_access.c
    for an example. 

*/
struct Dwarf_Obj_Access_Methods_s {
    /*
        get_section_info
      
        Get address, size, and name info about a section.
       
        Parameters
        section_index - Zero-based index.
        return_section - Pointer to a structure in which section info 
            will be placed.   Caller must provide a valid pointer to a
            structure area.  The structure's contents will be overwritten
            by the call to get_section_info.
        error - A pointer to an integer in which an error code may be stored.
      
        Return
        DW_DLV_OK - Everything ok.
        DW_DLV_ERROR - Error occurred. Use 'error' to determine the 
            libdwarf defined error.
        DW_DLV_NO_ENTRY - No such section.  */
    int    (*get_section_info)(void* obj, Dwarf_Half section_index, 
        Dwarf_Obj_Access_Section* return_section, int* error);
    /*
        get_byte_order
      
        Get whether the object file represented by this interface is big-endian 
        (DW_OBJECT_MSB) or little endian (DW_OBJECT_LSB).
      
        Parameters
        obj - Equivalent to 'this' in OO languages.
      
        Return
        Endianness of object. Cannot fail.  */
    Dwarf_Endianness  (*get_byte_order)(void* obj);
    /*
        get_length_size
      
        Get the size of a length field in the underlying object file. 
        libdwarf currently supports * 4 and 8 byte sizes, but may 
        support larger in the future.
        Perhaps the return type should be an enumeration?
      
        Parameters
        obj - Equivalent to 'this' in OO languages.
      
        Return
        Size of length. Cannot fail.  */
    Dwarf_Small   (*get_length_size)(void* obj);
    /* 
        get_pointer_size
      
        Get the size of a pointer field in the underlying object file. 
        libdwarf currently supports  4 and 8 byte sizes.
        Perhaps the return type should be an enumeration?

        Return
        Size of pointer. Cannot fail.  */
    Dwarf_Small   (*get_pointer_size)(void* obj);
    /*
        get_section_count
      
        Get the number of sections in the object file.
       
        Parameters
      
        Return
        Number of sections */
    Dwarf_Unsigned  (*get_section_count)(void* obj);
    /*
        load_section
      
        Get a pointer to an array of bytes that represent the section.
      
        Parameters
        section_index - Zero-based index.
        return_data - The address of a pointer to which the section data block 
            will be assigned.
        error - Pointer to an integer for returning libdwarf-defined 
            error numbers.
      
        Return
        DW_DLV_OK - No error.
        DW_DLV_ERROR - Error. Use 'error' to indicate a libdwarf-defined 
            error number.
        DW_DLV_NO_ENTRY - No such section.  */
    int    (*load_section)(void* obj, Dwarf_Half section_index, 
        Dwarf_Small** return_data, int* error);

    /**
        relocate_a_section
        If relocations are not supported leave this pointer NULL.
     
        Get a pointer to an array of bytes that represent the section.
     
        Parameters
        section_index - Zero-based index of the section to be relocated.
        error - Pointer to an integer for returning libdwarf-defined 
            error numbers.
     
        Return
        DW_DLV_OK - No error.
        DW_DLV_ERROR - Error. Use 'error' to indicate a libdwarf-defined 
            error number.
        DW_DLV_NO_ENTRY - No such section.  */
    int    (*relocate_a_section)(void* obj, Dwarf_Half section_index,
        Dwarf_Debug dbg,
        int* error);

};



/*  These structures are allocated and deallocated by your code
    when you are using the libdwarf Object File Interface  
    [dwarf_object_init() and dwarf_object_finish()] directly.
    dwarf_object_finish() does not free
    struct Dwarf_Obj_Access_Interface_s or its content. 
    (libdwarf does record a pointer to this struct: you must
    ensure that pointer remains valid for as long as
    a libdwarf instance is open (meaning
    after dwarf_init() and before dwarf_finish()).

    If you are reading Elf objects and libelf use dwarf_init()
    or dwarf_elf_init() which take care of these details.
*/
struct Dwarf_Obj_Access_Interface_s {
    /*  object is a void* as it hides the data the object access routines
        need (which varies by library in use and object format). 
    */
    void* object;
    const Dwarf_Obj_Access_Methods * methods;
};
  
/* End libdwarf Object File Interface */

/* 
    Dwarf_dealloc() alloc_type arguments.
    Argument points to:
*/
#define DW_DLA_STRING          0x01     /* char* */
#define DW_DLA_LOC             0x02     /* Dwarf_Loc */
#define DW_DLA_LOCDESC         0x03     /* Dwarf_Locdesc */
#define DW_DLA_ELLIST          0x04     /* Dwarf_Ellist (not used)*/
#define DW_DLA_BOUNDS          0x05     /* Dwarf_Bounds (not used) */
#define DW_DLA_BLOCK           0x06     /* Dwarf_Block */
#define DW_DLA_DEBUG           0x07     /* Dwarf_Debug */
#define DW_DLA_DIE             0x08     /* Dwarf_Die */
#define DW_DLA_LINE            0x09     /* Dwarf_Line */
#define DW_DLA_ATTR            0x0a     /* Dwarf_Attribute */
#define DW_DLA_TYPE            0x0b     /* Dwarf_Type  (not used) */
#define DW_DLA_SUBSCR          0x0c     /* Dwarf_Subscr (not used) */
#define DW_DLA_GLOBAL          0x0d     /* Dwarf_Global */
#define DW_DLA_ERROR           0x0e     /* Dwarf_Error */
#define DW_DLA_LIST            0x0f     /* a list */
#define DW_DLA_LINEBUF         0x10     /* Dwarf_Line* (not used) */
#define DW_DLA_ARANGE          0x11     /* Dwarf_Arange */
#define DW_DLA_ABBREV          0x12      /* Dwarf_Abbrev */
#define DW_DLA_FRAME_OP        0x13      /* Dwarf_Frame_Op */
#define DW_DLA_CIE             0x14     /* Dwarf_Cie */
#define DW_DLA_FDE             0x15     /* Dwarf_Fde */
#define DW_DLA_LOC_BLOCK       0x16     /* Dwarf_Loc Block (not used) */
#define DW_DLA_FRAME_BLOCK     0x17     /* Dwarf_Frame Block (not used) */
#define DW_DLA_FUNC            0x18     /* Dwarf_Func */
#define DW_DLA_TYPENAME        0x19     /* Dwarf_Type */
#define DW_DLA_VAR             0x1a     /* Dwarf_Var */
#define DW_DLA_WEAK            0x1b     /* Dwarf_Weak */
#define DW_DLA_ADDR            0x1c     /* Dwarf_Addr sized entries */
#define DW_DLA_RANGES          0x1d     /* Dwarf_Ranges */

/* The augmenter string for CIE */
#define DW_CIE_AUGMENTER_STRING_V0              "z"

/* dwarf_init() access arguments
*/
#define DW_DLC_READ        0        /* read only access */
#define DW_DLC_WRITE       1        /* write only access */
#define DW_DLC_RDWR        2        /* read/write access NOT SUPPORTED*/

/* dwarf_producer_init*() access flag modifiers
   If HAVE_DWARF2_99_EXTENSION is defined at libdwarf build time
   and DW_DLC_OFFSET_SIZE_64  is passed in producer_init() 
   flags then the DWARF3 64 bit offset extension is used 
   to generate 64 bit offsets.
*/
#define DW_DLC_SIZE_64     0x40000000 /* 64-bit address-size target */
#define DW_DLC_SIZE_32     0x20000000 /* 32-bit address-size target */
#define DW_DLC_OFFSET_SIZE_64 0x10000000 /* 64-bit offset-size DWARF */

/* dwarf_producer_init*() access flag modifiers
*/
#define DW_DLC_ISA_MIPS             0x00000000 /* MIPS target */
#define DW_DLC_ISA_IA64             0x01000000 /* IA64 target */
#define DW_DLC_STREAM_RELOCATIONS   0x02000000 /* Old style binary relocs */

    /*  Usable with assembly output because it is up to the producer to
        deal with locations in whatever manner the producer code wishes. 
        Possibly emitting text an assembler will recognize. */
#define DW_DLC_SYMBOLIC_RELOCATIONS 0x04000000 

#define DW_DLC_TARGET_BIGENDIAN     0x08000000 /* Big    endian target */
#define DW_DLC_TARGET_LITTLEENDIAN  0x00100000 /* Little endian target */

#if 0
  /*
   The libdwarf producer interfaces jumble these two semantics together in
   confusing ways.  We *should* have flags like these...
   But changing the code means a lot of diffs.  So for now,
   we leave things as they are 
  */
  #define DW_DLC_SUN_OFFSET32        0x00010000 /* use 32-bit sec offsets */
  #define DW_DLC_SUN_OFFSET64        0x00020000 /* use 64-bit sec offsets */
  #define DW_DLC_SUN_POINTER32        0x00040000 /* use 4 for address_size */
  #define DW_DLC_SUN_POINTER64        0x00080000 /* use 8 for address_size */
#endif

/* dwarf_pcline() slide arguments
*/
#define DW_DLS_BACKWARD   -1       /* slide backward to find line */
#define DW_DLS_NOSLIDE     0       /* match exactly without sliding */ 
#define DW_DLS_FORWARD     1       /* slide forward to find line */

/* libdwarf error numbers
*/
#define DW_DLE_NE          0     /* no error */ 
#define DW_DLE_VMM         1     /* dwarf format/library version mismatch */
#define DW_DLE_MAP         2     /* memory map failure */
#define DW_DLE_LEE         3     /* libelf error */
#define DW_DLE_NDS         4     /* no debug section */
#define DW_DLE_NLS         5     /* no line section */
#define DW_DLE_ID          6     /* invalid descriptor for query */
#define DW_DLE_IOF         7     /* I/O failure */
#define DW_DLE_MAF         8     /* memory allocation failure */
#define DW_DLE_IA          9     /* invalid argument */ 
#define DW_DLE_MDE         10     /* mangled debugging entry */
#define DW_DLE_MLE         11     /* mangled line number entry */
#define DW_DLE_FNO         12     /* file not open */
#define DW_DLE_FNR         13     /* file not a regular file */
#define DW_DLE_FWA         14     /* file open with wrong access */
#define DW_DLE_NOB         15     /* not an object file */
#define DW_DLE_MOF         16     /* mangled object file header */
#define DW_DLE_EOLL        17     /* end of location list entries */
#define DW_DLE_NOLL        18     /* no location list section */
#define DW_DLE_BADOFF      19     /* Invalid offset */
#define DW_DLE_EOS         20     /* end of section  */
#define DW_DLE_ATRUNC      21     /* abbreviations section appears truncated*/
#define DW_DLE_BADBITC     22     /* Address size passed to dwarf bad*/
                    /* It is not an allowed size (64 or 32) */
    /* Error codes defined by the current Libdwarf Implementation. */
#define DW_DLE_DBG_ALLOC                        23
#define DW_DLE_FSTAT_ERROR                      24
#define DW_DLE_FSTAT_MODE_ERROR                 25
#define DW_DLE_INIT_ACCESS_WRONG                26
#define DW_DLE_ELF_BEGIN_ERROR                  27
#define DW_DLE_ELF_GETEHDR_ERROR                28
#define DW_DLE_ELF_GETSHDR_ERROR                29
#define DW_DLE_ELF_STRPTR_ERROR                 30
#define DW_DLE_DEBUG_INFO_DUPLICATE             31
#define DW_DLE_DEBUG_INFO_NULL                  32
#define DW_DLE_DEBUG_ABBREV_DUPLICATE           33
#define DW_DLE_DEBUG_ABBREV_NULL                34
#define DW_DLE_DEBUG_ARANGES_DUPLICATE          35
#define DW_DLE_DEBUG_ARANGES_NULL               36
#define DW_DLE_DEBUG_LINE_DUPLICATE             37
#define DW_DLE_DEBUG_LINE_NULL                  38
#define DW_DLE_DEBUG_LOC_DUPLICATE              39
#define DW_DLE_DEBUG_LOC_NULL                   40
#define DW_DLE_DEBUG_MACINFO_DUPLICATE          41
#define DW_DLE_DEBUG_MACINFO_NULL               42
#define DW_DLE_DEBUG_PUBNAMES_DUPLICATE         43
#define DW_DLE_DEBUG_PUBNAMES_NULL              44
#define DW_DLE_DEBUG_STR_DUPLICATE              45
#define DW_DLE_DEBUG_STR_NULL                   46
#define DW_DLE_CU_LENGTH_ERROR                  47
#define DW_DLE_VERSION_STAMP_ERROR              48
#define DW_DLE_ABBREV_OFFSET_ERROR              49
#define DW_DLE_ADDRESS_SIZE_ERROR               50
#define DW_DLE_DEBUG_INFO_PTR_NULL              51
#define DW_DLE_DIE_NULL                         52
#define DW_DLE_STRING_OFFSET_BAD                53
#define DW_DLE_DEBUG_LINE_LENGTH_BAD            54
#define DW_DLE_LINE_PROLOG_LENGTH_BAD           55
#define DW_DLE_LINE_NUM_OPERANDS_BAD            56
#define DW_DLE_LINE_SET_ADDR_ERROR              57 /* No longer used. */
#define DW_DLE_LINE_EXT_OPCODE_BAD              58
#define DW_DLE_DWARF_LINE_NULL                  59
#define DW_DLE_INCL_DIR_NUM_BAD                 60
#define DW_DLE_LINE_FILE_NUM_BAD                61
#define DW_DLE_ALLOC_FAIL                       62
#define DW_DLE_NO_CALLBACK_FUNC                 63
#define DW_DLE_SECT_ALLOC                       64
#define DW_DLE_FILE_ENTRY_ALLOC                 65
#define DW_DLE_LINE_ALLOC                       66
#define DW_DLE_FPGM_ALLOC                       67
#define DW_DLE_INCDIR_ALLOC                     68
#define DW_DLE_STRING_ALLOC                     69
#define DW_DLE_CHUNK_ALLOC                      70
#define DW_DLE_BYTEOFF_ERR                      71
#define DW_DLE_CIE_ALLOC                        72
#define DW_DLE_FDE_ALLOC                        73
#define DW_DLE_REGNO_OVFL                       74
#define DW_DLE_CIE_OFFS_ALLOC                   75
#define DW_DLE_WRONG_ADDRESS                    76
#define DW_DLE_EXTRA_NEIGHBORS                  77
#define    DW_DLE_WRONG_TAG                     78
#define DW_DLE_DIE_ALLOC                        79
#define DW_DLE_PARENT_EXISTS                    80
#define DW_DLE_DBG_NULL                         81
#define DW_DLE_DEBUGLINE_ERROR                  82
#define DW_DLE_DEBUGFRAME_ERROR                 83
#define DW_DLE_DEBUGINFO_ERROR                  84
#define DW_DLE_ATTR_ALLOC                       85
#define DW_DLE_ABBREV_ALLOC                     86
#define DW_DLE_OFFSET_UFLW                      87
#define DW_DLE_ELF_SECT_ERR                     88
#define DW_DLE_DEBUG_FRAME_LENGTH_BAD           89
#define DW_DLE_FRAME_VERSION_BAD                90
#define DW_DLE_CIE_RET_ADDR_REG_ERROR           91
#define DW_DLE_FDE_NULL                         92
#define DW_DLE_FDE_DBG_NULL                     93
#define DW_DLE_CIE_NULL                         94
#define DW_DLE_CIE_DBG_NULL                     95
#define DW_DLE_FRAME_TABLE_COL_BAD              96
#define DW_DLE_PC_NOT_IN_FDE_RANGE              97
#define DW_DLE_CIE_INSTR_EXEC_ERROR             98
#define DW_DLE_FRAME_INSTR_EXEC_ERROR           99
#define DW_DLE_FDE_PTR_NULL                    100
#define DW_DLE_RET_OP_LIST_NULL                101
#define DW_DLE_LINE_CONTEXT_NULL               102
#define DW_DLE_DBG_NO_CU_CONTEXT               103
#define DW_DLE_DIE_NO_CU_CONTEXT               104
#define DW_DLE_FIRST_DIE_NOT_CU                105
#define DW_DLE_NEXT_DIE_PTR_NULL               106
#define DW_DLE_DEBUG_FRAME_DUPLICATE           107
#define DW_DLE_DEBUG_FRAME_NULL                108
#define DW_DLE_ABBREV_DECODE_ERROR             109
#define DW_DLE_DWARF_ABBREV_NULL               110
#define DW_DLE_ATTR_NULL                       111
#define DW_DLE_DIE_BAD                         112
#define DW_DLE_DIE_ABBREV_BAD                  113
#define DW_DLE_ATTR_FORM_BAD                   114
#define DW_DLE_ATTR_NO_CU_CONTEXT              115
#define DW_DLE_ATTR_FORM_SIZE_BAD              116
#define DW_DLE_ATTR_DBG_NULL                   117
#define DW_DLE_BAD_REF_FORM                    118
#define DW_DLE_ATTR_FORM_OFFSET_BAD            119
#define DW_DLE_LINE_OFFSET_BAD                 120
#define DW_DLE_DEBUG_STR_OFFSET_BAD            121
#define DW_DLE_STRING_PTR_NULL                 122
#define DW_DLE_PUBNAMES_VERSION_ERROR          123
#define DW_DLE_PUBNAMES_LENGTH_BAD             124
#define DW_DLE_GLOBAL_NULL                     125
#define DW_DLE_GLOBAL_CONTEXT_NULL             126
#define DW_DLE_DIR_INDEX_BAD                   127
#define DW_DLE_LOC_EXPR_BAD                    128
#define DW_DLE_DIE_LOC_EXPR_BAD                129
#define DW_DLE_ADDR_ALLOC                      130
#define DW_DLE_OFFSET_BAD                      131
#define DW_DLE_MAKE_CU_CONTEXT_FAIL            132
#define DW_DLE_REL_ALLOC                       133
#define DW_DLE_ARANGE_OFFSET_BAD               134
#define DW_DLE_SEGMENT_SIZE_BAD                135
#define DW_DLE_ARANGE_LENGTH_BAD               136
#define DW_DLE_ARANGE_DECODE_ERROR             137
#define DW_DLE_ARANGES_NULL                    138
#define DW_DLE_ARANGE_NULL                     139
#define DW_DLE_NO_FILE_NAME                    140
#define DW_DLE_NO_COMP_DIR                     141
#define DW_DLE_CU_ADDRESS_SIZE_BAD             142
#define DW_DLE_INPUT_ATTR_BAD                  143
#define DW_DLE_EXPR_NULL                       144
#define DW_DLE_BAD_EXPR_OPCODE                 145
#define DW_DLE_EXPR_LENGTH_BAD                 146
#define DW_DLE_MULTIPLE_RELOC_IN_EXPR          147
#define DW_DLE_ELF_GETIDENT_ERROR              148
#define DW_DLE_NO_AT_MIPS_FDE                  149
#define DW_DLE_NO_CIE_FOR_FDE                  150
#define DW_DLE_DIE_ABBREV_LIST_NULL            151
#define DW_DLE_DEBUG_FUNCNAMES_DUPLICATE       152
#define DW_DLE_DEBUG_FUNCNAMES_NULL            153
#define DW_DLE_DEBUG_FUNCNAMES_VERSION_ERROR   154
#define DW_DLE_DEBUG_FUNCNAMES_LENGTH_BAD      155
#define DW_DLE_FUNC_NULL                       156
#define DW_DLE_FUNC_CONTEXT_NULL               157
#define DW_DLE_DEBUG_TYPENAMES_DUPLICATE       158
#define DW_DLE_DEBUG_TYPENAMES_NULL            159
#define DW_DLE_DEBUG_TYPENAMES_VERSION_ERROR   160
#define DW_DLE_DEBUG_TYPENAMES_LENGTH_BAD      161
#define DW_DLE_TYPE_NULL                       162
#define DW_DLE_TYPE_CONTEXT_NULL               163
#define DW_DLE_DEBUG_VARNAMES_DUPLICATE        164
#define DW_DLE_DEBUG_VARNAMES_NULL             165
#define DW_DLE_DEBUG_VARNAMES_VERSION_ERROR    166
#define DW_DLE_DEBUG_VARNAMES_LENGTH_BAD       167
#define DW_DLE_VAR_NULL                        168
#define DW_DLE_VAR_CONTEXT_NULL                169
#define DW_DLE_DEBUG_WEAKNAMES_DUPLICATE       170
#define DW_DLE_DEBUG_WEAKNAMES_NULL            171
#define DW_DLE_DEBUG_WEAKNAMES_VERSION_ERROR   172
#define DW_DLE_DEBUG_WEAKNAMES_LENGTH_BAD      173
#define DW_DLE_WEAK_NULL                       174
#define DW_DLE_WEAK_CONTEXT_NULL               175
#define DW_DLE_LOCDESC_COUNT_WRONG             176
#define DW_DLE_MACINFO_STRING_NULL             177
#define DW_DLE_MACINFO_STRING_EMPTY            178
#define DW_DLE_MACINFO_INTERNAL_ERROR_SPACE    179
#define DW_DLE_MACINFO_MALLOC_FAIL             180
#define DW_DLE_DEBUGMACINFO_ERROR              181
#define DW_DLE_DEBUG_MACRO_LENGTH_BAD          182
#define DW_DLE_DEBUG_MACRO_MAX_BAD             183
#define DW_DLE_DEBUG_MACRO_INTERNAL_ERR        184
#define DW_DLE_DEBUG_MACRO_MALLOC_SPACE        185
#define DW_DLE_DEBUG_MACRO_INCONSISTENT        186
#define DW_DLE_DF_NO_CIE_AUGMENTATION          187
#define DW_DLE_DF_REG_NUM_TOO_HIGH             188 
#define DW_DLE_DF_MAKE_INSTR_NO_INIT           189 
#define DW_DLE_DF_NEW_LOC_LESS_OLD_LOC         190
#define DW_DLE_DF_POP_EMPTY_STACK              191
#define DW_DLE_DF_ALLOC_FAIL                   192
#define DW_DLE_DF_FRAME_DECODING_ERROR         193
#define DW_DLE_DEBUG_LOC_SECTION_SHORT         194
#define DW_DLE_FRAME_AUGMENTATION_UNKNOWN      195
#define DW_DLE_PUBTYPE_CONTEXT                 196 /* Unused. */
#define DW_DLE_DEBUG_PUBTYPES_LENGTH_BAD       197
#define DW_DLE_DEBUG_PUBTYPES_VERSION_ERROR    198
#define DW_DLE_DEBUG_PUBTYPES_DUPLICATE        199
#define DW_DLE_FRAME_CIE_DECODE_ERROR          200
#define DW_DLE_FRAME_REGISTER_UNREPRESENTABLE  201
#define DW_DLE_FRAME_REGISTER_COUNT_MISMATCH   202
#define DW_DLE_LINK_LOOP                       203
#define DW_DLE_STRP_OFFSET_BAD                 204
#define DW_DLE_DEBUG_RANGES_DUPLICATE          205
#define DW_DLE_DEBUG_RANGES_OFFSET_BAD         206
#define DW_DLE_DEBUG_RANGES_MISSING_END        207
#define DW_DLE_DEBUG_RANGES_OUT_OF_MEM         208
#define DW_DLE_DEBUG_SYMTAB_ERR                209
#define DW_DLE_DEBUG_STRTAB_ERR                210
#define DW_DLE_RELOC_MISMATCH_INDEX            211
#define DW_DLE_RELOC_MISMATCH_RELOC_INDEX      212
#define DW_DLE_RELOC_MISMATCH_STRTAB_INDEX     213
#define DW_DLE_RELOC_SECTION_MISMATCH          214
#define DW_DLE_RELOC_SECTION_MISSING_INDEX     215
#define DW_DLE_RELOC_SECTION_LENGTH_ODD        216
#define DW_DLE_RELOC_SECTION_PTR_NULL          217
#define DW_DLE_RELOC_SECTION_MALLOC_FAIL       218
#define DW_DLE_NO_ELF64_SUPPORT                219
#define DW_DLE_MISSING_ELF64_SUPPORT           220
#define DW_DLE_ORPHAN_FDE                      221
#define DW_DLE_DUPLICATE_INST_BLOCK            222
#define DW_DLE_BAD_REF_SIG8_FORM               223
#define DW_DLE_ATTR_EXPRLOC_FORM_BAD           224
#define DW_DLE_FORM_SEC_OFFSET_LENGTH_BAD      225
#define DW_DLE_NOT_REF_FORM                    226
#define DW_DLE_DEBUG_FRAME_LENGTH_NOT_MULTIPLE 227
#define DW_DLE_REF_SIG8_NOT_HANDLED            228
#define DW_DLE_DEBUG_FRAME_POSSIBLE_ADDRESS_BOTCH 229
#define DW_DLE_LOC_BAD_TERMINATION             230
#define DW_DLE_SYMTAB_SECTION_LENGTH_ODD       231
#define DW_DLE_RELOC_SECTION_SYMBOL_INDEX_BAD  232
#define DW_DLE_RELOC_SECTION_RELOC_TARGET_SIZE_UNKNOWN  233
#define DW_DLE_SYMTAB_SECTION_ENTRYSIZE_ZERO   234
#define DW_DLE_LINE_NUMBER_HEADER_ERROR        235
#define DW_DLE_DEBUG_TYPES_NULL                236
#define DW_DLE_DEBUG_TYPES_DUPLICATE           237
#define DW_DLE_DEBUG_TYPES_ONLY_DWARF4         238
#define DW_DLE_DEBUG_TYPEOFFSET_BAD            239
#define DW_DLE_GNU_OPCODE_ERROR                240


    /* DW_DLE_LAST MUST EQUAL LAST ERROR NUMBER */
#define DW_DLE_LAST        239
#define DW_DLE_LO_USER     0x10000

    /*  Taken as meaning 'undefined value', this is not
        a column or register number.
        Only present at libdwarf runtime. Never on disk.
        DW_FRAME_* Values present on disk are in dwarf.h
    */
#define DW_FRAME_UNDEFINED_VAL          1034

    /*  Taken as meaning 'same value' as caller had, not a column
        or register number
        Only present at libdwarf runtime. Never on disk.
        DW_FRAME_* Values present on disk are in dwarf.h
    */
#define DW_FRAME_SAME_VAL               1035



/* error return values  
*/
#define DW_DLV_BADADDR     (~(Dwarf_Addr)0)   
    /* for functions returning target address */

#define DW_DLV_NOCOUNT     ((Dwarf_Signed)-1) 
    /* for functions returning count */

#define DW_DLV_BADOFFSET   (~(Dwarf_Off)0)    
    /* for functions returning offset */

/* standard return values for functions */
#define DW_DLV_NO_ENTRY -1
#define DW_DLV_OK        0
#define DW_DLV_ERROR     1

/* Special values for offset_into_exception_table field of dwarf fde's. */
/* The following value indicates that there is no Exception table offset
   associated with a dwarf frame. */
#define DW_DLX_NO_EH_OFFSET         (-1LL)
/* The following value indicates that the producer was unable to analyse the
   source file to generate Exception tables for this function. */
#define DW_DLX_EH_OFFSET_UNAVAILABLE  (-2LL)


/*===========================================================================*/
/*  Dwarf consumer interface initialization and termination operations */

/* Initialization based on Unix open fd (using libelf internally). */
int dwarf_init(int    /*fd*/, 
    Dwarf_Unsigned    /*access*/, 
    Dwarf_Handler     /*errhand*/, 
    Dwarf_Ptr         /*errarg*/, 
    Dwarf_Debug*      /*dbg*/,
    Dwarf_Error*      /*error*/);

/* Initialization based on libelf/sgi-fastlibelf open pointer. */
int dwarf_elf_init(dwarf_elf_handle /*elf*/,
    Dwarf_Unsigned    /*access*/, 
    Dwarf_Handler     /*errhand*/, 
    Dwarf_Ptr         /*errarg*/, 
    Dwarf_Debug*      /*dbg*/,
    Dwarf_Error*      /*error*/);

/* Undocumented function for memory allocator. */
void dwarf_print_memory_stats(Dwarf_Debug  /*dbg*/);

int dwarf_get_elf(Dwarf_Debug /*dbg*/,
    dwarf_elf_handle* /*return_elfptr*/,
    Dwarf_Error*      /*error*/);

int dwarf_finish(Dwarf_Debug /*dbg*/, Dwarf_Error* /*error*/);


int dwarf_object_init(Dwarf_Obj_Access_Interface* /* obj */,
    Dwarf_Handler /* errhand */,
    Dwarf_Ptr     /* errarg */,
    Dwarf_Debug*  /* dbg */,
    Dwarf_Error*  /* error */);

int dwarf_object_finish(Dwarf_Debug /* dbg */,
    Dwarf_Error* /* error */);
  
/*  Die traversal operations.  
    dwarf_next_cu_header_b() traverses debug_info CU headers.
    */
int dwarf_next_cu_header_b(Dwarf_Debug /*dbg*/, 
    Dwarf_Unsigned* /*cu_header_length*/, 
    Dwarf_Half*     /*version_stamp*/, 
    Dwarf_Off*      /*abbrev_offset*/, 
    Dwarf_Half*     /*address_size*/, 
    Dwarf_Half*     /*length_size*/, 
    Dwarf_Half*     /*extension_size*/, 
    Dwarf_Unsigned* /*next_cu_header_offset*/,
    Dwarf_Error*    /*error*/);

/*  dwarf_next_cu_header_types() traverses debug_types CU headers.
    New in October, 2011
    */
int dwarf_next_cu_header_c(Dwarf_Debug /*dbg*/, 
    Dwarf_Bool      /*is_info*/,
    Dwarf_Unsigned* /*cu_header_length*/, 
    Dwarf_Half*     /*version_stamp*/, 
    Dwarf_Off*      /*abbrev_offset*/, 
    Dwarf_Half*     /*address_size*/, 
    Dwarf_Half*     /*length_size*/, 
    Dwarf_Half*     /*extension_size*/, 
    Dwarf_Sig8*     /*type signature*/,
    Dwarf_Unsigned* /*typeoffset*/,
    Dwarf_Unsigned* /*next_cu_header_offset*/,
    Dwarf_Error*    /*error*/);
/* The following is obsolete, though supported. November 2009. */
int dwarf_next_cu_header(Dwarf_Debug /*dbg*/, 
    Dwarf_Unsigned* /*cu_header_length*/, 
    Dwarf_Half*     /*version_stamp*/, 
    Dwarf_Off*      /*abbrev_offset*/, 
    Dwarf_Half*     /*address_size*/, 
    Dwarf_Unsigned* /*next_cu_header_offset*/,
    Dwarf_Error*    /*error*/);

int dwarf_siblingof(Dwarf_Debug /*dbg*/, 
    Dwarf_Die        /*die*/, 
    Dwarf_Die*       /*return_siblingdie*/,
    Dwarf_Error*     /*error*/);
/* dwarf_siblingof_b new October 2011. */
int dwarf_siblingof_b(Dwarf_Debug /*dbg*/, 
    Dwarf_Die        /*die*/, 
    Dwarf_Bool       /*is_info*/,
    Dwarf_Die*       /*return_siblingdie*/,
    Dwarf_Error*     /*error*/);

int dwarf_child(Dwarf_Die /*die*/, 
    Dwarf_Die*       /*return_childdie*/,
    Dwarf_Error*     /*error*/);

/*  Finding die given global (not CU-relative) offset.
    Applies only to debug_info. */
int dwarf_offdie(Dwarf_Debug /*dbg*/, 
    Dwarf_Off        /*offset*/, 
    Dwarf_Die*       /*return_die*/,
    Dwarf_Error*     /*error*/);

/* dwarf_offdie_b() new October 2011 */
/*  Finding die given global (not CU-relative) offset.
    Applies to debug_info (is_info true) or debug_types (is_info false). */
int dwarf_offdie_b(Dwarf_Debug /*dbg*/, 
    Dwarf_Off        /*offset*/, 
    Dwarf_Bool       /*is_info*/,
    Dwarf_Die*       /*return_die*/,
    Dwarf_Error*     /*error*/);

/*  Returns the is_info flag through the pointer if the function returns
    DW_DLV_OK. Needed so client software knows if a DIE is in debug_info
    or debug_types.
    New October 2011. */
Dwarf_Bool dwarf_get_die_infotypes_flag(Dwarf_Die /*die*/);

/* Higher level functions (Unimplemented) */
int dwarf_pcfile(Dwarf_Debug /*dbg*/, 
    Dwarf_Addr       /*pc*/, 
    Dwarf_Die*       /*return_die*/,
    Dwarf_Error*     /*error*/);

/* Unimplemented */
int dwarf_pcsubr(Dwarf_Debug /*dbg*/, 
    Dwarf_Addr       /*pc*/, 
    Dwarf_Die*       /*return_die*/,
    Dwarf_Error*     /*error*/);

/* Unimplemented */
int dwarf_pcscope(Dwarf_Debug /*dbg*/, 
    Dwarf_Addr       /*pc*/, 
    Dwarf_Die*       /*return_die*/,
    Dwarf_Error*     /*error*/);

/* operations on DIEs */
int dwarf_tag(Dwarf_Die /*die*/, 
    Dwarf_Half*      /*return_tag*/,
    Dwarf_Error*     /*error*/);

/* utility? */
/* dwarf_dieoffset returns the global debug_info
   section offset, not the CU relative offset. */
int dwarf_dieoffset(Dwarf_Die /*die*/, 
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

/* dwarf_CU_dieoffset_given_die returns
   the global debug_info section offset of the CU die
   that is the CU containing the given_die
   (the passed in DIE can be any DIE). 
   This information makes it possible for a consumer to
   find and print CU context information for any die. 
   See also dwarf_get_cu_die_offset_given_cu_header_offset(). */
int dwarf_CU_dieoffset_given_die(Dwarf_Die /*given_die*/, 
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

/* dwarf_die_CU_offset returns the CU relative offset
   not the global debug_info section offset, given
   any DIE in the CU.  See also dwarf_CU_dieoffset_given_die().
   */
int dwarf_die_CU_offset(Dwarf_Die /*die*/,
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

int dwarf_die_CU_offset_range(Dwarf_Die /*die*/,
    Dwarf_Off*       /*return_CU_header_offset*/,
    Dwarf_Off*       /*return_CU_length_bytes*/,
    Dwarf_Error*     /*error*/);

int dwarf_attr (Dwarf_Die /*die*/, 
    Dwarf_Half        /*attr*/, 
    Dwarf_Attribute * /*returned_attr*/,
    Dwarf_Error*      /*error*/);

int dwarf_diename(Dwarf_Die /*die*/, 
    char   **        /*diename*/,
    Dwarf_Error*     /*error*/);

/* Returns the  abbrev code of the die. Cannot fail. */
int dwarf_die_abbrev_code(Dwarf_Die /*die */);

/*  Returns a flag through ab_has_child. Non-zero if
    the DIE has children, zero if it does not.   */
int dwarf_die_abbrev_children_flag(Dwarf_Die /*die*/,
    Dwarf_Half * /*ab_has_child*/);

/* Validate the sibling DIE. This only makes sense to call
   if the sibling's DIEs have been travsersed and 
   dwarf_child() called on each,
   so that the last DIE dwarf_child saw was the last. 
   Essentially ensuring that (after such traversal) that we
   are in the same place a sibling attribute would identify.
   In case we return DW_DLV_ERROR, the global offset of the last
   DIE traversed by dwarf_child is returned through *offset */
int dwarf_validate_die_sibling(Dwarf_Die /*sibling*/,Dwarf_Off* /*offset*/);

/* convenience functions, alternative to using dwarf_attrlist() */
int dwarf_hasattr(Dwarf_Die /*die*/, 
    Dwarf_Half       /*attr*/, 
    Dwarf_Bool *     /*returned_bool*/,
    Dwarf_Error*     /*error*/);

/* dwarf_loclist_n preferred over dwarf_loclist */
int dwarf_loclist_n(Dwarf_Attribute /*attr*/,  
    Dwarf_Locdesc*** /*llbuf*/, 
    Dwarf_Signed *   /*locCount*/,
    Dwarf_Error*     /*error*/);

int dwarf_loclist(Dwarf_Attribute /*attr*/,  /* inflexible! */
    Dwarf_Locdesc**  /*llbuf*/, 
    Dwarf_Signed *   /*locCount*/,
    Dwarf_Error*     /*error*/);

/* Extracts a dwarf expression from an expression byte stream.
   Useful to get expressions from DW_CFA_def_cfa_expression
   DW_CFA_expression DW_CFA_val_expression expression bytes.
   27 April 2009: dwarf_loclist_from_expr() interface with
   no addr_size is obsolete but supported, 
   use dwarf_loclist_from_expr_a() instead.  
*/
int dwarf_loclist_from_expr(Dwarf_Debug dbg,
    Dwarf_Ptr expression_in,
    Dwarf_Unsigned expression_length,
    Dwarf_Locdesc ** llbuf,
    Dwarf_Signed * listlen, Dwarf_Error * error);

/* dwarf_loclist_from_expr_a() new 27 Apr 2009: added addr_size argument. */
int dwarf_loclist_from_expr_a(Dwarf_Debug dbg,
    Dwarf_Ptr expression_in,
    Dwarf_Unsigned expression_length,
    Dwarf_Half addr_size,
    Dwarf_Locdesc ** llbuf,
    Dwarf_Signed * listlen, Dwarf_Error * error);

/* Unimplemented */
int dwarf_stringlen(Dwarf_Die /*die*/, 
    Dwarf_Locdesc ** /*returned_locdesc*/,
    Dwarf_Error*     /*error*/);

/* Unimplemented */
int dwarf_subscrcnt(Dwarf_Die /*die*/, 
    Dwarf_Signed *   /*returned_count*/,
    Dwarf_Error*     /*error*/);

/* Unimplemented */
int dwarf_nthsubscr(Dwarf_Die /*die*/, 
    Dwarf_Unsigned   /*ssndx*/, 
    Dwarf_Die *      /*returned_die*/,
    Dwarf_Error*     /*error*/);

int dwarf_lowpc(Dwarf_Die /*die*/, 
    Dwarf_Addr  *    /*returned_addr*/,
    Dwarf_Error*     /*error*/);

int dwarf_highpc(Dwarf_Die /*die*/, 
    Dwarf_Addr  *    /*returned_addr*/,
    Dwarf_Error*     /*error*/);

int dwarf_bytesize(Dwarf_Die /*die*/, 
    Dwarf_Unsigned * /*returned_size*/,
    Dwarf_Error*     /*error*/);

/* Unimplemented */
int dwarf_isbitfield(Dwarf_Die /*die*/, 
    Dwarf_Bool  *    /*returned_bool*/,
    Dwarf_Error*     /*error*/);

int dwarf_bitsize(Dwarf_Die /*die*/, 
    Dwarf_Unsigned * /*returned_size*/,
    Dwarf_Error*     /*error*/);

int dwarf_bitoffset(Dwarf_Die /*die*/, 
    Dwarf_Unsigned * /*returned_offset*/,
    Dwarf_Error*     /*error*/);

int dwarf_srclang(Dwarf_Die /*die*/, 
    Dwarf_Unsigned * /*returned_lang*/,
    Dwarf_Error*     /*error*/);

int dwarf_arrayorder(Dwarf_Die /*die*/, 
    Dwarf_Unsigned * /*returned_order*/,
    Dwarf_Error*     /*error*/);

/* end of convenience function list */

/* this is the main interface to attributes of a DIE */
int dwarf_attrlist(Dwarf_Die /*die*/, 
    Dwarf_Attribute** /*attrbuf*/, 
    Dwarf_Signed   * /*attrcount*/,
    Dwarf_Error*     /*error*/);

/* query operations for attributes */
int dwarf_hasform(Dwarf_Attribute /*attr*/, 
    Dwarf_Half       /*form*/, 
    Dwarf_Bool *     /*returned_bool*/,
    Dwarf_Error*     /*error*/);

int dwarf_whatform(Dwarf_Attribute /*attr*/, 
    Dwarf_Half *     /*returned_form*/,
    Dwarf_Error*     /*error*/);

int dwarf_whatform_direct(Dwarf_Attribute /*attr*/, 
    Dwarf_Half *     /*returned_form*/,
    Dwarf_Error*     /*error*/);

int dwarf_whatattr(Dwarf_Attribute /*attr*/, 
    Dwarf_Half *     /*returned_attr_num*/,
    Dwarf_Error*     /*error*/);

/* 
    The following are concerned with the Primary Interface: getting
    the actual data values. One function per 'kind' of FORM.
*/
/*  dwarf_formref returns, thru return_offset, a CU-relative offset
    and does not allow DW_FORM_ref_addr*/
int dwarf_formref(Dwarf_Attribute /*attr*/, 
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);
/*  dwarf_global_formref returns, thru return_offset, 
    a debug_info-relative offset and does allow all reference forms*/
int dwarf_global_formref(Dwarf_Attribute /*attr*/, 
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

/*  dwarf_formsig8 returns in the caller-provided 8 byte area
    the 8 bytes of a DW_FORM_ref_sig8.  Not a string.  */
int dwarf_formsig8(Dwarf_Attribute /*attr*/,
    Dwarf_Sig8 * /*returned sig bytes*/,
    Dwarf_Error*     /*error*/);

int dwarf_formaddr(Dwarf_Attribute /*attr*/, 
    Dwarf_Addr   *   /*returned_addr*/,
    Dwarf_Error*     /*error*/);

int dwarf_formflag(Dwarf_Attribute /*attr*/,
    Dwarf_Bool *     /*returned_bool*/,
    Dwarf_Error*     /*error*/);

int dwarf_formudata(Dwarf_Attribute /*attr*/, 
    Dwarf_Unsigned  * /*returned_val*/,
    Dwarf_Error*     /*error*/);

int dwarf_formsdata(Dwarf_Attribute     /*attr*/, 
    Dwarf_Signed  *  /*returned_val*/,
    Dwarf_Error*     /*error*/);

int dwarf_formblock(Dwarf_Attribute /*attr*/, 
    Dwarf_Block    ** /*returned_block*/,
    Dwarf_Error*     /*error*/);

int dwarf_formstring(Dwarf_Attribute /*attr*/, 
    char   **        /*returned_string*/,
    Dwarf_Error*     /*error*/);

int dwarf_formexprloc(Dwarf_Attribute /*attr*/,
    Dwarf_Unsigned * /*return_exprlen*/,
    Dwarf_Ptr  * /*block_ptr*/,
    Dwarf_Error * /*error*/);


/* end attribute query operations. */

/* line number operations */
/* dwarf_srclines  is the normal interface */
int dwarf_srclines(Dwarf_Die /*die*/, 
    Dwarf_Line**     /*linebuf*/, 
    Dwarf_Signed *   /*linecount*/,
    Dwarf_Error*     /*error*/);

/* dwarf_srclines_dealloc, created July 2005, is the new
   method for deallocating what dwarf_srclines returns.
   More complete free than using dwarf_dealloc directly. */
void dwarf_srclines_dealloc(Dwarf_Debug /*dbg*/, 
    Dwarf_Line*       /*linebuf*/,
    Dwarf_Signed      /*count */);


int dwarf_srcfiles(Dwarf_Die /*die*/, 
    char***          /*srcfiles*/, 
    Dwarf_Signed *   /*filecount*/,
    Dwarf_Error*     /*error*/);

/* Unimplemented. */
int dwarf_dieline(Dwarf_Die /*die*/, 
    Dwarf_Line  *    /*returned_line*/,
    Dwarf_Error *    /*error*/);

int dwarf_linebeginstatement(Dwarf_Line /*line*/, 
    Dwarf_Bool  *    /*returned_bool*/,
    Dwarf_Error*     /*error*/);

int dwarf_lineendsequence(Dwarf_Line /*line*/,
    Dwarf_Bool  *    /*returned_bool*/,
    Dwarf_Error*     /*error*/);

int dwarf_lineno(Dwarf_Line /*line*/, 
    Dwarf_Unsigned * /*returned_lineno*/,
    Dwarf_Error*     /*error*/);

int dwarf_line_srcfileno(Dwarf_Line /*line*/,
    Dwarf_Unsigned * /*ret_fileno*/, 
    Dwarf_Error *    /*error*/);

/* Is the line address from DW_LNS_set_address? */
int dwarf_line_is_addr_set(Dwarf_Line /*line*/,
    Dwarf_Bool *     /*is_addr_set*/,
    Dwarf_Error *    /*error*/);

int dwarf_lineaddr(Dwarf_Line /*line*/, 
    Dwarf_Addr *     /*returned_addr*/,
    Dwarf_Error*     /*error*/);

/* dwarf_lineoff() is OBSOLETE as of December 2011. Do not use. */
int dwarf_lineoff(Dwarf_Line /*line*/, 
    Dwarf_Signed  *  /*returned_lineoffset*/,
    Dwarf_Error*     /*error*/);
/*  dwarf_lineoff_b() correctly returns an unsigned column number
    through the pointer returned_offset. 
    dwarf_lineoff_b() is new in December 2011.  */
int dwarf_lineoff_b(Dwarf_Line /*line*/, 
    Dwarf_Unsigned * /*returned_lineoffset*/,
    Dwarf_Error*     /*error*/);

int dwarf_linesrc(Dwarf_Line /*line*/, 
    char   **        /*returned_name*/,
    Dwarf_Error*     /*error*/);

int dwarf_lineblock(Dwarf_Line /*line*/, 
    Dwarf_Bool  *    /*returned_bool*/,
    Dwarf_Error*     /*error*/);

/* We gather these into one call as it's likely one
   will want all or none of them.  */
int dwarf_prologue_end_etc(Dwarf_Line /* line */,
    Dwarf_Bool  *    /*prologue_end*/,
    Dwarf_Bool  *    /*eplogue_begin*/,
    Dwarf_Unsigned * /* isa */,
    Dwarf_Unsigned * /* discriminator */,
    Dwarf_Error *    /*error*/);

/* Tertiary interface to line info */
/* Unimplemented */
int dwarf_pclines(Dwarf_Debug /*dbg*/, 
    Dwarf_Addr       /*pc*/, 
    Dwarf_Line**     /*linebuf*/, 
    Dwarf_Signed *   /*linecount*/,
    Dwarf_Signed     /*slide*/, 
    Dwarf_Error*     /*error*/);
/* end line number operations */

/* global name space operations (.debug_pubnames access) */
int dwarf_get_globals(Dwarf_Debug /*dbg*/, 
    Dwarf_Global**   /*globals*/, 
    Dwarf_Signed *   /*number_of_globals*/,
    Dwarf_Error*     /*error*/);
void dwarf_globals_dealloc(Dwarf_Debug /*dbg*/,
    Dwarf_Global*    /*globals*/,
    Dwarf_Signed     /*number_of_globals*/);

int dwarf_globname(Dwarf_Global /*glob*/, 
    char   **        /*returned_name*/,
    Dwarf_Error*     /*error*/);

int dwarf_global_die_offset(Dwarf_Global /*global*/, 
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error *    /*error*/);

/* This returns the CU die global offset if one knows the
   CU header global offset.
   See also dwarf_CU_dieoffset_given_die(). */ 
int dwarf_get_cu_die_offset_given_cu_header_offset(
    Dwarf_Debug      /*dbg*/,
    Dwarf_Off        /*in_cu_header_offset*/,
    Dwarf_Off *  /*out_cu_die_offset*/, 
    Dwarf_Error *    /*err*/);

/*  The _b form is new October 2011. */
int dwarf_get_cu_die_offset_given_cu_header_offset_b(
    Dwarf_Debug      /*dbg*/,
    Dwarf_Off        /*in_cu_header_offset*/,
    Dwarf_Bool       /*is_info. True means look in debug_Info, 
        false use debug_types.*/,
    Dwarf_Off *  /*out_cu_die_offset*/, 
    Dwarf_Error *    /*err*/);

#ifdef __sgi /* pragma is sgi MIPS only */
#pragma optional dwarf_get_cu_die_offset_given_cu_header_offset
#endif

int dwarf_global_cu_offset(Dwarf_Global /*global*/, 
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

int dwarf_global_name_offsets(Dwarf_Global /*global*/, 
    char   **        /*returned_name*/,
    Dwarf_Off*       /*die_offset*/, 
    Dwarf_Off*       /*cu_offset*/, 
    Dwarf_Error*     /*error*/);

/* Static function name operations.  */
int dwarf_get_funcs(Dwarf_Debug    /*dbg*/,
    Dwarf_Func**     /*funcs*/,
    Dwarf_Signed *   /*number_of_funcs*/,
    Dwarf_Error*     /*error*/);
void dwarf_funcs_dealloc(Dwarf_Debug /*dbg*/,
    Dwarf_Func*      /*funcs*/,
    Dwarf_Signed     /*number_of_funcs*/);

int dwarf_funcname(Dwarf_Func /*func*/,
    char   **        /*returned_name*/,
    Dwarf_Error*     /*error*/);

int dwarf_func_die_offset(Dwarf_Func /*func*/,
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

int dwarf_func_cu_offset(Dwarf_Func /*func*/,
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

int dwarf_func_name_offsets(Dwarf_Func /*func*/,
    char   **        /*returned_name*/,
    Dwarf_Off*       /*die_offset*/,
    Dwarf_Off*       /*cu_offset*/,
    Dwarf_Error*     /*error*/);

/* User-defined type name operations, SGI IRIX .debug_typenames section.
   Same content as DWARF3 .debug_pubtypes, but defined years before
   .debug_pubtypes was defined.   SGI IRIX only. */
int dwarf_get_types(Dwarf_Debug    /*dbg*/,
    Dwarf_Type**     /*types*/,
    Dwarf_Signed *   /*number_of_types*/,
    Dwarf_Error*     /*error*/);
void dwarf_types_dealloc(Dwarf_Debug /*dbg*/,
    Dwarf_Type*      /*types*/,
    Dwarf_Signed     /*number_of_types*/);


int dwarf_typename(Dwarf_Type /*type*/,
    char   **        /*returned_name*/,
    Dwarf_Error*     /*error*/);

int dwarf_type_die_offset(Dwarf_Type /*type*/,
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

int dwarf_type_cu_offset(Dwarf_Type /*type*/,
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

int dwarf_type_name_offsets(Dwarf_Type    /*type*/,
    char   **        /*returned_name*/,
    Dwarf_Off*       /*die_offset*/,
    Dwarf_Off*       /*cu_offset*/,
    Dwarf_Error*     /*error*/);

/* User-defined type name operations, DWARF3  .debug_pubtypes section. 
*/
int dwarf_get_pubtypes(Dwarf_Debug    /*dbg*/,
    Dwarf_Type**     /*types*/,
    Dwarf_Signed *   /*number_of_types*/,
    Dwarf_Error*     /*error*/);
void dwarf_pubtypes_dealloc(Dwarf_Debug /*dbg*/,
    Dwarf_Type*      /*pubtypes*/,
    Dwarf_Signed     /*number_of_pubtypes*/);


int dwarf_pubtypename(Dwarf_Type /*type*/,
    char   **        /*returned_name*/,
    Dwarf_Error*     /*error*/);

int dwarf_pubtype_die_offset(Dwarf_Type /*type*/,
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

int dwarf_pubtype_cu_offset(Dwarf_Type /*type*/,
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

int dwarf_pubtype_name_offsets(Dwarf_Type    /*type*/,
    char   **        /*returned_name*/,
    Dwarf_Off*       /*die_offset*/,
    Dwarf_Off*       /*cu_offset*/,
    Dwarf_Error*     /*error*/);

/* File-scope static variable name operations.  */
int dwarf_get_vars(Dwarf_Debug    /*dbg*/,
    Dwarf_Var**      /*vars*/,
    Dwarf_Signed *   /*number_of_vars*/,
    Dwarf_Error*     /*error*/);
void dwarf_vars_dealloc(Dwarf_Debug /*dbg*/,
    Dwarf_Var*       /*vars*/,
    Dwarf_Signed     /*number_of_vars*/);


int dwarf_varname(Dwarf_Var /*var*/,
    char   **        /*returned_name*/,
    Dwarf_Error*     /*error*/);

int dwarf_var_die_offset(Dwarf_Var /*var*/,
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

int dwarf_var_cu_offset(Dwarf_Var /*var*/,
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

int dwarf_var_name_offsets(Dwarf_Var /*var*/,
    char   **        /*returned_name*/,
    Dwarf_Off*       /*die_offset*/,
    Dwarf_Off*       /*cu_offset*/,
    Dwarf_Error*     /*error*/);

/* weak name operations.  */
int dwarf_get_weaks(Dwarf_Debug    /*dbg*/,
    Dwarf_Weak**     /*weaks*/,
    Dwarf_Signed *   /*number_of_weaks*/,
    Dwarf_Error*     /*error*/);
void dwarf_weaks_dealloc(Dwarf_Debug /*dbg*/,
    Dwarf_Weak*      /*weaks*/,
    Dwarf_Signed     /*number_of_weaks*/);


int dwarf_weakname(Dwarf_Weak /*weak*/,
    char   **        /*returned_name*/,
    Dwarf_Error*     /*error*/);

int dwarf_weak_die_offset(Dwarf_Weak /*weak*/,
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

int dwarf_weak_cu_offset(Dwarf_Weak /*weak*/,
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

int dwarf_weak_name_offsets(Dwarf_Weak    /*weak*/,
    char   **        /*returned_name*/,
    Dwarf_Off*       /*die_offset*/,
    Dwarf_Off*       /*cu_offset*/,
    Dwarf_Error*     /*error*/);

/* location list section operation.  (.debug_loc access) */
int dwarf_get_loclist_entry(Dwarf_Debug /*dbg*/, 
    Dwarf_Unsigned   /*offset*/, 
    Dwarf_Addr*      /*hipc*/, 
    Dwarf_Addr*      /*lopc*/, 
    Dwarf_Ptr*       /*data*/, 
    Dwarf_Unsigned*  /*entry_len*/, 
    Dwarf_Unsigned*  /*next_entry*/, 
    Dwarf_Error*     /*error*/);

/* abbreviation section operations */
int dwarf_get_abbrev(Dwarf_Debug /*dbg*/, 
    Dwarf_Unsigned   /*offset*/, 
    Dwarf_Abbrev  *  /*returned_abbrev*/,
    Dwarf_Unsigned*  /*length*/, 
    Dwarf_Unsigned*  /*attr_count*/, 
    Dwarf_Error*     /*error*/);

int dwarf_get_abbrev_tag(Dwarf_Abbrev /*abbrev*/, 
    Dwarf_Half*      /*return_tag_number*/,
    Dwarf_Error*     /*error*/);
int dwarf_get_abbrev_code(Dwarf_Abbrev /*abbrev*/, 
    Dwarf_Unsigned*  /*return_code_number*/,
    Dwarf_Error*     /*error*/);
/* See comments in dwarf_abbrev.c. Not an entirely safe function. */
int dwarf_get_abbrev_count(Dwarf_Debug /*dbg*/);

int dwarf_get_abbrev_children_flag(Dwarf_Abbrev /*abbrev*/, 
    Dwarf_Signed*    /*return_flag*/,
    Dwarf_Error*     /*error*/);

int dwarf_get_abbrev_entry(Dwarf_Abbrev /*abbrev*/, 
    Dwarf_Signed     /*index*/, 
    Dwarf_Half  *    /*returned_attr_num*/,
    Dwarf_Signed*    /*form*/, 
    Dwarf_Off*       /*offset*/, 
    Dwarf_Error*     /*error*/);

/* consumer string section operation */
int dwarf_get_str(Dwarf_Debug /*dbg*/, 
    Dwarf_Off        /*offset*/, 
    char**           /*string*/, 
    Dwarf_Signed *   /*strlen_of_string*/,
    Dwarf_Error*     /*error*/);

/* Consumer op on  gnu .eh_frame info */
int dwarf_get_fde_list_eh(
    Dwarf_Debug      /*dbg*/,
    Dwarf_Cie**      /*cie_data*/,
    Dwarf_Signed*    /*cie_element_count*/,
    Dwarf_Fde**      /*fde_data*/,
    Dwarf_Signed*    /*fde_element_count*/,
    Dwarf_Error*     /*error*/);


/* consumer operations on frame info: .debug_frame */
int dwarf_get_fde_list(Dwarf_Debug /*dbg*/, 
    Dwarf_Cie**      /*cie_data*/, 
    Dwarf_Signed*    /*cie_element_count*/, 
    Dwarf_Fde**      /*fde_data*/, 
    Dwarf_Signed*    /*fde_element_count*/, 
    Dwarf_Error*     /*error*/);

/* Release storage gotten by dwarf_get_fde_list_eh() or
   dwarf_get_fde_list() */
void dwarf_fde_cie_list_dealloc(Dwarf_Debug dbg,
    Dwarf_Cie *cie_data,
    Dwarf_Signed cie_element_count,
    Dwarf_Fde *fde_data,
    Dwarf_Signed fde_element_count);



int dwarf_get_fde_range(Dwarf_Fde /*fde*/, 
    Dwarf_Addr*      /*low_pc*/, 
    Dwarf_Unsigned*  /*func_length*/, 
    Dwarf_Ptr*       /*fde_bytes*/, 
    Dwarf_Unsigned*  /*fde_byte_length*/, 
    Dwarf_Off*       /*cie_offset*/, 
    Dwarf_Signed*    /*cie_index*/, 
    Dwarf_Off*       /*fde_offset*/, 
    Dwarf_Error*     /*error*/);

/*  Useful for IRIX only:  see dwarf_get_cie_augmentation_data()
    dwarf_get_fde_augmentation_data() for GNU .eh_frame. */
int dwarf_get_fde_exception_info(Dwarf_Fde /*fde*/,
    Dwarf_Signed*    /* offset_into_exception_tables */,
    Dwarf_Error*     /*error*/);


int dwarf_get_cie_of_fde(Dwarf_Fde /*fde*/,
    Dwarf_Cie *      /*cie_returned*/,
    Dwarf_Error*     /*error*/);

int dwarf_get_cie_info(Dwarf_Cie /*cie*/, 
    Dwarf_Unsigned * /*bytes_in_cie*/,
    Dwarf_Small*     /*version*/, 
    char        **   /*augmenter*/,
    Dwarf_Unsigned*  /*code_alignment_factor*/, 
    Dwarf_Signed*    /*data_alignment_factor*/, 
    Dwarf_Half*      /*return_address_register_rule*/, 
    Dwarf_Ptr*       /*initial_instructions*/, 
    Dwarf_Unsigned*  /*initial_instructions_length*/, 
    Dwarf_Error*     /*error*/);

/* dwarf_get_cie_index new September 2009. */
int dwarf_get_cie_index(
    Dwarf_Cie /*cie*/,
    Dwarf_Signed* /*index*/, 
    Dwarf_Error* /*error*/ );


int dwarf_get_fde_instr_bytes(Dwarf_Fde /*fde*/, 
    Dwarf_Ptr *      /*outinstrs*/, Dwarf_Unsigned * /*outlen*/, 
    Dwarf_Error *    /*error*/);

int dwarf_get_fde_info_for_all_regs(Dwarf_Fde /*fde*/, 
    Dwarf_Addr       /*pc_requested*/,
    Dwarf_Regtable*  /*reg_table*/,
    Dwarf_Addr*      /*row_pc*/,
    Dwarf_Error*     /*error*/);

int dwarf_get_fde_info_for_all_regs3(Dwarf_Fde /*fde*/, 
    Dwarf_Addr       /*pc_requested*/,
    Dwarf_Regtable3* /*reg_table*/,
    Dwarf_Addr*      /*row_pc*/,
    Dwarf_Error*     /*error*/);

/* In this older interface DW_FRAME_CFA_COL is a meaningful
    column (which does not work well with DWARF3 or
    non-MIPS architectures). */
int dwarf_get_fde_info_for_reg(Dwarf_Fde /*fde*/, 
    Dwarf_Half       /*table_column*/, 
    Dwarf_Addr       /*pc_requested*/, 
    Dwarf_Signed*    /*offset_relevant*/,
    Dwarf_Signed*    /*register*/,  
    Dwarf_Signed*    /*offset*/, 
    Dwarf_Addr*      /*row_pc*/, 
    Dwarf_Error*     /*error*/);

/* See discussion of dw_value_type, libdwarf.h. 
   Use of DW_FRAME_CFA_COL is not meaningful in this interface.
   See dwarf_get_fde_info_for_cfa_reg3().
*/
/* dwarf_get_fde_info_for_reg3 is useful on a single column, but
   it is inefficient to iterate across all table_columns using this
   function.  Instead call dwarf_get_fde_info_for_all_regs3() and index
   into the table it fills in. */
int dwarf_get_fde_info_for_reg3(Dwarf_Fde /*fde*/, 
    Dwarf_Half       /*table_column*/, 
    Dwarf_Addr       /*pc_requested*/, 
    Dwarf_Small  *   /*value_type*/, 
    Dwarf_Signed *   /*offset_relevant*/,
    Dwarf_Signed*    /*register*/,  
    Dwarf_Signed*    /*offset_or_block_len*/, 
    Dwarf_Ptr   *    /*block_ptr */,
    Dwarf_Addr*      /*row_pc_out*/, 
    Dwarf_Error*     /*error*/);

/* Use this to get the cfa. */
int dwarf_get_fde_info_for_cfa_reg3(Dwarf_Fde /*fde*/, 
    Dwarf_Addr       /*pc_requested*/, 
    Dwarf_Small  *   /*value_type*/, 
    Dwarf_Signed *   /*offset_relevant*/,
    Dwarf_Signed*    /*register*/,  
    Dwarf_Signed*    /*offset_or_block_len*/, 
    Dwarf_Ptr   *    /*block_ptr */,
    Dwarf_Addr*      /*row_pc_out*/, 
    Dwarf_Error*     /*error*/);

int dwarf_get_fde_for_die(Dwarf_Debug /*dbg*/, 
    Dwarf_Die        /*subr_die */, 
    Dwarf_Fde  *     /*returned_fde*/,
    Dwarf_Error*     /*error*/);

int dwarf_get_fde_n(Dwarf_Fde* /*fde_data*/, 
    Dwarf_Unsigned   /*fde_index*/, 
    Dwarf_Fde  *     /*returned_fde*/,
    Dwarf_Error*     /*error*/);

int dwarf_get_fde_at_pc(Dwarf_Fde* /*fde_data*/, 
    Dwarf_Addr       /*pc_of_interest*/, 
    Dwarf_Fde  *     /*returned_fde*/,
    Dwarf_Addr*      /*lopc*/, 
    Dwarf_Addr*      /*hipc*/, 
    Dwarf_Error*     /*error*/);

/* GNU .eh_frame augmentation information, raw form, see
   Linux Standard Base Core Specification version 3.0 . */
int dwarf_get_cie_augmentation_data(Dwarf_Cie /* cie*/,
    Dwarf_Small **   /* augdata */,
    Dwarf_Unsigned * /* augdata_len */,
    Dwarf_Error*     /*error*/);
/* GNU .eh_frame augmentation information, raw form, see
   Linux Standard Base Core Specification version 3.0 . */
int dwarf_get_fde_augmentation_data(Dwarf_Fde /* fde*/,
    Dwarf_Small **   /* augdata */,
    Dwarf_Unsigned * /* augdata_len */,
    Dwarf_Error*     /*error*/);

int dwarf_expand_frame_instructions(Dwarf_Cie /*cie*/, 
    Dwarf_Ptr        /*instruction*/, 
    Dwarf_Unsigned   /*i_length*/, 
    Dwarf_Frame_Op** /*returned_op_list*/, 
    Dwarf_Signed*    /*op_count*/,
    Dwarf_Error*     /*error*/);

/* Operations on .debug_aranges. */
int dwarf_get_aranges(Dwarf_Debug /*dbg*/, 
    Dwarf_Arange**   /*aranges*/, 
    Dwarf_Signed *   /*arange_count*/,
    Dwarf_Error*     /*error*/);



int dwarf_get_arange(
    Dwarf_Arange*    /*aranges*/, 
    Dwarf_Unsigned   /*arange_count*/, 
    Dwarf_Addr       /*address*/, 
    Dwarf_Arange *   /*returned_arange*/,
    Dwarf_Error*     /*error*/);

int dwarf_get_cu_die_offset(
    Dwarf_Arange     /*arange*/, 
    Dwarf_Off*       /*return_offset*/,
    Dwarf_Error*     /*error*/);

int dwarf_get_arange_cu_header_offset(
    Dwarf_Arange     /*arange*/, 
    Dwarf_Off*       /*return_cu_header_offset*/,
    Dwarf_Error*     /*error*/);
#ifdef __sgi /* pragma is sgi MIPS only */
#pragma optional dwarf_get_arange_cu_header_offset
#endif

/* DWARF2,3 interface. No longer really adequate (it was never
   right for segmented address spaces, please switch
   to using dwarf_get_arange_info_b instead.  
   There is no effective difference between these
   functions  if the address space
   of the target is not segmented.  */
int dwarf_get_arange_info(
    Dwarf_Arange     /*arange*/, 
    Dwarf_Addr*      /*start*/, 
    Dwarf_Unsigned*  /*length*/, 
    Dwarf_Off*       /*cu_die_offset*/, 
    Dwarf_Error*     /*error*/ );

/* New for DWARF4, entries may have segment information. 
   *segment is only meaningful if *segment_entry_size is non-zero. */
int dwarf_get_arange_info_b(
    Dwarf_Arange     /*arange*/, 
    Dwarf_Unsigned*  /*segment*/, 
    Dwarf_Unsigned*  /*segment_entry_size*/, 
    Dwarf_Addr    *  /*start*/, 
    Dwarf_Unsigned*  /*length*/, 
    Dwarf_Off     *  /*cu_die_offset*/, 
    Dwarf_Error   *  /*error*/ );


/* consumer .debug_macinfo information interface.
*/
struct Dwarf_Macro_Details_s {
    Dwarf_Off    dmd_offset; /* offset, in the section,
        of this macro info */
    Dwarf_Small  dmd_type;   /* the type, DW_MACINFO_define etc*/
    Dwarf_Signed dmd_lineno; /* the source line number where
        applicable and vend_def number if
        vendor_extension op */

    Dwarf_Signed dmd_fileindex;/* the source file index:
        applies to define undef start_file */
    char *       dmd_macro;  /* macro name (with value for defineop)
        string from vendor ext */
};

/*  dwarf_print_lines is for use by dwarfdump: it prints
    line info to stdout.
    The _dwarf name is obsolete. Use dwarf_ instead.
    Added extra argnument 2/2009 for better checking.
*/
int _dwarf_print_lines(Dwarf_Die /*cu_die*/,Dwarf_Error * /*error*/);
int dwarf_print_lines(Dwarf_Die /*cu_die*/,Dwarf_Error * /*error*/,
   int * /*error_count_out */);

/*  dwarf_check_lineheader lets dwarfdump get detailed messages
    about some compiler errors we detect.
    We return the count of detected errors through the
    pointer.
*/
void dwarf_check_lineheader(Dwarf_Die /*cu_die*/,int *errcount_out);

/*  dwarf_ld_sort_lines helps SGI IRIX ld 
    rearrange lines in .debug_line in a .o created with a text
    section per function.  
        -OPT:procedure_reorder=ON
    where ld-cord (cord(1)ing by ld, 
    not by cord(1)) may have changed the function order.
    The _dwarf name is obsolete. Use dwarf_ instead.
*/
int _dwarf_ld_sort_lines(
    void *         /*orig_buffer*/,
    unsigned long  /* buffer_len*/,
    int            /*is_64_bit*/,
    int *          /*any_change*/,
    int *          /*err_code*/);
int dwarf_ld_sort_lines(
    void *         /*orig_buffer*/,
    unsigned long  /*buffer_len*/,
    int            /*is_64_bit*/,
    int *          /*any_change*/,
    int *          /*err_code*/);

/* Used by dwarfdump -v to print fde offsets from debugging
   info.
   The _dwarf name is obsolete. Use dwarf_ instead.
*/
int _dwarf_fde_section_offset(Dwarf_Debug dbg,
    Dwarf_Fde         /*in_fde*/,
    Dwarf_Off *       /*fde_off*/, 
    Dwarf_Off *       /*cie_off*/,
    Dwarf_Error *     /*err*/);
int dwarf_fde_section_offset(Dwarf_Debug dbg,
    Dwarf_Fde         /*in_fde*/,
    Dwarf_Off *       /*fde_off*/, 
    Dwarf_Off *       /*cie_off*/,
    Dwarf_Error *     /*err*/);

/* Used by dwarfdump -v to print cie offsets from debugging
   info.
   The _dwarf name is obsolete. Use dwarf_ instead.
*/
int dwarf_cie_section_offset(Dwarf_Debug /*dbg*/,
    Dwarf_Cie     /*in_cie*/,
    Dwarf_Off *   /*cie_off */,
    Dwarf_Error * /*err*/);
int _dwarf_cie_section_offset(Dwarf_Debug /*dbg*/,
    Dwarf_Cie     /*in_cie*/,
    Dwarf_Off *   /*cie_off*/,
    Dwarf_Error * /*err*/);

typedef struct Dwarf_Macro_Details_s Dwarf_Macro_Details;

int dwarf_get_macro(Dwarf_Debug /*dbg*/,
    char *        /*requested_macro_name*/,
    Dwarf_Addr    /*pc_of_request*/,
    char **       /*returned_macro_value*/,
    Dwarf_Error * /*error*/);

int dwarf_get_all_defined_macros(Dwarf_Debug /*dbg*/,
    Dwarf_Addr     /*pc_of_request*/,
    Dwarf_Signed * /*returned_count*/,
    char ***       /*returned_pointers_to_macros*/,
    Dwarf_Error *  /*error*/);

char *dwarf_find_macro_value_start(char * /*macro_string*/);

int dwarf_get_macro_details(Dwarf_Debug /*dbg*/,
    Dwarf_Off            /*macro_offset*/,
    Dwarf_Unsigned       /*maximum_count*/,
    Dwarf_Signed         * /*entry_count*/,
    Dwarf_Macro_Details ** /*details*/,
    Dwarf_Error *        /*err*/);


int dwarf_get_address_size(Dwarf_Debug /*dbg*/,
    Dwarf_Half  *    /*addr_size*/,
    Dwarf_Error *    /*error*/);
int dwarf_get_die_address_size(Dwarf_Die /*die*/,
    Dwarf_Half  *    /*addr_size*/,
    Dwarf_Error *    /*error*/);

/* The dwarf specification separates FORMs into
different classes.  To do the seperation properly
requires 4 pieces of data as of DWARF4 (thus the
function arguments listed here). 
The DWARF4 specification class definition suffices to
describe all DWARF versions.
See section 7.5.4, Attribute Encodings.
A return of DW_FORM_CLASS_UNKNOWN means we could not properly figure
out what form-class it is.

    DW_FORM_CLASS_FRAMEPTR is MIPS/IRIX only, and refers
    to the DW_AT_MIPS_fde attribute (a reference to the
    .debug_frame section).
*/
enum Dwarf_Form_Class {
    DW_FORM_CLASS_UNKNOWN,   DW_FORM_CLASS_ADDRESS,
    DW_FORM_CLASS_BLOCK,     DW_FORM_CLASS_CONSTANT, 
    DW_FORM_CLASS_EXPRLOC,   DW_FORM_CLASS_FLAG, 
    DW_FORM_CLASS_LINEPTR,   DW_FORM_CLASS_LOCLISTPTR, 
    DW_FORM_CLASS_MACPTR,    DW_FORM_CLASS_RANGELISTPTR, 
    DW_FORM_CLASS_REFERENCE, DW_FORM_CLASS_STRING,
    DW_FORM_CLASS_FRAMEPTR
};

enum Dwarf_Form_Class dwarf_get_form_class(
    Dwarf_Half /* dwversion */,
    Dwarf_Half /* attrnum */, 
    Dwarf_Half /*offset_size */, 
    Dwarf_Half /*form*/);

/*  Utility operations */
Dwarf_Unsigned dwarf_errno(Dwarf_Error     /*error*/);

char* dwarf_errmsg(Dwarf_Error    /*error*/);

/*  stringcheck zero is default and means do all
    string length validity checks.
    Call with parameter value 1 to turn off many such checks (and
    increase performance).
    Call with zero for safest running.
    Actual value saved and returned is only 8 bits! Upper bits
    ignored by libdwarf (and zero on return).
    Returns previous value.  */
int dwarf_set_stringcheck(int /*stringcheck*/);

/*  'apply' defaults to 1 and means do all
    'rela' relocations on reading in a dwarf object section with
    such relocations.
    Call with parameter value 0 to turn off application of 
    such relocations.
    Since the static linker leaves 'bogus' data in object sections
    with a 'rela' relocation section such data cannot be read
    sensibly without processing the relocations.  Such relocations
    do not exist in executables and shared objects (.so), the
    relocations only exist in plain .o relocatable object files.
    Actual value saved and returned is only 8 bits! Upper bits
    ignored by libdwarf (and zero on return).
    Returns previous value.  */
int dwarf_set_reloc_application(int /*apply*/);


/* Unimplemented */
Dwarf_Handler dwarf_seterrhand(Dwarf_Debug /*dbg*/, Dwarf_Handler /*errhand*/);

/* Unimplemented */
Dwarf_Ptr dwarf_seterrarg(Dwarf_Debug /*dbg*/, Dwarf_Ptr /*errarg*/);

void dwarf_dealloc(Dwarf_Debug /*dbg*/, void* /*space*/, 
    Dwarf_Unsigned /*type*/);


/* DWARF Producer Interface */

/* New form June, 2011. Adds user_data argument.  */
typedef int (*Dwarf_Callback_Func_c)(
    char*           /*name*/,
    int             /*size*/,
    Dwarf_Unsigned  /*type*/,
    Dwarf_Unsigned  /*flags*/,
    Dwarf_Unsigned  /*link*/,
    Dwarf_Unsigned  /*info*/,
    Dwarf_Unsigned* /*sect_name_index*/,
    void *          /*user_data*/,
    int*            /*error*/);

/* New form June, 2011. Adds user_data */
Dwarf_P_Debug dwarf_producer_init_c(
    Dwarf_Unsigned        /*flags*/,
    Dwarf_Callback_Func_c /*func*/,
    Dwarf_Handler         /*errhand*/,
    Dwarf_Ptr             /*errarg*/,
    void *                /*user_data*/,
    Dwarf_Error *         /*error*/);

typedef int (*Dwarf_Callback_Func_b)(
    char*           /*name*/,
    int             /*size*/,
    Dwarf_Unsigned  /*type*/,
    Dwarf_Unsigned  /*flags*/,
    Dwarf_Unsigned  /*link*/,
    Dwarf_Unsigned  /*info*/,
    Dwarf_Unsigned* /*sect_name_index*/,
    int*            /*error*/);

/* Intermediate form. Made obsolescent by dwarf_producer_init_c, 
   but supported. */
Dwarf_P_Debug dwarf_producer_init_b(
    Dwarf_Unsigned        /*flags*/,
    Dwarf_Callback_Func_b /*func*/,
    Dwarf_Handler         /*errhand*/,
    Dwarf_Ptr             /*errarg*/,
    Dwarf_Error *         /*error*/);

/* Original, oldest form. From 1991. */
typedef int (*Dwarf_Callback_Func)(
    char*           /*name*/,
    int             /*size*/,
    Dwarf_Unsigned  /*type*/,
    Dwarf_Unsigned  /*flags*/,
    Dwarf_Unsigned  /*link*/,
    Dwarf_Unsigned  /*info*/,
    int*            /*sect name index*/,
    int*            /*error*/);

/* Original, oldest form. From 1991. */
Dwarf_P_Debug dwarf_producer_init(
    Dwarf_Unsigned  /*creation_flags*/,
    Dwarf_Callback_Func    /*func*/,
    Dwarf_Handler   /*errhand*/,
    Dwarf_Ptr       /*errarg*/,
    Dwarf_Error*    /*error*/);

Dwarf_Signed dwarf_transform_to_disk_form(Dwarf_P_Debug /*dbg*/,
    Dwarf_Error*     /*error*/);

Dwarf_Ptr dwarf_get_section_bytes(Dwarf_P_Debug /*dbg*/, 
    Dwarf_Signed     /*dwarf_section*/,
    Dwarf_Signed*    /*elf_section_index*/, 
    Dwarf_Unsigned*  /*length*/, 
    Dwarf_Error*     /*error*/);

int  dwarf_get_relocation_info_count(
    Dwarf_P_Debug    /*dbg*/,
    Dwarf_Unsigned * /*count_of_relocation_sections*/,
    int *                /*drd_buffer_version*/,
    Dwarf_Error*     /*error*/);

int dwarf_get_relocation_info(
    Dwarf_P_Debug           /*dbg*/,
    Dwarf_Signed          * /*elf_section_index*/,
    Dwarf_Signed          * /*elf_section_index_link*/,
    Dwarf_Unsigned        * /*relocation_buffer_count*/,
    Dwarf_Relocation_Data * /*reldata_buffer*/,
    Dwarf_Error*            /*error*/);

/* v1:  no drd_length field, enum explicit */
/* v2:  has the drd_length field, enum value in uchar member */
#define DWARF_DRD_BUFFER_VERSION 2

/* Markers are not written  to DWARF2/3/4, they are user
   defined and may be used for any purpose.
*/
Dwarf_Signed dwarf_get_die_markers(
    Dwarf_P_Debug     /*dbg*/,
    Dwarf_P_Marker *  /*marker_list*/,
    Dwarf_Unsigned *  /*marker_count*/,
    Dwarf_Error *     /*error*/);

int dwarf_get_string_attributes_count(Dwarf_P_Debug,
    Dwarf_Unsigned *,
    int *,
    Dwarf_Error *);

int dwarf_get_string_attributes_info(Dwarf_P_Debug, 
    Dwarf_Signed *,
    Dwarf_Unsigned *,
    Dwarf_P_String_Attr *,
    Dwarf_Error *);

void dwarf_reset_section_bytes(Dwarf_P_Debug /*dbg*/);

Dwarf_Unsigned dwarf_producer_finish(Dwarf_P_Debug /*dbg*/, 
    Dwarf_Error* /*error*/);

/* Producer attribute addition functions. */
Dwarf_P_Attribute dwarf_add_AT_targ_address(Dwarf_P_Debug /*dbg*/, 
    Dwarf_P_Die     /*ownerdie*/, 
    Dwarf_Half      /*attr*/, 
    Dwarf_Unsigned  /*pc_value*/, 
    Dwarf_Signed    /*sym_index*/, 
    Dwarf_Error*    /*error*/);

Dwarf_P_Attribute dwarf_add_AT_block(Dwarf_P_Debug /*dbg*/, 
    Dwarf_P_Die     /*ownerdie*/, 
    Dwarf_Half      /*attr*/, 
    Dwarf_Small*    /*block_data*/,
    Dwarf_Unsigned  /*block_len*/,
    Dwarf_Error*    /*error*/);

Dwarf_P_Attribute dwarf_add_AT_targ_address_b(Dwarf_P_Debug /*dbg*/, 
    Dwarf_P_Die     /*ownerdie*/, 
    Dwarf_Half      /*attr*/, 
    Dwarf_Unsigned  /*pc_value*/, 
    Dwarf_Unsigned  /*sym_index*/, 
    Dwarf_Error*    /*error*/);

Dwarf_P_Attribute dwarf_add_AT_ref_address(Dwarf_P_Debug /*dbg*/, 
    Dwarf_P_Die     /*ownerdie*/, 
    Dwarf_Half      /*attr*/, 
    Dwarf_Unsigned  /*pc_value*/, 
    Dwarf_Unsigned  /*sym_index*/, 
    Dwarf_Error*    /*error*/);

Dwarf_P_Attribute dwarf_add_AT_unsigned_const(Dwarf_P_Debug /*dbg*/, 
    Dwarf_P_Die     /*ownerdie*/, 
    Dwarf_Half      /*attr*/, 
    Dwarf_Unsigned  /*value*/, 
    Dwarf_Error*    /*error*/);

Dwarf_P_Attribute dwarf_add_AT_signed_const(Dwarf_P_Debug /*dbg*/, 
    Dwarf_P_Die     /*ownerdie*/, 
    Dwarf_Half      /*attr*/, 
    Dwarf_Signed    /*value*/, 
    Dwarf_Error*    /*error*/);

Dwarf_P_Attribute dwarf_add_AT_reference(Dwarf_P_Debug /*dbg*/, 
    Dwarf_P_Die     /*ownerdie*/, 
    Dwarf_Half      /*attr*/, 
    Dwarf_P_Die     /*otherdie*/, 
    Dwarf_Error*    /*error*/);

Dwarf_P_Attribute dwarf_add_AT_dataref(
    Dwarf_P_Debug   /* dbg*/,
    Dwarf_P_Die     /*ownerdie*/, 
    Dwarf_Half      /*attr*/,
    Dwarf_Unsigned  /*pcvalue*/,
    Dwarf_Unsigned  /*sym_index*/,
    Dwarf_Error*    /*error*/);

Dwarf_P_Attribute dwarf_add_AT_const_value_string(Dwarf_P_Die /*ownerdie*/, 
    char*           /*string_value*/, 
    Dwarf_Error*    /*error*/);

Dwarf_P_Attribute dwarf_add_AT_location_expr(Dwarf_P_Debug /*dbg*/, 
    Dwarf_P_Die     /*ownerdie*/, 
    Dwarf_Half      /*attr*/, 
    Dwarf_P_Expr    /*loc_expr*/, 
    Dwarf_Error*    /*error*/);

Dwarf_P_Attribute dwarf_add_AT_string(Dwarf_P_Debug /*dbg*/, 
    Dwarf_P_Die     /*ownerdie*/, 
    Dwarf_Half      /*attr*/, 
    char*           /*string*/, 
    Dwarf_Error*     /*error*/);

Dwarf_P_Attribute dwarf_add_AT_flag(Dwarf_P_Debug /*dbg*/, 
    Dwarf_P_Die     /*ownerdie*/, 
    Dwarf_Half      /*attr*/, 
    Dwarf_Small     /*flag*/, 
    Dwarf_Error*    /*error*/);

Dwarf_P_Attribute dwarf_add_AT_producer(Dwarf_P_Die /*ownerdie*/, 
    char*           /*producer_string*/, 
    Dwarf_Error*    /*error*/);

Dwarf_P_Attribute dwarf_add_AT_const_value_signedint(Dwarf_P_Die /*ownerdie*/, 
    Dwarf_Signed    /*signed_value*/, 
    Dwarf_Error*    /*error*/);

Dwarf_P_Attribute dwarf_add_AT_const_value_unsignedint(
    Dwarf_P_Die     /*ownerdie*/, 
    Dwarf_Unsigned  /*unsigned_value*/, 
    Dwarf_Error*    /*error*/);

Dwarf_P_Attribute dwarf_add_AT_comp_dir(Dwarf_P_Die /*ownerdie*/, 
    char*           /*current_working_directory*/, 
    Dwarf_Error*    /*error*/);

Dwarf_P_Attribute dwarf_add_AT_name(Dwarf_P_Die    /*die*/,
    char*           /*name*/,
    Dwarf_Error*    /*error*/);

/* Producer line creation functions (.debug_line) */
Dwarf_Unsigned dwarf_add_directory_decl(Dwarf_P_Debug /*dbg*/, 
    char*           /*name*/, 
    Dwarf_Error*    /*error*/);

Dwarf_Unsigned dwarf_add_file_decl(Dwarf_P_Debug /*dbg*/, 
    char*           /*name*/,
    Dwarf_Unsigned  /*dir_index*/, 
    Dwarf_Unsigned  /*time_last_modified*/, 
    Dwarf_Unsigned  /*length*/, 
    Dwarf_Error*    /*error*/);

Dwarf_Unsigned dwarf_add_line_entry_b(Dwarf_P_Debug /*dbg*/, 
    Dwarf_Unsigned  /*file_index*/, 
    Dwarf_Addr      /*code_address*/, 
    Dwarf_Unsigned  /*lineno*/, 
    Dwarf_Signed    /*column_number*/, 
    Dwarf_Bool      /*is_source_stmt_begin*/, 
    Dwarf_Bool      /*is_basic_block_begin*/, 
    Dwarf_Bool      /*is_epilogue_begin*/, 
    Dwarf_Bool      /*is_prologue_end*/, 
    Dwarf_Unsigned  /*isa*/,
    Dwarf_Unsigned  /*discriminator*/,
    Dwarf_Error*    /*error*/);
Dwarf_Unsigned dwarf_add_line_entry(Dwarf_P_Debug /*dbg*/, 
    Dwarf_Unsigned  /*file_index*/, 
    Dwarf_Addr      /*code_address*/, 
    Dwarf_Unsigned  /*lineno*/, 
    Dwarf_Signed    /*column_number*/, 
    Dwarf_Bool      /*is_source_stmt_begin*/, 
    Dwarf_Bool      /*is_basic_block_begin*/, 
    Dwarf_Error*    /*error*/);

Dwarf_Unsigned dwarf_lne_set_address(Dwarf_P_Debug /*dbg*/, 
    Dwarf_Unsigned  /*offset*/, 
    Dwarf_Unsigned  /*symbol_index*/, 
    Dwarf_Error*    /*error*/);

Dwarf_Unsigned dwarf_lne_end_sequence(Dwarf_P_Debug /*dbg*/, 
    Dwarf_Addr      /*end_address*/,
    Dwarf_Error*    /*error*/);

/* Producer .debug_frame functions */
Dwarf_Unsigned dwarf_add_frame_cie(Dwarf_P_Debug /*dbg*/, 
    char*           /*augmenter*/, 
    Dwarf_Small     /*code_alignment_factor*/, 
    Dwarf_Small     /*data_alignment_factor*/, 
    Dwarf_Small     /*return_address_reg*/, 
    Dwarf_Ptr       /*initialization_bytes*/, 
    Dwarf_Unsigned  /*init_byte_len*/, 
    Dwarf_Error*    /*error*/);

Dwarf_Unsigned dwarf_add_frame_fde( 
    Dwarf_P_Debug   /*dbg*/,
    Dwarf_P_Fde     /*fde*/, 
    Dwarf_P_Die     /*corresponding subprogram die*/,
    Dwarf_Unsigned  /*cie_to_use*/, 
    Dwarf_Unsigned  /*virt_addr_of_described_code*/, 
    Dwarf_Unsigned  /*length_of_code*/, 
    Dwarf_Unsigned  /*symbol_index*/, 
    Dwarf_Error*    /*error*/);

Dwarf_Unsigned dwarf_add_frame_fde_b(
    Dwarf_P_Debug  /*dbg*/,
    Dwarf_P_Fde    /*fde*/,
    Dwarf_P_Die    /*die*/,
    Dwarf_Unsigned /*cie*/,
    Dwarf_Addr     /*virt_addr*/,
    Dwarf_Unsigned /*code_len*/,
    Dwarf_Unsigned /*sym_idx*/,
    Dwarf_Unsigned /*sym_idx_of_end*/,
    Dwarf_Addr     /*offset_from_end_sym*/,
    Dwarf_Error*   /*error*/);

Dwarf_Unsigned dwarf_add_frame_info_b( 
    Dwarf_P_Debug dbg   /*dbg*/,
    Dwarf_P_Fde     /*fde*/,
    Dwarf_P_Die     /*die*/,
    Dwarf_Unsigned  /*cie*/,
    Dwarf_Addr      /*virt_addr*/,
    Dwarf_Unsigned  /*code_len*/,
    Dwarf_Unsigned  /*symidx*/,
    Dwarf_Unsigned  /*end_symbol */,
    Dwarf_Addr      /*offset_from_end_symbol */,
    Dwarf_Signed    /*offset_into_exception_tables*/,
    Dwarf_Unsigned  /*exception_table_symbol*/,
    Dwarf_Error*    /*error*/);

Dwarf_Unsigned dwarf_add_frame_info( 
    Dwarf_P_Debug dbg   /*dbg*/,
    Dwarf_P_Fde     /*fde*/,
    Dwarf_P_Die     /*die*/,
    Dwarf_Unsigned  /*cie*/,
    Dwarf_Addr      /*virt_addr*/,
    Dwarf_Unsigned  /*code_len*/,
    Dwarf_Unsigned  /*symidx*/,
    Dwarf_Signed    /*offset_into_exception_tables*/,
    Dwarf_Unsigned  /*exception_table_symbol*/,
    Dwarf_Error*    /*error*/);

Dwarf_P_Fde dwarf_add_fde_inst(
    Dwarf_P_Fde     /*fde*/,
    Dwarf_Small     /*op*/, 
    Dwarf_Unsigned  /*val1*/, 
    Dwarf_Unsigned  /*val2*/, 
    Dwarf_Error*    /*error*/);

/* New September 17, 2009 */
int dwarf_insert_fde_inst_bytes(
    Dwarf_P_Debug  /*dbg*/,
    Dwarf_P_Fde    /*fde*/,
    Dwarf_Unsigned /*len*/, 
    Dwarf_Ptr      /*ibytes*/,
    Dwarf_Error*   /*error*/);


Dwarf_P_Fde dwarf_new_fde(Dwarf_P_Debug    /*dbg*/, Dwarf_Error* /*error*/);

Dwarf_P_Fde dwarf_fde_cfa_offset(
    Dwarf_P_Fde     /*fde*/, 
    Dwarf_Unsigned  /*register_number*/, 
    Dwarf_Signed    /*offset*/, 
    Dwarf_Error*    /*error*/);

/* die creation & addition routines */
Dwarf_P_Die dwarf_new_die(
    Dwarf_P_Debug    /*dbg*/,
    Dwarf_Tag         /*tag*/,
    Dwarf_P_Die     /*parent*/, 
    Dwarf_P_Die     /*child*/, 
    Dwarf_P_Die     /*left */,
    Dwarf_P_Die     /*right*/,
    Dwarf_Error*    /*error*/);

Dwarf_Unsigned dwarf_add_die_to_debug(
    Dwarf_P_Debug   /*dbg*/,
    Dwarf_P_Die     /*die*/,
    Dwarf_Error*    /*error*/);

/* Markers are not written  to DWARF2/3/4, they are user
   defined and may be used for any purpose.
*/
Dwarf_Unsigned dwarf_add_die_marker(
    Dwarf_P_Debug   /*dbg*/,
    Dwarf_P_Die     /*die*/,
    Dwarf_Unsigned  /*marker*/,
    Dwarf_Error *   /*error*/);

Dwarf_Unsigned dwarf_get_die_marker(
    Dwarf_P_Debug   /*dbg*/,
    Dwarf_P_Die     /*die*/,
    Dwarf_Unsigned *  /*marker*/,
    Dwarf_Error *   /*error*/);

Dwarf_P_Die dwarf_die_link(
    Dwarf_P_Die     /*die*/,
    Dwarf_P_Die     /*parent*/,
    Dwarf_P_Die     /*child*/, 
    Dwarf_P_Die     /*left*/,
    Dwarf_P_Die     /*right*/, 
    Dwarf_Error*    /*error*/);

void dwarf_dealloc_compressed_block(
    Dwarf_P_Debug,
    void *
);

/*  Call this passing in return value from dwarf_uncompress_integer_block()
    to free the space the decompression allocated. */
void dwarf_dealloc_uncompressed_block(
    Dwarf_Debug,
    void *
);

void * dwarf_compress_integer_block(
    Dwarf_P_Debug,    /* dbg */
    Dwarf_Bool,       /* signed==true (or unsigned) */
    Dwarf_Small,      /* size of integer units: 8, 16, 32, 64 */
    void*,            /* data */
    Dwarf_Unsigned,   /* number of elements */
    Dwarf_Unsigned*,  /* number of bytes in output block */
    Dwarf_Error*      /* error */
);

/*  Decode an array of signed leb integers (so of course the
    array is not composed of fixed length values, but is instead
    a sequence of sleb values).
    Returns a DW_DLV_BADADDR on error.
    Otherwise returns a pointer to an array of 32bit integers.
    The signed argument must be non-zero (the decode
    assumes sleb integers in the input data) at this time.
    Size of integer units must be 32 (32 bits each) at this time.
    Number of bytes in block is a byte count (not array count).
    Returns number of units in output block (ie, number of elements
    of the array that the return value points to) thru the argument.  */
void * dwarf_uncompress_integer_block(
    Dwarf_Debug,      /* dbg */
    Dwarf_Bool,       /* signed==true (or unsigned) */
    Dwarf_Small,      /* size of integer units: 8, 16, 32, 64 */
    void*,            /* input data */
    Dwarf_Unsigned,   /* number of bytes in input */
    Dwarf_Unsigned*,  /* number of units in output block */
    Dwarf_Error*      /* error */
);

/* Operations to create location expressions. */
Dwarf_P_Expr dwarf_new_expr(Dwarf_P_Debug /*dbg*/, Dwarf_Error* /*error*/);

void dwarf_expr_reset(
    Dwarf_P_Expr      /*expr*/,
    Dwarf_Error*      /*error*/);

Dwarf_Unsigned dwarf_add_expr_gen(
    Dwarf_P_Expr      /*expr*/, 
    Dwarf_Small       /*opcode*/, 
    Dwarf_Unsigned    /*val1*/, 
    Dwarf_Unsigned    /*val2*/, 
    Dwarf_Error*      /*error*/);

Dwarf_Unsigned dwarf_add_expr_addr(
    Dwarf_P_Expr      /*expr*/, 
    Dwarf_Unsigned    /*addr*/, 
    Dwarf_Signed      /*sym_index*/, 
    Dwarf_Error*      /*error*/);

Dwarf_Unsigned dwarf_add_expr_addr_b(
    Dwarf_P_Expr      /*expr*/,
    Dwarf_Unsigned    /*addr*/,
    Dwarf_Unsigned    /*sym_index*/,
    Dwarf_Error*      /*error*/);

Dwarf_Unsigned dwarf_expr_current_offset(
    Dwarf_P_Expr      /*expr*/, 
    Dwarf_Error*      /*error*/);

Dwarf_Addr dwarf_expr_into_block(
    Dwarf_P_Expr      /*expr*/, 
    Dwarf_Unsigned*   /*length*/, 
    Dwarf_Error*      /*error*/);

Dwarf_Unsigned dwarf_add_arange(Dwarf_P_Debug /*dbg*/, 
    Dwarf_Addr        /*begin_address*/, 
    Dwarf_Unsigned    /*length*/, 
    Dwarf_Signed      /*symbol_index*/, 
    Dwarf_Error*      /*error*/);

Dwarf_Unsigned dwarf_add_arange_b(
    Dwarf_P_Debug  /*dbg*/,
    Dwarf_Addr     /*begin_address*/,
    Dwarf_Unsigned /*length*/,
    Dwarf_Unsigned /*symbol_index*/,
    Dwarf_Unsigned /*end_symbol_index*/,
    Dwarf_Addr     /*offset_from_end_symbol*/,
    Dwarf_Error *  /*error*/);

Dwarf_Unsigned dwarf_add_pubname(
    Dwarf_P_Debug      /*dbg*/, 
    Dwarf_P_Die        /*die*/, 
    char*              /*pubname_name*/, 
    Dwarf_Error*       /*error*/);

Dwarf_Unsigned dwarf_add_funcname(
    Dwarf_P_Debug      /*dbg*/, 
    Dwarf_P_Die        /*die*/, 
    char*              /*func_name*/, 
    Dwarf_Error*       /*error*/);

Dwarf_Unsigned dwarf_add_typename(
    Dwarf_P_Debug     /*dbg*/, 
    Dwarf_P_Die       /*die*/, 
    char*             /*type_name*/, 
    Dwarf_Error*      /*error*/);

Dwarf_Unsigned dwarf_add_varname(
    Dwarf_P_Debug     /*dbg*/, 
    Dwarf_P_Die       /*die*/, 
    char*             /*var_name*/, 
    Dwarf_Error*      /*error*/);

Dwarf_Unsigned dwarf_add_weakname(
    Dwarf_P_Debug    /*dbg*/, 
    Dwarf_P_Die      /*die*/, 
    char*            /*weak_name*/, 
    Dwarf_Error*     /*error*/);

/*  .debug_macinfo producer functions
    Functions must be called in right order: the section is output
    In the order these are presented.
*/
int dwarf_def_macro(Dwarf_P_Debug /*dbg*/,
    Dwarf_Unsigned   /*line*/,
    char *           /*macname, with (arglist), no space before (*/, 
    char *           /*macvalue*/,
    Dwarf_Error*     /*error*/);

int dwarf_undef_macro(Dwarf_P_Debug /*dbg*/,
    Dwarf_Unsigned   /*line*/,
    char *           /*macname, no arglist, of course*/,
    Dwarf_Error*     /*error*/);

int dwarf_start_macro_file(Dwarf_P_Debug /*dbg*/,
    Dwarf_Unsigned   /*fileindex*/,
    Dwarf_Unsigned   /*linenumber*/,
    Dwarf_Error*     /*error*/);

int dwarf_end_macro_file(Dwarf_P_Debug /*dbg*/,
    Dwarf_Error*     /*error*/);

int dwarf_vendor_ext(Dwarf_P_Debug /*dbg*/,
    Dwarf_Unsigned   /*constant*/,
    char *           /*string*/,
    Dwarf_Error*     /*error*/);

/* end macinfo producer functions */

int dwarf_attr_offset(Dwarf_Die /*die*/,
    Dwarf_Attribute /*attr of above die*/,
    Dwarf_Off     * /*returns offset thru this ptr */,
    Dwarf_Error   * /*error*/);

/*  This is a hack so clients can verify offsets.
    Added April 2005 so that debugger can detect broken offsets
    (which happened in an IRIX executable larger than 2GB
    with MIPSpro 7.3.1.3 toolchain.).
*/
int
dwarf_get_section_max_offsets(Dwarf_Debug /*dbg*/,
    Dwarf_Unsigned * /*debug_info_size*/,
    Dwarf_Unsigned * /*debug_abbrev_size*/,
    Dwarf_Unsigned * /*debug_line_size*/,
    Dwarf_Unsigned * /*debug_loc_size*/,
    Dwarf_Unsigned * /*debug_aranges_size*/,
    Dwarf_Unsigned * /*debug_macinfo_size*/,
    Dwarf_Unsigned * /*debug_pubnames_size*/,
    Dwarf_Unsigned * /*debug_str_size*/,
    Dwarf_Unsigned * /*debug_frame_size*/,
    Dwarf_Unsigned * /*debug_ranges_size*/,
    Dwarf_Unsigned * /*debug_pubtypes_size*/);

/*  New October 2011., adds .debug_types section to the sizes
    returned. */
int
dwarf_get_section_max_offsets_b(Dwarf_Debug /*dbg*/,

    Dwarf_Unsigned * /*debug_info_size*/,
    Dwarf_Unsigned * /*debug_abbrev_size*/,
    Dwarf_Unsigned * /*debug_line_size*/,
    Dwarf_Unsigned * /*debug_loc_size*/,
    Dwarf_Unsigned * /*debug_aranges_size*/,
    Dwarf_Unsigned * /*debug_macinfo_size*/,
    Dwarf_Unsigned * /*debug_pubnames_size*/,
    Dwarf_Unsigned * /*debug_str_size*/,
    Dwarf_Unsigned * /*debug_frame_size*/,
    Dwarf_Unsigned * /*debug_ranges_size*/,
    Dwarf_Unsigned * /*debug_pubtypes_size*/,
    Dwarf_Unsigned * /*debug_types_size*/);

/*  The 'set' calls here return the original (before any change
    by these set routines) of the respective fields. */
/*  Multiple releases spelled 'initial' as 'inital' . 
    The 'inital' spelling should not be used. */ 
Dwarf_Half dwarf_set_frame_rule_inital_value(Dwarf_Debug /*dbg*/,
    Dwarf_Half /*value*/);
/*  Additional interface with correct 'initial' spelling. */
/*  It is likely you will want to call the following 6 functions
    before accessing any frame information.  All are useful
    to tailor handling of pseudo-registers needed to turn
    frame operation references into simpler forms and to
    reflect ABI specific data.  Of course altering libdwarf.h
    and dwarf.h allow the same capabilities, but such header changes
    do not let one change these values at runtime. */
Dwarf_Half dwarf_set_frame_rule_initial_value(Dwarf_Debug /*dbg*/,
    Dwarf_Half /*value*/);
Dwarf_Half dwarf_set_frame_rule_table_size(Dwarf_Debug /*dbg*/, 
    Dwarf_Half /*value*/);
Dwarf_Half dwarf_set_frame_cfa_value(Dwarf_Debug /*dbg*/, 
    Dwarf_Half /*value*/);
Dwarf_Half dwarf_set_frame_same_value(Dwarf_Debug /*dbg*/, 
    Dwarf_Half /*value*/);
Dwarf_Half dwarf_set_frame_undefined_value(Dwarf_Debug /*dbg*/, 
    Dwarf_Half /*value*/);
/*  dwarf_set_default_address_size only sets 'value' if value is 
    greater than zero. */
Dwarf_Small dwarf_set_default_address_size(Dwarf_Debug /*dbg*/, 
    Dwarf_Small /* value */);

/*  As of April 27, 2009, this version with no diepointer is
    obsolete though supported.  Use dwarf_get_ranges_a() instead. */
int dwarf_get_ranges(Dwarf_Debug /*dbg*/, 
    Dwarf_Off /*rangesoffset*/,
    Dwarf_Ranges ** /*rangesbuf*/,
    Dwarf_Signed * /*listlen*/,
    Dwarf_Unsigned * /*bytecount*/,
    Dwarf_Error * /*error*/);

/* This adds the address_size argument. New April 27, 2009 */
int dwarf_get_ranges_a(Dwarf_Debug /*dbg*/, 
    Dwarf_Off /*rangesoffset*/,
    Dwarf_Die  /* diepointer */,
    Dwarf_Ranges ** /*rangesbuf*/,
    Dwarf_Signed * /*listlen*/,
    Dwarf_Unsigned * /*bytecount*/,
    Dwarf_Error * /*error*/);

void dwarf_ranges_dealloc(Dwarf_Debug /*dbg*/, 
    Dwarf_Ranges * /*rangesbuf*/,
    Dwarf_Signed /*rangecount*/);

/* The harmless error list is a circular buffer of
   errors we note but which do not stop us from processing
   the object.  Created so dwarfdump or other tools
   can report such inconsequential errors without causing
   anything to stop early. */
#define DW_HARMLESS_ERROR_CIRCULAR_LIST_DEFAULT_SIZE 4
#define DW_HARMLESS_ERROR_MSG_STRING_SIZE   200
/* User code supplies size of array of pointers errmsg_ptrs_array
    in count and the array of pointers (the pointers themselves
    need not be initialized).
    The pointers returned in the array of pointers
    are invalidated by ANY call to libdwarf.
    Use them before making another libdwarf call!
    The array of string pointers passed in always has
    a final null pointer, so if there are N pointers the
    and M actual strings, then MIN(M,N-1) pointers are
    set to point to error strings.  The array of pointers
    to strings always terminates with a NULL pointer.
    If 'count' is passed in zero then errmsg_ptrs_array
    is not touched.

    The function returns DW_DLV_NO_ENTRY if no harmless errors 
    were noted so far.  Returns DW_DLV_OK if there are errors.
    Never returns DW_DLV_ERROR. 

    Each call empties the error list (discarding all current entries).
    If newerr_count is non-NULL the count of harmless errors
    since the last call is returned through the pointer
    (some may have been discarded or not returned, it is a circular
    list...).
    If DW_DLV_NO_ENTRY is returned none of the arguments
    here are touched or used.
    */
int dwarf_get_harmless_error_list(Dwarf_Debug /*dbg*/,
    unsigned  /*count*/, 
    const char ** /*errmsg_ptrs_array*/,
    unsigned * /*newerr_count*/);

/*  Insertion is only for testing the harmless error code, it is not
    necessarily useful otherwise. */
void dwarf_insert_harmless_error(Dwarf_Debug /*dbg*/,
    char * /*newerror*/);

/*  The size of the circular list of strings may be set
    and reset as needed.  If it is shortened excess
    messages are simply dropped.  It returns the previous
    size. If zero passed in the size is unchanged
    and it simply returns the current size  */
unsigned dwarf_set_harmless_error_list_size(Dwarf_Debug /*dbg*/,
    unsigned /*maxcount*/);
/*  The harmless error strings (if any) are freed when the dbg
    is dwarf_finish()ed. */

/*  When the val_in is known these dwarf_get_TAG_name (etc)
    functions return the string corresponding to the val_in passed in
    through the pointer s_out and the value returned is DW_DLV_OK.   
    The strings are in static storage 
    and must not be freed.
    If DW_DLV_NO_ENTRY is returned the val_in is not known and
    *s_out is not set.  DW_DLV_ERROR is never returned.*/

/* The following copied from a generated dwarf_names.h */

/* BEGIN FILE */

extern int dwarf_get_TAG_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_children_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_FORM_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_AT_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_OP_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_ATE_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_DS_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_END_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_ATCF_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_ACCESS_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_VIS_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_VIRTUALITY_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_LANG_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_ID_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_CC_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_INL_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_ORD_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_DSC_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_LNS_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_LNE_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_ISA_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_MACINFO_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_CFA_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_EH_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_FRAME_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_CHILDREN_name(unsigned int /*val_in*/, const char ** /*s_out */);
extern int dwarf_get_ADDR_name(unsigned int /*val_in*/, const char ** /*s_out */);

/* END FILE */

/* Convert local offset into global offset */
int dwarf_convert_to_global_offset(Dwarf_Attribute  /*attr*/,
    Dwarf_Off        /*offset*/,
    Dwarf_Off*       /*ret_offset*/,
    Dwarf_Error*     /*error*/);

/* Get both offsets (local and global) */
int dwarf_die_offsets(Dwarf_Die     /*die*/,
    Dwarf_Off*    /*global_offset*/,
    Dwarf_Off*    /*local_offset*/,
    Dwarf_Error*  /*error*/);

/* Giving a section name, get its size and address */
int dwarf_get_section_info_by_name(Dwarf_Debug      /*dbg*/,
    const char *     /*section_name*/,
    Dwarf_Addr*      /*section_addr*/,
    Dwarf_Unsigned*  /*section_size*/,
    Dwarf_Error*     /*error*/);

/* Giving a section index, get its size and address */
int dwarf_get_section_info_by_index(Dwarf_Debug      /*dbg*/,
    int              /*section_index*/,
    const char **    /*section_name*/,
    Dwarf_Addr*      /*section_addr*/,
    Dwarf_Unsigned*  /*section_size*/,
    Dwarf_Error*     /*error*/);

/*  Get section count, of object file sections. */
int dwarf_get_section_count(Dwarf_Debug /*dbg*/);

/*  Get the version and offset size of a CU context. 
    This is useful as a precursor to
    calling dwarf_get_form_class() at times.  */
int dwarf_get_version_of_die(Dwarf_Die /*die*/,
    Dwarf_Half * /*version*/,
    Dwarf_Half * /*offset_size*/);

/*  Record some application command line options in libdwarf.  
    This is not arc/argv processing, just precooked setting
    of a flag in libdwarf based on something the application
    wants.  check_verbose_mode of TRUE means do more checking
    and sometimes print errors (from libdwarf).
    Not restricted to a single Dwarf_Debug, it applies
    to the libdwarf the executable is using.
*/
typedef struct {
    Dwarf_Bool check_verbose_mode;
} Dwarf_Cmdline_Options;
extern Dwarf_Cmdline_Options dwarf_cmdline_options;

/* Set libdwarf to reflect some application command line options. */
void dwarf_record_cmdline_options(Dwarf_Cmdline_Options /*options*/);

#ifdef __cplusplus
}
#endif
#endif /* _LIBDWARF_H */