py: Add module/function/class name to exceptions.

Exceptions know source file, line and block name.

Also tidy up some debug printing functions and provide a global
flag to enable/disable them.
This commit is contained in:
Damien George
2014-01-19 11:48:48 +00:00
parent e02b2d4391
commit cbd2f7482c
17 changed files with 83 additions and 83 deletions

View File

@@ -273,8 +273,8 @@ machine_int_t mp_obj_int_get_checked(mp_obj_t self_in);
// exception
extern const mp_obj_type_t exception_type;
qstr mp_obj_exception_get_type(mp_obj_t self_in);
void mp_obj_exception_set_source_info(mp_obj_t self_in, qstr file, machine_uint_t line);
void mp_obj_exception_get_source_info(mp_obj_t self_in, qstr *file, machine_uint_t *line);
void mp_obj_exception_set_source_info(mp_obj_t self_in, qstr file, machine_uint_t line, qstr block);
void mp_obj_exception_get_source_info(mp_obj_t self_in, qstr *file, machine_uint_t *line, qstr *block);
// str
extern const mp_obj_type_t str_type;