[ppc64le] Use skip_entrypoint for skip_trampoline_code
[deliverable/binutils-gdb.git] / gdb / btrace.c
index 94942f4a490347f18afc661505eea525da65a8c5..e205ea867c4e318009f0a36a0b197452e32c90dc 100644 (file)
@@ -193,7 +193,7 @@ ftrace_new_function (struct btrace_function *prev,
 {
   struct btrace_function *bfun;
 
-  bfun = xzalloc (sizeof (*bfun));
+  bfun = XCNEW (struct btrace_function);
 
   bfun->msym = mfun;
   bfun->sym = fun;
@@ -660,6 +660,7 @@ btrace_compute_ftrace_bts (struct thread_info *tp,
          insn.pc = pc;
          insn.size = size;
          insn.iclass = ftrace_classify_insn (gdbarch, pc);
+         insn.flags = 0;
 
          ftrace_update_insns (end, &insn);
 
@@ -725,6 +726,19 @@ pt_reclassify_insn (enum pt_insn_class iclass)
     }
 }
 
+/* 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
@@ -792,6 +806,7 @@ ftrace_add_pt (struct pt_insn_decoder *decoder,
          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);
        }
@@ -2181,7 +2196,7 @@ btrace_set_insn_history (struct btrace_thread_info *btinfo,
                         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;
@@ -2197,7 +2212,7 @@ btrace_set_call_history (struct btrace_thread_info *btinfo,
   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;
This page took 0.024719 seconds and 4 git commands to generate.