2022-12-20 17:49:37 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2006-2022, RT-Thread Development Team
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
*
|
|
|
|
* Change Logs:
|
|
|
|
* Date Author Notes
|
|
|
|
* 2022-06-02 Jesven the first version
|
2023-08-08 00:22:14 +08:00
|
|
|
* 2023-06-24 WangXiaoyao Support backtrace for non-active thread
|
2022-12-20 17:49:37 +08:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __BACKTRACE_H__
|
|
|
|
#define __BACKTRACE_H__
|
|
|
|
|
2023-08-08 00:22:14 +08:00
|
|
|
#include <rtthread.h>
|
|
|
|
|
2022-12-20 17:49:37 +08:00
|
|
|
struct bt_frame
|
|
|
|
{
|
|
|
|
unsigned long fp;
|
|
|
|
unsigned long pc;
|
|
|
|
};
|
|
|
|
|
|
|
|
void backtrace(unsigned long pc, unsigned long lr, unsigned long fp);
|
2023-02-27 10:04:10 +08:00
|
|
|
int rt_backtrace(void);
|
2022-12-20 17:49:37 +08:00
|
|
|
|
2023-08-08 00:22:14 +08:00
|
|
|
int rt_backtrace_user_thread(rt_thread_t thread);
|
|
|
|
int rt_backtrace_thread(rt_thread_t thread);
|
|
|
|
|
2022-12-20 17:49:37 +08:00
|
|
|
#endif /*__BACKTRACE_H__*/
|