New method for getting current task names (refactor)

#796 Merged at 97cc437
Repository
Branch
task_name
Repository
Branch
unified
Author
  1. Alex
Reviewers
Description

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.

Comments (4)

  1. Daniel Fort

    Thought that loading the selftest module and running a few tests might be a good way of testing this branch but it couldn't complete a Stubs API test on the EOSM. Did a regression test with the current nightly and it couldn't complete the test either. @Eosm Developer must be going crazy trying to do this on pull request #792.

  2. Alex author

    I've tested this branch in QEMU on all unified models (just the new stubs, without the GUI).

    Testing HPTimer and task name...
      5D2: Hello from task run_test
           Hello from HPTimer (184808, 1) **INT-10h**
      5D3: Hello from task run_test
           Hello from HPTimer (136936, 1) **INT-10h**
       6D: Hello from task run_test
           Hello from HPTimer (69096, 1) **INT-10h**
       7D: Hello from task run_test
           Hello from HPTimer (221928, 1) **INT-10h**
      50D: Hello from task run_test
           Hello from HPTimer (155112, 1) **INT-10h**
      60D: Hello from task run_test
           Hello from HPTimer (116968, 1) **INT-10h**
     500D: Hello from task run_test
           Hello from HPTimer (124136, 1) **INT-10h**
     550D: Hello from task run_test
           Hello from HPTimer (75496, 1) **INT-10h**
     600D: Hello from task run_test
           Hello from HPTimer (75496, 1) **INT-10h**
     650D: Hello from task run_test
           Hello from HPTimer (89832, 1) **INT-10h**
     700D: Hello from task run_test
           Hello from HPTimer (243944, 1) **INT-10h**
    1100D: Hello from task run_test
           Hello from HPTimer (62952, 1) **INT-10h**
     EOSM: Hello from task run_test
           Hello from HPTimer (166888, 1) **INT-10h**
    

    Full log: http://builds.magiclantern.fm/jenkins/view/QEMU/job/QEMU-tests/48/console

  3. Daniel Fort

    Sorry for the delay -- catching up on my todo list.

    Still trouble trying to complete a Stubs API test on the EOSM. Tested it on the 700D and it worked perfectly.

    In any case I ran it several times on the EOSM and the screen freezes without creating a log and with this message on the console:

           m12 = GetFreeMemForAllocateMemory() => 0x3500e4
    [Pass] ABS(m01-m11) => 0x20
    [Pass] ABS(m02-m12) => 0x3c