This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH]: Minor fix in blockframe.c
- To: gdb-patches at sources dot redhat dot com
- Subject: [PATCH]: Minor fix in blockframe.c
- From: Michael Snyder <msnyder at cygnus dot com>
- Date: Mon, 11 Dec 2000 13:09:12 -0800 (PST)
When setting up a new frame_info object, just use memset to pre-zero
it, rather than zeroing selected fields individually. That way new ones
won't get overlooked.
2000-12-11 Michael Snyder <msnyder@mvstp600e.cygnus.com>
* blockframe.c (get_prev_frame): Zero all fields of prev by
default using memset (instead of one at a time).
*** blockframe.c 2000/09/01 23:39:11 1.7
--- blockframe.c 2000/12/11 21:08:51
*************** get_prev_frame (struct frame_info *next_
*** 393,405 ****
obstack_alloc (&frame_cache_obstack,
sizeof (struct frame_info));
! prev->saved_regs = NULL;
if (next_frame)
next_frame->prev = prev;
prev->next = next_frame;
- prev->prev = (struct frame_info *) 0;
prev->frame = address;
- prev->signal_handler_caller = 0;
/* This change should not be needed, FIXME! We should
determine whether any targets *need* INIT_FRAME_PC to happen
--- 393,405 ----
obstack_alloc (&frame_cache_obstack,
sizeof (struct frame_info));
! /* Zero all fields by default. */
! memset (prev, 0, sizeof (struct frame_info);
!
if (next_frame)
next_frame->prev = prev;
prev->next = next_frame;
prev->frame = address;
/* This change should not be needed, FIXME! We should
determine whether any targets *need* INIT_FRAME_PC to happen