是否可以使用lldb做到这一点?
(lldb) p my_var
(uint64_t) $9 = 2
(lldb) set set target.max-children-count 4
但不是4,我想用当前值my_var
(在这种情况下为2)调用set命令。
答案 0 :(得分:2)
在大多数lldb命令中,对反引号块进行求值,并将结果替换为它们。例如,
(lldb) sett show stop-line-count-before
stop-line-count-before (int) = 3
(lldb) p 5
(int) $1 = 5
(lldb) sett set stop-line-count-before `$1`
(lldb) sett show stop-line-count-before
stop-line-count-before (int) = 5