This is the mail archive of the gdb@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: mi_load_progress question


 > I am pretty sure that there was a bug report about this before, but I
 > can't find it now.  Ah, here:
 > 
 > http://sourceware.org/ml/gdb-patches/2005-11/msg00295.html
 > 
 > No one else commented at the time and I opted to stick with what we
 > already had.  Do you think we should just turn the progress reporting
 > back on for -i=mi2?  How about you, Nick?

I have no experience with remote debugging, so I can only suggest that it's
consistent i.e have progress reporting for all cases or turn it off completely
(I don't know how useful it is or why it should only exist in MI).

 > > Looking through the change history, other values didn't exist when the
 > > original code was written.  So I guess it's not desired behaviour.
 > > 
 > >  if (current_interp_named_p (INTERP_MI1))
 > >    uiout = mi_out_new (1);
 > >  else if (current_interp_named_p (INTERP_MI)
 > > 	  || current_interp_named_p (INTERP_MI2))
 > >    uiout = mi_out_new (2);
 > >  else if (current_interp_named_p (INTERP_MI3))
 > >    uiout = mi_out_new (3);
 > >  else
 > >    return;
 > > 
 > > would work (until new MI levels are introduced!).  It would be best to generalise
 > > this and similar code to make it future proof.
 > 
 > Or come up with some other way to do this that avoids the need for the
 > hack.  The problem was that we were calling the MI load progress hook
 > through the wrong interpreter.  We need to figure out how to do this
 > right.
 >
 > First question: Should typing "load" at the MI prompt issue +download
 > updates?  Currently it does.  It also issues the CLI's updates.
 > 
 > Second question: Should typing "-interpreter-exec console load" issue
 > +download updates?  Currently it does the same as "load" and
 > that's the right thing to do so this is the same as the first question.

If the answer is yes, I suggest something like the patch below.  Unless I'm
missing something mi_load_progress only gets called in MI.  I would like to
make similar but more fiddly changes to mi-interp.c, removing
mi`N'_command_loop, N = 1,2,3, and just using mi_command_loop.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


*** mi-main.c	13 May 2006 16:42:07 +1200	1.84
--- mi-main.c	13 Jul 2006 18:41:37 +1200	
*************** mi_load_progress (const char *section_na
*** 1386,1397 ****
       of this function.  */
    saved_uiout = uiout;
  
!   if (current_interp_named_p (INTERP_MI))
!     uiout = mi_out_new (2);
!   else if (current_interp_named_p (INTERP_MI1))
!     uiout = mi_out_new (1);
!   else
!     return;
  
    update_threshold.tv_sec = 0;
    update_threshold.tv_usec = 500000;
--- 1386,1392 ----
       of this function.  */
    saved_uiout = uiout;
  
!   uiout = mi_out_new (mi_version (uiout));
  
    update_threshold.tv_sec = 0;
    update_threshold.tv_usec = 500000;


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