This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

Re: [commit] fix for "info threads" printing multiple headers


Tom Tromey wrote:
"Pedro" == Pedro Alves <pedro@codesourcery.com> writes:

Pedro> Thanks! A few comments below. If you don't want to Pedro> fix these, I'll try to find a bit later on myself.

Pedro> - get_number_or_range mantains an internal state machine
Pedro> using static variables.  I think that as long as you
Pedro> always pass in the same list string, and the list spec
Pedro> string is correctly formed, you're not hitting stale
Pedro> state inside get_number_or_range.  It'd be nicer
Pedro> if get_number_or_range (or a variant which get_number_or_range
Pedro> would then be implemented on top of) took an additional
Pedro> struct pointer that pointed to a struct that held
Pedro> all the currently static state.

I almost did this when moving stuff to cli-utils, but decided against it
on the basis of least change.

If Michael doesn't want to implement this, I'd be happy to.
Just let me know.

Seems like it would only be useful if the function had to be thread safe.




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