From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23749 invoked by alias); 11 Feb 2003 18:41:08 -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 23742 invoked from network); 11 Feb 2003 18:41:07 -0000 Received: from unknown (HELO hub.ott.qnx.com) (209.226.137.76) by 172.16.49.205 with SMTP; 11 Feb 2003 18:41:07 -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 NAA03187; Tue, 11 Feb 2003 13:30:10 -0500 Received: from catdog ([10.4.2.2]) by smtp.ott.qnx.com (8.8.8/8.6.12) with SMTP id NAA20543; Tue, 11 Feb 2003 13:41:06 -0500 Message-ID: <02d001c2d1fd$22e8ac00$0202040a@catdog> From: "Kris Warkentin" To: "Andrew Cagney" Cc: "Mark Kettenis" , References: <1c3601c2cbc1$72eac3b0$0202040a@catdog> <3E40387D.50001@redhat.com> <008f01c2ce4b$427295f0$2a00a8c0@dash> <86lm0r3nha.fsf@elgar.kettenis.dyndns.org> <218c01c2cee4$8cde7610$0202040a@catdog> <3E442C44.3020306@redhat.com> <02af01c2d1f8$fe327750$0202040a@catdog> Subject: patch to add HAVE_CONTINUABLE_BREAKPOINT to target_ops Date: Tue, 11 Feb 2003 18:41:00 -0000 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_02CD_01C2D1D3.39E7EA80" X-Priority: 3 X-MSMail-Priority: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-SW-Source: 2003-02/txt/msg00277.txt.bz2 This is a multi-part message in MIME format. ------=_NextPart_000_02CD_01C2D1D3.39E7EA80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-length: 2651 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_02CD_01C2D1D3.39E7EA80 Content-Type: application/octet-stream; name="contin.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="contin.diff" Content-length: 7284 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 11 Feb 2003 18:31:35 -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 11 Feb 2003 18:31:35 -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 11 Feb 2003 18:31:35 -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 11 Feb 2003 18:31:35 -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 11 Feb 2003 18:31:35 -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 11 Feb 2003 18:31:36 -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 11 Feb 2003 18:31:37 -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 11 Feb 2003 18:31:37 -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_02CD_01C2D1D3.39E7EA80--