There is no sample that does exact what you want, you may want to have a look at memtrace sample for how to get memory reference address.
Alternatively, you might want to have a look at shadow memory for it.
I would suggest you to read my papers (
http://people.csail.mit.edu/qin_zhao/) about shadow memory and watchpoint:
"How to do a million watchpoints: Efficient Debugging Using Dynamic Instrumentation" (cc 2008)
http://groups.csail.mit.edu/commit/papers/08/zhao-cc-2008.pdf
and
"Umbra: Efficient and Scalable Memory Shadowing." (cgo 2010)
http://groups.csail.mit.edu/commit/papers/2010/zhao-cgo10-umbra.pdf
For creating a new client of single file, you only need add the file directly and repeat the process starting from cmake to recreate the Makefile.
If you want to create a client with multiple files, you need change the CMakeLists.txt a little.
Best Regards
Qin