aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-cmds.c5
-rw-r--r--gdb/cli/cli-cmds.h2
-rw-r--r--gdb/cli/cli-decode.c7
-rw-r--r--gdb/cli/cli-decode.h4
4 files changed, 15 insertions, 3 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 9d9d9ce..16cc989 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -259,9 +259,10 @@ complete_command (char *arg, int from_tty)
}
}
-int is_complete_command (void (*func) (char *args, int from_tty))
+int
+is_complete_command (struct cmd_list_element *c)
{
- return func == complete_command;
+ return cmd_cfunc_eq (c, complete_command);
}
/* ARGSUSED */
diff --git a/gdb/cli/cli-cmds.h b/gdb/cli/cli-cmds.h
index d1515cd..a6e574e 100644
--- a/gdb/cli/cli-cmds.h
+++ b/gdb/cli/cli-cmds.h
@@ -105,7 +105,7 @@ void init_cmd_lists (void);
void init_cli_cmds (void);
-int is_complete_command (void (*func) (char *args, int from_tty));
+int is_complete_command (struct cmd_list_element *cmd);
/* Exported to gdb/main.c */
diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
index d64b2f6..a13b7b8 100644
--- a/gdb/cli/cli-decode.c
+++ b/gdb/cli/cli-decode.c
@@ -79,6 +79,13 @@ set_cmd_sfunc (struct cmd_list_element *cmd,
cmd->function.sfunc = sfunc; /* Ok. */
}
+int
+cmd_cfunc_eq (struct cmd_list_element *cmd,
+ void (*cfunc) (char *args, int from_tty))
+{
+ return cmd->func == do_cfunc && cmd->function.cfunc == cfunc;
+}
+
/* Add element named NAME.
CLASS is the top level category into which commands are broken down
diff --git a/gdb/cli/cli-decode.h b/gdb/cli/cli-decode.h
index 6c7c22b..e4b7c55 100644
--- a/gdb/cli/cli-decode.h
+++ b/gdb/cli/cli-decode.h
@@ -286,6 +286,10 @@ extern void set_cmd_sfunc (struct cmd_list_element *cmd,
void (*sfunc) (char *args, int from_tty,
struct cmd_list_element * c));
+/* HACK: cagney/2002-02-23: Code, mostly in tracepoints.c, grubs
+ around in cmd objects to test the value of the commands sfunc(). */
+extern int cmd_cfunc_eq (struct cmd_list_element *cmd,
+ void (*cfunc) (char *args, int from_tty));
extern struct cmd_list_element *lookup_cmd (char **,
struct cmd_list_element *, char *,