objgenerator: .print(): Output real underlying function name.

This commit is contained in:
Paul Sokolovsky
2014-05-01 22:20:07 +03:00
parent 1f85d6255d
commit c3103b55c1
3 changed files with 9 additions and 3 deletions

View File

@@ -126,12 +126,16 @@ mp_obj_t mp_make_function_var_between(int n_args_min, int n_args_max, mp_fun_var
/******************************************************************************/
/* byte code functions */
const char *mp_obj_fun_get_name(mp_obj_fun_bc_t *o) {
const byte *code_info = o->bytecode;
const char *mp_obj_code_get_name(const byte *code_info) {
qstr block_name = code_info[8] | (code_info[9] << 8) | (code_info[10] << 16) | (code_info[11] << 24);
return qstr_str(block_name);
}
const char *mp_obj_fun_get_name(mp_obj_fun_bc_t *o) {
const byte *code_info = o->bytecode;
return mp_obj_code_get_name(code_info);
}
#if MICROPY_CPYTHON_COMPAT
STATIC void fun_bc_print(void (*print)(void *env, const char *fmt, ...), void *env, mp_obj_t o_in, mp_print_kind_t kind) {
mp_obj_fun_bc_t *o = o_in;