From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4255 invoked by alias); 24 Feb 2002 06:15:14 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 4139 invoked from network); 24 Feb 2002 06:15:09 -0000 Received: from unknown (HELO zwingli.cygnus.com) (208.245.165.35) by sources.redhat.com with SMTP; 24 Feb 2002 06:15:09 -0000 Received: by zwingli.cygnus.com (Postfix, from userid 442) id 002315E9DE; Sun, 24 Feb 2002 01:15:07 -0500 (EST) To: tromey@redhat.com Cc: gdb-patches@sources.redhat.com Subject: Re: Patch: Dwarf2 reader -vs- DW_OP_piece References: <87664qej9l.fsf@creche.redhat.com> <87zo22ctbq.fsf@creche.redhat.com> From: Jim Blandy Date: Sat, 23 Feb 2002 22:15:00 -0000 In-Reply-To: <87zo22ctbq.fsf@creche.redhat.com> Message-ID: User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-02/txt/msg00672.txt.bz2 That makes sense. Could you change your patch to detect that pattern, verify that the register numbers are consecutive (according to DWARF2_REG_TO_REGNUM), return the number of the first register if everything seems right, and give a dwarf2_complex_location_expr complaint otherwise? This is a bit more work, but it's more correct. Tom Tromey writes: > >>>>> "Jim" == Jim Blandy writes: > > Jim> Can you explain what sorts of location expressions this is > Jim> supposed to help GDB handle? > > Yes, sorry. > > Suppose a value spans multiple registers. Currently gcc encodes this > as DW_OP_reg for the first register. However, I believe that is not > fully correct according to the Dwarf-2 spec. > > The gcc patch changes the output in this case to a series of > DW_OP_reg/DW_OP_piece instructions. > > So previously gcc could generate this for a `long long' value (on x86 > Linux): > > DW_OP_reg1 > > With the patch gcc will now generate: > > DW_OP_reg1 > DW_OP_piece 4 > DW_OP_reg2 > DW_OP_piece 4 > > Tom