diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2014-12-15 12:00:55 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2014-12-15 12:00:55 -0500 |
commit | c9657e708a03cb06ad92ce81bf17c68d28e57689 (patch) | |
tree | 87595320210e128f722acce17a2b7d5e91dfc5f2 /gdb/linux-nat.c | |
parent | e882ef3cfc3d991433c3b9aed104961ad3ce5904 (diff) | |
download | gdb-c9657e708a03cb06ad92ce81bf17c68d28e57689.zip gdb-c9657e708a03cb06ad92ce81bf17c68d28e57689.tar.gz gdb-c9657e708a03cb06ad92ce81bf17c68d28e57689.tar.bz2 |
Introduce utility function find_inferior_ptid
This patch introduces find_inferior_ptid to replace the common idiom
find_inferior_pid (ptid_get_pid (...));
It replaces all the instances of that idiom that I found with the new
function.
No significant changes before/after the patch in the regression suite
on amd64 linux.
gdb/ChangeLog:
* inferior.c (find_inferior_ptid): New function.
* inferior.h (find_inferior_ptid): New declaration.
* ada-tasks.c (ada_get_task_number): Use find_inferior_ptid.
* corelow.c (core_pid_to_str): Same.
* darwin-nat.c (darwin_resume): Same.
* infrun.c (fetch_inferior_event): Same.
(get_inferior_stop_soon): Same.
(handle_inferior_event): Same.
(handle_signal_stop): Same.
* linux-nat.c (resume_lwp): Same.
(stop_wait_callback): Same.
* mi/mi-interp.c (mi_new_thread): Same.
(mi_thread_exit): Same.
* proc-service.c (ps_pglobal_lookup): Same.
* record-btrace.c (record_btrace_step_thread): Same.
* remote-sim.c (gdbsim_close_inferior): Same.
(gdbsim_resume): Same.
(gdbsim_stop): Same.
* sol2-tdep.c (sol2_core_pid_to_str): Same.
* target.c (memory_xfer_partial_1): Same.
(default_thread_address_space): Same.
* thread.c (thread_change_ptid): Same.
(switch_to_thread): Same.
(do_restore_current_thread_cleanup): Same.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r-- | gdb/linux-nat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index 21797c1..29133f9 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -1435,7 +1435,7 @@ resume_lwp (struct lwp_info *lp, int step, enum gdb_signal signo) { if (lp->stopped) { - struct inferior *inf = find_inferior_pid (ptid_get_pid (lp->ptid)); + struct inferior *inf = find_inferior_ptid (lp->ptid); if (inf->vfork_child != NULL) { @@ -2388,7 +2388,7 @@ linux_nat_set_status_is_event (struct target_ops *t, static int stop_wait_callback (struct lwp_info *lp, void *data) { - struct inferior *inf = find_inferior_pid (ptid_get_pid (lp->ptid)); + struct inferior *inf = find_inferior_ptid (lp->ptid); /* If this is a vfork parent, bail out, it is not going to report any SIGSTOP until the vfork is done with. */ |