Пример #1
0
        static MemoryReadingReportModel.Dict BuildReport(PyDict dict, IPythonMemoryReader reader)
        {
            if (dict == null)
            {
                return(null);
            }

            dict.LoadType(reader);

            var slotsFiltered =
                dict?.Slots
                ?.Take(dictSlotCountUpperBound)
                ?.Select((slot, index) => BuildReport(slot, reader)?.WithSlotIndex(index))
                ?.Where(slotReport => slotReport?.Key != null || slotReport?.Value != null)
                ?.ToArray();

            return(new MemoryReadingReportModel.Dict
            {
                BaseAddress = dict.BaseAddress,
                PyTypeObjAddress = dict.ob_type,
                PyTypeName = dict.TypeObject?.tp_name_Val,
                SlotsFiltered = slotsFiltered,
            });
        }