开发者

How to use gdb command list to print a function's parameter and return value without pausing?

开发者 https://www.devze.com 2023-01-11 19:01 出处:网络
I want to see which parameter and return value to a function. I use gdb breakpoint command list (gdb command script) as follow:

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号