From: Alan Hayward Date: Thu, 22 Jun 2017 15:30:15 +0000 (+0100) Subject: Fix cached_frame allocation in py-unwind X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=16892a0323ce6cf41ca80e384dfba12524247902;p=binutils-gdb.git Fix cached_frame allocation in py-unwind gdb/ * python/py-unwind.c (pyuw_sniffer): Allocate space for registers. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1fad587c74b..bf9e08d1d81 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2017-06-22 Alan Hayward + + * python/py-unwind.c (pyuw_sniffer): Allocate space for + registers. + 2017-06-22 Alan Hayward * record-full.c (record_full_exec_insn): Use byte_vector. diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c index da1703ecf2b..1d800a7b786 100644 --- a/gdb/python/py-unwind.c +++ b/gdb/python/py-unwind.c @@ -557,7 +557,10 @@ pyuw_sniffer (const struct frame_unwind *self, struct frame_info *this_frame, saved_reg *reg; int i; - cached_frame = XNEW (cached_frame_info); + cached_frame + = ((cached_frame_info *) + xmalloc (sizeof (*cached_frame) + + reg_count * sizeof (cached_frame->reg[0]))); cached_frame->gdbarch = gdbarch; cached_frame->frame_id = unwind_info->frame_id; cached_frame->reg_count = reg_count;