@@ -525,6 +525,15 @@ qemu_plugin_register_vcpu_syscall_ret_cb(qemu_plugin_id_t id,
char *qemu_plugin_insn_disas(const struct qemu_plugin_insn *insn);
+/**
+ * qemu_plugin_insn_symbol() - best effort symbol lookup
+ * @insn: instruction reference
+ *
+ * Return a static string referring to the symbol. This is dependent
+ * on the binary QEMU is running having provided a symbol table.
+ */
+const char *qemu_plugin_insn_symbol(const struct qemu_plugin_insn *insn);
+
/**
* qemu_plugin_vcpu_for_each() - iterate over the existing vCPU
* @id: plugin ID
@@ -233,6 +233,12 @@ char *qemu_plugin_insn_disas(const struct qemu_plugin_insn *insn)
return plugin_disas(cpu, insn->vaddr, insn->data->len);
}
+const char *qemu_plugin_insn_symbol(const struct qemu_plugin_insn *insn)
+{
+ const char *sym = lookup_symbol(insn->vaddr);
+ return sym[0] != 0 ? sym : NULL;
+}
+
/*
* The memory queries allow the plugin to query information about a
* memory access.