@@ -35,7 +35,6 @@ static bool bSkipExceptions = false;
35
35
static bool bBreakOnNextDll = false ;
36
36
static int ecount = 0 ;
37
37
static std::vector<ExceptionRange> ignoredExceptionRange;
38
- static SIZE_T cachePrivateUsage = 0 ;
39
38
static HANDLE hEvent = 0 ;
40
39
static HANDLE hProcess = 0 ;
41
40
static HANDLE hMemMapThread = 0 ;
@@ -64,13 +63,8 @@ static DWORD WINAPI memMapThread(void* ptr)
64
63
}
65
64
if (bStopMemMapThread)
66
65
break ;
67
- const SIZE_T PrivateUsage = dbggetprivateusage (fdProcessInfo->hProcess );
68
- if (cachePrivateUsage != PrivateUsage && !dbgisrunning ()) // update the memory map when the memory usage changed
69
- {
70
- cachePrivateUsage = PrivateUsage;
71
- MemUpdateMap ();
72
- GuiUpdateMemoryView ();
73
- }
66
+ MemUpdateMap ();
67
+ GuiUpdateMemoryView ();
74
68
Sleep (1000 );
75
69
}
76
70
return 0 ;
@@ -115,17 +109,6 @@ void dbgstop()
115
109
WaitForThreadTermination (hTimeWastedCounterThread);
116
110
}
117
111
118
- SIZE_T dbggetprivateusage (HANDLE hProcess, bool update)
119
- {
120
- PROCESS_MEMORY_COUNTERS_EX memoryCounters;
121
- memoryCounters.cb = sizeof (PROCESS_MEMORY_COUNTERS_EX);
122
- if (!GetProcessMemoryInfo (fdProcessInfo->hProcess , (PPROCESS_MEMORY_COUNTERS)&memoryCounters, sizeof (PROCESS_MEMORY_COUNTERS_EX)))
123
- return 0 ;
124
- if (update)
125
- cachePrivateUsage = memoryCounters.PrivateUsage ;
126
- return memoryCounters.PrivateUsage ;
127
- }
128
-
129
112
duint dbgdebuggedbase ()
130
113
{
131
114
return pDebuggedBase;
@@ -642,7 +625,6 @@ static void cbCreateProcess(CREATE_PROCESS_DEBUG_INFO* CreateProcessInfo)
642
625
dprintf (" Process Started: " fhex " %s\n " , base, DebugFileName);
643
626
644
627
// update memory map
645
- dbggetprivateusage (fdProcessInfo->hProcess , true );
646
628
MemUpdateMap ();
647
629
GuiUpdateMemoryView ();
648
630
@@ -764,7 +746,6 @@ static void cbCreateThread(CREATE_THREAD_DEBUG_INFO* CreateThread)
764
746
if (settingboolget (" Events" , " ThreadStart" ))
765
747
{
766
748
// update memory map
767
- dbggetprivateusage (fdProcessInfo->hProcess , true );
768
749
MemUpdateMap ();
769
750
// update GUI
770
751
GuiSetDebugState (paused);
@@ -856,7 +837,6 @@ static void cbLoadDll(LOAD_DLL_DEBUG_INFO* LoadDll)
856
837
ModLoad ((duint)base, modInfo.ImageSize , modInfo.ImageName );
857
838
858
839
// update memory map
859
- dbggetprivateusage (fdProcessInfo->hProcess , true );
860
840
MemUpdateMap ();
861
841
GuiUpdateMemoryView ();
862
842
@@ -984,7 +964,6 @@ static void cbUnloadDll(UNLOAD_DLL_DEBUG_INFO* UnloadDll)
984
964
ModUnload ((duint)base);
985
965
986
966
// update memory map
987
- dbggetprivateusage (fdProcessInfo->hProcess , true );
988
967
MemUpdateMap ();
989
968
GuiUpdateMemoryView ();
990
969
}
@@ -1057,7 +1036,7 @@ static void cbException(EXCEPTION_DEBUG_INFO* ExceptionData)
1057
1036
dputs (" paused!" );
1058
1037
SetNextDbgContinueStatus (DBG_CONTINUE);
1059
1038
GuiSetDebugState (paused);
1060
- dbggetprivateusage (fdProcessInfo-> hProcess , true );
1039
+ // update memory map
1061
1040
MemUpdateMap ();
1062
1041
DebugUpdateGui (GetContextDataEx (hActiveThread, UE_CIP), true );
1063
1042
// lock
@@ -1174,7 +1153,6 @@ DWORD WINAPI threadDebugLoop(void* lpParameter)
1174
1153
varset (" $hp" , (duint)fdProcessInfo->hProcess , true );
1175
1154
varset (" $pid" , fdProcessInfo->dwProcessId , true );
1176
1155
ecount = 0 ;
1177
- cachePrivateUsage = 0 ;
1178
1156
// NOTE: set custom handlers
1179
1157
SetCustomHandler (UE_CH_CREATEPROCESS, (void *)cbCreateProcess);
1180
1158
SetCustomHandler (UE_CH_EXITPROCESS, (void *)cbExitProcess);
@@ -1438,7 +1416,6 @@ DWORD WINAPI threadAttachLoop(void* lpParameter)
1438
1416
bFileIsDll = IsFileDLL (szFileName, 0 );
1439
1417
GuiAddRecentFile (szFileName);
1440
1418
ecount = 0 ;
1441
- cachePrivateUsage = 0 ;
1442
1419
// NOTE: set custom handlers
1443
1420
SetCustomHandler (UE_CH_CREATEPROCESS, (void *)cbCreateProcess);
1444
1421
SetCustomHandler (UE_CH_EXITPROCESS, (void *)cbExitProcess);
0 commit comments