This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: throwing exception when new fails
- To: nathan at acm dot org
- Subject: Re: throwing exception when new fails
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Wed, 21 Oct 1998 16:24:28 +0100
- CC: egcs at cygnus dot com
- References: <362CD14A.CA8@acm.org>
> Now the problem I've found is in frame.c. __throw calls
> __frame_state_for to obtain the function frame information. This
> ends up generating an ordered list of the fde's (what's FDE stand
> for?)
Frame Descriptor Element. There is one per function, and it describes
where the function code is located, and what the register lifetimes
and stack layout are within the function.
The data structures are defined in the DWARF specfication, although
not in a very readable way.
Every time an exception is thrown, the code needs to locate the FDE
for the current function, and starts to look for exception regions
from that FDE. This works in a two-level search:
a) in a linear search, find the shared image (i.e. DLL) containing
the PC
b) using the FDE table for that shared object, locate the FDE using
binary search (which requires the sorting)
> Suggestions?
If malloc fails, one could try to locate the FDE using linear search.
Of course, this means that there would be considerable computational
overhead, and the code implementing it would rarely be used and not
well tested (unless you design some unit testing for it).
Hope this helps,
Martin