public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: Support DW_LLE_start_end
@ 2021-06-21  9:50 Andreas Schwab
  2021-06-21 17:02 ` Simon Marchi
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Schwab @ 2021-06-21  9:50 UTC (permalink / raw)
  To: gdb-patches

Without that it is impossible to debug on riscv64.

gdb/
	PR symtab/27999
	* dwarf2/loc.c (decode_debug_loclists_addresses): Support
	DW_LLE_start_end.
---
 gdb/dwarf2/loc.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c
index b7e30e3cb4a..d57cdc165ba 100644
--- a/gdb/dwarf2/loc.c
+++ b/gdb/dwarf2/loc.c
@@ -255,9 +255,27 @@ decode_debug_loclists_addresses (dwarf2_per_cu_data *per_cu,
       *new_ptr = loc_ptr;
       return DEBUG_LOC_OFFSET_PAIR;
 
+    case DW_LLE_start_end:
+      if (loc_ptr + 2 * addr_size > buf_end)
+	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;
+      if (signed_addr_p)
+	*high = extract_signed_integer (loc_ptr, addr_size, byte_order);
+      else
+	*high = extract_unsigned_integer (loc_ptr, addr_size, byte_order);
+
+      loc_ptr += addr_size;
+      *new_ptr = loc_ptr;
+      return DEBUG_LOC_START_END;
+
     /* Following cases are not supported yet.  */
     case DW_LLE_startx_endx:
-    case DW_LLE_start_end:
     case DW_LLE_default_location:
     default:
       return DEBUG_LOC_INVALID_ENTRY;
-- 
2.31.1


-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

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

end of thread, other threads:[~2021-06-22 13:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-21  9:50 [PATCH] gdb: Support DW_LLE_start_end Andreas Schwab
2021-06-21 17:02 ` Simon Marchi
2021-06-22 12:24   ` Andreas Schwab
2021-06-22 13:36     ` Simon Marchi

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).