Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pass gdb variable to a shell command excuted from gdb

Tags:

I want to execute a shell command from gdb, this shell command needs an argument, and this argument is a gdb variable. How to make gdb interpret this variable before passing the command and argument to the shell interpreter ?

For example, in a gdb prompt:

(gdb) set $my_arg = 2
(gdb) shell echo $my_arg

I would like this to print 2 on stdout, but actually it does print a blank line.

Edit: I'm using ndk-gdb, which doesn't support python scripting.