This modification is a non-IDL extension of the routine COMMAND_LINE_ARGS
which is nevertheless feasibly only used in interactive sessions. Two additional
keywords, /RESET and SET=[strarr] will, respectively, blank out the memory of
command_linbe_args and set them.
Internally, the command_line_args was held as avector(char *) which is not feasible for
flexible contents. So this is defined as vector(string).
gdl.cpp is also expanded with two boolean functions that test if the words "trace" or "debug" are
in the command line. So to print internal dialogue for debug and to turn it off:
// At the top of the file selected for debug/trace:
static bool trace_me;
static bool debug_me;
namespace lib {
bool trace_arg();
bool debug_arg();
void help_item( std::ostream& os,
BaseGDL* par, DString parString, bool doIndentation);
void help_struct( std::ostream& os, BaseGDL* par, int indent , bool debug );
}
// Then in the interesting section:
if(trace_arg())
{ DPtr p0 = (*Tail)[0];
std::printf(" tracing list.move : TAIL=%llu", p0);
blah blah etc.
}
The enhancement involves three files, gdl.cpp, basic_fun.cpp, and libinit.cpp;
the attached patch file contains patches for all three, concatenated. Only those changes
relevant to this are included in the patch file.
Line numbers should correspond pretty closely to current CVS (March 3, 2016).
I can't edit the lead message so I'll just advise here, the patch file attached includes a whole subroutine
I neglected to delete
(routine_filepath)so either edit that out of the above file oruse the file I attached to this reply.
As I have it now, the subroutine code is there but the libinit.cpp allows
only the limited keyword
input - the expanded functionality can be easily edited into usage, on a
rebuild.
trace_me = false; // trace_arg();
when the code has previously invoked the debug trace, but is finished
code, was a good solution.
I greatly needed this stuff when I was developing the list and hash
routines.
On Thu, Apr 19, 2018 at 4:39 PM, Sylwester Arabas slayoo@users.sourceforge.net wrote:
Related
Feature Requests:
#145Greg, thank you for the patch. I must say though that given this is non-IDL behaviour and it seems fully attainable with env vars, I would be reluctant to include it into GDL. It's not to say we should drop it, but let me just ask you to recreate the ticket on github if needed providing a valid use case. Thanks.