如何在指针内容满足条件时设置条件断点?

How to set a conditional breakpoint when the content of the pointer meets the condition?

假设X0是一个指针,0x98765432。

在 0x98765442(0x98765432 + 0x10) 处,它的值为“abcd efgh”。

当 0x98765442 的值为“abcd efgh”时,如何设置条件断点?

是这样的吗?

br *0x98765442 if $x0+0x10=="abcdefgh"

br *0x98765442 if $x0+0x10=="abcdefgh"

提议的语法将不起作用,因为它会比较劣质(正在调试)中的字符串地址(右侧字符串通过合成调用 strdup("abcdefgh") 被“注入”到进程中)过程(更糟糕的是,每次评估条件时都会生成 不同的 合成字符串)。

你想要这样的东西:

br *0x98765442 if 0 == strcmp((char*)$x0 + 0x10, "abcdefgh")