195c93a94a
Another chapter in the never-ending AppDomain security saga. If a computer goes to sleep while SourceGen is running with a project open, life gets confusing when the system wakes up. The keep-alive timer fires and a ping is sent to the remote AppDomain, successfully. At the same time, the lease expires on the remote side, and the objects are discarded (apparently without bothering to query the ILease object). This failure mode is 100% repeatable. Since we can't prevent sandbox objects from disappearing, we have to detect and recover from the problem. Fortunately we don't keep any necessary state on the plugin side, so we can just tear the whole thing down and recreate it. The various methods in ScriptManager now do a "health check" before making calls into the plugin AppDomain. If the ping attempt fails, the AppDomain is "rebooted" by destroying it and creating a new one, reloading all plugins that were in there before. The plugin binaries *should* still be in the PluginDllCache directory since the ping failure was due to objects being discarded, not AppDomain shutdown, and Windows doesn't let you mess with files that hold executable code. A new "reboot security sandbox" option has been added to the DEBUG menu to facilitate testing. The PluginManager's Ping() method gets called more often, but not to the extent that performance will be affected. This change also adds a finalizer to DisasmProject, since we're relying on it to shut down the ScriptManager, and it's relying on callers to invoke its cleanup function. The finalizer throws an assertion if the cleanup function doesn't get called. (Issue #82) |
||
---|---|---|
.. | ||
Apple | ||
Atari | ||
Commodore | ||
Help | ||
Nintendo | ||
TestData | ||
ExportTemplate.html | ||
LegalStuff.txt | ||
README.md | ||
RuntimeData.csproj | ||
SGStyle.css | ||
SystemDefs.json |
Runtime Data
Symbol files and analyzer scripts are split into directories by platform manufacturer.
The Visual Studio project (RuntimeData.csproj) exists so you can edit scripts with IntelliSense and error highlighting. Everything here is distributed as source, not in compiled form; all compilation occurs at run time.
SystemDefs.json
This file defines the systems available in the "new project" screen. The following fields are mandatory:
- Name - Short name that identifies the system.
- GroupName - Short string used to group common items together in the UI.
- CPU - Type of CPU used. The string must be part of the known set (see CpuDef.cs)
- Speed - Clock rate, in MHz, of the CPU on the system. When multiple speeds are possible, use the most common, favoring NTSC over PAL.
- SymbolFiles - List of platform symbol file identifiers (see below).
- ExtensionScripts - List of extension script file identifiers (see below).
- Parameters - List of optional parameters (see below).
The currently-supported parameters are:
- load-address=<addr> - Specify the initial load address. The default is 0x1000.
- entry-flags=<flag-set> - Specify the processor status flag values to use at entry points. This is intended for use on the 65802/65816, and may be one of "emulation", "native-short", and "native-long". The default is "emulation".
- undocumented-opcodes={true|false} - Enable or disable undocumented opcodes. They are disabled by default.
- first-word-is-load-addr={true|false} - If true, the first two bytes of the file contain the load address.
- default-text-encoding=<mode> - Specify default character encoding. Use "c64-petscii" for PETSCII. The default is low/high ASCII.
All of these things can be changed after the project has begun, but it's nice to have them configured in advance.
SymbolFiles and ExtensionScripts use file identifiers, which look like "RT:Apple/ProDOS8.sym65". The "RT:" means that the file lives in the RuntimeData directory, and the rest is a partial pathname. Files that live in the same directory as the project file are prefixed with "PROJ:". All symbol files and extension scripts must live in the RuntimeData directory or project file directory, or they will not be loaded.
All "RT:" identifier paths are relative to the RuntimeData directory. The Group Name is not automatically added.
Platform Symbol Files and Extension Scripts
These are described in the "Advanced Topics" section of the manual (here).
Misc Files
ExportTemplate.html and SGStyle.css are used by SourceGen's HTML export feature.
LegalStuff.txt is displayed in the About box.