libraries/ltkutils/src/breakpoint.cpp
changeset 0 7f656887cf89
equal deleted inserted replaced
-1:000000000000 0:7f656887cf89
       
     1 // breakpoint.cpp
       
     2 // 
       
     3 // Copyright (c) 2010 Accenture. All rights reserved.
       
     4 // This component and the accompanying materials are made available
       
     5 // under the terms of the "Eclipse Public License v1.0"
       
     6 // which accompanies this distribution, and is available
       
     7 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 // 
       
     9 // Initial Contributors:
       
    10 // Accenture - Initial contribution
       
    11 //
       
    12 #include <fshell/ltkutils.h>
       
    13 
       
    14 #ifdef __WINS__
       
    15 
       
    16 EXPORT_C void LtkUtils::Breakpoint()
       
    17 	{
       
    18 	__BREAKPOINT()
       
    19 	}
       
    20 
       
    21 #elif defined(__GCCE__) || defined(__GCC32__)
       
    22 
       
    23 // This only gets compiled for GCC-based platforms, hence why it uses __attribute__ and not just __NAKED__
       
    24 #include <u32std.h>
       
    25 
       
    26 EXPORT_C __attribute__((__naked__)) void LtkUtils::Breakpoint()
       
    27 	{
       
    28 	asm(".word 0xE7F123F4 ");
       
    29 	__JUMP(,lr);
       
    30 	}
       
    31 
       
    32 #endif
       
    33 
       
    34 EXPORT_C TLinAddr LtkUtils::BreakpointAddr()
       
    35 	{
       
    36 	return (TLinAddr)&Breakpoint;
       
    37 	}
       
    38 
       
    39 void BreakpointCleanupItem(TAny*)
       
    40 	{
       
    41 	LtkUtils::Breakpoint();
       
    42 	}
       
    43 
       
    44 EXPORT_C void LtkUtils::BreakpointPushL()
       
    45 	{
       
    46 	CleanupStack::PushL(TCleanupItem(&BreakpointCleanupItem, NULL));
       
    47 	}