How to view all descriptor types (and others) in VC6 debugger

in

While CodeWarrior and/or Borland have now become Symbians IDE's of choice, there are still some stubborn people (myself included!) that simply prefer MSDEV for development.

Though MSDEV is fine, it lacks the ability to display Descriptors, which can be a pain. A workaround is presented here, however this method also has a limitation.

The method presented above works fine for the concrete descriptor types, TBuf etc, but will only display the length when using the base classes, TDes or TDesC.

Viewing TDes and other descriptors

Using a little MSDEV knowledge we can overcome this by creating an addon DLL to display descriptor data. The DLL, ShowDes.dll (attached), must first be copied to :

\Microsoft Visual Studio\Common\MSDev98\Bin\

Next, we modify AUTOEXP.DAT to use this DLL. This change should be added in the [AutoExpand] section:

TDesC16=$ADDIN(ShowDes.dll,TDesC16_View)
TDesC8=$ADDIN(ShowDes.dll,TDesC8_View)

Once done, restart MSDEV for the changes to take effect.

This instructs MSDEV to call the TDesC16_View export of ShowDes.dll when viewing a TDesC16 or TDesC8_View when viewing a TDesC8. TDesC16_View and TDesC8_View extract the data, and return it to the debugger. This will correctly display both concreate (TBuf etc) and abstract (TDes/TDesC) descriptors in the debugger, along with their current length and max legnth (if they are non-constant).

Viewing Basic Symbian OS Structure

While we are modifying AutoExp.dat, we can add some other lines to aid Symbian Debugging - again, in the [AutoExpand] section:

TInt64 =low=<iLow> high=<iHigh>
TDateTime =day(zero based)=<iDay> mth=<iMonth> yr=<iYear> hr=<iHour> min=<iMinute> sec=<iSecond>.<iMicroSecond>
CActive= iIsActive=<iActive>
CArrayFixBase= iCount=<iCount>
CArrayVarBase= iCount=<iCount>
CBase= <,t>
RHandleBase= <iHandle,x> <,t>
RRegion= Rects=<iCount> Err=<iError> iTl.iX=<iRectangleList->iTl.iX> iTl.iY=<iRectangleList->iTl.iY> iBr.iX=<iRectangleList->iBr.iX> iBr.iY=<iRectangleList->iBr.iY>
TChar=<iChar> <iChar,c>
TLex8= iNext=<iNext,s>
TLex16= iNext=<iNext,su>
TPoint= iX=<iX> iY=<iY>
TRect= iTl.iX=<iTl.iX> iTl.iY=<iTl.iY> iBr.iX=<iBr.iX> iBr.iY=<iBr.iY>
TRegion= numRects=<iCount> Err=<iError>
TRequestStatus= <iStatus>
TSize= iWidth=<iWidth> iHeight=<iHeight>
TTime= iLow=<iTime.iLow,x> iHigh=<iTime.iHigh,x>
TTimeIntervalBase= <iInterval,d> <,t>
TUid= iUid=<iUid>
TStreamId= iVal=<iVal>
TMargins= iLeft=<iLeft> iRight=<iRight> iTop=<iTop> iBottom=<iBottom>
TPageSpec= iOrientation=<iOrientation>
TRgb= R=<iValue&0xff> G=<iValue/256%256)> B=<iValue/65536>
TPointerEvent=iType=<iType>, iPos.iX=<iPosition.iX>, iPos.iY=<iPosition.iY>
TCellRef=iRow=<iRow>, iCol=<iCol>
TRangeRef=iFrom.iRow=<iFrom.iRow>, iFrom.iCol=<iFrom.iCol>, iTo.iRow=<iTo.iRow>, iTo.iCol=<iTo.iCol>
CCoeControl= iPosition=(<iPosition.iX>,<iPosition.iY>) iSize=(<iSize.iWidth>,<iSize.iHeight>)

These expand several Symbian clases in the debugger automatically. The result:

Example.jpg

No step in TRAP macros

Finally, we can avoid the annoying way MSDEV steps into TRAP macros:

[ExecutionControl]
TTrap::*=NoStepInto

Adding this line prevents stepping into any method from TTrap - including TTrap::Trap used for TRAP(D).

Download

ShowDes.zip
ShowDes.zip


How to view all descriptor types (and others) in VC6 debugger

thanks for this article. could you please tell me how to show descriptor types in VC .net.

thanks in advance

How to view all descriptor types (and others) in VC6 debugger

in the smiliar way you can add auto-expand support for descriptors in VS2003. You just need to modify autoexp.dat file under

Microsoft Visual Studio .NET 2003\Common7\Packages\Debugger\autoexpand.dat

How to view all descriptor types (and others) in VC6 debugger

Use this dll in vs 2003.net does not work at all. Add this dll will cause .net no debug?