From 320b73818b557c3513d8a2f7f38fe2fb7102e2c2 Mon Sep 17 00:00:00 2001 From: Bowen Wang Date: Fri, 15 Sep 2023 19:08:56 +0800 Subject: [PATCH] tools/gdb/memdump.py: fix the wrap line output indentation 1. always output the wrap line when dump main heap memory node; 2. format the memdump.py; Signed-off-by: Bowen Wang --- tools/gdb/memdump.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/gdb/memdump.py b/tools/gdb/memdump.py index a494f47153..a53e20831f 100644 --- a/tools/gdb/memdump.py +++ b/tools/gdb/memdump.py @@ -20,7 +20,7 @@ import gdb import utils -from lists import list_for_each_entry, sq_for_every, sq_is_empty, sq_queue +from lists import list_for_each_entry, sq_for_every, sq_queue mempool_backtrace = utils.CachedType("struct mempool_backtrace_s") @@ -133,9 +133,10 @@ class Nxmemdump(gdb.Command): for node in mm_foreach(heap): if node["size"] & MM_ALLOC_BIT != 0: - if (pid == node["pid"] or (pid == PID_MM_ALLOC and node["pid"] != PID_MM_MEMPOOL)) and ( - node["seqno"] >= seqmin and node["seqno"] < seqmax - ): + if ( + pid == node["pid"] + or (pid == PID_MM_ALLOC and node["pid"] != PID_MM_MEMPOOL) + ) and (node["seqno"] >= seqmin and node["seqno"] < seqmax): charnode = gdb.Value(node).cast(gdb.lookup_type("char").pointer()) gdb.write( "%6d%12u%12u%#*x" @@ -161,7 +162,7 @@ class Nxmemdump(gdb.Command): ) ) - gdb.write("\n") + gdb.write("\n") self.aordblks += 1 self.uordblks += node["size"] & ~MM_MASK_BIT