+2013-03-11 Markus Metzger <markus.t.metzger@intel.com>
+
+ * target.h (add_deprecated_target_alias): New.
+ * target.c (add_deprecated_target_alias): New.
+
2013-03-11 Markus Metzger <markus.t.metzger@intel.com>
* common/linux-btrace.c: Include sys/ptrace, sys/types, sys/wait.h,
add_cmd (t->to_shortname, no_class, t->to_open, t->to_doc, &targetlist);
}
+/* See target.h. */
+
+void
+add_deprecated_target_alias (struct target_ops *t, char *alias)
+{
+ struct cmd_list_element *c;
+ char *alt;
+
+ /* If we use add_alias_cmd, here, we do not get the deprecated warning,
+ see PR cli/15104. */
+ c = add_cmd (alias, no_class, t->to_open, t->to_doc, &targetlist);
+ alt = xstrprintf ("target %s", t->to_shortname);
+ deprecate_cmd (c, alt);
+}
+
/* Stub functions */
void
extern void add_target (struct target_ops *);
+/* Adds a command ALIAS for target T and marks it deprecated. This is useful
+ for maintaining backwards compatibility when renaming targets. */
+
+extern void add_deprecated_target_alias (struct target_ops *t, char *alias);
+
extern void push_target (struct target_ops *);
extern int unpush_target (struct target_ops *);