diff --git a/src/nasal_builtin.cpp b/src/nasal_builtin.cpp index 499e92c..3f8eab8 100644 --- a/src/nasal_builtin.cpp +++ b/src/nasal_builtin.cpp @@ -405,13 +405,19 @@ var builtin_char(context* ctx, gc* ngc) { var builtin_values(context* ctx, gc* ngc) { auto hash = ctx->localr[1]; - if (hash.type!=vm_hash) { - return nas_err("values", "\"hash\" must be hash"); + if (hash.type!=vm_hash && hash.type!=vm_map) { + return nas_err("values", "\"hash\" must be hash or namespace"); } - var vec = ngc->alloc(vm_vec); + auto vec = ngc->alloc(vm_vec); auto& v = vec.vec().elems; - for(auto& i : hash.hash().elems) { - v.push_back(i.second); + if (hash.type==vm_hash) { + for(auto& i : hash.hash().elems) { + v.push_back(i.second); + } + } else { + for(auto& i : hash.map().mapper) { + v.push_back(*i.second); + } } return vec; } diff --git a/src/nasal_dbg.cpp b/src/nasal_dbg.cpp index fd0ac51..a4715cc 100644 --- a/src/nasal_dbg.cpp +++ b/src/nasal_dbg.cpp @@ -200,7 +200,10 @@ void dbg::interact() { } else if (res.size()==1) { switch(get_cmd_type(res[0])) { case dbg_cmd::cmd_help: help(); break; - case dbg_cmd::cmd_backtrace: trace_back(); break; + case dbg_cmd::cmd_backtrace: + function_call_trace(); + trace_back(); + break; case dbg_cmd::cmd_continue: return; case dbg_cmd::cmd_list_file: list_file(); break; case dbg_cmd::cmd_global: global_state(); break; @@ -240,13 +243,18 @@ void dbg::run( set_detail_report_info(true); do_profiling = profile || show_all_prof_result; - next = true; const auto& file_list = linker.get_file_list(); fsize = file_list.size(); - init(gen.strs(), gen.nums(), gen.natives(), - gen.codes(), gen.globals(), - file_list, argv); + init( + gen.strs(), + gen.nums(), + gen.natives(), + gen.codes(), + gen.globals(), + file_list, + argv + ); data.init(file_list); std::vector code; diff --git a/src/nasal_dbg.h b/src/nasal_dbg.h index 397bb7f..d351c61 100644 --- a/src/nasal_dbg.h +++ b/src/nasal_dbg.h @@ -158,7 +158,7 @@ private: public: dbg(): - next(false), fsize(0), + next(true), fsize(0), bk_fidx(0), bk_line(0), do_profiling(false) {} void run(