This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 2/4] Explicit locations
- From: Keith Seitz <keiths at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: "gdb-patches at sourceware dot org ml" <gdb-patches at sourceware dot org>
- Date: Mon, 16 Sep 2013 11:47:16 -0700
- Subject: Re: [RFA 2/4] Explicit locations
- Authentication-results: sourceware.org; auth=none
- References: <514B9E9F dot 2040400 at redhat dot com> <87txiidf0c dot fsf at fleche dot redhat dot com>
On 08/21/2013 12:23 PM, Tom Tromey wrote:
"Keith" == Keith Seitz <keiths@redhat.com> writes:
Keith> This is the second patch in the series. The main purpose of this patch
Keith> is to introduce explicit locations and use them internally. This
Keith> includes converting all linespec locations to explicit form.
This looks reasonable to me, though the "new file" comment from the
first patch applies here as well, I think.
Done.
Keith> +/* A convenience macro for testing for unset locations. */
Keith> +#define location_empty_p(L) \
Keith> + ((EVENT_LOCATION_TYPE ((L)) == EVENT_LOCATION_EXPLICIT \
Keith> + && (EVENT_LOCATION_EXPLICIT ((L)) == NULL \
Keith> + || (EVENT_LOCATION_EXPLICIT ((L))->source_filename == NULL \
Keith> + && EVENT_LOCATION_EXPLICIT ((L))->function_name == NULL \
Keith> + && EVENT_LOCATION_EXPLICIT ((L))->label_name == NULL \
Keith> + && (EVENT_LOCATION_EXPLICIT ((L))->line_offset.sign \
Keith> + == LINE_OFFSET_UNKNOWN)))) \
Keith> + || (EVENT_LOCATION_TYPE ((L)) == EVENT_LOCATION_LINESPEC \
Keith> + && EVENT_LOCATION_LINESPEC ((L)) == NULL))
I think this would be better as a function in the new module.
Done.
> Keith> + throw_error (NOT_FOUND_ERROR,
> Keith> + _("No label \"%s\" defined in curernt
function."),
> Keith> + label);
>
> Almost forgot, there's a typo in the message here.
Fixed.
Keith
ChangeLog
2012-09-13 Keith Seitz <keiths@redhat.com>
* locations.h (enum offset_relative_sign): Move here from linespec.c.
(struct line_offset): Likewise.
(enum event_location_type): Add EVENT_LOCATION_EXPLICIT.
(struct explicit_location): New structure.
(struct event_location): Add "explicit" and accessor macro.
(initialize_explicit_location): Declare.
(location_empty_p): Declare.
* locations.c (initialize_explicit_location): New function.
(initialize_event_location): Handle explicit locations.
(copy_event_location): Handle EVENT_LOCATION_EXPLICIT.
(delete_event_location): Likewise.
(event_location_to_string): Likewise.
(location_empty_p): New function.
* breakpoint.c (create_overlay_event_breakpoint): Convert linespec
location to explicit location.
(create_longjmp_master_breakpoint): Likewise.
(create_std_terminate_master_breakpoint): Likewise.
(create_exception_master_breakpoint): Likewise.
(update_breakpoints_after_exec): Check for empty location instead
of NULL linespec.
(create_breakpoint): Handle pending explicit breakpoints.
(bkpt_re_set): Check for empty location instead of NULL linespec.
(update_static_tracepoint): Use explicit location instead of linespec
location.
(location_to_sals): Handle explicit locations.
* linespec.c (enum offset_relative_sign): Moved to locations.c.
(struct line_offset): Likewise.
(undefined_label_error): New function.
(source_file_not_found_error): New function.
(linespec_parse_basic): Use undefined_label_error.
(canonicalize_linespec): Canonicalize all linespecs as
explicit locations.
(convert_explicit_location_to_sals): New function.
(event_location_to_sals): Handle explicit locations.
(decode_line_with_current_source): Likewise.
(decode_line_with_last_displayed): Likewise.
(symtabs_from_filename): Use source_file_not_found_error.
diff --git a/gdb/locations.h b/gdb/locations.h
index 667181f..f8ac807 100644
--- a/gdb/locations.h
+++ b/gdb/locations.h
@@ -21,6 +21,32 @@
struct language_defn;
+/* An enumeration of possible signs for a line offset. */
+
+enum offset_relative_sign
+{
+ /* No sign */
+ LINE_OFFSET_NONE,
+
+ /* A plus sign ("+") */
+ LINE_OFFSET_PLUS,
+
+ /* A minus sign ("-") */
+ LINE_OFFSET_MINUS,
+
+ /* A special "sign" for unspecified offset. */
+ LINE_OFFSET_UNKNOWN
+};
+
+/* A line offset in a location. */
+
+struct line_offset
+{
+ /* Line offset and any specified sign. */
+ int offset;
+ enum offset_relative_sign sign;
+};
+
/* An enumeration of the various ways to specify a stop event
location (used with create_breakpoint). */
@@ -31,6 +57,31 @@ enum event_location_type
/* An address in the inferior. */
EVENT_LOCATION_ADDRESS,
+
+ /* An explicit location. */
+ EVENT_LOCATION_EXPLICIT
+};
+
+/* An explicit location. This structure is used to bypass the
+ parsing done on linespecs. It still has the same requirements
+ as linespecs, though. For example, source_filename requires
+ at least one other field. */
+
+struct explicit_location
+{
+ /* The source filename. Malloc'd. */
+ char *source_filename;
+
+ /* The function name. Malloc'd. */
+ char *function_name;
+
+ /* The name of a label. Malloc'd. */
+ char *label_name;
+
+ /* A line offset relative to the start of the symbol
+ identified by the above fields or the current symtab
+ if the other fields are NULL. */
+ struct line_offset line_offset;
};
/* An event location used to set a stop event in the inferior.
@@ -53,6 +104,10 @@ struct event_location
/* An address in the inferior. */
CORE_ADDR address;
#define EVENT_LOCATION_ADDRESS(S) ((S)->u.address)
+
+ /* An explicit location. */
+ struct explicit_location explicit;
+#define EVENT_LOCATION_EXPLICIT(S) (&((S)->u.explicit))
} u;
/* A string representation of how this location may be
@@ -87,6 +142,10 @@ extern struct event_location *
extern void initialize_event_location (struct event_location *location,
enum event_location_type type);
+/* Initialize the given explicit location. */
+
+extern void initialize_explicit_location (struct explicit_location *explicit);
+
/* Attempt to convert the input string in *ARGP into an event location.
ARGP is advanced past any processed input. Returns a event_location
(malloc'd) if an event location was successfully found in *ARGP,
@@ -99,4 +158,8 @@ extern void initialize_event_location (struct event_location *location,
extern struct event_location *
string_to_event_location (char **argp,
const struct language_defn *langauge);
+
+/* A convenience function for testing for unset locations. */
+
+extern int event_location_empty_p (const struct event_location *location);
#endif /* LOCATIONS_H */
diff --git a/gdb/locations.c b/gdb/locations.c
index 1cde6f5..478318e 100644
--- a/gdb/locations.c
+++ b/gdb/locations.c
@@ -24,6 +24,15 @@
#include "language.h"
#include "linespec.h"
+/* Initialize the given explicit location. */
+
+void
+initialize_explicit_location (struct explicit_location *explicit)
+{
+ memset (explicit, 0, sizeof (struct explicit_location));
+ explicit->line_offset.sign = LINE_OFFSET_UNKNOWN;
+}
+
/* Initialize the given LOCATION. */
void
@@ -32,6 +41,8 @@ initialize_event_location (struct event_location *location,
{
memset (location, 0, sizeof (struct event_location));
EVENT_LOCATION_TYPE (location) = type;
+ if (type == EVENT_LOCATION_EXPLICIT)
+ initialize_explicit_location (EVENT_LOCATION_EXPLICIT (location));
}
/* Create a new user location with the given TYPE. */
@@ -68,6 +79,23 @@ copy_event_location (const struct event_location *src)
EVENT_LOCATION_ADDRESS (dst) = EVENT_LOCATION_ADDRESS (src);
break;
+ case EVENT_LOCATION_EXPLICIT:
+ if (EVENT_LOCATION_EXPLICIT (src)->source_filename != NULL)
+ EVENT_LOCATION_EXPLICIT (dst)->source_filename
+ = xstrdup (EVENT_LOCATION_EXPLICIT (src)->source_filename);
+
+ if (EVENT_LOCATION_EXPLICIT (src)->function_name != NULL)
+ EVENT_LOCATION_EXPLICIT (dst)->function_name
+ = xstrdup (EVENT_LOCATION_EXPLICIT (src)->function_name);
+
+ if (EVENT_LOCATION_EXPLICIT (src)->label_name != NULL)
+ EVENT_LOCATION_EXPLICIT (dst)->label_name
+ = xstrdup (EVENT_LOCATION_EXPLICIT (src)->label_name);
+
+ EVENT_LOCATION_EXPLICIT (dst)->line_offset
+ = EVENT_LOCATION_EXPLICIT (src)->line_offset;
+ break;
+
default:
gdb_assert_not_reached ("unknown event location type");
}
@@ -96,6 +124,15 @@ delete_event_location (void *data)
case EVENT_LOCATION_ADDRESS:
/* Nothing to do. */
break;
+
+ case EVENT_LOCATION_EXPLICIT:
+ xfree (EVENT_LOCATION_EXPLICIT (location)->source_filename);
+ xfree (EVENT_LOCATION_EXPLICIT (location)->function_name);
+ xfree (EVENT_LOCATION_EXPLICIT (location)->label_name);
+ break;
+
+ default:
+ gdb_assert_not_reached ("unknown event location type");
}
xfree (location);
@@ -118,6 +155,7 @@ event_location_to_string (const struct event_location *location)
break;
case EVENT_LOCATION_ADDRESS:
+ case EVENT_LOCATION_EXPLICIT:
result = EVENT_LOCATION_SAVE_SPEC (location);
break;
@@ -161,3 +199,29 @@ string_to_event_location (char **stringp,
return location;
}
+
+/* A convenience function for testing for unset locations. */
+
+int
+event_location_empty_p (const struct event_location *location)
+{
+ switch (EVENT_LOCATION_TYPE (location))
+ {
+ case EVENT_LOCATION_LINESPEC:
+ return EVENT_LOCATION_LINESPEC (location) == NULL;
+
+ case EVENT_LOCATION_ADDRESS:
+ return 0;
+
+ case EVENT_LOCATION_EXPLICIT:
+ return (EVENT_LOCATION_EXPLICIT (location) == NULL
+ || (EVENT_LOCATION_EXPLICIT (location)->source_filename == NULL
+ && EVENT_LOCATION_EXPLICIT (location)->function_name == NULL
+ && EVENT_LOCATION_EXPLICIT (location)->label_name == NULL
+ && (EVENT_LOCATION_EXPLICIT (location)->line_offset.sign
+ == LINE_OFFSET_UNKNOWN)));
+
+ default:
+ gdb_assert_not_reached ("unknown event location type");
+ }
+}
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 2b102e0..af6a1b4 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3152,8 +3152,9 @@ create_overlay_event_breakpoint (void)
b = create_internal_breakpoint (get_objfile_arch (objfile), addr,
bp_overlay_event,
&internal_breakpoint_ops);
- b->location = new_event_location (EVENT_LOCATION_LINESPEC);
- EVENT_LOCATION_LINESPEC (b->location) = xstrdup (func_name);
+ b->location = new_event_location (EVENT_LOCATION_EXPLICIT);
+ EVENT_LOCATION_EXPLICIT (b->location)->function_name
+ = xstrdup (func_name);
if (overlay_debugging == ovly_auto)
{
@@ -3270,8 +3271,9 @@ create_longjmp_master_breakpoint (void)
addr = SYMBOL_VALUE_ADDRESS (bp_objfile_data->longjmp_msym[i]);
b = create_internal_breakpoint (gdbarch, addr, bp_longjmp_master,
&internal_breakpoint_ops);
- b->location = new_event_location (EVENT_LOCATION_LINESPEC);
- EVENT_LOCATION_LINESPEC (b->location) = xstrdup (func_name);
+ b->location = new_event_location (EVENT_LOCATION_EXPLICIT);
+ EVENT_LOCATION_EXPLICIT (b->location)->function_name
+ = xstrdup (func_name);
b->enable_state = bp_disabled;
}
}
@@ -3327,8 +3329,9 @@ create_std_terminate_master_breakpoint (void)
b = create_internal_breakpoint (get_objfile_arch (objfile), addr,
bp_std_terminate_master,
&internal_breakpoint_ops);
- b->location = new_event_location (EVENT_LOCATION_LINESPEC);
- EVENT_LOCATION_LINESPEC (b->location) = xstrdup (func_name);
+ b->location = new_event_location (EVENT_LOCATION_EXPLICIT);
+ EVENT_LOCATION_EXPLICIT (b->location)->function_name
+ = xstrdup (func_name);
b->enable_state = bp_disabled;
}
}
@@ -3431,8 +3434,9 @@ create_exception_master_breakpoint (void)
¤t_target);
b = create_internal_breakpoint (gdbarch, addr, bp_exception_master,
&internal_breakpoint_ops);
- b->location = new_event_location (EVENT_LOCATION_LINESPEC);
- EVENT_LOCATION_LINESPEC (b->location) = xstrdup (func_name);
+ b->location = new_event_location (EVENT_LOCATION_EXPLICIT);
+ EVENT_LOCATION_EXPLICIT (b->location)->function_name
+ = xstrdup (func_name);
b->enable_state = bp_disabled;
}
@@ -3546,7 +3550,7 @@ update_breakpoints_after_exec (void)
/* Without a symbolic address, we have little hope of the
pre-exec() address meaning the same thing in the post-exec()
a.out. */
- if (EVENT_LOCATION_LINESPEC (b->location) == NULL)
+ if (event_location_empty_p (b->location))
{
delete_breakpoint (b);
continue;
@@ -9753,8 +9757,18 @@ create_breakpoint (struct gdbarch *gdbarch,
/* If the location has a string representation,
save it to the breakpoint's location save spec, since this
may be used to save the breakpoint to a file. */
- if (EVENT_LOCATION_SAVE_SPEC (b->location) == NULL
- && event_location_to_string (b->location) != NULL)
+ if (EVENT_LOCATION_TYPE (b->location) == EVENT_LOCATION_EXPLICIT)
+ {
+ char *old = EVENT_LOCATION_SAVE_SPEC (b->location);
+
+ EVENT_LOCATION_SAVE_SPEC (b->location)
+ = xstrprintf ("%s%s%s", old,
+ (extra_string == NULL ? "" : " "),
+ (extra_string == NULL ? "" : extra_string));
+ xfree (old);
+ }
+ else if (EVENT_LOCATION_SAVE_SPEC (b->location) == NULL
+ && event_location_to_string (b->location) != NULL)
{
EVENT_LOCATION_SAVE_SPEC (b->location)
= xstrdup (event_location_to_string (b->location));
@@ -12911,8 +12925,7 @@ static void
bkpt_re_set (struct breakpoint *b)
{
/* FIXME: is this still reachable? */
- if (EVENT_LOCATION_TYPE (b->location) == EVENT_LOCATION_LINESPEC
- && EVENT_LOCATION_LINESPEC (b->location) == NULL)
+ if (event_location_empty_p (b->location))
{
/* Anything without a string can't be re-set. */
delete_breakpoint (b);
@@ -14000,11 +14013,11 @@ update_static_tracepoint (struct breakpoint *b, struct symtab_and_line sal)
b->loc->symtab = sym != NULL ? sal2.symtab : NULL;
delete_event_location (b->location);
- b->location = new_event_location (EVENT_LOCATION_LINESPEC);
- EVENT_LOCATION_LINESPEC (b->location)
- = xstrprintf ("%s:%d",
- symtab_to_filename_for_display (sal2.symtab),
- b->loc->line_number);
+ b->location = new_event_location (EVENT_LOCATION_EXPLICIT);
+ EVENT_LOCATION_EXPLICIT (b->location)->source_filename
+ = xstrdup (symtab_to_filename_for_display (sal2.symtab));
+ EVENT_LOCATION_EXPLICIT (b->location)->line_offset.offset
+ = b->loc->line_number;
/* Might be nice to check if function changed, and warn if
so. */
@@ -14226,10 +14239,7 @@ location_to_sals (struct breakpoint *b, struct event_location *location,
if (EVENT_LOCATION_TYPE (location) == EVENT_LOCATION_LINESPEC)
s = EVENT_LOCATION_LINESPEC (location);
else
- {
- s = b->extra_string;
- b->extra_string = NULL;
- }
+ s = b->extra_string;
if (s != NULL && *s != '\0')
{
@@ -14259,7 +14269,15 @@ location_to_sals (struct breakpoint *b, struct event_location *location,
char *p, *str;
char *old = EVENT_LOCATION_SAVE_SPEC (location);
- len = orig - prev;
+ if (EVENT_LOCATION_TYPE (location) == EVENT_LOCATION_EXPLICIT)
+ {
+ len = strlen (prev);
+ if (s != NULL)
+ len -= strlen (s);
+ }
+ else
+ len = orig - prev;
+
str = savestring (prev, len);
p = remove_trailing_whitespace (str, str + len);
*p = '\0';
diff --git a/gdb/linespec.c b/gdb/linespec.c
index a5be218..9d99eb4 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -73,31 +73,6 @@ typedef struct minsym_and_objfile
DEF_VEC_O (minsym_and_objfile_d);
-/* An enumeration of possible signs for a line offset. */
-enum offset_relative_sign
-{
- /* No sign */
- LINE_OFFSET_NONE,
-
- /* A plus sign ("+") */
- LINE_OFFSET_PLUS,
-
- /* A minus sign ("-") */
- LINE_OFFSET_MINUS,
-
- /* A special "sign" for unspecified offset. */
- LINE_OFFSET_UNKNOWN
-};
-
-/* A line offset in a linespec. */
-
-struct line_offset
-{
- /* Line offset and any specified sign. */
- int offset;
- enum offset_relative_sign sign;
-};
-
/* A linespec. Elements of this structure are filled in by a parser
(either parse_linespec or some other function). The structure is
then converted into SALs by convert_linespec_to_sals. */
@@ -1558,6 +1533,29 @@ unexpected_linespec_error (linespec_parser *parser)
token_type_strings[token.type]);
}
+/* Throw an undefined label error. */
+
+static void ATTRIBUTE_NORETURN
+undefined_label_error (const char *function, const char *label)
+{
+ if (function != NULL)
+ throw_error (NOT_FOUND_ERROR,
+ _("No label \"%s\" defined in function \"%s\"."),
+ label, function);
+ else
+ throw_error (NOT_FOUND_ERROR,
+ _("No label \"%s\" defined in current function."),
+ label);
+}
+
+/* Throw a source file not found error. */
+
+static void ATTRIBUTE_NORETURN
+source_file_not_found_error (const char *name)
+{
+ throw_error (NOT_FOUND_ERROR, _("No source file named %s."), name);
+}
+
/* Parse and return a line offset in STRING. */
static struct line_offset
@@ -1732,9 +1730,8 @@ linespec_parse_basic (linespec_parser *parser)
else
{
/* We don't know what it was, but it isn't a label. */
- throw_error (NOT_FOUND_ERROR,
- _("No label \"%s\" defined in function \"%s\"."),
- name, PARSER_RESULT (parser)->function_name);
+ undefined_label_error (PARSER_RESULT (parser)->function_name,
+ name);
}
/* Check for a line offset. */
@@ -1790,17 +1787,22 @@ canonicalize_linespec (struct linespec_state *state, linespec_p ls)
else
{
struct ui_file *buf;
+ struct explicit_location *explicit;
int need_colon = 0;
buf = mem_fileopen ();
+ /* Convert any LINESPEC into EXPLICIT form so that the
+ parsing that was just done does not need to be repeated. */
state->canonical->location
- = new_event_location (EVENT_LOCATION_LINESPEC);
+ = new_event_location (EVENT_LOCATION_EXPLICIT);
+ explicit = EVENT_LOCATION_EXPLICIT (state->canonical->location);
if (ls->source_filename)
{
fputs_unfiltered (ls->source_filename, buf);
need_colon = 1;
+ explicit->source_filename = xstrdup (ls->source_filename);
}
if (ls->function_name)
@@ -1809,6 +1811,7 @@ canonicalize_linespec (struct linespec_state *state, linespec_p ls)
fputc_unfiltered (':', buf);
fputs_unfiltered (ls->function_name, buf);
need_colon = 1;
+ explicit->function_name = xstrdup (ls->function_name);
}
if (ls->label_name)
@@ -1827,11 +1830,13 @@ canonicalize_linespec (struct linespec_state *state, linespec_p ls)
s = VEC_index (symbolp, ls->labels.function_symbols, 0);
fputs_unfiltered (SYMBOL_NATURAL_NAME (s), buf);
fputc_unfiltered (':', buf);
+ explicit->function_name = xstrdup (SYMBOL_NATURAL_NAME (s));
}
fputs_unfiltered (ls->label_name, buf);
need_colon = 1;
state->canonical->special_display = 1;
+ explicit->label_name = xstrdup (ls->label_name);
}
if (ls->line_offset.sign != LINE_OFFSET_UNKNOWN)
@@ -1843,12 +1848,11 @@ canonicalize_linespec (struct linespec_state *state, linespec_p ls)
: (ls->line_offset.sign
== LINE_OFFSET_PLUS ? "+" : "-")),
ls->line_offset.offset);
+ explicit->line_offset = ls->line_offset;
}
EVENT_LOCATION_SAVE_SPEC (state->canonical->location)
= ui_file_xstrdup (buf, NULL);
- EVENT_LOCATION_LINESPEC (state->canonical->location)
- = xstrdup (EVENT_LOCATION_SAVE_SPEC (state->canonical->location));
ui_file_delete (buf);
}
}
@@ -2133,6 +2137,72 @@ convert_linespec_to_sals (struct linespec_state *state, linespec_p ls)
return sals;
}
+/* Convert the explicit location EXPLICIT into SaLs. */
+
+static struct symtabs_and_lines
+convert_explicit_location_to_sals (struct linespec_state *self,
+ linespec_p result,
+ struct explicit_location *explicit)
+{
+ VEC (symbolp) *symbols, *labels;
+ VEC (minsym_and_objfile_d) *minimal_symbols;
+
+ if (explicit->source_filename != NULL)
+ {
+ volatile struct gdb_exception except;
+
+ TRY_CATCH (except, RETURN_MASK_ERROR)
+ {
+ result->file_symtabs
+ = symtabs_from_filename (explicit->source_filename);
+ }
+
+ if (except.reason < 0 || result->file_symtabs == NULL)
+ source_file_not_found_error (explicit->source_filename);
+
+ result->source_filename = xstrdup (explicit->source_filename);
+ }
+ else
+ {
+ /* A NULL entry means to use the default symtab. */
+ VEC_safe_push (symtab_ptr, result->file_symtabs, NULL);
+ }
+
+ if (explicit->function_name != NULL)
+ {
+ find_linespec_symbols (self, result->file_symtabs,
+ explicit->function_name, &symbols,
+ &minimal_symbols);
+
+ if (symbols == NULL && minimal_symbols == NULL)
+ symbol_not_found_error (explicit->function_name,
+ result->source_filename);
+
+ result->function_name = xstrdup (explicit->function_name);
+ result->function_symbols = symbols;
+ result->minimal_symbols = minimal_symbols;
+ }
+
+ if (explicit->label_name != NULL)
+ {
+ symbols = NULL;
+ labels = find_label_symbols (self, result->function_symbols,
+ &symbols, explicit->label_name);
+
+ if (labels == NULL)
+ undefined_label_error (result->function_name, explicit->label_name);
+
+ result->label_name = xstrdup (explicit->label_name);
+ result->labels.label_symbols = labels;
+ result->labels.function_symbols = symbols;
+ }
+
+ if (explicit->line_offset.sign != LINE_OFFSET_UNKNOWN)
+ result->line_offset = explicit->line_offset;
+
+ return convert_linespec_to_sals (self, result);
+}
+
/* Parse a string that specifies a linespec.
Pass the address of a char * variable; that variable will be
advanced over the characters actually parsed.
@@ -2493,6 +2563,13 @@ event_location_to_sals (linespec_parser *parser,
EVENT_LOCATION_ADDRESS (location));
break;
+ case EVENT_LOCATION_EXPLICIT:
+ result
+ = convert_explicit_location_to_sals (PARSER_STATE (parser),
+ PARSER_RESULT (parser),
+ EVENT_LOCATION_EXPLICIT (location));
+ break;
+
default:
gdb_assert_not_reached ("unhandled event location type");
}
@@ -3159,7 +3236,7 @@ symtabs_from_filename (const char *filename)
throw_error (NOT_FOUND_ERROR,
_("No symbol table is loaded. "
"Use the \"file\" command."));
- throw_error (NOT_FOUND_ERROR, _("No source file named %s."), filename);
+ source_file_not_found_error (filename);
}
return result;