×
Namespaces

Variants
Actions

Debugging leaves

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Translated:
By alones
Last edited: hamishwillee (19 Oct 2011)


Original (Russian): Отладка сброса (leave)


Debugging Leave situations might be tedious. It would be much easier if the debugger could catch leaves and break the code execution. Luckily, there is a way to achieve it:

#define __LEAVE_IF_ERR(_c) TInt32 __reason = _c;       \
if (__reason < 0) { \
__BREAKPOINT(); \
User::Leave(__reason); \
}

The usage of this macro is similar to using User::LeaveIfError(), e.g. __LEAVE_IF_ERR(iFs.Connect()).

This page was last modified on 19 October 2011, at 08:22.
61 page views in the last 30 days.
×