emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/comp-static-data 7727f85b869 07/16: src/.gdbinit: Add pretty-pri


From: Vibhav Pant
Subject: scratch/comp-static-data 7727f85b869 07/16: src/.gdbinit: Add pretty-printing support for native comp units.
Date: Thu, 19 Jan 2023 12:44:35 -0500 (EST)

branch: scratch/comp-static-data
commit 7727f85b86967b647a89e64ac37297e3fe37e348
Author: Vibhav Pant <vibhavp@gmail.com>
Commit: Vibhav Pant <vibhavp@gmail.com>

    src/.gdbinit: Add pretty-printing support for native comp units.
    
    * src/.gdbinit (xnativecompunit): New command.
    (xpr): Call xnativecompunit for pretty-printing Lisp_Native_Comp_Unit
    objects.
---
 src/.gdbinit | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/.gdbinit b/src/.gdbinit
index 9ec536a96d1..e1918347d48 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -829,6 +829,20 @@ Print $ as a compiled function pointer.
 This command assumes that $ is an Emacs Lisp compiled value.
 end
 
+define xnativecompunit
+  xgetptr $
+  print (struct Lisp_Native_Comp_Unit *) $ptr
+  set $nativecompunit = (struct Lisp_Native_Comp_Unit *) $ptr
+  xgettype $nativecompunit->file
+  xgetptr $nativecompunit->file
+  output ($type == Lisp_String ? ((char *) (struct Lisp_String *) 
$ptr)->u.s.data : (struct Lisp_Cons *)$ptr)
+  echo \n
+end
+document xnativecompunit
+Print $ as a native compiled unit.
+This command assumes that $ is an Emacs Lisp native compiled unit value.
+end
+
 define xwindow
   xgetptr $
   print (struct window *) $ptr
@@ -1037,6 +1051,9 @@ define xpr
       if $vec == PVEC_COMPILED
        xcompiled
       end
+      if $vec == PVEC_NATIVE_COMP_UNIT
+        xnativecompunit
+      end
       if $vec == PVEC_WINDOW
        xwindow
       end



reply via email to

[Prev in Thread] Current Thread [Next in Thread]