Re: [PATCH 3/3] gdb/objfiles: use filtered_iterator as objfile::section_iterator

Tom Tromey
2025-08-29T13:43:05Z

>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> objfile::section_iterator looks like a good candidate to be implemented
Simon> with filtered_iterator. Following the enhancements to filtered_iterator
Simon> in the previous patch, it's pretty straighforward.

Simon> I removed the non-const version of objfile::sections, because it didn't
Simon> seem useful to have the two methods returning the exact same type and
Simon> value. Having just the const version achieves the same thing.

I would have thought the const one would return a const iterator and not
allow modifications to the underlying objects.

Anyway if it didn't then that's just some pre-existing bug, probably not
too important.

Approved-By: Tom Tromey <tom@tromey.com>

Tom