From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9103 invoked by alias); 2 Aug 2010 06:58:13 -0000 Received: (qmail 9093 invoked by uid 22791); 2 Aug 2010 06:58:13 -0000 X-SWARE-Spam-Status: No, hits=-6.0 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 02 Aug 2010 06:58:07 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o726w5Qe017154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 2 Aug 2010 02:58:06 -0400 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o726w3vI017841 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 2 Aug 2010 02:58:05 -0400 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o726w30b012293; Mon, 2 Aug 2010 08:58:03 +0200 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o726w2LR012292; Mon, 2 Aug 2010 08:58:02 +0200 Date: Mon, 02 Aug 2010 06:58:00 -0000 From: Jan Kratochvil To: Shrikanth Kamath Cc: gdb@sourceware.org Subject: Re: GDB hardware watchpoint information on i386 Message-ID: <20100802065802.GA12049@host1.dyn.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-12-10) 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/msg00004.txt.bz2 On Mon, 02 Aug 2010 06:10:31 +0200, Shrikanth Kamath wrote: > I am specifically looking for information about "hooking" my own handler to > service the watchpoint interrupt rather than needing to invoke a GDB session > and press 'c'. Besides GDB hacking isn't it enough for you to use `commands' with `continue' and associate arbitrary commands (`backtrace' here) in the GDB CLI interface? 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 = 0 New value = 1 f () at var.c:7 7 } #0 f () at var.c:7 #1 0x00000000004004a7 in main () at var.c:20 Hardware watchpoint 1: v Old value = 1 New value = 0 g () at var.c:13 13 } #0 g () at var.c:13 #1 0x00000000004004ac in main () at var.c:21 Hardware watchpoint 1: v Old value = 0 New value = 1 f () at var.c:7 7 } #0 f () at var.c:7 #1 0x00000000004004a7 in main () at var.c:20 Hardware watchpoint 1: v [...]