Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Marc Khouzam <marc.khouzam@ericsson.com>
To: 'Yao Qi' <yao@codesourcery.com>,
	"'gdb-patches@sourceware.org'"	<gdb-patches@sourceware.org>
Subject: RE: [PATCH 0/2] Create inferior fro trace file target
Date: Thu, 30 Jan 2014 19:21:00 -0000	[thread overview]
Message-ID: <E59706EF8DB1D147B15BECA3322E4BDC1C57CE2C@eusaamb103.ericsson.se> (raw)
In-Reply-To: <1391060652-10870-1-git-send-email-yao@codesourcery.com>

> -----Original Message-----
> From: Yao Qi [mailto:yao@codesourcery.com]
> Sent: Thursday, January 30, 2014 12:44 AM
> To: gdb-patches@sourceware.org
> Cc: Marc Khouzam
> Subject: [PATCH 0/2] Create inferior fro trace file target
> 
> Marc reported that Eclipse is unable to load trace file with GDB 7.7, but it
> works with GDB 7.6. https://sourceware.org/ml/gdb/2014-
> 01/msg00031.html
> This change is caused by my patch:
> 
>   [RFC] Don't create inferior in tfile target.
>   https://sourceware.org/ml/gdb-patches/2013-05/msg00068.html
> 
> because I didn't think inferior should be created when a tracefile is loaded.
> 
> On 01/30/2014 04:56 AM, Marc Khouzam wrote:
> > The trace file processing is based on the core file one, which shows
> > the execution tree after the core file is loaded.
> > But reading your mail makes me think that it makes sense that when
> > loading a trace file there would be no inferior or thread yet.
> > However, when selecting a trace record, then we would need to see the
> > inferior and thread.  This is not the case with 7.7.
> 
> I don't know why trace file processing is based on the core file.  They are
> different, IMO.

When starting the debug session, for a user, it is very similar to ask
to look at a core file than to look at a trace file.  So in Eclipse, it is
the same UI except that the user specifies if the file is a trace file
or a core file.

> > To me, trace records are like a limited core file:
> > a snapshot of a specific point of the execution.  So, when looking at
> > a trace record, just like when looking at a core file, we want to show
> > the execution hierarchy, i.e., the process and thread where the record
> > was collected.
> 
> The corefile has information about thread and process, but trace file
> doesn't.  Thread and process is not mentioned in the "Trace File Format"
> doc https://sourceware.org/gdb/current/onlinedocs/gdb/Trace-File-
> Format.html
> 
> Keeping trace file similar to core file is unspecified, and their code are total
> independent to each other.  It is not good for Eclipse to assume that, unless
> we can extend trace file format to include the process id and the thread id
> in each trace frame.

Eclipse fakes things a bit to make it look similar.  Maybe that is not the best
way to go and I'll have to revisit that eventually.

> Anyway, it is not a good time to discuss about trace file format and how
> Eclipse should handle trace file.  Let me focus on this problem and patches
> at first :).

Thank you.

> Reverting my patch works, which is included in patch 1/2.
> In patch 2/2, I add something similar to ctf target, and a test case.
> Patches are regression tested on x86_64-linux.  They are also tested on x86-
> linux with babeltrace installed.

I confirmed that things work again with Eclipse once I applied your patches.

> In short, Eclipse replies on an undocumented GDB behavior, that GDB
> should provide inferior and thread when reading a trace file while  I don't
> think GDB has to.  If global maintainers think GDB 7.7 shouldn't break
> Eclipse, then we should pick these two patches up.

You can guess where I place my vote :)

> These two patches bring an issue for multi-target support, say if GDB opens
> two trace files in two targets, what is the expected output of "info inferiors"
> and "info threads"?

If you are asking about Eclipse, we don't support multi-target, so the problem
never presented itself.  Maybe this should be part of a bigger discussion about
how trace files should be handled.

> *** BLURB HERE ***

(Out of curiosity, I've wondered why you have the above line in your patch posts.)


Thanks for your  quick reply to the issue!

Marc

> Yao Qi (2):
>   Create inferior for tfile target
>   Create inferior for ctf target.
> 
>  gdb/ctf.c                          |   24 ++++++++++++++++++++++++
>  gdb/testsuite/gdb.trace/report.exp |    7 ++++++-
>  gdb/testsuite/gdb.trace/tfile.exp  |    3 ---
>  gdb/tracepoint.c                   |   19 +++++++++++++++++++
>  4 files changed, 49 insertions(+), 4 deletions(-)
> 
> --
> 1.7.7.6


  parent reply	other threads:[~2014-01-30 19:21 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-30  5:46 Yao Qi
2014-01-30  5:46 ` [PATCH 1/2] Create inferior for tfile target Yao Qi
2014-01-30  5:47 ` [PATCH 2/2] Create inferior for ctf target Yao Qi
2014-01-30 19:21 ` Marc Khouzam [this message]
2014-02-05 12:54   ` [PATCH 0/2] Create inferior fro trace file target Yao Qi
2014-02-04 20:57 ` Pedro Alves
2014-02-04 21:08   ` Marc Khouzam
2014-02-04 21:17     ` Pedro Alves
2014-02-05  2:05   ` Joel Brobecker
2014-02-05 12:17   ` Yao Qi
2014-02-05 12:24     ` Joel Brobecker
2014-02-05 12:31     ` Pedro Alves
2014-02-05 12:42     ` Mark Kettenis

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=E59706EF8DB1D147B15BECA3322E4BDC1C57CE2C@eusaamb103.ericsson.se \
    --to=marc.khouzam@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@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