diff options
author | Phil Muldoon <pmuldoon@redhat.com> | 2014-06-03 00:01:39 -0700 |
---|---|---|
committer | Doug Evans <xdje42@gmail.com> | 2014-06-03 00:01:39 -0700 |
commit | fb1f94b09a3d12a231f6be8fadf421ab578dc4ba (patch) | |
tree | 3d1dc0b83f90269d06d5b6b31c2359577d7e65b0 | |
parent | ded0378278c7bbd5c6049446032b28196a5cfb38 (diff) | |
download | gdb-fb1f94b09a3d12a231f6be8fadf421ab578dc4ba.zip gdb-fb1f94b09a3d12a231f6be8fadf421ab578dc4ba.tar.gz gdb-fb1f94b09a3d12a231f6be8fadf421ab578dc4ba.tar.bz2 |
Don't remove #-comments.
When using the multi-line feature, we don't want the gdb CLI to remove
comments from the command list, as this will remove things like
"#define".
* top.c (command_loop): Handle comments here...
(command_line_input): ... not here.
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/top.c | 20 |
2 files changed, 12 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 22c7a1e..414ac6d 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-06-02 Phil Muldoon <pmuldoon@redhat.com> + + * top.c (command_loop): Handle comments here... + (command_line_input): ... not here. + 2014-06-02 Doug Evans <xdje42@gmail.com> Add progspace support for Guile. @@ -561,11 +561,14 @@ command_loop (void) make_command_stats_cleanup (1); - execute_command (command, instream == stdin); - - /* Do any commands attached to breakpoint we are stopped at. */ - bpstat_do_actions (); + /* Do not execute commented lines. */ + if (command[0] != '#') + { + execute_command (command, instream == stdin); + /* Do any commands attached to breakpoint we are stopped at. */ + bpstat_do_actions (); + } do_cleanups (old_chain); } } @@ -1058,15 +1061,6 @@ command_line_input (char *prompt_arg, int repeat, char *annotation_suffix) if (*linebuffer && input_from_terminal_p ()) add_history (linebuffer); - /* Note: lines consisting solely of comments are added to the command - history. This is useful when you type a command, and then - realize you don't want to execute it quite yet. You can comment - out the command and then later fetch it from the value history - and remove the '#'. The kill ring is probably better, but some - people are in the habit of commenting things out. */ - if (*p1 == '#') - *p1 = '\0'; /* Found a comment. */ - /* Save into global buffer if appropriate. */ if (repeat) { |