#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 <algorithm>
/* An enumeration of the various things a user might attempt to
const char *str, *s;
if (token.type == LSTOKEN_KEYWORD)
- return gdb::unique_xmalloc_ptr<char> (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);
/* 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
}
/* Advance the stream. */
+ gdb_assert (*(PARSER_STREAM (parser)) != '\0');
++(PARSER_STREAM (parser));
}
}
symbol_name_match_type match_type)
{
linespec_token token;
- struct gdb_exception file_exception = exception_none;
+ struct gdb_exception file_exception;
/* A special case to start. It has become quite popular for
IDEs to work around bugs in the previous parser by quoting
= symtabs_from_filename (user_filename.get (),
PARSER_STATE (parser)->search_pspace);
}
- catch (const gdb_exception_error &ex)
+ catch (gdb_exception_error &ex)
{
- file_exception = ex;
+ file_exception = std::move (ex);
}
if (file_exception.reason >= 0)
/* The linespec didn't parse. Re-throw the file exception if
there was one. */
if (file_exception.reason < 0)
- throw_exception (file_exception);
+ throw_exception (std::move (file_exception));
/* Otherwise, the symbol is not found. */
symbol_not_found_error (PARSER_EXPLICIT (parser)->function_name,
? 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);
\f
-/* First, some functions to initialize stuff at the beggining of the
+/* First, some functions to initialize stuff at the beginning of the
function. */
static void
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);
}
return values;
}
-/* A helper for create_sals_line_offset that iterates over the symtabs,
- adding lines to the VEC. */
+/* A helper for create_sals_line_offset that iterates over the symtabs
+ associated with LS and returns a vector of corresponding symtab_and_line
+ structures. */
static std::vector<symtab_and_line>
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));
}