Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有全局变量,例如int NUM = 4;。当我使用 gdb 附加到工作应用程序时 - 它挂起。现在,我想获得价值NUM并改变它。这个怎么做?
int NUM = 4;
NUM
也许,其他数据类型的可能示例char[]和std::string?
char[]
std::string
谢谢
在 gdb 中你应该使用
print INT
显示 INT 的值和
set variable INT = value
设置 INT 等于值。在数组中使用
set variable array_variable[element_index] = value
element_index将数组中索引处的元素设置array_variable为值。
element_index
array_variable