Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(235)

Side by Side Diff: base/logging.cc

Issue 796343002: win: use __debugbreak instead of __asm__ int3 (Closed) Base URL: https://chromium.googlesource.com/chromium/mini_chromium@file_path
Patch Set: rebase Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/logging.h" 5 #include "base/logging.h"
6 6
7 #include <stdio.h> 7 #include <stdio.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include <sys/time.h> 9 #include <sys/time.h>
10 #include <unistd.h> 10 #include <unistd.h>
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 LogMessage::~LogMessage() { 55 LogMessage::~LogMessage() {
56 stream_ << std::endl; 56 stream_ << std::endl;
57 std::string str_newline(stream_.str()); 57 std::string str_newline(stream_.str());
58 fprintf(stderr, "%s", str_newline.c_str()); 58 fprintf(stderr, "%s", str_newline.c_str());
59 fflush(stderr); 59 fflush(stderr);
60 if (severity_ == LOG_FATAL) { 60 if (severity_ == LOG_FATAL) {
61 #ifndef NDEBUG 61 #ifndef NDEBUG
62 abort(); 62 abort();
63 #else 63 #else
64 #if defined(OS_WIN)
65 __debugbreak();
66 #else
64 __asm__("int3"); 67 __asm__("int3");
65 #endif 68 #endif
69 #endif
66 } 70 }
67 } 71 }
68 72
69 void LogMessage::Init(const char* function, 73 void LogMessage::Init(const char* function,
70 const std::string& file_path, 74 const std::string& file_path,
71 int line) { 75 int line) {
72 std::string file_name; 76 std::string file_name;
73 size_t last_slash = file_path.find_last_of('/'); 77 size_t last_slash = file_path.find_last_of('/');
74 if (last_slash != std::string::npos) { 78 if (last_slash != std::string::npos) {
75 file_name.assign(file_path.substr(last_slash + 1)); 79 file_name.assign(file_path.substr(last_slash + 1));
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 135
132 ErrnoLogMessage::~ErrnoLogMessage() { 136 ErrnoLogMessage::~ErrnoLogMessage() {
133 stream() << ": " 137 stream() << ": "
134 << safe_strerror(err_) 138 << safe_strerror(err_)
135 << " (" 139 << " ("
136 << err_ 140 << err_
137 << ")"; 141 << ")";
138 } 142 }
139 143
140 } // namespace logging 144 } // namespace logging
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698