Setting GDB hardware watchpoint/how to set software watchpoint

后端 未结 3 666
故里飘歌
故里飘歌 2020-12-15 05:05

An earlier question explained that on x86 the size of objects being watched is limited by debug registers. As expected, I can \"watch\" a double variable. But I can\'t watch

3条回答
  •  难免孤独
    2020-12-15 05:25

    Yes, you can:

    set can-use-hw-watchpoints 0

    From 5.1.2 Setting Watchpoints:

    You can force GDB to use only software watchpoints with the set can-use-hw-watchpoints 0 command. With this variable set to zero, GDB will never try to use hardware watchpoints, even if the underlying system supports them. (Note that hardware-assisted watchpoints that were set before setting can-use-hw-watchpoints to zero will still use the hardware mechanism of watching expression values.)

    set can-use-hw-watchpoints

        Set whether or not to use hardware watchpoints.

    show can-use-hw-watchpoints

        Show the current mode of using hardware watchpoints.

提交回复
热议问题