コード例 #1
0
ファイル: AD7Module.cs プロジェクト: happylancer/node-tools
        // Gets the MODULE_INFO that describes this module.
        // This is how the debugger obtains most of the information about the module.
        int IDebugModule2.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] infoArray)
        {
            var info = new MODULE_INFO();

            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_NAME) != 0)
            {
                info.m_bstrName = DebuggedScript.Name;
                Debug.Assert(info.m_bstrName != null);
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
            }
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URL) != 0)
            {
                info.m_bstrUrl = DebuggedScript.Filename;
                Debug.Assert(info.m_bstrUrl != null);
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
            }
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_LOADORDER) != 0)
            {
                info.m_dwLoadOrder = (uint) DebuggedScript.Id;
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADORDER;
            }

            infoArray[0] = info;

            return VSConstants.S_OK;
        }
コード例 #2
0
ファイル: AD7Module.cs プロジェクト: zjherp/nodejstools
        // Gets the MODULE_INFO that describes this module.
        // This is how the debugger obtains most of the information about the module.
        int IDebugModule2.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] infoArray)
        {
            var info = new MODULE_INFO();

            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_NAME) != 0)
            {
                info.m_bstrName = this.DebuggedModule.Name;
                Debug.Assert(info.m_bstrName != null);
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
            }
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URL) != 0)
            {
                info.m_bstrUrl = this.DebuggedModule.FileName;
                Debug.Assert(info.m_bstrUrl != null);
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
            }
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_LOADORDER) != 0)
            {
                info.m_dwLoadOrder  = (uint)this.DebuggedModule.Id;
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADORDER;
            }

            infoArray[0] = info;

            return(VSConstants.S_OK);
        }
コード例 #3
0
        /// <summary>
        /// Gets information about this module.
        /// </summary>
        /// <param name="dwFields">A combination of flags from the MODULE_INFO_FIELDS enumeration that specify which fields of pInfo are to be filled out.</param>
        /// <param name="pinfo">A MODULE_INFO structure that is filled in with a description of the module.</param>
        /// <returns>
        /// If successful, returns S_OK; otherwise, returns an error code.
        /// </returns>
        public override int GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo)
        {
            Logger.Debug(string.Empty);
            var info = new MODULE_INFO();

            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_NAME) != 0)
            {
                info.m_bstrName     = FileName;
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
            }

            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URL) != 0)
            {
                info.m_bstrUrl      = FileName;
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
            }

            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_FLAGS) != 0)
            {
                info.m_dwModuleFlags = enum_MODULE_FLAGS.MODULE_FLAG_SYMBOLS;
                info.dwValidFields  |= enum_MODULE_INFO_FIELDS.MIF_FLAGS;
            }

            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION) != 0)
            {
                info.m_bstrUrlSymbolLocation = @".\";
                info.dwValidFields          |= enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
            }

            pinfo[0] = info;

            return(VSConstants.S_OK);
        }
コード例 #4
0
        /// <summary>
        /// Gets information about this module.
        /// </summary>
        /// <param name="dwFields">A combination of flags from the MODULE_INFO_FIELDS enumeration that specify which fields of pInfo are to be filled out.</param>
        /// <param name="pinfo">A MODULE_INFO structure that is filled in with a description of the module.</param>
        /// <returns>
        /// If successful, returns S_OK; otherwise, returns an error code.
        /// </returns>
        public override int GetInfo( enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo )
        {
            Logger.Debug( string.Empty );
            var info = new MODULE_INFO();

            if ( ( dwFields & enum_MODULE_INFO_FIELDS.MIF_NAME ) != 0 )
            {
                info.m_bstrName = FileName;
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
            }

            if ( ( dwFields & enum_MODULE_INFO_FIELDS.MIF_URL ) != 0 )
            {
                info.m_bstrUrl = FileName;
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
            }

            if ( ( dwFields & enum_MODULE_INFO_FIELDS.MIF_FLAGS ) != 0 )
            {
                info.m_dwModuleFlags = enum_MODULE_FLAGS.MODULE_FLAG_SYMBOLS;
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_FLAGS;
            }

            if ( ( dwFields & enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION ) != 0 )
            {
                info.m_bstrUrlSymbolLocation = @".\";
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
            }

            pinfo[0] = info;

            return VSConstants.S_OK;
        }
コード例 #5
0
        public int GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo)
        {
            var assemblyName = AssemblyMirror.GetName();

            pinfo[0].m_bstrName     = assemblyName.FullName;
            pinfo[0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;

            pinfo[0].m_bstrVersion  = assemblyName.Version.ToString();
            pinfo[0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_VERSION;

            pinfo[0].m_bstrUrl      = AssemblyMirror.Location;
            pinfo[0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;

            return(VSConstants.S_OK);
        }
コード例 #6
0
        public int GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo)
        {
            DLog.Debug(DContext.VSDebuggerComCall, "Module.GetInfo");

            pinfo[0].m_addrLoadAddress          = 0;
            pinfo[0].m_addrPreferredLoadAddress = 0;
            pinfo[0].m_bstrDebugMessage         = "<none>";
            pinfo[0].m_bstrName = Name;
            pinfo[0].m_bstrUrl  = "<unknown>";
            pinfo[0].m_bstrUrlSymbolLocation = "<unknown>";
            pinfo[0].m_bstrVersion           = "<unknown>";
            pinfo[0].m_dwLoadOrder           = 0;
            pinfo[0].m_dwModuleFlags         = 0;
            pinfo[0].m_dwSize      = 0;
            pinfo[0].dwValidFields = enum_MODULE_INFO_FIELDS.MIF_ALLFIELDS;

            return(VSConstants.S_OK);
        }
コード例 #7
0
ファイル: DebugModule.cs プロジェクト: Xtremrules/dot42
        public int GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo)
        {
            DLog.Debug(DContext.VSDebuggerComCall, "Module.GetInfo");

            pinfo[0].m_addrLoadAddress = 0;
            pinfo[0].m_addrPreferredLoadAddress = 0;
            pinfo[0].m_bstrDebugMessage = "<none>";
            pinfo[0].m_bstrName = Name;
            pinfo[0].m_bstrUrl = "<unknown>";
            pinfo[0].m_bstrUrlSymbolLocation = "<unknown>";
            pinfo[0].m_bstrVersion = "<unknown>";
            pinfo[0].m_dwLoadOrder = 0;
            pinfo[0].m_dwModuleFlags = 0;
            pinfo[0].m_dwSize = 0;
            pinfo[0].dwValidFields = enum_MODULE_INFO_FIELDS.MIF_ALLFIELDS;

            return VSConstants.S_OK;
        }
コード例 #8
0
ファイル: AD7Module.cs プロジェクト: bagobor/NodeVsDebugger
        // Gets the MODULE_INFO that describes this module.
        // This is how the debugger obtains most of the information about the module.
        int IDebugModule2.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] infoArray)
        {
            try {
                var info = new MODULE_INFO();

                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_NAME) != 0) {
                    info.m_bstrName = System.IO.Path.GetFileName(m_script.Name);
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
                }
                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URL) != 0) {
                    info.m_bstrUrl = m_script.Name;
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
                }
                infoArray[0] = info;

                return Constants.S_OK;
            } catch (Exception e) {
                return EngineUtils.UnexpectedException(e);
            }
        }
コード例 #9
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        #region IDebugModule2 Members

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public override int GetInfo(enum_MODULE_INFO_FIELDS requestedFields, MODULE_INFO [] infoArray)
        {
            //
            // Retrieve relevant requested data for this module.
            //

            LoggingUtils.PrintFunction();

            try
            {
                LoggingUtils.RequireOk(base.GetInfo(requestedFields, infoArray));

                return(Constants.S_OK);
            }
            catch (Exception e)
            {
                LoggingUtils.HandleException(e);

                return(Constants.E_FAIL);
            }
        }
コード例 #10
0
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    #region IDebugModule2 Members

    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    public override int GetInfo (enum_MODULE_INFO_FIELDS requestedFields, MODULE_INFO [] infoArray)
    {
      // 
      // Retrieve relevant requested data for this module.
      // 

      LoggingUtils.PrintFunction ();

      try
      {
        LoggingUtils.RequireOk (base.GetInfo (requestedFields, infoArray));
        
        return Constants.S_OK;
      }
      catch (Exception e)
      {
        LoggingUtils.HandleException (e);

        return Constants.E_FAIL;
      }
    }
コード例 #11
0
        // Gets the MODULE_INFO that describes this module.
        // This is how the debugger obtains most of the information about the module.
        int IDebugModule2.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] infoArray)
        {
            MODULE_INFO info = new MODULE_INFO();

            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_NAME) != 0)
            {
                info.m_bstrName = DebuggedModule.Name;
                Debug.Assert(info.m_bstrName != null);
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
            }
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URL) != 0)
            {
                info.m_bstrUrl = DebuggedModule.Filename;
                Debug.Assert(info.m_bstrUrl != null);
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
            }
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_LOADORDER) != 0)
            {
                info.m_dwLoadOrder  = (uint)this.DebuggedModule.ModuleId;
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADORDER;
            }
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION) != 0)
            {
                if (ModulePath.IsPythonSourceFile(DebuggedModule.Filename))
                {
                    info.m_bstrUrlSymbolLocation = DebuggedModule.Filename;
                }
                else
                {
                    info.m_bstrUrlSymbolLocation = string.Empty;
                }
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
            }

            infoArray[0] = info;

            return(VSConstants.S_OK);
        }
コード例 #12
0
        public int GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo)
        {
            Log.Debug("ScriptProgramNode: IDebugModule2.GetInfo");
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_NAME) != 0)
            {
                pinfo[0].m_bstrName     = FileName;
                pinfo[0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
            }

            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_FLAGS) != 0)
            {
                pinfo[0].m_dwModuleFlags = enum_MODULE_FLAGS.MODULE_FLAG_SYMBOLS;
                pinfo[0].dwValidFields  |= enum_MODULE_INFO_FIELDS.MIF_FLAGS;
            }

            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION) != 0)
            {
                pinfo[0].m_bstrUrlSymbolLocation = @".\";
                pinfo[0].dwValidFields          |= enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
            }

            return(VSConstants.S_OK);
        }
コード例 #13
0
ファイル: AD7Module.cs プロジェクト: AlexanderSher/RTVS-Old
 int IDebugModule3.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo) {
     throw new NotImplementedException();
 }
コード例 #14
0
ファイル: AD7Module.cs プロジェクト: ChrisJamesSadler/Cosmos
        // Gets the MODULE_INFO that describes this module.
        // This is how the debugger obtains most of the information about the module.
        int IDebugModule2.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] infoArray)
        {
            try
            {
                MODULE_INFO info = new MODULE_INFO();

                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_NAME))
                {
                    //info.m_bstrName = System.IO.Path.GetFileName(this.DebuggedModule.Name);
                    info.m_bstrName = "DEADBEEF";
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_URL))
                {
                    //info.m_bstrUrl = this.DebuggedModule.Name;
                    info.m_bstrUrl = "DEADBEEF";
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS))
                {
                    //info.m_addrLoadAddress = (ulong)this.DebuggedModule.BaseAddress;
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS))
                {
                    // A debugger that actually supports showing the preferred base should crack the PE header and get 
                    // that field. This debugger does not do that, so assume the module loaded where it was suppose to.                   
                    //info.m_addrPreferredLoadAddress = (ulong)this.DebuggedModule.BaseAddress;
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_SIZE))
                {
                    //info.m_dwSize = this.DebuggedModule.Size;
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_SIZE;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_LOADORDER))
                {
                    //info.m_dwLoadOrder = this.DebuggedModule.GetLoadOrder();
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADORDER;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION))
                {
                    //if (this.DebuggedModule.SymbolsLoaded)
                    {
                        //info.m_bstrUrlSymbolLocation = this.DebuggedModule.SymbolPath;
                        info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
                    }
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_FLAGS))
                {
                    info.m_dwModuleFlags = 0;
                    //if (this.DebuggedModule.SymbolsLoaded)
                    {
                        info.m_dwModuleFlags |= (enum_MODULE_FLAGS.MODULE_FLAG_SYMBOLS);
                    }
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_FLAGS;
                }
                
                
                infoArray[0] = info;

                return VSConstants.S_OK;
            }
            //catch (ComponentException e)
            //{
            //    return e.HResult;
            //}
            catch (Exception e)
            {
                return EngineUtils.UnexpectedException(e);
            }
        }
コード例 #15
0
ファイル: QmlDebugAD7Program.cs プロジェクト: qt-labs/vstools
 public int /*IDebugModule3*/ GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo)
 {
     Info.Map(MappingToMODULE_INFO, dwFields, out pinfo[0]);
     return(VSConstants.S_OK);
 }
コード例 #16
0
        // IDebugModule3 represents a module that supports alternate locations of symbols and JustMyCode states.
        // The sample does not support alternate symbol locations or JustMyCode, but it does not display symbol load information

        // Gets the MODULE_INFO that describes this module.
        // This is how the debugger obtains most of the information about the module.
        int IDebugModule3.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo)
        {
            return(((IDebugModule2)this).GetInfo(dwFields, pinfo));
        }
コード例 #17
0
ファイル: AD7Module.cs プロジェクト: zachwieja/RTVS
 int IDebugModule3.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo)
 {
     throw new NotImplementedException();
 }
コード例 #18
0
 public int GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo)
 {
     throw new NotImplementedException();
 }
コード例 #19
0
 public int GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo)
 {
     pinfo[0].dwValidFields = enum_MODULE_INFO_FIELDS.MIF_NAME;
     pinfo[0].m_bstrName    = moduleName;
     return(Constants.S_OK);
 }
コード例 #20
0
ファイル: AD7Module.cs プロジェクト: blackberry/VSPlugin
        /// <summary>
        /// Gets information about this module. (http://msdn.microsoft.com/en-ca/library/bb161975.aspx)
        /// </summary>
        /// <param name="dwFields"> A combination of flags from the MODULE_INFO_FIELDS enumeration that specify which fields of pInfo 
        /// are to be filled out. </param>
        /// <param name="infoArray"> A MODULE_INFO structure that is filled in with a description of the module. </param>
        /// <returns> If successful, returns S_OK; otherwise, returns an error code. </returns>
        int IDebugModule2.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] infoArray)
        {
            try
            {
                MODULE_INFO info = new MODULE_INFO();

                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_NAME))
                {
                    info.m_bstrName = "";
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_URL))
                {
                    info.m_bstrUrl = "";
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS))
                {
                    info.m_addrLoadAddress = 0;
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS))
                {
                    // A debugger that actually supports showing the preferred base should crack the PE header and get
                    // that field. This debugger does not do that, so assume the module loaded where it was suppose to.
                    info.m_addrPreferredLoadAddress = 0;
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_SIZE))
                {
                    info.m_dwSize = 0;
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_SIZE;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_LOADORDER))
                {
                    info.m_dwLoadOrder = 0;
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADORDER;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION))
                {
                    info.m_bstrUrlSymbolLocation = "";
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_FLAGS))
                {
                    info.m_dwModuleFlags = 0;
                    info.m_dwModuleFlags |= (enum_MODULE_FLAGS.MODULE_FLAG_SYMBOLS);
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_FLAGS;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_VERSION))
                {
                    info.m_bstrVersion = "";
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_VERSION;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_DEBUGMESSAGE))
                {
                    info.m_bstrDebugMessage = "";
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_DEBUGMESSAGE;
                }

                infoArray[0] = info;

                return VSConstants.S_OK;
            }
            catch (Exception e)
            {
                return EngineUtils.UnexpectedException(e);
            }
        }
コード例 #21
0
ファイル: AD7Module.cs プロジェクト: optikos/MIEngine
        // Gets the MODULE_INFO that describes this module.
        // This is how the debugger obtains most of the information about the module.
        int IDebugModule2.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] infoArray)
        {
            try
            {
                MODULE_INFO info = new MODULE_INFO();

                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_NAME) != 0)
                {
                    info.m_bstrName     = System.IO.Path.GetFileName(this.DebuggedModule.Name);
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
                }
                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URL) != 0)
                {
                    info.m_bstrUrl      = this.DebuggedModule.Name;
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
                }
                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS) != 0)
                {
                    info.m_addrLoadAddress = (ulong)this.DebuggedModule.BaseAddress;
                    info.dwValidFields    |= enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS;
                }
                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS) != 0)
                {
                    // A debugger that actually supports showing the preferred base should read the PE header and get
                    // that field. This debugger does not do that, so assume the module loaded where it was suppose to.
                    info.m_addrPreferredLoadAddress = (ulong)this.DebuggedModule.BaseAddress;
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS;;
                }
                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_SIZE) != 0)
                {
                    info.m_dwSize       = (uint)this.DebuggedModule.Size;
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_SIZE;
                }
                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_LOADORDER) != 0)
                {
                    info.m_dwLoadOrder  = this.DebuggedModule.GetLoadOrder();
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADORDER;
                }
                if (this.Process.LaunchOptions is LocalLaunchOptions localLaunchOptions &&
                    string.IsNullOrWhiteSpace(localLaunchOptions.MIDebuggerServerAddress) && string.IsNullOrWhiteSpace(localLaunchOptions.DebugServer) &&
                    (dwFields & enum_MODULE_INFO_FIELDS.MIF_TIMESTAMP) != 0 &&
                    this.DebuggedModule.Name != null)
                {
                    try
                    {
                        long ft   = File.GetLastWriteTimeUtc(this.DebuggedModule.Name).ToFileTime();
                        uint low  = (uint)(ft & 0xFFFFFFFF);
                        uint high = (uint)((ulong)(ft >> 32));
                        info.m_TimeStamp = new FILETIME()
                        {
                            dwLowDateTime  = low,
                            dwHighDateTime = high
                        };
                        info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_TIMESTAMP;
                    } catch {}
                }
                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION) != 0)
                {
                    if (this.DebuggedModule.SymbolsLoaded)
                    {
                        info.m_bstrUrlSymbolLocation = this.DebuggedModule.SymbolPath;
                        info.dwValidFields          |= enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
                    }
                }
                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_FLAGS) != 0)
                {
                    info.m_dwModuleFlags = 0;
                    if (this.DebuggedModule.SymbolsLoaded)
                    {
                        info.m_dwModuleFlags |= (enum_MODULE_FLAGS.MODULE_FLAG_SYMBOLS);
                    }

                    if (this.Process.Is64BitArch)
                    {
                        info.m_dwModuleFlags |= enum_MODULE_FLAGS.MODULE_FLAG_64BIT;
                    }

                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_FLAGS;
                }


                infoArray[0] = info;

                return(Constants.S_OK);
            }
            catch (MIException e)
            {
                return(e.HResult);
            }
            catch (Exception e)
            {
                return(EngineUtils.UnexpectedException(e));
            }
        }
コード例 #22
0
ファイル: AD7Module.cs プロジェクト: djgreastki1/VSPlugin
        /// <summary>
        /// Gets information about this module. (http://msdn.microsoft.com/en-ca/library/bb161975.aspx)
        /// </summary>
        /// <param name="dwFields"> A combination of flags from the MODULE_INFO_FIELDS enumeration that specify which fields of pInfo
        /// are to be filled out. </param>
        /// <param name="infoArray"> A MODULE_INFO structure that is filled in with a description of the module. </param>
        /// <returns> If successful, returns S_OK; otherwise, returns an error code. </returns>
        int IDebugModule2.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] infoArray)
        {
            try
            {
                MODULE_INFO info = new MODULE_INFO();

                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_NAME))
                {
                    info.m_bstrName     = "";
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_URL))
                {
                    info.m_bstrUrl      = "";
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS))
                {
                    info.m_addrLoadAddress = 0;
                    info.dwValidFields    |= enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS))
                {
                    // A debugger that actually supports showing the preferred base should crack the PE header and get
                    // that field. This debugger does not do that, so assume the module loaded where it was suppose to.
                    info.m_addrPreferredLoadAddress = 0;
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_SIZE))
                {
                    info.m_dwSize       = 0;
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_SIZE;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_LOADORDER))
                {
                    info.m_dwLoadOrder  = 0;
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADORDER;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION))
                {
                    info.m_bstrUrlSymbolLocation = "";
                    info.dwValidFields          |= enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_FLAGS))
                {
                    info.m_dwModuleFlags  = 0;
                    info.m_dwModuleFlags |= (enum_MODULE_FLAGS.MODULE_FLAG_SYMBOLS);
                    info.dwValidFields   |= enum_MODULE_INFO_FIELDS.MIF_FLAGS;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_VERSION))
                {
                    info.m_bstrVersion  = "";
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_VERSION;
                }
                if (dwFields.HasFlag(enum_MODULE_INFO_FIELDS.MIF_DEBUGMESSAGE))
                {
                    info.m_bstrDebugMessage = "";
                    info.dwValidFields     |= enum_MODULE_INFO_FIELDS.MIF_DEBUGMESSAGE;
                }

                infoArray[0] = info;

                return(VSConstants.S_OK);
            }
            catch (Exception e)
            {
                return(EngineUtils.UnexpectedException(e));
            }
        }
コード例 #23
0
ファイル: AD7Module.cs プロジェクト: lioaphy/nodejstools
        // IDebugModule3 represents a module that supports alternate locations of symbols and JustMyCode states.
        // The sample does not support alternate symbol locations or JustMyCode, but it does not display symbol load information 

        // Gets the MODULE_INFO that describes this module.
        // This is how the debugger obtains most of the information about the module.
        int IDebugModule3.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo) {
            return ((IDebugModule2)this).GetInfo(dwFields, pinfo);
        }
コード例 #24
0
        // Gets the MODULE_INFO that describes this module.
        // This is how the debugger obtains most of the information about the module.
        int IDebugModule2.GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] infoArray)
        {
            try
            {
                MODULE_INFO info = new MODULE_INFO();

                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_NAME) != 0)
                {
                    info.m_bstrName     = System.IO.Path.GetFileName(this.DebuggedModule.Name);
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
                }
                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URL) != 0)
                {
                    info.m_bstrUrl      = this.DebuggedModule.Name;
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
                }

                /*if ((dwFields & (uint)enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS) != 0)
                 * {
                 *  info.m_addrLoadAddress = (ulong)this.DebuggedModule.BaseAddress;
                 *  info.dwValidFields |= (uint)enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS;
                 * }
                 * if ((dwFields & (uint)enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS) != 0)
                 * {
                 *  // A debugger that actually supports showing the preferred base should crack the PE header and get
                 *  // that field. This debugger does not do that, so assume the module loaded where it was suppose to.
                 *  info.m_addrPreferredLoadAddress = (ulong)this.DebuggedModule.BaseAddress;
                 *  info.dwValidFields |= (uint)enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS; ;
                 * }
                 * if ((dwFields & (uint)enum_MODULE_INFO_FIELDS.MIF_SIZE) != 0)
                 * {
                 *  info.m_dwSize = this.DebuggedModule.Size;
                 *  info.dwValidFields |= (uint)enum_MODULE_INFO_FIELDS.MIF_SIZE;
                 * }
                 * if ((dwFields & (uint)enum_MODULE_INFO_FIELDS.MIF_LOADORDER) != 0)
                 * {
                 *  info.m_dwLoadOrder = this.DebuggedModule.GetLoadOrder();
                 *  info.dwValidFields |= (uint)enum_MODULE_INFO_FIELDS.MIF_LOADORDER;
                 * }
                 * if ((dwFields & (uint)enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION) != 0)
                 * {
                 *  if (this.DebuggedModule.SymbolsLoaded)
                 *  {
                 *      info.m_bstrUrlSymbolLocation = this.DebuggedModule.SymbolPath;
                 *      info.dwValidFields |= (uint)enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
                 *  }
                 * }
                 * if ((dwFields & (uint)enum_MODULE_INFO_FIELDS.MIF_FLAGS) != 0)
                 * {
                 *  info.m_dwModuleFlags = 0;
                 *  if (this.DebuggedModule.SymbolsLoaded)
                 *  {
                 *      info.m_dwModuleFlags |= (uint)(enum_MODULE_FLAGS.MODULE_FLAG_SYMBOLS);
                 *  }
                 *  info.dwValidFields |= (uint)enum_MODULE_INFO_FIELDS.MIF_FLAGS;
                 * }*/


                infoArray[0] = info;

                return(EngineConstants.S_OK);
            }
            catch (ComponentException e)
            {
                return(e.HRESULT);
            }
            catch (Exception e)
            {
                return(EngineUtils.UnexpectedException(e));
            }
        }
コード例 #25
0
        public int GetInfo(enum_MODULE_INFO_FIELDS fields, MODULE_INFO[] moduleInfo)
        {
            var        info             = new MODULE_INFO();
            SbFileSpec platformFileSpec = _lldbModule.GetPlatformFileSpec();

            if ((enum_MODULE_INFO_FIELDS.MIF_NAME & fields) != 0)
            {
                if (platformFileSpec != null)
                {
                    info.m_bstrName     = platformFileSpec.GetFilename();
                    info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
                }
            }

            // "URL" fills in the "Path" column in the Modules window.
            if ((enum_MODULE_INFO_FIELDS.MIF_URL & fields) != 0)
            {
                // The module paths are for remote files (on Linux).
                if (platformFileSpec != null)
                {
                    info.m_bstrUrl = FileUtil.PathCombineLinux(
                        platformFileSpec.GetDirectory(), platformFileSpec.GetFilename());
                }

                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
            }

            // "URLSYMBOLLOCATION" fills in the Symbol File Location column.
            if ((enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION & fields) != 0)
            {
                if (_moduleUtil.HasSymbolsLoaded(_lldbModule))
                {
                    // The symbol paths are for local files (on Windows).
                    SbFileSpec symbolFileSpec = _lldbModule.GetSymbolFileSpec();
                    if (symbolFileSpec != null)
                    {
                        info.m_bstrUrlSymbolLocation = Path.Combine(
                            symbolFileSpec.GetDirectory(), symbolFileSpec.GetFilename());
                        info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
                    }
                }
            }

            if ((enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS & fields) != 0)
            {
                info.m_addrLoadAddress = _lldbModule.GetCodeLoadAddress();
                info.dwValidFields    |= enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS;
            }

            if ((enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS & fields) != 0)
            {
                // TODO: Find the actual preferred load address rather than
                // pretending the module is loaded in the right place.
                // We may choose to ignore this, as samples do: extracting the preferred base
                // address from the library / executable seems nontrivial.
                // If m_addrLoadAddress is a different value, VS will show a warning on the icons
                // in the Modules window.
                info.m_addrPreferredLoadAddress = info.m_addrLoadAddress;
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS;
            }

            if ((enum_MODULE_INFO_FIELDS.MIF_SIZE & fields) != 0)
            {
                info.m_dwSize       = (uint)_lldbModule.GetCodeSize();
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_SIZE;
            }

            if ((enum_MODULE_INFO_FIELDS.MIF_LOADORDER & fields) != 0)
            {
                info.m_dwLoadOrder  = _loadOrder;
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADORDER;
            }

            if ((enum_MODULE_INFO_FIELDS.MIF_FLAGS & fields) != 0)
            {
                info.m_dwModuleFlags = 0;
                if (_moduleUtil.HasSymbolsLoaded(_lldbModule))
                {
                    info.m_dwModuleFlags |= enum_MODULE_FLAGS.MODULE_FLAG_SYMBOLS;
                }

                if (_lldbModule.Is64Bit())
                {
                    info.m_dwModuleFlags |= enum_MODULE_FLAGS.MODULE_FLAG_64BIT;
                }

                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_FLAGS;
            }

            if ((enum_MODULE_INFO_FIELDS.MIF_DEBUGMESSAGE & fields) != 0)
            {
                if (!_moduleUtil.HasSymbolsLoaded(_lldbModule))
                {
                    var inclusionSetting = _symbolSettingsProvider.GetInclusionSettings();
                    if (!inclusionSetting.IsModuleIncluded(ModuleName))
                    {
                        info.m_bstrDebugMessage = SymbolInclusionSettings.ModuleExcludedMessage;
                    }
                }

                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_DEBUGMESSAGE;
            }

            moduleInfo[0] = info;
            return(VSConstants.S_OK);
        }
コード例 #26
0
        public int GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo)
        {
            Log.Debug("ScriptProgramNode: IDebugModule2.GetInfo");
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_NAME) != 0)
            {
                pinfo[0].m_bstrName = FileName;
                pinfo[0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
            }

            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_FLAGS) != 0)
            {
                pinfo[0].m_dwModuleFlags = enum_MODULE_FLAGS.MODULE_FLAG_SYMBOLS;
                pinfo[0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_FLAGS;
            }

            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION) != 0)
            {
                pinfo[0].m_bstrUrlSymbolLocation = @".\";
                pinfo[0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
            }

            return VSConstants.S_OK;
        }
コード例 #27
0
        // Token: 0x060000B8 RID: 184 RVA: 0x00003D28 File Offset: 0x00001F28
        public int GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo)
        {
            int result;

            try
            {
                MODULE_INFO module_INFO = default(MODULE_INFO);
                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_NAME) != 0)
                {
                    module_INFO.m_bstrName     = Path.GetFileName(this.assembly.Location);
                    module_INFO.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
                }
                bool flag = false;
                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URL) != 0)
                {
                    module_INFO.m_bstrUrl = this.FindLocalLocation(this.assembly);
                    if (!string.IsNullOrEmpty(module_INFO.m_bstrUrl))
                    {
                        flag = true;
                    }
                    module_INFO.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
                }
                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_VERSION) != 0)
                {
                    module_INFO.m_bstrVersion  = this.assembly.GetName().Version.ToString();
                    module_INFO.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_VERSION;
                }
                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS) != 0)
                {
                    module_INFO.m_addrLoadAddress = (ulong)this.assembly.GetAssemblyObject().Address;
                    module_INFO.dwValidFields    |= enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS;
                    if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS) != 0)
                    {
                        module_INFO.m_addrPreferredLoadAddress = module_INFO.m_addrLoadAddress;
                        module_INFO.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS;
                    }
                }
                string text = this.FindSymbolLocation(this.assembly);
                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION) != 0 && text != null)
                {
                    module_INFO.m_bstrUrlSymbolLocation = text;
                    module_INFO.dwValidFields          |= enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
                }
                if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_FLAGS) != 0)
                {
                    module_INFO.m_dwModuleFlags = 0;
                    if (text != null)
                    {
                        module_INFO.m_dwModuleFlags |= enum_MODULE_FLAGS.MODULE_FLAG_SYMBOLS;
                    }
                    else if (flag && (dwFields & enum_MODULE_INFO_FIELDS.MIF_DEBUGMESSAGE) != 0)
                    {
                        module_INFO.m_bstrDebugMessage = "Symbols loaded in VM";
                        module_INFO.dwValidFields     |= enum_MODULE_INFO_FIELDS.MIF_DEBUGMESSAGE;
                    }
                    if (this.assembly.GetName().ProcessorArchitecture == ProcessorArchitecture.IA64)
                    {
                        module_INFO.m_dwModuleFlags |= enum_MODULE_FLAGS.MODULE_FLAG_64BIT;
                    }
                    module_INFO.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_FLAGS;
                }
                pinfo[0] = module_INFO;
                result   = 0;
            }
            catch (Exception ex)
            {
                result = ex.HResult;
            }
            return(result);
        }
コード例 #28
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        #region IDebugModule2 Members

        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        public virtual int GetInfo(enum_MODULE_INFO_FIELDS requestedFields, MODULE_INFO [] infoArray)
        {
            //
            // Retrieve relevant requested data for this module.
            //

            LoggingUtils.PrintFunction();

            try
            {
                infoArray [0] = new MODULE_INFO();

                if ((requestedFields & enum_MODULE_INFO_FIELDS.MIF_NAME) != 0)
                {
                    infoArray [0].m_bstrName = Name;

                    infoArray [0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
                }

                if ((requestedFields & enum_MODULE_INFO_FIELDS.MIF_URL) != 0)
                {
                    infoArray [0].m_bstrUrl = RemotePath;

                    infoArray [0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
                }

                if ((requestedFields & enum_MODULE_INFO_FIELDS.MIF_VERSION) != 0)
                {
                    infoArray [0].m_bstrVersion = Version;

                    infoArray [0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_VERSION;
                }

                if ((requestedFields & enum_MODULE_INFO_FIELDS.MIF_DEBUGMESSAGE) != 0)
                {
                    infoArray [0].m_bstrDebugMessage = RemotePath;

                    infoArray [0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_DEBUGMESSAGE;
                }

                if ((requestedFields & enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS) != 0)
                {
                    infoArray [0].m_addrLoadAddress = RemoteLoadAddress;

                    infoArray [0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS;
                }

                if ((requestedFields & enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS) != 0)
                {
                    // Assume the module loaded where it was suppose to.

                    infoArray [0].m_addrPreferredLoadAddress = RemoteLoadAddress;

                    infoArray [0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS;
                }

                if ((requestedFields & enum_MODULE_INFO_FIELDS.MIF_SIZE) != 0)
                {
                    infoArray [0].m_dwSize = Size;

                    infoArray [0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_SIZE;
                }

                if ((requestedFields & enum_MODULE_INFO_FIELDS.MIF_LOADORDER) != 0)
                {
                    infoArray [0].m_dwLoadOrder = 0;

                    infoArray [0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADORDER;
                }

                if ((requestedFields & enum_MODULE_INFO_FIELDS.MIF_TIMESTAMP) != 0)
                {
                }

                if ((requestedFields & enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION) != 0)
                {
                    infoArray [0].m_bstrUrlSymbolLocation = "file://" + SymbolsPath;

                    infoArray [0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
                }

                if ((requestedFields & enum_MODULE_INFO_FIELDS.MIF_FLAGS) != 0)
                {
                    infoArray [0].m_dwModuleFlags = enum_MODULE_FLAGS.MODULE_FLAG_NONE;

                    if (SymbolsLoaded)
                    {
                        infoArray [0].m_dwModuleFlags |= enum_MODULE_FLAGS.MODULE_FLAG_SYMBOLS;
                    }

                    infoArray [0].dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_FLAGS;
                }

                return(Constants.S_OK);
            }
            catch (Exception e)
            {
                LoggingUtils.HandleException(e);

                return(Constants.E_FAIL);
            }
        }
コード例 #29
0
ファイル: MonoModule.cs プロジェクト: vasek-cz/vs-mono
        public int GetInfo(enum_MODULE_INFO_FIELDS dwFields, MODULE_INFO[] pinfo)
        {
            var info = new MODULE_INFO();

            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_NAME) != 0)
            {
                info.m_bstrName     = System.IO.Path.GetFileName(engine.Session.VirtualMachine.RootDomain.GetEntryAssembly().Location);
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_NAME;
            }
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URL) != 0)
            {
                info.m_bstrUrl      = engine.Session.VirtualMachine.RootDomain.GetEntryAssembly().Location;
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URL;
            }
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS) != 0)
            {
                info.m_addrLoadAddress = 0;
                info.dwValidFields    |= enum_MODULE_INFO_FIELDS.MIF_LOADADDRESS;
            }
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS) != 0)
            {
                info.m_addrPreferredLoadAddress = 0;
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_PREFFEREDADDRESS;
            }
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_SIZE) != 0)
            {
                info.m_dwSize       = 0;
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_SIZE;
            }
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_LOADORDER) != 0)
            {
                info.m_dwLoadOrder  = 0;
                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_LOADORDER;
            }
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION) != 0)
            {
/*
 *              if (this.DebuggedModule.SymbolsLoaded)
 *              {
 *                  info.m_bstrUrlSymbolLocation = this.DebuggedModule.SymbolPath;
 *                  info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_URLSYMBOLLOCATION;
 *              }
 */
            }
            if ((dwFields & enum_MODULE_INFO_FIELDS.MIF_FLAGS) != 0)
            {
                info.m_dwModuleFlags = 0;
//                if (this.DebuggedModule.SymbolsLoaded)
//                {
                info.m_dwModuleFlags |= (enum_MODULE_FLAGS.MODULE_FLAG_SYMBOLS);
//                }

/*
 *              if (this.Process.Is64BitArch)
 *              {
 *                  info.m_dwModuleFlags |= enum_MODULE_FLAGS.MODULE_FLAG_64BIT;
 *              }
 */

                info.dwValidFields |= enum_MODULE_INFO_FIELDS.MIF_FLAGS;
            }

            pinfo[0] = info;

            return(VSConstants.S_OK);
        }