This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFC/RFA] add struct parse_context to all command functions
- From: Tom Tromey <tromey at redhat dot com>
- To: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- Cc: brobecker at adacore dot com (Joel Brobecker), gdb-patches at sourceware dot org
- Date: Tue, 28 Oct 2008 11:50:45 -0600
- Subject: Re: [RFC/RFA] add struct parse_context to all command functions
- References: <200810281624.m9SGOxVt015677@d12av02.megacenter.de.ibm.com>
- Reply-to: Tom Tromey <tromey at redhat dot com>
>>>>> "Ulrich" == Ulrich Weigand <uweigand@de.ibm.com> writes:
Ulrich> This is OK, thanks!
Thanks -- I checked it in.
Ulrich> - As all the top-level val_print callers set deref_ref to 1, maybe the
Ulrich> default user_print_options should have that value, making most (all?)
Ulrich> of the explicit opts.deref_ref = 1 statements obsolete.
Ulrich> - Maybe the "size" argument (to the print_formatted routines) should
Ulrich> also move into the struct, together with "format"?
I'll look at these two.
Ulrich> - In some cases (e.g. print_subexp_standard) you have multiple instances
Ulrich> within the same function where a local "opts" variable is created;
Ulrich> maybe it would be clearer to have a common "opts" initialized once
Ulrich> for the whole function?
In a long function, like print_subexp_standard, I find it clearer to
have variables declared as locally as possible, because it is simpler
to see all the code referencing the local at once.
Tom