45 namespace DebugCmdLine {
64 class WrapperGetOpt :
public GetOpt {
68 constructor(
hash options) ;
104 split(list<string> args, reference<list<string>> wrp_args, reference<*string> pgm_name, reference<list<string>> pgm_args);
108 class DebugCommandLine :
public AbstractDebugControl {
112 string ln_prompt =
'qdbg> ';
114 const defaultHistoryFileName =
'.qdbg.history';
115 const defaultIndent =
" ";
121 const fcExpandUniqueCmd = 0x02;
122 const fcValidate = 0x04;
123 const fcFallback = 0x08;
124 *
string historyFileName;
138 'desc':
'get help about command',
143 'desc':
'get version info. Check "host" key to see if server side is reponding',
150 'desc':
'load command line history from file, args: filename',
155 'desc':
'save command line history to file, args: filename',
161 'desc':
'load or save history to file. The history is implicitly loaded when program starting and saved when exiting. See command line parameters.',
164 'desc':
'quit debugger',
170 'desc':
'send a command to the server and show the output',
177 'desc':
'set current stack frame, args: frameId',
181 'validate': \DebugCommandLine::validateInt(),
187 'desc':
'get current stack frame',
194 'desc':
'Stack frame related commands',
197 'desc':
'get list of debugged programs, stopped threads and breakpoint stats',
202 'desc':
'load session from file, args: filename',
207 'desc':
'save session to file, args: filename',
219 'desc':
'load and run script, args: filename [args..]',
224 'desc':
'regex search for a program, args: regex',
231 'desc':
'verbose program listing',
236 'desc':
'list programs, [full] for a verbose listing',
241 'desc':
'set current program, arg: programId',
245 'validate': \DebugCommandLine::validateInt(),
251 'desc':
'get current program',
256 'desc':
'add current program for debugging',
261 'desc':
'remove current program from debugging',
266 'desc':
'stop current program, args: [threadId] to stop particular thread',
279 'desc':
'get/set global variable, args: varName [value]',
290 'desc':
'get defines, args: [defineName]',
293 'desc':
'list parse options',
298 'desc':
'get info about current program and list threads',
303 'desc':
'program related commands',
332 'desc':
'list breakpoints for current program',
337 'desc':
'list breakpoints for all programs',
344 'desc':
'create breakpoint and get breakpointId. Optionally assign to particular statement, i.e. code line, or do it later using "statement assign". args: [function([args, ...])] | [file] lineno | //statementId',
355 'desc':
'delete breakpoint, args: breakpointId',
364 'desc':
'enable breakpoint, args: breakpointId',
373 'desc':
'disable breakpoint, args: breakpointId',
388 'desc':
sprintf(
'get/set breakpoint policy, args: breakpointId [%s]', (keys AbstractDebugControl::policyStrings).join(
'|')),
397 'desc':
'get/set threads assigned to breakpoint, args: breakpointId ["+"/"-" threadId | threadId ..]',
408 'desc':
'get statement list assigned to breakpoint, args: breakpointId',
411 'desc':
'breakpoint related commands',
425 'desc':
'list statements, args: breakpointId',
434 'desc':
'assign statement to breakpoint, args: breakpointId [function([args, ...])] | [file] lineno | //statementId',
443 'desc':
'unassign statement from breakpoint, args: breakpointId [function([args, ...])] | [file] lineno | //statementId',
446 'desc':
'statement related commands',
453 'desc':
'set current thread, args: threadId',
456 'validate': \DebugCommandLine::validateInt(),
462 'desc':
'get current thread',
476 'desc':
'get/set local variable, args: varName [value]',
485 'desc':
'get/set special debug variable, args: varName [value], use "thread debug list" command result to see value list of varNames',
488 'desc':
'show threads and related programs, interrupted programs are marked with \"S\"',
493 'desc':
'show list of threads and top level stack position',
498 'desc':
'thread related commands',
509 'desc':
'get stack for current thread',
514 'desc':
'show call stack for all threads',
527 'desc':
sprintf(
'go thread with specified runstate, arg: %s', (keys AbstractDebugControl::runStateStrings).join(
'|')),
540 abstract *
hash doCommandImpl(
hash data);
541 doCommand(
hash data);
543 showPrograms(
hash ph,
bool show_interrupted);
545 showBreakpoints(*
list bkpts);
547 string getThreadStackStr(
hash lh);
549 showThreadStack(softint tid,
list stack);
551 static validateInt(DebugCommandLine dcl, softlist path, softlist val);
555 auto getContextValue(
string key);
557 setContextValue(
string key,
auto value);
563 list splitCmd(
string line);
567 string listVariantCmds(
hash v);
569 *
hash findCmd(
list args,
int opts = 0, *reference<int> last_param) {
hash result;
571 hash<auto> c = commands;
581 list ln_callback(
string line);
589 bool isOneLineArray(
list x);
593 printVar(
string name,
hash value);
595 printHuman(
hash x,
string indent = defaultIndent);
597 printHuman(
list x,
string indent = defaultIndent);
599 printHuman(
string x,
string indent = defaultIndent);
600 printHuman(any x,
string indent = defaultIndent);
602 printData(
auto data);
604 printLinenoise(*
string outs);
606 int checkProgramId();
610 static softlist enumBreakpointId(DebugCommandLine dcl, softlist path, softlist args);
612 loadSession(*
string fn);
string sprintf(string fmt,...)
list< string > split(string sep, string str, bool with_separator=False)