Qore DebugUtil Module Reference  0.1
DebugUtil.qm.dox.h
1 // -*- mode: c++; indent-tabs-mode: nil -*-
3 
4 /* DebugUtil.qm Copyright 2013 - 2017 Qore Technologies, s.r.o.
5 
6  Permission is hereby granted, free of charge, to any person obtaining a
7  copy of this software and associated documentation files (the "Software"),
8  to deal in the Software without restriction, including without limitation
9  the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  and/or sell copies of the Software, and to permit persons to whom the
11  Software is furnished to do so, subject to the following conditions:
12 
13  The above copyright notice and this permission notice shall be included in
14  all copies or substantial portions of the Software.
15 
16  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  DEALINGS IN THE SOFTWARE.
23 */
24 
25 // minimum required Qore version
26 
27 
28 
41 namespace DebugUtil {
44 
66 class WrapperGetOpt : public GetOpt {
67 
68 public:
69  constructor(hash options);
70 
71 
73 
105  split(list<string> args, reference<list<string>> wrp_args, reference<*string> pgm_name, reference<list<string>> pgm_args);
106  };
107 
109  const QoreDebugWsProtocolHeader = "QoreDebugWsProtocol";
110 
113 
115  const DUV_NONE = 0;
117  const DUV_INFO = 1;
119  const DUV_DEBUG = 2;
121  const DUV_DEBUG_1 = 3;
122 
124  class DebugLogger {
125 
126 public:
127  public :
128  int verbose = DUV_NONE;
129 
130 public:
131  constructor() {}
132 
134 
137  log(int verbosity, string fmt);
139 
142  log2(int verbosity, string fmt, *list args);
143  };
144 
147 
148 public:
149  public :
150  DebugLogger logger;
152  bool showFullException = False;
153 
154  const runStateStrings = ('detach': DebugDetach, 'run': DebugRun, 'step': DebugStep, 'stepover': DebugStepOver, 'untilreturn': DebugUntilReturn);
155  const flowStrings = ('none': 0, 'return': DebugFlowReturn, 'break': DebugFlowBreak, 'continue': DebugFlowContinue);
156  const boolStrings = ('false': False, 'true': True);
157  const policyStrings = ('none': BreakpointPolicyNone, 'accept': BreakpointPolicyAccept, 'reject': BreakpointPolicyReject);
158 
159 public:
160 
161  log(int verbosity, string fmt);
162 
163  static list enumFilter(softlist items, *string path);
164 
165  static bool evalCondition(softstring value, *string cond);
166 
167  // make_json/yaml does not support object code etc. so we need somehow process values
168  static hash serialize(auto val);
169 
170  static auto unserialize(auto sv);
171 
172  };
173 
174 };
const DebugDetach
const QoreDebugWsProtocolHeader
The HTTP header string for the Qore debug protocol version.
Definition: DebugUtil.qm.dox.h:109
class supporting argument parsing for executing programs to debug
Definition: DebugUtil.qm.dox.h:66
const DebugFlowBreak
const BreakpointPolicyNone
const BreakpointPolicyReject
const DebugFlowContinue
base class for controlling debugging
Definition: DebugUtil.qm.dox.h:146
const True
const QoreDebugProtocolVersion
The debug protocol version implemented.
Definition: DebugUtil.qm.dox.h:112
const False
const DebugFlowReturn
const DUV_INFO
logging constant: info messages
Definition: DebugUtil.qm.dox.h:117
list list(...)
const DebugRun
const DUV_NONE
logging constant: no logging
Definition: DebugUtil.qm.dox.h:115
const BreakpointPolicyAccept
const DebugStepOver
const DUV_DEBUG_1
logging constant: detailed debug messages
Definition: DebugUtil.qm.dox.h:121
const DebugUntilReturn
const DebugStep
class that can be used for logging
Definition: DebugUtil.qm.dox.h:124
hash hash(object obj)
the DebugUtil namespace contains all the definitions in the DebugUtil module
Definition: DebugUtil.qm.dox.h:42
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.
const DUV_DEBUG
logging constant: debug messages
Definition: DebugUtil.qm.dox.h:119