Bytecode: add debugging information about input arguments

trustregion
Sébastien Villemot 2022-02-17 17:41:10 +01:00
parent a376d8c9fe
commit 972461c326
No known key found for this signature in database
GPG Key ID: 2CECE9350ECEBE4A
1 changed files with 12 additions and 0 deletions

View File

@ -69,6 +69,10 @@ Get_Arguments_and_global_variables(int nrhs,
*extended_path = false; *extended_path = false;
for (int i = 0; i < nrhs; i++) for (int i = 0; i < nrhs; i++)
{ {
#ifdef DEBUG
if (mxIsChar(prhs[i]))
mexPrintf("Arg %d: %s\n", i, Get_Argument(prhs[i]).c_str());
#endif
if (!mxIsChar(prhs[i])) if (!mxIsChar(prhs[i]))
{ {
switch (count_array_argument) switch (count_array_argument)
@ -220,6 +224,11 @@ mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
int max_periods = 0; int max_periods = 0;
#ifdef DEBUG
mexPrintf("**************************************\n");
mexPrintf("ENTERING BYTECODE: nargin=%d, nargout=%d\n", nrhs, nlhs);
#endif
try try
{ {
Get_Arguments_and_global_variables(nrhs, prhs, count_array_argument, Get_Arguments_and_global_variables(nrhs, prhs, count_array_argument,
@ -238,6 +247,9 @@ mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
{ {
mexErrMsgTxt(feh.GetErrorMsg().c_str()); mexErrMsgTxt(feh.GetErrorMsg().c_str());
} }
#ifdef DEBUG
mexPrintf("**************************************\n");
#endif
if (!count_array_argument) if (!count_array_argument)
{ {
int field = mxGetFieldNumber(M_, "params"); int field = mxGetFieldNumber(M_, "params");