Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: Re: [DWARF/RFC] end-address overflow in location description entry
Date: Tue, 09 Nov 2010 19:42:00 -0000	[thread overview]
Message-ID: <20101109194201.GK2933@adacore.com> (raw)
In-Reply-To: <20101109193527.GI2811@adacore.com>

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

[wrong patch attached, sorry]

> like this:
> 
>      if (low == 0 && high == base_mask)
>         {
>           *locexpr_length = length;
>           return loc_ptr;

Here is the actual patch (lacking comments, but this is only for
experimenting). If we decide to handle this situation, I'll add
proper comments.

-- 
Joel

[-- Attachment #2: dwarf2loc-overflow.diff --]
[-- Type: text/x-diff, Size: 751 bytes --]

diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index b2aecf2..0e3cfff 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -104,6 +104,9 @@ find_location_expression (struct dwarf2_loclist_baton *baton,
       if (low == 0 && high == 0)
 	return NULL;
 
+      if (low == 0 && high == base_mask)
+        base_address = 0;
+
       /* Otherwise, a location expression entry.  */
       low += base_address;
       high += base_address;
@@ -2546,6 +2549,9 @@ loclist_describe_location (struct symbol *symbol, CORE_ADDR addr,
       if (low == 0 && high == 0)
 	break;
 
+      if (low == 0 && high == base_mask)
+        base_address = 0;
+
       /* Otherwise, a location expression entry.  */
       low += base_address;
       high += base_address;

  reply	other threads:[~2010-11-09 19:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-09 19:35 Joel Brobecker
2010-11-09 19:42 ` Joel Brobecker [this message]
2010-11-10  5:06   ` Jan Kratochvil

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=20101109194201.GK2933@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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