I redefined a built-in command in gdb, for example "run", I want to do printing a message and then call the original "run" command to execute the real function. If I write like this:
define run
print "running"
run
end
The gdb will reach the max execute limitation, because it is calling recursively. How can I avoid this problem?
Use gdb User-defined Command Hooks. For example this hook will print message before
run
command: