Beispiel #1
0
        /// <summary>
        /// Parse an incoming STKL.
        /// </summary>
        private void handleSTKL(Client client, ByteBuffer data)
        {
            StackTraceElement[] trace;
            int i, threadId, stackDepth;
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unused") int future;
            int future;

            future   = data.getInt();
            threadId = data.getInt();

            Log.v("ddms", "STKL: " + threadId);

            /* un-serialize the StackTraceElement[] */
            stackDepth = data.getInt();
            trace      = new StackTraceElement[stackDepth];
            for (i = 0; i < stackDepth; i++)
            {
                string className, methodName, fileName;
                int    len, lineNumber;

                len        = data.getInt();
                className  = getString(data, len);
                len        = data.getInt();
                methodName = getString(data, len);
                len        = data.getInt();
                if (len == 0)
                {
                    fileName = null;
                }
                else
                {
                    fileName = getString(data, len);
                }
                lineNumber = data.getInt();

                trace[i] = new StackTraceElement(className, methodName, fileName, lineNumber);
            }

            ThreadInfo threadInfo = client.clientData.getThread(threadId);

            if (threadInfo != null)
            {
                threadInfo.stackCall = trace;
                client.update(Client.CHANGE_THREAD_STACKTRACE);
            }
            else
            {
                Log.d("STKL", string.Format("Got stackcall for thread {0:D}, which does not exists (anymore?).", threadId));                 //$NON-NLS-1$
            }
        }
Beispiel #2
0
        /*
         * Handle a THNM (THread NaMe) message.  We get one of these after
         * somebody calls Thread.setName() on a running thread.
         */
        private void handleTHNM(Client client, ByteBuffer data)
        {
            int    threadId, nameLen;
            string name;

            threadId = data.getInt();
            nameLen  = data.getInt();
            name     = getString(data, nameLen);

            Log.v("ddm-thread", "THNM: " + threadId + " '" + name + "'");

            ThreadInfo threadInfo = client.clientData.getThread(threadId);

            if (threadInfo != null)
            {
                threadInfo.threadName = name;
                client.update(Client.CHANGE_THREAD_DATA);
            }
            else
            {
                Log.d("ddms", "Thread with id=" + threadId + " not found");
            }
        }
Beispiel #3
0
        internal virtual void addThread(int threadId, string threadName)
        {
            ThreadInfo attr = new ThreadInfo(threadId, threadName);

            mThreadMap.Add(threadId, attr);
        }
Beispiel #4
0
		internal virtual void addThread(int threadId, string threadName)
		{
			ThreadInfo attr = new ThreadInfo(threadId, threadName);
			mThreadMap.Add(threadId, attr);
		}