Stepping in original source with state and threads

This tests that we can successfully complete a debugging session with source maps, including setting breakpoints, deleting breakpoints, and stepping for a binary generated with PROXY_TO_PTHREAD.

Steps

  • Inspect main thread that is offloaded to a worker thread:
    1. Open DevTools
    2. Open stepping-with-state-and-threads.c
    3. Set a breakpoint at function main on line args *thread_args = (args*) malloc(sizeof(args));
    4. Reload
    5. Breakpoint should hit set breakpoint
    6. Check that the executing thread is a worker thread and not in the main thread
    7. Step a few times until the next line is hit and inspect wasm variables
    8. Remove breakpoint
    9. Set a breakpoint at function addConstant on line for (int i = 0; i < length; ++i) {
    10. Reload
    11. Breakpoint should hit the new breakpoint
    12. Step a few times and inspect the wasm variables in the scope view
    13. Remove breakpoint
    14. Resume
  • Inspect worker thread:
    1. Set a breakpoint at function threadEntryPoint on line args *arguments = (args*) input;
    2. Reload
    3. Breakpoint should hit set breakpoint
    4. Step a few times until the next line is hit and inspect wasm variables
    5. Remove breakpoint
    6. Set a breakpoint at function multiplyByConstant on line for (int i = 0; i < length; ++i) {
    7. Reload
    8. Breakpoint should hit the new breakpoint
    9. Step a few times until the next line is hit and inspect the wasm variables in the scope view
    10. Remove breakpoint
    11. Resume