* symtab.c (decode_line_spec): Update.
* python/python.c (gdbpy_decode_line): Update.
* linespec.h (decode_line_1): Update.
* linespec.c (decode_line_1): Remove 'not_found_ptr' argument.
(decode_compound, find_method, symtab_from_filename)
(decode_variable): Likewise.
* cli/cli-cmds.c (edit_command): Update.
(list_command): Update.
* breakpoint.c (parse_breakpoint_sals): Remove 'not_found_ptr'
argument.
(create_breakpoint): Update.
(until_break_command): Update.
(addr_string_to_sals): Update.
(decode_line_spec_1): Update.
+2011-04-04 Tom Tromey <tromey@redhat.com>
+
+ * tracepoint.c (scope_info): Update.
+ * symtab.c (decode_line_spec): Update.
+ * python/python.c (gdbpy_decode_line): Update.
+ * linespec.h (decode_line_1): Update.
+ * linespec.c (decode_line_1): Remove 'not_found_ptr' argument.
+ (decode_compound, find_method, symtab_from_filename)
+ (decode_variable): Likewise.
+ * cli/cli-cmds.c (edit_command): Update.
+ (list_command): Update.
+ * breakpoint.c (parse_breakpoint_sals): Remove 'not_found_ptr'
+ argument.
+ (create_breakpoint): Update.
+ (until_break_command): Update.
+ (addr_string_to_sals): Update.
+ (decode_line_spec_1): Update.
+
2011-04-04 Tom Tromey <tromey@redhat.com>
* breakpoint.c (struct captured_parse_breakpoint_args): Remove.
static void
parse_breakpoint_sals (char **address,
struct symtabs_and_lines *sals,
- struct linespec_result *canonical,
- int *not_found_ptr)
+ struct linespec_result *canonical)
{
char *addr_start = *address;
|| ((strchr ("+-", (*address)[0]) != NULL)
&& ((*address)[1] != '['))))
*sals = decode_line_1 (address, 1, default_breakpoint_symtab,
- default_breakpoint_line, canonical,
- not_found_ptr);
+ default_breakpoint_line, canonical);
else
*sals = decode_line_1 (address, 1, (struct symtab *) NULL, 0,
- canonical, not_found_ptr);
+ canonical);
}
/* For any SAL that didn't have a canonical string, fill one in. */
if (sals->nelts > 0 && canonical->canonical == NULL)
struct cleanup *bkpt_chain = NULL;
int i;
int pending = 0;
- int not_found = 0;
int task = 0;
int prev_bkpt_count = breakpoint_count;
TRY_CATCH (e, RETURN_MASK_ALL)
{
- parse_breakpoint_sals (&arg, &sals, &canonical, ¬_found);
+ parse_breakpoint_sals (&arg, &sals, &canonical);
}
/* If caller is interested in rc value from parse, set value. */
while (*arg == ' ' || *arg == '\t')
arg++;
- parse_breakpoint_sals (&arg, &sals_start, &canonical_start, NULL);
+ parse_breakpoint_sals (&arg, &sals_start, &canonical_start);
sal_start = sals_start.sals[0];
addr_string_start = canonical_start.canonical[0];
range. This makes it possible to have ranges like "foo.c:27, +14",
where +14 means 14 lines from the start location. */
sals_end = decode_line_1 (&arg, 1, sal_start.symtab, sal_start.line,
- &canonical_end, NULL);
+ &canonical_end);
/* canonical_end can be NULL if it was of the form "*0xdeadbeef". */
if (canonical_end.canonical == NULL)
if (default_breakpoint_valid)
sals = decode_line_1 (&arg, 1, default_breakpoint_symtab,
- default_breakpoint_line, NULL, NULL);
+ default_breakpoint_line, NULL);
else
- sals = decode_line_1 (&arg, 1, (struct symtab *) NULL, 0, NULL, NULL);
+ sals = decode_line_1 (&arg, 1, (struct symtab *) NULL, 0, NULL);
if (sals.nelts != 1)
error (_("Couldn't get information on specified line."));
addr_string_to_sals (struct breakpoint *b, char *addr_string, int *found)
{
char *s;
- int marker_spec, not_found;
+ int marker_spec;
struct symtabs_and_lines sals = {0};
struct gdb_exception e;
error (_("marker %s not found"), b->static_trace_marker_id);
}
else
- sals = decode_line_1 (&s, 1, (struct symtab *) NULL, 0,
- NULL, ¬_found);
+ sals = decode_line_1 (&s, 1, (struct symtab *) NULL, 0, NULL);
}
if (e.reason < 0)
{
state, then user already saw the message about that
breakpoint being disabled, and don't want to see more
errors. */
- if (not_found
+ if (e.error == NOT_FOUND_ERROR
&& (b->condition_not_parsed
|| (b->loc && b->loc->shlib_disabled)
|| b->enable_state == bp_disabled))
}
}
- if (!not_found)
+ if (e.reason == 0 || e.error != NOT_FOUND_ERROR)
{
gdb_assert (sals.nelts == 1);
if (b->type == bp_static_tracepoint && !marker_spec)
sals.sals[0] = update_static_tracepoint (b, sals.sals[0]);
- }
- *found = !not_found;
+ *found = 1;
+ }
+ else
+ *found = 0;
return sals;
}
sals = decode_line_1 (&string, funfirstline,
default_breakpoint_symtab,
default_breakpoint_line,
- NULL, NULL);
+ NULL);
else
sals = decode_line_1 (&string, funfirstline,
- (struct symtab *) NULL, 0, NULL, NULL);
+ (struct symtab *) NULL, 0, NULL);
if (*string)
error (_("Junk at end of line specification: %s"), string);
return sals;
/* Now should only be one argument -- decode it in SAL. */
arg1 = arg;
- sals = decode_line_1 (&arg1, 0, 0, 0, 0, 0);
+ sals = decode_line_1 (&arg1, 0, 0, 0, 0);
if (! sals.nelts)
{
dummy_beg = 1;
else
{
- sals = decode_line_1 (&arg1, 0, 0, 0, 0, 0);
+ sals = decode_line_1 (&arg1, 0, 0, 0, 0);
if (!sals.nelts)
return; /* C++ */
else
{
if (dummy_beg)
- sals_end = decode_line_1 (&arg1, 0, 0, 0, 0, 0);
+ sals_end = decode_line_1 (&arg1, 0, 0, 0, 0);
else
- sals_end = decode_line_1 (&arg1, 0, sal.symtab, sal.line, 0, 0);
+ sals_end = decode_line_1 (&arg1, 0, sal.symtab, sal.line, 0);
if (sals_end.nelts == 0)
return;
if (sals_end.nelts > 1)
int funfirstline,
struct linespec_result *canonical,
char *saved_arg,
- char *p,
- int *not_found_ptr);
+ char *p);
static struct symbol *lookup_prefix_sym (char **argptr, char *p);
char *saved_arg,
char *copy,
struct type *t,
- struct symbol *sym_class,
- int *not_found_ptr);
+ struct symbol *sym_class);
static void cplusplus_error (const char *name, const char *fmt, ...)
ATTRIBUTE_NORETURN ATTRIBUTE_PRINTF (2, 3);
struct linespec_result *);
static struct symtab *symtab_from_filename (char **argptr,
- char *p, int is_quote_enclosed,
- int *not_found_ptr);
+ char *p, int is_quote_enclosed);
static struct symbol *find_function_symbol (char **argptr, char *p,
int is_quote_enclosed);
static struct symtabs_and_lines decode_variable (char *copy,
int funfirstline,
struct linespec_result *canonical,
- struct symtab *file_symtab,
- int *not_found_ptr);
+ struct symtab *file_symtab);
static struct
symtabs_and_lines symbol_found (int funfirstline,
Note that it is possible to return zero for the symtab
if no file is validly specified. Callers must check that.
- Also, the line number returned may be invalid.
-
- If NOT_FOUND_PTR is not null, store a boolean true/false value at
- the location, based on whether or not failure occurs due to an
- unknown function or file. In the case where failure does occur due
- to an unknown function or file, do not issue an error message. */
+ Also, the line number returned may be invalid. */
/* We allow single quotes in various places. This is a hideous
kludge, which exists because the completer can't yet deal with the
struct symtabs_and_lines
decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab,
- int default_line, struct linespec_result *canonical,
- int *not_found_ptr)
+ int default_line, struct linespec_result *canonical)
{
char *p;
char *q;
was thrown when trying to parse a filename. */
volatile struct gdb_exception file_exception;
- if (not_found_ptr)
- *not_found_ptr = 0;
-
/* Defaults have defaults. */
initialize_defaults (&default_symtab, &default_line);
if (is_quote_enclosed)
++saved_arg;
values = decode_compound (argptr, funfirstline, canonical,
- saved_arg, p, not_found_ptr);
+ saved_arg, p);
if (is_quoted && **argptr == '\'')
*argptr = *argptr + 1;
return values;
TRY_CATCH (file_exception, RETURN_MASK_ERROR)
{
- file_symtab = symtab_from_filename (argptr, p, is_quote_enclosed,
- not_found_ptr);
+ file_symtab = symtab_from_filename (argptr, p, is_quote_enclosed);
}
/* If that failed, maybe we have `function:label'. */
if (file_exception.reason < 0)
exception. */
if (!function_symbol)
throw_exception (file_exception);
- if (not_found_ptr)
- *not_found_ptr = 0;
}
/* Check for single quotes on the non-filename part. */
}
if (function_symbol)
- {
- if (not_found_ptr)
- *not_found_ptr = 1;
- throw_exception (file_exception);
- }
+ throw_exception (file_exception);
/* Look up that token as a variable.
If file specified, use that file's per-file block to start with. */
- return decode_variable (copy, funfirstline, canonical,
- file_symtab, not_found_ptr);
+ return decode_variable (copy, funfirstline, canonical, file_symtab);
}
\f
static struct symtabs_and_lines
decode_compound (char **argptr, int funfirstline,
struct linespec_result *canonical,
- char *the_real_saved_arg, char *p, int *not_found_ptr)
+ char *the_real_saved_arg, char *p)
{
struct symtabs_and_lines values;
char *p2;
we'll lookup the whole string in the symbol tables. */
values = find_method (funfirstline, canonical, saved_arg,
- copy, t, sym_class, not_found_ptr);
+ copy, t, sym_class);
if (saved_java_argptr != NULL && values.nelts == 1)
{
/* The user specified a specific return type for a java method.
}
/* Couldn't find a minimal symbol, either, so give up. */
- if (not_found_ptr)
- *not_found_ptr = 1;
cplusplus_error (the_real_saved_arg,
"Can't find member of namespace, "
"class, struct, or union named \"%s\"\n",
static struct symtabs_and_lines
find_method (int funfirstline, struct linespec_result *canonical,
char *saved_arg,
- char *copy, struct type *t, struct symbol *sym_class,
- int *not_found_ptr)
+ char *copy, struct type *t, struct symbol *sym_class)
{
struct symtabs_and_lines values;
struct symbol *sym = NULL;
}
else
{
- if (not_found_ptr)
- *not_found_ptr = 1;
if (copy[0] == '~')
cplusplus_error (saved_arg,
"the class `%s' does not have destructor defined\n",
\f
/* Return the symtab associated to the filename given by the substring
- of *ARGPTR ending at P, and advance ARGPTR past that filename. If
- NOT_FOUND_PTR is not null and the source file is not found, store
- boolean true at the location pointed to and do not issue an
- error message. */
+ of *ARGPTR ending at P, and advance ARGPTR past that filename. */
static struct symtab *
-symtab_from_filename (char **argptr, char *p, int is_quote_enclosed,
- int *not_found_ptr)
+symtab_from_filename (char **argptr, char *p, int is_quote_enclosed)
{
char *p1;
char *copy;
file_symtab = lookup_symtab (copy);
if (file_symtab == 0)
{
- if (not_found_ptr)
- *not_found_ptr = 1;
if (!have_full_symbols () && !have_partial_symbols ())
throw_error (NOT_FOUND_ERROR,
_("No symbol table is loaded. "
}
/* Decode a linespec that's a variable. If FILE_SYMTAB is non-NULL,
- look in that symtab's static variables first. If NOT_FOUND_PTR is
- not NULL and the function cannot be found, store boolean true in
- the location pointed to and do not issue an error message. */
+ look in that symtab's static variables first. */
static struct symtabs_and_lines
decode_variable (char *copy, int funfirstline,
struct linespec_result *canonical,
- struct symtab *file_symtab, int *not_found_ptr)
+ struct symtab *file_symtab)
{
struct symbol *sym;
struct minimal_symbol *msymbol;
if (msymbol != NULL)
return minsym_found (funfirstline, msymbol);
- if (not_found_ptr)
- *not_found_ptr = 1;
-
if (!have_full_symbols ()
&& !have_partial_symbols ()
&& !have_minimal_symbols ())
extern struct symtabs_and_lines
decode_line_1 (char **argptr, int funfirstline,
struct symtab *default_symtab, int default_line,
- struct linespec_result *canonical, int *not_found_ptr);
+ struct linespec_result *canonical);
#endif /* defined (LINESPEC_H) */
arg = xstrdup (arg);
make_cleanup (xfree, arg);
copy = arg;
- sals = decode_line_1 (©, 0, 0, 0, 0, 0);
+ sals = decode_line_1 (©, 0, 0, 0, 0);
make_cleanup (xfree, sals.sals);
}
else
sals = decode_line_1 (&string, funfirstline,
cursal.symtab, cursal.line,
- NULL, NULL);
+ NULL);
if (*string)
error (_("Junk at end of line specification: %s"), string);
error (_("requires an argument (function, "
"line or *addr) to define a scope"));
- sals = decode_line_1 (&args, 1, NULL, 0, NULL, NULL);
+ sals = decode_line_1 (&args, 1, NULL, 0, NULL);
if (sals.nelts == 0)
return; /* Presumably decode_line_1 has already warned. */