X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=gdb%2Finferior.c;h=6b4f65fd1e810d0b263761754ea9bbe923b0055e;hb=003ea5a89ab7e9eaa65cb158a953d63dac2612c6;hp=23da0c7fe4d95a03d8366bfc2d2a9aa977d8d5f0;hpb=a0eaec95753c0f093f5cb80080ef423030d35edd;p=platform%2Fupstream%2Fgdb.git diff --git a/gdb/inferior.c b/gdb/inferior.c index 23da0c7..6b4f65f 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -1,6 +1,6 @@ /* Multi-process control for GDB, the GNU debugger. - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2015 Free Software Foundation, Inc. This file is part of GDB. @@ -275,8 +275,6 @@ exit_inferior_1 (struct inferior *inftoex, int silent) inf->vfork_child = NULL; } - inf->has_exit_code = 0; - inf->exit_code = 0; inf->pending_detach = 0; } @@ -322,6 +320,8 @@ void inferior_appeared (struct inferior *inf, int pid) { inf->pid = pid; + inf->has_exit_code = 0; + inf->exit_code = 0; observer_notify_inferior_appeared (inf); } @@ -367,12 +367,23 @@ find_inferior_pid (int pid) 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 *inf; + struct inferior *inf = current_inferior (); + + if (inf->pspace == pspace) + return inf; for (inf = inferior_list; inf != NULL; inf = inf->next) {