This is the mail archive of the gdb-cvs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Fix attach-pie-noexec.exp fail on native-extended-gdbserver


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d5131498a57d1789ff0fea2cfeb1af90802c8dad

commit d5131498a57d1789ff0fea2cfeb1af90802c8dad
Author: Yao Qi <yao.qi@linaro.org>
Date:   Mon Jul 13 17:14:13 2015 +0100

    Fix attach-pie-noexec.exp fail on native-extended-gdbserver
    
    When I examine the buildbot fails, I see this fail on
    native-extended-gdbserver,
    
     Attaching to process 13529^M
     "target:/scratch/yao/gdb/build-git/x86_64/gdb/testsuite/gdb.base/attach-pie-noexec (deleted)": could not open as an executable file: No such file or directory^M
     (gdb) FAIL: gdb.base/attach-pie-noexec.exp: attach
    
    if I run tests with board file unix, it doesn't exist,
    
     Attaching to process 13869^M
     /scratch/yao/gdb/build-git/x86_64/gdb/testsuite/gdb.base/attach-pie-noexec (deleted): No such file or directory.^M
     (gdb) PASS: gdb.base/attach-pie-noexec.exp: attach
    
    the test expects to see the period at the end of the error message,
    
      gdb_test "attach $testpid" "Attaching to process $testpid\r\n.*: No such file or directory\\." "attach"
    
    however the period is missing when running with native-extended-gdbserver.
    
    in exec.c:exec_file_attach, GDB has two places may throw errors [1] and [2],
    
          if (load_via_target)
    	{
    	  ...
    	}
          else
    	{
     	  ...
    	  if (scratch_chan < 0)
    	    perror_with_name (filename);  <--- [1]
    	}
    
    	...
          if (!exec_bfd)
    	{
    	  error (_("\"%s\": could not open as an executable file: %s"), <-- [2]
    		 scratch_pathname, bfd_errmsg (bfd_get_error ()));
    	}
    
    perror_with_name [1] append a period at the end of error message,
    but error [2] doesn't.  This fix is to add a period at the end of the
    error message.  Note that this fail is shown up on 7.9 release as well.
    
    gdb:
    
    2015-07-13  Yao Qi  <yao.qi@linaro.org>
    
    	* exec.c (exec_file_attach): Add period at the end of error
    	message.

Diff:
---
 gdb/ChangeLog | 5 +++++
 gdb/exec.c    | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 41400a2..a49f354 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2015-07-13  Yao Qi  <yao.qi@linaro.org>
+
+	* exec.c (exec_file_attach): Add period at the end of error
+	message.
+
 2015-07-13  Andrew Burgess  <andrew.burgess@embecosm.com>
 
 	* tui/tui-win.c (window_name_completer): New function.
diff --git a/gdb/exec.c b/gdb/exec.c
index 3dfc437..f1b1049 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -283,7 +283,7 @@ exec_file_attach (const char *filename, int from_tty)
 
       if (!exec_bfd)
 	{
-	  error (_("\"%s\": could not open as an executable file: %s"),
+	  error (_("\"%s\": could not open as an executable file: %s."),
 		 scratch_pathname, bfd_errmsg (bfd_get_error ()));
 	}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]