5
#include <boost/thread/recursive_mutex.hpp>
6
#include <boost/atomic.hpp>
13
///////////////////////////////////////////////////////////////////////////////
16
typedef boost::shared_ptr<ProcessInfo> ProcessInfoPtr;
18
///////////////////////////////////////////////////////////////////////////////
24
ModulePtr getModule(MEMOFFSET_64 offset);
25
void insertModule( ModulePtr& module);
26
void removeModule(MEMOFFSET_64 offset );
28
TypeInfoPtr getTypeInfo(const std::wstring& name);
29
void insertTypeInfo(const TypeInfoPtr& typeInfo);
31
void insertBreakpoint(const BreakpointPtr& breakpoint);
32
void removeBreakpoint(const BreakpointPtr& breakpoint);
34
DebugCallbackResult breakpointHit(BreakpointPtr& breakpoint);
36
void onChangeSymbolPaths();
40
typedef std::map<MEMOFFSET_64, ModulePtr> ModuleMap;
41
ModuleMap m_moduleMap;
42
boost::recursive_mutex m_moduleLock;
44
typedef std::map<std::wstring, TypeInfoPtr> TypeInfoMap;
45
TypeInfoMap m_typeInfoMap;
46
boost::recursive_mutex m_typeInfoLock;
48
typedef std::map<BREAKPOINT_ID, BreakpointPtr> BreakpointIdMap;
49
BreakpointIdMap m_breakpointMap;
50
boost::recursive_mutex m_breakpointLock;
53
///////////////////////////////////////////////////////////////////////////////
55
class ProcessMonitorImpl {
59
ProcessMonitorImpl() : m_bpUnique(0x80000000)
67
DebugCallbackResult processStart(PROCESS_DEBUG_ID id);
68
DebugCallbackResult processStop(PROCESS_DEBUG_ID id, ProcessExitReason reason, unsigned int ExitCode);
69
void processAllDetach();
70
void processAllTerminate();
71
unsigned int getNumberProcesses();
73
DebugCallbackResult createThread();
74
DebugCallbackResult stopThread();
76
DebugCallbackResult moduleLoad(PROCESS_DEBUG_ID id, MEMOFFSET_64 offset, const std::wstring& moduleName);
77
DebugCallbackResult moduleUnload(PROCESS_DEBUG_ID id, MEMOFFSET_64 offset, const std::wstring& moduleName);
78
DebugCallbackResult breakpointHit(PROCESS_DEBUG_ID id, BreakpointPtr& breakpoint);
79
void currentThreadChange(THREAD_DEBUG_ID threadid);
80
void executionStatusChange(ExecutionStatus status);
81
void localScopeChange();
82
void changeSymbolPaths();
83
void breakpointsChange(PROCESS_DEBUG_ID id);
84
DebugCallbackResult exceptionHit(const ExceptionInfo& excinfo);
85
void debugOutput(const std::wstring& text, OutputFlag flag);
89
ModulePtr getModule( MEMOFFSET_64 offset, PROCESS_DEBUG_ID id );
90
void insertModule( ModulePtr& module, PROCESS_DEBUG_ID id );
92
TypeInfoPtr getTypeInfo(const std::wstring& name, PROCESS_DEBUG_ID id = -1);
93
void insertTypeInfo(const TypeInfoPtr& typeInfo, PROCESS_DEBUG_ID id = -1);
95
void registerEventsCallback(DebugEventsCallback *callback);
96
void removeEventsCallback(DebugEventsCallback *callback);
98
void registerBreakpoint( const BreakpointPtr& breakpoint, PROCESS_DEBUG_ID id = -1 );
99
void removeBreakpoint( const BreakpointPtr& breakpoint, PROCESS_DEBUG_ID id = -1 );
103
ProcessInfoPtr getProcess( PROCESS_DEBUG_ID id );
105
boost::recursive_mutex m_lock;
107
typedef std::map<PROCESS_DEBUG_ID, ProcessInfoPtr> ProcessMap;
108
ProcessMap m_processMap;
110
boost::atomic<unsigned long long> m_bpUnique;
114
typedef std::list<DebugEventsCallback*> EventsCallbackList;
116
boost::recursive_mutex m_callbacksLock;
117
EventsCallbackList m_callbacks;
120
ProcessMonitorImpl* g_procmon;
122
///////////////////////////////////////////////////////////////////////////////
124
class CurrentProcessGuard {
128
CurrentProcessGuard() :
129
m_procId( getCurrentProcessId() )
132
~CurrentProcessGuard() {
133
setCurrentProcessById(m_procId);
138
PROCESS_DEBUG_ID m_procId;
141
///////////////////////////////////////////////////////////////////////////////
143
void ProcessMonitor::init()
146
g_procmon = new ProcessMonitorImpl();
149
///////////////////////////////////////////////////////////////////////////////
151
void ProcessMonitor::deinit()
160
/////////////////////////////////////////////////////////////////////////////
162
void ProcessMonitor::registerEventsCallback(DebugEventsCallback *callback)
164
g_procmon->registerEventsCallback(callback);
167
/////////////////////////////////////////////////////////////////////////////
169
void ProcessMonitor::removeEventsCallback(DebugEventsCallback *callback)
171
g_procmon->removeEventsCallback(callback);
174
/////////////////////////////////////////////////////////////////////////////
176
void ProcessMonitor::registerBreakpoint( const BreakpointPtr& breakpoint, PROCESS_DEBUG_ID id )
179
id = getCurrentProcessId();
181
g_procmon->registerBreakpoint(breakpoint, id);
185
/////////////////////////////////////////////////////////////////////////////
187
void ProcessMonitor::removeBreakpoint( const BreakpointPtr& breakpoint, PROCESS_DEBUG_ID id )
190
id = getCurrentProcessId();
192
g_procmon->removeBreakpoint(breakpoint, id);
195
/////////////////////////////////////////////////////////////////////////////
197
DebugCallbackResult ProcessMonitor::processStart(PROCESS_DEBUG_ID id)
199
return g_procmon->processStart(id);
202
/////////////////////////////////////////////////////////////////////////////
204
DebugCallbackResult ProcessMonitor::processStop(PROCESS_DEBUG_ID id, ProcessExitReason reason, unsigned int exitCode)
206
return g_procmon->processStop(id, reason, exitCode);
209
///////////////////////////////////////////////////////////////////////////////
211
DebugCallbackResult ProcessMonitor::createThread()
213
return g_procmon->createThread();
216
///////////////////////////////////////////////////////////////////////////////
218
DebugCallbackResult ProcessMonitor::stopThread()
220
return g_procmon->stopThread();
223
///////////////////////////////////////////////////////////////////////////////
225
void ProcessMonitor::processAllTerminate()
227
g_procmon->processAllTerminate();
230
///////////////////////////////////////////////////////////////////////////////
232
void ProcessMonitor::processAllDetach()
234
g_procmon->processAllDetach();
237
///////////////////////////////////////////////////////////////////////////////
239
unsigned int ProcessMonitor::getNumberProcesses()
241
return g_procmon->getNumberProcesses();
244
///////////////////////////////////////////////////////////////////////////////
246
DebugCallbackResult ProcessMonitor::moduleLoad(PROCESS_DEBUG_ID id, MEMOFFSET_64 offset, const std::wstring& moduleName)
248
return g_procmon->moduleLoad(id, offset, moduleName);
251
///////////////////////////////////////////////////////////////////////////////
253
DebugCallbackResult ProcessMonitor::moduleUnload(PROCESS_DEBUG_ID id, MEMOFFSET_64 offset, const std::wstring& moduleName)
255
return g_procmon->moduleUnload(id, offset, moduleName);
258
///////////////////////////////////////////////////////////////////////////////
260
DebugCallbackResult ProcessMonitor::breakpointHit(PROCESS_DEBUG_ID id, BreakpointPtr& breakpoint)
262
return g_procmon->breakpointHit(id, breakpoint);
265
///////////////////////////////////////////////////////////////////////////////
267
void ProcessMonitor::currentThreadChange(THREAD_DEBUG_ID id)
269
g_procmon->currentThreadChange(id);
272
///////////////////////////////////////////////////////////////////////////////
274
void ProcessMonitor::executionStatusChange(ExecutionStatus status)
276
g_procmon->executionStatusChange(status);
279
///////////////////////////////////////////////////////////////////////////////
281
void ProcessMonitor::localScopeChange()
283
g_procmon->localScopeChange();
286
///////////////////////////////////////////////////////////////////////////////
288
void ProcessMonitor::changeSymbolPaths()
290
g_procmon->changeSymbolPaths();
293
///////////////////////////////////////////////////////////////////////////////
295
void ProcessMonitor::breakpointsChange(PROCESS_DEBUG_ID id)
297
g_procmon->breakpointsChange(id);
300
///////////////////////////////////////////////////////////////////////////////
302
DebugCallbackResult ProcessMonitor::exceptionHit(const ExceptionInfo& excinfo)
304
return g_procmon->exceptionHit(excinfo);
307
///////////////////////////////////////////////////////////////////////////////
309
void ProcessMonitor::debugOutput(const std::wstring& text, OutputFlag flag)
311
g_procmon->debugOutput(text, flag);
314
///////////////////////////////////////////////////////////////////////////////
316
void ProcessMonitor::startInput()
318
g_procmon->startInput();
321
///////////////////////////////////////////////////////////////////////////////
323
void ProcessMonitor::stopInput()
325
g_procmon->stopInput();
328
///////////////////////////////////////////////////////////////////////////////
330
ModulePtr ProcessMonitor::getModule( MEMOFFSET_64 offset, PROCESS_DEBUG_ID id )
333
id = getCurrentProcessId();
335
return g_procmon->getModule(offset,id);
338
///////////////////////////////////////////////////////////////////////////////
340
void ProcessMonitor::insertModule( ModulePtr& module, PROCESS_DEBUG_ID id )
343
id = getCurrentProcessId();
345
return g_procmon->insertModule(module, id);
348
///////////////////////////////////////////////////////////////////////////////
350
TypeInfoPtr ProcessMonitor::getTypeInfo(const std::wstring& name, PROCESS_DEBUG_ID id)
353
id = getCurrentProcessId();
355
return g_procmon->getTypeInfo(name, id);
358
///////////////////////////////////////////////////////////////////////////////
360
void ProcessMonitor::insertTypeInfo(const TypeInfoPtr& typeInfo, PROCESS_DEBUG_ID id)
363
id = getCurrentProcessId();
365
return g_procmon->insertTypeInfo(typeInfo, id);
368
///////////////////////////////////////////////////////////////////////////////
370
DebugCallbackResult ProcessMonitorImpl::processStart(PROCESS_DEBUG_ID id)
373
ProcessInfoPtr proc = ProcessInfoPtr(new ProcessInfo());
374
boost::recursive_mutex::scoped_lock l(m_lock);
375
m_processMap[id] = proc;
378
DebugCallbackResult result = DebugCallbackNoChange;
380
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
382
EventsCallbackList::iterator it = m_callbacks.begin();
384
for (; it != m_callbacks.end(); ++it)
386
DebugCallbackResult ret = (*it)->onProcessStart(id);
387
result = ret != DebugCallbackNoChange ? ret : result;
394
///////////////////////////////////////////////////////////////////////////////
396
DebugCallbackResult ProcessMonitorImpl::processStop(PROCESS_DEBUG_ID id, ProcessExitReason reason, unsigned int exitCode)
399
boost::recursive_mutex::scoped_lock l(m_lock);
400
m_processMap.erase(id);
403
DebugCallbackResult result = DebugCallbackNoChange;
405
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
407
EventsCallbackList::iterator it = m_callbacks.begin();
409
for (; it != m_callbacks.end(); ++it)
411
DebugCallbackResult ret = (*it)->onProcessExit(id, reason, exitCode);
412
result = ret != DebugCallbackNoChange ? ret : result;
418
///////////////////////////////////////////////////////////////////////////////
420
DebugCallbackResult ProcessMonitorImpl::createThread()
422
DebugCallbackResult result = DebugCallbackNoChange;
424
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
426
EventsCallbackList::iterator it = m_callbacks.begin();
428
for (; it != m_callbacks.end(); ++it)
430
DebugCallbackResult ret = (*it)->onThreadStart();
431
result = ret != DebugCallbackNoChange ? ret : result;
437
///////////////////////////////////////////////////////////////////////////////
439
DebugCallbackResult ProcessMonitorImpl::stopThread()
441
DebugCallbackResult result = DebugCallbackNoChange;
443
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
445
EventsCallbackList::iterator it = m_callbacks.begin();
447
for (; it != m_callbacks.end(); ++it)
449
DebugCallbackResult ret = (*it)->onThreadStop();
450
result = ret != DebugCallbackNoChange ? ret : result;
456
///////////////////////////////////////////////////////////////////////////////
458
void ProcessMonitorImpl::processAllTerminate()
460
while (!m_processMap.empty())
462
PROCESS_DEBUG_ID id = m_processMap.begin()->first;
463
processStop(id, ProcessTerminate, 0);
467
///////////////////////////////////////////////////////////////////////////////
469
void ProcessMonitorImpl::processAllDetach()
471
while (!m_processMap.empty())
473
PROCESS_DEBUG_ID id = m_processMap.begin()->first;
474
processStop(id, ProcessDetach, 0);
478
///////////////////////////////////////////////////////////////////////////////
480
unsigned int ProcessMonitorImpl::getNumberProcesses()
482
boost::recursive_mutex::scoped_lock l(m_lock);
483
return static_cast<unsigned int>(m_processMap.size());
486
///////////////////////////////////////////////////////////////////////////////
488
ModulePtr ProcessMonitorImpl::getModule( MEMOFFSET_64 offset, PROCESS_DEBUG_ID id )
490
ProcessInfoPtr processInfo = getProcess(id);
495
module = processInfo->getModule(offset);
500
///////////////////////////////////////////////////////////////////////////////
502
DebugCallbackResult ProcessMonitorImpl::moduleLoad(PROCESS_DEBUG_ID id, MEMOFFSET_64 offset, const std::wstring& moduleName)
504
DebugCallbackResult result = DebugCallbackNoChange;
506
ProcessInfoPtr processInfo = getProcess(id);
510
processInfo->removeModule( offset );
514
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
516
EventsCallbackList::iterator it;
517
for (it = m_callbacks.begin(); it != m_callbacks.end(); ++it)
519
DebugCallbackResult ret = (*it)->onModuleLoad(offset, moduleName);
520
result = ret != DebugCallbackNoChange ? ret : result;
526
///////////////////////////////////////////////////////////////////////////////
528
DebugCallbackResult ProcessMonitorImpl::moduleUnload(PROCESS_DEBUG_ID id, MEMOFFSET_64 offset, const std::wstring &moduleName)
530
DebugCallbackResult result = DebugCallbackNoChange;
532
ProcessInfoPtr processInfo = getProcess(id);
535
processInfo->removeModule( offset );
537
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
539
EventsCallbackList::iterator it;
540
for ( it = m_callbacks.begin(); it != m_callbacks.end(); ++it )
542
DebugCallbackResult ret = (*it)->onModuleUnload(offset, moduleName );
543
result = ret != DebugCallbackNoChange ? ret : result;
549
///////////////////////////////////////////////////////////////////////////////
551
DebugCallbackResult ProcessMonitorImpl::breakpointHit(PROCESS_DEBUG_ID id, BreakpointPtr& breakpoint)
553
DebugCallbackResult result = DebugCallbackNoChange;
555
ProcessInfoPtr processInfo = getProcess(id);
557
result = processInfo->breakpointHit(breakpoint);
559
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
561
EventsCallbackList::iterator it;
562
for (it = m_callbacks.begin(); it != m_callbacks.end(); ++it)
564
DebugCallbackResult ret = (*it)->onBreakpoint(breakpoint->getId());
565
result = ret != DebugCallbackNoChange ? ret : result;
571
///////////////////////////////////////////////////////////////////////////////
573
void ProcessMonitorImpl::currentThreadChange(THREAD_DEBUG_ID threadid)
575
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
577
EventsCallbackList::iterator it = m_callbacks.begin();
579
for (; it != m_callbacks.end(); ++it)
581
(*it)->onCurrentThreadChange(threadid);
585
///////////////////////////////////////////////////////////////////////////////
587
void ProcessMonitorImpl::executionStatusChange(ExecutionStatus status)
589
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
591
EventsCallbackList::iterator it = m_callbacks.begin();
593
for (; it != m_callbacks.end(); ++it)
595
(*it)->onExecutionStatusChange(status);
599
///////////////////////////////////////////////////////////////////////////////
601
void ProcessMonitorImpl::localScopeChange()
603
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
605
EventsCallbackList::iterator it = m_callbacks.begin();
607
for (; it != m_callbacks.end(); ++it)
609
(*it)->onChangeLocalScope();
613
///////////////////////////////////////////////////////////////////////////////
615
void ProcessMonitorImpl::changeSymbolPaths()
619
boost::recursive_mutex::scoped_lock l(m_lock);
621
for ( ProcessMap::iterator it = m_processMap.begin(); it != m_processMap.end(); ++it)
622
it->second->onChangeSymbolPaths();
626
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
628
EventsCallbackList::iterator it = m_callbacks.begin();
630
for (; it != m_callbacks.end(); ++it)
632
(*it)->onChangeSymbolPaths();
637
///////////////////////////////////////////////////////////////////////////////
639
void ProcessMonitorImpl::breakpointsChange(PROCESS_DEBUG_ID id)
641
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
643
EventsCallbackList::iterator it = m_callbacks.begin();
645
for (; it != m_callbacks.end(); ++it)
647
(*it)->onChangeBreakpoints();
651
///////////////////////////////////////////////////////////////////////////////
653
DebugCallbackResult ProcessMonitorImpl::exceptionHit(const ExceptionInfo& excinfo)
655
DebugCallbackResult result = DebugCallbackNoChange;
657
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
659
EventsCallbackList::iterator it;
660
for (it = m_callbacks.begin(); it != m_callbacks.end(); ++it)
662
DebugCallbackResult ret = (*it)->onException(excinfo);
663
result = ret != DebugCallbackNoChange ? ret : result;
669
///////////////////////////////////////////////////////////////////////////////
671
void ProcessMonitorImpl::debugOutput(const std::wstring& text, OutputFlag flag)
673
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
675
EventsCallbackList::iterator it;
676
for (it = m_callbacks.begin(); it != m_callbacks.end(); ++it)
678
(*it)->onDebugOutput(text, flag);
682
///////////////////////////////////////////////////////////////////////////////
684
void ProcessMonitorImpl::startInput()
686
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
688
EventsCallbackList::iterator it;
689
for (it = m_callbacks.begin(); it != m_callbacks.end(); ++it)
691
(*it)->onStartInput();
695
///////////////////////////////////////////////////////////////////////////////
697
void ProcessMonitorImpl::stopInput()
699
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
701
EventsCallbackList::iterator it;
702
for (it = m_callbacks.begin(); it != m_callbacks.end(); ++it)
704
(*it)->onStopInput();
708
///////////////////////////////////////////////////////////////////////////////
710
void ProcessMonitorImpl::insertModule( ModulePtr& module, PROCESS_DEBUG_ID id )
712
ProcessInfoPtr processInfo = getProcess(id);
714
return processInfo->insertModule(module);
717
///////////////////////////////////////////////////////////////////////////////
719
TypeInfoPtr ProcessMonitorImpl::getTypeInfo(const std::wstring& name, PROCESS_DEBUG_ID id)
721
ProcessInfoPtr processInfo = getProcess(id);
723
return processInfo->getTypeInfo(name);
725
return TypeInfoPtr();
728
///////////////////////////////////////////////////////////////////////////////
730
void ProcessMonitorImpl::insertTypeInfo(const TypeInfoPtr& typeInfo, PROCESS_DEBUG_ID id)
732
ProcessInfoPtr processInfo = getProcess(id);
734
return processInfo->insertTypeInfo(typeInfo);
737
///////////////////////////////////////////////////////////////////////////////
739
ProcessInfoPtr ProcessMonitorImpl::getProcess( PROCESS_DEBUG_ID id )
741
boost::recursive_mutex::scoped_lock l(m_lock);
743
ProcessMap::iterator it = m_processMap.find(id);
745
if ( it != m_processMap.end() )
748
ProcessInfoPtr proc = ProcessInfoPtr( new ProcessInfo() );
749
m_processMap[id] = proc;
755
///////////////////////////////////////////////////////////////////////////////
757
void ProcessMonitorImpl::registerEventsCallback(DebugEventsCallback *callback)
759
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
760
m_callbacks.push_back(callback);
763
///////////////////////////////////////////////////////////////////////////////
765
void ProcessMonitorImpl::removeEventsCallback(DebugEventsCallback *callback)
767
boost::recursive_mutex::scoped_lock l(m_callbacksLock);
768
m_callbacks.remove(callback);
771
///////////////////////////////////////////////////////////////////////////////
773
void ProcessMonitorImpl::registerBreakpoint( const BreakpointPtr& breakpoint, PROCESS_DEBUG_ID id )
775
ProcessInfoPtr processInfo = getProcess(id);
779
processInfo->insertBreakpoint(breakpoint);
783
///////////////////////////////////////////////////////////////////////////////
785
void ProcessMonitorImpl::removeBreakpoint( const BreakpointPtr& breakpoint, PROCESS_DEBUG_ID id )
787
ProcessInfoPtr processInfo = getProcess(id);
791
processInfo->removeBreakpoint(breakpoint);
795
///////////////////////////////////////////////////////////////////////////////
797
ModulePtr ProcessInfo::getModule(MEMOFFSET_64 offset)
799
boost::recursive_mutex::scoped_lock l(m_moduleLock);
801
ModuleMap::iterator it = m_moduleMap.find(offset);
803
if ( it != m_moduleMap.end() )
806
for ( ModuleMap::iterator it = m_moduleMap.begin(); it != m_moduleMap.end(); ++it )
808
if ( it->second->getBase() <= offset && offset < it->second->getEnd() )
817
///////////////////////////////////////////////////////////////////////////////
819
void ProcessInfo::insertModule( ModulePtr& module)
821
boost::recursive_mutex::scoped_lock l(m_moduleLock);
822
m_moduleMap[ module->getBase() ] = module;
825
///////////////////////////////////////////////////////////////////////////////
827
void ProcessInfo::removeModule(MEMOFFSET_64 offset )
829
boost::recursive_mutex::scoped_lock l(m_moduleLock);
830
m_moduleMap.erase(offset);
833
///////////////////////////////////////////////////////////////////////////////
835
TypeInfoPtr ProcessInfo::getTypeInfo(const std::wstring& name)
837
boost::recursive_mutex::scoped_lock l(m_typeInfoLock);
839
TypeInfoMap::iterator it = m_typeInfoMap.find(name);
841
if (it != m_typeInfoMap.end())
844
return TypeInfoPtr();
847
///////////////////////////////////////////////////////////////////////////////
849
void ProcessInfo::insertTypeInfo(const TypeInfoPtr& typeInfo)
851
boost::recursive_mutex::scoped_lock l(m_typeInfoLock);
853
m_typeInfoMap.insert(std::make_pair(typeInfo->getName(), typeInfo));
856
///////////////////////////////////////////////////////////////////////////////
858
void ProcessInfo::insertBreakpoint(const BreakpointPtr& breakpoint)
860
boost::recursive_mutex::scoped_lock l(m_breakpointLock);
862
m_breakpointMap[breakpoint->getId()] = breakpoint;
865
///////////////////////////////////////////////////////////////////////////////
867
void ProcessInfo::removeBreakpoint(const BreakpointPtr& breakpoint)
869
BreakpointPtr origbp;
872
boost::recursive_mutex::scoped_lock l(m_breakpointLock);
874
BreakpointIdMap::iterator it = m_breakpointMap.find(breakpoint->getId());
875
if (it == m_breakpointMap.end() )
880
m_breakpointMap.erase(it);
883
BreakpointCallback* callback = origbp->getCallback();
885
callback->onRemove();
890
///////////////////////////////////////////////////////////////////////////////
892
DebugCallbackResult ProcessInfo::breakpointHit(BreakpointPtr& breakpoint)
894
boost::recursive_mutex::scoped_lock l(m_breakpointLock);
896
BreakpointIdMap::iterator it = m_breakpointMap.find( breakpoint->getId() );
898
if ( it == m_breakpointMap.end() )
899
return DebugCallbackNoChange;
901
BreakpointPtr origBp = it->second;
903
BreakpointCallback* callback = origBp->getCallback();
905
return DebugCallbackBreak;
907
return callback->onHit();
910
/////////////////////////////////////////////////////////////////////////////
912
void ProcessInfo::onChangeSymbolPaths()
914
boost::recursive_mutex::scoped_lock l(m_moduleLock);
916
for ( ModuleMap::iterator it = m_moduleMap.begin(); it != m_moduleMap.end(); ++it)
918
if ( !it->second->isSymbolLoaded() )
919
it->second->resetSymbols();
923
/////////////////////////////////////////////////////////////////////////////