Exemple #1
0
        private SourceInformation GetSourceInformation(MethodDebugInformationHandle handle)
        {
            SourceInformation sourceInformation = null;
            try
            {
                var methodDebugDefinition = _reader.GetMethodDebugInformation(handle);
                var fileName = GetMethodFileName(methodDebugDefinition);
                var lineNumber = GetMethodStartLineNumber(methodDebugDefinition);

                sourceInformation = new SourceInformation(fileName, lineNumber);
            }
            catch (BadImageFormatException)
            {
            }

            return sourceInformation;
        }
Exemple #2
0
        private SourceInformation GetSourceInformation(MethodDebugInformationHandle handle)
        {
            if (_reader == null)
            {
                throw new ObjectDisposedException(nameof(PortablePdbReader));
            }

            SourceInformation sourceInformation = null;

            try
            {
                var methodDebugDefinition = _reader.GetMethodDebugInformation(handle);
                var fileName   = GetMethodFileName(methodDebugDefinition);
                var lineNumber = GetMethodStartLineNumber(methodDebugDefinition);

                sourceInformation = new SourceInformation(fileName, lineNumber);
            }
            catch (BadImageFormatException)
            {
            }

            return(sourceInformation);
        }