author | ysuenaga |
Wed, 06 Apr 2016 20:43:03 +0900 | |
changeset 37445 | 5565e6e80352 |
parent 37177 | 49d02f305b29 |
child 38264 | a6a9765aafd5 |
permissions | -rw-r--r-- |
31978 | 1 |
/* |
2 |
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
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 |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
* |
|
23 |
*/ |
|
24 |
||
25 |
package sun.jvm.hotspot; |
|
26 |
||
27 |
import java.util.ArrayList; |
|
28 |
import java.util.Arrays; |
|
29 |
||
30 |
import sun.jvm.hotspot.tools.JStack; |
|
31 |
import sun.jvm.hotspot.tools.JMap; |
|
32 |
import sun.jvm.hotspot.tools.JInfo; |
|
37090 | 33 |
import sun.jvm.hotspot.tools.JSnap; |
31978 | 34 |
|
35 |
public class SALauncher { |
|
36 |
||
37 |
private static boolean launcherHelp() { |
|
38 |
System.out.println(" clhsdb \tcommand line debugger"); |
|
39 |
System.out.println(" hsdb \tui debugger"); |
|
40 |
System.out.println(" jstack --help\tto get more information"); |
|
41 |
System.out.println(" jmap --help\tto get more information"); |
|
42 |
System.out.println(" jinfo --help\tto get more information"); |
|
37090 | 43 |
System.out.println(" jsnap --help\tto get more information"); |
31978 | 44 |
return false; |
45 |
} |
|
46 |
||
47 |
private static boolean commonHelp() { |
|
48 |
// --pid <pid> |
|
49 |
// --exe <exe> |
|
50 |
// --core <core> |
|
51 |
System.out.println(" --exe\texecutable image name"); |
|
52 |
System.out.println(" --core\tpath to coredump"); |
|
53 |
System.out.println(" --pid\tpid of process to attach"); |
|
54 |
return false; |
|
55 |
} |
|
56 |
||
57 |
private static boolean jinfoHelp() { |
|
58 |
// --flags -> -flags |
|
59 |
// --sysprops -> -sysprops |
|
60 |
System.out.println(" --flags\tto print VM flags"); |
|
61 |
System.out.println(" --sysprops\tto print Java System properties"); |
|
62 |
System.out.println(" <no option>\tto print both of the above"); |
|
63 |
return commonHelp(); |
|
64 |
} |
|
65 |
||
66 |
private static boolean jmapHelp() { |
|
67 |
// --heap -> -heap |
|
68 |
// --binaryheap -> -heap:format=b |
|
69 |
// --histo -> -histo |
|
70 |
// --clstats -> -clstats |
|
71 |
// --finalizerinfo -> -finalizerinfo |
|
72 |
||
73 |
System.out.println(" <no option>\tto print same info as Solaris pmap"); |
|
74 |
System.out.println(" --heap\tto print java heap summary"); |
|
75 |
System.out.println(" --binaryheap\tto dump java heap in hprof binary format"); |
|
76 |
System.out.println(" --histo\tto print histogram of java object heap"); |
|
77 |
System.out.println(" --clstats\tto print class loader statistics"); |
|
78 |
System.out.println(" --finalizerinfo\tto print information on objects awaiting finalization"); |
|
79 |
return commonHelp(); |
|
80 |
} |
|
81 |
||
82 |
private static boolean jstackHelp() { |
|
83 |
// --locks -> -l |
|
84 |
// --mixed -> -m |
|
85 |
System.out.println(" --locks\tto print java.util.concurrent locks"); |
|
86 |
System.out.println(" --mixed\tto print both java and native frames (mixed mode)"); |
|
87 |
return commonHelp(); |
|
88 |
} |
|
89 |
||
37090 | 90 |
private static boolean jsnapHelp() { |
37177 | 91 |
System.out.println(" --all\tto print all performance counters"); |
37090 | 92 |
return commonHelp(); |
93 |
} |
|
94 |
||
31978 | 95 |
private static boolean toolHelp(String toolName) { |
96 |
if (toolName.equals("jstack")) { |
|
97 |
return jstackHelp(); |
|
98 |
} |
|
99 |
if (toolName.equals("jinfo")) { |
|
100 |
return jinfoHelp(); |
|
101 |
} |
|
102 |
if (toolName.equals("jmap")) { |
|
103 |
return jmapHelp(); |
|
104 |
} |
|
37090 | 105 |
if (toolName.equals("jsnap")) { |
106 |
return jsnapHelp(); |
|
107 |
} |
|
31978 | 108 |
if (toolName.equals("hsdb") || toolName.equals("clhsdb")) { |
109 |
return commonHelp(); |
|
110 |
} |
|
111 |
return launcherHelp(); |
|
112 |
} |
|
113 |
||
37445
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
114 |
private static void buildAttachArgs(ArrayList<String> newArgs, String pid, |
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
115 |
String exe, String core, boolean allowEmpty) { |
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
116 |
if (!allowEmpty && (pid == null) && (exe == null)) { |
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
117 |
throw new SAGetoptException("You have to set --pid or --exe."); |
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
118 |
} |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
119 |
|
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
120 |
if (pid != null) { // Attach to live process |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
121 |
if (exe != null) { |
37445
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
122 |
throw new SAGetoptException("Unnecessary argument: --exe"); |
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
123 |
} else if (core != null) { |
37445
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
124 |
throw new SAGetoptException("Unnecessary argument: --core"); |
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
125 |
} else if (!pid.matches("^\\d+$")) { |
37445
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
126 |
throw new SAGetoptException("Invalid pid: " + pid); |
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
127 |
} |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
128 |
|
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
129 |
newArgs.add(pid); |
37445
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
130 |
} else if (exe != null) { |
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
131 |
if (exe.length() == 0) { |
37445
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
132 |
throw new SAGetoptException("You have to set --exe."); |
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
133 |
} |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
134 |
|
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
135 |
newArgs.add(exe); |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
136 |
|
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
137 |
if ((core == null) || (core.length() == 0)) { |
37445
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
138 |
throw new SAGetoptException("You have to set --core."); |
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
139 |
} |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
140 |
|
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
141 |
newArgs.add(core); |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
142 |
} |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
143 |
} |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
144 |
|
31978 | 145 |
private static void runCLHSDB(String[] oldArgs) { |
146 |
SAGetopt sg = new SAGetopt(oldArgs); |
|
147 |
String[] longOpts = {"exe=", "core=", "pid="}; |
|
148 |
||
149 |
ArrayList<String> newArgs = new ArrayList(); |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
150 |
String pid = null; |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
151 |
String exe = null; |
31978 | 152 |
String core = null; |
153 |
String s = null; |
|
154 |
||
155 |
while((s = sg.next(null, longOpts)) != null) { |
|
156 |
if (s.equals("exe")) { |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
157 |
exe = sg.getOptarg(); |
31978 | 158 |
continue; |
159 |
} |
|
160 |
if (s.equals("core")) { |
|
161 |
core = sg.getOptarg(); |
|
162 |
continue; |
|
163 |
} |
|
164 |
if (s.equals("pid")) { |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
165 |
pid = sg.getOptarg(); |
31978 | 166 |
continue; |
167 |
} |
|
168 |
} |
|
169 |
||
37445
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
170 |
buildAttachArgs(newArgs, pid, exe, core, true); |
31978 | 171 |
CLHSDB.main(newArgs.toArray(new String[newArgs.size()])); |
172 |
} |
|
173 |
||
174 |
private static void runHSDB(String[] oldArgs) { |
|
175 |
SAGetopt sg = new SAGetopt(oldArgs); |
|
176 |
String[] longOpts = {"exe=", "core=", "pid="}; |
|
177 |
||
178 |
ArrayList<String> newArgs = new ArrayList(); |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
179 |
String pid = null; |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
180 |
String exe = null; |
31978 | 181 |
String core = null; |
182 |
String s = null; |
|
183 |
||
184 |
while((s = sg.next(null, longOpts)) != null) { |
|
185 |
if (s.equals("exe")) { |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
186 |
exe = sg.getOptarg(); |
31978 | 187 |
continue; |
188 |
} |
|
189 |
if (s.equals("core")) { |
|
190 |
core = sg.getOptarg(); |
|
191 |
continue; |
|
192 |
} |
|
193 |
if (s.equals("pid")) { |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
194 |
pid = sg.getOptarg(); |
31978 | 195 |
continue; |
196 |
} |
|
197 |
} |
|
198 |
||
37445
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
199 |
buildAttachArgs(newArgs, pid, exe, core, true); |
31978 | 200 |
HSDB.main(newArgs.toArray(new String[newArgs.size()])); |
201 |
} |
|
202 |
||
203 |
private static void runJSTACK(String[] oldArgs) { |
|
204 |
SAGetopt sg = new SAGetopt(oldArgs); |
|
205 |
String[] longOpts = {"exe=", "core=", "pid=", |
|
206 |
"mixed", "locks"}; |
|
207 |
||
208 |
ArrayList<String> newArgs = new ArrayList(); |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
209 |
String pid = null; |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
210 |
String exe = null; |
31978 | 211 |
String core = null; |
212 |
String s = null; |
|
213 |
||
214 |
while((s = sg.next(null, longOpts)) != null) { |
|
215 |
if (s.equals("exe")) { |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
216 |
exe = sg.getOptarg(); |
31978 | 217 |
continue; |
218 |
} |
|
219 |
if (s.equals("core")) { |
|
220 |
core = sg.getOptarg(); |
|
221 |
continue; |
|
222 |
} |
|
223 |
if (s.equals("pid")) { |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
224 |
pid = sg.getOptarg(); |
31978 | 225 |
continue; |
226 |
} |
|
227 |
if (s.equals("mixed")) { |
|
228 |
newArgs.add("-m"); |
|
229 |
continue; |
|
230 |
} |
|
231 |
if (s.equals("locks")) { |
|
232 |
newArgs.add("-l"); |
|
233 |
continue; |
|
234 |
} |
|
235 |
} |
|
236 |
||
37445
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
237 |
buildAttachArgs(newArgs, pid, exe, core, false); |
31978 | 238 |
JStack.main(newArgs.toArray(new String[newArgs.size()])); |
239 |
} |
|
240 |
||
241 |
private static void runJMAP(String[] oldArgs) { |
|
242 |
SAGetopt sg = new SAGetopt(oldArgs); |
|
243 |
String[] longOpts = {"exe=", "core=", "pid=", |
|
244 |
"heap", "binaryheap", "histo", "clstats", "finalizerinfo"}; |
|
245 |
||
246 |
ArrayList<String> newArgs = new ArrayList(); |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
247 |
String pid = null; |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
248 |
String exe = null; |
31978 | 249 |
String core = null; |
250 |
String s = null; |
|
251 |
||
252 |
while((s = sg.next(null, longOpts)) != null) { |
|
253 |
if (s.equals("exe")) { |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
254 |
exe = sg.getOptarg(); |
31978 | 255 |
continue; |
256 |
} |
|
257 |
if (s.equals("core")) { |
|
258 |
core = sg.getOptarg(); |
|
259 |
continue; |
|
260 |
} |
|
261 |
if (s.equals("pid")) { |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
262 |
pid = sg.getOptarg(); |
31978 | 263 |
continue; |
264 |
} |
|
265 |
if (s.equals("heap")) { |
|
266 |
newArgs.add("-heap"); |
|
267 |
continue; |
|
268 |
} |
|
269 |
if (s.equals("binaryheap")) { |
|
270 |
newArgs.add("-heap:format=b"); |
|
271 |
continue; |
|
272 |
} |
|
273 |
if (s.equals("histo")) { |
|
274 |
newArgs.add("-histo"); |
|
275 |
continue; |
|
276 |
} |
|
277 |
if (s.equals("clstats")) { |
|
278 |
newArgs.add("-clstats"); |
|
279 |
continue; |
|
280 |
} |
|
281 |
if (s.equals("finalizerinfo")) { |
|
282 |
newArgs.add("-finalizerinfo"); |
|
283 |
continue; |
|
284 |
} |
|
285 |
} |
|
286 |
||
37445
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
287 |
buildAttachArgs(newArgs, pid, exe, core, false); |
31978 | 288 |
JMap.main(newArgs.toArray(new String[newArgs.size()])); |
289 |
} |
|
290 |
||
291 |
private static void runJINFO(String[] oldArgs) { |
|
292 |
SAGetopt sg = new SAGetopt(oldArgs); |
|
293 |
String[] longOpts = {"exe=", "core=", "pid=", |
|
294 |
"flags", "sysprops"}; |
|
295 |
||
296 |
ArrayList<String> newArgs = new ArrayList(); |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
297 |
String exe = null; |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
298 |
String pid = null; |
31978 | 299 |
String core = null; |
300 |
String s = null; |
|
301 |
||
302 |
while((s = sg.next(null, longOpts)) != null) { |
|
303 |
if (s.equals("exe")) { |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
304 |
exe = sg.getOptarg(); |
31978 | 305 |
continue; |
306 |
} |
|
307 |
if (s.equals("core")) { |
|
308 |
core = sg.getOptarg(); |
|
309 |
continue; |
|
310 |
} |
|
311 |
if (s.equals("pid")) { |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
312 |
pid = sg.getOptarg(); |
31978 | 313 |
continue; |
314 |
} |
|
315 |
if (s.equals("flags")) { |
|
316 |
newArgs.add("-flags"); |
|
317 |
continue; |
|
318 |
} |
|
319 |
if (s.equals("sysprops")) { |
|
320 |
newArgs.add("-sysprops"); |
|
321 |
continue; |
|
322 |
} |
|
323 |
} |
|
324 |
||
37445
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
325 |
buildAttachArgs(newArgs, pid, exe, core, false); |
31978 | 326 |
JInfo.main(newArgs.toArray(new String[newArgs.size()])); |
327 |
} |
|
328 |
||
37090 | 329 |
private static void runJSNAP(String[] oldArgs) { |
330 |
SAGetopt sg = new SAGetopt(oldArgs); |
|
37177 | 331 |
String[] longOpts = {"exe=", "core=", "pid=", "all"}; |
37090 | 332 |
|
333 |
ArrayList<String> newArgs = new ArrayList(); |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
334 |
String exe = null; |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
335 |
String pid = null; |
37090 | 336 |
String core = null; |
337 |
String s = null; |
|
338 |
||
339 |
while((s = sg.next(null, longOpts)) != null) { |
|
340 |
if (s.equals("exe")) { |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
341 |
exe = sg.getOptarg(); |
37090 | 342 |
continue; |
343 |
} |
|
344 |
if (s.equals("core")) { |
|
345 |
core = sg.getOptarg(); |
|
346 |
continue; |
|
347 |
} |
|
348 |
if (s.equals("pid")) { |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
349 |
pid = sg.getOptarg(); |
37090 | 350 |
continue; |
351 |
} |
|
37177 | 352 |
if (s.equals("all")) { |
353 |
newArgs.add("-a"); |
|
354 |
continue; |
|
355 |
} |
|
37090 | 356 |
} |
357 |
||
37445
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
358 |
buildAttachArgs(newArgs, pid, exe, core, false); |
37090 | 359 |
JSnap.main(newArgs.toArray(new String[newArgs.size()])); |
360 |
} |
|
361 |
||
31978 | 362 |
public static void main(String[] args) { |
363 |
// Provide a help |
|
364 |
if (args.length == 0) { |
|
365 |
launcherHelp(); |
|
366 |
return; |
|
367 |
} |
|
368 |
// No arguments imply help for jstack, jmap, jinfo but launch clhsdb and hsdb |
|
369 |
if (args.length == 1 && !args[0].equals("clhsdb") && !args[0].equals("hsdb")) { |
|
370 |
toolHelp(args[0]); |
|
371 |
return; |
|
372 |
} |
|
373 |
||
374 |
for (String arg : args) { |
|
375 |
if (arg.equals("-h") || arg.equals("-help") || arg.equals("--help")) { |
|
376 |
toolHelp(args[0]); |
|
377 |
return; |
|
378 |
} |
|
379 |
} |
|
380 |
||
381 |
String[] oldArgs = Arrays.copyOfRange(args, 1, args.length); |
|
382 |
||
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
383 |
try { |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
384 |
// Run SA interactive mode |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
385 |
if (args[0].equals("clhsdb")) { |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
386 |
runCLHSDB(oldArgs); |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
387 |
return; |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
388 |
} |
31978 | 389 |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
390 |
if (args[0].equals("hsdb")) { |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
391 |
runHSDB(oldArgs); |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
392 |
return; |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
393 |
} |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
394 |
|
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
395 |
// Run SA tmtools mode |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
396 |
if (args[0].equals("jstack")) { |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
397 |
runJSTACK(oldArgs); |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
398 |
return; |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
399 |
} |
31978 | 400 |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
401 |
if (args[0].equals("jmap")) { |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
402 |
runJMAP(oldArgs); |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
403 |
return; |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
404 |
} |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
405 |
|
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
406 |
if (args[0].equals("jinfo")) { |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
407 |
runJINFO(oldArgs); |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
408 |
return; |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
409 |
} |
31978 | 410 |
|
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
411 |
if (args[0].equals("jsnap")) { |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
412 |
runJSNAP(oldArgs); |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
413 |
return; |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
414 |
} |
31978 | 415 |
|
37445
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
416 |
throw new SAGetoptException("Unknown tool: " + args[0]); |
5565e6e80352
8152435: (CL)HSDB should be started with no argument
ysuenaga
parents:
37177
diff
changeset
|
417 |
} catch (SAGetoptException e) { |
37101
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
418 |
System.err.println(e.getMessage()); |
496308fe87f1
8151709: jhsdb should show help message in SALauncher.
ysuenaga
parents:
37090
diff
changeset
|
419 |
toolHelp(args[0]); |
37090 | 420 |
} |
31978 | 421 |
} |
422 |
} |