Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Doug Evans <xdje42@gmail.com>
To: Julien Chavanton <jchavanton@gmail.com>
Cc: gdb <gdb@sourceware.org>
Subject: Re: how to create and hardware watchpoint from a commands list.
Date: Sun, 08 Feb 2015 05:26:00 -0000	[thread overview]
Message-ID: <CAP9bCMQknJ15bb52HPPq8ESa+=JOdhAxK=fTd45hxKVsep0qkQ@mail.gmail.com> (raw)
In-Reply-To: <CAKmcL2mg7F3QZXvQPdzUfokHm15YKLar_XL_KZpdCNZ2i6N6+Q@mail.gmail.com>

On Wed, Feb 4, 2015 at 2:14 AM, Julien Chavanton <jchavanton@gmail.com> 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


  reply	other threads:[~2015-02-08  5:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-04 10:14 Julien Chavanton
2015-02-08  5:26 ` Doug Evans [this message]
2015-02-08 14:49   ` Julien Chavanton
2015-02-08 21:47     ` Doug Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAP9bCMQknJ15bb52HPPq8ESa+=JOdhAxK=fTd45hxKVsep0qkQ@mail.gmail.com' \
    --to=xdje42@gmail.com \
    --cc=gdb@sourceware.org \
    --cc=jchavanton@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox