From: Simon Glass <sjg@chromium.org>
Date: Sat, 18 May 2019 17:59:50 +0000 (-0600)
Subject: sandbox: Add documentation on how to run valgrind
X-Git-Tag: v2025.01-rc5-pxa1908~2888^2~18
X-Git-Url: http://git.dujemihanovic.xyz/img/html/index.html?a=commitdiff_plain;h=80b7cb8c3230bb29b065633c803694d8720ecadf;p=u-boot.git

sandbox: Add documentation on how to run valgrind

U-Boot sandbox can run with valgrind to check memory allocations. Add
documentation on how to do this.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

diff --git a/board/sandbox/README.sandbox b/board/sandbox/README.sandbox
index 5e8fa58ba2..c10dd444df 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
 -------