Skip to content

Commit 810371e

Browse files
committed
Remove integration with GameMemory, offer Small and Full dump types
1 parent c0f1045 commit 810371e

File tree

7 files changed

+17
-488
lines changed

7 files changed

+17
-488
lines changed

Core/GameEngine/Include/Common/GameMemory.h

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,6 @@ class MemoryPool;
223223
class MemoryPoolFactory;
224224
class DynamicMemoryAllocator;
225225
class BlockCheckpointInfo;
226-
#ifdef RTS_ENABLE_CRASHDUMP
227-
class AllocationRangeIterator;
228-
#endif
229226

230227
// TYPE DEFINES ///////////////////////////////////////////////////////////////
231228

@@ -282,14 +279,6 @@ class Checkpointable
282279
};
283280
#endif
284281

285-
#ifdef RTS_ENABLE_CRASHDUMP
286-
struct MemoryPoolAllocatedRange
287-
{
288-
const char* allocationAddr;
289-
size_t allocationSize;
290-
};
291-
#endif
292-
293282
// ----------------------------------------------------------------------------
294283
/**
295284
A MemoryPool provides a way to efficiently allocate objects of the same (or similar)
@@ -395,9 +384,6 @@ class MemoryPool
395384
/// return true iff this block was allocated by this pool.
396385
Bool debugIsBlockInPool(void *pBlock);
397386
#endif
398-
#ifdef RTS_ENABLE_CRASHDUMP
399-
friend class AllocationRangeIterator;
400-
#endif
401387
};
402388

403389
// ----------------------------------------------------------------------------
@@ -488,52 +474,13 @@ class DynamicMemoryAllocator
488474
Bool debugIsPoolInDma(MemoryPool *pool);
489475

490476
#endif // MEMORYPOOL_DEBUG
491-
#ifdef RTS_ENABLE_CRASHDUMP
492-
MemoryPoolSingleBlock* getFirstRawBlock() const;
493-
MemoryPoolSingleBlock* getNextRawBlock(const MemoryPoolSingleBlock* block) const;
494-
void fillAllocationRangeForRawBlock(const MemoryPoolSingleBlock*, MemoryPoolAllocatedRange& allocationRange) const;
495-
#endif
496477
};
497478

498479
// ----------------------------------------------------------------------------
499480
#ifdef MEMORYPOOL_DEBUG
500481
enum { MAX_SPECIAL_USED = 256 };
501482
#endif
502483

503-
#ifdef RTS_ENABLE_CRASHDUMP
504-
class AllocationRangeIterator
505-
{
506-
typedef const MemoryPoolAllocatedRange value_type;
507-
typedef const MemoryPoolAllocatedRange* pointer;
508-
typedef const MemoryPoolAllocatedRange& reference;
509-
510-
public:
511-
512-
AllocationRangeIterator();
513-
AllocationRangeIterator(const MemoryPoolFactory* factory);
514-
AllocationRangeIterator(MemoryPool& pool, MemoryPoolBlob& blob);
515-
AllocationRangeIterator(MemoryPool* pool, MemoryPoolBlob* blob);
516-
517-
reference operator*() { return m_range; }
518-
pointer operator->() { return &m_range; }
519-
520-
AllocationRangeIterator& operator++();
521-
AllocationRangeIterator operator++(int);
522-
523-
friend const bool operator== (const AllocationRangeIterator& a, const AllocationRangeIterator& b);
524-
friend const bool operator!= (const AllocationRangeIterator& a, const AllocationRangeIterator& b);
525-
526-
private:
527-
528-
void updateRange();
529-
void moveToNextBlob();
530-
const MemoryPoolFactory* m_factory;
531-
MemoryPool* m_currentPool;
532-
MemoryPoolBlob* m_currentBlobInPool;
533-
MemoryPoolAllocatedRange m_range;
534-
};
535-
#endif
536-
537484
// ----------------------------------------------------------------------------
538485
/**
539486
The class that manages all the MemoryPools and DynamicMemoryAllocators.
@@ -626,20 +573,6 @@ class MemoryPoolFactory
626573
void debugResetCheckpoints();
627574

628575
#endif
629-
#ifdef RTS_ENABLE_CRASHDUMP
630-
AllocationRangeIterator cbegin() const
631-
{
632-
return AllocationRangeIterator(this);
633-
}
634-
635-
AllocationRangeIterator cend() const
636-
{
637-
return AllocationRangeIterator(NULL, NULL);
638-
}
639-
640-
MemoryPool* getFirstMemoryPool() const;
641-
friend class AllocationRangeIterator;
642-
#endif
643576
};
644577

645578
// how many bytes are we allowed to 'waste' per pool allocation before the debug code starts yelling at us...

Core/GameEngine/Include/Common/MiniDumper.h

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ enum DumpType CPP_11(: Char)
2525
{
2626
// Smallest dump type with call stacks and some supporting variables
2727
DumpType_Minimal = 'M',
28-
// Large dump including all memory regions allocated by the GameMemory implementation
29-
DumpType_Gamememory = 'X',
3028
// Largest dump size including complete memory contents of the process
3129
DumpType_Full = 'F',
3230
};
@@ -41,15 +39,6 @@ class MiniDumper
4139
MiniDumperExitCode_ForcedTerminate = 0x158B1154,
4240
};
4341

44-
enum DumpObjectsState CPP_11(: Int)
45-
{
46-
DumpObjectsState_Begin,
47-
DumpObjectsState_MemoryPools,
48-
DumpObjectsState_MemoryPoolAllocations,
49-
DumpObjectsState_DMAAllocations,
50-
DumpObjectsState_Completed
51-
};
52-
5342
public:
5443
MiniDumper();
5544
Bool IsInitialized() const;
@@ -66,16 +55,6 @@ class MiniDumper
6655
void CleanupResources();
6756
Bool IsDumpThreadStillRunning() const;
6857
void ShutdownDumpThread();
69-
Bool ShouldWriteDataSegsForModule(const PWCHAR module) const;
70-
#ifndef DISABLE_GAMEMEMORY
71-
void MoveToNextAllocatorWithRawBlocks();
72-
void MoveToNextSingleBlock();
73-
void DumpMemoryObjects(ULONG64& memoryBase, ULONG& memorySize);
74-
#endif
75-
76-
// Callbacks from dbghelp
77-
static BOOL CALLBACK MiniDumpCallback(PVOID CallbackParam, PMINIDUMP_CALLBACK_INPUT CallbackInput, PMINIDUMP_CALLBACK_OUTPUT CallbackOutput);
78-
BOOL CallbackInternal(const MINIDUMP_CALLBACK_INPUT& input, MINIDUMP_CALLBACK_OUTPUT& output);
7958

8059
// Thread procs
8160
static DWORD WINAPI MiniDumpThreadProc(LPVOID lpParam);
@@ -112,16 +91,6 @@ class MiniDumper
11291
// Thread handles
11392
HANDLE m_dumpThread;
11493
DWORD m_dumpThreadId;
115-
116-
#ifndef DISABLE_GAMEMEMORY
117-
// Internal memory dumping progress state
118-
DumpObjectsState m_dumpObjectsState;
119-
DynamicMemoryAllocator* m_currentAllocator;
120-
MemoryPool* m_currentPool;
121-
MemoryPoolSingleBlock* m_currentSingleBlock;
122-
123-
AllocationRangeIterator m_rangeIter;
124-
#endif
12594
};
12695

12796
extern MiniDumper* TheMiniDumper;

Core/GameEngine/Source/Common/System/Debug.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -736,9 +736,9 @@ static void TriggerMiniDump()
736736
#ifdef RTS_ENABLE_CRASHDUMP
737737
if (TheMiniDumper && TheMiniDumper->IsInitialized())
738738
{
739-
// Do dumps both with and without extended info
739+
// Create both minimal and full memory dumps
740740
TheMiniDumper->TriggerMiniDump(DumpType_Minimal);
741-
TheMiniDumper->TriggerMiniDump(DumpType_Gamememory);
741+
TheMiniDumper->TriggerMiniDump(DumpType_Full);
742742
}
743743

744744
MiniDumper::shutdownMiniDumper();

0 commit comments

Comments
 (0)