Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Side by Side Diff: runtime/vm/flags.cc

Issue 8413056: Print also comments with --print_flags (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 "vm/assert.h" 7 #include "vm/assert.h"
8 #include "vm/os.h" 8 #include "vm/os.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 18 matching lines...) Expand all
29 : name_(name), comment_(comment), addr_(addr), type_(type) { 29 : name_(name), comment_(comment), addr_(addr), type_(type) {
30 } 30 }
31 31
32 void Print() { 32 void Print() {
33 if (IsUnrecognized()) { 33 if (IsUnrecognized()) {
34 OS::Print("%s: unrecognized\n", name_); 34 OS::Print("%s: unrecognized\n", name_);
35 return; 35 return;
36 } 36 }
37 switch (type_) { 37 switch (type_) {
38 case kBoolean: { 38 case kBoolean: {
39 OS::Print("%s: %s\n", name_, *this->bool_ptr_ ? "true" : "false"); 39 OS::Print("%s: %s (%s)\n",
40 name_, *this->bool_ptr_ ? "true" : "false", comment_);
40 break; 41 break;
41 } 42 }
42 case kInteger: { 43 case kInteger: {
43 OS::Print("%s: %d\n", name_, *this->int_ptr_); 44 OS::Print("%s: %d (%s)\n", name_, *this->int_ptr_, comment_);
44 break; 45 break;
45 } 46 }
46 case kString: { 47 case kString: {
47 if (*this->charp_ptr_ != NULL) { 48 if (*this->charp_ptr_ != NULL) {
48 OS::Print("%s: '%s'\n", name_, *this->charp_ptr_); 49 OS::Print("%s: '%s' (%s)\n", name_, *this->charp_ptr_, comment_);
49 } else { 50 } else {
50 OS::Print("%s: (null)\n", name_); 51 OS::Print("%s: (null) (%s)\n", name_, comment_);
51 } 52 }
52 break; 53 break;
53 } 54 }
54 default: 55 default:
55 UNREACHABLE(); 56 UNREACHABLE();
56 break; 57 break;
57 } 58 }
58 } 59 }
59 60
60 bool IsUnrecognized() const { 61 bool IsUnrecognized() const {
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 OS::Print("Flag settings:\n"); 260 OS::Print("Flag settings:\n");
260 Flag* flag = Flags::flags_; 261 Flag* flag = Flags::flags_;
261 while (flag != NULL) { 262 while (flag != NULL) {
262 flag->Print(); 263 flag->Print();
263 flag = flag->next_; 264 flag = flag->next_;
264 } 265 }
265 } 266 }
266 } 267 }
267 268
268 } // namespace dart 269 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698