Skip to content

Commit

Permalink
debug output remove later
Browse files Browse the repository at this point in the history
Signed-off-by: Ali Beyad <abeyad@google.com>
  • Loading branch information
abeyad committed Oct 19, 2023
1 parent 748df61 commit 28e5cca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ build:windows --copt="-DCURL_STATICLIB"
build:msvc-cl --action_env=USE_CLANG_CL=""
build:msvc-cl --define clang_cl=0
build:msvc-cl --features=-determinism
build:msvc-cl --copt=-DNDEBUG

# Windows build behaviors when using clang-cl
build:clang-cl --action_env=USE_CLANG_CL=1
Expand Down
10 changes: 9 additions & 1 deletion source/common/common/debug_recursion_checker.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@ namespace Common {
class DebugRecursionChecker {
public:
void enter() {
std::cerr << "==> AAB DebugRecursionChecker::enter" << std::endl;
ASSERT(!entered_, "A resource should only be entered once");
#if !defined(NDEBUG)
entered_ = true;
std::cerr << "==> AAB DebugRecursionChecker::enter set entered_=true" << std::endl;
#endif // !defined(NDEBUG)
}

void exit() {
std::cerr << "==> AAB DebugRecursionChecker::exit" << std::endl;
#if !defined(NDEBUG)
entered_ = false;
std::cerr << "==> AAB DebugRecursionChecker::exit set entered_=false" << std::endl;
#endif // !defined(NDEBUG)
}

Expand All @@ -29,10 +33,14 @@ class DebugRecursionChecker {
class AutoDebugRecursionChecker {
public:
explicit AutoDebugRecursionChecker(DebugRecursionChecker& checker) : checker_(checker) {
std::cerr << "==> AAB AutoDebugRecursionChecker::CTOR" << std::endl;
checker.enter();
}

~AutoDebugRecursionChecker() { checker_.exit(); }
~AutoDebugRecursionChecker() {
std::cerr << "==> AAB AutoDebugRecursionChecker::DTOR" << std::endl;
checker_.exit();
}

private:
DebugRecursionChecker& checker_;
Expand Down

0 comments on commit 28e5cca

Please sign in to comment.