Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Add support for VxWorks (v3)
Date: Fri, 04 Mar 2011 12:10:00 -0000	[thread overview]
Message-ID: <20110304121028.GH30306@adacore.com> (raw)
In-Reply-To: <201103041045.10426.pedro@codesourcery.com>

First of all, I really appreciate the attention and time spent
on this topic. Thanks guys! After writing another rather lengthy
reply, I just started thinking that maybe I should go back to
basics and describe how VxWorks systems work. I tried brushing
on that in the GDB Manual's update, but assumed that readers
were minimally familiar with a few concepts.  However, I'm running
tight on time, and after re-reading myself, I think I presented
most of the important details about this system in a way that
flows reasonably well. So I'm giving this reply a try, and if
that doesn't work, or you feel this is necessary, I'll try to write
something up that describe the system more (or we can go with my
offer to deal with that sometime during the GCC Summit - see below).

> 1) Could map into a single inferior and then "info sharedlibrary"
> lists all partitions?  What is it in the use case that makes
> this not viable?

I really think that the concept of partitions and shared libraries
do not match at all. It would be simpler if we were allowed to think
that partitions can be seen as independent computers.  This is
pretty much the case (and I believe the intent!), except that we
have the extra complication of the fact that inter-partition linkage
is allowed under certain conditions.

> 2) Could map each partition into an inferior?  What is
> it in the use case that makes this not viable?

We can't map a partition into an inferior either, because we may
be debugging a single (VxWorks) task, or a group of tasks, from
that partition.  In that case, the inferior consists purely of
the VxWorks task(s) being debugged.

> > Another use case is is when
> > debugging a task that runs some code provided by a shared partition.
> > It's a little bit like shared libraries on traditional OSes.  In that
> > case, you're effectively debugging over several partitions at the same
> > time.
> 
> So that task would be mapped to a running inferior, and the
> shared partition would appear under shared libraries?

It's a little bit like that.

VxWorks systems consists of partitions inside which there are modules,
which are inter-linked blobs of code. There is no executable, just
these pieces of code called modules.  All these modules, including
the ones in shared partitions, but also those in the current partition,
are just objfiles. We have no main objfile in this case.

Because the system is so bare, it's really hard to map any of
the standard OS concepts on it.

When you read memory, or insert a breakpoint, the user needs to
tell us which which partition this applies to. This is what the
"partition" commands are for. It's a little bit like the "current
language", it tell us the context of all the queries that user
are making.

> If we end up with partitions, note that the "program space" entity
> was designed specifically for this.  From your description, the
> partition's symbols are a natural fit for a "program space".
> I kept the "address space" object separate from the "program space"
> exactly for cases like these, where you have several
> distinct programs (program spaces / partitions) running under
> the same address space.

Absolutely. I remember reading the specs of your program & address
spaces with great interest when you published it.  It'll need
a few extensions, I think (for instance, an inferior may be
running over multiple program spaces).  I think that we'll have
one program spacen and one address space per partition (except
maybe for shared partitions, which, I think, do not have their
own address space, only code).

That's also only part of the solution: We're going to need
a target-side extension to allow the target to tell core GDB
that the system has partitions, what partitions, etc.

And then a core part to deal with partitions themselves.

> You shouldn need objfile list swapping hacks anymore.

Hopefully not - just enhanced versions of the objfile chain
walking.

I am really sorry to be using up so much of everybody's time
for this concept.  I wish it was easy to explain, but VxWorks
systems can take a little bit of explanation before getting
the hang of it.  If you guys are interested, and are going to
be at this year's GCC Summit, I'm more than happy to make
a 10-15 min presentation of VxWorks systems, and let you guys
ask any questions you may have.  We could then talk about how
to best implement partition support.  Otherwise, I'm more than
happy to continue by email.

-- 
Joel


  reply	other threads:[~2011-03-04 12:10 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-04  6:22 Joel Brobecker
2011-03-04  6:22 ` [VxWorks 01/20] fix parameter names in cli/cli-utils.h Joel Brobecker
2011-03-04  6:22 ` [VxWorks 03/20] New toplevel_command_post observer Joel Brobecker
2011-03-04  6:22 ` [VxWorks 04/20] New general purpose routines in utils.c Joel Brobecker
2011-03-04  6:22 ` [VxWorks 05/20] more parsing routines in cli/cli-utils Joel Brobecker
2011-03-04  6:22 ` [VxWorks 02/20] Some ada-lang/ada-tasks routines needed by the VxWorks target Joel Brobecker
2011-03-04  6:23 ` [VxWorks 07/20] new struct bp_target_info target_private_data field Joel Brobecker
2011-03-04  6:23 ` [VxWorks 10/20] Add options to control Vxworks related settings Joel Brobecker
2011-03-04  6:23 ` [VxWorks 08/20] New modules gdb_dlfcn and remote-wtx-utils Joel Brobecker
2011-03-04  6:23 ` [VxWorks 06/20] add new "unload" command (symetry of existing "load" command) Joel Brobecker
2011-03-04  6:24 ` [VxWorks 11/20] VxWorks breakpoint-handling module Joel Brobecker
2011-03-04  6:24 ` [VxWorks 14/20] remote-wtx-hw: register fetch/store support Joel Brobecker
2011-03-04  6:24 ` [VxWorks 12/20] "multi-tasks-mode" support Joel Brobecker
2011-03-04  6:24 ` [VxWorks 13/20] Add partition support Joel Brobecker
2011-03-04  6:24 ` [VxWorks 09/20] remote-wtxapi: The WTX API abstraction layer Joel Brobecker
2011-03-04  6:25 ` [VxWorks 17/20] Add support for VxWorks 6 Joel Brobecker
2011-03-04  6:25 ` [VxWorks 15/20] Add new "wtx" target Joel Brobecker
2011-03-04  6:25 ` [VxWorks 19/20] Configury and Makefile updates for VxWorks Joel Brobecker
2011-03-04  6:25 ` [VxWorks 16/20] WTX-TCL support module Joel Brobecker
2011-03-04  6:25 ` [VxWorks 18/20] Add tdep files for x86 and powerpc Joel Brobecker
2011-03-04  6:25 ` [VxWorks 20/20] document the new VxWorks port Joel Brobecker
2011-03-04  9:36 ` Add support for VxWorks (v3) Pedro Alves
2011-03-04 10:05   ` Joel Brobecker
2011-03-04 10:45     ` Pedro Alves
2011-03-04 12:10       ` Joel Brobecker [this message]
2011-03-07 19:49 ` Tom Tromey

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=20110304121028.GH30306@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.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