summaryrefslogtreecommitdiff
path: root/gdb/inferior.h
diff options
context:
space:
mode:
authorVladimir Prus <vladimir@codesourcery.com>2010-01-20 14:23:07 +0000
committerVladimir Prus <vladimir@codesourcery.com>2010-01-20 14:23:07 +0000
commite9d6247f3e0c88822735be45843c7d44d8d9d2b8 (patch)
treead2c926c005d082c8c2bc6d2714c5f971bdcdb9e /gdb/inferior.h
parent47cf631cfac84796d765b828dc0f0a0f9e5f8421 (diff)
downloadgdb-e9d6247f3e0c88822735be45843c7d44d8d9d2b8.tar.gz
Per-inferior args and tty and environment.
* infcmd.c (inferior_args): Rename to ... (inferior_args_scratch): ... this. (inferior_io_terminal): Rename to ... (inferior_io_terminal_scratch): ... this. (inferior_argc, inferior_argv): Remove. (set_inferior_io_terminal, get_inferior_io_terminal): Store inside current_inferior(). (set_inferior_tty_command, show_inferior_tty_command): New. (get_inferior_args, set_inferior_args): Store inside current_inferior(). (notice_args_set): Likewise and rename to... (set_args_command): ... this. (set_inferior_args_vector): Likewise. (notice_args_read): Rename to... (show_args_command): ...new. (tty_command): Remove. (run_command_1): Don't free old args, as they are freed by set_inferior_arg now. (run_no_args_command): Likewise. (inferior_environ): Remove. (run_command_1): Use environment of the current inferior. (environment_info, set_environment_command) (unset_environment_command, path_info, path_command): Likewise. (_initialize_infcmd): Adjust for function and variable renames. Do not init inferior_environ. * inferior.h (set_inferior_arg): Adjust prototype. (struct inferior): New fields args, argc, argv, terminal, environment. (inferior_environ): Remove declaration. * inferior.c (free_inferior): Free new fields. (add_inferior_silent): Initialize 'environment' field. * main.c (captured_main): Set arguments only after the initial inferior has been created. Set set_inferior_io_terminal, not tty_command. * mi/mi-main.c (mi_cmd_env_path): Use environment of the current inferior. (_initialize_mi_cmd_env): Adjust for disappearance of global inferior_environ. * solib.c (solib_find): Use environment of the current inferior.
Diffstat (limited to 'gdb/inferior.h')
-rw-r--r--gdb/inferior.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/gdb/inferior.h b/gdb/inferior.h
index 9798ef144e4..e557d6c5c2a 100644
--- a/gdb/inferior.h
+++ b/gdb/inferior.h
@@ -131,8 +131,6 @@ extern int sync_execution;
/* Inferior environment. */
-extern struct gdb_environ *inferior_environ;
-
extern void clear_proceed_status (void);
extern void proceed (CORE_ADDR, enum target_signal, int);
@@ -253,15 +251,13 @@ void set_step_info (struct frame_info *frame, struct symtab_and_line sal);
/* From infcmd.c */
-extern void tty_command (char *, int);
-
extern void post_create_inferior (struct target_ops *, int);
extern void attach_command (char *, int);
extern char *get_inferior_args (void);
-extern char *set_inferior_args (char *);
+extern void set_inferior_args (char *);
extern void set_inferior_args_vector (int, char **);
@@ -427,6 +423,25 @@ struct inferior
/* The program space bound to this inferior. */
struct program_space *pspace;
+ /* The arguments string to use when running. */
+ char *args;
+
+ /* The size of elements in argv. */
+ int argc;
+
+ /* The vector version of arguments. If ARGC is nonzero,
+ then we must compute ARGS from this (via the target).
+ This is always coming from main's argv and therefore
+ should never be freed. */
+ char **argv;
+
+ /* The name of terminal device to use for I/O. */
+ char *terminal;
+
+ /* Environment to use for running inferior,
+ in format described in environ.h. */
+ struct gdb_environ *environment;
+
/* See the definition of stop_kind above. */
enum stop_kind stop_soon;