This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Exception hanlding under g++ questions
- To: gcc at gcc dot gnu dot org
- Subject: Exception hanlding under g++ questions
- From: "Kevin B. Hendricks" <khendricks at ivey dot uwo dot ca>
- Date: Wed, 13 Dec 2000 12:40:16 -0500
- Reply-To: khendricks at ivey dot uwo dot ca
Hi,
Under PPC Linux I have a g++ routine that properly saves the return address (lr register) in the previous stack frame (as shown by disassembly).
However when a routine called by this one throws an exception, the stack walkback only gets as far as this routine and then is terminated because the next pc to look for is out in the weeds someplace (as shown by gdb with breakpoints in throw_helper).
Looking in libgcc2.c I notice the following in throw_helper:
pc = get_return_addr(udata, sub_udata) - 1;
I tried to track down exactly where this is implemented to no avail (something about BUILT_IN_EXTRACT_RETURN_ADDR)
Why would this return a value out in the weeds instead of just the value of the correctly saved return address (lr valued stored in the offset of 4 in the previous frame).
What I am seeing is gdb easily able to do a backtrace through this function but the throw_helper
never gets past this routine and then terminates with a funny pc pointing to who knows where.
What additional info is the stack walk back using that gdb does not?
Ideas on how to debug this would be greatly appreciated.
Or any pointers on what to read to understand more about what is happening here.
please cc any replies to:
khendricks@ivey.uwo.ca
Thanks,
Kevin