debugger_win.cc revision 0529e5d033099cbfc42635f6f6183833b09dff6e
1// Copyright (c) 2010 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "base/debug/debugger.h"
6
7#include <stdlib.h>
8#include <windows.h>
9
10namespace base {
11namespace debug {
12
13bool BeingDebugged() {
14  return ::IsDebuggerPresent() != 0;
15}
16
17void BreakDebugger() {
18  if (IsDebugUISuppressed())
19    _exit(1);
20  __debugbreak();
21#if defined(NDEBUG)
22  _exit(1);
23#endif
24}
25
26}  // namespace debug
27}  // namespace base
28