LLDB mainline
ConnectionConPTYWindows.cpp File Reference

Go to the source code of this file.

Functions

static bool StripConPTYInitSequences (void *dst, size_t dst_len, size_t &len)
 Strips the ConPTY initialization sequences that Windows unconditionally emits when a process is first attached to a pseudo console.

Function Documentation

◆ StripConPTYInitSequences()

bool StripConPTYInitSequences ( void * dst,
size_t dst_len,
size_t & len )
static

Strips the ConPTY initialization sequences that Windows unconditionally emits when a process is first attached to a pseudo console.

These are emitted by ConPTY's host process (conhost.exe) at process attach time, not by the debuggee. They are always the first bytes on the output pipe and are always present as a contiguous prefix.

Parameters
dstBuffer containing the data read from the ConPTY output pipe. Modified in place: if the initialization sequences are present as a prefix, they are removed by shifting the remaining bytes to the front of the buffer.
dst_lenThe size of dst.
lenOn input, the number of valid bytes in dst. On output, reduced by the number of bytes stripped.
Returns
true if the sequence was found and stripped.

Definition at line 31 of file ConnectionConPTYWindows.cpp.

Referenced by lldb_private::ConnectionConPTY::Read().