Commit cba3446d authored by yangguo@chromium.org's avatar yangguo@chromium.org

Use PrintF instead of fprintf.

R=sven@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/13811020

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14200 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent dd70ce29
......@@ -1561,8 +1561,8 @@ void Disassembler::Disassemble(FILE* f, byte* begin, byte* end) {
buffer[0] = '\0';
byte* prev_pc = pc;
pc += d.InstructionDecode(buffer, pc);
fprintf(f, "%p %08x %s\n",
prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
PrintF(f, "%p %08x %s\n",
prev_pc, *reinterpret_cast<int32_t*>(prev_pc), buffer.start());
}
}
......
......@@ -50,8 +50,8 @@ void Disassembler::Dump(FILE* f, byte* begin, byte* end) {
pc - begin,
*pc);
} else {
fprintf(f, "%" V8PRIxPTR " %4" V8PRIdPTR " %02x\n",
reinterpret_cast<uintptr_t>(pc), pc - begin, *pc);
PrintF(f, "%" V8PRIxPTR " %4" V8PRIdPTR " %02x\n",
reinterpret_cast<uintptr_t>(pc), pc - begin, *pc);
}
}
}
......@@ -101,7 +101,7 @@ static void DumpBuffer(FILE* f, StringBuilder* out) {
if (f == NULL) {
PrintF("%s\n", out->Finalize());
} else {
fprintf(f, "%s\n", out->Finalize());
PrintF(f, "%s\n", out->Finalize());
}
out->Reset();
}
......
......@@ -367,8 +367,8 @@ int FlagList::SetFlagsFromCommandLine(int* argc,
// sense there.
continue;
} else {
fprintf(stderr, "Error: unrecognized flag %s\n"
"Try --help for options\n", arg);
PrintF(stderr, "Error: unrecognized flag %s\n"
"Try --help for options\n", arg);
return_code = j;
break;
}
......@@ -381,9 +381,9 @@ int FlagList::SetFlagsFromCommandLine(int* argc,
if (i < *argc) {
value = argv[i++];
} else {
fprintf(stderr, "Error: missing value for flag %s of type %s\n"
"Try --help for options\n",
arg, Type2String(flag->type()));
PrintF(stderr, "Error: missing value for flag %s of type %s\n"
"Try --help for options\n",
arg, Type2String(flag->type()));
return_code = j;
break;
}
......@@ -424,9 +424,9 @@ int FlagList::SetFlagsFromCommandLine(int* argc,
if ((flag->type() == Flag::TYPE_BOOL && value != NULL) ||
(flag->type() != Flag::TYPE_BOOL && is_bool) ||
*endp != '\0') {
fprintf(stderr, "Error: illegal value for flag %s of type %s\n"
"Try --help for options\n",
arg, Type2String(flag->type()));
PrintF(stderr, "Error: illegal value for flag %s of type %s\n"
"Try --help for options\n",
arg, Type2String(flag->type()));
return_code = j;
break;
}
......
......@@ -1842,7 +1842,7 @@ extern "C" {
#ifdef OBJECT_PRINT
void __gdb_print_v8_object(MaybeObject* object) {
object->Print();
fprintf(stdout, "\n");
PrintF(stdout, "\n");
}
#endif
}
......
......@@ -1140,7 +1140,7 @@ void Isolate::PrintCurrentStackTrace(FILE* out) {
Execution::GetStackTraceLine(recv, fun, pos_obj, is_top_level);
if (line->length() > 0) {
line->PrintOn(out);
fprintf(out, "\n");
PrintF(out, "\n");
}
}
}
......@@ -1306,8 +1306,9 @@ void Isolate::DoThrow(Object* exception, MessageLocation* location) {
FLAG_abort_on_uncaught_exception &&
(report_exception || can_be_caught_externally)) {
fatal_exception_depth++;
fprintf(stderr, "%s\n\nFROM\n",
*MessageHandler::GetLocalizedMessage(this, message_obj));
PrintF(stderr,
"%s\n\nFROM\n",
*MessageHandler::GetLocalizedMessage(this, message_obj));
PrintCurrentStackTrace(stderr);
OS::Abort();
}
......
......@@ -8003,7 +8003,7 @@ MaybeObject* String::SubString(int start, int end, PretenureFlag pretenure) {
void String::PrintOn(FILE* file) {
int length = this->length();
for (int i = 0; i < length; i++) {
fprintf(file, "%c", Get(i));
PrintF(file, "%c", Get(i));
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment