Roxen.git / server / tools / ntroxen / startdll / cmdline.cpp

version» Context lines:

Roxen.git/server/tools/ntroxen/startdll/cmdline.cpp:1:   // cmdline.cpp: implementation of the CCmdLine class.   // - // $Id: cmdline.cpp,v 1.5 2001/08/06 14:18:44 tomas Exp $ + // $Id: cmdline.cpp,v 1.6 2001/08/09 16:23:45 tomas Exp $   //   //////////////////////////////////////////////////////////////////////      #include "stdafx.h"   #include "startdll.h"   #include "cmdline.h" -  + #include "enumproc.h"      #ifdef _DEBUG   #undef THIS_FILE   static char THIS_FILE[]=__FILE__;   //#define new DEBUG_NEW   #endif      static char *defPikeArgs[] = {       // List terminator
Roxen.git/server/tools/ntroxen/startdll/cmdline.cpp:201:   //   // CCmdLine class   //      //////////////////////////////////////////////////////////////////////   // Construction/Destruction   //////////////////////////////////////////////////////////////////////      CCmdLine::CCmdLine()   { -  m_bPreloaded = FALSE; +  m_bPreloaded = FALSE;    -  m_bInstall = FALSE; -  m_bRemove = FALSE; -  m_bOnce = FALSE; -  m_bHelp = FALSE; -  m_bVersion = FALSE; -  m_bPassHelp = FALSE; +  m_bInstall = FALSE; +  m_bRemove = FALSE; +  m_bOnce = FALSE; +  m_bHelp = FALSE; +  m_bVersion = FALSE; +  m_bPassHelp = FALSE; +  m_bKeepMysql = FALSE; +  m_bMsdev = FALSE;    -  m_iVerbose = 1; -  m_iDebug = 0; +  m_iVerbose = 1; +  m_iDebug = -1;      }      CCmdLine::~CCmdLine()   {   }            ////////////////////////
Roxen.git/server/tools/ntroxen/startdll/cmdline.cpp:393:    "",    " .B--self-testB.: Runs a testsuite.",    " .B--self-test-verboseB.: Runs a testsuite, report all tests.",   // " .B--self-test-quietB.: Runs a testsuite, only report errors.",    " .BNOTE:B. You must manually shutdown any",    " running mysql process both before and",    " after these commands!",    "",    " .B--onceB.: Run the server only once, in the foreground.",    " This is very useful when debugging.", +  " Implies --module-debug.",    "",   /* -  +  " .B--keep-mysqlB.: Don't shut down MySQL process when exiting", +  " the start script. Useful during development", +  " or any other scenario where the start script", +  " is frequently terminated.", +  "", + */ + /*    " .B--gdbB.: Run the server in gdb. Implies .B--onceB..",    "",   */ -  + /* +  " .B--msdevB.: Run the server in Microsoft Developer Studio.", +  " Implies .B--onceB..", + */ +  "",    " .B--programB.: Start a different program with the roxen",    " Pike.",    "",    " .B--with-debugB.: Enable debug",    "", -  " .B--without-debugB.: Disable all debug", +  " .B--without-debugB.: Disable all debug. This is the default.",    "", -  " .B--with-fd-debugB.: Enable FD debug.", +  " .B--module-debugB.: Enable more internal debug checks to", +  " simplify debugging of Roxen modules.",    "", -  " .B--with-dump-debugB.: Enable dump debug.", +  " .B--fd-debugB.: Enable FD debug.",    "", -  +  " .B--dump-debugB.: Enable dump debug.", +  "",   /*    " .B--trussB.: (Solaris only). Run the server under",    " truss, shows .BallB. system calls. This is",    " extremely noisy, and is not intented for",    " anything but debug.",    "",    " .B--truss-cB.: (Solaris only). Run the server under",    " truss -c, shows times for all system calls",    " on exit. This is not intented for anything",    " but debug. Slows the server down.",
Roxen.git/server/tools/ntroxen/startdll/cmdline.cpp:872:       //'--without-debug')    // debug=-1    if (Match(*argv, "--without-debug", NULL, NULL))    {    m_iDebug = -1;    type = eArgNoDebug;    return 1;    }    +  //'--module-debug') +  // debug=0 +  if (Match(*argv, "--module-debug", NULL, NULL) || +  Match(*argv, "--with-module-debug", NULL, NULL) || +  Match(*argv, "--enable-module-debug", NULL, NULL) ) +  { +  m_iDebug = 0; +  type = eArgDebug; +  return 1; +  } +     //'--fd-debug'|'--with-fd-debug'|'--enable-fd-debug')    // DEFINES="-DFD_DEBUG $DEFINES"    if (Match(*argv, "--fd-debug", NULL, NULL) ||    Match(*argv, "--with-fd-debug", NULL, NULL) ||    Match(*argv, "--enable-fd-debug", NULL, NULL) )    {    m_saPikeDefines.Add("-DFD_DEBUG");    type = eArgPike;    return 1;    }
Roxen.git/server/tools/ntroxen/startdll/cmdline.cpp:993:    m_saRoxenArgs.Add(*argv);    type = eArgRoxen;    return 1;    }       //'--once')    // once=1    if (Match(*argv, "--once", NULL, NULL) )    {    m_bOnce = TRUE; +  m_iDebug = max(m_iDebug, 0);    type = eArgStart;    return 1;    }      //# Misspelling --once might give undesirable results, so let's accept   //# some "creative" spellings... :-)    //'--onve'|'--onec'|'--onev')    // once=1    if (Match(*argv, "--onve", NULL, NULL) ||    Match(*argv, "--onec", NULL, NULL) ||    Match(*argv, "--onev", NULL, NULL) )    {    m_bOnce = TRUE; -  +  m_iDebug = max(m_iDebug, 0);    type = eArgStart;    return 1;    }    -  +  //'--keep-mysql') +  // keep_mysql=1 +  if (Match(*argv, "--keep-mysql", NULL, NULL) ) +  { +  m_bKeepMysql = TRUE; +  type = eArgStart; +  return 1; +  } +  +  //'--gdb') +  // gdb=gdb +  // once=1 + /* +  if (Match(*argv, "--msdev", NULL, NULL) ) +  { +  m_bOnce = TRUE; +  m_bMsdev = TRUE; +  type = eArgStart; +  return 1; +  } + */ +     //'--program')    // program="$2"    // once=1    // passhelp=1    if (Match(*argv, "--program", NULL, NULL) )    {    m_saRoxenArgs.Add(*argv);    m_saRoxenArgs.Add(argv[1]);    m_bOnce = TRUE;    m_bPassHelp = TRUE;
Roxen.git/server/tools/ntroxen/startdll/cmdline.cpp:1039:    // shift    if (Match(*argv, "--cd", NULL, NULL) )    {    m_saRoxenArgs.Add(*argv);    m_saRoxenArgs.Add(argv[1]);    m_bOnce = TRUE;    type = eArgNtLoader;    return 2;    }    -  //--debug-without=*|-r*|-d*|-t*|-l*|-w*|-a*) +  //--debug-without=*|-r*|-d*|-t*|-l*|-w*|-a*|-p*|--*-debug*) +  // TODO: --*-debug*    // # Argument passed along to Pike.    // ARGS="$ARGS $1"    if (Match(*argv, "--debug-without=*", NULL, NULL) ||    Match(*argv, "-r*", NULL, NULL) ||    Match(*argv, "-d*", NULL, NULL) ||    Match(*argv, "-t*", NULL, NULL) ||    Match(*argv, "-l*", NULL, NULL) ||    Match(*argv, "-w*", NULL, NULL) || -  +  Match(*argv, "-p*", NULL, NULL) ||    Match(*argv, "-a*", NULL, NULL) )    {    m_saPikeArgs.Add(*argv);    type = eArgPike;    return 1;    }       //-D*|-M*|-I*|-P*)    // # Argument passed along to Pike.    // DEFINES="$DEFINES $1"
Roxen.git/server/tools/ntroxen/startdll/cmdline.cpp:1162:   {    int numargs;    int numchars;       SplitCmdline((_TSCHAR *)cmdline, NULL, NULL, &numargs, &numchars);       _TSCHAR *p = new _TSCHAR[numargs * sizeof(_TSCHAR *) + numchars * sizeof(_TSCHAR)];       SplitCmdline((_TSCHAR *)cmdline, (_TSCHAR **)p, p + numargs * sizeof(char *), &numargs, &numchars);    -  return Parse(numargs-1, (char **)p); +  int ret = Parse(numargs-1, (char **)p); +  +  delete p; +  +  return ret;   }         BOOL CCmdLine::Parse(int argc, char *argv[])   {    BOOL ret = TRUE;    tArgType type;    HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);    int i;   
Roxen.git/server/tools/ntroxen/startdll/cmdline.cpp:1243:    // No extra handling here    //OutputLineFmt(hOut, ".BNoDebug argument: %sB.", argv[i]);    break;       case eArgVersion:    // No extra handling here    //OutputLineFmt(hOut, ".BVersion argument: %sB.", argv[i]);    break;       case eArgSelfTest: +  // Make sure that mysql is not running +  KillMySql(); +     //DEFINES="-DRUN_SELF_TEST $DEFINES"    //rm -rf $VARDIR/test_config*    //cp -R etc/test/config $VARDIR/test_config    //cp etc/test/filesystem/test_rxml_package rxml_packages/test_rxml_package    //DIR=$VARDIR/test_config    //once=1    //remove_dumped=1    m_saPikeArgs.Add("-DRUN_SELF_TEST"); -  system("rmdir /Q /S ..\\var\\test_config"); -  system("xcopy etc\\test\\config ..\\var\\test_config\\ /E /Q /Y >NUL:"); -  system("copy /Y etc\\test\\filesystem\\test_rxml_package rxml_packages\\test_rxml_package >NUL:"); +  SetEnvironmentVariable("COPYCMD", "/Y"); +  system("rmdir /Q /S ..\\var\\test_config >NUL:"); +  system("xcopy etc\\test\\config ..\\var\\test_config\\ /E /Q >NUL:"); +  system("copy etc\\test\\filesystem\\test_rxml_package rxml_packages\\test_rxml_package >NUL:");       m_bOnce = TRUE;    m_saRoxenArgs.Add("--config-dir=../var/test_config");    m_saRoxenArgs.Add("--remove-dumped");       //OutputLineFmt(hOut, ".BSelfTest argument: %sB.", argv[i]);    break;       case eArgHelp:    // No extra handling here