[RFA] Fix DW_OP_GNU_regval_type with FP registers

Joel Brobecker brobecker@adacore.com
Fri Nov 15 12:19:00 GMT 2013


> >>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
> 
> Joel>         * dwarf2expr.h (struct dwarf_expr_context_funcs) <read_reg>:
> Joel>         Extend the documentation a bit.
> Joel>         <get_reg_value>: New field.
> Joel>         * dwarf2loc.c (dwarf_expr_get_reg_value)
> Joel>         (needs_frame_get_reg_value): New functions.
> Joel>         (dwarf_expr_ctx_funcs, needs_frame_ctx_funcs): Add "get_reg_value"
> Joel>         callback.
> Joel>         * dwarf2-frame.c (get_reg_value): New function.
> Joel>         (dwarf2_frame_ctx_funcs): Add "get_reg_value" callback.
> Joel>         * dwarf2expr.c (execute_stack_op) <DW_OP_GNU_regval_type>:
> Joel>         Use new callback to compute result_val.
> 
> Joel> gdb/testsuite/ChangeLog:
> 
> Joel>         * O2_float_param: New testcase.
> 
> Joel> tested on x86_64-linux and ppc-linux.
> Joel> OK to commit?

Thanks both, Pedro and Tom, for reviewing the patch. I immediately
starting thinking about Pedro's suggestion...

> (Eliminating read_reg might be tricky, but I think it'd be nice
> if it were be renamed to something that implies "address", like
> read_addr_reg or some such.)

... and forgot to announce here that I pushed the patch this morning.

Regarding Pedro's suggestion, what do we think of "read_addr_from_reg"?
Still not perfect, as it hides a bit the fact that it only does
a partial register read if the address size is smaller than the
register size. But much better than "read_reg", I agree.

-- 
Joel



More information about the Gdb-patches mailing list