Deleted Added
sdiff udiff text old ( 50397 ) new ( 52284 )
full compact
1/* Output Dwarf2 format symbol table information from the GNU C compiler.
2 Copyright (C) 1992, 93, 95, 96, 97, 1998 Free Software Foundation, Inc.
3 Contributed by Gary Funck (gary@intrepid.com).
4 Derived from DWARF 1 implementation of Ron Guilmette (rfg@monkeys.com).
5 Extensively modified by Jason Merrill (jason@cygnus.com).
6
7This file is part of GNU CC.
8
9GNU CC is free software; you can redistribute it and/or modify
10it under the terms of the GNU General Public License as published by
11the Free Software Foundation; either version 2, or (at your option)
12any later version.
13
14GNU CC is distributed in the hope that it will be useful,
15but WITHOUT ANY WARRANTY; without even the implied warranty of
16MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17GNU General Public License for more details.
18
19You should have received a copy of the GNU General Public License
20along with GNU CC; see the file COPYING. If not, write to
21the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
22
23/* The first part of this file deals with the DWARF 2 frame unwind
24 information, which is also used by the GCC efficient exception handling
25 mechanism. The second part, controlled only by an #ifdef
26 DWARF2_DEBUGGING_INFO, deals with the other DWARF 2 debugging
27 information. */
28
29#include "config.h"

--- 36 unchanged lines hidden (view full) ---

66#ifdef DWARF2_UNWIND_INFO
67 || (flag_exceptions && ! exceptions_via_longjmp)
68#endif
69 );
70}
71
72#if defined (DWARF2_DEBUGGING_INFO) || defined (DWARF2_UNWIND_INFO)
73
74#ifndef __GNUC__
75#define inline
76#endif
77
78/* How to start an assembler comment. */
79#ifndef ASM_COMMENT_START
80#define ASM_COMMENT_START ";#"
81#endif
82
83typedef struct dw_cfi_struct *dw_cfi_ref;
84typedef struct dw_fde_struct *dw_fde_ref;
85typedef union dw_cfi_oprnd_struct *dw_cfi_oprnd_ref;

--- 255 unchanged lines hidden (view full) ---

341
342#ifndef ASM_OUTPUT_DWARF_ADDR
343#define ASM_OUTPUT_DWARF_ADDR(FILE,LABEL) \
344 do { fprintf ((FILE), "\t%s\t", UNALIGNED_WORD_ASM_OP); \
345 assemble_name (FILE, LABEL); \
346 } while (0)
347#endif
348
349#ifndef ASM_OUTPUT_DWARF_ADDR_CONST
350#define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,ADDR) \
351 fprintf ((FILE), "\t%s\t%s", UNALIGNED_WORD_ASM_OP, (ADDR))
352#endif
353
354#ifndef ASM_OUTPUT_DWARF_OFFSET4
355#define ASM_OUTPUT_DWARF_OFFSET4(FILE,LABEL) \
356 do { fprintf ((FILE), "\t%s\t", UNALIGNED_INT_ASM_OP); \

--- 270 unchanged lines hidden (view full) ---

627 build_int_2 (DWARF_FRAME_REGNUM (ranges[1].end), 0)));
628 t = fold (build (TRUTH_ANDIF_EXPR, integer_type_node, t, t2));
629 t = fold (build (COND_EXPR, integer_type_node, t,
630 build_int_2 (ranges[1].size, 0),
631 build_int_2 (ranges[0].size, 0)));
632 }
633 else
634 {
635 --n_ranges;
636 t = build_int_2 (ranges[n_ranges].size, 0);
637 size = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
638 for (; n_ranges--; )
639 {
640 if ((DWARF_FRAME_REGNUM (ranges[n_ranges].end)
641 - DWARF_FRAME_REGNUM (ranges[n_ranges].beg))
642 != ranges[n_ranges].end - ranges[n_ranges].beg)
643 abort ();
644 if (DWARF_FRAME_REGNUM (ranges[n_ranges].beg) >= size)
645 abort ();
646 size = DWARF_FRAME_REGNUM (ranges[n_ranges].beg);
647 t2 = fold (build (LE_EXPR, integer_type_node, reg_tree,
648 build_int_2 (DWARF_FRAME_REGNUM
649 (ranges[n_ranges].end), 0)));
650 t = fold (build (COND_EXPR, integer_type_node, t2,
651 build_int_2 (ranges[n_ranges].size, 0), t));
652 }
653 }
654 return expand_expr (t, target, Pmode, 0);
655}
656
657/* Convert a DWARF call frame info. operation to its string name */
658
659static char *
660dwarf_cfi_name (cfi_opc)

--- 360 unchanged lines hidden (view full) ---

1021
1022/* Record the initial position of the return address. RTL is
1023 INCOMING_RETURN_ADDR_RTX. */
1024
1025static void
1026initial_return_save (rtl)
1027 register rtx rtl;
1028{
1029 unsigned reg = -1;
1030 long offset = 0;
1031
1032 switch (GET_CODE (rtl))
1033 {
1034 case REG:
1035 /* RA is in a register. */
1036 reg = reg_number (rtl);
1037 break;

--- 132 unchanged lines hidden (view full) ---

1170 if (args_size < 0)
1171 args_size = 0;
1172
1173 label = dwarf2out_cfi_label ();
1174 dwarf2out_def_cfa (label, cfa_reg, cfa_offset);
1175 dwarf2out_args_size (label, args_size);
1176}
1177
1178/* Record call frame debugging information for INSN, which either
1179 sets SP or FP (adjusting how we calculate the frame address) or saves a
1180 register to the stack. If INSN is NULL_RTX, initialize our state. */
1181
1182void
1183dwarf2out_frame_debug (insn)
1184 rtx insn;
1185{
1186 char *label;
1187 rtx src, dest;
1188 long offset;
1189
1190 /* A temporary register used in adjusting SP or setting up the store_reg. */
1191 static unsigned cfa_temp_reg;
1192 static long cfa_temp_value;
1193
1194 if (insn == NULL_RTX)
1195 {
1196 /* Set up state for generating call frame debug info. */
1197 lookup_cfa (&cfa_reg, &cfa_offset);
1198 if (cfa_reg != DWARF_FRAME_REGNUM (STACK_POINTER_REGNUM))
1199 abort ();
1200 cfa_reg = STACK_POINTER_REGNUM;
1201 cfa_store_reg = cfa_reg;
1202 cfa_store_offset = cfa_offset;
1203 cfa_temp_reg = -1;
1204 cfa_temp_value = 0;
1205 return;
1206 }
1207
1208 if (! RTX_FRAME_RELATED_P (insn))
1209 {
1210 dwarf2out_stack_adjust (insn);
1211 return;
1212 }
1213
1214 label = dwarf2out_cfi_label ();
1215
1216 insn = PATTERN (insn);
1217 /* Assume that in a PARALLEL prologue insn, only the first elt is
1218 significant. Currently this is true. */
1219 if (GET_CODE (insn) == PARALLEL)
1220 insn = XVECEXP (insn, 0, 0);
1221 if (GET_CODE (insn) != SET)
1222 abort ();
1223
1224 src = SET_SRC (insn);
1225 dest = SET_DEST (insn);
1226
1227 switch (GET_CODE (dest))
1228 {
1229 case REG:
1230 /* Update the CFA rule wrt SP or FP. Make sure src is
1231 relative to the current CFA register. */
1232 switch (GET_CODE (src))
1233 {
1234 /* Setting FP from SP. */
1235 case REG:
1236 if (cfa_reg != REGNO (src))
1237 abort ();
1238 if (REGNO (dest) != STACK_POINTER_REGNUM
1239 && !(frame_pointer_needed
1240 && REGNO (dest) == HARD_FRAME_POINTER_REGNUM))
1241 abort ();
1242 cfa_reg = REGNO (dest);
1243 break;
1244
1245 case PLUS:
1246 case MINUS:
1247 if (dest == stack_pointer_rtx)
1248 {
1249 /* Adjusting SP. */
1250 switch (GET_CODE (XEXP (src, 1)))
1251 {
1252 case CONST_INT:
1253 offset = INTVAL (XEXP (src, 1));
1254 break;
1255 case REG:
1256 if (REGNO (XEXP (src, 1)) != cfa_temp_reg)
1257 abort ();
1258 offset = cfa_temp_value;
1259 break;
1260 default:
1261 abort ();
1262 }
1263
1264 if (XEXP (src, 0) == hard_frame_pointer_rtx)
1265 {
1266 /* Restoring SP from FP in the epilogue. */
1267 if (cfa_reg != HARD_FRAME_POINTER_REGNUM)
1268 abort ();
1269 cfa_reg = STACK_POINTER_REGNUM;
1270 }
1271 else if (XEXP (src, 0) != stack_pointer_rtx)
1272 abort ();
1273
1274 if (GET_CODE (src) == PLUS)
1275 offset = -offset;
1276 if (cfa_reg == STACK_POINTER_REGNUM)
1277 cfa_offset += offset;
1278 if (cfa_store_reg == STACK_POINTER_REGNUM)
1279 cfa_store_offset += offset;
1280 }
1281 else if (dest == hard_frame_pointer_rtx)
1282 {
1283 /* Either setting the FP from an offset of the SP,
1284 or adjusting the FP */
1285 if (! frame_pointer_needed
1286 || REGNO (dest) != HARD_FRAME_POINTER_REGNUM)
1287 abort ();
1288
1289 if (XEXP (src, 0) == stack_pointer_rtx
1290 && GET_CODE (XEXP (src, 1)) == CONST_INT)
1291 {
1292 if (cfa_reg != STACK_POINTER_REGNUM)
1293 abort ();
1294 offset = INTVAL (XEXP (src, 1));
1295 if (GET_CODE (src) == PLUS)
1296 offset = -offset;
1297 cfa_offset += offset;
1298 cfa_reg = HARD_FRAME_POINTER_REGNUM;
1299 }
1300 else if (XEXP (src, 0) == hard_frame_pointer_rtx
1301 && GET_CODE (XEXP (src, 1)) == CONST_INT)
1302 {
1303 if (cfa_reg != HARD_FRAME_POINTER_REGNUM)
1304 abort ();
1305 offset = INTVAL (XEXP (src, 1));
1306 if (GET_CODE (src) == PLUS)
1307 offset = -offset;
1308 cfa_offset += offset;
1309 }
1310
1311 else
1312 abort();
1313 }
1314 else
1315 {
1316 if (GET_CODE (src) != PLUS
1317 || XEXP (src, 1) != stack_pointer_rtx)
1318 abort ();
1319 if (GET_CODE (XEXP (src, 0)) != REG
1320 || REGNO (XEXP (src, 0)) != cfa_temp_reg)
1321 abort ();
1322 if (cfa_reg != STACK_POINTER_REGNUM)
1323 abort ();
1324 cfa_store_reg = REGNO (dest);
1325 cfa_store_offset = cfa_offset - cfa_temp_value;
1326 }
1327 break;
1328
1329 case CONST_INT:
1330 cfa_temp_reg = REGNO (dest);
1331 cfa_temp_value = INTVAL (src);
1332 break;
1333
1334 case IOR:
1335 if (GET_CODE (XEXP (src, 0)) != REG
1336 || REGNO (XEXP (src, 0)) != cfa_temp_reg
1337 || REGNO (dest) != cfa_temp_reg
1338 || GET_CODE (XEXP (src, 1)) != CONST_INT)
1339 abort ();
1340 cfa_temp_value |= INTVAL (XEXP (src, 1));
1341 break;
1342
1343 default:
1344 abort ();
1345 }
1346 dwarf2out_def_cfa (label, cfa_reg, cfa_offset);
1347 break;
1348
1349 case MEM:
1350 /* Saving a register to the stack. Make sure dest is relative to the
1351 CFA register. */
1352 if (GET_CODE (src) != REG)
1353 abort ();
1354 switch (GET_CODE (XEXP (dest, 0)))
1355 {
1356 /* With a push. */
1357 case PRE_INC:
1358 case PRE_DEC:
1359 offset = GET_MODE_SIZE (GET_MODE (dest));
1360 if (GET_CODE (XEXP (dest, 0)) == PRE_INC)
1361 offset = -offset;
1362
1363 if (REGNO (XEXP (XEXP (dest, 0), 0)) != STACK_POINTER_REGNUM
1364 || cfa_store_reg != STACK_POINTER_REGNUM)
1365 abort ();
1366 cfa_store_offset += offset;
1367 if (cfa_reg == STACK_POINTER_REGNUM)
1368 cfa_offset = cfa_store_offset;
1369
1370 offset = -cfa_store_offset;
1371 break;
1372
1373 /* With an offset. */
1374 case PLUS:
1375 case MINUS:
1376 offset = INTVAL (XEXP (XEXP (dest, 0), 1));
1377 if (GET_CODE (src) == MINUS)
1378 offset = -offset;
1379
1380 if (cfa_store_reg != REGNO (XEXP (XEXP (dest, 0), 0)))
1381 abort ();
1382 offset -= cfa_store_offset;
1383 break;
1384
1385 default:
1386 abort ();
1387 }
1388 dwarf2out_def_cfa (label, cfa_reg, cfa_offset);
1389 dwarf2out_reg_save (label, REGNO (src), offset);
1390 break;
1391
1392 default:
1393 abort ();
1394 }
1395}
1396
1397/* Return the size of an unsigned LEB128 quantity. */
1398
1399static inline unsigned long
1400size_of_uleb128 (value)
1401 register unsigned long value;
1402{

--- 257 unchanged lines hidden (view full) ---

1660
1661 if (for_eh)
1662 {
1663#ifdef EH_FRAME_SECTION
1664 EH_FRAME_SECTION ();
1665#else
1666 tree label = get_file_function_name ('F');
1667
1668 data_section ();
1669 ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (PTR_SIZE));
1670 ASM_GLOBALIZE_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
1671 ASM_OUTPUT_LABEL (asm_out_file, IDENTIFIER_POINTER (label));
1672#endif
1673 assemble_label ("__FRAME_BEGIN__");
1674 }
1675 else
1676 ASM_OUTPUT_SECTION (asm_out_file, FRAME_SECTION);

--- 121 unchanged lines hidden (view full) ---

1798 else
1799 ASM_OUTPUT_DWARF_DELTA (asm_out_file, l2, l1);
1800#endif
1801 if (flag_debug_asm)
1802 fprintf (asm_out_file, "\t%s FDE Length", ASM_COMMENT_START);
1803 fputc ('\n', asm_out_file);
1804 ASM_OUTPUT_LABEL (asm_out_file, l1);
1805
1806 if (for_eh)
1807 ASM_OUTPUT_DWARF_DELTA (asm_out_file, l1, "__FRAME_BEGIN__");
1808 else
1809 ASM_OUTPUT_DWARF_OFFSET (asm_out_file, stripattributes (FRAME_SECTION));
1810 if (flag_debug_asm)
1811 fprintf (asm_out_file, "\t%s FDE CIE offset", ASM_COMMENT_START);
1812
1813 fputc ('\n', asm_out_file);
1814 ASM_OUTPUT_DWARF_ADDR (asm_out_file, fde->dw_fde_begin);
1815 if (flag_debug_asm)

--- 161 unchanged lines hidden (view full) ---

1977 dw_val_class_const,
1978 dw_val_class_unsigned_const,
1979 dw_val_class_long_long,
1980 dw_val_class_float,
1981 dw_val_class_flag,
1982 dw_val_class_die_ref,
1983 dw_val_class_fde_ref,
1984 dw_val_class_lbl_id,
1985 dw_val_class_section_offset,
1986 dw_val_class_str
1987}
1988dw_val_class;
1989
1990/* Various DIE's use offsets relative to the beginning of the
1991 .debug_info section to refer to each other. */
1992
1993typedef long int dw_offset;

--- 62 unchanged lines hidden (view full) ---

2056 long int val_int;
2057 long unsigned val_unsigned;
2058 dw_long_long_const val_long_long;
2059 dw_float_const val_float;
2060 dw_die_ref val_die_ref;
2061 unsigned val_fde_index;
2062 char *val_str;
2063 char *val_lbl_id;
2064 char *val_section;
2065 unsigned char val_flag;
2066 }
2067 v;
2068}
2069dw_val_node;
2070
2071/* Locations in memory are described using a sequence of stack machine
2072 operations. */

--- 283 unchanged lines hidden (view full) ---

2356/* Number of elements of pending_types_list currently in use. */
2357static unsigned pending_types;
2358
2359/* Size (in elements) of increments by which we may expand the pending
2360 types list. Actually, a single hunk of space of this size should
2361 be enough for most typical programs. */
2362#define PENDING_TYPES_INCREMENT 64
2363
2364/* Record whether the function being analyzed contains inlined functions. */
2365static int current_function_has_inlines;
2366#if 0 && defined (MIPS_DEBUGGING_INFO)
2367static int comp_unit_has_inlines;
2368#endif
2369
2370/* A pointer to the ..._DECL node which we have most recently been working
2371 on. We keep this around just in case something about it looks screwy and

--- 43 unchanged lines hidden (view full) ---

2415 unsigned));
2416static void add_AT_loc PROTO((dw_die_ref,
2417 enum dwarf_attribute,
2418 dw_loc_descr_ref));
2419static void add_AT_addr PROTO((dw_die_ref,
2420 enum dwarf_attribute, char *));
2421static void add_AT_lbl_id PROTO((dw_die_ref,
2422 enum dwarf_attribute, char *));
2423static void add_AT_section_offset PROTO((dw_die_ref,
2424 enum dwarf_attribute, char *));
2425static int is_extern_subr_die PROTO((dw_die_ref));
2426static dw_attr_ref get_AT PROTO((dw_die_ref,
2427 enum dwarf_attribute));
2428static char *get_AT_low_pc PROTO((dw_die_ref));
2429static char *get_AT_hi_pc PROTO((dw_die_ref));
2430static char *get_AT_string PROTO((dw_die_ref,
2431 enum dwarf_attribute));

--- 156 unchanged lines hidden (view full) ---

2588#endif
2589#ifndef DATA_SECTION
2590#define DATA_SECTION ".data"
2591#endif
2592#ifndef BSS_SECTION
2593#define BSS_SECTION ".bss"
2594#endif
2595
2596
2597/* Definitions of defaults for formats and names of various special
2598 (artificial) labels which may be generated within this file (when the -g
2599 options is used and DWARF_DEBUGGING_INFO is in effect.
2600 If necessary, these may be overridden from within the tm.h file, but
2601 typically, overriding these defaults is unnecessary. */
2602
2603static char text_end_label[MAX_ARTIFICIAL_LABEL_BYTES];
2604
2605#ifndef TEXT_END_LABEL
2606#define TEXT_END_LABEL "Letext"
2607#endif
2608#ifndef DATA_END_LABEL
2609#define DATA_END_LABEL "Ledata"
2610#endif
2611#ifndef BSS_END_LABEL

--- 20 unchanged lines hidden (view full) ---

2632#ifndef SEPARATE_LINE_CODE_LABEL
2633#define SEPARATE_LINE_CODE_LABEL "LSM"
2634#endif
2635
2636/* Convert a reference to the assembler name of a C-level name. This
2637 macro has the same effect as ASM_OUTPUT_LABELREF, but copies to
2638 a string rather than writing to a file. */
2639#ifndef ASM_NAME_TO_STRING
2640#define ASM_NAME_TO_STRING(STR, NAME) \
2641 do { \
2642 if ((NAME)[0] == '*') \
2643 dyn_string_append (STR, NAME + 1); \
2644 else \
2645 dyn_string_append (STR, NAME); \
2646 } \
2647 while (0)
2648#endif
2649
2650/* Convert an integer constant expression into assembler syntax. Addition
2651 and subtraction are the only arithmetic that may appear in these
2652 expressions. This is an adaptation of output_addr_const in final.c.
2653 Here, the target of the conversion is a string buffer. We can't use
2654 output_addr_const directly, because it writes to a file. */

--- 857 unchanged lines hidden (view full) ---

3512 function, so we have to trace all of the way back through the origin chain
3513 to find out what sort of node actually served as the original seed for the
3514 given block. */
3515
3516static tree
3517decl_ultimate_origin (decl)
3518 register tree decl;
3519{
3520 register tree immediate_origin = DECL_ABSTRACT_ORIGIN (decl);
3521
3522 if (immediate_origin == NULL_TREE)
3523 return NULL_TREE;
3524 else
3525 {
3526 register tree ret_val;
3527 register tree lookahead = immediate_origin;
3528
3529 do
3530 {
3531 ret_val = lookahead;
3532 lookahead = DECL_ABSTRACT_ORIGIN (ret_val);
3533 }
3534 while (lookahead != NULL && lookahead != ret_val);
3535
3536 return ret_val;
3537 }
3538}
3539
3540/* Determine the "ultimate origin" of a block. The block may be an inlined
3541 instance of an inlined instance of a block which is local to an inline
3542 function, so we have to trace all of the way back through the origin chain
3543 to find out what sort of node actually served as the original seed for the
3544 given block. */
3545

--- 256 unchanged lines hidden (view full) ---

3802 attr->dw_attr_val.val_class = dw_val_class_lbl_id;
3803 attr->dw_attr_val.v.val_lbl_id = xstrdup (lbl_id);
3804 add_dwarf_attr (die, attr);
3805}
3806
3807/* Add a section offset attribute value to a DIE. */
3808
3809static inline void
3810add_AT_section_offset (die, attr_kind, section)
3811 register dw_die_ref die;
3812 register enum dwarf_attribute attr_kind;
3813 register char *section;
3814{
3815 register dw_attr_ref attr = (dw_attr_ref) xmalloc (sizeof (dw_attr_node));
3816
3817 attr->dw_attr_next = NULL;
3818 attr->dw_attr = attr_kind;
3819 attr->dw_attr_val.val_class = dw_val_class_section_offset;
3820 attr->dw_attr_val.v.val_section = section;
3821 add_dwarf_attr (die, attr);
3822
3823}
3824
3825/* Test if die refers to an external subroutine. */
3826
3827static inline int
3828is_extern_subr_die (die)

--- 446 unchanged lines hidden (view full) ---

4275 case dw_val_class_die_ref:
4276 if (a->dw_attr_val.v.val_die_ref != NULL)
4277 fprintf (outfile, "die -> %lu",
4278 a->dw_attr_val.v.val_die_ref->die_offset);
4279 else
4280 fprintf (outfile, "die -> <null>");
4281 break;
4282 case dw_val_class_lbl_id:
4283 fprintf (outfile, "label: %s", a->dw_attr_val.v.val_lbl_id);
4284 break;
4285 case dw_val_class_section_offset:
4286 fprintf (outfile, "section: %s", a->dw_attr_val.v.val_section);
4287 break;
4288 case dw_val_class_str:
4289 if (a->dw_attr_val.v.val_str != NULL)
4290 fprintf (outfile, "\"%s\"", a->dw_attr_val.v.val_str);
4291 else
4292 fprintf (outfile, "<null>");
4293 break;
4294 default:
4295 break;

--- 347 unchanged lines hidden (view full) ---

4643 size += DWARF_OFFSET_SIZE;
4644 break;
4645 case dw_val_class_fde_ref:
4646 size += DWARF_OFFSET_SIZE;
4647 break;
4648 case dw_val_class_lbl_id:
4649 size += PTR_SIZE;
4650 break;
4651 case dw_val_class_section_offset:
4652 size += DWARF_OFFSET_SIZE;
4653 break;
4654 case dw_val_class_str:
4655 size += size_of_string (a->dw_attr_val.v.val_str);
4656 break;
4657 default:
4658 abort ();
4659 }

--- 85 unchanged lines hidden (view full) ---

4745 size = 2;
4746
4747 /* Prolog length specifier. */
4748 size += DWARF_OFFSET_SIZE;
4749
4750 /* Prolog. */
4751 size += size_of_line_prolog ();
4752
4753 /* Set address register instruction. */
4754 size += size_of_set_address;
4755
4756 current_file = 1;
4757 current_line = 1;
4758 for (lt_index = 1; lt_index < line_info_table_in_use; ++lt_index)
4759 {
4760 register dw_line_info_ref line_info;
4761
4762 /* Advance pc instruction. */
4763 /* ??? See the DW_LNS_advance_pc comment in output_line_info. */
4764 if (0)
4765 size += 1 + 2;
4766 else
4767 size += size_of_set_address;
4768
4769 line_info = &line_info_table[lt_index];
4770 if (line_info->dw_file_num != current_file)
4771 {
4772 /* Set file number instruction. */
4773 size += 1;
4774 current_file = line_info->dw_file_num;
4775 size += size_of_uleb128 (current_file);
4776 }
4777

--- 27 unchanged lines hidden (view full) ---

4805
4806 function = 0;
4807 current_file = 1;
4808 current_line = 1;
4809 for (lt_index = 0; lt_index < separate_line_info_table_in_use; )
4810 {
4811 register dw_separate_line_info_ref line_info
4812 = &separate_line_info_table[lt_index];
4813 if (function != line_info->function)
4814 {
4815 function = line_info->function;
4816 /* Set address register instruction. */
4817 size += size_of_set_address;
4818 }
4819 else
4820 {

--- 26 unchanged lines hidden (view full) ---

4847 size += 1;
4848 size += size_of_sleb128 (line_offset);
4849
4850 /* Generate line entry instruction. */
4851 size += 1;
4852 }
4853 }
4854
4855 ++lt_index;
4856
4857 /* If we're done with a function, end its sequence. */
4858 if (lt_index == separate_line_info_table_in_use
4859 || separate_line_info_table[lt_index].function != function)
4860 {
4861 current_file = 1;
4862 current_line = 1;

--- 93 unchanged lines hidden (view full) ---

4956 case dw_val_class_flag:
4957 return DW_FORM_flag;
4958 case dw_val_class_die_ref:
4959 return DW_FORM_ref;
4960 case dw_val_class_fde_ref:
4961 return DW_FORM_data;
4962 case dw_val_class_lbl_id:
4963 return DW_FORM_addr;
4964 case dw_val_class_section_offset:
4965 return DW_FORM_data;
4966 case dw_val_class_str:
4967 return DW_FORM_string;
4968 default:
4969 abort ();
4970 }
4971}
4972

--- 56 unchanged lines hidden (view full) ---

5029 dwarf_attr_name (a_attr->dw_attr));
5030
5031 fputc ('\n', asm_out_file);
5032 output_value_format (&a_attr->dw_attr_val);
5033 }
5034
5035 fprintf (asm_out_file, "\t%s\t0,0\n", ASM_BYTE_OP);
5036 }
5037}
5038
5039/* Output location description stack opcode's operands (if any). */
5040
5041static void
5042output_loc_operands (loc)
5043 register dw_loc_descr_ref loc;
5044{

--- 133 unchanged lines hidden (view full) ---

5178output_die (die)
5179 register dw_die_ref die;
5180{
5181 register dw_attr_ref a;
5182 register dw_die_ref c;
5183 register unsigned long ref_offset;
5184 register unsigned long size;
5185 register dw_loc_descr_ref loc;
5186 register int i;
5187
5188 output_uleb128 (die->die_abbrev);
5189 if (flag_debug_asm)
5190 fprintf (asm_out_file, " (DIE (0x%lx) %s)",
5191 die->die_offset, dwarf_tag_name (die->die_tag));
5192
5193 fputc ('\n', asm_out_file);
5194

--- 86 unchanged lines hidden (view full) ---

5281 if (flag_debug_asm)
5282 fprintf (asm_out_file,
5283 "\t%s long long constant", ASM_COMMENT_START);
5284
5285 fputc ('\n', asm_out_file);
5286 break;
5287
5288 case dw_val_class_float:
5289 ASM_OUTPUT_DWARF_DATA1 (asm_out_file,
5290 a->dw_attr_val.v.val_float.length * 4);
5291 if (flag_debug_asm)
5292 fprintf (asm_out_file, "\t%s %s",
5293 ASM_COMMENT_START, dwarf_attr_name (a->dw_attr));
5294
5295 fputc ('\n', asm_out_file);
5296 for (i = 0; i < a->dw_attr_val.v.val_float.length; ++i)
5297 {
5298 ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
5299 a->dw_attr_val.v.val_float.array[i]);
5300 if (flag_debug_asm)
5301 fprintf (asm_out_file, "\t%s fp constant word %d",
5302 ASM_COMMENT_START, i);
5303
5304 fputc ('\n', asm_out_file);
5305 }
5306 break;
5307
5308 case dw_val_class_flag:
5309 ASM_OUTPUT_DWARF_DATA1 (asm_out_file, a->dw_attr_val.v.val_flag);
5310 break;
5311
5312 case dw_val_class_die_ref:
5313 if (a->dw_attr_val.v.val_die_ref != NULL)
5314 ref_offset = a->dw_attr_val.v.val_die_ref->die_offset;

--- 14 unchanged lines hidden (view full) ---

5329 fprintf (asm_out_file, " - %d", DWARF_OFFSET_SIZE);
5330 }
5331 break;
5332
5333 case dw_val_class_lbl_id:
5334 ASM_OUTPUT_DWARF_ADDR (asm_out_file, a->dw_attr_val.v.val_lbl_id);
5335 break;
5336
5337 case dw_val_class_section_offset:
5338 ASM_OUTPUT_DWARF_OFFSET (asm_out_file,
5339 stripattributes
5340 (a->dw_attr_val.v.val_section));
5341 break;
5342
5343 case dw_val_class_str:
5344 if (flag_debug_asm)
5345 ASM_OUTPUT_DWARF_STRING (asm_out_file, a->dw_attr_val.v.val_str);
5346 else
5347 ASM_OUTPUT_ASCII (asm_out_file,
5348 a->dw_attr_val.v.val_str,
5349 strlen (a->dw_attr_val.v.val_str) + 1);
5350 break;
5351
5352 default:
5353 abort ();
5354 }
5355
5356 if (a->dw_attr_val.val_class != dw_val_class_loc
5357 && a->dw_attr_val.val_class != dw_val_class_long_long

--- 34 unchanged lines hidden (view full) ---

5392 ASM_COMMENT_START);
5393
5394 fputc ('\n', asm_out_file);
5395 ASM_OUTPUT_DWARF_DATA2 (asm_out_file, DWARF_VERSION);
5396 if (flag_debug_asm)
5397 fprintf (asm_out_file, "\t%s DWARF version number", ASM_COMMENT_START);
5398
5399 fputc ('\n', asm_out_file);
5400 ASM_OUTPUT_DWARF_OFFSET (asm_out_file, stripattributes (ABBREV_SECTION));
5401 if (flag_debug_asm)
5402 fprintf (asm_out_file, "\t%s Offset Into Abbrev. Section",
5403 ASM_COMMENT_START);
5404
5405 fputc ('\n', asm_out_file);
5406 ASM_OUTPUT_DWARF_DATA1 (asm_out_file, PTR_SIZE);
5407 if (flag_debug_asm)
5408 fprintf (asm_out_file, "\t%s Pointer Size (in bytes)", ASM_COMMENT_START);

--- 56 unchanged lines hidden (view full) ---

5465
5466 fputc ('\n', asm_out_file);
5467 ASM_OUTPUT_DWARF_DATA2 (asm_out_file, DWARF_VERSION);
5468
5469 if (flag_debug_asm)
5470 fprintf (asm_out_file, "\t%s DWARF Version", ASM_COMMENT_START);
5471
5472 fputc ('\n', asm_out_file);
5473 ASM_OUTPUT_DWARF_OFFSET (asm_out_file, stripattributes (DEBUG_INFO_SECTION));
5474 if (flag_debug_asm)
5475 fprintf (asm_out_file, "\t%s Offset of Compilation Unit Info.",
5476 ASM_COMMENT_START);
5477
5478 fputc ('\n', asm_out_file);
5479 ASM_OUTPUT_DWARF_DATA (asm_out_file, next_die_offset);
5480 if (flag_debug_asm)
5481 fprintf (asm_out_file, "\t%s Compilation Unit Length", ASM_COMMENT_START);

--- 11 unchanged lines hidden (view full) ---

5493
5494 if (flag_debug_asm)
5495 {
5496 ASM_OUTPUT_DWARF_STRING (asm_out_file, pub->name);
5497 fprintf (asm_out_file, "%s external name", ASM_COMMENT_START);
5498 }
5499 else
5500 {
5501 ASM_OUTPUT_ASCII (asm_out_file, pub->name, strlen (pub->name) + 1);
5502 }
5503
5504 fputc ('\n', asm_out_file);
5505 }
5506
5507 ASM_OUTPUT_DWARF_DATA (asm_out_file, 0);
5508 fputc ('\n', asm_out_file);
5509}

--- 35 unchanged lines hidden (view full) ---

5545 ASM_COMMENT_START);
5546
5547 fputc ('\n', asm_out_file);
5548 ASM_OUTPUT_DWARF_DATA2 (asm_out_file, DWARF_VERSION);
5549 if (flag_debug_asm)
5550 fprintf (asm_out_file, "\t%s DWARF Version", ASM_COMMENT_START);
5551
5552 fputc ('\n', asm_out_file);
5553 ASM_OUTPUT_DWARF_OFFSET (asm_out_file, stripattributes (DEBUG_INFO_SECTION));
5554 if (flag_debug_asm)
5555 fprintf (asm_out_file, "\t%s Offset of Compilation Unit Info.",
5556 ASM_COMMENT_START);
5557
5558 fputc ('\n', asm_out_file);
5559 ASM_OUTPUT_DWARF_DATA1 (asm_out_file, PTR_SIZE);
5560 if (flag_debug_asm)
5561 fprintf (asm_out_file, "\t%s Size of Address", ASM_COMMENT_START);

--- 9 unchanged lines hidden (view full) ---

5571 if (PTR_SIZE == 8)
5572 fprintf (asm_out_file, ",0,0");
5573
5574 if (flag_debug_asm)
5575 fprintf (asm_out_file, "\t%s Pad to %d byte boundary",
5576 ASM_COMMENT_START, 2 * PTR_SIZE);
5577
5578 fputc ('\n', asm_out_file);
5579 ASM_OUTPUT_DWARF_ADDR (asm_out_file, TEXT_SECTION);
5580 if (flag_debug_asm)
5581 fprintf (asm_out_file, "\t%s Address", ASM_COMMENT_START);
5582
5583 fputc ('\n', asm_out_file);
5584 ASM_OUTPUT_DWARF_ADDR_DELTA (asm_out_file, text_end_label, TEXT_SECTION);
5585 if (flag_debug_asm)
5586 fprintf (asm_out_file, "%s Length", ASM_COMMENT_START);
5587
5588 fputc ('\n', asm_out_file);
5589 for (i = 0; i < arange_table_in_use; ++i)
5590 {
5591 dw_die_ref a = arange_table[i];
5592

--- 136 unchanged lines hidden (view full) ---

5729 ASM_OUTPUT_DWARF_STRING (asm_out_file, file_table[ft_index]);
5730 fprintf (asm_out_file, "%s File Entry: 0x%lx",
5731 ASM_COMMENT_START, ft_index);
5732 }
5733 else
5734 {
5735 ASM_OUTPUT_ASCII (asm_out_file,
5736 file_table[ft_index],
5737 strlen (file_table[ft_index]) + 1);
5738 }
5739
5740 fputc ('\n', asm_out_file);
5741
5742 /* Include directory index */
5743 output_uleb128 (0);
5744 fputc ('\n', asm_out_file);
5745

--- 5 unchanged lines hidden (view full) ---

5751 output_uleb128 (0);
5752 fputc ('\n', asm_out_file);
5753 }
5754
5755 /* Terminate the file name table */
5756 ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
5757 fputc ('\n', asm_out_file);
5758
5759 /* Set the address register to the first location in the text section */
5760 ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 0);
5761 if (flag_debug_asm)
5762 fprintf (asm_out_file, "\t%s DW_LNE_set_address", ASM_COMMENT_START);
5763
5764 fputc ('\n', asm_out_file);
5765 output_uleb128 (1 + PTR_SIZE);
5766 fputc ('\n', asm_out_file);
5767 ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNE_set_address);
5768 fputc ('\n', asm_out_file);
5769 ASM_OUTPUT_DWARF_ADDR (asm_out_file, TEXT_SECTION);
5770 fputc ('\n', asm_out_file);
5771
5772 /* Generate the line number to PC correspondence table, encoded as
5773 a series of state machine operations. */
5774 current_file = 1;
5775 current_line = 1;
5776 strcpy (prev_line_label, TEXT_SECTION);
5777 for (lt_index = 1; lt_index < line_info_table_in_use; ++lt_index)
5778 {
5779 register dw_line_info_ref line_info;
5780
5781 /* Emit debug info for the address of the current line, choosing
5782 the encoding that uses the least amount of space. */
5783 /* ??? Unfortunately, we have little choice here currently, and must
5784 always use the most general form. Gcc does not know the address
5785 delta itself, so we can't use DW_LNS_advance_pc. There are no known
5786 dwarf2 aware assemblers at this time, so we can't use any special
5787 pseudo ops that would allow the assembler to optimally encode this for
5788 us. Many ports do have length attributes which will give an upper

--- 26 unchanged lines hidden (view full) ---

5815 fputc ('\n', asm_out_file);
5816 ASM_OUTPUT_DWARF_ADDR (asm_out_file, line_label);
5817 fputc ('\n', asm_out_file);
5818 }
5819 strcpy (prev_line_label, line_label);
5820
5821 /* Emit debug info for the source file of the current line, if
5822 different from the previous line. */
5823 line_info = &line_info_table[lt_index];
5824 if (line_info->dw_file_num != current_file)
5825 {
5826 current_file = line_info->dw_file_num;
5827 ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_set_file);
5828 if (flag_debug_asm)
5829 fprintf (asm_out_file, "\t%s DW_LNS_set_file", ASM_COMMENT_START);
5830
5831 fputc ('\n', asm_out_file);
5832 output_uleb128 (current_file);
5833 if (flag_debug_asm)
5834 fprintf (asm_out_file, " (\"%s\")", file_table[current_file]);
5835
5836 fputc ('\n', asm_out_file);
5837 }
5838
5839 /* Emit debug info for the current line number, choosing the encoding
5840 that uses the least amount of space. */
5841 line_offset = line_info->dw_line_num - current_line;
5842 line_delta = line_offset - DWARF_LINE_BASE;
5843 current_line = line_info->dw_line_num;
5844 if (line_delta >= 0 && line_delta < (DWARF_LINE_RANGE - 1))
5845 {
5846 /* This can handle deltas from -10 to 234, using the current
5847 definitions of DWARF_LINE_BASE and DWARF_LINE_RANGE. This
5848 takes 1 byte. */
5849 ASM_OUTPUT_DWARF_DATA1 (asm_out_file,
5850 DWARF_LINE_OPCODE_BASE + line_delta);
5851 if (flag_debug_asm)
5852 fprintf (asm_out_file,
5853 "\t%s line %ld", ASM_COMMENT_START, current_line);
5854
5855 fputc ('\n', asm_out_file);
5856 }
5857 else
5858 {
5859 /* This can handle any delta. This takes at least 4 bytes, depending
5860 on the value being encoded. */
5861 ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_advance_line);
5862 if (flag_debug_asm)
5863 fprintf (asm_out_file, "\t%s advance to line %ld",
5864 ASM_COMMENT_START, current_line);
5865
5866 fputc ('\n', asm_out_file);
5867 output_sleb128 (line_offset);
5868 fputc ('\n', asm_out_file);
5869 ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_copy);
5870 fputc ('\n', asm_out_file);
5871 }
5872 }
5873
5874 /* Emit debug info for the address of the end of the function. */
5875 if (0)
5876 {
5877 ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_fixed_advance_pc);
5878 if (flag_debug_asm)

--- 32 unchanged lines hidden (view full) ---

5911 function = 0;
5912 current_file = 1;
5913 current_line = 1;
5914 for (lt_index = 0; lt_index < separate_line_info_table_in_use; )
5915 {
5916 register dw_separate_line_info_ref line_info
5917 = &separate_line_info_table[lt_index];
5918
5919 /* Emit debug info for the address of the current line. If this is
5920 a new function, or the first line of a function, then we need
5921 to handle it differently. */
5922 ASM_GENERATE_INTERNAL_LABEL (line_label, SEPARATE_LINE_CODE_LABEL,
5923 lt_index);
5924 if (function != line_info->function)
5925 {
5926 function = line_info->function;

--- 84 unchanged lines hidden (view full) ---

6011 if (flag_debug_asm)
6012 fprintf (asm_out_file, "\t%s advance to line %ld",
6013 ASM_COMMENT_START, current_line);
6014
6015 fputc ('\n', asm_out_file);
6016 output_sleb128 (line_offset);
6017 fputc ('\n', asm_out_file);
6018 ASM_OUTPUT_DWARF_DATA1 (asm_out_file, DW_LNS_copy);
6019 fputc ('\n', asm_out_file);
6020 }
6021 }
6022
6023 ++lt_index;
6024
6025 /* If we're done with a function, end its sequence. */
6026 if (lt_index == separate_line_info_table_in_use
6027 || separate_line_info_table[lt_index].function != function)
6028 {
6029 current_file = 1;
6030 current_line = 1;

--- 1017 unchanged lines hidden (view full) ---

7048
7049 /* This decl represents a formal parameter which was optimized out.
7050 Note that DECL_INCOMING_RTL may be NULL in here, but we handle
7051 all* cases where (rtl == NULL_RTX) just below. */
7052 if (declared_type == passed_type)
7053 rtl = DECL_INCOMING_RTL (decl);
7054 else if (! BYTES_BIG_ENDIAN
7055 && TREE_CODE (declared_type) == INTEGER_TYPE
7056 && TYPE_SIZE (declared_type) <= TYPE_SIZE (passed_type))
7057 rtl = DECL_INCOMING_RTL (decl);
7058 }
7059 }
7060
7061 if (rtl == NULL_RTX)
7062 return;
7063
7064 rtl = eliminate_regs (rtl, 0, NULL_RTX);
7065#ifdef LEAF_REG_REMAP
7066 if (leaf_function)
7067 leaf_renumber_regs_insn (rtl);
7068#endif
7069
7070 switch (GET_CODE (rtl))
7071 {
7072 case ADDRESSOF:
7073 /* The address of a variable that was optimized away; don't emit
7074 anything. */

--- 448 unchanged lines hidden (view full) ---

7523
7524 decl_scope_table[decl_scope_depth].scope = scope;
7525
7526 /* Sometimes, while recursively emitting subtypes within a class type,
7527 we end up recuring on a subtype at a higher level then the current
7528 subtype. In such a case, we need to search the decl_scope_table to
7529 find the parent of this subtype. */
7530
7531 if (TREE_CODE_CLASS (TREE_CODE (scope)) == 't')
7532 containing_scope = TYPE_CONTEXT (scope);
7533 else
7534 containing_scope = NULL_TREE;
7535
7536 /* The normal case. */
7537 if (decl_scope_depth == 0
7538 || containing_scope == NULL_TREE
7539 /* Ignore namespaces for the moment. */

--- 35 unchanged lines hidden (view full) ---

7575 containing_scope = decl_class_context (t);
7576 else
7577 containing_scope = DECL_CONTEXT (t);
7578
7579 /* Ignore namespaces for the moment. */
7580 if (containing_scope && TREE_CODE (containing_scope) == NAMESPACE_DECL)
7581 containing_scope = NULL_TREE;
7582
7583 /* Function-local tags and functions get stuck in limbo until they are
7584 fixed up by decls_for_scope. */
7585 if (context_die == NULL && containing_scope != NULL_TREE
7586 && (TREE_CODE (t) == FUNCTION_DECL || is_tagged_type (t)))
7587 return NULL;
7588
7589 if (containing_scope == NULL_TREE)
7590 scope_die = comp_unit_die;

--- 20 unchanged lines hidden (view full) ---

7611 {
7612 scope_die = context_die;
7613 /* Since the checks below are no longer applicable. */
7614 i = 0;
7615 }
7616
7617 if (i < 0)
7618 {
7619 if (scope_die != comp_unit_die
7620 || TREE_CODE_CLASS (TREE_CODE (containing_scope)) != 't')
7621 abort ();
7622 if (debug_info_level > DINFO_LEVEL_TERSE
7623 && !TREE_ASM_WRITTEN (containing_scope))
7624 abort ();
7625 }
7626 }
7627
7628 return scope_die;
7629}
7630
7631/* Pop a declaration scope. */
7632static inline void

--- 243 unchanged lines hidden (view full) ---

7876 --pending_types;
7877 type = pending_types_list[pending_types];
7878 gen_type_die (type, context_die);
7879 if (!TREE_ASM_WRITTEN (type))
7880 abort ();
7881 }
7882}
7883
7884/* Generate a DIE to represent an inlined instance of an enumeration type. */
7885
7886static void
7887gen_inlined_enumeration_type_die (type, context_die)
7888 register tree type;
7889 register dw_die_ref context_die;
7890{
7891 register dw_die_ref type_die = new_die (DW_TAG_enumeration_type,

--- 265 unchanged lines hidden (view full) ---

8157 remove_children (subr_die);
8158 }
8159 else if (old_die)
8160 {
8161 register unsigned file_index
8162 = lookup_filename (DECL_SOURCE_FILE (decl));
8163
8164 if (get_AT_flag (old_die, DW_AT_declaration) != 1)
8165 abort ();
8166
8167 /* If the definition comes from the same place as the declaration,
8168 maybe use the old DIE. We always want the DIE for this function
8169 that has the *_pc attributes to be under comp_unit_die so the
8170 debugger can find it. For inlines, that is the concrete instance,
8171 so we can use the old DIE here. For non-inline methods, we want a
8172 specification DIE at toplevel, so we need a new DIE. For local
8173 class methods, this does not apply. */

--- 311 unchanged lines hidden (view full) ---

8485 else
8486 add_name_and_src_coords_attributes (lbl_die, decl);
8487
8488 if (DECL_ABSTRACT (decl))
8489 equate_decl_number_to_die (decl, lbl_die);
8490 else
8491 {
8492 insn = DECL_RTL (decl);
8493 if (GET_CODE (insn) == CODE_LABEL)
8494 {
8495 /* When optimization is enabled (via -O) some parts of the compiler
8496 (e.g. jump.c and cse.c) may try to delete CODE_LABEL insns which
8497 represent source-level labels which were explicitly declared by
8498 the user. This really shouldn't be happening though, so catch
8499 it if it ever does happen. */
8500 if (INSN_DELETED_P (insn))
8501 abort ();

--- 290 unchanged lines hidden (view full) ---

8792 register dw_die_ref type_die = lookup_type_die (type);
8793 register dw_die_ref scope_die = 0;
8794 register int nested = 0;
8795
8796 if (type_die && ! TYPE_SIZE (type))
8797 return;
8798
8799 if (TYPE_CONTEXT (type) != NULL_TREE
8800 && TREE_CODE_CLASS (TREE_CODE (TYPE_CONTEXT (type))) == 't')
8801 nested = 1;
8802
8803 scope_die = scope_die_for (type, context_die);
8804
8805 if (! type_die || (nested && scope_die == comp_unit_die))
8806 /* First occurrence of type or toplevel definition of nested class. */
8807 {
8808 register dw_die_ref old_die = type_die;

--- 42 unchanged lines hidden (view full) ---

8851 tree vtype = DECL_FCONTEXT (TYPE_VFIELD (type));
8852
8853 gen_type_die (vtype, context_die);
8854 add_AT_die_ref (type_die, DW_AT_containing_type,
8855 lookup_type_die (vtype));
8856 }
8857 }
8858 else
8859 add_AT_flag (type_die, DW_AT_declaration, 1);
8860}
8861
8862/* Generate a DIE for a subroutine _type_. */
8863
8864static void
8865gen_subroutine_type_die (type, context_die)
8866 register tree type;
8867 register dw_die_ref context_die;

--- 137 unchanged lines hidden (view full) ---

9005
9006 case ENUMERAL_TYPE:
9007 case RECORD_TYPE:
9008 case UNION_TYPE:
9009 case QUAL_UNION_TYPE:
9010 /* If this is a nested type whose containing class hasn't been
9011 written out yet, writing it out will cover this one, too. */
9012 if (TYPE_CONTEXT (type)
9013 && TREE_CODE_CLASS (TREE_CODE (TYPE_CONTEXT (type))) == 't'
9014 && ! TREE_ASM_WRITTEN (TYPE_CONTEXT (type)))
9015 {
9016 gen_type_die (TYPE_CONTEXT (type), context_die);
9017
9018 if (TREE_ASM_WRITTEN (TYPE_CONTEXT (type)))
9019 return;
9020
9021 /* If that failed, attach ourselves to the stub. */
9022 push_decl_scope (TYPE_CONTEXT (type));
9023 context_die = lookup_type_die (TYPE_CONTEXT (type));
9024 }
9025
9026 if (TREE_CODE (type) == ENUMERAL_TYPE)
9027 gen_enumeration_type_die (type, context_die);
9028 else
9029 gen_struct_or_union_type_die (type, context_die);
9030
9031 if (TYPE_CONTEXT (type)
9032 && TREE_CODE_CLASS (TREE_CODE (TYPE_CONTEXT (type))) == 't'
9033 && ! TREE_ASM_WRITTEN (TYPE_CONTEXT (type)))
9034 pop_decl_scope ();
9035
9036 /* Don't set TREE_ASM_WRITTEN on an incomplete struct; we want to fix
9037 it up if it is ever completed. gen_*_type_die will set it for us
9038 when appropriate. */
9039 return;
9040

--- 363 unchanged lines hidden (view full) ---

9404 If it does, then totally ignoring it is bound to screw up our count of
9405 blocks, and that in turn will completely screw up the labels we will
9406 reference in subsequent DW_AT_low_pc and DW_AT_high_pc attributes (for
9407 subsequent blocks). (It's too bad that BLOCK nodes don't carry their
9408 own sequence numbers with them!) */
9409 if (DECL_IGNORED_P (decl))
9410 {
9411 if (TREE_CODE (decl) == FUNCTION_DECL
9412 && DECL_INITIAL (decl) != NULL)
9413 abort ();
9414
9415 return;
9416 }
9417
9418 switch (TREE_CODE (decl))
9419 {
9420 case FUNCTION_DECL:

--- 349 unchanged lines hidden (view full) ---

9770 /* Generate the initial DIE for the .debug section. Note that the (string)
9771 value given in the DW_AT_name attribute of the DW_TAG_compile_unit DIE
9772 will (typically) be a relative pathname and that this pathname should be
9773 taken as being relative to the directory from which the compiler was
9774 invoked when the given (base) source file was compiled. */
9775 gen_compile_unit_die (main_input_filename);
9776
9777 ASM_GENERATE_INTERNAL_LABEL (text_end_label, TEXT_END_LABEL, 0);
9778}
9779
9780/* Output stuff that dwarf requires at the end of every file,
9781 and generate the DWARF-2 debugging info. */
9782
9783void
9784dwarf2out_finish ()
9785{

--- 19 unchanged lines hidden (view full) ---

9805 else if (die == comp_unit_die)
9806 ;
9807 else
9808 abort ();
9809 }
9810 free (node);
9811 }
9812
9813 /* Traverse the DIE tree and add sibling attributes to those DIE's
9814 that have children. */
9815 add_sibling_attributes (comp_unit_die);
9816
9817 /* Output a terminator label for the .text section. */
9818 fputc ('\n', asm_out_file);
9819 ASM_OUTPUT_SECTION (asm_out_file, TEXT_SECTION);
9820 ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, TEXT_END_LABEL, 0);

--- 16 unchanged lines hidden (view full) ---

9837 fputc ('\n', asm_out_file);
9838 ASM_OUTPUT_SECTION (asm_out_file, DEBUG_LINE_SECTION);
9839 output_line_info ();
9840
9841 /* We can only use the low/high_pc attributes if all of the code
9842 was in .text. */
9843 if (separate_line_info_table_in_use == 0)
9844 {
9845 add_AT_lbl_id (comp_unit_die, DW_AT_low_pc, TEXT_SECTION);
9846 add_AT_lbl_id (comp_unit_die, DW_AT_high_pc, text_end_label);
9847 }
9848
9849 add_AT_section_offset (comp_unit_die, DW_AT_stmt_list, DEBUG_LINE_SECTION);
9850 }
9851
9852 /* Output the abbreviation table. */
9853 fputc ('\n', asm_out_file);
9854 ASM_OUTPUT_SECTION (asm_out_file, ABBREV_SECTION);
9855 build_abbrev_table (comp_unit_die);
9856 output_abbrev_section ();
9857

--- 27 unchanged lines hidden ---