This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

how to create and hardware watchpoint from a commands list.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]