From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30882 invoked by alias); 4 Feb 2015 10:14:39 -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 30863 invoked by uid 89); 4 Feb 2015 10:14:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-qa0-f53.google.com Received: from mail-qa0-f53.google.com (HELO mail-qa0-f53.google.com) (209.85.216.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 04 Feb 2015 10:14:37 +0000 Received: by mail-qa0-f53.google.com with SMTP id n4so395006qaq.12 for ; Wed, 04 Feb 2015 02:14:35 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.140.102.142 with SMTP id w14mr44780385qge.88.1423044874910; Wed, 04 Feb 2015 02:14:34 -0800 (PST) Received: by 10.96.146.234 with HTTP; Wed, 4 Feb 2015 02:14:34 -0800 (PST) Date: Wed, 04 Feb 2015 10:14:00 -0000 Message-ID: Subject: how to create and hardware watchpoint from a commands list. From: Julien Chavanton To: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-02/txt/msg00007.txt.bz2 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. 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 ? 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