Swift - 有没有办法触发程序断点在停止后继续

Swift -is there a way to trigger a programmatic breakpoint to continue after it stops

按照 this answer 我能够在代码中创建断点。

func sayHello() {

    raise(SIGTRAP) // programmatic breakpoint
    kill(getpid(), SIGSTOP)  // programmatic breakpoint

    print("say hello")
}

使用这两个函数中的任何一个都会停止执行,并且 "say hello" 永远不会打印出来。

与我能够以编程方式创建断点的方式相同,有没有一种方法可以让我以编程方式创建其他东西,以便在命中这两个断点中的任何一个后继续执行?

您正在寻找的功能是内置的。这里是打印 "here" 并继续的断点: