gdb stops with too many watchpoints when there is only one

后端 未结 3 1692
迷失自我
迷失自我 2021-01-01 16:10

Do you know any other reasons why a watchpoint could not be inserted other than too many hardware breakpoints/watchpoints?

I have the following debug session:

<
3条回答
  •  说谎
    说谎 (楼主)
    2021-01-01 17:03

    As far as I know commodity x86 CPUs have four debug registers available for supporting hardware breaks/watches. This limits the object size that you can watch. Object alignment also plays here.

    Try limiting the watch scope to a smaller object like pair of first and last members of the structure.

提交回复
热议问题