Lance Samaria
Lance Samaria

Reputation: 19612

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

Following this answer I was able to create a breakpoint in code.

func sayHello() {

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

    print("say hello")
}

Using either of those 2 functions stops execution and "say hello" never gets printed.

The same way I was able to programmatically create the breakpoints is there a way that I can programmatically create something else so that the execution can continue after either of those 2 breakpoints is hit?

Upvotes: 0

Views: 777

Answers (1)

matt
matt

Reputation: 535606

The feature you're looking for is built in. Here's a breakpoint that prints "here" and continues:

enter image description here

Upvotes: 1

Related Questions