home *** CD-ROM | disk | FTP | other *** search
- import java.awt.BorderLayout;
- import java.awt.Container;
- import java.awt.Panel;
- import java.awt.TextArea;
- import sun.tools.debug.RemoteClass;
- import sun.tools.debug.RemoteDebugger;
- import sun.tools.debug.RemoteStackVariable;
- import sun.tools.debug.RemoteThread;
- import sun.tools.debug.RemoteValue;
-
- public class JDPDebugger extends JDPClassLayout {
- RemoteDebugger debugger;
- TextArea console;
- boolean debugOn;
-
- public void addConsole(String text) {
- this.console.setText(this.console.getText() + text + "\r\n");
- }
-
- public void breakpointEvent(RemoteThread t) {
- try {
- this.debugger.findClass("SalesOrder");
- RemoteValue rv = null;
- RemoteStackVariable[] rsvs = t.getStackVariables();
-
- for(int ix = 0; ix < rsvs.length; ++ix) {
- rv = rsvs[ix] == null ? null : rsvs[ix].getValue();
- this.addConsole(rv.description());
- this.addConsole(rv.toString());
- }
- } catch (Exception var7) {
- ((Throwable)var7).printStackTrace();
- }
-
- try {
- this.debugger.cont();
- } catch (Exception var6) {
- ((Throwable)var6).printStackTrace();
- }
-
- }
-
- public void threadDeathEvent(RemoteThread t) {
- this.addConsole("thread death event");
- }
-
- public void addConsoleVerbatim(String text) {
- this.console.setText(this.console.getText() + text);
- }
-
- public void exceptionEvent(RemoteThread t, String errorText) {
- this.addConsole("exception caught");
- }
-
- public void InitClass(JDPUser user, Panel targetPanel, String moduleParameter) {
- ((Container)this).setLayout(new BorderLayout());
- this.console = new TextArea("");
- ((Container)this).add("Center", this.console);
-
- try {
- String javaArgs = "-classpath .;\\jdk1.1.2\\lib\\classes.zip JDesignerPro http://205.219.62.2/JDesignerPro/ 01001 Guest a SalesOrder";
- JDPDebuggerCallback dc = new JDPDebuggerCallback(this);
- this.debugger = new RemoteDebugger(javaArgs, dc, false);
-
- try {
- Thread.sleep(8000L);
- RemoteValue obj = this.debugger.findClass("SalesOrder");
- ((RemoteClass)obj).setBreakpointLine(162);
- } catch (Exception var8) {
- ((Throwable)var8).printStackTrace();
- }
- } catch (Exception var9) {
- ((Throwable)var9).printStackTrace();
- }
-
- }
-
- public void printToConsole(String text) {
- this.addConsoleVerbatim(text);
- }
-
- public void quitEvent() {
- try {
- RemoteValue obj = this.debugger.findClass("SalesOrder");
- ((RemoteClass)obj).clearBreakpointLine(162);
- } catch (Exception var3) {
- ((Throwable)var3).printStackTrace();
- }
-
- this.addConsole("quit event");
- this.debugger.close();
- this.debugger = null;
- }
- }
-