public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Laurie Gellatly <laurie.gellatly@netic.com>
Cc: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] building and debugging
Date: Tue, 20 Feb 2007 19:32:00 -0000	[thread overview]
Message-ID: <20070220193159.GB15919@lunn.ch> (raw)
In-Reply-To: <OBEELMDOHGDFDEMJCJCJMEFELKAA.laurie.gellatly@netic.com>

On Mon, Feb 19, 2007 at 06:22:56PM +1100, Laurie Gellatly wrote:
> Hi All,
> I've been using eclipse to develop my arm based system for some time.
> The application runs multiple threads and I had been able to debug them
> reasonably well (the program did not always flow the way I expected when
> single stepping and sometimes local variables are not able to be displayed).

Try disabling the optimizer, i.e. remove the -O2 flag. It will then
flow in a more logical, but less efficient way.

> What I have now is that although the main thread seems to be able to be
> debugged, the other threads have problems.
> I can set a breakpoint in a thread and it will stop, but single stepping or
> trying to display local variables etc no longer works.

Part of the problem is that gdb is not fully thread aware. It cannot
stop a thread context change at a time slice. It cannot stop a higher
priority thread taking over, it cannot stop a timer tick happening
etc. So when every you do a single step something else can take over
control from the current thread. What you can do is run the thread you
are trying to debug at a higher priority than anything else. That will
reduce the likelihood of it being preempted. However if you are
looking for a race condition this is not going to help you...

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2007-02-20 19:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-18 17:51 [ECOS] i2c questions Grant Edwards
2007-02-18 18:57 ` [ECOS] " Grant Edwards
2007-02-18 21:56   ` Grant Edwards
2007-02-19  7:23 ` [ECOS] building and debugging Laurie Gellatly
2007-02-20 19:32   ` Andrew Lunn [this message]
     [not found] <519508.74681.qm@web62310.mail.re1.yahoo.com>
2007-02-21 10:04 ` Laurie Gellatly

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=20070220193159.GB15919@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=ecos-discuss@sources.redhat.com \
    --cc=laurie.gellatly@netic.com \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).