20
我想知道如何才能知道GDB中的当前系统架构,并将这些信息存储到一个变量中供以后评估。将shell的输出重定向/存储到GDB变量中?
喜欢的东西:
set variable $x=`shell uname -m`
我想知道如何才能知道GDB中的当前系统架构,并将这些信息存储到一个变量中供以后评估。将shell的输出重定向/存储到GDB变量中?
喜欢的东西:
set variable $x=`shell uname -m`
那里有2种方式:
旧的方式:
(gdb) shell echo set \$x=\"$(uname -m)\" >/tmp/foo.gdb
(gdb) source /tmp/foo.gdb
与蟒蛇更新:
(gdb) python gdb.execute("set $y=\"" + os.uname()[4] + "\"")