From: Simon Glass Date: Sat, 18 May 2019 11:59:50 -0600 Subject: [U-Boot] [PATCH 13/17] sandbox: Add documentation on how to run valgrind In-Reply-To: <20190518175954.262021-1-sjg@chromium.org> References: <20190518175954.262021-1-sjg@chromium.org> Message-ID: <20190518175954.262021-14-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de U-Boot sandbox can run with valgrind to check memory allocations. Add documentation on how to do this. Signed-off-by: Simon Glass --- board/sandbox/README.sandbox | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/board/sandbox/README.sandbox b/board/sandbox/README.sandbox index 5e8fa58ba29..c10dd444df0 100644 --- a/board/sandbox/README.sandbox +++ b/board/sandbox/README.sandbox @@ -442,6 +442,20 @@ If sdl-config is on a different path from the default, set the SDL_CONFIG environment variable to the correct pathname before building U-Boot. +Using valgrind / memcheck +------------------------- + +It is possible to run U-Boot under valgrind to check memory allocations: + + valgrind u-boot + +If you are running sandbox SPL or TPL, then valgrind will not by default +notice when U-Boot jumps from TPL to SPL, or from SPL to U-Boot proper. To +fix this, use: + + valgrind --trace-children=yes u-boot + + Testing ------- -- 2.21.0.1020.gf2820cf01a-goog