aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2024-06-10 21:12:12 +0300
committerEli Zaretskii2024-06-10 21:12:12 +0300
commitaca5de19b86c973bf303de936bdd06dbb86c023e (patch)
tree3ee1caffdd0fbd11e898bbc67ae1352c2000e929 /src
parentce4e5e6a28182b4559802cd6fa62c68c2b035bc8 (diff)
downloademacs-aca5de19b86c973bf303de936bdd06dbb86c023e.tar.gz
emacs-aca5de19b86c973bf303de936bdd06dbb86c023e.zip
Allow to print treesit objects from GDB
* src/.gdbinit (xtsparser, xtsnode, xtsquery): New functions. (xpr): Call them for treesit objects.
Diffstat (limited to 'src')
-rw-r--r--src/.gdbinit39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/.gdbinit b/src/.gdbinit
index 7645d466a5e..0f55cc18699 100644
--- a/src/.gdbinit
+++ b/src/.gdbinit
@@ -926,6 +926,36 @@ Set $ as a hash table pointer.
926This command assumes that $ is an Emacs Lisp hash table value. 926This command assumes that $ is an Emacs Lisp hash table value.
927end 927end
928 928
929define xtsparser
930 xgetptr $
931 print (struct Lisp_TS_Parser *) $ptr
932 output *$
933 echo \n
934end
935document xtsparser
936Print the address of the treesit-parser which the Lisp_Object $ points to.
937end
938
939define xtsnode
940 xgetptr $
941 print (struct Lisp_TS_Node *) $ptr
942 output *$
943 echo \n
944end
945document xtsnode
946Print the address of the treesit-node which the Lisp_Object $ points to.
947end
948
949define xtsquery
950 xgetptr $
951 print (struct Lisp_TS_Query *) $ptr
952 output *$
953 echo \n
954end
955document xtsquery
956Print the address of the treesit-query which the Lisp_Object $ points to.
957end
958
929define xcons 959define xcons
930 xgetptr $ 960 xgetptr $
931 print (struct Lisp_Cons *) $ptr 961 print (struct Lisp_Cons *) $ptr
@@ -1069,6 +1099,15 @@ define xpr
1069 if $vec == PVEC_HASH_TABLE 1099 if $vec == PVEC_HASH_TABLE
1070 xhashtable 1100 xhashtable
1071 end 1101 end
1102 if $vec == PVEC_TS_PARSER
1103 xtsparser
1104 end
1105 if $vec == PVEC_TS_NODE
1106 xtsnode
1107 end
1108 if $vec == PVEC_TS_QUERY
1109 xtsquery
1110 end
1072 else 1111 else
1073 xvector 1112 xvector
1074 end 1113 end