Re: how to create and hardware watchpoint from a commands list.

Doug Evans <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAP9bCMQknJ15bb52HPPq8ESa+=JOdhAxK=fTd45hxKVsep0qkQ@mail.gmail.com>
On Wed, Feb 4, 2015 at 2:14 AM, Julien Chavanton <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.