Bug 440765

Summary: Feature request: when a dynamically allocated variable is last read/written
Product: [Developer tools] valgrind Reporter: gao.jeff3
Component: memcheckAssignee: Julian Seward <jseward>
Status: REPORTED ---    
Severity: wishlist CC: p.r.worrall, philippe.waroquiers
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description gao.jeff3 2021-08-09 05:19:41 UTC
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?
Comment 1 Philippe Waroquiers 2021-08-09 08:13:16 UTC
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.