From: Eli Zaretskii Date: Mon, 10 Jun 2024 18:12:12 +0000 (+0300) Subject: Allow to print treesit objects from GDB X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=725a2a21a06a55748e22dcc3b934575c58baa9dd;p=emacs.git Allow to print treesit objects from GDB * src/.gdbinit (xtsparser, xtsnode, xtsquery): New functions. (xpr): Call them for treesit objects. (cherry picked from commit aca5de19b86c973bf303de936bdd06dbb86c023e) --- 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. This command assumes that $ is an Emacs Lisp hash table value. end +define xtsparser + xgetptr $ + print (struct Lisp_TS_Parser *) $ptr + output *$ + echo \n +end +document xtsparser +Print the address of the treesit-parser which the Lisp_Object $ points to. +end + +define xtsnode + xgetptr $ + print (struct Lisp_TS_Node *) $ptr + output *$ + echo \n +end +document xtsnode +Print the address of the treesit-node which the Lisp_Object $ points to. +end + +define xtsquery + xgetptr $ + print (struct Lisp_TS_Query *) $ptr + output *$ + echo \n +end +document xtsquery +Print the address of the treesit-query which the Lisp_Object $ points to. +end + define xcons xgetptr $ print (struct Lisp_Cons *) $ptr @@ -1069,6 +1099,15 @@ define xpr if $vec == PVEC_HASH_TABLE xhashtable end + if $vec == PVEC_TS_PARSER + xtsparser + end + if $vec == PVEC_TS_NODE + xtsnode + end + if $vec == PVEC_TS_QUERY + xtsquery + end else xvector end