diff --git a/repos/os/src/monitor/gdb_stub.h b/repos/os/src/monitor/gdb_stub.h index 1a190be55c..d0c2461fe1 100644 --- a/repos/os/src/monitor/gdb_stub.h +++ b/repos/os/src/monitor/gdb_stub.h @@ -346,7 +346,9 @@ struct qXfer : Command_with_separator static Window from_args(Const_byte_range_ptr const &args) { return { .offset = comma_separated_hex_value(args, 0, 0UL), - .len = comma_separated_hex_value(args, 1, 0UL) }; + /* terminal_crosslink currently buffers 4096 bytes */ + .len = min(comma_separated_hex_value(args, 1, 0UL), + 2048UL) }; } }; diff --git a/repos/os/src/monitor/main.cc b/repos/os/src/monitor/main.cc index 173ce3cc97..435412b39c 100644 --- a/repos/os/src/monitor/main.cc +++ b/repos/os/src/monitor/main.cc @@ -133,14 +133,11 @@ struct Monitor::Main : Sandbox::State_handler, Terminal::Connection &_terminal; void operator () (char const *str) { - for (;;) { - size_t const num_bytes = strlen(str); - size_t const written_bytes = _terminal.write(str, num_bytes); - if (written_bytes == num_bytes) - break; - - str = str + written_bytes; - } + size_t const num_bytes = strlen(str); + size_t const written_bytes = _terminal.write(str, num_bytes); + if (written_bytes != num_bytes) + Genode::warning("Could not send the debug response " + "message completely."); } } _write_fn;