[RFA] dwarf2read.c: Remove useless complaint for external functions.

Pierre Muller pierre.muller@ics-cnrs.unistra.fr
Fri May 28 10:06:00 GMT 2010


  In my recent attempts to understand dwarf reader,
I tried to remove several complaints, when 
the seemed not justified.

  Here is another one:
sometimes, the dwarf2 reader complains about
not being able to find low and high addresses
of a function.
  But if this function is declared external,
it is normal that we don't have these addresses, no?
  
  The patch below check for the presence of 
this flag before complaining.

Pierre Muller
Pascal language support maintainer for GDB


2010-05-28  Pierre Muller  <muller@ics.u-strasbg.fr>

	* dwarf2read.c (read_func_scope): Do not complain for
	external function if bounds are not found.

Index: src/gdb/dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.388
diff -u -p -r1.388 dwarf2read.c
--- src/gdb/dwarf2read.c	21 May 2010 20:45:19 -0000	1.388
+++ src/gdb/dwarf2read.c	28 May 2010 08:39:58 -0000
@@ -3904,9 +3904,11 @@ read_func_scope (struct die_info *die, s
   /* Ignore functions with missing or invalid low and high pc attributes.
*/
   if (!dwarf2_get_pc_bounds (die, &lowpc, &highpc, cu, NULL))
     {
-      complaint (&symfile_complaints,
-                 _("cannot get low and high bounds for subprogram DIE at
%d"),
-                 die->offset);
+      attr = dwarf2_attr (die, DW_AT_external, cu);
+      if (!attr || !DW_UNSND (attr))
+	complaint (&symfile_complaints,
+		   _("cannot get low and high bounds for subprogram DIE at
%d"),
+		   die->offset);
       return;
     }
 




More information about the Gdb-patches mailing list