{
struct btrace_function *bfun;
- bfun = xzalloc (sizeof (*bfun));
+ bfun = XCNEW (struct btrace_function);
bfun->msym = mfun;
bfun->sym = fun;
insn.pc = pc;
insn.size = size;
insn.iclass = ftrace_classify_insn (gdbarch, pc);
+ insn.flags = 0;
ftrace_update_insns (end, &insn);
}
}
+/* Return the btrace instruction flags for INSN. */
+
+static enum btrace_insn_flag
+pt_btrace_insn_flags (const struct pt_insn *insn)
+{
+ enum btrace_insn_flag flags = 0;
+
+ if (insn->speculative)
+ flags |= BTRACE_INSN_FLAG_SPECULATIVE;
+
+ return flags;
+}
+
/* Add function branch trace using DECODER. */
static void
btinsn.pc = (CORE_ADDR) insn.ip;
btinsn.size = (gdb_byte) insn.size;
btinsn.iclass = pt_reclassify_insn (insn.iclass);
+ btinsn.flags = pt_btrace_insn_flags (&insn);
ftrace_update_insns (end, &btinsn);
}
static void
parse_xml_raw (struct gdb_xml_parser *parser, const char *body_text,
- gdb_byte **pdata, unsigned long *psize)
+ gdb_byte **pdata, size_t *psize)
{
struct cleanup *cleanup;
gdb_byte *data, *bin;
- unsigned long size;
- size_t len;
+ size_t len, size;
len = strlen (body_text);
- size = len / 2;
-
- if ((size_t) size * 2 != len)
+ if (len % 2 != 0)
gdb_xml_error (parser, _("Bad raw data size."));
+ size = len / 2;
+
bin = data = xmalloc (size);
cleanup = make_cleanup (xfree, data);
const struct btrace_insn_iterator *end)
{
if (btinfo->insn_history == NULL)
- btinfo->insn_history = xzalloc (sizeof (*btinfo->insn_history));
+ btinfo->insn_history = XCNEW (struct btrace_insn_history);
btinfo->insn_history->begin = *begin;
btinfo->insn_history->end = *end;
gdb_assert (begin->btinfo == end->btinfo);
if (btinfo->call_history == NULL)
- btinfo->call_history = xzalloc (sizeof (*btinfo->call_history));
+ btinfo->call_history = XCNEW (struct btrace_call_history);
btinfo->call_history->begin = *begin;
btinfo->call_history->end = *end;
break;
case ppt_pip:
- printf_unfiltered (("pip %" PRIx64 ""), packet->payload.pip.cr3);
+ printf_unfiltered (("pip %" PRIx64 "%s"), packet->payload.pip.cr3,
+ packet->payload.pip.nr ? (" nr") : (""));
break;
case ppt_tsc:
printf_unfiltered (("ovf"));
break;
+ case ppt_stop:
+ printf_unfiltered (("stop"));
+ break;
+
+ case ppt_vmcs:
+ printf_unfiltered (("vmcs %" PRIx64 ""), packet->payload.vmcs.base);
+ break;
+
+ case ppt_tma:
+ printf_unfiltered (("tma %x %x"), packet->payload.tma.ctc,
+ packet->payload.tma.fc);
+ break;
+
+ case ppt_mtc:
+ printf_unfiltered (("mtc %x"), packet->payload.mtc.ctc);
+ break;
+
+ case ppt_cyc:
+ printf_unfiltered (("cyc %" PRIx64 ""), packet->payload.cyc.value);
+ break;
+
+ case ppt_mnt:
+ printf_unfiltered (("mnt %" PRIx64 ""), packet->payload.mnt.payload);
+ break;
}
}