开发者

Redirecting/storing output of shell into GDB variable?

I would like to know how it is possible to know the current system architecture in GDB and store this information into a variable for later evaluation.

Something like:

s开发者_运维知识库et variable $x=`shell uname -m`


theres 2 ways:

the older way:

(gdb) shell echo set \$x=\"$(uname -m)\" >/tmp/foo.gdb
(gdb) source /tmp/foo.gdb

newer with python:

(gdb) python gdb.execute("set $y=\"" + os.uname()[4] + "\"")
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜