projects
/
platform
/
upstream
/
gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Imported Upstream version 7.9
[platform/upstream/gdb.git]
/
gdb
/
inferior.c
diff --git
a/gdb/inferior.c
b/gdb/inferior.c
index
23da0c7
..
6b4f65f
100644
(file)
--- a/
gdb/inferior.c
+++ b/
gdb/inferior.c
@@
-1,6
+1,6
@@
/* Multi-process control for GDB, the GNU debugger.
/* Multi-process control for GDB, the GNU debugger.
- Copyright (C) 2008-201
4
Free Software Foundation, Inc.
+ Copyright (C) 2008-201
5
Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-275,8
+275,6
@@
exit_inferior_1 (struct inferior *inftoex, int silent)
inf->vfork_child = NULL;
}
inf->vfork_child = NULL;
}
- inf->has_exit_code = 0;
- inf->exit_code = 0;
inf->pending_detach = 0;
}
inf->pending_detach = 0;
}
@@
-322,6
+320,8
@@
void
inferior_appeared (struct inferior *inf, int pid)
{
inf->pid = pid;
inferior_appeared (struct inferior *inf, int pid)
{
inf->pid = pid;
+ inf->has_exit_code = 0;
+ inf->exit_code = 0;
observer_notify_inferior_appeared (inf);
}
observer_notify_inferior_appeared (inf);
}
@@
-367,12
+367,23
@@
find_inferior_pid (int pid)
return NULL;
}
return NULL;
}
-/* Find an inferior bound to PSPACE. */
+/* See inferior.h */
+
+struct inferior *
+find_inferior_ptid (ptid_t ptid)
+{
+ return find_inferior_pid (ptid_get_pid (ptid));
+}
+
+/* See inferior.h. */
struct inferior *
find_inferior_for_program_space (struct program_space *pspace)
{
struct inferior *
find_inferior_for_program_space (struct program_space *pspace)
{
- struct inferior *inf;
+ struct inferior *inf = current_inferior ();
+
+ if (inf->pspace == pspace)
+ return inf;
for (inf = inferior_list; inf != NULL; inf = inf->next)
{
for (inf = inferior_list; inf != NULL; inf = inf->next)
{