greenplumn CSerializableStackTrace 源码
greenplumn CSerializableStackTrace 代码
文件路径:/src/backend/gporca/libgpopt/src/minidump/CSerializableStackTrace.cpp
//---------------------------------------------------------------------------
// Greenplum Database
// Copyright (C) 2012 EMC Corp.
//
// @filename:
// CSerializableStackTrace.cpp
//
// @doc:
// Serializable stack trace object
//---------------------------------------------------------------------------
#include "gpopt/minidump/CSerializableStackTrace.h"
#include "gpos/base.h"
#include "gpos/error/CErrorContext.h"
#include "gpos/task/CTask.h"
#include "naucrates/dxl/CDXLUtils.h"
#include "naucrates/dxl/xml/CDXLSections.h"
#define GPOPT_MINIDUMP_BUF_SIZE (1024 * 4)
using namespace gpos;
using namespace gpopt;
using namespace gpdxl;
//---------------------------------------------------------------------------
// @function:
// CSerializableStackTrace::CSerializableStackTrace
//
// @doc:
// Ctor
//
//---------------------------------------------------------------------------
CSerializableStackTrace::CSerializableStackTrace() : CSerializable()
{
}
//---------------------------------------------------------------------------
// @function:
// CSerializableStackTrace::~CSerializableStackTrace
//
// @doc:
// Dtor
//
//---------------------------------------------------------------------------
CSerializableStackTrace::~CSerializableStackTrace() = default;
//---------------------------------------------------------------------------
// @function:
// CSerializableStackTrace::Serialize
//
// @doc:
// Serialize contents into provided stream
//
//---------------------------------------------------------------------------
void
CSerializableStackTrace::Serialize(COstream &oos)
{
if (!ITask::Self()->HasPendingExceptions())
{
// no pending exception: no need to serialize stack trace
return;
}
WCHAR wszStackBuffer[GPOPT_MINIDUMP_BUF_SIZE];
CWStringStatic str(wszStackBuffer, GPOS_ARRAY_SIZE(wszStackBuffer));
str.AppendFormat(CDXLSections::m_wszStackTraceHeader);
CErrorContext *perrctxt = CTask::Self()->ConvertErrCtxt();
perrctxt->GetStackDescriptor()->AppendTrace(&str);
str.AppendFormat(CDXLSections::m_wszStackTraceFooter);
oos << wszStackBuffer;
}
// EOF
相关信息
相关文章
greenplumn CMetadataAccessorFactory 源码
greenplumn CMinidumperUtils 源码
greenplumn CSerializableMDAccessor 源码
greenplumn CSerializableOptimizerConfig 源码
0
赞
热门推荐
-
2、 - 优质文章
-
3、 gate.io
-
8、 golang
-
9、 openharmony
-
10、 Vue中input框自动聚焦