OSDN Git Service

gcc
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Jun 2009 00:02:10 +0000 (00:02 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Jun 2009 00:02:10 +0000 (00:02 +0000)
* dwarf2.h: Remove.
* Makefile.in (DWARF2_H): New variable.
(except.o): Use it.
(dwarf2out.o): Likewise.
(dwarf2asm.o): Likewise.
* config/i386/t-i386: Use DWARF2_H.
* except.c: Include elf/dwarf2.h.
* unwind-dw2.c: Include elf/dwarf2.h.
* dwarf2out.c: Include elf/dwarf2.h.
(dw_loc_descr_struct) <dw_loc_opc>: Now a bitfield.
<dtprel>: New field.
(dwarf_stack_op_name): Don't handle INTERNAL_DW_OP_tls_addr.
(size_of_loc_descr): Likewise.
(output_loc_operands_raw): Likewise.
(output_loc_operands): Handle new dtprel field.
(loc_checksum): Update.
(loc_descriptor_from_tree_1) <VAR_DDECL>: Set dtprel field.
* unwind-dw2-fde-glibc.c: Include elf/dwarf2.h.
* unwind-dw2-fde.c: Include elf/dwarf2.h.
* dwarf2asm.c: Include elf/dwarf2.h.
* unwind-dw2-fde-darwin.c: Include elf/dwarf2.h.
* config/mmix/mmix.c: Include elf/dwarf2.h.
* config/rs6000/darwin-fallback.c: Include elf/dwarf2.h.
* config/xtensa/unwind-dw2-xtensa.c: Include elf/dwarf2.h.
* config/sh/sh.c: Include elf/dwarf2.h.
* config/i386/i386.c: Include elf/dwarf2.h.
gcc/ada
* raise-gcc.c: Include elf/dwarf2.h.
include
* elf/dwarf2.h: New file.  Merged with gdb.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149070 138bc75d-0d04-0410-961f-82ee72b054a4

19 files changed:
gcc/ChangeLog
gcc/Makefile.in
gcc/ada/ChangeLog
gcc/ada/raise-gcc.c
gcc/config/i386/i386.c
gcc/config/i386/t-i386
gcc/config/mmix/mmix.c
gcc/config/rs6000/darwin-fallback.c
gcc/config/sh/sh.c
gcc/config/xtensa/unwind-dw2-xtensa.c
gcc/dwarf2asm.c
gcc/dwarf2out.c
gcc/except.c
gcc/unwind-dw2-fde-darwin.c
gcc/unwind-dw2-fde-glibc.c
gcc/unwind-dw2-fde.c
gcc/unwind-dw2.c
include/ChangeLog
include/elf/dwarf2.h [moved from gcc/dwarf2.h with 97% similarity]

index 52812c8..61ffa34 100644 (file)
@@ -1,3 +1,32 @@
+2009-06-29  Tom Tromey  <tromey@redhat.com>
+
+       * dwarf2.h: Remove.
+       * Makefile.in (DWARF2_H): New variable.
+       (except.o): Use it.
+       (dwarf2out.o): Likewise.
+       (dwarf2asm.o): Likewise.
+       * config/i386/t-i386: Use DWARF2_H.
+       * except.c: Include elf/dwarf2.h.
+       * unwind-dw2.c: Include elf/dwarf2.h.
+       * dwarf2out.c: Include elf/dwarf2.h.
+       (dw_loc_descr_struct) <dw_loc_opc>: Now a bitfield.
+       <dtprel>: New field.
+       (dwarf_stack_op_name): Don't handle INTERNAL_DW_OP_tls_addr.
+       (size_of_loc_descr): Likewise.
+       (output_loc_operands_raw): Likewise.
+       (output_loc_operands): Handle new dtprel field.
+       (loc_checksum): Update.
+       (loc_descriptor_from_tree_1) <VAR_DDECL>: Set dtprel field.
+       * unwind-dw2-fde-glibc.c: Include elf/dwarf2.h.
+       * unwind-dw2-fde.c: Include elf/dwarf2.h.
+       * dwarf2asm.c: Include elf/dwarf2.h.
+       * unwind-dw2-fde-darwin.c: Include elf/dwarf2.h.
+       * config/mmix/mmix.c: Include elf/dwarf2.h.
+       * config/rs6000/darwin-fallback.c: Include elf/dwarf2.h.
+       * config/xtensa/unwind-dw2-xtensa.c: Include elf/dwarf2.h.
+       * config/sh/sh.c: Include elf/dwarf2.h.
+       * config/i386/i386.c: Include elf/dwarf2.h.
+
 2009-06-29  DJ Delorie  <dj@redhat.com>
 
        * config/mep/mep.h (CPP_SPEC): Remove __cop macro.
index d8bbc68..8bd09a8 100644 (file)
@@ -405,6 +405,7 @@ SPLAY_TREE_H= $(srcdir)/../include/splay-tree.h
 FIBHEAP_H   = $(srcdir)/../include/fibheap.h
 PARTITION_H = $(srcdir)/../include/partition.h
 MD5_H      = $(srcdir)/../include/md5.h
+DWARF2_H    = $(srcdir)/../include/elf/dwarf2.h
 
 # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
 NATIVE_SYSTEM_HEADER_DIR = /usr/include
@@ -2592,7 +2593,7 @@ except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    $(TREE_H) $(FLAGS_H) $(EXCEPT_H) $(FUNCTION_H) $(EXPR_H) libfuncs.h \
    langhooks.h insn-config.h hard-reg-set.h $(BASIC_BLOCK_H) output.h \
    dwarf2asm.h dwarf2out.h $(TOPLEV_H) $(HASHTAB_H) intl.h $(GGC_H) \
-   gt-except.h $(CGRAPH_H) $(INTEGRATE_H) $(DIAGNOSTIC_H) dwarf2.h \
+   gt-except.h $(CGRAPH_H) $(INTEGRATE_H) $(DIAGNOSTIC_H) $(DWARF2_H) \
    $(TARGET_H) $(TM_P_H) $(TREE_PASS_H) $(TIMEVAR_H) $(TREE_FLOW_H)
 expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
    $(TREE_H) $(FLAGS_H) $(FUNCTION_H) $(REGS_H) $(EXPR_H) $(OPTABS_H) \
@@ -2635,14 +2636,14 @@ sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) debug.h \
    output.h $(TOPLEV_H) $(TM_P_H) gsyms.h langhooks.h $(TARGET_H) sdbout.h \
    gt-sdbout.h reload.h $(VARRAY_H)
 dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
-   $(TREE_H) version.h $(RTL_H) dwarf2.h debug.h $(FLAGS_H) insn-config.h \
+   $(TREE_H) version.h $(RTL_H) $(DWARF2_H) debug.h $(FLAGS_H) insn-config.h \
    output.h $(DIAGNOSTIC_H) $(REAL_H) hard-reg-set.h $(REGS_H) $(EXPR_H) \
    libfuncs.h $(TOPLEV_H) dwarf2out.h reload.h $(GGC_H) $(EXCEPT_H) dwarf2asm.h \
    $(TM_P_H) langhooks.h $(HASHTAB_H) gt-dwarf2out.h $(TARGET_H) $(CGRAPH_H) \
    $(MD5_H) $(INPUT_H) $(FUNCTION_H) $(VARRAY_H)
 dwarf2asm.o : dwarf2asm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
    $(FLAGS_H) $(RTL_H) $(TREE_H) output.h dwarf2asm.h $(TM_P_H) $(GGC_H) \
-   gt-dwarf2asm.h dwarf2.h $(SPLAY_TREE_H) $(TARGET_H)
+   gt-dwarf2asm.h $(DWARF2_H) $(SPLAY_TREE_H) $(TARGET_H)
 vmsdbgout.o : vmsdbgout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) version.h \
    $(FLAGS_H) $(RTL_H) output.h vmsdbg.h debug.h langhooks.h $(FUNCTION_H) $(TARGET_H)
 xcoffout.o : xcoffout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
index b4c1dc0..1374c4c 100644 (file)
@@ -1,3 +1,7 @@
+2009-06-29  Tom Tromey  <tromey@redhat.com>
+
+       * raise-gcc.c: Include elf/dwarf2.h.
+
 2009-06-27  Laurent GUERBY  <laurent@guerby.net>
 
        * tb-gcc.c (trace_callback): Add casts to silence warning.
index 1d9efb9..b30145a 100644 (file)
@@ -96,7 +96,7 @@ __gnat_Unwind_ForcedUnwind (_Unwind_Exception *, void *, void *);
 
 #ifdef IN_RTS   /* For eh personality routine */
 
-#include "dwarf2.h"
+#include "elf/dwarf2.h"
 #include "unwind-dw2-fde.h"
 #include "unwind-pe.h"
 
index c8c4bbf..8bb82f3 100644 (file)
@@ -48,7 +48,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "langhooks.h"
 #include "cgraph.h"
 #include "gimple.h"
-#include "dwarf2.h"
+#include "elf/dwarf2.h"
 #include "df.h"
 #include "tm-constrs.h"
 #include "params.h"
index 01e5ce4..087c474 100644 (file)
@@ -22,7 +22,7 @@ i386.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
   $(INSN_ATTR_H) $(FLAGS_H) $(C_COMMON_H) except.h $(FUNCTION_H) \
   $(RECOG_H) $(EXPR_H) $(OPTABS_H) toplev.h $(BASIC_BLOCK_H) \
   $(GGC_H) $(TARGET_H) $(TARGET_DEF_H) langhooks.h $(CGRAPH_H) \
-  $(TREE_GIMPLE_H) dwarf2.h $(DF_H) tm-constrs.h $(PARAMS_H)
+  $(TREE_GIMPLE_H) $(DWARF2_H) $(DF_H) tm-constrs.h $(PARAMS_H)
 
 i386-c.o: $(srcdir)/config/i386/i386-c.c \
   $(srcdir)/config/i386/i386-protos.h $(CONFIG_H) $(SYSTEM_H) coretypes.h \
index 67b1b23..f815124 100644 (file)
@@ -36,7 +36,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "toplev.h"
 #include "recog.h"
 #include "ggc.h"
-#include "dwarf2.h"
+#include "elf/dwarf2.h"
 #include "debug.h"
 #include "tm_p.h"
 #include "integrate.h"
index 4591071..e4d5afe 100644 (file)
@@ -28,7 +28,7 @@
 #include "tsystem.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "dwarf2.h"
+#include "elf/dwarf2.h"
 #include "unwind.h"
 #include "unwind-dw2.h"
 #include <stdint.h>
index 7c72f00..08cae31 100644 (file)
@@ -38,7 +38,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "toplev.h"
 #include "recog.h"
 #include "integrate.h"
-#include "dwarf2.h"
+#include "elf/dwarf2.h"
 #include "tm_p.h"
 #include "target.h"
 #include "target-def.h"
index e7ca86a..235b8a1 100644 (file)
@@ -28,7 +28,7 @@
 #include "tsystem.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "dwarf2.h"
+#include "elf/dwarf2.h"
 #include "unwind.h"
 #ifdef __USING_SJLJ_EXCEPTIONS__
 # define NO_SIZE_OF_ENCODED_VALUE
index 6f21ff6..4e2c998 100644 (file)
@@ -29,7 +29,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "output.h"
 #include "target.h"
 #include "dwarf2asm.h"
-#include "dwarf2.h"
+#include "elf/dwarf2.h"
 #include "splay-tree.h"
 #include "ggc.h"
 #include "tm_p.h"
index c57b753..f954d6e 100644 (file)
@@ -74,7 +74,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "expr.h"
 #include "libfuncs.h"
 #include "except.h"
-#include "dwarf2.h"
+#include "elf/dwarf2.h"
 #include "dwarf2out.h"
 #include "dwarf2asm.h"
 #include "toplev.h"
@@ -3886,7 +3886,10 @@ dw_val_node;
 
 typedef struct GTY(()) dw_loc_descr_struct {
   dw_loc_descr_ref dw_loc_next;
-  enum dwarf_location_atom dw_loc_opc;
+  ENUM_BITFIELD (dwarf_location_atom) dw_loc_opc : 8;
+  /* Used to distinguish DW_OP_addr with a direct symbol relocation
+     from DW_OP_addr with a dtp-relative symbol relocation.  */
+  unsigned int dtprel : 1;
   int dw_loc_addr;
   dw_val_node dw_loc_oprnd1;
   dw_val_node dw_loc_oprnd2;
@@ -3918,7 +3921,6 @@ dwarf_stack_op_name (unsigned int op)
   switch (op)
     {
     case DW_OP_addr:
-    case INTERNAL_DW_OP_tls_addr:
       return "DW_OP_addr";
     case DW_OP_deref:
       return "DW_OP_deref";
@@ -4333,7 +4335,6 @@ size_of_loc_descr (dw_loc_descr_ref loc)
   switch (loc->dw_loc_opc)
     {
     case DW_OP_addr:
-    case INTERNAL_DW_OP_tls_addr:
       size += DWARF2_ADDR_SIZE;
       break;
     case DW_OP_const1u:
@@ -4474,9 +4475,6 @@ output_loc_operands (dw_loc_descr_ref loc)
   switch (loc->dw_loc_opc)
     {
 #ifdef DWARF2_DEBUGGING_INFO
-    case DW_OP_addr:
-      dw2_asm_output_addr_rtx (DWARF2_ADDR_SIZE, val1->v.val_addr, NULL);
-      break;
     case DW_OP_const2u:
     case DW_OP_const2s:
       dw2_asm_output_data (2, val1->v.val_int, NULL);
@@ -4502,7 +4500,6 @@ output_loc_operands (dw_loc_descr_ref loc)
       }
       break;
 #else
-    case DW_OP_addr:
     case DW_OP_const2u:
     case DW_OP_const2s:
     case DW_OP_const4u:
@@ -4585,16 +4582,27 @@ output_loc_operands (dw_loc_descr_ref loc)
       dw2_asm_output_data (1, val1->v.val_int, NULL);
       break;
 
-    case INTERNAL_DW_OP_tls_addr:
-      if (targetm.asm_out.output_dwarf_dtprel)
+    case DW_OP_addr:
+      if (loc->dtprel)
        {
-         targetm.asm_out.output_dwarf_dtprel (asm_out_file,
-                                              DWARF2_ADDR_SIZE,
-                                              val1->v.val_addr);
-         fputc ('\n', asm_out_file);
+         if (targetm.asm_out.output_dwarf_dtprel)
+           {
+             targetm.asm_out.output_dwarf_dtprel (asm_out_file,
+                                                  DWARF2_ADDR_SIZE,
+                                                  val1->v.val_addr);
+             fputc ('\n', asm_out_file);
+           }
+         else
+           gcc_unreachable ();
        }
       else
-       gcc_unreachable ();
+       {
+#ifdef DWARF2_DEBUGGING_INFO
+         dw2_asm_output_addr_rtx (DWARF2_ADDR_SIZE, val1->v.val_addr, NULL);
+#else
+         gcc_unreachable ();
+#endif
+       }
       break;
 
     default:
@@ -4728,9 +4736,6 @@ output_loc_operands_raw (dw_loc_descr_ref loc)
       dw2_asm_output_data_sleb128_raw (val2->v.val_int);
       break;
 
-    case INTERNAL_DW_OP_tls_addr:
-      gcc_unreachable ();
-
     default:
       /* Other codes have no operands.  */
       break;
@@ -7280,7 +7285,10 @@ pop_compile_unit (dw_die_ref old_unit)
 static inline void
 loc_checksum (dw_loc_descr_ref loc, struct md5_ctx *ctx)
 {
-  CHECKSUM (loc->dw_loc_opc);
+  int tem;
+
+  tem = (loc->dtprel << 8) | ((unsigned int) loc->dw_loc_opc);
+  CHECKSUM (tem);
   CHECKSUM (loc->dw_loc_oprnd1);
   CHECKSUM (loc->dw_loc_oprnd2);
 }
@@ -10772,6 +10780,7 @@ loc_descriptor_from_tree_1 (tree loc, int want_address)
          rtx rtl;
          enum dwarf_location_atom first_op;
          enum dwarf_location_atom second_op;
+         bool dtprel = false;
 
          if (targetm.have_tls)
            {
@@ -10785,7 +10794,8 @@ loc_descriptor_from_tree_1 (tree loc, int want_address)
                  module.  */
              if (DECL_EXTERNAL (loc) && !targetm.binds_local_p (loc))
                return 0;
-             first_op = (enum dwarf_location_atom) INTERNAL_DW_OP_tls_addr;
+             first_op = DW_OP_addr;
+             dtprel = true;
              second_op = DW_OP_GNU_push_tls_address;
            }
          else
@@ -10810,6 +10820,7 @@ loc_descriptor_from_tree_1 (tree loc, int want_address)
          ret = new_loc_descr (first_op, 0, 0);
          ret->dw_loc_oprnd1.val_class = dw_val_class_addr;
          ret->dw_loc_oprnd1.v.val_addr = rtl;
+         ret->dtprel = dtprel;
 
          ret1 = new_loc_descr (second_op, 0, 0);
          add_loc_descr (&ret, ret1);
index 95163cc..4a02fe3 100644 (file)
@@ -65,7 +65,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "output.h"
 #include "dwarf2asm.h"
 #include "dwarf2out.h"
-#include "dwarf2.h"
+#include "elf/dwarf2.h"
 #include "toplev.h"
 #include "hashtab.h"
 #include "intl.h"
index cd00ea2..c033bbe 100644 (file)
@@ -27,7 +27,7 @@
 #include "tsystem.h"
 #include <string.h>
 #include <stdlib.h>
-#include "dwarf2.h"
+#include "elf/dwarf2.h"
 #include "unwind.h"
 #define NO_BASE_OF_ENCODED_VALUE
 #define DWARF2_OBJECT_END_PTR_EXTENSION
index d246ae1..0e3d0a3 100644 (file)
@@ -37,7 +37,7 @@
 #endif
 #include "coretypes.h"
 #include "tm.h"
-#include "dwarf2.h"
+#include "elf/dwarf2.h"
 #include "unwind.h"
 #define NO_BASE_OF_ENCODED_VALUE
 #include "unwind-pe.h"
index 4aa9d82..6780700 100644 (file)
@@ -29,7 +29,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "tsystem.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "dwarf2.h"
+#include "elf/dwarf2.h"
 #include "unwind.h"
 #define NO_BASE_OF_ENCODED_VALUE
 #include "unwind-pe.h"
index 68a1a28..0ceda12 100644 (file)
@@ -27,7 +27,7 @@
 #include "tsystem.h"
 #include "coretypes.h"
 #include "tm.h"
-#include "dwarf2.h"
+#include "elf/dwarf2.h"
 #include "unwind.h"
 #ifdef __USING_SJLJ_EXCEPTIONS__
 # define NO_SIZE_OF_ENCODED_VALUE
index b680b43..148e404 100644 (file)
@@ -1,3 +1,7 @@
+2009-06-29  Tom Tromey  <tromey@redhat.com>
+
+       * elf/dwarf2.h: New file.  Merged with gdb.
+
 2009-06-09  Ian Lance Taylor  <ian@airs.com>
 
        * ansidecl.h (ATTRIBUTE_UNUSED_LABEL): Define for C++.
similarity index 97%
rename from gcc/dwarf2.h
rename to include/elf/dwarf2.h
index d106b67..f0dbfd2 100644 (file)
    by UNIX International.  Copies of this specification are available from
    UNIX International, 20 Waterview Boulevard, Parsippany, NJ, 07054.
 
-   This file also now contains definitions from the DWARF 3 specification.  */
+   This file also now contains definitions from the DWARF 3 specification
+   published Dec 20, 2005, available from: http://dwarf.freestandards.org.  */
 
 /* This file is shared between GCC and GDB, and should not contain
    prototypes.  */
 
-#ifndef GCC_DWARF2_H
-#define GCC_DWARF2_H
+#ifndef _ELF_DWARF2_H
+#define _ELF_DWARF2_H
 
 /* Structure found in the .debug_line section.  */
 typedef struct
@@ -281,7 +282,7 @@ enum dwarf_attribute
     DW_AT_return_addr = 0x2a,
     DW_AT_start_scope = 0x2c,
     DW_AT_bit_stride = 0x2e,
-    DW_AT_stride_size = DW_AT_bit_stride,
+#define DW_AT_stride_size   DW_AT_bit_stride  /* Note: The use of DW_AT_stride_size is deprecated.  */
     DW_AT_upper_bound = 0x2f,
     DW_AT_abstract_origin = 0x31,
     DW_AT_accessibility = 0x32,
@@ -317,7 +318,7 @@ enum dwarf_attribute
     DW_AT_associated    = 0x4f,
     DW_AT_data_location = 0x50,
     DW_AT_byte_stride   = 0x51,
-    DW_AT_stride        = DW_AT_byte_stride,
+#define DW_AT_stride   DW_AT_byte_stride  /* Note: The use of DW_AT_stride is deprecated.  */
     DW_AT_entry_pc      = 0x52,
     DW_AT_use_UTF8      = 0x53,
     DW_AT_extension     = 0x54,
@@ -563,12 +564,8 @@ enum dwarf_location_atom
     DW_OP_HP_mod_range   = 0xe4,
     DW_OP_HP_unmod_range = 0xe5,
     DW_OP_HP_tls         = 0xe6,
-
-    /* Used internally in dwarf2out.c to distinguish DW_OP_addr with a
-       direct symbol relocation from DW_OP_addr with a dtp-relative
-       symbol relocation.  */
-    INTERNAL_DW_OP_tls_addr = 0x103
-
+    /* PGI (STMicroelectronics) extensions.  */
+    DW_OP_PGI_omp_thread_num = 0xf8
   };
 
 /* Type encodings.  */
@@ -722,6 +719,7 @@ enum dwarf_line_number_x_ops
     DW_LNE_end_sequence = 1,
     DW_LNE_set_address = 2,
     DW_LNE_define_file = 3,
+    DW_LNE_set_discriminator = 4,
     /* HP extensions.  */
     DW_LNE_HP_negate_is_UV_update      = 0x11,
     DW_LNE_HP_push_context             = 0x12,
@@ -782,6 +780,7 @@ enum dwarf_call_frame_info
 
 #define DW_CIE_ID        0xffffffff
 #define DW64_CIE_ID      0xffffffffffffffffULL
+#define DW_CIE_VERSION   1
 
 #define DW_CFA_extended   0
 
@@ -856,4 +855,4 @@ enum dwarf_macinfo_record_type
 
 #define DW_EH_PE_indirect      0x80
 
-#endif /* dwarf2.h */
+#endif /* _ELF_DWARF2_H */