Marcin Bukat | b4eab59 | 2012-01-25 09:57:59 +0100 | [diff] [blame] | 1 | /*************************************************************************** |
| 2 | * ARM Stack Unwinder, Michael.McTernan.2001@cs.bris.ac.uk |
| 3 | * |
| 4 | * This program is PUBLIC DOMAIN. |
| 5 | * This means that there is no copyright and anyone is able to take a copy |
| 6 | * for free and use it as they wish, with or without modifications, and in |
| 7 | * any context, commercially or otherwise. The only limitation is that I |
| 8 | * don't guarantee that the software is fit for any purpose or accept any |
| 9 | * liability for it's use or misuse - this software is without warranty. |
| 10 | *************************************************************************** |
| 11 | * File Description: Implementation of the interface into the ARM unwinder. |
| 12 | **************************************************************************/ |
| 13 | |
| 14 | #define MODULE_NAME "UNWARMINDER" |
| 15 | |
| 16 | /*************************************************************************** |
| 17 | * Include Files |
| 18 | **************************************************************************/ |
| 19 | |
| 20 | #include "types.h" |
| 21 | #include <stdio.h> |
| 22 | #include <string.h> |
| 23 | #include "unwarminder.h" |
| 24 | #include "unwarm.h" |
| 25 | |
| 26 | |
| 27 | /*************************************************************************** |
| 28 | * Manifest Constants |
| 29 | **************************************************************************/ |
| 30 | |
| 31 | |
| 32 | /*************************************************************************** |
| 33 | * Type Definitions |
| 34 | **************************************************************************/ |
| 35 | |
| 36 | |
| 37 | /*************************************************************************** |
| 38 | * Variables |
| 39 | **************************************************************************/ |
| 40 | |
| 41 | |
| 42 | /*************************************************************************** |
| 43 | * Macros |
| 44 | **************************************************************************/ |
| 45 | |
| 46 | |
| 47 | /*************************************************************************** |
| 48 | * Local Functions |
| 49 | **************************************************************************/ |
| 50 | |
| 51 | |
| 52 | /*************************************************************************** |
| 53 | * Global Functions |
| 54 | **************************************************************************/ |
| 55 | |
| 56 | UnwResult UnwindStart(Int32 pcValue, |
| 57 | Int32 spValue, |
| 58 | const UnwindCallbacks *cb, |
| 59 | void *data) |
| 60 | { |
| 61 | UnwState state; |
| 62 | |
| 63 | /* Initialise the unwinding state */ |
| 64 | UnwInitState(&state, cb, data, pcValue, spValue); |
| 65 | |
| 66 | /* Check the Thumb bit */ |
| 67 | if(pcValue & 0x1) |
| 68 | { |
| 69 | return UnwStartThumb(&state); |
| 70 | } |
| 71 | else |
| 72 | { |
| 73 | return UnwStartArm(&state); |
| 74 | } |
| 75 | } |
| 76 | |
| 77 | /* END OF FILE */ |
| 78 | |