This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
CRIS port; frame cleanup crash
- From: Orjan Friberg <orjan dot friberg at axis dot com>
- To: gdb-patches at sources dot redhat dot com
- Date: Mon, 11 Aug 2003 15:30:28 +0200
- Subject: CRIS port; frame cleanup crash
- Organization: Axis Communications
After a long overdue update of my gdb cvs tree, I found that something
broke late March/early April. I don't quite understand what goes on,
but it seems to happen the first time a frame allocated by
deprecated_frame_xmalloc_with_cleanup is freed by do_cleanups (which
happens in cris_skip_prologue_main). gdb segfaults on a call to free
with a pointer to that frame. The arm-tdep.c file contains the same
construct of:
old_chain = make_cleanup (null_cleanup, NULL);
frame = deprecated_frame_xmalloc_with_cleanup (..., ...)
<do something with frame>
do_cleanups (old_chain);
The only thing I found that looked suspicous was that the frame variable
is allocated by a call to obstack_alloc, but free'd with a "normal" call
to free. I would have guessed it should be with obstack_free, but then
again, my understanding of what happens is limited so far.
Any pointers or suggestions are appreciated.
--
Orjan Friberg
Axis Communications