On 03/09/2012 12:26 AM, Pedro Alves wrote: >> > - remove downloaded tracepoint in target when failed to install, > We should also check what happens when we do "enable TRACEPOINT_FOO", and > that tracepoints fails to be likewise inserted. Following this direction, > we should make sure it stays disabled in the target, but _not_ deleted. > AFAIK, tracepoint is not inserted when "enable tracepoint", so we don't have to worry about the fails of inserting tracepoints in "enable tracepoint". Tracepoints are downloaded and installed in QTDP or QTStart. For QTenable/QTDisable, it simply changes the flag `enable' in tracepoint. Of course, we may get fails during QTenable/QTDisable, but fails are not caused by inserting/installing tracepoint. >> > +/* Remove TPOINT from global list. */ >> > + >> > +static void >> > +remove_tracepoint (struct tracepoint *tpoint) >> > +{ >> > + struct tracepoint *tp, *tp_prev; >> > + >> > + for (tp = tracepoints, tp_prev = NULL; tp && tp != tpoint; >> > + tp_prev = tp, tp = tp->next) >> > + ; >> > + >> > + if (tp) >> > + { >> > + if (tp_prev) >> > + tp_prev->next = tp->next; >> > + else >> > + tracepoints->next = tp->next; > > This doesn't look correct. If there's no tp_prev, then TP must be > TRACEPOINTS, and so you need to do 'tracepoints = tp->next;'. > Oops, sorry. I should stop coding at mid-night. Fixed. Regression tested on x86_64-linux. Committed. http://sourceware.org/ml/gdb-cvs/2012-03/msg00146.html -- Yao (齐尧)