+added source file information to stepped handler.

This commit is contained in:
paladin-t 2016-01-26 10:19:15 +08:00
parent b8120d9517
commit 9ad0a75148
5 changed files with 9 additions and 5 deletions

View File

@ -1,3 +1,6 @@
Jan. 26 2016
Added source file information to stepped handler
Jan. 25 2016
Fixed a memory leak when printing a referenced usertype
Fixed a bug with nested IF statement

Binary file not shown.

View File

@ -8505,12 +8505,12 @@ void _stepped(mb_interpreter_t* s, _ls_node_t* ast) {
if(ast && ast->data) {
obj = (_object_t*)ast->data;
#ifdef MB_ENABLE_SOURCE_TRACE
s->debug_stepped_handler(s, obj->source_pos, obj->source_row, obj->source_col);
s->debug_stepped_handler(s, s->source_file, obj->source_pos, obj->source_row, obj->source_col);
#else /* MB_ENABLE_SOURCE_TRACE */
s->debug_stepped_handler(s, obj->source_pos, 0, 0);
s->debug_stepped_handler(s, s->source_file, obj->source_pos, 0, 0);
#endif /* MB_ENABLE_SOURCE_TRACE */
} else {
s->debug_stepped_handler(s, -1, 0, 0);
s->debug_stepped_handler(s, s->source_file, -1, 0, 0);
}
}
}

View File

@ -420,7 +420,7 @@ typedef int (* mb_func_t)(struct mb_interpreter_t*, void**);
typedef int (* mb_has_routine_arg_func_t)(struct mb_interpreter_t*, void**, mb_value_t*, unsigned, unsigned*, void*);
typedef int (* mb_pop_routine_arg_func_t)(struct mb_interpreter_t*, void**, mb_value_t*, unsigned, unsigned*, void*, mb_value_t*);
typedef int (* mb_routine_func_t)(struct mb_interpreter_t*, void**, mb_value_t*, unsigned, void*, mb_has_routine_arg_func_t, mb_pop_routine_arg_func_t);
typedef void (* mb_debug_stepped_handler_t)(struct mb_interpreter_t*, int, unsigned short, unsigned short);
typedef void (* mb_debug_stepped_handler_t)(struct mb_interpreter_t*, char*, int, unsigned short, unsigned short);
typedef void (* mb_error_handler_t)(struct mb_interpreter_t*, enum mb_error_e, char*, char*, int, unsigned short, unsigned short, int);
typedef int (* mb_print_func_t)(const char*, ...);
typedef int (* mb_input_func_t)(char*, int);

View File

@ -1127,8 +1127,9 @@ static int beep(struct mb_interpreter_t* s, void** l) {
** Callbacks and handlers
*/
static void _on_stepped(struct mb_interpreter_t* s, int p, unsigned short row, unsigned short col) {
static void _on_stepped(struct mb_interpreter_t* s, char* f, int p, unsigned short row, unsigned short col) {
mb_unrefvar(s);
mb_unrefvar(f);
mb_unrefvar(p);
mb_unrefvar(row);
mb_unrefvar(col);