const linetable_entry **best_entry);
static std::vector<symtab_and_line> decode_digits_list_mode
- (struct linespec_state *self,
- linespec *ls,
- struct symtab_and_line val);
+ (linespec_state *self, linespec *ls, int line);
static void minsym_found (struct linespec_state *self, struct objfile *objfile,
struct minimal_symbol *msymbol,
use_default = true;
}
- symtab_and_line val;
- val.line = ls->explicit_loc.line_offset.offset;
+ int line = ls->explicit_loc.line_offset.offset;
+
switch (ls->explicit_loc.line_offset.sign)
{
case LINE_OFFSET_PLUS:
if (ls->explicit_loc.line_offset.offset == 0)
- val.line = 5;
+ line = 5;
if (use_default)
- val.line = self->default_line + val.line;
+ line = self->default_line + line;
break;
case LINE_OFFSET_MINUS:
if (ls->explicit_loc.line_offset.offset == 0)
- val.line = 15;
+ line = 15;
if (use_default)
- val.line = self->default_line - val.line;
+ line = self->default_line - line;
else
- val.line = -val.line;
+ line = -line;
break;
case LINE_OFFSET_NONE:
std::vector<symtab_and_line> values;
if (self->list_mode)
- values = decode_digits_list_mode (self, ls, val);
+ values = decode_digits_list_mode (self, ls, line);
else
{
const linetable_entry *best_entry = NULL;
bool was_exact = true;
std::vector<symtab_and_line> intermediate_results
- = decode_digits_ordinary (self, ls, val.line, &best_entry);
+ = decode_digits_ordinary (self, ls, line, &best_entry);
if (intermediate_results.empty () && best_entry != NULL)
{
was_exact = false;
&& sym != nullptr
&& sym->loc_class () == LOC_BLOCK
&& sal.pc == sym->value_block ()->entry_pc ()
- && val.line < sym->line ())
+ && line < sym->line ())
continue;
if (self->funfirstline)
if (ls->explicit_loc.source_filename)
throw_error (NOT_FOUND_ERROR,
_("No compiled code for line %d in file \"%s\"."),
- val.line, ls->explicit_loc.source_filename.get ());
+ line, ls->explicit_loc.source_filename.get ());
else
throw_error (NOT_FOUND_ERROR,
_("No compiled code for line %d in the current file."),
- val.line);
+ line);
}
return values;
/* A helper for create_sals_line_offset that handles the 'list_mode' case. */
static std::vector<symtab_and_line>
-decode_digits_list_mode (struct linespec_state *self,
- linespec *ls,
- struct symtab_and_line val)
+decode_digits_list_mode (linespec_state *self, linespec *ls, int line)
{
gdb_assert (self->list_mode);
set_current_program_space (pspace);
/* Simplistic search just for the list command. */
- val.symtab = find_line_symtab (elt, val.line, nullptr);
+ symtab_and_line val;
+ val.line = line;
+ val.symtab = find_line_symtab (elt, line, nullptr);
if (val.symtab == NULL)
val.symtab = elt;
val.pspace = pspace;