Process call stack frames during failure dispatch.

This commit is contained in:
Bartosz Taudul 2020-09-30 15:57:14 +02:00
parent 641649143c
commit 9d392d2c90
2 changed files with 23 additions and 1 deletions

View File

@ -2989,10 +2989,18 @@ void Worker::DispatchFailure( const QueueItem& ev, const char*& ptr )
switch( ev.hdr.type )
{
case QueueType::SingleStringData:
ptr += sizeof( QueueHeader );
memcpy( &sz, ptr, sizeof( sz ) );
ptr += sizeof( sz );
AddSingleStringFailure( ptr, sz );
ptr += sz;
break;
case QueueType::SecondStringData:
ptr += sizeof( QueueHeader );
memcpy( &sz, ptr, sizeof( sz ) );
ptr += sizeof( sz ) + sz;
ptr += sizeof( sz );
AddSecondString( ptr, sz );
ptr += sz;
break;
default:
ptr += QueueDataSize[ev.hdr.idx];
@ -3003,6 +3011,12 @@ void Worker::DispatchFailure( const QueueItem& ev, const char*& ptr )
m_serverQuerySpaceLeft++;
break;
case QueueType::CallstackFrameSize:
ProcessCallstackFrameSize( ev.callstackFrameSize );
m_serverQuerySpaceLeft++;
break;
case QueueType::CallstackFrame:
ProcessCallstackFrame( ev.callstackFrame, false );
break;
case QueueType::SymbolInformation:
case QueueType::ParamPingback:
m_serverQuerySpaceLeft++;
@ -3542,6 +3556,13 @@ void Worker::AddSingleString( const char* str, size_t sz )
m_pendingSingleString = StoreString( str, sz );
}
void Worker::AddSingleStringFailure( const char* str, size_t sz )
{
// During failure dispatch processing of most events is ignored, but string data
// is still send. Just ignore anything that was already in the staging area.
m_pendingSingleString = StoreString( str, sz );
}
void Worker::AddSecondString( const char* str, size_t sz )
{
assert( m_pendingSecondString.ptr == nullptr );

View File

@ -736,6 +736,7 @@ private:
void AddString( uint64_t ptr, const char* str, size_t sz );
void AddThreadString( uint64_t id, const char* str, size_t sz );
void AddSingleString( const char* str, size_t sz );
void AddSingleStringFailure( const char* str, size_t sz );
void AddSecondString( const char* str, size_t sz );
void AddExternalName( uint64_t ptr, const char* str, size_t sz );
void AddExternalThreadName( uint64_t ptr, const char* str, size_t sz );