public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [PATCH 2/4] Show new created display
Date: Mon, 28 Apr 2014 06:15:00 -0000	[thread overview]
Message-ID: <1398665538-16580-3-git-send-email-yao@codesourcery.com> (raw)
In-Reply-To: <1398665538-16580-1-git-send-email-yao@codesourcery.com>

When I run refactored unavailable.exp, I find
command display behaves a little different on live inferior and on
examining traceframes.  In live inferior, when command "display argc"
is typed, the value of "argc" is shown.

(gdb) display argc
1: argc = 1 '\001'

however, on tfile target, when command "display argc" is typed, the
value of "argc" is not shown.

(gdb) tfind
Found trace frame 0, tracepoint 1
    at ../../../../git/gdb/testsuite/gdb.trace/unavailable.cc:198
198       i =  (int) argc + argi + argf + argd + argstruct.memberi + argarray[1];
(gdb) display argc

I also notice that on "core" target, the value of "argc" isn't shown
either.  This difference is caused by the code below in printcmd.c:display_command,

      if (from_tty && target_has_execution)
        do_one_display (new);

Looks the value of each display is shown if the target has execution.
Source code archaeology doesn't tell much about this requirement.
However, if we type command "display" then on "core" or "tfile"
target, the value of "argc" is still displayed,

for "core" target,
(gdb) display argc
(gdb) display
1: argc = 1 '\001'

for "tfile" target,
(gdb) display argc
(gdb) display
1: argc = <unavailable>

I feel that it is not necessary to have such "target has execution"
requirement to show the value of new created display.  Auto-display is
a feature to show the value of expression frequently, has nothing to
do with whether target has execution or not.  On the other hand, GDB
has the requirement for new created display, but command "display" can
still show them, this is an inconsistency, which should be fixed.

This patch is to remove the checking to target_has_execution from the
condition.

gdb:

2014-04-26  Yao Qi  <yao@codesourcery.com>

	* printcmd.c (display_command): Remove the check to
	target_has_execution.
---
 gdb/printcmd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 87b1448..228d4ad 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1547,7 +1547,7 @@ display_command (char *arg, int from_tty)
       new->enabled_p = 1;
       display_chain = new;
 
-      if (from_tty && target_has_execution)
+      if (from_tty)
 	do_one_display (new);
 
       dont_repeat ();
-- 
1.9.0

  parent reply	other threads:[~2014-04-28  6:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-28  6:15 [PATCH 0/4 V2] Partially available/unavailable data in requested range Yao Qi
2014-04-28  6:15 ` [PATCH 3/4] Save traceframes in trace file and read data out from trace file Yao Qi
2014-04-30 16:26   ` Pedro Alves
2014-05-05  3:52     ` Yao Qi
2014-04-28  6:15 ` [PATCH 4/4] Partially available/unavailable data in requested range Yao Qi
2014-04-30 16:29   ` Pedro Alves
2014-04-28  6:15 ` Yao Qi [this message]
2014-04-30 16:26   ` [PATCH 2/4] Show new created display Pedro Alves
2014-04-28  6:15 ` [PATCH 1/4] Move traceframe checking out of traceframe generation Yao Qi
2014-04-30 16:15   ` Pedro Alves

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=1398665538-16580-3-git-send-email-yao@codesourcery.com \
    --to=yao@codesourcery.com \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).