diff options
author | Markus Metzger <mmetzger@sourceware.org> | 2013-03-11 08:39:38 +0000 |
---|---|---|
committer | Markus Metzger <mmetzger@sourceware.org> | 2013-03-11 08:39:38 +0000 |
commit | b48d48ebed2efed429a1e6b92603d784b703a4ab (patch) | |
tree | 59c3c0dd37156b8ee7614b005ccbe04692cd87b5 /gdb/target.c | |
parent | a950d57c9fcf0b82e9b625398c24bf9c70717c0f (diff) | |
download | gdb-b48d48ebed2efed429a1e6b92603d784b703a4ab.zip gdb-b48d48ebed2efed429a1e6b92603d784b703a4ab.tar.gz gdb-b48d48ebed2efed429a1e6b92603d784b703a4ab.tar.bz2 |
Add a new function to target.h to add an alias command for a target and mark it
deprecated. This is useful when renaming targets.
gdb/
* target.h (add_deprecated_target_alias): New.
* target.c (add_deprecated_target_alias): New.
Diffstat (limited to 'gdb/target.c')
-rw-r--r-- | gdb/target.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c index 524caec..dd20184 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -434,6 +434,21 @@ information on the arguments for a particular protocol, type\n\ 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 |