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.lazare...@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~