init_linespec_result (&canonical);
location = new_linespec_location (&exp);
old_chain = make_cleanup_delete_event_location (location);
- decode_line_full (location, DECODE_LINE_FUNFIRSTLINE,
+ decode_line_full (location, DECODE_LINE_FUNFIRSTLINE, NULL,
(struct symtab *) NULL, 0, &canonical,
NULL, NULL);
make_cleanup_destroy_linespec_result (&canonical);
struct cleanup *cleanup;
enum exception_event_kind kind = classify_exception_breakpoint (self);
struct event_location *location;
+ struct program_space *filter_pspace = current_program_space;
/* We first try to use the probe interface. */
TRY
location
= new_probe_location (exception_functions[kind].probe);
cleanup = make_cleanup_delete_event_location (location);
- sals = parse_probes (location, NULL);
+ sals = parse_probes (location, filter_pspace, NULL);
do_cleanups (cleanup);
}
-
CATCH (e, RETURN_MASK_ERROR)
{
/* Using the probe interface failed. Let's fallback to the normal
= ASTRDUP (exception_functions[kind].function);
location = new_explicit_location (&explicit_loc);
cleanup = make_cleanup_delete_event_location (location);
- self->ops->decode_location (self, location, &sals);
+ self->ops->decode_location (self, location, filter_pspace, &sals);
do_cleanups (cleanup);
}
CATCH (ex, RETURN_MASK_ERROR)
END_CATCH
cleanup = make_cleanup (xfree, sals.sals);
- update_breakpoint_locations (self, sals, sals_end);
+ update_breakpoint_locations (self, filter_pspace, sals, sals_end);
do_cleanups (cleanup);
}
static void decode_location_default (struct breakpoint *b,
const struct event_location *location,
+ struct program_space *search_pspace,
struct symtabs_and_lines *sals);
static void clear_command (char *, int);
&& strchr ("+-", address[0]) != NULL
&& address[1] != '['))
{
- decode_line_full (location, DECODE_LINE_FUNFIRSTLINE,
+ decode_line_full (location, DECODE_LINE_FUNFIRSTLINE, NULL,
get_last_displayed_symtab (),
get_last_displayed_line (),
canonical, NULL, NULL);
}
}
- decode_line_full (location, DECODE_LINE_FUNFIRSTLINE,
+ decode_line_full (location, DECODE_LINE_FUNFIRSTLINE, NULL,
cursal.symtab, cursal.line, canonical, NULL, NULL);
}
where +14 means 14 lines from the start location. */
end_location = string_to_event_location (&arg, current_language);
make_cleanup_delete_event_location (end_location);
- decode_line_full (end_location, DECODE_LINE_FUNFIRSTLINE,
+ decode_line_full (end_location, DECODE_LINE_FUNFIRSTLINE, NULL,
sal_start.symtab, sal_start.line,
&canonical_end, NULL, NULL);
cleanup = make_cleanup_delete_event_location (location);
if (last_displayed_sal_is_valid ())
- sals = decode_line_1 (location, DECODE_LINE_FUNFIRSTLINE,
+ sals = decode_line_1 (location, DECODE_LINE_FUNFIRSTLINE, NULL,
get_last_displayed_symtab (),
get_last_displayed_line ());
else
sals = decode_line_1 (location, DECODE_LINE_FUNFIRSTLINE,
- (struct symtab *) NULL, 0);
+ NULL, (struct symtab *) NULL, 0);
if (sals.nelts != 1)
error (_("Couldn't get information on specified line."));
static void
base_breakpoint_decode_location (struct breakpoint *b,
const struct event_location *location,
+ struct program_space *search_pspace,
struct symtabs_and_lines *sals)
{
internal_error_pure_virtual_called ();
static void
bkpt_decode_location (struct breakpoint *b,
const struct event_location *location,
+ struct program_space *search_pspace,
struct symtabs_and_lines *sals)
{
- decode_location_default (b, location, sals);
+ decode_location_default (b, location, search_pspace, sals);
}
/* Virtual table for internal breakpoints. */
{
struct linespec_sals lsal;
- lsal.sals = parse_probes (location, canonical);
+ lsal.sals = parse_probes (location, NULL, canonical);
lsal.canonical = xstrdup (event_location_to_string (canonical->location));
VEC_safe_push (linespec_sals, canonical->sals, &lsal);
}
static void
bkpt_probe_decode_location (struct breakpoint *b,
const struct event_location *location,
+ struct program_space *search_pspace,
struct symtabs_and_lines *sals)
{
- *sals = parse_probes (location, NULL);
+ *sals = parse_probes (location, search_pspace, NULL);
if (!sals->sals)
error (_("probe not found"));
}
static void
tracepoint_decode_location (struct breakpoint *b,
const struct event_location *location,
+ struct program_space *search_pspace,
struct symtabs_and_lines *sals)
{
- decode_location_default (b, location, sals);
+ decode_location_default (b, location, search_pspace, sals);
}
struct breakpoint_ops tracepoint_breakpoint_ops;
static void
tracepoint_probe_decode_location (struct breakpoint *b,
const struct event_location *location,
+ struct program_space *search_pspace,
struct symtabs_and_lines *sals)
{
/* We use the same method for breakpoint on probes. */
- bkpt_probe_decode_location (b, location, sals);
+ bkpt_probe_decode_location (b, location, search_pspace, sals);
}
static struct breakpoint_ops tracepoint_probe_breakpoint_ops;
static void
strace_marker_decode_location (struct breakpoint *b,
const struct event_location *location,
+ struct program_space *search_pspace,
struct symtabs_and_lines *sals)
{
struct tracepoint *tp = (struct tracepoint *) b;
map_breakpoint_numbers (arg, do_map_delete_breakpoint, NULL);
}
+/* Return true if all locations of B bound to PSPACE are pending. If
+ PSPACE is NULL, all locations of all program spaces are
+ considered. */
+
static int
-all_locations_are_pending (struct bp_location *loc)
+all_locations_are_pending (struct breakpoint *b, struct program_space *pspace)
{
- for (; loc; loc = loc->next)
- if (!loc->shlib_disabled
+ struct bp_location *loc;
+
+ for (loc = b->loc; loc != NULL; loc = loc->next)
+ if ((pspace == NULL
+ || loc->pspace == pspace)
+ && !loc->shlib_disabled
&& !loc->pspace->executing_startup)
return 0;
return 1;
return 1;
}
-/* Create new breakpoint locations for B (a hardware or software breakpoint)
- based on SALS and SALS_END. If SALS_END.NELTS is not zero, then B is
- a ranged breakpoint. */
+/* Split all locations of B that are bound to PSPACE out of B's
+ location list to a separate list and return that list's head. If
+ PSPACE is NULL, hoist out all locations of B. */
+
+static struct bp_location *
+hoist_existing_locations (struct breakpoint *b, struct program_space *pspace)
+{
+ struct bp_location head;
+ struct bp_location *i = b->loc;
+ struct bp_location **i_link = &b->loc;
+ struct bp_location *hoisted = &head;
+
+ if (pspace == NULL)
+ {
+ i = b->loc;
+ b->loc = NULL;
+ return i;
+ }
+
+ head.next = NULL;
+
+ while (i != NULL)
+ {
+ if (i->pspace == pspace)
+ {
+ *i_link = i->next;
+ i->next = NULL;
+ hoisted->next = i;
+ hoisted = i;
+ }
+ else
+ i_link = &i->next;
+ i = *i_link;
+ }
+
+ return head.next;
+}
+
+/* Create new breakpoint locations for B (a hardware or software
+ breakpoint) based on SALS and SALS_END. If SALS_END.NELTS is not
+ zero, then B is a ranged breakpoint. Only recreates locations for
+ FILTER_PSPACE. Locations of other program spaces are left
+ untouched. */
void
update_breakpoint_locations (struct breakpoint *b,
+ struct program_space *filter_pspace,
struct symtabs_and_lines sals,
struct symtabs_and_lines sals_end)
{
int i;
- struct bp_location *existing_locations = b->loc;
+ struct bp_location *existing_locations;
if (sals_end.nelts != 0 && (sals.nelts != 1 || sals_end.nelts != 1))
{
We'd like to retain the location, so that when the library is
loaded again, we don't loose the enabled/disabled status of the
individual locations. */
- if (all_locations_are_pending (existing_locations) && sals.nelts == 0)
+ if (all_locations_are_pending (b, filter_pspace) && sals.nelts == 0)
return;
- b->loc = NULL;
+ existing_locations = hoist_existing_locations (b, filter_pspace);
for (i = 0; i < sals.nelts; ++i)
{
static struct symtabs_and_lines
location_to_sals (struct breakpoint *b, struct event_location *location,
- int *found)
+ struct program_space *search_pspace, int *found)
{
struct symtabs_and_lines sals = {0};
struct gdb_exception exception = exception_none;
TRY
{
- b->ops->decode_location (b, location, &sals);
+ b->ops->decode_location (b, location, search_pspace, &sals);
}
CATCH (e, RETURN_MASK_ERROR)
{
breakpoint being disabled, and don't want to see more
errors. */
if (e.error == NOT_FOUND_ERROR
- && (b->condition_not_parsed
+ && (b->condition_not_parsed
+ || (b->loc != NULL
+ && search_pspace != NULL
+ && b->loc->pspace != search_pspace)
|| (b->loc && b->loc->shlib_disabled)
|| (b->loc && b->loc->pspace->executing_startup)
|| b->enable_state == bp_disabled))
struct symtabs_and_lines sals, sals_end;
struct symtabs_and_lines expanded = {0};
struct symtabs_and_lines expanded_end = {0};
+ struct program_space *filter_pspace = current_program_space;
- sals = location_to_sals (b, b->location, &found);
+ sals = location_to_sals (b, b->location, filter_pspace, &found);
if (found)
{
make_cleanup (xfree, sals.sals);
if (b->location_range_end != NULL)
{
- sals_end = location_to_sals (b, b->location_range_end, &found);
+ sals_end = location_to_sals (b, b->location_range_end,
+ filter_pspace, &found);
if (found)
{
make_cleanup (xfree, sals_end.sals);
}
}
- update_breakpoint_locations (b, expanded, expanded_end);
+ update_breakpoint_locations (b, filter_pspace, expanded, expanded_end);
}
/* Default method for creating SALs from an address string. It basically
static void
decode_location_default (struct breakpoint *b,
const struct event_location *location,
+ struct program_space *search_pspace,
struct symtabs_and_lines *sals)
{
struct linespec_result canonical;
init_linespec_result (&canonical);
- decode_line_full (location, DECODE_LINE_FUNFIRSTLINE,
+ decode_line_full (location, DECODE_LINE_FUNFIRSTLINE, search_pspace,
(struct symtab *) NULL, 0,
&canonical, multiple_symbols_all,
b->filter);
static struct cleanup *
prepare_re_set_context (struct breakpoint *b)
{
- struct cleanup *cleanups;
-
input_radix = b->input_radix;
- cleanups = save_current_space_and_thread ();
- if (b->pspace != NULL)
- switch_to_program_space_and_thread (b->pspace);
set_language (b->language);
- return cleanups;
+ return make_cleanup (null_cleanup, NULL);
}
/* Reset a breakpoint given it's struct breakpoint * BINT.
return 0;
}
-/* Re-set all breakpoints after symbols have been re-loaded. */
+/* Re-set breakpoint locations for the current program space.
+ Locations bound to other program spaces are left untouched. */
+
void
breakpoint_re_set (void)
{
save_language = current_language->la_language;
save_input_radix = input_radix;
- old_chain = save_current_program_space ();
+ old_chain = save_current_space_and_thread ();
ALL_BREAKPOINTS_SAFE (b, b_tmp)
{
int, const struct breakpoint_ops *,
int, int, int, unsigned);
- /* Given the location (second parameter), this method decodes it
- and provides the SAL locations related to it. For ordinary breakpoints,
- it calls `decode_line_full'.
+ /* Given the location (second parameter), this method decodes it and
+ provides the SAL locations related to it. For ordinary
+ breakpoints, it calls `decode_line_full'. If SEARCH_PSPACE is
+ not NULL, symbol search is restricted to just that program space.
This function is called inside `location_to_sals'. */
void (*decode_location) (struct breakpoint *b,
const struct event_location *location,
+ struct program_space *search_pspace,
struct symtabs_and_lines *sals);
/* Return true if this breakpoint explains a signal. See
struct breakpoint *owner);
extern void update_breakpoint_locations (struct breakpoint *b,
+ struct program_space *filter_pspace,
struct symtabs_and_lines sals,
struct symtabs_and_lines sals_end);
arg1 = arg;
location = string_to_event_location (&arg1, current_language);
cleanup = make_cleanup_delete_event_location (location);
- sals = decode_line_1 (location, DECODE_LINE_LIST_MODE, 0, 0);
+ sals = decode_line_1 (location, DECODE_LINE_LIST_MODE, NULL, NULL, 0);
filter_sals (&sals);
if (! sals.nelts)
location = string_to_event_location (&arg1, current_language);
make_cleanup_delete_event_location (location);
- sals = decode_line_1 (location, DECODE_LINE_LIST_MODE, 0, 0);
+ sals = decode_line_1 (location, DECODE_LINE_LIST_MODE, NULL, NULL, 0);
filter_sals (&sals);
if (!sals.nelts)
make_cleanup_delete_event_location (location);
if (dummy_beg)
sals_end = decode_line_1 (location,
- DECODE_LINE_LIST_MODE, 0, 0);
+ DECODE_LINE_LIST_MODE, NULL, NULL, 0);
else
sals_end = decode_line_1 (location, DECODE_LINE_LIST_MODE,
- sal.symtab, sal.line);
+ NULL, sal.symtab, sal.line);
filter_sals (&sals_end);
if (sals_end.nelts == 0)
sals_end.nelts = 0;
b->type = bp_breakpoint;
- update_breakpoint_locations (b, sals, sals_end);
+ update_breakpoint_locations (b, current_program_space, sals, sals_end);
}
/* A helper function for elf_symfile_read that reads the minimal
/* The program space as seen when the module was entered. */
struct program_space *program_space;
+ /* If not NULL, the search is restricted to just this program
+ space. */
+ struct program_space *search_pspace;
+
/* The default symtab to use, if no other symtab is specified. */
struct symtab *default_symtab;
linespec_p ls,
const char *arg);
-static VEC (symtab_ptr) *symtabs_from_filename (const char *);
+static VEC (symtab_ptr) *symtabs_from_filename (const char *,
+ struct program_space *pspace);
static VEC (symbolp) *find_label_symbols (struct linespec_state *self,
VEC (symbolp) *function_symbols,
struct program_space *pspace,
VEC (const_char_ptr) *names);
-static VEC (symtab_ptr) *collect_symtabs_from_filename (const char *file);
+static VEC (symtab_ptr) *
+ collect_symtabs_from_filename (const char *file,
+ struct program_space *pspace);
static void decode_digits_ordinary (struct linespec_state *self,
linespec_p ls,
fullname = symtab_to_fullname (self->default_symtab);
VEC_pop (symtab_ptr, ls->file_symtabs);
VEC_free (symtab_ptr, ls->file_symtabs);
- ls->file_symtabs = collect_symtabs_from_filename (fullname);
+ ls->file_symtabs = collect_symtabs_from_filename (fullname,
+ self->search_pspace);
use_default = 1;
}
TRY
{
result->file_symtabs
- = symtabs_from_filename (explicit_loc->source_filename);
+ = symtabs_from_filename (explicit_loc->source_filename,
+ self->search_pspace);
}
CATCH (except, RETURN_MASK_ERROR)
{
TRY
{
PARSER_RESULT (parser)->file_symtabs
- = symtabs_from_filename (user_filename);
+ = symtabs_from_filename (user_filename,
+ PARSER_STATE (parser)->search_pspace);
}
CATCH (ex, RETURN_MASK_ERROR)
{
static void
linespec_state_constructor (struct linespec_state *self,
int flags, const struct language_defn *language,
+ struct program_space *search_pspace,
struct symtab *default_symtab,
int default_line,
struct linespec_result *canonical)
self->language = language;
self->funfirstline = (flags & DECODE_LINE_FUNFIRSTLINE) ? 1 : 0;
self->list_mode = (flags & DECODE_LINE_LIST_MODE) ? 1 : 0;
+ self->search_pspace = search_pspace;
self->default_symtab = default_symtab;
self->default_line = default_line;
self->canonical = canonical;
static void
linespec_parser_new (linespec_parser *parser,
int flags, const struct language_defn *language,
+ struct program_space *search_pspace,
struct symtab *default_symtab,
int default_line,
struct linespec_result *canonical)
memset (PARSER_RESULT (parser), 0, sizeof (struct linespec));
PARSER_EXPLICIT (parser)->line_offset.sign = LINE_OFFSET_UNKNOWN;
linespec_state_constructor (PARSER_STATE (parser), flags, language,
+ search_pspace,
default_symtab, default_line, canonical);
}
if (stringp == NULL || *stringp == NULL)
return;
- linespec_parser_new (&parser, 0, current_language, NULL, 0, NULL);
+ linespec_parser_new (&parser, 0, current_language, NULL, NULL, 0, NULL);
cleanup = make_cleanup (linespec_parser_delete, &parser);
parser.lexer.saved_arg = *stringp;
PARSER_STREAM (&parser) = orig = *stringp;
void
decode_line_full (const struct event_location *location, int flags,
+ struct program_space *search_pspace,
struct symtab *default_symtab,
int default_line, struct linespec_result *canonical,
const char *select_mode,
|| select_mode == multiple_symbols_cancel);
gdb_assert ((flags & DECODE_LINE_LIST_MODE) == 0);
- linespec_parser_new (&parser, flags, current_language, default_symtab,
+ linespec_parser_new (&parser, flags, current_language,
+ search_pspace, default_symtab,
default_line, canonical);
cleanups = make_cleanup (linespec_parser_delete, &parser);
save_current_program_space ();
struct symtabs_and_lines
decode_line_1 (const struct event_location *location, int flags,
+ struct program_space *search_pspace,
struct symtab *default_symtab,
int default_line)
{
linespec_parser parser;
struct cleanup *cleanups;
- linespec_parser_new (&parser, flags, current_language, default_symtab,
+ linespec_parser_new (&parser, flags, current_language,
+ search_pspace, default_symtab,
default_line, NULL);
cleanups = make_cleanup (linespec_parser_delete, &parser);
save_current_program_space ();
location = string_to_event_location (&string, current_language);
cleanup = make_cleanup_delete_event_location (location);
- sals = decode_line_1 (location, flags,
+ sals = decode_line_1 (location, flags, NULL,
cursal.symtab, cursal.line);
if (*string)
location = string_to_event_location (&string, current_language);
cleanup = make_cleanup_delete_event_location (location);
if (last_displayed_sal_is_valid ())
- sals = decode_line_1 (location, flags,
+ sals = decode_line_1 (location, flags, NULL,
get_last_displayed_symtab (),
get_last_displayed_line ());
else
- sals = decode_line_1 (location, flags, (struct symtab *) NULL, 0);
+ sals = decode_line_1 (location, flags, NULL, (struct symtab *) NULL, 0);
if (*string)
error (_("Junk at end of line specification: %s"), string);
return 0;
}
-/* Given a file name, return a VEC of all matching symtabs. */
+/* Given a file name, return a VEC of all matching symtabs. If
+ SEARCH_PSPACE is not NULL, the search is restricted to just that
+ program space. */
static VEC (symtab_ptr) *
-collect_symtabs_from_filename (const char *file)
+collect_symtabs_from_filename (const char *file,
+ struct program_space *search_pspace)
{
struct symtab_collector collector;
struct cleanup *cleanups;
cleanups = make_cleanup_htab_delete (collector.symtab_table);
/* Find that file's data. */
- ALL_PSPACES (pspace)
- {
- if (pspace->executing_startup)
- continue;
+ if (search_pspace == NULL)
+ {
+ ALL_PSPACES (pspace)
+ {
+ if (pspace->executing_startup)
+ continue;
- set_current_program_space (pspace);
- iterate_over_symtabs (file, add_symtabs_to_list, &collector);
- }
+ set_current_program_space (pspace);
+ iterate_over_symtabs (file, add_symtabs_to_list, &collector);
+ }
+ }
+ else
+ {
+ set_current_program_space (search_pspace);
+ iterate_over_symtabs (file, add_symtabs_to_list, &collector);
+ }
do_cleanups (cleanups);
return collector.symtabs;
}
-/* Return all the symtabs associated to the FILENAME. */
+/* Return all the symtabs associated to the FILENAME. If SEARCH_PSPACE is
+ not NULL, the search is restricted to just that program space. */
static VEC (symtab_ptr) *
-symtabs_from_filename (const char *filename)
+symtabs_from_filename (const char *filename,
+ struct program_space *search_pspace)
{
VEC (symtab_ptr) *result;
- result = collect_symtabs_from_filename (filename);
+ result = collect_symtabs_from_filename (filename, search_pspace);
if (VEC_empty (symtab_ptr, result))
{
/* Try NAME as an Objective-C selector. */
find_imps (name, &symbol_names);
if (!VEC_empty (const_char_ptr, symbol_names))
- add_all_symbol_names_from_pspace (&info, NULL, symbol_names);
+ add_all_symbol_names_from_pspace (&info, state->search_pspace,
+ symbol_names);
else
- add_matching_symbols_to_info (name, &info, NULL);
+ add_matching_symbols_to_info (name, &info, state->search_pspace);
do_cleanups (cleanup);
extern struct symtabs_and_lines
decode_line_1 (const struct event_location *location, int flags,
+ struct program_space *search_pspace,
struct symtab *default_symtab, int default_line);
/* Parse LOCATION and return results. This is the "full"
For FLAGS, see decode_line_flags. DECODE_LINE_LIST_MODE is not
valid for this function.
+ If SEARCH_PSPACE is not NULL, symbol search is restricted to just
+ that program space.
+
DEFAULT_SYMTAB and DEFAULT_LINE describe the default location.
DEFAULT_SYMTAB can be NULL, in which case the current symtab and
line are used.
filtered out. */
extern void decode_line_full (const struct event_location *location, int flags,
+ struct program_space *search_pspace,
struct symtab *default_symtab, int default_line,
struct linespec_result *canonical,
const char *select_mode,
\f
+/* A helper for parse_probes that decodes a probe specification in
+ SEARCH_PSPACE. It appends matching SALs to RESULT. */
+
+static void
+parse_probes_in_pspace (const struct probe_ops *probe_ops,
+ struct program_space *search_pspace,
+ const char *objfile_namestr,
+ const char *provider,
+ const char *name,
+ struct symtabs_and_lines *result)
+{
+ struct objfile *objfile;
+
+ ALL_PSPACE_OBJFILES (search_pspace, objfile)
+ {
+ VEC (probe_p) *probes;
+ struct probe *probe;
+ int ix;
+
+ if (!objfile->sf || !objfile->sf->sym_probe_fns)
+ continue;
+
+ if (objfile_namestr
+ && FILENAME_CMP (objfile_name (objfile), objfile_namestr) != 0
+ && FILENAME_CMP (lbasename (objfile_name (objfile)),
+ objfile_namestr) != 0)
+ continue;
+
+ probes = objfile->sf->sym_probe_fns->sym_get_probes (objfile);
+
+ for (ix = 0; VEC_iterate (probe_p, probes, ix, probe); ix++)
+ {
+ struct symtab_and_line *sal;
+
+ if (probe_ops != &probe_ops_any && probe->pops != probe_ops)
+ continue;
+
+ if (provider && strcmp (probe->provider, provider) != 0)
+ continue;
+
+ if (strcmp (probe->name, name) != 0)
+ continue;
+
+ ++result->nelts;
+ result->sals = XRESIZEVEC (struct symtab_and_line, result->sals,
+ result->nelts);
+ sal = &result->sals[result->nelts - 1];
+
+ init_sal (sal);
+
+ sal->pc = get_probe_address (probe, objfile);
+ sal->explicit_pc = 1;
+ sal->section = find_pc_overlay (sal->pc);
+ sal->pspace = search_pspace;
+ sal->probe = probe;
+ sal->objfile = objfile;
+ }
+ }
+}
+
/* See definition in probe.h. */
struct symtabs_and_lines
parse_probes (const struct event_location *location,
+ struct program_space *search_pspace,
struct linespec_result *canonical)
{
char *arg_end, *arg;
char *objfile_namestr = NULL, *provider = NULL, *name, *p;
struct cleanup *cleanup;
struct symtabs_and_lines result;
- struct objfile *objfile;
- struct program_space *pspace;
const struct probe_ops *probe_ops;
const char *arg_start, *cs;
if (objfile_namestr && *objfile_namestr == '\0')
error (_("invalid objfile name"));
- ALL_PSPACES (pspace)
- ALL_PSPACE_OBJFILES (pspace, objfile)
- {
- VEC (probe_p) *probes;
- struct probe *probe;
- int ix;
-
- if (!objfile->sf || !objfile->sf->sym_probe_fns)
- continue;
-
- if (objfile_namestr
- && FILENAME_CMP (objfile_name (objfile), objfile_namestr) != 0
- && FILENAME_CMP (lbasename (objfile_name (objfile)),
- objfile_namestr) != 0)
- continue;
-
- probes = objfile->sf->sym_probe_fns->sym_get_probes (objfile);
-
- for (ix = 0; VEC_iterate (probe_p, probes, ix, probe); ix++)
- {
- struct symtab_and_line *sal;
-
- if (probe_ops != &probe_ops_any && probe->pops != probe_ops)
- continue;
-
- if (provider && strcmp (probe->provider, provider) != 0)
- continue;
-
- if (strcmp (probe->name, name) != 0)
- continue;
-
- ++result.nelts;
- result.sals = XRESIZEVEC (struct symtab_and_line, result.sals,
- result.nelts);
- sal = &result.sals[result.nelts - 1];
-
- init_sal (sal);
+ if (search_pspace != NULL)
+ {
+ parse_probes_in_pspace (probe_ops, search_pspace, objfile_namestr,
+ provider, name, &result);
+ }
+ else
+ {
+ struct program_space *pspace;
- sal->pc = get_probe_address (probe, objfile);
- sal->explicit_pc = 1;
- sal->section = find_pc_overlay (sal->pc);
- sal->pspace = pspace;
- sal->probe = probe;
- sal->objfile = objfile;
- }
- }
+ ALL_PSPACES (pspace)
+ parse_probes_in_pspace (probe_ops, pspace, objfile_namestr,
+ provider, name, &result);
+ }
if (result.nelts == 0)
{
symtabs_and_lines object and updates LOC or throws an error. */
extern struct symtabs_and_lines parse_probes (const struct event_location *loc,
+ struct program_space *pspace,
struct linespec_result *canon);
/* Helper function to register the proper probe_ops to a newly created probe.
TRY
{
if (location != NULL)
- sals = decode_line_1 (location, 0, 0, 0);
+ sals = decode_line_1 (location, 0, NULL, NULL, 0);
else
{
set_default_source_symtab_and_line ();
+2016-01-19 Pedro Alves <palves@redhat.com>
+
+ * ax-gdb.c (agent_command_1): Adjust call to decode_line_full.
+ * break-catch-throw.c (re_set_exception_catchpoint): Pass the
+ current program space down to linespec decoding and breakpoint
+ location updating.
+ * breakpoint.c (parse_breakpoint_sals): Adjust calls to
+ decode_line_full.
+ (until_break_command): Adjust calls to decode_line_1.
+ (base_breakpoint_decode_location, bkpt_decode_location): Add
+ 'search_pspace' parameter. Pass it along.
+ (bkpt_probe_create_sals_from_location): Adjust calls to
+ parse_probes.
+ (tracepoint_decode_location, tracepoint_probe_decode_location)
+ (strace_marker_decode_location): Add 'search_pspace' parameter.
+ Pass it along.
+ (all_locations_are_pending): Rewrite to take a breakpoint and
+ program space as arguments instead.
+ (hoist_existing_locations): New function.
+ (update_breakpoint_locations): Add 'filter_pspace' parameter. Use
+ hoist_existing_locations instead of always removing all locations,
+ and adjust to all_locations_are_pending change.
+ (location_to_sals): Add 'search_pspace' parameter. Pass it along.
+ Don't disable the breakpoint if there are other locations in
+ another program space.
+ (breakpoint_re_set_default): Adjust to pass down the current
+ program space as filter program space.
+ (decode_location_default): Add 'search_pspace' parameter and pass
+ it along.
+ (prepare_re_set_context): Don't switch program space here.
+ (breakpoint_re_set): Use save_current_space_and_thread instead of
+ save_current_program_space.
+ * breakpoint.h (struct breakpoint_ops) <decode_location>: Add
+ 'search_pspace' parameter.
+ (update_breakpoint_locations): Add 'filter_pspace' parameter.
+ * cli/cli-cmds.c (edit_command, list_command): Adjust calls to
+ decode_line_1.
+ * elfread.c (elf_gnu_ifunc_resolver_return_stop): Pass the current
+ program space as filter program space.
+ * linespec.c (struct linespec_state) <search_pspace>: New field.
+ (create_sals_line_offset, convert_explicit_location_to_sals)
+ (parse_linespec): Pass the search program space down.
+ (linespec_state_constructor): Add 'search_pspace' parameter.
+ Store it.
+ (linespec_parser_new): Add 'search_pspace' parameter and pass it
+ along.
+ (linespec_lex_to_end): Adjust.
+ (decode_line_full, decode_line_1): Add 'search_pspace' parameter
+ and pass it along.
+ (decode_line_with_last_displayed): Adjust.
+ (collect_symtabs_from_filename, symtabs_from_filename): New
+ 'search_pspace' parameter. Use it.
+ (find_function_symbols): Pass the search program space down.
+ * linespec.h (decode_line_1, decode_line_full): Add
+ 'search_pspace' parameter.
+ * probe.c (parse_probes_in_pspace): New function, factored out
+ from ...
+ (parse_probes): ... this. Add 'search_pspace' parameter and use
+ it.
+ * probe.h (parse_probes): Add pspace' parameter.
+ * python/python.c (gdbpy_decode_line): Adjust.
+ * tracepoint.c (scope_info): Adjust.
+
2016-01-19 Marcin KoĆcielnicki <koriakin@0x04.net>
* gdb.trace/ftrace.exp: Fix expected message on continue.
location = string_to_event_location (&args, current_language);
back_to = make_cleanup_delete_event_location (location);
- sals = decode_line_1 (location, DECODE_LINE_FUNFIRSTLINE, NULL, 0);
+ sals = decode_line_1 (location, DECODE_LINE_FUNFIRSTLINE, NULL, NULL, 0);
if (sals.nelts == 0)
{
/* Presumably decode_line_1 has already warned. */