mess: вернул все назад, потому что это привело к хаосу с зависимостями
Теперь репозиторий очень грязный, но мне правда уже не хочется мучиться с зависимостиями, поэтому пусть будет так
This commit is contained in:
3
src/README.md
Normal file
3
src/README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# почему так грязно?
|
||||
|
||||
Потому что я заколебался воевать с модульностью питона, чтобы сделать это красиво
|
||||
33
src/dbg_main.py
Normal file
33
src/dbg_main.py
Normal file
@ -0,0 +1,33 @@
|
||||
from dpdebugger import Debugger, DbgDict
|
||||
from argparse import ArgumentParser
|
||||
import json
|
||||
|
||||
def parse_dbg(dbg_json_dict: dict) -> DbgDict:
|
||||
instr = dbg_json_dict["instructions"]
|
||||
print(instr)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = ArgumentParser(
|
||||
prog="dp32dbg",
|
||||
description="Bad debugger for DP32 processor"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-m",
|
||||
"--memory",
|
||||
required=True,
|
||||
help="Initial memory for virtual machine"
|
||||
)
|
||||
parser.add_argument(
|
||||
"-d",
|
||||
"--debug-file",
|
||||
required=True,
|
||||
help="JSON with debug information. by default named dbg.json"
|
||||
)
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
with open(args.memory, "rb") as f:
|
||||
mem = bytearray(f.read())
|
||||
with open(args.debug_file, 'r') as f:
|
||||
dbg_dict: DbgDict = parse_dbg(json.load(f))
|
||||
@ -1,5 +0,0 @@
|
||||
def main():
|
||||
print("Hello world!")
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@ -2,6 +2,7 @@
|
||||
Отладчик принимает на вход довольно много всего и пытается вам
|
||||
хоть как-то помочь
|
||||
"""
|
||||
|
||||
from emulator.vm import VM, VMException, Breakpoint, Condition, WORD_SIZE
|
||||
|
||||
from dataclasses import dataclass
|
||||
@ -59,6 +60,7 @@ class Debugger:
|
||||
self._vm = VM(mem)
|
||||
self._dbg_dict = dbg_dict
|
||||
self._breakpoints = set()
|
||||
self.__init_callbacks__()
|
||||
|
||||
def __init_callbacks__(self):
|
||||
self._callbacks_table = {
|
||||
Reference in New Issue
Block a user