From 46eee6ef67ec0ec5f8bb5559d7e6fffc4b990dd7 Mon Sep 17 00:00:00 2001 From: Trivalik_cp <42497cfff885d3ca0e6fda54fb6262dd42101bd5sx56jUzf> Date: Thu, 7 Apr 2011 19:50:01 +0000 Subject: [PATCH] fix dbg for 64 bit parameters --- source2/IL2CPU/Cosmos.IL2CPU.X86/AppAssemblerNasm.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source2/IL2CPU/Cosmos.IL2CPU.X86/AppAssemblerNasm.cs b/source2/IL2CPU/Cosmos.IL2CPU.X86/AppAssemblerNasm.cs index faf8f198a..e8eb384d6 100644 --- a/source2/IL2CPU/Cosmos.IL2CPU.X86/AppAssemblerNasm.cs +++ b/source2/IL2CPU/Cosmos.IL2CPU.X86/AppAssemblerNasm.cs @@ -153,15 +153,19 @@ namespace Cosmos.IL2CPU.X86 var xParams = aMethod.MethodBase.GetParameters(); var xParamCount = (ushort)xParams.Length; + for (ushort i = 0; i < xParamCount; i++) { + var xOffset = IL.Ldarg.GetArgumentDisplacement(aMethod, (ushort)(i + xIdxOffset)); + // if last argument is 8 byte long, we need to add 4, so that debugger could read all 8 bytes from this variable in positiv direction + xOffset -= (int)Cosmos.IL2CPU.X86.ILOp.Align(Cosmos.IL2CPU.X86.ILOp.SizeOfType(xParams[i].ParameterType), 4) - 4; mLocals_Arguments_Infos.Add(new DebugInfo.Local_Argument_Info { MethodLabelName = xMethodLabel, IsArgument = true, Index = (int)(i + xIdxOffset), Name = xParams[i].Name, - Offset = (int)IL.Ldarg.GetArgumentDisplacement(aMethod, (ushort)(i + xIdxOffset)), + Offset = xOffset, Type=xParams[i].ParameterType.AssemblyQualifiedName }); }