Robust applications framework in C++. Includes a static analysis tool and two applications.
c=
<path>).Module
constructor so that an optional module can define a symbol that allows it to be enabled.OptionalModules
configuration parameter (a string) that specifies the optional modules to enable.NbModule::Startup
.CreateModules
in main.cpp and rscapp.cpp to use the optional modules capability.Warning
A module that is not required by another one must define a symbol when it invokes the base
Module
constructor, and that symbol must appear in theOptionalModules
parameter in the configuration file. Each module must also override theEnable
function to enable the modules that it requires, plus itself (Module::Enable
). Instantiating a module is no longer sufficient to make its capabilities available; it must also be enabled for itsStartup
function to be invoked during initialization and restarts. See the comments in Module.h.
fn_name
function in a template header to an inline fn_name
(a C++17 capability).inline
data.RscLauncher
to Launcher
.CodeTools
WarningAttrs.disabled_
bool so that all occurrences of a warning can be disabled.>check
and add a >linecounts
command to export them.NodeBase
RecoveryThread
to its own files.CodeTools
Editor
and made before logging FunctionCouldBeFree
were forgotten for DataCouldBeFree
.>check
is re-executed.Other
NodeBase
Mutex
is almost as efficient and much better for robustness and debugging.SlabPriv::Validate
should only validate the block at addr
, instead of the entire heap, when addr != nullptr
.CodeTools
auto
variable that should be tagged const
.FunctionCouldBeFree
when checks in Editor
prevented >fix
from actually changing the function.static
in a .cpp, the class must qualify the static
function with its namespace to invoke it.static
in a .cpp was relocated to within a class definition.NodeBase
Log
and MainArgs
to share code with rscapp.cpp.EXIT_SUCCESS
and EXIT_FAILURE
for exit codes.CodeTools
>export
to dump all code comments to a file.>export
option to extract comments, and then use MS Word to find and fix typos.NodeBase
SIGWRITE
on Linux.Thread.Interrupt
to require a reason for the interrupt.Mutex
causes blocking.Gate.WaitFor
.CodeTools
>parse
is specifying the same target.NodeBase
CodeTools
RscLauncher
also has a main()
, which causes spurious warnings about removing #includes
from rsc/main.cpp
.auto
variable could be inadvertently copying an object, which would be avoided by declaring it as auto&
.auto
variable was copying an object.>fix
adds a special member function to a template, FindTemplateAnalog
causes an "invalid vector subscript" exception because template instances don't have that member.Other
RscLauncher
working on Linux. This uncovered a VS2022 bug: hitting the enter key in the Linux Console Window, without any other input, does not cause std::getline
to return with an empty string. A space must be entered first.SysFile
→FileSystem
, SysLock
→Lock
, and SysMutex
→Mutex
.Mutex
.SysThread::SetPriorityAllowed
to indicate whether scheduler priorities can be changed. If they can't, increase the timeslice for a locked thread if a preemptable thread is also running.Base::Summarize
for displaying items in a tabular format.Summarize
:
NbIncrement
: >alarms list
>buffers
>daemons list
>deferred
>heaps list
>modules
>mutexes
>pools
>psignals
>threads
>tools
NwIncrement
: >ipports
>ipservices
SbIncrement
: >contexts
>events
>factories
>handlers
>initiators
>invpools
>messages
>msgports
>parameters
>protocols
>psms
>services
>signals
>ssms
>states
>timers
>triggers
The focus was on testing the Linux target, which now seems stable.
NodeBase
SysFile.GetLine
for erasing the \r
from endlines in files created on Windows but read on Linux.SysThreadStack
to SysStackTrace
.SysStackTrace.Demangle
targets for Linux and Windows.SysThread.Pause
so a thread can sleep while waiting for its Thread
to finish construction.InitThread.RunningTicks
as a rough monotonic clock that doesn't advance during restarts and breakpoints.Thread
still isn't finished construction.SlabHeap.Validate
.RootThread
will not initiate a restart on a scheduling timeout, limit it to one log every 3 seconds.ThreadRegistry
before RootThread
and add some missing mutexes when accessing its threads_
member.ThreadRegistry.threads_
.Destroy
on a Thread
that is marked deleting_
.NetworkBase
recvfrom
on Linux, so have a UdpIoThread
send itself a message to unblock when it wants to exit during a restart.CodeTools
SourcePath
directory from the file paths in >check
output and change \
separators to /
: this eliminates noise in diffs when a >check
obtained on Windows is compared with one obtained on Linux.this
argument to the function call, which is needed to match with a non-static function, but which is ignored when matching with a static function.Known deficiencies
The following recovery tests fail on Linux:
std::terminate
(currently a problem in Windows release builds as well)The first three are because of the gcc compiler. The last one appears to be because WSL doesn't pass a Ctrl-C to the Linux console.
There are minor differences between >check
and >export
results obtained on Windows as opposed to Linux.
RscLauncher
still hasn't been tested on Linux.
NodeBase
RscLauncher
. Closes #20.>restart reboot
and >restart exit
failed because exit()
invokes destructors, which eventually caused problems when Debug::ft
was invoked.CodeTools
virtual
should always be removed on an override.override
tag could only be added after the virtual
keyword was present so that it could be deleted.virtual
and override
are detected during the compilation phase and were not preserved when the file was checked.Known deficiencies
std::terminate
in a release build has been reported.