From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23707 invoked by alias); 14 May 2009 21:30:47 -0000 Received: (qmail 23508 invoked by uid 22791); 14 May 2009 21:30:40 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.152) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 14 May 2009 21:30:34 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id n4ELUVxf032394 for ; Thu, 14 May 2009 23:30:31 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms3.u-strasbg.fr [IPv6:2001:660:2402:d::12]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id n4ELUUat019186 ; Thu, 14 May 2009 23:30:30 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id n4ELUUiH066464 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) ; Thu, 14 May 2009 23:30:30 +0200 (CEST) (envelope-from muller@ics.u-strasbg.fr) From: "Pierre Muller" To: "'Pierre Muller'" , References: <003701c9d4da$6c4f5fb0$44ee1f10$@u-strasbg.fr> In-Reply-To: <003701c9d4da$6c4f5fb0$44ee1f10$@u-strasbg.fr> Subject: RE: [RFC] Add hardware breapoints in procfs.c Date: Thu, 14 May 2009 21:30:00 -0000 Message-ID: <003801c9d4db$380e2ff0$a82a8fd0$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-05/txt/msg00312.txt.bz2 Sorry, I sent the wrong version of the patch. I started to write another patch that=20 tries to find the watchpoint stop address in procinfo struct. Correct patch is below. Pierre > -----Message d'origine----- > De=A0: gdb-patches-owner@sourceware.org [mailto:gdb-patches- > owner@sourceware.org] De la part de Pierre Muller > Envoy=E9=A0: Thursday, May 14, 2009 11:25 PM > =C0=A0: gdb-patches@sourceware.org > Objet=A0: [RFC] Add hardware breapoints in procfs.c >=20 > I postponed this part of my original patch > for procfs.c >=20 > I don't know if all platforms using > procfs.c code will work with that code, > and I have access only to a i386 OpenSolaris. > For that target, it works, > but only once the program is started... >=20 > Can someone test other targets? >=20 > Pierre >=20 2009-05-14 Pierre Muller =20 * procfs.c (procfs_insert_hw_breakpoint, procfs_remove_hw_breakpoint): New functions. (procfs_use_watchpoints): Register new hardware breakpoint related target functions. Index: procfs.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /cvs/src/src/gdb/procfs.c,v retrieving revision 1.107 diff -u -p -r1.107 procfs.c --- procfs.c 11 May 2009 11:13:08 -0000 1.107 +++ procfs.c 14 May 2009 21:16:54 -0000 @@ -5387,6 +5387,20 @@ procfs_region_ok_for_hw_watchpoint (CORE return 1; } +static int +procfs_insert_hw_breakpoint (struct bp_target_info *bp_tgt) +{ + CORE_ADDR addr =3D bp_tgt->placed_address; + return procfs_set_watchpoint (inferior_ptid, addr, 1, hw_execute, 0); +} + +static int +procfs_remove_hw_breakpoint (struct bp_target_info *bp_tgt) +{ + CORE_ADDR addr =3D bp_tgt->placed_address; + return procfs_set_watchpoint (inferior_ptid, addr, 0, 0, 0); +} + void procfs_use_watchpoints (struct target_ops *t) { @@ -5394,6 +5408,8 @@ procfs_use_watchpoints (struct target_op t->to_insert_watchpoint =3D procfs_insert_watchpoint; t->to_remove_watchpoint =3D procfs_remove_watchpoint; t->to_region_ok_for_hw_watchpoint =3D procfs_region_ok_for_hw_watchpoint; + t->to_insert_hw_breakpoint =3D procfs_insert_hw_breakpoint; + t->to_remove_hw_breakpoint =3D procfs_remove_hw_breakpoint; } /*