This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] decode_line_spec_* cleanup
- From: Tom Tromey <tromey at redhat dot com>
- To: dje at google dot com (Doug Evans)
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 28 Jun 2012 15:00:53 -0600
- Subject: Re: [RFA] decode_line_spec_* cleanup
- References: <20120628195537.3B6D01E13A1@ruffy2.mtv.corp.google.com>
>>>>> "Doug" == Doug Evans <dje@google.com> writes:
Doug> First: Yes, I know these function names are really long :-).
Yeah. I think they make the code harder to read.
Doug> I'm happy to change them, but decode_line_spec and decode_line_spec_1
Doug> just don't work for me.
I think "spec" and "as_default" don't add much value. Then you would
have decode_line_with_current_source and
decode_line_with_last_displayed. That is better but still on the long
side. Perhaps "with" is also not needed.
Another approach would be to separate the defaults-getting from
decode_line in general.
Doug> +struct symtabs_and_lines
Doug> +decode_line_spec_with_current_source_as_default (char *string, int flags)
Doug> +{
[...]
Doug> + /* We use whatever is set as the current source line. We do not try
Doug> + and get a default or it will recursively call us! */
Doug> + cursal = get_current_source_symtab_and_line ();
This seems a little weird since this is already the default.
In a way this makes the "with_current_source_as_default" more confusing,
since that does not actually name the difference between this function
and decode_line_1.
Tom