This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v6 7/9] Explicit locations: add UI features for CLI
- From: Doug Evans <xdje42 at gmail dot com>
- To: Keith Seitz <keiths at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 11 Aug 2015 14:49:55 -0700
- Subject: Re: [PATCH v6 7/9] Explicit locations: add UI features for CLI
- Authentication-results: sourceware.org; auth=none
- References: <m3r3nbc4na dot fsf at sspiff dot org> <1439325928-4723-1-git-send-email-keiths at redhat dot com>
Keith Seitz <keiths@redhat.com> writes:
> Doug Evans <dje@google.com> writes:
>> Keith Seitz <keiths@redhat.com> writes:
>>
>>> + else
>>> + {
>>> + /* Handle numbers first, stopping at the next whitespace or ','. */
>>> + while (isdigit (*inp[0]))
>>> + ++(*inp);
>>> + if (*inp[0] == '\0' || isspace (*inp[0]) || *inp[0] == ',')
>>> + return savestring (start, *inp - start);
>>> +
>>> + /* Otherwise stop at the next occurrence of "SPACE -", '\0',
>>> + keyword, or ','. */
>>
>>> This comment needs updating (right?).
>
> Yes, indeed! As you've identified, the code now stops at any whitespace
> instead of "SPACE -". Fixsd.
>
>> I have checked in the temp fix for 17960 so the "if {0}" can be removed.
>
> Excellent. I have rebased and verified that all tests pass (and they do!).
>
> For the record, this is the final version I plan on committing/pushing.
>
> gdb/ChangeLog:
>
> * completer.c: Include location.h.
> (enum match_type): New enum.
> (location_completer): Rename to ...
> (linespec_completer): ... this.
> (collect_explicit_location_matches, backup_text_ptr)
> (explicit_location_completer): New functions.
> (location_completer): "New" function; handle linespec
> and explicit location completions.
> (complete_line_internal): Remove all location completer-specific
> handling.
> * linespec.c (linespec_lexer_lex_keyword, is_ada_operator)
> (find_toplevel_char): Export.
> (linespec_parse_line_offset): Export.
> Issue error if STRING is not numerical.
> (gdb_get_linespec_parser_quote_characters): New function.
> * linespec.h (linespec_parse_line_offset): Declare.
> (get_gdb_linespec_parser_quote_characters): Declare.
> (is_ada_operator): Declare.
> (find_toplevel_char): Declare.
> (linespec_lexer_lex_keyword): Declare.
> * location.c (explicit_to_event_location): New function.
> (explicit_location_lex_one): New function.
> (string_to_explicit_location): New function.
> (string_to_event_location): Handle explicit locations.
> * location.h (explicit_to_event_location): Declare.
> (string_to_explicit_location): Declare.
>
> gdb/testsuite/ChangeLog:
>
> * gdb.linespec/3explicit.c: New file.
> * gdb.linespec/cpexplicit.cc: New file.
> * gdb.linespec/cpexplicit.exp: New file.
> * gdb.linespec/explicit.c: New file.
> * gdb.linespec/explicit.exp: New file.
> * gdb.linespec/explicit2.c: New file.
> * gdb.linespec/ls-errs.exp: Add explicit location tests.
> * lib/gdb.exp (capture_command_output): Regexp-escape `command'
> before using in the matching pattern.
> Clarify that `prefix' is a regular expression.
LGTM