I want to track the state of all the variables in a function in C.
I know I can use info commands in gdb to get all the variables state at the current context.
And I can use gdbinit to automate the gdb.
But what I want to do is set a breakpoint at the function and then after executing each line print execute the info command.
Basically, I want to set 2 breakpoints: one at the start of a function and one at the end of the same function(I don't know how to this) and execute line-by-line between these 2 points.
I want something like this in my gdbinit:
b <func_name>
commands
while <inside the function>:
info locals
next
end
run
Is there a way to have the while loop shown above?