Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Hui Zhu <hui_zhu@mentor.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Add CTF support to GDB [3/4] ctf target
Date: Thu, 06 Dec 2012 13:37:00 -0000	[thread overview]
Message-ID: <CANFwon1VKO=+KAqs4oY1780BWWvbwSEKuRVxh2gVQXXoWU=h7w@mail.gmail.com> (raw)
In-Reply-To: <87pq2w3znr.fsf@fleche.redhat.com>

On Fri, Nov 30, 2012 at 4:46 AM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Hui" == Hui Zhu <hui_zhu@mentor.com> writes:
>
> Hui> It add a new target ctf like the tfile target to read the ctf file.
> Hui> After use this target open the ctf dir, you can use tfind to select
> Hui> the ctf event.  Each field inside this event will add to GDB as a
> Hui> internalvar.  And tdump will show all of them.  And you can use python
> Hui> read the value of them.
>
> Can you explain the internalvar feature a little?  Why is it needed?
> How are these variables named?  What do they represent?  Are they
> different from the saved trace data somehow?  I notice this feature
> isn't in the documentation at all -- I think that is required, perhaps
> with an example.
>
> Tom

Actually, I am not sure internalvar is the right name of the $xxx var.

About why is it needed?  This is a very good question.
Because CTF format is different with the tfile format and target ctf
is different with other target.

AFAIK each tracepoint frame entry in tfile format save the value of
var in address len format. Then when GDB want read the value of a var,
it will send address len info to "target tfile".

But CTF is different, it save the value of each var without address.
Libbabeltrace can parse this value out according to metadata file in
the CTF format dir.
Its advantage is to read this value don't need the debug info.  But
its weakness is not really fit with the GDB interace.
My first design is just support tfind to select the traceframe and
tdump to show all the value of the vars.  But it is not very useful
and cannot work very well with python.
So I change it to add each value to the GDB as a internalvar and named
as the name of var.
The python can access each var in the CTF for example: python print
int(gdb.parse_and_eval("$ret"))

I will update the doc of "target ctf" to add some example about use
this internalvar.

Thanks,
Hui


      reply	other threads:[~2012-12-06 13:37 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-21  1:45 Hui Zhu
2012-11-21  2:36 ` Yao Qi
2012-11-21  3:32   ` Hui Zhu
2012-11-27 10:55     ` Hui Zhu
2012-11-29 20:42       ` Tom Tromey
2012-12-21  8:23         ` Hui Zhu
2013-01-16 15:12           ` Abid, Hafiz
2013-01-23  5:54             ` Hui Zhu
2013-02-11 12:55               ` Hui Zhu
2012-11-21  4:29 ` Yao Qi
2012-11-29 20:24 ` Tom Tromey
2012-12-05  6:59   ` Hui Zhu
2012-11-29 20:47 ` Tom Tromey
2012-12-06 13:37   ` Hui Zhu [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='CANFwon1VKO=+KAqs4oY1780BWWvbwSEKuRVxh2gVQXXoWU=h7w@mail.gmail.com' \
    --to=teawater@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=hui_zhu@mentor.com \
    --cc=tromey@redhat.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