Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/globals.h" | 5 #include "vm/globals.h" |
| 6 #if defined(TARGET_OS_ANDROID) | 6 #if defined(TARGET_OS_ANDROID) |
| 7 | 7 |
| 8 #include "vm/os.h" | 8 #include "vm/os.h" |
| 9 | 9 |
| 10 #include <android/log.h> // NOLINT | 10 #include <android/log.h> // NOLINT |
| 11 #include <dlfcn.h> // NOLINT | |
| 11 #include <errno.h> // NOLINT | 12 #include <errno.h> // NOLINT |
| 12 #include <limits.h> // NOLINT | 13 #include <limits.h> // NOLINT |
| 13 #include <malloc.h> // NOLINT | 14 #include <malloc.h> // NOLINT |
| 14 #include <time.h> // NOLINT | 15 #include <time.h> // NOLINT |
| 15 #include <sys/resource.h> // NOLINT | 16 #include <sys/resource.h> // NOLINT |
| 16 #include <sys/time.h> // NOLINT | 17 #include <sys/time.h> // NOLINT |
| 17 #include <sys/types.h> // NOLINT | 18 #include <sys/types.h> // NOLINT |
| 18 #include <unistd.h> // NOLINT | 19 #include <unistd.h> // NOLINT |
| 19 | 20 |
| 20 #include "platform/utils.h" | 21 #include "platform/utils.h" |
| (...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 379 } | 380 } |
| 380 if (FLAG_generate_pprof_symbols != NULL) { | 381 if (FLAG_generate_pprof_symbols != NULL) { |
| 381 CodeObservers::Register(new PprofCodeObserver); | 382 CodeObservers::Register(new PprofCodeObserver); |
| 382 } | 383 } |
| 383 #if defined(DART_VTUNE_SUPPORT) | 384 #if defined(DART_VTUNE_SUPPORT) |
| 384 Register(new VTuneCodeObserver); | 385 Register(new VTuneCodeObserver); |
| 385 #endif | 386 #endif |
| 386 } | 387 } |
| 387 | 388 |
| 388 | 389 |
| 390 const char* OS::ReverseLookupSymbol(uword address) { | |
| 391 // TODO(regis): This does not work for symbols of the main program. | |
| 392 // Passing -export-dynamic to the linker does not help. | |
|
zra
2013/03/08 16:55:42
You might also need to remove -fvisibility=hidden
| |
| 393 Dl_info info; | |
| 394 if (dladdr(reinterpret_cast<void*>(address), &info)) { | |
| 395 return info.dli_sname; | |
| 396 } else { | |
| 397 return NULL; | |
| 398 } | |
| 399 } | |
| 400 | |
| 401 | |
| 389 void OS::PrintErr(const char* format, ...) { | 402 void OS::PrintErr(const char* format, ...) { |
| 390 va_list args; | 403 va_list args; |
| 391 va_start(args, format); | 404 va_start(args, format); |
| 392 VFPrint(stderr, format, args); | 405 VFPrint(stderr, format, args); |
| 393 // Forward to the Android log for remote access. | 406 // Forward to the Android log for remote access. |
| 394 __android_log_vprint(ANDROID_LOG_ERROR, "DartVM", format, args); | 407 __android_log_vprint(ANDROID_LOG_ERROR, "DartVM", format, args); |
| 395 va_end(args); | 408 va_end(args); |
| 396 } | 409 } |
| 397 | 410 |
| 398 | 411 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 415 } | 428 } |
| 416 | 429 |
| 417 | 430 |
| 418 void OS::Exit(int code) { | 431 void OS::Exit(int code) { |
| 419 exit(code); | 432 exit(code); |
| 420 } | 433 } |
| 421 | 434 |
| 422 } // namespace dart | 435 } // namespace dart |
| 423 | 436 |
| 424 #endif // defined(TARGET_OS_ANDROID) | 437 #endif // defined(TARGET_OS_ANDROID) |
| OLD | NEW |