* breakpoint.c (insert_breakpoints, breakpoint_init_inferior)
(update_global_location_list): Use gdbarch_has_global_breakpoints instead of gdbarch_has_global_solist and target_supports_multi_process. * dicos-tdep.c (dicos_init_abi): Set gdbarch_has_global_breakpoints. * gdbarch.sh (has_global_solist): Update comment. (has_global_breakpoints): New. * remote.c (remote_start_remote): Use gdbarch_has_global_breakpoints instead of gdbarch_has_global_solist. * target.c (target_detach): Use gdbarch_has_global_breakpoints instead of gdbarch_has_global_solist. * infcmd.c (attach_command): Use gdbarch_has_global_solist instead of target_supports_multi_process.
This commit is contained in:
parent
7b6175f9c6
commit
2567c7d9cc
8 changed files with 58 additions and 18 deletions
|
@ -1290,8 +1290,7 @@ insert_breakpoints (void)
|
|||
|
||||
if (!breakpoints_always_inserted_mode ()
|
||||
&& (target_has_execution
|
||||
|| (gdbarch_has_global_solist (target_gdbarch)
|
||||
&& target_supports_multi_process ())))
|
||||
|| gdbarch_has_global_breakpoints (target_gdbarch)))
|
||||
/* update_global_location_list does not insert breakpoints
|
||||
when always_inserted_mode is not enabled. Explicitly
|
||||
insert them now. */
|
||||
|
@ -1780,7 +1779,7 @@ breakpoint_init_inferior (enum inf_context context)
|
|||
|
||||
/* If breakpoint locations are shared across processes, then there's
|
||||
nothing to do. */
|
||||
if (gdbarch_has_global_solist (target_gdbarch))
|
||||
if (gdbarch_has_global_breakpoints (target_gdbarch))
|
||||
return;
|
||||
|
||||
ALL_BP_LOCATIONS (bpt)
|
||||
|
@ -7200,8 +7199,7 @@ update_global_location_list (int should_insert)
|
|||
|
||||
if (breakpoints_always_inserted_mode () && should_insert
|
||||
&& (target_has_execution
|
||||
|| (gdbarch_has_global_solist (target_gdbarch)
|
||||
&& target_supports_multi_process ())))
|
||||
|| (gdbarch_has_global_breakpoints (target_gdbarch))))
|
||||
insert_breakpoint_locations ();
|
||||
|
||||
do_cleanups (cleanups);
|
||||
|
|
|
@ -33,9 +33,14 @@ dicos_init_abi (struct gdbarch *gdbarch)
|
|||
set_solib_ops (gdbarch, &solib_target_so_ops);
|
||||
|
||||
/* Every process, although has its own address space, sees the same
|
||||
list of shared libraries. */
|
||||
list of shared libraries. There's no "main executable" in DICOS,
|
||||
so this accounts for all code. */
|
||||
set_gdbarch_has_global_solist (gdbarch, 1);
|
||||
|
||||
/* The DICOS breakpoint API takes care of magically making
|
||||
breakpoints visible to all inferiors. */
|
||||
set_gdbarch_has_global_breakpoints (gdbarch, 1);
|
||||
|
||||
/* There's no (standard definition of) entry point or a guaranteed
|
||||
text location with a symbol where to place the call dummy, so we
|
||||
put it on the stack. */
|
||||
|
|
|
@ -245,6 +245,7 @@ struct gdbarch
|
|||
gdbarch_get_siginfo_type_ftype *get_siginfo_type;
|
||||
gdbarch_record_special_symbol_ftype *record_special_symbol;
|
||||
int has_global_solist;
|
||||
int has_global_breakpoints;
|
||||
};
|
||||
|
||||
|
||||
|
@ -381,6 +382,7 @@ struct gdbarch startup_gdbarch =
|
|||
0, /* get_siginfo_type */
|
||||
0, /* record_special_symbol */
|
||||
0, /* has_global_solist */
|
||||
0, /* has_global_breakpoints */
|
||||
/* startup_gdbarch() */
|
||||
};
|
||||
|
||||
|
@ -638,6 +640,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
|
|||
/* Skip verify of get_siginfo_type, has predicate */
|
||||
/* Skip verify of record_special_symbol, has predicate */
|
||||
/* Skip verify of has_global_solist, invalid_p == 0 */
|
||||
/* Skip verify of has_global_breakpoints, invalid_p == 0 */
|
||||
buf = ui_file_xstrdup (log, &dummy);
|
||||
make_cleanup (xfree, buf);
|
||||
if (strlen (buf) > 0)
|
||||
|
@ -861,6 +864,9 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
|
|||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: get_siginfo_type = <%s>\n",
|
||||
host_address_to_string (gdbarch->get_siginfo_type));
|
||||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: has_global_breakpoints = %s\n",
|
||||
plongest (gdbarch->has_global_breakpoints));
|
||||
fprintf_unfiltered (file,
|
||||
"gdbarch_dump: has_global_solist = %s\n",
|
||||
plongest (gdbarch->has_global_solist));
|
||||
|
@ -3382,6 +3388,23 @@ set_gdbarch_has_global_solist (struct gdbarch *gdbarch,
|
|||
gdbarch->has_global_solist = has_global_solist;
|
||||
}
|
||||
|
||||
int
|
||||
gdbarch_has_global_breakpoints (struct gdbarch *gdbarch)
|
||||
{
|
||||
gdb_assert (gdbarch != NULL);
|
||||
/* Skip verify of has_global_breakpoints, invalid_p == 0 */
|
||||
if (gdbarch_debug >= 2)
|
||||
fprintf_unfiltered (gdb_stdlog, "gdbarch_has_global_breakpoints called\n");
|
||||
return gdbarch->has_global_breakpoints;
|
||||
}
|
||||
|
||||
void
|
||||
set_gdbarch_has_global_breakpoints (struct gdbarch *gdbarch,
|
||||
int has_global_breakpoints)
|
||||
{
|
||||
gdbarch->has_global_breakpoints = has_global_breakpoints;
|
||||
}
|
||||
|
||||
|
||||
/* Keep a registry of per-architecture data-pointers required by GDB
|
||||
modules. */
|
||||
|
|
|
@ -863,13 +863,21 @@ extern void set_gdbarch_record_special_symbol (struct gdbarch *gdbarch, gdbarch_
|
|||
|
||||
/* True if the list of shared libraries is one and only for all
|
||||
processes, as opposed to a list of shared libraries per inferior.
|
||||
When this property is true, GDB assumes that since shared libraries
|
||||
are shared across processes, so is all code. Hence, GDB further
|
||||
assumes an inserted breakpoint location is visible to all processes. */
|
||||
This usually means that all processes, although may or may not share
|
||||
an address space, will see the same set of symbols at the same
|
||||
addresses. */
|
||||
|
||||
extern int gdbarch_has_global_solist (struct gdbarch *gdbarch);
|
||||
extern void set_gdbarch_has_global_solist (struct gdbarch *gdbarch, int has_global_solist);
|
||||
|
||||
/* On some targets, even though each inferior has its own private
|
||||
address space, the debug interface takes care of making breakpoints
|
||||
visible to all address spaces automatically. For such cases,
|
||||
this property should be set to true. */
|
||||
|
||||
extern int gdbarch_has_global_breakpoints (struct gdbarch *gdbarch);
|
||||
extern void set_gdbarch_has_global_breakpoints (struct gdbarch *gdbarch, int has_global_breakpoints);
|
||||
|
||||
extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
|
||||
|
||||
|
||||
|
|
|
@ -732,10 +732,16 @@ M:void:record_special_symbol:struct objfile *objfile, asymbol *sym:objfile, sym
|
|||
|
||||
# True if the list of shared libraries is one and only for all
|
||||
# processes, as opposed to a list of shared libraries per inferior.
|
||||
# When this property is true, GDB assumes that since shared libraries
|
||||
# are shared across processes, so is all code. Hence, GDB further
|
||||
# assumes an inserted breakpoint location is visible to all processes.
|
||||
# This usually means that all processes, although may or may not share
|
||||
# an address space, will see the same set of symbols at the same
|
||||
# addresses.
|
||||
v:int:has_global_solist:::0:0::0
|
||||
|
||||
# On some targets, even though each inferior has its own private
|
||||
# address space, the debug interface takes care of making breakpoints
|
||||
# visible to all address spaces automatically. For such cases,
|
||||
# this property should be set to true.
|
||||
v:int:has_global_breakpoints:::0:0::0
|
||||
EOF
|
||||
}
|
||||
|
||||
|
|
|
@ -2220,8 +2220,9 @@ attach_command (char *args, int from_tty)
|
|||
|
||||
dont_repeat (); /* Not for the faint of heart */
|
||||
|
||||
if (target_supports_multi_process ())
|
||||
/* Don't complain if we can be attached to multiple processes. */
|
||||
if (gdbarch_has_global_solist (target_gdbarch))
|
||||
/* Don't complain if all processes share the same symbol
|
||||
space. */
|
||||
;
|
||||
else if (target_has_execution)
|
||||
{
|
||||
|
|
|
@ -2824,9 +2824,8 @@ remote_start_remote (struct ui_out *uiout, void *opaque)
|
|||
remote_check_symbols (symfile_objfile);
|
||||
}
|
||||
|
||||
/* If code is shared between processes, then breakpoints are global
|
||||
too; Insert them now. */
|
||||
if (gdbarch_has_global_solist (target_gdbarch)
|
||||
/* If breakpoints are global, insert them now. */
|
||||
if (gdbarch_has_global_breakpoints (target_gdbarch)
|
||||
&& breakpoints_always_inserted_mode ())
|
||||
insert_breakpoints ();
|
||||
}
|
||||
|
|
|
@ -1788,7 +1788,7 @@ target_detach (char *args, int from_tty)
|
|||
{
|
||||
struct target_ops* t;
|
||||
|
||||
if (gdbarch_has_global_solist (target_gdbarch))
|
||||
if (gdbarch_has_global_breakpoints (target_gdbarch))
|
||||
/* Don't remove global breakpoints here. They're removed on
|
||||
disconnection from the target. */
|
||||
;
|
||||
|
|
Loading…
Reference in a new issue