VirtualBox

Changeset 938 in vbox for trunk/include/iprt/assert.h


Ignore:
Timestamp:
Feb 15, 2007 9:00:36 PM (18 years ago)
Author:
vboxsync
Message:

Use RTAssertDoBreakpoint everywhere. (part II)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/assert.h

    r1 r938  
    4141# ifdef __GNUC__
    4242#  ifndef __L4ENV__
    43 #   define AssertBreakpoint()   do { __asm__ __volatile__ ("int3\n\tnop"); } while (0)
     43#   define AssertBreakpoint()   do { if (RTAssertDoBreakpoint()) { __asm__ __volatile__ ("int3\n\tnop"); } } while (0)
    4444#  else
    45 #   define AssertBreakpoint()   do { __asm__ __volatile__ ("int3; jmp 1f; 1:"); } while (0)
     45#   define AssertBreakpoint()   do { if (RTAssertDoBreakpoint()) { __asm__ __volatile__ ("int3; jmp 1f; 1:"); } } while (0)
    4646#  endif
     47# elif defined(_MSC_VER)
     48#  define AssertBreakpoint()    do { if (RTAssertDoBreakpoint()) { __debugbreak(); } } while (0)
    4749# else
    48 #  ifdef IN_RING0
    49 #   define AssertBreakpoint()   do { if (RTAssertDoBreakpoint()) __debugbreak(); } while (0)
    50 #  else
    51 #   define AssertBreakpoint()   __debugbreak()
    52 #  endif
     50#  error "Unknown compiler"
    5351# endif
    5452#else
     
    484482#  define AssertReleaseBreakpoint()   do { __asm__ __volatile__ ("int3; jmp 1f; 1:"); } while (0)
    485483# endif
    486 #else
     484#elif defined(_MSC_VER)
    487485# define AssertReleaseBreakpoint()      __debugbreak()
     486#else
     487# error "Unknown compiler"
    488488#endif
    489489
     
    10851085
    10861086/**
    1087  * Check if we really want to hit a breakpoint.
    1088  * Can jump back to ring-3 when the longjmp is armed.
    1089  */
    1090 RTDECL(bool) RTAssertDoBreakpoint(void);
     1087 * Overridable function that decides whether assertions executes the breakpoint or not.
     1088 *
     1089 * The generic implementation will return true.
     1090 *
     1091 * @returns true if the breakpoint should be hit, false if it should be ignored.
     1092 * @remark  The RTDECL() makes this a bit difficult to override on windows. Sorry.
     1093 */
     1094RTDECL(bool)    RTAssertDoBreakpoint(void);
     1095
    10911096
    10921097/** The last assert message, 1st part. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette