Is it possible to run code inside 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. What can I do?
-
You could try using the print command, I am not sure if it allows you to call arbitrary functions thoughBlackBear– BlackBear2014-02-16 18:38:22 +00:00Commented Feb 16, 2014 at 18:38
-
Not only is it possible (in most cases), you can even set and hit breakpoints inside code you explicitly evaluateLeeor– Leeor2014-02-16 20:06:00 +00:00Commented Feb 16, 2014 at 20:06
Add a comment
|