This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Update .debug_loc dumping


There is no need to adjust for section address. We should always
output "<End of list>". Otherwise, it looks kind of odd.


H.J.
----
2005-01-04  H.J. Lu  <hongjiu.lu@intel.com>

	* readelf.c (display_debug_loc): Display if start >= end. Don't
	adjust for section address. Always output <End of list>.

--- readelf.c.loc	2005-01-04 17:49:32.533290104 -0800
+++ readelf.c	2005-01-04 17:54:56.137213043 -0800
@@ -9386,7 +9386,6 @@ display_debug_loc (Elf_Internal_Shdr *se
   unsigned char *section_end;
   unsigned long bytes;
   unsigned char *section_begin = start;
-  bfd_vma addr;
   unsigned int num_loc_list = 0;
   unsigned long last_offset = 0;
   unsigned int first = 0;
@@ -9396,7 +9395,6 @@ display_debug_loc (Elf_Internal_Shdr *se
   int use_debug_info = 1;
   unsigned char *next;
 
-  addr = section->sh_addr;
   bytes = section->sh_size;
   section_end = start + bytes;
 
@@ -9504,9 +9502,6 @@ display_debug_loc (Elf_Internal_Shdr *se
 	      if (begin == 0xffffffff)
 		continue;
 
-	      begin += addr;
-	      end += addr;
-
 	      length = byte_get (start, 2);
 	      start += 2;
 
@@ -9514,18 +9509,17 @@ display_debug_loc (Elf_Internal_Shdr *se
 		      offset, begin, end);
 	      decode_location_expression (start, pointer_size, length,
 					  cu_offset);
-	      printf (")\n");
+	      putchar (')');
 
-	      if (begin >= end)
-		warn ("Bad location list at %8.8lx from %8.8lx to %8.8lx\n",
-		      offset, begin, end);
+	      if (begin == end)
+		fputs (_(" (start == end)"), stdout);
+	      else if (begin > end)
+		fputs (_(" (start > end)"), stdout);
 
-	      start += length;
+	      putchar ('\n');
 	    }
 
-	  if (j < debug_information [i].num_loc_offsets -1)
-	    printf (_("  <End of list>"));
-	  printf ("\n");
+	  fputs (_("  <End of list>\n"), stdout);
 	}
     }
   return 1;


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