From 5fb8e0344a4c0e8fc204dbd35ff67544e3f2a6d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20K=C3=A4ll=C3=A9n?= Date: Tue, 5 Dec 2023 02:34:41 +0100 Subject: [PATCH] Feature: PalmOS support for MacsBug symbols * Moved the MacsBugSymbolScanner.cs from MacOS.csproj to PalmOS.csproj, renaming it to SymbolScanner.cs in the ProcessJumpTable * Added new assembly, Reko.Libraries.MacsBug, to the solution. --- src/Drivers/Common.items | 1 + .../MacOS/Classic/ResourceFork.cs | 19 ++-- src/Environments/MacOS/MacOS.csproj | 1 + src/Environments/PalmOS/PRC/PrcLoader.cs | 20 +++- src/Environments/PalmOS/PalmOS.csproj | 1 + src/Environments/PalmOS/Traps.cs | 1 - src/Installers/NuGetPackage/reko-files.xml | 12 +- src/Libraries/MacsBug/MacsBug.csproj | 17 +++ .../MacsBug/SymbolScanner.cs} | 17 +-- src/Reko-decompiler.sln | 106 ++++++++++++------ .../Arch/Qualcomm/HexagonRewriterTests.cs | 1 - .../SymbolScannerTests.cs} | 14 +-- 12 files changed, 138 insertions(+), 72 deletions(-) create mode 100644 src/Libraries/MacsBug/MacsBug.csproj rename src/{Environments/MacOS/Classic/MacsBugSymbolScanner.cs => Libraries/MacsBug/SymbolScanner.cs} (96%) rename src/UnitTests/{Environments/MacOS/Classic/MacsBugSymbolScannerTests.cs => Libraries/SymbolScannerTests.cs} (91%) diff --git a/src/Drivers/Common.items b/src/Drivers/Common.items index 727cc9a88d..543ffba76a 100644 --- a/src/Drivers/Common.items +++ b/src/Drivers/Common.items @@ -365,6 +365,7 @@ by the PreBuild.targets file. + diff --git a/src/Environments/MacOS/Classic/ResourceFork.cs b/src/Environments/MacOS/Classic/ResourceFork.cs index 6bdbbcfc4a..4772705473 100644 --- a/src/Environments/MacOS/Classic/ResourceFork.cs +++ b/src/Environments/MacOS/Classic/ResourceFork.cs @@ -18,11 +18,10 @@ */ #endregion -using Reko.Arch.M68k; using Reko.Core; using Reko.Core.Loading; using Reko.Core.Memory; -using Reko.Core.Types; +using Reko.Libraries.MacsBug; using System; using System.Collections.Generic; using System.Diagnostics; @@ -38,10 +37,10 @@ namespace Reko.Environments.MacOS.Classic /// public class ResourceFork { - private byte[] image; - private MacOSClassic platform; - private IProcessorArchitecture arch; - private ResourceTypeCollection rsrcTypes; + private readonly byte[] image; + private readonly MacOSClassic platform; + private readonly IProcessorArchitecture arch; + private readonly ResourceTypeCollection rsrcTypes; uint rsrcDataOff; uint rsrcMapOff; @@ -101,9 +100,9 @@ public ResourceReference(ushort rsrcID, string name, uint offset) public class ResourceTypeCollection : ICollection { private byte[] bytes; - uint rsrcTypeListOff ; - uint rsrcNameListOff; - int crsrcTypes; + uint rsrcTypeListOff ; + uint rsrcNameListOff; + int crsrcTypes; public ResourceTypeCollection(byte [] bytes, uint offset, uint size) { @@ -391,7 +390,7 @@ private void AddCodeSegment(SortedList symbols, Dictionary { segment.Access |= AccessMode.Execute; codeSegs.Add(rsrc.ResourceID, segment); - var macsBug = new MacsBugSymbolScanner(arch, memSeg); + var macsBug = new SymbolScanner(arch, memSeg); var mbSymbols = macsBug.ScanForSymbols(); foreach (var symbol in mbSymbols) { diff --git a/src/Environments/MacOS/MacOS.csproj b/src/Environments/MacOS/MacOS.csproj index 934a7cfbad..666dbd4816 100644 --- a/src/Environments/MacOS/MacOS.csproj +++ b/src/Environments/MacOS/MacOS.csproj @@ -14,5 +14,6 @@ + \ No newline at end of file diff --git a/src/Environments/PalmOS/PRC/PrcLoader.cs b/src/Environments/PalmOS/PRC/PrcLoader.cs index 82099d820d..4b78df1333 100644 --- a/src/Environments/PalmOS/PRC/PrcLoader.cs +++ b/src/Environments/PalmOS/PRC/PrcLoader.cs @@ -23,6 +23,7 @@ using Reko.Core.Loading; using Reko.Core.Memory; using Reko.Core.Services; +using Reko.Libraries.MacsBug; using System; using System.Collections.Generic; using System.Text; @@ -54,6 +55,7 @@ public override Program LoadProgram(Address? addrLoad) addrLoad ??= PreferredBaseAddress; var rdr = new BeImageReader(base.RawImage); var cfgSvc = Services.RequireService(); + var arch = cfgSvc.GetArchitecture("m68k")!; var header = LoadHeader(rdr); if (header is null) @@ -61,17 +63,20 @@ public override Program LoadProgram(Address? addrLoad) var rsrcHeaders = LoadResourceHeaders(rdr, header.num_records); if (rsrcHeaders is null) throw new BadImageFormatException(); - var (segments, ep) = LoadResources(rdr, rsrcHeaders, addrLoad); + var (segments, ep, symbols) = LoadResources(arch, rdr, rsrcHeaders, addrLoad); if (segments is null) throw new BadImageFormatException(); - var arch = cfgSvc.GetArchitecture("m68k")!; var platform = new PalmOSPlatform(Services, arch, "palmOS"); var program = new Program(segments, arch, platform); if (ep is not null) { program.EntryPoints.Add(ep, ImageSymbol.Procedure(arch, ep)); } + foreach (var sym in symbols) + { + program.ImageSymbols[sym.Address] = sym; + } return program; } @@ -138,9 +143,14 @@ public override Program LoadProgram(Address? addrLoad) return headers; } - private (SegmentMap, Address?) LoadResources(BeImageReader rdr, List rsrcHeaders, Address addrBase) + private (SegmentMap, Address?, List) LoadResources( + IProcessorArchitecture arch, + BeImageReader rdr, + List rsrcHeaders, + Address addrBase) { var segments = new List(); + var symbols = new List(); var addr = addrBase; Address? addrEntrypoint = null; for (int i = 0; i < rsrcHeaders.Count - 1; ++i) @@ -169,6 +179,8 @@ public override Program LoadProgram(Address? addrLoad) { addrEntrypoint = addr; } + var symScanner = new SymbolScanner(arch, mem); + symbols.AddRange(symScanner.ScanForSymbols()); } } var seg = new ImageSegment(name, mem, accessMode); @@ -176,7 +188,7 @@ public override Program LoadProgram(Address? addrLoad) addr += length; //$TODO: align to even paragraph boundary? } var map = new SegmentMap(segments.ToArray()); - return (map, addrEntrypoint); + return (map, addrEntrypoint, symbols); } private void LoadCode0Resource() diff --git a/src/Environments/PalmOS/PalmOS.csproj b/src/Environments/PalmOS/PalmOS.csproj index 496f8aaeaa..462221ffde 100644 --- a/src/Environments/PalmOS/PalmOS.csproj +++ b/src/Environments/PalmOS/PalmOS.csproj @@ -12,5 +12,6 @@ + diff --git a/src/Environments/PalmOS/Traps.cs b/src/Environments/PalmOS/Traps.cs index 4508448729..c0f3c75a9a 100644 --- a/src/Environments/PalmOS/Traps.cs +++ b/src/Environments/PalmOS/Traps.cs @@ -1425,7 +1425,6 @@ private static DataType CreateParameterType(string arg) } DataType dt; - Storage stg; if (arg.Length == a + 1) { switch (arg[a]) diff --git a/src/Installers/NuGetPackage/reko-files.xml b/src/Installers/NuGetPackage/reko-files.xml index c40b0a3db2..4a2ce17a81 100644 --- a/src/Installers/NuGetPackage/reko-files.xml +++ b/src/Installers/NuGetPackage/reko-files.xml @@ -138,12 +138,13 @@ $SolutionDir$/ImageLoaders/XexLoader/$TargetDir$/Reko.ImageLoaders.Xex.dll $SolutionDir$/ImageLoaders/Xbe/$TargetDir$/Reko.ImageLoaders.Xbe.dll - $SolutionDir$/Symbols/LGSymLoader/$TargetDir$/Reko.Symbols.LGSymLoader.dll - $SolutionDir$/Libraries/Libc/$TargetDir$/Reko.Libraries.Libc.dll - $SolutionDir$/Libraries/Python/$TargetDir$/Reko.Libraries.Python.dll + $SolutionDir$/Symbols/LGSymLoader/$TargetDir$/Reko.Symbols.LGSymLoader.dll + $SolutionDir$/Libraries/Libc/$TargetDir$/Reko.Libraries.Libc.dll + $SolutionDir$/Libraries/MacsBug/$TargetDir$/Reko.Libraries.MacsBug.dll + $SolutionDir$/Libraries/Python/$TargetDir$/Reko.Libraries.Python.dll - $SolutionDir$/Scripts/Python/ - $SolutionDir$/Scripts/Python/$TargetDir$/Reko.Scripts.Python.dll + $SolutionDir$/Scripts/Python/ + $SolutionDir$/Scripts/Python/$TargetDir$/Reko.Scripts.Python.dll @@ -333,6 +334,7 @@ + diff --git a/src/Libraries/MacsBug/MacsBug.csproj b/src/Libraries/MacsBug/MacsBug.csproj new file mode 100644 index 0000000000..1b1a0309aa --- /dev/null +++ b/src/Libraries/MacsBug/MacsBug.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + Library + enable + enable + Reko.Libraries.MacsBug + Reko.Libraries.MacsBug + net6.0 + false + Debug;Release + + + + + diff --git a/src/Environments/MacOS/Classic/MacsBugSymbolScanner.cs b/src/Libraries/MacsBug/SymbolScanner.cs similarity index 96% rename from src/Environments/MacOS/Classic/MacsBugSymbolScanner.cs rename to src/Libraries/MacsBug/SymbolScanner.cs index e639195ca0..2827276552 100644 --- a/src/Environments/MacOS/Classic/MacsBugSymbolScanner.cs +++ b/src/Libraries/MacsBug/SymbolScanner.cs @@ -18,18 +18,13 @@ */ #endregion -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Reko.Core; -using Reko.Core.Lib; -using System.Text.RegularExpressions; -using Reko.Core.Memory; using Reko.Core.Loading; +using Reko.Core.Memory; +using System.Text; +using System.Text.RegularExpressions; -namespace Reko.Environments.MacOS.Classic +namespace Reko.Libraries.MacsBug { /* MacsBug accepts and returns addresses as procedure names and offsets. @@ -77,7 +72,7 @@ procedure in memory. The first word after the name specifies how many bytes of constant data are present. If there are no constants, a length of 0 must be given. */ - public class MacsBugSymbolScanner + public class SymbolScanner { public const ushort LINK = 0x4E56; public const ushort RTS = 0x4E75; @@ -88,7 +83,7 @@ public class MacsBugSymbolScanner private readonly EndianImageReader rdr; private readonly Regex reValidVariableLengthProcedureName; - public MacsBugSymbolScanner(IProcessorArchitecture arch, ByteMemoryArea mem) + public SymbolScanner(IProcessorArchitecture arch, ByteMemoryArea mem) { this.arch = arch; this.rdr = mem.CreateBeReader(0); diff --git a/src/Reko-decompiler.sln b/src/Reko-decompiler.sln index 627ffe792d..4e63073237 100644 --- a/src/Reko-decompiler.sln +++ b/src/Reko-decompiler.sln @@ -223,6 +223,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsDecompiler", "Driver {A1376626-5207-41A9-A77B-11DDB9F534D1} = {A1376626-5207-41A9-A77B-11DDB9F534D1} {A4DEF935-217C-4107-998C-C7845893CFA0} = {A4DEF935-217C-4107-998C-C7845893CFA0} {A943CF9B-7FCD-413A-B6D9-A199A69AF217} = {A943CF9B-7FCD-413A-B6D9-A199A69AF217} + {A945526E-3780-42E9-9A83-0343A2D28DD8} = {A945526E-3780-42E9-9A83-0343A2D28DD8} {A959C1A2-A622-4600-81AD-29E08545B2F7} = {A959C1A2-A622-4600-81AD-29E08545B2F7} {AB5DDEB2-87C0-42C7-8CD3-72CB2B1282FB} = {AB5DDEB2-87C0-42C7-8CD3-72CB2B1282FB} {B15C2937-0FB8-4F3B-8B84-BEE861DC841B} = {B15C2937-0FB8-4F3B-8B84-BEE861DC841B} @@ -290,6 +291,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CmdLine", "Drivers\CmdLine\ {A1376626-5207-41A9-A77B-11DDB9F534D1} = {A1376626-5207-41A9-A77B-11DDB9F534D1} {A4DEF935-217C-4107-998C-C7845893CFA0} = {A4DEF935-217C-4107-998C-C7845893CFA0} {A943CF9B-7FCD-413A-B6D9-A199A69AF217} = {A943CF9B-7FCD-413A-B6D9-A199A69AF217} + {A945526E-3780-42E9-9A83-0343A2D28DD8} = {A945526E-3780-42E9-9A83-0343A2D28DD8} {AB5DDEB2-87C0-42C7-8CD3-72CB2B1282FB} = {AB5DDEB2-87C0-42C7-8CD3-72CB2B1282FB} {B15C2937-0FB8-4F3B-8B84-BEE861DC841B} = {B15C2937-0FB8-4F3B-8B84-BEE861DC841B} {B7DC39DD-6693-4F71-AE7F-007C5C62CBAA} = {B7DC39DD-6693-4F71-AE7F-007C5C62CBAA} @@ -311,6 +313,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CmdLine", "Drivers\CmdLine\ EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaShell", "Drivers\AvaloniaShell\AvaloniaShell.csproj", "{D60AC978-B1F2-45D7-9677-DD671E414B0F}" + ProjectSection(ProjectDependencies) = postProject + {A945526E-3780-42E9-9A83-0343A2D28DD8} = {A945526E-3780-42E9-9A83-0343A2D28DD8} + EndProjectSection EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "website", "Drivers\WebSite\website.csproj", "{0D35C524-CA16-4C68-80CD-538897144B47}" ProjectSection(ProjectDependencies) = postProject @@ -375,6 +380,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libc", "Libraries\Libc\Libc.csproj", "{FDAF4CA9-085C-473E-BCB5-0D2A4354A949}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MacsBug", "Libraries\MacsBug\MacsBug.csproj", "{A945526E-3780-42E9-9A83-0343A2D28DD8}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python", "Libraries\Python\Python.csproj", "{C278CA2F-7D7C-47C3-B560-7BC63E1FAD96}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Symbols", "Symbols", "{EF16C5BE-595C-4A9F-9CA6-028D993661E7}" @@ -714,6 +721,38 @@ Global {5E75D702-3032-41FE-8D09-86428555A8ED}.UnixRelease|x64.Build.0 = Release|Any CPU {5E75D702-3032-41FE-8D09-86428555A8ED}.UnixRelease|x86.ActiveCfg = Release|Any CPU {5E75D702-3032-41FE-8D09-86428555A8ED}.UnixRelease|x86.Build.0 = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|ARM64.Build.0 = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|x64.ActiveCfg = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|x64.Build.0 = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|x86.ActiveCfg = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|x86.Build.0 = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|Any CPU.Build.0 = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|ARM64.ActiveCfg = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|ARM64.Build.0 = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|x64.ActiveCfg = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|x64.Build.0 = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|x86.ActiveCfg = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|x86.Build.0 = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|Any CPU.ActiveCfg = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|Any CPU.Build.0 = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|ARM64.ActiveCfg = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|ARM64.Build.0 = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|x64.ActiveCfg = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|x64.Build.0 = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|x86.ActiveCfg = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|x86.Build.0 = Debug|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|Any CPU.ActiveCfg = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|Any CPU.Build.0 = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|ARM64.ActiveCfg = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|ARM64.Build.0 = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|x64.ActiveCfg = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|x64.Build.0 = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|x86.ActiveCfg = Release|Any CPU + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|x86.Build.0 = Release|Any CPU {0BCCEFDD-63A8-47F2-9A39-8CE7B5F9CFAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {0BCCEFDD-63A8-47F2-9A39-8CE7B5F9CFAB}.Debug|Any CPU.Build.0 = Debug|Any CPU {0BCCEFDD-63A8-47F2-9A39-8CE7B5F9CFAB}.Debug|ARM64.ActiveCfg = Debug|Any CPU @@ -2641,6 +2680,38 @@ Global {FDAF4CA9-085C-473E-BCB5-0D2A4354A949}.UnixRelease|x64.Build.0 = Release|Any CPU {FDAF4CA9-085C-473E-BCB5-0D2A4354A949}.UnixRelease|x86.ActiveCfg = Release|Any CPU {FDAF4CA9-085C-473E-BCB5-0D2A4354A949}.UnixRelease|x86.Build.0 = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Debug|ARM64.ActiveCfg = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Debug|ARM64.Build.0 = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Debug|x64.ActiveCfg = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Debug|x64.Build.0 = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Debug|x86.ActiveCfg = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Debug|x86.Build.0 = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Release|Any CPU.Build.0 = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Release|ARM64.ActiveCfg = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Release|ARM64.Build.0 = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Release|x64.ActiveCfg = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Release|x64.Build.0 = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Release|x86.ActiveCfg = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.Release|x86.Build.0 = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixDebug|Any CPU.ActiveCfg = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixDebug|Any CPU.Build.0 = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixDebug|ARM64.ActiveCfg = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixDebug|ARM64.Build.0 = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixDebug|x64.ActiveCfg = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixDebug|x64.Build.0 = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixDebug|x86.ActiveCfg = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixDebug|x86.Build.0 = Debug|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixRelease|Any CPU.ActiveCfg = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixRelease|Any CPU.Build.0 = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixRelease|ARM64.ActiveCfg = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixRelease|ARM64.Build.0 = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixRelease|x64.ActiveCfg = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixRelease|x64.Build.0 = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixRelease|x86.ActiveCfg = Release|Any CPU + {A945526E-3780-42E9-9A83-0343A2D28DD8}.UnixRelease|x86.Build.0 = Release|Any CPU {C278CA2F-7D7C-47C3-B560-7BC63E1FAD96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C278CA2F-7D7C-47C3-B560-7BC63E1FAD96}.Debug|Any CPU.Build.0 = Debug|Any CPU {C278CA2F-7D7C-47C3-B560-7BC63E1FAD96}.Debug|ARM64.ActiveCfg = Debug|Any CPU @@ -4721,38 +4792,6 @@ Global {C44138B0-6F67-48E8-B793-03BC2156A14B}.UnixRelease|x64.Build.0 = Release|Any CPU {C44138B0-6F67-48E8-B793-03BC2156A14B}.UnixRelease|x86.ActiveCfg = Release|Any CPU {C44138B0-6F67-48E8-B793-03BC2156A14B}.UnixRelease|x86.Build.0 = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|ARM64.Build.0 = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|x64.ActiveCfg = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|x64.Build.0 = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|x86.ActiveCfg = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Debug|x86.Build.0 = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|Any CPU.Build.0 = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|ARM64.ActiveCfg = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|ARM64.Build.0 = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|x64.ActiveCfg = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|x64.Build.0 = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|x86.ActiveCfg = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.Release|x86.Build.0 = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|Any CPU.ActiveCfg = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|Any CPU.Build.0 = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|ARM64.ActiveCfg = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|ARM64.Build.0 = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|x64.ActiveCfg = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|x64.Build.0 = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|x86.ActiveCfg = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixDebug|x86.Build.0 = Debug|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|Any CPU.ActiveCfg = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|Any CPU.Build.0 = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|ARM64.ActiveCfg = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|ARM64.Build.0 = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|x64.ActiveCfg = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|x64.Build.0 = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|x86.ActiveCfg = Release|Any CPU - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5}.UnixRelease|x86.Build.0 = Release|Any CPU {AC7E183E-2FB1-4E93-ADEB-31B318D3DC93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AC7E183E-2FB1-4E93-ADEB-31B318D3DC93}.Debug|Any CPU.Build.0 = Debug|Any CPU {AC7E183E-2FB1-4E93-ADEB-31B318D3DC93}.Debug|ARM64.ActiveCfg = Debug|Any CPU @@ -4793,6 +4832,7 @@ Global {F9C628DF-EB23-46D7-9580-3A2B749E8BDA} = {18994109-C4D5-49F9-86E0-3B5B1046C08E} {32F09304-51BE-4797-A86A-C0BEFED2422B} = {18994109-C4D5-49F9-86E0-3B5B1046C08E} {5E75D702-3032-41FE-8D09-86428555A8ED} = {18994109-C4D5-49F9-86E0-3B5B1046C08E} + {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5} = {3F38B136-C309-4B62-8496-931723F16706} {0BCCEFDD-63A8-47F2-9A39-8CE7B5F9CFAB} = {18994109-C4D5-49F9-86E0-3B5B1046C08E} {F6F2225D-B778-4FD2-9BA9-A8E2B58ACCCC} = {18994109-C4D5-49F9-86E0-3B5B1046C08E} {38A94634-B2B2-4A89-AF02-2A2898B93343} = {18994109-C4D5-49F9-86E0-3B5B1046C08E} @@ -4855,6 +4895,7 @@ Global {D60AC978-B1F2-45D7-9677-DD671E414B0F} = {583D1273-7630-480B-9020-D16B3A15D15D} {0D35C524-CA16-4C68-80CD-538897144B47} = {583D1273-7630-480B-9020-D16B3A15D15D} {FDAF4CA9-085C-473E-BCB5-0D2A4354A949} = {D35CD07C-C6BE-467D-B50D-EE9EDCC74D4E} + {A945526E-3780-42E9-9A83-0343A2D28DD8} = {D35CD07C-C6BE-467D-B50D-EE9EDCC74D4E} {C278CA2F-7D7C-47C3-B560-7BC63E1FAD96} = {D35CD07C-C6BE-467D-B50D-EE9EDCC74D4E} {9E4B5291-EBA1-4127-AC38-E0F822F7E4F1} = {EF16C5BE-595C-4A9F-9CA6-028D993661E7} {41BF59CB-46A6-42F6-91F2-B663BEED068A} = {AD6CD1E3-2C31-4E78-9432-4BAC77BC63D5} @@ -4920,7 +4961,6 @@ Global {02CA5C70-1AA3-4F10-81F8-47B9BB122EE8} = {18994109-C4D5-49F9-86E0-3B5B1046C08E} {5D970ABA-822D-4A35-8354-C82DA425EF6A} = {18994109-C4D5-49F9-86E0-3B5B1046C08E} {C44138B0-6F67-48E8-B793-03BC2156A14B} = {E6A2E818-3AB9-47FC-9266-4E72ECBB13F4} - {2B025555-2C2C-42FE-B5B4-238E7F1E0AB5} = {3F38B136-C309-4B62-8496-931723F16706} {AC7E183E-2FB1-4E93-ADEB-31B318D3DC93} = {E6A2E818-3AB9-47FC-9266-4E72ECBB13F4} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution diff --git a/src/UnitTests/Arch/Qualcomm/HexagonRewriterTests.cs b/src/UnitTests/Arch/Qualcomm/HexagonRewriterTests.cs index fa1bde3725..92b9fcf1d0 100644 --- a/src/UnitTests/Arch/Qualcomm/HexagonRewriterTests.cs +++ b/src/UnitTests/Arch/Qualcomm/HexagonRewriterTests.cs @@ -610,7 +610,6 @@ public void HexagonRw_load_indexed() "1|L--|r0 = Mem0[r30 + r0 * 4<32>:word32]"); } - [Test] [Ignore("Conditional assignment")] public void HexagonRw_NOT() diff --git a/src/UnitTests/Environments/MacOS/Classic/MacsBugSymbolScannerTests.cs b/src/UnitTests/Libraries/SymbolScannerTests.cs similarity index 91% rename from src/UnitTests/Environments/MacOS/Classic/MacsBugSymbolScannerTests.cs rename to src/UnitTests/Libraries/SymbolScannerTests.cs index 7c04ac77b9..a289058ae1 100644 --- a/src/UnitTests/Environments/MacOS/Classic/MacsBugSymbolScannerTests.cs +++ b/src/UnitTests/Libraries/SymbolScannerTests.cs @@ -23,12 +23,12 @@ using Reko.Core; using Reko.Core.Loading; using Reko.Core.Memory; -using Reko.Environments.MacOS.Classic; +using Reko.Libraries.MacsBug; using System.Collections.Generic; using System.ComponentModel.Design; using System.Text; -namespace Reko.UnitTests.Environments.MacOS.Classic +namespace Reko.UnitTests.Libraries.MacsBug { class MacsBugSymbolScannerTests { @@ -45,7 +45,7 @@ public void Setup() private void Given_Link(int amount) { // Emit a LINK instruction reservice `amount` bytes of space. - w.WriteBeUInt16(MacsBugSymbolScanner.LINK); + w.WriteBeUInt16(SymbolScanner.LINK); w.WriteBeUInt16((ushort)amount); } @@ -60,12 +60,12 @@ private void Given_Body(int instrs) private void Given_Rts() { - w.WriteBeUInt16(MacsBugSymbolScanner.RTS); + w.WriteBeUInt16(SymbolScanner.RTS); } private void Given_Rtd(int n) { - w.WriteBeUInt16(MacsBugSymbolScanner.RTD); + w.WriteBeUInt16(SymbolScanner.RTD); w.WriteBeUInt16((ushort)n); } @@ -108,7 +108,7 @@ public void MacsBug_ScanProcedures() Given_ProgramData(0); var mem = new ByteMemoryArea(Address.Ptr32(0x00100000), w.ToArray()); - var scan = new MacsBugSymbolScanner(arch, mem); + var scan = new SymbolScanner(arch, mem); var symbols = scan.ScanForSymbols(); Assert.AreEqual(1, symbols.Count); @@ -138,7 +138,7 @@ public void MacsBug_ScanProcedures_WithConstantData() Given_Rts(); // no symbol. var mem = new ByteMemoryArea(Address.Ptr32(0x00100000), w.ToArray()); - var scan = new MacsBugSymbolScanner(arch, mem); + var scan = new SymbolScanner(arch, mem); var symbols = scan.ScanForSymbols(); Assert.AreEqual(2, symbols.Count);