From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22362 invoked by alias); 8 Feb 2015 05:26:26 -0000 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 Received: (qmail 22352 invoked by uid 89); 8 Feb 2015 05:26:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f180.google.com Received: from mail-wi0-f180.google.com (HELO mail-wi0-f180.google.com) (209.85.212.180) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 08 Feb 2015 05:26:23 +0000 Received: by mail-wi0-f180.google.com with SMTP id ho1so795743wib.1 for ; Sat, 07 Feb 2015 21:26:20 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.194.71.110 with SMTP id t14mr22592898wju.58.1423373180489; Sat, 07 Feb 2015 21:26:20 -0800 (PST) Received: by 10.27.20.5 with HTTP; Sat, 7 Feb 2015 21:26:20 -0800 (PST) In-Reply-To: References: Date: Sun, 08 Feb 2015 05:26:00 -0000 Message-ID: Subject: Re: how to create and hardware watchpoint from a commands list. From: Doug Evans To: Julien Chavanton Cc: gdb Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00012.txt.bz2 On Wed, Feb 4, 2015 at 2:14 AM, Julien Chavanton wrote: > Hi Folks, I would like to create and hardware watchpoint from a commands list. > > retrieve the addres of a variable and create a watch. > > watch *(int *) &call->stream->session->ext.settings.mode > > Manualy this is working fine, but I do not know the right syntax in GDB. What do you mean by this working manually but then not knowing the right syntax? > > I tried "watch -location call->stream->session->ext.settings.mode" > > And sereval other things, is there a way to pipe the output of one > command to another one ? You tried several things, but you need to be more specific about what problems you had. Complete unedited session logs are useful. There are various ways to "pipe" (for lack of a better term) the output of previous commands into subsequent commands. value history, convenience variables and/or eval or python come to mind. But do you need to? What about "watch -location ..." didn't work? > > watch *(int *) | printf "0x%x\n", &call->stream->session->ext.settings.mode > > > ---------------------------------------------------------- > > > define myhook > echo myhook \n > next > next > next > print call->stream->session->ext.settings.mode > print &call->stream->session->ext.settings.mode > printf "watch *(int *)0x%x\n", &call->stream->session->ext.settings.mode > end > > break set_settings > commands > myhook > end