[Pdbg] [PATCH] Add valgrind suppression file

Joel Stanley joel at jms.id.au
Thu Mar 3 12:47:28 AEDT 2022


Use this to ignore memory leaks from the device tree generation code:

 valgrind --leak-check=full --suppressions=rules ./pdbg

Bonus points if you fix the code to free the memory and remove this
file.

Signed-off-by: Joel Stanley <joel at jms.id.au>
---
 pdbg.supp | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)
 create mode 100644 pdbg.supp

diff --git a/pdbg.supp b/pdbg.supp
new file mode 100644
index 000000000000..c18b97cc66d2
--- /dev/null
+++ b/pdbg.supp
@@ -0,0 +1,60 @@
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:malloc
+   fun:strdup
+   fun:take_name
+   fun:dt_new_node
+   ...
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:calloc
+   fun:get_target_class
+   fun:dt_pdbg_target_new
+   fun:dt_new_node
+   fun:dt_expand_node
+   ...
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:malloc
+   fun:strdup
+   fun:get_target_class
+   fun:dt_pdbg_target_new
+   fun:dt_new_node
+   ...
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:calloc
+   fun:dt_new_node
+   fun:dt_new_virtual
+   fun:pdbg_targets_init_virtual
+   ...
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:calloc
+   fun:dt_new_node
+   fun:dt_expand_node
+   ...
+}
+{
+   <insert_a_suppression_name_here>
+   Memcheck:Leak
+   match-leak-kinds: possible
+   fun:calloc
+   fun:dt_pdbg_target_new
+   fun:dt_new_node
+   ...
+}
-- 
2.34.1



More information about the Pdbg mailing list