This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 320b73818b tools/gdb/memdump.py: fix the wrap line output indentation
320b73818b is described below

commit 320b73818b557c3513d8a2f7f38fe2fb7102e2c2
Author: Bowen Wang <wangbow...@xiaomi.com>
AuthorDate: Fri Sep 15 19:08:56 2023 +0800

    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 <wangbow...@xiaomi.com>
---
 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

Reply via email to