From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32517 invoked by alias); 12 Mar 2010 01:27:52 -0000 Received: (qmail 32498 invoked by uid 22791); 12 Mar 2010 01:27:51 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 12 Mar 2010 01:27:47 +0000 Received: (qmail 9099 invoked from network); 12 Mar 2010 01:27:45 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 Mar 2010 01:27:45 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [PATCH] More C++ for tracepoint actions Date: Fri, 12 Mar 2010 01:27:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-19-generic; KDE/4.3.2; x86_64; ; ) Cc: Stan Shebs References: <4B999376.8030209@codesourcery.com> In-Reply-To: <4B999376.8030209@codesourcery.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201003120127.40475.pedro@codesourcery.com> X-IsSubscribed: yes 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-03/txt/msg00429.txt.bz2 I got comments :-) On Friday 12 March 2010 01:05:58, Stan Shebs wrote: > + static int > + gen_maybe_namespace_elt (struct expression *exp, > + struct agent_expr *ax, struct axs_value *value, > + const struct type *curtype, char *name) > + { > + const char *namespace_name = TYPE_TAG_NAME (curtype); > + struct symbol *sym; > + > + sym = cp_lookup_symbol_namespace (namespace_name, name, > + get_selected_block (0), This should be context of the tracepoint instead: block_for_pc (ax->scope) The selected frame is unrelated to the tracepoint location. Basically, every call to get_selected_frame or get_selected_block in byte code generation is a bug. E.g. to make this clear for the archives: when stopped at `main', with frame #0 selected, get_selected_block returns the block of function `main'. If you do `trace foo; actions ...; tstart', you want to use the context of `foo' to generate the bytecode of this tracepoint, not `main'. -- Pedro Alves