mirror of
https://github.com/par274/sharpemu.git
synced 2026-08-01 15:39:47 +08:00
core: report what occupies a fixed-address allocation on failure (#278)
* Implement DescribeAddressForDiagnostics method Added a method to describe the state of a memory address for diagnostics. * core: enrich allocation failure exception with host region diagnostic
This commit is contained in:
@@ -197,8 +197,9 @@ public sealed class SelfLoader : ISelfLoader
|
||||
{
|
||||
if (!physicalVm.TryAllocateAtExact(imageBase, totalImageSize, executable: true, out var allocatedBase))
|
||||
{
|
||||
var reason = physicalVm.DescribeAddressForDiagnostics(imageBase);
|
||||
throw new InvalidOperationException(
|
||||
$"Could not allocate main image at required base 0x{imageBase:X16} (size=0x{totalImageSize:X}).");
|
||||
$"Could not allocate main image at required base 0x{imageBase:X16} (size=0x{totalImageSize:X}): {reason}.");
|
||||
}
|
||||
|
||||
imageBase = allocatedBase;
|
||||
|
||||
Reference in New Issue
Block a user