comparison graal/com.oracle.truffle.api/src/com/oracle/truffle/api/DebugManager.java @ 13567:2f67ba090923

Truffle: extensions to the DebugManager interface in the Instrumentation Framework
author Michael Van De Vanter <michael.van.de.vanter@oracle.com>
date Tue, 07 Jan 2014 18:28:40 -0800
parents 69d2e4baa215
children fbf448929260
comparison
equal deleted inserted replaced
13566:f2b3452744ef 13567:2f67ba090923
1 /* 1 /*
2 * Copyright (c) 2013, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. Oracle designates this 7 * published by the Free Software Foundation. Oracle designates this
22 * or visit www.oracle.com if you need additional information or have any 22 * or visit www.oracle.com if you need additional information or have any
23 * questions. 23 * questions.
24 */ 24 */
25 package com.oracle.truffle.api; 25 package com.oracle.truffle.api;
26 26
27 import com.oracle.truffle.api.frame.*;
28 import com.oracle.truffle.api.nodes.*;
29 import com.oracle.truffle.api.nodes.instrument.*;
27 import com.oracle.truffle.api.source.*; 30 import com.oracle.truffle.api.source.*;
28 31
29 /** 32 /**
30 * Language-agnostic access to AST-based debugging support. 33 * Language-agnostic access to AST-based debugging support.
31 * <p> 34 * <p>
32 * <strong>WARNING:</strong> this interface is under development and will change substantially. 35 * <strong>Disclaimer:</strong> this interface is under development and will change.
33 */ 36 */
34 public interface DebugManager { 37 public interface DebugManager {
38
39 /**
40 * Gets a list of current breakpoints.
41 */
42 LineBreakpoint[] getBreakpoints();
35 43
36 /** 44 /**
37 * Sets a breakpoint at a line-based location. 45 * Sets a breakpoint at a line-based location.
38 */ 46 */
39 LineBreakpoint setBreakpoint(SourceLineLocation lineLocation); 47 LineBreakpoint setBreakpoint(SourceLineLocation lineLocation);
43 * serve as a break condition. 51 * serve as a break condition.
44 */ 52 */
45 LineBreakpoint setConditionalBreakpoint(SourceLineLocation lineLocation, String condition); 53 LineBreakpoint setConditionalBreakpoint(SourceLineLocation lineLocation, String condition);
46 54
47 /** 55 /**
48 * Gets a list of current breakpoints. 56 * Sets a breakpoint at a line-based location that will remove itself when hit.
49 */ 57 */
50 LineBreakpoint[] getBreakpoints(); 58 LineBreakpoint setOneShotBreakpoint(SourceLineLocation lineLocation);
59
60 /**
61 * Is there a line-based breakpoint set at a location?
62 */
63 boolean hasBreakpoint(SourceLineLocation lineLocation);
51 64
52 /** 65 /**
53 * Removes a breakpoint at a line-based location. 66 * Removes a breakpoint at a line-based location.
54 */ 67 */
55 void removeBreakpoint(SourceLineLocation lineLocation); 68 void removeBreakpoint(SourceLineLocation lineLocation);
69
70 /**
71 * Notification from Truffle execution that execution should halt in a debugging context.
72 */
73 /**
74 * Receives notification of a suspended execution context; execution resumes when this method
75 * returns.
76 *
77 * @param astNode a guest language AST node that represents the current execution site, assumed
78 * not to be any kind of {@link InstrumentationNode},
79 * @param frame execution frame at the site where execution suspended
80 */
81 void haltedAt(Node astNode, MaterializedFrame frame);
56 82
57 /** 83 /**
58 * Description of a line-based breakpoint. 84 * Description of a line-based breakpoint.
59 */ 85 */
60 interface LineBreakpoint { 86 interface LineBreakpoint {