Showing posts with label debug. Show all posts
Showing posts with label debug. Show all posts

Monday, July 26, 2010

Debugging (a more elegant way)

OK, this way of debugging is more elegant but can't see it working in a real device. So it's only for S60 2nd emulator. Create an empty file in [EPOCROOT]\winscw\c named ErrRd. Please note, no extension.

for example
C:\Symbian\8.1a\S60_2nd_FP3\Epoc32\winscw\c\ErrRd

and there you go. Run your app in emulator, and if there is an error, the emulator will raise a pop up note including the panic code. See the SDK documentation for the explanation of this error. Happy coding.

How to Debug Symbian C++

Hi guys/girls.

Um, this time i would like to share; how to debug your Symbian C++ code. Actually and as the most right and elegant way to do debugging, you need to put a breakpoint to your suspicious code line. But, i don't really like the way Carbide C++ 1.2 do it. So this is my way.

Suppose you have these lines of code

code1;

function1(code1);

code2=code1;


If the application crashed, and you think that function1 is wrong, create globalnote and display it before and after the function1.

code1;

CAknGlobalNote* globalNote = CAknGlobalNote::NewLC();
globalNote->>ShowNoteL(EAknGlobalInformationNote,_L("Before"));

function1(code1);

globalNote->ShowNoteL(EAknGlobalInformationNote,_L("After"));
CleanupStack::PopAndDestroy(globalNote);

code2=code1;


So, if Before message is popped-up but there is no "After" message popped-up, you're right, there is something wrong with function1. Happy coding.

PS: make sure you include aknglobalnote.h at the beginning of your implementation file.

#include
.
.
.