diff -c -r -x *.rej -x #* -x *~ -N orig/gdb-4.16/gdb/ChangeLog gdb-4.16/gdb/ChangeLog
*** orig/gdb-4.16/gdb/ChangeLog	Tue Apr 23 06:34:43 1996
--- gdb-4.16/gdb/ChangeLog	Wed Mar  5 23:09:02 1997
***************
*** 1,3 ****
--- 1,10 ----
+ Wed Mar  5 21:41:51 1997  Kresten Krab Thorup  <krab@california.daimi.aau.dk>
+ 
+ 	* config/m68k/palmos.mt, config/m68k/tm-palmos.h: New files.
+ 
+ 	* m68k-tdep.c (m68k_saved_pc_after_call): Added support for
+ 	MAC_SYSCALL_TRAP style systraps.
+ 
  Mon Apr 22 20:17:01 1996  Fred Fish  <fnf@cygnus.com>
  
  	* Makefile.in (VERSION): Bump version number to 4.16
diff -c -r -x *.rej -x #* -x *~ -N orig/gdb-4.16/gdb/config/m68k/palmos.mt gdb-4.16/gdb/config/m68k/palmos.mt
*** orig/gdb-4.16/gdb/config/m68k/palmos.mt	Thu Jan  1 01:00:00 1970
--- gdb-4.16/gdb/config/m68k/palmos.mt	Wed Mar  5 22:00:29 1997
***************
*** 0 ****
--- 1,3 ----
+ # Target: Motorola m68k embedded (EST emulator, rom68k and bug monitors)
+ TDEPFILES= m68k-tdep.o monitor.o remote-est.o cpu32bug-rom.o rom68k-rom.o dsrec.o
+ TM_FILE= tm-palmos.h
diff -c -r -x *.rej -x #* -x *~ -N orig/gdb-4.16/gdb/config/m68k/tm-palmos.h gdb-4.16/gdb/config/m68k/tm-palmos.h
*** orig/gdb-4.16/gdb/config/m68k/tm-palmos.h	Thu Jan  1 01:00:00 1970
--- gdb-4.16/gdb/config/m68k/tm-palmos.h	Wed Mar  5 22:10:58 1997
***************
*** 0 ****
--- 1,48 ----
+ /* Target machine definitions for a generic m68k PalmOS.
+    Copyright (C) 1986, 1987, 1989, 1993, 1995 Free Software Foundation, Inc.
+ 
+ This file is part of GDB.
+ 
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+ 
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
+ 
+ /* The definitions here are appropriate for several embedded m68k-based
+    targets, including IDP (rom68k), BCC (cpu32bug), and EST's emulator.  */
+ 
+ /* GCC is probably the only compiler used on this configuration.  So
+    get this right even if the code which detects gcc2_compiled. is
+    still broken.  */
+ 
+ #define BELIEVE_PCC_PROMOTION 1
+ 
+ /* The target system handles breakpoints.  */
+ 
+ #define DECR_PC_AFTER_BREAK 2
+ 
+ /* No float registers.  */
+ 
+ /*#define NUM_REGS 18*/
+ 
+ #include "m68k/tm-m68k.h"
+ 
+ /* FIXME, should do GET_LONGJMP_TARGET for newlib.  */
+ 
+ #ifdef __GNUC__
+ #define MAC_SYSCALL_TRAP \
+    ({ static long addr = 0; \
+       addr != 0 ? addr : (addr = read_memory_integer ((32+15)*4, 4)); })
+ #else
+ #define MAC_SYSCALL_TRAP read_memory_integer ((32+15)*4, 4)
+ #endif
+ 
diff -c -r -x *.rej -x #* -x *~ -N orig/gdb-4.16/gdb/configure gdb-4.16/gdb/configure
*** orig/gdb-4.16/gdb/configure	Tue Apr 23 06:34:51 1996
--- gdb-4.16/gdb/configure	Wed Mar  5 21:48:52 1997
***************
*** 2069,2074 ****
--- 2069,2075 ----
  m68*-monitor-*)         gdb_target=monitor ;;
  m68*-est-*)		gdb_target=monitor ;;
  m68*-*-aout*)		gdb_target=monitor ;;
+ m68*-palmos-coff)	gdb_target=palmos ;;
  m68*-*-coff*)		gdb_target=monitor ;;
  m68*-*-elf*)		gdb_target=monitor ;;
  m68*-*-lynxos*)		gdb_target=m68klynx
diff -c -r -x *.rej -x #* -x *~ -N orig/gdb-4.16/gdb/m68k-tdep.c gdb-4.16/gdb/m68k-tdep.c
*** orig/gdb-4.16/gdb/m68k-tdep.c	Wed Aug  2 05:19:07 1995
--- gdb-4.16/gdb/m68k-tdep.c	Wed Mar  5 21:39:07 1997
***************
*** 504,509 ****
--- 504,514 ----
      return read_memory_integer (read_register (SP_REGNUM) + 4, 4);
    else
  #endif /* SYSCALL_TRAP */
+ #ifdef MAC_SYSCALL_TRAP
+   if (frame->pc == MAC_SYSCALL_TRAP)
+     return read_memory_integer (read_register (SP_REGNUM) + 2, 4) + 2;
+   else
+ #endif /* MAC_SYSCALL_TRAP */
      return read_memory_integer (read_register (SP_REGNUM), 4);
  }
  
