1. A method for debugging a computer program comprising: selecting a first memory location as a breakpoint location; determining a first memory page that contains the first memory location; replacing at least a portion of the first memory page with new content, the new content including a breakpoint instruction; and setting a permission of the first memory page to execute only, such that attempts to read to or write from the first memory page by the computer program are prevented.