E.g.:
define mycmd
break $arg0
commands
print $arg0
end
end
mycmd myfunc
continue
Prints:
$1 = void
instead of the expected myfunc
, because $arg0
is evaulated when the command is hit, and since it has not been defined shows void
.
Is there a way to pass it to the commands
?
I think I would be able to do it with Python easily, but it would be cool to have a quicker way. But if you have the Python ready, just paste it anyways.
Motivation: automate https://stackoverflow.com/a/5372742/895245 , where I'd like to write:
define break-stack
break $arg0
commands
tbreak $arg1
continue
end
end
break-stack ParentFunc ChildFunc
Yes, I know that https://stackoverflow.com/a/20209911/895245 provides a Python solution.
GDB 7.11, Ubuntu 16.10.