+2020-04-07 Nitika Achra <Nitika.Achra@amd.com>
+
+ * dwarf2/loc.c (enum debug_loc_kind): Add a new kind DEBUG_LOC_OFFSET_PAIR.
+ (dwarf2_find_location_expression): Call the function decode_debug_loclists_
+ addresses if DWARF version is 5 or more. DW_LLE_start* or DW_LLE_offset_pair
+ with DW_LLE_base_addressx are being emitted in DWARFv5 instead of DW_LLE_GNU*.
+ Add applicable base address if the entry is DW_LLE_offset_pair from DWO.
+ (decode_debug_loclists_addresses): Return DEBUG_LOC_OFFSET_PAIR instead of
+ DEBUG_LOC_START_END in case of DW_LLE_offset_pair.
+
+
2020-04-07 Nitika Achra <Nitika.Achra@amd.com>
* dwarf2/read.c (cu_debug_loc_section): Added the declaration for the function.
as in .debug_loc. */
DEBUG_LOC_START_LENGTH = 3,
+ /* This is followed by two unsigned LEB128 operands. The values of these
+ operands are the starting and ending offsets, respectively, relative to
+ the applicable base address. */
+ DEBUG_LOC_OFFSET_PAIR = 4,
+
/* An internal value indicating there is insufficient data. */
DEBUG_LOC_BUFFER_OVERFLOW = -1,
return DEBUG_LOC_BUFFER_OVERFLOW;
*high = u64;
*new_ptr = loc_ptr;
- return DEBUG_LOC_START_END;
+ return DEBUG_LOC_OFFSET_PAIR;
/* Following cases are not supported yet. */
case DW_LLE_startx_endx:
case DW_LLE_start_end:
enum debug_loc_kind kind;
const gdb_byte *new_ptr = NULL; /* init for gcc -Wall */
- if (baton->from_dwo)
+ if (baton->per_cu->version () < 5 && baton->from_dwo)
kind = decode_debug_loc_dwo_addresses (baton->per_cu,
loc_ptr, buf_end, &new_ptr,
&low, &high, byte_order);
continue;
case DEBUG_LOC_START_END:
case DEBUG_LOC_START_LENGTH:
+ case DEBUG_LOC_OFFSET_PAIR:
break;
case DEBUG_LOC_BUFFER_OVERFLOW:
case DEBUG_LOC_INVALID_ENTRY:
/* Otherwise, a location expression entry.
If the entry is from a DWO, don't add base address: the entry is from
- .debug_addr which already has the DWARF "base address". We still add
- base_offset in case we're debugging a PIE executable. */
- if (baton->from_dwo)
+ .debug_addr which already has the DWARF "base address". We still add
+ base_offset in case we're debugging a PIE executable. However, if the
+ entry is DW_LLE_offset_pair from a DWO, add the base address as the
+ operands are offsets relative to the applicable base address. */
+ if (baton->from_dwo && kind != DEBUG_LOC_OFFSET_PAIR)
{
low += base_offset;
high += base_offset;