[all-commits] [llvm/llvm-project] 4570f2: Add a test for debugserver handling threads suspen...

jimingham via All-commits all-commits at lists.llvm.org
Thu Feb 13 16:01:43 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 4570f2c7cf35388d8b3ab9cc5cdcad4971e31cf2
      https://github.com/llvm/llvm-project/commit/4570f2c7cf35388d8b3ab9cc5cdcad4971e31cf2
  Author: Jim Ingham <jingham at apple.com>
  Date:   2020-02-13 (Thu, 13 Feb 2020)

  Changed paths:
    A lldb/test/API/macosx/thread_suspend/Makefile
    A lldb/test/API/macosx/thread_suspend/TestInternalThreadSuspension.py
    A lldb/test/API/macosx/thread_suspend/main.c

  Log Message:
  -----------
  Add a test for debugserver handling threads suspended from within a program.

Mach allows you to suspend and resume other threads within a program, so
debugserver has to be careful not to interfere with this when it goes to supend and
resume threads while stepping over breakpoints and calling functions.  Even
trickier, if you call a function on a suspended thread, it has to resume the
thread to get the expression to run, and then suspend it properly when done.

This all works already, but there wasn't a test for it.  Adding that here.

This same test could be written for a unix that supports pthread_{suspend,resume}_np, but
macOS doesn't support these calls, only the mach version.  It doesn't look like
a lot of Linux'es support this (AIX does apparently...)  And IIUC Windows allows
you to suspend and resume other threads, but the code for that would look pretty
different than this main.c.  So for simplicity's sake I wrote this test for Darwin-only.




More information about the All-commits mailing list