2001-01-24 Fernando Nasser <fnasser@redhat.com>
* infcmd.c (get_inferior_args, set_inferior_args): Accessor functions for the inferior program arguments. (run_command, run_no_args_command, init_infcmd)): Use accessor functions to set the inferior program arguments. * inferior.h: Add definitions to the accessor functions above.
This commit is contained in:
parent
554064594b
commit
07091751ff
@ -1,3 +1,11 @@
|
|||||||
|
2001-01-24 Fernando Nasser <fnasser@redhat.com>
|
||||||
|
|
||||||
|
* infcmd.c (get_inferior_args, set_inferior_args): Accessor functions
|
||||||
|
for the inferior program arguments.
|
||||||
|
(run_command, run_no_args_command, init_infcmd)): Use accessor
|
||||||
|
functions to set the inferior program arguments.
|
||||||
|
* inferior.h: Add definitions to the accessor functions above.
|
||||||
|
|
||||||
2001-01-23 Jim Blandy <jimb@redhat.com>
|
2001-01-23 Jim Blandy <jimb@redhat.com>
|
||||||
|
|
||||||
* dwarf2read.c (read_tag_const_type, read_tag_volatile_type):
|
* dwarf2read.c (read_tag_const_type, read_tag_volatile_type):
|
||||||
|
29
gdb/infcmd.c
29
gdb/infcmd.c
@ -191,6 +191,23 @@ int step_multi;
|
|||||||
|
|
||||||
struct environ *inferior_environ;
|
struct environ *inferior_environ;
|
||||||
|
|
||||||
|
/* Accessor routines. */
|
||||||
|
|
||||||
|
char *
|
||||||
|
get_inferior_args (void)
|
||||||
|
{
|
||||||
|
return inferior_args;
|
||||||
|
}
|
||||||
|
|
||||||
|
char *
|
||||||
|
set_inferior_args (char *newargs)
|
||||||
|
{
|
||||||
|
char *saved_args = inferior_args;
|
||||||
|
|
||||||
|
inferior_args = newargs;
|
||||||
|
|
||||||
|
return saved_args;
|
||||||
|
}
|
||||||
|
|
||||||
/* This function detects whether or not a '&' character (indicating
|
/* This function detects whether or not a '&' character (indicating
|
||||||
background execution) has been added as *the last* of the arguments ARGS
|
background execution) has been added as *the last* of the arguments ARGS
|
||||||
@ -280,7 +297,6 @@ Start it from the beginning? "))
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *cmd;
|
|
||||||
int async_exec = strip_bg_char (&args);
|
int async_exec = strip_bg_char (&args);
|
||||||
|
|
||||||
/* If we get a request for running in the bg but the target
|
/* If we get a request for running in the bg but the target
|
||||||
@ -299,9 +315,8 @@ Start it from the beginning? "))
|
|||||||
/* If there were other args, beside '&', process them. */
|
/* If there were other args, beside '&', process them. */
|
||||||
if (args)
|
if (args)
|
||||||
{
|
{
|
||||||
cmd = concat ("set args ", args, NULL);
|
char *old_args = set_inferior_args (xstrdup (args));
|
||||||
make_cleanup (xfree, cmd);
|
xfree (old_args);
|
||||||
execute_command (cmd, from_tty);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -335,8 +350,8 @@ Start it from the beginning? "))
|
|||||||
static void
|
static void
|
||||||
run_no_args_command (char *args, int from_tty)
|
run_no_args_command (char *args, int from_tty)
|
||||||
{
|
{
|
||||||
execute_command ("set args", from_tty);
|
char *old_args = set_inferior_args (xstrdup (""));
|
||||||
run_command ((char *) NULL, from_tty);
|
xfree (old_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1944,7 +1959,7 @@ Register name as argument means describe only that register.");
|
|||||||
add_info ("float", float_info,
|
add_info ("float", float_info,
|
||||||
"Print the status of the floating point unit\n");
|
"Print the status of the floating point unit\n");
|
||||||
|
|
||||||
inferior_args = savestring ("", 1); /* Initially no args */
|
set_inferior_args (xstrdup ("")); /* Initially no args */
|
||||||
inferior_environ = make_environ ();
|
inferior_environ = make_environ ();
|
||||||
init_environ (inferior_environ);
|
init_environ (inferior_environ);
|
||||||
}
|
}
|
||||||
|
@ -285,6 +285,10 @@ extern void tty_command (char *, int);
|
|||||||
|
|
||||||
extern void attach_command (char *, int);
|
extern void attach_command (char *, int);
|
||||||
|
|
||||||
|
extern char *get_inferior_arg (void);
|
||||||
|
|
||||||
|
extern char *set_inferior_arg (char *);
|
||||||
|
|
||||||
/* Last signal that the inferior received (why it stopped). */
|
/* Last signal that the inferior received (why it stopped). */
|
||||||
|
|
||||||
extern enum target_signal stop_signal;
|
extern enum target_signal stop_signal;
|
||||||
|
Loading…
Reference in New Issue
Block a user