diff options
Diffstat (limited to 'gdb/linux-thread-db.c')
-rw-r--r-- | gdb/linux-thread-db.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 1c6ea4d..2c75cd6 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -95,6 +95,7 @@ public: ptid_t wait (ptid_t, struct target_waitstatus *, target_wait_flags) override; void resume (ptid_t, int, enum gdb_signal) override; void mourn_inferior () override; + void follow_exec (inferior *, ptid_t, const char *) override; void update_thread_list () override; std::string pid_to_str (ptid_t) override; CORE_ADDR get_thread_local_address (ptid_t ptid, @@ -1384,6 +1385,7 @@ thread_db_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus, case TARGET_WAITKIND_EXITED: case TARGET_WAITKIND_THREAD_EXITED: case TARGET_WAITKIND_SIGNALLED: + case TARGET_WAITKIND_EXECD: return ptid; } @@ -1393,16 +1395,6 @@ thread_db_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus, if (info == NULL) return ptid; - if (ourstatus->kind == TARGET_WAITKIND_EXECD) - { - /* New image, it may or may not end up using thread_db. Assume - not unless we find otherwise. */ - delete_thread_db_info (beneath, ptid.pid ()); - current_inferior ()->unpush_target (this); - - return ptid; - } - /* Fill in the thread's user-level thread id and status. */ thread_from_lwp (find_thread_ptid (beneath, ptid), ptid); @@ -1423,6 +1415,19 @@ thread_db_target::mourn_inferior () current_inferior ()->unpush_target (this); } +void +thread_db_target::follow_exec (inferior *follow_inf, ptid_t ptid, + const char *execd_pathname) +{ + process_stratum_target *beneath + = as_process_stratum_target (this->beneath ()); + + delete_thread_db_info (beneath, ptid.pid ()); + + current_inferior ()->unpush_target (this); + beneath->follow_exec (follow_inf, ptid, execd_pathname); +} + struct callback_data { struct thread_db_info *info; |