[rfc] ui_out_is_mi_like_p(); Was: [patch] Add -i=mi0 as an interpreter

Andrew Cagney ac131313@cygnus.com
Wed Jul 4 15:34:00 GMT 2001


> Most of it is straight forward.  The 
>> nasty bit is where I s/strcmp/strncmp/ in breakpoint.c and infrun.c. 
> 
> 
> Why can't this strncmp be done in one place and then saved in some
> variable?  If you do need to use strncmp all over the place, then I
> can't say I care to see the magical constants "mi" and 2 every time
> you do ;-)


The attached patch replaces:

> ! 	  if (interpreter_p && strncmp (interpreter_p, "mi", 2) == 0)
> 

with:

	if (ui_out_is_mi_like_p (uiout))

it addresses the immedate concern and creates a name so horrible that no 
one will want to use it :-)

	Andrew


More information about the Gdb-patches mailing list