Skip to content

Commit

Permalink
Fix: build break.
Browse files Browse the repository at this point in the history
  • Loading branch information
uxmal committed Mar 31, 2023
1 parent 59349b2 commit 603817e
Show file tree
Hide file tree
Showing 4 changed files with 254 additions and 249 deletions.
1 change: 0 additions & 1 deletion src/Arch/Microchip/Common/PICArchitecture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ public PICArchitecture(IServiceProvider services, string archId, Dictionary<stri
PointerType = PrimitiveType.Ptr32;
WordWidth = PrimitiveType.Byte;
this.Options = null!;
LoadUserOptions(options);
}

public PICArchitecture(IServiceProvider services, Dictionary<string, object> options)
Expand Down
6 changes: 6 additions & 0 deletions src/Arch/Padauk/PadaukArchitecture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

using Reko.Core;
using Reko.Core.Expressions;
using Reko.Core.Hll.Pascal;
using Reko.Core.Lib;
using Reko.Core.Machine;
using Reko.Core.Memory;
Expand Down Expand Up @@ -128,6 +129,11 @@ public override string GrfToString(RegisterStorage flagregister, string prefix,
return s.ToString();
}

public override void LoadUserOptions(Dictionary<string, object>? options)
{
this.Options = options ?? new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
}

public override Address MakeAddressFromConstant(Constant c, bool codeAlign)
{
return Address.Ptr16(c.ToUInt16());
Expand Down
10 changes: 5 additions & 5 deletions src/Drivers/CmdLine/CmdLineDriver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,19 +318,19 @@ private void DecompileRawImage(Dictionary<string, object> pArgs)
{
try
{
var arch = config.GetArchitecture((string) pArgs["--arch"]);
if (arch is null)
throw new ApplicationException(string.Format("Unknown architecture {0}", pArgs["--arch"]));
Dictionary<string, object> archOptions;
if (pArgs.TryGetValue("--arch-options", out var oArchOptions))
{
archOptions = (Dictionary<string, object>) oArchOptions;
arch.LoadUserOptions(archOptions);
}
else
{
archOptions = new Dictionary<string, object>(StringComparer.OrdinalIgnoreCase);
archOptions = new Dictionary<string,object>(StringComparer.OrdinalIgnoreCase);
}
var arch = config.GetArchitecture((string) pArgs["--arch"], archOptions);
if (arch is null)
throw new ApplicationException(string.Format("Unknown architecture {0}", pArgs["--arch"]));

pArgs.TryGetValue("--env", out object sEnv);

if (!pArgs.TryGetValue("--base", out var oAddrBase))
Expand Down
Loading

0 comments on commit 603817e

Please sign in to comment.