rpms/gdb/F-13 gdb-6.6-buildid-locate-core-as-arg.patch, 1.4, 1.5 gdb.spec, 1.429, 1.430

Jan Kratochvil jkratoch at fedoraproject.org
Sun Apr 11 21:32:17 UTC 2010


Author: jkratoch

Update of /cvs/pkgs/rpms/gdb/F-13
In directory cvs01.phx2.fedoraproject.org:/tmp/cvs-serv23251

Modified Files:
	gdb-6.6-buildid-locate-core-as-arg.patch gdb.spec 
Log Message:
* Sun Apr 11 2010 Jan Kratochvil <jan.kratochvil at redhat.com> - 7.1-12.fc13
- Fix crash on trying to load invalid executable (BZ 581215).


gdb-6.6-buildid-locate-core-as-arg.patch:
 exceptions.h |    3 +++
 exec.c       |   22 +++++++++++++++++++---
 main.c       |   53 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 3 files changed, 72 insertions(+), 6 deletions(-)

Index: gdb-6.6-buildid-locate-core-as-arg.patch
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/F-13/gdb-6.6-buildid-locate-core-as-arg.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- gdb-6.6-buildid-locate-core-as-arg.patch	25 Mar 2010 23:56:06 -0000	1.4
+++ gdb-6.6-buildid-locate-core-as-arg.patch	11 Apr 2010 21:32:17 -0000	1.5
@@ -58,10 +58,8 @@ Http://sourceware.org/ml/gdb-patches/201
 	* exec.c (exec_file_attach): Print a more useful error message if the
 	user did "gdb core".
 
-Index: gdb-7.1/gdb/exceptions.h
-===================================================================
---- gdb-7.1.orig/gdb/exceptions.h	2010-01-18 07:25:22.000000000 +0100
-+++ gdb-7.1/gdb/exceptions.h	2010-03-25 18:40:49.000000000 +0100
+--- ./gdb/exceptions.h	2010-04-11 22:31:30.000000000 +0200
++++ ./gdb/exceptions.h	2010-04-11 22:31:47.000000000 +0200
 @@ -78,6 +78,9 @@ enum errors {
    /* Feature is not supported in this copy of GDB.  */
    UNSUPPORTED_ERROR,
@@ -72,10 +70,8 @@ Index: gdb-7.1/gdb/exceptions.h
    /* Add more errors here.  */
    NR_ERRORS
  };
-Index: gdb-7.1/gdb/exec.c
-===================================================================
---- gdb-7.1.orig/gdb/exec.c	2010-03-25 17:46:11.000000000 +0100
-+++ gdb-7.1/gdb/exec.c	2010-03-25 18:41:09.000000000 +0100
+--- ./gdb/exec.c	2010-04-11 22:31:30.000000000 +0200
++++ ./gdb/exec.c	2010-04-11 22:41:26.000000000 +0200
 @@ -34,6 +34,7 @@
  #include "arch-utils.h"
  #include "gdbthread.h"
@@ -84,28 +80,39 @@ Index: gdb-7.1/gdb/exec.c
  
  #include <fcntl.h>
  #include "readline/readline.h"
-@@ -259,6 +260,17 @@ exec_file_attach (char *filename, int fr
- 	  /* Make sure to close exec_bfd, or else "run" might try to use
- 	     it.  */
- 	  exec_close ();
+@@ -256,12 +257,27 @@ exec_file_attach (char *filename, int fr
+ 
+       if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
+ 	{
++	  int is_core;
 +
 +	  /* If the user accidentally did "gdb core", print a useful
 +	     error message.  Check it only after bfd_object has been checked as
 +	     a valid executable may get recognized for example also as
 +	     "trad-core".  */
-+	  if (bfd_check_format (exec_bfd, bfd_core))
++	  is_core = bfd_check_format (exec_bfd, bfd_core);
++
+ 	  /* Make sure to close exec_bfd, or else "run" might try to use
+ 	     it.  */
+ 	  exec_close ();
+-	  error (_("\"%s\": not in executable format: %s"),
+-		 scratch_pathname,
+-		 gdb_bfd_errmsg (bfd_get_error (), matching));
++
++	  if (is_core != 0)
 +	    throw_error (IS_CORE_ERROR,
 +		   _("\"%s\" is a core file.\n"
 +		     "Please specify an executable to debug."),
 +		   scratch_pathname);
-+
- 	  error (_("\"%s\": not in executable format: %s"),
- 		 scratch_pathname,
- 		 gdb_bfd_errmsg (bfd_get_error (), matching));
-Index: gdb-7.1/gdb/main.c
-===================================================================
---- gdb-7.1.orig/gdb/main.c	2010-03-25 17:46:11.000000000 +0100
-+++ gdb-7.1/gdb/main.c	2010-03-25 18:40:49.000000000 +0100
++	  else
++	    error (_("\"%s\": not in executable format: %s"),
++		   scratch_pathname,
++		   gdb_bfd_errmsg (bfd_get_error (), matching));
+ 	}
+ 
+       /* FIXME - This should only be run for RS6000, but the ifdef is a poor
+--- ./gdb/main.c	2010-04-11 22:31:30.000000000 +0200
++++ ./gdb/main.c	2010-04-11 22:31:47.000000000 +0200
 @@ -241,6 +241,36 @@ captured_command_loop (void *data)
    return 1;
  }


Index: gdb.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gdb/F-13/gdb.spec,v
retrieving revision 1.429
retrieving revision 1.430
diff -u -p -r1.429 -r1.430
--- gdb.spec	8 Apr 2010 20:01:04 -0000	1.429
+++ gdb.spec	11 Apr 2010 21:32:17 -0000	1.430
@@ -36,7 +36,7 @@ Version: 7.1
 
 # The release always contains a leading reserved number, start it at 1.
 # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
-Release: 11%{?_with_upstream:.upstream}%{dist}
+Release: 12%{?_with_upstream:.upstream}%{dist}
 
 License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and GFDL and BSD and Public Domain
 Group: Development/Debuggers
@@ -1050,6 +1050,9 @@ fi
 %endif
 
 %changelog
+* Sun Apr 11 2010 Jan Kratochvil <jan.kratochvil at redhat.com> - 7.1-12.fc13
+- Fix crash on trying to load invalid executable (BZ 581215).
+
 * Thu Apr  8 2010 Jan Kratochvil <jan.kratochvil at redhat.com> - 7.1-11.fc13
 - testsuite: Fix gdb.base/gstack.exp also for ppc64 inferiors (for BZ 579793).
 



More information about the scm-commits mailing list