aboutsummaryrefslogtreecommitdiff
path: root/gdb/printcmd.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2014-04-26 08:47:33 +0800
committerYao Qi <yao@codesourcery.com>2014-05-05 11:51:53 +0800
commit91256dc2fb82e6f68dce9b577e26cd89695b6c21 (patch)
tree1a07713c74fa24ce79057772b43e5731e8cd08dd /gdb/printcmd.c
parentb5262cd094e73112fb86297df9052ff0560f68a4 (diff)
downloadgdb-91256dc2fb82e6f68dce9b577e26cd89695b6c21.zip
gdb-91256dc2fb82e6f68dce9b577e26cd89695b6c21.tar.gz
gdb-91256dc2fb82e6f68dce9b577e26cd89695b6c21.tar.bz2
Show new created display
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-05-05 Yao Qi <yao@codesourcery.com> * printcmd.c (display_command): Remove the check to target_has_execution.
Diffstat (limited to 'gdb/printcmd.c')
-rw-r--r--gdb/printcmd.c2
1 files changed, 1 insertions, 1 deletions
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 ();