From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1579 invoked by alias); 9 Nov 2010 19:42:15 -0000 Received: (qmail 1571 invoked by uid 22791); 9 Nov 2010 19:42:15 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Nov 2010 19:42:09 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 5AFB72BAD24 for ; Tue, 9 Nov 2010 14:42:08 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id w4zRp5tATXyn for ; Tue, 9 Nov 2010 14:42:08 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 26A482BAD22 for ; Tue, 9 Nov 2010 14:42:08 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id A998A145B4E; Tue, 9 Nov 2010 11:42:01 -0800 (PST) Date: Tue, 09 Nov 2010 19:42:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Re: [DWARF/RFC] end-address overflow in location description entry Message-ID: <20101109194201.GK2933@adacore.com> References: <20101109193527.GI2811@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="KsGdsel6WgEHnImy" Content-Disposition: inline In-Reply-To: <20101109193527.GI2811@adacore.com> User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-11/txt/msg00141.txt.bz2 --KsGdsel6WgEHnImy Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 324 [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 --KsGdsel6WgEHnImy Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="dwarf2loc-overflow.diff" Content-length: 751 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; --KsGdsel6WgEHnImy--