00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #include <dwarf.h>
00036 #include <stdio.h>
00037
00038 static unsigned int tag_attr_combination_table[0x36][3];
00039 static char *tag_name[ ] = {
00040 "0x00",
00041 "0x01 DW_TAG_array_type",
00042 "0x02 DW_TAG_class_type",
00043 "0x03 DW_TAG_entry_point",
00044 "0x04 DW_TAG_enumeration_type",
00045 "0x05 DW_TAG_formal_parameter",
00046 "0x06",
00047 "0x07",
00048 "0x08 DW_TAG_imported_declaration",
00049 "0x09",
00050 "0x0a DW_TAG_label",
00051 "0x0b DW_TAG_lexical_block",
00052 "0x0c",
00053 "0x0d DW_TAG_member",
00054 "0x0e",
00055 "0x0f DW_TAG_pointer_type",
00056 "0x10 DW_TAG_reference_type",
00057 "0x11 DW_TAG_compile_unit",
00058 "0x12 DW_TAG_string_type",
00059 "0x13 DW_TAG_structure_type",
00060 "0x14",
00061 "0x15 DW_TAG_subroutine_type",
00062 "0x16 DW_TAG_typedef",
00063 "0x17 DW_TAG_union_type",
00064 "0x18 DW_TAG_unspecified_parameters",
00065 "0x19 DW_TAG_variant",
00066 "0x1a DW_TAG_common_block",
00067 "0x1b DW_TAG_common_inclusion",
00068 "0x1c DW_TAG_inheritance",
00069 "0x1d DW_TAG_inlined_subroutine",
00070 "0x1e DW_TAG_module",
00071 "0x1f DW_TAG_ptr_to_member_type",
00072 "0x20 DW_TAG_set_type",
00073 "0x21 DW_TAG_subrange_type",
00074 "0x22 DW_TAG_with_stmt",
00075 "0x23 DW_TAG_access_declaration",
00076 "0x24 DW_TAG_base_type",
00077 "0x25 DW_TAG_catch_block",
00078 "0x26 DW_TAG_const_type",
00079 "0x27 DW_TAG_constant",
00080 "0x28 DW_TAG_enumerator",
00081 "0x29 DW_TAG_file_type",
00082 "0x2a DW_TAG_friend",
00083 "0x2b DW_TAG_namelist",
00084 "0x2c DW_TAG_namelist_item",
00085 "0x2d DW_TAG_packed_type",
00086 "0x2e DW_TAG_subprogram",
00087 "0x2f DW_TAG_template_type_parameter",
00088 "0x30 DW_TAG_template_value_parameter",
00089 "0x31 DW_TAG_thrown_type",
00090 "0x32 DW_TAG_try_block",
00091 "0x33 DW_TAG_variant_part",
00092 "0x34 DW_TAG_variable",
00093 "0x35 DW_TAG_volatile_type",
00094 };
00095
00096
00097 int
00098 main ()
00099 {
00100 int i;
00101 int num;
00102 scanf("%x\n", &num);
00103 while (! feof(stdin)) {
00104 int tag;
00105 scanf("%x\n", &tag);
00106 scanf("%x\n", &num);
00107 while (num != 0xffffffff) {
00108 int idx = num / 0x20;
00109 int bit = num % 0x20;
00110 tag_attr_combination_table[tag][idx] |= (1 << bit);
00111 scanf("%x\n", &num);
00112 }
00113 }
00114 printf("static unsigned int tag_attr_combination_table [ ][3] = {\n");
00115 for (i = 0; i < 0x36; i ++) {
00116 printf("/* %-37s*/\n", tag_name[i]);
00117 printf(" { %#.8x, %#.8x, %#.8x},\n",
00118 tag_attr_combination_table[i][0],
00119 tag_attr_combination_table[i][1],
00120 tag_attr_combination_table[i][2]);
00121 }
00122 printf("};\n");
00123 return(0);
00124 }