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: [RFA] decode_line_spec_* cleanup


>>>>> "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


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