This is the mail archive of the gdb@sources.redhat.com 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]

[rfc/breakpoint] breakpoint_1() re-structure


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



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