readonly bool _loaded; // true if a module was loaded, false if a module was unloaded public DebugModuleLoadEvent(IDebugModule2 module, bool loaded) : base((uint)enum_EVENTATTRIBUTES.EVENT_ASYNCHRONOUS, new Guid("989DB083-0D7C-40D1-A9D9-921BF611A4B2")) { _module = module; _loaded = loaded; }
internal void GetModuleInfo(string moduleName, out string modulePath, out string symbolPath) { modulePath = null; symbolPath = null; IEnumDebugModules2 debugModulesEnumerator; if (currentDebugProgram.EnumModules(out debugModulesEnumerator) != S_OK) { return; } using (new DisposableComReference(debugModulesEnumerator)) { debugModulesEnumerator.Reset(); IDebugModule2[] debugModuleArray = new IDebugModule2[1]; uint moduleCount = 0; while (debugModulesEnumerator.Next(1, debugModuleArray, ref moduleCount) == S_OK && moduleCount > 0) { IDebugModule2 debugModule = debugModuleArray[0]; using (new DisposableComReference(debugModule)) { MODULE_INFO[] moduleInfo = new MODULE_INFO[1]; if (debugModule.GetInfo((uint)(enum_MODULE_INFO_FIELDS.MIF_NAME | enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION | enum_MODULE_INFO_FIELDS.MIF_URL), moduleInfo) == S_OK) { if (moduleName.ToLowerInvariant() == System.IO.Path.GetFileNameWithoutExtension(moduleInfo[0].m_bstrName).ToLowerInvariant()) { modulePath = moduleInfo[0].m_bstrUrl; symbolPath = moduleInfo[0].m_bstrUrlSymbolLocation; return; } } } } } }
public int GetModule(out IDebugModule2 pModule, ref string pbstrDebugMessage, ref int pbLoad) { pModule = _module; pbLoad = _loaded ? 1 : 0; return(VSConstants.S_OK); }
private Core.SModule GetModuleForPredicate(Func <MODULE_INFO, bool> predicate, string errorMessage) { IEnumDebugModules2 debugModulesEnumerator; if (this.runner.CurrentDebugProgram.EnumModules(out debugModulesEnumerator) == S_OK) { using (new DisposableComReference(debugModulesEnumerator)) { debugModulesEnumerator.Reset(); IDebugModule2[] debugModuleArray = new IDebugModule2[1]; uint cModules = 0; while (debugModulesEnumerator.Next(1, debugModuleArray, ref cModules) == S_OK && cModules > 0) { IDebugModule2 debugModule2 = debugModuleArray[0]; using (new DisposableComReference(debugModule2)) { MODULE_INFO[] moduleInfo = new MODULE_INFO[1]; if (debugModule2.GetInfo((uint)enum_MODULE_INFO_FIELDS.MIF_NAME | (uint)enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS | (uint)enum_MODULE_INFO_FIELDS.MIF_SIZE, moduleInfo) == S_OK) { if (predicate(moduleInfo[0])) { return(new Core.SModule() { BaseAddress = moduleInfo[0].m_addrLoadAddress, Name = StripModuleSuffix(moduleInfo[0].m_bstrName) }); } } } } } } throw new DebuggerException(errorMessage); }
public int GetModule(out IDebugModule2 pModule, ref string pbstrDebugMessage, ref int pbLoad) { pModule = _module; pbstrDebugMessage = _debugMessage; pbLoad = _isLoading ? 1 : 0; return VSConstants.S_OK; }
public DebugModuleLoadEvent(enum_EVENTATTRIBUTES attributes, IDebugModule2 module, string debugMessage, bool isLoading) : base(attributes) { Contract.Requires <ArgumentNullException>(module != null, "module"); _module = module; _debugMessage = debugMessage; _isLoading = isLoading; }
public DebugModuleLoadEvent(enum_EVENTATTRIBUTES attributes, IDebugModule2 module, string debugMessage, bool isLoading) : base(attributes) { Contract.Requires<ArgumentNullException>(module != null, "module"); _module = module; _debugMessage = debugMessage; _isLoading = isLoading; }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// public int EnumModules(out IEnumDebugModules2 ppEnum) { // // Enumerates the modules that this program has loaded and is executing. // LoggingUtils.PrintFunction(); ppEnum = null; try { List <IDebugModule2> modules = new List <IDebugModule2> (); uint count; { LoggingUtils.RequireOk(AttachedEngine.NativeDebugger.NativeProgram.EnumModules(out ppEnum)); LoggingUtils.RequireOk(ppEnum.GetCount(out count)); IDebugModule2 [] moduleArray = new IDebugModule2 [count]; LoggingUtils.RequireOk(ppEnum.Next(count, moduleArray, ref count)); modules.AddRange(moduleArray); } { LoggingUtils.RequireOk(AttachedEngine.JavaDebugger.JavaProgram.EnumModules(out ppEnum)); LoggingUtils.RequireOk(ppEnum.GetCount(out count)); IDebugModule2 [] moduleArray = new IDebugModule2 [count]; LoggingUtils.RequireOk(ppEnum.Next(count, moduleArray, ref count)); modules.AddRange(moduleArray); } ppEnum = new DebuggeeModule.Enumerator(modules); return(Constants.S_OK); } catch (Exception e) { LoggingUtils.HandleException(e); return(Constants.E_FAIL); } }
/// <summary> /// Gets the module that is being loaded or unloaded. (http://msdn.microsoft.com/en-ca/library/bb161763.aspx) /// </summary> /// <param name="module"> Returns an IDebugModule2 object that represents the module which is loading or unloading. </param> /// <param name="debugMessage"> Returns an optional message describing this event. If this parameter is a null value, no message /// is requested. </param> /// <param name="fIsLoad"> Nonzero (TRUE) if the module is loading and zero (FALSE) if the module is unloading. If this /// parameter is a null value, no status is requested. </param> /// <returns> VSConstants.S_OK. </returns> int IDebugModuleLoadEvent2.GetModule(out IDebugModule2 module, ref string debugMessage, ref int fIsLoad) { module = m_module; if (m_fLoad) { fIsLoad = 1; } else { fIsLoad = 0; } return(VSConstants.S_OK); }
/// <summary> /// Gets the module that is being loaded or unloaded. /// </summary> /// <param name="module">Returns an IDebugModule2 object that represents the module which is loading or unloading.</param> /// <param name="debugMessage">Returns an optional message describing this event. If this parameter is a null value, no message is requested.</param> /// <param name="fIsLoad">Nonzero (TRUE) if the module is loading and zero (FALSE) if the module is unloading. If this parameter is a null value, no status is requested.</param> /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns> public virtual int GetModule(out IDebugModule2 module, ref string debugMessage, ref int fIsLoad) { module = Module; if (IsLoading) { debugMessage = String.Format("Loaded '{0}'", Module.Name); fIsLoad = 1; } else { debugMessage = String.Concat("Unloaded '{0}'", Module.Name); fIsLoad = 0; } return(VSConstants.S_OK); }
/// <summary> /// Gets the module that is being loaded or unloaded. /// </summary> /// <param name="module">Returns an IDebugModule2 object that represents the module which is loading or unloading.</param> /// <param name="debugMessage">Returns an optional message describing this event. If this parameter is a null value, no message is requested.</param> /// <param name="fIsLoad">Nonzero (TRUE) if the module is loading and zero (FALSE) if the module is unloading. If this parameter is a null value, no status is requested.</param> /// <returns>If successful, returns S_OK; otherwise, returns an error code.</returns> public virtual int GetModule( out IDebugModule2 module, ref string debugMessage, ref int fIsLoad ) { module = Module; if ( IsLoading ) { debugMessage = String.Format( "Loaded '{0}'", Module.Name ); fIsLoad = 1; } else { debugMessage = String.Concat( "Unloaded '{0}'", Module.Name ); fIsLoad = 0; } return VSConstants.S_OK; }
int IDebugModuleLoadEvent2.GetModule(out IDebugModule2 module, ref string debugMessage, ref int fIsLoad) { module = _module; if (_fLoad) { debugMessage = String.Concat("Loaded '", _module.DebuggedModule.Name, "'"); fIsLoad = 1; } else { debugMessage = String.Concat("Unloaded '", _module.DebuggedModule.Name, "'"); fIsLoad = 0; } return(Constants.S_OK); }
int IDebugModuleLoadEvent2.GetModule(out IDebugModule2 module, ref string debugMessage, ref int fIsLoad) { module = _module; if (_fLoad) { string symbolLoadStatus = _module.DebuggedModule.SymbolsLoaded ? ResourceStrings.ModuleLoadedWithSymbols : ResourceStrings.ModuleLoadedWithoutSymbols; debugMessage = string.Format(CultureInfo.CurrentUICulture, ResourceStrings.ModuleLoadMessage, _module.DebuggedModule.Name, symbolLoadStatus); fIsLoad = 1; } else { debugMessage = string.Format(CultureInfo.CurrentUICulture, ResourceStrings.ModuleUnloadMessage, _module.DebuggedModule.Name); fIsLoad = 0; } return(Constants.S_OK); }
public int GetModule(out IDebugModule2 ppModule) { ppModule = null; return VSConstants.E_FAIL; }
/// <summary> /// Gets the module that is being loaded or unloaded. (http://msdn.microsoft.com/en-ca/library/bb161763.aspx) /// </summary> /// <param name="module"> Returns an IDebugModule2 object that represents the module which is loading or unloading. </param> /// <param name="debugMessage"> Returns an optional message describing this event. If this parameter is a null value, no message /// is requested. </param> /// <param name="fIsLoad"> Nonzero (TRUE) if the module is loading and zero (FALSE) if the module is unloading. If this /// parameter is a null value, no status is requested. </param> /// <returns> VSConstants.S_OK. </returns> int IDebugModuleLoadEvent2.GetModule(out IDebugModule2 module, ref string debugMessage, ref int fIsLoad) { module = m_module; if (m_fLoad) { fIsLoad = 1; } else { fIsLoad = 0; } return VSConstants.S_OK; }
public int GetModule(out IDebugModule2 ppModule) { // TODO: implement modules? ppModule = null; return(VSConstants.E_FAIL); }
public int GetModule(out IDebugModule2 ppModule) { // TODO: implement modules? ppModule = null; return VSConstants.E_FAIL; }
int IDebugModuleLoadEvent2.GetModule(out IDebugModule2 module, ref string debugMessage, ref int fIsLoad) { module = _module; if (_fLoad) { string symbolLoadStatus = _module.DebuggedModule.SymbolsLoaded ? ResourceStrings.ModuleLoadedWithSymbols : ResourceStrings.ModuleLoadedWithoutSymbols; debugMessage = string.Format(CultureInfo.CurrentUICulture, ResourceStrings.ModuleLoadMessage, _module.DebuggedModule.Name, symbolLoadStatus); fIsLoad = 1; } else { debugMessage = string.Format(CultureInfo.CurrentUICulture, ResourceStrings.ModuleUnloadMessage, _module.DebuggedModule.Name); fIsLoad = 0; } return Constants.S_OK; }
int IDebugModuleLoadEvent2.GetModule (out IDebugModule2 module, ref string debugMessage, ref int fIsLoad) { LoggingUtils.PrintFunction (); module = m_debugModule; try { MODULE_INFO [] moduleInfo = new MODULE_INFO [1]; LoggingUtils.RequireOk (module.GetInfo (enum_MODULE_INFO_FIELDS.MIF_NAME | enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS, moduleInfo)); debugMessage = string.Format ("{0}: {1}", ((m_loadModule) ? "Loaded" : "Unloaded"), moduleInfo [0].m_bstrName); fIsLoad = (m_loadModule) ? 1 : 0; return Constants.S_OK; } catch (System.Exception e) { LoggingUtils.HandleException (e); return Constants.E_FAIL; } }
void ReceivedModuleAddedEvent(IDebugModule2 debugModule) { moduleAddedHandler.Received(1).Invoke(debugModuleCache, Arg.Is <ModuleAddedEventArgs>(args => args.Module == debugModule)); }
public int GetModule(out IDebugModule2 ppModule) { ppModule = null; return(VSConstants.E_FAIL); }
void DidNotReceivedModuleRemovedEvent(IDebugModule2 debugModule) { moduleRemovedHandler.DidNotReceive().Invoke(debugModuleCache, Arg.Is <ModuleRemovedEventArgs>(args => args.Module == debugModule)); }
public ModuleAddedEventArgs(IDebugModule2 module) { Module = module; }
public BeforeSymbolSearch (IDebugModule2 module) { m_debugModule = module; }
public ModuleRemovedEventArgs(IDebugModule2 module) { Module = module; }
int IDebugModuleLoadEvent2.GetModule(out IDebugModule2 module, ref string debugMessage, ref int fIsLoad) { module = m_module; if (m_fLoad) { debugMessage = null; //String.Concat("Loaded '", m_module.DebuggedModule.Name, "'"); fIsLoad = 1; } else { debugMessage = null; // String.Concat("Unloaded '", m_module.DebuggedModule.Name, "'"); fIsLoad = 0; } return VSConstants.S_OK; }
/// <summary> /// Send a module load or unload event to the SDM. /// </summary> public static void OnModuleLoad(this IDebugEngineHandler handler, IDebugModule2 module, IGgpDebugProgram program) => handler.SendEvent(new DebugModuleLoadEvent(module, true), program);
public ModuleLoad (IDebugModule2 debugModule, bool loadModule) { m_debugModule = debugModule; m_loadModule = loadModule; }