From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16896 invoked by alias); 12 Jun 2012 11:42:37 -0000 Received: (qmail 16881 invoked by uid 22791); 12 Jun 2012 11:42:36 -0000 X-SWARE-Spam-Status: No, hits=-4.7 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-vc0-f169.google.com (HELO mail-vc0-f169.google.com) (209.85.220.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Jun 2012 11:42:15 +0000 Received: by vcbfl10 with SMTP id fl10so3362846vcb.0 for ; Tue, 12 Jun 2012 04:42:14 -0700 (PDT) Received: by 10.220.214.148 with SMTP id ha20mr14634926vcb.5.1339501334271; Tue, 12 Jun 2012 04:42:14 -0700 (PDT) MIME-Version: 1.0 Received: by 10.52.184.2 with HTTP; Tue, 12 Jun 2012 04:41:34 -0700 (PDT) In-Reply-To: <4FD6A346.4010108@codesourcery.com> References: <4FD68A1A.2040600@mentor.com> <4FD6A346.4010108@codesourcery.com> From: Hui Zhu Date: Tue, 12 Jun 2012 11:42:00 -0000 Message-ID: Subject: Re: What about add new commands "maintenance agent-breakpoint id expression" and "maintenance agent-eval-breakpoint id expression" To: Yao Qi Cc: Hui Zhu , "gdb@sourceware.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-06/txt/msg00057.txt.bz2 On Tue, Jun 12, 2012 at 10:02 AM, Yao Qi wrote: > On 06/12/2012 08:15 AM, Hui Zhu wrote: >> Hi guys, >> >> The "maintenance agent" and "maintenance agent-eval" are for translate >> an expression into remote agent bytecode. >> Both of them got address info from frame. =C2=A0But when we use tracepoi= nt or >> breakpoint with agent code, this address is from tracepoint or breakpoin= t. > > Agent expression evaluation makes sense in the context of "current > scope" or "current frame". =C2=A0We can't switch to a frame at any arbitr= ary > address, because the frame maybe does not exist. > What your worry about is line "expr =3D parse_expression (exp);" cannot work, right? It can be change to function "parse_exp_1" to handle this issue. BTW if agent generate need current scope or current frame, how this code generate when breakpoint or tracepoint use it? :) > Any examples that "maint agent" doesn't meet your needs in > breakpoint/tracepoint? =C2=A0It works in the following simple case, > > (gdb) b main if (unsigned int) main > 1 > (gdb) maintenance agent-eval (unsigned int) main > 1 > =C2=A00 =C2=A0const64 134513662 > =C2=A09 =C2=A0zero_ext 32 > =C2=A011 =C2=A0const8 1 > =C2=A013 =C2=A0zero_ext 32 > =C2=A015 =C2=A0swap > =C2=A016 =C2=A0less_unsigned > =C2=A017 =C2=A0end > > -- > Yao (=E9=BD=90=E5=B0=A7) > > It have too much limit. For example, it will not work when we want collect an local var inside of a function. Thanks, Hui