1 package jde.debugger.command;
2 import jde.debugger.Etc;
3 import jde.debugger.JDEException;
4 import jde.debugger.spec.EventRequestSpec;
5 import jde.debugger.spec.EventRequestSpecList;
10 * 'trace_exceptions' command.
15 * trace_exceptions classPattern <u>type</u>
16 * [{@link Etc#getThreadFromArgs(List) thread-restriction}]
17 * [{@link Etc#getSuspendPolicyFromArgs(List) suspend-policy}]
18 * [{@link Etc#getClassFiltersFromArgs(List) class-filters}]
19 * [{@link Etc#getClassExFiltersFromArgs(List) class-exclusion-filters}]
24 * (jde-dbo-command-result cmd_id specID)
29 * <li> <u>type</u> can be "caught", "uncaught", or "both"
30 * <li> specID is a 'long', and can be used in the 'clear'
36 * @author Paul Kinnucan
37 * @version $Revision: 1.2 $
39 * Copyright (c) 2000, 2001, 2003 Paul Kinnucan
42 public class TraceExceptions extends DebugProcessCommand {
46 * @exception jde.debugger.JDEException <description>
48 public void doCommand() throws JDEException {
49 if (m_args.size() < 2)
50 throw new JDEException("Insufficient arguments");
52 String classPattern = m_args.remove(0).toString();
53 String type = m_args.remove(0).toString().toLowerCase();
55 boolean caught = false;
56 boolean uncaught = false;
58 if (type.equals("both")) {
61 } else if (type.equals("caught")) {
63 } else if (type.equals("uncaught")) {
66 throw new JDEException("'"+type+"' not understood");
69 EventRequestSpecList eventRequests = m_debugger.getEventRequestSpecList();
70 EventRequestSpec er = eventRequests.createExceptionIntercept(classPattern, caught, uncaught);
72 er.setThread(Etc.getThreadFromArgs(m_args));
73 er.setSuspendPolicy(Etc.getSuspendPolicyFromArgs(m_args));
74 er.setClassFilters(Etc.getClassFiltersFromArgs(m_args));
75 er.setClassExFilters(Etc.getClassExFiltersFromArgs(m_args));
76 eventRequests.install(er);
78 m_debugger.signalCommandResult(m_cmdID, er.getID().toString(), CMD_OK, NOQUOTE);
81 public Object clone() {return new TraceExceptions();}
86 * $Log: TraceExceptions.java,v $
87 * Revision 1.2 2003/01/15 05:56:26 paulk
88 * Add Petter Mahlen's changes.
90 * Revision 1.1 2001/03/24 13:35:25 paulk
96 // End of TraceExceptions.java