Skip to content

Commit

Permalink
Merge pull request #1429 from microsoft/main
Browse files Browse the repository at this point in the history
Merge 'main' into 'release_mdd'
  • Loading branch information
WardenGnaw committed Nov 29, 2023
2 parents 3ac1f31 + 9f35772 commit 3b0d344
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/MIDebugEngine/AD7.Impl/AD7Disassembly.cs
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,14 @@ public int GetCodeContext(ulong uCodeLocationId, out IDebugCodeContext2 ppCodeCo
public int GetCodeLocationId(IDebugCodeContext2 pCodeContext, out ulong puCodeLocationId)
{
AD7MemoryAddress addr = pCodeContext as AD7MemoryAddress;
puCodeLocationId = addr.Address;
return Constants.S_OK;
if (addr != null)
{
puCodeLocationId = addr.Address;
return Constants.S_OK;
}

puCodeLocationId = 0;
return Constants.E_FAIL;
}

public int GetCurrentLocation(out ulong puCodeLocationId)
Expand Down
30 changes: 28 additions & 2 deletions src/MIDebugEngine/AD7.Impl/AD7Property.cs
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,37 @@ public int GetMemoryContext(out IDebugMemoryContext2 ppMemory)
{
return AD7_HRESULT.S_GETMEMORYCONTEXT_NO_MEMORY_CONTEXT;
}
v = v.Trim();

if ((v[0] == '[') && (v[v.Length-1] == ']'))
{
// this is an array evaluation result from GDB, which does not contain an address
// VS on the other hand supports direct array evaluations without address operator
// therefore we need to re-evaluate with an address operator
//
VariableInformation viArray = new VariableInformation("&(" + _variableInformation.FullName() + ")", (VariableInformation)_variableInformation);
viArray.SyncEval();
if (viArray.Error)
{
return AD7_HRESULT.S_GETMEMORYCONTEXT_NO_MEMORY_CONTEXT;
}
v = viArray.Value;
v.Trim();
if (v.Length == 0)
{
return AD7_HRESULT.S_GETMEMORYCONTEXT_NO_MEMORY_CONTEXT;
}
}

if (v[0] == '{')
{
var index = v.IndexOf('}');
if (index == -1)
{
// syntax error!
return AD7_HRESULT.S_GETMEMORYCONTEXT_NO_MEMORY_CONTEXT;
}
// strip type name and trailing spaces
v = v.Substring(v.IndexOf('}') + 1);
v = v.Substring(index+1);
v = v.Trim();
}
int i = v.IndexOf(' ');
Expand Down
2 changes: 1 addition & 1 deletion src/SSHDebugPS/SSHDebugPS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<TargetFramework>net472</TargetFramework>
<UseWPF>true</UseWPF>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<IncludePackageReferencesDuringMarkupCompilation>false</IncludePackageReferencesDuringMarkupCompilation>
<IncludePackageReferencesDuringMarkupCompilation>true</IncludePackageReferencesDuringMarkupCompilation>
</PropertyGroup>

<Import Project="..\..\build\Debugger.PIAs.NonPortable.Packages.settings.targets" />
Expand Down

0 comments on commit 3b0d344

Please sign in to comment.