user13145920
user13145920

Reputation: 189

Get return from gdb exec

In .gdbinit I call to function

call open("tmp/test",1)

Then I got return value

$15 = 1

I want to use $15 to the next operation.

How can I got this var to the .gdbinit next line ?

Upvotes: 1

Views: 59

Answers (1)

user15092531
user15092531

Reputation:

You can simply assign the return value to a variable with a name of your choosing:

(gdb) call $ret = open("tmp/test", 1)
(gdb) print $ret
-1

Upvotes: 1

Related Questions