Subject: toolchain/16799: gdb can't set breakpoint on remote m68k target
To: None <gnats-bugs@gnats.netbsd.org>
From: None <chris@Pin.LU>
List: netbsd-bugs
Date: 05/14/2002 04:48:08
>Number:         16799
>Category:       toolchain
>Synopsis:       gdb can't set breakpoint on remote m68k target
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    toolchain-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon May 13 20:28:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Christian Limpach
>Release:        current (as of May 14 2002)
>Organization:
	
>Environment:
	
System: NetBSD clapper 1.5ZC NetBSD 1.5ZC (CLAPPER) #46: Mon May 13 20:51:50 CEST 2002     root@marble:/devel/netbsd/src-current/sys/arch/next68k/compile/CLAPPER next68k


>Description:
	
	gdb uses the wrong trap to set remote breakpoints.
	config/m68k/tm-nbsd.h doesn't define REMOTE_BPT_VECTOR, gdb uses the
	default 0x1.  REMOTE_BPT_VECTOR has to be defined to 0xf as it's done
	in the non-toolchain gdb.

>How-To-Repeat:
	
	Set a breakpoint with remote gdb on m68k target.
	When the breakpoint is reached, the target machine panics
	and drops to gdb but it's not possible to resume execution.

>Fix:
	
	The following patch fixes the problem.

Index: dist/toolchain/gdb/config/m68k/tm-nbsd.h
===================================================================
RCS file: /cvsroot/gnusrc/gnu/dist/toolchain/gdb/config/m68k/tm-nbsd.h,v
retrieving revision 1.4
diff -u -r1.4 tm-nbsd.h
--- tm-nbsd.h	2002/05/10 21:24:51	1.4
+++ tm-nbsd.h	2002/05/14 02:58:46
@@ -21,10 +21,9 @@
 #ifndef TM_NBSD_H
 #define TM_NBSD_H
 
-/* Define BPT_VECTOR if it is different than the default.
-   This is the vector number used by traps to indicate a breakpoint. */
-
-#define BPT_VECTOR 0x2
+/* NetBSD uses trap 15 for both user and kernel breakpoints. */
+#define BPT_VECTOR 0xf
+#define REMOTE_BPT_VECTOR 0xf
 
 /* For NetBSD, sigtramp is 32 bytes before STACK_END_ADDR,
    but we don't know where that is until run-time!  */

>Release-Note:
>Audit-Trail:
>Unformatted: