X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Flinespec.c;h=ac7d34dfe96f898e74a534fad79324a3a6004932;hb=268a13a5a3f7c6b9b6ffc5ac2d1b24eb41f3fbdc;hp=f418e03b774531a8af0b0c16090f378b4fad3e81;hpb=94aeb44b001ab2d632806242a3bacb0a879abe15;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/linespec.c b/gdb/linespec.c index f418e03b77..ac7d34dfe9 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -44,8 +44,8 @@ #include "ada-lang.h" #include "stack.h" #include "location.h" -#include "common/function-view.h" -#include "common/def-vector.h" +#include "gdbsupport/function-view.h" +#include "gdbsupport/def-vector.h" #include /* An enumeration of the various things a user might attempt to @@ -555,7 +555,7 @@ copy_token_string (linespec_token token) const char *str, *s; if (token.type == LSTOKEN_KEYWORD) - return gdb::unique_xmalloc_ptr (xstrdup (LS_TOKEN_KEYWORD (token))); + return make_unique_xstrdup (LS_TOKEN_KEYWORD (token)); str = LS_TOKEN_STOKEN (token).ptr; s = remove_trailing_whitespace (str, str + LS_TOKEN_STOKEN (token).length); @@ -760,7 +760,9 @@ linespec_lexer_lex_string (linespec_parser *parser) /* Do not tokenize ABI tags such as "[abi:cxx11]". */ else if (PARSER_STREAM (parser) - start > 4 && startswith (PARSER_STREAM (parser) - 4, "[abi")) - ++(PARSER_STREAM (parser)); + { + /* Nothing. */ + } /* Do not tokenify if the input length so far is one (i.e, a single-letter drive name) and the next character @@ -861,6 +863,7 @@ linespec_lexer_lex_string (linespec_parser *parser) } /* Advance the stream. */ + gdb_assert (*(PARSER_STREAM (parser)) != '\0'); ++(PARSER_STREAM (parser)); } } @@ -3318,8 +3321,7 @@ decode_line_with_last_displayed (const char *string, int flags) ? decode_line_1 (location.get (), flags, NULL, get_last_displayed_symtab (), get_last_displayed_line ()) - : decode_line_1 (location.get (), flags, NULL, - (struct symtab *) NULL, 0)); + : decode_line_1 (location.get (), flags, NULL, NULL, 0)); if (*string) error (_("Junk at end of line specification: %s"), string); @@ -4099,7 +4101,7 @@ decode_digits_list_mode (struct linespec_state *self, val.symtab = elt; val.pspace = SYMTAB_PSPACE (elt); val.pc = 0; - val.explicit_line = 1; + val.explicit_line = true; add_sal_to_sals (self, &values, &val, NULL, 0); } @@ -4133,6 +4135,7 @@ decode_digits_ordinary (struct linespec_state *self, sal.pspace = SYMTAB_PSPACE (elt); sal.symtab = elt; sal.line = line; + sal.explicit_line = true; sal.pc = pc; sals.push_back (std::move (sal)); }