11/*
2- * Copyright (c) 2006-2023, RT-Thread Development Team
2+ * Copyright (c) 2006-2025 RT-Thread Development Team
33 *
44 * SPDX-License-Identifier: Apache-2.0
55 *
66 * Change Logs:
77 * Date Author Notes
88 * 2023-07-11 RT-Thread first version
9+ * 2025-01-16 wumingzi add doxyzen comment
910 */
1011
1112#ifndef __LWP_DBG_H__
1516#include <rthw.h>
1617#include <lwp.h>
1718
19+ /**
20+ * addtogroup KernelService
21+ * @defgroup lwp lwp
22+ * @brief lwp api
23+ * @ingroup KernelService
24+ * @addtogroup lwp
25+ *@{
26+ */
27+
28+ /**
29+ * @brief Get lwp debug state
30+ * @return int lwp debug state code
31+ */
1832int dbg_thread_in_debug (void );
33+
34+ /**
35+ * @brief Register dbg_ops to struct dbg_ops_t
36+ * @param dbg_ops Pointer to dbg_ops_t that contains function pointers for various debugging operations.
37+ */
1938void dbg_register (struct dbg_ops_t * dbg_ops );
39+
40+ /**
41+ * @brief Get lwp instructure state
42+ * @return Return the architecture number
43+ */
2044uint32_t dbg_get_ins (void );
45+
46+ /**
47+ * @brief Enable step debug feature
48+ */
2149void dbg_activate_step (void );
50+
51+ /**
52+ * @brief Disable step debug feature
53+ */
2254void dbg_deactivate_step (void );
55+
56+ /**
57+ * @brief Check event for related instruction by exception state register
58+ * @param regs Pointer to exception stack with type struct rt_hw_exp_stack *
59+ * @param esr Address of exception state register
60+ * @return Return the debug event number
61+ */
2362int dbg_check_event (struct rt_hw_exp_stack * regs , unsigned long esr );
63+
64+ /**
65+ * @brief Get gdb server channel and prepared by rt_channel_t
66+ * @return Return a Pointer to rt_channel_t
67+ */
2468rt_channel_t gdb_server_channel (void );
69+
70+ /**
71+ * @brief Get debug step type
72+ * @return Return the debug step type
73+ */
2574int dbg_step_type (void );
75+
76+ /**
77+ * @brief Start debug attach request
78+ * @param pc Pointer to programe counter
79+ */
2680void dbg_attach_req (void * pc );
81+
82+ /**
83+ * @brief Suspend debug attach request
84+ * @return Return result of suspend operation and 0 is failed.
85+ */
2786int dbg_check_suspend (void );
2887
29- #endif /* __LWP_DBG_H__ */
88+ /*! @}*/
89+
90+ #endif /* __LWP_DBG_H__ */
0 commit comments