Re: What does this stack mean?
Re: What does this stack mean?
- Subject: Re: What does this stack mean?
- From: Jonny Taylor <email@hidden>
- Date: Thu, 7 Dec 2006 09:23:46 +0000
- Authenticated-sender:
The exception "unwinding" code is in a library whose name escapes
me at the moment. At each level of unwinding it does these things;
1. check whether the current point of execution is inside a "try"
block
2. If not, call destructors for all locally defined objects
3. dump this frame and step up the calling chain to the previous
frame, go to step 1. If there is no previous frame, kill the program.
4. If it is in a try block, examine the catch clauses for a match
5. If a match is found, execute its code and continue
6. If no match is found, go to step 3
I think that is right. The compiler creates links to the locally
defined objects so the exception code can find them. The exception
code is written with knowledge of how the stack frame is organized.
David,
Thankyou very much for this explanation. Do you know how much of this
is done "from" the original throw function? That is, if a slightly
more extended version of my stack at the time of the crash is:
#0 0x00089d5c in _Unwind_Find_registered_FDE
#1 0x00089fc8 in _Unwind_Find_FDE
#2 0x00085c88 in uw_frame_state_for
#3 0x0008603c in uw_init_context_1
#4 0x00086400 in _Unwind_RaiseException
#5 0x00087f38 in __cxa_throw
#6 0x0002010c in Record::SetValue
#7 0x00010434 in DataWindow::GetSetItemData
#8 0x0003ecd8 in JBrowser::DoPaste
#9 0x000443e8 in JBrowser::ExecuteEditCommand
#10 0x0001303c in DataWindow::DoPaste
and there were a "catch" block in DataWindow::DoPaste and a local
stack object Foo to be destroyed in DataWindow::GetSetItemData, would
an extract from the stack look something like this at the time of
destruction:
#0 0x000????? in Foo::~Foo
#1 0x00085c88 in uw_frame_state_for
#2 0x0008603c in uw_init_context_1
#3 0x00086400 in _Unwind_RaiseException
#4 0x00087f38 in __cxa_throw
#5 0x0002010c in Record::SetValue
#6 0x00010434 in DataWindow::GetSetItemData
#7 0x0003ecd8 in JBrowser::DoPaste
#8 0x000443e8 in JBrowser::ExecuteEditCommand
#9 0x0001303c in DataWindow::DoPaste
(though obviously I may be wrong in exactly which function ends up
calling ~Foo)... or would the stack look something like this instead?
#0 0x000????? in Foo::~Foo
#1 0x000????? in some sort of exception-handling glue, potentially
#2 0x00010434 in DataWindow::GetSetItemData
#3 0x0003ecd8 in JBrowser::DoPaste
#4 0x000443e8 in JBrowser::ExecuteEditCommand
#5 0x0001303c in DataWindow::DoPaste
My guess would be that the former is more plausible, but obviously it
would make quite a difference in my case if it were the latter - for
example in terms of whether there's any chance that destructors might
have been called at the point where the crash occurred with my
original callstack.
Thanks again for your help!
Jonny
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden