aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2014-12-15 12:00:55 -0500
committerSimon Marchi <simon.marchi@ericsson.com>2014-12-15 12:00:55 -0500
commitc9657e708a03cb06ad92ce81bf17c68d28e57689 (patch)
tree87595320210e128f722acce17a2b7d5e91dfc5f2 /gdb/infrun.c
parente882ef3cfc3d991433c3b9aed104961ad3ce5904 (diff)
downloadgdb-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/infrun.c')
-rw-r--r--gdb/infrun.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 74f9e12..413b052 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -3262,7 +3262,7 @@ fetch_inferior_event (void *client_data)
if (!ecs->wait_some_more)
{
- struct inferior *inf = find_inferior_pid (ptid_get_pid (ecs->ptid));
+ struct inferior *inf = find_inferior_ptid (ecs->ptid);
delete_just_stopped_threads_infrun_breakpoints ();
@@ -3581,7 +3581,7 @@ fill_in_stop_func (struct gdbarch *gdbarch,
static enum stop_kind
get_inferior_stop_soon (ptid_t ptid)
{
- struct inferior *inf = find_inferior_pid (ptid_get_pid (ptid));
+ struct inferior *inf = find_inferior_ptid (ptid);
gdb_assert (inf != NULL);
return inf->control.stop_soon;
@@ -3815,7 +3815,7 @@ handle_inferior_event (struct execution_control_state *ecs)
}
inferior_ptid = ecs->ptid;
- set_current_inferior (find_inferior_pid (ptid_get_pid (ecs->ptid)));
+ set_current_inferior (find_inferior_ptid (ecs->ptid));
set_current_program_space (current_inferior ()->pspace);
handle_vfork_child_exec_or_exit (0);
target_terminal_ours (); /* Must do this before mourn anyway. */
@@ -3899,7 +3899,7 @@ Cannot fill $_exitsignal with the correct signal number.\n"));
if (displaced && ptid_equal (displaced->step_ptid, ecs->ptid))
{
struct inferior *parent_inf
- = find_inferior_pid (ptid_get_pid (ecs->ptid));
+ = find_inferior_ptid (ecs->ptid);
struct regcache *child_regcache;
CORE_ADDR parent_pc;
@@ -4495,7 +4495,7 @@ handle_signal_stop (struct execution_control_state *ecs)
if (random_signal)
{
/* Signal not for debugging purposes. */
- struct inferior *inf = find_inferior_pid (ptid_get_pid (ecs->ptid));
+ struct inferior *inf = find_inferior_ptid (ecs->ptid);
enum gdb_signal stop_signal = ecs->event_thread->suspend.stop_signal;
if (debug_infrun)