Skip to content

New method for getting current task names (refactor)

Alex requested to merge branch/task_name into branch/unified

This method was used on dm-spy-experiments branch and had quite a few iterations over time. The commit history from this branch is a bit simplified, showing just the latest version.

Reason: the one from unified crashes when called for every single debug message. Didn't check whether it's race condition, calling from unsafe contexts, or just too slow.

The new one is very fast: simply reads a pointer to DryOS's current_task structure from memory. It also handles interrupts.

Very useful for anything that logs low-level stuff, and fewer things that can go wrong during normal usage.

Some models may require stubs (current_task, current_interrupt). They can be checked easily in QEMU (GDB scripts).

VxWorks will require some changes as well (already done on vxworks-dm-spy branch).

current_task->name is also valid on DIGIC 6 models as well. I guess current_task->taskId is valid as well, but didn't check.

Merge request reports