aboutsummaryrefslogtreecommitdiff
path: root/contrib/plugins/execlog.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/plugins/execlog.c')
-rw-r--r--contrib/plugins/execlog.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c
index d67d010..811f320 100644
--- a/contrib/plugins/execlog.c
+++ b/contrib/plugins/execlog.c
@@ -95,6 +95,7 @@ static void insn_check_regs(CPU *cpu)
g_byte_array_set_size(reg->new, 0);
sz = qemu_plugin_read_register(reg->handle, reg->new);
+ g_assert(sz > 0);
g_assert(sz == reg->last->len);
if (memcmp(reg->last->data, reg->new->data, sz)) {
@@ -232,12 +233,15 @@ static void vcpu_tb_trans(qemu_plugin_id_t id, struct qemu_plugin_tb *tb)
*/
if (disas_assist && rmatches) {
check_regs_next = false;
- gchar *args = g_strstr_len(insn_disas, -1, " ");
- for (int n = 0; n < all_reg_names->len; n++) {
- gchar *reg = g_ptr_array_index(all_reg_names, n);
- if (g_strrstr(args, reg)) {
- check_regs_next = true;
- skip = false;
+ g_auto(GStrv) args = g_strsplit_set(insn_disas, " \t", 2);
+ if (args && args[1]) {
+ for (int n = 0; n < all_reg_names->len; n++) {
+ const gchar *reg = g_ptr_array_index(all_reg_names, n);
+ if (g_strrstr(args[1], reg)) {
+ check_regs_next = true;
+ skip = false;
+ break;
+ }
}
}
}