简体   繁体   English

在gdb调试器中运行代码

[英]Running code inside gdb debugger

Is it possible to run code inside gdb? 是否可以在gdb中运行代码? For example, if I were debugging a .c file, and I wanted to get the strlen() of a character array at a particular point in time, I can't just type in strlen(str) into the buffer - it is an invalid command. 例如,如果我正在调试.c文件,并且想在特定时间获取字符数组的strlen(),则不能只将strlen(str)输入到缓冲区中-它是一个无效的命令。 What can I do? 我能做什么?

From gdb prompt call strlen(the_char_array). 从gdb提示符调用strlen(the_char_array)。 Eg., 例如。,

(gdb) call strlen(the_char_array)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM