blob: ccc9c1604bc3dca339aee501bf6124f1ee7123c6 [file] [log] [blame]
[email protected]58580352010-10-26 04:07:501// 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
[email protected]8a65f282014-04-17 23:29:557#include <stdlib.h>
[email protected]58580352010-10-26 04:07:508#include <windows.h>
[email protected]58580352010-10-26 04:07:509
10namespace base {
11namespace debug {
12
[email protected]58580352010-10-26 04:07:5013bool BeingDebugged() {
14 return ::IsDebuggerPresent() != 0;
15}
16
17void BreakDebugger() {
[email protected]d0282962011-01-01 16:08:5218 if (IsDebugUISuppressed())
[email protected]58580352010-10-26 04:07:5019 _exit(1);
20 __debugbreak();
[email protected]f355c562011-01-21 05:02:1721#if defined(NDEBUG)
22 _exit(1);
23#endif
[email protected]58580352010-10-26 04:07:5024}
25
26} // namespace debug
27} // namespace base