Exemple #1
0
        private void UpdateDisplay(ulong address, byte[] memory)
        {
            var parameters = DebugSource.GetMethodParameters(method);

            if (parameters == null || parameters.Count == 0)
            {
                return;
            }

            long offset = (long)(address - StackFrame);

            foreach (var parameter in parameters)
            {
                var type = DebugSource.GetTypeInfo(parameter.ParameterTypeID);

                uint size = (parameter.Size == NativeIntegerSize || parameter.Size == NativeIntegerSize * 2) ? parameter.Size : 0;

                if (size == 0 && parameter.Size <= NativeIntegerSize)
                {
                    size = NativeIntegerSize;
                }

                ulong value = (size != 0) ? MainForm.ToLong(memory, parameter.Offset, size) : 0;

                var entry = new StackEntry()
                {
                    Index  = (int)parameter.Index,
                    Name   = parameter.Name,
                    Offset = Platform.StackFrame.Name.ToUpperInvariant() +
                             (offset >= 0
                                                ? "+" + BasePlatform.ToHex(offset + parameter.Offset, 1)
                                                : "-" + BasePlatform.ToHex(-offset + parameter.Offset, 1)),
                    Address  = BasePlatform.ToHex(StackFrame + parameter.Offset, size),
                    Size     = size,
                    Value    = value,
                    HexValue = BasePlatform.ToHex(value, size),
                    Type     = type.FullName,
                    Info     = MainForm.GetAddressInfo(value)
                };

                stackentries.Add(entry);
            }
        }