--- a/persistentstorage/sql/SRC/Client/IPC/IPCBuf.cpp Thu Aug 19 11:36:21 2010 +0300
+++ b/persistentstorage/sql/SRC/Client/IPC/IPCBuf.cpp Tue Aug 31 16:57:14 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of "Eclipse Public License v1.0"
@@ -15,8 +15,13 @@
#include <e32base.h>
#include "IPCBuf.h"
-#include "SqlPanic.h"
+#include "SqlAssert.h"
#include "SqlDbSession.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "IPCBufTraces.h"
+#endif
+#include "SqlTraceDef.h"
/**
Standard, phase-one HIpcBuf factory method.
@@ -75,6 +80,7 @@
TPckg<TIpcStreamBuf> pckg(iBuf);
aArgs.Set(2, &pckg);
__SQLLEAVE_IF_ERROR(iHandle = iSession.SendReceive(aFunction, aArgs));
+ SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, HIPCBUF_CONSTRUCTL, "0x%X;HIpcBuf::ConstructL;iHandle=%d", (TUint)this, iHandle));
TUint8* base = iBuf.iData;
// if reading we already have one buffer-full of data
TInt avail = Max(0, Min(iBuf.iExt, KIpcBufSize));
@@ -100,6 +106,7 @@
*/
HIpcBuf::~HIpcBuf()
{
+ SQL_TRACE_INTERNALS(OstTraceExt2(TRACE_INTERNALS, HIPCBUF_HIPCBUFL2, "0x%X;HIpcBuf::~HIpcBuf;iHandle=%d", (TUint)this, iHandle));
if(iHandle > 0) //iHandle is valid only when > 0.
{
(void)iSession.SendReceive(::MakeMsgCode(ESqlSrvStreamClose, ESqlSrvStreamHandle, iHandle));
@@ -116,7 +123,7 @@
{
return 0;
}
- __SQLASSERT(Avail(ERead) == 0, ESqlPanicInternalError);
+ __ASSERT_DEBUG(Avail(ERead) == 0, __SQLPANIC(ESqlPanicInternalError));
TUint8* base=iBuf.iData;
IpcWriteL(base,Lag(EWrite));
SetBuf(EWrite,base,base);
@@ -131,7 +138,7 @@
*/
void HIpcBuf::OverflowL()
{
- __SQLASSERT(Avail(EWrite) == 0, ESqlPanicInternalError);
+ __ASSERT_DEBUG(Avail(EWrite) == 0, __SQLPANIC(ESqlPanicInternalError));
TUint8* base = iBuf.iData;
MovePos(ERead, Lag(ERead));
@@ -168,9 +175,9 @@
*/
TInt HIpcBuf::DoReadL(TAny* aPtr, TInt aMaxLength)
{
- __SQLASSERT(aMaxLength > 0, ESqlPanicInternalError);
+ __ASSERT_DEBUG(aMaxLength > 0, __SQLPANIC(ESqlPanicInternalError));
TInt avail = Avail(ERead);
- __SQLASSERT(avail >= 0 && Avail(EWrite) >= 0, ESqlPanicInternalError);
+ __ASSERT_DEBUG(avail >= 0 && Avail(EWrite) >= 0, __SQLPANIC(ESqlPanicInternalError));
if(avail > 0)
{
TInt len = Min(aMaxLength, avail);
@@ -181,7 +188,7 @@
if(aMaxLength == 0)
return len; // that's it
}
- __SQLASSERT(Avail(ERead) == 0, ESqlPanicInternalError);
+ __ASSERT_DEBUG(Avail(ERead) == 0, __SQLPANIC(ESqlPanicInternalError));
if(aMaxLength < iBuf.ESize)
return avail + TStreamBuf::DoReadL(aPtr, aMaxLength);
@@ -202,9 +209,9 @@
*/
void HIpcBuf::DoWriteL(const TAny* aPtr,TInt aLength)
{
- __SQLASSERT(aLength > 0, ESqlPanicInternalError);
+ __ASSERT_DEBUG(aLength > 0, __SQLPANIC(ESqlPanicInternalError));
TInt avail = Avail(EWrite);
- __SQLASSERT(Avail(ERead) >= 0 && avail >= 0, ESqlPanicInternalError);
+ __ASSERT_DEBUG(Avail(ERead) >= 0 && avail >= 0, __SQLPANIC(ESqlPanicInternalError));
if(avail > 0)
{
TInt len = Min(aLength, avail);
@@ -215,7 +222,7 @@
aPtr = (TUint8*)aPtr + len;
}
- __SQLASSERT(Avail(EWrite) == 0, ESqlPanicInternalError);
+ __ASSERT_DEBUG(Avail(EWrite) == 0, __SQLPANIC(ESqlPanicInternalError));
if(aLength < iBuf.ESize)
TStreamBuf::DoWriteL(aPtr, aLength);
else
@@ -250,7 +257,7 @@
aOffset += Mark(EWrite);
break;
default:
- __SQLASSERT_ALWAYS(0, ESqlPanicStreamMarkInvalid);
+ __ASSERT_ALWAYS(0, __SQLPANIC(ESqlPanicStreamMarkInvalid));
break;
}
break;
@@ -258,7 +265,7 @@
aOffset += end;
break;
default:
- __SQLASSERT_ALWAYS(0, ESqlPanicStreamLocationInvalid);
+ __ASSERT_ALWAYS(0, __SQLPANIC(ESqlPanicStreamLocationInvalid));
break;
}
TInt r = KErrNone;
@@ -273,7 +280,7 @@
r = KErrEof;
}
- __SQLASSERT_ALWAYS(!(aMark & ~(ERead | EWrite)), ESqlPanicStreamMarkInvalid);
+ __ASSERT_ALWAYS(!(aMark & ~(ERead | EWrite)), __SQLPANIC(ESqlPanicStreamMarkInvalid));
if(aMark & ERead)
{
TInt lag = aOffset - Pos(ERead);
@@ -304,7 +311,7 @@
*/
TInt HIpcBuf::IpcReadL(TAny* aPtr, TInt aMaxLength)
{
- __SQLASSERT(aMaxLength >= 0, ESqlPanicInternalError);
+ __ASSERT_DEBUG(aMaxLength >= 0, __SQLPANIC(ESqlPanicInternalError));
if(aMaxLength == 0)
return 0;
@@ -327,7 +334,7 @@
*/
void HIpcBuf::IpcWriteL(const TAny* aPtr, TInt aLength)
{
- __SQLASSERT(aLength >= 0, ESqlPanicInternalError);
+ __ASSERT_DEBUG(aLength >= 0, __SQLPANIC(ESqlPanicInternalError));
if(aLength == 0)
return;