|
|
| 137 |
|
137 |
|
| 138 |
#endif /* NS3_DEBUG_ENABLE */ |
138 |
#endif /* NS3_DEBUG_ENABLE */ |
| 139 |
|
139 |
|
|
|
140 |
|
| 141 |
/* Hacker macro to place breakpoints for selected machines. |
| 142 |
* Actual use is strongly discouraged of course ;) |
| 143 |
* Copied from GLib 2.12.9. |
| 144 |
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald |
| 145 |
* |
| 146 |
* Modified by the GLib Team and others 1997-2000. See the AUTHORS |
| 147 |
* file for a list of people on the GLib Team. See the ChangeLog |
| 148 |
* files for a list of changes. These files are distributed with |
| 149 |
* GLib at ftp://ftp.gtk.org/pub/gtk/. |
| 150 |
*/ |
| 151 |
|
| 152 |
/** |
| 153 |
* \ingroup debugging |
| 154 |
* |
| 155 |
* Inserts a breakpoint instruction (or equivalent system call) into |
| 156 |
* the code for selected machines. |
| 157 |
*/ |
| 158 |
#if (defined (__i386__) || defined (__x86_64__)) && defined (__GNUC__) && __GNUC__ >= 2 |
| 159 |
# define NS_DEBUG_BREAKPOINT() \ |
| 160 |
do{ __asm__ __volatile__ ("int $03"); }while(false) |
| 161 |
#elif defined (_MSC_VER) && defined (_M_IX86) |
| 162 |
# define NS_DEBUG_BREAKPOINT() \ |
| 163 |
do{ __asm int 3h }while(false) |
| 164 |
#elif defined (__alpha__) && !defined(__osf__) && defined (__GNUC__) && __GNUC__ >= 2 |
| 165 |
# define NS_DEBUG_BREAKPOINT() \ |
| 166 |
do{ __asm__ __volatile__ ("bpt"); }while(false) |
| 167 |
#else /* !__i386__ && !__alpha__ */ |
| 168 |
# define NS_DEBUG_BREAKPOINT() ns3::AssertBreakpoint () |
| 169 |
#endif |
| 170 |
|
| 140 |
#endif /* DEBUG_H */ |
171 |
#endif /* DEBUG_H */ |