diff options
author | Andrew Morrow <acm@mongodb.com> | 2015-01-03 17:30:42 -0500 |
---|---|---|
committer | Andrew Morrow <acm@mongodb.com> | 2015-01-05 18:27:01 -0500 |
commit | 997256fc799e815fbdb4c1b163afcb2aca6dc249 (patch) | |
tree | 2d1b242092aba5dd792b52c5ef547cff00764fba /src | |
parent | a341230b5ebbff4d6c097d5f2bab91545ed97f93 (diff) | |
download | mongo-997256fc799e815fbdb4c1b163afcb2aca6dc249.tar.gz |
SERVER-13256 Make debug_util macros only
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/SConscript | 2 | ||||
-rw-r--r-- | src/mongo/util/assert_util.cpp | 1 | ||||
-rw-r--r-- | src/mongo/util/debug_util.h | 8 | ||||
-rw-r--r-- | src/mongo/util/debugger.cpp (renamed from src/mongo/util/debug_util.cpp) | 6 | ||||
-rw-r--r-- | src/mongo/util/debugger.h | 39 | ||||
-rw-r--r-- | src/mongo/util/signal_handlers_synchronous.cpp | 1 |
6 files changed, 46 insertions, 11 deletions
diff --git a/src/mongo/SConscript b/src/mongo/SConscript index c9312d05098..7bd73618274 100644 --- a/src/mongo/SConscript +++ b/src/mongo/SConscript @@ -61,7 +61,7 @@ env.Library('foundation', [ 'util/assert_util.cpp', 'util/concurrency/mutex.cpp', 'util/concurrency/thread_pool.cpp', - 'util/debug_util.cpp', + 'util/debugger.cpp', 'util/exception_filter_win32.cpp', 'util/file.cpp', 'util/log.cpp', diff --git a/src/mongo/util/assert_util.cpp b/src/mongo/util/assert_util.cpp index 046cff6b1ed..ce513d4138c 100644 --- a/src/mongo/util/assert_util.cpp +++ b/src/mongo/util/assert_util.cpp @@ -42,6 +42,7 @@ using namespace std; #include "mongo/bson/bsonobjbuilder.h" #include "mongo/util/debug_util.h" +#include "mongo/util/debugger.h" #include "mongo/util/exit.h" #include "mongo/util/log.h" #include "mongo/util/quick_exit.h" diff --git a/src/mongo/util/debug_util.h b/src/mongo/util/debug_util.h index d59e45cd513..bcf979ee20d 100644 --- a/src/mongo/util/debug_util.h +++ b/src/mongo/util/debug_util.h @@ -60,12 +60,4 @@ namespace mongo { #define MONGO_ONCE for( static bool undone = true; undone; undone = false ) #define ONCE MONGO_ONCE - // Sets SIGTRAP handler to launch GDB - // Noop unless on *NIX and compiled with _DEBUG - void setupSIGTRAPforGDB(); - - void mongo_breakpoint(); - inline void breakpoint() { - mongo_breakpoint(); - } } // namespace mongo diff --git a/src/mongo/util/debug_util.cpp b/src/mongo/util/debugger.cpp index 368dc735baf..69935a40695 100644 --- a/src/mongo/util/debug_util.cpp +++ b/src/mongo/util/debugger.cpp @@ -27,7 +27,9 @@ * then also delete it in the license file. */ -#include "mongo/pch.h" +#include "mongo/platform/basic.h" + +#include "mongo/util/debugger.h" #include "mongo/db/server_options.h" @@ -40,7 +42,7 @@ #endif // defined(USE_GDBSERVER) namespace mongo { - void mongo_breakpoint() { + void breakpoint() { #ifdef _WIN32 DEV DebugBreak(); #endif diff --git a/src/mongo/util/debugger.h b/src/mongo/util/debugger.h new file mode 100644 index 00000000000..2e91af92fbb --- /dev/null +++ b/src/mongo/util/debugger.h @@ -0,0 +1,39 @@ +/** + * Copyright (C) 2015 MongoDB Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License, version 3, + * as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + * As a special exception, the copyright holders give permission to link the + * code of portions of this program with the OpenSSL library under certain + * conditions as described in each individual source file and distribute + * linked combinations including the program with the OpenSSL library. You + * must comply with the GNU Affero General Public License in all respects for + * all of the code used other than as permitted herein. If you modify file(s) + * with this exception, you may extend this exception to your version of the + * file(s), but you are not obligated to do so. If you do not wish to do so, + * delete this exception statement from your version. If you delete this + * exception statement from all source files in the program, then also delete + * it in the license file. + */ + +#pragma once + +namespace mongo { + + // Sets SIGTRAP handler to launch GDB + // Noop unless on *NIX and compiled with _DEBUG + void setupSIGTRAPforGDB(); + + void breakpoint(); + +} // namespace mongo diff --git a/src/mongo/util/signal_handlers_synchronous.cpp b/src/mongo/util/signal_handlers_synchronous.cpp index 74f5874d9e7..3ed71f07fd7 100644 --- a/src/mongo/util/signal_handlers_synchronous.cpp +++ b/src/mongo/util/signal_handlers_synchronous.cpp @@ -46,6 +46,7 @@ #include "mongo/logger/logger.h" #include "mongo/util/concurrency/thread_name.h" #include "mongo/util/debug_util.h" +#include "mongo/util/debugger.h" #include "mongo/util/exception_filter_win32.h" #include "mongo/util/exit_code.h" #include "mongo/util/log.h" |