diff options
Diffstat (limited to 'libgcc')
-rw-r--r-- | libgcc/ChangeLog | 5 | ||||
-rw-r--r-- | libgcc/unwind-seh.c | 42 |
2 files changed, 23 insertions, 24 deletions
diff --git a/libgcc/ChangeLog b/libgcc/ChangeLog index dd90874..1303694 100644 --- a/libgcc/ChangeLog +++ b/libgcc/ChangeLog @@ -1,3 +1,8 @@ +2014-05-13 Bernd Edlinger <bernd.edlinger@hotmail.de> + + * unwind-seh.c (_Unwind_Backtrace): Uncommented, finished + implementation. + 2014-05-12 Georg-Johann Lay <avr@gjlay.de> * config/arm/bpabi-lib.h (License): Add GCC Runtime Library Exception. diff --git a/libgcc/unwind-seh.c b/libgcc/unwind-seh.c index b4a3ca1..c8187b3 100644 --- a/libgcc/unwind-seh.c +++ b/libgcc/unwind-seh.c @@ -431,43 +431,40 @@ _Unwind_DeleteException (struct _Unwind_Exception *exc) /* Perform stack backtrace through unwind data. */ _Unwind_Reason_Code -_Unwind_Backtrace(_Unwind_Trace_Fn trace ATTRIBUTE_UNUSED, - void *trace_argument ATTRIBUTE_UNUSED) +_Unwind_Backtrace(_Unwind_Trace_Fn trace, + void *trace_argument) { -#if 0 UNWIND_HISTORY_TABLE ms_history; CONTEXT ms_context; struct _Unwind_Context gcc_context; + DISPATCHER_CONTEXT disp_context; memset (&ms_history, 0, sizeof(ms_history)); memset (&gcc_context, 0, sizeof(gcc_context)); + memset (&disp_context, 0, sizeof(disp_context)); ms_context.ContextFlags = CONTEXT_ALL; RtlCaptureContext (&ms_context); - gcc_context.disp.ContextRecord = &ms_context; - gcc_context.disp.HistoryTable = &ms_history; + gcc_context.disp = &disp_context; + gcc_context.disp->ContextRecord = &ms_context; + gcc_context.disp->HistoryTable = &ms_history; while (1) { - gcc_context.disp.ControlPc = ms_context.Rip; - gcc_context.disp.FunctionEntry - = RtlLookupFunctionEntry (ms_context.Rip, &gcc_context.disp.ImageBase, + gcc_context.disp->ControlPc = ms_context.Rip; + gcc_context.disp->FunctionEntry + = RtlLookupFunctionEntry (ms_context.Rip, &gcc_context.disp->ImageBase, &ms_history); - if (gcc_context.disp.FunctionEntry) - { - gcc_context.disp.LanguageHandler - = RtlVirtualUnwind (0, gcc_context.disp.ImageBase, ms_context.Rip, - gcc_context.disp.FunctionEntry, &ms_context, - &gcc_context.disp.HandlerData, - &gcc_context.disp.EstablisherFrame, NULL); - } - else - { - ms_context.Rip = *(ULONG_PTR *)ms_context.Rsp; - ms_context.Rsp += 8; - } + if (!gcc_context.disp->FunctionEntry) + return _URC_END_OF_STACK; + + gcc_context.disp->LanguageHandler + = RtlVirtualUnwind (0, gcc_context.disp->ImageBase, ms_context.Rip, + gcc_context.disp->FunctionEntry, &ms_context, + &gcc_context.disp->HandlerData, + &gcc_context.disp->EstablisherFrame, NULL); /* Call trace function. */ if (trace (&gcc_context, trace_argument) != _URC_NO_REASON) @@ -477,8 +474,5 @@ _Unwind_Backtrace(_Unwind_Trace_Fn trace ATTRIBUTE_UNUSED, if (ms_context.Rip == 0) return _URC_END_OF_STACK; } -#else - return _URC_END_OF_STACK; -#endif } #endif /* __SEH__ && !defined (__USING_SJLJ_EXCEPTIONS__) */ |