1 /* Low-level child interface to ttrace.
3 Copyright 2004 Free Software Foundation, Inc.
5 This file is part of GDB.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
24 /* The ttrace(2) system call didn't exist before HP-UX 10.30. Don't
25 try to compile this code unless we have it. */
34 #include "gdb_assert.h"
35 #include "gdb_string.h"
37 #include <sys/ttrace.h>
39 #include "inf-child.h"
40 #include "inf-ttrace.h"
42 /* HACK: Save the ttrace ops returned by inf_ttrace_target. */
43 static struct target_ops
*ttrace_ops_hack
;
46 /* On HP-UX versions that have the ttrace(2) system call, we can
47 implement "hardware" watchpoints by fiddling with the protection of
48 pages in the address space that contain the variable being watched.
49 In order to implement this, we keep a dictionary of pages for which
50 we have changed the protection. */
52 struct inf_ttrace_page
54 CORE_ADDR addr
; /* Page address. */
55 int prot
; /* Protection. */
56 int refcount
; /* Reference count. */
57 struct inf_ttrace_page
*next
;
58 struct inf_ttrace_page
*prev
;
61 struct inf_ttrace_page_dict
63 struct inf_ttrace_page buckets
[128];
64 int pagesize
; /* Page size. */
65 int count
; /* Number of pages in this dictionary. */
66 } inf_ttrace_page_dict
;
68 /* Number of threads that are currently in a system call. */
69 static int inf_ttrace_num_threads_in_syscall
;
71 /* Flag to indicate whether we should re-enable page protections after
73 static int inf_ttrace_reenable_page_protections
;
75 /* Enable system call events for process PID. */
78 inf_ttrace_enable_syscall_events (pid_t pid
)
83 gdb_assert (inf_ttrace_num_threads_in_syscall
== 0);
85 if (ttrace (TT_PROC_GET_EVENT_MASK
, pid
, 0,
86 (uintptr_t)&tte
, sizeof tte
, 0) == -1)
87 perror_with_name ("ttrace");
89 tte
.tte_events
|= (TTEVT_SYSCALL_ENTRY
| TTEVT_SYSCALL_RETURN
);
91 if (ttrace (TT_PROC_SET_EVENT_MASK
, pid
, 0,
92 (uintptr_t)&tte
, sizeof tte
, 0) == -1)
93 perror_with_name ("ttrace");
95 if (ttrace (TT_PROC_GET_FIRST_LWP_STATE
, pid
, 0,
96 (uintptr_t)&tts
, sizeof tts
, 0) == -1)
97 perror_with_name ("ttrace");
99 if (tts
.tts_flags
& TTS_INSYSCALL
)
100 inf_ttrace_num_threads_in_syscall
++;
102 /* FIXME: Handle multiple threads. */
105 /* Disable system call events for process PID. */
108 inf_ttrace_disable_syscall_events (pid_t pid
)
112 gdb_assert (inf_ttrace_page_dict
.count
== 0);
114 if (ttrace (TT_PROC_GET_EVENT_MASK
, pid
, 0,
115 (uintptr_t)&tte
, sizeof tte
, 0) == -1)
116 perror_with_name ("ttrace");
118 tte
.tte_events
&= ~(TTEVT_SYSCALL_ENTRY
| TTEVT_SYSCALL_RETURN
);
120 if (ttrace (TT_PROC_SET_EVENT_MASK
, pid
, 0,
121 (uintptr_t)&tte
, sizeof tte
, 0) == -1)
122 perror_with_name ("ttrace");
124 inf_ttrace_num_threads_in_syscall
= 0;
127 /* Get information about the page at address ADDR for process PID from
130 static struct inf_ttrace_page
*
131 inf_ttrace_get_page (pid_t pid
, CORE_ADDR addr
)
133 const int num_buckets
= ARRAY_SIZE (inf_ttrace_page_dict
.buckets
);
134 const int pagesize
= inf_ttrace_page_dict
.pagesize
;
136 struct inf_ttrace_page
*page
;
138 bucket
= (addr
/ pagesize
) % num_buckets
;
139 page
= &inf_ttrace_page_dict
.buckets
[bucket
];
142 if (page
->addr
== addr
)
151 /* Add the page at address ADDR for process PID to the dictionary. */
153 static struct inf_ttrace_page
*
154 inf_ttrace_add_page (pid_t pid
, CORE_ADDR addr
)
156 const int num_buckets
= ARRAY_SIZE (inf_ttrace_page_dict
.buckets
);
157 const int pagesize
= inf_ttrace_page_dict
.pagesize
;
159 struct inf_ttrace_page
*page
;
160 struct inf_ttrace_page
*prev
= NULL
;
162 bucket
= (addr
/ pagesize
) % num_buckets
;
163 page
= &inf_ttrace_page_dict
.buckets
[bucket
];
166 if (page
->addr
== addr
)
177 if (ttrace (TT_PROC_GET_MPROTECT
, pid
, 0,
178 addr
, 0, (uintptr_t)&prot
) == -1)
179 perror_with_name ("ttrace");
181 page
= XMALLOC (struct inf_ttrace_page
);
190 inf_ttrace_page_dict
.count
++;
191 if (inf_ttrace_page_dict
.count
== 1)
192 inf_ttrace_enable_syscall_events (pid
);
194 if (inf_ttrace_num_threads_in_syscall
== 0)
196 if (ttrace (TT_PROC_SET_MPROTECT
, pid
, 0,
197 addr
, pagesize
, prot
& ~PROT_WRITE
) == -1)
198 perror_with_name ("ttrace");
205 /* Insert the page at address ADDR of process PID to the dictionary. */
208 inf_ttrace_insert_page (pid_t pid
, CORE_ADDR addr
)
210 struct inf_ttrace_page
*page
;
212 page
= inf_ttrace_get_page (pid
, addr
);
214 page
= inf_ttrace_add_page (pid
, addr
);
219 /* Remove the page at address ADDR of process PID from the dictionary. */
222 inf_ttrace_remove_page (pid_t pid
, CORE_ADDR addr
)
224 const int pagesize
= inf_ttrace_page_dict
.pagesize
;
225 struct inf_ttrace_page
*page
;
227 page
= inf_ttrace_get_page (pid
, addr
);
230 gdb_assert (page
->refcount
>= 0);
232 if (page
->refcount
== 0)
234 if (inf_ttrace_num_threads_in_syscall
== 0)
236 if (ttrace (TT_PROC_SET_MPROTECT
, pid
, 0,
237 addr
, pagesize
, page
->prot
) == -1)
238 perror_with_name ("ttrace");
241 inf_ttrace_page_dict
.count
--;
242 if (inf_ttrace_page_dict
.count
== 0)
243 inf_ttrace_disable_syscall_events (pid
);
245 page
->prev
->next
= page
->next
;
247 page
->next
->prev
= page
->prev
;
253 /* Mask the bits in PROT from the page protections that are currently
254 in the dictionary for process PID. */
257 inf_ttrace_mask_page_protections (pid_t pid
, int prot
)
259 const int num_buckets
= ARRAY_SIZE (inf_ttrace_page_dict
.buckets
);
260 const int pagesize
= inf_ttrace_page_dict
.pagesize
;
263 for (bucket
= 0; bucket
< num_buckets
; bucket
++)
265 struct inf_ttrace_page
*page
;
267 page
= inf_ttrace_page_dict
.buckets
[bucket
].next
;
270 if (ttrace (TT_PROC_SET_MPROTECT
, pid
, 0,
271 page
->addr
, pagesize
, page
->prot
& ~prot
) == -1)
272 perror_with_name ("ttrace");
279 /* Write-protect the pages in the dictionary for process PID. */
282 inf_ttrace_enable_page_protections (pid_t pid
)
284 inf_ttrace_mask_page_protections (pid
, PROT_WRITE
);
287 /* Restore the protection of the pages in the dictionary for process
291 inf_ttrace_disable_page_protections (pid_t pid
)
293 inf_ttrace_mask_page_protections (pid
, 0);
296 /* Insert a "hardware" watchpoint for LEN bytes at address ADDR of
300 inf_ttrace_insert_watchpoint (CORE_ADDR addr
, int len
, int type
)
302 const int pagesize
= inf_ttrace_page_dict
.pagesize
;
303 pid_t pid
= ptid_get_pid (inferior_ptid
);
308 gdb_assert (type
== hw_write
);
310 page_addr
= (addr
/ pagesize
) * pagesize
;
311 num_pages
= (len
+ pagesize
- 1) / pagesize
;
313 for (page
= 0; page
< num_pages
; page
++, page_addr
+= pagesize
)
314 inf_ttrace_insert_page (pid
, page_addr
);
319 /* Remove a "hardware" watchpoint for LEN bytes at address ADDR of
323 inf_ttrace_remove_watchpoint (CORE_ADDR addr
, int len
, int type
)
325 const int pagesize
= inf_ttrace_page_dict
.pagesize
;
326 pid_t pid
= ptid_get_pid (inferior_ptid
);
331 gdb_assert (type
== hw_write
);
333 page_addr
= (addr
/ pagesize
) * pagesize
;
334 num_pages
= (len
+ pagesize
- 1) / pagesize
;
336 for (page
= 0; page
< num_pages
; page
++, page_addr
+= pagesize
)
337 inf_ttrace_remove_page (pid
, page_addr
);
343 inf_ttrace_can_use_hw_breakpoint (int type
, int len
, int ot
)
345 return (type
== bp_hardware_watchpoint
);
349 inf_ttrace_region_size_ok_for_hw_watchpoint (int len
)
354 /* Return non-zero if the current inferior was (potentially) stopped
355 by hitting a "hardware" watchpoint. */
358 inf_ttrace_stopped_by_watchpoint (void)
360 pid_t pid
= ptid_get_pid (inferior_ptid
);
361 lwpid_t lwpid
= ptid_get_lwp (inferior_ptid
);
364 if (inf_ttrace_page_dict
.count
> 0)
366 if (ttrace (TT_LWP_GET_STATE
, pid
, lwpid
,
367 (uintptr_t)&tts
, sizeof tts
, 0) == -1)
368 perror_with_name ("ttrace");
370 if (tts
.tts_event
== TTEVT_SIGNAL
371 && tts
.tts_u
.tts_signal
.tts_signo
== SIGBUS
)
373 const int pagesize
= inf_ttrace_page_dict
.pagesize
;
374 void *addr
= tts
.tts_u
.tts_signal
.tts_siginfo
.si_addr
;
375 CORE_ADDR page_addr
= ((uintptr_t)addr
/ pagesize
) * pagesize
;
377 if (inf_ttrace_get_page (pid
, page_addr
))
386 /* File descriptors for pipes used as semaphores during initial
387 startup of an inferior. */
388 static int inf_ttrace_pfd1
[2];
389 static int inf_ttrace_pfd2
[2];
392 do_cleanup_pfds (void *dummy
)
394 close (inf_ttrace_pfd1
[0]);
395 close (inf_ttrace_pfd1
[1]);
396 close (inf_ttrace_pfd2
[0]);
397 close (inf_ttrace_pfd2
[1]);
401 inf_ttrace_prepare (void)
403 if (pipe (inf_ttrace_pfd1
) == -1)
404 perror_with_name ("pipe");
406 if (pipe (inf_ttrace_pfd2
) == -1)
408 close (inf_ttrace_pfd1
[0]);
409 close (inf_ttrace_pfd2
[0]);
410 perror_with_name ("pipe");
414 /* Prepare to be traced. */
419 struct cleanup
*old_chain
= make_cleanup (do_cleanup_pfds
, 0);
422 /* "Trace me, Dr. Memory!" */
423 if (ttrace (TT_PROC_SETTRC
, 0, 0, 0, TT_VERSION
, 0) == -1)
424 perror_with_name ("ttrace");
426 /* Tell our parent that we are ready to be traced. */
427 if (write (inf_ttrace_pfd1
[1], &c
, sizeof c
) != sizeof c
)
428 perror_with_name ("write");
430 /* Wait until our parent has set the initial event mask. */
431 if (read (inf_ttrace_pfd2
[0], &c
, sizeof c
) != sizeof c
)
432 perror_with_name ("read");
434 do_cleanups (old_chain
);
437 /* Start tracing PID. */
440 inf_ttrace_him (int pid
)
442 struct cleanup
*old_chain
= make_cleanup (do_cleanup_pfds
, 0);
446 /* Wait until our child is ready to be traced. */
447 if (read (inf_ttrace_pfd1
[0], &c
, sizeof c
) != sizeof c
)
448 perror_with_name ("read");
450 /* Set the initial event mask. */
451 memset (&tte
, 0, sizeof (tte
));
452 tte
.tte_events
= TTEVT_EXEC
| TTEVT_EXIT
;
453 tte
.tte_opts
= TTEO_NOSTRCCHLD
;
454 if (ttrace (TT_PROC_SET_EVENT_MASK
, pid
, 0,
455 (uintptr_t)&tte
, sizeof tte
, 0) == -1)
456 perror_with_name ("ttrace");
458 /* Tell our child that we have set the initial event mask. */
459 if (write (inf_ttrace_pfd2
[1], &c
, sizeof c
) != sizeof c
)
460 perror_with_name ("write");
462 do_cleanups (old_chain
);
464 push_target (ttrace_ops_hack
);
466 /* On some targets, there must be some explicit synchronization
467 between the parent and child processes after the debugger forks,
468 and before the child execs the debuggee program. This call
469 basically gives permission for the child to exec. */
471 target_acknowledge_created_inferior (pid
);
473 /* START_INFERIOR_TRAPS_EXPECTED is defined in inferior.h, and will
474 be 1 or 2 depending on whether we're starting without or with a
476 startup_inferior (START_INFERIOR_TRAPS_EXPECTED
);
478 /* On some targets, there must be some explicit actions taken after
479 the inferior has been started up. */
480 target_post_startup_inferior (pid_to_ptid (pid
));
484 inf_ttrace_create_inferior (char *exec_file
, char *allargs
, char **env
,
487 gdb_assert (inf_ttrace_page_dict
.count
== 0);
488 gdb_assert (inf_ttrace_num_threads_in_syscall
== 0);
489 gdb_assert (inf_ttrace_reenable_page_protections
== 0);
491 fork_inferior (exec_file
, allargs
, env
, inf_ttrace_me
, inf_ttrace_him
,
492 inf_ttrace_prepare
, NULL
);
494 /* We are at the first instruction we care about. */
495 observer_notify_inferior_created (¤t_target
, from_tty
);
497 /* Pedal to the metal... */
498 proceed ((CORE_ADDR
) -1, TARGET_SIGNAL_0
, 0);
502 inf_ttrace_kill_inferior (void)
504 pid_t pid
= ptid_get_pid (inferior_ptid
);
509 if (ttrace (TT_PROC_EXIT
, pid
, 0, 0, 0, 0) == -1)
510 perror_with_name ("ttrace");
511 /* ??? Is it necessary to call ttrace_wait() here? */
512 target_mourn_inferior ();
516 inf_ttrace_mourn_inferior (void)
518 const int num_buckets
= ARRAY_SIZE (inf_ttrace_page_dict
.buckets
);
521 inf_ttrace_num_threads_in_syscall
= 0;
523 for (bucket
= 0; bucket
< num_buckets
; bucket
++)
525 struct inf_ttrace_page
*page
;
526 struct inf_ttrace_page
*next
;
528 page
= inf_ttrace_page_dict
.buckets
[bucket
].next
;
536 inf_ttrace_page_dict
.count
= 0;
538 unpush_target (ttrace_ops_hack
);
539 generic_mourn_inferior ();
543 inf_ttrace_attach (char *args
, int from_tty
)
551 error_no_arg ("process-id to attach");
554 pid
= strtol (args
, &dummy
, 0);
555 if (pid
== 0 && args
== dummy
)
556 error ("Illegal process-id: %s\n", args
);
558 if (pid
== getpid ()) /* Trying to masturbate? */
559 error ("I refuse to debug myself!");
563 exec_file
= (char *) get_exec_file (0);
566 printf_unfiltered ("Attaching to program: %s, %s\n", exec_file
,
567 target_pid_to_str (pid_to_ptid (pid
)));
569 printf_unfiltered ("Attaching to %s\n",
570 target_pid_to_str (pid_to_ptid (pid
)));
572 gdb_flush (gdb_stdout
);
575 if (ttrace (TT_PROC_ATTACH
, pid
, 0, TT_KILL_ON_EXIT
, TT_VERSION
, 0) == -1)
576 perror_with_name ("ttrace");
579 /* Set the initial event mask. */
580 gdb_assert (inf_ttrace_num_threads_in_syscall
== 0);
581 memset (&tte
, 0, sizeof (tte
));
582 tte
.tte_events
= TTEVT_EXEC
| TTEVT_EXIT
;
583 tte
.tte_opts
= TTEO_NOSTRCCHLD
;
584 if (ttrace (TT_PROC_SET_EVENT_MASK
, pid
, 0,
585 (uintptr_t)&tte
, sizeof tte
, 0) == -1)
586 perror_with_name ("ttrace");
588 inferior_ptid
= pid_to_ptid (pid
);
589 push_target (ttrace_ops_hack
);
591 /* Do this first, before anything has had a chance to query the
592 inferior's symbol table or similar. */
593 observer_notify_inferior_created (¤t_target
, from_tty
);
597 inf_ttrace_detach (char *args
, int from_tty
)
600 pid_t pid
= ptid_get_pid (inferior_ptid
);
604 char *exec_file
= get_exec_file (0);
607 printf_unfiltered ("Detaching from program: %s, %s\n", exec_file
,
608 target_pid_to_str (pid_to_ptid (pid
)));
609 gdb_flush (gdb_stdout
);
614 /* ??? The HP-UX 11.0 ttrace(2) manual page doesn't mention that we
615 can pass a signal number here. Does this really work? */
616 if (ttrace (TT_PROC_DETACH
, pid
, 0, 0, sig
, 0) == -1)
617 perror_with_name ("ttrace");
619 inf_ttrace_num_threads_in_syscall
= 0;
621 unpush_target (ttrace_ops_hack
);
622 inferior_ptid
= null_ptid
;
626 inf_ttrace_resume (ptid_t ptid
, int step
, enum target_signal signal
)
628 pid_t pid
= ptid_get_pid (ptid
);
629 lwpid_t lwpid
= ptid_get_lwp (ptid
);
630 ttreq_t request
= step
? TT_LWP_SINGLE
: TT_LWP_CONTINUE
;
631 int sig
= target_signal_to_host (signal
);
635 pid
= ptid_get_pid (inferior_ptid
);
636 lwpid
= ptid_get_lwp (inferior_ptid
);
639 if (ttrace (request
, pid
, lwpid
, TT_NOPC
, sig
, 0) == -1)
640 perror_with_name ("ttrace");
642 if (ptid_equal (ptid
, minus_one_ptid
))
644 /* Let all the other threads run too. */
645 if (ttrace (TT_PROC_CONTINUE
, pid
, 0, 0, 0, 0) == -1)
646 perror_with_name ("ttrace");
651 inf_ttrace_wait (ptid_t ptid
, struct target_waitstatus
*ourstatus
)
653 pid_t pid
= ptid_get_pid (ptid
);
654 lwpid_t lwpid
= ptid_get_lwp (ptid
);
657 /* Until proven otherwise. */
658 ourstatus
->kind
= TARGET_WAITKIND_IGNORE
;
663 gdb_assert (lwpid
== 0 || pid
!= 0);
670 if (ttrace_wait (pid
, lwpid
, TTRACE_WAITOK
, &tts
, sizeof tts
) == -1)
671 perror_with_name ("ttrace_wait");
674 clear_sigint_trap ();
676 while (tts
.tts_event
== TTEVT_NONE
);
678 /* Now that we've waited, we can re-enable the page protections. */
679 if (inf_ttrace_reenable_page_protections
)
681 gdb_assert (inf_ttrace_num_threads_in_syscall
== 0);
682 inf_ttrace_enable_page_protections (tts
.tts_pid
);
683 inf_ttrace_reenable_page_protections
= 0;
686 switch (tts
.tts_event
)
689 /* Make it look like a breakpoint. */
690 ourstatus
->kind
= TARGET_WAITKIND_STOPPED
;
691 ourstatus
->value
.sig
= TARGET_SIGNAL_TRAP
;
695 store_waitstatus (ourstatus
, tts
.tts_u
.tts_exit
.tts_exitcode
);
699 ourstatus
->kind
= TARGET_WAITKIND_STOPPED
;
700 ourstatus
->value
.sig
=
701 target_signal_from_host (tts
.tts_u
.tts_signal
.tts_signo
);
704 case TTEVT_SYSCALL_ENTRY
:
705 gdb_assert (inf_ttrace_reenable_page_protections
== 0);
706 inf_ttrace_num_threads_in_syscall
++;
707 if (inf_ttrace_num_threads_in_syscall
== 1)
709 /* A thread has just entered a system call. Disable any
710 page protections as the kernel can't deal with them. */
711 inf_ttrace_disable_page_protections (tts
.tts_pid
);
713 ourstatus
->kind
= TARGET_WAITKIND_SYSCALL_ENTRY
;
714 ourstatus
->value
.syscall_id
= tts
.tts_scno
;
717 case TTEVT_SYSCALL_RETURN
:
718 if (inf_ttrace_num_threads_in_syscall
> 0)
720 /* If the last thread has just left the system call, this
721 would be a logical place to re-enable the page
722 protections, but that doesn't work. We can't re-enable
723 them until we've done another wait. */
724 inf_ttrace_reenable_page_protections
=
725 (inf_ttrace_num_threads_in_syscall
== 1);
726 inf_ttrace_num_threads_in_syscall
--;
728 ourstatus
->kind
= TARGET_WAITKIND_SYSCALL_RETURN
;
729 ourstatus
->value
.syscall_id
= tts
.tts_scno
;
733 /* Make sure all threads within the process are stopped. */
734 if (ttrace (TT_PROC_STOP
, tts
.tts_pid
, 0, 0, 0, 0) == -1)
735 perror_with_name ("ttrace");
737 /* HACK: Twiddle INFERIOR_PTID such that the initial thread of a
738 process isn't recognized as a new thread. */
739 if (ptid_get_lwp (inferior_ptid
) == 0)
740 inferior_ptid
= ptid_build (tts
.tts_pid
, tts
.tts_lwpid
, tts
.tts_user_tid
);
742 return ptid_build (tts
.tts_pid
, tts
.tts_lwpid
, tts
.tts_user_tid
);
745 /* Transfer LEN bytes from ADDR in the inferior's memory into READBUF,
746 and transfer LEN bytes from WRITEBUF into the inferior's memory at
747 ADDR. Either READBUF or WRITEBUF may be null, in which case the
748 corresponding transfer doesn't happen. Return the number of bytes
749 actually transferred (which may be zero if an error occurs). */
752 inf_ttrace_xfer_memory (CORE_ADDR addr
, ULONGEST len
,
753 void *readbuf
, const void *writebuf
)
755 pid_t pid
= ptid_get_pid (inferior_ptid
);
757 /* HP-UX treats text space and data space differently. GDB however,
758 doesn't really know the difference. Therefore we try both. Try
759 text space before data space though because when we're writing
760 into text space the instruction cache might need to be flushed. */
763 && ttrace (TT_PROC_RDTEXT
, pid
, 0, addr
, len
, (uintptr_t)readbuf
) == -1
764 && ttrace (TT_PROC_RDDATA
, pid
, 0, addr
, len
, (uintptr_t)readbuf
) == -1)
768 && ttrace (TT_PROC_WRTEXT
, pid
, 0, addr
, len
, (uintptr_t)writebuf
) == -1
769 && ttrace (TT_PROC_WRDATA
, pid
, 0, addr
, len
, (uintptr_t)writebuf
) == -1)
776 inf_ttrace_xfer_partial (struct target_ops
*ops
, enum target_object object
,
777 const char *annex
, void *readbuf
,
778 const void *writebuf
, ULONGEST offset
, LONGEST len
)
782 case TARGET_OBJECT_MEMORY
:
783 return inf_ttrace_xfer_memory (offset
, len
, readbuf
, writebuf
);
785 case TARGET_OBJECT_UNWIND_TABLE
:
788 case TARGET_OBJECT_AUXV
:
791 case TARGET_OBJECT_WCOOKIE
:
799 /* Print status information about what we're accessing. */
802 inf_ttrace_files_info (struct target_ops
*ignore
)
804 printf_unfiltered ("\tUsing the running image of %s %s.\n",
805 attach_flag
? "attached" : "child",
806 target_pid_to_str (inferior_ptid
));
811 inf_ttrace_target (void)
813 struct target_ops
*t
= inf_child_target ();
815 t
->to_create_inferior
= inf_ttrace_create_inferior
;
816 t
->to_kill
= inf_ttrace_kill_inferior
;
817 t
->to_mourn_inferior
= inf_ttrace_mourn_inferior
;
818 t
->to_attach
= inf_ttrace_attach
;
819 t
->to_detach
= inf_ttrace_detach
;
820 t
->to_resume
= inf_ttrace_resume
;
821 t
->to_wait
= inf_ttrace_wait
;
822 t
->to_xfer_partial
= inf_ttrace_xfer_partial
;
823 t
->to_files_info
= inf_ttrace_files_info
;
824 t
->to_can_use_hw_breakpoint
= inf_ttrace_can_use_hw_breakpoint
;
825 t
->to_region_size_ok_for_hw_watchpoint
=
826 inf_ttrace_region_size_ok_for_hw_watchpoint
;
827 t
->to_insert_watchpoint
= inf_ttrace_insert_watchpoint
;
828 t
->to_remove_watchpoint
= inf_ttrace_remove_watchpoint
;
829 t
->to_stopped_by_watchpoint
= inf_ttrace_stopped_by_watchpoint
;
836 /* Prevent warning from -Wmissing-prototypes. */
837 void _initialize_hppa_hpux_nat (void);
840 _initialize_inf_ttrace (void)
842 inf_ttrace_page_dict
.pagesize
= getpagesize();