static void target_info (char *, int);
+static void generic_tls_error (void) ATTRIBUTE_NORETURN;
+
static void default_terminal_info (struct target_ops *, const char *, int);
static int default_watchpoint_addr_within_range (struct target_ops *,
static void debug_to_terminal_ours (struct target_ops *self);
-static void debug_to_load (struct target_ops *self, char *, int);
+static void debug_to_load (struct target_ops *self, const char *, int);
static int debug_to_can_run (struct target_ops *self);
}
void
-target_load (char *arg, int from_tty)
+target_load (const char *arg, int from_tty)
{
target_dcache_invalidate ();
(*current_target.to_load) (¤t_target, arg, from_tty);
return 0;
}
+/* Default implementation of to_get_thread_local_address. */
+
+static void
+generic_tls_error (void)
+{
+ throw_error (TLS_GENERIC_ERROR,
+ _("Cannot find thread-local variables on this target"));
+}
+
/* Using the objfile specified in OBJFILE, find the address for the
current thread's thread-local storage with offset OFFSET. */
CORE_ADDR
target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
{
volatile CORE_ADDR addr = 0;
- struct target_ops *target;
-
- for (target = current_target.beneath;
- target != NULL;
- target = target->beneath)
- {
- if (target->to_get_thread_local_address != NULL)
- break;
- }
+ struct target_ops *target = ¤t_target;
- if (target != NULL
- && gdbarch_fetch_tls_load_module_address_p (target_gdbarch ()))
+ if (gdbarch_fetch_tls_load_module_address_p (target_gdbarch ()))
{
ptid_t ptid = inferior_ptid;
volatile struct gdb_exception ex;
/* Implement the "info proc" command. */
int
-target_info_proc (char *args, enum info_proc_what what)
+target_info_proc (const char *args, enum info_proc_what what)
{
struct target_ops *t;
/* See target.h. */
-void
-target_info_record (void)
-{
- struct target_ops *t;
-
- for (t = current_target.beneath; t != NULL; t = t->beneath)
- if (t->to_info_record != NULL)
- {
- t->to_info_record (t);
- return;
- }
-
- tcomplain ();
-}
-
-/* See target.h. */
-
void
target_save_record (const char *filename)
{
return current_target.to_decr_pc_after_break (¤t_target, gdbarch);
}
+/* See target.h. */
+
+void
+target_prepare_to_generate_core (void)
+{
+ current_target.to_prepare_to_generate_core (¤t_target);
+}
+
+/* See target.h. */
+
+void
+target_done_generating_core (void)
+{
+ current_target.to_done_generating_core (¤t_target);
+}
+
static void
debug_to_files_info (struct target_ops *target)
{
}
static void
-debug_to_load (struct target_ops *self, char *args, int from_tty)
+debug_to_load (struct target_ops *self, const char *args, int from_tty)
{
debug_target.to_load (&debug_target, args, from_tty);