Beispiel #1
0
        private IEnumerable <SYMBOL_INFO> Enumerate(Action <IntPtr> action)
        {
            PdbStore store = GetStore(action);

            foreach (SYMBOL_INFO si in store.Enumerate())
            {
                yield return(si);
            }
        }
Beispiel #2
0
        private static unsafe bool enum_proc(IntPtr pinfo, uint size, IntPtr pUserContext)
        {
            SYMBOL_INFO info = SYMBOL_INFO.Create(pinfo);

            PdbStore pdbStore = (PdbStore)Marshal.GetObjectForNativeVariant(pUserContext);

            pdbStore.Add(info);

            return(true);
        }
Beispiel #3
0
        private PdbStore GetStore(Action <IntPtr> action)
        {
            PdbStore store = new PdbStore();

            IntPtr pStore = Marshal.AllocHGlobal(16); // 16 == sizeof(VARIANT)

            Marshal.GetNativeVariantForObject(store, pStore);

            action(pStore);

            return(store);
        }
Beispiel #4
0
        public static PdbStore CreateTypeStore(string pdbFilePath, IntPtr baseAddress, int memorySize)
        {
            PdbStore store = null;

            using (PdbDump pdbDumper = new PdbDump(pdbFilePath, baseAddress, memorySize))
            {
                store = pdbDumper.GetStore((pStore) =>
                {
                    NativeMethods.SymEnumTypes(pdbDumper._hProcess, (ulong)baseAddress.ToInt64(), enum_proc, pStore);
                });
            }

            return(store);
        }