From 9a3399a975df99c22c2654ebe501f072ef144272 Mon Sep 17 00:00:00 2001 From: ElectronixTM Date: Sat, 12 Apr 2025 19:33:57 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=20=D1=87=D1=82=D0=B5=D0=BD=D0=B8=D0=B8=20?= =?UTF-8?q?=D0=B8=20=D0=B7=D0=B0=D0=BF=D0=B8=D1=81=D0=B8=20=D1=84=D0=B0?= =?UTF-8?q?=D0=B9=D0=BB=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dp32proto/dbg.json | 98 +++++++++++++++++++++++++++++++++++++ src/dp32proto/dbg_main.py | 2 +- src/dp32proto/dpdebugger.py | 2 +- 3 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 src/dp32proto/dbg.json diff --git a/src/dp32proto/dbg.json b/src/dp32proto/dbg.json new file mode 100644 index 0000000..7524509 --- /dev/null +++ b/src/dp32proto/dbg.json @@ -0,0 +1,98 @@ +{ + "labels": { + "_start": 0, + "_start_return": 9, + "f_fibo": 11, + "f_fibo_loop": 14, + "return": 27, + "result": 28, + "end": 29 + }, + "instructions": { + "0": { + "length": 1, + "srcline": 6 + }, + "1": { + "length": 1, + "srcline": 7 + }, + "2": { + "length": 2, + "srcline": 8 + }, + "4": { + "length": 2, + "srcline": 9 + }, + "6": { + "length": 2, + "srcline": 10 + }, + "8": { + "length": 1, + "srcline": 11 + }, + "9": { + "length": 2, + "srcline": 13 + }, + "11": { + "length": 1, + "srcline": 16 + }, + "12": { + "length": 1, + "srcline": 17 + }, + "13": { + "length": 1, + "srcline": 18 + }, + "14": { + "length": 1, + "srcline": 20 + }, + "15": { + "length": 1, + "srcline": 21 + }, + "16": { + "length": 1, + "srcline": 22 + }, + "17": { + "length": 1, + "srcline": 23 + }, + "18": { + "length": 1, + "srcline": 24 + }, + "19": { + "length": 2, + "srcline": 25 + }, + "21": { + "length": 2, + "srcline": 27 + }, + "23": { + "length": 2, + "srcline": 28 + }, + "25": { + "length": 2, + "srcline": 29 + }, + "27": { + "length": 1, + "srcline": 31 + }, + "28": { + "length": 1, + "srcline": 32 + } + }, + "src": "C:\\Users\\etdia\\code\\dp32-proto\\src\\test.dasm" +} \ No newline at end of file diff --git a/src/dp32proto/dbg_main.py b/src/dp32proto/dbg_main.py index c437d72..0c4d583 100644 --- a/src/dp32proto/dbg_main.py +++ b/src/dp32proto/dbg_main.py @@ -51,7 +51,7 @@ def main(): dbg_dict: DbgDict = parse_dbg(json.load(f)) dbg = Debugger(mem, dbg_dict) - with open (dbg_dict["src"], 'r') as f: + with open (dbg_dict["src"], 'r', encoding="utf8") as f: src = f.read() dbg_tui.run_tui(dbg, src) diff --git a/src/dp32proto/dpdebugger.py b/src/dp32proto/dpdebugger.py index 13c224d..184d3d7 100644 --- a/src/dp32proto/dpdebugger.py +++ b/src/dp32proto/dpdebugger.py @@ -55,7 +55,7 @@ class Debugger: } def __init__(self, mem: bytearray, dbg_dict: DbgDict): - with open(dbg_dict["src"], 'r') as f: + with open(dbg_dict["src"], 'r', encoding="utf8") as f: self._source_lines = f.readlines() self._vm = VM(mem) self._dbg_dict = dbg_dict