X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Fprocess-stratum-target.c;h=c851090a7f2ea23913cb9e9d15360015f73a2a4c;hb=294c36eb6ac9eaf761ec300fd400623ed5175203;hp=719167803fff47f8b9cbf31c49ea5451f6a1db9f;hpb=2af87c859fe450d4a3a841cf19637a91d53c9486;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/process-stratum-target.c b/gdb/process-stratum-target.c index 719167803f..c851090a7f 100644 --- a/gdb/process-stratum-target.c +++ b/gdb/process-stratum-target.c @@ -84,6 +84,26 @@ process_stratum_target::has_execution (inferior *inf) return inf->pid != 0; } +void +process_stratum_target::follow_exec (inferior *follow_inf, ptid_t ptid, + const char *execd_pathname) +{ + inferior *orig_inf = current_inferior (); + + if (orig_inf != follow_inf) + { + /* Execution continues in a new inferior, push the original inferior's + process target on the new inferior's target stack. The process target + may decide to unpush itself from the original inferior's target stack + after that, at its discretion. */ + follow_inf->push_target (orig_inf->process_target ()); + thread_info *t = add_thread (follow_inf->process_target (), ptid); + + /* Leave the new inferior / thread as the current inferior / thread. */ + switch_to_thread (t); + } +} + /* See process-stratum-target.h. */ std::set