2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 2004, 2011, Oracle and/or its affiliates. All rights reserved. 2N/A * UNWIND - Unwind library 2N/A * ===================== stack walk ==================== 2N/A * Stack walk-back starts with the user code at the top of the stack 2N/A * calling a language specific support routine which calls the generic 2N/A * unwind code. The unwind code captures 2N/A * information which can be used to partially build an _Unwind_Context 2N/A * for the user code containing: 2N/A * callee saves registers <current values> 2N/A * Using that pc location the unwind info for the function is found. 2N/A * Then the CFA operations encoded in the unwind info are interepreted to get 2N/A * callee saves registers <values on entry> 2N/A * the return address 2N/A * cannonical frame address 2N/A * completing the context for the user function (See 2N/A * _Unw_Rollback_Registers()) . 2N/A * The values computed above are equivalent to the info which would have been 2N/A * captured from the caller and are used to initialize the callers context 2N/A * (see _Unw_Propagate_Registers()) which can be completed. 2N/A * Using the same two-step procedure 2N/A * context records for each frame down the stack may be constructed 2N/A * in turn. The ABI defined interface to _Unwind_Context provides 2N/A * callee saves registers <current values> 2N/A * and allows changing 2N/A * values of integer argument registers 2N/A * (changed values take effect if context is "installed" - think 2N/A * | local storage for start() | <FP == 0> 2N/A * --------------------------------. 2N/A * | | <- CFA for bar() 2N/A * --------------------------------. 2N/A * | local storage for bar() | 2N/A * | | <- SP for bar(), CFA for foo() 2N/A * ................................ 2N/A * -------------------------------- 2N/A * | local storage for foo() | 2N/A * | | <- SP for foo(), CFA for ex_throw() 2N/A * ................................ 2N/A * | pc for foo() - PC3 | 2N/A * ................................ 2N/A * | saved RBP from foo() - BP3 | <- FP for ex_throw() == FP2 2N/A * -------------------------------- 2N/A * | local storage for ex_throw() | 2N/A * | | <- SP for ex_throw(), CFA for Unw() 2N/A * ................................ 2N/A * | pc for ex_throw() - PC2 | 2N/A * ................................ 2N/A * | saved RBP from ex_throw() | <- FP for Unw() == FP1 2N/A * -------------------------------- 2N/A * | local storage for Unw() | 2N/A * | | <- SP for Unw() == SP1 2N/A * We know that Unw() and ex_throw save and have an FP 2N/A * The only static variables in this code - changed by debugging hook below 2N/A * input: FP1 (or FP2 if from _Unwind_Resume (from_landing_pad)) 2N/A * output: PC3, SP3, and BP3 2N/A * remaining callee saves registers are also captured in context 2N/A /* now shift ----------------------------- */ 2N/A * Here starts the real work - the entry points from either a language 2N/A * runtime or directly from user code. 2N/A * The two ..._Body functions are intended as private interfaces for 2N/A * Sun code as well so should remain accessible. 2N/A /* keep going - don't call personality */ 2N/A /* keep going - do call personality */ 2N/A default:
/* failure */ 2N/A/* Calls destructor function for exception object */ 2N/A * stack frame context accessors defined in ABI 2N/A * (despite all the dire text in the ABI these are reliable Get/Set routines) 2N/A * Note: RA is handled as GR value