backtrace.h 640 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2006-2022, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2022-06-02 Jesven the first version
  9. * 2023-06-24 WangXiaoyao Support backtrace for non-active thread
  10. */
  11. #ifndef __BACKTRACE_H__
  12. #define __BACKTRACE_H__
  13. #include <rtthread.h>
  14. struct bt_frame
  15. {
  16. unsigned long fp;
  17. unsigned long pc;
  18. };
  19. void backtrace(unsigned long pc, unsigned long lr, unsigned long fp);
  20. int rt_backtrace(void);
  21. int rt_backtrace_user_thread(rt_thread_t thread);
  22. int rt_backtrace_thread(rt_thread_t thread);
  23. #endif /*__BACKTRACE_H__*/