From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22086 invoked by alias); 12 Feb 2003 19:42:29 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 22077 invoked from network); 12 Feb 2003 19:42:28 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by 172.16.49.205 with SMTP; 12 Feb 2003 19:42:28 -0000 Received: from smtp.ott.qnx.com (smtp.ott.qnx.com [10.0.2.158]) by hub.ott.qnx.com (8.9.3/8.9.3) with ESMTP id OAA11107; Wed, 12 Feb 2003 14:31:25 -0500 Received: from catdog ([10.4.2.2]) by smtp.ott.qnx.com (8.8.8/8.6.12) with SMTP id OAA24766; Wed, 12 Feb 2003 14:42:27 -0500 Message-ID: <00e201c2d2ce$deb672b0$0202040a@catdog> From: "Kris Warkentin" To: "Kris Warkentin" , "Andrew Cagney" Cc: Subject: Re: patch to add HAVE_CONTINUABLE_BREAKPOINT to target_ops Date: Wed, 12 Feb 2003 19:42:00 -0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_00DF_01C2D2A4.F5C98750" X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-SW-Source: 2003-02/txt/msg00291.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_00DF_01C2D2A4.F5C98750 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-length: 3413 Here's take 2 on the patch. I had a slight error in the definition of HAVE_CONTINUABLE_WATCHPOINT in the first one. I was worried about initialization (since infrun.c wanted the default to be zero) but since target_ops structures are always declared as global data, it will be fine. cheers, Kris ----- Original Message ----- From: "Kris Warkentin" To: "Andrew Cagney" Cc: "Mark Kettenis" ; Sent: Tuesday, February 11, 2003 1:41 PM Subject: patch to add HAVE_CONTINUABLE_BREAKPOINT to target_ops > Probably easier if I just give a diff for you to comment on. > > Changelog Entry: > > 2003-02-11 Kris Warkentin kewarken@qnx.com > > * target.h: Add to_have_continuable_watchpoint to struct target_ops. > Initialize HAVE_CONTINUABLE_WATCHPOINT. > * target.c: update_current_target(): Add to_have_continuable_watchpoint. > * infrun.c: remove initialization of HAVE_CONTINUABLE_WATCHPOINT. > * config/i386/nm-i386.h: Change HAVE_CONTINUABLE_WATCHPOINT defines to > 1. > * config/i386/nm-i386sco5.h: ditto > * config/i386/nm-i386sol2.h: ditto > * config/s390/nm-linux.h: ditto > * config/sparc/nm-sun4sol2.h: ditto > > cheers, > > Kris > > ----- Original Message ----- > From: "Kris Warkentin" > To: "Andrew Cagney" > Cc: "Mark Kettenis" ; > Sent: Tuesday, February 11, 2003 1:11 PM > Subject: Re: patch to add QNX NTO i386 support > > > > Hi Andrew, > > > > Sorry it took so long to reply - I took a couple days to do a port of a > > vxworks lib for a BSP we're working on. > > > > Question: can I make any assumption about the initialization of the > > target_ops vector? It looks like infrun.c wants > HAVE_CONTINUABLE_BREAKPOINT > > to default to zero but I didn't see anywhere int target.[ch] that ops were > > being initialized. > > > > cheers, > > > > Kris > > > > > > /* After a watchpoint trap, the PC points to the instruction after > > > >> > the one that caused the trap. Therefore we don't need to step > > over > > > > > > > > it. > > > > > > > >> > But we do need to reset the status register to avoid another > trap. > > > > > > > > */ > > > > > > > >> > #define HAVE_CONTINUABLE_WATCHPOINT > > > > > > > >> > > > >> Hmm, this poses an interesting problem. The other i386 targets have > > > >> this in their nm.h file, since they consider hardware watchpoints as > a > > > >> native-only feature. However, this isn't necessarily right since we > > > >> might support hardware breakpoints via the remote protocol. If you > > > >> can live with the native-only approach, please move this to your nm.h > > > >> file. Otherwise we might need to multi-arch this definition. > > > > > > > > > > > > Okay, file that under TODO along with the solib stuff. We have > hardware > > > > breakpoints on all our remote targets that support them. > > > > > > Just FYI, this needs to be added to the target vector (target.h) and not > > > the architecture vector. > > > > > > For examples, see STOPPED_BY_WATCHPOINT et.al. A bit of manipulation of > > > the existing nm-*.h files will be needed - have them define the value as > > 1. > > > > > > Can you please submit a separate patch that does just this. > > > > > > Andrew > > > > > > > > > > > > > > ------=_NextPart_000_00DF_01C2D2A4.F5C98750 Content-Type: application/octet-stream; name="contin2.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="contin2.diff" Content-length: 7283 Index: config/i386/nm-i386.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/config/i386/nm-i386.h,v=0A= retrieving revision 1.3=0A= diff -u -r1.3 nm-i386.h=0A= --- config/i386/nm-i386.h 4 Jul 2002 12:32:29 -0000 1.3=0A= +++ config/i386/nm-i386.h 12 Feb 2003 19:38:15 -0000=0A= @@ -93,7 +93,7 @@=0A= one that caused the trap. Therefore we don't need to step over it.=0A= But we do need to reset the status register to avoid another trap. */= =0A= =20=0A= -#define HAVE_CONTINUABLE_WATCHPOINT=0A= +#define HAVE_CONTINUABLE_WATCHPOINT 1=0A= =20=0A= #define STOPPED_BY_WATCHPOINT(W) (i386_stopped_data_address () !=3D = 0)=0A= =20=0A= Index: config/i386/nm-i386sco5.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/config/i386/nm-i386sco5.h,v=0A= retrieving revision 1.3=0A= diff -u -r1.3 nm-i386sco5.h=0A= --- config/i386/nm-i386sco5.h 18 Aug 2002 22:23:32 -0000 1.3=0A= +++ config/i386/nm-i386sco5.h 12 Feb 2003 19:38:15 -0000=0A= @@ -63,7 +63,7 @@=0A= /* After a watchpoint trap, the PC points to the instruction which=0A= caused the trap. But we can continue over it without disabling the=0A= trap. */=0A= -#define HAVE_CONTINUABLE_WATCHPOINT=0A= +#define HAVE_CONTINUABLE_WATCHPOINT 1=0A= #define HAVE_STEPPABLE_WATCHPOINT=0A= =20=0A= #define STOPPED_BY_WATCHPOINT(W) \=0A= Index: config/i386/nm-i386sol2.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/config/i386/nm-i386sol2.h,v=0A= retrieving revision 1.7=0A= diff -u -r1.7 nm-i386sol2.h=0A= --- config/i386/nm-i386sol2.h 5 Jun 2002 19:18:19 -0000 1.7=0A= +++ config/i386/nm-i386sol2.h 12 Feb 2003 19:38:15 -0000=0A= @@ -32,7 +32,7 @@=0A= /* When a hardware watchpoint fires off the PC will be left at the=0A= instruction following the one which caused the watchpoint.=20=20=0A= It will *NOT* be necessary for GDB to step over the watchpoint. */=0A= -#define HAVE_CONTINUABLE_WATCHPOINT=0A= +#define HAVE_CONTINUABLE_WATCHPOINT 1=0A= =20=0A= /* Solaris x86 2.6 and 2.7 targets have a kernel bug when stepping=0A= over an instruction that causes a page fault without triggering=0A= Index: config/s390/nm-linux.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/config/s390/nm-linux.h,v=0A= retrieving revision 1.5=0A= diff -u -r1.5 nm-linux.h=0A= --- config/s390/nm-linux.h 24 Feb 2002 22:56:06 -0000 1.5=0A= +++ config/s390/nm-linux.h 12 Feb 2003 19:38:15 -0000=0A= @@ -51,7 +51,7 @@=0A= /* WATCHPOINT SPECIFIC STUFF */=0A= =20=0A= #define TARGET_HAS_HARDWARE_WATCHPOINTS=0A= -#define HAVE_CONTINUABLE_WATCHPOINT=0A= +#define HAVE_CONTINUABLE_WATCHPOINT 1=0A= #define target_insert_watchpoint(addr, len, type) \=0A= s390_insert_watchpoint (PIDGET (inferior_ptid), addr, len, type)=0A= =20=0A= Index: config/sparc/nm-sun4sol2.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/config/sparc/nm-sun4sol2.h,v=0A= retrieving revision 1.9=0A= diff -u -r1.9 nm-sun4sol2.h=0A= --- config/sparc/nm-sun4sol2.h 14 Nov 2002 00:25:05 -0000 1.9=0A= +++ config/sparc/nm-sun4sol2.h 12 Feb 2003 19:38:15 -0000=0A= @@ -51,7 +51,7 @@=0A= /* When a hardware watchpoint fires off the PC will be left at the=0A= instruction following the one which caused the watchpoint.=20=20=0A= It will *NOT* be necessary for GDB to step over the watchpoint. */=0A= -#define HAVE_CONTINUABLE_WATCHPOINT=0A= +#define HAVE_CONTINUABLE_WATCHPOINT 1=0A= =20=0A= extern int procfs_stopped_by_watchpoint (ptid_t);=0A= #define STOPPED_BY_WATCHPOINT(W) \=0A= Index: infrun.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/infrun.c,v=0A= retrieving revision 1.96=0A= diff -u -r1.96 infrun.c=0A= --- infrun.c 31 Jan 2003 15:22:57 -0000 1.96=0A= +++ infrun.c 12 Feb 2003 19:38:16 -0000=0A= @@ -226,13 +226,6 @@=0A= #define HAVE_STEPPABLE_WATCHPOINT 1=0A= #endif=0A= =20=0A= -#ifndef HAVE_CONTINUABLE_WATCHPOINT=0A= -#define HAVE_CONTINUABLE_WATCHPOINT 0=0A= -#else=0A= -#undef HAVE_CONTINUABLE_WATCHPOINT=0A= -#define HAVE_CONTINUABLE_WATCHPOINT 1=0A= -#endif=0A= -=0A= #ifndef CANNOT_STEP_HW_WATCHPOINTS=0A= #define CANNOT_STEP_HW_WATCHPOINTS 0=0A= #else=0A= Index: target.c=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/target.c,v=0A= retrieving revision 1.49=0A= diff -u -r1.49 target.c=0A= --- target.c 19 Jan 2003 04:06:46 -0000 1.49=0A= +++ target.c 12 Feb 2003 19:38:17 -0000=0A= @@ -573,6 +573,7 @@=0A= INHERIT (to_remove_watchpoint, t);=0A= INHERIT (to_stopped_data_address, t);=0A= INHERIT (to_stopped_by_watchpoint, t);=0A= + INHERIT (to_have_continuable_watchpoint, t);=0A= INHERIT (to_region_size_ok_for_hw_watchpoint, t);=0A= INHERIT (to_terminal_init, t);=0A= INHERIT (to_terminal_inferior, t);=0A= Index: target.h=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvs/src/src/gdb/target.h,v=0A= retrieving revision 1.35=0A= diff -u -r1.35 target.h=0A= --- target.h 19 Jan 2003 04:06:46 -0000 1.35=0A= +++ target.h 12 Feb 2003 19:38:17 -0000=0A= @@ -256,6 +256,7 @@=0A= int (*to_remove_watchpoint) (CORE_ADDR, int, int);=0A= int (*to_insert_watchpoint) (CORE_ADDR, int, int);=0A= int (*to_stopped_by_watchpoint) (void);=0A= + int to_have_continuable_watchpoint;=0A= CORE_ADDR (*to_stopped_data_address) (void);=0A= int (*to_region_size_ok_for_hw_watchpoint) (int);=0A= void (*to_terminal_init) (void);=0A= @@ -961,6 +962,13 @@=0A= #ifndef STOPPED_BY_WATCHPOINT=0A= #define STOPPED_BY_WATCHPOINT(w) \=0A= (*current_target.to_stopped_by_watchpoint) ()=0A= +#endif=0A= +=0A= +/* Non-zero if we have continuable watchpoints */=0A= +=0A= +#ifndef HAVE_CONTINUABLE_WATCHPOINT=0A= +#define HAVE_CONTINUABLE_WATCHPOINT \=0A= + (current_target.to_have_continuable_watchpoint)=0A= #endif=0A= =20=0A= /* HP-UX supplies these operations, which respectively disable and enable= =0A= ------=_NextPart_000_00DF_01C2D2A4.F5C98750--