Operating system? GDB version?
Does GDB/Codeblocks crash, or is this a valid error message from gdb?
What are you trying to debug?
Is the stack filled? Because if there are no items, top() will return an invalid reference, probably undefined behavior....