py: Fix adding of traceback so that it appends to existing info.
This makes exception traceback info self contained (ie doesn't rely on
list object, which was a bit of a hack), reduces code size, and reduces
RAM footprint of exception by eliminating the list object.
Addresses part of issue #1126.
diff --git a/py/objexcept.h b/py/objexcept.h
index d6cfacd..783f694 100644
--- a/py/objexcept.h
+++ b/py/objexcept.h
@@ -31,7 +31,9 @@
typedef struct _mp_obj_exception_t {
mp_obj_base_t base;
- mp_obj_t traceback; // a list object, holding (file,line,block) as numbers (not Python objects); a hack for now
+ mp_uint_t traceback_alloc : (BITS_PER_WORD / 2);
+ mp_uint_t traceback_len : (BITS_PER_WORD / 2);
+ mp_uint_t *traceback_data;
mp_obj_tuple_t *args;
} mp_obj_exception_t;