Blob Blame History Raw
commit fef3cb9f3aa84018d10866f89228ae3f23e5ca7e
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date:   Wed Apr 6 15:57:08 2016 +0200

    Print the "file" command suggestion in exec_file_locate_attach
    
    currently:
    	$ gdbserver-7.9 :1234 true &
    	$ gdb -q -ex 'target remote :1234' # that -q is not relevant here
    	Remote debugging using :1234
    	warning: Could not load vsyscall page because no executable was specified
    	try using the "file" command first.
    	0x00007ffff7ddcc80 in ?? ()
    	(gdb) b main
    	No symbol table is loaded.  Use the "file" command.
    	Make breakpoint pending on future shared library load? (y or [n]) _
    
    Provide more suggestive message to use the "file" command.
    
    gdb/ChangeLog
    2016-04-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
    	    Pedro Alves  <palves@redhat.com>
    
    	* exec.c (exec_file_locate_attach): Print warning for unsupported
    	target_pid_to_exec_file.
    	* symfile-mem.c (add_vsyscall_page): Remove the "file" command
    	message part.

### a/gdb/ChangeLog
### b/gdb/ChangeLog
## -1,3 +1,11 @@
+2016-04-06  Jan Kratochvil  <jan.kratochvil@redhat.com>
+	    Pedro Alves  <palves@redhat.com>
+
+	* exec.c (exec_file_locate_attach): Print warning for unsupported
+	target_pid_to_exec_file.
+	* symfile-mem.c (add_vsyscall_page): Remove the "file" command
+	message part.
+
 2016-04-04  Simon Marchi  <simon.marchi@ericsson.com>
 
 	* cli/cli-decode.c (help_cmd_list): Fix function doc and remove
Index: gdb-7.6.1/gdb/symfile-mem.c
===================================================================
--- gdb-7.6.1.orig/gdb/symfile-mem.c	2016-04-27 23:28:29.490647020 +0200
+++ gdb-7.6.1/gdb/symfile-mem.c	2016-04-27 23:30:03.395264401 +0200
@@ -212,8 +212,7 @@
 	  format should fix this.  */
 	{
 	  warning (_("Could not load vsyscall page "
-		     "because no executable was specified\n"
-		     "try using the \"file\" command first."));
+		     "because no executable was specified"));
 	  return;
 	}
       args.bfd = bfd;
Index: gdb-7.6.1/gdb/infcmd.c
===================================================================
--- gdb-7.6.1.orig/gdb/infcmd.c	2013-03-07 22:57:29.000000000 +0100
+++ gdb-7.6.1/gdb/infcmd.c	2016-04-27 23:30:37.366487747 +0200
@@ -2426,7 +2426,12 @@
   if (!exec_file)
     {
       exec_file = target_pid_to_exec_file (PIDGET (inferior_ptid));
-      if (exec_file)
+      if (!exec_file)
+	warning (_("No executable has been specified and target does not "
+		   "support\n"
+		   "determining executable automatically.  "
+		   "Try using the \"file\" command."));
+      else
 	{
 	  /* It's possible we don't have a full path, but rather just a
 	     filename.  Some targets, such as HP-UX, don't provide the