If you are interested in the multiple moving parts needed to get #mte support for #qemu's #gdbstub you might find my colleges blog post interesting:
Adding Support for MTE debugging to QEMU | Blog | LinaroThis blog post explains how Linaro enabled QEMU to debug MTE (Memory Tagging Extension) code on machines that support this feature. We'll start by explaining MTE and what was needed to enable debugging. Then, we'll describe the components we upstreamed to GDB and QEMU to make it work.