author | Eugene Ostroukhov <eugeneo@symbian.org> |
Mon, 07 Jun 2010 16:51:19 -0700 | |
changeset 355 | 8726e95bcbba |
parent 2 | e4420d2515f1 |
permissions | -rw-r--r-- |
2 | 1 |
// Copyright (c) 2009 The Chromium Authors. All rights reserved. |
2 |
// Use of this source code is governed by a BSD-style license that can be |
|
3 |
// found in the LICENSE file. |
|
4 |
||
5 |
package org.chromium.sdk.internal.tools.v8; |
|
6 |
||
7 |
import java.util.HashMap; |
|
8 |
import java.util.Map; |
|
9 |
||
10 |
/** |
|
11 |
* Known V8 VM debugger commands and events. |
|
12 |
*/ |
|
13 |
public enum DebuggerCommand { |
|
14 |
CONTINUE("continue"), |
|
15 |
EVALUATE("evaluate"), |
|
16 |
BACKTRACE("backtrace"), |
|
17 |
FRAME("frame"), |
|
18 |
SCRIPTS("scripts"), |
|
355
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
19 |
CHANGELIVE("changelive"), |
2 | 20 |
SOURCE("source"), |
21 |
SCOPE("scope"), |
|
22 |
SETBREAKPOINT("setbreakpoint"), |
|
23 |
CHANGEBREAKPOINT("changebreakpoint"), |
|
24 |
CLEARBREAKPOINT("clearbreakpoint"), |
|
355
8726e95bcbba
Initial commit of updated Chrome Java SDK
Eugene Ostroukhov <eugeneo@symbian.org>
parents:
2
diff
changeset
|
25 |
LISTBREAKPOINTS("listbreakpoints"), |
2 | 26 |
LOOKUP("lookup"), |
27 |
SUSPEND("suspend"), |
|
28 |
VERSION("version"), |
|
29 |
||
30 |
// Events |
|
31 |
BREAK("break"), |
|
32 |
EXCEPTION("exception"), |
|
33 |
AFTER_COMPILE("afterCompile"), |
|
34 |
; |
|
35 |
||
36 |
public final String value; |
|
37 |
||
38 |
DebuggerCommand(String value) { |
|
39 |
this.value = value; |
|
40 |
} |
|
41 |
||
42 |
private static final Map<String, DebuggerCommand> valueToCommandMap = |
|
43 |
new HashMap<String, DebuggerCommand>(); |
|
44 |
||
45 |
static { |
|
46 |
for (DebuggerCommand c : values()) { |
|
47 |
valueToCommandMap.put(c.value, c); |
|
48 |
} |
|
49 |
} |
|
50 |
||
51 |
/** |
|
52 |
* @param value the DebuggerCommand string value |
|
53 |
* @return the DebuggerCommand instance or null if none corresponds to value |
|
54 |
*/ |
|
55 |
public static DebuggerCommand forString(String value) { |
|
56 |
if (value == null) { |
|
57 |
return null; |
|
58 |
} |
|
59 |
return valueToCommandMap.get(value); |
|
60 |
} |
|
61 |
||
62 |
} |