Branch: Tag:

2018-11-29

2018-11-29 21:38:41 by William Welliver <william@welliver.org>

debugger: when debugger is enabled, pike will wait for a time for a debugger to connect.

3637:    return v;   };    - void load_debugger() { + void load_debugger(int wait_seconds) {    set_debugger(1);    // load the debugger support    function d;
3660:    throw(d);    }    debugger = d(); -  debugger->load_breakpoint(); +  debugger->load_breakpoint(wait_seconds);   }      //! This function is called when all the driver is done with all setup
3710:       Version cur_compat_ver;    +  int have_debugger = 0; +  int debugger_wait = 5; // 5 seconds by default +     if(sizeof(argv)>1 && sizeof(argv[1]) && argv[1][0]=='-')    {    array q;
3741:    ({"assembler_debug",MAY_HAVE_ARG, ({"--assembler-debug"}), 0, 0}),    ({"optimizer_debug",MAY_HAVE_ARG, ({"--optimizer-debug"}), 0, 0}),    ({"debugger", MAY_HAVE_ARG, ({"--debugger"}), 0, 1}), +  ({"debugger_wait", HAS_ARG, ({"--debugger-wait"}), 0, 1}),    ({"debug", MAY_HAVE_ARG, ({"--debug"}), 0, 1}),    ({"trace", MAY_HAVE_ARG, ({"--trace"}), 0, 1}),    ({"ignore", MAY_HAVE_ARG, ({"-Dqdatplr"}), 0, 1}),
3796:    debug+=(int)q[i][1];    break;    case "debugger": -  load_debugger(); -  set_debugger(1); +  have_debugger = 1;    break; -  +  case "debugger_wait": +  debugger_wait = (int)q[i][1]; +  break;    case "trace":    trace+=(int)q[i][1];    break;
3837:    }    }    +  if(have_debugger) { +  load_debugger(debugger_wait); +  set_debugger(1); +  } +     cur_compat_ver = Version (compat_major, compat_minor);    if (cur_compat_ver < lowestcompat)    {