qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 15/20] disas/nanomips: Replace exception handling


From: Thomas Huth
Subject: Re: [PATCH 15/20] disas/nanomips: Replace exception handling
Date: Sat, 27 Aug 2022 10:34:00 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0

On 15/08/2022 09.26, Milica Lazarevic wrote:
Since there's no support for exception handling in C, the try-catch
blocks have been deleted, and throw clauses are replaced. When a runtime
error happens, we're printing out the error message. Disassembling of
the current instruction interrupts. This behavior is achieved by adding
sigsetjmp() to discard further disassembling after the error message
prints and by adding the siglongjmp() function to imitate throwing an
error.The goal was to maintain the same output as it was.

Signed-off-by: Milica Lazarevic <milica.lazarevic@syrmia.com>
---
  disas/nanomips.cpp | 135 +++++++++++++++++++++++----------------------
  1 file changed, 69 insertions(+), 66 deletions(-)

diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index 769368a984..a8cd878809 100644
--- a/disas/nanomips.cpp
+++ b/disas/nanomips.cpp
@@ -31,7 +31,6 @@
  #include "disas/dis-asm.h"
#include <string.h>
-#include <stdexcept>
  #include <stdio.h>
  #include <stdarg.h>
@@ -90,6 +89,8 @@ struct Pool { static img_address m_pc;
  static TABLE_ATTRIBUTE_TYPE   m_requested_instruction_categories;
+static struct disassemble_info *disassm_info;
+static jmp_buf j_buf;

I guess this is also not thread-safe? (see also Richard's answer to patch 03/20)

 Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]