Remember whether the system was running before the first debugger
client forced it to pause, and resume only after the final client
disconnects. This prevents a dropped connection or disabled server
from leaving an originally running system paused, while preserving a
pause that predated debugger attachment and avoiding premature resumes
with multiple clients.
Accept the remote protocol's C and S packet forms, including their
optional resume addresses, so GDB can continue or step after reporting
a signal. Validate the signal and address fields completely; signal
delivery itself is intentionally ignored because the emulated
bare-metal target has no inferior process signal mechanism.
Enforce the advertised PacketSize while scanning the receive buffer.
Close clients that exceed the framed packet limit so an unterminated
or oversized request cannot fill the fixed receive buffer and leave
the connection permanently stalled.
Keep the most recently framed RSP reply for each client and resend it
when GDB returns a negative acknowledgement. Build acknowledgement and
reply frames separately so only the reply packet is retained for
protocol recovery.
Expose BufferedStreamSocket's allow-smaller policy through Write while
preserving the existing default for other callers. GDB replies now
require enough queue space for the complete RSP packet and close the
connection instead of silently discarding an unwritten suffix.
Advertise a 16 KiB RSP PacketSize and cap memory reads so their
hex-encoded replies fit within it. This prevents small m packets from
requesting multi-gigabyte allocations and keeps generated replies
within the server's transport capacity.
Invalidate affected emulated instruction-cache lines and translated
RAM code pages after a successful M packet. This ensures debugger
patches and GDB's fallback software breakpoints execute the newly
written instructions instead of stale cached code.
Decode and validate the complete G packet before mutating CPU state,
preserve the zero and read-only BadVaddr registers, and return the
protocol-defined OK response. Apply SR and CAUSE masks and side
effects, and rebuild the instruction pipeline only when PC changes.
Require command payloads, numeric fields, breakpoint kinds, and
checksums to be consumed in full. This prevents valid command prefixes
and partial numeric conversions from accepting trailing garbage while
retaining the protocol-defined breakpoint packet layout.
A checksum-valid packet must be acknowledged even when its command
arguments are malformed. Return an RSP error or unsupported reply from
the affected handlers instead of sending a negative transport ACK,
which caused GDB to retransmit the same valid packet indefinitely.
Record the signal reported by each client's most recent stop reply and
use it when handling the '?' query. Interrupt requests now report
SIGINT while single-step, breakpoint, and other system pauses continue
to report SIGTRAP.
Avoid calling SetPC when an address-qualified continue or single-step
names the CPU's current PC. The next instruction is already prefetched
at that address, and rebuilding the pipeline would incorrectly discard
pending load and branch-delay state.
Honor the optional resume address carried by the remote protocol's
single-step packet. Validate the address and update the CPU through
SetPC before setting the single-step flag so the instruction pipeline
resumes from the requested location.
Route continue packets through the normal checksum-validated command
dispatcher and parse the optional resume address defined by the remote
protocol. Address-qualified continues now update the CPU through SetPC
before resuming instead of being treated as unsupported commands.
Acknowledge step and continue packets when they are received, then send
the eventual stop reply without another leading ACK. This avoids
emitting two acknowledgements for a single resume packet and prevents
external system resumes from producing stray protocol ACKs.
Write each specialization value into packed backing storage and map entries to
that storage instead of leaving zero-initialized data.
Not used anywhere, but was still wrong.
Return complete VkSurfaceFormatKHR entries from the surface query, preserve
color spaces, and only choose an arbitrary format for the single
undefined-format case.
Create the buffer before allocation, intersect both memory-type masks, honor
size and dedicated requirements, and propagate bind failures.
Also require that the memory is coherent, because otherwise we'd have to resort
to architecture-specific cache flush methods. vkInvalidateMappedMemoryRanges()
is only valid on memory mapped by vkMapMemory().
Synchronize the actual offset and full pitched-row span written by image
readbacks, and invalidate the matching allocation range on the host.
Also fix the incorrect source stage.