diff --git a/source/lib/common/utility.cpp b/source/lib/common/utility.cpp index a0457199..3b37fce5 100644 --- a/source/lib/common/utility.cpp +++ b/source/lib/common/utility.cpp @@ -123,3 +123,29 @@ read_command_line(pid_t _pid) } } // namespace common } // namespace rocprofiler + +namespace +{ +std::atomic& +debugger_block() +{ + static std::atomic block = {true}; + return block; +} +} // namespace + +extern "C" { +void +rocprofiler_debugger_block() +{ + while(debugger_block().load() == true) + {}; + // debugger_block().exchange(true); +} + +void +rocprofiler_debugger_continue() +{ + debugger_block().exchange(false); +} +} \ No newline at end of file diff --git a/source/lib/common/utility.hpp b/source/lib/common/utility.hpp index 5e84bd6e..2553cb15 100644 --- a/source/lib/common/utility.hpp +++ b/source/lib/common/utility.hpp @@ -265,3 +265,10 @@ yield(PredicateT&& predicate, } } // namespace common } // namespace rocprofiler + +extern "C" { +void +rocprofiler_debugger_block(); +void +rocprofiler_debugger_continue(); +} \ No newline at end of file