Browse Source

Give every interpreter a command_loop_proc.

https://sourceware.org/ml/gdb-patches/2013-09/msg00179.html

gdb/ChangeLog

        * cli/cli-interp.c (_initialize_cli_interp): Add a
        command_loop_proc to interp_procs.
        * event-top.c (cli_command_loop): Change signature to match
        interp_command_loop_ftype.
        * event-top.h (cli_command_loop): Same.
        * interps.c (interp_new): Require every interpreter to have a
        command_loop_proc.
        (current_interp_command_loop): Just call the command_loop_proc on
        the current interpreter.
        * tui/tui-interp.c (_initialize_tui_interp): Add a
        command_loop_proc to interp_procs.
binutils-2_24-branch
Andrew Burgess 13 years ago
parent
commit
4d09c5b423
  1. 14
      gdb/ChangeLog
  2. 4
      gdb/cli/cli-interp.c
  3. 6
      gdb/event-top.c
  4. 2
      gdb/event-top.h
  5. 13
      gdb/interps.c
  6. 2
      gdb/tui/tui-interp.c

14
gdb/ChangeLog

@ -1,3 +1,17 @@
2013-09-06 Andrew Burgess <aburgess@broadcom.com>
* cli/cli-interp.c (_initialize_cli_interp): Add a
command_loop_proc to interp_procs.
* event-top.c (cli_command_loop): Change signature to match
interp_command_loop_ftype.
* event-top.h (cli_command_loop): Same.
* interps.c (interp_new): Require every interpreter to have a
command_loop_proc.
(current_interp_command_loop): Just call the command_loop_proc on
the current interpreter.
* tui/tui-interp.c (_initialize_tui_interp): Add a
command_loop_proc to interp_procs.
2013-09-06 Ricard Wanderlof <ricardw@axis.com> 2013-09-06 Ricard Wanderlof <ricardw@axis.com>
* cris-tdep.c (cris_gdbarch_init): Add call to * cris-tdep.c (cris_gdbarch_init): Add call to

4
gdb/cli/cli-interp.c

@ -151,7 +151,9 @@ _initialize_cli_interp (void)
cli_interpreter_suspend, /* suspend_proc */ cli_interpreter_suspend, /* suspend_proc */
cli_interpreter_exec, /* exec_proc */ cli_interpreter_exec, /* exec_proc */
cli_interpreter_display_prompt_p, /* prompt_proc_p */ cli_interpreter_display_prompt_p, /* prompt_proc_p */
cli_ui_out /* ui_out_proc */ cli_ui_out, /* ui_out_proc */
NULL, /* set_logging_proc */
cli_command_loop /* command_loop_proc */
}; };
struct interp *cli_interp; struct interp *cli_interp;

6
gdb/event-top.c

@ -167,9 +167,11 @@ rl_callback_read_char_wrapper (gdb_client_data client_data)
} }
/* Initialize all the necessary variables, start the event loop, /* Initialize all the necessary variables, start the event loop,
register readline, and stdin, start the loop. */ register readline, and stdin, start the loop. The DATA is the
interpreter data cookie, ignored for now. */
void void
cli_command_loop (void) cli_command_loop (void *data)
{ {
display_gdb_prompt (0); display_gdb_prompt (0);

2
gdb/event-top.h

@ -62,6 +62,6 @@ extern void (*input_handler) (char *);
extern int input_fd; extern int input_fd;
extern void (*after_char_processing_hook) (void); extern void (*after_char_processing_hook) (void);
extern void cli_command_loop (void); extern void cli_command_loop (void *);
#endif #endif

13
gdb/interps.c

@ -101,6 +101,9 @@ interp_new (const char *name, const struct interp_procs *procs)
new_interp->procs = procs; new_interp->procs = procs;
new_interp->inited = 0; new_interp->inited = 0;
/* Check for required procs. */
gdb_assert (procs->command_loop_proc != NULL);
return new_interp; return new_interp;
} }
@ -319,13 +322,9 @@ current_interp_display_prompt_p (void)
void void
current_interp_command_loop (void) current_interp_command_loop (void)
{ {
/* Somewhat messy. For the moment prop up all the old ways of gdb_assert (current_interpreter != NULL);
selecting the command loop. */
if (current_interpreter != NULL current_interpreter->procs->command_loop_proc (current_interpreter->data);
&& current_interpreter->procs->command_loop_proc != NULL)
current_interpreter->procs->command_loop_proc (current_interpreter->data);
else
cli_command_loop ();
} }
int int

2
gdb/tui/tui-interp.c

@ -153,6 +153,8 @@ _initialize_tui_interp (void)
tui_exec, tui_exec,
tui_display_prompt_p, tui_display_prompt_p,
tui_ui_out, tui_ui_out,
NULL,
cli_command_loop
}; };
struct interp *tui_interp; struct interp *tui_interp;

Loading…
Cancel
Save