Tom> http://sourceware.org/ml/gdb-patches/2008-08/msg00525.html Ulrich> Ah, I'd forgotten about that thread. I'll have a look at the Ulrich> above patch. Thanks! Ulrich> In fact, I'm wondering if it wouldn't be nicer to also have something Ulrich> like a get_default_print_options function instead of refering to the Ulrich> user_print_options global in the top-level printing routines ... I implemented this, and I fixed the other problems you mentioned. The result is appended. I still haven't tested this or written a ChangeLog entry. This version reduces the use of user_print_options to the absolute minimum. I don't think this is notably cleaner, but the difference isn't extreme. If we cared, we could make it mildly less ugly by having get_user_print_options return its argument. I still have a version of the patch without get_user_print_options in case you change your mind on this. Doing this did point out a couple things: * As you mentioned, breakpoint-printing could probably use a small refactoring to give value_print_options arguments to various methods. I can do this and roll it into this patch if you want; though my first reaction is to leave it as a follow-up patch (or just not do it). Let me know what you want. * print_scalar_formatted probably needs an options argument as well. What do you think? This worries me a little since it is another 47 call sites; so it could make the patch even bigger. Maybe this ought to be a follow-up. Ulrich> OK, I'm fine with this. However, this means that we'll really have Ulrich> to construct the option struct on the fly, we cannot have a global Ulrich> struct hold pre-initialized pointers to current_language etc. There's always "GCC style": #define current_language user_print_options.language Semi-awful. Or just s/current_language/user_print_options.current_language/ everywhere. This, IMO, is not terrible, aside from its verbosity. This is related to Joel's patch and to Daniel's question about a policy for access to globals. Before going too far down this road it may be worth coming up with an agreement there. To sum up, once I know how much more I should do, I will implement it and then submit the patch for real. I am not looking forward to writing this ChangeLog entry... Tom