* mi/mi-main.c (mi_cmd_execute): Use cleanup from
	prepare_execute_command.
	* top.c (prepare_execute_command): Return cleanup.
	(execute_command): Use cleanup from prepare_execute_command.
	* top.h (prepare_execute_command): Change prototype to return
	cleanup.
	* defs.h (struct value): Add opaque declaration.
	(make_cleanup_value_free_to_mark): Add prototype.
	* utils.c (do_value_free_to_mark): New function.
	(make_cleanup_value_free_to_mark): Likewise.

gdb/testsuite/
	* gdb.python/py-function.exp: Test setting a value from a function
	which executes a command.
This commit is contained in:
Thiago Jung Bauermann
2011-05-13 04:34:25 +00:00
parent c9eaa05f39
commit 028d0ed5d1
8 changed files with 68 additions and 8 deletions

View File

@ -48,8 +48,9 @@ extern int quit_cover (void *);
extern void execute_command (char *, int);
/* Prepare for execution of a command.
Call this before every command, CLI or MI. */
extern void prepare_execute_command (void);
Call this before every command, CLI or MI.
Returns a cleanup to be run after the command is completed. */
extern struct cleanup *prepare_execute_command (void);
/* This function returns a pointer to the string that is used
by gdb for its command prompt. */