2
votes

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.

Any help is appreciated.

1

1 Answers

2
votes

You need a second breakpoint at the end of the function if you want to associate commands there.