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

Side by Side Diff: src/log-utils.cc

Issue 1877453002: Fix printf formats (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Handle ptrdiff_t format, which seems to make MSVC barf Created 4 years, 8 months 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 | « src/log-utils.h ('k') | src/profiler/allocation-tracker.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project 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 "src/log-utils.h" 5 #include "src/log-utils.h"
6 6
7 #include "src/assert-scope.h" 7 #include "src/assert-scope.h"
8 #include "src/base/platform/platform.h" 8 #include "src/base/platform/platform.h"
9 #include "src/objects-inl.h" 9 #include "src/objects-inl.h"
10 #include "src/string-stream.h" 10 #include "src/string-stream.h"
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 157
158 158
159 void Log::MessageBuilder::Append(String* str) { 159 void Log::MessageBuilder::Append(String* str) {
160 DisallowHeapAllocation no_gc; // Ensure string stay valid. 160 DisallowHeapAllocation no_gc; // Ensure string stay valid.
161 int length = str->length(); 161 int length = str->length();
162 for (int i = 0; i < length; i++) { 162 for (int i = 0; i < length; i++) {
163 Append(static_cast<char>(str->Get(i))); 163 Append(static_cast<char>(str->Get(i)));
164 } 164 }
165 } 165 }
166 166
167 167 void Log::MessageBuilder::AppendAddress(Address addr) { Append("%p", addr); }
168 void Log::MessageBuilder::AppendAddress(Address addr) {
169 Append("0x%" V8PRIxPTR, addr);
170 }
171
172 168
173 void Log::MessageBuilder::AppendSymbolName(Symbol* symbol) { 169 void Log::MessageBuilder::AppendSymbolName(Symbol* symbol) {
174 DCHECK(symbol); 170 DCHECK(symbol);
175 Append("symbol("); 171 Append("symbol(");
176 if (!symbol->name()->IsUndefined()) { 172 if (!symbol->name()->IsUndefined()) {
177 Append("\""); 173 Append("\"");
178 AppendDetailed(String::cast(symbol->name()), false); 174 AppendDetailed(String::cast(symbol->name()), false);
179 Append("\" "); 175 Append("\" ");
180 } 176 }
181 Append("hash %x)", symbol->Hash()); 177 Append("hash %x)", symbol->Hash());
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 const int written = log_->WriteToFile(log_->message_buffer_, pos_); 234 const int written = log_->WriteToFile(log_->message_buffer_, pos_);
239 if (written != pos_) { 235 if (written != pos_) {
240 log_->stop(); 236 log_->stop();
241 log_->logger_->LogFailure(); 237 log_->logger_->LogFailure();
242 } 238 }
243 } 239 }
244 240
245 241
246 } // namespace internal 242 } // namespace internal
247 } // namespace v8 243 } // namespace v8
OLDNEW
« no previous file with comments | « src/log-utils.h ('k') | src/profiler/allocation-tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698