STRIDE 3.0.01xx: Difference between revisions

From STRIDE Wiki
Jump to navigation Jump to search
Line 144: Line 144:
* Fixed a compiler warning in srmem.c.
* Fixed a compiler warning in srmem.c.
* Fixed a potential data abort issue when executing delegate code in the IM prior to Runtime being initialized.
* Fixed a potential data abort issue when executing delegate code in the IM prior to Runtime being initialized.
* Fixed a compiler warning in srcgutil.h.


*'' The following Runtime files have been modified:
*'' The following Runtime files have been modified:

Revision as of 00:43, 21 June 2008

Release Notes

This page documents the changes in STRIDE version 3.0.0101 (code name StoneSteps).

Please review this information before upgrading from an earlier version.

What's New

Build Tools

A set of new command line build tools has been implemented:

  • Stride compiler
  • Stride database binder
  • Stride instrumantation generator

These utilities has been ported for Windows and Linux. Using them would allow seamless integration with "make" like build environment.

Target-Based Testing

The Target-based testing has been expanded with a new pragma scl_test_flist(). When included in the source code the compiler and the IM generator will automatically create test harnessing code.

On a higher level the test pragmas (scl_test_class and scl_test_flist) has been grouped in Test Units category. A new TestUnits collection has been added to AutoScript.

The automation components STRIDE.testclass, STRIDE.testunit and STRIDE.testfunction are removed.

Runtime/PAL

Based on customer requirements, in this release we have made significant changes to STRIDE Runtime and PAL.

Multi-Process Targets

New routines and support have been added to Runtime and PAL to support multi-process target. Changes include implementation of memory management and shared memory, protecting using named Mutex objects, synchronization of multiple processors and multiple threads, and usage of current process and thread IDs.

Logging (Optional)

Runtime and PAL use a logging routine that can optionally be implemented in PAL.

Windows Off-Target SDK

A new SDK for implemention of Off-Target applications on Windows has been packaged. It contains prebuild in a library (s2srWin.dll/lib) Windows PAL, Runtime, and GRS and a set of utility scripts.

The s2shostapphrt libriary, a prebuild verion of the Host Runtime, has been removed. Building Windows applications using the Host Runtime is not supported anymore. The s2shostapptrt libriary, a prebuild version of the Target Runtime, has been removed.

If an upgrade is performed it is srongly recommented that the above mentioned s2shostapp* libraries and the their public API header (hostapp.h) be manually removed.

Change Details

Fixes

This section describes defects which have been corrected in STRIDE and the customer tracking number associated with them, if any, in brackets [].

  • [1055] Not able to specifiy uppercase include directory
  • [1543] IM source file locations added to studio UI and automation
  • [1586] Support for Variadic Macros
  • [1597] EDGFront crash for scl_ptr_opaque
  • [1600] Pre-processor treats constant 1 always as 8-bit

AutoScript

TestUnits Collection

A new TestUnits collection has been implemented. All test interfaces (specified with scl_test_class and scl_test_flist) will be listed there.

Functions Collection

Interfaces specified with scl_test_class pragma are not listed in the Functions collection anymore.

PAL

Memory Management

To support multi-process target, memory management support for dynamic, configurable, and internal static memory has been implemented in Runtime. Runtime makes PAL calls to acquire memory segments and manages the memory according to runtime configurations set by user. In case of multi-process target is enabled, these memory will be shared among multiple applications, and PAL should implement shared memory.

Protection using Mutex

Runtime now uses named mutex objects to protect critical data from multiple and simultaneous accesses by multiple threads and, in case of multi-process target is enabled, by multiple applications. Runtime makes PAL calls to obtain and control mutex objects.

New Routines

  • Memory Management

In case of multi-process target, recommended approach is to use Memory-Mapped Files to implement memory segments.

palMemSegmentOpen() - Open/create memory segment 
palMemSegmentClose() - Close memory segment
  • Named Mutexes
palMutexInit() - Initialize a mutex object
palMutexDestroy() - Destroy a mutex object
palMutexLock() - Lock a mutex object
palMutexUnlock() - Unlock a mutex object
  • Task Synchronization
palGetThreadId() - Get current thread Id
palGetProcessId() - Get current process Id
palSleep() - Suspend the execution of the current thread
  • Logging

This is optional.

palLog() - Logging utility

Updated Routines

  • Function signatures and functionalities of palWait() & palNotify() have been updated.
palWait() - now takes in an in/out pointer for events notification
palNotify() - mail box Id has been updated to notify any event including mail box Ids.
  • Function signatures of palMemAlloc() & palMemFree() have been updated.

Removed Routines

palProtect
palUnprotect
palCriticalErr

Removed Modules

S2Mem - Memory module provided as part of PAL has been removed. If native OS does not support dynamic memory, Runtime's memory management module srMem can be used instead of S2Mem.

Runtime (Beta 1)

  • STRIDE Host Release 3.0.0101 is compatible with the Runtime Version 3.00.
  • To support multi-process target, significant changes have been made to runtime.
  • A new public routine, srUninit(), has been added to sr.h & srapi.c.
  • A new module, srMem, for Memory Management has been added. Its new routines, _srMem_Allocate() & _srMem_Free(), will be used in PAL's palMemAlloc() & palMemFree() in case of multi-process target is enabled.
  • Calls to palProtect() & palUnprotect() have been replaced by new routines _srProtect() & _srUnprotect(), in which the implementation uses its own mutex object that calls PAL's mutex routines.
  • In target Test Classes and Test Functions, added capability to specify the comment label in srTestCaseAddComment() and AddComment() APIs.
  • The following Runtime files have been modified:
sr.h
srapi.c
srconn.c
srconn.h
srib.c
srib.h
sribtr.c
sribtr.h
srmsgptr.c
srmsgptr.h
srmsgque.c
srmsgque.h
srmsgrt.c
srmsgrt.h
srmsgsub.c
srmsgsub.h
srstid.c
srstid.h
srsuid.c
srsuid.h
srtest.c
srtest.cpp
srtest.h
srtime.c
srtime.h
  • The following Runtime files have been added:
srmem.c
srmem.h

Runtime (Beta 2)

  • A new public routine for Runtime Thread exit point, srThreadUninit(), has been added to sr.h & srthread.c.
  • Fixed a compiler warning in srmem.c.
  • Fixed a potential data abort issue when executing delegate code in the IM prior to Runtime being initialized.
  • Fixed a compiler warning in srcgutil.h.
  • The following Runtime files have been modified:
sr.h
srcfg.h
srcgutil.h
srconn.c
srmem.c
srthread.c

Migration to 3.0.0101

Recommended steps for migration from a previous version:

AutoScript

Any use of test classes through the Functions collection, like:

$main::ascript->Functions->Item("my_test_class")->User->Call();

should be converted to use the new TestUnits collection:

$main::ascript->TestUnits->Item("my_test_class")->Run();


PAL

Please refer to Platform Abstraction Layer (PAL) Specification for detailed information on new APIs. You may also refer to Linux implementation of PAL, which has been updated with new routines.

  • Implement new shared memory routines, palMemSegmentOpen() & palMemSegmentClose(). In case of multi-process target, these routines should implement shared memory using memory-mapped files.
  • Runtime now can manage dynamic, configurable, and internal static memory. In case of multi-process target, update palMemAlloc() to simply call _srMem_Allocate() and palMemFree() to simply call _srMem_Free(). In case of single-process target, you can simply allocate dynamic memory according to your Operating System. If you are upgrading, you can simply leave the current implementation as it is.
  • Implement new mutex routines, palMutexInit(), palMutexDestroy(), palMutexLock() & palMutexUnlock, to handle any named mutex objects. It is recommended to implement a separate code for shared memory case if it is necessary.
  • Remove old routines palProtect(), palUnprotect() and palCriticalErr().
  • Implement new routines palGetThreadId() and palGetProcessId().
  • Implement new routine palSleep().
  • Update synchronization routines, palCreateNID(), palDeleteNID(), palWait() & palNotify(), to support event notifications and in case of multi-process target is enabled, sharing of the synchronization objects among multiple processors.
  • If your PAL uses S2Mem routines for dynamic memory, you should use new Runtime module srMem. Update palMemAlloc() to call _srMem_Allocate() and palMemFree() to call _srMem_Free().
  • Optionally, implement new routine palLog() as a logging utility for PAL and Runtime.

Runtime

  • Edit srcfg.h file to configure the new memory management (srCFG_MEMORY_MANAGEMENT) and multi-process target (srCFG_MULTI_PROC_TARGET) settings. By default, memory management and multi-process target are disabled. If you enable multi-process target you also need to enable memory management and configure the sizes and the maximum number of memory blocks. New Runtime module srMem uses these configurations to allocate and manage memory segments.
  • Edit srcfg.h file to configure the new target connection timeout setting (srCFG_CONNECTION_TIMEOUT).
  • If target Test Classes and Test Functions are used, change the signature to include test label in srTestCaseAddComment() and AddComment() APIs.

Windows Applications using Windows Off-Target SDK

  • The new s2srwin.lib has public API, pulished in a header srwin.h, containing the following set of routines:
srWin_SetMaster() - Sets the application as the master and initializes the Stride Runtime thread. In a multi-process environment only one application should make this call.
srWin_AddThread() - Adds additional message processing threads to the application.
srWin_Run() - Starts the processing and will not return until it has been signaled via keyboard key or CTRL-C.
srWin_SetPortTCP() - Overrides the TCP port number (default: 8000) to which the application will bind for the purpose of accepting connections.
srWin_SetPortSerial() - Overrides the COM port number (default: 1) to which the application will bind for the purpose of accepting connections.
  • Existing Host Apps developed against the old hostapphrt and hostapptrt libraries should be updated to as follows:
    • replace the include of hostapp.h with include of srwin.h
    • replace all calls to HostAppXXX() with srWin_XXX()
    • call srWin_SetMaster() to start the runtime thred, srThread, before calling srWin_Run(). Within a multi-process target, only one process (the master) calls this routine.