Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] gdb, btrace: support libipt v2.2 events
@ 2026-04-30 11:24 Markus Metzger
  2026-04-30 18:11 ` Keith Seitz
  0 siblings, 1 reply; 8+ messages in thread
From: Markus Metzger @ 2026-04-30 11:24 UTC (permalink / raw)
  To: gdb-patches

---
 gdb/btrace.c | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/gdb/btrace.c b/gdb/btrace.c
index 6a8f0f549d1..f9c6f0e5b6a 100644
--- a/gdb/btrace.c
+++ b/gdb/btrace.c
@@ -1597,6 +1597,59 @@ handle_pt_insn_events (struct btrace_thread_info *btinfo,
 	    break;
 	  }
 #endif /* defined (LIBIPT_VERSION >= 0x201) */
+
+#if (LIBIPT_VERSION >= 0x202)
+	case ptev_trig:
+	  {
+	    std::string aux_string = std::string (_("trig: trbv = "))
+	      + hex_string (event.variant.trig.trbv);
+
+	    if (event.variant.trig.mult != 0)
+	      aux_string += std::string (", mult");
+
+	    if (event.ip_suppressed == 0)
+	      {
+		pc = event.variant.trig.ip;
+		aux_string += std::string (", ip = ") + hex_string (*pc);
+	      }
+
+	    if (event.variant.trig.icnt != 0)
+	      aux_string += std::string (", icnt = ")
+		+ hex_string (event.variant.trig.icnt);
+
+	    handle_pt_aux_insn (btinfo, aux_string, pc);
+	    break;
+	  }
+
+	case ptev_swintr:
+	  {
+	    std::string aux_string = std::string (_("swintr: vector = "))
+	      + hex_string (event.variant.swintr.vector);
+
+	    if (event.ip_suppressed == 0)
+	      {
+		pc = event.variant.swintr.ip;
+		aux_string += std::string (", ip = ") + hex_string (*pc);
+	      }
+
+	    handle_pt_aux_insn (btinfo, aux_string, pc);
+	    break;
+	  }
+
+	case ptev_syscall:
+	  {
+	    std::string aux_string = std::string (_("syscall"));
+
+	    if (event.ip_suppressed == 0)
+	      {
+		pc = event.variant.syscall.ip;
+		aux_string += std::string (": ip = ") + hex_string (*pc);
+	      }
+
+	    handle_pt_aux_insn (btinfo, aux_string, pc);
+	    break;
+	  }
+#endif /* (LIBIPT_VERSION >= 0x202) */
 	}
     }
 #endif /* defined (HAVE_PT_INSN_EVENT) */
-- 
2.34.1

Intel Deutschland GmbH
Registered Address: Dornacher Strasse 1, 85622 Feldkirchen, Germany
Tel: +49 89 991 430, www.intel.de
Managing Directors: Harry Demas, Jeffrey Schneiderman, Yin Chong Sorrell
Chairperson of the Supervisory Board: Nicole Lau
Registered Seat: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-05-08  5:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-04-30 11:24 [PATCH] gdb, btrace: support libipt v2.2 events Markus Metzger
2026-04-30 18:11 ` Keith Seitz
2026-05-01 16:39   ` Tom Tromey
2026-05-04  7:16     ` Metzger, Markus T
2026-05-04 16:08       ` Simon Marchi
2026-05-05 13:28       ` Tom Tromey
2026-05-08  5:07         ` Metzger, Markus T
2026-05-04  7:16   ` Metzger, Markus T

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox