@@ -201,84 +201,87 @@ QString MemoryMapView::paintContent(QPainter* painter, int_t rowBase, int rowOff
201
201
return StdTable::paintContent (painter, rowBase, rowOffset, col, x, y, w, h);
202
202
}
203
203
204
- void MemoryMapView::stateChangedSlot (DBGSTATE state )
204
+ void MemoryMapView::refreshMap ( )
205
205
{
206
- if (state == paused)
206
+ MEMMAP wMemMapStruct;
207
+ int wI;
208
+
209
+ memset (&wMemMapStruct, 0 , sizeof (MEMMAP));
210
+
211
+ DbgMemMap (&wMemMapStruct);
212
+
213
+ setRowCount (wMemMapStruct.count );
214
+
215
+ for (wI = 0 ; wI < wMemMapStruct.count ; wI++)
207
216
{
208
- MEMMAP wMemMapStruct ;
209
- int wI ;
217
+ QString wS ;
218
+ MEMORY_BASIC_INFORMATION wMbi = (wMemMapStruct. page )[wI]. mbi ;
210
219
211
- memset (&wMemMapStruct, 0 , sizeof (MEMMAP));
220
+ // Base address
221
+ wS = QString (" %1" ).arg ((uint_t )wMbi.BaseAddress , sizeof (uint_t ) * 2 , 16 , QChar (' 0' )).toUpper ();
222
+ setCellContent (wI, 0 , wS);
212
223
213
- DbgMemMap (&wMemMapStruct);
224
+ // Size
225
+ wS = QString (" %1" ).arg ((uint_t )wMbi.RegionSize , sizeof (uint_t ) * 2 , 16 , QChar (' 0' )).toUpper ();
226
+ setCellContent (wI, 1 , wS);
214
227
215
- setRowCount (wMemMapStruct.count );
228
+ // Information
229
+ wS = QString ((wMemMapStruct.page )[wI].info );
230
+ setCellContent (wI, 2 , wS);
216
231
217
- for (wI = 0 ; wI < wMemMapStruct.count ; wI++)
232
+ // State
233
+ switch (wMbi.State )
218
234
{
219
- QString wS;
220
- MEMORY_BASIC_INFORMATION wMbi = (wMemMapStruct.page )[wI].mbi ;
221
-
222
- // Base address
223
- wS = QString (" %1" ).arg ((uint_t )wMbi.BaseAddress , sizeof (uint_t ) * 2 , 16 , QChar (' 0' )).toUpper ();
224
- setCellContent (wI, 0 , wS);
225
-
226
- // Size
227
- wS = QString (" %1" ).arg ((uint_t )wMbi.RegionSize , sizeof (uint_t ) * 2 , 16 , QChar (' 0' )).toUpper ();
228
- setCellContent (wI, 1 , wS);
229
-
230
- // Information
231
- wS = QString ((wMemMapStruct.page )[wI].info );
232
- setCellContent (wI, 2 , wS);
233
-
234
- // State
235
- switch (wMbi.State )
236
- {
237
- case MEM_FREE:
238
- wS = QString (" FREE" );
239
- break ;
240
- case MEM_COMMIT:
241
- wS = QString (" COMM" );
242
- break ;
243
- case MEM_RESERVE:
244
- wS = QString (" RESV" );
245
- break ;
246
- default :
247
- wS = QString (" ????" );
248
- }
249
- setCellContent (wI, 3 , wS);
250
-
251
- // Type
252
- switch (wMbi.Type )
253
- {
254
- case MEM_IMAGE:
255
- wS = QString (" IMG" );
256
- break ;
257
- case MEM_MAPPED:
258
- wS = QString (" MAP" );
259
- break ;
260
- case MEM_PRIVATE:
261
- wS = QString (" PRV" );
262
- break ;
263
- default :
264
- wS = QString (" N/A" );
265
- break ;
266
- }
267
- setCellContent (wI, 3 , wS);
268
-
269
- // current access protection
270
- wS = getProtectionString (wMbi.Protect );
271
- setCellContent (wI, 4 , wS);
272
-
273
- // allocation protection
274
- wS = getProtectionString (wMbi.AllocationProtect );
275
- setCellContent (wI, 5 , wS);
235
+ case MEM_FREE:
236
+ wS = QString (" FREE" );
237
+ break ;
238
+ case MEM_COMMIT:
239
+ wS = QString (" COMM" );
240
+ break ;
241
+ case MEM_RESERVE:
242
+ wS = QString (" RESV" );
243
+ break ;
244
+ default :
245
+ wS = QString (" ????" );
246
+ }
247
+ setCellContent (wI, 3 , wS);
276
248
249
+ // Type
250
+ switch (wMbi.Type )
251
+ {
252
+ case MEM_IMAGE:
253
+ wS = QString (" IMG" );
254
+ break ;
255
+ case MEM_MAPPED:
256
+ wS = QString (" MAP" );
257
+ break ;
258
+ case MEM_PRIVATE:
259
+ wS = QString (" PRV" );
260
+ break ;
261
+ default :
262
+ wS = QString (" N/A" );
263
+ break ;
277
264
}
278
- if (wMemMapStruct.page != 0 )
279
- BridgeFree (wMemMapStruct.page );
280
- reloadData (); // refresh memory map
265
+ setCellContent (wI, 3 , wS);
266
+
267
+ // current access protection
268
+ wS = getProtectionString (wMbi.Protect );
269
+ setCellContent (wI, 4 , wS);
270
+
271
+ // allocation protection
272
+ wS = getProtectionString (wMbi.AllocationProtect );
273
+ setCellContent (wI, 5 , wS);
274
+
281
275
}
276
+ if (wMemMapStruct.page != 0 )
277
+ BridgeFree (wMemMapStruct.page );
278
+ reloadData (); // refresh memory map
279
+ }
280
+
281
+ void MemoryMapView::stateChangedSlot (DBGSTATE state)
282
+ {
283
+ if (state == paused)
284
+ refreshMap ();
282
285
}
283
286
284
287
void MemoryMapView::followDumpSlot ()
@@ -353,21 +356,11 @@ void MemoryMapView::memoryExecuteSingleshootToggleSlot()
353
356
354
357
void MemoryMapView::pageMemoryRights ()
355
358
{
356
- PageMemoryRights* mPageMemoryRightsDialog = new PageMemoryRights (this );
357
-
358
- #ifdef _WIN64
359
+ PageMemoryRights PageMemoryRightsDialog (this );
360
+ connect (&PageMemoryRightsDialog, SIGNAL (refreshMemoryMap ()), this , SLOT (refreshMap ()));
359
361
uint_t addr = getCellContent (getInitialSelection (), 0 ).toULongLong (0 , 16 );
360
- #else // x86
361
- uint_t addr = getCellContent (getInitialSelection (), 0 ).toULong (0 , 16 );
362
- #endif // _WIN64
363
-
364
- #ifdef _WIN64
365
362
uint_t size = getCellContent (getInitialSelection (), 1 ).toULongLong (0 , 16 );
366
- #else // x86
367
- uint_t size = getCellContent (getInitialSelection (), 1 ).toULong (0 , 16 );
368
- #endif // _WIN64
369
-
370
- mPageMemoryRightsDialog ->RunAddrSize (addr, size, getCellContent (getInitialSelection (), 3 ));
363
+ PageMemoryRightsDialog.RunAddrSize (addr, size, getCellContent (getInitialSelection (), 3 ));
371
364
}
372
365
373
366
void MemoryMapView::switchView ()
0 commit comments