Reputation: 3293
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?
Upvotes: 8
Views: 6794
Reputation: 5377
From gdb prompt call strlen(the_char_array). Eg.,
(gdb) call strlen(the_char_array)
Upvotes: 10