/* GDB commands implemented in Scheme.
- Copyright (C) 2008-2014 Free Software Foundation, Inc.
+ Copyright (C) 2008-2015 Free Software Foundation, Inc.
This file is part of GDB.
command_smob *c_smob = (command_smob *) context;
cmdscm_release_command (c_smob);
-
- /* We allocated the name, doc string, and perhaps the prefix name. */
- xfree ((char *) self->name);
- xfree ((char *) self->doc);
- xfree ((char *) self->prefixname);
}
/* Called by gdb to invoke the command. */
static const scheme_integer_constant command_classes[] =
{
/* Note: alias and user are special; pseudo appears to be unused,
- and there is no reason to expose tui or xdb, I think. */
+ and there is no reason to expose tui, I think. */
{ "COMMAND_NONE", no_class },
{ "COMMAND_RUNNING", class_run },
{ "COMMAND_DATA", class_vars },
int doc_arg_pos = -1;
char *s;
char *name;
- int command_class = no_class;
+ enum command_class command_class = no_class;
SCM completer_class = SCM_BOOL_F;
int is_prefix = 0;
char *doc = NULL;
char *cmd_name, *pfx_name;
struct cmd_list_element **cmd_list;
struct cmd_list_element *cmd = NULL;
- volatile struct gdb_exception except;
if (cmdscm_is_valid (c_smob))
scm_misc_error (FUNC_NAME, _("command is already registered"), SCM_EOL);
c_smob->cmd_name = gdbscm_gc_xstrdup (cmd_name);
xfree (cmd_name);
- TRY_CATCH (except, RETURN_MASK_ALL)
+ TRY
{
if (c_smob->is_prefix)
{
NULL, c_smob->doc, cmd_list);
}
}
- GDBSCM_HANDLE_GDB_EXCEPTION (except);
+ CATCH (except, RETURN_MASK_ALL)
+ {
+ GDBSCM_HANDLE_GDB_EXCEPTION (except);
+ }
+ END_CATCH
/* Note: At this point the command exists in gdb.
So no more errors after this point. */