/* Low level Unix child interface to ttrace, for GDB when running under HP-UX.
Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
- 1999, 2000, 2001
+ 1999, 2000, 2001, 2003
Free Software Foundation, Inc.
This file is part of GDB.
#include "gdb_string.h"
#include "gdb_wait.h"
#include "command.h"
+#include "gdbthread.h"
/* We need pstat functionality so that we can get the exec file
for a process we attach to.
thread descriptor.
This caches the state. The implementation of queries like
- target_has_execd can then use this cached state, rather than
+ hpux_has_execd can then use this cached state, rather than
be forced to make an explicit ttrace call to get it.
(Guard against the condition that this is the first time we've
child_acknowledge_created_inferior.)
*/
int
-parent_attach_all (void)
+parent_attach_all (int p1, PTRACE_ARG3_TYPE p2, int p3)
{
int tt_status;
}
#endif
-#if defined(CHILD_HAS_FORKED)
-
/* Q: Do we need to map the returned process ID to a thread ID?
* A: I don't think so--here we want a _real_ pid. Any later
* start the mapping.
*/
int
-child_has_forked (int tid, int *childpid)
+hpux_has_forked (int tid, int *childpid)
{
int tt_status;
ttstate_t ttrace_state;
return 0;
}
-#endif
-
-
-#if defined(CHILD_HAS_VFORKED)
-/* See child_has_forked for pid discussion.
+/* See hpux_has_forked for pid discussion.
*/
int
-child_has_vforked (int tid, int *childpid)
+hpux_has_vforked (int tid, int *childpid)
{
int tt_status;
ttstate_t ttrace_state;
return 0;
}
-#endif
#if defined(CHILD_INSERT_EXEC_CATCHPOINT)
#endif
-#if defined(CHILD_HAS_EXECD)
int
-child_has_execd (int tid, char **execd_pathname)
+hpux_has_execd (int tid, char **execd_pathname)
{
int tt_status;
ttstate_t ttrace_state;
return 0;
}
-#endif
-#if defined(CHILD_HAS_SYSCALL_EVENT)
int
-child_has_syscall_event (int pid, enum target_waitkind *kind, int *syscall_id)
+hpux_has_syscall_event (int pid, enum target_waitkind *kind, int *syscall_id)
{
int tt_status;
ttstate_t ttrace_state;
*syscall_id = ttrace_state.tts_scno;
return 1;
}
-#endif
\f
there's no need for any "break" statements.
*/
case PT_SETTRC:
- return parent_attach_all ();
+ return parent_attach_all (0, 0, 0);
case PT_RUREGS:
tt_status = read_from_register_save_state (gdb_tid,
* state.tts_flags & TTS_STATEMASK == TTS_WASSUSPENDED
*/
if (debug_on)
- if (state.tts_flags & TTS_STATEMASK != TTS_WASSUSPENDED)
+ if ((state.tts_flags & TTS_STATEMASK) != TTS_WASSUSPENDED)
printf ("About to continue non-stopped thread %d\n", scan_tid);
#endif
#ifdef THREAD_DEBUG
if (debug_on)
- if (state.tts_flags & TTS_STATEMASK != TTS_WASSUSPENDED)
+ if ((state.tts_flags & TTS_STATEMASK) != TTS_WASSUSPENDED)
warning ("About to continue non-stopped thread %d\n", scan_tid);
#endif
pending signal will be passed to the inferior. interrupt.exp
in the testsuite does this precise thing and fails due to the
unwanted signal delivery to the inferior. */
- if (resume_all_threads)
+ /* drow/2002-12-05: However, note that we must use TT_PROC_CONTINUE
+ if we are tracing a vfork. */
+ if (vfork_in_flight)
+ {
+ call_ttrace (TT_PROC_CONTINUE, tid, TT_NIL, TT_NIL, TT_NIL);
+ clear_all_handled ();
+ clear_all_stepping_mode ();
+ }
+ else if (resume_all_threads)
{
#ifdef THREAD_DEBUG
if (debug_on)
}
}
-/* Called via #define REQUIRE_ATTACH from inftarg.c,
- * ultimately from "follow_inferior_fork" in infrun.c,
- * itself called from "resume".
+/* Called from child_follow_fork in hppah-nat.c.
*
* This seems to be intended to attach after a fork or
* vfork, while "attach" is used to attach to a pid
watchpoints.
*/
int
-hppa_remove_hw_watchpoint (int pid, CORE_ADDR start, LONGEST len,
- enum bptype type)
+hppa_remove_hw_watchpoint (int pid, CORE_ADDR start, LONGEST len, int type)
{
CORE_ADDR page_start;
int dictionary_is_empty;
hardware support.
*/
int
-hppa_can_use_hw_watchpoint (enum bptype type, int cnt, enum bptype ot)
+hppa_can_use_hw_watchpoint (int type, int cnt, int ot)
{
return (type == bp_hardware_watchpoint);
}