Command Hooks (Post rather than Pre)

Steven Johnson sbjohnson@ozemail.com.au
Tue Aug 15 00:30:00 GMT 2000


After some investigation, I can answer one of my own questions :

Does a command recurse if it is called from it's hook?
Answer : Yes.
Do Bad things happen:
Answer : Yes. (Unless one considers a segmentation fault a good thing)

The Patch I have will also prevent this from happening, so that for example,
you can write the following:

define hook-echo
echo PRE HOOK Running\n
end

define hookpost-echo
echo POST HOOK Running\n
end

when you then execute:
gdb>echo hello world\n

you get:
PRE HOOK Running
hello world
POST HOOK Running

This is what my patch will now allow. Anyway as I said, im fishing for
comments on this before I submit it.

Steven Johnson


More information about the Gdb mailing list