Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Nick Roberts <nickrob@snap.net.nz>
To: Daniel Jacobowitz <drow@false.org>
Cc: Denis PILAT <denis.pilat@st.com>, gdb-patches@sourceware.org
Subject: Re: [RFC] -thread-select double print stack frame
Date: Wed, 28 Mar 2007 05:56:00 -0000	[thread overview]
Message-ID: <17930.715.767042.438147@farnswood.snap.net.nz> (raw)
In-Reply-To: <20070328021123.GA28506@caradoc.them.org>

 > > But why do you think that while file and line details are currenly
 > > duplicated in MI, they are not in CLI?  (I mean what is the underlying
 > > logic/cause, not the just the code differences).
 > 
 > Here's what I get from the CLI:
 > 
 > [Switching to thread 1 (Thread 46912506009296 (LWP 28747))]#0  main
 > (argc=1, argv=0x7fffffffe178)
 >     at /space/fsf/commit/src/gdb/gdb.c:28
 > 28      {
 > 
 > The first line is the frame description and becomes the new-thread-id
 > and the frame={} tuple.  The second line ("28 {") comes from
 > print_source_lines (from lack of ui_source_list).  I think we need
 > both, because we use print_source_lines in other contexts too, but I'm
 > not sure about that.
 > 
 > So the short answer is that they are duplicated in the CLI too.  The
 > two copies are just formatted so differently that it isn't obvious.

OK.  I think I understand the second call now.

I was looking specifically at this clause in print_source_lines_base:

  if (desc < 0)
    {
      last_source_error = desc;

      if (!noerror)
	{
	  char *name = alloca (strlen (s->filename) + 100);
	  sprintf (name, "%d\t%s", line, s->filename);
	  print_sys_errmsg (name, errno);
	}
      else
	ui_out_field_int (uiout, "line", line);
      ui_out_text (uiout, "\tin ");
      ui_out_field_string (uiout, "file", s->filename);
      ui_out_text (uiout, "\n");

      return;
    }

I think this code may only be reached when there is duplicated MI output.

 > This does make me wonder about the patch though.  Denis, could you
 > hold off on committing it?  Which duplicate copy are you eliminating?
 > Maybe we should diff two testsuite runs to see what else changes.

No, I think this change is alright (I haven't run the testsuite though.).

It's your decision but the next release is a long way off and if these changes
are not the right ones they are not far off.  So I would suggest committing
them all i.e this one, yours and Denis's -thread-* commands now.  That way
if there are problems we will quite likely discover them before the release.


-- 
Nick                                           http://www.inet.net.nz/~nickrob


  reply	other threads:[~2007-03-28  5:56 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19 13:48 Denis PILAT
2007-03-20  0:57 ` Nick Roberts
2007-03-26 13:19   ` Denis PILAT
2007-03-27 19:33     ` Daniel Jacobowitz
2007-03-27 21:42       ` Nick Roberts
2007-03-28  2:11         ` Daniel Jacobowitz
2007-03-28  5:56           ` Nick Roberts [this message]
2007-03-28  8:26             ` Denis PILAT
2007-03-28 11:43         ` Daniel Jacobowitz
2007-03-29  7:45           ` Denis PILAT

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=17930.715.767042.438147@farnswood.snap.net.nz \
    --to=nickrob@snap.net.nz \
    --cc=denis.pilat@st.com \
    --cc=drow@false.org \
    --cc=gdb-patches@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