George Newton
George Newton

Reputation: 3293

Running code inside gdb debugger

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

Answers (1)

Nipun Talukdar
Nipun Talukdar

Reputation: 5377

From gdb prompt call strlen(the_char_array). Eg.,

(gdb) call strlen(the_char_array)

Upvotes: 10

Related Questions