1 /* QNX Neutrino specific low level interface, for the remote server
3 Copyright (C) 2009, 2010 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 3 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, see <http://www.gnu.org/licenses/>. */
27 #include <sys/procfs.h>
30 #include <sys/iomgr.h>
31 #include <sys/neutrino.h>
34 extern int using_threads
;
35 int using_threads
= 1;
38 nto_trace (const char *fmt
, ...)
42 if (debug_threads
== 0)
44 fprintf (stderr
, "nto:");
45 va_start (arg_list
, fmt
);
46 vfprintf (stderr
, fmt
, arg_list
);
50 #define TRACE nto_trace
52 /* Structure holding neutrino specific information about
57 char nto_procfs_path
[PATH_MAX
];
60 int exit_signo
; /* For tracking exit status. */
63 static struct nto_inferior nto_inferior
;
66 init_nto_inferior (struct nto_inferior
*nto_inferior
)
68 memset (nto_inferior
, 0, sizeof (struct nto_inferior
));
69 nto_inferior
->ctl_fd
= -1;
70 nto_inferior
->pid
= -1;
76 if (nto_inferior
.ctl_fd
!= -1)
78 nto_trace ("Closing fd\n");
79 close (nto_inferior
.ctl_fd
);
80 init_nto_inferior (&nto_inferior
);
84 /* Set current thread. Return 1 on success, 0 otherwise. */
87 nto_set_thread (ptid_t ptid
)
91 TRACE ("%s pid: %d tid: %ld\n", __func__
, ptid_get_pid (ptid
),
93 if (nto_inferior
.ctl_fd
!= -1
94 && !ptid_equal (ptid
, null_ptid
)
95 && !ptid_equal (ptid
, minus_one_ptid
))
97 pthread_t tid
= ptid_get_lwp (ptid
);
99 if (EOK
== devctl (nto_inferior
.ctl_fd
, DCMD_PROC_CURTHREAD
, &tid
,
103 TRACE ("%s: Error: failed to set current thread\n", __func__
);
108 /* This function will determine all alive threads. Note that we do not list
109 dead but unjoined threads even though they are still in the process' thread
112 NTO_INFERIOR must not be NULL. */
115 nto_find_new_threads (struct nto_inferior
*nto_inferior
)
119 TRACE ("%s pid:%d\n", __func__
, nto_inferior
->pid
);
121 if (nto_inferior
->ctl_fd
== -1)
124 for (tid
= 1;; ++tid
)
126 procfs_status status
;
131 err
= devctl (nto_inferior
->ctl_fd
, DCMD_PROC_TIDSTATUS
, &status
,
134 if (err
!= EOK
|| status
.tid
== 0)
137 /* All threads in between are gone. */
138 while (tid
!= status
.tid
|| status
.state
== STATE_DEAD
)
140 struct thread_info
*ti
;
142 ptid
= ptid_build (nto_inferior
->pid
, tid
, 0);
143 ti
= find_thread_ptid (ptid
);
146 TRACE ("Removing thread %d\n", tid
);
149 if (tid
== status
.tid
)
154 if (status
.state
!= STATE_DEAD
)
156 TRACE ("Adding thread %d\n", tid
);
157 ptid
= ptid_build (nto_inferior
->pid
, tid
, 0);
158 if (!find_thread_ptid (ptid
))
159 add_thread (ptid
, NULL
);
164 /* Given pid, open procfs path. */
167 do_attach (pid_t pid
)
169 procfs_status status
;
170 struct sigevent event
;
172 if (nto_inferior
.ctl_fd
!= -1)
174 close (nto_inferior
.ctl_fd
);
175 init_nto_inferior (&nto_inferior
);
177 snprintf (nto_inferior
.nto_procfs_path
, PATH_MAX
- 1, "/proc/%d/as", pid
);
178 nto_inferior
.ctl_fd
= open (nto_inferior
.nto_procfs_path
, O_RDWR
);
179 if (nto_inferior
.ctl_fd
== -1)
181 TRACE ("Failed to open %s\n", nto_inferior
.nto_procfs_path
);
182 init_nto_inferior (&nto_inferior
);
185 if (devctl (nto_inferior
.ctl_fd
, DCMD_PROC_STOP
, &status
, sizeof (status
), 0)
191 nto_inferior
.pid
= pid
;
192 /* Define a sigevent for process stopped notification. */
193 event
.sigev_notify
= SIGEV_SIGNAL_THREAD
;
194 event
.sigev_signo
= SIGUSR1
;
195 event
.sigev_code
= 0;
196 event
.sigev_value
.sival_ptr
= NULL
;
197 event
.sigev_priority
= -1;
198 devctl (nto_inferior
.ctl_fd
, DCMD_PROC_EVENT
, &event
, sizeof (event
), 0);
200 if (devctl (nto_inferior
.ctl_fd
, DCMD_PROC_STATUS
, &status
, sizeof (status
),
202 && (status
.flags
& _DEBUG_FLAG_STOPPED
))
207 ptid
= ptid_build (status
.pid
, status
.tid
, 0);
208 the_low_target
.arch_setup ();
209 add_process (status
.pid
, 1);
210 TRACE ("Adding thread: pid=%d tid=%ld\n", status
.pid
,
211 ptid_get_lwp (ptid
));
212 nto_find_new_threads (&nto_inferior
);
223 /* Read or write LEN bytes from/to inferior's MEMADDR memory address
224 into gdbservers's MYADDR buffer. Return number of bytes actually
228 nto_xfer_memory (off_t memaddr
, unsigned char *myaddr
, int len
,
233 if (lseek (nto_inferior
.ctl_fd
, memaddr
, SEEK_SET
) == memaddr
)
236 nbytes
= write (nto_inferior
.ctl_fd
, myaddr
, len
);
238 nbytes
= read (nto_inferior
.ctl_fd
, myaddr
, len
);
245 TRACE ("Error in %s : errno=%d (%s)\n", __func__
, e
, strerror (e
));
250 /* Insert or remove breakpoint or watchpoint at address ADDR.
251 TYPE can be one of Neutrino breakpoint types. SIZE must be 0 for
252 inserting the point, -1 for removing it.
254 Return 0 on success, 1 otherwise. */
257 nto_breakpoint (CORE_ADDR addr
, int type
, int size
)
264 if (devctl (nto_inferior
.ctl_fd
, DCMD_PROC_BREAK
, &brk
, sizeof (brk
), 0)
270 /* Read auxiliary vector from inferior's initial stack into gdbserver's
271 MYADDR buffer, up to LEN bytes.
273 Return number of bytes read. */
276 nto_read_auxv_from_initial_stack (CORE_ADDR initial_stack
,
277 unsigned char *myaddr
,
282 unsigned int len_read
= 0;
284 /* Skip over argc, argv and envp... Comment from ldd.c:
286 The startup frame is set-up so that we have:
291 envp1 <----- void *frame + (argc + 2) * sizeof(char *)
296 argc <------ void * frame
298 On entry to ldd, frame gives the address of argc on the stack. */
299 if (nto_xfer_memory (initial_stack
, (unsigned char *)&anint
,
300 sizeof (anint
), 0) != sizeof (anint
))
303 /* Size of pointer is assumed to be 4 bytes (32 bit arch. ) */
304 data_ofs
+= (anint
+ 2) * sizeof (void *); /* + 2 comes from argc itself and
305 NULL terminating pointer in
308 /* Now loop over env table: */
309 while (nto_xfer_memory (initial_stack
+ data_ofs
,
310 (unsigned char *)&anint
, sizeof (anint
), 0)
313 data_ofs
+= sizeof (anint
);
317 initial_stack
+= data_ofs
;
319 memset (myaddr
, 0, len
);
320 while (len_read
<= len
- sizeof (auxv_t
))
322 auxv_t
*auxv
= (auxv_t
*)myaddr
;
324 /* Search backwards until we have read AT_PHDR (num. 3),
325 AT_PHENT (num 4), AT_PHNUM (num 5) */
326 if (nto_xfer_memory (initial_stack
, (unsigned char *)auxv
,
327 sizeof (auxv_t
), 0) == sizeof (auxv_t
))
329 if (auxv
->a_type
!= AT_NULL
)
332 len_read
+= sizeof (auxv_t
);
334 if (auxv
->a_type
== AT_PHNUM
) /* That's all we need. */
336 initial_stack
+= sizeof (auxv_t
);
341 TRACE ("auxv: len_read: %d\n", len_read
);
345 /* Start inferior specified by PROGRAM passing arguments ALLARGS. */
348 nto_create_inferior (char *program
, char **allargs
)
350 struct inheritance inherit
;
354 TRACE ("%s %s\n", __func__
, program
);
355 /* Clear any pending SIGUSR1's but keep the behavior the same. */
356 signal (SIGUSR1
, signal (SIGUSR1
, SIG_IGN
));
359 sigaddset (&set
, SIGUSR1
);
360 sigprocmask (SIG_UNBLOCK
, &set
, NULL
);
362 memset (&inherit
, 0, sizeof (inherit
));
363 inherit
.flags
|= SPAWN_SETGROUP
| SPAWN_HOLD
;
364 inherit
.pgroup
= SPAWN_NEWPGROUP
;
365 pid
= spawnp (program
, 0, NULL
, &inherit
, allargs
, 0);
366 sigprocmask (SIG_BLOCK
, &set
, NULL
);
371 if (do_attach (pid
) != pid
)
377 /* Attach to process PID. */
380 nto_attach (unsigned long pid
)
382 TRACE ("%s %ld\n", __func__
, pid
);
383 if (do_attach (pid
) != pid
)
384 error ("Unable to attach to %ld\n", pid
);
388 /* Send signal to process PID. */
393 TRACE ("%s %d\n", __func__
, pid
);
399 /* Detach from process PID. */
404 TRACE ("%s %d\n", __func__
, pid
);
410 nto_mourn (struct process_info
*process
)
412 remove_process (process
);
415 /* Check if the given thread is alive.
417 Return 1 if alive, 0 otherwise. */
420 nto_thread_alive (ptid_t ptid
)
424 TRACE ("%s pid:%d tid:%d\n", __func__
, ptid_get_pid (ptid
),
425 ptid_get_lwp (ptid
));
426 if (SignalKill (0, ptid_get_pid (ptid
), ptid_get_lwp (ptid
),
431 TRACE ("%s: %s\n", __func__
, res
? "yes" : "no");
435 /* Resume inferior's execution. */
438 nto_resume (struct thread_resume
*resume_info
, size_t n
)
440 /* We can only work in all-stop mode. */
441 procfs_status status
;
445 TRACE ("%s\n", __func__
);
446 /* Workaround for aliasing rules violation. */
447 sigset_t
*run_fault
= (sigset_t
*) (void *) &run
.fault
;
449 nto_set_thread (resume_info
->thread
);
451 run
.flags
= _DEBUG_RUN_FAULT
| _DEBUG_RUN_TRACE
;
452 if (resume_info
->kind
== resume_step
)
453 run
.flags
|= _DEBUG_RUN_STEP
;
454 run
.flags
|= _DEBUG_RUN_ARM
;
456 sigemptyset (run_fault
);
457 sigaddset (run_fault
, FLTBPT
);
458 sigaddset (run_fault
, FLTTRACE
);
459 sigaddset (run_fault
, FLTILL
);
460 sigaddset (run_fault
, FLTPRIV
);
461 sigaddset (run_fault
, FLTBOUNDS
);
462 sigaddset (run_fault
, FLTIOVF
);
463 sigaddset (run_fault
, FLTIZDIV
);
464 sigaddset (run_fault
, FLTFPE
);
465 sigaddset (run_fault
, FLTPAGE
);
466 sigaddset (run_fault
, FLTSTACK
);
467 sigaddset (run_fault
, FLTACCESS
);
469 sigemptyset (&run
.trace
);
470 if (resume_info
->sig
)
474 devctl (nto_inferior
.ctl_fd
, DCMD_PROC_STATUS
, &status
, sizeof (status
),
476 signal_to_pass
= resume_info
->sig
;
477 if (status
.why
& (_DEBUG_WHY_SIGNALLED
| _DEBUG_WHY_FAULTED
))
479 if (signal_to_pass
!= status
.info
.si_signo
)
481 kill (status
.pid
, signal_to_pass
);
482 run
.flags
|= _DEBUG_RUN_CLRFLT
| _DEBUG_RUN_CLRSIG
;
484 else /* Let it kill the program without telling us. */
485 sigdelset (&run
.trace
, signal_to_pass
);
489 run
.flags
|= _DEBUG_RUN_CLRSIG
| _DEBUG_RUN_CLRFLT
;
491 sigfillset (&run
.trace
);
493 regcache_invalidate ();
495 err
= devctl (nto_inferior
.ctl_fd
, DCMD_PROC_RUN
, &run
, sizeof (run
), 0);
497 TRACE ("Error: %d \"%s\"\n", err
, strerror (err
));
500 /* Wait for inferior's event.
502 Return ptid of thread that caused the event. */
505 nto_wait (ptid_t ptid
,
506 struct target_waitstatus
*ourstatus
, int target_options
)
510 procfs_status status
;
511 const int trace_mask
= (_DEBUG_FLAG_TRACE_EXEC
| _DEBUG_FLAG_TRACE_RD
512 | _DEBUG_FLAG_TRACE_WR
| _DEBUG_FLAG_TRACE_MODIFY
);
514 TRACE ("%s\n", __func__
);
516 ourstatus
->kind
= TARGET_WAITKIND_SPURIOUS
;
519 sigaddset (&set
, SIGUSR1
);
521 devctl (nto_inferior
.ctl_fd
, DCMD_PROC_STATUS
, &status
, sizeof (status
), 0);
522 while (!(status
.flags
& _DEBUG_FLAG_ISTOP
))
524 sigwaitinfo (&set
, &info
);
525 devctl (nto_inferior
.ctl_fd
, DCMD_PROC_STATUS
, &status
, sizeof (status
),
528 nto_find_new_threads (&nto_inferior
);
530 if (status
.flags
& _DEBUG_FLAG_SSTEP
)
533 ourstatus
->kind
= TARGET_WAITKIND_STOPPED
;
534 ourstatus
->value
.sig
= TARGET_SIGNAL_TRAP
;
536 /* Was it a breakpoint? */
537 else if (status
.flags
& trace_mask
)
540 ourstatus
->kind
= TARGET_WAITKIND_STOPPED
;
541 ourstatus
->value
.sig
= TARGET_SIGNAL_TRAP
;
543 else if (status
.flags
& _DEBUG_FLAG_ISTOP
)
548 case _DEBUG_WHY_SIGNALLED
:
549 TRACE (" SIGNALLED\n");
550 ourstatus
->kind
= TARGET_WAITKIND_STOPPED
;
551 ourstatus
->value
.sig
=
552 target_signal_from_host (status
.info
.si_signo
);
553 nto_inferior
.exit_signo
= ourstatus
->value
.sig
;
555 case _DEBUG_WHY_FAULTED
:
556 TRACE (" FAULTED\n");
557 ourstatus
->kind
= TARGET_WAITKIND_STOPPED
;
558 if (status
.info
.si_signo
== SIGTRAP
)
560 ourstatus
->value
.sig
= 0;
561 nto_inferior
.exit_signo
= 0;
565 ourstatus
->value
.sig
=
566 target_signal_from_host (status
.info
.si_signo
);
567 nto_inferior
.exit_signo
= ourstatus
->value
.sig
;
571 case _DEBUG_WHY_TERMINATED
:
575 TRACE (" TERMINATED\n");
576 waitpid (ptid_get_pid (ptid
), &waitval
, WNOHANG
);
577 if (nto_inferior
.exit_signo
)
579 /* Abnormal death. */
580 ourstatus
->kind
= TARGET_WAITKIND_SIGNALLED
;
581 ourstatus
->value
.sig
= nto_inferior
.exit_signo
;
586 ourstatus
->kind
= TARGET_WAITKIND_EXITED
;
587 ourstatus
->value
.integer
= WEXITSTATUS (waitval
);
589 nto_inferior
.exit_signo
= 0;
593 case _DEBUG_WHY_REQUESTED
:
594 TRACE ("REQUESTED\n");
595 /* We are assuming a requested stop is due to a SIGINT. */
596 ourstatus
->kind
= TARGET_WAITKIND_STOPPED
;
597 ourstatus
->value
.sig
= TARGET_SIGNAL_INT
;
598 nto_inferior
.exit_signo
= 0;
603 return ptid_build (status
.pid
, status
.tid
, 0);
606 /* Fetch inferior's registers for currently selected thread (CURRENT_INFERIOR).
607 If REGNO is -1, fetch all registers, or REGNO register only otherwise. */
610 nto_fetch_registers (struct regcache
*regcache
, int regno
)
616 TRACE ("%s (regno=%d)\n", __func__
, regno
);
617 if (regno
>= the_low_target
.num_regs
)
620 if (current_inferior
== NULL
)
622 TRACE ("current_inferior is NULL\n");
625 ptid
= thread_to_gdb_id (current_inferior
);
626 if (!nto_set_thread (ptid
))
629 if (devctl (nto_inferior
.ctl_fd
, DCMD_PROC_GETGREG
, &greg
, sizeof (greg
),
632 if (regno
== -1) /* All registers. */
634 for (regno
= 0; regno
!= the_low_target
.num_regs
; ++regno
)
636 const unsigned int registeroffset
637 = the_low_target
.register_offset (regno
);
638 supply_register (regcache
, regno
, ((char *)&greg
) + registeroffset
);
643 const unsigned int registeroffset
644 = the_low_target
.register_offset (regno
);
645 if (registeroffset
== -1)
647 supply_register (regcache
, regno
, ((char *)&greg
) + registeroffset
);
651 TRACE ("ERROR reading registers from inferior.\n");
654 /* Store registers for currently selected thread (CURRENT_INFERIOR).
655 We always store all registers, regardless of REGNO. */
658 nto_store_registers (struct regcache
*regcache
, int regno
)
664 TRACE ("%s (regno:%d)\n", __func__
, regno
);
666 if (current_inferior
== NULL
)
668 TRACE ("current_inferior is NULL\n");
671 ptid
= thread_to_gdb_id (current_inferior
);
672 if (!nto_set_thread (ptid
))
675 memset (&greg
, 0, sizeof (greg
));
676 for (regno
= 0; regno
!= the_low_target
.num_regs
; ++regno
)
678 const unsigned int regoffset
679 = the_low_target
.register_offset (regno
);
680 collect_register (regcache
, regno
, ((char *)&greg
) + regoffset
);
682 err
= devctl (nto_inferior
.ctl_fd
, DCMD_PROC_SETGREG
, &greg
, sizeof (greg
),
685 TRACE ("Error: setting registers.\n");
688 /* Read LEN bytes from inferior's memory address MEMADDR into
689 gdbserver's MYADDR buffer.
691 Return 0 on success -1 otherwise. */
694 nto_read_memory (CORE_ADDR memaddr
, unsigned char *myaddr
, int len
)
696 TRACE ("%s memaddr:0x%08lx, len:%d\n", __func__
, memaddr
, len
);
698 if (nto_xfer_memory (memaddr
, myaddr
, len
, 0) != len
)
700 TRACE ("Failed to read memory\n");
707 /* Write LEN bytes from gdbserver's buffer MYADDR into inferior's
708 memory at address MEMADDR.
710 Return 0 on success -1 otherwise. */
713 nto_write_memory (CORE_ADDR memaddr
, const unsigned char *myaddr
, int len
)
717 TRACE ("%s memaddr: 0x%08llx len: %d\n", __func__
, memaddr
, len
);
718 if ((len_written
= nto_xfer_memory (memaddr
, (unsigned char *)myaddr
, len
,
722 TRACE ("Wanted to write: %d but written: %d\n", len
, len_written
);
729 /* Stop inferior. We always stop all threads. */
732 nto_request_interrupt (void)
734 TRACE ("%s\n", __func__
);
735 nto_set_thread (ptid_build (nto_inferior
.pid
, 1, 0));
736 if (EOK
!= devctl (nto_inferior
.ctl_fd
, DCMD_PROC_STOP
, NULL
, 0, 0))
737 TRACE ("Error stopping inferior.\n");
740 /* Read auxiliary vector from inferior's memory into gdbserver's buffer
741 MYADDR. We always read whole auxv.
743 Return number of bytes stored in MYADDR buffer, 0 if OFFSET > 0
747 nto_read_auxv (CORE_ADDR offset
, unsigned char *myaddr
, unsigned int len
)
750 CORE_ADDR initial_stack
;
751 procfs_info procinfo
;
753 TRACE ("%s\n", __func__
);
757 err
= devctl (nto_inferior
.ctl_fd
, DCMD_PROC_INFO
, &procinfo
,
762 initial_stack
= procinfo
.initial_stack
;
764 return nto_read_auxv_from_initial_stack (initial_stack
, myaddr
, len
);
767 /* Insert {break/watch}point at address ADDR.
768 TYPE must be in '0'..'4' range. LEN is not used. */
771 nto_insert_point (char type
, CORE_ADDR addr
, int len
)
773 int wtype
= _DEBUG_BREAK_HW
; /* Always request HW. */
775 TRACE ("%s type:%c addr: 0x%08lx len:%d\n", __func__
, (int)type
, addr
, len
);
778 case '0': /* software-breakpoint */
779 wtype
= _DEBUG_BREAK_EXEC
;
781 case '1': /* hardware-breakpoint */
782 wtype
|= _DEBUG_BREAK_EXEC
;
784 case '2': /* write watchpoint */
785 wtype
|= _DEBUG_BREAK_RW
;
787 case '3': /* read watchpoint */
788 wtype
|= _DEBUG_BREAK_RD
;
790 case '4': /* access watchpoint */
791 wtype
|= _DEBUG_BREAK_RW
;
794 return 1; /* Not supported. */
796 return nto_breakpoint (addr
, wtype
, 0);
799 /* Remove {break/watch}point at address ADDR.
800 TYPE must be in '0'..'4' range. LEN is not used. */
803 nto_remove_point (char type
, CORE_ADDR addr
, int len
)
805 int wtype
= _DEBUG_BREAK_HW
; /* Always request HW. */
807 TRACE ("%s type:%c addr: 0x%08lx len:%d\n", __func__
, (int)type
, addr
, len
);
810 case '0': /* software-breakpoint */
811 wtype
= _DEBUG_BREAK_EXEC
;
813 case '1': /* hardware-breakpoint */
814 wtype
|= _DEBUG_BREAK_EXEC
;
816 case '2': /* write watchpoint */
817 wtype
|= _DEBUG_BREAK_RW
;
819 case '3': /* read watchpoint */
820 wtype
|= _DEBUG_BREAK_RD
;
822 case '4': /* access watchpoint */
823 wtype
|= _DEBUG_BREAK_RW
;
826 return 1; /* Not supported. */
828 return nto_breakpoint (addr
, wtype
, -1);
831 /* Check if the reason of stop for current thread (CURRENT_INFERIOR) is
834 Return 1 if stopped by watchpoint, 0 otherwise. */
837 nto_stopped_by_watchpoint (void)
841 TRACE ("%s\n", __func__
);
842 if (nto_inferior
.ctl_fd
!= -1 && current_inferior
!= NULL
)
846 ptid
= thread_to_gdb_id (current_inferior
);
847 if (nto_set_thread (ptid
))
849 const int watchmask
= _DEBUG_FLAG_TRACE_RD
| _DEBUG_FLAG_TRACE_WR
850 | _DEBUG_FLAG_TRACE_MODIFY
;
851 procfs_status status
;
854 err
= devctl (nto_inferior
.ctl_fd
, DCMD_PROC_STATUS
, &status
,
856 if (err
== EOK
&& (status
.flags
& watchmask
))
860 TRACE ("%s: %s\n", __func__
, ret
? "yes" : "no");
864 /* Get instruction pointer for CURRENT_INFERIOR thread.
866 Return inferior's instruction pointer value, or 0 on error. */
869 nto_stopped_data_address (void)
871 CORE_ADDR ret
= (CORE_ADDR
)0;
873 TRACE ("%s\n", __func__
);
874 if (nto_inferior
.ctl_fd
!= -1 && current_inferior
!= NULL
)
878 ptid
= thread_to_gdb_id (current_inferior
);
880 if (nto_set_thread (ptid
))
882 procfs_status status
;
884 if (devctl (nto_inferior
.ctl_fd
, DCMD_PROC_STATUS
, &status
,
885 sizeof (status
), 0) == EOK
)
889 TRACE ("%s: 0x%08lx\n", __func__
, ret
);
893 /* We do not currently support non-stop. */
896 nto_supports_non_stop (void)
898 TRACE ("%s\n", __func__
);
904 static struct target_ops nto_target_ops
= {
918 NULL
, /* nto_look_up_symbols */
919 nto_request_interrupt
,
923 nto_stopped_by_watchpoint
,
924 nto_stopped_data_address
,
925 NULL
, /* nto_read_offsets */
926 NULL
, /* thread_db_set_tls_address */
928 hostio_last_error_from_errno
,
929 NULL
, /* nto_qxfer_osdata */
930 NULL
, /* xfer_siginfo */
931 nto_supports_non_stop
,
933 NULL
/* start_non_stop */
937 /* Global function called by server.c. Initializes QNX Neutrino
941 initialize_low (void)
945 TRACE ("%s\n", __func__
);
946 set_target_ops (&nto_target_ops
);
947 set_breakpoint_data (the_low_target
.breakpoint
,
948 the_low_target
.breakpoint_len
);
950 /* We use SIGUSR1 to gain control after we block waiting for a process.
951 We use sigwaitevent to wait. */
953 sigaddset (&set
, SIGUSR1
);
954 sigprocmask (SIG_BLOCK
, &set
, NULL
);