Sends a composed message to the UI window, tolerating a dead peer: the user can close the window at any moment, and a failed send must never let an exception cross the extern "C" bridge API into the debugger's Python interpreter -- libc++abi would terminate the whole debugger. The message is dropped; the next debugger stop relaunches the window (see start()'s stale-client reset). Caught as the bas
| 246 | // std::runtime_error for the same shared-library visibility reason as in |
| 247 | // try_read_incoming_messages below. |
| 248 | void send_to_window(const oid::MessageComposer& message_composer) const { |
| 249 | try { |
| 250 | message_composer.send(*client_); |
| 251 | } catch (const std::runtime_error& e) { |
| 252 | std::cerr << "[OpenImageDebugger] could not reach the OID window " |
| 253 | "(closed?); message dropped: " |
| 254 | << e.what() << std::endl; |
| 255 | } |
| 256 | } |
| 257 | |
| 258 | void try_read_incoming_messages(const int msecs = 3000) { |
| 259 | if (client_ == nullptr) { |