Rebase to FSF GDB 7.4.50.20120703.

- [archer-tromey-dwz-multifile-rebase] Merge new branch (Tom Tromey).
- [arm] <--with testsuite>: Disable fpc BuildRequires as it is not yet built.
- Revert function returning pointer fix (PR 9514) regressing Fedora errno patch.
This commit is contained in:
Jan Kratochvil 2012-07-03 20:54:05 +02:00
parent a9b4b48ee3
commit 11eae30806
24 changed files with 4871 additions and 3556 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
/libstdc++-v3-python-r155978.tar.bz2 /libstdc++-v3-python-r155978.tar.bz2
/gdb-7.4.50.20120603.tar.bz2 /gdb-7.4.50.20120703.tar.bz2

View File

@ -11,11 +11,11 @@
* gdb.texinfo (File Options): Document --readnever. * gdb.texinfo (File Options): Document --readnever.
Index: gdb-7.4.50.20120602/gdb/doc/gdb.texinfo Index: gdb-7.4.50.20120703/gdb/doc/gdb.texinfo
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/doc/gdb.texinfo 2012-06-02 18:16:36.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/doc/gdb.texinfo 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/doc/gdb.texinfo 2012-06-02 18:25:20.300254019 +0200 +++ gdb-7.4.50.20120703/gdb/doc/gdb.texinfo 2012-07-03 17:31:40.695642449 +0200
@@ -1020,6 +1020,12 @@ Read each symbol file's entire symbol ta @@ -1023,6 +1023,12 @@ Read each symbol file's entire symbol ta
the default, which is to read it incrementally as it is needed. the default, which is to read it incrementally as it is needed.
This makes startup slower, but makes future operations faster. This makes startup slower, but makes future operations faster.
@ -28,10 +28,10 @@ Index: gdb-7.4.50.20120602/gdb/doc/gdb.texinfo
@end table @end table
@node Mode Options @node Mode Options
Index: gdb-7.4.50.20120602/gdb/main.c Index: gdb-7.4.50.20120703/gdb/main.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/main.c 2012-06-02 18:16:36.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/main.c 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/main.c 2012-06-02 18:25:20.302254019 +0200 +++ gdb-7.4.50.20120703/gdb/main.c 2012-07-03 17:31:40.696642448 +0200
@@ -414,6 +414,7 @@ captured_main (void *data) @@ -414,6 +414,7 @@ captured_main (void *data)
{"xdb", no_argument, &xdb_commands, 1}, {"xdb", no_argument, &xdb_commands, 1},
{"dbx", no_argument, &dbx_commands, 1}, {"dbx", no_argument, &dbx_commands, 1},
@ -48,11 +48,11 @@ Index: gdb-7.4.50.20120602/gdb/main.c
"), stream); "), stream);
fputs_unfiltered (_("\ fputs_unfiltered (_("\
--se=FILE Use FILE as symbol file and executable file.\n\ --se=FILE Use FILE as symbol file and executable file.\n\
Index: gdb-7.4.50.20120602/gdb/symfile.c Index: gdb-7.4.50.20120703/gdb/symfile.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/symfile.c 2012-05-31 20:44:49.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/symfile.c 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/symfile.c 2012-06-02 18:25:20.334254013 +0200 +++ gdb-7.4.50.20120703/gdb/symfile.c 2012-07-03 17:31:40.697642447 +0200
@@ -80,6 +80,7 @@ static void clear_symtab_users_cleanup ( @@ -81,6 +81,7 @@ static void clear_symtab_users_cleanup (
/* Global variables owned by this file. */ /* Global variables owned by this file. */
int readnow_symbol_files; /* Read full symbols immediately. */ int readnow_symbol_files; /* Read full symbols immediately. */
@ -60,19 +60,19 @@ Index: gdb-7.4.50.20120602/gdb/symfile.c
/* External variables and functions referenced. */ /* External variables and functions referenced. */
Index: gdb-7.4.50.20120602/gdb/dwarf2read.c Index: gdb-7.4.50.20120703/gdb/dwarf2read.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/dwarf2read.c 2012-06-02 18:16:36.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/dwarf2read.c 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/dwarf2read.c 2012-06-02 18:25:32.837250535 +0200 +++ gdb-7.4.50.20120703/gdb/dwarf2read.c 2012-07-03 17:31:53.421627153 +0200
@@ -63,6 +63,7 @@ @@ -65,6 +65,7 @@
#include "valprint.h" #include "gdb/gdb-index.h"
#include "gdbcore.h" /* for gnutarget */
#include <ctype.h> #include <ctype.h>
#include "gdb_bfd.h"
+#include "top.h" +#include "top.h"
#include <fcntl.h> #include <fcntl.h>
#include "gdb_string.h" #include "gdb_string.h"
@@ -1514,8 +1515,9 @@ dwarf2_has_info (struct objfile *objfile @@ -1587,8 +1588,9 @@ dwarf2_has_info (struct objfile *objfile
(void *) names); (void *) names);
dwarf2_per_objfile->objfile = objfile; dwarf2_per_objfile->objfile = objfile;
} }
@ -84,10 +84,10 @@ Index: gdb-7.4.50.20120602/gdb/dwarf2read.c
} }
/* When loading sections, we look either for uncompressed section or for /* When loading sections, we look either for uncompressed section or for
Index: gdb-7.4.50.20120602/gdb/top.h Index: gdb-7.4.50.20120703/gdb/top.h
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/top.h 2012-01-23 18:12:30.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/top.h 2012-01-23 18:12:30.000000000 +0100
+++ gdb-7.4.50.20120602/gdb/top.h 2012-06-02 18:25:20.367254001 +0200 +++ gdb-7.4.50.20120703/gdb/top.h 2012-07-03 17:31:40.700642444 +0200
@@ -60,6 +60,7 @@ extern void set_prompt (const char *s); @@ -60,6 +60,7 @@ extern void set_prompt (const char *s);
/* From random places. */ /* From random places. */

View File

@ -23,10 +23,10 @@ instead.
Port to GDB-6.7. Port to GDB-6.7.
Index: gdb-7.4.50.20120602/gdb/amd64-linux-tdep.c Index: gdb-7.4.50.20120703/gdb/amd64-linux-tdep.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/amd64-linux-tdep.c 2012-06-02 21:05:45.352280128 +0200 --- gdb-7.4.50.20120703.orig/gdb/amd64-linux-tdep.c 2012-06-13 22:36:48.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/amd64-linux-tdep.c 2012-06-02 21:06:25.536265325 +0200 +++ gdb-7.4.50.20120703/gdb/amd64-linux-tdep.c 2012-07-03 17:32:46.547563363 +0200
@@ -271,6 +271,80 @@ amd64_linux_register_reggroup_p (struct @@ -271,6 +271,80 @@ amd64_linux_register_reggroup_p (struct
/* Set the program counter for process PTID to PC. */ /* Set the program counter for process PTID to PC. */
@ -108,20 +108,20 @@ Index: gdb-7.4.50.20120602/gdb/amd64-linux-tdep.c
static void static void
amd64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc) amd64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc)
{ {
@@ -1330,6 +1404,8 @@ amd64_linux_init_abi (struct gdbarch_inf @@ -1547,6 +1621,8 @@ amd64_linux_init_abi (struct gdbarch_inf
tdep->xsave_xcr0_offset = I386_LINUX_XSAVE_XCR0_OFFSET; amd64_linux_init_abi_common (info, gdbarch);
+ tdep->outermost_frame_p = amd64_linux_outermost_frame; + tdep->outermost_frame_p = amd64_linux_outermost_frame;
+ +
/* GNU/Linux uses SVR4-style shared libraries. */ /* GNU/Linux uses SVR4-style shared libraries. */
set_solib_svr4_fetch_link_map_offsets set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_lp64_fetch_link_map_offsets); (gdbarch, svr4_lp64_fetch_link_map_offsets);
Index: gdb-7.4.50.20120602/gdb/amd64-tdep.c Index: gdb-7.4.50.20120703/gdb/amd64-tdep.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/amd64-tdep.c 2012-06-02 21:05:45.352280128 +0200 --- gdb-7.4.50.20120703.orig/gdb/amd64-tdep.c 2012-06-16 17:20:22.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/amd64-tdep.c 2012-06-02 21:06:00.437274574 +0200 +++ gdb-7.4.50.20120703/gdb/amd64-tdep.c 2012-07-03 17:32:12.335604415 +0200
@@ -2138,6 +2138,7 @@ amd64_frame_unwind_stop_reason (struct f @@ -2324,6 +2324,7 @@ amd64_frame_unwind_stop_reason (struct f
{ {
struct amd64_frame_cache *cache = struct amd64_frame_cache *cache =
amd64_frame_cache (this_frame, this_cache); amd64_frame_cache (this_frame, this_cache);
@ -129,7 +129,7 @@ Index: gdb-7.4.50.20120602/gdb/amd64-tdep.c
if (!cache->base_p) if (!cache->base_p)
return UNWIND_UNAVAILABLE; return UNWIND_UNAVAILABLE;
@@ -2146,6 +2147,10 @@ amd64_frame_unwind_stop_reason (struct f @@ -2332,6 +2333,10 @@ amd64_frame_unwind_stop_reason (struct f
if (cache->base == 0) if (cache->base == 0)
return UNWIND_OUTERMOST; return UNWIND_OUTERMOST;
@ -140,7 +140,7 @@ Index: gdb-7.4.50.20120602/gdb/amd64-tdep.c
return UNWIND_NO_REASON; return UNWIND_NO_REASON;
} }
@@ -2155,6 +2160,7 @@ amd64_frame_this_id (struct frame_info * @@ -2341,6 +2346,7 @@ amd64_frame_this_id (struct frame_info *
{ {
struct amd64_frame_cache *cache = struct amd64_frame_cache *cache =
amd64_frame_cache (this_frame, this_cache); amd64_frame_cache (this_frame, this_cache);
@ -148,7 +148,7 @@ Index: gdb-7.4.50.20120602/gdb/amd64-tdep.c
if (!cache->base_p) if (!cache->base_p)
return; return;
@@ -2163,6 +2169,10 @@ amd64_frame_this_id (struct frame_info * @@ -2349,6 +2355,10 @@ amd64_frame_this_id (struct frame_info *
if (cache->base == 0) if (cache->base == 0)
return; return;
@ -159,11 +159,11 @@ Index: gdb-7.4.50.20120602/gdb/amd64-tdep.c
(*this_id) = frame_id_build (cache->base + 16, cache->pc); (*this_id) = frame_id_build (cache->base + 16, cache->pc);
} }
Index: gdb-7.4.50.20120602/gdb/i386-tdep.c Index: gdb-7.4.50.20120703/gdb/i386-tdep.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/i386-tdep.c 2012-06-02 21:05:45.352280128 +0200 --- gdb-7.4.50.20120703.orig/gdb/i386-tdep.c 2012-06-18 19:31:34.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/i386-tdep.c 2012-06-02 21:06:00.466274562 +0200 +++ gdb-7.4.50.20120703/gdb/i386-tdep.c 2012-07-03 17:32:12.339604409 +0200
@@ -7639,6 +7639,9 @@ i386_gdbarch_init (struct gdbarch_info i @@ -7655,6 +7655,9 @@ i386_gdbarch_init (struct gdbarch_info i
tdep->xsave_xcr0_offset = -1; tdep->xsave_xcr0_offset = -1;
@ -173,10 +173,10 @@ Index: gdb-7.4.50.20120602/gdb/i386-tdep.c
tdep->record_regmap = i386_record_regmap; tdep->record_regmap = i386_record_regmap;
set_gdbarch_long_long_align_bit (gdbarch, 32); set_gdbarch_long_long_align_bit (gdbarch, 32);
Index: gdb-7.4.50.20120602/gdb/i386-tdep.h Index: gdb-7.4.50.20120703/gdb/i386-tdep.h
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/i386-tdep.h 2012-06-02 21:05:45.352280128 +0200 --- gdb-7.4.50.20120703.orig/gdb/i386-tdep.h 2012-06-13 22:29:15.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/i386-tdep.h 2012-06-02 21:06:00.486274568 +0200 +++ gdb-7.4.50.20120703/gdb/i386-tdep.h 2012-07-03 17:32:12.340604408 +0200
@@ -219,6 +219,9 @@ struct gdbarch_tdep @@ -219,6 +219,9 @@ struct gdbarch_tdep
int (*i386_sysenter_record) (struct regcache *regcache); int (*i386_sysenter_record) (struct regcache *regcache);
/* Parse syscall args. */ /* Parse syscall args. */
@ -187,10 +187,10 @@ Index: gdb-7.4.50.20120602/gdb/i386-tdep.h
}; };
/* Floating-point registers. */ /* Floating-point registers. */
Index: gdb-7.4.50.20120602/gdb/ia64-tdep.c Index: gdb-7.4.50.20120703/gdb/ia64-tdep.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/ia64-tdep.c 2012-06-02 21:05:45.352280128 +0200 --- gdb-7.4.50.20120703.orig/gdb/ia64-tdep.c 2012-07-03 17:30:09.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/ia64-tdep.c 2012-06-02 21:06:00.490274552 +0200 +++ gdb-7.4.50.20120703/gdb/ia64-tdep.c 2012-07-03 17:32:12.343604405 +0200
@@ -2176,6 +2176,138 @@ static const struct frame_unwind ia64_fr @@ -2176,6 +2176,138 @@ static const struct frame_unwind ia64_fr
default_frame_sniffer default_frame_sniffer
}; };
@ -338,10 +338,10 @@ Index: gdb-7.4.50.20120602/gdb/ia64-tdep.c
#ifdef HAVE_LIBUNWIND_IA64_H #ifdef HAVE_LIBUNWIND_IA64_H
frame_unwind_append_unwinder (gdbarch, frame_unwind_append_unwinder (gdbarch,
&ia64_libunwind_sigtramp_frame_unwind); &ia64_libunwind_sigtramp_frame_unwind);
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/bt-clone-stop.c Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/bt-clone-stop.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/bt-clone-stop.c 2012-06-02 21:06:00.514274544 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/bt-clone-stop.c 2012-07-03 17:32:12.344604404 +0200
@@ -0,0 +1,39 @@ @@ -0,0 +1,39 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -382,10 +382,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/bt-clone-stop.c
+ for (;;) + for (;;)
+ pause(); + pause();
+} +}
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/bt-clone-stop.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/bt-clone-stop.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/bt-clone-stop.exp 2012-06-02 21:06:00.515274547 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/bt-clone-stop.exp 2012-07-03 17:32:12.344604404 +0200
@@ -0,0 +1,61 @@ @@ -0,0 +1,61 @@
+# Copyright 2006 Free Software Foundation, Inc. +# Copyright 2006 Free Software Foundation, Inc.
+ +

View File

@ -58,10 +58,10 @@ Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html
* exec.c (exec_file_attach): Print a more useful error message if the * exec.c (exec_file_attach): Print a more useful error message if the
user did "gdb core". user did "gdb core".
Index: gdb-7.4.50.20120602/gdb/exceptions.h Index: gdb-7.4.50.20120703/gdb/exceptions.h
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/exceptions.h 2012-01-04 09:17:01.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/exceptions.h 2012-01-04 09:17:01.000000000 +0100
+++ gdb-7.4.50.20120602/gdb/exceptions.h 2012-06-02 19:59:22.195114052 +0200 +++ gdb-7.4.50.20120703/gdb/exceptions.h 2012-07-03 17:36:27.840297264 +0200
@@ -86,6 +86,9 @@ enum errors { @@ -86,6 +86,9 @@ enum errors {
/* DW_OP_GNU_entry_value resolving failed. */ /* DW_OP_GNU_entry_value resolving failed. */
NO_ENTRY_VALUE_ERROR, NO_ENTRY_VALUE_ERROR,
@ -72,19 +72,19 @@ Index: gdb-7.4.50.20120602/gdb/exceptions.h
/* Add more errors here. */ /* Add more errors here. */
NR_ERRORS NR_ERRORS
}; };
Index: gdb-7.4.50.20120602/gdb/exec.c Index: gdb-7.4.50.20120703/gdb/exec.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/exec.c 2012-05-29 16:23:39.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/exec.c 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/exec.c 2012-06-02 19:59:22.196114052 +0200 +++ gdb-7.4.50.20120703/gdb/exec.c 2012-07-03 17:37:27.777225175 +0200
@@ -33,6 +33,7 @@ @@ -34,6 +34,7 @@
#include "arch-utils.h"
#include "gdbthread.h" #include "gdbthread.h"
#include "progspace.h" #include "progspace.h"
#include "gdb_bfd.h"
+#include "exceptions.h" +#include "exceptions.h"
#include <fcntl.h> #include <fcntl.h>
#include "readline/readline.h" #include "readline/readline.h"
@@ -251,12 +252,27 @@ exec_file_attach (char *filename, int fr @@ -245,12 +246,27 @@ exec_file_attach (char *filename, int fr
if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching)) if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
{ {
@ -114,11 +114,11 @@ Index: gdb-7.4.50.20120602/gdb/exec.c
+ gdb_bfd_errmsg (bfd_get_error (), matching)); + gdb_bfd_errmsg (bfd_get_error (), matching));
} }
/* FIXME - This should only be run for RS6000, but the ifdef is a poor gdb_bfd_stash_filename (exec_bfd);
Index: gdb-7.4.50.20120602/gdb/main.c Index: gdb-7.4.50.20120703/gdb/main.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/main.c 2012-06-02 19:11:55.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/main.c 2012-07-03 17:31:40.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/main.c 2012-06-02 19:59:42.082107499 +0200 +++ gdb-7.4.50.20120703/gdb/main.c 2012-07-03 17:36:27.843297261 +0200
@@ -266,6 +266,36 @@ typedef struct cmdarg { @@ -266,6 +266,36 @@ typedef struct cmdarg {
/* Define type VEC (cmdarg_s). */ /* Define type VEC (cmdarg_s). */
DEF_VEC_O (cmdarg_s); DEF_VEC_O (cmdarg_s);

View File

@ -1,18 +1,18 @@
Index: gdb-7.4.50.20120602/gdb/corelow.c Index: gdb-7.4.50.20120703/gdb/corelow.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/corelow.c 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.50.20120703.orig/gdb/corelow.c 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/corelow.c 2012-06-02 21:07:16.464246569 +0200 +++ gdb-7.4.50.20120703/gdb/corelow.c 2012-07-03 17:33:27.882513714 +0200
@@ -46,6 +46,9 @@ @@ -47,6 +47,9 @@
#include "filenames.h"
#include "progspace.h" #include "progspace.h"
#include "objfiles.h" #include "objfiles.h"
#include "gdb_bfd.h"
+#include "auxv.h" +#include "auxv.h"
+#include "elf/common.h" +#include "elf/common.h"
+#include "gdbcmd.h" +#include "gdbcmd.h"
#ifndef O_LARGEFILE #ifndef O_LARGEFILE
#define O_LARGEFILE 0 #define O_LARGEFILE 0
@@ -275,6 +278,52 @@ add_to_thread_list (bfd *abfd, asection @@ -274,6 +277,52 @@ add_to_thread_list (bfd *abfd, asection
inferior_ptid = ptid; /* Yes, make it current. */ inferior_ptid = ptid; /* Yes, make it current. */
} }
@ -65,7 +65,7 @@ Index: gdb-7.4.50.20120602/gdb/corelow.c
/* This routine opens and sets up the core file bfd. */ /* This routine opens and sets up the core file bfd. */
static void static void
@@ -377,6 +426,12 @@ core_open (char *filename, int from_tty) @@ -378,6 +427,12 @@ core_open (char *filename, int from_tty)
push_target (&core_ops); push_target (&core_ops);
discard_cleanups (old_chain); discard_cleanups (old_chain);
@ -78,7 +78,7 @@ Index: gdb-7.4.50.20120602/gdb/corelow.c
/* Do this before acknowledging the inferior, so if /* Do this before acknowledging the inferior, so if
post_create_inferior throws (can happen easilly if you're loading post_create_inferior throws (can happen easilly if you're loading
a core file with the wrong exec), we aren't left with threads a core file with the wrong exec), we aren't left with threads
@@ -935,4 +990,11 @@ _initialize_corelow (void) @@ -941,4 +996,11 @@ _initialize_corelow (void)
init_core_ops (); init_core_ops ();
add_target (&core_ops); add_target (&core_ops);
@ -90,11 +90,11 @@ Index: gdb-7.4.50.20120602/gdb/corelow.c
+ NULL, NULL, NULL, + NULL, NULL, NULL,
+ &setlist, &showlist); + &setlist, &showlist);
} }
Index: gdb-7.4.50.20120602/gdb/doc/gdb.texinfo Index: gdb-7.4.50.20120703/gdb/doc/gdb.texinfo
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/doc/gdb.texinfo 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.50.20120703.orig/gdb/doc/gdb.texinfo 2012-07-03 17:31:40.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/doc/gdb.texinfo 2012-06-02 21:07:16.480246563 +0200 +++ gdb-7.4.50.20120703/gdb/doc/gdb.texinfo 2012-07-03 17:33:14.630529528 +0200
@@ -16502,6 +16502,27 @@ information files. @@ -16530,6 +16530,27 @@ information files.
@end table @end table
@ -122,10 +122,10 @@ Index: gdb-7.4.50.20120602/gdb/doc/gdb.texinfo
@cindex @code{.gnu_debuglink} sections @cindex @code{.gnu_debuglink} sections
@cindex debug link sections @cindex debug link sections
A debug link is a special section of the executable file named A debug link is a special section of the executable file named
Index: gdb-7.4.50.20120602/gdb/solib-svr4.c Index: gdb-7.4.50.20120703/gdb/solib-svr4.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/solib-svr4.c 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.50.20120703.orig/gdb/solib-svr4.c 2012-06-05 17:44:03.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/solib-svr4.c 2012-06-02 21:07:16.510246552 +0200 +++ gdb-7.4.50.20120703/gdb/solib-svr4.c 2012-07-03 17:33:14.631529527 +0200
@@ -1227,9 +1227,52 @@ svr4_read_so_list (CORE_ADDR lm, struct @@ -1227,9 +1227,52 @@ svr4_read_so_list (CORE_ADDR lm, struct
continue; continue;
} }
@ -182,14 +182,14 @@ Index: gdb-7.4.50.20120602/gdb/solib-svr4.c
xfree (buffer); xfree (buffer);
/* If this entry has no name, or its name matches the name /* If this entry has no name, or its name matches the name
Index: gdb-7.4.50.20120602/gdb/elfread.c Index: gdb-7.4.50.20120703/gdb/elfread.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/elfread.c 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.50.20120703.orig/gdb/elfread.c 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/elfread.c 2012-06-02 21:07:56.264232049 +0200 +++ gdb-7.4.50.20120703/gdb/elfread.c 2012-07-03 17:34:04.778468965 +0200
@@ -44,6 +44,11 @@ @@ -45,6 +45,11 @@
#include "gdbthread.h"
#include "regcache.h" #include "regcache.h"
#include "bcache.h" #include "bcache.h"
#include "gdb_bfd.h"
+#include "libbfd.h" +#include "libbfd.h"
+#include "gdbcore.h" +#include "gdbcore.h"
+#include "gdbcmd.h" +#include "gdbcmd.h"
@ -198,7 +198,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
extern void _initialize_elfread (void); extern void _initialize_elfread (void);
@@ -1072,16 +1077,65 @@ elf_gnu_ifunc_resolver_return_stop (stru @@ -1074,16 +1079,65 @@ elf_gnu_ifunc_resolver_return_stop (stru
update_breakpoint_locations (b, sals, sals_end); update_breakpoint_locations (b, sals, sals_end);
} }
@ -266,7 +266,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
{ {
struct build_id *retval; struct build_id *retval;
@@ -1097,6 +1151,348 @@ build_id_bfd_get (bfd *abfd) @@ -1099,6 +1153,348 @@ build_id_bfd_get (bfd *abfd)
return retval; return retval;
} }
@ -615,7 +615,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
/* Return if FILENAME has NT_GNU_BUILD_ID matching the CHECK value. */ /* Return if FILENAME has NT_GNU_BUILD_ID matching the CHECK value. */
static int static int
@@ -1111,7 +1507,7 @@ build_id_verify (const char *filename, s @@ -1113,7 +1509,7 @@ build_id_verify (const char *filename, s
if (abfd == NULL) if (abfd == NULL)
return 0; return 0;
@ -624,7 +624,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
if (found == NULL) if (found == NULL)
warning (_("File \"%s\" has no build-id, file skipped"), filename); warning (_("File \"%s\" has no build-id, file skipped"), filename);
@@ -1129,17 +1525,18 @@ build_id_verify (const char *filename, s @@ -1131,17 +1527,18 @@ build_id_verify (const char *filename, s
return retval; return retval;
} }
@ -647,7 +647,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
/* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will
cause "/.build-id/..." lookups. */ cause "/.build-id/..." lookups. */
@@ -1152,6 +1549,8 @@ build_id_to_debug_filename (struct build @@ -1154,6 +1551,8 @@ build_id_to_debug_filename (struct build
size_t debugdir_len = strlen (debugdir); size_t debugdir_len = strlen (debugdir);
gdb_byte *data = build_id->data; gdb_byte *data = build_id->data;
size_t size = build_id->size; size_t size = build_id->size;
@ -656,7 +656,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
char *s; char *s;
memcpy (link, debugdir, debugdir_len); memcpy (link, debugdir, debugdir_len);
@@ -1166,37 +1565,240 @@ build_id_to_debug_filename (struct build @@ -1168,37 +1567,240 @@ build_id_to_debug_filename (struct build
*s++ = '/'; *s++ = '/';
while (size-- > 0) while (size-- > 0)
s += sprintf (s, "%02x", (unsigned) *data++); s += sprintf (s, "%02x", (unsigned) *data++);
@ -908,7 +908,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
xfree (build_id); xfree (build_id);
/* Prevent looping on a stripped .debug file. */ /* Prevent looping on a stripped .debug file. */
if (build_id_name != NULL if (build_id_name != NULL
@@ -1207,7 +1809,7 @@ find_separate_debug_file_by_buildid (str @@ -1209,7 +1811,7 @@ find_separate_debug_file_by_buildid (str
xfree (build_id_name); xfree (build_id_name);
} }
else if (build_id_name != NULL) else if (build_id_name != NULL)
@ -917,7 +917,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
} }
return NULL; return NULL;
} }
@@ -1427,9 +2029,10 @@ elf_symfile_read (struct objfile *objfil @@ -1436,9 +2038,10 @@ elf_symfile_read (struct objfile *objfil
`.note.gnu.build-id'. */ `.note.gnu.build-id'. */
else if (!objfile_has_partial_symbols (objfile)) else if (!objfile_has_partial_symbols (objfile))
{ {
@ -930,7 +930,7 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
if (debugfile == NULL) if (debugfile == NULL)
debugfile = find_separate_debug_file_by_debuglink (objfile); debugfile = find_separate_debug_file_by_debuglink (objfile);
@@ -1441,6 +2044,12 @@ elf_symfile_read (struct objfile *objfil @@ -1450,6 +2053,12 @@ elf_symfile_read (struct objfile *objfil
symbol_file_add_separate (abfd, symfile_flags, objfile); symbol_file_add_separate (abfd, symfile_flags, objfile);
xfree (debugfile); xfree (debugfile);
} }
@ -941,9 +941,9 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
+ +
+ xfree (build_id_filename); + xfree (build_id_filename);
} }
}
@@ -1770,4 +2379,16 @@ _initialize_elfread (void) if (symtab_create_debug)
@@ -1782,4 +2391,16 @@ _initialize_elfread (void)
elf_objfile_gnu_ifunc_cache_data = register_objfile_data (); elf_objfile_gnu_ifunc_cache_data = register_objfile_data ();
gnu_ifunc_fns_p = &elf_gnu_ifunc_fns; gnu_ifunc_fns_p = &elf_gnu_ifunc_fns;
@ -960,10 +960,10 @@ Index: gdb-7.4.50.20120602/gdb/elfread.c
+ +
+ observer_attach_executable_changed (debug_print_executable_changed); + observer_attach_executable_changed (debug_print_executable_changed);
} }
Index: gdb-7.4.50.20120602/gdb/symfile.h Index: gdb-7.4.50.20120703/gdb/symfile.h
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/symfile.h 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.50.20120703.orig/gdb/symfile.h 2012-05-25 00:14:35.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/symfile.h 2012-06-02 21:07:16.524246547 +0200 +++ gdb-7.4.50.20120703/gdb/symfile.h 2012-07-03 17:33:14.632529526 +0200
@@ -615,6 +615,13 @@ void free_symfile_segment_data (struct s @@ -615,6 +615,13 @@ void free_symfile_segment_data (struct s
extern struct cleanup *increment_reading_symtab (void); extern struct cleanup *increment_reading_symtab (void);
@ -978,10 +978,10 @@ Index: gdb-7.4.50.20120602/gdb/symfile.h
/* From dwarf2read.c */ /* From dwarf2read.c */
/* Names for a dwarf2 debugging section. The field NORMAL is the normal /* Names for a dwarf2 debugging section. The field NORMAL is the normal
Index: gdb-7.4.50.20120602/gdb/testsuite/lib/gdb.exp Index: gdb-7.4.50.20120703/gdb/testsuite/lib/gdb.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/testsuite/lib/gdb.exp 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.50.20120703.orig/gdb/testsuite/lib/gdb.exp 2012-07-03 17:30:09.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/testsuite/lib/gdb.exp 2012-06-02 21:07:16.526246546 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/lib/gdb.exp 2012-07-03 17:33:14.633529524 +0200
@@ -1388,6 +1388,16 @@ proc default_gdb_start { } { @@ -1388,6 +1388,16 @@ proc default_gdb_start { } {
warning "Couldn't set the width to 0." warning "Couldn't set the width to 0."
} }
@ -999,10 +999,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/lib/gdb.exp
return 0; return 0;
} }
Index: gdb-7.4.50.20120602/gdb/testsuite/lib/mi-support.exp Index: gdb-7.4.50.20120703/gdb/testsuite/lib/mi-support.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/testsuite/lib/mi-support.exp 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.50.20120703.orig/gdb/testsuite/lib/mi-support.exp 2012-04-14 14:18:44.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/testsuite/lib/mi-support.exp 2012-06-02 21:07:16.535246544 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/lib/mi-support.exp 2012-07-03 17:33:14.633529524 +0200
@@ -213,6 +213,16 @@ proc default_mi_gdb_start { args } { @@ -213,6 +213,16 @@ proc default_mi_gdb_start { args } {
warning "Couldn't set the width to 0." warning "Couldn't set the width to 0."
} }
@ -1020,10 +1020,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/lib/mi-support.exp
# If allowing the inferior to have its own PTY then assign the inferior # If allowing the inferior to have its own PTY then assign the inferior
# its own terminal device here. # its own terminal device here.
if { $separate_inferior_pty } { if { $separate_inferior_pty } {
Index: gdb-7.4.50.20120602/gdb/objfiles.h Index: gdb-7.4.50.20120703/gdb/objfiles.h
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/objfiles.h 2012-06-02 21:07:03.695251272 +0200 --- gdb-7.4.50.20120703.orig/gdb/objfiles.h 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/objfiles.h 2012-06-02 21:07:16.539246541 +0200 +++ gdb-7.4.50.20120703/gdb/objfiles.h 2012-07-03 17:33:14.633529524 +0200
@@ -432,6 +432,10 @@ struct objfile @@ -432,6 +432,10 @@ struct objfile
#define OBJF_MAINLINE (1 << 5) #define OBJF_MAINLINE (1 << 5)

View File

@ -1,8 +1,8 @@
Index: gdb-7.3.50.20110722/gdb/infrun.c Index: gdb-7.4.50.20120703/gdb/infrun.c
=================================================================== ===================================================================
--- gdb-7.3.50.20110722.orig/gdb/infrun.c 2011-07-22 19:12:56.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/infrun.c 2012-07-03 20:26:25.060940765 +0200
+++ gdb-7.3.50.20110722/gdb/infrun.c 2011-07-22 19:17:06.000000000 +0200 +++ gdb-7.4.50.20120703/gdb/infrun.c 2012-07-03 20:26:32.808929860 +0200
@@ -1549,7 +1549,7 @@ static const char *scheduler_enums[] = { @@ -1591,7 +1591,7 @@ static const char *const scheduler_enums
schedlock_step, schedlock_step,
NULL NULL
}; };
@ -11,11 +11,11 @@ Index: gdb-7.3.50.20110722/gdb/infrun.c
static void static void
show_scheduler_mode (struct ui_file *file, int from_tty, show_scheduler_mode (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value) struct cmd_list_element *c, const char *value)
Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-console.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-console.exp
=================================================================== ===================================================================
--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.mi/mi-console.exp 2011-01-01 16:33:47.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi-console.exp 2012-07-03 20:26:25.060940765 +0200
+++ gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-console.exp 2011-07-22 19:17:06.000000000 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-console.exp 2012-07-03 20:26:32.809929858 +0200
@@ -47,6 +47,9 @@ if { [gdb_compile "${srcdir}/${subdir}/ @@ -46,6 +46,9 @@ if { [gdb_compile "${srcdir}/${subdir}/
mi_run_to_main mi_run_to_main
@ -25,11 +25,11 @@ Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-console.exp
# Next over the hello() call which will produce lots of output # Next over the hello() call which will produce lots of output
mi_gdb_test "220-exec-next" \ mi_gdb_test "220-exec-next" \
"220\\^running(\r\n\\*running,thread-id=\"all\")?" \ "220\\^running(\r\n\\*running,thread-id=\"all\")?" \
Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi2-console.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi2-console.exp
=================================================================== ===================================================================
--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.mi/mi2-console.exp 2011-06-23 11:40:50.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi2-console.exp 2012-07-03 20:26:25.060940765 +0200
+++ gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi2-console.exp 2011-07-22 19:17:27.000000000 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi2-console.exp 2012-07-03 20:26:32.809929858 +0200
@@ -47,6 +47,9 @@ if { [gdb_compile "${srcdir}/${subdir}/ @@ -46,6 +46,9 @@ if { [gdb_compile "${srcdir}/${subdir}/
mi_run_to_main mi_run_to_main
@ -39,11 +39,11 @@ Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi2-console.exp
# Next over the hello() call which will produce lots of output # Next over the hello() call which will produce lots of output
mi_gdb_test "220-exec-next" "220\\^running(\r\n)?(\\*running,thread-id=\"all\")?" \ mi_gdb_test "220-exec-next" "220\\^running(\r\n)?(\\*running,thread-id=\"all\")?" \
"Started step over hello" "Started step over hello"
Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-cli.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-cli.exp
=================================================================== ===================================================================
--- gdb-7.3.50.20110722.orig/gdb/testsuite/gdb.mi/mi-cli.exp 2011-04-27 12:17:38.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi-cli.exp 2012-07-03 20:26:25.060940765 +0200
+++ gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-cli.exp 2011-07-22 19:17:06.000000000 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-cli.exp 2012-07-03 20:26:32.810929856 +0200
@@ -176,7 +176,7 @@ mi_execute_to "exec-continue" "breakpoin @@ -175,7 +175,7 @@ mi_execute_to "exec-continue" "breakpoin
# Test that the token is output even for CLI commands # Test that the token is output even for CLI commands
# Also test that *stopped includes frame information. # Also test that *stopped includes frame information.
mi_gdb_test "34 next" \ mi_gdb_test "34 next" \
@ -52,3 +52,25 @@ Index: gdb-7.3.50.20110722/gdb/testsuite/gdb.mi/mi-cli.exp
"34 next: run" "34 next: run"
if {!$async} { if {!$async} {
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-logging.exp
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.mi/mi-logging.exp 2012-06-29 00:11:23.000000000 +0200
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.mi/mi-logging.exp 2012-07-03 20:29:03.573717651 +0200
@@ -56,7 +56,7 @@ close $chan
set mi_log_prompt "\[(\]gdb\[)\] \[\r\n\]+"
-if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
+if [regexp "\\^done\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
pass "Log file contents"
} else {
fail "Log file contents"
@@ -79,7 +79,7 @@ set chan [open $milogfile]
set logcontent [read $chan]
close $chan
-if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"all\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
+if [regexp "1001\\^done\[\r\n\]+$mi_log_prompt.*1002\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt.*1003\\^running\[\r\n\]+\\*running,thread-id=\"1\"\[\r\n\]+$mi_log_prompt\\*stopped,reason=\"end-stepping-range\",.*\[\r\n\]+$mi_log_prompt" $logcontent] {
pass "Redirect log file contents"
} else {
fail "Redirect log file contents"

View File

@ -1,7 +1,7 @@
Index: gdb-7.4.50.20120602/gdb/linux-nat.c Index: gdb-7.4.50.20120703/gdb/linux-nat.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/linux-nat.c 2012-06-02 20:51:58.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/linux-nat.c 2012-07-03 17:46:55.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/linux-nat.c 2012-06-02 20:54:30.127529159 +0200 +++ gdb-7.4.50.20120703/gdb/linux-nat.c 2012-07-03 17:57:29.608734933 +0200
@@ -180,6 +180,9 @@ blocked. */ @@ -180,6 +180,9 @@ blocked. */
static struct target_ops *linux_ops; static struct target_ops *linux_ops;
static struct target_ops linux_ops_saved; static struct target_ops linux_ops_saved;
@ -55,8 +55,8 @@ Index: gdb-7.4.50.20120602/gdb/linux-nat.c
} }
/* Resume LP. */ /* Resume LP. */
@@ -2083,6 +2099,14 @@ linux_nat_resume (struct target_ops *ops @@ -2104,6 +2120,14 @@ linux_nat_resume (struct target_ops *ops
resume_callback. */ linux_nat_resume_callback. */
lp->stopped = 0; lp->stopped = 0;
+ /* At this point, we are going to resume the inferior and if we + /* At this point, we are going to resume the inferior and if we
@ -68,9 +68,9 @@ Index: gdb-7.4.50.20120602/gdb/linux-nat.c
+ pid_was_stopped = 0; + pid_was_stopped = 0;
+ +
if (resume_many) if (resume_many)
iterate_over_lwps (ptid, resume_callback, NULL); iterate_over_lwps (ptid, linux_nat_resume_callback, NULL);
@@ -4132,6 +4156,8 @@ linux_nat_mourn_inferior (struct target_ @@ -4129,6 +4153,8 @@ linux_nat_mourn_inferior (struct target_
there are other viable forks to debug. Delete the exiting there are other viable forks to debug. Delete the exiting
one and context-switch to the first available. */ one and context-switch to the first available. */
linux_fork_mourn_inferior (); linux_fork_mourn_inferior ();
@ -79,11 +79,11 @@ Index: gdb-7.4.50.20120602/gdb/linux-nat.c
} }
/* Convert a native/host siginfo object, into/from the siginfo in the /* Convert a native/host siginfo object, into/from the siginfo in the
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/attach-stopped.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/attach-stopped.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2012-01-04 09:27:55.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2012-06-26 21:23:20.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/attach-stopped.exp 2012-06-02 20:52:08.893505403 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/attach-stopped.exp 2012-07-03 17:56:43.797790120 +0200
@@ -63,7 +63,65 @@ proc corefunc { threadtype } { @@ -61,7 +61,65 @@ proc corefunc { threadtype } {
gdb_reinitialize_dir $srcdir/$subdir gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile} gdb_load ${binfile}

View File

@ -1,8 +1,8 @@
Index: gdb-7.3.50.20110722/gdb/dwarf2read.c Index: gdb-7.4.50.20120703/gdb/gdb_bfd.c
=================================================================== ===================================================================
--- gdb-7.3.50.20110722.orig/gdb/dwarf2read.c 2011-07-22 19:37:15.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/gdb_bfd.c 2012-07-03 17:30:07.356754655 +0200
+++ gdb-7.3.50.20110722/gdb/dwarf2read.c 2011-07-22 19:44:42.000000000 +0200 +++ gdb-7.4.50.20120703/gdb/gdb_bfd.c 2012-07-03 17:43:52.565762454 +0200
@@ -67,12 +67,14 @@ @@ -26,12 +26,14 @@
#ifdef HAVE_ZLIB_H #ifdef HAVE_ZLIB_H
#include <zlib.h> #include <zlib.h>
#endif #endif
@ -15,37 +15,37 @@ Index: gdb-7.3.50.20110722/gdb/dwarf2read.c
#endif #endif
+#endif +#endif
typedef struct symbol *symbolp; /* An object of this type is stored in the section's user data when
DEF_VEC_P (symbolp); mapping a section. */
@@ -1618,6 +1620,7 @@ dwarf2_read_section (struct objfile *obj @@ -181,6 +183,7 @@ free_one_bfd_section (bfd *abfd, asectio
if (sect != NULL && sect->data != NULL)
{
+#ifndef __sparc__
#ifdef HAVE_MMAP
if (sect->map_addr != NULL)
{
@@ -191,6 +194,7 @@ free_one_bfd_section (bfd *abfd, asectio
}
else
#endif
+#endif
xfree (sect->data);
}
}
@@ -425,6 +429,7 @@ gdb_bfd_map_section (asection *sectp, bf
} }
} }
+#ifndef __sparc__ +#ifndef __sparc__
#ifdef HAVE_MMAP #ifdef HAVE_MMAP
if (pagesize == 0) {
pagesize = getpagesize (); /* The page size, used when mmapping. */
@@ -1641,6 +1644,7 @@ dwarf2_read_section (struct objfile *obj @@ -458,6 +463,7 @@ gdb_bfd_map_section (asection *sectp, bf
} }
} }
#endif #endif /* HAVE_MMAP */
+#endif +#endif
/* If we get here, we are a normal, not-compressed section. */ /* If we get here, we are a normal, not-compressed section. */
info->buffer = buf
@@ -15983,6 +15987,7 @@ munmap_section_buffer (struct dwarf2_sec
{
if (info->map_addr != NULL)
{
+#ifndef __sparc__
#ifdef HAVE_MMAP
int res;
@@ -15992,6 +15997,7 @@ munmap_section_buffer (struct dwarf2_sec
/* Without HAVE_MMAP, we should never be here to begin with. */
gdb_assert_not_reached ("no mmap support");
#endif
+#endif
}
}

File diff suppressed because it is too large Load Diff

View File

@ -1,994 +0,0 @@
http://sourceware.org/ml/gdb-patches/2010-09/msg00360.html
Subject: [patch 3/4]#3 linux-nat: Do not respawn signals
Hi,
linux-nat.c is fixed to never respawn signals; possibly keeping SIGSTOP
pending, as is done in current in FSF gdbserver and as suggested by Pedro:
http://sourceware.org/ml/gdb-patches/2010-08/msg00544.html
The last linux-nat.c removed patch chunk comes from the initial implementation
by Mark Kettenis:
[PATCH] New Linux threads support
http://sourceware.org/ml/gdb-patches/2000-09/msg00020.html
92280a75e017683bf8e4f339f4f85640b0700509
It gets in part reimplemented into the new stop_wait_callback <if (lp->step)>
part and partially just not needed as currently GDB never drops the signals as
it does not PTRACE_CONT the thread; signal is kept for processing:
"RC: Not resuming sibling %s (has pending)\n"
In stop_wait_callback I believe breakpoints cancellation is not needed here,
it would be done later.
The testcase sigstep-threads.exp was written to catch a regression-like
appearance then the new <if (lp->step)> part of stop_wait_callback gets
removed. Still the tecase fails even with FSF HEAD:
32 var++; /* step-1 */
(gdb) step
Program received signal SIGUSR1, User defined signal 1.
Program received signal SIGUSR1, User defined signal 1.
31 { /* step-0 */
There is no reason why it shouldn't stop on line 33, between line 32 and line
33 no signal would occur. Stepping of the current thread should not be
affected by whatever happens in the other threads as select_event_lwp has:
/* Give preference to any LWP that is being single-stepped. */
There is a problem that with FSF HEAD GDB does PTRACE_SINGLESTEP for thread A,
PTRACE_CONT for thread B (because of set scheduler-locking off), thread B hits
SIGUSR1, so GDB tkills thread A with SIGSTOP and it can receive SIGSTOP for
thread A before the SIGTRAP for completed PTRACE_SINGLESTEP. At that moment
select_event_lwp. forgets it was stepping thread A because there is no pending
SIGTRAP event. currently_stepping still remembers thread A was stepping so it
will later stop but as thread A was PTRACE_CONT-ed in the meantime it is too
late.
There is the new <if (lp->step)> part of stop_wait_callback to always track
thread A is stepping. Due to different scheduling without this part the
changed GDB would very rarely stop in this testcase otherwise, making it look
as a regression.
I have some another patch I may post separately as if multiple signals happen
besides SIGTRAP GDB still may switch from thread A away (as not considering it
stepping) to thread B for SIGUSR and accidentally PTRACE_CONT thread A.
But I do not find this as a prerequisite for this patchset.
Thanks,
Jan
gdb/
2010-09-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-nat.c (stop_wait_callback): New gdb_assert. Remove signals
respawning; keep TP with SIGNALLED. New debugging message "SWC:
Delayed SIGSTOP caught for %s.". Catch next signal if SIGSTOP has
been caught and LP->STEP is set.
(linux_nat_wait_1) <lp && lp->signalled>: Remove.
gdb/testsuite/
2010-09-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.threads/siginfo-threads.exp: New file.
* gdb.threads/siginfo-threads.c: New file.
* gdb.threads/sigstep-threads.exp: New file.
* gdb.threads/sigstep-threads.c: New file.
Index: gdb-7.4.50.20120602/gdb/linux-nat.c
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/linux-nat.c 2012-06-02 21:34:51.999517510 +0200
+++ gdb-7.4.50.20120602/gdb/linux-nat.c 2012-06-02 21:35:59.930491577 +0200
@@ -2856,6 +2856,8 @@ stop_wait_callback (struct lwp_info *lp,
{
int status;
+ gdb_assert (lp->resumed);
+
status = wait_lwp (lp);
if (status == 0)
return 0;
@@ -2881,110 +2883,61 @@ stop_wait_callback (struct lwp_info *lp,
if (WSTOPSIG (status) != SIGSTOP)
{
- if (linux_nat_status_is_event (status))
- {
- /* If a LWP other than the LWP that we're reporting an
- event for has hit a GDB breakpoint (as opposed to
- some random trap signal), then just arrange for it to
- hit it again later. We don't keep the SIGTRAP status
- and don't forward the SIGTRAP signal to the LWP. We
- will handle the current event, eventually we will
- resume all LWPs, and this one will get its breakpoint
- trap again.
-
- If we do not do this, then we run the risk that the
- user will delete or disable the breakpoint, but the
- thread will have already tripped on it. */
-
- /* Save the trap's siginfo in case we need it later. */
- save_siginfo (lp);
-
- save_sigtrap (lp);
-
- /* Now resume this LWP and get the SIGSTOP event. */
- errno = 0;
- ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
- if (debug_linux_nat)
- {
- fprintf_unfiltered (gdb_stdlog,
- "PTRACE_CONT %s, 0, 0 (%s)\n",
- target_pid_to_str (lp->ptid),
- errno ? safe_strerror (errno) : "OK");
-
- fprintf_unfiltered (gdb_stdlog,
- "SWC: Candidate SIGTRAP event in %s\n",
- target_pid_to_str (lp->ptid));
- }
- /* Hold this event/waitstatus while we check to see if
- there are any more (we still want to get that SIGSTOP). */
- stop_wait_callback (lp, NULL);
+ /* The thread was stopped with a signal other than SIGSTOP. */
- /* Hold the SIGTRAP for handling by linux_nat_wait. If
- there's another event, throw it back into the
- queue. */
- if (lp->status)
- {
- if (debug_linux_nat)
- fprintf_unfiltered (gdb_stdlog,
- "SWC: kill %s, %s\n",
- target_pid_to_str (lp->ptid),
- status_to_str ((int) status));
- kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (lp->status));
- }
-
- /* Save the sigtrap event. */
- lp->status = status;
- return 0;
- }
- else
- {
- /* The thread was stopped with a signal other than
- SIGSTOP, and didn't accidentally trip a breakpoint. */
+ /* Save the trap's siginfo in case we need it later. */
+ save_siginfo (lp);
- if (debug_linux_nat)
- {
- fprintf_unfiltered (gdb_stdlog,
- "SWC: Pending event %s in %s\n",
- status_to_str ((int) status),
- target_pid_to_str (lp->ptid));
- }
- /* Now resume this LWP and get the SIGSTOP event. */
- errno = 0;
- ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, 0);
- if (debug_linux_nat)
- fprintf_unfiltered (gdb_stdlog,
- "SWC: PTRACE_CONT %s, 0, 0 (%s)\n",
- target_pid_to_str (lp->ptid),
- errno ? safe_strerror (errno) : "OK");
+ save_sigtrap (lp);
- /* Hold this event/waitstatus while we check to see if
- there are any more (we still want to get that SIGSTOP). */
- stop_wait_callback (lp, NULL);
+ if (debug_linux_nat)
+ fprintf_unfiltered (gdb_stdlog,
+ "SWC: Pending event %s in %s\n",
+ status_to_str ((int) status),
+ target_pid_to_str (lp->ptid));
- /* If the lp->status field is still empty, use it to
- hold this event. If not, then this event must be
- returned to the event queue of the LWP. */
- if (lp->status)
- {
- if (debug_linux_nat)
- {
- fprintf_unfiltered (gdb_stdlog,
- "SWC: kill %s, %s\n",
- target_pid_to_str (lp->ptid),
- status_to_str ((int) status));
- }
- kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (status));
- }
- else
- lp->status = status;
- return 0;
- }
+ /* Save the sigtrap event. */
+ lp->status = status;
+ gdb_assert (! lp->stopped);
+ gdb_assert (lp->signalled);
+ lp->stopped = 1;
}
else
{
/* We caught the SIGSTOP that we intended to catch, so
there's no SIGSTOP pending. */
- lp->stopped = 1;
+
+ if (debug_linux_nat)
+ fprintf_unfiltered (gdb_stdlog,
+ "SWC: Delayed SIGSTOP caught for %s.\n",
+ target_pid_to_str (lp->ptid));
+
+ if (lp->step)
+ {
+ /* LP->STATUS is 0 here. That means SIGTRAP from
+ PTRACE_SINGLESTEP still has to be delivered for this inferior
+ stop. Catching the SIGTRAP event is important to prevent
+ starvation in select_event_lwp. */
+
+ registers_changed ();
+ linux_ops->to_resume (linux_ops, pid_to_ptid (GET_LWP (lp->ptid)),
+ 1, GDB_SIGNAL_0);
+ if (debug_linux_nat)
+ fprintf_unfiltered (gdb_stdlog,
+ "SWC: %s %s, 0, 0 (discard SIGSTOP)\n",
+ "PTRACE_SINGLESTEP",
+ target_pid_to_str (lp->ptid));
+
+ lp->stopped = 0;
+ gdb_assert (lp->resumed);
+ stop_wait_callback (lp, NULL);
+ gdb_assert (lp->stopped);
+ }
+ else
+ lp->stopped = 1;
+
+ /* Reset SIGNALLED only after the stop_wait_callback call above as
+ it does gdb_assert on SIGNALLED. */
lp->signalled = 0;
}
}
@@ -3616,54 +3569,6 @@ retry:
lp = NULL;
}
- if (lp && lp->signalled && lp->last_resume_kind != resume_stop)
- {
- /* A pending SIGSTOP may interfere with the normal stream of
- events. In a typical case where interference is a problem,
- we have a SIGSTOP signal pending for LWP A while
- single-stepping it, encounter an event in LWP B, and take the
- pending SIGSTOP while trying to stop LWP A. After processing
- the event in LWP B, LWP A is continued, and we'll never see
- the SIGTRAP associated with the last time we were
- single-stepping LWP A. */
-
- /* Resume the thread. It should halt immediately returning the
- pending SIGSTOP. */
- registers_changed ();
- if (linux_nat_prepare_to_resume != NULL)
- linux_nat_prepare_to_resume (lp);
- linux_ops->to_resume (linux_ops, pid_to_ptid (GET_LWP (lp->ptid)),
- lp->step, GDB_SIGNAL_0);
- if (debug_linux_nat)
- fprintf_unfiltered (gdb_stdlog,
- "LLW: %s %s, 0, 0 (expect SIGSTOP)\n",
- lp->step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
- target_pid_to_str (lp->ptid));
- lp->stopped = 0;
- gdb_assert (lp->resumed);
-
- /* Catch the pending SIGSTOP. */
- status = lp->status;
- lp->status = 0;
-
- stop_wait_callback (lp, NULL);
-
- /* If the lp->status field isn't empty, we caught another signal
- while flushing the SIGSTOP. Return it back to the event
- queue of the LWP, as we already have an event to handle. */
- if (lp->status)
- {
- if (debug_linux_nat)
- fprintf_unfiltered (gdb_stdlog,
- "LLW: kill %s, %s\n",
- target_pid_to_str (lp->ptid),
- status_to_str (lp->status));
- kill_lwp (GET_LWP (lp->ptid), WSTOPSIG (lp->status));
- }
-
- lp->status = status;
- }
-
if (!target_can_async_p ())
{
/* Causes SIGINT to be passed on to the attached process. */
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/siginfo-threads.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/siginfo-threads.c 2012-06-02 21:35:40.268499060 +0200
@@ -0,0 +1,447 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 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 <http://www.gnu.org/licenses/>. */
+
+#define _GNU_SOURCE
+#include <pthread.h>
+#include <stdio.h>
+#include <limits.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <signal.h>
+#include <unistd.h>
+#include <asm/unistd.h>
+
+#define gettid() syscall (__NR_gettid)
+#define tgkill(tgid, tid, sig) syscall (__NR_tgkill, tgid, tid, sig)
+
+/* Terminate always in the main task, it can lock up with SIGSTOPped GDB
+ otherwise. */
+#define TIMEOUT (gettid () == getpid() ? 10 : 15)
+
+static pid_t thread1_tid;
+static pthread_cond_t thread1_tid_cond = PTHREAD_COND_INITIALIZER;
+static pthread_mutex_t thread1_tid_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
+static int thread1_sigusr1_hit;
+static int thread1_sigusr2_hit;
+
+static pid_t thread2_tid;
+static pthread_cond_t thread2_tid_cond = PTHREAD_COND_INITIALIZER;
+static pthread_mutex_t thread2_tid_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
+static int thread2_sigusr1_hit;
+static int thread2_sigusr2_hit;
+
+static pthread_mutex_t terminate_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
+
+/* Do not use alarm as it would create a ptrace event which would hang up us if
+ we are being traced by GDB which we stopped ourselves. */
+
+static void timed_mutex_lock (pthread_mutex_t *mutex)
+{
+ int i;
+ struct timespec start, now;
+
+ i = clock_gettime (CLOCK_MONOTONIC, &start);
+ assert (i == 0);
+
+ do
+ {
+ i = pthread_mutex_trylock (mutex);
+ if (i == 0)
+ return;
+ assert (i == EBUSY);
+
+ i = clock_gettime (CLOCK_MONOTONIC, &now);
+ assert (i == 0);
+ assert (now.tv_sec >= start.tv_sec);
+ }
+ while (now.tv_sec - start.tv_sec < TIMEOUT);
+
+ fprintf (stderr, "Timed out waiting for internal lock!\n");
+ exit (EXIT_FAILURE);
+}
+
+static void
+handler (int signo, siginfo_t *siginfo, void *exception)
+{
+ int *varp;
+
+ assert (siginfo->si_signo == signo);
+ assert (siginfo->si_code == SI_TKILL);
+ assert (siginfo->si_pid == getpid ());
+
+ if (gettid () == thread1_tid)
+ {
+ if (signo == SIGUSR1)
+ varp = &thread1_sigusr1_hit;
+ else if (signo == SIGUSR2)
+ varp = &thread1_sigusr2_hit;
+ else
+ assert (0);
+ }
+ else if (gettid () == thread2_tid)
+ {
+ if (signo == SIGUSR1)
+ varp = &thread2_sigusr1_hit;
+ else if (signo == SIGUSR2)
+ varp = &thread2_sigusr2_hit;
+ else
+ assert (0);
+ }
+ else
+ assert (0);
+
+ if (*varp)
+ {
+ fprintf (stderr, "Signal %d for TID %lu has been already hit!\n", signo,
+ (unsigned long) gettid ());
+ exit (EXIT_FAILURE);
+ }
+ *varp = 1;
+}
+
+static void *
+thread1_func (void *unused)
+{
+ int i;
+
+ timed_mutex_lock (&thread1_tid_mutex);
+
+ /* THREAD1_TID_MUTEX must be already locked to avoid race. */
+ thread1_tid = gettid ();
+
+ i = pthread_cond_signal (&thread1_tid_cond);
+ assert (i == 0);
+ i = pthread_mutex_unlock (&thread1_tid_mutex);
+ assert (i == 0);
+
+ /* Be sure the "t (tracing stop)" test can proceed for both threads. */
+ timed_mutex_lock (&terminate_mutex);
+ i = pthread_mutex_unlock (&terminate_mutex);
+ assert (i == 0);
+
+ if (! thread1_sigusr1_hit)
+ {
+ fprintf (stderr, "Thread 1 signal SIGUSR1 not hit!\n");
+ exit (EXIT_FAILURE);
+ }
+ if (! thread1_sigusr2_hit)
+ {
+ fprintf (stderr, "Thread 1 signal SIGUSR2 not hit!\n");
+ exit (EXIT_FAILURE);
+ }
+
+ return NULL;
+}
+
+static void *
+thread2_func (void *unused)
+{
+ int i;
+
+ timed_mutex_lock (&thread2_tid_mutex);
+
+ /* THREAD2_TID_MUTEX must be already locked to avoid race. */
+ thread2_tid = gettid ();
+
+ i = pthread_cond_signal (&thread2_tid_cond);
+ assert (i == 0);
+ i = pthread_mutex_unlock (&thread2_tid_mutex);
+ assert (i == 0);
+
+ /* Be sure the "t (tracing stop)" test can proceed for both threads. */
+ timed_mutex_lock (&terminate_mutex);
+ i = pthread_mutex_unlock (&terminate_mutex);
+ assert (i == 0);
+
+ if (! thread2_sigusr1_hit)
+ {
+ fprintf (stderr, "Thread 2 signal SIGUSR1 not hit!\n");
+ exit (EXIT_FAILURE);
+ }
+ if (! thread2_sigusr2_hit)
+ {
+ fprintf (stderr, "Thread 2 signal SIGUSR2 not hit!\n");
+ exit (EXIT_FAILURE);
+ }
+
+ return NULL;
+}
+
+static const char *
+proc_string (const char *filename, const char *line)
+{
+ FILE *f;
+ static char buf[LINE_MAX];
+ size_t line_len = strlen (line);
+
+ f = fopen (filename, "r");
+ if (f == NULL)
+ {
+ fprintf (stderr, "fopen (\"%s\") for \"%s\": %s\n", filename, line,
+ strerror (errno));
+ exit (EXIT_FAILURE);
+ }
+ while (errno = 0, fgets (buf, sizeof (buf), f))
+ {
+ char *s;
+
+ s = strchr (buf, '\n');
+ assert (s != NULL);
+ *s = 0;
+
+ if (strncmp (buf, line, line_len) != 0)
+ continue;
+
+ if (fclose (f))
+ {
+ fprintf (stderr, "fclose (\"%s\") for \"%s\": %s\n", filename, line,
+ strerror (errno));
+ exit (EXIT_FAILURE);
+ }
+
+ return &buf[line_len];
+ }
+ if (errno != 0)
+ {
+ fprintf (stderr, "fgets (\"%s\": %s\n", filename, strerror (errno));
+ exit (EXIT_FAILURE);
+ }
+ fprintf (stderr, "\"%s\": No line \"%s\" found.\n", filename, line);
+ exit (EXIT_FAILURE);
+}
+
+static unsigned long
+proc_ulong (const char *filename, const char *line)
+{
+ const char *s = proc_string (filename, line);
+ long retval;
+ char *end;
+
+ errno = 0;
+ retval = strtol (s, &end, 10);
+ if (retval < 0 || retval >= LONG_MAX || (end && *end))
+ {
+ fprintf (stderr, "\"%s\":\"%s\": %ld, %s\n", filename, line, retval,
+ strerror (errno));
+ exit (EXIT_FAILURE);
+ }
+ return retval;
+}
+
+static void
+state_wait (pid_t process, const char *wanted)
+{
+ char *filename;
+ int i;
+ struct timespec start, now;
+ const char *state;
+
+ i = asprintf (&filename, "/proc/%lu/status", (unsigned long) process);
+ assert (i > 0);
+
+ i = clock_gettime (CLOCK_MONOTONIC, &start);
+ assert (i == 0);
+
+ do
+ {
+ state = proc_string (filename, "State:\t");
+
+ /* torvalds/linux-2.6.git 464763cf1c6df632dccc8f2f4c7e50163154a2c0
+ has changed "T (tracing stop)" to "t (tracing stop)". Make the GDB
+ testcase backward compatible with older Linux kernels. */
+ if (strcmp (state, "T (tracing stop)") == 0)
+ state = "t (tracing stop)";
+
+ if (strcmp (state, wanted) == 0)
+ {
+ free (filename);
+ return;
+ }
+
+ if (sched_yield ())
+ {
+ perror ("sched_yield()");
+ exit (EXIT_FAILURE);
+ }
+
+ i = clock_gettime (CLOCK_MONOTONIC, &now);
+ assert (i == 0);
+ assert (now.tv_sec >= start.tv_sec);
+ }
+ while (now.tv_sec - start.tv_sec < TIMEOUT);
+
+ fprintf (stderr, "Timed out waiting for PID %lu \"%s\" (now it is \"%s\")!\n",
+ (unsigned long) process, wanted, state);
+ exit (EXIT_FAILURE);
+}
+
+static volatile pid_t tracer = 0;
+static pthread_t thread1, thread2;
+
+static void
+cleanup (void)
+{
+ printf ("Resuming GDB PID %lu.\n", (unsigned long) tracer);
+
+ if (tracer)
+ {
+ int i;
+ int tracer_save = tracer;
+
+ tracer = 0;
+
+ i = kill (tracer_save, SIGCONT);
+ assert (i == 0);
+ }
+}
+
+int
+main (int argc, char **argv)
+{
+ int i;
+ int standalone = 0;
+ struct sigaction act;
+
+ if (argc == 2 && strcmp (argv[1], "-s") == 0)
+ standalone = 1;
+ else
+ assert (argc == 1);
+
+ setbuf (stdout, NULL);
+
+ timed_mutex_lock (&thread1_tid_mutex);
+ timed_mutex_lock (&thread2_tid_mutex);
+
+ timed_mutex_lock (&terminate_mutex);
+
+ errno = 0;
+ memset (&act, 0, sizeof (act));
+ act.sa_sigaction = handler;
+ act.sa_flags = SA_RESTART | SA_SIGINFO;
+ i = sigemptyset (&act.sa_mask);
+ assert_perror (errno);
+ assert (i == 0);
+ i = sigaction (SIGUSR1, &act, NULL);
+ assert_perror (errno);
+ assert (i == 0);
+ i = sigaction (SIGUSR2, &act, NULL);
+ assert_perror (errno);
+ assert (i == 0);
+
+ i = pthread_create (&thread1, NULL, thread1_func, NULL);
+ assert (i == 0);
+
+ i = pthread_create (&thread2, NULL, thread2_func, NULL);
+ assert (i == 0);
+
+ if (!standalone)
+ {
+ tracer = proc_ulong ("/proc/self/status", "TracerPid:\t");
+ if (tracer == 0)
+ {
+ fprintf (stderr, "The testcase must be run by GDB!\n");
+ exit (EXIT_FAILURE);
+ }
+ if (tracer != getppid ())
+ {
+ fprintf (stderr, "The testcase parent must be our GDB tracer!\n");
+ exit (EXIT_FAILURE);
+ }
+ }
+
+ /* SIGCONT our debugger in the case of our crash as we would deadlock
+ otherwise. */
+
+ atexit (cleanup);
+
+ printf ("Stopping GDB PID %lu.\n", (unsigned long) tracer);
+
+ if (tracer)
+ {
+ i = kill (tracer, SIGSTOP);
+ assert (i == 0);
+ state_wait (tracer, "T (stopped)");
+ }
+
+ /* Threads are now waiting at timed_mutex_lock (thread1_tid_mutex) and so
+ they could not trigger the signals before GDB gets unstopped later.
+ Threads get resumed at pthread_cond_wait below. Use `while' loops for
+ protection against spurious pthread_cond_wait wakeups. */
+
+ printf ("Waiting till the threads initialize their TIDs.\n");
+
+ while (thread1_tid == 0)
+ {
+ i = pthread_cond_wait (&thread1_tid_cond, &thread1_tid_mutex);
+ assert (i == 0);
+ }
+
+ while (thread2_tid == 0)
+ {
+ i = pthread_cond_wait (&thread2_tid_cond, &thread2_tid_mutex);
+ assert (i == 0);
+ }
+
+ printf ("Thread 1 TID = %lu, thread 2 TID = %lu, PID = %lu.\n",
+ (unsigned long) thread1_tid, (unsigned long) thread2_tid,
+ (unsigned long) getpid ());
+
+ errno = 0;
+ i = tgkill (getpid (), thread1_tid, SIGUSR1);
+ assert_perror (errno);
+ assert (i == 0);
+ i = tgkill (getpid (), thread1_tid, SIGUSR2);
+ assert_perror (errno);
+ assert (i == 0);
+ i = tgkill (getpid (), thread2_tid, SIGUSR1);
+ assert_perror (errno);
+ assert (i == 0);
+ i = tgkill (getpid (), thread2_tid, SIGUSR2);
+ assert_perror (errno);
+ assert (i == 0);
+
+ printf ("Waiting till the threads get trapped by the signals.\n");
+
+ if (tracer)
+ {
+ /* s390x-unknown-linux-gnu will fail with "R (running)". */
+
+ state_wait (thread1_tid, "t (tracing stop)");
+
+ state_wait (thread2_tid, "t (tracing stop)");
+ }
+
+ cleanup ();
+
+ printf ("Joining the threads.\n");
+
+ i = pthread_mutex_unlock (&terminate_mutex);
+ assert (i == 0);
+
+ i = pthread_join (thread1, NULL);
+ assert (i == 0);
+
+ i = pthread_join (thread2, NULL);
+ assert (i == 0);
+
+ printf ("Exiting.\n"); /* break-at-exit */
+
+ return EXIT_SUCCESS;
+}
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/siginfo-threads.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/siginfo-threads.exp 2012-06-02 21:35:40.296499050 +0200
@@ -0,0 +1,94 @@
+# Copyright 2010 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 <http://www.gnu.org/licenses/>.
+
+set testfile "siginfo-threads"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+if {[gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" ${binfile} executable [list debug additional_flags=-lrt]] != "" } {
+ return -1
+}
+
+clean_restart $testfile
+
+if ![runto_main] {
+ return -1
+}
+
+# `nostop noprint pass' could in some cases report false PASS due to the
+# (preempt 'handle') code path.
+
+gdb_test "handle SIGUSR1 stop print pass" "Signal\[ \t\]+Stop\[ \t\]+Print\[ \t\]+Pass to program\[ \t\]+Description\r\nSIGUSR1\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+Yes\[ \t\].*"
+gdb_test "handle SIGUSR2 stop print pass" "Signal\[ \t\]+Stop\[ \t\]+Print\[ \t\]+Pass to program\[ \t\]+Description\r\nSIGUSR2\[ \t\]+Yes\[ \t\]+Yes\[ \t\]+Yes\[ \t\].*"
+
+gdb_breakpoint [gdb_get_line_number "break-at-exit"]
+
+set test "get pid"
+gdb_test_multiple "p getpid ()" $test {
+ -re " = (\[0-9\]+)\r\n$gdb_prompt $" {
+ set pid $expect_out(1,string)
+ pass $test
+ }
+}
+
+for {set sigcount 0} {$sigcount < 4} {incr sigcount} {
+ set test "catch signal $sigcount"
+ set sigusr ""
+ gdb_test_multiple "continue" $test {
+ -re "Program received signal SIGUSR(\[12\]), User defined signal \[12\]\\.\r\n.*\r\n$gdb_prompt $" {
+ set sigusr $expect_out(1,string)
+ pass $test
+ }
+ }
+ if {$sigusr == ""} {
+ return -1
+ }
+
+ set test "signal $sigcount si_signo"
+ if {$sigusr == 1} {
+ set signo 10
+ } else {
+ set signo 12
+ }
+ gdb_test_multiple {p $_siginfo.si_signo} $test {
+ -re " = $signo\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "Attempt to extract a component of a value that is not a structure\\.\r\n$gdb_prompt $" {
+ unsupported $test
+ }
+ }
+
+ set test "signal $sigcount si_code is SI_TKILL"
+ gdb_test_multiple {p $_siginfo.si_code} $test {
+ -re " = -6\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "Attempt to extract a component of a value that is not a structure\\.\r\n$gdb_prompt $" {
+ unsupported $test
+ }
+ }
+
+ set test "signal $sigcount si_pid"
+ gdb_test_multiple {p $_siginfo._sifields._kill.si_pid} $test {
+ -re " = $pid\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "Attempt to extract a component of a value that is not a structure\\.\r\n$gdb_prompt $" {
+ unsupported $test
+ }
+ }
+}
+
+gdb_continue_to_breakpoint break-at-exit ".*break-at-exit.*"
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/sigstep-threads.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/sigstep-threads.c 2012-06-02 21:35:40.297499050 +0200
@@ -0,0 +1,54 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 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 <http://www.gnu.org/licenses/>. */
+
+#include <pthread.h>
+#include <assert.h>
+#include <signal.h>
+
+#include <asm/unistd.h>
+#include <unistd.h>
+#define tgkill(tgid, tid, sig) syscall (__NR_tgkill, (tgid), (tid), (sig))
+#define gettid() syscall (__NR_gettid)
+
+static volatile int var;
+
+static void
+handler (int signo) /* step-0 */
+{ /* step-0 */
+ var++; /* step-1 */
+ tgkill (getpid (), gettid (), SIGUSR1); /* step-2 */
+}
+
+static void *
+start (void *arg)
+{
+ signal (SIGUSR1, handler);
+ tgkill (getpid (), gettid (), SIGUSR1);
+ assert (0);
+
+ return NULL;
+}
+
+int
+main (void)
+{
+ pthread_t thread;
+
+ pthread_create (&thread, NULL, start, NULL);
+ start (NULL); /* main-start */
+ return 0;
+}
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/sigstep-threads.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/sigstep-threads.exp 2012-06-02 21:35:40.297499050 +0200
@@ -0,0 +1,74 @@
+# Copyright 2010 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 <http://www.gnu.org/licenses/>.
+
+set testfile sigstep-threads
+set srcfile ${testfile}.c
+set executable ${testfile}
+set binfile ${objdir}/${subdir}/${executable}
+
+if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+ untested ${testfile}.exp
+ return -1
+}
+
+clean_restart $executable
+
+if ![runto_main] {
+ return -1;
+}
+
+# `noprint' would not test the full logic of GDB.
+gdb_test "handle SIGUSR1 nostop print pass" "\r\nSIGUSR1\[ \t\]+No\[ \t\]+Yes\[ \t\]+Yes\[ \t\].*"
+
+gdb_test_no_output "set scheduler-locking off"
+
+gdb_breakpoint [gdb_get_line_number "step-1"]
+gdb_test_no_output {set $step1=$bpnum}
+gdb_continue_to_breakpoint "step-1" ".* step-1 .*"
+gdb_test_no_output {disable $step1}
+
+# 1 as we are now stopped at the `step-1' label.
+set step_at 1
+for {set i 0} {$i < 100} {incr i} {
+ set test "step $i"
+ # Presume this step failed - as in the case of a timeout.
+ set failed 1
+ gdb_test_multiple "step" $test {
+ -re "\r\nProgram received signal SIGUSR1, User defined signal 1.\r\n" {
+ exp_continue -continue_timer
+ }
+ -re "step-(\[012\]).*\r\n$gdb_prompt $" {
+ set now $expect_out(1,string)
+ if {$step_at == 2 && $now == 1} {
+ set failed 0
+ } elseif {$step_at == 1 && $now == 2} {
+ set failed 0
+ # Continue over the re-signalling back to the handle entry.
+ gdb_test_no_output {enable $step1} ""
+ gdb_test "continue" " step-1 .*" ""
+ set now 1
+ gdb_test_no_output {disable $step1} ""
+ } else {
+ fail $test
+ }
+ set step_at $now
+ }
+ }
+ if $failed {
+ return
+ }
+}
+# We can never reliably say the racy problematic case has been tested.
+pass "step"

View File

@ -26,19 +26,19 @@ gdb/
(linux_nat_set_siginfo_fixup): Use PTRACE_GETSIGINFO. (linux_nat_set_siginfo_fixup): Use PTRACE_GETSIGINFO.
* linux-nat.h (struct lwp_info) <siginfo>: Remove. * linux-nat.h (struct lwp_info) <siginfo>: Remove.
Index: gdb-7.4.50.20120602/gdb/linux-nat.c Index: gdb-7.4.50.20120703/gdb/linux-nat.c
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/linux-nat.c 2012-06-02 21:36:21.067483466 +0200 --- gdb-7.4.50.20120703.orig/gdb/linux-nat.c 2012-07-03 17:33:02.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/linux-nat.c 2012-06-02 21:37:55.345447402 +0200 +++ gdb-7.4.50.20120703/gdb/linux-nat.c 2012-07-03 17:38:36.738142509 +0200
@@ -1929,7 +1929,6 @@ resume_lwp (struct lwp_info *lp, int ste @@ -1933,7 +1933,6 @@ resume_lwp (struct lwp_info *lp, int ste
step, GDB_SIGNAL_0); step, signo);
lp->stopped = 0; lp->stopped = 0;
lp->step = step; lp->step = step;
- memset (&lp->siginfo, 0, sizeof (lp->siginfo)); - memset (&lp->siginfo, 0, sizeof (lp->siginfo));
lp->stopped_by_watchpoint = 0; lp->stopped_by_watchpoint = 0;
} }
else else
@@ -2071,7 +2070,6 @@ linux_nat_resume (struct target_ops *ops @@ -2092,7 +2091,6 @@ linux_nat_resume (struct target_ops *ops
if (linux_nat_prepare_to_resume != NULL) if (linux_nat_prepare_to_resume != NULL)
linux_nat_prepare_to_resume (lp); linux_nat_prepare_to_resume (lp);
linux_ops->to_resume (linux_ops, ptid, step, signo); linux_ops->to_resume (linux_ops, ptid, step, signo);
@ -46,7 +46,7 @@ Index: gdb-7.4.50.20120602/gdb/linux-nat.c
lp->stopped_by_watchpoint = 0; lp->stopped_by_watchpoint = 0;
if (debug_linux_nat) if (debug_linux_nat)
@@ -2625,22 +2623,6 @@ wait_lwp (struct lwp_info *lp) @@ -2646,22 +2644,6 @@ wait_lwp (struct lwp_info *lp)
return status; return status;
} }
@ -69,7 +69,7 @@ Index: gdb-7.4.50.20120602/gdb/linux-nat.c
/* Send a SIGSTOP to LP. */ /* Send a SIGSTOP to LP. */
static int static int
@@ -2885,9 +2867,6 @@ stop_wait_callback (struct lwp_info *lp, @@ -2904,9 +2886,6 @@ stop_wait_callback (struct lwp_info *lp,
{ {
/* The thread was stopped with a signal other than SIGSTOP. */ /* The thread was stopped with a signal other than SIGSTOP. */
@ -79,7 +79,7 @@ Index: gdb-7.4.50.20120602/gdb/linux-nat.c
save_sigtrap (lp); save_sigtrap (lp);
if (debug_linux_nat) if (debug_linux_nat)
@@ -3291,12 +3270,7 @@ linux_nat_filter_event (int lwpid, int s @@ -3288,12 +3267,7 @@ linux_nat_filter_event (int lwpid, int s
} }
if (linux_nat_status_is_event (status)) if (linux_nat_status_is_event (status))
@ -93,7 +93,7 @@ Index: gdb-7.4.50.20120602/gdb/linux-nat.c
/* Check if the thread has exited. */ /* Check if the thread has exited. */
if ((WIFEXITED (status) || WIFSIGNALED (status)) if ((WIFEXITED (status) || WIFSIGNALED (status))
@@ -3950,7 +3924,6 @@ resume_stopped_resumed_lwps (struct lwp_ @@ -3947,7 +3921,6 @@ resume_stopped_resumed_lwps (struct lwp_
linux_ops->to_resume (linux_ops, pid_to_ptid (GET_LWP (lp->ptid)), linux_ops->to_resume (linux_ops, pid_to_ptid (GET_LWP (lp->ptid)),
lp->step, GDB_SIGNAL_0); lp->step, GDB_SIGNAL_0);
lp->stopped = 0; lp->stopped = 0;
@ -101,7 +101,7 @@ Index: gdb-7.4.50.20120602/gdb/linux-nat.c
lp->stopped_by_watchpoint = 0; lp->stopped_by_watchpoint = 0;
} }
@@ -5227,11 +5200,19 @@ linux_nat_set_prepare_to_resume (struct @@ -5224,11 +5197,19 @@ linux_nat_set_prepare_to_resume (struct
siginfo_t * siginfo_t *
linux_nat_get_siginfo (ptid_t ptid) linux_nat_get_siginfo (ptid_t ptid)
{ {
@ -124,10 +124,10 @@ Index: gdb-7.4.50.20120602/gdb/linux-nat.c
} }
/* Provide a prototype to silence -Wmissing-prototypes. */ /* Provide a prototype to silence -Wmissing-prototypes. */
Index: gdb-7.4.50.20120602/gdb/linux-nat.h Index: gdb-7.4.50.20120703/gdb/linux-nat.h
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/linux-nat.h 2012-06-02 21:36:21.067483466 +0200 --- gdb-7.4.50.20120703.orig/gdb/linux-nat.h 2012-07-03 17:30:09.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/linux-nat.h 2012-06-02 21:36:27.140481144 +0200 +++ gdb-7.4.50.20120703/gdb/linux-nat.h 2012-07-03 17:38:13.501170247 +0200
@@ -76,10 +76,6 @@ struct lwp_info @@ -76,10 +76,6 @@ struct lwp_info
/* The kind of stepping of this LWP. */ /* The kind of stepping of this LWP. */
enum resume_step step; enum resume_step step;

View File

@ -3,11 +3,11 @@ Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Inp
[ New patch variant. ] [ New patch variant. ]
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c Index: gdb-7.4.50.20120703/gdb/solib-svr4.c
index 307e483..ba70764 100644 ===================================================================
--- a/gdb/solib-svr4.c --- gdb-7.4.50.20120703.orig/gdb/solib-svr4.c 2012-07-03 17:34:18.000000000 +0200
+++ b/gdb/solib-svr4.c +++ gdb-7.4.50.20120703/gdb/solib-svr4.c 2012-07-03 17:34:35.614432174 +0200
@@ -1221,8 +1221,17 @@ svr4_read_so_list (CORE_ADDR lm, struct so_list ***link_ptr_ptr, @@ -1221,8 +1221,17 @@ svr4_read_so_list (CORE_ADDR lm, struct
SO_NAME_MAX_PATH_SIZE - 1, &errcode); SO_NAME_MAX_PATH_SIZE - 1, &errcode);
if (errcode != 0) if (errcode != 0)
{ {
@ -27,11 +27,11 @@ index 307e483..ba70764 100644
do_cleanups (old_chain); do_cleanups (old_chain);
continue; continue;
} }
diff --git a/gdb/solib.c b/gdb/solib.c Index: gdb-7.4.50.20120703/gdb/solib.c
index 90439ba..36e4d2a 100644 ===================================================================
--- a/gdb/solib.c --- gdb-7.4.50.20120703.orig/gdb/solib.c 2012-07-03 17:30:07.000000000 +0200
+++ b/gdb/solib.c +++ gdb-7.4.50.20120703/gdb/solib.c 2012-07-03 17:34:35.616432172 +0200
@@ -669,7 +669,7 @@ solib_used (const struct so_list *const known) @@ -672,7 +672,7 @@ solib_used (const struct so_list *const
processes we've just attached to, so that's okay. */ processes we've just attached to, so that's okay. */
static void static void
@ -40,7 +40,7 @@ index 90439ba..36e4d2a 100644
{ {
struct target_so_ops *ops = solib_ops (target_gdbarch); struct target_so_ops *ops = solib_ops (target_gdbarch);
struct so_list *inferior = ops->current_sos(); struct so_list *inferior = ops->current_sos();
@@ -840,6 +840,21 @@ Do you need \"set solib-search-path\" or \"set sysroot\"?"), @@ -843,6 +843,21 @@ Do you need \"set solib-search-path\" or
} }
} }
@ -62,10 +62,10 @@ index 90439ba..36e4d2a 100644
/* Return non-zero if NAME is the libpthread shared library. /* Return non-zero if NAME is the libpthread shared library.
diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/corefile.exp
index 027eb2c..ab686f0 100644 ===================================================================
--- a/gdb/testsuite/gdb.base/corefile.exp --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.base/corefile.exp 2012-06-21 22:46:21.000000000 +0200
+++ b/gdb/testsuite/gdb.base/corefile.exp +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.base/corefile.exp 2012-07-03 17:34:35.617432171 +0200
@@ -256,3 +256,18 @@ if ![is_remote target] { @@ -256,3 +256,18 @@ if ![is_remote target] {
gdb_exit gdb_exit
@ -85,11 +85,11 @@ index 027eb2c..ab686f0 100644
+ pass $test + pass $test
+ } + }
+} +}
diff --git a/gdb/testsuite/gdb.base/solib-symbol.exp b/gdb/testsuite/gdb.base/solib-symbol.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/solib-symbol.exp
index 3c03317..0fc38d9 100644 ===================================================================
--- a/gdb/testsuite/gdb.base/solib-symbol.exp --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.base/solib-symbol.exp 2012-06-21 22:46:22.000000000 +0200
+++ b/gdb/testsuite/gdb.base/solib-symbol.exp +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.base/solib-symbol.exp 2012-07-03 17:36:06.520322820 +0200
@@ -27,7 +27,8 @@ set lib_flags [list debug ldflags=-Wl,-Bsymbolic] @@ -27,7 +27,8 @@ set lib_flags [list debug ldflags=-Wl,-B
# Binary file. # Binary file.
set testfile "solib-symbol-main" set testfile "solib-symbol-main"
set srcfile ${srcdir}/${subdir}/${testfile}.c set srcfile ${srcdir}/${subdir}/${testfile}.c
@ -98,7 +98,7 @@ index 3c03317..0fc38d9 100644
+set binfile ${objdir}/${subdir}/${executable} +set binfile ${objdir}/${subdir}/${executable}
set bin_flags [list debug shlib=${binfile_lib}] set bin_flags [list debug shlib=${binfile_lib}]
if [get_compiler_info ${binfile}] { if [get_compiler_info] {
@@ -72,8 +73,26 @@ gdb_test "br foo2" \ @@ -72,8 +73,26 @@ gdb_test "br foo2" \
"Breakpoint.*: foo2. .2 locations..*" \ "Breakpoint.*: foo2. .2 locations..*" \
"foo2 in mdlib" "foo2 in mdlib"

View File

@ -1,42 +0,0 @@
http://sourceware.org/ml/gdb-patches/2012-06/msg00050.html
Subject: [patch] dejagnu compat. - missing find_go_linker [Re: [patch, doc RFA] Go language support]
On Wed, 25 Apr 2012 04:17:35 +0200, Doug Evans wrote:
> +if {[info procs find_go_linker] == ""} {
> + rename gdb_find_go find_go
> + rename gdb_find_go_linker find_go_linker
> + # No need to set use_gdb_compile.
> +}
Is there a reason for it? With recent Fedora 17 update
https://bugzilla.redhat.com/show_bug.cgi?id=635651
dejagnu has started to support 'find_gfortran'. But it still does not support
'find_go_linker'. This has resulted in regression failing to compile any
gdb.go/*.exp files.
Thanks,
Jan
gdb/testsuite/
2012-06-02 Jan Kratochvil <jan.kratochvil@redhat.com>
* lib/future.exp: Set $use_gdb_compile even if only find_go_linker is
missing.
diff --git a/gdb/testsuite/lib/future.exp b/gdb/testsuite/lib/future.exp
index 40456c0..bf47988 100644
--- a/gdb/testsuite/lib/future.exp
+++ b/gdb/testsuite/lib/future.exp
@@ -514,7 +514,7 @@ if {[info procs find_gfortran] == ""} {
if {[info procs find_go_linker] == ""} {
rename gdb_find_go find_go
rename gdb_find_go_linker find_go_linker
- # No need to set use_gdb_compile.
+ set use_gdb_compile 1
}
if {$use_gdb_compile} {

View File

@ -4,10 +4,10 @@ Date: Mon Aug 8 12:08:53 2011 +0200
+testcase +testcase
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread-lib.c Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/dlopen-libpthread-lib.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread-lib.c 2012-06-02 20:03:42.711393776 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/dlopen-libpthread-lib.c 2012-07-03 17:44:45.797698656 +0200
@@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -49,10 +49,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread-lib.c
+ i = pthread_join (t, NULL); + i = pthread_join (t, NULL);
+ assert (i == 0); + assert (i == 0);
+} +}
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread.c Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/dlopen-libpthread.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread.c 2012-06-02 20:03:42.712393775 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/dlopen-libpthread.c 2012-07-03 17:44:45.798698655 +0200
@@ -0,0 +1,46 @@ @@ -0,0 +1,46 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -100,10 +100,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread.c
+ +
+ return 0; + return 0;
+} +}
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/dlopen-libpthread.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread.exp 2012-06-02 20:03:42.724393771 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/dlopen-libpthread.exp 2012-07-03 17:44:45.798698655 +0200
@@ -0,0 +1,74 @@ @@ -0,0 +1,74 @@
+# Copyright 2011 Free Software Foundation, Inc. +# Copyright 2011 Free Software Foundation, Inc.
+# +#
@ -179,15 +179,15 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.threads/dlopen-libpthread.exp
+gdb_continue_to_breakpoint "notify" ".* notify-here .*" +gdb_continue_to_breakpoint "notify" ".* notify-here .*"
+ +
+gdb_test "info sharedlibrary" {/libpthread\.so.*} "libpthread.so found" +gdb_test "info sharedlibrary" {/libpthread\.so.*} "libpthread.so found"
Index: gdb-7.4.50.20120602/gdb/testsuite/lib/gdb.exp Index: gdb-7.4.50.20120703/gdb/testsuite/lib/gdb.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/testsuite/lib/gdb.exp 2012-06-02 19:11:56.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/testsuite/lib/gdb.exp 2012-07-03 17:34:18.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/testsuite/lib/gdb.exp 2012-06-02 20:03:42.727393770 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/lib/gdb.exp 2012-07-03 17:46:44.316514076 +0200
@@ -3693,30 +3693,49 @@ proc build_executable { testname executa @@ -3758,23 +3758,7 @@ proc build_executable { testname executa
set sources ${executable}.c set sources ${executable}.c
} }
- set binfile ${objdir}/${subdir}/${executable} - set binfile [standard_output_file $executable]
- -
- set objects {} - set objects {}
- for {set i 0} "\$i<[llength $sources]" {incr i} { - for {set i 0} "\$i<[llength $sources]" {incr i} {
@ -197,29 +197,29 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/lib/gdb.exp
- return -1 - return -1
- } - }
- lappend objects "${binfile}${i}.o" - lappend objects "${binfile}${i}.o"
+ # get_compiler_info by gdb_compile_shlib and gdb_compile_shlib_pthreads. - }
+ set info_options ""
+ if { [lsearch -exact $options "c++"] >= 0 } {
+ set info_options "c++"
}
- -
- if { [gdb_compile $objects "${binfile}" executable $options] != "" } { - if { [gdb_compile $objects "${binfile}" executable $options] != "" } {
- untested $testname - untested $testname
+ if [get_compiler_info binfile_unused ${info_options}] { - return -1
- }
-
+ # get_compiler_info by gdb_compile_shlib and gdb_compile_shlib_pthreads.
set info_options ""
if { [lsearch -exact $options "c++"] >= 0 } {
set info_options "c++"
@@ -3782,6 +3766,41 @@ proc build_executable { testname executa
if [get_compiler_info ${info_options}] {
return -1 return -1
} }
+
- set info_options "" + set binfile [standard_output_file $executable]
- if { [lsearch -exact $options "c++"] >= 0 } {
- set info_options "c++"
+ set binfile ${objdir}/${subdir}/${executable}
+ +
+ set func gdb_compile + set func gdb_compile
+ set func_index [lsearch -regexp $options {^(pthreads|shlib|shlib_pthreads)$}] + set func_index [lsearch -regexp $options {^(pthreads|shlib|shlib_pthreads)$}]
+ if {$func_index != -1} { + if {$func_index != -1} {
+ set func "${func}_[lindex $options $func_index]" + set func "${func}_[lindex $options $func_index]"
} + }
- if [get_compiler_info ${binfile} ${info_options}] {
+ +
+ # gdb_compile_shlib and gdb_compile_shlib_pthreads do not use the 3rd + # gdb_compile_shlib and gdb_compile_shlib_pthreads do not use the 3rd
+ # parameter. They also requires $sources while gdb_compile and + # parameter. They also requires $sources while gdb_compile and
@ -244,16 +244,16 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/lib/gdb.exp
+ } + }
+ if { $ret != "" } { + if { $ret != "" } {
+ untested $testname + untested $testname
return -1 + return -1
} + }
+ +
return 0 return 0
} }
Index: gdb-7.4.50.20120602/gdb/testsuite/lib/prelink-support.exp Index: gdb-7.4.50.20120703/gdb/testsuite/lib/prelink-support.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/testsuite/lib/prelink-support.exp 2012-01-04 09:27:56.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/testsuite/lib/prelink-support.exp 2012-01-04 09:27:56.000000000 +0100
+++ gdb-7.4.50.20120602/gdb/testsuite/lib/prelink-support.exp 2012-06-02 20:03:42.733393768 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/lib/prelink-support.exp 2012-07-03 17:44:45.803698648 +0200
@@ -95,8 +95,9 @@ proc file_copy {src dest} { @@ -95,8 +95,9 @@ proc file_copy {src dest} {
# Wrap function build_executable so that the resulting executable is fully # Wrap function build_executable so that the resulting executable is fully
# self-sufficient (without dependencies on system libraries). Parameter # self-sufficient (without dependencies on system libraries). Parameter
@ -306,10 +306,10 @@ Index: gdb-7.4.50.20120602/gdb/testsuite/lib/prelink-support.exp
return $prelink_args return $prelink_args
} }
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.base/break-interp.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/break-interp.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20120602.orig/gdb/testsuite/gdb.base/break-interp.exp 2012-02-24 15:09:08.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.base/break-interp.exp 2012-06-21 22:46:21.000000000 +0200
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.base/break-interp.exp 2012-06-02 20:04:56.135369687 +0200 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.base/break-interp.exp 2012-07-03 17:44:45.804698647 +0200
@@ -109,14 +109,21 @@ proc strip_debug {dest} { @@ -109,14 +109,21 @@ proc strip_debug {dest} {
} }
} }

View File

@ -0,0 +1,236 @@
Regression: Invalid data type for function to be called. [Re: FYI: fix PR 9514]
http://sourceware.org/ml/gdb-patches/2012-07/msg00043.html
reverted:
http://sourceware.org/ml/gdb-cvs/2012-06/msg00148.html
diff -dup -rup gdb-7.4.50.20120703-orig/gdb/c-exp.y gdb-7.4.50.20120703/gdb/c-exp.y
--- gdb-7.4.50.20120703-orig/gdb/c-exp.y 2012-07-03 20:08:15.976418420 +0200
+++ gdb-7.4.50.20120703/gdb/c-exp.y 2012-07-03 20:08:35.935390282 +0200
@@ -172,10 +172,9 @@ static struct stoken operator_stoken (co
/* %type <bval> block */
/* Fancy type parsing. */
-%type <voidval> func_mod direct_abs_decl abs_decl ptr_operator
+%type <voidval> func_mod direct_abs_decl abs_decl
%type <tval> ptype
%type <lval> array_mod
-%type <tval> conversion_type_id
%token <typed_val_int> INT
%token <typed_val_float> FLOAT
@@ -932,7 +931,9 @@ variable: name_not_typename
;
space_identifier : '@' NAME
- { insert_type_address_space (copy_name ($2.stoken)); }
+ { push_type_address_space (copy_name ($2.stoken));
+ push_type (tp_space_identifier);
+ }
;
const_or_volatile: const_or_volatile_noopt
@@ -951,23 +952,14 @@ const_or_volatile_or_space_identifier:
|
;
-ptr_operator:
- ptr_operator '*'
- { insert_type (tp_pointer); }
- const_or_volatile_or_space_identifier
- { $$ = 0; }
- | '*'
- { insert_type (tp_pointer); }
- const_or_volatile_or_space_identifier
- { $$ = 0; }
+abs_decl: '*'
+ { push_type (tp_pointer); $$ = 0; }
+ | '*' abs_decl
+ { push_type (tp_pointer); $$ = $2; }
| '&'
- { insert_type (tp_reference); $$ = 0; }
- | '&' ptr_operator
- { insert_type (tp_reference); $$ = 0; }
- ;
-
-abs_decl: ptr_operator direct_abs_decl
- | ptr_operator
+ { push_type (tp_reference); $$ = 0; }
+ | '&' abs_decl
+ { push_type (tp_reference); $$ = $2; }
| direct_abs_decl
;
@@ -1211,30 +1203,22 @@ nonempty_typelist
;
ptype : typebase
- | ptype abs_decl
- { $$ = follow_types ($1); }
- ;
-
-conversion_type_id: typebase conversion_declarator
+ | ptype const_or_volatile_or_space_identifier abs_decl const_or_volatile_or_space_identifier
{ $$ = follow_types ($1); }
;
-conversion_declarator: /* Nothing. */
- | ptr_operator conversion_declarator
- ;
-
const_and_volatile: CONST_KEYWORD VOLATILE_KEYWORD
| VOLATILE_KEYWORD CONST_KEYWORD
;
const_or_volatile_noopt: const_and_volatile
- { insert_type (tp_const);
- insert_type (tp_volatile);
+ { push_type (tp_const);
+ push_type (tp_volatile);
}
| CONST_KEYWORD
- { insert_type (tp_const); }
+ { push_type (tp_const); }
| VOLATILE_KEYWORD
- { insert_type (tp_volatile); }
+ { push_type (tp_volatile); }
;
operator: OPERATOR NEW
@@ -1341,7 +1325,7 @@ operator: OPERATOR NEW
{ $$ = operator_stoken ("()"); }
| OPERATOR '[' ']'
{ $$ = operator_stoken ("[]"); }
- | OPERATOR conversion_type_id
+ | OPERATOR ptype
{ char *name;
long length;
struct ui_file *buf = mem_fileopen ();
diff -dup -rup gdb-7.4.50.20120703-orig/gdb/parse.c gdb-7.4.50.20120703/gdb/parse.c
--- gdb-7.4.50.20120703-orig/gdb/parse.c 2012-07-03 20:08:15.979418415 +0200
+++ gdb-7.4.50.20120703/gdb/parse.c 2012-07-03 20:08:35.938390277 +0200
@@ -1370,49 +1370,6 @@ check_type_stack_depth (void)
}
}
-/* A helper function for insert_type and insert_type_address_space.
- This does work of expanding the type stack and inserting the new
- element, ELEMENT, into the stack at location SLOT. */
-
-static void
-insert_into_type_stack (int slot, union type_stack_elt element)
-{
- check_type_stack_depth ();
-
- if (slot < type_stack_depth)
- memmove (&type_stack[slot + 1], &type_stack[slot],
- (type_stack_depth - slot) * sizeof (union type_stack_elt));
- type_stack[slot] = element;
- ++type_stack_depth;
-}
-
-/* Insert a new type, TP, at the bottom of the type stack. If TP is
- tp_pointer or tp_reference, it is inserted at the bottom. If TP is
- a qualifier, it is inserted at slot 1 (just above a previous
- tp_pointer) if there is anything on the stack, or simply pushed if
- the stack is empty. Other values for TP are invalid. */
-
-void
-insert_type (enum type_pieces tp)
-{
- union type_stack_elt element;
- int slot;
-
- gdb_assert (tp == tp_pointer || tp == tp_reference
- || tp == tp_const || tp == tp_volatile);
-
- /* If there is anything on the stack (we know it will be a
- tp_pointer), insert the qualifier above it. Otherwise, simply
- push this on the top of the stack. */
- if (type_stack_depth && (tp == tp_const || tp == tp_volatile))
- slot = 1;
- else
- slot = 0;
-
- element.piece = tp;
- insert_into_type_stack (slot, element);
-}
-
void
push_type (enum type_pieces tp)
{
@@ -1427,32 +1384,10 @@ push_type_int (int n)
type_stack[type_stack_depth++].int_val = n;
}
-/* Insert a tp_space_identifier and the corresponding address space
- value into the stack. STRING is the name of an address space, as
- recognized by address_space_name_to_int. If the stack is empty,
- the new elements are simply pushed. If the stack is not empty,
- this function assumes that the first item on the stack is a
- tp_pointer, and the new values are inserted above the first
- item. */
-
void
-insert_type_address_space (char *string)
+push_type_address_space (char *string)
{
- union type_stack_elt element;
- int slot;
-
- /* If there is anything on the stack (we know it will be a
- tp_pointer), insert the address space qualifier above it.
- Otherwise, simply push this on the top of the stack. */
- if (type_stack_depth)
- slot = 1;
- else
- slot = 0;
-
- element.piece = tp_space_identifier;
- insert_into_type_stack (slot, element);
- element.int_val = address_space_name_to_int (parse_gdbarch, string);
- insert_into_type_stack (slot, element);
+ push_type_int (address_space_name_to_int (parse_gdbarch, string));
}
enum type_pieces
Only in gdb-7.4.50.20120703-orig/gdb: parse.c.orig
diff -dup -rup gdb-7.4.50.20120703-orig/gdb/parser-defs.h gdb-7.4.50.20120703/gdb/parser-defs.h
--- gdb-7.4.50.20120703-orig/gdb/parser-defs.h 2012-07-03 20:08:15.980418414 +0200
+++ gdb-7.4.50.20120703/gdb/parser-defs.h 2012-07-03 20:08:35.939390275 +0200
@@ -192,13 +192,11 @@ extern int end_arglist (void);
extern char *copy_name (struct stoken);
-extern void insert_type (enum type_pieces);
-
extern void push_type (enum type_pieces);
extern void push_type_int (int);
-extern void insert_type_address_space (char *);
+extern void push_type_address_space (char *);
extern enum type_pieces pop_type (void);
diff -dup -rup gdb-7.4.50.20120703-orig/gdb/testsuite/gdb.base/whatis.exp gdb-7.4.50.20120703/gdb/testsuite/gdb.base/whatis.exp
--- gdb-7.4.50.20120703-orig/gdb/testsuite/gdb.base/whatis.exp 2012-07-03 20:08:15.981418413 +0200
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.base/whatis.exp 2012-07-03 20:08:35.940390273 +0200
@@ -465,17 +465,3 @@ gdb_test "whatis char_addr" \
gdb_test "whatis a_char_addr" \
"type = char_addr" \
"whatis applied to variable defined by typedef"
-
-# Regression tests for PR 9514.
-
-gdb_test "whatis void (**)()" \
- "type = void \\(\\*\\*\\)\\(\\)" \
- "whatis applied to pointer to pointer to function"
-
-gdb_test "whatis void (** const)()" \
- "type = void \\(\\*\\* const\\)\\(\\)" \
- "whatis applied to const pointer to pointer to function"
-
-gdb_test "whatis void (* const *)()" \
- "type = void \\(\\* const \\*\\)\\(\\)" \
- "whatis applied to pointer to const pointer to function"

View File

@ -1,215 +0,0 @@
http://sourceware.org/ml/gdb-patches/2012-05/msg01105.html
Subject: [RFA/commit 1/3] Revert "Search global symbols from the expression's block objfile first."
The search order used in this patch breaks global symbol lookups
for certain symbols when copy-relocation is used. A slightly different
search order will be implemented later.
gdb/ChangeLog:
Revert the following patch:
* findvar.c (default_read_var_value): For LOC_UNRESOLVED symbols,
try locating the symbol in the symbol's own objfile first, before
extending the search to all objfiles.
* symtab.c (lookup_symbol_aux_objfile): New function, extracted
out of lookup_symbol_aux_symtabs.
(lookup_symbol_aux_symtabs): Add new parameter "exclude_objfile".
Replace extracted-out code by call to lookup_symbol_aux_objfile.
Do not search EXCLUDE_OBJFILE.
(lookup_static_symbol_aux): Update call to lookup_symbol_aux_symtabs.
(lookup_symbol_global): Search for matches in the block's objfile
first, before searching all other objfiles.
Will commit if patches #2 & #3 are OK.
---
gdb/findvar.c | 10 +-----
gdb/symtab.c | 108 +++++++++++++++++----------------------------------------
2 files changed, 33 insertions(+), 85 deletions(-)
diff --git a/gdb/findvar.c b/gdb/findvar.c
index ed7903c..9009e6f 100644
--- a/gdb/findvar.c
+++ b/gdb/findvar.c
@@ -562,15 +562,7 @@ default_read_var_value (struct symbol *var, struct frame_info *frame)
struct minimal_symbol *msym;
struct obj_section *obj_section;
- /* First, try locating the associated minimal symbol within
- the same objfile. This prevents us from selecting another
- symbol with the same name but located in a different objfile. */
- msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL,
- SYMBOL_SYMTAB (var)->objfile);
- /* If the lookup failed, try expanding the search to all
- objfiles. */
- if (msym == NULL)
- msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL, NULL);
+ msym = lookup_minimal_symbol (SYMBOL_LINKAGE_NAME (var), NULL, NULL);
if (msym == NULL)
error (_("No global symbol \"%s\"."), SYMBOL_LINKAGE_NAME (var));
if (overlay_debugging)
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 85ddd1d..39d8c6f 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -95,8 +95,7 @@ struct symbol *lookup_symbol_aux_local (const char *name,
static
struct symbol *lookup_symbol_aux_symtabs (int block_index,
const char *name,
- const domain_enum domain,
- struct objfile *exclude_objfile);
+ const domain_enum domain);
static
struct symbol *lookup_symbol_aux_quick (struct objfile *objfile,
@@ -1360,7 +1359,7 @@ lookup_static_symbol_aux (const char *name, const domain_enum domain)
struct objfile *objfile;
struct symbol *sym;
- sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, domain, NULL);
+ sym = lookup_symbol_aux_symtabs (STATIC_BLOCK, name, domain);
if (sym != NULL)
return sym;
@@ -1499,61 +1498,40 @@ lookup_global_symbol_from_objfile (const struct objfile *main_objfile,
return NULL;
}
-/* Check to see if the symbol is defined in one of the OBJFILE's
- symtabs. BLOCK_INDEX should be either GLOBAL_BLOCK or STATIC_BLOCK,
+/* Check to see if the symbol is defined in one of the symtabs.
+ BLOCK_INDEX should be either GLOBAL_BLOCK or STATIC_BLOCK,
depending on whether or not we want to search global symbols or
static symbols. */
static struct symbol *
-lookup_symbol_aux_objfile (struct objfile *objfile, int block_index,
- const char *name, const domain_enum domain)
-{
- struct symbol *sym = NULL;
- struct blockvector *bv;
- const struct block *block;
- struct symtab *s;
-
- if (objfile->sf)
- objfile->sf->qf->pre_expand_symtabs_matching (objfile, block_index,
- name, domain);
-
- ALL_OBJFILE_SYMTABS (objfile, s)
- if (s->primary)
- {
- bv = BLOCKVECTOR (s);
- block = BLOCKVECTOR_BLOCK (bv, block_index);
- sym = lookup_block_symbol (block, name, domain);
- if (sym)
- {
- block_found = block;
- return fixup_symbol_section (sym, objfile);
- }
- }
-
- return NULL;
-}
-
-/* Same as lookup_symbol_aux_objfile, except that it searches all
- objfiles except for EXCLUDE_OBJFILE. Return the first match found.
-
- If EXCLUDE_OBJFILE is NULL, then all objfiles are searched. */
-
-static struct symbol *
lookup_symbol_aux_symtabs (int block_index, const char *name,
- const domain_enum domain,
- struct objfile *exclude_objfile)
+ const domain_enum domain)
{
struct symbol *sym;
struct objfile *objfile;
+ struct blockvector *bv;
+ const struct block *block;
+ struct symtab *s;
ALL_OBJFILES (objfile)
{
- if (objfile != exclude_objfile)
- {
- sym = lookup_symbol_aux_objfile (objfile, block_index, name, domain);
- if (sym)
- return sym;
- }
+ if (objfile->sf)
+ objfile->sf->qf->pre_expand_symtabs_matching (objfile,
+ block_index,
+ name, domain);
+
+ ALL_OBJFILE_SYMTABS (objfile, s)
+ if (s->primary)
+ {
+ bv = BLOCKVECTOR (s);
+ block = BLOCKVECTOR_BLOCK (bv, block_index);
+ sym = lookup_block_symbol (block, name, domain);
+ if (sym)
+ {
+ block_found = block;
+ return fixup_symbol_section (sym, objfile);
+ }
+ }
}
return NULL;
@@ -1679,46 +1657,24 @@ lookup_symbol_global (const char *name,
const domain_enum domain)
{
struct symbol *sym = NULL;
- struct objfile *block_objfile = NULL;
struct objfile *objfile = NULL;
/* Call library-specific lookup procedure. */
- block_objfile = lookup_objfile_from_block (block);
- if (block_objfile != NULL)
- sym = solib_global_lookup (block_objfile, name, domain);
+ objfile = lookup_objfile_from_block (block);
+ if (objfile != NULL)
+ sym = solib_global_lookup (objfile, name, domain);
if (sym != NULL)
return sym;
- /* If BLOCK_OBJFILE is not NULL, then search this objfile first.
- In case the global symbol is defined in multiple objfiles,
- we have a better chance of finding the most relevant symbol. */
-
- if (block_objfile != NULL)
- {
- sym = lookup_symbol_aux_objfile (block_objfile, GLOBAL_BLOCK,
- name, domain);
- if (sym == NULL)
- sym = lookup_symbol_aux_quick (block_objfile, GLOBAL_BLOCK,
- name, domain);
- if (sym != NULL)
- return sym;
- }
-
- /* Symbol not found in the BLOCK_OBJFILE, so try all the other
- objfiles, starting with symtabs first, and then partial symtabs. */
-
- sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, domain, block_objfile);
+ sym = lookup_symbol_aux_symtabs (GLOBAL_BLOCK, name, domain);
if (sym != NULL)
return sym;
ALL_OBJFILES (objfile)
{
- if (objfile != block_objfile)
- {
- sym = lookup_symbol_aux_quick (objfile, GLOBAL_BLOCK, name, domain);
- if (sym)
- return sym;
- }
+ sym = lookup_symbol_aux_quick (objfile, GLOBAL_BLOCK, name, domain);
+ if (sym)
+ return sym;
}
return NULL;
--
1.7.1

View File

@ -1,416 +0,0 @@
http://sourceware.org/ml/gdb-patches/2012-06/msg00458.html
Subject: [patch 1/2] Generalize call_site.parameter key ("code cleanup")
Hi,
previously parameter could be identified either via DW_OP_reg or via
DW_OP_fbreg (both in DW_AT_location). As [patch 2/2] adds new identification
via DW_AT_abstract_origin generalize this two state deciding into more general
enum.
Thanks,
Jan
gdb/
2012-06-14 Jan Kratochvil <jan.kratochvil@redhat.com>
Code cleanup: Generalize call_site.parameter key.
* dwarf2expr.c (execute_stack_op) <DW_OP_GNU_entry_value>: Remove
variable dwarf_reg. New variable kind_u. Update parameters to
push_dwarf_reg_entry_value.
(ctx_no_push_dwarf_reg_entry_value): Update parameters.
* dwarf2expr.h (enum call_site_parameter_kind)
(union call_site_parameter_u): Forward declarations.
(struct dwarf_expr_context_funcs): Update parameters and their
description for push_dwarf_reg_entry_value.
(ctx_no_push_dwarf_reg_entry_value): Update parameters.
* dwarf2loc.c (call_site_parameter_matches): New function.
(dwarf_expr_reg_to_entry_parameter): Update parameters and their
description. Use call_site_parameter_matches.
(dwarf_expr_push_dwarf_reg_entry_value, value_of_dwarf_reg_entry):
Update parameters and their description.
(value_of_dwarf_block_entry): Remove variables dwarf_reg and fb_offset.
New variable kind_u. Adjust the caller for updated parameters.
(needs_dwarf_reg_entry_value): Update parameters.
* dwarf2read.c (read_call_site_scope): New variable loc. Use it
instead of attr. Update for the changed fields of struct
call_site_parameter.
* gdbtypes.h: Include dwarf2expr.h.
(enum call_site_parameter_kind): New.
(struct call_site.parameter): New field kind. Wrap dwarf_reg and
fb_offset into new union u.
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -1355,33 +1355,35 @@ execute_stack_op (struct dwarf_expr_context *ctx,
case DW_OP_GNU_entry_value:
{
uint64_t len;
- int dwarf_reg;
CORE_ADDR deref_size;
+ union call_site_parameter_u kind_u;
op_ptr = safe_read_uleb128 (op_ptr, op_end, &len);
if (op_ptr + len > op_end)
error (_("DW_OP_GNU_entry_value: too few bytes available."));
- dwarf_reg = dwarf_block_to_dwarf_reg (op_ptr, op_ptr + len);
- if (dwarf_reg != -1)
+ kind_u.dwarf_reg = dwarf_block_to_dwarf_reg (op_ptr, op_ptr + len);
+ if (kind_u.dwarf_reg != -1)
{
op_ptr += len;
- ctx->funcs->push_dwarf_reg_entry_value (ctx, dwarf_reg,
- 0 /* unused */,
+ ctx->funcs->push_dwarf_reg_entry_value (ctx,
+ CALL_SITE_PARAMETER_DWARF_REG,
+ kind_u,
-1 /* deref_size */);
goto no_push;
}
- dwarf_reg = dwarf_block_to_dwarf_reg_deref (op_ptr, op_ptr + len,
- &deref_size);
- if (dwarf_reg != -1)
+ kind_u.dwarf_reg = dwarf_block_to_dwarf_reg_deref (op_ptr,
+ op_ptr + len,
+ &deref_size);
+ if (kind_u.dwarf_reg != -1)
{
if (deref_size == -1)
deref_size = ctx->addr_size;
op_ptr += len;
- ctx->funcs->push_dwarf_reg_entry_value (ctx, dwarf_reg,
- 0 /* unused */,
- deref_size);
+ ctx->funcs->push_dwarf_reg_entry_value (ctx,
+ CALL_SITE_PARAMETER_DWARF_REG,
+ kind_u, deref_size);
goto no_push;
}
@@ -1533,7 +1535,8 @@ ctx_no_get_base_type (struct dwarf_expr_context *ctx, cu_offset die)
void
ctx_no_push_dwarf_reg_entry_value (struct dwarf_expr_context *ctx,
- int dwarf_reg, CORE_ADDR fb_offset,
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u,
int deref_size)
{
internal_error (__FILE__, __LINE__,
--- a/gdb/dwarf2expr.h
+++ b/gdb/dwarf2expr.h
@@ -26,6 +26,8 @@
#include "leb128.h"
struct dwarf_expr_context;
+enum call_site_parameter_kind;
+union call_site_parameter_u;
/* Offset relative to the start of its containing CU (compilation unit). */
typedef struct
@@ -77,14 +79,12 @@ struct dwarf_expr_context_funcs
struct type *(*get_base_type) (struct dwarf_expr_context *ctx, cu_offset die);
/* Push on DWARF stack an entry evaluated for DW_TAG_GNU_call_site's
- DWARF_REG/FB_OFFSET at the caller of specified BATON. If DWARF register
- number DWARF_REG specifying the push_dwarf_reg_entry_value parameter is
- not -1 FB_OFFSET is ignored. Otherwise FB_OFFSET specifies stack
- parameter offset against caller's stack pointer (which equals the callee's
- frame base). If DEREF_SIZE is not -1 then use
- DW_AT_GNU_call_site_data_value instead of DW_AT_GNU_call_site_value. */
+ parameter matching KIND and KIND_U at the caller of specified BATON.
+ If DEREF_SIZE is not -1 then use DW_AT_GNU_call_site_data_value instead of
+ DW_AT_GNU_call_site_value. */
void (*push_dwarf_reg_entry_value) (struct dwarf_expr_context *ctx,
- int dwarf_reg, CORE_ADDR fb_offset,
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u,
int deref_size);
/* Return the address indexed by DW_OP_GNU_addr_index.
@@ -289,7 +289,8 @@ void ctx_no_dwarf_call (struct dwarf_expr_context *ctx, cu_offset die_offset);
struct type *ctx_no_get_base_type (struct dwarf_expr_context *ctx,
cu_offset die);
void ctx_no_push_dwarf_reg_entry_value (struct dwarf_expr_context *ctx,
- int dwarf_reg, CORE_ADDR fb_offset,
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u,
int deref_size);
CORE_ADDR ctx_no_get_addr_index (void *baton, unsigned int index);
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -929,16 +929,34 @@ call_site_find_chain (struct gdbarch *gdbarch, CORE_ADDR caller_pc,
return retval;
}
-/* Fetch call_site_parameter from caller matching the parameters. FRAME is for
- callee. See DWARF_REG and FB_OFFSET description at struct
- dwarf_expr_context_funcs->push_dwarf_reg_entry_value.
+/* Return 1 if KIND and KIND_U match PARAMETER. Return 0 otherwise. */
+
+static int
+call_site_parameter_matches (struct call_site_parameter *parameter,
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u)
+{
+ if (kind == parameter->kind)
+ switch (kind)
+ {
+ case CALL_SITE_PARAMETER_DWARF_REG:
+ return kind_u.dwarf_reg == parameter->u.dwarf_reg;
+ case CALL_SITE_PARAMETER_FB_OFFSET:
+ return kind_u.fb_offset == parameter->u.fb_offset;
+ }
+ return 0;
+}
+
+/* Fetch call_site_parameter from caller matching KIND and KIND_U.
+ FRAME is for callee.
Function always returns non-NULL, it throws NO_ENTRY_VALUE_ERROR
otherwise. */
static struct call_site_parameter *
-dwarf_expr_reg_to_entry_parameter (struct frame_info *frame, int dwarf_reg,
- CORE_ADDR fb_offset,
+dwarf_expr_reg_to_entry_parameter (struct frame_info *frame,
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u,
struct dwarf2_per_cu_data **per_cu_return)
{
CORE_ADDR func_addr = get_frame_func (frame);
@@ -1001,12 +1019,7 @@ dwarf_expr_reg_to_entry_parameter (struct frame_info *frame, int dwarf_reg,
for (iparams = 0; iparams < call_site->parameter_count; iparams++)
{
parameter = &call_site->parameter[iparams];
- if (parameter->dwarf_reg == -1 && dwarf_reg == -1)
- {
- if (parameter->fb_offset == fb_offset)
- break;
- }
- else if (parameter->dwarf_reg == dwarf_reg)
+ if (call_site_parameter_matches (parameter, kind, kind_u))
break;
}
if (iparams == call_site->parameter_count)
@@ -1063,17 +1076,17 @@ dwarf_entry_parameter_to_value (struct call_site_parameter *parameter,
return dwarf2_evaluate_loc_desc (type, caller_frame, data, size + 1, per_cu);
}
-/* Execute call_site_parameter's DWARF block matching DEREF_SIZE for caller of
- the CTX's frame. CTX must be of dwarf_expr_ctx_funcs kind. See DWARF_REG
- and FB_OFFSET description at struct
- dwarf_expr_context_funcs->push_dwarf_reg_entry_value.
+/* Execute DWARF block of call_site_parameter which matches KIND and KIND_U.
+ Choose DEREF_SIZE value of that parameter. Search caller of the CTX's
+ frame. CTX must be of dwarf_expr_ctx_funcs kind.
The CTX caller can be from a different CU - per_cu_dwarf_call implementation
can be more simple as it does not support cross-CU DWARF executions. */
static void
dwarf_expr_push_dwarf_reg_entry_value (struct dwarf_expr_context *ctx,
- int dwarf_reg, CORE_ADDR fb_offset,
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u,
int deref_size)
{
struct dwarf_expr_baton *debaton;
@@ -1090,7 +1103,7 @@ dwarf_expr_push_dwarf_reg_entry_value (struct dwarf_expr_context *ctx,
frame = debaton->frame;
caller_frame = get_prev_frame (frame);
- parameter = dwarf_expr_reg_to_entry_parameter (frame, dwarf_reg, fb_offset,
+ parameter = dwarf_expr_reg_to_entry_parameter (frame, kind, kind_u,
&caller_per_cu);
data_src = deref_size == -1 ? parameter->value : parameter->data_value;
size = deref_size == -1 ? parameter->value_size : parameter->data_value_size;
@@ -1187,17 +1200,17 @@ static const struct lval_funcs entry_data_value_funcs =
entry_data_value_free_closure
};
-/* Read parameter of TYPE at (callee) FRAME's function entry. DWARF_REG and
- FB_OFFSET are used to match DW_AT_location at the caller's
- DW_TAG_GNU_call_site_parameter. See DWARF_REG and FB_OFFSET description at
- struct dwarf_expr_context_funcs->push_dwarf_reg_entry_value.
+/* Read parameter of TYPE at (callee) FRAME's function entry. KIND and KIND_U
+ are used to match DW_AT_location at the caller's
+ DW_TAG_GNU_call_site_parameter.
Function always returns non-NULL value. It throws NO_ENTRY_VALUE_ERROR if it
cannot resolve the parameter for any reason. */
static struct value *
value_of_dwarf_reg_entry (struct type *type, struct frame_info *frame,
- int dwarf_reg, CORE_ADDR fb_offset)
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u)
{
struct type *checked_type = check_typedef (type);
struct type *target_type = TYPE_TARGET_TYPE (checked_type);
@@ -1207,7 +1220,7 @@ value_of_dwarf_reg_entry (struct type *type, struct frame_info *frame,
struct dwarf2_per_cu_data *caller_per_cu;
CORE_ADDR addr;
- parameter = dwarf_expr_reg_to_entry_parameter (frame, dwarf_reg, fb_offset,
+ parameter = dwarf_expr_reg_to_entry_parameter (frame, kind, kind_u,
&caller_per_cu);
outer_val = dwarf_entry_parameter_to_value (parameter, -1 /* deref_size */,
@@ -1259,15 +1272,16 @@ static struct value *
value_of_dwarf_block_entry (struct type *type, struct frame_info *frame,
const gdb_byte *block, size_t block_len)
{
- int dwarf_reg;
- CORE_ADDR fb_offset;
+ union call_site_parameter_u kind_u;
- dwarf_reg = dwarf_block_to_dwarf_reg (block, block + block_len);
- if (dwarf_reg != -1)
- return value_of_dwarf_reg_entry (type, frame, dwarf_reg, 0 /* unused */);
+ kind_u.dwarf_reg = dwarf_block_to_dwarf_reg (block, block + block_len);
+ if (kind_u.dwarf_reg != -1)
+ return value_of_dwarf_reg_entry (type, frame, CALL_SITE_PARAMETER_DWARF_REG,
+ kind_u);
- if (dwarf_block_to_fb_offset (block, block + block_len, &fb_offset))
- return value_of_dwarf_reg_entry (type, frame, -1, fb_offset);
+ if (dwarf_block_to_fb_offset (block, block + block_len, &kind_u.fb_offset))
+ return value_of_dwarf_reg_entry (type, frame, CALL_SITE_PARAMETER_FB_OFFSET,
+ kind_u);
/* This can normally happen - throw NO_ENTRY_VALUE_ERROR to get the message
suppressed during normal operation. The expression can be arbitrary if
@@ -2358,7 +2372,8 @@ needs_frame_dwarf_call (struct dwarf_expr_context *ctx, cu_offset die_offset)
static void
needs_dwarf_reg_entry_value (struct dwarf_expr_context *ctx,
- int dwarf_reg, CORE_ADDR fb_offset, int deref_size)
+ enum call_site_parameter_kind kind,
+ union call_site_parameter_u kind_u, int deref_size)
{
struct needs_frame_baton *nf_baton = ctx->baton;
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -7816,6 +7816,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
child_die = sibling_die (child_die))
{
struct call_site_parameter *parameter;
+ struct attribute *loc;
if (child_die->tag != DW_TAG_GNU_call_site_parameter)
{
@@ -7829,8 +7830,8 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
/* DW_AT_location specifies the register number. Value of the data
assumed for the register is contained in DW_AT_GNU_call_site_value. */
- attr = dwarf2_attr (child_die, DW_AT_location, cu);
- if (!attr || !attr_form_is_block (attr))
+ loc = dwarf2_attr (child_die, DW_AT_location, cu);
+ if (loc == NULL || !attr_form_is_block (loc))
{
complaint (&symfile_complaints,
_("No DW_FORM_block* DW_AT_location for "
@@ -7838,19 +7839,26 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
child_die->offset.sect_off, objfile->name);
continue;
}
- parameter->dwarf_reg = dwarf_block_to_dwarf_reg (DW_BLOCK (attr)->data,
- &DW_BLOCK (attr)->data[DW_BLOCK (attr)->size]);
- if (parameter->dwarf_reg == -1
- && !dwarf_block_to_sp_offset (gdbarch, DW_BLOCK (attr)->data,
- &DW_BLOCK (attr)->data[DW_BLOCK (attr)->size],
- &parameter->fb_offset))
+ else
{
- complaint (&symfile_complaints,
- _("Only single DW_OP_reg or DW_OP_fbreg is supported "
- "for DW_FORM_block* DW_AT_location for "
- "DW_TAG_GNU_call_site child DIE 0x%x [in module %s]"),
- child_die->offset.sect_off, objfile->name);
- continue;
+ parameter->u.dwarf_reg = dwarf_block_to_dwarf_reg
+ (DW_BLOCK (loc)->data, &DW_BLOCK (loc)->data[DW_BLOCK (loc)->size]);
+ if (parameter->u.dwarf_reg != -1)
+ parameter->kind = CALL_SITE_PARAMETER_DWARF_REG;
+ else if (dwarf_block_to_sp_offset (gdbarch, DW_BLOCK (loc)->data,
+ &DW_BLOCK (loc)->data[DW_BLOCK (loc)->size],
+ &parameter->u.fb_offset))
+ parameter->kind = CALL_SITE_PARAMETER_FB_OFFSET;
+ else
+ {
+ complaint (&symfile_complaints,
+ _("Only single DW_OP_reg or DW_OP_fbreg is supported "
+ "for DW_FORM_block* DW_AT_location is supported for "
+ "DW_TAG_GNU_call_site child DIE 0x%x "
+ "[in module %s]"),
+ child_die->offset.sect_off, objfile->name);
+ continue;
+ }
}
attr = dwarf2_attr (child_die, DW_AT_GNU_call_site_value, cu);
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -23,6 +23,7 @@
#define GDBTYPES_H 1
#include "hashtab.h"
+#include "dwarf2expr.h"
/* Forward declarations for prototypes. */
struct field;
@@ -915,6 +916,17 @@ struct func_type
struct call_site *tail_call_list;
};
+/* struct call_site_parameter can be referenced in callees by several ways. */
+
+enum call_site_parameter_kind
+{
+ /* Use field call_site_parameter.u.dwarf_reg. */
+ CALL_SITE_PARAMETER_DWARF_REG,
+
+ /* Use field call_site_parameter.u.fb_offset. */
+ CALL_SITE_PARAMETER_FB_OFFSET
+};
+
/* A place where a function gets called from, represented by
DW_TAG_GNU_call_site. It can be looked up from symtab->call_site_htab. */
@@ -948,15 +960,19 @@ struct call_site
/* Describe DW_TAG_GNU_call_site's DW_TAG_formal_parameter. */
struct call_site_parameter
{
- /* DW_TAG_formal_parameter's DW_AT_location's DW_OP_regX as DWARF
- register number, for register passed parameters. If -1 then use
- fb_offset. */
- int dwarf_reg;
-
- /* Offset from the callee's frame base, for stack passed parameters.
- This equals offset from the caller's stack pointer. Valid only if
- DWARF_REGNUM is -1. */
- CORE_ADDR fb_offset;
+ ENUM_BITFIELD (call_site_parameter_kind) kind : 2;
+
+ union call_site_parameter_u
+ {
+ /* DW_TAG_formal_parameter's DW_AT_location's DW_OP_regX as DWARF
+ register number, for register passed parameters. */
+ int dwarf_reg;
+
+ /* Offset from the callee's frame base, for stack passed parameters.
+ This equals offset from the caller's stack pointer. */
+ CORE_ADDR fb_offset;
+ }
+ u;
/* DW_TAG_formal_parameter's DW_AT_GNU_call_site_value. It is never
NULL. */

View File

@ -1,864 +0,0 @@
http://sourceware.org/ml/gdb-patches/2012-06/msg00459.html
Subject: [patch 2/2] Support gcc-4.7 DW_OP_GNU_parameter_ref
Hi,
this add-on to gdb.arch/amd64-entry-value.exp has been somehow forgotten:
[PATCH] Improve debug info for IPA-SRA optimized code - add DW_OP_GNU_parameter_ref support (PR debug/47858)
http://gcc.gnu.org/ml/gcc-patches/2011-06/msg00649.html
And for gcc-4.7+ -O2 -g code GDB may print (instead of the calculated value):
(gdb) p y
Unhandled dwarf expression opcode 0xfa
The support is pretty simple, there is just now third kind of binding between
callers and callees parameter values.
No regressions on {x86_64,x86_64-m32,i686}-fedora17-linux-gnu.
Thanks,
Jan
gdb/
2012-06-14 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2expr.c (execute_stack_op): Support DW_OP_GNU_parameter_ref.
* dwarf2loc.c (call_site_parameter_matches): Support
CALL_SITE_PARAMETER_PARAM_OFFSET.
(needs_dwarf_reg_entry_value): Push stub value.
* dwarf2read.c (read_call_site_scope): New variable origin. Support
CALL_SITE_PARAMETER_PARAM_OFFSET and its DW_AT_abstract_origin.
* gdbtypes.h (enum call_site_parameter_kind): New item
CALL_SITE_PARAMETER_PARAM_OFFSET.
(struct call_site.parameter.u): New field param_offset.
gdb/testsuite/
2012-06-14 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.arch/amd64-entry-value-param.S: New file.
* gdb.arch/amd64-entry-value-param.c: New file.
* gdb.arch/amd64-entry-value-param.exp: New file.
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -1392,6 +1392,21 @@ execute_stack_op (struct dwarf_expr_context *ctx,
"or for DW_OP_breg*(0)+DW_OP_deref*"));
}
+ case DW_OP_GNU_parameter_ref:
+ {
+ cu_offset offset;
+ union call_site_parameter_u kind_u;
+
+ kind_u.param_offset.cu_off = extract_unsigned_integer (op_ptr, 4,
+ byte_order);
+ op_ptr += 4;
+ ctx->funcs->push_dwarf_reg_entry_value (ctx,
+ CALL_SITE_PARAMETER_PARAM_OFFSET,
+ kind_u,
+ -1 /* deref_size */);
+ }
+ goto no_push;
+
case DW_OP_GNU_const_type:
{
cu_offset type_die;
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -943,6 +943,8 @@ call_site_parameter_matches (struct call_site_parameter *parameter,
return kind_u.dwarf_reg == parameter->u.dwarf_reg;
case CALL_SITE_PARAMETER_FB_OFFSET:
return kind_u.fb_offset == parameter->u.fb_offset;
+ case CALL_SITE_PARAMETER_PARAM_OFFSET:
+ return kind_u.param_offset.cu_off == parameter->u.param_offset.cu_off;
}
return 0;
}
@@ -2378,6 +2380,9 @@ needs_dwarf_reg_entry_value (struct dwarf_expr_context *ctx,
struct needs_frame_baton *nf_baton = ctx->baton;
nf_baton->needs_frame = 1;
+
+ /* The expression may require some stub values on DWARF stack. */
+ dwarf_expr_push_address (ctx, 0, 0);
}
/* DW_OP_GNU_addr_index doesn't require a frame. */
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -7816,7 +7816,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
child_die = sibling_die (child_die))
{
struct call_site_parameter *parameter;
- struct attribute *loc;
+ struct attribute *loc, *origin;
if (child_die->tag != DW_TAG_GNU_call_site_parameter)
{
@@ -7827,11 +7827,23 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu)
gdb_assert (call_site->parameter_count < nparams);
parameter = &call_site->parameter[call_site->parameter_count];
- /* DW_AT_location specifies the register number. Value of the data
- assumed for the register is contained in DW_AT_GNU_call_site_value. */
+ /* DW_AT_location specifies the register number or DW_AT_abstract_origin
+ specifies DW_TAG_formal_parameter. Value of the data assumed for the
+ register is contained in DW_AT_GNU_call_site_value. */
loc = dwarf2_attr (child_die, DW_AT_location, cu);
- if (loc == NULL || !attr_form_is_block (loc))
+ origin = dwarf2_attr (child_die, DW_AT_abstract_origin, cu);
+ if (loc == NULL && origin != NULL && is_ref_attr (origin))
+ {
+ sect_offset offset;
+
+ parameter->kind = CALL_SITE_PARAMETER_PARAM_OFFSET;
+ offset = dwarf2_get_ref_die_offset (origin);
+ gdb_assert (offset.sect_off >= cu->header.offset.sect_off);
+ parameter->u.param_offset.cu_off = (offset.sect_off
+ - cu->header.offset.sect_off);
+ }
+ else if (loc == NULL || origin != NULL || !attr_form_is_block (loc))
{
complaint (&symfile_complaints,
_("No DW_FORM_block* DW_AT_location for "
--- a/gdb/gdbtypes.h
+++ b/gdb/gdbtypes.h
@@ -924,7 +924,10 @@ enum call_site_parameter_kind
CALL_SITE_PARAMETER_DWARF_REG,
/* Use field call_site_parameter.u.fb_offset. */
- CALL_SITE_PARAMETER_FB_OFFSET
+ CALL_SITE_PARAMETER_FB_OFFSET,
+
+ /* Use field call_site_parameter.u.param_offset. */
+ CALL_SITE_PARAMETER_PARAM_OFFSET
};
/* A place where a function gets called from, represented by
@@ -971,6 +974,11 @@ struct call_site
/* Offset from the callee's frame base, for stack passed parameters.
This equals offset from the caller's stack pointer. */
CORE_ADDR fb_offset;
+
+ /* Offset relative to the start of this PER_CU to
+ DW_TAG_formal_parameter which is referenced by both caller and
+ the callee. */
+ cu_offset param_offset;
}
u;
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-param.S
@@ -0,0 +1,611 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 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 <http://www.gnu.org/licenses/>. */
+
+/* This file is compiled from gdb.arch/amd64-entry-value-param.c
+ using -g -dA -S -O2. */
+
+ .file "amd64-entry-value-param.c"
+ .text
+.Ltext0:
+ .p2align 4,,15
+ .type foo.isra.0.constprop.2, @function
+foo.isra.0.constprop.2:
+.LFB4:
+ .file 1 "gdb.arch/amd64-entry-value-param.c"
+ /* gdb.arch/amd64-entry-value-param.c:21 */
+ .loc 1 21 0
+ .cfi_startproc
+.LVL0:
+/* BLOCK 2 freq:10000 seq:0 */
+/* PRED: ENTRY [100.0%] (fallthru) */
+ /* gdb.arch/amd64-entry-value-param.c:26 */
+ .loc 1 26 0
+ movl vv(%rip), %eax
+ addl $1, %eax
+ movl %eax, vv(%rip)
+ /* gdb.arch/amd64-entry-value-param.c:27 */
+ .loc 1 27 0
+ leal 3(%rdi), %eax
+/* SUCC: EXIT [100.0%] */
+ /* gdb.arch/amd64-entry-value-param.c:28 */
+ .loc 1 28 0
+ ret
+ .cfi_endproc
+.LFE4:
+ .size foo.isra.0.constprop.2, .-foo.isra.0.constprop.2
+ .p2align 4,,15
+ .type bar.constprop.1, @function
+bar.constprop.1:
+.LFB5:
+ /* gdb.arch/amd64-entry-value-param.c:31 */
+ .loc 1 31 0
+ .cfi_startproc
+/* BLOCK 2 freq:10000 seq:0 */
+/* PRED: ENTRY [100.0%] (fallthru) */
+.LVL1:
+ pushq %rbx
+.LCFI0:
+ .cfi_def_cfa_offset 16
+ .cfi_offset 3, -16
+ /* gdb.arch/amd64-entry-value-param.c:33 */
+ .loc 1 33 0
+ movl $10, %edi
+ call foo.isra.0.constprop.2
+.LVL2:
+ movl $10, %edi
+ movl %eax, %ebx
+ call foo.isra.0.constprop.2
+.LVL3:
+ movl $16, %edi
+ addl %eax, %ebx
+ call foo.isra.0.constprop.2
+.LVL4:
+ leal 10(%rbx,%rax), %eax
+ /* gdb.arch/amd64-entry-value-param.c:34 */
+ .loc 1 34 0
+ popq %rbx
+.LCFI1:
+ .cfi_def_cfa_offset 8
+/* SUCC: EXIT [100.0%] */
+ ret
+ .cfi_endproc
+.LFE5:
+ .size bar.constprop.1, .-bar.constprop.1
+ .section .text.startup,"ax",@progbits
+ .p2align 4,,15
+ .globl main
+ .type main, @function
+main:
+.LFB2:
+ /* gdb.arch/amd64-entry-value-param.c:38 */
+ .loc 1 38 0
+ .cfi_startproc
+/* BLOCK 2 freq:10000 seq:0 */
+/* PRED: ENTRY [100.0%] (fallthru) */
+ /* gdb.arch/amd64-entry-value-param.c:39 */
+ .loc 1 39 0
+ jmp bar.constprop.1
+/* SUCC: EXIT [100.0%] (ab,sibcall) */
+.LVL5:
+ .cfi_endproc
+.LFE2:
+ .size main, .-main
+ .comm vv,4,4
+ .text
+.Letext0:
+ .section .debug_info,"",@progbits
+.Ldebug_info0:
+ .4byte 0x1b7 /* Length of Compilation Unit Info */
+ .2byte 0x2 /* DWARF version number */
+ .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */
+ .byte 0x8 /* Pointer Size (in bytes) */
+ .uleb128 0x1 /* (DIE (0xb) DW_TAG_compile_unit) */
+ .4byte .LASF0 /* DW_AT_producer: "GNU C 4.7.1 20120612 (prerelease)" */
+ .byte 0x1 /* DW_AT_language */
+ .4byte .LASF1 /* DW_AT_name: "gdb.arch/amd64-entry-value-param.c" */
+ .4byte .LASF2 /* DW_AT_comp_dir: "" */
+ .4byte .Ldebug_ranges0+0 /* DW_AT_ranges */
+ .quad 0 /* DW_AT_low_pc */
+ .quad 0 /* DW_AT_entry_pc */
+ .4byte .Ldebug_line0 /* DW_AT_stmt_list */
+ .uleb128 0x2 /* (DIE (0x31) DW_TAG_subprogram) */
+ .ascii "foo\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x15 /* DW_AT_decl_line */
+ .byte 0x1 /* DW_AT_prototyped */
+ .4byte 0x79 /* DW_AT_type */
+ .byte 0 /* DW_AT_inline */
+ .4byte 0x79 /* DW_AT_sibling */
+ .uleb128 0x3 /* (DIE (0x42) DW_TAG_formal_parameter) */
+ .ascii "x\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x15 /* DW_AT_decl_line */
+ .4byte 0x79 /* DW_AT_type */
+ .uleb128 0x3 /* (DIE (0x4b) DW_TAG_formal_parameter) */
+ .ascii "y\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x15 /* DW_AT_decl_line */
+ .4byte 0x79 /* DW_AT_type */
+ .uleb128 0x3 /* (DIE (0x54) DW_TAG_formal_parameter) */
+ .ascii "z\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x15 /* DW_AT_decl_line */
+ .4byte 0x79 /* DW_AT_type */
+ .uleb128 0x4 /* (DIE (0x5d) DW_TAG_variable) */
+ .ascii "a\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x17 /* DW_AT_decl_line */
+ .4byte 0x79 /* DW_AT_type */
+ .uleb128 0x4 /* (DIE (0x66) DW_TAG_variable) */
+ .ascii "b\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x18 /* DW_AT_decl_line */
+ .4byte 0x79 /* DW_AT_type */
+ .uleb128 0x4 /* (DIE (0x6f) DW_TAG_variable) */
+ .ascii "c\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x19 /* DW_AT_decl_line */
+ .4byte 0x79 /* DW_AT_type */
+ .byte 0 /* end of children of DIE 0x31 */
+ .uleb128 0x5 /* (DIE (0x79) DW_TAG_base_type) */
+ .byte 0x4 /* DW_AT_byte_size */
+ .byte 0x5 /* DW_AT_encoding */
+ .ascii "int\0" /* DW_AT_name */
+ .uleb128 0x2 /* (DIE (0x80) DW_TAG_subprogram) */
+ .ascii "bar\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x1f /* DW_AT_decl_line */
+ .byte 0x1 /* DW_AT_prototyped */
+ .4byte 0x79 /* DW_AT_type */
+ .byte 0x1 /* DW_AT_inline */
+ .4byte 0x9b /* DW_AT_sibling */
+ .uleb128 0x3 /* (DIE (0x91) DW_TAG_formal_parameter) */
+ .ascii "x\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x1f /* DW_AT_decl_line */
+ .4byte 0x79 /* DW_AT_type */
+ .byte 0 /* end of children of DIE 0x80 */
+ .uleb128 0x6 /* (DIE (0x9b) DW_TAG_subprogram) */
+ .4byte 0x31 /* DW_AT_abstract_origin */
+ .quad .LFB4 /* DW_AT_low_pc */
+ .quad .LFE4 /* 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 */
+ .4byte 0xf1 /* DW_AT_sibling */
+ .uleb128 0x7 /* (DIE (0xb8) DW_TAG_formal_parameter) */
+ .4byte 0x42 /* DW_AT_abstract_origin */
+ .byte 0x1 /* DW_AT_location */
+ .byte 0x55 /* DW_OP_reg5 */
+ .uleb128 0x7 /* (DIE (0xbf) DW_TAG_formal_parameter) */
+ .4byte 0x4b /* DW_AT_abstract_origin */
+ .byte 0x6 /* DW_AT_location */
+ .byte 0xfa /* DW_OP_GNU_parameter_ref */
+ .4byte 0x4b
+ .byte 0x9f /* DW_OP_stack_value */
+ .uleb128 0x8 /* (DIE (0xcb) DW_TAG_variable) */
+ .4byte 0x5d /* DW_AT_abstract_origin */
+ .byte 0x5 /* DW_AT_location */
+ .byte 0x75 /* DW_OP_breg5 */
+ .sleb128 0
+ .byte 0x31 /* DW_OP_lit1 */
+ .byte 0x24 /* DW_OP_shl */
+ .byte 0x9f /* DW_OP_stack_value */
+ .uleb128 0x8 /* (DIE (0xd6) DW_TAG_variable) */
+ .4byte 0x66 /* DW_AT_abstract_origin */
+ .byte 0x8 /* DW_AT_location */
+ .byte 0xfa /* DW_OP_GNU_parameter_ref */
+ .4byte 0x4b
+ .byte 0x31 /* DW_OP_lit1 */
+ .byte 0x24 /* DW_OP_shl */
+ .byte 0x9f /* DW_OP_stack_value */
+ .uleb128 0x9 /* (DIE (0xe4) DW_TAG_variable) */
+ .4byte 0x6f /* DW_AT_abstract_origin */
+ .byte 0x6 /* DW_AT_const_value */
+ .uleb128 0xa /* (DIE (0xea) DW_TAG_formal_parameter) */
+ .4byte 0x54 /* DW_AT_abstract_origin */
+ .byte 0x3 /* DW_AT_const_value */
+ .byte 0 /* end of children of DIE 0x9b */
+ .uleb128 0xb /* (DIE (0xf1) DW_TAG_subprogram) */
+ .4byte 0x80 /* DW_AT_abstract_origin */
+ .quad .LFB5 /* DW_AT_low_pc */
+ .quad .LFE5 /* DW_AT_high_pc */
+ .4byte .LLST0 /* DW_AT_frame_base */
+ .byte 0x1 /* DW_AT_GNU_all_call_sites */
+ .4byte 0x16c /* DW_AT_sibling */
+ .uleb128 0xa /* (DIE (0x10f) DW_TAG_formal_parameter) */
+ .4byte 0x91 /* DW_AT_abstract_origin */
+ .byte 0xa /* DW_AT_const_value */
+ .uleb128 0xc /* (DIE (0x115) DW_TAG_GNU_call_site) */
+ .quad .LVL2 /* DW_AT_low_pc */
+ .4byte 0x9b /* DW_AT_abstract_origin */
+ .4byte 0x133 /* DW_AT_sibling */
+ .uleb128 0xd /* (DIE (0x126) 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 0x3a /* DW_OP_lit10 */
+ .uleb128 0xe /* (DIE (0x12b) DW_TAG_GNU_call_site_parameter) */
+ .4byte 0x4b /* DW_AT_abstract_origin */
+ .byte 0x1 /* DW_AT_GNU_call_site_value */
+ .byte 0x32 /* DW_OP_lit2 */
+ .byte 0 /* end of children of DIE 0x115 */
+ .uleb128 0xc /* (DIE (0x133) DW_TAG_GNU_call_site) */
+ .quad .LVL3 /* DW_AT_low_pc */
+ .4byte 0x9b /* DW_AT_abstract_origin */
+ .4byte 0x151 /* DW_AT_sibling */
+ .uleb128 0xd /* (DIE (0x144) 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 0x3a /* DW_OP_lit10 */
+ .uleb128 0xe /* (DIE (0x149) DW_TAG_GNU_call_site_parameter) */
+ .4byte 0x4b /* DW_AT_abstract_origin */
+ .byte 0x1 /* DW_AT_GNU_call_site_value */
+ .byte 0x34 /* DW_OP_lit4 */
+ .byte 0 /* end of children of DIE 0x133 */
+ .uleb128 0xf /* (DIE (0x151) DW_TAG_GNU_call_site) */
+ .quad .LVL4 /* DW_AT_low_pc */
+ .4byte 0x9b /* DW_AT_abstract_origin */
+ .uleb128 0xd /* (DIE (0x15e) 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 0x40 /* DW_OP_lit16 */
+ .uleb128 0xe /* (DIE (0x163) DW_TAG_GNU_call_site_parameter) */
+ .4byte 0x4b /* DW_AT_abstract_origin */
+ .byte 0x1 /* DW_AT_GNU_call_site_value */
+ .byte 0x3a /* DW_OP_lit10 */
+ .byte 0 /* end of children of DIE 0x151 */
+ .byte 0 /* end of children of DIE 0xf1 */
+ .uleb128 0x10 /* (DIE (0x16c) DW_TAG_subprogram) */
+ .byte 0x1 /* DW_AT_external */
+ .4byte .LASF3 /* DW_AT_name: "main" */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x25 /* DW_AT_decl_line */
+ .byte 0x1 /* DW_AT_prototyped */
+ .4byte 0x79 /* DW_AT_type */
+ .quad .LFB2 /* DW_AT_low_pc */
+ .quad .LFE2 /* 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 */
+ .4byte 0x1a0 /* DW_AT_sibling */
+ .uleb128 0x11 /* (DIE (0x191) DW_TAG_GNU_call_site) */
+ .quad .LVL5 /* DW_AT_low_pc */
+ .byte 0x1 /* DW_AT_GNU_tail_call */
+ .4byte 0xf1 /* DW_AT_abstract_origin */
+ .byte 0 /* end of children of DIE 0x16c */
+ .uleb128 0x12 /* (DIE (0x1a0) DW_TAG_variable) */
+ .ascii "vv\0" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_decl_file (gdb.arch/amd64-entry-value-param.c) */
+ .byte 0x12 /* DW_AT_decl_line */
+ .4byte 0x1b5 /* DW_AT_type */
+ .byte 0x1 /* DW_AT_external */
+ .byte 0x9 /* DW_AT_location */
+ .byte 0x3 /* DW_OP_addr */
+ .quad vv
+ .uleb128 0x13 /* (DIE (0x1b5) DW_TAG_volatile_type) */
+ .4byte 0x79 /* DW_AT_type */
+ .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 0x2e /* (TAG: DW_TAG_subprogram) */
+ .byte 0x1 /* DW_children_yes */
+ .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 0x27 /* (DW_AT_prototyped) */
+ .uleb128 0xc /* (DW_FORM_flag) */
+ .uleb128 0x49 /* (DW_AT_type) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x20 /* (DW_AT_inline) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .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) */
+ .byte 0
+ .byte 0
+ .uleb128 0x4 /* (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) */
+ .byte 0
+ .byte 0
+ .uleb128 0x5 /* (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 0x6 /* (abbrev code) */
+ .uleb128 0x2e /* (TAG: DW_TAG_subprogram) */
+ .byte 0x1 /* DW_children_yes */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .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 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 0x7 /* (abbrev code) */
+ .uleb128 0x5 /* (TAG: DW_TAG_formal_parameter) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x2 /* (DW_AT_location) */
+ .uleb128 0xa /* (DW_FORM_block1) */
+ .byte 0
+ .byte 0
+ .uleb128 0x8 /* (abbrev code) */
+ .uleb128 0x34 /* (TAG: DW_TAG_variable) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x2 /* (DW_AT_location) */
+ .uleb128 0xa /* (DW_FORM_block1) */
+ .byte 0
+ .byte 0
+ .uleb128 0x9 /* (abbrev code) */
+ .uleb128 0x34 /* (TAG: DW_TAG_variable) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x1c /* (DW_AT_const_value) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .byte 0
+ .byte 0
+ .uleb128 0xa /* (abbrev code) */
+ .uleb128 0x5 /* (TAG: DW_TAG_formal_parameter) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x1c /* (DW_AT_const_value) */
+ .uleb128 0xb /* (DW_FORM_data1) */
+ .byte 0
+ .byte 0
+ .uleb128 0xb /* (abbrev code) */
+ .uleb128 0x2e /* (TAG: DW_TAG_subprogram) */
+ .byte 0x1 /* DW_children_yes */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .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 0xc /* (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) */
+ .uleb128 0x1 /* (DW_AT_sibling) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .byte 0
+ .byte 0
+ .uleb128 0xd /* (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 0xe /* (abbrev code) */
+ .uleb128 0x410a /* (TAG: DW_TAG_GNU_call_site_parameter) */
+ .byte 0 /* DW_children_no */
+ .uleb128 0x31 /* (DW_AT_abstract_origin) */
+ .uleb128 0x13 /* (DW_FORM_ref4) */
+ .uleb128 0x2111 /* (DW_AT_GNU_call_site_value) */
+ .uleb128 0xa /* (DW_FORM_block1) */
+ .byte 0
+ .byte 0
+ .uleb128 0xf /* (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 0x10 /* (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 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 0x11 /* (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 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 0x12 /* (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 0x13 /* (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
+ .byte 0
+ .section .debug_loc,"",@progbits
+.Ldebug_loc0:
+.LLST0:
+ .quad .LFB5 /* Location list begin address (*.LLST0) */
+ .quad .LCFI0 /* Location list end address (*.LLST0) */
+ .2byte 0x2 /* Location expression size */
+ .byte 0x77 /* DW_OP_breg7 */
+ .sleb128 8
+ .quad .LCFI0 /* Location list begin address (*.LLST0) */
+ .quad .LCFI1 /* Location list end address (*.LLST0) */
+ .2byte 0x2 /* Location expression size */
+ .byte 0x77 /* DW_OP_breg7 */
+ .sleb128 16
+ .quad .LCFI1 /* Location list begin address (*.LLST0) */
+ .quad .LFE5 /* Location list end address (*.LLST0) */
+ .2byte 0x2 /* Location expression size */
+ .byte 0x77 /* DW_OP_breg7 */
+ .sleb128 8
+ .quad 0 /* Location list terminator begin (*.LLST0) */
+ .quad 0 /* Location list terminator end (*.LLST0) */
+ .section .debug_aranges,"",@progbits
+ .4byte 0x3c /* Length of Address Ranges Info */
+ .2byte 0x2 /* DWARF Version */
+ .4byte .Ldebug_info0 /* Offset of Compilation Unit Info */
+ .byte 0x8 /* Size of Address */
+ .byte 0 /* Size of Segment Descriptor */
+ .2byte 0 /* Pad to 16 byte boundary */
+ .2byte 0
+ .quad .Ltext0 /* Address */
+ .quad .Letext0-.Ltext0 /* Length */
+ .quad .LFB2 /* Address */
+ .quad .LFE2-.LFB2 /* Length */
+ .quad 0
+ .quad 0
+ .section .debug_ranges,"",@progbits
+.Ldebug_ranges0:
+ .quad .Ltext0 /* Offset 0 */
+ .quad .Letext0
+ .quad .LFB2 /* Offset 0x10 */
+ .quad .LFE2
+ .quad 0
+ .quad 0
+ .section .debug_line,"",@progbits
+.Ldebug_line0:
+ .section .debug_str,"MS",@progbits,1
+.LASF1:
+ .string "gdb.arch/amd64-entry-value-param.c"
+.LASF3:
+ .string "main"
+.LASF2:
+ .string ""
+.LASF0:
+ .string "GNU C 4.7.1 20120612 (prerelease)"
+ .ident "GCC: (GNU) 4.7.1 20120612 (prerelease)"
+ .section .note.GNU-stack,"",@progbits
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-param.c
@@ -0,0 +1,40 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2012 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 <http://www.gnu.org/licenses/>. */
+
+volatile int vv;
+
+static __attribute__((noinline)) int
+foo (int x, int y, int z)
+{
+ int a = x * 2;
+ int b = y * 2;
+ int c = z * 2;
+ vv++; /* break-here */
+ return x + z;
+}
+
+static __attribute__((noinline)) int
+bar (int x)
+{
+ return foo (x, 2, 3) + foo (x, 4, 3) + foo (x + 6, x, 3) + x;
+}
+
+int
+main (void)
+{
+ return bar (10);
+}
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/amd64-entry-value-param.exp
@@ -0,0 +1,51 @@
+# Copyright (C) 2012 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 <http://www.gnu.org/licenses/>.
+
+set testfile amd64-entry-value-param
+set srcfile ${testfile}.S
+set csrcfile ${testfile}.c
+set opts {}
+
+if [info exists COMPILE] {
+ # make check RUNTESTFLAGS="gdb.arch/amd64-entry-value-param.exp COMPILE=1"
+ set srcfile ${csrcfile}
+ lappend opts debug optimize=-O2
+} elseif { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
+ verbose "Skipping amd64-entry-value-param."
+ return
+}
+
+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} $opts] } {
+ return -1
+}
+
+if ![runto_main] {
+ return -1
+}
+
+set srcfile $csrcfile
+gdb_breakpoint [gdb_get_line_number "break-here"]
+
+gdb_continue_to_breakpoint "break-here" ".* break-here .*"
+gdb_test "p y" " = 2"
+gdb_test "p b" " = 4"
+
+gdb_continue_to_breakpoint "break-here" ".* break-here .*"
+gdb_test "p y" " = 4"
+gdb_test "p b" " = 8"
+
+gdb_continue_to_breakpoint "break-here" ".* break-here .*"
+gdb_test "p y" " = 10"
+gdb_test "p b" " = 20"

View File

@ -1,10 +1,10 @@
Some functionality is available on RHEL-5.4+ only with gcc44 and gfortran44 as Some functionality is available on RHEL-5.4+ only with gcc44 and gfortran44 as
the default gcc and gfortran binaries are from gcc-4.1. the default gcc and gfortran binaries are from gcc-4.1.
Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.base/vla.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/vla.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20111218.orig/gdb/testsuite/gdb.base/vla.exp 2011-12-18 23:35:23.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.base/vla.exp 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/testsuite/gdb.base/vla.exp 2011-12-19 02:27:16.745327844 +0100 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.base/vla.exp 2012-07-03 17:50:57.999207540 +0200
@@ -16,7 +16,25 @@ @@ -16,7 +16,25 @@
set testfile vla set testfile vla
set srcfile ${testfile}.c set srcfile ${testfile}.c
@ -32,11 +32,11 @@ Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.base/vla.exp
untested "Couldn't compile test program" untested "Couldn't compile test program"
return -1 return -1
} }
Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.base/break-interp.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/break-interp.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20111218.orig/gdb/testsuite/gdb.base/break-interp.exp 2011-12-19 02:21:56.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.base/break-interp.exp 2012-07-03 17:44:45.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/testsuite/gdb.base/break-interp.exp 2011-12-19 02:27:16.745327844 +0100 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.base/break-interp.exp 2012-07-03 17:50:58.000207539 +0200
@@ -34,9 +34,29 @@ if [get_compiler_info ${binfile_lib}] { @@ -34,9 +34,29 @@ if [get_compiler_info] {
return -1 return -1
} }
@ -67,10 +67,10 @@ Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.base/break-interp.exp
return -1 return -1
} }
Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/common-block.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/common-block.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20111218.orig/gdb/testsuite/gdb.fortran/common-block.exp 2011-12-19 01:31:24.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/common-block.exp 2012-07-03 17:36:21.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/common-block.exp 2011-12-19 02:27:16.746327840 +0100 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/common-block.exp 2012-07-03 17:50:58.001207537 +0200
@@ -20,7 +20,25 @@ set testfile "common-block" @@ -20,7 +20,25 @@ set testfile "common-block"
set srcfile ${testfile}.f90 set srcfile ${testfile}.f90
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
@ -98,10 +98,10 @@ Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/common-block.exp
untested "Couldn't compile ${srcfile}" untested "Couldn't compile ${srcfile}"
return -1 return -1
} }
Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/dwarf-stride.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/dwarf-stride.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20111218.orig/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2011-12-18 23:35:23.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2011-12-19 02:27:16.746327840 +0100 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2012-07-03 17:50:58.002207535 +0200
@@ -27,7 +27,25 @@ @@ -27,7 +27,25 @@
set testfile dwarf-stride set testfile dwarf-stride
set srcfile ${testfile}.f90 set srcfile ${testfile}.f90
@ -129,10 +129,10 @@ Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/dwarf-stride.exp
return -1 return -1
} }
Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/dynamic.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/dynamic.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20111218.orig/gdb/testsuite/gdb.fortran/dynamic.exp 2011-12-18 23:35:23.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/dynamic.exp 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/dynamic.exp 2011-12-19 02:27:16.746327840 +0100 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/dynamic.exp 2012-07-03 17:50:58.002207535 +0200
@@ -25,7 +25,25 @@ set testfile "dynamic" @@ -25,7 +25,25 @@ set testfile "dynamic"
set srcfile ${testfile}.f90 set srcfile ${testfile}.f90
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
@ -160,15 +160,15 @@ Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/dynamic.exp
untested "Couldn't compile ${srcfile}" untested "Couldn't compile ${srcfile}"
return -1 return -1
} }
Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/library-module.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/library-module.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20111218.orig/gdb/testsuite/gdb.fortran/library-module.exp 2011-11-30 09:24:32.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/library-module.exp 2012-06-25 22:51:35.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/library-module.exp 2011-12-19 02:31:10.991318026 +0100 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/library-module.exp 2012-07-03 17:52:57.666062981 +0200
@@ -25,16 +25,34 @@ if [get_compiler_info not-used] { @@ -23,16 +23,34 @@ if [get_compiler_info] {
return -1 return -1
} }
-if { [gdb_compile_shlib "${srcdir}/${subdir}/${srclibfile}" $objdir/$subdir/$libfile {debug f90}] != "" } { -if { [gdb_compile_shlib "${srcdir}/${subdir}/${srclibfile}" $libfile {debug f90}] != "" } {
- untested "Couldn't compile ${srclibfile}" - untested "Couldn't compile ${srclibfile}"
- return -1 - return -1
+# Temporarily provide f90compiler=gfortran44 saving the original value around. +# Temporarily provide f90compiler=gfortran44 saving the original value around.
@ -186,9 +186,9 @@ Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/library-module.exp
# just for the linking phase (and not the source compilation phase). And any # just for the linking phase (and not the source compilation phase). And any
# warnings on ignored $libfile abort the process. # warnings on ignored $libfile abort the process.
-if { [gdb_compile $srcdir/$subdir/$srcfile $objdir/$subdir/$binfile executable [list debug f90 shlib=$objdir/$subdir/$libfile]] != "" } { -if { [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list debug f90 shlib=$libfile]] != "" } {
+set err1 [gdb_compile_shlib "${srcdir}/${subdir}/${srclibfile}" $objdir/$subdir/$libfile {debug f90}] +set err1 [gdb_compile_shlib "${srcdir}/${subdir}/${srclibfile}" $libfile {debug f90}]
+set err2 [gdb_compile $srcdir/$subdir/$srcfile $objdir/$subdir/$binfile executable [list debug f90 shlib=$objdir/$subdir/$libfile]] +set err2 [gdb_compile $srcdir/$subdir/$srcfile $binfile executable [list debug f90 shlib=$libfile]]
+ +
+unset_board_info f90compiler +unset_board_info f90compiler
+if [info exists old_f90compiler] { +if [info exists old_f90compiler] {
@ -203,13 +203,13 @@ Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/library-module.exp
untested "Couldn't compile ${srcfile}" untested "Couldn't compile ${srcfile}"
return -1 return -1
} }
Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/module.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/module.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20111218.orig/gdb/testsuite/gdb.fortran/module.exp 2011-06-30 00:05:16.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/module.exp 2012-06-25 22:51:35.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/module.exp 2011-12-19 02:27:16.747327836 +0100 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/module.exp 2012-07-03 17:53:56.464992086 +0200
@@ -16,7 +16,25 @@ @@ -15,7 +15,25 @@
set testfile "module"
set srcfile ${testfile}.f90 standard_testfile .f90
-if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}] } { -if { [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}] } {
+# Temporarily provide f90compiler=gfortran44 saving the original value around. +# Temporarily provide f90compiler=gfortran44 saving the original value around.
@ -234,10 +234,10 @@ Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/module.exp
return -1 return -1
} }
Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/string.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/string.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20111218.orig/gdb/testsuite/gdb.fortran/string.exp 2011-12-18 23:35:23.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/string.exp 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/string.exp 2011-12-19 02:27:16.747327836 +0100 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/string.exp 2012-07-03 17:50:58.005207532 +0200
@@ -23,7 +23,25 @@ set testfile "string" @@ -23,7 +23,25 @@ set testfile "string"
set srcfile ${testfile}.f90 set srcfile ${testfile}.f90
set binfile ${objdir}/${subdir}/${testfile} set binfile ${objdir}/${subdir}/${testfile}
@ -265,10 +265,10 @@ Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/string.exp
untested "Couldn't compile ${srcfile}" untested "Couldn't compile ${srcfile}"
return -1 return -1
} }
Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/omp-step.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/omp-step.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20111218.orig/gdb/testsuite/gdb.fortran/omp-step.exp 2011-12-19 01:31:24.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/omp-step.exp 2012-07-03 17:36:21.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/omp-step.exp 2011-12-19 02:27:16.748327832 +0100 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/omp-step.exp 2012-07-03 17:50:58.006207531 +0200
@@ -15,7 +15,26 @@ @@ -15,7 +15,26 @@
set testfile "omp-step" set testfile "omp-step"
@ -297,16 +297,15 @@ Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/omp-step.exp
return -1 return -1
} }
Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/derived-type.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/derived-type.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20111218.orig/gdb/testsuite/gdb.fortran/derived-type.exp 2011-06-29 19:50:47.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/derived-type.exp 2012-06-25 22:51:35.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/derived-type.exp 2011-12-19 02:27:16.748327832 +0100 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/derived-type.exp 2012-07-03 17:55:46.583858849 +0200
@@ -28,8 +28,26 @@ set testfile "derived-type" @@ -22,7 +22,25 @@ if { [skip_fortran_tests] } { return -1
set srcfile ${testfile}.f90
set binfile ${objdir}/${subdir}/${testfile}
-if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ standard_testfile .f90
- executable {debug f90}] != ""} {
-if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} {
+# Temporarily provide f90compiler=gfortran44 saving the original value around. +# Temporarily provide f90compiler=gfortran44 saving the original value around.
+ +
+set board [target_info name] +set board [target_info name]
@ -318,28 +317,26 @@ Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/derived-type.exp
+} +}
+set_board_info f90compiler gfortran44 +set_board_info f90compiler gfortran44
+ +
+set err [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ +set err [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]
+ executable {debug f90}]
+ +
+unset_board_info f90compiler +unset_board_info f90compiler
+if [info exists old_f90compiler] { +if [info exists old_f90compiler] {
+ set_board_info f90compiler $old_f90compiler + set_board_info f90compiler $old_f90compiler
+} +}
+ +
+if { $err != "" } { +if $err {
return -1 return -1
} }
Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/subarray.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/subarray.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20111218.orig/gdb/testsuite/gdb.fortran/subarray.exp 2011-06-29 19:50:47.000000000 +0200 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.fortran/subarray.exp 2012-06-25 22:51:35.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/subarray.exp 2011-12-19 02:27:16.748327832 +0100 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.fortran/subarray.exp 2012-07-03 17:56:20.454818198 +0200
@@ -28,8 +28,26 @@ set testfile "subarray" @@ -22,7 +22,25 @@ if { [skip_fortran_tests] } { return -1
set srcfile ${testfile}.f
set binfile ${objdir}/${subdir}/${testfile}
-if {[gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ standard_testfile .f
- executable {debug f90}] != ""} {
-if {[prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]} {
+# Temporarily provide f90compiler=gfortran44 saving the original value around. +# Temporarily provide f90compiler=gfortran44 saving the original value around.
+ +
+set board [target_info name] +set board [target_info name]
@ -351,22 +348,21 @@ Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.fortran/subarray.exp
+} +}
+set_board_info f90compiler gfortran44 +set_board_info f90compiler gfortran44
+ +
+set err [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ +set err [prepare_for_testing $testfile.exp $testfile $srcfile {debug f90}]
+ executable {debug f90}]
+ +
+unset_board_info f90compiler +unset_board_info f90compiler
+if [info exists old_f90compiler] { +if [info exists old_f90compiler] {
+ set_board_info f90compiler $old_f90compiler + set_board_info f90compiler $old_f90compiler
+} +}
+ +
+if { $err != "" } { +if $err {
return -1 return -1
} }
Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.threads/tls-sepdebug.exp Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/tls-sepdebug.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20111218.orig/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2011-12-19 00:28:11.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2012-07-03 17:32:05.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2011-12-19 02:27:16.748327832 +0100 +++ gdb-7.4.50.20120703/gdb/testsuite/gdb.threads/tls-sepdebug.exp 2012-07-03 17:50:58.007207530 +0200
@@ -32,7 +32,25 @@ set binshareddebugfile ${objdir}/${subdi @@ -32,7 +32,25 @@ set binshareddebugfile ${objdir}/${subdi
# FIXME: gcc dependency (-Wl,-soname). # FIXME: gcc dependency (-Wl,-soname).
@ -394,10 +390,10 @@ Index: gdb-7.4.50.20111218/gdb/testsuite/gdb.threads/tls-sepdebug.exp
untested "Couldn't compile test library" untested "Couldn't compile test library"
return -1 return -1
} }
Index: gdb-7.4.50.20111218/gdb/testsuite/lib/prelink-support.exp Index: gdb-7.4.50.20120703/gdb/testsuite/lib/prelink-support.exp
=================================================================== ===================================================================
--- gdb-7.4.50.20111218.orig/gdb/testsuite/lib/prelink-support.exp 2011-12-19 02:21:56.000000000 +0100 --- gdb-7.4.50.20120703.orig/gdb/testsuite/lib/prelink-support.exp 2012-07-03 17:44:45.000000000 +0200
+++ gdb-7.4.50.20111218/gdb/testsuite/lib/prelink-support.exp 2011-12-19 02:27:16.749327828 +0100 +++ gdb-7.4.50.20120703/gdb/testsuite/lib/prelink-support.exp 2012-07-03 17:50:58.008207529 +0200
@@ -119,9 +119,31 @@ proc file_copy {src dest} { @@ -119,9 +119,31 @@ proc file_copy {src dest} {
proc build_executable_own_libs {testname executable sources options {interp ""} {dir ""}} { proc build_executable_own_libs {testname executable sources options {interp ""} {dir ""}} {
global objdir subdir global objdir subdir

View File

@ -1,293 +0,0 @@
http://sourceware.org/ml/gdb-patches/2012-06/msg00065.html
Subject: [commit 1/2] testsuite: code_elim.exp: unique names
Hi,
this is just removal of non-unique test names and one small simplification.
Checked in.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2012-06/msg00011.html
### src/gdb/testsuite/ChangeLog 2012/05/28 20:37:29 1.3209
### src/gdb/testsuite/ChangeLog 2012/06/03 17:06:04 1.3210
## -1,3 +1,16 @@
+2012-06-03 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * gdb.base/code_elim.exp (add-symbol-file ${testfile1} 0x100000):
+ Simplify it to ...
+ (symbol-file ${testfile1}): ... here.
+ (test eliminated var my_global_symbol)
+ (test eliminated var my_static_symbol)
+ (test eliminated var my_global_func, get address of main): Wrap them to
+ 'single psymtabs' and 'single symtabs'
+ (get address of my_global_symbol, get address of my_static_symbol)
+ (get address of my_global_func, get address of main): Wrap them to
+ 'order1' and 'order2'.
+
2012-05-28 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.server/solib-list-lib.c: New file.
--- src/gdb/testsuite/gdb.base/code_elim.exp 2012/01/16 16:21:44 1.4
+++ src/gdb/testsuite/gdb.base/code_elim.exp 2012/06/03 17:06:04 1.5
@@ -95,16 +95,16 @@
gdb_exit
gdb_start
-gdb_test "add-symbol-file ${binfile1} 0x100000" \
+gdb_test "symbol-file ${binfile1}" \
"Reading symbols from .*${testfile1}\\.\\.\\.done\\.(|\r\nUsing host libthread_db library .*libthread_db.so.*\\.)" \
- "add-symbol-file ${testfile1} 0x100000" \
- "add symbol table from file \".*${testfile1}\" at\[ \t\r\n\]+\.text_addr = 0x100000\[\r\n\]+\\(y or n\\) " \
- "y"
+ "symbol-file ${testfile1}"
-test_eliminated_var my_global_symbol
-test_eliminated_var my_static_symbol
-test_eliminated_var my_global_func
-not_null_var_address main
+with_test_prefix "single psymtabs" {
+ test_eliminated_var my_global_symbol
+ test_eliminated_var my_static_symbol
+ test_eliminated_var my_global_func
+ not_null_var_address main
+}
# Same thing for symtabs
@@ -115,10 +115,12 @@
gdb_start
set GDBFLAGS $saved_gdbflags
-test_eliminated_var my_global_symbol
-test_eliminated_var my_static_symbol
-test_eliminated_var my_global_func
-not_null_var_address main
+with_test_prefix "single symtabs" {
+ test_eliminated_var my_global_symbol
+ test_eliminated_var my_static_symbol
+ test_eliminated_var my_global_func
+ not_null_var_address main
+}
# binfile2 contains the symbols that have been eliminated in binfile1. Check
# the eliminated symbols does not hide these valid ones.
@@ -138,10 +140,12 @@
"add symbol table from file \".*${testfile2}\" at\[ \t\r\n\]+\.text_addr = 0x200000\[\r\n\]+\\(y or n\\) " \
"y"
-not_null_var_address my_global_symbol
-not_null_var_address my_static_symbol
-not_null_var_address my_global_func
-not_null_var_address main
+with_test_prefix "order1" {
+ not_null_var_address my_global_symbol
+ not_null_var_address my_static_symbol
+ not_null_var_address my_global_func
+ not_null_var_address main
+}
# Same thing, but loading binfile2 before binfile1.
@@ -160,9 +164,9 @@
"add symbol table from file \".*${testfile1}\" at\[ \t\r\n\]+\.text_addr = 0x100000\[\r\n\]+\\(y or n\\) " \
"y"
-not_null_var_address my_global_symbol
-not_null_var_address my_static_symbol
-not_null_var_address my_global_func
-not_null_var_address main
-
-
+with_test_prefix "order2" {
+ not_null_var_address my_global_symbol
+ not_null_var_address my_static_symbol
+ not_null_var_address my_global_func
+ not_null_var_address main
+}
http://sourceware.org/ml/gdb-patches/2012-06/msg00066.html
Subject: [commit 2/2] testsuite: code_elim.exp: Fix false FAIL
Hi,
with Fedora 18 x86_64 (Rawhide) there is a false FAIl since:
2167931cf70f91206efb8b01e848a55d82a347ce is the first bad commit
Author: Tom Tromey <tromey@redhat.com>
Date: Fri May 18 15:31:39 2012 +0000
http://sourceware.org/bugzilla/show_bug.cgi?id=13907
print &my_global_symbol
-$1 = (int *) 0x804a004
-(gdb) PASS: gdb.base/code_elim.exp: get address of my_global_symbol
+$1 = (int *) 0x804a004 <completed.5732>
+(gdb) FAIL: gdb.base/code_elim.exp: get address of my_global_symbol
Nothing really changed, just GDB now prints <completed.5732> and the testcase
expects either none or <my_global_symbol> suffix.
This is because the two symbol files (their sections .data/.bss) have
overlapped so GDB chooses randomly which symbol to display. And since
Fedora 18 GCC puts there that "completed.5732" symbol.
This may be because add-symbol-file FILE ADDR relocates to ADDR on the .text
section and leaves other sections at their original place, which is IMO a bit
unexpected; it is a FAQ people expect more ADDR to be relocation displacement
(and not relative to .text and not limited to .text). But this is really
outside of the scope of this testcase false FAIL.
Checked in.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2012-06/msg00012.html
### src/gdb/testsuite/ChangeLog 2012/06/03 17:06:04 1.3210
### src/gdb/testsuite/ChangeLog 2012/06/03 17:10:28 1.3211
## -11,6 +11,16 @@
(get address of my_global_func, get address of main): Wrap them to
'order1' and 'order2'.
+ * gdb.base/code_elim.exp
+ (add-symbol-file ${testfile1} 0x100000)
+ (add-symbol-file ${testfile2} 0x200000): Wrap them to 'order1' and
+ 'order2'.
+ (order1: add-symbol-file ${testfile1} 0x100000)
+ (order1: add-symbol-file ${testfile2} 0x200000)
+ (order2: add-symbol-file ${testfile2} 0x200000)
+ (order2: add-symbol-file ${testfile1} 0x100000): Add -s .data and -s
+ .bss as appropriate.
+
2012-05-28 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.server/solib-list-lib.c: New file.
--- src/gdb/testsuite/gdb.base/code_elim.exp 2012/06/03 17:06:04 1.5
+++ src/gdb/testsuite/gdb.base/code_elim.exp 2012/06/03 17:10:28 1.6
@@ -128,19 +128,19 @@
gdb_exit
gdb_start
-gdb_test "add-symbol-file ${binfile1} 0x100000" \
- "Reading symbols from .*${testfile1}\\.\\.\\.done\\." \
- "add-symbol-file ${testfile1} 0x100000" \
- "add symbol table from file \".*${testfile1}\" at\[ \t\r\n\]+\.text_addr = 0x100000\[\r\n\]+\\(y or n\\) " \
- "y"
-
-gdb_test "add-symbol-file ${binfile2} 0x200000" \
- "Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
- "add-symbol-file ${testfile2} 0x200000" \
- "add symbol table from file \".*${testfile2}\" at\[ \t\r\n\]+\.text_addr = 0x200000\[\r\n\]+\\(y or n\\) " \
- "y"
-
with_test_prefix "order1" {
+ gdb_test "add-symbol-file ${binfile1} 0x100000 -s .bss 0x120000" \
+ "Reading symbols from .*${testfile1}\\.\\.\\.done\\." \
+ "add-symbol-file ${testfile1} 0x100000" \
+ "add symbol table from file \".*${testfile1}\" at.*\\(y or n\\) " \
+ "y"
+
+ gdb_test "add-symbol-file ${binfile2} 0x200000 -s .data 0x210000 -s .bss 0x220000" \
+ "Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
+ "add-symbol-file ${testfile2} 0x200000" \
+ "add symbol table from file \".*${testfile2}\" at.*\\(y or n\\) " \
+ "y"
+
not_null_var_address my_global_symbol
not_null_var_address my_static_symbol
not_null_var_address my_global_func
@@ -152,19 +152,19 @@
gdb_exit
gdb_start
-gdb_test "add-symbol-file ${binfile2} 0x200000" \
- "Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
- "add-symbol-file ${testfile2} 0x200000" \
- "add symbol table from file \".*${testfile2}\" at\[ \t\r\n\]+\.text_addr = 0x200000\[\r\n\]+\\(y or n\\) " \
- "y"
-
-gdb_test "add-symbol-file ${binfile1} 0x100000" \
- "Reading symbols from .*${testfile1}\\.\\.\\.done\\." \
- "add-symbol-file ${testfile1} 0x100000" \
- "add symbol table from file \".*${testfile1}\" at\[ \t\r\n\]+\.text_addr = 0x100000\[\r\n\]+\\(y or n\\) " \
- "y"
-
with_test_prefix "order2" {
+ gdb_test "add-symbol-file ${binfile2} 0x200000 -s .data 0x210000 -s .bss 0x220000" \
+ "Reading symbols from .*${testfile2}\\.\\.\\.done\\." \
+ "add-symbol-file ${testfile2} 0x200000" \
+ "add symbol table from file \".*${testfile2}\" at.*\\(y or n\\) " \
+ "y"
+
+ gdb_test "add-symbol-file ${binfile1} 0x100000 -s .bss 0x120000" \
+ "Reading symbols from .*${testfile1}\\.\\.\\.done\\." \
+ "add-symbol-file ${testfile1} 0x100000" \
+ "add symbol table from file \".*${testfile1}\" at.*\\(y or n\\) " \
+ "y"
+
not_null_var_address my_global_symbol
not_null_var_address my_static_symbol
not_null_var_address my_global_func
http://sourceware.org/ml/gdb-cvs/2012-06/msg00047.html
### src/gdb/ChangeLog 2012/06/06 06:04:42 1.14330
### src/gdb/ChangeLog 2012/06/06 16:57:34 1.14331
## -1,3 +1,8 @@
+2012-06-06 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * configure.ac: Move development=true below AC_INIT.
+ * configure: Regenerate.
+
2012-06-05 Stan Shebs <stan@codesourcery.com>
* mi/mi-interp.c (mi_interpreter_init): Set raw_stdout from
--- src/gdb/configure 2012/06/01 18:20:18 1.366
+++ src/gdb/configure 2012/06/06 16:57:36 1.367
@@ -2683,6 +2683,11 @@
+# Provide more thorough testing by -lmcheck.
+# Set it to 'true' for development snapshots, 'false' for releases or
+# pre-releases.
+development=true
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
--- src/gdb/configure.ac 2012/06/01 18:20:18 1.177
+++ src/gdb/configure.ac 2012/06/06 16:57:38 1.178
@@ -18,16 +18,16 @@
dnl Process this file with autoconf to produce a configure script.
-dnl Provide more thorough testing by -lmcheck.
-dnl Set it to 'true' for development snapshots, 'false' for releases or
-dnl pre-releases.
-development=true
-
AC_PREREQ(2.59)dnl
AC_INIT(main.c)
AC_CONFIG_HEADER(config.h:config.in)
AM_MAINTAINER_MODE
+# Provide more thorough testing by -lmcheck.
+# Set it to 'true' for development snapshots, 'false' for releases or
+# pre-releases.
+development=true
+
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
ACX_LARGEFILE

View File

@ -1,119 +0,0 @@
http://sourceware.org/ml/gdb-patches/2012-03/msg00357.html
Subject: [patch 1/2] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #5
Hi,
posted as a new thread.
As described in
cancel: [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #4 [Re: [revert] Regression on PowerPC]
http://sourceware.org/ml/gdb-patches/2012-03/msg00322.html
just ON_STACK had some regressions.
The expectations in that mail were wrong (at least that cleanup/fix is not
required for gdb.cp/gdb2495.exp).
The problem is that the inferior call return pad breakpoint instruction is
never removed even after inferior call finishes. It is even still visible in
"maintenance info breakpoints". This does not matter much for AT_ENTRY_POINT
but for ON_STACK it just corrupts stack.
No regressions on
{x86_64,x86_64-m32,i686}-fedora(15-rawhide)/rhel(5-6)-linux-gnu and for
gdbsever non-extended mode.
Thanks,
Jan
gdb/
2012-03-09 Jan Kratochvil <jan.kratochvil@redhat.com>
Remove momentary breakpoints for completed inferior calls.
* dummy-frame.c: Include gdbthread.h.
(pop_dummy_frame_bpt): New function.
(pop_dummy_frame): Initialie DUMMY earlier. Call pop_dummy_frame_bpt.
gdb/testsuite/
2012-03-09 Jan Kratochvil <jan.kratochvil@redhat.com>
Remove momentary breakpoints for completed inferior calls.
* gdb.base/call-signal-resume.exp (maintenance print dummy-frames)
(maintenance info breakpoints): New tests.
Index: gdb-7.4.50.20120602/gdb/dummy-frame.c
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/dummy-frame.c 2012-01-04 09:17:00.000000000 +0100
+++ gdb-7.4.50.20120602/gdb/dummy-frame.c 2012-06-02 20:42:40.907720327 +0200
@@ -29,6 +29,7 @@
#include "gdbcmd.h"
#include "gdb_string.h"
#include "observer.h"
+#include "gdbthread.h"
/* Dummy frame. This saves the processor state just prior to setting
up the inferior function call. Older targets save the registers
@@ -108,19 +109,36 @@ remove_dummy_frame (struct dummy_frame *
xfree (dummy);
}
+/* Delete any breakpoint B which is a momentary breakpoint for return from
+ inferior call matching DUMMY_VOIDP. */
+
+static int
+pop_dummy_frame_bpt (struct breakpoint *b, void *dummy_voidp)
+{
+ struct dummy_frame *dummy = dummy_voidp;
+
+ if (b->disposition == disp_del && frame_id_eq (b->frame_id, dummy->id)
+ && b->thread == pid_to_thread_id (inferior_ptid))
+ delete_breakpoint (b);
+
+ /* Continue the traversal. */
+ return 0;
+}
+
/* Pop *DUMMY_PTR, restoring program state to that before the
frame was created. */
static void
pop_dummy_frame (struct dummy_frame **dummy_ptr)
{
- struct dummy_frame *dummy;
+ struct dummy_frame *dummy = *dummy_ptr;
+
+ restore_infcall_suspend_state (dummy->caller_state);
- restore_infcall_suspend_state ((*dummy_ptr)->caller_state);
+ iterate_over_breakpoints (pop_dummy_frame_bpt, dummy);
/* restore_infcall_control_state frees inf_state,
all that remains is to pop *dummy_ptr. */
- dummy = *dummy_ptr;
*dummy_ptr = dummy->next;
xfree (dummy);
Index: gdb-7.4.50.20120602/gdb/testsuite/gdb.base/call-signal-resume.exp
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/testsuite/gdb.base/call-signal-resume.exp 2012-01-23 18:11:50.000000000 +0100
+++ gdb-7.4.50.20120602/gdb/testsuite/gdb.base/call-signal-resume.exp 2012-06-02 20:43:10.523709052 +0200
@@ -101,6 +101,18 @@ gdb_test "frame $frame_number" ".*"
gdb_test_no_output "set confirm off"
gdb_test "return" ""
+# Verify there are no remains of the dummy frame.
+gdb_test_no_output "maintenance print dummy-frames"
+set test "maintenance info breakpoints"
+gdb_test_multiple $test $test {
+ -re "call dummy.*\r\n$gdb_prompt $" {
+ fail $test
+ }
+ -re "\r\n$gdb_prompt $" {
+ pass $test
+ }
+}
+
# Resume execution, the program should continue without any signal.
gdb_test "break stop_two" "Breakpoint \[0-9\]* at .*"

View File

@ -1,166 +0,0 @@
http://sourceware.org/ml/gdb-patches/2012-03/msg00358.html
Subject: [patch 2/2] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #5
Hi,
here is the ON_STACK code again, with fixed alignment for i386 SSE.
It is generalized for all OSes on i386/amd64. I can move it to
{i386,amd64)-linux-tdep.c but I find this code much more lightweight than
i386_push_dummy_call which is already present in i386-tdep.
No regressions on
{x86_64,x86_64-m32,i686}-fedora(15-rawhide)/rhel(5-6)-linux-gnu and for
gdbsever non-extended mode.
For x86_64-fedora17-linux-gnu it fixes:
-FAIL: gdb.cp/gdb2495.exp: Call a function that raises an exception without a handler.
-FAIL: gdb.cp/gdb2495.exp: bt after returning from a popped frame
+PASS: gdb.cp/gdb2495.exp: Call a function that raises an exception without a handler.
+PASS: gdb.cp/gdb2495.exp: bt after returning from a popped frame
Thanks,
Jan
gdb/
2012-03-09 Jan Kratochvil <jan.kratochvil@redhat.com>
* amd64-dicos-tdep.c (amd64_dicos_push_dummy_code): Remove.
(amd64_dicos_init_abi): Remove its installment.
* dicos-tdep.c (dicos_init_abi): Remove the
set_gdbarch_call_dummy_location call. Update the comment here.
* i386-dicos-tdep.c (i386_dicos_push_dummy_code): Remove.
(i386_dicos_init_abi): Remove its installment.
* i386-tdep.c (i386_push_dummy_code): New function.
(i386_gdbarch_init): Call set_gdbarch_call_dummy_location, install
i386_push_dummy_code.
--- a/gdb/amd64-dicos-tdep.c
+++ b/gdb/amd64-dicos-tdep.c
@@ -23,24 +23,6 @@
#include "amd64-tdep.h"
#include "dicos-tdep.h"
-static CORE_ADDR
-amd64_dicos_push_dummy_code (struct gdbarch *gdbarch,
- CORE_ADDR sp, CORE_ADDR funaddr,
- struct value **args, int nargs,
- struct type *value_type,
- CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
- struct regcache *regcache)
-{
- int bplen;
- CORE_ADDR bppc = sp;
-
- gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen);
- *bp_addr = sp - bplen;
- *real_pc = funaddr;
-
- return *bp_addr;
-}
-
static void
amd64_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
@@ -49,8 +31,6 @@ amd64_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
amd64_init_abi (info, gdbarch);
dicos_init_abi (gdbarch);
-
- set_gdbarch_push_dummy_code (gdbarch, amd64_dicos_push_dummy_code);
}
static enum gdb_osabi
--- a/gdb/dicos-tdep.c
+++ b/gdb/dicos-tdep.c
@@ -43,8 +43,8 @@ dicos_init_abi (struct gdbarch *gdbarch)
/* There's no (standard definition of) entry point or a guaranteed
text location with a symbol where to place the call dummy, so we
- put it on the stack. */
- set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+ need it on the stack. Rely on i386_gdbarch_init used also for
+ amd64 to set up ON_STACK inferior calls. */
/* DICOS rewinds the PC itself. */
set_gdbarch_decr_pc_after_break (gdbarch, 0);
--- a/gdb/i386-dicos-tdep.c
+++ b/gdb/i386-dicos-tdep.c
@@ -22,32 +22,12 @@
#include "gdb_string.h"
#include "dicos-tdep.h"
-static CORE_ADDR
-i386_dicos_push_dummy_code (struct gdbarch *gdbarch,
- CORE_ADDR sp, CORE_ADDR funaddr,
- struct value **args, int nargs,
- struct type *value_type,
- CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
- struct regcache *regcache)
-{
- int bplen;
- CORE_ADDR bppc = sp;
-
- gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen);
- *bp_addr = sp - bplen;
- *real_pc = funaddr;
-
- return *bp_addr;
-}
-
static void
i386_dicos_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
dicos_init_abi (gdbarch);
-
- set_gdbarch_push_dummy_code (gdbarch, i386_dicos_push_dummy_code);
}
static enum gdb_osabi
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -2326,6 +2326,30 @@ i386_16_byte_align_p (struct type *type)
return 0;
}
+/* Implementation for set_gdbarch_push_dummy_code. */
+
+static CORE_ADDR
+i386_push_dummy_code (struct gdbarch *gdbarch, CORE_ADDR sp, CORE_ADDR funaddr,
+ struct value **args, int nargs, struct type *value_type,
+ CORE_ADDR *real_pc, CORE_ADDR *bp_addr,
+ struct regcache *regcache)
+{
+ int bplen;
+ CORE_ADDR bppc = sp;
+
+ gdbarch_breakpoint_from_pc (gdbarch, &bppc, &bplen);
+ sp -= bplen;
+
+ /* amd64_push_dummy_call does alignment on its own but i386_push_dummy_call
+ does not. ABI requires stack alignment for executables using SSE. */
+ if (gdbarch_frame_align_p (gdbarch))
+ sp = gdbarch_frame_align (gdbarch, sp);
+
+ *bp_addr = sp;
+ *real_pc = funaddr;
+ return sp;
+}
+
static CORE_ADDR
i386_push_dummy_call (struct gdbarch *gdbarch, struct value *function,
struct regcache *regcache, CORE_ADDR bp_addr, int nargs,
@@ -7372,6 +7396,8 @@ i386_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
set_gdbarch_get_longjmp_target (gdbarch, i386_get_longjmp_target);
/* Call dummy code. */
+ set_gdbarch_call_dummy_location (gdbarch, ON_STACK);
+ set_gdbarch_push_dummy_code (gdbarch, i386_push_dummy_code);
set_gdbarch_push_dummy_call (gdbarch, i386_push_dummy_call);
set_gdbarch_frame_align (gdbarch, i386_frame_align);

View File

@ -30,12 +30,12 @@ Name: %{?scl_prefix}gdb
# Set version to contents of gdb/version.in. # Set version to contents of gdb/version.in.
# NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3 # NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3
# and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch). # and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch).
%global snap 20120603 %global snap 20120703
Version: 7.4.50.%{snap} Version: 7.4.50.%{snap}
# The release always contains a leading reserved number, start it at 1. # The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 7%{?dist} Release: 8%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain
Group: Development/Debuggers Group: Development/Debuggers
@ -481,8 +481,6 @@ Patch504: gdb-bz623749-gcore-relro.patch
# Fix lost siginfo_t in linux-nat (BZ 592031). # Fix lost siginfo_t in linux-nat (BZ 592031).
#=push #=push
Patch510: gdb-bz592031-siginfo-lost-4of5.patch
#=push
Patch511: gdb-bz592031-siginfo-lost-5of5.patch Patch511: gdb-bz592031-siginfo-lost-5of5.patch
# Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108). # Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108).
@ -542,36 +540,22 @@ Patch653: gdb-attach-fail-reasons-5of5.patch
#=fedora #=fedora
Patch657: gdb-attach-fail-reasons-5of5configure.patch Patch657: gdb-attach-fail-reasons-5of5configure.patch
# Fix inferior calls, particularly uncaught thrown exceptions (BZ 799531).
#=push+work
Patch654: gdb-x86-onstack-1of2.patch
Patch658: gdb-x86-onstack-2of2.patch
# Workaround crashes from stale frame_info pointer (BZ 804256). # Workaround crashes from stale frame_info pointer (BZ 804256).
#=push+work #=fedora
Patch661: gdb-stale-frame_info.patch Patch661: gdb-stale-frame_info.patch
# Workaround PR libc/14166 for inferior calls of strstr. # Workaround PR libc/14166 for inferior calls of strstr.
#=push+work: But push it to glibc. #=push+work: But push it to glibc.
Patch690: gdb-glibc-strstr-workaround.patch Patch690: gdb-glibc-strstr-workaround.patch
# Fix dejagnu-1.5-4.fc17 compatibility for Go (for BZ 635651).
#=fedoratest
Patch692: gdb-dejagnu-go.patch
# Revert recent breakage of UNIX objfiles order for symbols lookup.
Patch693: gdb-objfile-order.patch
# Disable -lmcheck in the development builds. # Disable -lmcheck in the development builds.
#=fedora
Patch694: gdb-disable-mcheck.patch Patch694: gdb-disable-mcheck.patch
# Fix assertion on some files as glibc-2.15.90-8.fc18 (Doug Evans). # Fix assertion on some files as glibc-2.15.90-8.fc18 (Doug Evans).
#=push
Patch695: gdb-index-assert.patch Patch695: gdb-index-assert.patch
# Support DW_OP_GNU_parameter_ref for -O2 -g inferiors (BZ 827375).
Patch696: gdb-parameterref-1of2.patch
Patch697: gdb-parameterref-2of2.patch
# Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789). # Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789).
#=fedoratest #=fedoratest
#+ppc #+ppc
@ -581,6 +565,10 @@ Patch698: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch
#=fedoratest #=fedoratest
Patch703: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch Patch703: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
# Revert function returning pointer fix (PR 9514) regressing Fedora errno patch.
#=push
Patch715: gdb-errno-func-datatype-revert.patch
%if 0%{!?rhel:1} || 0%{?rhel} > 6 %if 0%{!?rhel:1} || 0%{?rhel} > 6
# RL_STATE_FEDORA_GDB would not be found for: # RL_STATE_FEDORA_GDB would not be found for:
# Patch642: gdb-readline62-ask-more-rh.patch # Patch642: gdb-readline62-ask-more-rh.patch
@ -651,8 +639,11 @@ BuildRequires: prelink
%endif %endif
%endif %endif
%if 0%{!?rhel:1} %if 0%{!?rhel:1}
# Fedora arm does not yet have fpc built.
%ifnarch %{arm}
BuildRequires: fpc BuildRequires: fpc
%endif %endif
%endif
%if 0%{?el5:1} %if 0%{?el5:1}
BuildRequires: gcc44 gcc44-gfortran BuildRequires: gcc44 gcc44-gfortran
%endif %endif
@ -758,6 +749,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch2 -p1 %patch2 -p1
%patch232 -p1 %patch232 -p1
%patch715 -p1
%patch349 -p1 %patch349 -p1
%patch1 -p1 %patch1 -p1
%patch3 -p1 %patch3 -p1
@ -847,7 +839,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch491 -p1 %patch491 -p1
%patch496 -p1 %patch496 -p1
%patch504 -p1 %patch504 -p1
%patch510 -p1
%patch511 -p1 %patch511 -p1
%patch526 -p1 %patch526 -p1
%patch542 -p1 %patch542 -p1
@ -861,16 +852,10 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch643 -p1 %patch643 -p1
%patch653 -p1 %patch653 -p1
%patch657 -p1 %patch657 -p1
%patch654 -p1
%patch658 -p1
%patch661 -p1 %patch661 -p1
%patch690 -p1 %patch690 -p1
%patch692 -p1
%patch693 -p1
%patch694 -p1 %patch694 -p1
%patch695 -p1 %patch695 -p1
%patch696 -p1
%patch697 -p1
%patch698 -p1 %patch698 -p1
%patch703 -p1 %patch703 -p1
@ -1362,6 +1347,12 @@ fi
%endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch" %endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch"
%changelog %changelog
* Tue Jul 3 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.50.20120703-8.fc18
- Rebase to FSF GDB 7.4.50.20120703.
- [archer-tromey-dwz-multifile-rebase] Merge new branch (Tom Tromey).
- [arm] <--with testsuite>: Disable fpc BuildRequires as it is not yet built.
- Revert function returning pointer fix (PR 9514) regressing Fedora errno patch.
* Thu Jun 21 2012 Sergio Durigan Junior <sergiodj@redhat.com> - 7.4.50.20120603-7.fc18 * Thu Jun 21 2012 Sergio Durigan Junior <sergiodj@redhat.com> - 7.4.50.20120603-7.fc18
- Include testcase for BZ 818343. - Include testcase for BZ 818343.

View File

@ -1,2 +1,2 @@
04e5c4b1b9e633422cc48990fe61958d libstdc++-v3-python-r155978.tar.bz2 04e5c4b1b9e633422cc48990fe61958d libstdc++-v3-python-r155978.tar.bz2
d6766c3ec4444f337cb0d7a0265130f9 gdb-7.4.50.20120603.tar.bz2 91290d1034013db1fe035c081adde514 gdb-7.4.50.20120703.tar.bz2