home *** CD-ROM | disk | FTP | other *** search
/ ftp.mayn.de / ftp.mayn.de-pub.zip / ftp.mayn.de-pub / apple / apple_unix / GNU_stuff / gdb-4.12.diffs < prev    next >
Text File  |  2017-03-06  |  40KB  |  1,346 lines

  1. *** ./gdb/config/m68k/aux.mh.orig    Fri Feb 11 11:09:39 1994
  2. --- ./gdb/config/m68k/aux.mh    Fri Feb 11 11:13:07 1994
  3. ***************
  4. *** 0 ****
  5. --- 1,8 ----
  6. + # Host: Apple Macintosh running A/UX version 3.0.
  7. + XM_FILE= xm-aux.h
  8. + NAT_FILE= nm-aux.h
  9. + NATDEPFILES= exec.o inftarg.o fork-child.o corelow.o
  10. + XDEPFILES= aux-xdep.o exec.o inftarg.o fork-child.o
  11. + REGEX= regex.o
  12. + REGEX1= regex.o
  13. + XM_CLIBS= -static # -lposix # -lposix seems to cause trouble with ctrl-z
  14. *** ./gdb/config/m68k/aux.mt.orig    Fri Feb 11 11:09:39 1994
  15. --- ./gdb/config/m68k/aux.mt    Fri Feb 11 11:09:39 1994
  16. ***************
  17. *** 0 ****
  18. --- 1,3 ----
  19. + # Target: Apple Macintosh running A/UX version 3.0.
  20. + TDEPFILES= m68k-pinsn.o exec.o m68k-tdep.o remote-aux.o
  21. + TM_FILE= tm-aux.h
  22. *** ./gdb/config/m68k/tm-aux.h.orig    Fri Feb 11 11:09:39 1994
  23. --- ./gdb/config/m68k/tm-aux.h    Fri Feb 11 11:43:09 1994
  24. ***************
  25. *** 0 ****
  26. --- 1,100 ----
  27. + /* Parameters for execution on Apple A/UX, for GDB, the GNU debugger.
  28. +    Copyright (C) 1992 Thomas Eberhardt (thomas@mathematik.uni-Bremen.de)
  29. + This program is free software; you can redistribute it and/or modify
  30. + it under the terms of the GNU General Public License as published by
  31. + the Free Software Foundation; either version 2 of the License, or
  32. + (at your option) any later version.
  33. + This program is distributed in the hope that it will be useful,
  34. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  35. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  36. + GNU General Public License for more details.
  37. + You should have received a copy of the GNU General Public License
  38. + along with this program; if not, write to the Free Software
  39. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  40. + /* Define HAVE_68881 if that is the case.  */
  41. + #define HAVE_68881
  42. + /* Define BPT_VECTOR if it is different than the default.
  43. +    This is the vector number used by traps to indicate a breakpoint. */
  44. + #define BPT_VECTOR 0x1
  45. + /* Are we currently handling a signal */
  46. + #define IN_SIGTRAMP(pc, name) \
  47. +  name && *name == '_' && !strcmp ("_sigcode", name)
  48. + /* If your kernel resets the pc after the trap happens you may need to
  49. +    define this before including this file.  */
  50. + #define DECR_PC_AFTER_BREAK 0
  51. + /* Extract from an array REGBUF containing the (raw) register state
  52. +    a function return value of type TYPE, and copy that, in virtual format,
  53. +    into VALBUF.  This is assuming that floating point values are returned
  54. +    as doubles in fp0.  */
  55. + #define EXTRACT_RETURN_VALUE(TYPE,REGBUF,VALBUF) \
  56. +   { if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
  57. +       { \
  58. +     REGISTER_CONVERT_TO_VIRTUAL (FP0_REGNUM, \
  59. +                 REGISTER_VIRTUAL_TYPE (FP0_REGNUM), \
  60. +                 ®BUF[REGISTER_BYTE (FP0_REGNUM)], \
  61. +                 VALBUF); \
  62. +       } \
  63. +     else \
  64. +       memcpy (VALBUF, REGBUF, TYPE_LENGTH (TYPE)); }
  65. + /* Write into appropriate registers a function return value
  66. +    of type TYPE, given in virtual format.  Assumes floats are passed
  67. +    in fp0.  */
  68. + #define STORE_RETURN_VALUE(TYPE,VALBUF) \
  69. +   { if (TYPE_CODE (TYPE) == TYPE_CODE_FLT) \
  70. +       { \
  71. +     char raw_buf[REGISTER_RAW_SIZE (FP0_REGNUM)]; \
  72. +     REGISTER_CONVERT_TO_RAW (REGISTER_VIRTUAL_TYPE (FP0_REGNUM), \
  73. +                  FP0_REGNUM, VALBUF, raw_buf); \
  74. +     write_register_bytes (FP0_REGNUM, \
  75. +                   raw_buf, REGISTER_RAW_SIZE (FP0_REGNUM)); \
  76. +       } \
  77. +     else \
  78. +       write_register_bytes (0, VALBUF, TYPE_LENGTH (TYPE)); }
  79. + /* Needed for child_xfer_memory in aux-xdep.c */
  80. + #define NEED_TEXT_START_END
  81. + /* We don't have this */
  82. + #define NO_PTRACE_H
  83. + #define JB_ELEMENT_SIZE 4
  84. + #define JB_D2 0
  85. + #define JB_D3 1
  86. + #define JB_D4 2
  87. + #define JB_D5 3
  88. + #define JB_D6 4
  89. + #define JB_D7 5
  90. + #define JB_PC 6
  91. + #define JB_A2 7
  92. + #define JB_A3 8
  93. + #define JB_A4 9
  94. + #define JB_A5 10
  95. + #define JB_A6 11
  96. + #define JB_A7 12
  97. + #define JB_SIGMASK 13
  98. + /* Figure out where the longjmp will land.  Slurp the args out of the stack.
  99. +    We expect the first arg to be a pointer to the jmp_buf structure from which
  100. +    we extract the pc (JB_PC) that we will land at.  The pc is copied into ADDR.
  101. +    This routine returns true on success */
  102. + #define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
  103. + #include "m68k/tm-m68k.h"
  104. *** ./gdb/config/m68k/xm-aux.h.orig    Fri Feb 11 11:09:39 1994
  105. --- ./gdb/config/m68k/xm-aux.h    Fri Feb 11 11:09:40 1994
  106. ***************
  107. *** 0 ****
  108. --- 1,97 ----
  109. + /* Parameters for execution on Apple A/UX, for GDB, the GNU debugger.
  110. +    Copyright (C) 1992 Thomas Eberhardt (thomas@mathematik.uni-Bremen.de)
  111. + This program is free software; you can redistribute it and/or modify
  112. + it under the terms of the GNU General Public License as published by
  113. + the Free Software Foundation; either version 2 of the License, or
  114. + (at your option) any later version.
  115. + This program is distributed in the hope that it will be useful,
  116. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  117. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  118. + GNU General Public License for more details.
  119. + You should have received a copy of the GNU General Public License
  120. + along with this program; if not, write to the Free Software
  121. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  122. + #define USG
  123. + #define NEED_POSIX_SETPGID
  124. + #define NO_SYS_FILE
  125. + #define HOST_BYTE_ORDER BIG_ENDIAN
  126. + #define HAVE_TERMIO
  127. + #define HAVE_SIGSETMASK 1
  128. + #define SYS_SIGLIST_MISSING 1
  129. + extern char *strdup();
  130. + #define REGISTER_ADDR(u_ar0, regno)                    \
  131. +   (unsigned)                                \
  132. +   ((regno) < PS_REGNUM                            \
  133. +    ? &((int *)(u_ar0))[(regno) + R0]                    \
  134. +    : ((regno) == PS_REGNUM                        \
  135. +       ? &((int *)(u_ar0))[RPS]                        \
  136. +       : &((int *)(u_ar0))[PC]))
  137. + #define FP_REGISTER_ADDR(regno)                        \
  138. +   ((regno) < FPC_REGNUM                            \
  139. +    ? offsetof(struct user, u_fpdreg[(regno) - FP0_REGNUM])        \
  140. +    : offsetof(struct user, u_fpsysreg[(regno) - FPC_REGNUM]))
  141. + /* Interface definitions for kernel debugger KDB.  */
  142. + /* Map machine fault codes into signal numbers.
  143. +    First subtract 0, divide by 4, then index in a table.
  144. +    Faults for which the entry in this table is 0
  145. +    are not handled by KDB; the program's own trap handler
  146. +    gets to handle then.  */
  147. + #define FAULT_CODE_ORIGIN 0
  148. + #define FAULT_CODE_UNITS 4
  149. + #define FAULT_TABLE    \
  150. + { 0, 0, 0, 0, SIGTRAP, 0, 0, 0, \
  151. +   0, SIGTRAP, 0, 0, 0, 0, 0, SIGKILL, \
  152. +   0, 0, 0, 0, 0, 0, 0, 0, \
  153. +   SIGILL }
  154. + /* Start running with a stack stretching from BEG to END.
  155. +    BEG and END should be symbols meaningful to the assembler.
  156. +    This is used only for kdb.  */
  157. + #define INIT_STACK(beg, end)  \
  158. + { asm (".globl end");         \
  159. +   asm ("movel #end, %sp");      \
  160. +   asm ("movel #0,%a6"); }
  161. + /* Push the frame pointer register on the stack.  */
  162. + #define PUSH_FRAME_PTR        \
  163. +   asm ("movel %a6,%sp@-");
  164. + /* Copy the top-of-stack to the frame pointer register.  */
  165. + #define POP_FRAME_PTR  \
  166. +   asm ("movl %sp@,%a6");
  167. + /* After KDB is entered by a fault, push all registers
  168. +    that GDB thinks about (all NUM_REGS of them),
  169. +    so that they appear in order of ascending GDB register number.
  170. +    The fault code will be on the stack beyond the last register.  */
  171. + #define PUSH_REGISTERS        \
  172. + { asm ("clrw @%sp-");          \
  173. +   asm ("pea %sp@(10)");          \
  174. +   asm ("movem #0xfffe,%sp@-"); }
  175. + /* Assuming the registers (including processor status) have been
  176. +    pushed on the stack in order of ascending GDB register number,
  177. +    restore them and return to the address in the saved PC register.  */
  178. + #define POP_REGISTERS          \
  179. + { asm ("subil #8,%sp@(28)");     \
  180. +   asm ("movem %sp@,#0xffff"); \
  181. +   asm ("rte"); }
  182. *** ./gdb/config/m68k/nm-aux.h.orig    Fri Feb 11 11:09:40 1994
  183. --- ./gdb/config/m68k/nm-aux.h    Fri Feb 11 11:09:40 1994
  184. ***************
  185. *** 0 ****
  186. --- 1,23 ----
  187. + /* Parameters for native support on A/UX, for GDB, the GNU debugger.
  188. +    Copyright (C) 1986, 1987, 1989, 1992 Free Software Foundation, Inc.
  189. + This file is part of GDB.
  190. + This program is free software; you can redistribute it and/or modify
  191. + it under the terms of the GNU General Public License as published by
  192. + the Free Software Foundation; either version 2 of the License, or
  193. + (at your option) any later version.
  194. + This program is distributed in the hope that it will be useful,
  195. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  196. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  197. + GNU General Public License for more details.
  198. + You should have received a copy of the GNU General Public License
  199. + along with this program; if not, write to the Free Software
  200. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  201. + /* Do implement the attach and detach commands. EXPERIMENTAL HACK */
  202. + #define ATTACH_DETACH
  203. *** ./gdb/config/m68k/tm-m68k.h.orig    Thu Feb  3 08:43:18 1994
  204. --- ./gdb/config/m68k/tm-m68k.h    Fri Feb 11 12:22:33 1994
  205. ***************
  206. *** 162,170 ****
  207.   
  208.   #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
  209.   { \
  210. !   double val; \
  211. !   ieee_extended_to_double (&ext_format_68881, (FROM), &val); \
  212. !   store_floating ((TO), TYPE_LENGTH (TYPE), val); \
  213.   }
  214.   
  215.   /* Convert data from virtual format with type TYPE in buffer FROM
  216. --- 162,170 ----
  217.   
  218.   #define REGISTER_CONVERT_TO_VIRTUAL(REGNUM,TYPE,FROM,TO) \
  219.   { \
  220. !   double RCtVval; \
  221. !   ieee_extended_to_double (&ext_format_68881, (FROM), &RCtVval); \
  222. !   store_floating ((TO), TYPE_LENGTH (TYPE), RCtVval); \
  223.   }
  224.   
  225.   /* Convert data from virtual format with type TYPE in buffer FROM
  226. ***************
  227. *** 172,179 ****
  228.   
  229.   #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO)    \
  230.   { \
  231. !   double val = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
  232. !   double_to_ieee_extended (&ext_format_68881, &val, (TO)); \
  233.   }
  234.   
  235.   /* Return the GDB type object for the "standard" data type
  236. --- 172,179 ----
  237.   
  238.   #define REGISTER_CONVERT_TO_RAW(TYPE,REGNUM,FROM,TO)    \
  239.   { \
  240. !   double RCtRval = extract_floating ((FROM), TYPE_LENGTH (TYPE)); \
  241. !   double_to_ieee_extended (&ext_format_68881, &RCtRval, (TO)); \
  242.   }
  243.   
  244.   /* Return the GDB type object for the "standard" data type
  245. *** ./gdb/aux-xdep.c.orig    Fri Feb 11 11:09:40 1994
  246. --- ./gdb/aux-xdep.c    Fri Feb 11 12:30:48 1994
  247. ***************
  248. *** 0 ****
  249. --- 1,376 ----
  250. + /* Host-dependent code for Apple A/UX for GDB, the GNU debugger.
  251. +    Copyright (C) 1992 Thomas Eberhardt (thomas@mathematik.uni-Bremen.de)
  252. + This program is free software; you can redistribute it and/or modify
  253. + it under the terms of the GNU General Public License as published by
  254. + the Free Software Foundation; either version 2 of the License, or
  255. + (at your option) any later version.
  256. + This program is distributed in the hope that it will be useful,
  257. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  258. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  259. + GNU General Public License for more details.
  260. + You should have received a copy of the GNU General Public License
  261. + along with this program; if not, write to the Free Software
  262. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  263. + #include <stdio.h>
  264. + #include "defs.h"
  265. + #include "inferior.h"
  266. + #include "gdbcore.h"
  267. + #include "target.h"
  268. + #include <sys/types.h>
  269. + #include <sys/reg.h>
  270. + #include <sys/param.h>
  271. + #include <sys/time.h>
  272. + #include <sys/user.h>
  273. + extern int errno;
  274. + #define PT_READ_I    1
  275. + #define    PT_READ_D    2
  276. + #define PT_READ_U    3
  277. + #define PT_WRITE_I    4
  278. + #define PT_WRITE_D    5
  279. + #define PT_WRITE_U    6
  280. + #define PT_CONTINUE    7
  281. + #define PT_KILL        8
  282. + #define PT_STEP        9
  283. + #define PT_READ_R    10
  284. + #define PT_WRITE_R    11
  285. + #ifdef ATTACH_DETACH
  286. + #define PT_ATTACH    12
  287. + #define PT_DETACH    13
  288. + #endif
  289. + #ifndef PT_ATTACH
  290. + #define PT_ATTACH PTRACE_ATTACH
  291. + #endif
  292. + #ifndef PT_DETACH
  293. + #define PT_DETACH PTRACE_DETACH
  294. + #endif
  295. + /* This function simply calls ptrace with the given arguments.  
  296. +    It exists so that all calls to ptrace are isolated in this 
  297. +    machine-dependent file. */
  298. + int
  299. + call_ptrace (request, pid, addr, data)
  300. +      int request, pid;
  301. +      PTRACE_ARG3_TYPE addr;
  302. +      int data;
  303. + {
  304. +   return ptrace (request, pid, addr, data);
  305. + }
  306. + #ifdef DEBUG_PTRACE
  307. + /* For the rest of the file, use an extra level of indirection */
  308. + /* This lets us breakpoint usefully on call_ptrace. */
  309. + #define ptrace call_ptrace
  310. + #endif
  311. + /* This is used when GDB is exiting.  It gives less chance of error.*/
  312. + void
  313. + kill_inferior_fast ()
  314. + {
  315. +   if (inferior_pid == 0)
  316. +     return;
  317. +   ptrace (PT_KILL, inferior_pid, (PTRACE_ARG3_TYPE) 0, 0);
  318. +   wait ((int *)0);
  319. + }
  320. + void
  321. + kill_inferior ()
  322. + {
  323. +   kill_inferior_fast ();
  324. +   target_mourn_inferior ();
  325. + }
  326. + /* Resume execution of the inferior process.
  327. +    If STEP is nonzero, single-step it.
  328. +    If SIGNAL is nonzero, give it that signal.  */
  329. + void
  330. + child_resume (pid, step, signal)
  331. +      int pid;
  332. +      int step;
  333. +      enum target_signal signal;
  334. + {
  335. +   errno = 0;
  336. +   if (pid == -1)
  337. +     pid = inferior_pid;
  338. +   /* An address of (PTRACE_ARG3_TYPE) 1 tells ptrace to continue from where
  339. +      it was. (If GDB wanted it to start some other way, we have already
  340. +      written a new PC value to the child.)  */
  341. +   if (step)
  342. +     ptrace (PT_STEP, pid, (PTRACE_ARG3_TYPE) 1,
  343. +         target_signal_to_host(signal));
  344. +   else
  345. +     ptrace (PT_CONTINUE, pid, (PTRACE_ARG3_TYPE) 1,
  346. +         target_signal_to_host(signal));
  347. +   if (errno)
  348. +     perror_with_name ("ptrace");
  349. + }
  350. + #ifdef ATTACH_DETACH
  351. + /* Start debugging the process whose number is PID.  */
  352. + int
  353. + attach (pid)
  354. +      int pid;
  355. + {
  356. +   errno = 0;
  357. +   ptrace (PT_ATTACH, pid, (PTRACE_ARG3_TYPE) 0, 0);
  358. +   if (errno)
  359. +     perror_with_name ("ptrace");
  360. +   attach_flag = 1;
  361. +   return pid;
  362. + }
  363. + /* Stop debugging the process whose number is PID
  364. +    and continue it with signal number SIGNAL.
  365. +    SIGNAL = 0 means just continue it.  */
  366. + void
  367. + detach (signal)
  368. +      int signal;
  369. + {
  370. +   errno = 0;
  371. +   ptrace (PT_DETACH, inferior_pid, (PTRACE_ARG3_TYPE) 1, signal);
  372. +   if (errno)
  373. +     perror_with_name ("ptrace");
  374. +   attach_flag = 0;
  375. + }
  376. + #endif /* ATTACH_DETACH */
  377. +             
  378. + void
  379. + fetch_register (int regno)
  380. + {
  381. +   register unsigned int regaddr;
  382. +   char buf[MAX_REGISTER_RAW_SIZE];
  383. +   register int i;
  384. +   if (regno < FP0_REGNUM)
  385. +     *(int *) &buf[0] =
  386. +       ptrace (PT_READ_R, inferior_pid,
  387. +           (PTRACE_ARG3_TYPE) (regno < PS_REGNUM ? regno
  388. +                   : (regno == PS_REGNUM ? 17 : 16)), 0);
  389. +   else
  390. +     {
  391. +       regaddr = FP_REGISTER_ADDR (regno);
  392. +       for (i = 0; i < REGISTER_RAW_SIZE (regno); i += sizeof (int))
  393. +     {
  394. +       *(int *) &buf[i] = ptrace (PT_READ_U, inferior_pid,
  395. +                      (PTRACE_ARG3_TYPE) regaddr, 0);
  396. +       regaddr += sizeof (int);
  397. +     }
  398. +     }
  399. +   supply_register (regno, buf);
  400. + }
  401. + void
  402. + fetch_inferior_registers (regno)
  403. +      int regno;
  404. + {
  405. +   if (regno == -1)
  406. +     for (regno = 0; regno < NUM_REGS; regno++)
  407. +       fetch_register (regno);
  408. +   else
  409. +     fetch_register (regno);
  410. + }
  411. + void
  412. + store_inferior_registers (regno)
  413. +      int regno;
  414. + {
  415. +   register unsigned int regaddr;
  416. +   char buf[80];
  417. +   if (regno >= 0)
  418. +     {
  419. +       errno = 0;
  420. +       if (regno < FP0_REGNUM)
  421. +         ptrace (PT_WRITE_R, inferior_pid,
  422. +         (PTRACE_ARG3_TYPE) (regno < PS_REGNUM ? regno
  423. +                     : (regno == PS_REGNUM ? 17 : 16)),
  424. +         read_register (regno));
  425. +       else
  426. +     {
  427. +       int i;
  428. +           regaddr = FP_REGISTER_ADDR (regno);
  429. +       for (i = 0; i < REGISTER_RAW_SIZE(regno); i += sizeof(int))
  430. +         {
  431. +           errno = 0;
  432. +               ptrace (PT_WRITE_U, inferior_pid,
  433. +           (PTRACE_ARG3_TYPE) regaddr, *(int *)
  434. +             ®isters[REGISTER_BYTE (regno) + i]);
  435. +           if (errno != 0)
  436. +             {
  437. +           sprintf (buf, "writing register number %d(%d)", regno, i);
  438. +           perror_with_name (buf);
  439. +         }
  440. +               regaddr += sizeof(int);
  441. +             }
  442. +     }
  443. +       if (errno != 0)
  444. +     {
  445. +       sprintf (buf, "writing register number %d", regno);
  446. +       perror_with_name (buf);
  447. +     }
  448. +     }
  449. +   else
  450. +     {
  451. +       for (regno = 0; regno < NUM_REGS; regno++)
  452. +     {
  453. +       errno = 0;
  454. +       if (regno < FP0_REGNUM)
  455. +         ptrace (PT_WRITE_R, inferior_pid,
  456. +             (PTRACE_ARG3_TYPE) (regno < PS_REGNUM ? regno
  457. +                     : (regno == PS_REGNUM ? 17 : 16)),
  458. +             read_register (regno));
  459. +       else
  460. +         {
  461. +           int i;
  462. +               regaddr = FP_REGISTER_ADDR (regno);
  463. +           for (i = 0; i < REGISTER_RAW_SIZE(regno); i += sizeof(int))
  464. +             {
  465. +               errno = 0;
  466. +                   ptrace (PT_WRITE_U, inferior_pid,
  467. +               (PTRACE_ARG3_TYPE) regaddr, *(int *)
  468. +                 ®isters[REGISTER_BYTE (regno) + i]);
  469. +               if (errno != 0)
  470. +                 {
  471. +               sprintf (buf, "writing register number %d(%d)", regno, i);
  472. +               perror_with_name (buf);
  473. +             }
  474. +                   regaddr += sizeof(int);
  475. +                 }
  476. +             }
  477. +       if (errno != 0)
  478. +         {
  479. +           sprintf (buf, "writing all regs, number %d", regno);
  480. +           perror_with_name (buf);
  481. +         }
  482. +     }
  483. +     }
  484. + }
  485. + int
  486. + child_xfer_memory (memaddr, myaddr, len, write, target)
  487. +      CORE_ADDR memaddr;
  488. +      char *myaddr;
  489. +      int len;
  490. +      int write;
  491. +      struct target_ops *target;        /* ignored */
  492. + {
  493. +   register int i;
  494. +   /* Round starting address down to longword boundary.  */
  495. +   register CORE_ADDR addr = memaddr & - sizeof (int);
  496. +   /* Round ending address up; get number of longwords that makes.  */
  497. +   register int count
  498. +     = (((memaddr + len) - addr) + sizeof (int) - 1) / sizeof (int);
  499. +   /* Allocate buffer of that many longwords.  */
  500. +   register int *buffer = (int *) alloca (count * sizeof (int));
  501. +   int pt_read, pt_write;
  502. +   extern CORE_ADDR text_start, text_end;
  503. +   /* A/UX distinguishes between text and data space accesses */
  504. +   pt_read = addr >= text_start && addr < text_end ? PT_READ_I : PT_READ_D;
  505. +   pt_write = addr >= text_start && addr < text_end ? PT_WRITE_I : PT_WRITE_D;
  506. +   if (write)
  507. +     {
  508. +       /* Fill start and end extra bytes of buffer with existing memory data.  */
  509. +       if (addr != memaddr || len < (int)sizeof (int)) {
  510. +     /* Need part of initial word -- fetch it.  */
  511. +         buffer[0] = ptrace (pt_read, inferior_pid, (PTRACE_ARG3_TYPE) addr,
  512. +                 0);
  513. +       }
  514. +       if (count > 1)        /* FIXME, avoid if even boundary */
  515. +     {
  516. +       buffer[count - 1]
  517. +         = ptrace (pt_read, inferior_pid,
  518. +               (PTRACE_ARG3_TYPE) (addr + (count - 1) * sizeof (int)),
  519. +               0);
  520. +     }
  521. +       /* Copy data to be written over corresponding part of buffer */
  522. +       memcpy ((char *) buffer + (memaddr & (sizeof (int) - 1)), myaddr, len);
  523. +       /* Write the entire buffer.  */
  524. +       for (i = 0; i < count; i++, addr += sizeof (int))
  525. +     {
  526. +       errno = 0;
  527. +       ptrace (pt_write, inferior_pid, (PTRACE_ARG3_TYPE) addr,
  528. +           buffer[i]);
  529. +       if (errno)
  530. +         return 0;
  531. +     }
  532. +     }
  533. +   else
  534. +     {
  535. +       /* Read all the longwords */
  536. +       for (i = 0; i < count; i++, addr += sizeof (int))
  537. +     {
  538. +       errno = 0;
  539. +       buffer[i] = ptrace (pt_read, inferior_pid,
  540. +                   (PTRACE_ARG3_TYPE) addr, 0);
  541. +       if (errno)
  542. +         return 0;
  543. +       QUIT;
  544. +     }
  545. +       /* Copy appropriate bytes out of the buffer.  */
  546. +       memcpy (myaddr, (char *) buffer + (memaddr & (sizeof (int) - 1)), len);
  547. +     }
  548. +   return len;
  549. + }
  550. + void
  551. + fetch_core_registers (core_reg_sect, core_reg_size, which, reg_addr)
  552. +      char *core_reg_sect;
  553. +      unsigned core_reg_size;
  554. +      int which;
  555. +      unsigned reg_addr;
  556. + {
  557. +   register int regno;
  558. +   register unsigned int addr;
  559. +   int bad_reg = -1;
  560. +   register reg_ptr = -reg_addr;        /* Original u.u_ar0 is -reg_addr. */
  561. +   for (regno = 0; regno < FP0_REGNUM; regno++)
  562. +     {
  563. +       addr = REGISTER_ADDR (reg_ptr, regno);
  564. +       if (addr >= core_reg_size)
  565. +     {
  566. +       if (bad_reg < 0)
  567. +         bad_reg = regno;
  568. +     }
  569. +       else
  570. +     supply_register (regno, core_reg_sect + addr);
  571. +     }
  572. +   for (; regno < NUM_REGS; regno++)
  573. +     {
  574. +       addr = FP_REGISTER_ADDR (regno);
  575. +       if (addr >= core_reg_size)
  576. +     {
  577. +       if (bad_reg < 0)
  578. +         bad_reg = regno;
  579. +     }
  580. +       else
  581. +     supply_register (regno, core_reg_sect + addr);
  582. +     }
  583. +   if (bad_reg >= 0)
  584. +     error ("Register %s not found in core file.", reg_names[bad_reg]);
  585. + }
  586. *** ./gdb/configure.in.orig    Thu Feb  3 09:05:09 1994
  587. --- ./gdb/configure.in    Fri Feb 11 11:17:03 1994
  588. ***************
  589. *** 66,71 ****
  590. --- 66,72 ----
  591.   m68*-altos-*)        gdb_host=altos ;;
  592.   m68*-apollo*-sysv*)    gdb_host=apollo68v ;;
  593.   m68*-apollo*-bsd*)    gdb_host=apollo68b ;;
  594. + m68*-apple*-aux*)    gdb_host=aux ;;
  595.   m68*-att-*)        gdb_host=3b1 ;;
  596.   m68*-bull*-sysv*)    gdb_host=dpx2 ;;
  597.   m68*-cbm-sysv4*)    gdb_host=amix ;;
  598. ***************
  599. *** 227,232 ****
  600. --- 228,234 ----
  601.   m68*-hp-hpux*)        gdb_target=hp300hpux ;;
  602.   
  603.   m68*-altos-*)        gdb_target=altos ;;
  604. + m68*-apple-*)        gdb_target=aux ;;
  605.   m68*-apollo*-bsd*)    gdb_target=apollo68b ;;
  606.   m68*-att-*)        gdb_target=3b1 ;;
  607.   m68*-ericsson-*)    gdb_target=es1800 ;;
  608. *** ./gdb/remote-aux.c.orig    Fri Feb 11 11:09:40 1994
  609. --- ./gdb/remote-aux.c    Fri Feb 11 11:09:41 1994
  610. ***************
  611. *** 0 ****
  612. --- 1,232 ----
  613. + /* Remote target communications for an A/UX kernel in modified GDB protocol *
  614. + This program is a derivative work of remote.c, and as such is copyright by
  615. + John L. Coolidge and the FSF. It is covered by the GPL.
  616. + This file is part of GDB.
  617. + This program is free software; you can redistribute it and/or modify
  618. + it under the terms of the GNU General Public License as published by
  619. + the Free Software Foundation; either version 2 of the License, or
  620. + (at your option) any later version.
  621. + This program is distributed in the hope that it will be useful,
  622. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  623. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  624. + GNU General Public License for more details.
  625. + You should have received a copy of the GNU General Public License
  626. + along with this program; if not, write to the Free Software
  627. + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
  628. + /* The remote communication protocol is as documented in remote.c except
  629. +    for the following additions.
  630. +    All values are encoded in ascii hex digits.
  631. +     Request        Packet
  632. +     breakpoint    BAA..AA[,DDDD]
  633. +                     AA..AA is address,
  634. +                     DDDD is the old contents of the
  635. +                     address. If DDDD is omitted, the
  636. +                     address is set to a breakpoint
  637. +     reply        XXXX        the former contents of the address,
  638. +                     if DDDD is omitted.
  639. +             OK        if DDDD was specified and the breakpoint
  640. +                     was successfully set
  641. +             ENN        for an error
  642. +     extended cmd    Xcmd[,ARGS...]
  643. +                     cmd is an extended command
  644. +     reply        XX..XX        XX.XX and so forth are strings
  645. +             YY..YY        giving the output of the extended
  646. +             ...        command. Output is terminated by
  647. +             OK        an 'OK' value
  648. +             ENN        for an error
  649. + */
  650. + #include "defs.h"
  651. + #include <string.h>
  652. + #include <fcntl.h>
  653. + #include "frame.h"
  654. + #include "inferior.h"
  655. + #include "target.h"
  656. + #include "wait.h"
  657. + #include "terminal.h"
  658. + #include "gdbcmd.h"
  659. + #if !defined(DONT_USE_REMOTE)
  660. + #ifdef USG
  661. + #include <sys/types.h>
  662. + #endif
  663. + #include <signal.h>
  664. + #ifndef HAVE_TERMIO
  665. + extern int alarm ();            /* Many systems don't declare it */
  666. + #endif
  667. + /* Prototypes for local functions */
  668. + static int
  669. + remote_aux_insert_breakpoint PARAMS ((CORE_ADDR, char *));
  670. + static int
  671. + remote_aux_remove_breakpoint PARAMS ((CORE_ADDR, char *));
  672. + extern struct target_ops remote_aux_ops;    /* Forward decl */
  673. + extern struct target_ops remote_ops;
  674. + static void        (*remote_open_fn) PARAMS ((char *, int));
  675. + #define PBUFSIZ 1024
  676. + remote_aux_open (name, from_tty)
  677. +      char *name;
  678. +      int from_tty;
  679. + {
  680. +     (*remote_open_fn)(name, from_tty);
  681. +     if (current_target == &remote_ops)
  682. +     {
  683. +         current_target = current_target->to_next;
  684. +         push_target (&remote_aux_ops);
  685. +     }
  686. + }
  687. + static void
  688. + remote_aux_mourn ()
  689. + {
  690. +   unpush_target (&remote_aux_ops);
  691. +   generic_mourn_inferior ();
  692. + }
  693. + /* install a breakpoint on the remote machine */
  694. + static int
  695. + remote_aux_insert_breakpoint(addr, contents_cache)
  696. +      CORE_ADDR addr;
  697. +      char *contents_cache;
  698. + {
  699. +   char buf[PBUFSIZ];
  700. +   int i;
  701. +   char *p;
  702. +   sprintf (buf, "B%x", addr);
  703. +   remote_send (buf);
  704. +   /* reply indicates the old value */
  705. +   p = buf;
  706. +   for (i = 0; i < 2; i++)
  707. +     {
  708. +       if (p[0] == 0 || p[1] == 0)
  709. +     error ("Remote reply is too short: %s", buf);
  710. +       contents_cache[i] = fromhex (p[0]) * 16 + fromhex (p[1]);
  711. +       p += 2;
  712. +     }
  713. +   return 0;
  714. + }
  715. + /* remove a breakpoint */
  716. + static int
  717. + remote_aux_remove_breakpoint(addr, contents_cache)
  718. +      CORE_ADDR addr;
  719. +      char *contents_cache;
  720. + {
  721. +   char buf[PBUFSIZ];
  722. +   int i;
  723. +   char *p;
  724. +   sprintf (buf, "B%x,%04x", addr, *(unsigned short*)contents_cache);
  725. +   remote_send (buf);
  726. +   return 0;
  727. + }
  728. + /* Send an extended command to the target system. Prints out the results. */
  729. + static int
  730. + remote_aux_extended(command)
  731. + char * command;
  732. + {
  733. +    char buf[PBUFSIZ];
  734. +    sprintf (buf, "X%s", command);
  735. +    remote_send (buf);
  736. +    if (*buf == 'E')
  737. +        error ("extended command %s got an error %s\n", command, buf);
  738. +    while (*buf && strncmp(buf, "OK", 2)) {
  739. +        puts_filtered(buf);
  740. +        puts_filtered("\n");
  741. +        getpkt(buf,0);
  742. +    }
  743. + }
  744. + struct target_ops remote_aux_ops = {
  745. +   "aux-kernel",            /* to_shortname */
  746. +   "Remote serial target in A/UX kernel gdb protocol",    /* to_longname */
  747. +   "Debug an A/UX kernel via a serial line, using modified gdb protocol.\n\
  748. + Specify the serial device it is connected to (e.g. /dev/ttya).",  /* to_doc */
  749. +   remote_aux_open,        /* to_open */
  750. +   NULL,                /* to_close */
  751. +   NULL,                /* to_attach */
  752. +   NULL,                /* to_detach */
  753. +   NULL,                /* to_resume */
  754. +   NULL,                /* to_wait */
  755. +   NULL,                /* to_fetch_registers */
  756. +   NULL,                /* to_store_registers */
  757. +   NULL,                /* to_prepare_to_store */
  758. +   NULL,                /* to_xfer_memory */
  759. +   NULL,                /* to_files_info */
  760. +   remote_aux_insert_breakpoint,    /* to_insert_breakpoint */
  761. +   remote_aux_remove_breakpoint,    /* to_remove_breakpoint */
  762. +   NULL,                /* to_terminal_init */
  763. +   NULL,                /* to_terminal_inferior */
  764. +   NULL,                /* to_terminal_ours_for_output */
  765. +   NULL,                /* to_terminal_ours */
  766. +   NULL,                /* to_terminal_info */
  767. +   NULL,                /* to_kill */
  768. +   NULL,                /* to_load */
  769. +   NULL,                /* to_lookup_symbol */
  770. +   NULL,                /* to_create_inferior */
  771. +   remote_aux_mourn,        /* to_mourn_inferior */
  772. +   0,                /* to_can_run */
  773. +   0,                /* to_notice_signals */
  774. +   process_stratum,        /* to_stratum */
  775. +   NULL,                /* to_next */
  776. +   1,                /* to_has_all_memory */
  777. +   1,                /* to_has_memory */
  778. +   1,                /* to_has_stack */
  779. +   1,                /* to_has_registers */
  780. +   1,                /* to_has_execution */
  781. +   NULL,                /* sections */
  782. +   NULL,                /* sections_end */
  783. +   OPS_MAGIC            /* to_magic */
  784. + };
  785. + void
  786. + _initialize_remote_aux ()
  787. + {
  788. +   /* This function depends on _initialize_remote being called first */
  789. +   remote_aux_ops.to_close = remote_ops.to_close;
  790. +   remote_aux_ops.to_detach = remote_ops.to_detach;
  791. +   remote_aux_ops.to_resume = remote_ops.to_resume;
  792. +   remote_aux_ops.to_wait = remote_ops.to_wait;
  793. +   remote_aux_ops.to_fetch_registers = remote_ops.to_fetch_registers;
  794. +   remote_aux_ops.to_store_registers = remote_ops.to_store_registers;
  795. +   remote_aux_ops.to_prepare_to_store = remote_ops.to_prepare_to_store;
  796. +   remote_aux_ops.to_xfer_memory = remote_ops.to_xfer_memory;
  797. +   remote_aux_ops.to_files_info = remote_ops.to_files_info;
  798. +   remote_aux_ops.to_kill = remote_ops.to_kill;
  799. +   add_target (&remote_aux_ops);
  800. +   add_com ("extended", no_class, remote_aux_extended,
  801. +       "Send an extended command to the remote host.\n");
  802. +   remote_open_fn = remote_ops.to_open;
  803. + }
  804. + #endif /* DONT_USE_REMOTE */
  805. *** ./gdb/coffread.c.orig    Thu Feb  3 08:41:04 1994
  806. --- ./gdb/coffread.c    Fri Feb 11 11:09:41 1994
  807. ***************
  808. *** 913,918 ****
  809. --- 913,923 ----
  810.              could see if the flags indicate SEC_CODE.  If so, then
  811.            record this symbol as a function in the minimal symbol table.
  812.           But why are absolute syms recorded as functions, anyway?  */
  813. + #ifdef AUX
  814. +             if (cs->c_secnum == N_DEBUG)
  815. +             /* bogus DEBUG segment sym left behind by A/UX linker */
  816. +                 continue;
  817. + #endif
  818.               if (cs->c_secnum <= text_bfd_scnum+1) {/* text or abs */
  819.                   record_minimal_symbol (cs->c_name, cs->c_value,
  820.                              mst_text, objfile);
  821. *** ./gdb/remote.c.orig    Thu Feb  3 08:41:56 1994
  822. --- ./gdb/remote.c    Fri Feb 11 11:09:42 1994
  823. ***************
  824. *** 181,193 ****
  825.   static void
  826.   remote_store_registers PARAMS ((int regno));
  827.   
  828. ! static void
  829.   getpkt PARAMS ((char *buf, int forever));
  830.   
  831.   static void
  832.   putpkt PARAMS ((char *buf));
  833.   
  834. ! static void
  835.   remote_send PARAMS ((char *buf));
  836.   
  837.   static int
  838. --- 181,199 ----
  839.   static void
  840.   remote_store_registers PARAMS ((int regno));
  841.   
  842. ! #ifndef AUX
  843. ! static
  844. ! #endif
  845. ! void
  846.   getpkt PARAMS ((char *buf, int forever));
  847.   
  848.   static void
  849.   putpkt PARAMS ((char *buf));
  850.   
  851. ! #ifndef AUX
  852. ! static
  853. ! #endif
  854. ! void
  855.   remote_send PARAMS ((char *buf));
  856.   
  857.   static int
  858. ***************
  859. *** 198,204 ****
  860.   static int
  861.   tohex PARAMS ((int nib));
  862.   
  863. ! static int
  864.   fromhex PARAMS ((int a));
  865.   
  866.   static void
  867. --- 204,213 ----
  868.   static int
  869.   tohex PARAMS ((int nib));
  870.   
  871. ! #ifndef AUX
  872. ! static
  873. ! #endif
  874. ! int
  875.   fromhex PARAMS ((int a));
  876.   
  877.   static void
  878. ***************
  879. *** 354,360 ****
  880.   
  881.   /* Convert hex digit A to a number.  */
  882.   
  883. ! static int
  884.   fromhex (a)
  885.        int a;
  886.   {
  887. --- 363,372 ----
  888.   
  889.   /* Convert hex digit A to a number.  */
  890.   
  891. ! #ifndef AUX
  892. ! static
  893. ! #endif
  894. ! int
  895.   fromhex (a)
  896.        int a;
  897.   {
  898. ***************
  899. *** 1023,1029 ****
  900.      and read the reply into BUF.
  901.      Report an error if we get an error reply.  */
  902.   
  903. ! static void
  904.   remote_send (buf)
  905.        char *buf;
  906.   {
  907. --- 1035,1044 ----
  908.      and read the reply into BUF.
  909.      Report an error if we get an error reply.  */
  910.   
  911. ! #ifndef AUX
  912. ! static
  913. ! #endif
  914. ! void
  915.   remote_send (buf)
  916.        char *buf;
  917.   {
  918. ***************
  919. *** 1124,1130 ****
  920.      If FOREVER, wait forever rather than timing out; this is used
  921.      while the target is executing user code.  */
  922.   
  923. ! static void
  924.   getpkt (buf, forever)
  925.        char *buf;
  926.        int forever;
  927. --- 1139,1148 ----
  928.      If FOREVER, wait forever rather than timing out; this is used
  929.      while the target is executing user code.  */
  930.   
  931. ! #ifndef AUX
  932. ! static
  933. ! #endif
  934. ! void
  935.   getpkt (buf, forever)
  936.        char *buf;
  937.        int forever;
  938. *** ./config/mh-aux.orig    Fri Feb 11 11:09:42 1994
  939. --- ./config/mh-aux    Fri Feb 11 11:09:42 1994
  940. ***************
  941. *** 0 ****
  942. --- 1,2 ----
  943. + CC = gcc -pipe -D_POSIX_SOURCE
  944. + RANLIB = echo >/dev/null
  945. *** ./bfd/config/aux.mh.orig    Fri Feb 11 11:09:42 1994
  946. --- ./bfd/config/aux.mh    Fri Feb 11 11:09:42 1994
  947. ***************
  948. *** 0 ****
  949. --- 1,3 ----
  950. + HDEFINES=-DTRAD_CORE
  951. + HDEPFILES=trad-core.o
  952. + MINIMIZE=1
  953. *** ./bfd/config/aux.mt.orig    Fri Feb 11 11:09:42 1994
  954. --- ./bfd/config/aux.mt    Fri Feb 11 11:09:42 1994
  955. ***************
  956. *** 0 ****
  957. --- 1,4 ----
  958. + # Target:  Apple A/UX
  959. + DEFAULT_VECTOR=m68kcoff_vec
  960. + SELECT_ARCHITECTURES=bfd_m68k_arch
  961. *** ./bfd/hosts/aux.h.orig    Fri Feb 11 11:09:42 1994
  962. --- ./bfd/hosts/aux.h    Fri Feb 11 11:09:42 1994
  963. ***************
  964. *** 0 ****
  965. --- 1,39 ----
  966. + #include <fcntl.h>
  967. + #include <errno.h>
  968. + #include <stdio.h>
  969. + #include <sys/types.h>
  970. + #include <sys/stat.h>
  971. + #include <sys/time.h>
  972. + #include <ctype.h>
  973. + #include <string.h>
  974. + #include <unistd.h>
  975. + #include <stdlib.h>        /* for malloc() */
  976. + #ifndef O_ACCMODE
  977. + #define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR)
  978. + #endif
  979. + #define SEEK_SET 0
  980. + #define SEEK_CUR 1
  981. + /* The following definitions are only intended for trad-core.c */
  982. + #define NBPG            4096
  983. + #define UPAGES            USIZE
  984. + #define HOST_DATA_START_ADDR    u.u_exdata.ux_datorg /* this seems ok */
  985. + #define HOST_STACK_END_ADDR    0xffffffff
  986. + /* EXACT TYPES */
  987. + typedef char int8e_type;
  988. + typedef unsigned char uint8e_type;
  989. + typedef short int16e_type;
  990. + typedef unsigned short uint16e_type;
  991. + typedef int int32e_type;
  992. + typedef unsigned int uint32e_type;
  993. + /* CORRECT SIZE OR GREATER */
  994. + typedef char int8_type;
  995. + typedef unsigned char uint8_type;
  996. + typedef short int16_type;
  997. + typedef unsigned short uint16_type;
  998. + typedef int int32_type;
  999. + typedef unsigned int uint32_type;
  1000. + #include "fopen-same.h"
  1001. *** ./bfd/Makefile.in.orig    Thu Feb  3 08:46:35 1994
  1002. --- ./bfd/Makefile.in    Fri Feb 11 11:09:43 1994
  1003. ***************
  1004. *** 296,305 ****
  1005.   
  1006.   
  1007.   targets.o: targets.c Makefile
  1008. !     $(CC) -c $(CFLAGS) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) $(TDEFAULTS) $<
  1009.   
  1010.   archures.o: archures.c Makefile
  1011. !     $(CC) -c $(CFLAGS) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) $(TDEFAULTS) $<
  1012.   
  1013.   subdir_do: force
  1014.       @for i in $(DODIRS); do \
  1015. --- 296,305 ----
  1016.   
  1017.   
  1018.   targets.o: targets.c Makefile
  1019. !     $(CC) -c $(CFLAGS) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) $(TDEFAULTS) targets.c
  1020.   
  1021.   archures.o: archures.c Makefile
  1022. !     $(CC) -c $(CFLAGS) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) $(TDEFAULTS) archures.c
  1023.   
  1024.   subdir_do: force
  1025.       @for i in $(DODIRS); do \
  1026. *** ./bfd/config.bfd.orig    Thu Feb  3 09:01:00 1994
  1027. --- ./bfd/config.bfd    Fri Feb 11 11:09:43 1994
  1028. ***************
  1029. *** 50,55 ****
  1030. --- 50,56 ----
  1031.     i960-*-bout*)        bfd_name=i960-bout ;;
  1032.     i960-*-nindy*)    bfd_name=i960-bout ;;
  1033.     m68*-apollo-bsd*)    bfd_name=apollo ;;
  1034. +   m68*-apple-*)        bfd_name=aux ;;
  1035.     m68*-bull-sysv*)    bfd_name=u68k-coff ;;
  1036.     m68*-hp-bsd*)        bfd_name=hp300bsd ;;
  1037.     m68*-*-aout*)        bfd_name=m68k-aout ;;
  1038. *** ./bfd/trad-core.c.orig    Thu Feb  3 08:47:19 1994
  1039. --- ./bfd/trad-core.c    Fri Feb 11 11:09:43 1994
  1040. ***************
  1041. *** 184,190 ****
  1042. --- 184,195 ----
  1043.     core_regsec (abfd)->flags = SEC_ALLOC + SEC_HAS_CONTENTS;
  1044.   
  1045.     core_datasec (abfd)->_raw_size =  NBPG * u.u_dsize;
  1046. + #ifdef AUX
  1047. +   /* Can't represent 2^32 */
  1048. +   core_stacksec (abfd)->_raw_size = NBPG * u.u_ssize - 1;
  1049. + #else
  1050.     core_stacksec (abfd)->_raw_size = NBPG * u.u_ssize;
  1051. + #endif
  1052.     core_regsec (abfd)->_raw_size = NBPG * UPAGES; /* Larger than sizeof struct u */
  1053.   
  1054.     /* What a hack... we'd like to steal it from the exec file,
  1055. ***************
  1056. *** 198,204 ****
  1057. --- 203,213 ----
  1058.   #ifdef HOST_STACK_START_ADDR
  1059.     core_stacksec (abfd)->vma = HOST_STACK_START_ADDR;
  1060.   #else
  1061. + #ifndef AUX
  1062.     core_stacksec (abfd)->vma = HOST_STACK_END_ADDR - (NBPG * u.u_ssize);
  1063. + #else
  1064. +   core_stacksec (abfd)->vma = (HOST_STACK_END_ADDR - (NBPG * u.u_ssize))+1;
  1065. + #endif
  1066.   #endif
  1067.   
  1068.     /* This is tricky.  As the "register section", we give them the entire
  1069. *** ./bfd/configure.host.orig    Thu Feb  3 08:46:47 1994
  1070. --- ./bfd/configure.host    Fri Feb 11 11:09:43 1994
  1071. ***************
  1072. *** 55,60 ****
  1073. --- 55,61 ----
  1074.   
  1075.   m68*-apollo*-sysv*)    my_host=apollov68 ;;
  1076.   m68*-apollo*-bsd*)    my_host=apollo68 ;;
  1077. + m68*-apple*-aux*)       my_host=aux ;;
  1078.   m68*-bull*-sysv*)    my_host=dpx2 ;;
  1079.   m68*-convergent-sysv*)    my_host=miniframe ;;
  1080.   m68*-cbm-amigados*)    my_host=amigados ;;
  1081. *** ./libiberty/config.table.orig    Thu Feb  3 08:48:12 1994
  1082. --- ./libiberty/config.table    Fri Feb 11 11:09:43 1994
  1083. ***************
  1084. *** 7,12 ****
  1085. --- 7,13 ----
  1086.     rs6000-ibm-aix*)      files=${xsrcdir}alloca-botch.h ;;
  1087.     m68k-apollo-bsd*)    frag=mh-a68bsd ;;
  1088.     m68k-apollo-sysv*)    frag=mh-apollo68 ;;
  1089. +   m68k-apple-aux*)      frag=mh-sysv ;;
  1090.     i[34]86-ncr-sysv4*)    frag=mh-ncr3000 ;;
  1091.     *-*-lynxos*)        frag=mh-lynxos ;;
  1092.     *-*-dgux*)        frag=mh-sysv ;;
  1093. *** ./readline/config/mh-aux.orig    Fri Feb 11 11:09:43 1994
  1094. --- ./readline/config/mh-aux    Fri Feb 11 11:09:43 1994
  1095. ***************
  1096. *** 0 ****
  1097. --- 1,4 ----
  1098. + # Define USG as -DUSG if you are using a System V operating system.
  1099. + USG = -DUSG -DNO_SYS_FILE -DHAVE_UNISTD_H
  1100. + RANLIB = echo >/dev/null
  1101. + INSTALL = cp
  1102. *** ./readline/configure.in.orig    Thu Feb  3 08:47:47 1994
  1103. --- ./readline/configure.in    Fri Feb 11 11:09:43 1994
  1104. ***************
  1105. *** 28,33 ****
  1106. --- 28,34 ----
  1107.     i[34]86-*-sco*)    host_makefile_frag=config/mh-sco; files=sysdep-sco.h ;;
  1108.     i[34]86-*-isc*)    host_makefile_frag=config/mh-isc ;;
  1109.     m68k-apollo-sysv*)    host_makefile_frag=config/mh-apollo68v ;;    
  1110. +   m68k-apple-aux*)    host_makefile_frag=config/mh-aux ;;
  1111.     *-*-sysv*)        host_makefile_frag=config/mh-sysv ;;
  1112.     *-*-m88kbcs*)        host_makefile_frag=config/mh-sysv ;;
  1113.     i[34]86-*-linux*)    host_makefile_frag=config/mh-posix ;;
  1114. *** ./glob/configure.in.orig    Thu Feb  3 08:47:59 1994
  1115. --- ./glob/configure.in    Fri Feb 11 11:09:43 1994
  1116. ***************
  1117. *** 17,22 ****
  1118. --- 17,23 ----
  1119.     rs6000-ibm-aix3.1)    files=sysdep-aix.h;    my_host=aix ;;
  1120.     *-*-aix*)                    my_host=aix ;;
  1121.     mips-sgi-irix*)    files=sysdep-irix.h ;;
  1122. +   m68k-apple-aux*)    files=sysdep-aix.h ;;
  1123.     m68k-sony-news*)    files=sysdep-obsd.h ;;
  1124.     m68k-*-sunos3*)    files=sysdep-obsd.h ;;
  1125.     *-*-mach*)        files=sysdep-obsd.h ;;
  1126. *** ./config.sub.orig    Thu Feb  3 09:07:29 1994
  1127. --- ./config.sub    Fri Feb 11 11:13:59 1994
  1128. ***************
  1129. *** 73,83 ****
  1130.           ;;
  1131.       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
  1132.       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
  1133. !     -unicom* | -ibm* | -next* | -hp | -isi* | -apollo | -altos* | \
  1134.       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
  1135.       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
  1136.       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
  1137. !     -sim)                        # CYGNUS LOCAL
  1138.           os=
  1139.           basic_machine=$1
  1140.           ;;
  1141. --- 73,83 ----
  1142.           ;;
  1143.       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
  1144.       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
  1145. !     -unicom* | -ibm* | -next* | -hp | -isi* | -apollo | -altos* | -aux* | \
  1146.       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
  1147.       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
  1148.       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
  1149. !     -sim )                        # CYGNUS LOCAL
  1150.           os=
  1151.           basic_machine=$1
  1152.           ;;
  1153. ***************
  1154. *** 385,390 ****
  1155. --- 385,394 ----
  1156.           basic_machine=m68k-next
  1157.           os=-bsd
  1158.           ;;
  1159. +     aux)
  1160. +         basic_machine=m68k-apple
  1161. +         os=-aux
  1162. +         ;;
  1163.       amiga)
  1164.           basic_machine=m68k-cbm
  1165.           ;;
  1166. ***************
  1167. *** 658,663 ****
  1168. --- 662,670 ----
  1169.       orion105)
  1170.           basic_machine=clipper-highlevel
  1171.           ;;
  1172. +     m68k-apple*)
  1173. +         os=-aux
  1174. +         ;;
  1175.       *)
  1176.           echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
  1177.           exit 1
  1178. ***************
  1179. *** 698,704 ****
  1180.             | -amigados* | -msdos* | -newsos* | -unicos* | -aos* \
  1181.             | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
  1182.             | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
  1183. !           | -hiux* | -386bsd* | -netbsd* | -riscix* | -lynxos* \
  1184.             | -go32 | -vsta | -sim | -es1800* | -udi | -hms* | -xray | -hds* \
  1185.             | -os68k* | -none* | -v88r* | -aout* | -coff | -elf* | -bosx* \
  1186.             | -abug | -ecoff* | -netware* )
  1187. --- 705,711 ----
  1188.             | -amigados* | -msdos* | -newsos* | -unicos* | -aos* \
  1189.             | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
  1190.             | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
  1191. !           | -hiux* | -386bsd* | -netbsd* | -riscix* | -lynxos* | -aux* \
  1192.             | -go32 | -vsta | -sim | -es1800* | -udi | -hms* | -xray | -hds* \
  1193.             | -os68k* | -none* | -v88r* | -aout* | -coff | -elf* | -bosx* \
  1194.             | -abug | -ecoff* | -netware* )
  1195. ***************
  1196. *** 912,917 ****
  1197. --- 919,927 ----
  1198.               -genix*)
  1199.                   vendor=ns
  1200.                   ;;
  1201. +             -aux*)
  1202. +                 vendor=apple
  1203. +                 ;;
  1204.               -mvs*)
  1205.                   vendor=ibm
  1206.                   ;;
  1207.