From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32722 invoked by alias); 5 Oct 2002 00:11:14 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 32714 invoked from network); 5 Oct 2002 00:11:12 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 5 Oct 2002 00:11:12 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id g94NpwX09423 for ; Fri, 4 Oct 2002 19:51:58 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g950BBf26794; Fri, 4 Oct 2002 20:11:11 -0400 Received: from localhost.localdomain (vpn50-3.rdu.redhat.com [172.16.50.3]) by pobox.corp.redhat.com (8.11.6/8.11.6) with ESMTP id g950BA807545; Fri, 4 Oct 2002 20:11:10 -0400 Received: (from kev@localhost) by localhost.localdomain (8.11.6/8.11.6) id g950B5505069; Fri, 4 Oct 2002 17:11:05 -0700 Date: Fri, 04 Oct 2002 17:11:00 -0000 From: Kevin Buettner Message-Id: <1021005001104.ZM5068@localhost.localdomain> In-Reply-To: Fredrik Tolf "Instruction address catching" (Oct 5, 1:36am) References: <1033774568.4573.2.camel@pc7> To: Fredrik Tolf , gdb@sources.redhat.com Subject: Re: Instruction address catching MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-10/txt/msg00050.txt.bz2 On Oct 5, 1:36am, Fredrik Tolf wrote: > Is it possible, with the current version of gdb, to make it detect every > time an address is written to, and to make it stop only if the address > of the instruction that wrote to that address isn't equal to a specific > value. Do it like this: (gdb) watch foo Hardware watchpoint 1: foo (gdb) condition 1 $pc != 0x80484c8 The address to compare $pc against should be the address of the instruction *after* the one that writes to ``foo''. It's probably easier to figure this out by simply setting a watchpoint on foo, running 'til it's hit, and if that's not the one you're interested in, add a condition so that it won't stop there again. > If it's possible, does it work in a multithreaded application? It should. If it doesn't, it's a bug. Kevin