diff options
Diffstat (limited to 'src/debug/ee/controller.h')
-rw-r--r-- | src/debug/ee/controller.h | 46 |
1 files changed, 35 insertions, 11 deletions
diff --git a/src/debug/ee/controller.h b/src/debug/ee/controller.h index 95569b55c7..bac635e2f7 100644 --- a/src/debug/ee/controller.h +++ b/src/debug/ee/controller.h @@ -276,16 +276,32 @@ struct DebuggerFunctionKey1 typedef DebuggerFunctionKey1 UNALIGNED DebuggerFunctionKey; -// ILMaster: Breakpoints on IL code may need to be applied to multiple -// copies of code, because generics mean code gets JITTed multiple times. -// The "master" is a patch we keep to record the IL offset, and is used to -// create new "slave"patches. - +// IL Master: Breakpoints on IL code may need to be applied to multiple +// copies of code. Historically generics was the only way IL code was JITTed +// multiple times but more recently the CodeVersionManager and tiered compilation +// provide more open-ended mechanisms to have multiple native code bodies derived +// from a single IL method body. +// The "master" is a patch we keep to record the IL offset or native offset, and +// is used to create new "slave"patches. For native offsets only offset 0 is allowed +// because that is the only one that we think would have a consistent semantic +// meaning across different code bodies. +// There can also be multiple IL bodies for the same method given EnC or ReJIT. +// A given master breakpoint is tightly bound to one particular IL body determined +// by encVersion. ReJIT + breakpoints isn't currently supported. +// +// +// IL Slave: The slaves created from Master patches. If the master used an IL offset +// then the slave also initially has an IL offset that will later become a native offset. +// If the master uses a native offset (0) then the slave will also have a native offset (0). +// These patches always resolve to addresses in jitted code. // -// ILSlave: The slaves created from ILMaster patches. The offset for -// these is initially an IL offset and later becomes a native offset. // -// NativeManaged: A patch we apply to managed code, usually for walkers etc. +// NativeManaged: A patch we apply to managed code, usually for walkers etc. If this code +// is jitted then these patches are always bound to one exact jitted code body. +// If you need to be 100% sure I suggest you do more code review but I believe we also +// use this for managed code from other code generators such as a stub or statically compiled +// code that executes in cooperative mode. +// // // NativeUnmanaged: A patch applied to any kind of native code. @@ -361,6 +377,8 @@ struct DebuggerControllerPatch PRD_TYPE opcodeSaved;//also a misnomer BOOL offsetIsIL; TraceDestination trace; + MethodDesc* pMethodDescFilter; // used for IL Master patches that should only bind to jitted + // code versions for a single generic instantiation private: int refCount; union @@ -663,7 +681,9 @@ public: DebuggerControllerPatch *AddPatchForMethodDef(DebuggerController *controller, Module *module, mdMethodDef md, - size_t offset, + MethodDesc *pMethodDescFilter, + size_t offset, + BOOL offsetIsIL, DebuggerPatchKind kind, FramePointer fp, AppDomain *pAppDomain, @@ -1170,8 +1190,10 @@ public: BOOL AddILPatch(AppDomain * pAppDomain, Module *module, mdMethodDef md, + MethodDesc* pMethodFilter, SIZE_T encVersion, // what encVersion does this apply to? - SIZE_T offset); + SIZE_T offset, + BOOL offsetIsIL); // The next two are very similar. Both work on offsets, // but one takes a "patch id". I don't think these are really needed: the @@ -1244,12 +1266,14 @@ public: DebuggerControllerPatch *AddILMasterPatch(Module *module, mdMethodDef md, + MethodDesc *pMethodDescFilter, SIZE_T offset, + BOOL offsetIsIL, SIZE_T encVersion); BOOL AddBindAndActivatePatchForMethodDesc(MethodDesc *fd, DebuggerJitInfo *dji, - SIZE_T offset, + SIZE_T nativeOffset, DebuggerPatchKind kind, FramePointer fp, AppDomain *pAppDomain); |