public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] libdw: Handle .debug_rnglists in dwarf_ranges.
@ 2018-05-24 19:08 Mark Wielaard
  2018-05-28 12:57 ` Mark Wielaard
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Wielaard @ 2018-05-24 19:08 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Mark Wielaard

Handle all new DW_RLE opcodes in .debug_rnglists in dwarf_ranges. Extract
code for reading .debug_addr indexes from dwarf_formaddr as __libdw_addrx
to reuse in __libdw_read_begin_end_pair_inc. And add new testcase.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 libdw/ChangeLog                      |  15 ++
 libdw/dwarf_formaddr.c               |  76 ++++----
 libdw/dwarf_getlocation.c            |   2 +-
 libdw/dwarf_ranges.c                 | 258 +++++++++++++++++++++++----
 libdw/libdwP.h                       |  84 ++++++++-
 src/ChangeLog                        |   3 +-
 src/readelf.c                        |   2 +
 tests/ChangeLog                      |   6 +
 tests/Makefile.am                    |   2 +-
 tests/run-all-dwarf-ranges.sh        |  55 ++++++
 tests/run-dwarf-ranges.sh            |  18 ++
 tests/testfile-ranges-hello5.dwo.bz2 | Bin 0 -> 1296 bytes
 tests/testfile-ranges-world5.dwo.bz2 | Bin 0 -> 1466 bytes
 tests/testfileranges5.debug.bz2      | Bin 0 -> 2857 bytes
 tests/testfilesplitranges5.debug.bz2 | Bin 0 -> 2235 bytes
 15 files changed, 442 insertions(+), 79 deletions(-)
 create mode 100644 tests/testfile-ranges-hello5.dwo.bz2
 create mode 100644 tests/testfile-ranges-world5.dwo.bz2
 create mode 100755 tests/testfileranges5.debug.bz2
 create mode 100755 tests/testfilesplitranges5.debug.bz2

diff --git a/libdw/ChangeLog b/libdw/ChangeLog
index 9c0ab3c5..b19ebe96 100644
--- a/libdw/ChangeLog
+++ b/libdw/ChangeLog
@@ -1,3 +1,18 @@
+2018-04-06  Mark Wielaard  <mark@klomp.org>
+
+	* dwarf_formaddr.c (__libdw_addrx): New function, extracted from...
+	(dwarf_formaddr): here. Use __libdw_addrx.
+	* dwarf_getlocation.c (getlocations_addr): Pass cu to
+	__libdw_read_begin_end_pair_inc.
+	* dwarf_ranges.c (__libdw_read_begin_end_pair_inc): Take cu as
+	argument. Handle .debug_rnglists.
+	(initial_offset): Handle .debug_rnglists and DW_FORM_rnglistx.
+	(dwarf_ranges): Likewise. Check cu isn't NULL before use. Pass cu to
+	__libdw_read_begin_end_pair_inc.
+	* libdwP.h (__libdw_read_begin_end_pair_inc): Take cu as argument.
+	(__libdw_cu_ranges_base): Handle DW_AT_rnglists_base.
+	(__libdw_addrx): New function definition.
+
 2018-04-11  Mark Wielaard  <mark@klomp.org>
 
 	* dwarf.h: Add DWARF5 range list entry DW_RLE encodings.
diff --git a/libdw/dwarf_formaddr.c b/libdw/dwarf_formaddr.c
index 3c89a5d2..9cd3d200 100644
--- a/libdw/dwarf_formaddr.c
+++ b/libdw/dwarf_formaddr.c
@@ -34,6 +34,48 @@
 #include "libdwP.h"
 
 
+int
+__libdw_addrx (Dwarf_CU *cu, Dwarf_Word idx, Dwarf_Addr *addr)
+{
+  Dwarf_Off addr_off = __libdw_cu_addr_base (cu);
+  if (addr_off == (Dwarf_Off) -1)
+    return -1;
+
+  Dwarf *dbg = cu->dbg;
+  if (dbg->sectiondata[IDX_debug_addr] == NULL)
+    {
+      __libdw_seterrno (DWARF_E_NO_DEBUG_ADDR);
+      return -1;
+    }
+
+  /* The section should at least contain room for one address.  */
+  int address_size = cu->address_size;
+  if (cu->address_size > dbg->sectiondata[IDX_debug_addr]->d_size)
+    {
+    invalid_offset:
+      __libdw_seterrno (DWARF_E_INVALID_OFFSET);
+      return -1;
+    }
+
+  if (addr_off > (dbg->sectiondata[IDX_debug_addr]->d_size
+		  - address_size))
+    goto invalid_offset;
+
+  idx *= address_size;
+  if (idx > (dbg->sectiondata[IDX_debug_addr]->d_size
+	     - address_size - addr_off))
+    goto invalid_offset;
+
+  const unsigned char *datap;
+  datap = dbg->sectiondata[IDX_debug_addr]->d_buf + addr_off + idx;
+  if (address_size == 4)
+    *addr = read_4ubyte_unaligned (dbg, datap);
+  else
+    *addr = read_8ubyte_unaligned (dbg, datap);
+
+  return 0;
+}
+
 int
 dwarf_formaddr (Dwarf_Attribute *attr, Dwarf_Addr *return_addr)
 {
@@ -98,41 +140,9 @@ dwarf_formaddr (Dwarf_Attribute *attr, Dwarf_Addr *return_addr)
 
   /* So we got an index.  Lets see if it is valid and we can get the actual
      address.  */
-
-  Dwarf_Off addr_off = __libdw_cu_addr_base (cu);
-  if (addr_off == (Dwarf_Off) -1)
+  if (__libdw_addrx (cu, idx, return_addr) != 0)
     return -1;
 
-  if (dbg->sectiondata[IDX_debug_addr] == NULL)
-    {
-      __libdw_seterrno (DWARF_E_NO_DEBUG_ADDR);
-      return -1;
-    }
-
-  /* The section should at least contain room for one address.  */
-  int address_size = cu->address_size;
-  if (cu->address_size > dbg->sectiondata[IDX_debug_addr]->d_size)
-    {
-    invalid_offset:
-      __libdw_seterrno (DWARF_E_INVALID_OFFSET);
-      return -1;
-    }
-
-  if (addr_off > (dbg->sectiondata[IDX_debug_addr]->d_size
-		  - address_size))
-    goto invalid_offset;
-
-  idx *= address_size;
-  if (idx > (dbg->sectiondata[IDX_debug_addr]->d_size
-	     - address_size - addr_off))
-    goto invalid_offset;
-
-  datap = dbg->sectiondata[IDX_debug_addr]->d_buf + addr_off + idx;
-  if (address_size == 4)
-    *return_addr = read_4ubyte_unaligned (dbg, datap);
-  else
-    *return_addr = read_8ubyte_unaligned (dbg, datap);
-
   return 0;
 }
 INTDEF(dwarf_formaddr)
diff --git a/libdw/dwarf_getlocation.c b/libdw/dwarf_getlocation.c
index ade3e6c5..0e7115f8 100644
--- a/libdw/dwarf_getlocation.c
+++ b/libdw/dwarf_getlocation.c
@@ -724,7 +724,7 @@ getlocations_addr (Dwarf_Attribute *attr, ptrdiff_t offset,
   Dwarf_Addr end;
 
  next:
-  switch (__libdw_read_begin_end_pair_inc (dbg, secidx,
+  switch (__libdw_read_begin_end_pair_inc (cu, secidx,
 					   &readp, readendp,
 					   cu->address_size,
 					   &begin, &end, basep))
diff --git a/libdw/dwarf_ranges.c b/libdw/dwarf_ranges.c
index 52a61eea..fa65e5c6 100644
--- a/libdw/dwarf_ranges.c
+++ b/libdw/dwarf_ranges.c
@@ -40,62 +40,244 @@
     - If it's end of rangelist, don't set anything and return 2
     - If an error occurs, don't set anything and return -1.  */
 internal_function int
-__libdw_read_begin_end_pair_inc (Dwarf *dbg, int sec_index,
+__libdw_read_begin_end_pair_inc (Dwarf_CU *cu, int sec_index,
 				 const unsigned char **addrp,
 				 const unsigned char *addrend,
 				 int width,
 				 Dwarf_Addr *beginp, Dwarf_Addr *endp,
 				 Dwarf_Addr *basep)
 {
-  Dwarf_Addr escape = (width == 8 ? (Elf64_Addr) -1
-		       : (Elf64_Addr) (Elf32_Addr) -1);
-  Dwarf_Addr begin;
-  Dwarf_Addr end;
-
-  const unsigned char *addr = *addrp;
-  if (addrend - addr < width * 2)
+  Dwarf *dbg = cu->dbg;
+  if (sec_index == IDX_debug_ranges || sec_index == IDX_debug_loc)
     {
-    invalid:
-      __libdw_seterrno (DWARF_E_INVALID_DWARF);
-      return -1;
-    }
+      Dwarf_Addr escape = (width == 8 ? (Elf64_Addr) -1
+			   : (Elf64_Addr) (Elf32_Addr) -1);
+      Dwarf_Addr begin;
+      Dwarf_Addr end;
 
-  bool begin_relocated = READ_AND_RELOCATE (__libdw_relocate_address, begin);
-  bool end_relocated = READ_AND_RELOCATE (__libdw_relocate_address, end);
-  *addrp = addr;
+      const unsigned char *addr = *addrp;
+      if (addrend - addr < width * 2)
+	{
+	invalid:
+	  __libdw_seterrno (DWARF_E_INVALID_DWARF);
+	  return -1;
+	}
 
-  /* Unrelocated escape for begin means base address selection.  */
-  if (begin == escape && !begin_relocated)
-    {
-      if (unlikely (end == escape))
-	goto invalid;
+      bool begin_relocated = READ_AND_RELOCATE (__libdw_relocate_address,
+						begin);
+      bool end_relocated = READ_AND_RELOCATE (__libdw_relocate_address,
+					      end);
+      *addrp = addr;
 
-      *basep = end;
-      return 1;
-    }
+      /* Unrelocated escape for begin means base address selection.  */
+      if (begin == escape && !begin_relocated)
+	{
+	  if (unlikely (end == escape))
+	    goto invalid;
+
+	  *basep = end;
+	  return 1;
+	}
 
-  /* Unrelocated pair of zeroes means end of range list.  */
-  if (begin == 0 && end == 0 && !begin_relocated && !end_relocated)
-    return 2;
+      /* Unrelocated pair of zeroes means end of range list.  */
+      if (begin == 0 && end == 0 && !begin_relocated && !end_relocated)
+	return 2;
 
-  /* Don't check for begin_relocated == end_relocated.  Serve the data
-     to the client even though it may be buggy.  */
-  *beginp = begin + *basep;
-  *endp = end + *basep;
+      /* Don't check for begin_relocated == end_relocated.  Serve the data
+	 to the client even though it may be buggy.  */
+      *beginp = begin + *basep;
+      *endp = end + *basep;
 
-  return 0;
+      return 0;
+    }
+  else if (sec_index == IDX_debug_rnglists)
+    {
+      const unsigned char *addr = *addrp;
+      if (addrend - addr < 1)
+	goto invalid;
+
+      const char code = *addr++;
+      uint64_t begin = 0, end = 0, base = *basep, addr_idx;
+      switch (code)
+	{
+	case DW_RLE_end_of_list:
+	  *addrp = addr;
+	  return 2;
+
+	case DW_RLE_base_addressx:
+	  if (addrend - addr < 1)
+	    goto invalid;
+	  get_uleb128 (addr_idx, addr, addrend);
+	  if (__libdw_addrx (cu, addr_idx, &base) != 0)
+	    return -1;
+
+	  *basep = base;
+	  *addrp = addr;
+	  return 1;
+
+	case DW_RLE_startx_endx:
+	  if (addrend - addr < 1)
+	    goto invalid;
+	  get_uleb128 (addr_idx, addr, addrend);
+	  if (__libdw_addrx (cu, addr_idx, &begin) != 0)
+	    return -1;
+	  if (addrend - addr < 1)
+	    goto invalid;
+	  get_uleb128 (addr_idx, addr, addrend);
+	  if (__libdw_addrx (cu, addr_idx, &end) != 0)
+	    return -1;
+
+	  *beginp = begin;
+	  *endp = end;
+	  *addrp = addr;
+	  return 0;
+
+	case DW_RLE_startx_length:
+	  if (addrend - addr < 1)
+	    goto invalid;
+	  get_uleb128 (addr_idx, addr, addrend);
+	  if (__libdw_addrx (cu, addr_idx, &begin) != 0)
+	    return -1;
+	  if (addrend - addr < 1)
+	    goto invalid;
+	  get_uleb128 (end, addr, addrend);
+
+	  *beginp = begin;
+	  *endp = begin + end;
+	  *addrp = addr;
+	  return 0;
+
+	case DW_RLE_offset_pair:
+	  if (addrend - addr < 1)
+	    goto invalid;
+	  get_uleb128 (begin, addr, addrend);
+	  if (addrend - addr < 1)
+	    goto invalid;
+	  get_uleb128 (end, addr, addrend);
+
+	  *beginp = begin + base;
+	  *endp = end + base;
+	  *addrp = addr;
+	  return 0;
+
+	case DW_RLE_base_address:
+	  if (addrend - addr < width)
+	    goto invalid;
+	  __libdw_read_address_inc (dbg, sec_index, &addr, width, &base);
+
+	  *basep = base;
+	  *addrp = addr;
+	  return 1;
+
+	case DW_RLE_start_end:
+	  if (addrend - addr < 2 * width)
+	    goto invalid;
+	  __libdw_read_address_inc (dbg, sec_index, &addr, width, &begin);
+	  __libdw_read_address_inc (dbg, sec_index, &addr, width, &end);
+
+	  *beginp = begin;
+	  *endp = end;
+	  *addrp = addr;
+	  return 0;
+
+	case DW_RLE_start_length:
+	  if (addrend - addr < width)
+	    goto invalid;
+	  __libdw_read_address_inc (dbg, sec_index, &addr, width, &begin);
+	  if (addrend - addr < 1)
+	    goto invalid;
+	  get_uleb128 (end, addr, addrend);
+
+	  *beginp = begin;
+	  *endp = begin + end;
+	  *addrp = addr;
+	  return 0;
+
+	default:
+	  goto invalid;
+	}
+    }
+  else
+    {
+      __libdw_seterrno (DWARF_E_INVALID_DWARF);
+      return -1;
+    }
 }
 
 static int
 initial_offset (Dwarf_Attribute *attr, ptrdiff_t *offset)
 {
-  size_t secidx = IDX_debug_ranges;
+  size_t secidx = (attr->cu->version < 5
+		   ? IDX_debug_ranges : IDX_debug_rnglists);
 
   Dwarf_Word start_offset;
-  if (__libdw_formptr (attr, secidx,
-		       DWARF_E_NO_DEBUG_RANGES,
-		       NULL, &start_offset) == NULL)
-    return -1;
+  if (attr->form == DW_FORM_rnglistx)
+    {
+      Dwarf_Word idx;
+      Dwarf_CU *cu = attr->cu;
+      const unsigned char *datap = attr->valp;
+      const unsigned char *endp = cu->endp;
+      if (datap >= endp)
+	{
+	  __libdw_seterrno (DWARF_E_INVALID_DWARF);
+	  return -1;
+	}
+      get_uleb128 (idx, datap, endp);
+
+      Elf_Data *data = cu->dbg->sectiondata[secidx];
+      if (data == NULL && cu->unit_type == DW_UT_split_compile)
+	{
+	  cu = __libdw_find_split_unit (cu);
+	  if (cu != NULL)
+	    data = cu->dbg->sectiondata[secidx];
+	}
+
+      if (data == NULL)
+	{
+	  __libdw_seterrno (secidx == IDX_debug_ranges
+                            ? DWARF_E_NO_DEBUG_RANGES
+                            : DWARF_E_NO_DEBUG_RNGLISTS);
+	  return -1;
+	}
+
+      Dwarf_Off range_base_off = __libdw_cu_ranges_base (cu);
+
+      /* The section should at least contain room for one offset.  */
+      size_t sec_size = cu->dbg->sectiondata[secidx]->d_size;
+      size_t offset_size = cu->offset_size;
+      if (offset_size > sec_size)
+	{
+	invalid_offset:
+	  __libdw_seterrno (DWARF_E_INVALID_OFFSET);
+	  return -1;
+	}
+
+      /* And the base offset should be at least inside the section.  */
+      if (range_base_off > (sec_size - offset_size))
+	goto invalid_offset;
+
+      size_t max_idx = (sec_size - offset_size - range_base_off) / offset_size;
+      if (idx > max_idx)
+	goto invalid_offset;
+
+      datap = (cu->dbg->sectiondata[secidx]->d_buf
+	       + range_base_off + (idx * offset_size));
+      if (offset_size == 4)
+	start_offset = read_4ubyte_unaligned (cu->dbg, datap);
+      else
+	start_offset = read_8ubyte_unaligned (cu->dbg, datap);
+
+      start_offset += range_base_off;
+    }
+  else
+    {
+      if (__libdw_formptr (attr, secidx,
+			   (secidx == IDX_debug_ranges
+			    ? DWARF_E_NO_DEBUG_RANGES
+			    : DWARF_E_NO_DEBUG_RNGLISTS),
+			   NULL, &start_offset) == NULL)
+	return -1;
+    }
 
   *offset = start_offset;
   return 0;
@@ -121,7 +303,6 @@ dwarf_ranges (Dwarf_Die *die, ptrdiff_t offset, Dwarf_Addr *basep,
     return 0;
 
   /* We have to look for a noncontiguous range.  */
-  size_t secidx = IDX_debug_ranges;
   Dwarf_CU *cu = die->cu;
   if (cu == NULL)
     {
@@ -129,6 +310,7 @@ dwarf_ranges (Dwarf_Die *die, ptrdiff_t offset, Dwarf_Addr *basep,
       return -1;
     }
 
+  size_t secidx = (cu->version < 5 ? IDX_debug_ranges : IDX_debug_rnglists);
   const Elf_Data *d = cu->dbg->sectiondata[secidx];
   if (d == NULL && cu->unit_type == DW_UT_split_compile)
     {
@@ -176,7 +358,7 @@ dwarf_ranges (Dwarf_Die *die, ptrdiff_t offset, Dwarf_Addr *basep,
   Dwarf_Addr end;
 
  next:
-  switch (__libdw_read_begin_end_pair_inc (cu->dbg, secidx,
+  switch (__libdw_read_begin_end_pair_inc (cu, secidx,
 					   &readp, readendp,
 					   cu->address_size,
 					   &begin, &end, basep))
diff --git a/libdw/libdwP.h b/libdw/libdwP.h
index 3cfcc557..c419e37a 100644
--- a/libdw/libdwP.h
+++ b/libdw/libdwP.h
@@ -915,7 +915,7 @@ is_cudie (Dwarf_Die *cudie)
     - If it's base address selection record, set up *BASEP and return 1.
     - If it's end of rangelist, don't set anything and return 2
     - If an error occurs, don't set anything and return <0.  */
-int __libdw_read_begin_end_pair_inc (Dwarf *dbg, int sec_index,
+int __libdw_read_begin_end_pair_inc (Dwarf_CU *cu, int sec_index,
 				     const unsigned char **readp,
 				     const unsigned char *readend,
 				     int width,
@@ -1084,6 +1084,8 @@ static inline Dwarf_Off __libdw_cu_str_off_base (Dwarf_CU *cu)
 }
 
 
+/* Either a direct offset into .debug_ranges for version < 5, or the
+   start of the offset table in .debug_rnglists for version > 5.  */
 static inline Dwarf_Off
 __libdw_cu_ranges_base (Dwarf_CU *cu)
 {
@@ -1092,12 +1094,79 @@ __libdw_cu_ranges_base (Dwarf_CU *cu)
       Dwarf_Off offset = 0;
       Dwarf_Die cu_die = CUDIE(cu);
       Dwarf_Attribute attr;
-      if (dwarf_attr (&cu_die, DW_AT_GNU_ranges_base, &attr) != NULL)
+      if (cu->version < 5)
 	{
-	  Dwarf_Word off;
-	  if (dwarf_formudata (&attr, &off) == 0)
-	    offset = off;
+	  if (dwarf_attr (&cu_die, DW_AT_GNU_ranges_base, &attr) != NULL)
+	    {
+	      Dwarf_Word off;
+	      if (dwarf_formudata (&attr, &off) == 0)
+		offset = off;
+	    }
+	}
+      else
+	{
+	  if (dwarf_attr (&cu_die, DW_AT_rnglists_base, &attr) != NULL)
+	    {
+	      Dwarf_Word off;
+	      if (dwarf_formudata (&attr, &off) == 0)
+		offset = off;
+	    }
+
+	  /* There wasn't an rnglists_base, if the Dwarf does have a
+	     .debug_rnglists section, then it might be we need the
+	     base after the first header. */
+	  Elf_Data *data = cu->dbg->sectiondata[IDX_debug_rnglists];
+	  if (offset == 0 && data != NULL)
+	    {
+	      Dwarf *dbg = cu->dbg;
+	      const unsigned char *readp = data->d_buf;
+	      const unsigned char *const dataend
+		= (unsigned char *) data->d_buf + data->d_size;
+
+	      uint64_t unit_length = read_4ubyte_unaligned_inc (dbg, readp);
+	      unsigned int offset_size = 4;
+	      if (unlikely (unit_length == 0xffffffff))
+		{
+		  if (unlikely (readp > dataend - 8))
+		    goto no_header;
+
+		  unit_length = read_8ubyte_unaligned_inc (dbg, readp);
+		  offset_size = 8;
+		}
+
+	      if (readp > dataend - 8
+		  || unit_length < 8
+		  || unit_length > (uint64_t) (dataend - readp))
+		goto no_header;
+
+	      uint16_t version = read_2ubyte_unaligned_inc (dbg, readp);
+	      if (version != 5)
+		goto no_header;
+
+	      uint8_t address_size = *readp++;
+	      if (address_size != 4 && address_size != 8)
+		goto no_header;
+
+	      uint8_t segment_size = *readp++;
+	      if (segment_size != 0)
+		goto no_header;
+
+	      uint32_t offset_entry_count;
+	      offset_entry_count = read_4ubyte_unaligned_inc (dbg, readp);
+
+	      const unsigned char *offset_array_start = readp;
+	      if (offset_entry_count <= 0)
+		goto no_header;
+
+	      uint64_t needed = offset_entry_count * offset_size;
+	      if (unit_length - 8 < needed)
+		goto no_header;
+
+	      offset = (Dwarf_Off) (offset_array_start
+				    - (unsigned char *) data->d_buf);
+	    }
 	}
+    no_header:
       cu->ranges_base = offset;
     }
 
@@ -1105,6 +1174,11 @@ __libdw_cu_ranges_base (Dwarf_CU *cu)
 }
 
 
+/* Given an address index for a CU return the address.
+   Returns -1 and sets libdw_errno if an error occurs.  */
+int __libdw_addrx (Dwarf_CU *cu, Dwarf_Word idx, Dwarf_Addr *addr);
+
+
 /* Helper function to set debugdir field in Dwarf, used from dwarf_begin_elf
    and libdwfl process_file.  */
 char * __libdw_debugdir (int fd);
diff --git a/src/ChangeLog b/src/ChangeLog
index d28d89af..4772448c 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -6,7 +6,8 @@
 	(listptr_cu): New function.
 	(print_debug_rnglists_section): Likewise.
 	(attr_callback): Call notice_listptr for DW_AT_ranges. Handle
-	DW_AT_rnglists_base.
+	DW_AT_rnglists_base. Handle DW_FORM_rnglistx. DW_AT_start_scope
+	can also have a rnglist.
 	(print_debug_units): Do (silently) scan split DWARF also for
 	debug_ranges before DWARF5 to catch all rangelistptrs.
 	(print_debug): Recognize .debug_rnglists. Reset known_rnglistptr.
diff --git a/src/readelf.c b/src/readelf.c
index 071906fa..3f5c73b8 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -6702,6 +6702,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
       break;
 
     case DW_FORM_sec_offset:
+    case DW_FORM_rnglistx:
     case DW_FORM_implicit_const:
     case DW_FORM_udata:
     case DW_FORM_sdata:
@@ -6758,6 +6759,7 @@ attr_callback (Dwarf_Attribute *attrp, void *arg)
 	  return DWARF_CB_OK;
 
 	case DW_AT_ranges:
+	case DW_AT_start_scope:
 	  {
 	    bool nlpt;
 	    if (cbargs->cu->version < 5)
diff --git a/tests/ChangeLog b/tests/ChangeLog
index 13d168de..f26651c9 100644
--- a/tests/ChangeLog
+++ b/tests/ChangeLog
@@ -1,3 +1,9 @@
+2018-04-06  Mark Wielaard  <mark@klomp.org>
+
+	* testfileranges5.debug.bz2: New testfile.
+	* run-dwarf-ranges.sh: Run on testfileranges5.debug.
+	* tests/Makefile.am (EXTRA_DIST): Add testfileranges5.debug.bz2.
+
 2018-04-11  Mark Wielaard  <mark@klomp.org>
 
 	* run-readelf-ranges.sh: New test.
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 54a3d1d5..bb80b78b 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -203,7 +203,7 @@ EXTRA_DIST = run-arextract.sh run-arsymtest.sh run-ar.sh \
 	     run-dwfl-addr-sect.sh run-early-offscn.sh \
 	     run-dwarf-getmacros.sh \
 	     run-dwarf-ranges.sh debug-ranges-no-lowpc.o.bz2 \
-	     testfileranges4.debug.bz2 \
+	     testfileranges4.debug.bz2 testfileranges5.debug.bz2 \
 	     run-test-flag-nobits.sh \
 	     run-dwarf-getstring.sh run-rerequest_tag.sh run-alldts.sh \
 	     testfile15.bz2 testfile15.debug.bz2 \
diff --git a/tests/run-all-dwarf-ranges.sh b/tests/run-all-dwarf-ranges.sh
index ad5e634f..cefb4231 100755
--- a/tests/run-all-dwarf-ranges.sh
+++ b/tests/run-all-dwarf-ranges.sh
@@ -71,4 +71,59 @@ die: no_subject (2e)
 
 EOF
 
+# Same with -gdwarf-5
+# gcc -c -O2 -o testfile-ranges-hello5.o -gsplit-dwarf -gdwarf-5 hello.c
+# gcc -c -O2 -o testfile-ranges-world5.o -gsplit-dwarf -gdwarf-5 world.c
+# gcc -o testfilesplitranges5 -O2 testfile-ranges-hello5.o testfile-ranges-world5.o
+# eu-strip -f testfilesplitranges5.debug testfilesplitranges5
+
+testfiles testfilesplitranges5.debug
+testfiles testfile-ranges-hello5.dwo testfile-ranges-world5.dwo
+
+testrun_compare ${abs_builddir}/all-dwarf-ranges testfilesplitranges5.debug <<\EOF
+die: hello.c (11)
+ 401150..40117a
+ 401050..401067
+
+die: no_say (2e)
+ 401160..40117a
+
+die: main (2e)
+ 401050..401067
+
+die: subject (1d)
+ 401053..40105f
+
+die: subject (2e)
+ 401150..401160
+
+die: world.c (11)
+ 401180..4011e7
+
+die: no_main (2e)
+ 4011d0..4011e7
+
+die: no_subject (1d)
+ 4011d3..4011df
+
+die: say (2e)
+ 401180..4011c0
+
+die: happy (1d)
+ 40119b..40119b
+ 40119c..4011a6
+ 4011b0..4011b4
+ 4011b5..4011bf
+
+die: sad (1d)
+ 40119b..40119b
+ 40119c..4011a6
+ 4011b4..4011b4
+ 4011b5..4011bf
+
+die: no_subject (2e)
+ 4011c0..4011d0
+
+EOF
+
 exit 0
diff --git a/tests/run-dwarf-ranges.sh b/tests/run-dwarf-ranges.sh
index f935eaf4..a58ee659 100755
--- a/tests/run-dwarf-ranges.sh
+++ b/tests/run-dwarf-ranges.sh
@@ -102,4 +102,22 @@ testrun_compare ${abs_builddir}/dwarf-ranges testfileranges4.debug 0x374 <<\EOF
 4005a5..4005ad (base 400540)
 EOF
 
+# Like above, but with -gdwarf-5.
+testfiles testfileranges5.debug
+testrun_compare ${abs_builddir}/dwarf-ranges testfileranges5.debug 0xc <<\EOF
+4004e0..4004ff (base 0)
+4003e0..4003f7 (base 0)
+EOF
+
+testrun_compare ${abs_builddir}/dwarf-ranges testfileranges5.debug 0x289 <<\EOF
+40051c..400526 (base 400500)
+400530..400534 (base 400500)
+400535..40053f (base 400500)
+EOF
+
+testrun_compare ${abs_builddir}/dwarf-ranges testfileranges5.debug 0x2a9 <<\EOF
+40051c..400526 (base 400500)
+400535..40053f (base 400500)
+EOF
+
 exit 0
diff --git a/tests/testfile-ranges-hello5.dwo.bz2 b/tests/testfile-ranges-hello5.dwo.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..03d252e14d9ffed0a12abad13afedbe5e4e116c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8y1dXrKl49x{peo@t~%otE(DnpGE^gN6GWt#y1RJ=xJS@&
z86b~BSrihFTA%A??#6%w&_SV!MCJl}d;m15{DM)2mRprMyXPxIRL<diU<tm(^e!O$
z0yjr1m*WOmBt%JP1hGTk5@(QHGC(TDC|TkocWHLsOA9C$pdrxAmOM`Ztsl#TstN}#
z3ABa<5rZRwf#(F{9}I}DsEhVf&kh8dApi(zW6MNfFhXpYGbuzHR4xPcM}RZ&4&(q6
zYUz3-YlmD0%E>o^1Oq`ojE-^~A^6QYoW8~57OaT4jrOLZ%Q=|MBx&*^iocP!e*vmS
z=AP*l<e1`+$SmE_SfO0k@G9vdf|6-=U65JD=0gAg$yfuyDBuZ3SHKmPYb1h4W7qNO
zX8SZ$r7@sBoH}rjuFfo5J|vJW<ip|=Q?Z{h#;oNLJNGk}h8V8#a+yM4d5e(GvO<4M
zW5DU!?D=y#<)f{V@Kd8{BSM;uVvCW-%~Y^8)9(Lboqo%rtZ(+3-g7B6qOcW8g5TyT
z_H5Gbj+vE&vRMt@f5o`ZlK1$+E<TM^H`CzJq16O+0Y=~+vOOm*2#JgwI|!X(USTRU
zGUG-0c{r6hq1mmczkFA{qH|vMQmq!RKdd+|yrW}&QSMl*J9Okh<rrd>jxOYiaG@Yd
GzWcyBflLkn

literal 0
HcmV?d00001

diff --git a/tests/testfile-ranges-world5.dwo.bz2 b/tests/testfile-ranges-world5.dwo.bz2
new file mode 100644
index 0000000000000000000000000000000000000000..1ee3b6ac5adc43e475a512e545736ea50e61c1c4
GIT binary patch
literal 1466
zcmV;r1x5NoT4*^jL0KkKS>RD1s{jH?fB*mg|M~a-|KI=r|KGp=zyJUL-~HG2_kaKY
z|Nj5~|NYPdUIVq;UN#P~!k(e!Jx@gSJwfU{Pe>VxJdk>g9+1iDJtwKAo~M-4Pauy`
zqd}&JspSmPH1t6A8&erg9;VY%)I6g@!i_ya`jcu6rj1WX^i4dY#Sc@{Nc5koXwx!?
z00000G|&J6pa2aT0077Vpc()G001-q88iS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;Bi;<8LSOE<OpbeWa2wTJ&iRpzTa7;rYd;-KF*f6{fM=cD&Is>78
z6XNfp3MefZsvCfYMM(Nj01^1X0~A;nfD%*9cL4FGSkHh6F(uG#yENlpYoA9;V;La@
z94h&J5gh~o57uokj0fnA6Q_Tj72|+@S4bU9eaPe1NNG8dvCrEhy%$C^k6{X=@gN^(
zg$T(-IWppg3DHPy(Cofy@P7&_X-W?mVmJ!$X^lDUFo-UKNG%X-6|VfVV1j9W`P_8(
zSJsNqT8>Fv(|Pg`6J}t_i3a3t!+HlH2d(eu-54v07#Ys9dW3BKr6`9yDxHYTCL0OU
zd0&sE0MN-_RZ0P9TOo)^4JyfEn6GjBMqckVor#8@)kXWc`t1mYbJyI6V}81H5)%g5
z{E#E@E}BaBR}U=YszdXl&M}t5KN37|I_|oVchD42w);5IY}p(U&Y*xcAH*nda<v(N
z9(_#4QAy%~{HmIE=`Rd~lhui28OX%AEwHPBV}c!kjYl;IO+5SA7_##1d^;8Ek|dk8
za4ei{U=m$^UAw6^)>lExnpO}s!&*0ehRzh$o+PgRrPAo#a7tu41#dS5SD;>B2{)am
Ui?rcoB0u8pNT&)C910{AU^N7V=>Px#

literal 0
HcmV?d00001

diff --git a/tests/testfileranges5.debug.bz2 b/tests/testfileranges5.debug.bz2
new file mode 100755
index 0000000000000000000000000000000000000000..b7351ef51bfe2ebfd358fff0bd790a6929ffeb04
GIT binary patch
literal 2857
zcmV+^3)b{PT4*^jL0KkKSq%;?SpW-MfB*mg|NsB@_y7Or|M~y_|MT`S?sx6!ZDjPa
z#zKGeed*u|PTMQ(_h>jw^!Ir#uXj}XJ)?Erb-TC#t_GSx8bF$u(w+lU{VDn++K1|o
zH4KwAJt5@`nKXKhJxw&;sL6=Hhm--J9-~dEpuz*u2dT9H8Kiod41f(2L=7|(35lqi
zMH@{c(LF%X>SzJw27nt-GzNeG000002dDr50004?8VDkrLPN?PqeIjH&;ZcdY5*D<
z0002>0009(0000000000XbB1=)YQO?r=}<#lT4U~k5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h3L;HGqIqSOM^;;gmZZP84WFq8(<|`|#TKdfd4Hs=TBn86nmr121So0kO@*
zz$bi_O(1Vb%;PMquAE9ZJ}QUQQDdmIaV9~NcRUOfJLuQF4+J;!25npuMv*T^dkiuU
z(f8w~D7IDXh0(oB{Cl3@>St0hm9(OXD9yVWPlb)t45oczbP`epo!V;{BS501Rf@J{
znj9SCLSvY$W7b$=3+?~q4S?Y|AeX~pM~qD}DiamZ$Z(o=rZrr0)F1eR|KjdQrwS4Q
Hp~b5pMLHtc

literal 0
HcmV?d00001

diff --git a/tests/testfilesplitranges5.debug.bz2 b/tests/testfilesplitranges5.debug.bz2
new file mode 100755
index 0000000000000000000000000000000000000000..7e43492f80d7aa930da386a9edd7efbffee5436c
GIT binary patch
literal 2235
zcmV;s2t@ZnT4*^jL0KkKSu@8~x&R6IfB*mg|NsB@_wWDz|MLI;|M}(@>kVbiM-)`y
zN~BxNWoh6C-#2hLdv~qgpr>;^UfZUq0Pr-_BAKMkO#)`7(@Ce2G8qge0s})p0~1Vu
z27#uUXf$XIGH7UNkO8Kd8faw6pbZECG=@zYYH5+GdYT@msBJ)K0ib9!00000001-q
z00000007j%2!$S}s0M&E1Juv}0MG%T0QCW&Xc}Z10002c00000G-x!*Nk(dVL5OLI
zra^)OKru1~jRO&c000>@GGYMr00xaT$&*bo10yDY0u356WEyB`rh$;qG#G}MO$M4U
zAOWB>X{Li9WHA{UF&Z%%83q$fngb@8Gy+6KA_{mBG|eCnQJ`oZlS9-qQ`7(+paw=j
z0i!@@Xdb7i4FC-Q8Vv(RfL6Cq%`_S|Wzdc9*}Ie*UkI?2w(P)Z17L-Ls0zbv7}<mx
z$72a;MKR@LNaj;z&mrnreOE0B%b-zt84Y0b+`0@m5IuQ1K_ZiK(Ev#<Clp&w*w1t2
zN8(lCB($lB1r0W)vG@8W4YsHa+0(R7ImC0;{Xr2R5QxML*>$Y#x$`phw^kBS;n`X3
z6gI$WVmU-8i8{uXgsibhwibVoRc8VOT(NpmT%^4E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_97n;_$MqQ+?9DV%reR
z1UkfkuE&8s6i%a405qwp1mYLQSFm6e%BBHQ&0Wo<jASEO5V1;O2<9P^OoFI<fTHzC
zz$mk3h%+~&ir^It(7<#G1i*ksLnC-lMu_~z%F0F%f`3iUNXYO~tAChp?A$-%?ntK!
J5(aqcw?Lj>;Vb|E

literal 0
HcmV?d00001

-- 
2.17.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] libdw: Handle .debug_rnglists in dwarf_ranges.
  2018-05-24 19:08 [PATCH] libdw: Handle .debug_rnglists in dwarf_ranges Mark Wielaard
@ 2018-05-28 12:57 ` Mark Wielaard
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2018-05-28 12:57 UTC (permalink / raw)
  To: elfutils-devel

On Thu, 2018-05-24 at 21:08 +0200, Mark Wielaard wrote:
> Handle all new DW_RLE opcodes in .debug_rnglists in dwarf_ranges. Extract
> code for reading .debug_addr indexes from dwarf_formaddr as __libdw_addrx
> to reuse in __libdw_read_begin_end_pair_inc. And add new testcase.

Pushed this to master.

But I first regenerated the new test files with a newer GCC that fixes
the location expressions as promised for the just posted "libdw: Handle
.debug_loclists in dwarf_getlocation" patch.

It seemed better to only have one set in the tree.
Both testfileranges5.debug and testfilesplitranges5.debug got
regenerated (and the test results slightly adjusted) to show that the
ranges are identical for both, even though they are using completely
different DWARF encodings.

Cheers,

Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-05-28 12:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-24 19:08 [PATCH] libdw: Handle .debug_rnglists in dwarf_ranges Mark Wielaard
2018-05-28 12:57 ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).