Skip to content

Commit 26f8b1e

Browse files
committed
gdb: z80: guard saved_reg addr access
The z80 unwinder calls trad_frame_saved_reg::addr() on entries that are still REALREG, which trips an assertion in debug builds. Guard the addr() access with is_addr() so only actual saved-address regs are adjusted. This keeps debug and release behavior consistent.
1 parent 91658d4 commit 26f8b1e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

gdb/z80-tdep.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ z80_frame_unwind_cache (const frame_info_ptr &this_frame,
641641
/* Adjust all the saved registers so that they contain addresses and not
642642
offsets. */
643643
for (i = 0; i < gdbarch_num_regs (gdbarch) - 1; i++)
644-
if (info->saved_regs[i].addr () > 0)
644+
if (info->saved_regs[i].is_addr () && info->saved_regs[i].addr () > 0)
645645
info->saved_regs[i].set_addr
646646
(info->prev_sp - info->saved_regs[i].addr () * addr_len);
647647

0 commit comments

Comments
 (0)