1

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 ?

user13145920
  • 179
  • 1
  • 9

1 Answers1

1

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