diff options
| author | Eli Zaretskii | 2024-06-10 21:12:12 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2024-06-10 21:12:12 +0300 |
| commit | aca5de19b86c973bf303de936bdd06dbb86c023e (patch) | |
| tree | 3ee1caffdd0fbd11e898bbc67ae1352c2000e929 /src | |
| parent | ce4e5e6a28182b4559802cd6fa62c68c2b035bc8 (diff) | |
| download | emacs-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/.gdbinit | 39 |
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. | |||
| 926 | This command assumes that $ is an Emacs Lisp hash table value. | 926 | This command assumes that $ is an Emacs Lisp hash table value. |
| 927 | end | 927 | end |
| 928 | 928 | ||
| 929 | define xtsparser | ||
| 930 | xgetptr $ | ||
| 931 | print (struct Lisp_TS_Parser *) $ptr | ||
| 932 | output *$ | ||
| 933 | echo \n | ||
| 934 | end | ||
| 935 | document xtsparser | ||
| 936 | Print the address of the treesit-parser which the Lisp_Object $ points to. | ||
| 937 | end | ||
| 938 | |||
| 939 | define xtsnode | ||
| 940 | xgetptr $ | ||
| 941 | print (struct Lisp_TS_Node *) $ptr | ||
| 942 | output *$ | ||
| 943 | echo \n | ||
| 944 | end | ||
| 945 | document xtsnode | ||
| 946 | Print the address of the treesit-node which the Lisp_Object $ points to. | ||
| 947 | end | ||
| 948 | |||
| 949 | define xtsquery | ||
| 950 | xgetptr $ | ||
| 951 | print (struct Lisp_TS_Query *) $ptr | ||
| 952 | output *$ | ||
| 953 | echo \n | ||
| 954 | end | ||
| 955 | document xtsquery | ||
| 956 | Print the address of the treesit-query which the Lisp_Object $ points to. | ||
| 957 | end | ||
| 958 | |||
| 929 | define xcons | 959 | define 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 |