Search in sources :

Example 76 with JSONArray

use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.

the class SetBreakpointsArguments method getLines.

/**
 * Deprecated: The code locations of the breakpoints.
 */
public List<Integer> getLines() {
    final JSONArray json = jsonData.optJSONArray("lines");
    if (json == null) {
        return null;
    }
    final List<Integer> list = new ArrayList<>(json.length());
    for (int i = 0; i < json.length(); i++) {
        list.add(json.getInt(i));
    }
    return Collections.unmodifiableList(list);
}
Also used : JSONArray(com.oracle.truffle.tools.utils.json.JSONArray) ArrayList(java.util.ArrayList)

Example 77 with JSONArray

use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.

the class SetBreakpointsArguments method setLines.

public SetBreakpointsArguments setLines(List<Integer> lines) {
    if (lines != null) {
        final JSONArray json = new JSONArray();
        for (int intValue : lines) {
            json.put(intValue);
        }
        jsonData.put("lines", json);
    }
    return this;
}
Also used : JSONArray(com.oracle.truffle.tools.utils.json.JSONArray)

Example 78 with JSONArray

use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.

the class SetDataBreakpointsArguments method getBreakpoints.

/**
 * The contents of this array replaces all existing data breakpoints. An empty array clears all
 * data breakpoints.
 */
public List<DataBreakpoint> getBreakpoints() {
    final JSONArray json = jsonData.getJSONArray("breakpoints");
    final List<DataBreakpoint> list = new ArrayList<>(json.length());
    for (int i = 0; i < json.length(); i++) {
        list.add(new DataBreakpoint(json.getJSONObject(i)));
    }
    return Collections.unmodifiableList(list);
}
Also used : JSONArray(com.oracle.truffle.tools.utils.json.JSONArray) ArrayList(java.util.ArrayList)

Example 79 with JSONArray

use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.

the class SetExceptionBreakpointsArguments method getFilters.

/**
 * IDs of checked exception options. The set of IDs is returned via the
 * 'exceptionBreakpointFilters' capability.
 */
public List<String> getFilters() {
    final JSONArray json = jsonData.getJSONArray("filters");
    final List<String> list = new ArrayList<>(json.length());
    for (int i = 0; i < json.length(); i++) {
        list.add(json.getString(i));
    }
    return Collections.unmodifiableList(list);
}
Also used : JSONArray(com.oracle.truffle.tools.utils.json.JSONArray) ArrayList(java.util.ArrayList)

Example 80 with JSONArray

use of com.oracle.truffle.tools.utils.json.JSONArray in project graal by oracle.

the class SetExceptionBreakpointsArguments method setExceptionOptions.

public SetExceptionBreakpointsArguments setExceptionOptions(List<ExceptionOptions> exceptionOptions) {
    if (exceptionOptions != null) {
        final JSONArray json = new JSONArray();
        for (ExceptionOptions options : exceptionOptions) {
            json.put(options.jsonData);
        }
        jsonData.put("exceptionOptions", json);
    }
    return this;
}
Also used : JSONArray(com.oracle.truffle.tools.utils.json.JSONArray)

Aggregations

JSONArray (com.oracle.truffle.tools.utils.json.JSONArray)195 JSONObject (com.oracle.truffle.tools.utils.json.JSONObject)85 ArrayList (java.util.ArrayList)74 DebugValue (com.oracle.truffle.api.debug.DebugValue)8 Params (com.oracle.truffle.tools.chromeinspector.commands.Params)8 Collection (java.util.Collection)7 List (java.util.List)7 DebugException (com.oracle.truffle.api.debug.DebugException)6 Source (com.oracle.truffle.api.source.Source)5 SourceSection (com.oracle.truffle.api.source.SourceSection)4 CommandProcessException (com.oracle.truffle.tools.chromeinspector.server.CommandProcessException)4 HashMap (java.util.HashMap)4 Location (com.oracle.truffle.tools.chromeinspector.types.Location)3 Script (com.oracle.truffle.tools.chromeinspector.types.Script)3 CPUSampler (com.oracle.truffle.tools.profiler.CPUSampler)3 CPUSamplerData (com.oracle.truffle.tools.profiler.CPUSamplerData)3 PrintWriter (java.io.PrintWriter)3 Map (java.util.Map)3 TruffleContext (com.oracle.truffle.api.TruffleContext)2 Breakpoint (com.oracle.truffle.api.debug.Breakpoint)2