- gdb allows defining hooks, that will be executed before of after a command.
- To define a pre-hook for the command 'echo':
define hook-echo
echo <<<---
end
- To define a post-hook for the command 'echo':
define hookpost-echo
echo --->>>\n
end
- Now, using the command 'echo':
(gdb) echo Hello World
<<<---Hello World--->>>
(gdb)