Changeset 299

Show
Ignore:
Timestamp:
06/02/10 13:53:08 (2 years ago)
Author:
sean
Message:

Added @property where appropriate in core routines (haven't checked core.sync yet).
NOTE: This requires a beta DMD 2.047 compiler to produce working headers.

Added 'get' properties as approproate in core.runtime.

Added some initial header support for stack tracing in Windows.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/import/core/sys/windows/windows.d

    r206 r299  
    5252 
    5353    alias uint DWORD; 
     54    alias ulong DWORD64; 
    5455    alias int BOOL; 
    5556    alias ubyte BYTE; 
     
    11761177} 
    11771178 
     1179enum ADDRESS_MODE 
     1180{ 
     1181    AddrMode1616, 
     1182    AddrMode1632, 
     1183    AddrModeReal, 
     1184    AddrModeFlat 
     1185} 
     1186 
     1187struct ADDRESS 
     1188{ 
     1189    DWORD         Offset; 
     1190    WORD          Segment; 
     1191    ADDRESS_MODE  Mode; 
     1192} 
     1193 
     1194struct ADDRESS64 
     1195{ 
     1196    DWORD64       Offset; 
     1197    WORD          Segment; 
     1198    ADDRESS_MODE  Mode; 
     1199} 
     1200 
     1201struct KDHELP 
     1202{ 
     1203    DWORD       Thread; 
     1204    DWORD       ThCallbackStack; 
     1205    DWORD       NextCallback; 
     1206    DWORD       FramePointer; 
     1207    DWORD       KiCallUserMode; 
     1208    DWORD       KeUserCallbackDispatcher; 
     1209    DWORD       SystemRangeStart; 
     1210    DWORD       ThCallbackBStore; 
     1211    DWORD       KiUserExceptionDispatcher; 
     1212    DWORD       StackBase; 
     1213    DWORD       StackLimit; 
     1214    DWORD[5]    Reserved; 
     1215} 
     1216 
     1217struct KDHELP64 
     1218{ 
     1219    DWORD64     Thread; 
     1220    DWORD       ThCallbackStack; 
     1221    DWORD       ThCallbackBStore; 
     1222    DWORD       NextCallback; 
     1223    DWORD       FramePointer; 
     1224    DWORD64     KiCallUserMode; 
     1225    DWORD64     KeUserCallbackDispatcher; 
     1226    DWORD64     SystemRangeStart; 
     1227    DWORD64     KiUserExceptionDispatcher; 
     1228    DWORD64     StackBase; 
     1229    DWORD64     StackLimit; 
     1230    DWORD64[5]  Reserved; 
     1231} 
     1232 
     1233struct STACKFRAME 
     1234{ 
     1235    ADDRESS     AddrPC; 
     1236    ADDRESS     AddrReturn; 
     1237    ADDRESS     AddrFrame; 
     1238    ADDRESS     AddrStack; 
     1239    PVOID       FuncTableEntry; 
     1240    DWORD[4]    Params; 
     1241    BOOL        Far; 
     1242    BOOL        Virtual; 
     1243    DWORD[3]    Reserved; 
     1244    KDHELP      KdHelp; 
     1245    ADDRESS     AddrBStore; 
     1246} 
     1247 
     1248struct STACKFRAME64 
     1249{ 
     1250    ADDRESS64   AddrPC; 
     1251    ADDRESS64   AddrReturn; 
     1252    ADDRESS64   AddrFrame; 
     1253    ADDRESS64   AddrStack; 
     1254    ADDRESS64   AddrBStore; 
     1255    PVOID       FuncTableEntry; 
     1256    DWORD64[4]  Params; 
     1257    BOOL        Far; 
     1258    BOOL        Virtual; 
     1259    DWORD64[3]  Reserved; 
     1260    KDHELP64    KdHelp; 
     1261} 
     1262 
    11781263enum 
    11791264{ 
  • trunk/src/core/runtime.d

    r297 r299  
    2323 
    2424    extern (C) void rt_setCollectHandler( CollectHandler h ); 
     25    extern (C) CollectHandler rt_getCollectHandler(); 
     26 
    2527    extern (C) void rt_setTraceHandler( TraceHandler h ); 
    2628    extern (C) TraceHandler rt_getTraceHandler(); 
     
    121123     *  true if the runtime is halting. 
    122124     */ 
    123     static bool isHalting() 
     125    static @property bool isHalting() 
    124126    { 
    125127        return rt_isHalting(); 
     
    169171     *  h = The new trace handler.  Set to null to use the default handler. 
    170172     */ 
    171     static void traceHandler( TraceHandler h ) 
     173    static @property void traceHandler( TraceHandler h ) 
    172174    { 
    173175        rt_setTraceHandler( h ); 
     
    175177 
    176178    /** 
    177      * Return the current trace handler 
    178      */ 
    179     static TraceHandler traceHandler() 
     179     * Gets the current trace handler. 
     180     * 
     181     * Returns: 
     182     *  The current trace handler or null if no trace handler is set. 
     183     */ 
     184    static @property TraceHandler traceHandler() 
    180185    { 
    181186        return rt_getTraceHandler(); 
     
    193198     *  h = The new collect handler.  Set to null to use the default handler. 
    194199     */ 
    195     static void collectHandler( CollectHandler h ) 
     200    static @property void collectHandler( CollectHandler h ) 
    196201    { 
    197202        rt_setCollectHandler( h ); 
     203    } 
     204     
     205     
     206    /** 
     207     * Gets the current collect handler. 
     208     * 
     209     * Returns: 
     210     *  The current collect handler or null if no trace handler is set. 
     211     */ 
     212    static @property CollectHandler collectHandler() 
     213    { 
     214        return rt_getCollectHandler(); 
    198215    } 
    199216 
     
    208225     *  h = The new unit tester.  Set to null to use the default unit tester. 
    209226     */ 
    210     static void moduleUnitTester( ModuleUnitTester h ) 
     227    static @property void moduleUnitTester( ModuleUnitTester h ) 
    211228    { 
    212229        sm_moduleUnitTester = h; 
     230    } 
     231     
     232     
     233    /** 
     234     * Gets the current module unit tester. 
     235     * 
     236     * Returns: 
     237     *  The current module unit tester handler or null if no trace handler is 
     238     *  set. 
     239     */ 
     240    static @property ModuleUnitTester moduleUnitTester() 
     241    { 
     242        return sm_moduleUnitTester; 
    213243    } 
    214244 
  • trunk/src/core/thread.d

    r284 r299  
    793793     *  The name of this thread. 
    794794     */ 
    795     final string name() 
     795    final @property string name() 
    796796    { 
    797797        synchronized( this ) 
     
    808808     *  val = The new name of this thread. 
    809809     */ 
    810     final void name( string val ) 
     810    final @property void name( string val ) 
    811811    { 
    812812        synchronized( this ) 
     
    827827     *  true if this is a daemon thread. 
    828828     */ 
    829     final bool isDaemon() 
     829    final @property bool isDaemon() 
    830830    { 
    831831        synchronized( this ) 
     
    846846     *  val = The new daemon status for this thread. 
    847847     */ 
    848     final void isDaemon( bool val ) 
     848    final @property void isDaemon( bool val ) 
    849849    { 
    850850        synchronized( this ) 
     
    861861     *  true if the thread is running, false if not. 
    862862     */ 
    863     final bool isRunning() 
     863    final @property bool isRunning() 
    864864    { 
    865865        if( m_addr == m_addr.init ) 
     
    913913     *  The scheduling priority of this thread. 
    914914     */ 
    915     final int priority() 
     915    final @property int priority() 
    916916    { 
    917917        version( Windows ) 
     
    937937     *  val = The new scheduling priority of this thread. 
    938938     */ 
    939     final void priority( int val ) 
     939    final @property void priority( int val ) 
    940940    { 
    941941        version( Windows ) 
     
    29342934     *  The state of this fiber as an enumerated value. 
    29352935     */ 
    2936     final State state() 
     2936    final @property State state() 
    29372937    { 
    29382938        return m_state; 
  • trunk/src/rt/lifetime.d

    r282 r299  
    942942 * 
    943943 */ 
    944 extern (C) void rt_setCollectHandler(CollectHandler h) 
     944extern (C) void rt_setCollectHandler(CollectHandler h) 
    945945{ 
    946946    collectHandler = h; 
     947} 
     948 
     949 
     950/** 
     951 * 
     952 */ 
     953extern (C) CollectHandler rt_getCollectHandler() 
     954{ 
     955    return collectHandler; 
    947956} 
    948957