diff -urN gdb-5.0-rtems-20000627/bfd/ChangeLog gdb-5.0-rtems/bfd/ChangeLog
--- gdb-5.0-rtems-20000627/bfd/ChangeLog	Wed Apr 19 09:32:30 2000
+++ gdb-5.0-rtems/bfd/ChangeLog	Fri Sep  1 19:01:39 2000
@@ -1,3 +1,7 @@
+2000-09-01  Antti P Miettinen  <anmietti@trshp.ntc.nokia.com>
+
+	* config.bfd: add m68k*-*-RTEMS* (RTEMS rdbg) target
+
 Wed Apr 19 16:28:40 2000  Andrew Cagney  <cagney@b1.cygnus.com>
 
 	* bfd-in2.h: Re-generate.
diff -urN gdb-5.0-rtems-20000627/bfd/config.bfd gdb-5.0-rtems/bfd/config.bfd
--- gdb-5.0-rtems-20000627/bfd/config.bfd	Fri Aug 18 12:07:15 2000
+++ gdb-5.0-rtems/bfd/config.bfd	Mon Aug 14 00:19:10 2000
@@ -422,7 +422,7 @@
     targ_defvec=m68kcoff_vec
     targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec"
     ;;
-  m68*-*-rtems* | m68*-*-rtemself*)
+  m68*-*-rtems* | m68*-*-rtemself* | m68*-*-RTEMS*)
     # same as m68k-elf with some extra targets
     targ_defvec=bfd_elf32_m68k_vec
     targ_selvecs="m68kcoff_vec versados_vec ieee_vec aout0_big_vec"
diff -urN gdb-5.0-rtems-20000627/gdb/ChangeLog gdb-5.0-rtems/gdb/ChangeLog
--- gdb-5.0-rtems-20000627/gdb/ChangeLog	Fri Aug 18 12:07:15 2000
+++ gdb-5.0-rtems/gdb/ChangeLog	Fri Sep  1 19:10:53 2000
@@ -1,3 +1,13 @@
+2000-09-01  Antti P Miettinen  <anmietti@trshp.ntc.nokia.com>
+
+	* config/m68k/rtems.mt: New file for m68k RTEMS rdbg target.
+	* config/m68k/tm-m68k-rtems.h: New file for m68k RTEMS rdbg
+	target. Contains wild guesses.
+	* configure.tgt: Added m68*-*-RTEMS* target.
+	* rtems/m68k/remdeb_f.x: Added r_vec to registers. Checking r_sr for
+	single stepping does not work as the handler clears T bit.
+	* rtems.c: Changed registers[] to *registers to make compile.
+
 Fri Aug  6 165:41:15 EDT 1999 Charles-A. Gauthier <charles.gauthier@iit.nrc.ca>+
 
 	* config/m68k/monitor.mt (TDEPFILES): Add 167bug-rom.o.
diff -urN gdb-5.0-rtems-20000627/gdb/config/m68k/rtems.mt gdb-5.0-rtems/gdb/config/m68k/rtems.mt
--- gdb-5.0-rtems-20000627/gdb/config/m68k/rtems.mt	Thu Jan  1 02:00:00 1970
+++ gdb-5.0-rtems/gdb/config/m68k/rtems.mt	Sun Aug 13 23:47:56 2000
@@ -0,0 +1,44 @@
+#****************************************************************
+#
+# Component =   GDB configuration file
+# Module =      
+#
+# Synopsis =    Configuration when target is Rtems
+#		running on a m68k
+#
+#  Copyright(C) 2000 Nokia Networks
+#  
+#  Developped by : 
+#	Antti P Miettinen,	mail to : antti.p.miettinen@nokia.com
+#
+#
+#               
+#
+#****************************************************************
+# Basic, host-specific, and target-specific definitions for GDB.
+#   Copyright (C) 1986, 1989, 1991, 1992, 1993, 1994, 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., 675 Mass Ave, Cambridge, MA 02139, USA. 
+
+# Target: m68k running RTEMS
+TDEPFILES= m68k-tdep.o fork-child.o infptrace.o inftarg.o remote-rte.o rtems.o thread_rte.o rtems/rteRemDebXdr.o 
+
+TM_FILE= tm-m68k-rtems.h 
+
+MT_CFLAGS= -DGDB_BUG_FIX -DRPC_SUN -DNO_PORT_MAPPER -DFETCH_INFERIOR_REGISTERS -DRTEMS -DTARGET_m68k
+
diff -urN gdb-5.0-rtems-20000627/gdb/config/m68k/tm-m68k-rtems.h gdb-5.0-rtems/gdb/config/m68k/tm-m68k-rtems.h
--- gdb-5.0-rtems-20000627/gdb/config/m68k/tm-m68k-rtems.h	Thu Jan  1 02:00:00 1970
+++ gdb-5.0-rtems/gdb/config/m68k/tm-m68k-rtems.h	Fri Aug 25 15:23:26 2000
@@ -0,0 +1,110 @@
+/* Macro definitions for m68k running RTEMS
+   Based on m68k SVR4 and i386 RTEMS defs
+   Copyright 1995, 1996, 1997 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.  */
+
+#ifndef TM_M68K_RTEMS_H
+#define TM_M68K_RTEMS_H
+
+#define BPT_VECTOR 15 /* rdbg uses trap #15 */
+#define REMOTE_BPT_VECTOR 1 /* XXX can it be? */
+
+#define DECR_PC_AFTER_BREAK 0	/* No decrement required */
+
+/* Use the alternate method of determining valid frame chains. */
+#define FRAME_CHAIN_VALID_ALTERNATE
+
+#include "tm-sysv4.h"
+#include "m68k/tm-m68k.h"
+
+/* the following is from tm-m68kv4.h */
+
+/* Offsets (in target ints) into jmp_buf.  Not defined in any system header
+   file, so we have to step through setjmp/longjmp with a debugger and figure
+   them out.  As a double check, note that <setjmp> defines _JBLEN as 13,
+   which matches the number of elements we see saved by setjmp(). */
+
+#define JB_ELEMENT_SIZE sizeof(int)	/* jmp_buf[_JBLEN] is array of ints */
+
+#define JB_D2	0
+#define JB_D3	1
+#define JB_D4	2
+#define JB_D5	3
+#define JB_D6	4
+#define JB_D7	5
+#define JB_A1	6
+#define JB_A2	7
+#define JB_A3	8
+#define JB_A4	9
+#define JB_A5	10
+#define JB_A6	11
+#define JB_A7	12
+
+#define JB_PC	JB_A1		/* Setjmp()'s return PC saved in A1 */
+
+/* Figure out where the longjmp will land.  Slurp the args out of the stack.
+   We expect the first arg to be a pointer to the jmp_buf structure from which
+   we extract the pc (JB_PC) that we will land at.  The pc is copied into ADDR.
+   This routine returns true on success */
+
+#define GET_LONGJMP_TARGET(ADDR) get_longjmp_target(ADDR)
+extern int get_longjmp_target PARAMS ((CORE_ADDR *));
+
+/* Convert a DWARF register number to a gdb REGNUM.  */
+#define DWARF_REG_TO_REGNUM(num) ((num) < 16 ? (num) : (num)+FP0_REGNUM-16)
+
+/* from tm-i386rte.h */
+#undef START_INFERIOR_TRAPS_EXPECTED
+#define START_INFERIOR_TRAPS_EXPECTED 1
+
+/* from tm-ppc-rtems.h */
+#define GDB_TARGET_M68K
+
+/* Say that we're using ELF, not XCOFF.  */
+#define ELF_OBJECT_FORMAT 1
+
+#if 0 /* XXX needed? */
+
+/* from tm-i386rte.h */
+
+/* A macro that tells us whether the function invocation represented
+   by FI does not have a frame on the stack associated with it.  If it
+   does not, FRAMELESS is set to 1, else 0.  */
+#undef FRAMELESS_FUNCTION_INVOCATION
+#define FRAMELESS_FUNCTION_INVOCATION(FI) \
+	(frameless_look_for_prologue(FI))
+
+/* from tm-linux.h */
+
+/* Offset to saved PC in sigcontext, from <asm/sigcontext.h>.  */
+#define SIGCONTEXT_PC_OFFSET 26
+
+#undef FRAME_SAVED_PC
+#define FRAME_SAVED_PC(FRAME) \
+  (((FRAME)->signal_handler_caller \
+    ? sigtramp_saved_pc (FRAME) \
+    : read_memory_integer ((FRAME)->frame + 4, 4)))
+
+extern CORE_ADDR sigtramp_saved_pc PARAMS ((struct frame_info *));
+
+#define IN_SIGTRAMP(pc,name) in_sigtramp (pc)
+extern int in_sigtramp PARAMS ((CORE_ADDR pc));
+
+#endif /*0*/
+
+#endif /* TM_M68K_RTEMS_H */
diff -urN gdb-5.0-rtems-20000627/gdb/configure.tgt gdb-5.0-rtems/gdb/configure.tgt
--- gdb-5.0-rtems-20000627/gdb/configure.tgt	Fri Aug 18 12:07:16 2000
+++ gdb-5.0-rtems/gdb/configure.tgt	Mon Aug 14 00:07:50 2000
@@ -170,6 +170,7 @@
 m68*-*-aout*)		gdb_target=monitor ;;
 m68*-*-coff*)		gdb_target=monitor ;;
 m68*-*-elf*)		gdb_target=monitor ;;
+m68*-*-RTEMS*)		gdb_target=rtems ;;
 m68*-*-linux*)		gdb_target=linux
 		configdirs="${configdirs} gdbserver" ;;
 m68*-*-lynxos*)		gdb_target=m68klynx
diff -urN gdb-5.0-rtems-20000627/gdb/rtems/m68k/remdeb_f.x gdb-5.0-rtems/gdb/rtems/m68k/remdeb_f.x
--- gdb-5.0-rtems-20000627/gdb/rtems/m68k/remdeb_f.x	Fri Aug 18 12:07:17 2000
+++ gdb-5.0-rtems/gdb/rtems/m68k/remdeb_f.x	Fri Aug 25 15:20:09 2000
@@ -41,6 +41,7 @@
         int     r_areg[8];      /* address registers */
         int     r_sr;           /* status register (actually a short) */
         int     r_pc;           /* program counter */
+	int	r_vec;		/* last vector */
 };
 
 #ifdef RPC_HDR
@@ -60,7 +61,7 @@
 %#define SET_BREAK(l)   ((l&0x0000FFFF) | 0x4E4F0000)  /* TRAP 15 */
 %#define IS_BREAK(l)    (((l) & 0xFFFF0000) == 0x4E4F0000)
 %#define ORG_BREAK(c,p) (((c) & 0x0000FFFF) | ((p) & 0xFFFF0000))
-%#define IS_STEP(regs)  ((regs.r_sr & 0x8000) == 0x8000)
+%#define IS_STEP(regs)  ((regs).r_vec == 9)
 %#define BREAK_ADJ      0
 %#define BREAK_SIZE     2
 
diff -urN gdb-5.0-rtems-20000627/gdb/rtems.c gdb-5.0-rtems/gdb/rtems.c
--- gdb-5.0-rtems-20000627/gdb/rtems.c	Fri Aug 18 12:07:17 2000
+++ gdb-5.0-rtems/gdb/rtems.c	Mon Aug 14 00:43:35 2000
@@ -332,7 +332,7 @@
 put_registers_in_gdb_order (regs)
      xdr_regs *regs;
 {
-  extern char registers[];
+  extern char *registers;
   int i;
 
   for (i = 0; i < NUM_REGS; i++) {
@@ -349,7 +349,7 @@
 put_registers_in_frame_order (regs)
      xdr_regs *regs;
 {
-  extern char registers[];
+  extern char *registers;
   int i;
 
   for (i = 0; i < NUM_REGS; i++) {
@@ -365,7 +365,7 @@
 put_fp_registers_in_gdb_order (regs)
      xdr_fp_status *regs;
 {
-  extern char registers[];
+  extern char *registers;
 
   bcopy (regs, &registers[REGISTER_BYTE (FP0_REGNUM)],
 	 sizeof regs->fps_regs);
@@ -379,7 +379,7 @@
 put_fp_registers_in_frame_order (regs)
      xdr_fp_status *regs;
 {
-  extern char registers[];
+  extern char *registers;
 
   bcopy (&registers[REGISTER_BYTE (FP0_REGNUM)], regs, 
 	 sizeof regs->fps_regs);
