Changeset 722
- Timestamp:
- Sep 24, 2003, 8:47:07 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gcc/gcc/dbxout.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.2
r721 r722 310 310 static void print_wide_int PARAMS ((HOST_WIDE_INT)); 311 311 static void dbxout_type_name PARAMS ((tree)); 312 static void dbxout_class_name_qualifiers PARAMS ((tree)); /* bird: from 3.3.1 */ 312 313 static int dbxout_symbol_location PARAMS ((tree, tree, const char *, rtx)); 313 314 static void dbxout_symbol_name PARAMS ((tree, const char *, int)); … … 674 675 { 675 676 if (TREE_CODE (decl) == VAR_DECL 677 #ifdef EMX /* bird: debug info for all referenced global vars. */ 678 && ( !DECL_EXTERNAL (decl) 679 || ( use_gnu_debug_info_extensions 680 && TREE_SYMBOL_REFERENCED (DECL_NAME (decl)))) 681 #else 676 682 && ! DECL_EXTERNAL (decl) 683 #endif 677 684 && DECL_RTL_SET_P (decl)) /* Not necessary? */ 678 685 dbxout_symbol (decl, 0); 679 } 686 } 680 687 681 688 /* At the end of compilation, finish writing the symbol table. … … 1868 1875 CHARS (digs); 1869 1876 } 1870 1877 1871 1878 /* Output the name of type TYPE, with no punctuation. 1872 1879 Such names can be set up either by typedef declarations … … 1893 1900 fprintf (asmfile, "%s", IDENTIFIER_POINTER (t)); 1894 1901 CHARS (IDENTIFIER_LENGTH (t)); 1902 } 1903 1904 /* bird: from 3.3.1: */ 1905 /* Output leading leading struct or class names needed for qualifying 1906 type whose scope is limited to a struct or class. */ 1907 1908 static void 1909 dbxout_class_name_qualifiers (decl) 1910 tree decl; 1911 { 1912 tree context = decl_type_context (decl); 1913 1914 if (context != NULL_TREE 1915 && TREE_CODE(context) == RECORD_TYPE 1916 && TYPE_NAME (context) != 0 1917 && (TREE_CODE (TYPE_NAME (context)) == IDENTIFIER_NODE 1918 || (DECL_NAME (TYPE_NAME (context)) != 0))) 1919 { 1920 tree name = TYPE_NAME (context); 1921 1922 if (TREE_CODE (name) == TYPE_DECL) 1923 { 1924 dbxout_class_name_qualifiers (name); 1925 name = DECL_NAME (name); 1926 } 1927 fprintf (asmfile, "%s::", IDENTIFIER_POINTER (name)); 1928 CHARS (IDENTIFIER_LENGTH (name) + 2); 1929 } 1895 1930 } 1896 1931 … … 2036 2071 } 2037 2072 2073 #if 1 /* bird: from 3.3.1 */ 2074 /* Output .stabs (or whatever) and leading double quote. */ 2075 fprintf (asmfile, "%s\"", ASM_STABS_OP); 2076 2077 if (use_gnu_debug_info_extensions) 2078 { 2079 /* Output leading class/struct qualifiers. */ 2080 dbxout_class_name_qualifiers (decl); 2081 } 2082 2038 2083 /* Output typedef name. */ 2084 fprintf (asmfile, "%s:", IDENTIFIER_POINTER (DECL_NAME (decl))); 2085 #else 2086 /* Output typedef name. */ 2039 2087 fprintf (asmfile, "%s\"%s:", ASM_STABS_OP, 2040 2088 IDENTIFIER_POINTER (DECL_NAME (decl))); 2089 #endif 2041 2090 2042 2091 /* Short cut way to output a tag also. */ … … 2130 2179 if (! DECL_RTL_SET_P (decl)) 2131 2180 return 0; 2181 #ifdef EMX 2182 /* Don't mention a variable that is external and unreferenced.. 2183 bird: Referenced variables must be mentioned for OMF support. */ 2184 if (DECL_EXTERNAL (decl) 2185 && ( !use_gnu_debug_info_extensions 2186 || !TREE_SYMBOL_REFERENCED (DECL_NAME (decl)))) 2187 break; 2188 #else 2132 2189 /* Don't mention a variable that is external. 2133 2190 Let the file that defines it describe it. */ 2134 2191 if (DECL_EXTERNAL (decl)) 2135 2192 break; 2193 #endif 2136 2194 2137 2195 /* If the variable is really a constant … … 2180 2238 result = dbxout_symbol_location (decl, type, 0, DECL_RTL (decl)); 2181 2239 break; 2182 2240 2183 2241 default: 2184 2242 break; … … 2205 2263 /* Don't mention a variable at all 2206 2264 if it was completely optimized into nothingness. 2207 2265 2208 2266 If the decl was from an inline function, then its rtl 2209 2267 is not identically the rtl that was used in this … … 2249 2307 letter = 'G'; 2250 2308 current_sym_code = N_GSYM; 2309 #ifdef EMX 2310 /* bird: This is hacks for two things. The first part, to use the 2311 value of a 'G', is intended to help resolving global symbols 2312 when the variable name isn't equal to the assembler name. f.ex.: 2313 class foo { foo() {static const char *psz= "foo";} }; 2314 The 2nd hack is for external symbols, which we need debug info for 2315 on EMX due to HLL conversion. In that case we need to find the 2316 variable somehow and generates a special alias symbol for it. 2317 The alias is a pretty unique name which includes the string 2318 '$hll$' which is what we'll look for. ld accept multiple 2319 definitions of aliases so it's not really a problem there. The 2320 value of these 'G' stabs are always -12357. */ 2321 if (use_gnu_debug_info_extensions) 2322 { 2323 current_sym_addr = XEXP (home, 0); 2324 if (DECL_EXTERNAL (decl)) 2325 { 2326 struct timeval tv; 2327 /* We'll make a special alias for the external symbol 2328 which the a.out -> omf copy will detect. 2329 Todo: This should really be _after_ the symbol. */ 2330 dbxout_symbol_name (decl, suffix, letter); 2331 gettimeofday(&tv, NULL); 2332 fprintf (asmfile, "$hll$%lx%08lx\",%d,0,0,0\n", 2333 tv.tv_sec, tv.tv_usec, /*N_INDR | N_EXT*/11); 2334 fprintf (asmfile, "\t.stabs\t\""); 2335 output_addr_const (asmfile, current_sym_addr); 2336 fprintf (asmfile, "\",%d,0,0,0\n", /*N_EXT*/ 1); 2337 current_sym_addr = 0; 2338 current_sym_value = -12357; 2339 } 2340 } 2341 #endif 2251 2342 } 2252 2343 else … … 2284 2375 current_sym_addr = tmp; 2285 2376 } 2286 2377 2287 2378 /* Ultrix `as' seems to need this. */ 2288 2379 #ifdef DBX_STATIC_STAB_DATA_SECTION … … 2575 2666 2576 2667 /* It is quite tempting to use: 2577 2668 2578 2669 dbxout_type (TREE_TYPE (parms), 0); 2579 2670 … … 2712 2803 = INTVAL (XEXP (XEXP (XEXP (DECL_RTL (parms), 0), 0), 1)); 2713 2804 current_sym_addr = 0; 2714 2805 current_sym_code = N_PSYM; /* bird: from 3.3.1 */ 2806 2715 2807 FORCE_TEXT; 2716 2808 fprintf (asmfile, "%s\"%s:v", ASM_STABS_OP, decl_name); … … 2750 2842 && GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (parms))) < UNITS_PER_WORD) 2751 2843 { 2752 current_sym_value += 2844 current_sym_value += 2753 2845 GET_MODE_SIZE (GET_MODE (DECL_RTL (parms))) 2754 2846 - GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (parms))); … … 2862 2954 2863 2955 #if DBX_BLOCKS_FUNCTION_RELATIVE 2864 const char *begin_label; 2956 const char *begin_label; 2865 2957 if (current_function_func_begin_label != NULL_TREE) 2866 2958 begin_label = IDENTIFIER_POINTER (current_function_func_begin_label); -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.