Add missing leading space to some queries

Message ID 1446049232-2318-1-git-send-email-patrick@parcs.ath.cx
State New, archived
Headers

Commit Message

Patrick Palka Oct. 28, 2015, 4:20 p.m. UTC
  Query strings should have a leading space so that there is some kind of
separator between the actual query and the "(y or n)" suffix that is
appended to the query.

gdb/ChangeLog:

	* linux-record.c (record_linux_system_call): Add a
	leading space to each query string.
	* record-full.c (record_full_check_insn_num): Likewise.
	(record_full_store_registers): Likewise.
	(record_full_xfer_partial): Likewise.
---
 gdb/linux-record.c | 8 ++++----
 gdb/record-full.c  | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
  

Comments

Pedro Alves Oct. 28, 2015, 5:10 p.m. UTC | #1
On 10/28/2015 04:20 PM, Patrick Palka wrote:
> Query strings should have a leading space so that there is some kind of
> separator between the actual query and the "(y or n)" suffix that is
> appended to the query.
> 

OK.

Though, it would seem better to me to go the other way around and have
query() itself add the space.  E.g. the way it is, translations would
need to know that the space is there to keep, which seems fragile.

Thanks,
Pedro Alves
  
Patrick Palka Oct. 28, 2015, 5:20 p.m. UTC | #2
On Wed, Oct 28, 2015 at 1:10 PM, Pedro Alves <palves@redhat.com> wrote:
> On 10/28/2015 04:20 PM, Patrick Palka wrote:
>> Query strings should have a leading space so that there is some kind of
>> separator between the actual query and the "(y or n)" suffix that is
>> appended to the query.
>>
>
> OK.
>
> Though, it would seem better to me to go the other way around and have
> query() itself add the space.  E.g. the way it is, translations would
> need to know that the space is there to keep, which seems fragile.

That makes sense. I'll post a patch tomorrow that does this instead.

>
> Thanks,
> Pedro Alves
>
  

Patch

diff --git a/gdb/linux-record.c b/gdb/linux-record.c
index cffd4f7..78a8fb1 100644
--- a/gdb/linux-record.c
+++ b/gdb/linux-record.c
@@ -246,7 +246,7 @@  record_linux_system_call (enum gdb_syscall syscall,
         target_terminal_ours ();
         q = yquery (_("The next instruction is syscall exit.  "
                       "It will make the program exit.  "
-                      "Do you want to stop the program?"));
+                      "Do you want to stop the program? "));
         target_terminal_inferior ();
         if (q)
           return 1;
@@ -679,7 +679,7 @@  record_linux_system_call (enum gdb_syscall syscall,
         target_terminal_ours ();
         q = yquery (_("The next instruction is syscall reboot.  "
 		      "It will restart the computer.  "
-		      "Do you want to stop the program?"));
+		      "Do you want to stop the program? "));
         target_terminal_inferior ();
         if (q)
           return 1;
@@ -712,7 +712,7 @@  record_linux_system_call (enum gdb_syscall syscall,
 The next instruction is syscall munmap.\n\
 It will free the memory addr = 0x%s len = %u.\n\
 It will make record target cannot record some memory change.\n\
-Do you want to stop the program?"),
+Do you want to stop the program? "),
                         OUTPUT_REG (tmpulongest, tdep->arg1), (int) len);
             target_terminal_inferior ();
             if (q)
@@ -1932,7 +1932,7 @@  Do you want to stop the program?"),
         target_terminal_ours ();
         q = yquery (_("The next instruction is syscall exit_group.  "
                       "It will make the program exit.  "
-                      "Do you want to stop the program?"));
+                      "Do you want to stop the program? "));
         target_terminal_inferior ();
         if (q)
           return 1;
diff --git a/gdb/record-full.c b/gdb/record-full.c
index 595e357..fcba371 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -548,7 +548,7 @@  record_full_check_insn_num (int set_terminal)
 	    target_terminal_ours ();
 	  q = yquery (_("Do you want to auto delete previous execution "
 			"log entries when record/replay buffer becomes "
-			"full (record full stop-at-limit)?"));
+			"full (record full stop-at-limit)? "));
 	  if (set_terminal)
 	    target_terminal_inferior ();
 	  if (q)
@@ -1477,12 +1477,12 @@  record_full_store_registers (struct target_ops *ops,
 	      query (_("Because GDB is in replay mode, changing the "
 		       "value of a register will make the execution "
 		       "log unusable from this point onward.  "
-		       "Change all registers?"));
+		       "Change all registers? "));
 	  else
 	    n =
 	      query (_("Because GDB is in replay mode, changing the value "
 		       "of a register will make the execution log unusable "
-		       "from this point onward.  Change register %s?"),
+		       "from this point onward.  Change register %s? "),
 		      gdbarch_register_name (get_regcache_arch (regcache),
 					       regno));
 
@@ -1534,7 +1534,7 @@  record_full_xfer_partial (struct target_ops *ops, enum target_object object,
 	  /* Let user choose if he wants to write memory or not.  */
 	  if (!query (_("Because GDB is in replay mode, writing to memory "
 		        "will make the execution log unusable from this "
-		        "point onward.  Write memory at address %s?"),
+		        "point onward.  Write memory at address %s? "),
 		       paddress (target_gdbarch (), offset)))
 	    error (_("Process record canceled the operation."));