diff options
| author | Alejandro Soto <alejandro@34project.org> | 2023-10-06 06:09:32 -0600 |
|---|---|---|
| committer | Alejandro Soto <alejandro@34project.org> | 2023-10-06 06:10:00 -0600 |
| commit | fac14c8c03592f101d34116cb8ecde908e92c18b (patch) | |
| tree | c230e0b17775677674d02aa40be085d685d37fed /sim/gdbstub.py | |
| parent | 5f1981c3d481a25e83bdaf55c300785be4d90b0d (diff) | |
sim/gdbstub: check if kernel files exist
Diffstat (limited to 'sim/gdbstub.py')
| -rw-r--r-- | sim/gdbstub.py | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/sim/gdbstub.py b/sim/gdbstub.py index 88477be..bf902f2 100644 --- a/sim/gdbstub.py +++ b/sim/gdbstub.py @@ -1,8 +1,12 @@ -import sys, socket, traceback +import os.path, sys, socket, traceback -loads = {0x0100000: 'build/uImage', - 0x1000000: 'build/initrd.img', - } +loads = {} + +if os.path.exists('build/uImage'): + loads[0x0100000] = 'build/uImage' + +if os.path.exists('build/initrd.img'): + loads[0x1000000] = 'build/initrd.img' cycles = None enable_tty = True @@ -24,14 +28,14 @@ def fatal(): stop_reason = 'fatal' yield_to_gdb() -def do_output(text): - if text is None: - return not is_halted() - elif not client: - return False +#def do_output(text): +# if text is None: +# return not is_halted() +# elif not client: +# return False - reply(b'O' + hexout(text.encode('ascii'))) - return True +# reply(b'O' + hexout(text.encode('ascii'))) +# return True buffer = b'' stop_reason = None |
