#include "stack.h"
#include "location.h"
#include "common/function-view.h"
+#include "common/def-vector.h"
/* An enumeration of the various things a user might attempt to
complete for a linespec location. */
if (i != IF_KEYWORD_INDEX)
{
p += len;
- p = skip_spaces_const (p);
+ p = skip_spaces (p);
for (j = 0; linespec_keywords[j] != NULL; ++j)
{
int nextlen = strlen (linespec_keywords[j]);
{
if (isspace (*PARSER_STREAM (parser)))
{
- p = skip_spaces_const (PARSER_STREAM (parser));
+ p = skip_spaces (PARSER_STREAM (parser));
/* When we get here we know we've found something followed by
a space (we skip over parens and templates below).
So if we find a keyword now, we know it is a keyword and not,
if (parser->lexer.current.type == LSTOKEN_CONSUMED)
{
/* Skip any whitespace. */
- PARSER_STREAM (parser) = skip_spaces_const (PARSER_STREAM (parser));
+ PARSER_STREAM (parser) = skip_spaces (PARSER_STREAM (parser));
/* Check for a keyword, they end the linespec. */
keyword = linespec_lexer_lex_keyword (PARSER_STREAM (parser));
{
if (*PARSER_STREAM (parser) == ' ')
{
- parser->completion_word = skip_spaces_const (PARSER_STREAM (parser) + 1);
+ parser->completion_word = skip_spaces (PARSER_STREAM (parser) + 1);
parser->complete_what = next;
}
else
if (ptr[i] == ' ')
{
LS_TOKEN_STOKEN (token).length = i;
- PARSER_STREAM (parser) = skip_spaces_const (ptr + i + 1);
+ PARSER_STREAM (parser) = skip_spaces (ptr + i + 1);
break;
}
}
create_sals_line_offset (struct linespec_state *self,
linespec_p ls)
{
- struct symtab_and_line val;
int use_default = 0;
- init_sal (&val);
-
/* This is where we need to make sure we have good defaults.
We must guarantee that this section of code is never executed
when we are called with just a function name, since
use_default = 1;
}
+ symtab_and_line val;
val.line = ls->explicit_loc.line_offset.offset;
switch (ls->explicit_loc.line_offset.sign)
{
else
{
struct linetable_entry *best_entry = NULL;
- int *filter;
- const struct block **blocks;
int i, j;
std::vector<symtab_and_line> intermediate_results
above, we see if there are other PCs that are in the same
block. If yes, the other PCs are filtered out. */
- filter = XNEWVEC (int, intermediate_results.size ());
- struct cleanup *cleanup = make_cleanup (xfree, filter);
- blocks = XNEWVEC (const struct block *, intermediate_results.size ());
- make_cleanup (xfree, blocks);
+ gdb::def_vector<int> filter (intermediate_results.size ());
+ gdb::def_vector<const block *> blocks (intermediate_results.size ());
for (i = 0; i < intermediate_results.size (); ++i)
{
add_sal_to_sals (self, &values, &intermediate_results[i],
sym ? SYMBOL_NATURAL_NAME (sym) : NULL, 0);
}
-
- do_cleanups (cleanup);
}
if (values.empty ())
advances past a keyword automatically, so skip it
manually. */
parser->completion_word
- = skip_spaces_const (skip_to_space_const (PARSER_STREAM (parser)));
+ = skip_spaces (skip_to_space (PARSER_STREAM (parser)));
parser->complete_what = linespec_complete_what::EXPRESSION;
}
pcs = find_pcs_for_symtab_line (elt, line, best_entry);
for (CORE_ADDR pc : pcs)
{
- struct symtab_and_line sal;
-
- init_sal (&sal);
+ symtab_and_line sal;
sal.pspace = SYMTAB_PSPACE (elt);
sal.symtab = elt;
sal.line = line;
{
if (SYMBOL_CLASS (sym) == LOC_LABEL && SYMBOL_VALUE_ADDRESS (sym) != 0)
{
- init_sal (result);
+ *result = {};
result->symtab = symbol_symtab (sym);
result->line = SYMBOL_LINE (sym);
result->pc = SYMBOL_VALUE_ADDRESS (sym);
else if (SYMBOL_LINE (sym) != 0)
{
/* We know its line number. */
- init_sal (result);
+ *result = {};
result->symtab = symbol_symtab (sym);
result->line = SYMBOL_LINE (sym);
result->pspace = SYMTAB_PSPACE (result->symtab);