public int EnumFrameInfo(enum_FRAMEINFO_FLAGS dwFieldSpec, uint nRadix, out IEnumDebugFrameInfo2 ppEnum)
        {
            ppEnum = null;
            List <FRAMEINFO> frames = new List <FRAMEINFO>();

#if !HIDE_THREADS
            ReadOnlyCollection <IStackFrame> stackFrames = _thread.GetFrames();

            FRAMEINFO[] frameInfo = new FRAMEINFO[1];
            foreach (var stackFrame in stackFrames)
            {
                JavaDebugStackFrame javaStackFrame = new JavaDebugStackFrame(this, stackFrame);
                int result = javaStackFrame.GetInfo(dwFieldSpec, nRadix, frameInfo);
                if (!ErrorHandler.Succeeded(result))
                {
                    return(result);
                }

                frames.Add(frameInfo[0]);
            }
#endif

            ppEnum = new EnumDebugFrameInfo(frames);
            return(VSConstants.S_OK);
        }
        private bool TryGetLocation(out string location)
        {
#if !HIDE_THREADS
            int frameCount = _thread.GetFrameCount();
            for (int i = 0; i < frameCount; i++)
            {
                IStackFrame frame  = _thread.GetFrame(i);
                IMethod     method = frame.GetLocation().GetMethod();
                if (method.GetIsNative())
                {
                    continue;
                }

                JavaDebugStackFrame stackFrame = new JavaDebugStackFrame(this, frame);
                FRAMEINFO[]         frameInfo  = new FRAMEINFO[1];
                int result = stackFrame.GetInfo(
                    enum_FRAMEINFO_FLAGS.FIF_FUNCNAME
                    | enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS
                    | enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS_NAMES
                    | enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS_TYPES
                    | enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_OFFSET
                    | enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_LINES,
                    10,
                    frameInfo);
                if (ErrorHandler.Failed(result))
                {
                    break;
                }

                location = frameInfo[0].m_bstrFuncName;
                return(true);
            }
#endif

            location = null;
            return(false);
        }
Esempio n. 3
0
        private bool TryGetLocation(out string location)
        {
#if !HIDE_THREADS
            int frameCount = _thread.GetFrameCount();
            for (int i = 0; i < frameCount; i++)
            {
                IStackFrame frame = _thread.GetFrame(i);
                IMethod method = frame.GetLocation().GetMethod();
                if (method.GetIsNative())
                    continue;

                JavaDebugStackFrame stackFrame = new JavaDebugStackFrame(this, frame);
                FRAMEINFO[] frameInfo = new FRAMEINFO[1];
                int result = stackFrame.GetInfo(
                    enum_FRAMEINFO_FLAGS.FIF_FUNCNAME
                    | enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS
                    | enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS_NAMES
                    | enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_ARGS_TYPES
                    | enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_OFFSET
                    | enum_FRAMEINFO_FLAGS.FIF_FUNCNAME_LINES,
                    10,
                    frameInfo);
                if (ErrorHandler.Failed(result))
                    break;

                location = frameInfo[0].m_bstrFuncName;
                return true;
            }
#endif

            location = null;
            return false;
        }
Esempio n. 4
0
        public int EnumFrameInfo(enum_FRAMEINFO_FLAGS dwFieldSpec, uint nRadix, out IEnumDebugFrameInfo2 ppEnum)
        {
            ppEnum = null;
            List<FRAMEINFO> frames = new List<FRAMEINFO>();

#if !HIDE_THREADS
            ReadOnlyCollection<IStackFrame> stackFrames = _thread.GetFrames();

            FRAMEINFO[] frameInfo = new FRAMEINFO[1];
            foreach (var stackFrame in stackFrames)
            {
                JavaDebugStackFrame javaStackFrame = new JavaDebugStackFrame(this, stackFrame);
                int result = javaStackFrame.GetInfo(dwFieldSpec, nRadix, frameInfo);
                if (!ErrorHandler.Succeeded(result))
                    return result;

                frames.Add(frameInfo[0]);
            }
#endif

            ppEnum = new EnumDebugFrameInfo(frames);
            return VSConstants.S_OK;
        }