mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-12-01 19:49:11 +08:00
add debugger_get_current_frame
This commit is contained in:
parent
ebb20037b2
commit
0b5f107cf4
@ -1,6 +1,7 @@
|
||||
# 最新动态
|
||||
2023/10/28
|
||||
* 修复conf\_doc\_dup\_node复制数组的问题(感谢俊杰提供补丁)。
|
||||
* 增加debugger\_get\_curr\_frame\_index函数(感谢智明提供补丁)
|
||||
|
||||
2023/10/28
|
||||
* 完善edit带格式输入。
|
||||
|
@ -310,6 +310,11 @@ tk_object_t* debugger_get_var(debugger_t* debugger, const char* path) {
|
||||
return debugger->vt->get_var(debugger, path);
|
||||
}
|
||||
|
||||
int32_t debugger_get_current_frame(debugger_t* debugger) {
|
||||
return_value_if_fail(debugger != NULL && debugger->vt != NULL, -1);
|
||||
return debugger->current_frame_index;
|
||||
}
|
||||
|
||||
ret_t debugger_set_current_frame(debugger_t* debugger, uint32_t frame_index) {
|
||||
return_value_if_fail(debugger != NULL && debugger->vt != NULL, RET_BAD_PARAMS);
|
||||
|
||||
|
@ -507,6 +507,16 @@ ret_t debugger_remove_break_point_ex(debugger_t* debugger, const char* position)
|
||||
*/
|
||||
tk_object_t* debugger_get_var(debugger_t* debugger, const char* path);
|
||||
|
||||
/**
|
||||
* @method debugger_get_current_frame
|
||||
*获取当前callstack的frame。
|
||||
* > 处于暂停状态才能执行本命令。
|
||||
* @param {debugger_t*} debugger debugger对象。
|
||||
*
|
||||
* @return {uint32_t} 成功返回frame序数(0表示当前),失败返回-1。
|
||||
*/
|
||||
int32_t debugger_get_current_frame(debugger_t* debugger);
|
||||
|
||||
/**
|
||||
* @method debugger_set_current_frame
|
||||
* 从callstack中选择当前的frame。
|
||||
|
@ -344,7 +344,7 @@ static ret_t func_local(app_info_t* app, tokenizer_t* tokenizer) {
|
||||
int32_t index = tokenizer_next_int(tokenizer, -1);
|
||||
|
||||
if (index < 0) {
|
||||
index = app->debugger->current_frame_index;
|
||||
index = debugger_get_current_frame(app->debugger);
|
||||
}
|
||||
obj = debugger_get_local(app->debugger, index);
|
||||
fdb_show_variables("local vars", obj);
|
||||
@ -458,7 +458,7 @@ static ret_t fdb_show_callstack(app_info_t* app) {
|
||||
log_debug("callstack:\n---------------------------\n");
|
||||
while (tokenizer_has_more(&t)) {
|
||||
const char* func = tokenizer_next(&t);
|
||||
if (i == app->debugger->current_frame_index) {
|
||||
if (i == debugger_get_current_frame(app->debugger)) {
|
||||
log_debug(KGRN "=> [%d] %s\n" KNRM, i, func);
|
||||
} else {
|
||||
log_debug(" [%d] %s\n", i, func);
|
||||
|
Loading…
Reference in New Issue
Block a user