summaryrefslogtreecommitdiff
path: root/gdb/command.h
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-03-19 02:19:17 +0000
committerAndrew Cagney <cagney@redhat.com>2002-03-19 02:19:17 +0000
commit4f63f770b079264e0e4caeec3bd723ea868c07ca (patch)
tree62be522182f6384733bef8b6e3c37afb758698df /gdb/command.h
parent66141112b60f4c8fb00f045e983cac9eeb4a567a (diff)
downloadgdb-4f63f770b079264e0e4caeec3bd723ea868c07ca.tar.gz
* 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.
Diffstat (limited to 'gdb/command.h')
-rw-r--r--gdb/command.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gdb/command.h b/gdb/command.h
index fffa3be5324..5f7284e4dfe 100644
--- a/gdb/command.h
+++ b/gdb/command.h
@@ -145,6 +145,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.
@@ -300,6 +303,11 @@ 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));
+/* Each command object has a local context attached to it. . */
+extern void set_cmd_context (struct cmd_list_element *cmd, void *context);
+extern void *get_cmd_context (struct cmd_list_element *cmd);
+
+
/* Execute CMD's pre/post hook. Throw an error if the command fails.
If already executing this pre/post hook, or there is no pre/post
hook, the call is silently ignored. */