From: Gary Benson <gbenson@redhat.com>
To: Freddie Chopin <freddie_chopin@op.pl>
Cc: Pierre-Marie de Rodat <derodat@adacore.com>,
Liviu Ionescu <ilg@livius.net>,
gdb@sourceware.org,
openocd-devel <openocd-devel@lists.sourceforge.net>
Subject: Re: [OpenOCD-devel] Python API for supplying thread information?
Date: Fri, 31 Mar 2017 10:55:00 -0000 [thread overview]
Message-ID: <20170331105545.GA26820@blade.nx> (raw)
In-Reply-To: <1490287804.1231.7.camel@op.pl>
Hi,
I'm the guy who did the Infinity talk at Cauldron...
Freddie Chopin wrote:
> On Thu, 2017-03-23 at 10:23 +0100, Pierre-Marie de Rodat wrote:
> > What makes you think that? My understanding of the design is that
> > it's centered on adding new metadata sections to ELF binaries and
> > make the debugger use this metedata. This looks quite
> > embedded-friendly to me.
>
> Maybe I got the wrong impression, sorry. But the problem is that
> this project doesn't seem very active... Generally fragmenting the
> effort (yet another library with yet another standard and so on...)
> doesn't seem like a very good idea to me, that's why in my opinion a
> solution implemented completely in GDB would be better suited and
> would have a higher chance of "survival" and "adoption". But I might
> got the wrong impression again.
>
> However me and Liviu had a discussion about describing RTOS
> structure in a generic way and I'm still pretty certain that this is
> generally not possible in a generic and agnostic way. In the end it
> would become either extremely complex or you'd have to implement
> some kind of scripting/code to actually deal with that.
Infinity is active, but it's just me, and I've had some distractions
that've kept me from making progress of late.
I think it could do what you're asking. I'm not super-familiar with
embedded systems but I assume you're using GDB talking to something
via the remote protocol? Here's how I see it working:
* There's some information you need from the remote. I'll use the
example that you have a numeric thread ID and you want that
thread's priority, which is also a number.
* You write an Infinity function, called thread::priority_for_ID or
something. That function gets compiled by the Infinity note
compiler and lives in the executable. Possibly in your case it
would be stripped from the binary the embedded system sees, but
present in the binary GDB sees. [Note this is future work: Infinity
functions are always unstripped at present.] The function you wrote
is basically things like "read this register, add this other thing
to it, read this memory".
* GDB loads the binary, it has the Infinity functions.
* Your pretty printer is able to get the information it requires
by calling the Infinity function you wrote via a Python API in
GDB. [Note again, this part is future work, there's no such API
at present.]
* GDB executes the Infinity function you wrote, deferring to the
remote for register and memory reads using existing remote protocol
features.
This can all be done without adding extra features to the remote--the
Infinity function is executed by GDB.
It's not something that's weeks away from release, but if you want to
lend a hand? ;)
Cheers,
Gary
--
https://gbenson.net/
next prev parent reply other threads:[~2017-03-31 10:55 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-22 9:43 Freddie Chopin
2017-03-22 11:01 ` [OpenOCD-devel] " Liviu Ionescu
2017-03-22 11:46 ` Freddie Chopin
2017-03-22 17:23 ` Pierre-Marie de Rodat
2017-03-22 17:52 ` Freddie Chopin
2017-03-23 9:23 ` Pierre-Marie de Rodat
2017-03-23 16:50 ` Freddie Chopin
2017-03-23 18:08 ` Liviu Ionescu
2017-03-31 10:55 ` Gary Benson [this message]
2017-03-22 15:32 ` Phil Muldoon
2017-03-22 15:37 ` Phil Muldoon
2017-03-22 16:20 ` Freddie Chopin
2017-03-23 11:34 ` Yao Qi
2017-03-23 14:33 ` [OpenOCD-devel] " Duane Ellis
2017-03-26 14:11 ` Freddie Chopin
2017-03-23 16:41 ` Freddie Chopin
[not found] ` <CADQtY4AdhK73Gva2TYo4VDaTsY3Z33MtrJVLc-OwXwD6R5OqtQ@mail.gmail.com>
2017-03-26 14:02 ` [OpenOCD-devel] " Freddie Chopin
2017-03-22 21:51 ` Gareth McMullin
2017-03-23 16:44 ` Freddie Chopin
[not found] ` <220810f4-9843-d898-6947-e7eeeed3a1ed@daniel-krebs.net>
2017-03-23 16:56 ` [OpenOCD-devel] " Freddie Chopin
[not found] ` <CADQtY4BBxGdOg=DNqZYigA2G8-MVi5bvbbccfh8Vy_KEx-U+ug@mail.gmail.com>
2017-03-26 13:58 ` Freddie Chopin
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=20170331105545.GA26820@blade.nx \
--to=gbenson@redhat.com \
--cc=derodat@adacore.com \
--cc=freddie_chopin@op.pl \
--cc=gdb@sourceware.org \
--cc=ilg@livius.net \
--cc=openocd-devel@lists.sourceforge.net \
/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