diff options
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r-- | gdb/gdbserver/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/gdbserver/inferiors.c | 11 |
2 files changed, 17 insertions, 0 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 3de4b10..25d527b 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,5 +1,11 @@ 2017-10-04 Sergio Durigan Junior <sergiodj@redhat.com> + * inferiors.c (current_inferior_cwd): New global variable. + (get_inferior_cwd): New function. + * inferiors.h (struct process_info) <cwd>: New field. + +2017-10-04 Sergio Durigan Junior <sergiodj@redhat.com> + * Makefile.in (SFILES): Add $(srcdir)/common/gdb_tilde_expand.c. (OBS): Add gdb_tilde_expand.o. diff --git a/gdb/gdbserver/inferiors.c b/gdb/gdbserver/inferiors.c index 3a45959..57d9956 100644 --- a/gdb/gdbserver/inferiors.c +++ b/gdb/gdbserver/inferiors.c @@ -29,6 +29,9 @@ struct thread_info *current_thread; #define get_thread(inf) ((struct thread_info *)(inf)) +/* The current working directory used to start the inferior. */ +static const char *current_inferior_cwd = NULL; + void add_inferior_to_list (struct inferior_list *list, struct inferior_list_entry *new_inferior) @@ -445,3 +448,11 @@ switch_to_thread (ptid_t ptid) gdb_assert (ptid != minus_one_ptid); current_thread = find_thread_ptid (ptid); } + +/* See common/common-inferior.h. */ + +const char * +get_inferior_cwd () +{ + return current_inferior_cwd; +} |