2

I tried to do that :

a = `gdb -q ./test` ; print a

But it's showing nothing, even the gdb process are running. How can I do it ?

Aramyh
  • 55
  • 5

1 Answers1

0

gdb waits for some command after start entered from stdin. At least, r to run program. So you need to send r to gdb. Try this:

a = `echo 'r'|gdb -q ./test`; print a

Also, you can read this question

user2807083
  • 2,962
  • 4
  • 29
  • 37