I wrote a program in C++ that used a function pointer to a function within the program, mem-copied the function to another location in memory and executed the replica. I had placed a breakpoint in the original function before copying, and the breakpoint got copied over too. The debugger encountered the breakpoint in the replica function, did not know where it came from and thereby acted. It was fun.
Alright, this wasn't exactly useless as I was trying to learn how debuggers work.