Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Wenbo Yang <solrex@gmail.com>
To: Michael Qiu <fallwind@gmail.com>
Cc: gdb@sourceware.org
Subject: Re: gdb stub implement questions
Date: Mon, 01 Sep 2008 08:22:00 -0000	[thread overview]
Message-ID: <48BBA5F5.6000707@gmail.com> (raw)
In-Reply-To: <f74f98340808312308w511d8b4em7107c2af3d546c04@mail.gmail.com>

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



      parent reply	other threads:[~2008-09-01  8:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-01  4:03 Michael Qiu
2008-09-01  4:11 ` Daniel Jacobowitz
2008-09-01  6:09   ` Michael Qiu
2008-09-01  6:32     ` Michael Qiu
2008-09-01  8:22     ` Wenbo Yang [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48BBA5F5.6000707@gmail.com \
    --to=solrex@gmail.com \
    --cc=fallwind@gmail.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox