suggestion for GCC 2.8 release notes re register_frame

Paul Eggert eggert@twinsun.com
Tue Dec 16 16:01:00 GMT 1997


If you're having trouble linking EGCS-1.0-generated shared libraries
with GCC 2.8.0-1997-12-13, then you should be able to work around the
problem by linking in the following code.

Perhaps this code could be put into a frame_egcs.c source file in the
GCC distribution, or put into the GCC and/or EGCS release notes, or
something like that.  This would save experimental users some grief.



/* Stack frame unwinding backward compatibility with EGCS 1.0.  */

#include <stdlib.h>

struct object {
  void *pc_begin;
  void *pc_end;
  void *fde_begin;
  void *fde_array;
  size_t count;
  struct object *next;
};

void __register_frame_info (void *, struct object *);
void __register_frame_info_table (void *, struct object *);
void __deregister_frame_info (void *);

void
__register_frame (void *begin)
{
  __register_frame_info (begin, malloc (sizeof (struct object)));
}

void
__register_frame_table (void *begin)
{
  __register_frame_info_table (begin, malloc (sizeof (struct object)));
}

void
__deregister_frame (void *begin)
{
  /* This leaks the memory malloced above,
     but that's good enough for backward compatibility purposes.  */
  __deregister_frame_info (begin);
}



More information about the Gcc mailing list