Professional Documents
Culture Documents
CnDebugger接口帮助文档
CnDebugger接口帮助文档
http://www.cnpack.org
CnDebugger
Blue++(zy_hon@hotmail.com )
(liuxiao@cnpack.org)
CnPack
V0.1.0.7
2006.09.05
2008.05.01
1) CnDebugger
CnDebug
CnDebugger
CnDebugger
CnDebugger
Msg
Level
LevelLevel Level 2
2 Level 2 Level 0 3
3 Level
MsgType
Tag 8
CnDebugger CnDebug.pas initialization finalization
2) CnDebug.pas
CnDebug.pas
USE_JCL CnDebug.pas
JCL JCL JCL CnDebug.pas
JCL Include TD32 debug Info
MapFile
CnDebug.pas RTTI
SUPPORT_EVALUATE CnPack
CnPropSheetFrm.pas
3) C++Builder CnDebug.pas
4) CnDebug.pas
CnDebug.pas CnDebugViewer
CnDebugViewer CnDebug.pas CnDebugViewer
2 CnDebugger
1) CnDebugger
CnDebugger
LogMsg LogMsgWarning LogColor LogStrings
LogEnter/TraceEnterLogLeave/TraceLeave
RTTI
Exception
implementation uses CnDebug Project Options
Conditional Defines DEBUG CnDebugger
Log/Trace
CnDebugger Log Trace
Log DEBUG Trace
NDEBUG
Log DEBUG
Trace
NDEBUG
CnDebug.pas RTTI
SUPPORT_EVALUATESUPPORT_EVALUATE NDEBUG
UNDEF
CnDebug.pas
DUMP_TO_FILE
CnDebugDump.cddDUMP_TO_FILE NDEBUG
UNDEF
DEBUG Project Options
2)
CnDebug.pas
3)
4)
procedure StartDebugViewer;
Debug Viewer CnDebugViewer.exe
1. const AMsg: string;
2. const ATag: string;
procedure LogSeparator;
procedure LogLastError;
1. Color: TColor;
2. const AMsg: string;
1. Point: TPoint; TPoint
2. const AMsg: string;
1. const AFormat: string;
2. Args: array of const;
3. ALevel: Integer;
procedure TraceSeparator;
procedure TraceLastError;
1. Value: Integer;
2. const AMsg: string;
1. AComponent: TComponent;
3 CnDebug.pas Channel
CnDebug.pas TCnDebugChannel
TCnDebugChannel CnDebugger Viewer
CnDebug.pas TCnMapFileChannel
CnDebugViewer
TCnMapFileChannel CnDebugViewer
CnDebug.pas
var
CnDebugChannelClass: TCnDebugChannelClass = TCnMapFileChannel;
CnDebugChannelClass := TMyChannel;
TCnDebugChannel
TCnDebugChannel
TCnDebugChannel = class(TObject)
{* Channel }
private
FAutoFlush: Boolean;
FActive: Boolean;
procedure SetAutoFlush(const Value: Boolean);
protected
procedure SetActive(const Value: Boolean); virtual;
// Active
function CheckReady: Boolean; virtual;
//
procedure UpdateFlush; virtual;
// AutoFlush
public
constructor Create(IsAutoFlush: Boolean = True); virtual;
//
procedure StartDebugViewer; virtual;
// Debug Viewer
{$NODEFINE TCnMsgAnnex}
TCnMsgAnnex = packed record
{* }
Level: Integer; // Level
MsgType: DWORD; //
MsgCPInterval: DWORD; // CPU
TimeStampType: DWORD; //
case Integer of
1: (MsgDateTime: TDateTime); //
DateTime
2: (MsgTickCount: DWORD); //
TickCount
3: (MsgCPUPeriod: Int64); // CPU
end;
{$NODEFINE TCnMsgDesc}
{$NODEFINE PCnMsgDesc}
TCnMsgDesc = packed record
{* }
Length: Integer; //
Annex: TCnMsgAnnex; //
CnDebug
CnDebugViewer
CnDebugger protected InternalOutputMsg
Channel SendContent
CnDebug.pas