Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/share/jdb/JdbCommand.java
41161 views
/*1* Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223package nsk.share.jdb;2425/**26* Represents list of commands of <code>jdb</code> from JDK1.4:27*28* run [class [args]] -- start execution of application's main class29*30* threads [threadgroup] -- list threads31* thread <thread id> -- set default thread32* suspend [thread id(s)] -- suspend threads (default: all)33* resume [thread id(s)] -- resume threads (default: all)34* where [thread id] | all -- dump a thread's stack35* wherei [thread id] | all -- dump a thread's stack, with pc info36* up [n frames] -- move up a thread's stack37* down [n frames] -- move down a thread's stack38* kill <thread> <expr> -- kill a thread with the given exception object39* interrupt <thread> -- interrupt a thread40*41* print <expr> -- print value of expression42* dump <expr> -- print all object information43* eval <expr> -- evaluate expression (same as print)44* set <lvalue> = <expr> -- assign new value to field/variable/array element45* locals -- print all local variables in current stack frame46*47* classes -- list currently known classes48* class <class id> -- show details of named class49* methods <class id> -- list a class's methods50* fields <class id> -- list a class's fields51*52* threadgroups -- list threadgroups53* threadgroup <name> -- set current threadgroup54*55* stop in <class id>.<method>[(argument_type,...)]56* -- set a breakpoint in a method57* stop at <class id>:<line> -- set a breakpoint at a line58* clear <class id>.<method>[(argument_type,...)]59* -- clear a breakpoint in a method60* clear <class id>:<line> -- clear a breakpoint at a line61* clear -- list breakpoints62* catch <class id> -- break when specified exception thrown63* ignore <class id> -- cancel 'catch' for the specified exception64* watch [access|all] <class id>.<field name>65* -- watch access/modifications to a field66* unwatch [access|all] <class id>.<field name>67* -- discontinue watching access/modifications to a field68* trace methods [thread] -- trace method entry and exit69* untrace methods [thread] -- stop tracing method entry and exit70* step -- execute current line71* step up -- execute until the current method returns to its caller72* stepi -- execute current instruction73* next -- step one line (step OVER calls)74* cont -- continue execution from breakpoint75*76* list [line number|method] -- print source code77* use (or sourcepath) [source file path]78* -- display or change the source path79* exclude [class id ... | "none"]80* -- do not report step or method events for specified classes81* classpath -- print classpath info from target VM82*83* monitor <command> -- execute command each time the program stops84* monitor -- list monitors85* unmonitor <monitor#> -- delete a monitor86* read <filename> -- read and execute a command file87*88* lock <expr> -- print lock info for an object89* threadlocks [thread id] -- print lock info for a thread90*91* pop -- pop the stack through and including the current frame92* reenter -- same as pop, but current frame is reentered93* redefine <class id> <class file name>94* -- redefine the code for a class95*96* disablegc <expr> -- prevent garbage collection of an object97* enablegc <expr> -- permit garbage collection of an object98*99* !! -- repeat last command100* <n> <command> -- repeat command n times101* help (or ?) -- list commands102* version -- print version information103* exit (or quit) -- exit debugger104*105* <class id>: full class name with package qualifiers or a106* pattern with a leading or trailing wildcard ('*').107* <thread id>: thread number as reported in the 'threads' command108* <expr>: a Java(tm) Programming Language expression.109* Most common syntax is supported.110*111* Startup commands can be placed in either "jdb.ini" or ".jdbrc"112* in user.home or user.dir113*/114public class JdbCommand {115public static final String ls = System.getProperty("line.separator");116117public static final String _catch = "catch ";118public static final String _class = "class ";119public static final String classes = "classes" + ls;120public static final String classpath = "classpath" + ls;121public static final String clear = "clear ";122public static final String cont = "cont" + ls;123public static final String disablegc = "disablegc ";124public static final String down = "down ";125public static final String dump = "dump ";126public static final String enablegc = "enablegc";127public static final String eval = "eval ";128public static final String exit = "exit" + ls;129public static final String exclude = "exclude ";130public static final String fields = "fields ";131public static final String help = "help" + ls;132public static final String ignore = "ignore ";133public static final String interrupt = "interrupt ";134public static final String kill = "kill ";135public static final String list = "list ";136public static final String locals = "locals" + ls;137public static final String lock = "lock ";138public static final String methods = "methods ";139public static final String monitor = "monitor ";140public static final String next = "next" + ls;141public static final String pop = "pop" + ls;142public static final String print = "print ";143public static final String quit = "quit" + ls;144public static final String read = "read ";145public static final String redefine = "redefine ";146public static final String reenter = "reenter" + ls;147public static final String resume = "resume ";148public static final String run = "run ";149public static final String set = "set ";150public static final String step = "step" + ls;151public static final String stepi = "stepi" + ls;152public static final String step_up = "step up" + ls;153public static final String stop_in = "stop in ";154public static final String stop_at = "stop at ";155public static final String suspend = "suspend ";156public static final String thread = "thread ";157public static final String threads = "threads ";158public static final String threadgroup = "threadgroup ";159public static final String threadgroups = "threadgroups" + ls;160public static final String threadlocks = "threadlocks ";161public static final String trace = "trace ";162public static final String watch = "watch ";163public static final String where = "where ";164public static final String where_all = "where all" + ls;165public static final String wherei = "wherei ";166public static final String wherei_all = "wherei all" + ls;167public static final String unmonitor = "unmonitor ";168public static final String untrace = "untrace ";169public static final String unwatch = "unwatch ";170public static final String up = "up ";171public static final String use = "use ";172public static final String version = "version" + ls;173}174175176