"""
Test stop hooks
"""
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbdap_testcase
class TestDAP_stop_hooks(lldbdap_testcase.DAPTestCaseBase):
def test_stop_hooks_before_run(self):
"""
Test that there is no race condition between lldb-dap and
stop hooks executor
"""
program = self.getBuildArtifact("a.out")
preRunCommands = ["target stop-hook add -o help"]
self.build_and_launch(program, stopOnEntry=True, preRunCommands=preRunCommands)
self.continue_to_next_stop()
breakpoint_ids = self.set_function_breakpoints(["main"])
self.continue_to_breakpoints(breakpoint_ids)
self.continue_to_exit()