This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: problem with debug_loc patch


Richard Henderson <rth@redhat.com> writes:

> At least some of the declarations are outside the DWARF2_DEBUGGING_INFO
> ifdefs.  You can see this as
> 
> ../../../src/gcc/dwarf2out.c:2234: warning: `output_loc_list' declared `static' but never defined
> ../../../src/gcc/dwarf2out.c:2235: warning: `gen_internal_sym' declared `static' but never defined
> 
> when cross-compiling to alpha-dec-osf5.1 or powerpc-ibm-aix4.3.3.
> 
> When building with the native compilers this is a hard error and
> breaks the build.  Would you please fix this?
Sure.

I think this is right (I'm on my way out for half an hour, i'll verify it when i get
back).

Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/dwarf2out.c,v
retrieving revision 1.277
diff -c -3 -p -w -B -b -r1.277 dwarf2out.c
*** dwarf2out.c	2001/06/10 13:47:55	1.277
--- dwarf2out.c	2001/06/29 16:57:40
*************** static unsigned long size_of_locs	PARAMS
*** 2225,2238 ****
  static void output_loc_operands		PARAMS ((dw_loc_descr_ref));
  static void output_loc_sequence		PARAMS ((dw_loc_descr_ref));
  
! static dw_loc_list_ref new_loc_list     PARAMS ((dw_loc_descr_ref, 
! 						 const char *, const char *,
! 						 const char *, unsigned));
! static void add_loc_descr_to_loc_list   PARAMS ((dw_loc_list_ref *,
! 						 dw_loc_descr_ref,
! 						 const char *, const char *, const char *));
! static void output_loc_list		PARAMS ((dw_loc_list_ref));
! static char *gen_internal_sym 		PARAMS ((const char *));
  /* Convert a DWARF stack opcode into its string name.  */
  
  static const char *
--- 2225,2231 ----
  static void output_loc_operands		PARAMS ((dw_loc_descr_ref));
  static void output_loc_sequence		PARAMS ((dw_loc_descr_ref));
  
! 
  /* Convert a DWARF stack opcode into its string name.  */
  
  static const char *
*************** new_loc_descr (op, oprnd1, oprnd2)
*** 2560,2588 ****
    return descr;
  }
  
- /* Return a new location list, given the begin and end range, and the
-    expression. gensym tells us whether to generate a new internal
-    symbol for this location list node, which is done for the head of
-    the list only. */ 
- static inline dw_loc_list_ref
- new_loc_list (expr, begin, end, section, gensym)
-      register dw_loc_descr_ref expr;
-      register const char *begin;
-      register const char *end;
-      register const char *section;
-      register unsigned gensym;
- {
-   register dw_loc_list_ref retlist
-     = (dw_loc_list_ref) xcalloc (1, sizeof (dw_loc_list_node));
-   retlist->begin = begin;
-   retlist->end = end;
-   retlist->expr = expr;
-   retlist->section = section;
-   if (gensym) 
-     retlist->ll_symbol = gen_internal_sym ("LLST");
-   return retlist;
- }
- 
  /* Add a location description term to a location description expression.  */
  
  static inline void
--- 2553,2558 ----
*************** add_loc_descr (list_head, descr)
*** 2599,2622 ****
    *d = descr;
  }
  
- /* Add a location description expression to a location list */
- static inline void
- add_loc_descr_to_loc_list (list_head, descr, begin, end, section)
-      register dw_loc_list_ref *list_head;
-      register dw_loc_descr_ref descr;
-      register const char *begin;
-      register const char *end;
-      register const char *section;
- {
-   register dw_loc_list_ref *d;
-   
-   /* Find the end of the chain. */
-   for (d = list_head; (*d) != NULL; d = &(*d)->dw_loc_next)
-     ;
-   /* Add a new location list node to the list */
-   *d = new_loc_list (descr, begin, end, section, 0);
- }
- 
  /* Return the size of a location descriptor.  */
  
  static unsigned long
--- 2569,2574 ----
*************** static void gen_type_die_for_member	PARA
*** 3594,3599 ****
--- 3547,3560 ----
  static rtx save_rtx			PARAMS ((rtx));
  static void splice_child_die		PARAMS ((dw_die_ref, dw_die_ref));
  static int file_info_cmp		PARAMS ((const void *, const void *));
+ static dw_loc_list_ref new_loc_list     PARAMS ((dw_loc_descr_ref, 
+ 						 const char *, const char *,
+ 						 const char *, unsigned));
+ static void add_loc_descr_to_loc_list   PARAMS ((dw_loc_list_ref *,
+ 						 dw_loc_descr_ref,
+ 						 const char *, const char *, const char *));
+ static void output_loc_list		PARAMS ((dw_loc_list_ref));
+ static char *gen_internal_sym 		PARAMS ((const char *));
  
  /* Section names used to hold DWARF debugging information.  */
  #ifndef DEBUG_INFO_SECTION
*************** dwarf_type_encoding_name (enc)
*** 4139,4144 ****
--- 4105,4152 ----
      }
  }
  #endif
+ /* Return a new location list, given the begin and end range, and the
+    expression. gensym tells us whether to generate a new internal
+    symbol for this location list node, which is done for the head of
+    the list only. */ 
+ static inline dw_loc_list_ref
+ new_loc_list (expr, begin, end, section, gensym)
+      register dw_loc_descr_ref expr;
+      register const char *begin;
+      register const char *end;
+      register const char *section;
+      register unsigned gensym;
+ {
+   register dw_loc_list_ref retlist
+     = (dw_loc_list_ref) xcalloc (1, sizeof (dw_loc_list_node));
+   retlist->begin = begin;
+   retlist->end = end;
+   retlist->expr = expr;
+   retlist->section = section;
+   if (gensym) 
+     retlist->ll_symbol = gen_internal_sym ("LLST");
+   return retlist;
+ }
+ 
+ /* Add a location description expression to a location list */
+ static inline void
+ add_loc_descr_to_loc_list (list_head, descr, begin, end, section)
+      register dw_loc_list_ref *list_head;
+      register dw_loc_descr_ref descr;
+      register const char *begin;
+      register const char *end;
+      register const char *section;
+ {
+   register dw_loc_list_ref *d;
+   
+   /* Find the end of the chain. */
+   for (d = list_head; (*d) != NULL; d = &(*d)->dw_loc_next)
+     ;
+   /* Add a new location list node to the list */
+   *d = new_loc_list (descr, begin, end, section, 0);
+ }
+ 
+ 
  
  /* Determine the "ultimate origin" of a decl.  The decl may be an inlined
     instance of an inlined instance of a decl which is local to an inline

> 
> 
> r~

-- 
"Years ago, I worked in a natural, organic health food store in
Seattle, Washington.  One day a man walked in and asked, "If I
can melt dry ice, can I swim without getting wet?"  Two days
later I was fired for eating cotton candy and drinking straight
Bosco on the job.
"-Steven Wright


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]