This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFC: make thread_list static
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Pedro> This was after getting sick of writing callback-style iterators
Pedro> in the itsets run-control work, and introducing the macro there
Pedro> first. This isn't different from ALL_OBJFILES and several other
Pedro> similar macros in the tree (which I realize from this that you'd
Pedro> rather remove). We could switch to callback-style before pushing
Pedro> those patches in, but, IMO, the convenience and readability of
Pedro> the resulting code trumps the implementation detail exposure
Pedro> detail.
Ok. I won't put it in.
FWIW -- I am not really a fan of the callback style. It is too verbose,
usually requiring a new struct and marshalling and unmarshalling, which
means more places to forget something.
But, I'm also not a fan of the ALL_* macro approach. I think it
obscures the code.
On the whole I'd prefer iterator objects along the lines of
dictionary.h. These are a mild pain since in C the iterator object has
to be fully visible, but some discipline and/or field-uglification
approaches can deal with that adequately.
Tom