All Classes Namespaces Functions Variables Groups Pages
DebugCmdLine.qm.dox.h
// -*- mode: c++; indent-tabs-mode: nil -*-
/* DebugCmdLine.qm Copyright 2013 - 2018 Qore Technologies, s.r.o.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
*/
// minimum required Qore version
namespace DebugCmdLine {
class WrapperGetOpt : public GetOpt {
public:
constructor(hash options) ;
split(list<string> args, reference<list<string>> wrp_args, reference<*string> pgm_name, reference<list<string>> pgm_args);
};
class DebugCommandLine : public AbstractDebugControl {
public:
public :
hash cx;
const defaultIndent = " ";
public:
private :
const fcHelp = 0x01;
const fcExpandUniqueCmd = 0x02;
const fcValidate = 0x04;
const fcFallback = 0x08;
*string historyFileName;
Qore::Thread::RWLock rwlContext();
public:
constructor();
private:
hash<auto> getCommands();
public:
// to implement print to terminal
abstract printfImpl(string fmt);
abstract *hash doCommandImpl(hash data);
*hash doCommand(hash data, bool print);
showFileNames(hash fn);
showPrograms(hash ph, bool show_interrupted);
showBreakpoints(*list bkpts);
string getThreadStackStr(hash lh);
showThreadStack(softint tid, list stack);
printSource(*hash src);
processGetSource(string type, list path, list args);
static validateInt(DebugCommandLine dcl, softlist path, softlist val);
auto parseValue();
auto getContextValue(string key);
setContextValue(string key, auto value);
hash getStatementValue(list args);
private:
list splitCmd(string line);
public:
string listVariantCmds(hash v);
*hash findCmd(list args, int opts = 0, *reference<int> last_param) { /* because it is needed from closure */ hash result;
result.path = ();
hash<auto> c = getCommands();
last_param = 0;
while (args);
result.args = args;
return result;
}
list getLineCompletions(string line);
bool processCmdLine(string line);
private:
bool isOneLineArray(list x);
public:
printVar(string name, hash value);
printHuman(hash x, string indent = defaultIndent);
printHuman(list x, string indent = defaultIndent);
printHuman(string x, string indent = defaultIndent);
printHuman(any x, string indent = defaultIndent);
printData(auto data);
int checkProgramId();
int checkThreadId();
static softlist enumBreakpointId(DebugCommandLine dcl, softlist path, softlist args);
loadSession(*string fn);
init(hash opt);
};
};
DebugCmdLine::WrapperGetOpt::split
split(list< string > args, reference< list< string >> wrp_args, reference< *string > pgm_name, reference< list< string >> pgm_args)
Parses input arguments until a standalone argument is found.
DebugCmdLine::WrapperGetOpt
Definition: DebugCmdLine.qm.dox.h:69
DebugCmdLine::DebugCommandLine
debug command line class
Definition: DebugCmdLine.qm.dox.h:113
print
nothing print(...)
list
list list(...)
DebugCmdLine::DebugCommandLine::doCommandImpl
abstract *hash doCommandImpl(hash data)
To be implemented to execute remote (via websocket) or local command (via DebugProgramControl) ...
DebugCmdLine::WrapperGetOpt::constructor
constructor(hash options)
create the object with the given GetOpt option hash
type
string type(auto arg)
Qore::Thread::RWLock
hash
hash hash(object obj)