qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH v2 15/20] disas/nanomips: Introduce Dis_info struct


From: Richard Henderson
Subject: Re: [PATCH v2 15/20] disas/nanomips: Introduce Dis_info struct
Date: Mon, 5 Sep 2022 12:55:56 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 9/5/22 10:55, Milica Lazarevic wrote:
This patch introduces the Dis_info struct, which should hold the
necessary data for handling runtime errors. Fields fprintf_func and
stream are in charge of error printing. Field buf enables the use of
sigsetjmp() and siglongjmp() functions. Support for runtime error
handling will be added later.

Parameter m_pc, which we need for address calculation, is integrated
into the Dis_info struct.

We're filling Dis_info at the entrance of the nanoMIPS disassembler,
i.e. print_insn_nanomips. Next, we're adding that information as an
argument wherever we need to.

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

diff --git a/disas/nanomips.cpp b/disas/nanomips.cpp
index 9e34ca164c..5142f307fc 100644
--- a/disas/nanomips.cpp
+++ b/disas/nanomips.cpp
@@ -41,9 +41,16 @@ typedef uint32_t uint32;
  typedef uint16_t uint16;
  typedef uint64_t img_address;
+struct Dis_info {
+  img_address m_pc;
+  fprintf_function fprintf_func;
+  FILE *stream;
+  sigjmp_buf buf;
+};

As mentioned vs patch 3, this structure should be introduced much earlier, which eliminates almost all of this patch. What remains appears to be specific to the next patch, for exception handling, and you would merge this into that.


r~



reply via email to

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