When I run valgrind --leak-check=yes
on a program, a few bytes of lost memory are reported. Is it possible to view the contents of this memory (i.e. dump the data that is stored in it)?
相关问题
- What uses more memory in c++? An 2 ints or 2 funct
- Memory for python.exe on Windows 7 python 32 - Num
- Analyzing Outlook HANG dump (with GoogleCalendarSy
- gRPC client do not dispose Channel
- localtime_r consuming some memory before program e
相关文章
- Why are memory addresses incremented by 4 in MIPS?
- Why doesn't valgrind detect a memory leak in m
- Is there anyway a valgrind message “Conditional ju
- Is my heap fragmented
- new libstdc++ of gcc5.1 may allocate large heap me
- Is there a way to avoid this memory error?
- Why does this cause a memory leak in the Haskell C
- Is there any limit on number of html elements, tha
You can do that with the last version of Valgrind (3.8.1):
Start your executable activating the gdbserver at startup:
Then in another window, connect a gdb to Valgrind (following the indications given by Valgrind). Then put a breakpoint at a relevant place (e.g. at the end of main) and use the gdb
command till the breakpoint is reached. Then do a leak search from gdb:
Then list the address(es) of the reachable blocks of the relevant loss record nr
You can then use gdb features to examine the memory of the given address(es). Note also the potentially interesting command "who_points_at" if you are searching who has kept a pointer to this memory.