Commit c175bc69 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

Make %DebugPrint work correctly on Android

On Android, %DebugPrint should output to the Android log instead of
stdout.

R=mstarzinger@chromium.org

Bug: v8:7820
Change-Id: Ia2ab14f1e4ae15914a1e0e721457f83b288683ff
Reviewed-on: https://chromium-review.googlesource.com/1088691
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53559}
parent c92027c5
......@@ -5,6 +5,7 @@
#include "src/runtime/runtime-utils.h"
#include <memory>
#include <sstream>
#include "src/api.h"
#include "src/arguments.h"
......@@ -530,7 +531,7 @@ RUNTIME_FUNCTION(Runtime_DebugPrint) {
// MaybeObject*.
MaybeObject* maybe_object = reinterpret_cast<MaybeObject*>(args[0]);
OFStream os(stdout);
std::ostringstream os;
if (maybe_object->IsClearedWeakHeapObject()) {
os << "[weak cleared]";
} else {
......@@ -576,6 +577,9 @@ RUNTIME_FUNCTION(Runtime_DebugPrint) {
}
os << std::endl;
// TODO(clemensh): Introduce an output stream which outputs to android log.
PrintF("%s", os.str().c_str());
return args[0]; // return TOS
}
......
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