summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabien Chouteau <chouteau@adacore.com>2017-08-26 09:15:51 +0100
committerChris Johns <chrisj@rtems.org>2017-08-29 18:05:13 +1000
commit05b4cfbfc12782ac1d21c531cf773cf8e94fb0ab (patch)
treea5a80af8420e2ac402e879fbac8f6d8d011d9d2d
parentrtemstoolkit/host.py: Change option to search parent directory in Python3. (diff)
downloadrtems-tools-05b4cfbfc12782ac1d21c531cf773cf8e94fb0ab.tar.bz2
covoar/qemu-traces.h: Change to match current couverture-qemu file.
-rw-r--r--tester/covoar/qemu-traces.h76
1 files changed, 39 insertions, 37 deletions
diff --git a/tester/covoar/qemu-traces.h b/tester/covoar/qemu-traces.h
index 7e37840..1b3d118 100644
--- a/tester/covoar/qemu-traces.h
+++ b/tester/covoar/qemu-traces.h
@@ -1,7 +1,7 @@
/*
* QEMU System Emulator
*
- * Copyright (C) 2009, AdaCore
+ * Copyright (C) 2009-2011, AdaCore
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -23,7 +23,7 @@
*/
/*
- * Qemu trace file format.
+ * QEMU trace file format.
* It requires proper definition for uintXX_t where XX is 8, 16, 32 and 64
* and target_ulong (32 or 64 bits).
*/
@@ -31,13 +31,10 @@
#ifndef QEMU_TRACE_H
#define QEMU_TRACE_H
-/* XXX really not always right */
-/* XXX Added for covoar so this compiles */
-typedef uint32_t target_ulong;
+
/* File header definition. */
-struct trace_header
-{
+struct trace_header {
char magic[12];
#define QEMU_TRACE_MAGIC "#QEMU-Traces"
@@ -46,10 +43,10 @@ struct trace_header
/* File kind. */
uint8_t kind;
-#define QEMU_TRACE_KIND_RAW 0
-#define QEMU_TRACE_KIND_HISTORY 1
-#define QEMU_TRACE_KIND_INFO 2
-#define QEMU_TRACE_KIND_DECISION_MAP 3
+#define QEMU_TRACE_KIND_RAW 0
+#define QEMU_TRACE_KIND_HISTORY 1
+#define QEMU_TRACE_KIND_INFO 2
+#define QEMU_TRACE_KIND_DECISION_MAP 3
#define QEMU_TRACE_KIND_CONSOLIDATED 248
/* Sizeof (target_pc). Indicates struct trace_entry length. */
@@ -66,27 +63,27 @@ struct trace_header
};
/* Header is followed by trace entries. */
-struct trace_entry
-{
- target_ulong pc;
+struct trace_entry {
+ /* FIXME: import target_ulong */
+ /* target_ulong pc; */
+ uint32_t pc;
+
uint16_t size;
- uint8_t op;
+ uint8_t op;
};
-struct trace_entry32
-{
+struct trace_entry32 {
uint32_t pc;
uint16_t size;
- uint8_t op;
- uint8_t _pad[1];
+ uint8_t op;
+ uint8_t _pad[1];
};
-struct trace_entry64
-{
+struct trace_entry64 {
uint64_t pc;
uint16_t size;
- uint8_t op;
- uint8_t _pad[5];
+ uint8_t op;
+ uint8_t _pad[5];
};
/*
@@ -94,26 +91,31 @@ struct trace_entry64
*/
/* _BLOCK means pc .. pc+size-1 was executed. */
-#define TRACE_OP_BLOCK 0x10 /* Block fully executed. */
-#define TRACE_OP_FAULT 0x20 /* Fault at pc. */
-#define TRACE_OP_DYN 0x40 /* Dynamic branch. */
-#define TRACE_OP_BR0 0x01 /* Branch taken "in direction 0". */
-#define TRACE_OP_BR1 0x02 /* Branch taken "in direction 1". */
-#define TRACE_OP_BR2 0x04
-#define TRACE_OP_BR3 0x08
+#define TRACE_OP_BLOCK 0x10 /* Block fully executed. */
+#define TRACE_OP_FAULT 0x20 /* Fault at pc. */
+#define TRACE_OP_BR0 0x01 /* Branch 0 taken at pc. */
+#define TRACE_OP_BR1 0x02
+
+#define TRACE_OP_SPECIAL 0x80 /* Special info in trace file. */
+/* Special operations (in size). */
+#define TRACE_SPECIAL_LOADADDR 0x1 /* Module loaded at PC. */
+
+/* Only used internally in cpu-exec.c. */
+#define TRACE_OP_HIST_SET 0x100 /* Set in the map file. */
+#define TRACE_OP_HIST_CACHE 0x200 /* Has already been searched. */
/*
* Decision map operations
*/
-#define TRACE_OP_TRACE_CONDITIONAL 1
+
/* Trace conditional jump instruction at address */
+#define TRACE_OP_TRACE_CONDITIONAL 1
extern struct trace_entry *trace_current;
-extern int tracefile_enabled;
-extern int tracefile_nobuf;
-extern int tracefile_history;
-
-void trace_init (const char *optarg);
-void trace_push_entry (void);
+extern int tracefile_enabled;
+void trace_init(const char *optarg);
+void trace_cleanup(void);
+void trace_push_entry(void);
+void trace_special(uint16_t subop, uint32_t data);
#endif /* QEMU_TRACE_H */