From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6224 invoked by alias); 1 Sep 2008 08:22:48 -0000 Received: (qmail 6208 invoked by uid 22791); 1 Sep 2008 08:22:47 -0000 X-Spam-Check-By: sourceware.org Received: from ti-out-0910.google.com (HELO ti-out-0910.google.com) (209.85.142.184) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 01 Sep 2008 08:21:47 +0000 Received: by ti-out-0910.google.com with SMTP id d10so1139634tib.12 for ; Mon, 01 Sep 2008 01:21:43 -0700 (PDT) Received: by 10.110.3.15 with SMTP id 15mr7414382tic.24.1220257302960; Mon, 01 Sep 2008 01:21:42 -0700 (PDT) Received: from ?192.168.0.209? ( [123.127.78.126]) by mx.google.com with ESMTPS id 22sm457717tim.10.2008.09.01.01.21.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 01 Sep 2008 01:21:41 -0700 (PDT) Message-ID: <48BBA5F5.6000707@gmail.com> Date: Mon, 01 Sep 2008 08:22:00 -0000 From: Wenbo Yang User-Agent: Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Michael Qiu CC: gdb@sourceware.org Subject: Re: gdb stub implement questions References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-09/txt/msg00004.txt.bz2 Michael Qiu wrote: > Here I have an proposal, will you take a look? > > Background: > I'm using uscosII, it's a multitask os, and all tasks running in the > same memory space. So it's easy to get other tasks' information. > > What I suppose to do is: > 1. When system startup. I will put a piece of code like this: > install_bkpt_handle(); // Install the trap handler for gdb. > bkpt; // Just trigger it. > Question: Can I just put it before OS start? If I just put it after OS > has started, then only means I cannot debug the os startup process? > Yes, you can debug the os startup process. Just put the stub in different memory space against your os. > 2. Write an exception handler to handle the bkpt exception. In this > routine I should save the context of interrupt task and swith to a gdb > remote debug protocal process task. > Question: should I disable interrupt in the exception handler and the > protocal process task? Or should I disable task scheduler when enter > the protocal process task? > Maybe you made some mistake here. If you were debugging an OS, probably the task scheduler is meaningless to you. If you were debugging an APP on an os, it is your os's responsibility to support stub's function. > 3. When user just "continue" or "step" the program, the protocal > process task should save it's context and restore the cpu with the > previous saved context for the interrupt task. > Question: How can I do it with ucos/II's API without digging into the > code? Should the protocal process task action like an normal task or > just an routine not known to OS? > Still Daniel's answer: These are more questions about your operating system than about GDB. Regards, Wenbo -- Wenbo YANG The State Key Laboratory Of Information Security Graduate University of CAS, 19A Yuquan Road, Beijing, China MSN/AIM/QQ: solrex@live.com --- Homepage: http://solrex.cn