| 1 | /* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
| 2 | * |
| 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
| 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 6 | |
| 7 | // API class |
| 8 | |
| 9 | package org.mozilla.javascript.debug; |
| 10 | |
| 11 | import org.mozilla.javascript.Context; |
| 12 | |
| 13 | /** |
| 14 | Interface to implement if the application is interested in receiving debug |
| 15 | information. |
| 16 | */ |
| 17 | public interface Debugger { |
| 18 | |
| 19 | /** |
| 20 | Called when compilation of a particular function or script into internal |
| 21 | bytecode is done. |
| 22 | |
| 23 | @param cx current Context for this thread |
| 24 | @param fnOrScript object describing the function or script |
| 25 | @param source the function or script source |
| 26 | */ |
| 27 | void handleCompilationDone(Context cx, DebuggableScript fnOrScript, |
| 28 | String source); |
| 29 | |
| 30 | /** |
| 31 | Called when execution entered a particular function or script. |
| 32 | |
| 33 | @return implementation of DebugFrame which receives debug information during |
| 34 | the function or script execution or null otherwise |
| 35 | */ |
| 36 | DebugFrame getFrame(Context cx, DebuggableScript fnOrScript); |
| 37 | } |