This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] More C++ for tracepoint actions


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]