forked from Imagelibrary/binutils-gdb
* command.h (struct cmd_list_element): Add field context.
(set_cmd_context, get_cmd_context): Declare. * cli/cli-decode.h: Ditto. * cli/cli-decode.c (get_cmd_context): New function. (set_cmd_context): New function. (add_cmd): Initialize context. Part of fixing PR gdb/145 and PR gdb/146.
This commit is contained in:
@@ -139,6 +139,9 @@ struct cmd_list_element
|
||||
}
|
||||
function;
|
||||
|
||||
/* Local state (context) for this command. This can be anything. */
|
||||
void *context;
|
||||
|
||||
/* Documentation of this command (or help topic).
|
||||
First line is brief documentation; remaining lines form, with it,
|
||||
the full documentation. First line should end with a period.
|
||||
@@ -294,6 +297,10 @@ extern void set_cmd_completer (struct cmd_list_element *cmd,
|
||||
extern int cmd_cfunc_eq (struct cmd_list_element *cmd,
|
||||
void (*cfunc) (char *args, int from_tty));
|
||||
|
||||
/* Access to the command's local context. */
|
||||
extern void set_cmd_context (struct cmd_list_element *cmd, void *context);
|
||||
extern void *get_cmd_context (struct cmd_list_element *cmd);
|
||||
|
||||
extern struct cmd_list_element *lookup_cmd (char **,
|
||||
struct cmd_list_element *, char *,
|
||||
int, int);
|
||||
|
||||
Reference in New Issue
Block a user