Always log the assert locally. Do not report_fault, but
instead include the fact of the fault in the assertion.
Don't bother freeing allocated strings before the abort().
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
target/mips/tcg/sysemu/mips-semi.c | 39 ++++++++++++++----------------
1 file changed, 18 insertions(+), 21 deletions(-)
case UHI_assert:
- GET_TARGET_STRINGS_2(p, gpr[4], p2, gpr[5]);
- printf("assertion '");
- printf("\"%s\"", p);
- printf("': file \"%s\", line %d\n", p2, (int)gpr[6]);
- FREE_TARGET_STRING(p2, gpr[5]);
- FREE_TARGET_STRING(p, gpr[4]);
- abort();
- break;
+ {
+ const char *msg, *file;
+
+ msg = lock_user_string(gpr[4]);
+ if (!msg) {
+ msg = "<EFAULT>";
+ }
+ file = lock_user_string(gpr[5]);
+ if (!file) {
+ file = "<EFAULT>";
+ }
+
+ error_report("UHI assertion \"%s\": file \"%s\", line %d",
+ msg, file, (int)gpr[6]);
+ abort();
+ }
+
default:
error_report("Unknown UHI operation %d", op);
abort();