From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11951 invoked by alias); 2 Aug 2010 07:55:12 -0000 Received: (qmail 11846 invoked by uid 22791); 2 Aug 2010 07:55:11 -0000 X-SWARE-Spam-Status: No, hits=1.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-px0-f169.google.com (HELO mail-px0-f169.google.com) (209.85.212.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 02 Aug 2010 07:55:05 +0000 Received: by pxi7 with SMTP id 7so2901083pxi.0 for ; Mon, 02 Aug 2010 00:55:03 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.131.6 with SMTP id e6mr6259934wad.114.1280735703066; Mon, 02 Aug 2010 00:55:03 -0700 (PDT) Received: by 10.114.133.17 with HTTP; Mon, 2 Aug 2010 00:55:02 -0700 (PDT) In-Reply-To: <20100802065802.GA12049@host1.dyn.jankratochvil.net> References: <20100802065802.GA12049@host1.dyn.jankratochvil.net> Date: Mon, 02 Aug 2010 07:55:00 -0000 Message-ID: Subject: Re: GDB hardware watchpoint information on i386 From: Shrikanth Kamath To: Jan Kratochvil Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-08/txt/msg00005.txt.bz2 Decent enough Jan. Okay, from internals perspective, say I have written the "commands" to be executed when the watchpoint is hit, which function inside GDB maps this action(s) to the watchpoint trap? I mean there would be foo_service_watchpoint() { /* map actions to this watchpoint */ } which is this function? -- Shrikanth R K On Mon, Aug 2, 2010 at 12:28 PM, Jan Kratochvil wrote: > On Mon, 02 Aug 2010 06:10:31 +0200, Shrikanth Kamath wrote: >> I am specifically looking for information about "hooking" my own=A0handl= er=A0to >> service=A0the watchpoint interrupt rather than needing to invoke a GDB s= ession >> and press 'c'. > > Besides GDB hacking isn't it enough for you to use `commands' with `conti= nue' > and associate arbitrary commands (`backtrace' here) in the GDB CLI interf= ace? > > Regards, > Jan > > > (gdb) watch v > Hardware watchpoint 1: v > (gdb) commands > Type commands for when breakpoint 1 is hit, one per line. > End with a line saying just "end". >>backtrace >>continue >>end > (gdb) run > Starting program: var > Hardware watchpoint 1: v > > Old value =3D 0 > New value =3D 1 > f () at var.c:7 > 7 =A0 =A0 =A0 } > #0 =A0f () at var.c:7 > #1 =A00x00000000004004a7 in main () at var.c:20 > Hardware watchpoint 1: v > > Old value =3D 1 > New value =3D 0 > g () at var.c:13 > 13 =A0 =A0 =A0} > #0 =A0g () at var.c:13 > #1 =A00x00000000004004ac in main () at var.c:21 > Hardware watchpoint 1: v > > Old value =3D 0 > New value =3D 1 > f () at var.c:7 > 7 =A0 =A0 =A0 } > #0 =A0f () at var.c:7 > #1 =A00x00000000004004a7 in main () at var.c:20 > Hardware watchpoint 1: v > > [...] >