Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Achra, Nitika" <Nitika.Achra@amd.com>
To: Simon Marchi <simark@simark.ca>,
	"gdb-patches@sourceware.org"	<gdb-patches@sourceware.org>
Cc: Ali Tamur <tamur@google.com>,
	"George, Jini Susan"	<JiniSusan.George@amd.com>
Subject: RE: [PATCH] Support for DWARF5 location lists entries
Date: Thu, 16 Jan 2020 15:48:00 -0000	[thread overview]
Message-ID: <MN2PR12MB3744FB7A9F17AFBE119E69FB9A360@MN2PR12MB3744.namprd12.prod.outlook.com> (raw)
In-Reply-To: <726ebd81-48b2-684d-d4b5-8cdcf315d737@simark.ca>

[-- Attachment #1: Type: text/plain, Size: 1607 bytes --]

[AMD Official Use Only - Internal Distribution Only]

Hi Simon,

I have modified the commit message. Please find the attachment.

Regards,
Nitika Achra

-----Original Message-----
From: Simon Marchi <simark@simark.ca> 
Sent: Thursday, January 16, 2020 7:45 PM
To: Achra, Nitika <Nitika.Achra@amd.com>; gdb-patches@sourceware.org
Cc: Ali Tamur <tamur@google.com>; George, Jini Susan <JiniSusan.George@amd.com>
Subject: Re: [PATCH] Support for DWARF5 location lists entries

[CAUTION: External Email]

On 2020-01-16 6:29 a.m., Achra, Nitika wrote:
> [AMD Official Use Only - Internal Distribution Only]
>
> Hi Simon,
>
> Please find the attachment.
>
>
> *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. Also tested -gslit-dwarf along with -gdwarf-4 as well as -gdwarf5 flags.
>
>
> gdb/ChangeLog:
>         *dwarf2loc.c (decode_debug_loclists_addresses): Handle
>           DW_LLE_base_addressx, DW_LLE_startx_length, DW_LLE_start_length.
>
> This is an effort to support DWARF5 in gdb.

Hi Achra,

The commit message of the patch is empty.  The text that is above, which describes what your patch does, should be placed in your git commit, such that it will appear in the patch file when you use "git format-patch".

This is the text that people will see when they do "git log", so you can do "git log"
to see how it's usually formatted.

Thanks,

Simon

[-- Attachment #2: 0001-Support-for-DWARF5-location-lists-entries.patch --]
[-- Type: application/octet-stream, Size: 2836 bytes --]

From f11af3868b64db169a7c5ac5ddf931e868252195 Mon Sep 17 00:00:00 2001
From: nitachra <Nitika.Achra@amd.com>
Date: Thu, 16 Jan 2020 16:43:21 +0530
Subject: [PATCH] Support for DWARF5 location lists entries

This patch handles 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. Also tested -gslit-dwarf along with -gdwarf-4 as well
as -gdwarf5 flags.

This is an effort to support DWARF5 in gdb.

gdb/ChangeLog:

   *dwarf2loc.c (decode_debug_loclists_addresses): Handle
    DW_LLE_base_addressx, DW_LLE_startx_length, DW_LLE_start_length.
---
 gdb/dwarf2loc.c | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 1fe6829100..cf358fbe61 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,10 @@ decode_debug_loclists_addresses (struct dwarf2_per_cu_data *per_cu,
       *high = u64;
       *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.17.1


  parent reply	other threads:[~2020-01-16 15:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-31  9:41 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 [this message]
2020-01-16 17:28                       ` 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=MN2PR12MB3744FB7A9F17AFBE119E69FB9A360@MN2PR12MB3744.namprd12.prod.outlook.com \
    --to=nitika.achra@amd.com \
    --cc=JiniSusan.George@amd.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simark@simark.ca \
    --cc=tamur@google.com \
    /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