Re: What about add new commands "maintenance agent-breakpoint id expression" and "maintenance agent-eval-breakpoint id expression"
Yao Qi <yao <at> codesourcery.com>
2012-06-12 13:15:21 GMT
On 06/12/2012 07:41 PM, Hui Zhu wrote:
>> > Agent expression evaluation makes sense in the context of "current
>> > scope" or "current frame". We can't switch to a frame at any arbitrary
>> > address, because the frame maybe does not exist.
> What your worry about is line "expr = 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? :)
My reply was on the context of "maint agent"/"maint agent-expr" which
you asked about. My full reply should be "In 'maint agent'/'maint
agent-expr', agent expression evaluation makes in ....".
I am not worried about parse_expression, but
struct frame_info *fi = get_current_frame (); /* need current scope */
agent = gen_eval_for_expr (get_frame_pc (fi), expr);
gives me the feeling that we need a correct frame here.
When using variable in condition or actions in breakpoint or tracepoint,
the variable should be *visible* under a certain frame (not current
frame that we are setting breakpoint/tracepoint, as I observed).
> It have too much limit. For example, it will not work when we want
> collect an local var inside of a function.