From: Jérémie Astor Date: Sat, 4 Sep 2021 13:09:56 +0000 (+0200) Subject: :art: Improve unhandled effects X-Git-Tag: nightly~470^2~18 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=cc1c6b02605c50c1de023f92ac3f51e00e246eba;p=gwion.git :art: Improve unhandled effects --- diff --git a/src/vm/vm.c b/src/vm/vm.c index d2041e19..922ef5cb 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -154,13 +154,15 @@ ANN static inline void add_to_killed(const VM_Shred shred) { vector_add(&shreduler->killed_shreds, (m_uint)shred); } -ANN static inline void unhandled_pp(VM_Shred shred, const m_str effect) { - gw_err("{-C}shred{W}[{Y}% 5" UINT_F "{W}]{-}: {-R}Unhandled {+R}%s{0}\n", +ANN static inline void unhandled_pp(VM_Shred shred, const m_str effect, const struct TraceStart *ts) { + gw_err("{-}[{0}{+}Gwion{0}{-}](VM):{0} {-}in code {/+}'%s'{0}{-}. origin: {/+}'%s'{0}{-}\n", + ts->code->name, shred->info->orig->name); + gw_err("{-C}shred{W}[{Y}% 5" UINT_F "{W}]{-}:{-R}Unhandled {+R}%s{0}\n", shred->tick->xid, effect); } ANN static inline void handle_fail(VM_Shred shred, const m_str effect, const struct TraceStart *ts) { - unhandled_pp(shred, effect); + unhandled_pp(shred, effect, ts); if (shred->info->line.ptr) // trace if available shred_trace(shred, ts); add_to_killed(shred);