This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] More C++ for tracepoint actions
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Stan Shebs <stan at codesourcery dot com>
- Date: Fri, 12 Mar 2010 01:27:40 +0000
- Subject: Re: [PATCH] More C++ for tracepoint actions
- References: <4B999376.8030209@codesourcery.com>
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