From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 603 invoked by alias); 7 May 2003 23:01:18 -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 585 invoked from network); 7 May 2003 23:01:17 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 7 May 2003 23:01:17 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h47N1HH05020 for ; Wed, 7 May 2003 19:01:17 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h47N1HI22629 for ; Wed, 7 May 2003 19:01:17 -0400 Received: from localhost.redhat.com (romulus-int.sfbay.redhat.com [172.16.27.46]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h47N1Fj15439; Wed, 7 May 2003 19:01:16 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id EBD4F2C43B; Wed, 7 May 2003 19:06:11 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16057.37219.690886.548761@localhost.redhat.com> Date: Wed, 07 May 2003 23:01:00 -0000 To: Kevin Buettner Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] dwarf2expr.c: Prepare for eventual DW_OP_piece support In-Reply-To: <1030507224112.ZM32208@localhost.localdomain> References: <1030424010535.ZM18157@localhost.localdomain> <1030507224112.ZM32208@localhost.localdomain> X-SW-Source: 2003-05/txt/msg00113.txt.bz2 Kevin Buettner writes: > Ping! > > --- Forwarded mail from Kevin Buettner > > Date: Wed, 23 Apr 2003 18:05:36 -0700 > From: Kevin Buettner > To: gdb-patches@sources.redhat.com > Subject: [RFA] dwarf2expr.c: Prepare for eventual DW_OP_piece support > > The patch below prepares execute_stack_op() for eventual DW_OP_piece > support. > > The relatively obvious part of the patch is the revision of the tests > which force DW_OP_reg operations to be used alone. These tests have > been revised to permit a DW_OP_piece operator to follow a DW_OP_reg* > operator. > > The not so obvious part concerns the initialization of ctx->in_reg. > When a DW_OP_piece case is eventually added, it will need to know > whether the thing on the stack is a register or some other kind of > location expression. At the moment, the only indication we have of > what this thing is is being cleared each time through the loop. Moving > it out of the loop will allow a DW_OP_piece case to use this information > for determining how to proceed. > > Okay? > ok. elena > * dwarf2expr.c (execute_stack_op): Move ``ctx->in_reg'' initialization > out of loop. Allow DW_OP_reg0 ... DW_OP_reg31 and DW_OP_regx to > be used in conjuction with DW_OP_piece. Revise error message > accordingly. > > Index: dwarf2expr.c > =================================================================== > RCS file: /cvs/src/src/gdb/dwarf2expr.c,v > retrieving revision 1.6 > diff -u -p -r1.6 dwarf2expr.c > --- dwarf2expr.c 13 Apr 2003 15:53:44 -0000 1.6 > +++ dwarf2expr.c 24 Apr 2003 00:36:43 -0000 > @@ -228,6 +227,8 @@ static void > execute_stack_op (struct dwarf_expr_context *ctx, unsigned char *op_ptr, > unsigned char *op_end) > { > + ctx->in_reg = 0; > + > while (op_ptr < op_end) > { > enum dwarf_location_atom op = *op_ptr++; > @@ -236,8 +237,6 @@ execute_stack_op (struct dwarf_expr_cont > LONGEST offset; > int bytes_read; > > - ctx->in_reg = 0; > - > switch (op) > { > case DW_OP_lit0: > @@ -355,10 +354,9 @@ execute_stack_op (struct dwarf_expr_cont > case DW_OP_reg29: > case DW_OP_reg30: > case DW_OP_reg31: > - /* NOTE: in the presence of DW_OP_piece this check is incorrect. */ > - if (op_ptr != op_end) > + if (op_ptr != op_end && *op_ptr != DW_OP_piece) > error ("DWARF-2 expression error: DW_OP_reg operations must be " > - "used alone."); > + "used either alone or in conjuction with DW_OP_piece."); > > result = op - DW_OP_reg0; > ctx->in_reg = 1; > @@ -367,9 +365,9 @@ execute_stack_op (struct dwarf_expr_cont > > case DW_OP_regx: > op_ptr = read_uleb128 (op_ptr, op_end, ®); > - if (op_ptr != op_end) > + if (op_ptr != op_end && *op_ptr != DW_OP_piece) > error ("DWARF-2 expression error: DW_OP_reg operations must be " > - "used alone."); > + "used either alone or in conjuction with DW_OP_piece."); > > result = reg; > ctx->in_reg = 1; > > > --- End of forwarded mail from Kevin Buettner