This repository has been archived by the owner on Feb 8, 2018. It is now read-only.
/
ModuleData.cs
101 lines (81 loc) · 2.59 KB
/
ModuleData.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
using System;
namespace Mono.Debugger
{
public delegate void ModuleDataEventHandler (ModuleData data);
public abstract class ModuleData
{
protected ModuleData (Module module, string name)
{
this.module = module;
this.name = name;
}
Module module;
string name;
public Module Module {
get { return module; }
}
public string FullName {
get { return name; }
}
public abstract object Language {
get;
}
public abstract bool SymbolsLoaded {
get;
}
public abstract SourceFile[] Sources {
get;
}
public abstract ISymbolTable SymbolTable {
get;
}
protected internal abstract void ReadModuleData ();
public abstract SourceMethod FindMethod (string name);
public abstract TargetAddress SimpleLookup (string name);
// <summary>
// This event is emitted when the module's symbol tables are loaded.
// </summary>
public event ModuleDataEventHandler SymbolsLoadedEvent;
// <summary>
// This event is emitted when the module's symbol tables are unloaded.
// </summary>
public event ModuleDataEventHandler SymbolsUnLoadedEvent;
protected virtual void OnSymbolsLoadedEvent ()
{
if (SymbolsLoadedEvent != null)
SymbolsLoadedEvent (this);
}
protected virtual void OnSymbolsUnLoadedEvent ()
{
if (SymbolsUnLoadedEvent != null)
SymbolsUnLoadedEvent (this);
}
// <summary>
// This event is emitted when adding or removing a breakpoint or
// enabling/disabling a breakpoint.
// </summary>
public event ModuleDataEventHandler BreakpointsChangedEvent;
protected virtual void OnBreakpointsChangedEvent ()
{
if (BreakpointsChangedEvent != null)
BreakpointsChangedEvent (this);
}
// <summary>
// This must be implemented to actually enable the breakpoint. It is
// called after the method has been loaded - so we know the method's
// address and can actually insert a breakpoint instruction.
// The implementation may return any arbitrary data which will be passed
// as the @data argument to DisableBreakpoint() when disabling the breakpoint.
// </summary>
protected internal abstract object EnableBreakpoint (BreakpointHandle handle,
ThreadGroup group,
TargetAddress address);
// <summary>
// This must be implemented to actually disable the breakpoint. It is
// called which the method is still being loaded and the target is still
// alive. The @data argument is whatever EnableBreakpoint() returned.
// </summary>
protected internal abstract void DisableBreakpoint (BreakpointHandle handle,
ThreadGroup group, object data);
}
}