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;
+};