This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: tracing broken if target doesn't do disconnected tracing


Pedro Alves wrote:

I suggest we change that to simply:

  /* If running interactively, warn the user a trace run is ongoing.
     She may want to cancel detaching instead.  */
    if (current_trace_status ()->running && from_tty)
      {
        if (current_trace_status ()->disconnected_tracing)
          {
            if (!query (_("Trace is running and will continue after detach; detach anyway? ")))
              error (_("Not confirmed."));
          }
        else
          {
            if (!query (_("Trace is running but will stop on detach; detach anyway? ")))
             error (_("Not confirmed."));
          }
      }

- simpler, more coherent, less explaining, less confusing.

The downside of this design is that if you did want to shut tracing down, you have to cancel the detach, do a tstop, then redo the detach. It's not crucial perhaps, but it seems a bit pedantic for GDB to have the power to choose whether to keep the trace running, but not to exercise it, and to insist that you have cancel and type the command yourself. Perhaps the crux of the confusion is that this is really a three-way choice - trace/detach, tstop/detach, cancel - and a pair of yes/no questions is not a good way to model it.


Stan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]