Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] Support for DWARF5 location lists entries
@ 2019-12-31  9:41 Achra, Nitika
  2019-12-31 18:33 ` Simon Marchi
  0 siblings, 1 reply; 14+ messages in thread
From: Achra, Nitika @ 2019-12-31  9:41 UTC (permalink / raw)
  To: gdb-patches; +Cc: George, Jini Susan, Ali Tamur

[AMD Official Use Only - Internal Distribution Only]



* Handle DW_LLE_base_addressx, DW_LLE_startx_length and DW_LLE_start_length.



Tested by running the testsuite before and after the patch and there is no increase in the number of test cases that fails.

Tested with both -gdwarf-4 and -gdwarf-5 flags.




gdb/ChangeLog:
        *gdb/dwarf2loc.c (decode_debug_loclists_addresses): Handle DW_LLE_base_addressx, DW_LLE_startx_length, DW_LLE_start_length.



diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 976d453d3c..0de956ab66 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -173,6 +173,41 @@ decode_debug_loclists_addresses (struct dwarf2_per_cu_data *per_cu,
   switch (*loc_ptr++)
     {
+    case DW_LLE_base_addressx:
+       *low = 0;
+       loc_ptr = gdb_read_uleb128(loc_ptr, buf_end, &u64);
+       if (loc_ptr == NULL)
+               return DEBUG_LOC_BUFFER_OVERFLOW;
+       *high = dwarf2_read_addr_index(per_cu, u64);
+       *new_ptr = loc_ptr;
+       return DEBUG_LOC_BASE_ADDRESS;
+    case DW_LLE_startx_length:
+       loc_ptr = gdb_read_uleb128(loc_ptr, buf_end, &u64);
+       if (loc_ptr == NULL)
+          return DEBUG_LOC_BUFFER_OVERFLOW;
+       *low = dwarf2_read_addr_index(per_cu, u64);
+       *high = *low;
+       loc_ptr = gdb_read_uleb128(loc_ptr, buf_end, &u64);
+       if (loc_ptr == NULL)
+               return DEBUG_LOC_BUFFER_OVERFLOW;
+       *high += u64;
+       *new_ptr = loc_ptr;
+       return DEBUG_LOC_START_LENGTH;
+    case DW_LLE_start_length:
+       if (buf_end - loc_ptr < addr_size)
+                return DEBUG_LOC_BUFFER_OVERFLOW;
+       if (signed_addr_p)
+               *low = extract_signed_integer(loc_ptr, addr_size, byte_order);
+       else
+               *low = extract_unsigned_integer(loc_ptr, addr_size, byte_order);
+       loc_ptr += addr_size;
+       *high = *low;
+       loc_ptr = gdb_read_uleb128(loc_ptr, buf_end, &u64);
+       if (loc_ptr == NULL)
+                return DEBUG_LOC_BUFFER_OVERFLOW;
+       *high += u64;
+       *new_ptr = loc_ptr;
+       return DEBUG_LOC_START_LENGTH;
     case DW_LLE_end_of_list:
       *new_ptr = loc_ptr;
       return DEBUG_LOC_END_OF_LIST;
@@ -197,6 +232,9 @@ decode_debug_loclists_addresses (struct dwarf2_per_cu_data *per_cu,
       *high = u64;
       *new_ptr = loc_ptr;
       return DEBUG_LOC_START_END;
+    case DW_LLE_startx_endx:
+    case DW_LLE_start_end:
+    case DW_LLE_default_location:
     default:
       return DEBUG_LOC_INVALID_ENTRY;
     }


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

end of thread, other threads:[~2020-01-16 17:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-31  9:41 [PATCH] Support for DWARF5 location lists entries Achra, Nitika
2019-12-31 18:33 ` Simon Marchi
2020-01-06  7:22   ` Achra, Nitika
2020-01-06 10:14     ` Achra, Nitika
2020-01-08  3:26       ` Simon Marchi
2020-01-13 12:50         ` Achra, Nitika
2020-01-13 16:54           ` Simon Marchi
2020-01-14  8:04             ` Achra, Nitika
2020-01-14 16:56               ` Simon Marchi
2020-01-16 11:29                 ` Achra, Nitika
2020-01-16 14:16                   ` Simon Marchi
2020-01-16 14:29                     ` Simon Marchi
2020-01-16 15:48                     ` Achra, Nitika
2020-01-16 17:28                       ` Simon Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox