libdwarf.h 41.7 KB
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
#ifndef _LIBDWARF_H
#define _LIBDWARF_H
#ifdef __cplusplus
extern "C" {
#endif
/*
	libdwarf.h  
	$Revision: 1.1.1.1 $ $Date: 2002/05/02 03:29:20 $

	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...

*/

#if (_MIPS_SZLONG == 64)
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 */
#else /* 32-bit */
typedef int                 Dwarf_Bool;     /* boolean type */
typedef unsigned long long  Dwarf_Off;      /* 4 or 8 byte file offset */
typedef unsigned long 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 long    Dwarf_Signed;   /* 4 or 8 byte signed value */
typedef unsigned long long  Dwarf_Addr;     /* target memory address */
#endif
typedef void*		Dwarf_Ptr;          /* host machine pointer */

/* uninterpreted block of data
*/
typedef struct {
        Dwarf_Unsigned  bl_len;         /* length of block */
        Dwarf_Ptr       bl_data;        /* uninterpreted data */
} 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_Locdesc;

/* Frame description instructions expanded.
*/
typedef struct {
        Dwarf_Small     fp_base_op;
        Dwarf_Small     fp_extended_op;
        Dwarf_Half      fp_register;
        Dwarf_Unsigned  fp_offset;
        Dwarf_Off       fp_instr_offset;
} Dwarf_Frame_Op;


/* 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*/); 


/* 
    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 */


/* 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_init() access flag modifiers
*/
#define DW_DLC_SIZE_64     0x40000000 /* 32-bit target */
#define DW_DLC_SIZE_32     0x20000000 /* 64-bit target */

/* 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
#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
    /* DW_DLE_LAST MUST EQUAL LAST ERROR NUMBER */
#define DW_DLE_LAST        			186
#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



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

/* non-elf initialization */
int dwarf_init(int 	/*fd*/, 
    Dwarf_Unsigned 	/*access*/, 
    Dwarf_Handler 	/*errhand*/, 
    Dwarf_Ptr 		/*errarg*/, 
    Dwarf_Debug      *  /*dbg*/,
    Dwarf_Error* 	/*error*/);

/* elf intialization */
int dwarf_elf_init(Elf* /*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*/,
    Elf **              /*return_elfptr*/,
    Dwarf_Error*	/*error*/);

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

/* die traversal operations */
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*/);

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

/* finding die given offset */
int dwarf_offdie(Dwarf_Debug /*dbg*/, 
    Dwarf_Off 		/*offset*/, 
    Dwarf_Die*          /*return_die*/,
    Dwarf_Error* 	/*error*/);

/* 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? */
int dwarf_dieoffset(Dwarf_Die /*die*/, 
    Dwarf_Off*          /*return_offset*/,
    Dwarf_Error* 	/*error*/);

int dwarf_die_CU_offset(Dwarf_Die /*die*/,
    Dwarf_Off*          /*return_offset*/,
    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*/);

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

int dwarf_loclist(Dwarf_Attribute /*attr*/, 
    Dwarf_Locdesc** 	/*llbuf*/, 
    Dwarf_Signed *      /*locCount*/,
    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_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.
*/
int dwarf_formref(Dwarf_Attribute /*attr*/, 
    Dwarf_Off*          /*return_offset*/,
    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*/);

/* 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*/);

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_lineaddr(Dwarf_Line /*line*/, 
    Dwarf_Addr *        /*returned_addr*/,
    Dwarf_Error* 	/*error*/);

int dwarf_lineoff(Dwarf_Line /*line*/, 
    Dwarf_Signed  *     /*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*/);

/* 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*/);

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*/);

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*/);

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.  */
int dwarf_get_types(Dwarf_Debug	/*dbg*/,
    Dwarf_Type**	/*types*/,
    Dwarf_Signed *      /*number_of_types*/,
    Dwarf_Error*	/*error*/);

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*/);

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

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*/);

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) */
/* Unimplemented. */
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_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 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*/);

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*/);

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*/);

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*/);

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*/);

int dwarf_expand_frame_instructions(Dwarf_Debug /*dbg*/, 
    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_info(
    Dwarf_Arange 	/*arange*/, 
    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 # 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
                           */
};

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*/);



/* 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*/);

/* 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 */

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*/);

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*/);

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_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_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(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_alignent_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_P_Fde dwarf_add_fde_inst(Dwarf_P_Fde /*fde*/,
    Dwarf_Small 	/*op*/, 
    Dwarf_Unsigned 	/*val1*/, 
    Dwarf_Unsigned 	/*val2*/, 
    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*/);

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*/);

/* Operations to create location expressions. */
Dwarf_P_Expr dwarf_new_expr(Dwarf_P_Debug /*dbg*/, 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_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_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 */


void dwarf_p_dealloc(void* /*space*/, Dwarf_Unsigned /*type*/);

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


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