mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 00:13:50 +00:00
[vm/test] Show crash dump in builder logs for Android tests.
Previously we would not have any VM logs because they are were sent to the Android system logs, which are not captured by the bots. Also added a flag --android-log-to-stderr, which is useful for local testing and debugging. Change-Id: I1968b4c230d70b5546d2dd48e40fe3cfe5196def Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112250 Commit-Queue: Samir Jindel <sjindel@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
This commit is contained in:
parent
fa45f91f18
commit
7283827b4e
|
@ -682,6 +682,7 @@ class CommandExecutorImpl implements CommandExecutor {
|
|||
[
|
||||
'export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$deviceTestDir;'
|
||||
'$devicedir/dart_precompiled_runtime',
|
||||
'--android-log-to-stderr'
|
||||
]..addAll(arguments),
|
||||
timeout: timeoutDuration));
|
||||
|
||||
|
@ -741,6 +742,7 @@ class CommandExecutorImpl implements CommandExecutor {
|
|||
[
|
||||
'export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:$deviceTestDir;'
|
||||
'$devicedir/dart',
|
||||
'--android-log-to-stderr'
|
||||
]..addAll(arguments),
|
||||
timeout: timeoutDuration));
|
||||
|
||||
|
|
|
@ -25,6 +25,12 @@
|
|||
|
||||
namespace dart {
|
||||
|
||||
DEFINE_FLAG(bool,
|
||||
android_log_to_stderr,
|
||||
false,
|
||||
"Send Dart VM logs to stdout and stderr instead of the Android "
|
||||
"system logs.");
|
||||
|
||||
// Android CodeObservers.
|
||||
|
||||
#ifndef PRODUCT
|
||||
|
@ -255,8 +261,12 @@ DART_NOINLINE uintptr_t OS::GetProgramCounter() {
|
|||
void OS::Print(const char* format, ...) {
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
// Forward to the Android log for remote access.
|
||||
__android_log_vprint(ANDROID_LOG_INFO, "DartVM", format, args);
|
||||
if (FLAG_android_log_to_stderr) {
|
||||
vfprintf(stderr, format, args);
|
||||
} else {
|
||||
// Forward to the Android log for remote access.
|
||||
__android_log_vprint(ANDROID_LOG_INFO, "DartVM", format, args);
|
||||
}
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
@ -332,8 +342,12 @@ void OS::RegisterCodeObservers() {
|
|||
void OS::PrintErr(const char* format, ...) {
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
// Forward to the Android log for remote access.
|
||||
__android_log_vprint(ANDROID_LOG_ERROR, "DartVM", format, args);
|
||||
if (FLAG_android_log_to_stderr) {
|
||||
vfprintf(stderr, format, args);
|
||||
} else {
|
||||
// Forward to the Android log for remote access.
|
||||
__android_log_vprint(ANDROID_LOG_ERROR, "DartVM", format, args);
|
||||
}
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue