public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Andreas Schwab <schwab@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb: Support DW_LLE_start_end
Date: Mon, 21 Jun 2021 13:02:05 -0400	[thread overview]
Message-ID: <8febd971-d782-51dc-909f-1e0c862d3773@polymtl.ca> (raw)
In-Reply-To: <mvmpmwfeed0.fsf@suse.de>

On 2021-06-21 5:50 a.m., Andreas Schwab wrote:
> 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;
> 

Could you please try adding a gdb.dwarf2 test case?  Support for
building loclists already exists, so there should be little new
infrastructure needed, just add support for DW_LLE_start_end (see where
DW_LLE_start_length is handled).

I'm thinking of a test case where we would test all the DW_LLE_*
operations we support.

Simon

  reply	other threads:[~2021-06-21 17:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-21  9:50 Andreas Schwab
2021-06-21 17:02 ` Simon Marchi [this message]
2021-06-22 12:24   ` Andreas Schwab
2021-06-22 13:36     ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8febd971-d782-51dc-909f-1e0c862d3773@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=schwab@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).