home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / sd386v50.zip / sd386src.zip / INVOKE.C < prev    next >
Text File  |  1996-05-09  |  32KB  |  768 lines

  1. /*****************************************************************************/
  2. /* File:                                             IBM INTERNAL USE ONLY   */
  3. /*   invoke.c                                                                */
  4. /*                                                                           */
  5. /* Description:                                                              */
  6. /*                                                                           */
  7. /*   Parent/Child debugger invocation handling.                              */
  8. /*                                                                           */
  9. /* History:                                                                  */
  10. /*                                                                           */
  11. /*   11/04/93 Created.                                                       */
  12. /*                                                                           */
  13. /*****************************************************************************/
  14.  
  15. #include "all.h"
  16.  
  17. /*****************************************************************************/
  18. /* ParseInvocationOptions                                                    */
  19. /*                                                                           */
  20. /* Description:                                                              */
  21. /*                                                                           */
  22. /*  Parse the invocation line entered by the user.                           */
  23. /*                                                                           */
  24. /*   Syntax:                                                                 */
  25. /*                                                                           */
  26. /*   SD386 [SD386 invocation options] [program name] [ program options ]     */
  27. /*                                                                           */
  28. /* Parameters:                                                               */
  29. /*                                                                           */
  30. /*    argc           number of invocation parameters.                        */
  31. /*    argv        -> to array of ptrs to invocation parameters.              */
  32. /*    pcmd        -> to the structure that will define the invocation parms. */
  33. /*    pConnection -> to the structure that will define the connection parms. */
  34. /*                                                                           */
  35. /* Return:                                                                   */
  36. /*                                                                           */
  37. /* Assumptions:                                                              */
  38. /*                                                                           */
  39. /*****************************************************************************/
  40. void ParseInvocationOptions( int argc,
  41.                              char**argv,
  42.                              CmdParms *pcmd,
  43.                              CONNECTION *pConnection )
  44. {
  45.  char  ParmString[512];
  46.  int   i;
  47.  char *pOption;
  48.  char *cp;
  49.  int   len;
  50.  
  51.  /****************************************************************************/
  52.  /* - Handle the argc==1 case.                                               */
  53.  /****************************************************************************/
  54.  if( argc == 1 )
  55.   SayMsg(HELP_INVOCATION_SD386);
  56.  
  57.  /****************************************************************************/
  58.  /* - set default options.                                                   */
  59.  /****************************************************************************/
  60.  pConnection->DbgOrEsp    = _DBG;
  61.  pConnection->ConnectType = BOUND;
  62.  
  63.  pcmd->DbgFlags.Verbose        = FALSE;
  64.  pcmd->DbgFlags.IsParentDbg    = TRUE;
  65.  pcmd->DbgFlags.UseExecPgm     = FALSE;
  66.  pcmd->DbgFlags.DebugChild     = FALSE;
  67.  pcmd->DbgFlags.SingleMultiple = SINGLE;
  68.  pcmd->DbgFlags.DosDebugTrace  = FALSE;
  69.  
  70.  /****************************************************************************/
  71.  /* - Build a string of tokens delimited by a single blank.                  */
  72.  /****************************************************************************/
  73.  ParmString[0] = '\0';
  74.  for( i=1 ; i<argc; i++)
  75.  {
  76.   strcat(ParmString,argv[i]);
  77.   strcat(ParmString," ");
  78.  }
  79.  strcat(ParmString,"\0");
  80.  
  81.  /****************************************************************************/
  82.  /* - Now, parse the SD386 invocation options.                               */
  83.  /*   At this point, the case where argc==1 has already been handled.        */
  84.  /****************************************************************************/
  85.  pOption = strtok(ParmString," ");
  86.  do
  87.  {
  88.   switch( *pOption )
  89.   {
  90.    case '?':
  91.     /*************************************************************************/
  92.     /* - print the message file help.                                        */
  93.     /*************************************************************************/
  94.     SayMsg(HELP_INVOCATION_SD386);
  95.     break;
  96.  
  97.  
  98.    default:
  99.     /*************************************************************************/
  100.     /* - pOption will be pointing to the program name at this point. The     */
  101.     /*   strtok function will have converted the blank at the end of         */
  102.     /*   the name to a \0.                                                   */
  103.     /* - convert the name to upper case.                                     */
  104.     /* - append the .EXE to the program name if user did not enter it.       */
  105.     /*************************************************************************/
  106.     strupr(pOption);
  107.     len = strlen(pOption);
  108.     if( !strstr( pOption , ".EXE"))
  109.      len += 4;
  110.     cp  = Talloc(len+1);
  111.     strcpy(cp,pOption);
  112.     if( !strstr( pOption , ".EXE"))
  113.      strcpy(cp+strlen(pOption),".EXE");
  114.     cp[len] = '\0';
  115.     pcmd->pUserExe   = cp;
  116.  
  117.     /*************************************************************************/
  118.     /* - parse the user parameters exactly as they were entered by the user. */
  119.     /*************************************************************************/
  120.     pcmd->pUserParms = ParseUserParameters();
  121.     return;
  122.  
  123.    case '/':
  124.    case '-':
  125.  
  126.     switch( tolower(*(pOption + 1)) )
  127.     {
  128.      default:
  129.       ErrorPrintf( ERR_BAD_INVOCATION_OPTION, 1, pOption );
  130.       break;
  131.  
  132.      case 'h':
  133.      case '?':
  134.       /***********************************************************************/
  135.       /* - print the message file help.                                      */
  136.       /***********************************************************************/
  137.       SayMsg(HELP_INVOCATION_SD386);
  138.       break;
  139.  
  140.      case 'p':
  141.       /***********************************************************************/
  142.       /* - TRUE says read the user profile.                                  */
  143.       /***********************************************************************/
  144.       pcmd->Profile = TRUE;
  145.       break;
  146.  
  147.      case 'c':
  148.       /***********************************************************************/
  149.       /* - TRUE says be case sensitive.                                      */
  150.       /***********************************************************************/
  151.       pcmd->CaseSens = TRUE;
  152.       break;
  153.  
  154.      case 'i':
  155.       /***********************************************************************/
  156.       /* - TRUE says stop at the first exe/dll entry point.                  */
  157.       /***********************************************************************/
  158.       pcmd->ShowInit = TRUE;
  159.       break;
  160.  
  161.      case 'f':
  162.       /***********************************************************************/
  163.       /* - 1 ==> start the application in a full screen session.             */
  164.       /***********************************************************************/
  165.       pcmd->SessionType  = SSF_TYPE_FULLSCREEN;
  166.       break;
  167.  
  168.      case 'w':
  169.       /***********************************************************************/
  170.       /* - 2 ==> start the application in a text window.                     */
  171.       /***********************************************************************/
  172.       pcmd->SessionType  = SSF_TYPE_WINDOWABLEVIO;
  173.       break;
  174.  
  175.      case 'k':
  176.       /***********************************************************************/
  177.       /* - TRUE says ignore mouse input and use keyboard only.               */
  178.       /***********************************************************************/
  179.       pcmd->KeyboardOnly = TRUE;
  180.       break;
  181.  
  182.      case 'u':
  183.       /***********************************************************************/
  184.       /* - don't flush the keyboard buffer before getting a keystroke.       */
  185.       /***********************************************************************/
  186.       pcmd->KBDBufferFlush = NOFLUSHALLTIMES;
  187.       break;
  188.  
  189.      case 'm':
  190.       /************************************************************************/
  191.       /* - Use imports or the math shell.                                     */
  192.       /************************************************************************/
  193.       if( strnicmp( pOption+1, "msh", 3 ) == 0 )
  194.       {
  195.        pcmd->DbgFlags.UseMsh  = TRUE;
  196.       }
  197.       else
  198.        pcmd->ResolveImports = TRUE;
  199.       break;
  200.  
  201.      case 'o':
  202.       /***********************************************************************/
  203.       /* - pull off the modem control file name.                             */
  204.       /***********************************************************************/
  205.       pConnection->modem = TRUE;
  206.       pConnection->pModemFile = NULL;
  207.       len = strlen(pOption+2);
  208.       if( len != 0 )
  209.       {
  210.        cp  = Talloc(len+1);
  211.        strcpy(cp,pOption + 2);
  212.        cp[len] = '\0';
  213.        pConnection->pModemFile = cp;
  214.       }
  215.       break;
  216.  
  217.      case 'r':
  218.       /***********************************************************************/
  219.       /* - TRUE says we want to remote debug.                                */
  220.       /* - Parse the bit rate.                                               */
  221.       /* - Set a flag for esp.                                               */
  222.       /***********************************************************************/
  223.       pConnection->ConnectType = ASYNC;
  224.       pConnection->BitRate     = ParseBitRate( *(pOption+2) );
  225.  
  226.       break;
  227.  
  228.      case 'a':
  229.       /***********************************************************************/
  230.       /* - Parse the com port.                                               */
  231.       /***********************************************************************/
  232.       pConnection->ComPort = ParseComPort( *(pOption+2) );
  233.       break;
  234.  
  235.      case 's':
  236.       /***********************************************************************/
  237.       /* - Blow by main.                                                     */
  238.       /***********************************************************************/
  239.       pcmd->NoStopAtMain = TRUE;
  240.       break;
  241.  
  242.      case 'e':
  243.       /***********************************************************************/
  244.       /* - Use DosExecPgm() to start the debuggee.                           */
  245.       /***********************************************************************/
  246.       pcmd->DbgFlags.UseExecPgm   = TRUE;
  247.       break;
  248.  
  249.      case 'b':
  250.       /***********************************************************************/
  251.       /* - Debug the children of the parent debuggee.                        */
  252.       /* - Build a filespec for the name(s) of the children to debug.        */
  253.       /***********************************************************************/
  254.       pcmd->DbgFlags.DebugChild = TRUE;
  255.       pcmd->pChildProcesses     = NULL;
  256.  
  257.       len = strlen(pOption+2);
  258.       if( len != 0 )
  259.       {
  260.        cp = Talloc(strlen(pOption+2) + 1);
  261.        strcpy(cp,strupr(pOption+2));
  262.        pcmd->pChildProcesses = cp;
  263.       }
  264.       else
  265.       {
  266.        ErrorPrintf( ERR_BAD_INVOCATION_OPTION, 1, pOption );
  267.       }
  268.       break;
  269.  
  270.      case '@':
  271.       if( strlen( pOption+1 ) != 1 )
  272.        ErrorPrintf( ERR_BAD_INVOCATION_OPTION, 1, pOption );
  273.       /***********************************************************************/
  274.       /* - turn DosDebug() tracing on.                                       */
  275.       /***********************************************************************/
  276.       pcmd->DbgFlags.DosDebugTrace = TRUE;
  277.       break;
  278.  
  279.      case '+':
  280.       pcmd->DbgFlags.Verbose = TRUE;
  281.       break;
  282.  
  283.      case '!':
  284.       pcmd->DbgFlags.UseDebug  = TRUE;
  285.       break;
  286.  
  287.      case 'n':
  288.       /***********************************************************************/
  289.       /* - connect using netbios.                                            */
  290.       /* - get the logical adapter name.                                     */
  291.       /***********************************************************************/
  292.       pConnection->ConnectType = _NETBIOS;
  293.       len = strlen(pOption+2);
  294.       if( len != 0 )
  295.       {
  296.        if( len > (MAX_LSN_NAME - LSN_RES_NAME) )
  297.         len = MAX_LSN_NAME - LSN_RES_NAME;
  298.        cp = Talloc(len + 1);
  299.        strncpy( cp, pOption+2, len );
  300.        pConnection->pLsnName = cp;
  301.       }
  302.       break;
  303.  
  304.      case 't':
  305.      {
  306.       /***********************************************************************/
  307.       /* - connect using sockets.                                            */
  308.       /***********************************************************************/
  309.       pConnection->ConnectType = SOCKET;
  310.       len = strlen(pOption+2);
  311.       cp  = Talloc(len + 1);
  312.  
  313.       strncpy( cp, pOption+2, len );
  314.  
  315.       pConnection->pLsnName = cp;
  316.      }
  317.      break;
  318.  
  319.      case 'x':
  320.       pcmd->DbgFlags.HotKey = TRUE;
  321.       SetHotKey();
  322.       break;
  323.  
  324.      case '$':
  325.      {
  326.       int    cols;
  327.       int    rows;
  328.  
  329.       VIOMODEINFO md;
  330.  
  331.       sscanf(pOption+2,"%dx%d",&cols, &rows);
  332.  
  333.       memset(&md, 0, sizeof(md));
  334.       md.cb  = sizeof(md);
  335.       VioGetMode(&md, 0);
  336.  
  337.       md.row = rows;
  338.       md.col = cols;
  339.  
  340.       if( VioSetMode(&md, 0) )
  341.       {
  342.        printf("Unable to set mode %dx%d", cols, rows );
  343.        exit(0);
  344.       }
  345.      }
  346.      break;
  347.  
  348.     }
  349.   }
  350.   pOption = strtok(NULL," " );
  351.  }
  352.  while( pOption );
  353.  return;
  354. }
  355.  
  356. /*****************************************************************************/
  357. /* ParseUserParameters                                                       */
  358. /*                                                                           */
  359. /* Description:                                                              */
  360. /*                                                                           */
  361. /*  Get a pointer to the user parameters exactly as they were entered        */
  362. /*  by the user.                                                             */
  363. /*                                                                           */
  364. /* Parameters:                                                               */
  365. /*                                                                           */
  366. /* Return:                                                                   */
  367. /*                                                                           */
  368. /*  pUserParms   -> to allocated block of user parameters.                   */
  369. /*                                                                           */
  370. /* Assumptions:                                                              */
  371. /*                                                                           */
  372. /*****************************************************************************/
  373. char *ParseUserParameters( void )
  374. {
  375.  TIB  *pTib;
  376.  PIB  *pPib;
  377.  char *pCmdInvocation;
  378.  char  UserParms[512];
  379.  char *pUserParms;
  380.  char *cp;
  381.  int   len;
  382.  
  383.  /****************************************************************************/
  384.  /*                                                                          */
  385.  /* Call DosGetInfoBlocks() to get a pointer to command line invocation.     */
  386.  /* We will get a pointer to a block formatted like so:                      */
  387.  /*                                                                          */
  388.  /*   string1\0string2\0\0.                                                  */
  389.  /*                                                                          */
  390.  /*   where:                                                                 */
  391.  /*                                                                          */
  392.  /*     string1=fully qualified invocation such as D:\SOMEDIR\SD386.EXE.     */
  393.  /*     string2=everything entered by the user after string1.                */
  394.  /*                                                                          */
  395.  /****************************************************************************/
  396.  DosGetInfoBlocks(&pTib,&pPib);
  397.  pCmdInvocation = pPib->pib_pchcmd;
  398.  
  399.  /****************************************************************************/
  400.  /* - blow by string1.                                                       */
  401.  /****************************************************************************/
  402.  while ( (*pCmdInvocation++) != '\0'){;}
  403.  
  404.  /****************************************************************************/
  405.  /* - make a local copy of "string2"                                         */
  406.  /* - and, blow by any sd386 invocation options.                             */
  407.  /****************************************************************************/
  408.  memset( UserParms,0,sizeof(UserParms) );
  409.  strcpy(UserParms,pCmdInvocation);
  410.  cp = strtok(UserParms," ");
  411.  while( *cp=='/' || *cp=='-' ) cp=strtok(NULL," ");
  412.  
  413.  /****************************************************************************/
  414.  /* At this point, cp will be pointing to the debuggee program name.         */
  415.  /*                                                                          */
  416.  /* - Blow by the program name.                                              */
  417.  /* - If there are really some parms, then return a pointer to them.         */
  418.  /****************************************************************************/
  419.  while ( (*cp++) != '\0' ){;}
  420.  len = strlen(cp);
  421.  if( len == 0 )
  422.   pUserParms = NULL;
  423.  else
  424.  {
  425.   pUserParms = Talloc(len+1);
  426.   strcpy(pUserParms,cp);
  427.  }
  428.  return(pUserParms);
  429. }
  430. /*****************************************************************************/
  431. /* ParseBitRate                                                              */
  432. /*                                                                           */
  433. /* Description:                                                              */
  434. /*                                                                           */
  435. /*  Get the bit rate for remote debugging.                                   */
  436. /*                                                                           */
  437. /* Parameters:                                                               */
  438. /*                                                                           */
  439. /* Return:                                                                   */
  440. /*                                                                           */
  441. /*  c            user specified bitrate 0-6.                                 */
  442. /*                                                                           */
  443. /* Assumptions:                                                              */
  444. /*                                                                           */
  445. /*****************************************************************************/
  446. int ParseBitRate( char c )
  447. {
  448.  int BitRate;
  449.  
  450.  switch( c )
  451.  {
  452.   case '0':
  453.    BitRate = 300;
  454.    break;
  455.  
  456.   case '1':
  457.    BitRate = 1200;
  458.    break;
  459.  
  460.   case '2':
  461.    BitRate = 2400;
  462.    break;
  463.  
  464.   case '3':
  465.    BitRate = 4800;
  466.    break;
  467.  
  468.   case '4':
  469.    BitRate = 9600;
  470.    break;
  471.  
  472.   case '5':
  473.    BitRate = 19200;
  474.    break;
  475.  
  476.   case '6':
  477.    BitRate = 38400;
  478.    break;
  479.  
  480.   default:
  481.    BitRate = 0;
  482.    break;
  483.  }
  484.  return(BitRate);
  485. }
  486.  
  487. /*****************************************************************************/
  488. /* ParseComPort                                                              */
  489. /*                                                                           */
  490. /* Description:                                                              */
  491. /*                                                                           */
  492. /*  Get the com port to use for remote debugging.                            */
  493. /*                                                                           */
  494. /* Parameters:                                                               */
  495. /*                                                                           */
  496. /*  c            user specified com port 1-4.                                */
  497. /*                                                                           */
  498. /* Return:                                                                   */
  499. /*                                                                           */
  500. /*  ComPort      user specified Com Port 1-4.                                */
  501. /*                                                                           */
  502. /* Assumptions:                                                              */
  503. /*                                                                           */
  504. /*****************************************************************************/
  505. int ParseComPort( char c )
  506. {
  507.  int ComPort;
  508.  
  509.  switch( c )
  510.  {
  511.   case '1':
  512.    ComPort = 1;
  513.    break;
  514.  
  515.   case '2':
  516.    ComPort = 2;
  517.    break;
  518.  
  519.   case '3':
  520.    ComPort = 3;
  521.    break;
  522.  
  523.   case '4':
  524.    ComPort = 4;
  525.    break;
  526.  
  527.   default:
  528.    SayMsg(ERR_COM_PORT_INVALID);
  529.    break;
  530.  }
  531.  return(ComPort);
  532. }
  533.  
  534. /*****************************************************************************/
  535. /* ParseChildInvocationOptions                                               */
  536. /*                                                                           */
  537. /* Description:                                                              */
  538. /*                                                                           */
  539. /*  Parse the invocation line passed to a child debug session from           */
  540. /*  the parent.                                                              */
  541. /*                                                                           */
  542. /* Parameters:                                                               */
  543. /*                                                                           */
  544. /*    argc           number of invocation parameters.                        */
  545. /*    argv        -> to array of ptrs to invocation parameters.              */
  546. /*    pcmd        -> to the structure that will define the invocation parms. */
  547. /*    pConnection -> to the structure that will define the connection parms. */
  548. /*                                                                           */
  549. /* Return:                                                                   */
  550. /*                                                                           */
  551. /* Assumptions:                                                              */
  552. /*                                                                           */
  553. /*****************************************************************************/
  554. void ParseChildInvocationOptions( int         argc,
  555.                                   char       **argv,
  556.                                   CmdParms    *pcmd,
  557.                                   CONNECTION  *pConnection )
  558. {
  559.  char  ParmString[512];
  560.  int   i;
  561.  char *pOption;
  562.  char *cp;
  563.  int   len;
  564.  
  565.  /****************************************************************************/
  566.  /* - set any default options.                                               */
  567.  /****************************************************************************/
  568.  pConnection->DbgOrEsp    = _DBG;
  569.  pConnection->ConnectType = BOUND;
  570.  
  571.  pcmd->DbgFlags.IsParentDbg    = FALSE;
  572.  pcmd->DbgFlags.SingleMultiple = MULTIPLE;
  573.  pcmd->DbgFlags.UseExecPgm     = FALSE;
  574.  
  575.  /****************************************************************************/
  576.  /* - Build a string of tokens delimited by a single blank.                  */
  577.  /****************************************************************************/
  578.  ParmString[0] = '\0';
  579.  for( i=1 ; i<argc; i++)
  580.  {
  581.   strcat(ParmString,argv[i]);
  582.   strcat(ParmString," ");
  583.  }
  584.  strcat(ParmString,"\0");
  585.  
  586.  /****************************************************************************/
  587.  /* - Now, parse the SD386 invocation options.                               */
  588.  /*   At this point, the case where argc==1 has already been handled.        */
  589.  /****************************************************************************/
  590.  pOption = strtok(ParmString," ");
  591.  do
  592.  {
  593.   switch( *pOption )
  594.   {
  595.  
  596.    default:
  597.     break;
  598.  
  599.    case '/':
  600.    case '-':
  601.  
  602.     switch( tolower(*(pOption + 1)) )
  603.     {
  604.      default:
  605.       break;
  606.  
  607.      case 'p':
  608.       /***********************************************************************/
  609.       /* - TRUE says read the user profile.                                  */
  610.       /***********************************************************************/
  611.       pcmd->Profile = TRUE;
  612.       break;
  613.  
  614.      case 'c':
  615.       /***********************************************************************/
  616.       /* - TRUE says be case sensitive.                                      */
  617.       /* - handle the /child= option which MUST be argv[1];                  */
  618.       /***********************************************************************/
  619.       if( strlen( pOption+1 ) == 1 )
  620.        pcmd->CaseSens = TRUE;
  621.       else if( strstr( pOption+1, "child" ) )
  622.        pcmd->ProcessID = atoi( strchr( argv[1], '=' ) + 1 );
  623.       break;
  624.  
  625.      case 'i':
  626.       /***********************************************************************/
  627.       /* - TRUE says stop at the first exe/dll entry point.                  */
  628.       /***********************************************************************/
  629.       pcmd->ShowInit = TRUE;
  630.       break;
  631.  
  632.      case 'k':
  633.       /***********************************************************************/
  634.       /* - TRUE says ignore mouse input and use keyboard only.               */
  635.       /***********************************************************************/
  636.       pcmd->KeyboardOnly = TRUE;
  637.       break;
  638.  
  639.      case 'u':
  640.       /***********************************************************************/
  641.       /* - don't flush the keyboard buffer before getting a keystroke.       */
  642.       /***********************************************************************/
  643.       pcmd->KBDBufferFlush = NOFLUSHALLTIMES;
  644.       break;
  645.  
  646.      case 'm':
  647.       /***********************************************************************/
  648.       /* - TRUE says display imported variables.                             */
  649.       /***********************************************************************/
  650.       pcmd->ResolveImports = TRUE;
  651.       break;
  652.  
  653.      case 's':
  654.       /***********************************************************************/
  655.       /* - Blow by main and                                                  */
  656.       /* - Set the shared heap memory handle.                                */
  657.       /***********************************************************************/
  658.       if( strlen( pOption+1 ) == 1 )
  659.        pcmd->NoStopAtMain = TRUE;
  660.       else if( strstr( pOption+1, "shr" ) )
  661.       {
  662.        ULONG *pshrmem;
  663.  
  664.        pshrmem = (ULONG*)atol( strchr( pOption+1, '=' ) + 1 );
  665.        SetShrMem( pshrmem );
  666.       }
  667.       break;
  668.  
  669.      case 'q':
  670.       /***********************************************************************/
  671.       /* - Set the queue name for sending messages.                          */
  672.       /***********************************************************************/
  673.       if( strstr( pOption+1, "qname" ) )
  674.       {
  675.        char *pQueName;
  676.  
  677.        pQueName = strchr( pOption+1, '=' ) + 1 ;
  678.        SetDbgQueName( pQueName );
  679.       }
  680.       break;
  681.  
  682.      case 'h':
  683.       /***********************************************************************/
  684.       /* - Set the start address of the shared heap.                         */
  685.       /***********************************************************************/
  686.       if( strstr( pOption+1, "heap" ) )
  687.       {
  688.        ULONG *heap;
  689.  
  690.        heap = (ULONG*)atol( strchr( pOption+1, '=' ) + 1 );
  691.        SetShrHeap( heap );
  692.       }
  693.       else if( strstr( pOption+1, "handle" ) )
  694.       {
  695.        pcmd->handle = (LHANDLE)atol( strchr( pOption+1, '=' ) + 1 );
  696.       }
  697.       break;
  698.  
  699.      case 'r':
  700.       /***********************************************************************/
  701.       /* - TRUE says we want to remote debug.                                */
  702.       /* - Parse the bit rate.                                               */
  703.       /* - Set a flag for esp.                                               */
  704.       /***********************************************************************/
  705.       pConnection->ConnectType = ASYNC;
  706.       break;
  707.  
  708.      case 'n':
  709.       /***********************************************************************/
  710.       /* - connect using netbios.                                            */
  711.       /* - get the logical adapter name.                                     */
  712.       /***********************************************************************/
  713.       pConnection->ConnectType = _NETBIOS;
  714.       len = strlen(pOption+2);
  715.       if( len != 0 )
  716.       {
  717.        if( len > (MAX_LSN_NAME - LSN_RES_NAME) )
  718.         len = MAX_LSN_NAME - LSN_RES_NAME;
  719.        cp = Talloc(len + 1);
  720.        strncpy( cp, pOption+2, len );
  721.        pConnection->pLsnName = cp;
  722.       }
  723.       break;
  724.  
  725.      case 't':
  726.      {
  727.       /***********************************************************************/
  728.       /* - connect using sockets.                                            */
  729.       /***********************************************************************/
  730.       pConnection->ConnectType = SOCKET;
  731.       len = strlen(pOption+2);
  732.       cp  = Talloc(len + 1);
  733.  
  734.       strncpy( cp, pOption+2, len );
  735.  
  736.       pConnection->pLsnName = cp;
  737.      }
  738.      break;
  739.  
  740.      case '+':
  741.       pcmd->DbgFlags.Verbose = TRUE;
  742.       break;
  743.  
  744.      case 'e':
  745.       /***********************************************************************/
  746.       /* - DosExecPgm() was used to start the parent. This is inherited      */
  747.       /*   from the parent debug session.                                    */
  748.       /***********************************************************************/
  749.       pcmd->DbgFlags.UseExecPgm = TRUE;
  750.       break;
  751.  
  752.     }
  753.   }
  754.   pOption = strtok(NULL," " );
  755.  }
  756.  while( pOption );
  757.  
  758.  /****************************************************************************/
  759.  /* - After parsing the child options, if the connection type is bound       */
  760.  /*   then we're debugging multiple processes on a single machine and        */
  761.  /*   the connection type has to be local pipe.                              */
  762.  /****************************************************************************/
  763.  if(  pConnection->ConnectType == BOUND )
  764.   pConnection->ConnectType = LOCAL_PIPE;
  765.  
  766.  return;
  767. }
  768.