From 28221e7158acb4b3129e57fcb8bbf262b8d4ab3d Mon Sep 17 00:00:00 2001 From: mwilliams Date: Tue, 7 Jan 2020 07:02:31 -0800 Subject: [PATCH] gdb: Fix "Assertion 'fi->level == 0' failed." At the point that python unwinders are called, to determine if they want to handle a frame, calling value_of_register_lazy can fail because the next frame's id has not yet been computed (if its inline). Rather than calling value_of_register_lazy, then immediately calling value_fetch_lazy, just call get_frame_register_value directly. gdb/Changelog 2020-01-18 Mark Williams PR gdb/22748 * findvar.c call get_frame_register_value instead of value_of_register_lazy/value_fetch_lazy so it works without a frame id. --- gdb/findvar.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gdb/findvar.c b/gdb/findvar.c index 5cf1cd4137..0cddebc12b 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -263,16 +263,13 @@ struct value * value_of_register (int regnum, struct frame_info *frame) { struct gdbarch *gdbarch = get_frame_arch (frame); - struct value *reg_val; /* User registers lie completely outside of the range of normal registers. Catch them early so that the target never sees them. */ if (regnum >= gdbarch_num_cooked_regs (gdbarch)) return value_of_user_reg (regnum, frame); - reg_val = value_of_register_lazy (frame, regnum); - value_fetch_lazy (reg_val); - return reg_val; + return get_frame_register_value (frame, regnum); } /* Return a `value' with the contents of (virtual or cooked) register -- 2.17.1