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 #ifndef VM_DEBUGGER_H_ | 5 #ifndef VM_DEBUGGER_H_ |
6 #define VM_DEBUGGER_H_ | 6 #define VM_DEBUGGER_H_ |
7 | 7 |
8 #include <cstring> | |
9 #include <map> | |
siva
2013/02/09 01:00:57
We have generally tried to avoid usage of map insi
Tom Ball
2013/02/14 23:45:16
STL references removed.
| |
10 | |
8 #include "include/dart_debugger_api.h" | 11 #include "include/dart_debugger_api.h" |
9 | 12 |
10 #include "vm/object.h" | 13 #include "vm/object.h" |
11 #include "vm/port.h" | 14 #include "vm/port.h" |
12 | 15 |
13 namespace dart { | 16 namespace dart { |
14 | 17 |
15 class SourceBreakpoint; | 18 class SourceBreakpoint; |
16 class CodeBreakpoint; | 19 class CodeBreakpoint; |
17 class Isolate; | 20 class Isolate; |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
373 intptr_t exc_pause_info_; | 376 intptr_t exc_pause_info_; |
374 | 377 |
375 static BreakpointHandler* bp_handler_; | 378 static BreakpointHandler* bp_handler_; |
376 static EventHandler* event_handler_; | 379 static EventHandler* event_handler_; |
377 | 380 |
378 friend class SourceBreakpoint; | 381 friend class SourceBreakpoint; |
379 DISALLOW_COPY_AND_ASSIGN(Debugger); | 382 DISALLOW_COPY_AND_ASSIGN(Debugger); |
380 }; | 383 }; |
381 | 384 |
382 | 385 |
386 // Singleton service managing VM status gathering and status plug-in | |
387 // registration. | |
388 class VmStatusService { | |
389 public: | |
390 static Dart_Handle RegisterPlugin( | |
391 const char* status_type, Dart_VmStatusCallback callback); | |
392 | |
393 // Returns VM status for a specified request. The caller is responsible | |
394 // for releasing the heap memory after use. | |
395 static char* Dart_GetVmStatus(const char* request); | |
396 | |
397 static void InitOnce(); | |
398 | |
399 private: | |
400 VmStatusService() {} | |
401 | |
402 static VmStatusService* instance_; | |
403 | |
404 struct strcmp { | |
405 bool operator()(char const *a, char const *b) { | |
406 return std::strcmp(a, b) < 0; | |
407 } | |
408 }; | |
409 | |
410 typedef std::map<const char*, Dart_VmStatusCallback, strcmp> ServiceMap; | |
411 | |
412 ServiceMap service_map_; | |
413 | |
414 DISALLOW_COPY_AND_ASSIGN(VmStatusService); | |
415 }; | |
416 | |
417 | |
383 } // namespace dart | 418 } // namespace dart |
384 | 419 |
385 #endif // VM_DEBUGGER_H_ | 420 #endif // VM_DEBUGGER_H_ |
OLD | NEW |