This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

CRIS port; frame cleanup crash


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]