public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Andrew Burgess (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Tom Tromey <tromey@sourceware.org>, gdb-patches@sourceware.org
Subject: [review] Allow using less horizontal space in TUI source window
Date: Mon, 11 Nov 2019 11:19:00 -0000	[thread overview]
Message-ID: <20191111111954.7D19320AF6@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1573404038000.I46ce9a68b12c9c79332d510f9c14b3c84b7efadd@gnutoolchain-gerrit.osci.io>

Andrew Burgess has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/605
......................................................................


Patch Set 1:

(1 comment)

| --- gdb/tui/tui-source.c
| +++ gdb/tui/tui-source.c
| @@ -76,12 +80,19 @@ tui_source_window::set_contents (struct gdbarch *arch,
|  	  cur_line = 0;
|  	  gdbarch = get_objfile_arch (SYMTAB_OBJFILE (s));
|  	  start_line_or_addr.loa = LOA_LINE;
|  	  cur_line_no = start_line_or_addr.u.line_no = line_no;
|  
| +	  int digits = 0;
| +	  if (compact_source)
| +	    {
| +	      double l = log10 (offsets->size ()) + 1;
| +	      digits = 1 + (int) l;

PS1, Line 89:

If I understand correctly one of the +1's here is for the white space
that is displayed on the left of the number when it is being printed
(the calculation here always gives number of digits + 1).  However it
feels a little weird to me to have part of the display logic here, and
part of the display logic in tui_copy_source_line.

Personally I'd rather have this calculation always return the correct
number of digits and have all display logic - what whitespace is where
inside tui_copy_source_line.

| +	    }
| +
|  	  const char *iter = srclines.c_str ();
|  	  content.resize (nlines);
|  	  while (cur_line < nlines)
|  	    {
|  	      struct tui_source_element *element
|  		= &content[cur_line];
|  

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I46ce9a68b12c9c79332d510f9c14b3c84b7efadd
Gerrit-Change-Number: 605
Gerrit-PatchSet: 1
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-CC: Andrew Burgess <andrew.burgess@embecosm.com>
Gerrit-Comment-Date: Mon, 11 Nov 2019 11:19:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

  reply	other threads:[~2019-11-11 11:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-10 16:40 Tom Tromey (Code Review)
2019-11-11 11:19 ` Andrew Burgess (Code Review) [this message]
2019-11-14  9:55 ` Eli Zaretskii
2019-11-22 23:53 ` Tom Tromey (Code Review)
2019-11-22 23:54 ` [review v2] " Tom Tromey (Code Review)
2019-11-23  7:21   ` Eli Zaretskii
2019-11-28 10:12 ` Andrew Burgess (Code Review)
2019-12-01 19:04 ` [pushed] " Sourceware to Gerrit sync (Code Review)
2019-12-01 19:04 ` Sourceware to Gerrit sync (Code Review)

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=20191111111954.7D19320AF6@gnutoolchain-gerrit.osci.io \
    --to=gerrit@gnutoolchain-gerrit.osci.io \
    --cc=gdb-patches@sourceware.org \
    --cc=gnutoolchain-gerrit@osci.io \
    --cc=tromey@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).