2003-07-16 Andrew Cagney <cagney@redhat.com>
[deliverable/binutils-gdb.git] / gdb / symm-nat.c
CommitLineData
2fbce691
AC
1// OBSOLETE /* Sequent Symmetry host interface, for GDB when running under Unix.
2// OBSOLETE
3// OBSOLETE Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1999,
4// OBSOLETE 2000, 2001, 2003 Free Software Foundation, Inc.
5// OBSOLETE
6// OBSOLETE This file is part of GDB.
7// OBSOLETE
8// OBSOLETE This program is free software; you can redistribute it and/or modify
9// OBSOLETE it under the terms of the GNU General Public License as published by
10// OBSOLETE the Free Software Foundation; either version 2 of the License, or
11// OBSOLETE (at your option) any later version.
12// OBSOLETE
13// OBSOLETE This program is distributed in the hope that it will be useful,
14// OBSOLETE but WITHOUT ANY WARRANTY; without even the implied warranty of
15// OBSOLETE MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16// OBSOLETE GNU General Public License for more details.
17// OBSOLETE
18// OBSOLETE You should have received a copy of the GNU General Public License
19// OBSOLETE along with this program; if not, write to the Free Software
20// OBSOLETE Foundation, Inc., 59 Temple Place - Suite 330,
21// OBSOLETE Boston, MA 02111-1307, USA. */
22// OBSOLETE
23// OBSOLETE /* FIXME, some 387-specific items of use taken from i387-tdep.c -- ought to be
24// OBSOLETE merged back in. */
25// OBSOLETE
26// OBSOLETE #include "defs.h"
27// OBSOLETE #include "frame.h"
28// OBSOLETE #include "inferior.h"
29// OBSOLETE #include "symtab.h"
30// OBSOLETE #include "target.h"
31// OBSOLETE #include "regcache.h"
32// OBSOLETE
33// OBSOLETE /* FIXME: What is the _INKERNEL define for? */
34// OBSOLETE #define _INKERNEL
35// OBSOLETE #include <signal.h>
36// OBSOLETE #undef _INKERNEL
37// OBSOLETE #include "gdb_wait.h"
38// OBSOLETE #include <sys/param.h>
39// OBSOLETE #include <sys/user.h>
40// OBSOLETE #include <sys/proc.h>
41// OBSOLETE #include <sys/dir.h>
42// OBSOLETE #include <sys/ioctl.h>
43// OBSOLETE #include "gdb_stat.h"
44// OBSOLETE #ifdef _SEQUENT_
45// OBSOLETE #include <sys/ptrace.h>
46// OBSOLETE #else
47// OBSOLETE /* Dynix has only machine/ptrace.h, which is already included by sys/user.h */
48// OBSOLETE /* Dynix has no mptrace call */
49// OBSOLETE #define mptrace ptrace
50// OBSOLETE #endif
51// OBSOLETE #include "gdbcore.h"
52// OBSOLETE #include <fcntl.h>
53// OBSOLETE #include <sgtty.h>
54// OBSOLETE #define TERMINAL struct sgttyb
55// OBSOLETE
56// OBSOLETE #include "gdbcore.h"
57// OBSOLETE
58// OBSOLETE void
59// OBSOLETE store_inferior_registers (int regno)
60// OBSOLETE {
61// OBSOLETE struct pt_regset regs;
62// OBSOLETE int i;
63// OBSOLETE
64// OBSOLETE /* FIXME: Fetching the registers is a kludge to initialize all elements
65// OBSOLETE in the fpu and fpa status. This works for normal debugging, but
66// OBSOLETE might cause problems when calling functions in the inferior.
67// OBSOLETE At least fpu_control and fpa_pcr (probably more) should be added
68// OBSOLETE to the registers array to solve this properly. */
69// OBSOLETE mptrace (XPT_RREGS, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) & regs, 0);
70// OBSOLETE
71// OBSOLETE regs.pr_eax = *(int *) &deprecated_registers[REGISTER_BYTE (0)];
72// OBSOLETE regs.pr_ebx = *(int *) &deprecated_registers[REGISTER_BYTE (5)];
73// OBSOLETE regs.pr_ecx = *(int *) &deprecated_registers[REGISTER_BYTE (2)];
74// OBSOLETE regs.pr_edx = *(int *) &deprecated_registers[REGISTER_BYTE (1)];
75// OBSOLETE regs.pr_esi = *(int *) &deprecated_registers[REGISTER_BYTE (6)];
76// OBSOLETE regs.pr_edi = *(int *) &deprecated_registers[REGISTER_BYTE (7)];
77// OBSOLETE regs.pr_esp = *(int *) &deprecated_registers[REGISTER_BYTE (14)];
78// OBSOLETE regs.pr_ebp = *(int *) &deprecated_registers[REGISTER_BYTE (15)];
79// OBSOLETE regs.pr_eip = *(int *) &deprecated_registers[REGISTER_BYTE (16)];
80// OBSOLETE regs.pr_flags = *(int *) &deprecated_registers[REGISTER_BYTE (17)];
81// OBSOLETE for (i = 0; i < 31; i++)
82// OBSOLETE {
83// OBSOLETE regs.pr_fpa.fpa_regs[i] =
84// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (FP1_REGNUM + i)];
85// OBSOLETE }
86// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[0], &deprecated_registers[REGISTER_BYTE (ST0_REGNUM)], 10);
87// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[1], &deprecated_registers[REGISTER_BYTE (ST1_REGNUM)], 10);
88// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[2], &deprecated_registers[REGISTER_BYTE (ST2_REGNUM)], 10);
89// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[3], &deprecated_registers[REGISTER_BYTE (ST3_REGNUM)], 10);
90// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[4], &deprecated_registers[REGISTER_BYTE (ST4_REGNUM)], 10);
91// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[5], &deprecated_registers[REGISTER_BYTE (ST5_REGNUM)], 10);
92// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[6], &deprecated_registers[REGISTER_BYTE (ST6_REGNUM)], 10);
93// OBSOLETE memcpy (regs.pr_fpu.fpu_stack[7], &deprecated_registers[REGISTER_BYTE (ST7_REGNUM)], 10);
94// OBSOLETE mptrace (XPT_WREGS, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) & regs, 0);
95// OBSOLETE }
96// OBSOLETE
97// OBSOLETE void
98// OBSOLETE fetch_inferior_registers (int regno)
99// OBSOLETE {
100// OBSOLETE int i;
101// OBSOLETE struct pt_regset regs;
102// OBSOLETE
103// OBSOLETE deprecated_registers_fetched ();
104// OBSOLETE
105// OBSOLETE mptrace (XPT_RREGS, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) & regs, 0);
106// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (EAX_REGNUM)] = regs.pr_eax;
107// OBSOLETE *(int *) &rdeprecated_egisters[REGISTER_BYTE (EBX_REGNUM)] = regs.pr_ebx;
108// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (ECX_REGNUM)] = regs.pr_ecx;
109// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (EDX_REGNUM)] = regs.pr_edx;
110// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (ESI_REGNUM)] = regs.pr_esi;
111// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (EDI_REGNUM)] = regs.pr_edi;
112// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (EBP_REGNUM)] = regs.pr_ebp;
113// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (ESP_REGNUM)] = regs.pr_esp;
114// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (EIP_REGNUM)] = regs.pr_eip;
115// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (EFLAGS_REGNUM)] = regs.pr_flags;
116// OBSOLETE for (i = 0; i < FPA_NREGS; i++)
117// OBSOLETE {
118// OBSOLETE *(int *) &deprecated_registers[REGISTER_BYTE (FP1_REGNUM + i)] =
119// OBSOLETE regs.pr_fpa.fpa_regs[i];
120// OBSOLETE }
121// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST0_REGNUM)], regs.pr_fpu.fpu_stack[0], 10);
122// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST1_REGNUM)], regs.pr_fpu.fpu_stack[1], 10);
123// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST2_REGNUM)], regs.pr_fpu.fpu_stack[2], 10);
124// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST3_REGNUM)], regs.pr_fpu.fpu_stack[3], 10);
125// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST4_REGNUM)], regs.pr_fpu.fpu_stack[4], 10);
126// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST5_REGNUM)], regs.pr_fpu.fpu_stack[5], 10);
127// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST6_REGNUM)], regs.pr_fpu.fpu_stack[6], 10);
128// OBSOLETE memcpy (&deprecated_registers[REGISTER_BYTE (ST7_REGNUM)], regs.pr_fpu.fpu_stack[7], 10);
129// OBSOLETE }
130// OBSOLETE \f
131// OBSOLETE /* FIXME: This should be merged with i387-tdep.c as well. */
132// OBSOLETE static
133// OBSOLETE print_fpu_status (struct pt_regset ep)
134// OBSOLETE {
135// OBSOLETE int i;
136// OBSOLETE int bothstatus;
137// OBSOLETE int top;
138// OBSOLETE int fpreg;
139// OBSOLETE unsigned char *p;
140// OBSOLETE
141// OBSOLETE printf_unfiltered ("80387:");
142// OBSOLETE if (ep.pr_fpu.fpu_ip == 0)
143// OBSOLETE {
144// OBSOLETE printf_unfiltered (" not in use.\n");
145// OBSOLETE return;
146// OBSOLETE }
147// OBSOLETE else
148// OBSOLETE {
149// OBSOLETE printf_unfiltered ("\n");
150// OBSOLETE }
151// OBSOLETE if (ep.pr_fpu.fpu_status != 0)
152// OBSOLETE {
153// OBSOLETE print_387_status_word (ep.pr_fpu.fpu_status);
154// OBSOLETE }
155// OBSOLETE print_387_control_word (ep.pr_fpu.fpu_control);
156// OBSOLETE printf_unfiltered ("last exception: ");
157// OBSOLETE printf_unfiltered ("opcode 0x%x; ", ep.pr_fpu.fpu_rsvd4);
158// OBSOLETE printf_unfiltered ("pc 0x%x:0x%x; ", ep.pr_fpu.fpu_cs, ep.pr_fpu.fpu_ip);
159// OBSOLETE printf_unfiltered ("operand 0x%x:0x%x\n", ep.pr_fpu.fpu_data_offset, ep.pr_fpu.fpu_op_sel);
160// OBSOLETE
161// OBSOLETE top = (ep.pr_fpu.fpu_status >> 11) & 7;
162// OBSOLETE
163// OBSOLETE printf_unfiltered ("regno tag msb lsb value\n");
164// OBSOLETE for (fpreg = 7; fpreg >= 0; fpreg--)
165// OBSOLETE {
166// OBSOLETE double val;
167// OBSOLETE
168// OBSOLETE printf_unfiltered ("%s %d: ", fpreg == top ? "=>" : " ", fpreg);
169// OBSOLETE
170// OBSOLETE switch ((ep.pr_fpu.fpu_tag >> (fpreg * 2)) & 3)
171// OBSOLETE {
172// OBSOLETE case 0:
173// OBSOLETE printf_unfiltered ("valid ");
174// OBSOLETE break;
175// OBSOLETE case 1:
176// OBSOLETE printf_unfiltered ("zero ");
177// OBSOLETE break;
178// OBSOLETE case 2:
179// OBSOLETE printf_unfiltered ("trap ");
180// OBSOLETE break;
181// OBSOLETE case 3:
182// OBSOLETE printf_unfiltered ("empty ");
183// OBSOLETE break;
184// OBSOLETE }
185// OBSOLETE for (i = 9; i >= 0; i--)
186// OBSOLETE printf_unfiltered ("%02x", ep.pr_fpu.fpu_stack[fpreg][i]);
187// OBSOLETE
188// OBSOLETE i387_to_double ((char *) ep.pr_fpu.fpu_stack[fpreg], (char *) &val);
189// OBSOLETE printf_unfiltered (" %g\n", val);
190// OBSOLETE }
191// OBSOLETE if (ep.pr_fpu.fpu_rsvd1)
192// OBSOLETE warning ("rsvd1 is 0x%x\n", ep.pr_fpu.fpu_rsvd1);
193// OBSOLETE if (ep.pr_fpu.fpu_rsvd2)
194// OBSOLETE warning ("rsvd2 is 0x%x\n", ep.pr_fpu.fpu_rsvd2);
195// OBSOLETE if (ep.pr_fpu.fpu_rsvd3)
196// OBSOLETE warning ("rsvd3 is 0x%x\n", ep.pr_fpu.fpu_rsvd3);
197// OBSOLETE if (ep.pr_fpu.fpu_rsvd5)
198// OBSOLETE warning ("rsvd5 is 0x%x\n", ep.pr_fpu.fpu_rsvd5);
199// OBSOLETE }
200// OBSOLETE
201// OBSOLETE
202// OBSOLETE print_1167_control_word (unsigned int pcr)
203// OBSOLETE {
204// OBSOLETE int pcr_tmp;
205// OBSOLETE
206// OBSOLETE pcr_tmp = pcr & FPA_PCR_MODE;
207// OBSOLETE printf_unfiltered ("\tMODE= %#x; RND= %#x ", pcr_tmp, pcr_tmp & 12);
208// OBSOLETE switch (pcr_tmp & 12)
209// OBSOLETE {
210// OBSOLETE case 0:
211// OBSOLETE printf_unfiltered ("RN (Nearest Value)");
212// OBSOLETE break;
213// OBSOLETE case 1:
214// OBSOLETE printf_unfiltered ("RZ (Zero)");
215// OBSOLETE break;
216// OBSOLETE case 2:
217// OBSOLETE printf_unfiltered ("RP (Positive Infinity)");
218// OBSOLETE break;
219// OBSOLETE case 3:
220// OBSOLETE printf_unfiltered ("RM (Negative Infinity)");
221// OBSOLETE break;
222// OBSOLETE }
223// OBSOLETE printf_unfiltered ("; IRND= %d ", pcr_tmp & 2);
224// OBSOLETE if (0 == pcr_tmp & 2)
225// OBSOLETE {
226// OBSOLETE printf_unfiltered ("(same as RND)\n");
227// OBSOLETE }
228// OBSOLETE else
229// OBSOLETE {
230// OBSOLETE printf_unfiltered ("(toward zero)\n");
231// OBSOLETE }
232// OBSOLETE pcr_tmp = pcr & FPA_PCR_EM;
233// OBSOLETE printf_unfiltered ("\tEM= %#x", pcr_tmp);
234// OBSOLETE if (pcr_tmp & FPA_PCR_EM_DM)
235// OBSOLETE printf_unfiltered (" DM");
236// OBSOLETE if (pcr_tmp & FPA_PCR_EM_UOM)
237// OBSOLETE printf_unfiltered (" UOM");
238// OBSOLETE if (pcr_tmp & FPA_PCR_EM_PM)
239// OBSOLETE printf_unfiltered (" PM");
240// OBSOLETE if (pcr_tmp & FPA_PCR_EM_UM)
241// OBSOLETE printf_unfiltered (" UM");
242// OBSOLETE if (pcr_tmp & FPA_PCR_EM_OM)
243// OBSOLETE printf_unfiltered (" OM");
244// OBSOLETE if (pcr_tmp & FPA_PCR_EM_ZM)
245// OBSOLETE printf_unfiltered (" ZM");
246// OBSOLETE if (pcr_tmp & FPA_PCR_EM_IM)
247// OBSOLETE printf_unfiltered (" IM");
248// OBSOLETE printf_unfiltered ("\n");
249// OBSOLETE pcr_tmp = FPA_PCR_CC;
250// OBSOLETE printf_unfiltered ("\tCC= %#x", pcr_tmp);
251// OBSOLETE if (pcr_tmp & FPA_PCR_20MHZ)
252// OBSOLETE printf_unfiltered (" 20MHZ");
253// OBSOLETE if (pcr_tmp & FPA_PCR_CC_Z)
254// OBSOLETE printf_unfiltered (" Z");
255// OBSOLETE if (pcr_tmp & FPA_PCR_CC_C2)
256// OBSOLETE printf_unfiltered (" C2");
257// OBSOLETE
258// OBSOLETE /* Dynix defines FPA_PCR_CC_C0 to 0x100 and ptx defines
259// OBSOLETE FPA_PCR_CC_C1 to 0x100. Use whichever is defined and assume
260// OBSOLETE the OS knows what it is doing. */
261// OBSOLETE #ifdef FPA_PCR_CC_C1
262// OBSOLETE if (pcr_tmp & FPA_PCR_CC_C1)
263// OBSOLETE printf_unfiltered (" C1");
264// OBSOLETE #else
265// OBSOLETE if (pcr_tmp & FPA_PCR_CC_C0)
266// OBSOLETE printf_unfiltered (" C0");
267// OBSOLETE #endif
268// OBSOLETE
269// OBSOLETE switch (pcr_tmp)
270// OBSOLETE {
271// OBSOLETE case FPA_PCR_CC_Z:
272// OBSOLETE printf_unfiltered (" (Equal)");
273// OBSOLETE break;
274// OBSOLETE #ifdef FPA_PCR_CC_C1
275// OBSOLETE case FPA_PCR_CC_C1:
276// OBSOLETE #else
277// OBSOLETE case FPA_PCR_CC_C0:
278// OBSOLETE #endif
279// OBSOLETE printf_unfiltered (" (Less than)");
280// OBSOLETE break;
281// OBSOLETE case 0:
282// OBSOLETE printf_unfiltered (" (Greater than)");
283// OBSOLETE break;
284// OBSOLETE case FPA_PCR_CC_Z |
285// OBSOLETE #ifdef FPA_PCR_CC_C1
286// OBSOLETE FPA_PCR_CC_C1
287// OBSOLETE #else
288// OBSOLETE FPA_PCR_CC_C0
289// OBSOLETE #endif
290// OBSOLETE | FPA_PCR_CC_C2:
291// OBSOLETE printf_unfiltered (" (Unordered)");
292// OBSOLETE break;
293// OBSOLETE default:
294// OBSOLETE printf_unfiltered (" (Undefined)");
295// OBSOLETE break;
296// OBSOLETE }
297// OBSOLETE printf_unfiltered ("\n");
298// OBSOLETE pcr_tmp = pcr & FPA_PCR_AE;
299// OBSOLETE printf_unfiltered ("\tAE= %#x", pcr_tmp);
300// OBSOLETE if (pcr_tmp & FPA_PCR_AE_DE)
301// OBSOLETE printf_unfiltered (" DE");
302// OBSOLETE if (pcr_tmp & FPA_PCR_AE_UOE)
303// OBSOLETE printf_unfiltered (" UOE");
304// OBSOLETE if (pcr_tmp & FPA_PCR_AE_PE)
305// OBSOLETE printf_unfiltered (" PE");
306// OBSOLETE if (pcr_tmp & FPA_PCR_AE_UE)
307// OBSOLETE printf_unfiltered (" UE");
308// OBSOLETE if (pcr_tmp & FPA_PCR_AE_OE)
309// OBSOLETE printf_unfiltered (" OE");
310// OBSOLETE if (pcr_tmp & FPA_PCR_AE_ZE)
311// OBSOLETE printf_unfiltered (" ZE");
312// OBSOLETE if (pcr_tmp & FPA_PCR_AE_EE)
313// OBSOLETE printf_unfiltered (" EE");
314// OBSOLETE if (pcr_tmp & FPA_PCR_AE_IE)
315// OBSOLETE printf_unfiltered (" IE");
316// OBSOLETE printf_unfiltered ("\n");
317// OBSOLETE }
318// OBSOLETE
319// OBSOLETE print_1167_regs (long regs[FPA_NREGS])
320// OBSOLETE {
321// OBSOLETE int i;
322// OBSOLETE
323// OBSOLETE union
324// OBSOLETE {
325// OBSOLETE double d;
326// OBSOLETE long l[2];
327// OBSOLETE }
328// OBSOLETE xd;
329// OBSOLETE union
330// OBSOLETE {
331// OBSOLETE float f;
332// OBSOLETE long l;
333// OBSOLETE }
334// OBSOLETE xf;
335// OBSOLETE
336// OBSOLETE
337// OBSOLETE for (i = 0; i < FPA_NREGS; i++)
338// OBSOLETE {
339// OBSOLETE xf.l = regs[i];
340// OBSOLETE printf_unfiltered ("%%fp%d: raw= %#x, single= %f", i + 1, regs[i], xf.f);
341// OBSOLETE if (!(i & 1))
342// OBSOLETE {
343// OBSOLETE printf_unfiltered ("\n");
344// OBSOLETE }
345// OBSOLETE else
346// OBSOLETE {
347// OBSOLETE xd.l[1] = regs[i];
348// OBSOLETE xd.l[0] = regs[i + 1];
349// OBSOLETE printf_unfiltered (", double= %f\n", xd.d);
350// OBSOLETE }
351// OBSOLETE }
352// OBSOLETE }
353// OBSOLETE
354// OBSOLETE print_fpa_status (struct pt_regset ep)
355// OBSOLETE {
356// OBSOLETE
357// OBSOLETE printf_unfiltered ("WTL 1167:");
358// OBSOLETE if (ep.pr_fpa.fpa_pcr != 0)
359// OBSOLETE {
360// OBSOLETE printf_unfiltered ("\n");
361// OBSOLETE print_1167_control_word (ep.pr_fpa.fpa_pcr);
362// OBSOLETE print_1167_regs (ep.pr_fpa.fpa_regs);
363// OBSOLETE }
364// OBSOLETE else
365// OBSOLETE {
366// OBSOLETE printf_unfiltered (" not in use.\n");
367// OBSOLETE }
368// OBSOLETE }
369// OBSOLETE
370// OBSOLETE #if 0 /* disabled because it doesn't go through the target vector. */
371// OBSOLETE i386_float_info (void)
372// OBSOLETE {
373// OBSOLETE char ubuf[UPAGES * NBPG];
374// OBSOLETE struct pt_regset regset;
375// OBSOLETE
376// OBSOLETE if (have_inferior_p ())
377// OBSOLETE {
378// OBSOLETE PTRACE_READ_REGS (PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) & regset);
379// OBSOLETE }
380// OBSOLETE else
381// OBSOLETE {
382// OBSOLETE int corechan = bfd_cache_lookup (core_bfd);
383// OBSOLETE if (lseek (corechan, 0, 0) < 0)
384// OBSOLETE {
385// OBSOLETE perror ("seek on core file");
386// OBSOLETE }
387// OBSOLETE if (myread (corechan, ubuf, UPAGES * NBPG) < 0)
388// OBSOLETE {
389// OBSOLETE perror ("read on core file");
390// OBSOLETE }
391// OBSOLETE /* only interested in the floating point registers */
392// OBSOLETE regset.pr_fpu = ((struct user *) ubuf)->u_fpusave;
393// OBSOLETE regset.pr_fpa = ((struct user *) ubuf)->u_fpasave;
394// OBSOLETE }
395// OBSOLETE print_fpu_status (regset);
396// OBSOLETE print_fpa_status (regset);
397// OBSOLETE }
398// OBSOLETE #endif
399// OBSOLETE
400// OBSOLETE static volatile int got_sigchld;
401// OBSOLETE
402// OBSOLETE /*ARGSUSED */
403// OBSOLETE /* This will eventually be more interesting. */
404// OBSOLETE void
405// OBSOLETE sigchld_handler (int signo)
406// OBSOLETE {
407// OBSOLETE got_sigchld++;
408// OBSOLETE }
409// OBSOLETE
410// OBSOLETE /*
411// OBSOLETE * Signals for which the default action does not cause the process
412// OBSOLETE * to die. See <sys/signal.h> for where this came from (alas, we
413// OBSOLETE * can't use those macros directly)
414// OBSOLETE */
415// OBSOLETE #ifndef sigmask
416// OBSOLETE #define sigmask(s) (1 << ((s) - 1))
417// OBSOLETE #endif
418// OBSOLETE #define SIGNALS_DFL_SAFE sigmask(SIGSTOP) | sigmask(SIGTSTP) | \
419// OBSOLETE sigmask(SIGTTIN) | sigmask(SIGTTOU) | sigmask(SIGCHLD) | \
420// OBSOLETE sigmask(SIGCONT) | sigmask(SIGWINCH) | sigmask(SIGPWR) | \
421// OBSOLETE sigmask(SIGURG) | sigmask(SIGPOLL)
422// OBSOLETE
423// OBSOLETE #ifdef ATTACH_DETACH
424// OBSOLETE /*
425// OBSOLETE * Thanks to XPT_MPDEBUGGER, we have to mange child_wait().
426// OBSOLETE */
427// OBSOLETE ptid_t
428// OBSOLETE child_wait (ptid_t ptid, struct target_waitstatus *status)
429// OBSOLETE {
430// OBSOLETE int save_errno, rv, xvaloff, saoff, sa_hand;
431// OBSOLETE struct pt_stop pt;
432// OBSOLETE struct user u;
433// OBSOLETE sigset_t set;
434// OBSOLETE /* Host signal number for a signal which the inferior terminates with, or
435// OBSOLETE 0 if it hasn't terminated due to a signal. */
436// OBSOLETE static int death_by_signal = 0;
437// OBSOLETE #ifdef SVR4_SHARED_LIBS /* use this to distinguish ptx 2 vs ptx 4 */
438// OBSOLETE prstatus_t pstatus;
439// OBSOLETE #endif
440// OBSOLETE int pid = PIDGET (ptid);
441// OBSOLETE
442// OBSOLETE do
443// OBSOLETE {
444// OBSOLETE set_sigint_trap (); /* Causes SIGINT to be passed on to the
445// OBSOLETE attached process. */
446// OBSOLETE save_errno = errno;
447// OBSOLETE
448// OBSOLETE got_sigchld = 0;
449// OBSOLETE
450// OBSOLETE sigemptyset (&set);
451// OBSOLETE
452// OBSOLETE while (got_sigchld == 0)
453// OBSOLETE {
454// OBSOLETE sigsuspend (&set);
455// OBSOLETE }
456// OBSOLETE
457// OBSOLETE clear_sigint_trap ();
458// OBSOLETE
459// OBSOLETE rv = mptrace (XPT_STOPSTAT, 0, (char *) &pt, 0);
460// OBSOLETE if (-1 == rv)
461// OBSOLETE {
462// OBSOLETE printf ("XPT_STOPSTAT: errno %d\n", errno); /* DEBUG */
463// OBSOLETE continue;
464// OBSOLETE }
465// OBSOLETE
466// OBSOLETE pid = pt.ps_pid;
467// OBSOLETE
468// OBSOLETE if (pid != PIDGET (inferior_ptid))
469// OBSOLETE {
470// OBSOLETE /* NOTE: the mystery fork in csh/tcsh needs to be ignored.
471// OBSOLETE * We should not return new children for the initial run
472// OBSOLETE * of a process until it has done the exec.
473// OBSOLETE */
474// OBSOLETE /* inferior probably forked; send it on its way */
475// OBSOLETE rv = mptrace (XPT_UNDEBUG, pid, 0, 0);
476// OBSOLETE if (-1 == rv)
477// OBSOLETE {
478// OBSOLETE printf ("child_wait: XPT_UNDEBUG: pid %d: %s\n", pid,
479// OBSOLETE safe_strerror (errno));
480// OBSOLETE }
481// OBSOLETE continue;
482// OBSOLETE }
483// OBSOLETE /* FIXME: Do we deal with fork notification correctly? */
484// OBSOLETE switch (pt.ps_reason)
485// OBSOLETE {
486// OBSOLETE case PTS_FORK:
487// OBSOLETE /* multi proc: treat like PTS_EXEC */
488// OBSOLETE /*
489// OBSOLETE * Pretend this didn't happen, since gdb isn't set up
490// OBSOLETE * to deal with stops on fork.
491// OBSOLETE */
492// OBSOLETE rv = ptrace (PT_CONTSIG, pid, 1, 0);
493// OBSOLETE if (-1 == rv)
494// OBSOLETE {
495// OBSOLETE printf ("PTS_FORK: PT_CONTSIG: error %d\n", errno);
496// OBSOLETE }
497// OBSOLETE continue;
498// OBSOLETE case PTS_EXEC:
499// OBSOLETE /*
500// OBSOLETE * Pretend this is a SIGTRAP.
501// OBSOLETE */
502// OBSOLETE status->kind = TARGET_WAITKIND_STOPPED;
503// OBSOLETE status->value.sig = TARGET_SIGNAL_TRAP;
504// OBSOLETE break;
505// OBSOLETE case PTS_EXIT:
506// OBSOLETE /*
507// OBSOLETE * Note: we stop before the exit actually occurs. Extract
508// OBSOLETE * the exit code from the uarea. If we're stopped in the
509// OBSOLETE * exit() system call, the exit code will be in
510// OBSOLETE * u.u_ap[0]. An exit due to an uncaught signal will have
511// OBSOLETE * something else in here, see the comment in the default:
512// OBSOLETE * case, below. Finally,let the process exit.
513// OBSOLETE */
514// OBSOLETE if (death_by_signal)
515// OBSOLETE {
516// OBSOLETE status->kind = TARGET_WAITKIND_SIGNALED;
517// OBSOLETE status->value.sig = target_signal_from_host (death_by_signal);
518// OBSOLETE death_by_signal = 0;
519// OBSOLETE break;
520// OBSOLETE }
521// OBSOLETE xvaloff = (unsigned long) &u.u_ap[0] - (unsigned long) &u;
522// OBSOLETE errno = 0;
523// OBSOLETE rv = ptrace (PT_RUSER, pid, (char *) xvaloff, 0);
524// OBSOLETE status->kind = TARGET_WAITKIND_EXITED;
525// OBSOLETE status->value.integer = rv;
526// OBSOLETE /*
527// OBSOLETE * addr & data to mptrace() don't matter here, since
528// OBSOLETE * the process is already dead.
529// OBSOLETE */
530// OBSOLETE rv = mptrace (XPT_UNDEBUG, pid, 0, 0);
531// OBSOLETE if (-1 == rv)
532// OBSOLETE {
533// OBSOLETE printf ("child_wait: PTS_EXIT: XPT_UNDEBUG: pid %d error %d\n", pid,
534// OBSOLETE errno);
535// OBSOLETE }
536// OBSOLETE break;
537// OBSOLETE case PTS_WATCHPT_HIT:
538// OBSOLETE internal_error (__FILE__, __LINE__,
539// OBSOLETE "PTS_WATCHPT_HIT\n");
540// OBSOLETE break;
541// OBSOLETE default:
542// OBSOLETE /* stopped by signal */
543// OBSOLETE status->kind = TARGET_WAITKIND_STOPPED;
544// OBSOLETE status->value.sig = target_signal_from_host (pt.ps_reason);
545// OBSOLETE death_by_signal = 0;
546// OBSOLETE
547// OBSOLETE if (0 == (SIGNALS_DFL_SAFE & sigmask (pt.ps_reason)))
548// OBSOLETE {
549// OBSOLETE break;
550// OBSOLETE }
551// OBSOLETE /* else default action of signal is to die */
552// OBSOLETE #ifdef SVR4_SHARED_LIBS
553// OBSOLETE rv = ptrace (PT_GET_PRSTATUS, pid, (char *) &pstatus, 0);
554// OBSOLETE if (-1 == rv)
555// OBSOLETE error ("child_wait: signal %d PT_GET_PRSTATUS: %s\n",
556// OBSOLETE pt.ps_reason, safe_strerror (errno));
557// OBSOLETE if (pstatus.pr_cursig != pt.ps_reason)
558// OBSOLETE {
559// OBSOLETE printf ("pstatus signal %d, pt signal %d\n",
560// OBSOLETE pstatus.pr_cursig, pt.ps_reason);
561// OBSOLETE }
562// OBSOLETE sa_hand = (int) pstatus.pr_action.sa_handler;
563// OBSOLETE #else
564// OBSOLETE saoff = (unsigned long) &u.u_sa[0] - (unsigned long) &u;
565// OBSOLETE saoff += sizeof (struct sigaction) * (pt.ps_reason - 1);
566// OBSOLETE errno = 0;
567// OBSOLETE sa_hand = ptrace (PT_RUSER, pid, (char *) saoff, 0);
568// OBSOLETE if (errno)
569// OBSOLETE error ("child_wait: signal %d: RUSER: %s\n",
570// OBSOLETE pt.ps_reason, safe_strerror (errno));
571// OBSOLETE #endif
572// OBSOLETE if ((int) SIG_DFL == sa_hand)
573// OBSOLETE {
574// OBSOLETE /* we will be dying */
575// OBSOLETE death_by_signal = pt.ps_reason;
576// OBSOLETE }
577// OBSOLETE break;
578// OBSOLETE }
579// OBSOLETE
580// OBSOLETE }
581// OBSOLETE while (pid != PIDGET (inferior_ptid)); /* Some other child died or stopped */
582// OBSOLETE
583// OBSOLETE return pid_to_ptid (pid);
584// OBSOLETE }
585// OBSOLETE #else /* !ATTACH_DETACH */
586// OBSOLETE /*
587// OBSOLETE * Simple child_wait() based on inftarg.c child_wait() for use until
588// OBSOLETE * the MPDEBUGGER child_wait() works properly. This will go away when
589// OBSOLETE * that is fixed.
590// OBSOLETE */
591// OBSOLETE ptid_t
592// OBSOLETE child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
593// OBSOLETE {
594// OBSOLETE int save_errno;
595// OBSOLETE int status;
596// OBSOLETE int pid = PIDGET (ptid);
597// OBSOLETE
598// OBSOLETE do
599// OBSOLETE {
600// OBSOLETE pid = wait (&status);
601// OBSOLETE save_errno = errno;
602// OBSOLETE
603// OBSOLETE if (pid == -1)
604// OBSOLETE {
605// OBSOLETE if (save_errno == EINTR)
606// OBSOLETE continue;
607// OBSOLETE fprintf (stderr, "Child process unexpectedly missing: %s.\n",
608// OBSOLETE safe_strerror (save_errno));
609// OBSOLETE ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
610// OBSOLETE ourstatus->value.sig = TARGET_SIGNAL_UNKNOWN;
611// OBSOLETE return pid_to_ptid (-1);
612// OBSOLETE }
613// OBSOLETE }
614// OBSOLETE while (pid != PIDGET (inferior_ptid)); /* Some other child died or stopped */
615// OBSOLETE store_waitstatus (ourstatus, status);
616// OBSOLETE return pid_to_ptid (pid);
617// OBSOLETE }
618// OBSOLETE #endif /* ATTACH_DETACH */
619// OBSOLETE \f
620// OBSOLETE
621// OBSOLETE
622// OBSOLETE /* This function simply calls ptrace with the given arguments.
623// OBSOLETE It exists so that all calls to ptrace are isolated in this
624// OBSOLETE machine-dependent file. */
625// OBSOLETE int
626// OBSOLETE call_ptrace (int request, int pid, PTRACE_ARG3_TYPE addr, int data)
627// OBSOLETE {
628// OBSOLETE return ptrace (request, pid, addr, data);
629// OBSOLETE }
630// OBSOLETE
631// OBSOLETE int
632// OBSOLETE call_mptrace (int request, int pid, PTRACE_ARG3_TYPE addr, int data)
633// OBSOLETE {
634// OBSOLETE return mptrace (request, pid, addr, data);
635// OBSOLETE }
636// OBSOLETE
637// OBSOLETE #if defined (DEBUG_PTRACE)
638// OBSOLETE /* For the rest of the file, use an extra level of indirection */
639// OBSOLETE /* This lets us breakpoint usefully on call_ptrace. */
640// OBSOLETE #define ptrace call_ptrace
641// OBSOLETE #define mptrace call_mptrace
642// OBSOLETE #endif
643// OBSOLETE
644// OBSOLETE void
645// OBSOLETE kill_inferior (void)
646// OBSOLETE {
647// OBSOLETE if (ptid_equal (inferior_ptid, null_ptid))
648// OBSOLETE return;
649// OBSOLETE
650// OBSOLETE /* For MPDEBUGGER, don't use PT_KILL, since the child will stop
651// OBSOLETE again with a PTS_EXIT. Just hit him with SIGKILL (so he stops)
652// OBSOLETE and detach. */
653// OBSOLETE
654// OBSOLETE kill (PIDGET (inferior_ptid), SIGKILL);
655// OBSOLETE #ifdef ATTACH_DETACH
656// OBSOLETE detach (SIGKILL);
657// OBSOLETE #else /* ATTACH_DETACH */
658// OBSOLETE ptrace (PT_KILL, PIDGET (inferior_ptid), 0, 0);
659// OBSOLETE wait ((int *) NULL);
660// OBSOLETE #endif /* ATTACH_DETACH */
661// OBSOLETE target_mourn_inferior ();
662// OBSOLETE }
663// OBSOLETE
664// OBSOLETE /* Resume execution of the inferior process.
665// OBSOLETE If STEP is nonzero, single-step it.
666// OBSOLETE If SIGNAL is nonzero, give it that signal. */
667// OBSOLETE
668// OBSOLETE void
669// OBSOLETE child_resume (ptid_t ptid, int step, enum target_signal signal)
670// OBSOLETE {
671// OBSOLETE int pid = PIDGET (ptid);
672// OBSOLETE
673// OBSOLETE errno = 0;
674// OBSOLETE
675// OBSOLETE if (pid == -1)
676// OBSOLETE pid = PIDGET (inferior_ptid);
677// OBSOLETE
678// OBSOLETE /* An address of (PTRACE_ARG3_TYPE)1 tells ptrace to continue from where
679// OBSOLETE it was. (If GDB wanted it to start some other way, we have already
680// OBSOLETE written a new PC value to the child.)
681// OBSOLETE
682// OBSOLETE If this system does not support PT_SSTEP, a higher level function will
683// OBSOLETE have called single_step() to transmute the step request into a
684// OBSOLETE continue request (by setting breakpoints on all possible successor
685// OBSOLETE instructions), so we don't have to worry about that here. */
686// OBSOLETE
687// OBSOLETE if (step)
688// OBSOLETE ptrace (PT_SSTEP, pid, (PTRACE_ARG3_TYPE) 1, signal);
689// OBSOLETE else
690// OBSOLETE ptrace (PT_CONTSIG, pid, (PTRACE_ARG3_TYPE) 1, signal);
691// OBSOLETE
692// OBSOLETE if (errno)
693// OBSOLETE perror_with_name ("ptrace");
694// OBSOLETE }
695// OBSOLETE \f
696// OBSOLETE #ifdef ATTACH_DETACH
697// OBSOLETE /* Start debugging the process whose number is PID. */
698// OBSOLETE int
699// OBSOLETE attach (int pid)
700// OBSOLETE {
701// OBSOLETE sigset_t set;
702// OBSOLETE int rv;
703// OBSOLETE
704// OBSOLETE rv = mptrace (XPT_DEBUG, pid, 0, 0);
705// OBSOLETE if (-1 == rv)
706// OBSOLETE {
707// OBSOLETE error ("mptrace(XPT_DEBUG): %s", safe_strerror (errno));
708// OBSOLETE }
709// OBSOLETE rv = mptrace (XPT_SIGNAL, pid, 0, SIGSTOP);
710// OBSOLETE if (-1 == rv)
711// OBSOLETE {
712// OBSOLETE error ("mptrace(XPT_SIGNAL): %s", safe_strerror (errno));
713// OBSOLETE }
714// OBSOLETE attach_flag = 1;
715// OBSOLETE return pid;
716// OBSOLETE }
717// OBSOLETE
718// OBSOLETE void
719// OBSOLETE detach (int signo)
720// OBSOLETE {
721// OBSOLETE int rv;
722// OBSOLETE
723// OBSOLETE rv = mptrace (XPT_UNDEBUG, PIDGET (inferior_ptid), 1, signo);
724// OBSOLETE if (-1 == rv)
725// OBSOLETE {
726// OBSOLETE error ("mptrace(XPT_UNDEBUG): %s", safe_strerror (errno));
727// OBSOLETE }
728// OBSOLETE attach_flag = 0;
729// OBSOLETE }
730// OBSOLETE
731// OBSOLETE #endif /* ATTACH_DETACH */
732// OBSOLETE \f
733// OBSOLETE /* Default the type of the ptrace transfer to int. */
734// OBSOLETE #ifndef PTRACE_XFER_TYPE
735// OBSOLETE #define PTRACE_XFER_TYPE int
736// OBSOLETE #endif
737// OBSOLETE \f
738// OBSOLETE
739// OBSOLETE /* NOTE! I tried using PTRACE_READDATA, etc., to read and write memory
740// OBSOLETE in the NEW_SUN_PTRACE case.
741// OBSOLETE It ought to be straightforward. But it appears that writing did
742// OBSOLETE not write the data that I specified. I cannot understand where
743// OBSOLETE it got the data that it actually did write. */
744// OBSOLETE
745// OBSOLETE /* Copy LEN bytes to or from inferior's memory starting at MEMADDR
746// OBSOLETE to debugger memory starting at MYADDR. Copy to inferior if
747// OBSOLETE WRITE is nonzero. TARGET is ignored.
748// OBSOLETE
749// OBSOLETE Returns the length copied, which is either the LEN argument or zero.
750// OBSOLETE This xfer function does not do partial moves, since child_ops
751// OBSOLETE doesn't allow memory operations to cross below us in the target stack
752// OBSOLETE anyway. */
753// OBSOLETE
754// OBSOLETE int
755// OBSOLETE child_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write,
756// OBSOLETE struct mem_attrib *attrib,
757// OBSOLETE struct target_ops *target)
758// OBSOLETE {
759// OBSOLETE register int i;
760// OBSOLETE /* Round starting address down to longword boundary. */
761// OBSOLETE register CORE_ADDR addr = memaddr & -(CORE_ADDR) sizeof (PTRACE_XFER_TYPE);
762// OBSOLETE /* Round ending address up; get number of longwords that makes. */
763// OBSOLETE register int count
764// OBSOLETE = (((memaddr + len) - addr) + sizeof (PTRACE_XFER_TYPE) - 1)
765// OBSOLETE / sizeof (PTRACE_XFER_TYPE);
766// OBSOLETE /* Allocate buffer of that many longwords. */
767// OBSOLETE /* FIXME (alloca): This code, cloned from infptrace.c, is unsafe
768// OBSOLETE because it uses alloca to allocate a buffer of arbitrary size.
769// OBSOLETE For very large xfers, this could crash GDB's stack. */
770// OBSOLETE register PTRACE_XFER_TYPE *buffer
771// OBSOLETE = (PTRACE_XFER_TYPE *) alloca (count * sizeof (PTRACE_XFER_TYPE));
772// OBSOLETE
773// OBSOLETE if (write)
774// OBSOLETE {
775// OBSOLETE /* Fill start and end extra bytes of buffer with existing memory data. */
776// OBSOLETE
777// OBSOLETE if (addr != memaddr || len < (int) sizeof (PTRACE_XFER_TYPE))
778// OBSOLETE {
779// OBSOLETE /* Need part of initial word -- fetch it. */
780// OBSOLETE buffer[0] = ptrace (PT_RTEXT, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) addr,
781// OBSOLETE 0);
782// OBSOLETE }
783// OBSOLETE
784// OBSOLETE if (count > 1) /* FIXME, avoid if even boundary */
785// OBSOLETE {
786// OBSOLETE buffer[count - 1]
787// OBSOLETE = ptrace (PT_RTEXT, PIDGET (inferior_ptid),
788// OBSOLETE ((PTRACE_ARG3_TYPE)
789// OBSOLETE (addr + (count - 1) * sizeof (PTRACE_XFER_TYPE))),
790// OBSOLETE 0);
791// OBSOLETE }
792// OBSOLETE
793// OBSOLETE /* Copy data to be written over corresponding part of buffer */
794// OBSOLETE
795// OBSOLETE memcpy ((char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)),
796// OBSOLETE myaddr,
797// OBSOLETE len);
798// OBSOLETE
799// OBSOLETE /* Write the entire buffer. */
800// OBSOLETE
801// OBSOLETE for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
802// OBSOLETE {
803// OBSOLETE errno = 0;
804// OBSOLETE ptrace (PT_WDATA, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) addr,
805// OBSOLETE buffer[i]);
806// OBSOLETE if (errno)
807// OBSOLETE {
808// OBSOLETE /* Using the appropriate one (I or D) is necessary for
809// OBSOLETE Gould NP1, at least. */
810// OBSOLETE errno = 0;
811// OBSOLETE ptrace (PT_WTEXT, PIDGET (inferior_ptid), (PTRACE_ARG3_TYPE) addr,
812// OBSOLETE buffer[i]);
813// OBSOLETE }
814// OBSOLETE if (errno)
815// OBSOLETE return 0;
816// OBSOLETE }
817// OBSOLETE }
818// OBSOLETE else
819// OBSOLETE {
820// OBSOLETE /* Read all the longwords */
821// OBSOLETE for (i = 0; i < count; i++, addr += sizeof (PTRACE_XFER_TYPE))
822// OBSOLETE {
823// OBSOLETE errno = 0;
824// OBSOLETE buffer[i] = ptrace (PT_RTEXT, PIDGET (inferior_ptid),
825// OBSOLETE (PTRACE_ARG3_TYPE) addr, 0);
826// OBSOLETE if (errno)
827// OBSOLETE return 0;
828// OBSOLETE QUIT;
829// OBSOLETE }
830// OBSOLETE
831// OBSOLETE /* Copy appropriate bytes out of the buffer. */
832// OBSOLETE memcpy (myaddr,
833// OBSOLETE (char *) buffer + (memaddr & (sizeof (PTRACE_XFER_TYPE) - 1)),
834// OBSOLETE len);
835// OBSOLETE }
836// OBSOLETE return len;
837// OBSOLETE }
838// OBSOLETE
839// OBSOLETE
840// OBSOLETE void
841// OBSOLETE _initialize_symm_nat (void)
842// OBSOLETE {
843// OBSOLETE #ifdef ATTACH_DETACH
844// OBSOLETE /*
845// OBSOLETE * the MPDEBUGGER is necessary for process tree debugging and attach
846// OBSOLETE * to work, but it alters the behavior of debugged processes, so other
847// OBSOLETE * things (at least child_wait()) will have to change to accomodate
848// OBSOLETE * that.
849// OBSOLETE *
850// OBSOLETE * Note that attach is not implemented in dynix 3, and not in ptx
851// OBSOLETE * until version 2.1 of the OS.
852// OBSOLETE */
853// OBSOLETE int rv;
854// OBSOLETE sigset_t set;
855// OBSOLETE struct sigaction sact;
856// OBSOLETE
857// OBSOLETE rv = mptrace (XPT_MPDEBUGGER, 0, 0, 0);
858// OBSOLETE if (-1 == rv)
859// OBSOLETE {
860// OBSOLETE internal_error (__FILE__, __LINE__,
861// OBSOLETE "_initialize_symm_nat(): mptrace(XPT_MPDEBUGGER): %s",
862// OBSOLETE safe_strerror (errno));
863// OBSOLETE }
864// OBSOLETE
865// OBSOLETE /*
866// OBSOLETE * Under MPDEBUGGER, we get SIGCLHD when a traced process does
867// OBSOLETE * anything of interest.
868// OBSOLETE */
869// OBSOLETE
870// OBSOLETE /*
871// OBSOLETE * Block SIGCHLD. We leave it blocked all the time, and then
872// OBSOLETE * call sigsuspend() in child_wait() to wait for the child
873// OBSOLETE * to do something. None of these ought to fail, but check anyway.
874// OBSOLETE */
875// OBSOLETE sigemptyset (&set);
876// OBSOLETE rv = sigaddset (&set, SIGCHLD);
877// OBSOLETE if (-1 == rv)
878// OBSOLETE {
879// OBSOLETE internal_error (__FILE__, __LINE__,
880// OBSOLETE "_initialize_symm_nat(): sigaddset(SIGCHLD): %s",
881// OBSOLETE safe_strerror (errno));
882// OBSOLETE }
883// OBSOLETE rv = sigprocmask (SIG_BLOCK, &set, (sigset_t *) NULL);
884// OBSOLETE if (-1 == rv)
885// OBSOLETE {
886// OBSOLETE internal_error (__FILE__, __LINE__,
887// OBSOLETE "_initialize_symm_nat(): sigprocmask(SIG_BLOCK): %s",
888// OBSOLETE safe_strerror (errno));
889// OBSOLETE }
890// OBSOLETE
891// OBSOLETE sact.sa_handler = sigchld_handler;
892// OBSOLETE sigemptyset (&sact.sa_mask);
893// OBSOLETE sact.sa_flags = SA_NOCLDWAIT; /* keep the zombies away */
894// OBSOLETE rv = sigaction (SIGCHLD, &sact, (struct sigaction *) NULL);
895// OBSOLETE if (-1 == rv)
896// OBSOLETE {
897// OBSOLETE internal_error (__FILE__, __LINE__,
898// OBSOLETE "_initialize_symm_nat(): sigaction(SIGCHLD): %s",
899// OBSOLETE safe_strerror (errno));
900// OBSOLETE }
901// OBSOLETE #endif
902// OBSOLETE }
This page took 0.08843 seconds and 4 git commands to generate.