diff --git a/.gitignore b/.gitignore index a46cc98..02bbc6f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ /gdb-libstdc++-v3-python-r155978.tar.bz2 -/gdb-7.5.50.20130310.tar.bz2 +/gdb-7.5.91.20130323.tar.bz2 diff --git a/gdb-6.3-test-pie-20050107.patch b/gdb-6.3-test-pie-20050107.patch index f877225..c6a8cbc 100644 --- a/gdb-6.3-test-pie-20050107.patch +++ b/gdb-6.3-test-pie-20050107.patch @@ -1,7 +1,7 @@ -Index: gdb-7.4.50.20120602/gdb/testsuite/configure.ac +Index: gdb-7.5.91.20130323/gdb/testsuite/configure.ac =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/testsuite/configure.ac 2012-04-25 16:07:22.000000000 +0200 -+++ gdb-7.4.50.20120602/gdb/testsuite/configure.ac 2012-06-02 18:24:38.456266545 +0200 +--- gdb-7.5.91.20130323.orig/gdb/testsuite/configure.ac 2013-03-11 09:59:00.000000000 +0100 ++++ gdb-7.5.91.20130323/gdb/testsuite/configure.ac 2013-03-23 19:47:24.189683555 +0100 @@ -96,6 +96,6 @@ AC_OUTPUT([Makefile \ gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile \ gdb.hp/gdb.defects/Makefile gdb.linespec/Makefile \ @@ -10,20 +10,20 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/configure.ac + gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \ gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile \ gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile]) -Index: gdb-7.4.50.20120602/gdb/testsuite/configure +Index: gdb-7.5.91.20130323/gdb/testsuite/configure =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/testsuite/configure 2012-04-25 16:07:21.000000000 +0200 -+++ gdb-7.4.50.20120602/gdb/testsuite/configure 2012-06-02 18:25:06.200258240 +0200 +--- gdb-7.5.91.20130323.orig/gdb/testsuite/configure 2013-03-11 09:59:00.000000000 +0100 ++++ gdb-7.5.91.20130323/gdb/testsuite/configure 2013-03-23 19:47:47.256822312 +0100 @@ -3448,7 +3448,7 @@ done --ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" -+ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" +-ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.btrace/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" ++ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.btrace/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure -@@ -4175,6 +4175,7 @@ do +@@ -4176,6 +4176,7 @@ do "gdb.opencl/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opencl/Makefile" ;; "gdb.opt/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;; "gdb.pascal/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;; @@ -31,10 +31,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/configure "gdb.python/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;; "gdb.reverse/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.reverse/Makefile" ;; "gdb.stabs/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.stabs/Makefile" ;; -Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/attach.c +Index: gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/attach.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/attach.c 2012-06-02 18:24:38.497266532 +0200 ++++ gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/attach.c 2013-03-23 19:47:24.191683466 +0100 @@ -0,0 +1,20 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -56,10 +56,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/attach.c + } + return 0; +} -Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/attach2.c +Index: gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/attach2.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/attach2.c 2012-06-02 18:24:38.504266529 +0200 ++++ gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/attach2.c 2013-03-23 19:47:24.192683421 +0100 @@ -0,0 +1,24 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -85,10 +85,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/attach2.c + } + return (0); +} -Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/break.c +Index: gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/break.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/break.c 2012-06-02 18:24:38.505266529 +0200 ++++ gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/break.c 2013-03-23 19:47:24.192683421 +0100 @@ -0,0 +1,146 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -236,10 +236,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/break.c + } + return 0; +} -Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/break1.c +Index: gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/break1.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/break1.c 2012-06-02 18:24:38.506266530 +0200 ++++ gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/break1.c 2013-03-23 19:47:24.192683421 +0100 @@ -0,0 +1,44 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -285,10 +285,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/break1.c +void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */ +void marker4 (d) long d; {} /* set breakpoint 13 here */ +#endif -Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/coremaker.c +Index: gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/coremaker.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/coremaker.c 2012-06-02 18:24:38.506266530 +0200 ++++ gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/coremaker.c 2013-03-23 19:47:24.192683421 +0100 @@ -0,0 +1,142 @@ +/* Copyright 1992, 1993, 1994, 1995, 1996, 1999 + Free Software Foundation, Inc. @@ -432,10 +432,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/coremaker.c + return 0; +} + -Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/attach.exp +Index: gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/attach.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/attach.exp 2012-06-02 18:24:38.508266531 +0200 ++++ gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/attach.exp 2013-03-23 19:47:24.193683377 +0100 @@ -0,0 +1,417 @@ +# Copyright 1997, 1999, 2002 Free Software Foundation, Inc. + @@ -854,10 +854,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/attach.exp +do_call_attach_tests + +return 0 -Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/break.exp +Index: gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/break.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/break.exp 2012-06-02 18:24:38.510266529 +0200 ++++ gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/break.exp 2013-03-23 19:47:24.194683332 +0100 @@ -0,0 +1,962 @@ +# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2002, 2003, 2004 @@ -1821,10 +1821,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/break.exp + send_gdb "set args main\n" + gdb_expect -re ".*$gdb_prompt $" {} +} -Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/corefile.exp +Index: gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/corefile.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/corefile.exp 2012-06-02 18:24:38.511266528 +0200 ++++ gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/corefile.exp 2013-03-23 19:47:24.194683332 +0100 @@ -0,0 +1,233 @@ +# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Free Software Foundation, Inc. @@ -2059,10 +2059,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/corefile.exp +gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp (reinit)" + +gdb_test "core" "No core file now." -Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/Makefile.in +Index: gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/Makefile.in =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.pie/Makefile.in 2012-06-02 18:24:38.512266527 +0200 ++++ gdb-7.5.91.20130323/gdb/testsuite/gdb.pie/Makefile.in 2013-03-23 19:47:24.194683332 +0100 @@ -0,0 +1,19 @@ +VPATH = @srcdir@ +srcdir = @srcdir@ diff --git a/gdb-6.6-buildid-locate-core-as-arg.patch b/gdb-6.6-buildid-locate-core-as-arg.patch index 2faa306..efacab5 100644 --- a/gdb-6.6-buildid-locate-core-as-arg.patch +++ b/gdb-6.6-buildid-locate-core-as-arg.patch @@ -58,13 +58,13 @@ Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html * exec.c (exec_file_attach): Print a more useful error message if the user did "gdb core". -Index: gdb-7.4.91.20120801/gdb/exceptions.h +Index: gdb-7.5.91.20130323/gdb/exceptions.h =================================================================== ---- gdb-7.4.91.20120801.orig/gdb/exceptions.h 2012-01-04 09:17:01.000000000 +0100 -+++ gdb-7.4.91.20120801/gdb/exceptions.h 2012-08-01 18:43:39.806959992 +0200 -@@ -86,6 +86,9 @@ enum errors { - /* DW_OP_GNU_entry_value resolving failed. */ - NO_ENTRY_VALUE_ERROR, +--- gdb-7.5.91.20130323.orig/gdb/exceptions.h 2013-03-22 21:41:45.000000000 +0100 ++++ gdb-7.5.91.20130323/gdb/exceptions.h 2013-03-23 19:49:05.738459185 +0100 +@@ -90,6 +90,9 @@ enum errors { + aborted as the inferior state is no longer valid. */ + TARGET_CLOSE_ERROR, + /* Attempt to load a core file as executable. */ + IS_CORE_ERROR, @@ -72,10 +72,10 @@ Index: gdb-7.4.91.20120801/gdb/exceptions.h /* Add more errors here. */ NR_ERRORS }; -Index: gdb-7.4.91.20120801/gdb/exec.c +Index: gdb-7.5.91.20130323/gdb/exec.c =================================================================== ---- gdb-7.4.91.20120801.orig/gdb/exec.c 2012-08-01 18:36:51.000000000 +0200 -+++ gdb-7.4.91.20120801/gdb/exec.c 2012-08-01 18:44:39.928627287 +0200 +--- gdb-7.5.91.20130323.orig/gdb/exec.c 2013-01-31 19:37:37.000000000 +0100 ++++ gdb-7.5.91.20130323/gdb/exec.c 2013-03-23 19:48:53.284575912 +0100 @@ -34,6 +34,7 @@ #include "gdbthread.h" #include "progspace.h" @@ -84,7 +84,7 @@ Index: gdb-7.4.91.20120801/gdb/exec.c #include #include "readline/readline.h" -@@ -242,12 +243,27 @@ exec_file_attach (char *filename, int fr +@@ -240,12 +241,27 @@ exec_file_attach (char *filename, int fr if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching)) { @@ -115,11 +115,11 @@ Index: gdb-7.4.91.20120801/gdb/exec.c } /* FIXME - This should only be run for RS6000, but the ifdef is a poor -Index: gdb-7.4.91.20120801/gdb/main.c +Index: gdb-7.5.91.20130323/gdb/main.c =================================================================== ---- gdb-7.4.91.20120801.orig/gdb/main.c 2012-08-01 18:36:51.000000000 +0200 -+++ gdb-7.4.91.20120801/gdb/main.c 2012-08-01 18:43:39.810959970 +0200 -@@ -266,6 +266,36 @@ typedef struct cmdarg { +--- gdb-7.5.91.20130323.orig/gdb/main.c 2013-03-23 19:48:18.000000000 +0100 ++++ gdb-7.5.91.20130323/gdb/main.c 2013-03-23 19:48:53.285575901 +0100 +@@ -296,6 +296,36 @@ typedef struct cmdarg { /* Define type VEC (cmdarg_s). */ DEF_VEC_O (cmdarg_s); @@ -156,7 +156,7 @@ Index: gdb-7.4.91.20120801/gdb/main.c static int captured_main (void *data) { -@@ -762,6 +792,8 @@ captured_main (void *data) +@@ -796,6 +826,8 @@ captured_main (void *data) { symarg = argv[optind]; execarg = argv[optind]; @@ -165,7 +165,7 @@ Index: gdb-7.4.91.20120801/gdb/main.c optind++; } -@@ -917,11 +949,25 @@ captured_main (void *data) +@@ -951,11 +983,25 @@ captured_main (void *data) && symarg != NULL && strcmp (execarg, symarg) == 0) { diff --git a/gdb-attach-fail-reasons-5of5configure.patch b/gdb-attach-fail-reasons-5of5configure.patch index 6098645..76b80ee 100644 --- a/gdb-attach-fail-reasons-5of5configure.patch +++ b/gdb-attach-fail-reasons-5of5configure.patch @@ -1,8 +1,8 @@ -Index: gdb-7.4.50.20120602/gdb/config.in +Index: gdb-7.5.91.20130323/gdb/config.in =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/config.in 2012-06-02 21:49:26.147399232 +0200 -+++ gdb-7.4.50.20120602/gdb/config.in 2012-06-02 21:49:27.206398845 +0200 -@@ -222,6 +222,9 @@ +--- gdb-7.5.91.20130323.orig/gdb/config.in 2013-03-23 19:48:18.000000000 +0100 ++++ gdb-7.5.91.20130323/gdb/config.in 2013-03-23 19:50:53.300066378 +0100 +@@ -216,6 +216,9 @@ /* Define if librpm library is being used. */ #undef HAVE_LIBRPM @@ -12,7 +12,7 @@ Index: gdb-7.4.50.20120602/gdb/config.in /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_IA64_H -@@ -363,6 +366,9 @@ +@@ -360,6 +363,9 @@ /* Define to 1 if you have the `sbrk' function. */ #undef HAVE_SBRK @@ -22,11 +22,11 @@ Index: gdb-7.4.50.20120602/gdb/config.in /* Define to 1 if you have the `setlocale' function. */ #undef HAVE_SETLOCALE -Index: gdb-7.4.50.20120602/gdb/configure +Index: gdb-7.5.91.20130323/gdb/configure =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/configure 2012-06-02 21:49:27.139398869 +0200 -+++ gdb-7.4.50.20120602/gdb/configure 2012-06-02 21:49:50.890390179 +0200 -@@ -12745,6 +12745,64 @@ $as_echo "#define HAVE_PERSONALITY 1" >> +--- gdb-7.5.91.20130323.orig/gdb/configure 2013-03-23 19:48:18.000000000 +0100 ++++ gdb-7.5.91.20130323/gdb/configure 2013-03-23 19:50:53.303066376 +0100 +@@ -12814,6 +12814,64 @@ $as_echo "#define HAVE_PERSONALITY 1" >> fi @@ -91,21 +91,21 @@ Index: gdb-7.4.50.20120602/gdb/configure # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR, # except that the argument to --with-sysroot is optional. -Index: gdb-7.4.50.20120602/gdb/gdbserver/config.in +Index: gdb-7.5.91.20130323/gdb/gdbserver/config.in =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/gdbserver/config.in 2012-04-19 21:34:51.000000000 +0200 -+++ gdb-7.4.50.20120602/gdb/gdbserver/config.in 2012-06-02 21:49:55.945388329 +0200 -@@ -69,6 +69,9 @@ +--- gdb-7.5.91.20130323.orig/gdb/gdbserver/config.in 2013-03-11 09:35:09.000000000 +0100 ++++ gdb-7.5.91.20130323/gdb/gdbserver/config.in 2013-03-23 19:51:14.323052419 +0100 +@@ -73,6 +73,9 @@ /* Define to 1 if you have the `dl' library (-ldl). */ #undef HAVE_LIBDL +/* Define to 1 if you have the `selinux' library (-lselinux). */ +#undef HAVE_LIBSELINUX + - /* Define to 1 if you have the header file. */ - #undef HAVE_LINUX_ELF_H + /* Define if the target supports branch tracing. */ + #undef HAVE_LINUX_BTRACE -@@ -130,6 +133,9 @@ +@@ -140,6 +143,9 @@ /* Define to 1 if you have the `readlink' function. */ #undef HAVE_READLINK @@ -115,11 +115,11 @@ Index: gdb-7.4.50.20120602/gdb/gdbserver/config.in /* Define to 1 if you have the header file. */ #undef HAVE_SGTTY_H -Index: gdb-7.4.50.20120602/gdb/gdbserver/configure +Index: gdb-7.5.91.20130323/gdb/gdbserver/configure =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/gdbserver/configure 2012-04-20 19:58:49.000000000 +0200 -+++ gdb-7.4.50.20120602/gdb/gdbserver/configure 2012-06-02 21:49:54.485388864 +0200 -@@ -5532,6 +5532,64 @@ if $want_ipa ; then +--- gdb-7.5.91.20130323.orig/gdb/gdbserver/configure 2013-03-11 09:35:09.000000000 +0100 ++++ gdb-7.5.91.20130323/gdb/gdbserver/configure 2013-03-23 19:50:53.305066374 +0100 +@@ -5911,6 +5911,64 @@ if $want_ipa ; then fi fi diff --git a/gdb-bz541866-rwatch-before-run.patch b/gdb-bz541866-rwatch-before-run.patch index 74604ba..46650e3 100644 --- a/gdb-bz541866-rwatch-before-run.patch +++ b/gdb-bz541866-rwatch-before-run.patch @@ -1,20 +1,20 @@ -Index: gdb-7.4.50.20120602/gdb/config/i386/linux64.mh +Index: gdb-7.5.91.20130323/gdb/config/i386/linux64.mh =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/config/i386/linux64.mh 2012-03-13 16:00:34.000000000 +0100 -+++ gdb-7.4.50.20120602/gdb/config/i386/linux64.mh 2012-06-02 19:56:03.196172503 +0200 +--- gdb-7.5.91.20130323.orig/gdb/config/i386/linux64.mh 2013-03-11 09:25:58.000000000 +0100 ++++ gdb-7.5.91.20130323/gdb/config/i386/linux64.mh 2013-03-23 19:48:37.707761117 +0100 @@ -4,7 +4,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \ linux-nat.o linux-osdata.o \ proc-service.o linux-thread-db.o linux-fork.o \ - linux-procfs.o linux-ptrace.o + linux-procfs.o linux-ptrace.o linux-btrace.o -NAT_FILE= config/nm-linux.h +NAT_FILE= nm-linux64.h NAT_CDEPS = $(srcdir)/proc-service.list # The dynamically loaded libthread_db needs access to symbols in the -Index: gdb-7.4.50.20120602/gdb/config/i386/linux.mh +Index: gdb-7.5.91.20130323/gdb/config/i386/linux.mh =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/config/i386/linux.mh 2012-03-13 16:00:33.000000000 +0100 -+++ gdb-7.4.50.20120602/gdb/config/i386/linux.mh 2012-06-02 19:55:42.418178412 +0200 +--- gdb-7.5.91.20130323.orig/gdb/config/i386/linux.mh 2013-03-11 09:25:58.000000000 +0100 ++++ gdb-7.5.91.20130323/gdb/config/i386/linux.mh 2013-03-23 19:48:22.757990256 +0100 @@ -1,6 +1,6 @@ # Host: Intel 386 running GNU/Linux. @@ -23,10 +23,10 @@ Index: gdb-7.4.50.20120602/gdb/config/i386/linux.mh NATDEPFILES= inf-ptrace.o fork-child.o \ i386-nat.o i386-linux-nat.o \ proc-service.o linux-thread-db.o \ -Index: gdb-7.4.50.20120602/gdb/config/i386/nm-linux.h +Index: gdb-7.5.91.20130323/gdb/config/i386/nm-linux.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.50.20120602/gdb/config/i386/nm-linux.h 2012-06-02 19:55:42.433178408 +0200 ++++ gdb-7.5.91.20130323/gdb/config/i386/nm-linux.h 2013-03-23 19:48:22.757990256 +0100 @@ -0,0 +1,28 @@ +/* Native support for GNU/Linux i386. + @@ -56,10 +56,10 @@ Index: gdb-7.4.50.20120602/gdb/config/i386/nm-linux.h +#define target_can_use_hardware_watchpoint(type, cnt, ot) 1 + +#endif /* NM_LINUX64_H */ -Index: gdb-7.4.50.20120602/gdb/config/i386/nm-linux64.h +Index: gdb-7.5.91.20130323/gdb/config/i386/nm-linux64.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.50.20120602/gdb/config/i386/nm-linux64.h 2012-06-02 19:55:42.434178407 +0200 ++++ gdb-7.5.91.20130323/gdb/config/i386/nm-linux64.h 2013-03-23 19:48:22.757990256 +0100 @@ -0,0 +1,28 @@ +/* Native support for GNU/Linux amd64. + @@ -89,11 +89,11 @@ Index: gdb-7.4.50.20120602/gdb/config/i386/nm-linux64.h +#define target_can_use_hardware_watchpoint(type, cnt, ot) 1 + +#endif /* NM_LINUX64_H */ -Index: gdb-7.4.50.20120602/gdb/target.h +Index: gdb-7.5.91.20130323/gdb/target.h =================================================================== ---- gdb-7.4.50.20120602.orig/gdb/target.h 2012-06-01 18:37:59.000000000 +0200 -+++ gdb-7.4.50.20120602/gdb/target.h 2012-06-02 19:55:42.436178407 +0200 -@@ -1470,8 +1470,10 @@ extern char *target_thread_name (struct +--- gdb-7.5.91.20130323.orig/gdb/target.h 2013-03-11 09:50:05.000000000 +0100 ++++ gdb-7.5.91.20130323/gdb/target.h 2013-03-23 19:48:22.758990238 +0100 +@@ -1563,8 +1563,10 @@ extern char *target_thread_name (struct bp_hardware_breakpoint. CNT is the number of such watchpoints used so far (including this one?). OTHERTYPE is who knows what... */ @@ -104,10 +104,10 @@ Index: gdb-7.4.50.20120602/gdb/target.h /* Returns the number of debug registers needed to watch the given memory region, or zero if not supported. */ -Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp +Index: gdb-7.5.91.20130323/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2012-06-02 19:55:42.442178406 +0200 ++++ gdb-7.5.91.20130323/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2013-03-23 19:48:22.758990238 +0100 @@ -0,0 +1,40 @@ +# Copyright 2009, 2010 Free Software Foundation, Inc. + diff --git a/gdb-dlopen-stap-probe-inhibit.patch b/gdb-dlopen-stap-probe-inhibit.patch new file mode 100644 index 0000000..f0417ec --- /dev/null +++ b/gdb-dlopen-stap-probe-inhibit.patch @@ -0,0 +1,60 @@ +https://bugzilla.redhat.com/show_bug.cgi?id=911712 + +--- ./gdb/objfiles.c-orig 2013-03-21 18:51:00.141957331 +0100 ++++ ./gdb/objfiles.c 2013-03-21 19:20:25.615519748 +0100 +@@ -615,6 +615,7 @@ free_objfile (struct objfile *objfile) + obstack_free (&objfile->objfile_obstack, 0); + + /* Rebuild section map next time we need it. */ ++ gdb_assert (!get_objfile_pspace_data (objfile->pspace)->inhibit_updates); + get_objfile_pspace_data (objfile->pspace)->objfiles_changed_p = 1; + + xfree (objfile); +@@ -1284,6 +1285,21 @@ bsearch_cmp (const void *key, const void + return 1; + } + ++static void ++update_space_info_sections (struct objfile_pspace_info *pspace_info) ++{ ++ if (pspace_info->objfiles_changed_p && !pspace_info->inhibit_updates) ++ { ++ update_section_map (current_program_space, ++ &pspace_info->sections, ++ &pspace_info->num_sections); ++ ++ /* Don't need updates to section map until objfiles are added, ++ removed or relocated. */ ++ pspace_info->objfiles_changed_p = 0; ++ } ++} ++ + /* Returns a section whose range includes PC or NULL if none found. */ + + struct obj_section * +@@ -1298,16 +1314,7 @@ find_pc_section (CORE_ADDR pc) + return s; + + pspace_info = get_objfile_pspace_data (current_program_space); +- if (pspace_info->objfiles_changed_p && !pspace_info->inhibit_updates) +- { +- update_section_map (current_program_space, +- &pspace_info->sections, +- &pspace_info->num_sections); +- +- /* Don't need updates to section map until objfiles are added, +- removed or relocated. */ +- pspace_info->objfiles_changed_p = 0; +- } ++ update_space_info_sections (pspace_info); + + /* The C standard (ISO/IEC 9899:TC2) requires the BASE argument to + bsearch be non-NULL. */ +@@ -1471,6 +1478,7 @@ objfiles_changed (void) + void + inhibit_section_map_updates (void) + { ++ update_space_info_sections (get_objfile_pspace_data (current_program_space)); + get_objfile_pspace_data (current_program_space)->inhibit_updates = 1; + } + diff --git a/gdb-entryval-1of2.patch b/gdb-entryval-1of2.patch deleted file mode 100644 index 01a31ec..0000000 --- a/gdb-entryval-1of2.patch +++ /dev/null @@ -1,872 +0,0 @@ -http://sourceware.org/ml/gdb-patches/2013-03/msg00061.html -Subject: [patch] entry-values: Fix for C++ across CUs - -Hi, - -I have found with C++ entry-values do not work much. This is a problem -primarily for 'this' being in $rdi clobbered very soon and having a function -with 'this=' is pretty useless for core crash analysis. -It happens if the call is across CUs, where GCC uses name reference: - - <2><7c>: Abbrev Number: 6 (DW_TAG_GNU_call_site) - <7d> DW_AT_low_pc : 0x40049e - <85> DW_AT_abstract_origin: <0xa8> - <1>: Abbrev Number: 10 (DW_TAG_subprogram) - DW_AT_external : 1 - DW_AT_name : f - DW_AT_decl_file : 1 - DW_AT_decl_line : 26 - DW_AT_linkage_name: (indirect string, offset: 0x83): _Z1fi - DW_AT_declaration : 1 - -The testcase tests tail calls which is another (compared to unrecovered values -such as 'this') reproduction of the same problem: - Cannot find function "f(int)" for a call site target at 0x4004ae in main - #0 g (x=2) at gdb.arch/amd64-tailcall-cxx1.cc:23 - #1 0x00000000004004ae in main () at gdb.arch/amd64-tailcall-cxx1.cc:31 --> - #0 g (x=x@entry=2) at gdb.arch/amd64-tailcall-cxx1.cc:23 - #1 0x00000000004005c8 in f (x=x@entry=1) at gdb.arch/amd64-tailcall-cxx2.cc:23 - #2 0x00000000004004ae in main () at gdb.arch/amd64-tailcall-cxx1.cc:31 - -There are two different fixes below. The first one only always works but it -always uses the demangled name, which is not exact. The second fix provides -the mangled name (if available); the mangled name would not need the first fix -but the mangled name is sometimes not available - for example in Fedora GCC. - -No regressions on {x86_64,x86_64-m32,i686}-fedora19pre-linux-gnu. - -Probably nothing interesting, I will check it in. - - -Thanks, -Jan - - -gdb/ -2013-03-02 Jan Kratochvil - - Fix entry-values in C++ across CUs. - * dwarf2loc.c (call_site_to_target_addr) : Use - lookup_minimal_symbol. Add a comment. - * dwarf2read.c - (read_call_site_scope) : Prefer - DW_AT_linkage_name. - -gdb/testsuite/ -2013-03-02 Jan Kratochvil - - Fix entry-values in C++ across CUs. - * gdb.arch/amd64-tailcall-cxx.exp: New file. - * gdb.arch/amd64-tailcall-cxx1.S: New file. - * gdb.arch/amd64-tailcall-cxx1.cc: New file. - * gdb.arch/amd64-tailcall-cxx2.S: New file. - * gdb.arch/amd64-tailcall-cxx2.cc: New file. - -diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c -index 8a61ae6..f300df2 100644 ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -542,7 +542,9 @@ call_site_to_target_addr (struct gdbarch *call_site_gdbarch, - struct minimal_symbol *msym; - - physname = FIELD_STATIC_PHYSNAME (call_site->target); -- msym = lookup_minimal_symbol_text (physname, NULL); -+ -+ /* Handle both the mangled and demangled PHYSNAME. */ -+ msym = lookup_minimal_symbol (physname, NULL, NULL); - if (msym == NULL) - { - msym = lookup_minimal_symbol_by_pc (call_site->pc - 1); -diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index df6298b..faee1a8 100644 ---- a/gdb/dwarf2read.c -+++ b/gdb/dwarf2read.c -@@ -9812,9 +9812,18 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu) - gdb_assert (target_cu->objfile == objfile); - if (die_is_declaration (target_die, target_cu)) - { -- const char *target_physname; -- -- target_physname = dwarf2_physname (NULL, target_die, target_cu); -+ const char *target_physname = NULL; -+ struct attribute *target_attr; -+ -+ /* Prefer the mangled name; otherwise compute the demangled one. */ -+ target_attr = dwarf2_attr (target_die, DW_AT_linkage_name, target_cu); -+ if (target_attr == NULL) -+ target_attr = dwarf2_attr (target_die, DW_AT_MIPS_linkage_name, -+ target_cu); -+ if (target_attr != NULL && DW_STRING (target_attr) != NULL) -+ target_physname = DW_STRING (target_attr); -+ else -+ target_physname = dwarf2_physname (NULL, target_die, target_cu); - if (target_physname == NULL) - complaint (&symfile_complaints, - _("DW_AT_GNU_call_site_target target DIE has invalid " -diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-cxx.exp b/gdb/testsuite/gdb.arch/amd64-tailcall-cxx.exp -new file mode 100644 -index 0000000..db2ab3c ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/amd64-tailcall-cxx.exp -@@ -0,0 +1,36 @@ -+# Copyright (C) 2012-2013 Free Software Foundation, Inc. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+set opts {} -+standard_testfile amd64-tailcall-cxx1.S amd64-tailcall-cxx2.S -+ -+if [info exists COMPILE] { -+ # make check RUNTESTFLAGS="gdb.arch/amd64-tailcall-cxx.exp COMPILE=1" -+ standard_testfile amd64-tailcall-cxx1.cc amd64-tailcall-cxx2.cc -+ lappend opts debug optimize=-O2 -+} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } { -+ verbose "Skipping ${testfile}." -+ return -+} -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} "${srcfile} ${srcfile2}" $opts] } { -+ return -1 -+} -+ -+if ![runto g] { -+ return -1 -+} -+ -+gdb_test "bt" "\r\n#0 +g \\(x=x@entry=2\\) at \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in f \\(x=x@entry=1\\) at \[^\r\n\]*\r\n#2 +0x\[0-9a-f\]+ in main .*" -diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-cxx1.S b/gdb/testsuite/gdb.arch/amd64-tailcall-cxx1.S -new file mode 100644 -index 0000000..d988446 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/amd64-tailcall-cxx1.S -@@ -0,0 +1,367 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2012-2013 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+/* This source file was generated by: -+ g++ -o gdb.arch/amd64-tailcall-cxx1.S gdb.arch/amd64-tailcall-cxx1.cc -Wall -S -dA -O2 -g -+ Fedora GCC was used here to also test the case of missing DW_AT_linkage_name. -+ */ -+ -+ .file "amd64-tailcall-cxx1.cc" -+ .text -+.Ltext0: -+ .p2align 4,,15 -+ .globl _Z1gi -+ .type _Z1gi, @function -+_Z1gi: -+.LFB0: -+ .file 1 "gdb.arch/amd64-tailcall-cxx1.cc" -+ # gdb.arch/amd64-tailcall-cxx1.cc:22 -+ .loc 1 22 0 -+ .cfi_startproc -+.LVL0: -+# BLOCK 2 freq:10000 seq:0 -+# PRED: ENTRY [100.0%] (FALLTHRU) -+ # gdb.arch/amd64-tailcall-cxx1.cc:23 -+ .loc 1 23 0 -+ movl %edi, v(%rip) -+# SUCC: EXIT [100.0%] -+ ret -+ .cfi_endproc -+.LFE0: -+ .size _Z1gi, .-_Z1gi -+ .section .text.startup,"ax",@progbits -+ .p2align 4,,15 -+ .globl main -+ .type main, @function -+main: -+.LFB1: -+ # gdb.arch/amd64-tailcall-cxx1.cc:30 -+ .loc 1 30 0 -+ .cfi_startproc -+# BLOCK 2 freq:10000 seq:0 -+# PRED: ENTRY [100.0%] (FALLTHRU) -+ subq $8, %rsp -+ .cfi_def_cfa_offset 16 -+ # gdb.arch/amd64-tailcall-cxx1.cc:31 -+ .loc 1 31 0 -+ movl $1, %edi -+ call _Z1fi -+.LVL1: -+ # gdb.arch/amd64-tailcall-cxx1.cc:32 -+ .loc 1 32 0 -+ xorl %eax, %eax -+ addq $8, %rsp -+ .cfi_def_cfa_offset 8 -+# SUCC: EXIT [100.0%] -+ ret -+ .cfi_endproc -+.LFE1: -+ .size main, .-main -+ .globl v -+ .bss -+ .align 4 -+ .type v, @object -+ .size v, 4 -+v: -+ .zero 4 -+ .text -+.Letext0: -+ .section .debug_info,"",@progbits -+.Ldebug_info0: -+ .long 0xb4 # Length of Compilation Unit Info -+ .value 0x4 # DWARF version number -+ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section -+ .byte 0x8 # Pointer Size (in bytes) -+ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit) -+ .long .LASF1 # DW_AT_producer: "GNU C++ 4.8.0 20130220 (Red Hat 4.8.0-0.14) -mtune=generic -march=x86-64 -g -O2" -+ .byte 0x4 # DW_AT_language -+ .long .LASF2 # DW_AT_name: "gdb.arch/amd64-tailcall-cxx1.cc" -+ .long .LASF3 # DW_AT_comp_dir: "" -+ .long .Ldebug_ranges0+0 # DW_AT_ranges -+ .quad 0 # DW_AT_low_pc -+ .long .Ldebug_line0 # DW_AT_stmt_list -+ .uleb128 0x2 # (DIE (0x29) DW_TAG_subprogram) -+ # DW_AT_external -+ .ascii "g\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-cxx1.cc) -+ .byte 0x15 # DW_AT_decl_line -+ .long .LASF4 # DW_AT_linkage_name: "_Z1gi" -+ .quad .LFB0 # DW_AT_low_pc -+ .quad .LFE0-.LFB0 # DW_AT_high_pc -+ .uleb128 0x1 # DW_AT_frame_base -+ .byte 0x9c # DW_OP_call_frame_cfa -+ # DW_AT_GNU_all_call_sites -+ .long 0x54 # DW_AT_sibling -+ .uleb128 0x3 # (DIE (0x48) DW_TAG_formal_parameter) -+ .ascii "x\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-cxx1.cc) -+ .byte 0x15 # DW_AT_decl_line -+ .long 0x54 # DW_AT_type -+ .uleb128 0x1 # DW_AT_location -+ .byte 0x55 # DW_OP_reg5 -+ .byte 0 # end of children of DIE 0x29 -+ .uleb128 0x4 # (DIE (0x54) DW_TAG_base_type) -+ .byte 0x4 # DW_AT_byte_size -+ .byte 0x5 # DW_AT_encoding -+ .ascii "int\0" # DW_AT_name -+ .uleb128 0x5 # (DIE (0x5b) DW_TAG_subprogram) -+ # DW_AT_external -+ .long .LASF0 # DW_AT_name: "main" -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-cxx1.cc) -+ .byte 0x1d # DW_AT_decl_line -+ .long 0x54 # DW_AT_type -+ .quad .LFB1 # DW_AT_low_pc -+ .quad .LFE1-.LFB1 # DW_AT_high_pc -+ .uleb128 0x1 # DW_AT_frame_base -+ .byte 0x9c # DW_OP_call_frame_cfa -+ # DW_AT_GNU_all_call_sites -+ .long 0x90 # DW_AT_sibling -+ .uleb128 0x6 # (DIE (0x7c) DW_TAG_GNU_call_site) -+ .quad .LVL1 # DW_AT_low_pc -+ .long 0xa8 # DW_AT_abstract_origin -+ .uleb128 0x7 # (DIE (0x89) DW_TAG_GNU_call_site_parameter) -+ .uleb128 0x1 # DW_AT_location -+ .byte 0x55 # DW_OP_reg5 -+ .uleb128 0x1 # DW_AT_GNU_call_site_value -+ .byte 0x31 # DW_OP_lit1 -+ .byte 0 # end of children of DIE 0x7c -+ .byte 0 # end of children of DIE 0x5b -+ .uleb128 0x8 # (DIE (0x90) DW_TAG_variable) -+ .ascii "v\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-cxx1.cc) -+ .byte 0x12 # DW_AT_decl_line -+ .long 0xa3 # DW_AT_type -+ # DW_AT_external -+ .uleb128 0x9 # DW_AT_location -+ .byte 0x3 # DW_OP_addr -+ .quad v -+ .uleb128 0x9 # (DIE (0xa3) DW_TAG_volatile_type) -+ .long 0x54 # DW_AT_type -+ .uleb128 0xa # (DIE (0xa8) DW_TAG_subprogram) -+ # DW_AT_external -+ .ascii "f\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-cxx1.cc) -+ .byte 0x1a # DW_AT_decl_line -+ .long .LASF5 # DW_AT_linkage_name: "_Z1fi" -+ # DW_AT_declaration -+ .uleb128 0xb # (DIE (0xb1) DW_TAG_formal_parameter) -+ .long 0x54 # DW_AT_type -+ .byte 0 # end of children of DIE 0xa8 -+ .byte 0 # end of children of DIE 0xb -+ .section .debug_abbrev,"",@progbits -+.Ldebug_abbrev0: -+ .uleb128 0x1 # (abbrev code) -+ .uleb128 0x11 # (TAG: DW_TAG_compile_unit) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x25 # (DW_AT_producer) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x13 # (DW_AT_language) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x1b # (DW_AT_comp_dir) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x55 # (DW_AT_ranges) -+ .uleb128 0x17 # (DW_FORM_sec_offset) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x10 # (DW_AT_stmt_list) -+ .uleb128 0x17 # (DW_FORM_sec_offset) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x2 # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x3f # (DW_AT_external) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x6e # (DW_AT_linkage_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x7 # (DW_FORM_data8) -+ .uleb128 0x40 # (DW_AT_frame_base) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x1 # (DW_AT_sibling) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x3 # (abbrev code) -+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter) -+ .byte 0 # DW_children_no -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x2 # (DW_AT_location) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x4 # (abbrev code) -+ .uleb128 0x24 # (TAG: DW_TAG_base_type) -+ .byte 0 # DW_children_no -+ .uleb128 0xb # (DW_AT_byte_size) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3e # (DW_AT_encoding) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x5 # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x3f # (DW_AT_external) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x7 # (DW_FORM_data8) -+ .uleb128 0x40 # (DW_AT_frame_base) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x1 # (DW_AT_sibling) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x6 # (abbrev code) -+ .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x31 # (DW_AT_abstract_origin) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x7 # (abbrev code) -+ .uleb128 0x410a # (TAG: DW_TAG_GNU_call_site_parameter) -+ .byte 0 # DW_children_no -+ .uleb128 0x2 # (DW_AT_location) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .uleb128 0x2111 # (DW_AT_GNU_call_site_value) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x8 # (abbrev code) -+ .uleb128 0x34 # (TAG: DW_TAG_variable) -+ .byte 0 # DW_children_no -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x3f # (DW_AT_external) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x2 # (DW_AT_location) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x9 # (abbrev code) -+ .uleb128 0x35 # (TAG: DW_TAG_volatile_type) -+ .byte 0 # DW_children_no -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xa # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x3f # (DW_AT_external) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x6e # (DW_AT_linkage_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x3c # (DW_AT_declaration) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xb # (abbrev code) -+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter) -+ .byte 0 # DW_children_no -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .byte 0 -+ .section .debug_aranges,"",@progbits -+ .long 0x3c # Length of Address Ranges Info -+ .value 0x2 # DWARF Version -+ .long .Ldebug_info0 # Offset of Compilation Unit Info -+ .byte 0x8 # Size of Address -+ .byte 0 # Size of Segment Descriptor -+ .value 0 # Pad to 16 byte boundary -+ .value 0 -+ .quad .Ltext0 # Address -+ .quad .Letext0-.Ltext0 # Length -+ .quad .LFB1 # Address -+ .quad .LFE1-.LFB1 # Length -+ .quad 0 -+ .quad 0 -+ .section .debug_ranges,"",@progbits -+.Ldebug_ranges0: -+ .quad .Ltext0 # Offset 0 -+ .quad .Letext0 -+ .quad .LFB1 # Offset 0x10 -+ .quad .LFE1 -+ .quad 0 -+ .quad 0 -+ .section .debug_line,"",@progbits -+.Ldebug_line0: -+ .section .debug_str,"MS",@progbits,1 -+.LASF4: -+ .string "_Z1gi" -+.LASF3: -+ .string "" -+.LASF2: -+ .string "gdb.arch/amd64-tailcall-cxx1.cc" -+.LASF1: -+ .string "GNU C++ 4.8.0 20130220 (Red Hat 4.8.0-0.14) -mtune=generic -march=x86-64 -g -O2" -+.LASF0: -+ .string "main" -+.LASF5: -+ .string "_Z1fi" -+ .ident "GCC: (GNU) 4.8.0 20130220 (Red Hat 4.8.0-0.14)" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-cxx1.cc b/gdb/testsuite/gdb.arch/amd64-tailcall-cxx1.cc -new file mode 100644 -index 0000000..7af9936 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/amd64-tailcall-cxx1.cc -@@ -0,0 +1,32 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2013 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+volatile int v; -+ -+__attribute__ ((noinline, noclone)) void -+g (int x) -+{ -+ v = x; -+} -+ -+extern void f (int x); -+ -+int -+main () -+{ -+ f (1); -+} -diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-cxx2.S b/gdb/testsuite/gdb.arch/amd64-tailcall-cxx2.S -new file mode 100644 -index 0000000..8a26d6f ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/amd64-tailcall-cxx2.S -@@ -0,0 +1,276 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2012-2013 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+/* This source file was generated by: -+ g++ -o gdb.arch/amd64-tailcall-cxx2.S gdb.arch/amd64-tailcall-cxx2.cc -Wall -S -dA -O2 -g -+ Fedora GCC was used here to also test the case of missing DW_AT_linkage_name. -+ */ -+ -+ .file "amd64-tailcall-cxx2.cc" -+ .text -+.Ltext0: -+ .p2align 4,,15 -+ .globl _Z1fi -+ .type _Z1fi, @function -+_Z1fi: -+.LFB0: -+ .file 1 "gdb.arch/amd64-tailcall-cxx2.cc" -+ # gdb.arch/amd64-tailcall-cxx2.cc:22 -+ .loc 1 22 0 -+ .cfi_startproc -+.LVL0: -+# BLOCK 2 freq:10000 seq:0 -+# PRED: ENTRY [100.0%] (FALLTHRU) -+ # gdb.arch/amd64-tailcall-cxx2.cc:23 -+ .loc 1 23 0 -+ addl $1, %edi -+.LVL1: -+ jmp _Z1gi -+.LVL2: -+# SUCC: EXIT [100.0%] (ABNORMAL,SIBCALL) -+ .cfi_endproc -+.LFE0: -+ .size _Z1fi, .-_Z1fi -+.Letext0: -+ .section .debug_info,"",@progbits -+.Ldebug_info0: -+ .long 0x84 # Length of Compilation Unit Info -+ .value 0x4 # DWARF version number -+ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section -+ .byte 0x8 # Pointer Size (in bytes) -+ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit) -+ .long .LASF0 # DW_AT_producer: "GNU C++ 4.8.0 20130220 (Red Hat 4.8.0-0.14) -mtune=generic -march=x86-64 -g -O2" -+ .byte 0x4 # DW_AT_language -+ .long .LASF1 # DW_AT_name: "gdb.arch/amd64-tailcall-cxx2.cc" -+ .long .LASF2 # DW_AT_comp_dir: "" -+ .quad .Ltext0 # DW_AT_low_pc -+ .quad .Letext0-.Ltext0 # DW_AT_high_pc -+ .long .Ldebug_line0 # DW_AT_stmt_list -+ .uleb128 0x2 # (DIE (0x2d) DW_TAG_subprogram) -+ # DW_AT_external -+ .ascii "f\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-cxx2.cc) -+ .byte 0x15 # DW_AT_decl_line -+ .long .LASF3 # DW_AT_linkage_name: "_Z1fi" -+ .quad .LFB0 # DW_AT_low_pc -+ .quad .LFE0-.LFB0 # DW_AT_high_pc -+ .uleb128 0x1 # DW_AT_frame_base -+ .byte 0x9c # DW_OP_call_frame_cfa -+ # DW_AT_GNU_all_call_sites -+ .long 0x71 # DW_AT_sibling -+ .uleb128 0x3 # (DIE (0x4c) DW_TAG_formal_parameter) -+ .ascii "x\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-cxx2.cc) -+ .byte 0x15 # DW_AT_decl_line -+ .long 0x71 # DW_AT_type -+ .long .LLST0 # DW_AT_location -+ .uleb128 0x4 # (DIE (0x59) DW_TAG_GNU_call_site) -+ .quad .LVL2 # DW_AT_low_pc -+ # DW_AT_GNU_tail_call -+ .long 0x78 # DW_AT_abstract_origin -+ .uleb128 0x5 # (DIE (0x66) DW_TAG_GNU_call_site_parameter) -+ .uleb128 0x1 # DW_AT_location -+ .byte 0x55 # DW_OP_reg5 -+ .uleb128 0x5 # DW_AT_GNU_call_site_value -+ .byte 0xf3 # DW_OP_GNU_entry_value -+ .uleb128 0x1 -+ .byte 0x55 # DW_OP_reg5 -+ .byte 0x23 # DW_OP_plus_uconst -+ .uleb128 0x1 -+ .byte 0 # end of children of DIE 0x59 -+ .byte 0 # end of children of DIE 0x2d -+ .uleb128 0x6 # (DIE (0x71) DW_TAG_base_type) -+ .byte 0x4 # DW_AT_byte_size -+ .byte 0x5 # DW_AT_encoding -+ .ascii "int\0" # DW_AT_name -+ .uleb128 0x7 # (DIE (0x78) DW_TAG_subprogram) -+ # DW_AT_external -+ .ascii "g\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-cxx2.cc) -+ .byte 0x12 # DW_AT_decl_line -+ .long .LASF4 # DW_AT_linkage_name: "_Z1gi" -+ # DW_AT_declaration -+ .uleb128 0x8 # (DIE (0x81) DW_TAG_formal_parameter) -+ .long 0x71 # DW_AT_type -+ .byte 0 # end of children of DIE 0x78 -+ .byte 0 # end of children of DIE 0xb -+ .section .debug_abbrev,"",@progbits -+.Ldebug_abbrev0: -+ .uleb128 0x1 # (abbrev code) -+ .uleb128 0x11 # (TAG: DW_TAG_compile_unit) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x25 # (DW_AT_producer) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x13 # (DW_AT_language) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x1b # (DW_AT_comp_dir) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x7 # (DW_FORM_data8) -+ .uleb128 0x10 # (DW_AT_stmt_list) -+ .uleb128 0x17 # (DW_FORM_sec_offset) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x2 # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x3f # (DW_AT_external) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x6e # (DW_AT_linkage_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x7 # (DW_FORM_data8) -+ .uleb128 0x40 # (DW_AT_frame_base) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x1 # (DW_AT_sibling) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x3 # (abbrev code) -+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter) -+ .byte 0 # DW_children_no -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x2 # (DW_AT_location) -+ .uleb128 0x17 # (DW_FORM_sec_offset) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x4 # (abbrev code) -+ .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x2115 # (DW_AT_GNU_tail_call) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x31 # (DW_AT_abstract_origin) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x5 # (abbrev code) -+ .uleb128 0x410a # (TAG: DW_TAG_GNU_call_site_parameter) -+ .byte 0 # DW_children_no -+ .uleb128 0x2 # (DW_AT_location) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .uleb128 0x2111 # (DW_AT_GNU_call_site_value) -+ .uleb128 0x18 # (DW_FORM_exprloc) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x6 # (abbrev code) -+ .uleb128 0x24 # (TAG: DW_TAG_base_type) -+ .byte 0 # DW_children_no -+ .uleb128 0xb # (DW_AT_byte_size) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3e # (DW_AT_encoding) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x7 # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x3f # (DW_AT_external) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x6e # (DW_AT_linkage_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x3c # (DW_AT_declaration) -+ .uleb128 0x19 # (DW_FORM_flag_present) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x8 # (abbrev code) -+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter) -+ .byte 0 # DW_children_no -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .byte 0 -+ .section .debug_loc,"",@progbits -+.Ldebug_loc0: -+.LLST0: -+ .quad .LVL0-.Ltext0 # Location list begin address (*.LLST0) -+ .quad .LVL1-.Ltext0 # Location list end address (*.LLST0) -+ .value 0x1 # Location expression size -+ .byte 0x55 # DW_OP_reg5 -+ .quad .LVL1-.Ltext0 # Location list begin address (*.LLST0) -+ .quad .LVL2-1-.Ltext0 # Location list end address (*.LLST0) -+ .value 0x3 # Location expression size -+ .byte 0x75 # DW_OP_breg5 -+ .sleb128 -1 -+ .byte 0x9f # DW_OP_stack_value -+ .quad .LVL2-1-.Ltext0 # Location list begin address (*.LLST0) -+ .quad .LFE0-.Ltext0 # Location list end address (*.LLST0) -+ .value 0x4 # Location expression size -+ .byte 0xf3 # DW_OP_GNU_entry_value -+ .uleb128 0x1 -+ .byte 0x55 # DW_OP_reg5 -+ .byte 0x9f # DW_OP_stack_value -+ .quad 0 # Location list terminator begin (*.LLST0) -+ .quad 0 # Location list terminator end (*.LLST0) -+ .section .debug_aranges,"",@progbits -+ .long 0x2c # Length of Address Ranges Info -+ .value 0x2 # DWARF Version -+ .long .Ldebug_info0 # Offset of Compilation Unit Info -+ .byte 0x8 # Size of Address -+ .byte 0 # Size of Segment Descriptor -+ .value 0 # Pad to 16 byte boundary -+ .value 0 -+ .quad .Ltext0 # Address -+ .quad .Letext0-.Ltext0 # Length -+ .quad 0 -+ .quad 0 -+ .section .debug_line,"",@progbits -+.Ldebug_line0: -+ .section .debug_str,"MS",@progbits,1 -+.LASF0: -+ .string "GNU C++ 4.8.0 20130220 (Red Hat 4.8.0-0.14) -mtune=generic -march=x86-64 -g -O2" -+.LASF2: -+ .string "" -+.LASF3: -+ .string "_Z1fi" -+.LASF1: -+ .string "gdb.arch/amd64-tailcall-cxx2.cc" -+.LASF4: -+ .string "_Z1gi" -+ .ident "GCC: (GNU) 4.8.0 20130220 (Red Hat 4.8.0-0.14)" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-cxx2.cc b/gdb/testsuite/gdb.arch/amd64-tailcall-cxx2.cc -new file mode 100644 -index 0000000..232f4fb ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/amd64-tailcall-cxx2.cc -@@ -0,0 +1,24 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2013 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+extern void g (int x); -+ -+__attribute__ ((noinline, noclone)) void -+f (int x) -+{ -+ g (x + 1); -+} - diff --git a/gdb-entryval-2of2.patch b/gdb-entryval-2of2.patch deleted file mode 100644 index 3c3c479..0000000 --- a/gdb-entryval-2of2.patch +++ /dev/null @@ -1,845 +0,0 @@ -http://sourceware.org/ml/gdb-patches/2013-03/msg00062.html -Subject: [patch] entry-values: Fix if callee called noreturn function - -Hi, - -while debugging the previous bug I found this bug. - -THIS_PC found below is then passed to get_pc_function_start. -get_pc_function_start cannot handle PC which has address of the end of the -function. - -No regressions on {x86_64,x86_64-m32,i686}-fedora19pre-linux-gnu. - -I will check it in. - - -Thanks, -Jan - - -gdb/ -2013-03-02 Jan Kratochvil - - Fix entry-values if the callee called a noreturn function. - * dwarf2-frame-tailcall.c (dwarf2_tailcall_sniffer_first): Use - get_frame_address_in_block. Add new comment. - -gdb/testsuite/ -2013-03-02 Jan Kratochvil - - Fix entry-values if the callee called a noreturn function. - * gdb.arch/amd64-tailcall-noret.S: New file. - * gdb.arch/amd64-tailcall-noret.c: New file. - * gdb.arch/amd64-tailcall-noret.exp: New file. - -diff --git a/gdb/dwarf2-frame-tailcall.c b/gdb/dwarf2-frame-tailcall.c -index b5f95c3..b82a051 100644 ---- a/gdb/dwarf2-frame-tailcall.c -+++ b/gdb/dwarf2-frame-tailcall.c -@@ -374,7 +374,9 @@ dwarf2_tailcall_sniffer_first (struct frame_info *this_frame, - - gdb_assert (*tailcall_cachep == NULL); - -- this_pc = get_frame_pc (this_frame); -+ /* PC may be after the function if THIS_FRAME calls noreturn function, -+ get_frame_address_in_block will decrease it by 1 in such case. */ -+ this_pc = get_frame_address_in_block (this_frame); - - /* Catch any unwinding errors. */ - TRY_CATCH (except, RETURN_MASK_ERROR) -diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-noret.S b/gdb/testsuite/gdb.arch/amd64-tailcall-noret.S -new file mode 100644 -index 0000000..25397e9 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/amd64-tailcall-noret.S -@@ -0,0 +1,694 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2013 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+/* This source file was generated by: -+ gcc -o gdb.arch/amd64-tailcall-noret.S gdb.arch/amd64-tailcall-noret.c -Wall -S -dA -O2 -g -+ */ -+ -+ .file "amd64-tailcall-noret.c" -+ .text -+.Ltext0: -+ .section .text.unlikely,"ax",@progbits -+ .type noret, @function -+noret: -+.LFB9: -+ .file 1 "gdb.arch/amd64-tailcall-noret.c" -+ # gdb.arch/amd64-tailcall-noret.c:24 -+ .loc 1 24 0 -+ .cfi_startproc -+.LVL0: -+# BLOCK 2 freq:10000 seq:0 -+# PRED: ENTRY [100.0%] (fallthru) -+ pushq %rax -+.LCFI0: -+ .cfi_def_cfa_offset 16 -+ # gdb.arch/amd64-tailcall-noret.c:25 -+ .loc 1 25 0 -+ call abort -+.LVL1: -+# SUCC: -+ .cfi_endproc -+.LFE9: -+ .size noret, .-noret -+ .text -+ .p2align 4,,15 -+ .type mayret, @function -+mayret: -+.LFB10: -+ # gdb.arch/amd64-tailcall-noret.c:30 -+ .loc 1 30 0 -+ .cfi_startproc -+.LVL2: -+# BLOCK 2 freq:10000 seq:0 -+# PRED: ENTRY [100.0%] (fallthru) -+ # gdb.arch/amd64-tailcall-noret.c:31 -+ .loc 1 31 0 -+ movl v(%rip), %eax -+ testl %eax, %eax -+# SUCC: 4 [0.0%] (can_fallthru) 3 [100.0%] (fallthru,can_fallthru) -+ jne .L8 -+# BLOCK 3 freq:9996 seq:1 -+# PRED: 2 [100.0%] (fallthru,can_fallthru) -+# SUCC: EXIT [100.0%] -+ rep -+ ret -+# BLOCK 4 freq:4 seq:2 -+# PRED: 2 [0.0%] (can_fallthru) -+.L8: -+ # gdb.arch/amd64-tailcall-noret.c:30 -+ .loc 1 30 0 -+ pushq %rdx -+.LCFI1: -+ .cfi_def_cfa_offset 16 -+ # gdb.arch/amd64-tailcall-noret.c:32 -+ .loc 1 32 0 -+ xorl %eax, %eax -+ call noret -+.LVL3: -+# SUCC: -+ .cfi_endproc -+.LFE10: -+ .size mayret, .-mayret -+ .p2align 4,,15 -+ .type tailcall, @function -+tailcall: -+.LFB11: -+ # gdb.arch/amd64-tailcall-noret.c:37 -+ .loc 1 37 0 -+ .cfi_startproc -+.LVL4: -+# BLOCK 2 freq:10000 seq:0 -+# PRED: ENTRY [100.0%] (fallthru) -+ # gdb.arch/amd64-tailcall-noret.c:38 -+ .loc 1 38 0 -+ jmp mayret -+.LVL5: -+# SUCC: EXIT [100.0%] (ab,sibcall) -+ .cfi_endproc -+.LFE11: -+ .size tailcall, .-tailcall -+ .section .text.startup,"ax",@progbits -+ .p2align 4,,15 -+ .globl main -+ .type main, @function -+main: -+.LFB12: -+ # gdb.arch/amd64-tailcall-noret.c:43 -+ .loc 1 43 0 -+ .cfi_startproc -+# BLOCK 2 freq:10000 seq:0 -+# PRED: ENTRY [100.0%] (fallthru) -+ subq $8, %rsp -+.LCFI2: -+ .cfi_def_cfa_offset 16 -+ # gdb.arch/amd64-tailcall-noret.c:44 -+ .loc 1 44 0 -+ movl $1, %edi -+ call tailcall -+.LVL6: -+ # gdb.arch/amd64-tailcall-noret.c:46 -+ .loc 1 46 0 -+ xorl %eax, %eax -+ addq $8, %rsp -+.LCFI3: -+ .cfi_def_cfa_offset 8 -+# SUCC: EXIT [100.0%] -+ ret -+ .cfi_endproc -+.LFE12: -+ .size main, .-main -+ .globl v -+ .data -+ .align 4 -+ .type v, @object -+ .size v, 4 -+v: -+ .long 1 -+ .text -+.Letext0: -+ .file 2 "/usr/include/stdlib.h" -+ .section .debug_info,"",@progbits -+.Ldebug_info0: -+ .long 0x19d # Length of Compilation Unit Info -+ .value 0x2 # DWARF version number -+ .long .Ldebug_abbrev0 # Offset Into Abbrev. Section -+ .byte 0x8 # Pointer Size (in bytes) -+ .uleb128 0x1 # (DIE (0xb) DW_TAG_compile_unit) -+ .long .LASF14 # DW_AT_producer: "GNU C 4.7.3 20130221 (prerelease)" -+ .byte 0x1 # DW_AT_language -+ .long .LASF15 # DW_AT_name: "gdb.arch/amd64-tailcall-noret.c" -+ .long .LASF16 # DW_AT_comp_dir: "" -+ .long .Ldebug_ranges0+0 # DW_AT_ranges -+ .quad 0 # DW_AT_low_pc -+ .quad 0 # DW_AT_entry_pc -+ .long .Ldebug_line0 # DW_AT_stmt_list -+ .uleb128 0x2 # (DIE (0x31) DW_TAG_base_type) -+ .byte 0x8 # DW_AT_byte_size -+ .byte 0x7 # DW_AT_encoding -+ .long .LASF0 # DW_AT_name: "long unsigned int" -+ .uleb128 0x3 # (DIE (0x38) DW_TAG_base_type) -+ .byte 0x4 # DW_AT_byte_size -+ .byte 0x5 # DW_AT_encoding -+ .ascii "int\0" # DW_AT_name -+ .uleb128 0x2 # (DIE (0x3f) DW_TAG_base_type) -+ .byte 0x1 # DW_AT_byte_size -+ .byte 0x8 # DW_AT_encoding -+ .long .LASF1 # DW_AT_name: "unsigned char" -+ .uleb128 0x2 # (DIE (0x46) DW_TAG_base_type) -+ .byte 0x2 # DW_AT_byte_size -+ .byte 0x7 # DW_AT_encoding -+ .long .LASF2 # DW_AT_name: "short unsigned int" -+ .uleb128 0x2 # (DIE (0x4d) DW_TAG_base_type) -+ .byte 0x4 # DW_AT_byte_size -+ .byte 0x7 # DW_AT_encoding -+ .long .LASF3 # DW_AT_name: "unsigned int" -+ .uleb128 0x2 # (DIE (0x54) DW_TAG_base_type) -+ .byte 0x1 # DW_AT_byte_size -+ .byte 0x6 # DW_AT_encoding -+ .long .LASF4 # DW_AT_name: "signed char" -+ .uleb128 0x2 # (DIE (0x5b) DW_TAG_base_type) -+ .byte 0x2 # DW_AT_byte_size -+ .byte 0x5 # DW_AT_encoding -+ .long .LASF5 # DW_AT_name: "short int" -+ .uleb128 0x2 # (DIE (0x62) DW_TAG_base_type) -+ .byte 0x8 # DW_AT_byte_size -+ .byte 0x5 # DW_AT_encoding -+ .long .LASF6 # DW_AT_name: "long int" -+ .uleb128 0x2 # (DIE (0x69) DW_TAG_base_type) -+ .byte 0x8 # DW_AT_byte_size -+ .byte 0x7 # DW_AT_encoding -+ .long .LASF7 # DW_AT_name: "sizetype" -+ .uleb128 0x2 # (DIE (0x70) DW_TAG_base_type) -+ .byte 0x1 # DW_AT_byte_size -+ .byte 0x6 # DW_AT_encoding -+ .long .LASF8 # DW_AT_name: "char" -+ .uleb128 0x2 # (DIE (0x77) DW_TAG_base_type) -+ .byte 0x8 # DW_AT_byte_size -+ .byte 0x5 # DW_AT_encoding -+ .long .LASF9 # DW_AT_name: "long long int" -+ .uleb128 0x2 # (DIE (0x7e) DW_TAG_base_type) -+ .byte 0x8 # DW_AT_byte_size -+ .byte 0x7 # DW_AT_encoding -+ .long .LASF10 # DW_AT_name: "long long unsigned int" -+ .uleb128 0x4 # (DIE (0x85) DW_TAG_volatile_type) -+ .long 0x38 # DW_AT_type -+ .uleb128 0x5 # (DIE (0x8a) DW_TAG_subprogram) -+ .long .LASF11 # DW_AT_name: "noret" -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-noret.c) -+ .byte 0x17 # DW_AT_decl_line -+ .byte 0x1 # DW_AT_prototyped -+ .quad .LFB9 # DW_AT_low_pc -+ .quad .LFE9 # DW_AT_high_pc -+ .long .LLST0 # DW_AT_frame_base -+ .byte 0x1 # DW_AT_GNU_all_call_sites -+ .long 0xc7 # DW_AT_sibling -+ .uleb128 0x6 # (DIE (0xab) DW_TAG_formal_parameter) -+ .ascii "x\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-noret.c) -+ .byte 0x17 # DW_AT_decl_line -+ .long 0x38 # DW_AT_type -+ .long .LLST1 # DW_AT_location -+ .uleb128 0x7 # (DIE (0xb8) DW_TAG_unspecified_parameters) -+ .uleb128 0x8 # (DIE (0xb9) DW_TAG_GNU_call_site) -+ .quad .LVL1 # DW_AT_low_pc -+ .long 0x195 # DW_AT_abstract_origin -+ .byte 0 # end of children of DIE 0x8a -+ .uleb128 0x5 # (DIE (0xc7) DW_TAG_subprogram) -+ .long .LASF12 # DW_AT_name: "mayret" -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-noret.c) -+ .byte 0x1d # DW_AT_decl_line -+ .byte 0x1 # DW_AT_prototyped -+ .quad .LFB10 # DW_AT_low_pc -+ .quad .LFE10 # DW_AT_high_pc -+ .long .LLST2 # DW_AT_frame_base -+ .byte 0x1 # DW_AT_GNU_all_call_sites -+ .long 0x103 # DW_AT_sibling -+ .uleb128 0x6 # (DIE (0xe8) DW_TAG_formal_parameter) -+ .ascii "x\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-noret.c) -+ .byte 0x1d # DW_AT_decl_line -+ .long 0x38 # DW_AT_type -+ .long .LLST3 # DW_AT_location -+ .uleb128 0x8 # (DIE (0xf5) DW_TAG_GNU_call_site) -+ .quad .LVL3 # DW_AT_low_pc -+ .long 0x8a # DW_AT_abstract_origin -+ .byte 0 # end of children of DIE 0xc7 -+ .uleb128 0x9 # (DIE (0x103) DW_TAG_subprogram) -+ .long .LASF13 # DW_AT_name: "tailcall" -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-noret.c) -+ .byte 0x24 # DW_AT_decl_line -+ .byte 0x1 # DW_AT_prototyped -+ .quad .LFB11 # DW_AT_low_pc -+ .quad .LFE11 # DW_AT_high_pc -+ .byte 0x2 # DW_AT_frame_base -+ .byte 0x77 # DW_OP_breg7 -+ .sleb128 8 -+ .byte 0x1 # DW_AT_GNU_all_call_sites -+ .long 0x147 # DW_AT_sibling -+ .uleb128 0x6 # (DIE (0x123) DW_TAG_formal_parameter) -+ .ascii "x\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-noret.c) -+ .byte 0x24 # DW_AT_decl_line -+ .long 0x38 # DW_AT_type -+ .long .LLST4 # DW_AT_location -+ .uleb128 0xa # (DIE (0x130) DW_TAG_GNU_call_site) -+ .quad .LVL5 # DW_AT_low_pc -+ .byte 0x1 # DW_AT_GNU_tail_call -+ .long 0xc7 # DW_AT_abstract_origin -+ .uleb128 0xb # (DIE (0x13e) DW_TAG_GNU_call_site_parameter) -+ .byte 0x1 # DW_AT_location -+ .byte 0x55 # DW_OP_reg5 -+ .byte 0x3 # DW_AT_GNU_call_site_value -+ .byte 0xf3 # DW_OP_GNU_entry_value -+ .uleb128 0x1 -+ .byte 0x55 # DW_OP_reg5 -+ .byte 0 # end of children of DIE 0x130 -+ .byte 0 # end of children of DIE 0x103 -+ .uleb128 0xc # (DIE (0x147) DW_TAG_subprogram) -+ .byte 0x1 # DW_AT_external -+ .long .LASF17 # DW_AT_name: "main" -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-noret.c) -+ .byte 0x2a # DW_AT_decl_line -+ .byte 0x1 # DW_AT_prototyped -+ .long 0x38 # DW_AT_type -+ .quad .LFB12 # DW_AT_low_pc -+ .quad .LFE12 # DW_AT_high_pc -+ .long .LLST5 # DW_AT_frame_base -+ .byte 0x1 # DW_AT_GNU_all_call_sites -+ .long 0x181 # DW_AT_sibling -+ .uleb128 0xd # (DIE (0x16d) DW_TAG_GNU_call_site) -+ .quad .LVL6 # DW_AT_low_pc -+ .long 0x103 # DW_AT_abstract_origin -+ .uleb128 0xb # (DIE (0x17a) DW_TAG_GNU_call_site_parameter) -+ .byte 0x1 # DW_AT_location -+ .byte 0x55 # DW_OP_reg5 -+ .byte 0x1 # DW_AT_GNU_call_site_value -+ .byte 0x31 # DW_OP_lit1 -+ .byte 0 # end of children of DIE 0x16d -+ .byte 0 # end of children of DIE 0x147 -+ .uleb128 0xe # (DIE (0x181) DW_TAG_variable) -+ .ascii "v\0" # DW_AT_name -+ .byte 0x1 # DW_AT_decl_file (gdb.arch/amd64-tailcall-noret.c) -+ .byte 0x14 # DW_AT_decl_line -+ .long 0x85 # DW_AT_type -+ .byte 0x1 # DW_AT_external -+ .byte 0x9 # DW_AT_location -+ .byte 0x3 # DW_OP_addr -+ .quad v -+ .uleb128 0xf # (DIE (0x195) DW_TAG_subprogram) -+ .byte 0x1 # DW_AT_external -+ .long .LASF18 # DW_AT_name: "abort" -+ .byte 0x2 # DW_AT_decl_file (/usr/include/stdlib.h) -+ .value 0x202 # DW_AT_decl_line -+ .byte 0x1 # DW_AT_prototyped -+ .byte 0x1 # DW_AT_declaration -+ .byte 0 # end of children of DIE 0xb -+ .section .debug_abbrev,"",@progbits -+.Ldebug_abbrev0: -+ .uleb128 0x1 # (abbrev code) -+ .uleb128 0x11 # (TAG: DW_TAG_compile_unit) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x25 # (DW_AT_producer) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x13 # (DW_AT_language) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x1b # (DW_AT_comp_dir) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x55 # (DW_AT_ranges) -+ .uleb128 0x6 # (DW_FORM_data4) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x52 # (DW_AT_entry_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x10 # (DW_AT_stmt_list) -+ .uleb128 0x6 # (DW_FORM_data4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x2 # (abbrev code) -+ .uleb128 0x24 # (TAG: DW_TAG_base_type) -+ .byte 0 # DW_children_no -+ .uleb128 0xb # (DW_AT_byte_size) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3e # (DW_AT_encoding) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x3 # (abbrev code) -+ .uleb128 0x24 # (TAG: DW_TAG_base_type) -+ .byte 0 # DW_children_no -+ .uleb128 0xb # (DW_AT_byte_size) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3e # (DW_AT_encoding) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x4 # (abbrev code) -+ .uleb128 0x35 # (TAG: DW_TAG_volatile_type) -+ .byte 0 # DW_children_no -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x5 # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x27 # (DW_AT_prototyped) -+ .uleb128 0xc # (DW_FORM_flag) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x40 # (DW_AT_frame_base) -+ .uleb128 0x6 # (DW_FORM_data4) -+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites) -+ .uleb128 0xc # (DW_FORM_flag) -+ .uleb128 0x1 # (DW_AT_sibling) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x6 # (abbrev code) -+ .uleb128 0x5 # (TAG: DW_TAG_formal_parameter) -+ .byte 0 # DW_children_no -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x2 # (DW_AT_location) -+ .uleb128 0x6 # (DW_FORM_data4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x7 # (abbrev code) -+ .uleb128 0x18 # (TAG: DW_TAG_unspecified_parameters) -+ .byte 0 # DW_children_no -+ .byte 0 -+ .byte 0 -+ .uleb128 0x8 # (abbrev code) -+ .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site) -+ .byte 0 # DW_children_no -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x31 # (DW_AT_abstract_origin) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0x9 # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x27 # (DW_AT_prototyped) -+ .uleb128 0xc # (DW_FORM_flag) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x40 # (DW_AT_frame_base) -+ .uleb128 0xa # (DW_FORM_block1) -+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites) -+ .uleb128 0xc # (DW_FORM_flag) -+ .uleb128 0x1 # (DW_AT_sibling) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xa # (abbrev code) -+ .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x2115 # (DW_AT_GNU_tail_call) -+ .uleb128 0xc # (DW_FORM_flag) -+ .uleb128 0x31 # (DW_AT_abstract_origin) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xb # (abbrev code) -+ .uleb128 0x410a # (TAG: DW_TAG_GNU_call_site_parameter) -+ .byte 0 # DW_children_no -+ .uleb128 0x2 # (DW_AT_location) -+ .uleb128 0xa # (DW_FORM_block1) -+ .uleb128 0x2111 # (DW_AT_GNU_call_site_value) -+ .uleb128 0xa # (DW_FORM_block1) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xc # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x3f # (DW_AT_external) -+ .uleb128 0xc # (DW_FORM_flag) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x27 # (DW_AT_prototyped) -+ .uleb128 0xc # (DW_FORM_flag) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x12 # (DW_AT_high_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x40 # (DW_AT_frame_base) -+ .uleb128 0x6 # (DW_FORM_data4) -+ .uleb128 0x2117 # (DW_AT_GNU_all_call_sites) -+ .uleb128 0xc # (DW_FORM_flag) -+ .uleb128 0x1 # (DW_AT_sibling) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xd # (abbrev code) -+ .uleb128 0x4109 # (TAG: DW_TAG_GNU_call_site) -+ .byte 0x1 # DW_children_yes -+ .uleb128 0x11 # (DW_AT_low_pc) -+ .uleb128 0x1 # (DW_FORM_addr) -+ .uleb128 0x31 # (DW_AT_abstract_origin) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xe # (abbrev code) -+ .uleb128 0x34 # (TAG: DW_TAG_variable) -+ .byte 0 # DW_children_no -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0x8 # (DW_FORM_string) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x49 # (DW_AT_type) -+ .uleb128 0x13 # (DW_FORM_ref4) -+ .uleb128 0x3f # (DW_AT_external) -+ .uleb128 0xc # (DW_FORM_flag) -+ .uleb128 0x2 # (DW_AT_location) -+ .uleb128 0xa # (DW_FORM_block1) -+ .byte 0 -+ .byte 0 -+ .uleb128 0xf # (abbrev code) -+ .uleb128 0x2e # (TAG: DW_TAG_subprogram) -+ .byte 0 # DW_children_no -+ .uleb128 0x3f # (DW_AT_external) -+ .uleb128 0xc # (DW_FORM_flag) -+ .uleb128 0x3 # (DW_AT_name) -+ .uleb128 0xe # (DW_FORM_strp) -+ .uleb128 0x3a # (DW_AT_decl_file) -+ .uleb128 0xb # (DW_FORM_data1) -+ .uleb128 0x3b # (DW_AT_decl_line) -+ .uleb128 0x5 # (DW_FORM_data2) -+ .uleb128 0x27 # (DW_AT_prototyped) -+ .uleb128 0xc # (DW_FORM_flag) -+ .uleb128 0x3c # (DW_AT_declaration) -+ .uleb128 0xc # (DW_FORM_flag) -+ .byte 0 -+ .byte 0 -+ .byte 0 -+ .section .debug_loc,"",@progbits -+.Ldebug_loc0: -+.LLST0: -+ .quad .LFB9 # Location list begin address (*.LLST0) -+ .quad .LCFI0 # Location list end address (*.LLST0) -+ .value 0x2 # Location expression size -+ .byte 0x77 # DW_OP_breg7 -+ .sleb128 8 -+ .quad .LCFI0 # Location list begin address (*.LLST0) -+ .quad .LFE9 # Location list end address (*.LLST0) -+ .value 0x2 # Location expression size -+ .byte 0x77 # DW_OP_breg7 -+ .sleb128 16 -+ .quad 0 # Location list terminator begin (*.LLST0) -+ .quad 0 # Location list terminator end (*.LLST0) -+.LLST1: -+ .quad .LVL0 # Location list begin address (*.LLST1) -+ .quad .LVL1-1 # Location list end address (*.LLST1) -+ .value 0x1 # Location expression size -+ .byte 0x55 # DW_OP_reg5 -+ .quad .LVL1-1 # Location list begin address (*.LLST1) -+ .quad .LFE9 # Location list end address (*.LLST1) -+ .value 0x4 # Location expression size -+ .byte 0xf3 # DW_OP_GNU_entry_value -+ .uleb128 0x1 -+ .byte 0x55 # DW_OP_reg5 -+ .byte 0x9f # DW_OP_stack_value -+ .quad 0 # Location list terminator begin (*.LLST1) -+ .quad 0 # Location list terminator end (*.LLST1) -+.LLST2: -+ .quad .LFB10 # Location list begin address (*.LLST2) -+ .quad .LCFI1 # Location list end address (*.LLST2) -+ .value 0x2 # Location expression size -+ .byte 0x77 # DW_OP_breg7 -+ .sleb128 8 -+ .quad .LCFI1 # Location list begin address (*.LLST2) -+ .quad .LFE10 # Location list end address (*.LLST2) -+ .value 0x2 # Location expression size -+ .byte 0x77 # DW_OP_breg7 -+ .sleb128 16 -+ .quad 0 # Location list terminator begin (*.LLST2) -+ .quad 0 # Location list terminator end (*.LLST2) -+.LLST3: -+ .quad .LVL2 # Location list begin address (*.LLST3) -+ .quad .LVL3-1 # Location list end address (*.LLST3) -+ .value 0x1 # Location expression size -+ .byte 0x55 # DW_OP_reg5 -+ .quad .LVL3-1 # Location list begin address (*.LLST3) -+ .quad .LFE10 # Location list end address (*.LLST3) -+ .value 0x4 # Location expression size -+ .byte 0xf3 # DW_OP_GNU_entry_value -+ .uleb128 0x1 -+ .byte 0x55 # DW_OP_reg5 -+ .byte 0x9f # DW_OP_stack_value -+ .quad 0 # Location list terminator begin (*.LLST3) -+ .quad 0 # Location list terminator end (*.LLST3) -+.LLST4: -+ .quad .LVL4 # Location list begin address (*.LLST4) -+ .quad .LVL5-1 # Location list end address (*.LLST4) -+ .value 0x1 # Location expression size -+ .byte 0x55 # DW_OP_reg5 -+ .quad .LVL5-1 # Location list begin address (*.LLST4) -+ .quad .LFE11 # Location list end address (*.LLST4) -+ .value 0x4 # Location expression size -+ .byte 0xf3 # DW_OP_GNU_entry_value -+ .uleb128 0x1 -+ .byte 0x55 # DW_OP_reg5 -+ .byte 0x9f # DW_OP_stack_value -+ .quad 0 # Location list terminator begin (*.LLST4) -+ .quad 0 # Location list terminator end (*.LLST4) -+.LLST5: -+ .quad .LFB12 # Location list begin address (*.LLST5) -+ .quad .LCFI2 # Location list end address (*.LLST5) -+ .value 0x2 # Location expression size -+ .byte 0x77 # DW_OP_breg7 -+ .sleb128 8 -+ .quad .LCFI2 # Location list begin address (*.LLST5) -+ .quad .LCFI3 # Location list end address (*.LLST5) -+ .value 0x2 # Location expression size -+ .byte 0x77 # DW_OP_breg7 -+ .sleb128 16 -+ .quad .LCFI3 # Location list begin address (*.LLST5) -+ .quad .LFE12 # Location list end address (*.LLST5) -+ .value 0x2 # Location expression size -+ .byte 0x77 # DW_OP_breg7 -+ .sleb128 8 -+ .quad 0 # Location list terminator begin (*.LLST5) -+ .quad 0 # Location list terminator end (*.LLST5) -+ .section .debug_aranges,"",@progbits -+ .long 0x4c # Length of Address Ranges Info -+ .value 0x2 # DWARF Version -+ .long .Ldebug_info0 # Offset of Compilation Unit Info -+ .byte 0x8 # Size of Address -+ .byte 0 # Size of Segment Descriptor -+ .value 0 # Pad to 16 byte boundary -+ .value 0 -+ .quad .Ltext0 # Address -+ .quad .Letext0-.Ltext0 # Length -+ .quad .LFB9 # Address -+ .quad .LFE9-.LFB9 # Length -+ .quad .LFB12 # Address -+ .quad .LFE12-.LFB12 # Length -+ .quad 0 -+ .quad 0 -+ .section .debug_ranges,"",@progbits -+.Ldebug_ranges0: -+ .quad .Ltext0 # Offset 0 -+ .quad .Letext0 -+ .quad .LFB9 # Offset 0x10 -+ .quad .LFE9 -+ .quad .LFB12 # Offset 0x20 -+ .quad .LFE12 -+ .quad 0 -+ .quad 0 -+ .section .debug_line,"",@progbits -+.Ldebug_line0: -+ .section .debug_str,"MS",@progbits,1 -+.LASF9: -+ .string "long long int" -+.LASF14: -+ .string "GNU C 4.7.3 20130221 (prerelease)" -+.LASF3: -+ .string "unsigned int" -+.LASF17: -+ .string "main" -+.LASF0: -+ .string "long unsigned int" -+.LASF10: -+ .string "long long unsigned int" -+.LASF16: -+ .string "" -+.LASF13: -+ .string "tailcall" -+.LASF1: -+ .string "unsigned char" -+.LASF8: -+ .string "char" -+.LASF6: -+ .string "long int" -+.LASF11: -+ .string "noret" -+.LASF2: -+ .string "short unsigned int" -+.LASF4: -+ .string "signed char" -+.LASF12: -+ .string "mayret" -+.LASF18: -+ .string "abort" -+.LASF5: -+ .string "short int" -+.LASF7: -+ .string "sizetype" -+.LASF15: -+ .string "gdb.arch/amd64-tailcall-noret.c" -+ .ident "GCC: (GNU) 4.7.3 20130221 (prerelease)" -+ .section .note.GNU-stack,"",@progbits -diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-noret.c b/gdb/testsuite/gdb.arch/amd64-tailcall-noret.c -new file mode 100644 -index 0000000..6a84c76 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/amd64-tailcall-noret.c -@@ -0,0 +1,46 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2013 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+#include -+ -+volatile int v = 1; -+ -+static __attribute__ ((noinline, noclone, noreturn)) void -+noret (int x, ...) -+{ -+ abort (); -+} -+ -+static __attribute__ ((noinline, noclone)) void -+mayret (int x) -+{ -+ if (v) -+ noret (x); -+} -+ -+static __attribute__ ((noinline, noclone)) void -+tailcall (int x) -+{ -+ mayret (x); -+} -+ -+int -+main (void) -+{ -+ tailcall (1); -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-noret.exp b/gdb/testsuite/gdb.arch/amd64-tailcall-noret.exp -new file mode 100644 -index 0000000..cd15596 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/amd64-tailcall-noret.exp -@@ -0,0 +1,36 @@ -+# Copyright (C) 2012-2013 Free Software Foundation, Inc. -+# -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+set opts {} -+standard_testfile .S -+ -+if [info exists COMPILE] { -+ # make check RUNTESTFLAGS="gdb.arch/amd64-tailcall-noret.exp COMPILE=1" -+ standard_testfile -+ lappend opts debug optimize=-O2 -+} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } { -+ verbose "Skipping ${testfile}." -+ return -+} -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} $opts] } { -+ return -1 -+} -+ -+if ![runto noret] { -+ return -1 -+} -+ -+gdb_test "bt" "#0 +noret \\(x=1\\) at \[^\r\n\]*\r\n#1 +0x\[0-9a-f\]+ in mayret \\(x=x@entry=1\\) at \[^\r\n\]*\r\n#2 +0x\[0-9a-f\]+ in tailcall \\(x=x@entry=1\\) at \[^\r\n\]*\r\n#3 +0x\[0-9a-f\]+ in main \\(\\) at .*" - diff --git a/gdb-orphanripper.c b/gdb-orphanripper.c index f8e3f49..d79d93c 100644 --- a/gdb-orphanripper.c +++ b/gdb-orphanripper.c @@ -47,13 +47,10 @@ static const char *progname; -static volatile int signal_chld_hit = 0; static volatile pid_t child; static void signal_chld (int signo) { - if (child && kill (child, 0) != 0) - signal_chld_hit = 1; } static volatile int signal_alrm_hit = 0; @@ -104,6 +101,44 @@ static int read_out (int amaster) return 1; } +/* kill (child, 0) == 0 sometimes even when CHILD's state is already "Z". */ + +static int child_exited (void) +{ + char buf[200]; + int fd, i, retval; + ssize_t got; + char *state; + + snprintf (buf, sizeof (buf), "/proc/%ld/stat", (long) child); + fd = open (buf, O_RDONLY); + if (fd == -1) + { + perror ("open (/proc/CHILD/stat)"); + exit (EXIT_FAILURE); + } + got = read (fd, buf, sizeof(buf)); + if (got <= 0) + { + perror ("read (/proc/CHILD/stat)"); + exit (EXIT_FAILURE); + } + if (close (fd) != 0) + { + perror ("close (/proc/CHILD/stat)"); + exit (EXIT_FAILURE); + } + i = sscanf (buf, "%*d%*s%ms", &state); + if (i != 1) + { + perror ("sscanf (/proc/CHILD/stat)"); + exit (EXIT_FAILURE); + } + retval = strcmp (state, "Z") == 0; + free (state); + return retval; +} + static int spawn (char **argv, int timeout) { pid_t child_got; @@ -157,6 +192,11 @@ static int spawn (char **argv, int timeout) assert (i == STDIN_FILENO); #endif + i = sigemptyset (&set); + assert (i == 0); + i = sigprocmask (SIG_SETMASK, &set, NULL); + assert (i == 0); + /* Do not setpgrp(2) in the parent process as the process-group is shared for the whole sh(1) pipeline we could be a part of. The process-group is set according to PID of the first @@ -206,7 +246,7 @@ static int spawn (char **argv, int timeout) i = ppoll (&pollfd, 1, NULL, &set); if (i == -1 && errno == EINTR) { - if (signal_chld_hit) + if (child_exited ()) break; /* Non-CHILD child may have exited. */ continue; @@ -230,7 +270,7 @@ static int spawn (char **argv, int timeout) exit (EXIT_FAILURE); } /* Child exited? */ - if (signal_chld_hit) + if (child_exited ()) break; } @@ -279,12 +319,10 @@ static int spawn (char **argv, int timeout) exit (EXIT_FAILURE); } - /* In the POLLHUP case we may not have seen SIGCHLD so far. */ + /* Not used in fact. */ i = sigprocmask (SIG_SETMASK, &set, NULL); assert (i == 0); - assert (signal_chld_hit != 0); - /* Do not unset O_NONBLOCK as a stale child (the whole purpose of this program) having open its output pty would block us in read_out. */ #if 0 diff --git a/gdb-python-rdynamic.patch b/gdb-python-rdynamic.patch deleted file mode 100644 index a576b72..0000000 --- a/gdb-python-rdynamic.patch +++ /dev/null @@ -1,44 +0,0 @@ ---- a/gdb/configure -+++ b/gdb/configure -@@ -14631,6 +14631,10 @@ rm -f core conftest.err conftest.$ac_objext \ - # Problem does not happen for the recommended libpythonX.Y.so linkage. - old_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PYTHON_CFLAGS" -+ old_CPPFLAGS="$CPPFLAGS" -+ CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS" -+ old_LIBS="$LIBS" -+ LIBS="$LIBS $PYTHON_LIBS" - if test "$cross_compiling" = yes; then : - true - else -@@ -14657,6 +14661,8 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - fi - - CFLAGS="$old_CFLAGS" -+ CPPFLAGS="$old_CPPFLAGS" -+ LIBS="$old_LIBS" - fi - LDFLAGS="$old_LDFLAGS" - fi ---- a/gdb/configure.ac -+++ b/gdb/configure.ac -@@ -1576,6 +1576,10 @@ if test "${gdb_native}" = yes; then - # Problem does not happen for the recommended libpythonX.Y.so linkage. - old_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PYTHON_CFLAGS" -+ old_CPPFLAGS="$CPPFLAGS" -+ CPPFLAGS="$CPPFLAGS $PYTHON_CPPFLAGS" -+ old_LIBS="$LIBS" -+ LIBS="$LIBS $PYTHON_LIBS" - AC_RUN_IFELSE( - AC_LANG_PROGRAM( - [#include "]${have_libpython}[/Python.h"], -@@ -1586,6 +1590,8 @@ if test "${gdb_native}" = yes; then - return err == 0 ? 0 : 1;]), - [dynamic_list=true], [], [true]) - CFLAGS="$old_CFLAGS" -+ CPPFLAGS="$old_CPPFLAGS" -+ LIBS="$old_LIBS" - fi - LDFLAGS="$old_LDFLAGS" - fi diff --git a/gdb-upstream.patch b/gdb-upstream.patch deleted file mode 100644 index 548af5f..0000000 --- a/gdb-upstream.patch +++ /dev/null @@ -1,152 +0,0 @@ -[COMMIT PATCH] Avoid invalid pointer to pointer conversions. -http://sourceware.org/ml/gdb-patches/2013-03/msg00449.html -http://sourceware.org/ml/gdb-cvs/2013-03/msg00093.html - -### src/gdb/ChangeLog 2013/03/11 12:20:45 1.15252 -### src/gdb/ChangeLog 2013/03/11 12:22:16 1.15253 -## -1,3 +1,15 @@ -+2013-03-11 Pedro Alves -+ -+ * charset.c (convert_between_encodings): Don't cast between -+ different pointer to pointer types. Instead, make the 'inp' local -+ be of the type iconv expects. -+ (wchar_iterate): Don't cast between different pointer to pointer -+ types. Instead, use new pointer local of the type iconv expects. -+ * target.c (target_read_stralloc, target_fileio_read_stralloc): -+ Add new local of type char pointer, and use it to get a -+ char/string view of the byte buffer, instead of casting between -+ pointer to pointer types. -+ - 2013-03-11 Hafiz Abid Qadeer - - * remote.c (remote_set_trace_buffer_size): Move != operator ---- src/gdb/charset.c 2013/03/07 19:10:46 1.54 -+++ src/gdb/charset.c 2013/03/11 12:22:20 1.55 -@@ -474,7 +474,7 @@ - iconv_t desc; - struct cleanup *cleanups; - size_t inleft; -- char *inp; -+ ICONV_CONST char *inp; - unsigned int space_request; - - /* Often, the host and target charsets will be the same. */ -@@ -490,7 +490,7 @@ - cleanups = make_cleanup (cleanup_iconv, &desc); - - inleft = num_bytes; -- inp = (char *) bytes; -+ inp = (ICONV_CONST char *) bytes; - - space_request = num_bytes; - -@@ -506,7 +506,7 @@ - outp = obstack_base (output) + old_size; - outleft = space_request; - -- r = iconv (desc, (ICONV_CONST char **) &inp, &inleft, &outp, &outleft); -+ r = iconv (desc, &inp, &inleft, &outp, &outleft); - - /* Now make sure that the object on the obstack only includes - bytes we have converted. */ -@@ -640,14 +640,15 @@ - out_request = 1; - while (iter->bytes > 0) - { -+ ICONV_CONST char *inptr = (ICONV_CONST char *) iter->input; - char *outptr = (char *) &iter->out[0]; - const gdb_byte *orig_inptr = iter->input; - size_t orig_in = iter->bytes; - size_t out_avail = out_request * sizeof (gdb_wchar_t); - size_t num; -- size_t r = iconv (iter->desc, -- (ICONV_CONST char **) &iter->input, -- &iter->bytes, &outptr, &out_avail); -+ size_t r = iconv (iter->desc, &inptr, &iter->bytes, &outptr, &out_avail); -+ -+ iter->input = (gdb_byte *) inptr; - - if (r == (size_t) -1) - { ---- src/gdb/target.c 2013/03/11 08:50:05 1.328 -+++ src/gdb/target.c 2013/03/11 12:22:20 1.329 -@@ -2378,11 +2378,12 @@ - target_read_stralloc (struct target_ops *ops, enum target_object object, - const char *annex) - { -- char *buffer; -+ gdb_byte *buffer; -+ char *bufstr; - LONGEST i, transferred; - -- transferred = target_read_alloc_1 (ops, object, annex, -- (gdb_byte **) &buffer, 1); -+ transferred = target_read_alloc_1 (ops, object, annex, &buffer, 1); -+ bufstr = (char *) buffer; - - if (transferred < 0) - return NULL; -@@ -2390,11 +2391,11 @@ - if (transferred == 0) - return xstrdup (""); - -- buffer[transferred] = 0; -+ bufstr[transferred] = 0; - - /* Check for embedded NUL bytes; but allow trailing NULs. */ -- for (i = strlen (buffer); i < transferred; i++) -- if (buffer[i] != 0) -+ for (i = strlen (bufstr); i < transferred; i++) -+ if (bufstr[i] != 0) - { - warning (_("target object %d, annex %s, " - "contained unexpected null characters"), -@@ -2402,7 +2403,7 @@ - break; - } - -- return buffer; -+ return bufstr; - } - - /* Memory transfer methods. */ -@@ -3542,11 +3543,12 @@ - char * - target_fileio_read_stralloc (const char *filename) - { -- char *buffer; -+ gdb_byte *buffer; -+ char *bufstr; - LONGEST i, transferred; - -- transferred = target_fileio_read_alloc_1 (filename, -- (gdb_byte **) &buffer, 1); -+ transferred = target_fileio_read_alloc_1 (filename, &buffer, 1); -+ bufstr = (char *) buffer; - - if (transferred < 0) - return NULL; -@@ -3554,11 +3556,11 @@ - if (transferred == 0) - return xstrdup (""); - -- buffer[transferred] = 0; -+ bufstr[transferred] = 0; - - /* Check for embedded NUL bytes; but allow trailing NULs. */ -- for (i = strlen (buffer); i < transferred; i++) -- if (buffer[i] != 0) -+ for (i = strlen (bufstr); i < transferred; i++) -+ if (bufstr[i] != 0) - { - warning (_("target file %s " - "contained unexpected null characters"), -@@ -3566,7 +3568,7 @@ - break; - } - -- return buffer; -+ return bufstr; - } - - diff --git a/gdb.spec b/gdb.spec index 759aec8..9f559fd 100644 --- a/gdb.spec +++ b/gdb.spec @@ -27,14 +27,14 @@ Summary: A GNU source-level debugger for C, C++, Fortran, Go and other languages Name: %{?scl_prefix}gdb -%global snap 20130310 +%global snap 20130323 # See timestamp of source gnulib installed into gdb/gnulib/ . %global snapgnulib 20121213 -Version: 7.5.50.20130310 +Version: 7.5.91.%{snap} # 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: 13%{?dist} +Release: 14%{?dist} License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain Group: Development/Debuggers @@ -261,7 +261,7 @@ Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch # Backported fixups post the source tarball. #Xdrop: Just backports. -Patch232: gdb-upstream.patch +#Patch232: gdb-upstream.patch # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). #=fedoratest+ppc @@ -497,6 +497,7 @@ Patch548: gdb-test-expr-cumulative-archer.patch Patch579: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch # Fix dlopen of libpthread.so, patched glibc required (Gary Benson, BZ 669432). +# Fix crash regression from the dlopen of libpthread.so fix (BZ 911712). #=push Patch718: gdb-dlopen-stap-probe-3of7.patch Patch719: gdb-dlopen-stap-probe-4of7.patch @@ -506,6 +507,7 @@ Patch722: gdb-dlopen-stap-probe-7of7.patch Patch619: gdb-dlopen-stap-probe-test.patch Patch723: gdb-dlopen-stap-probe-test2.patch Patch822: gdb-dlopen-stap-probe-mapfailed.patch +Patch827: gdb-dlopen-stap-probe-inhibit.patch # Work around PR libc/13097 "linux-vdso.so.1" warning message. #=push @@ -519,10 +521,6 @@ Patch634: gdb-runtest-pie-override.patch #=fedora Patch642: gdb-readline62-ask-more-rh.patch -# Enable smaller %{_bindir}/gdb in future by no longer using -rdynamic. -#=push -Patch643: gdb-python-rdynamic.patch - # Print reasons for failed attach/spawn incl. SELinux deny_ptrace (BZ 786878). #=push Patch653: gdb-attach-fail-reasons-5of5.patch @@ -557,11 +555,6 @@ Patch816: gdb-rhbz795424-bitpos-25of25.patch Patch817: gdb-rhbz795424-bitpos-25of25-test.patch Patch818: gdb-rhbz795424-bitpos-lazyvalue.patch -# Fix various entry-values sub-optimal results. -# =push -Patch825: gdb-entryval-1of2.patch -Patch826: gdb-entryval-2of2.patch - %if 0%{!?rhel:1} || 0%{?rhel} > 6 # RL_STATE_FEDORA_GDB would not be found for: # Patch642: gdb-readline62-ask-more-rh.patch @@ -765,7 +758,7 @@ find -name "*.info*"|xargs rm -f %patch2 -p1 %patch349 -p1 -%patch232 -p1 +#patch232 -p1 %patch1 -p1 %patch3 -p1 @@ -861,10 +854,10 @@ find -name "*.info*"|xargs rm -f %patch722 -p1 %patch723 -p1 %patch822 -p1 +%patch827 -p1 %patch619 -p1 %patch627 -p1 %patch634 -p1 -%patch643 -p1 %patch653 -p1 %patch657 -p1 %patch661 -p1 @@ -878,8 +871,6 @@ find -name "*.info*"|xargs rm -f %patch816 -p1 %patch817 -p1 %patch818 -p1 -%patch825 -p1 -%patch826 -p1 %patch393 -p1 %if 0%{!?el5:1} || 0%{?scl:1} @@ -1379,6 +1370,10 @@ fi %endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch" %changelog +* Sat Mar 23 2013 Jan Kratochvil - 7.5.91.20130323-14.fc19 +- Rebase to FSF GDB 7.5.91.20130310 (pre-7.6 snapshot). +- Fix crash regression from the dlopen of libpthread.so fix (BZ 911712). + * Mon Mar 11 2013 Jan Kratochvil - 7.5.50.20130310-13.fc19 - [RHEL-5] Import build regression fix. diff --git a/sources b/sources index e7a4c5c..d57c42a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ 4981307aa9619bbec5b73261e4e41c8d gdb-libstdc++-v3-python-r155978.tar.bz2 -d9769486fba1789e609685be0a383b88 gdb-7.5.50.20130310.tar.bz2 +e29dcaabf65847575f254944a298a009 gdb-7.5.91.20130323.tar.bz2