This work makes two major contributions to architectural support for the debugging of memory related bugs. First, it proposes a novel framework for detecting memory related bugs, where the application can be selective, can be extended to kernel modules, and is based on the virtual memory simulation of the application in hand. Secondly, we have tried to formalize the code instrumentation given our framework. It has not been dealt in details in the earlier works. This will generate scopes for future research in this area and a better formalism can help to come up with a much more usable and robust tool for detecting memory related bugs.