When performing a leak check in Valgrind, is it possible to include a feature detailing when a dynamically allocated variable is last read/written to?
Keeping a stack trace of all accesses is a very heavy functionality. This can be implemented as e.g. helgrind --history=full provides this history of past accesses (with the amountof history to keep controlled by --conflict-cache-size=N). An alternative might be to use valgrind+gdb/vgdb and use the gdb command watch to watch accesses to a piece of memory.