aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2017-06-22 16:30:15 +0100
committerAlan Hayward <alan.hayward@arm.com>2017-06-22 16:30:15 +0100
commit16892a0323ce6cf41ca80e384dfba12524247902 (patch)
treed7bd55f43728b002e67f0321365027c18153fa54 /gdb/python
parentd7dcbefc724e59aa49e4ac2ac2337c8e1b8c367a (diff)
downloadfsf-binutils-gdb-16892a0323ce6cf41ca80e384dfba12524247902.zip
fsf-binutils-gdb-16892a0323ce6cf41ca80e384dfba12524247902.tar.gz
fsf-binutils-gdb-16892a0323ce6cf41ca80e384dfba12524247902.tar.bz2
Fix cached_frame allocation in py-unwind
gdb/ * python/py-unwind.c (pyuw_sniffer): Allocate space for registers.
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/py-unwind.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/python/py-unwind.c b/gdb/python/py-unwind.c
index da1703e..1d800a7 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;