[rfc/breakpoint] breakpoint_1() re-structure

Andrew Cagney ac131313@cygnus.com
Wed Jun 13 13:20:00 GMT 2001


Hello,

As part of finalizing MI I need to restructure the function 
breakpoints.c:breakpoint_1().

At present it looks roughly like:

	open table

	for breakpoints do

		if !printable breakpoint
			continue
		if first printable breakpoint
			print table header
		print breakpoint

	if no printable breakpoints
		do some stuff

	close breakpoint

I'd like to change it to be roughly:

	for breakpoints do
		if printable
			number of breakpoints ++

	open table (number of breakpoints)

	print table header (where needed)

	for breakpoints do
		if printable
			print breakpoint

	close breakpoint table

This means that the code gains an extra for loop (O(2N) instead of 
O(N)).  I can't see that being a problem, however, I'd like to first be 
certain no one is going to raise an eyebrow.

	Andrew




More information about the Gdb mailing list