[PATCH] Handle LOC_COMPUTED variables in tracepoint actions
Fri Dec 18 19:46:00 GMT 2009
The last time that anybody used tracepoints much, stabs was still the
norm and Dwarf 2 the newbie, and so nobody thought much about handling
variables with computed locations. Nowadays many local variables have
computed locations, and we have to generate appropriate agent expression
bytecodes. Worse, the top-level encoding machinery for tracepoint
actions will issue instructions to collect variables directly, not using
bytecodes, so we need to detect when bytecodes are necessary. (In
theory we could always generate bytecodes for collection expressions;
that would make a good cleanup for later.)
This patch doesn't handle every possible computed location, that's a big
project of its own (basically translating arbitrary dwarf2 bytecode
sequences into equivalent agent expression bytecodes), it just handles
frame/base register combinations that are typical for local vars. Even
the simplified version is a little arcane, so I'll leave it up for
comments for a few days before committing.
2009-12-18 Stan Shebs <firstname.lastname@example.org>
* ax-gdb.h (gen_trace_for_var): Declare.
* ax-gdb.c (gen_trace_for_var): New function.
* dwarf2loc.c (dwarf_expr_frame_base_1): New function, split from...
(dwarf2_tracepoint_var_ref): Add computed location case.
* tracepoint.c (collect_symbol): Add scope arg and LOC_COMPUTED
(add_local_symbols): Update call to collect_symbol.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the Gdb-patches