Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Paul Koning <pkoning@equallogic.com>
To: gdb@sourceware.org
Subject: Re: Improving GDB for multicore and embedded system!
Date: Fri, 02 Mar 2007 15:22:00 -0000	[thread overview]
Message-ID: <17896.16613.317537.597215@gargle.gargle.HOWL> (raw)
In-Reply-To: <1172847786.2170.24.camel@localhost.localdomain>

I have some experience with multicore debugging and hacking GDB for
that.

In our case, we have two cores that have the same instruction
architecture.  But they are running different OS, and one is running
64-bit code while the other is running 32-bit.

For live debug, we use two copies of GDB.  Yes, that uses up some more
VM for the multiple symbol tables.  No problem, workstation memory is
cheap and easy to get.  Each core has a stub, so we can do remote
debug via its stub.  (If they had to share a stub, which may happen at
some point, I'll probably just put in a mux widget that continues to
create the appearance of separate stubs.)

For crash dump analysis, I get all of memory in a single dump file.
Debugging that with two GDBs would be possible but annoying, so I
added hacks to the dump analyzer machinery to allow it to switch
between the two OS views.  It switches address spaces (easy) and it
switches executable file symbol tables (very hard).  Fortunately, the
kernel doesn't have shared libs or the like, it's all one file.

This works just well enough to make it practical.  It does
occasionally mess up.  For dump analysis that's not too big a problem,
just restart GDB.  For live system debug that would create the risk of
losing control, which is one reason why we don't do it there.

If you have a situation where the multiple cores can be presented to
GDB as threads of a single image, the thread machinery should work.
If that model doesn't fit, I think the best way to proceed would be to
use multiple GDBs, and buy more PC DRAM if necessary.  That would be
especially true if the various cores differ enough that a single GDB
doesn't understand all of them even after putting the multiarch
machinery to work.

The notion that you debug exactly one executable file seems to be very
much fundamental in GDB.  You can hack around it but the result is
messy and not very stable.  Or I suppose if you have enough help from
the GDB experts you can redesign GDB to eliminate this assumption.  I
don't know how long that would take and how hard it would be.
Personally, if I had a need for this kind of debug support, I'd just
use the multiple GDBs and ask the boss for more memory.

    paul


  reply	other threads:[~2007-03-02 15:22 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-01 16:39 Dominique Toupin (QA/EMC)
2007-03-01 17:00 ` Dominique Toupin (QA/EMC)
2007-03-01 17:08   ` Dominique Toupin (QA/EMC)
2007-03-02  9:09 ` Denis PILAT
2007-03-02 10:04   ` Dominique Toupin (QA/EMC)
2007-03-02 13:54   ` Daniel Jacobowitz
2007-03-02 14:21     ` Fabian Cenedese
2007-03-02 14:31       ` Daniel Jacobowitz
2007-03-02 15:04     ` Ramana Radhakrishnan
2007-03-02 15:22       ` Paul Koning [this message]
2007-03-05 16:51     ` Ulrich Weigand

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=17896.16613.317537.597215@gargle.gargle.HOWL \
    --to=pkoning@equallogic.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