Re: [PATCH 5/7] Add a proxy unwinder.

Tom Tromey
2011-08-15T20:38:57Z

>>>>> "Sanjoy" == Sanjoy Das <sanjoy@playingwithpointers.com> writes:

Sanjoy> Have the proxy unwinder pass down all calls to the functions the JIT
Sanjoy> reader provides.

Thank you.

Sanjoy> +static void
Sanjoy> +free_reg_value_impl (struct gdb_reg_value *reg_value)
Sanjoy> +{
Sanjoy> + free (reg_value);

xfree.

Sanjoy> +static struct gdb_reg_value *
Sanjoy> +jit_unwind_reg_get_impl (struct gdb_unwind_callbacks *cb, int regnum)
Sanjoy> +{
Sanjoy> + struct jit_unwind_private *priv = cb->priv_data;
Sanjoy> + int gdb_reg = gdbarch_dwarf2_reg_to_regnum (target_gdbarch, regnum);
Sanjoy> + int size = register_size (target_gdbarch, gdb_reg);
Sanjoy> + struct gdb_reg_value *value = malloc (sizeof (struct gdb_reg_value) +
Sanjoy> + size - 1);

xmalloc.

Sanjoy> + While this is nominally a frame sniffer, in the case where the JIT
Sanjoy> + reader actually recognizes the frame, it does a lot more work -- it
Sanjoy> + unwinds the frame and saves the corresponding register values in
Sanjoy> + the cache. jit_frame_prev_register simply returns the saved
Sanjoy> + register values. */

I'm curious why you approached it this way.

Sanjoy> +jit_frame_unwind_stop_reason (struct frame_info *this_frame, void **cache)

Line too long.

Tom