From 267f8299ac1fd97430284fa6d44e5e9c6ed26850 Mon Sep 17 00:00:00 2001 From: John Salem Date: Thu, 23 May 2019 20:18:33 -0700 Subject: Diagnostics IPC (#24582) * Initial draft of structs and classes for Diagnostic Server IPC Protocol * Fix some syntax/name issues that weren't getting caught by intellisense in vscode for mac * * Add member checkers for Flatten and GetSize * Split Flatten impl to have a default version for simple, fixed-size structs * * Remove unnecessary abstract class * Add documentation about templates * * Change templating for IpcMessage class to be more limited (only on message creation and payload parsing) * flesh out parse and tryparse * add requirement for non-fixed-size payloads to implement a static TryParse(buffer, bufferlen) * refactor namespace to bottom of file * * moved DiagnosticsIpc namespace into diagnosticprotocol.h to avoid being referenced by debug-pal project * converted diagnostic server to use DiagnosticsIpc code * converted EventPipeProtocolHelper to use DiagnosticsIpc code * made EventPipe end to end use DiagnosticsIpc code * * Add ASSERTs where relevant * Refactor stream ownershpi back to previous way for collect tracing response * * Add contracts where applicable * * Updating GenerateCoreDump code to use new IPC work after rebase * * modify contract in DiagnosticProtocolHelper to be more restrictive * remove comments * Add comment documentation of SFINAE pattern above usage * simplify Has* checks * Fix function resolution for static member check * Add Constructor for rvalue references to IpcMessage * avoid code path that would result in a blocking read on 0 bytes * Fix silly strcmp bug * fix contractin EventPipeProtocolHelper * * Modify header declaration to make static initialization easier * fix type in template code * * Make all messages use Initialize instead of constructor for hydrating themselves, to make error paths easier * * Expand and streamline error model to match spec * Simplify writing error messages to a static function * memory management * *modify function signatures for SFINAE to remove clang warning * * add braces to static initialization to remove clang warnings * * modify IpcMessage::TryParseImpl, to reset the internal data pointer when passing back a reinterpret_cast to prevent double frees on destruction * Add notes on requirement that user free the memory for a payload * * fix bug in TryParse for generateCoreDump * change INT to uint32_t in GenerateCoreDump payloads * Remove unused error code * * rename Miscellaneous command set to Diagnostic * Remove unnecessary command ids in EventPipe * Rename Diagnostic command set to Dump * * Move payload into Holder to simplify cleanup * Add buffer holder to payloads to ensure the buffers are being cleaned up after use * updated Profiler attach to use IPC work after rebase * * Fix typos * Fix placement of ifdefs for profiler helpers * * Fix accidental char hidden in ifdef... * * Add ASSERT to signify we shouldn't be re-using IpcMessages * * fix another typo hidden behind inactive ifdef... * * Change errors to use HRESULTS to increase transparency * fix bug in profiler attach for checking if entire client data is in buffer --- src/pal/prebuilt/inc/corerror.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/pal') diff --git a/src/pal/prebuilt/inc/corerror.h b/src/pal/prebuilt/inc/corerror.h index f8578f182d..3d92d63fd7 100644 --- a/src/pal/prebuilt/inc/corerror.h +++ b/src/pal/prebuilt/inc/corerror.h @@ -228,6 +228,10 @@ #define CORPROF_E_CALLBACK6_REQUIRED EMAKEHR(0x1380) #define CORPROF_E_CALLBACK7_REQUIRED EMAKEHR(0x1382) #define CORPROF_E_REJIT_INLINING_DISABLED EMAKEHR(0x1383) +#define CORDIAGIPC_E_BAD_ENCODING EMAKEHR(0x1384) +#define CORDIAGIPC_E_UNKNOWN_COMMAND EMAKEHR(0x1385) +#define CORDIAGIPC_E_UNKNOWN_MAGIC EMAKEHR(0x1386) +#define CORDIAGIPC_E_UNKNOWN_ERROR EMAKEHR(0x1387) #define SECURITY_E_INCOMPATIBLE_SHARE EMAKEHR(0x1401) #define SECURITY_E_UNVERIFIABLE EMAKEHR(0x1402) #define SECURITY_E_INCOMPATIBLE_EVIDENCE EMAKEHR(0x1403) -- cgit v1.2.3