switch (b->type)
{
case bp_catch_fork:
- val = target_insert_fork_catchpoint (inferior_pid);
+ val = target_insert_fork_catchpoint (PIDGET (inferior_ptid));
break;
case bp_catch_vfork:
- val = target_insert_vfork_catchpoint (inferior_pid);
+ val = target_insert_vfork_catchpoint (PIDGET (inferior_ptid));
break;
case bp_catch_exec:
- val = target_insert_exec_catchpoint (inferior_pid);
+ val = target_insert_exec_catchpoint (PIDGET (inferior_ptid));
break;
default:
warning ("Internal error, %s line %d.", __FILE__, __LINE__);
{
register struct breakpoint *b;
int val;
- int saved_inferior_pid = inferior_pid;
+ ptid_t saved_inferior_ptid = inferior_ptid;
- /* FIXME: use a cleanup, to insure that inferior_pid gets replaced! */
- inferior_pid = pid; /* Because remove_breakpoint will use this global. */
+ /* FIXME: use a cleanup, to insure that inferior_ptid gets replaced! */
+ inferior_ptid = pid_to_ptid (pid); /* Because remove_breakpoint will use this global. */
ALL_BREAKPOINTS (b)
{
if (b->inserted)
val = target_insert_breakpoint (b->address, b->shadow_contents);
if (val != 0)
{
- inferior_pid = saved_inferior_pid;
+ inferior_ptid = saved_inferior_ptid;
return val;
}
}
}
- inferior_pid = saved_inferior_pid;
+ inferior_ptid = saved_inferior_ptid;
return 0;
}
{
register struct breakpoint *b;
int val;
- int saved_inferior_pid = inferior_pid;
+ ptid_t saved_inferior_ptid = inferior_ptid;
- if (pid == inferior_pid)
- error ("Cannot detach breakpoints of inferior_pid");
+ if (pid == PIDGET (inferior_ptid))
+ error ("Cannot detach breakpoints of inferior_ptid");
- /* FIXME: use a cleanup, to insure that inferior_pid gets replaced! */
- inferior_pid = pid; /* Because remove_breakpoint will use this global. */
+ /* FIXME: use a cleanup, to insure that inferior_ptid gets replaced! */
+ inferior_ptid = pid_to_ptid (pid); /* Because remove_breakpoint will use this global. */
ALL_BREAKPOINTS (b)
{
if (b->inserted)
val = remove_breakpoint (b, mark_inserted);
if (val != 0)
{
- inferior_pid = saved_inferior_pid;
+ inferior_ptid = saved_inferior_ptid;
return val;
}
}
}
- inferior_pid = saved_inferior_pid;
+ inferior_ptid = saved_inferior_ptid;
return 0;
}
switch (b->type)
{
case bp_catch_fork:
- val = target_remove_fork_catchpoint (inferior_pid);
+ val = target_remove_fork_catchpoint (PIDGET (inferior_ptid));
break;
case bp_catch_vfork:
- val = target_remove_vfork_catchpoint (inferior_pid);
+ val = target_remove_vfork_catchpoint (PIDGET (inferior_ptid));
break;
case bp_catch_exec:
- val = target_remove_exec_catchpoint (inferior_pid);
+ val = target_remove_exec_catchpoint (PIDGET (inferior_ptid));
break;
default:
warning ("Internal error, %s line %d.", __FILE__, __LINE__);
PC is valid for process/thread PID. */
int
-breakpoint_thread_match (CORE_ADDR pc, int pid)
+breakpoint_thread_match (CORE_ADDR pc, ptid_t ptid)
{
struct breakpoint *b;
int thread;
- thread = pid_to_thread_id (pid);
+ thread = pid_to_thread_id (ptid);
ALL_BREAKPOINTS (b)
if (b->enable != disabled
ignore it. */
if ((b->type == bp_catch_load)
#if defined(SOLIB_HAVE_LOAD_EVENT)
- && (!SOLIB_HAVE_LOAD_EVENT (inferior_pid)
+ && (!SOLIB_HAVE_LOAD_EVENT (PIDGET (inferior_ptid))
|| ((b->dll_pathname != NULL)
&& (strcmp (b->dll_pathname,
- SOLIB_LOADED_LIBRARY_PATHNAME (inferior_pid))
+ SOLIB_LOADED_LIBRARY_PATHNAME (
+ PIDGET (inferior_ptid)))
!= 0)))
#endif
)
if ((b->type == bp_catch_unload)
#if defined(SOLIB_HAVE_UNLOAD_EVENT)
- && (!SOLIB_HAVE_UNLOAD_EVENT (inferior_pid)
+ && (!SOLIB_HAVE_UNLOAD_EVENT (PIDGET (inferior_ptid))
|| ((b->dll_pathname != NULL)
&& (strcmp (b->dll_pathname,
- SOLIB_UNLOADED_LIBRARY_PATHNAME (inferior_pid))
+ SOLIB_UNLOADED_LIBRARY_PATHNAME (
+ PIDGET (inferior_ptid)))
!= 0)))
#endif
)
continue;
if ((b->type == bp_catch_fork)
- && !target_has_forked (inferior_pid, &b->forked_inferior_pid))
+ && !target_has_forked (PIDGET (inferior_ptid),
+ &b->forked_inferior_pid))
continue;
if ((b->type == bp_catch_vfork)
- && !target_has_vforked (inferior_pid, &b->forked_inferior_pid))
+ && !target_has_vforked (PIDGET (inferior_ptid),
+ &b->forked_inferior_pid))
continue;
if ((b->type == bp_catch_exec)
- && !target_has_execd (inferior_pid, &b->exec_pathname))
+ && !target_has_execd (PIDGET (inferior_ptid), &b->exec_pathname))
continue;
if (ep_is_exception_catchpoint (b) &&
if (ep->triggered_dll_pathname != NULL)
xfree (ep->triggered_dll_pathname);
if (ep->type == bp_catch_load)
- dll_pathname = SOLIB_LOADED_LIBRARY_PATHNAME (inferior_pid);
+ dll_pathname = SOLIB_LOADED_LIBRARY_PATHNAME (
+ PIDGET (inferior_ptid));
else
- dll_pathname = SOLIB_UNLOADED_LIBRARY_PATHNAME (inferior_pid);
+ dll_pathname = SOLIB_UNLOADED_LIBRARY_PATHNAME (
+ PIDGET (inferior_ptid));
#else
dll_pathname = NULL;
#endif
/* If we're debugging a multi-threaded program, then we
want momentary breakpoints to be active in only a
single thread of control. */
- if (in_thread_list (inferior_pid))
- b->thread = pid_to_thread_id (inferior_pid);
+ if (in_thread_list (inferior_ptid))
+ b->thread = pid_to_thread_id (inferior_ptid);
return b;
}
startup sequence by the dynamic linker.
However, I tried avoiding that by having HP-UX's implementation of
- TARGET_CAN_USE_HW_WATCHPOINT return FALSE if there was no inferior_pid
+ TARGET_CAN_USE_HW_WATCHPOINT return FALSE if there was no inferior_ptid
yet, which forced slow watches before a "run" or "attach", and it
still fails somewhere in the startup code.
/* Create a load breakpoint that only triggers when a load of
the specified dll (or any dll, if no pathname was specified)
occurs. */
- SOLIB_CREATE_CATCH_LOAD_HOOK (inferior_pid, tempflag,
+ SOLIB_CREATE_CATCH_LOAD_HOOK (PIDGET (inferior_ptid), tempflag,
dll_pathname, cond_string);
}
/* Create an unload breakpoint that only triggers when an unload of
the specified dll (or any dll, if no pathname was specified)
occurs. */
- SOLIB_CREATE_CATCH_UNLOAD_HOOK (inferior_pid, tempflag,
+ SOLIB_CREATE_CATCH_UNLOAD_HOOK (PIDGET (inferior_ptid), tempflag,
dll_pathname, cond_string);
}
#endif /* SOLIB_ADD */
/* Reset the thread number of this breakpoint:
- If the breakpoint is for all threads, leave it as-is.
- - Else, reset it to the current thread for inferior_pid. */
+ - Else, reset it to the current thread for inferior_ptid. */
void
breakpoint_re_set_thread (struct breakpoint *b)
{
if (b->thread != -1)
{
- if (in_thread_list (inferior_pid))
- b->thread = pid_to_thread_id (inferior_pid);
+ if (in_thread_list (inferior_ptid))
+ b->thread = pid_to_thread_id (inferior_ptid);
}
}