GDB: Set variable using pipe and awk
问题 I would like to store the executable name of the current inferior in a variable. I way to obtain the executable name in the gdb CLI is the following: pipe info inferiors | awk '{ if ($1 == "*") { print $4} }' But I am unable to store the output of this expression in a variable. The expression uses single and double quotes, which makes gdb complain if it is combined with set and eval . (gdb) set $exec="pipe info inferiors | awk '{ if ($1 == "*") { print $4} }'" Argument to arithmetic operation