[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 44/45] target/hppa: Log cpu state at interrupt
From: |
Richard Henderson |
Subject: |
[PATCH 44/45] target/hppa: Log cpu state at interrupt |
Date: |
Wed, 24 Apr 2024 17:00:22 -0700 |
This contains all of the information logged before, plus more.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/hppa/int_helper.c | 27 ++++++++++++++-------------
1 file changed, 14 insertions(+), 13 deletions(-)
diff --git a/target/hppa/int_helper.c b/target/hppa/int_helper.c
index b82f32fd12..391f32f27d 100644
--- a/target/hppa/int_helper.c
+++ b/target/hppa/int_helper.c
@@ -241,21 +241,22 @@ void hppa_cpu_do_interrupt(CPUState *cs)
[EXCP_SYSCALL_LWS] = "syscall-lws",
[EXCP_TOC] = "TOC (transfer of control)",
};
- static int count;
- const char *name = NULL;
- char unknown[16];
- if (i >= 0 && i < ARRAY_SIZE(names)) {
- name = names[i];
+ FILE *logfile = qemu_log_trylock();
+ if (logfile) {
+ const char *name = NULL;
+
+ if (i >= 0 && i < ARRAY_SIZE(names)) {
+ name = names[i];
+ }
+ if (name) {
+ fprintf(logfile, "INT: cpu %d %s\n", cs->cpu_index, name);
+ } else {
+ fprintf(logfile, "INT: cpu %d unknown %d\n", cs->cpu_index, i);
+ }
+ hppa_cpu_dump_state(cs, logfile, 0);
+ qemu_log_unlock(logfile);
}
- if (!name) {
- snprintf(unknown, sizeof(unknown), "unknown %d", i);
- name = unknown;
- }
- qemu_log("INT %6d: %s @ " TARGET_FMT_lx ":" TARGET_FMT_lx
- " for " TARGET_FMT_lx ":" TARGET_FMT_lx "\n",
- ++count, name, env->cr[CR_IIASQ], env->cr[CR_IIAOQ],
- env->cr[CR_ISR], env->cr[CR_IOR]);
}
cs->exception_index = -1;
}
--
2.34.1
- [PATCH 30/45] target/hppa: Use delay_excp for conditional trap on overflow, (continued)
- [PATCH 30/45] target/hppa: Use delay_excp for conditional trap on overflow, Richard Henderson, 2024/04/24
- [PATCH 34/45] target/hppa: Improve hppa_cpu_dump_state, Richard Henderson, 2024/04/24
- [PATCH 36/45] target/hppa: Manage PSW_X and PSW_B in translator, Richard Henderson, 2024/04/24
- [PATCH 21/45] target/hppa: Use TCG_COND_TST* in do_log_cond, Richard Henderson, 2024/04/24
- [PATCH 33/45] target/hppa: Do not mask in copy_iaoq_entry, Richard Henderson, 2024/04/24
- [PATCH 35/45] target/hppa: Split PSW X and B into their own field, Richard Henderson, 2024/04/24
- [PATCH 37/45] target/hppa: Implement PSW_B, Richard Henderson, 2024/04/24
- [PATCH 38/45] target/hppa: Implement PSW_X, Richard Henderson, 2024/04/24
- [PATCH 39/45] target/hppa: Drop tlb_entry return from hppa_get_physical_address, Richard Henderson, 2024/04/24
- [PATCH 41/45] target/hppa: Implement CF_PCREL, Richard Henderson, 2024/04/24
- [PATCH 44/45] target/hppa: Log cpu state at interrupt,
Richard Henderson <=
- [PATCH 43/45] target/hppa: Implement PSW_H, PSW_L, Richard Henderson, 2024/04/24
- [PATCH 42/45] target/hppa: Implement PSW_T, Richard Henderson, 2024/04/24
- [PATCH 45/45] target/hppa: Log cpu state on return-from-interrupt, Richard Henderson, 2024/04/24
- [PATCH 40/45] target/hppa: Adjust priv for B,GATE at runtime, Richard Henderson, 2024/04/24