How to use gdb command list to print a function's parameter and return value without pausing?
I want to see which parameter and return value to a function. I use gdb breakpoint command list (gdb command script) as follow:
int foo(int)
(gdb) break foo
(gdb) print $r0
(gdb) finish
(gdb) print $r0
(gdb) continue
(gdb) end
But it print only the parameter.
I got the reason from here GDB Breakpoint command lists
Any other commands in the command list, after a command that resumes execution, are ignored开发者_JS百科.
Any help is appreciated.
You need a second breakpoint at the end of the function if you want to associate commands there.
精彩评论