forked from len0rd/rockbox
Arm stack unwinder
Simplified stack unwinder for ARM. This is port of http://www.mcternan.me.uk/ArmStackUnwinding/ backtrace() is called from UIE() on native targets and from panicf() on both native and ARM RaaA. Change-Id: I8e4b3c02490dd60b30aa372fe842d193b8929ce0
This commit is contained in:
parent
680c6fcde1
commit
b4eab59951
23 changed files with 2630 additions and 18 deletions
78
lib/unwarminder/unwarminder.c
Normal file
78
lib/unwarminder/unwarminder.c
Normal file
|
@ -0,0 +1,78 @@
|
|||
/***************************************************************************
|
||||
* ARM Stack Unwinder, Michael.McTernan.2001@cs.bris.ac.uk
|
||||
*
|
||||
* This program is PUBLIC DOMAIN.
|
||||
* This means that there is no copyright and anyone is able to take a copy
|
||||
* for free and use it as they wish, with or without modifications, and in
|
||||
* any context, commercially or otherwise. The only limitation is that I
|
||||
* don't guarantee that the software is fit for any purpose or accept any
|
||||
* liability for it's use or misuse - this software is without warranty.
|
||||
***************************************************************************
|
||||
* File Description: Implementation of the interface into the ARM unwinder.
|
||||
**************************************************************************/
|
||||
|
||||
#define MODULE_NAME "UNWARMINDER"
|
||||
|
||||
/***************************************************************************
|
||||
* Include Files
|
||||
**************************************************************************/
|
||||
|
||||
#include "types.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "unwarminder.h"
|
||||
#include "unwarm.h"
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* Manifest Constants
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* Type Definitions
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* Variables
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* Macros
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* Local Functions
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
* Global Functions
|
||||
**************************************************************************/
|
||||
|
||||
UnwResult UnwindStart(Int32 pcValue,
|
||||
Int32 spValue,
|
||||
const UnwindCallbacks *cb,
|
||||
void *data)
|
||||
{
|
||||
UnwState state;
|
||||
|
||||
/* Initialise the unwinding state */
|
||||
UnwInitState(&state, cb, data, pcValue, spValue);
|
||||
|
||||
/* Check the Thumb bit */
|
||||
if(pcValue & 0x1)
|
||||
{
|
||||
return UnwStartThumb(&state);
|
||||
}
|
||||
else
|
||||
{
|
||||
return UnwStartArm(&state);
|
||||
}
|
||||
}
|
||||
|
||||
/* END OF FILE */
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue