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/flags.h" | 5 #include "vm/flags.h" |
| 6 | 6 |
| 7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
| 8 #include "vm/json_stream.h" | 8 #include "vm/json_stream.h" |
| 9 #include "vm/os.h" | 9 #include "vm/os.h" |
| 10 | 10 |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 433 } | 433 } |
| 434 if (unrecognized_count > 0) { | 434 if (unrecognized_count > 0) { |
| 435 OS::PrintErr("\n"); | 435 OS::PrintErr("\n"); |
| 436 exit(255); | 436 exit(255); |
| 437 } | 437 } |
| 438 } | 438 } |
| 439 if (FLAG_print_flags) { | 439 if (FLAG_print_flags) { |
| 440 PrintFlags(); | 440 PrintFlags(); |
| 441 } | 441 } |
| 442 | 442 |
| 443 if (FLAG_dwarf_stack_traces) { | |
| 444 // The Dart standard requires the output of StackTrace.toString to include | |
| 445 // all pending activations with precise source locations (i.e., to expand | |
| 446 // inlined frames and provide line and column numbers). | |
| 447 OS::PrintErr( | |
| 448 "Warning: This VM has been configured to produce stack traces " | |
|
Cutch
2017/03/15 14:54:13
Is this necessary?
rmacnak
2017/03/16 17:50:11
Maybe in the stack trace instead, but we should be
| |
| 449 "that violate the Dart standard.\n"); | |
| 450 } | |
| 451 | |
| 443 initialized_ = true; | 452 initialized_ = true; |
| 444 return true; | 453 return true; |
| 445 } | 454 } |
| 446 | 455 |
| 456 | |
| 447 bool Flags::SetFlag(const char* name, const char* value, const char** error) { | 457 bool Flags::SetFlag(const char* name, const char* value, const char** error) { |
| 448 Flag* flag = Lookup(name); | 458 Flag* flag = Lookup(name); |
| 449 if (flag == NULL) { | 459 if (flag == NULL) { |
| 450 *error = "Cannot set flag: flag not found"; | 460 *error = "Cannot set flag: flag not found"; |
| 451 return false; | 461 return false; |
| 452 } | 462 } |
| 453 if (!SetFlagFromString(flag, value)) { | 463 if (!SetFlagFromString(flag, value)) { |
| 454 *error = "Cannot set flag: invalid value"; | 464 *error = "Cannot set flag: invalid value"; |
| 455 return false; | 465 return false; |
| 456 } | 466 } |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 518 JSONObject jsobj(js); | 528 JSONObject jsobj(js); |
| 519 jsobj.AddProperty("type", "FlagList"); | 529 jsobj.AddProperty("type", "FlagList"); |
| 520 JSONArray jsarr(&jsobj, "flags"); | 530 JSONArray jsarr(&jsobj, "flags"); |
| 521 for (intptr_t i = 0; i < num_flags_; ++i) { | 531 for (intptr_t i = 0; i < num_flags_; ++i) { |
| 522 PrintFlagToJSONArray(&jsarr, flags_[i]); | 532 PrintFlagToJSONArray(&jsarr, flags_[i]); |
| 523 } | 533 } |
| 524 } | 534 } |
| 525 #endif // !PRODUCT | 535 #endif // !PRODUCT |
| 526 | 536 |
| 527 } // namespace dart | 537 } // namespace dart |
| OLD | NEW |