mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-05-24 02:37:23 +08:00
2010-04-29 Phil Muldoon <pmuldoon@redhat.com>
Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> * Makefile.in (SUBDIR_PYTHON_OBS): Add py-parameter. (SUBDIR_PYTHON_SRCS): Likewise. (py-parameter.o): New rule. * python/py-parameter.c: New file. * python/python-internal.h (gdbpy_initialize_parameter) (gdbpy_parameter, gdbpy_parameter_value) (gdbpy_parse_command_name): Declare. * python/py-cmd.c (parse_command_name): Rename to gdbpy_parse_command_name. (gdbpy_parse_command_name): Accept a starting list parameter and use over cmdlist. (cmdpy_init): Use gdbpy_parse_command_name. * python/python.c (parameter_to_python): Rename to gdbpy_parameter_to_python. Accept enum var_types and value. (gdbpy_parameter): Use gdbpy_parameter_value. (_initialize_python): Call gdbpy_initialize_parameters. 2010-04-29 Phil Muldoon <pmuldoon@redhat.com> * gdb.python/py-param.exp: New File. 2010-04-29 Phil Muldoon <pmuldoon@redhat.com> Tom Tromey <tromey@redhat.com> Thiago Jung Bauermann <bauerman@br.ibm.com> * gdb.texinfo (Parameters In Python): New Node.
This commit is contained in:
@ -263,10 +263,14 @@ cmdpy_completer (struct cmd_list_element *command, char *text, char *word)
|
||||
*BASE_LIST is set to the final prefix command's list of
|
||||
*sub-commands.
|
||||
|
||||
START_LIST is the list in which the search starts.
|
||||
|
||||
This function returns the xmalloc()d name of the new command. On
|
||||
error sets the Python error and returns NULL. */
|
||||
static char *
|
||||
parse_command_name (char *text, struct cmd_list_element ***base_list)
|
||||
char *
|
||||
gdbpy_parse_command_name (char *text,
|
||||
struct cmd_list_element ***base_list,
|
||||
struct cmd_list_element **start_list)
|
||||
{
|
||||
struct cmd_list_element *elt;
|
||||
int len = strlen (text);
|
||||
@ -299,7 +303,7 @@ parse_command_name (char *text, struct cmd_list_element ***base_list)
|
||||
;
|
||||
if (i < 0)
|
||||
{
|
||||
*base_list = &cmdlist;
|
||||
*base_list = start_list;
|
||||
return result;
|
||||
}
|
||||
|
||||
@ -308,7 +312,7 @@ parse_command_name (char *text, struct cmd_list_element ***base_list)
|
||||
prefix_text[i + 1] = '\0';
|
||||
|
||||
text = prefix_text;
|
||||
elt = lookup_cmd_1 (&text, cmdlist, NULL, 1);
|
||||
elt = lookup_cmd_1 (&text, *start_list, NULL, 1);
|
||||
if (!elt || elt == (struct cmd_list_element *) -1)
|
||||
{
|
||||
PyErr_Format (PyExc_RuntimeError, _("Could not find command prefix %s."),
|
||||
@ -399,7 +403,7 @@ cmdpy_init (PyObject *self, PyObject *args, PyObject *kw)
|
||||
return -1;
|
||||
}
|
||||
|
||||
cmd_name = parse_command_name (name, &cmd_list);
|
||||
cmd_name = gdbpy_parse_command_name (name, &cmd_list, &cmdlist);
|
||||
if (! cmd_name)
|
||||
return -1;
|
||||
|
||||
|
Reference in New Issue
Block a user