Rebase to FSF GDB 7.4.91.20120801.

- [dwz] Rebase it from FSF GDB HEAD.
This commit is contained in:
Jan Kratochvil 2012-08-01 21:40:12 +02:00
parent 914739c6e2
commit 4945b2263d
12 changed files with 1067 additions and 896 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
/libstdc++-v3-python-r155978.tar.bz2
/gdb-7.4.50.20120714.tar.bz2
/gdb-7.4.91.20120801.tar.bz2

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
user did "gdb core".
Index: gdb-7.4.50.20120703/gdb/exceptions.h
Index: gdb-7.4.91.20120801/gdb/exceptions.h
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/exceptions.h 2012-01-04 09:17:01.000000000 +0100
+++ gdb-7.4.50.20120703/gdb/exceptions.h 2012-07-03 17:36:27.840297264 +0200
--- gdb-7.4.91.20120801.orig/gdb/exceptions.h 2012-01-04 09:17:01.000000000 +0100
+++ gdb-7.4.91.20120801/gdb/exceptions.h 2012-08-01 18:43:39.806959992 +0200
@@ -86,6 +86,9 @@ enum errors {
/* DW_OP_GNU_entry_value resolving failed. */
NO_ENTRY_VALUE_ERROR,
@ -72,10 +72,10 @@ Index: gdb-7.4.50.20120703/gdb/exceptions.h
/* Add more errors here. */
NR_ERRORS
};
Index: gdb-7.4.50.20120703/gdb/exec.c
Index: gdb-7.4.91.20120801/gdb/exec.c
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/exec.c 2012-07-03 17:30:07.000000000 +0200
+++ gdb-7.4.50.20120703/gdb/exec.c 2012-07-03 17:37:27.777225175 +0200
--- gdb-7.4.91.20120801.orig/gdb/exec.c 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/exec.c 2012-08-01 18:44:39.928627287 +0200
@@ -34,6 +34,7 @@
#include "gdbthread.h"
#include "progspace.h"
@ -84,7 +84,7 @@ Index: gdb-7.4.50.20120703/gdb/exec.c
#include <fcntl.h>
#include "readline/readline.h"
@@ -245,12 +246,27 @@ exec_file_attach (char *filename, int fr
@@ -242,12 +243,27 @@ exec_file_attach (char *filename, int fr
if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching))
{
@ -114,11 +114,11 @@ Index: gdb-7.4.50.20120703/gdb/exec.c
+ gdb_bfd_errmsg (bfd_get_error (), matching));
}
gdb_bfd_stash_filename (exec_bfd);
Index: gdb-7.4.50.20120703/gdb/main.c
/* FIXME - This should only be run for RS6000, but the ifdef is a poor
Index: gdb-7.4.91.20120801/gdb/main.c
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/main.c 2012-07-03 17:31:40.000000000 +0200
+++ gdb-7.4.50.20120703/gdb/main.c 2012-07-03 17:36:27.843297261 +0200
--- gdb-7.4.91.20120801.orig/gdb/main.c 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/main.c 2012-08-01 18:43:39.810959970 +0200
@@ -266,6 +266,36 @@ typedef struct cmdarg {
/* Define type VEC (cmdarg_s). */
DEF_VEC_O (cmdarg_s);
@ -156,7 +156,7 @@ Index: gdb-7.4.50.20120703/gdb/main.c
static int
captured_main (void *data)
{
@@ -764,6 +794,8 @@ captured_main (void *data)
@@ -762,6 +792,8 @@ captured_main (void *data)
{
symarg = argv[optind];
execarg = argv[optind];
@ -165,7 +165,7 @@ Index: gdb-7.4.50.20120703/gdb/main.c
optind++;
}
@@ -919,11 +951,25 @@ captured_main (void *data)
@@ -917,11 +949,25 @@ captured_main (void *data)
&& symarg != NULL
&& strcmp (execarg, symarg) == 0)
{

View File

@ -1,7 +1,7 @@
Index: gdb-7.4.50.20120703/gdb/corelow.c
Index: gdb-7.4.91.20120801/gdb/corelow.c
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/corelow.c 2012-07-06 15:04:04.378487860 +0200
+++ gdb-7.4.50.20120703/gdb/corelow.c 2012-07-06 15:38:41.272908113 +0200
--- gdb-7.4.91.20120801.orig/gdb/corelow.c 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/corelow.c 2012-08-01 18:37:44.584925750 +0200
@@ -47,6 +47,9 @@
#include "progspace.h"
#include "objfiles.h"
@ -65,7 +65,7 @@ Index: gdb-7.4.50.20120703/gdb/corelow.c
/* This routine opens and sets up the core file bfd. */
static void
@@ -420,6 +469,14 @@ core_open (char *filename, int from_tty)
@@ -418,6 +467,14 @@ core_open (char *filename, int from_tty)
switch_to_thread (thread->ptid);
}
@ -80,7 +80,7 @@ Index: gdb-7.4.50.20120703/gdb/corelow.c
post_create_inferior (&core_ops, from_tty);
/* Now go through the target stack looking for threads since there
@@ -941,4 +998,11 @@ _initialize_corelow (void)
@@ -939,4 +996,11 @@ _initialize_corelow (void)
init_core_ops ();
add_target (&core_ops);
@ -92,10 +92,10 @@ Index: gdb-7.4.50.20120703/gdb/corelow.c
+ NULL, NULL, NULL,
+ &setlist, &showlist);
}
Index: gdb-7.4.50.20120703/gdb/doc/gdb.texinfo
Index: gdb-7.4.91.20120801/gdb/doc/gdb.texinfo
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/doc/gdb.texinfo 2012-07-06 15:04:04.378487860 +0200
+++ gdb-7.4.50.20120703/gdb/doc/gdb.texinfo 2012-07-06 15:04:26.069463330 +0200
--- gdb-7.4.91.20120801.orig/gdb/doc/gdb.texinfo 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/doc/gdb.texinfo 2012-08-01 18:37:44.598925672 +0200
@@ -16530,6 +16530,27 @@ information files.
@end table
@ -124,11 +124,11 @@ Index: gdb-7.4.50.20120703/gdb/doc/gdb.texinfo
@cindex @code{.gnu_debuglink} sections
@cindex debug link sections
A debug link is a special section of the executable file named
Index: gdb-7.4.50.20120703/gdb/solib-svr4.c
Index: gdb-7.4.91.20120801/gdb/solib-svr4.c
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/solib-svr4.c 2012-07-06 15:04:04.378487860 +0200
+++ gdb-7.4.50.20120703/gdb/solib-svr4.c 2012-07-06 15:38:41.433907928 +0200
@@ -1227,9 +1227,52 @@ svr4_read_so_list (CORE_ADDR lm, struct
--- gdb-7.4.91.20120801.orig/gdb/solib-svr4.c 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/solib-svr4.c 2012-08-01 18:37:44.599925667 +0200
@@ -1228,9 +1228,52 @@ svr4_read_so_list (CORE_ADDR lm, struct
continue;
}
@ -184,10 +184,10 @@ Index: gdb-7.4.50.20120703/gdb/solib-svr4.c
xfree (buffer);
/* If this entry has no name, or its name matches the name
Index: gdb-7.4.50.20120703/gdb/elfread.c
Index: gdb-7.4.91.20120801/gdb/elfread.c
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/elfread.c 2012-07-06 15:04:04.378487860 +0200
+++ gdb-7.4.50.20120703/gdb/elfread.c 2012-07-06 15:38:41.272908113 +0200
--- gdb-7.4.91.20120801.orig/gdb/elfread.c 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/elfread.c 2012-08-01 18:38:08.956790879 +0200
@@ -45,6 +45,11 @@
#include "regcache.h"
#include "bcache.h"
@ -932,9 +932,9 @@ Index: gdb-7.4.50.20120703/gdb/elfread.c
if (debugfile == NULL)
debugfile = find_separate_debug_file_by_debuglink (objfile);
@@ -1450,6 +2053,12 @@ elf_symfile_read (struct objfile *objfil
@@ -1452,6 +2055,12 @@ elf_symfile_read (struct objfile *objfil
symbol_file_add_separate (abfd, symfile_flags, objfile);
xfree (debugfile);
do_cleanups (cleanup);
}
+ /* Check if any separate debug info has been extracted out. */
+ else if (bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink")
@ -945,7 +945,7 @@ Index: gdb-7.4.50.20120703/gdb/elfread.c
}
if (symtab_create_debug)
@@ -1782,4 +2391,16 @@ _initialize_elfread (void)
@@ -1784,4 +2393,16 @@ _initialize_elfread (void)
elf_objfile_gnu_ifunc_cache_data = register_objfile_data ();
gnu_ifunc_fns_p = &elf_gnu_ifunc_fns;
@ -962,10 +962,10 @@ Index: gdb-7.4.50.20120703/gdb/elfread.c
+
+ observer_attach_executable_changed (debug_print_executable_changed);
}
Index: gdb-7.4.50.20120703/gdb/symfile.h
Index: gdb-7.4.91.20120801/gdb/symfile.h
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/symfile.h 2012-07-06 15:04:04.378487860 +0200
+++ gdb-7.4.50.20120703/gdb/symfile.h 2012-07-06 15:38:41.272908113 +0200
--- gdb-7.4.91.20120801.orig/gdb/symfile.h 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/symfile.h 2012-08-01 18:37:44.600925662 +0200
@@ -615,6 +615,13 @@ void free_symfile_segment_data (struct s
extern struct cleanup *increment_reading_symtab (void);
@ -980,10 +980,10 @@ Index: gdb-7.4.50.20120703/gdb/symfile.h
/* From dwarf2read.c */
/* Names for a dwarf2 debugging section. The field NORMAL is the normal
Index: gdb-7.4.50.20120703/gdb/testsuite/lib/gdb.exp
Index: gdb-7.4.91.20120801/gdb/testsuite/lib/gdb.exp
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/testsuite/lib/gdb.exp 2012-07-06 15:04:04.378487860 +0200
+++ gdb-7.4.50.20120703/gdb/testsuite/lib/gdb.exp 2012-07-06 15:38:41.272908113 +0200
--- gdb-7.4.91.20120801.orig/gdb/testsuite/lib/gdb.exp 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/testsuite/lib/gdb.exp 2012-08-01 18:37:44.601925656 +0200
@@ -1388,6 +1388,16 @@ proc default_gdb_start { } {
warning "Couldn't set the width to 0."
}
@ -1001,10 +1001,10 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/lib/gdb.exp
return 0;
}
Index: gdb-7.4.50.20120703/gdb/testsuite/lib/mi-support.exp
Index: gdb-7.4.91.20120801/gdb/testsuite/lib/mi-support.exp
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/testsuite/lib/mi-support.exp 2012-07-06 15:04:04.378487860 +0200
+++ gdb-7.4.50.20120703/gdb/testsuite/lib/mi-support.exp 2012-07-06 15:38:41.272908113 +0200
--- gdb-7.4.91.20120801.orig/gdb/testsuite/lib/mi-support.exp 2012-07-25 22:35:30.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/testsuite/lib/mi-support.exp 2012-08-01 18:37:44.601925656 +0200
@@ -213,6 +213,16 @@ proc default_mi_gdb_start { args } {
warning "Couldn't set the width to 0."
}
@ -1022,10 +1022,10 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/lib/mi-support.exp
# If allowing the inferior to have its own PTY then assign the inferior
# its own terminal device here.
if { $separate_inferior_pty } {
Index: gdb-7.4.50.20120703/gdb/objfiles.h
Index: gdb-7.4.91.20120801/gdb/objfiles.h
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/objfiles.h 2012-07-06 15:04:04.378487860 +0200
+++ gdb-7.4.50.20120703/gdb/objfiles.h 2012-07-06 15:04:26.073463324 +0200
--- gdb-7.4.91.20120801.orig/gdb/objfiles.h 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/objfiles.h 2012-08-01 18:37:44.601925656 +0200
@@ -432,6 +432,10 @@ struct objfile
#define OBJF_MAINLINE (1 << 5)
@ -1037,10 +1037,10 @@ Index: gdb-7.4.50.20120703/gdb/objfiles.h
/* The object file that contains the runtime common minimal symbols
for SunOS4. Note that this objfile has no associated BFD. */
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.base/corefile.exp
Index: gdb-7.4.91.20120801/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
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.base/corefile.exp 2012-07-06 15:39:41.601838633 +0200
--- gdb-7.4.91.20120801.orig/gdb/testsuite/gdb.base/corefile.exp 2012-06-21 22:46:21.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/testsuite/gdb.base/corefile.exp 2012-08-01 18:37:44.602925650 +0200
@@ -256,3 +256,33 @@ if ![is_remote target] {
gdb_exit

File diff suppressed because it is too large Load Diff

View File

@ -1,24 +0,0 @@
diff -dup -rup gdb-7.4.50.20120603-orig/gdb/configure gdb-7.4.50.20120603/gdb/configure
--- gdb-7.4.50.20120603-orig/gdb/configure 2012-06-06 19:08:32.824824699 +0200
+++ gdb-7.4.50.20120603/gdb/configure 2012-06-06 19:12:12.346992423 +0200
@@ -2706,7 +2706,7 @@ fi
# Provide more thorough testing by -lmcheck.
# Set it to 'true' for development snapshots, 'false' for releases or
# pre-releases.
-development=true
+development=false
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
diff -dup -rup gdb-7.4.50.20120603-orig/gdb/configure.ac gdb-7.4.50.20120603/gdb/configure.ac
--- gdb-7.4.50.20120603-orig/gdb/configure.ac 2012-06-06 19:08:32.817824693 +0200
+++ gdb-7.4.50.20120603/gdb/configure.ac 2012-06-06 19:12:05.545987227 +0200
@@ -26,7 +26,7 @@ AM_MAINTAINER_MODE
# Provide more thorough testing by -lmcheck.
# Set it to 'true' for development snapshots, 'false' for releases or
# pre-releases.
-development=true
+development=false
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS

View File

@ -2,10 +2,10 @@ From: Gary Benson <gbenson@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Message-ID: <20110810133605.GB7294@redhat.com>
Index: gdb-7.4.50.20120602/gdb/infrun.c
Index: gdb-7.4.91.20120801/gdb/infrun.c
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/infrun.c 2012-06-02 21:38:07.236442883 +0200
+++ gdb-7.4.50.20120602/gdb/infrun.c 2012-06-02 21:38:13.450440507 +0200
--- gdb-7.4.91.20120801.orig/gdb/infrun.c 2012-08-01 18:38:24.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/infrun.c 2012-08-01 18:44:59.568518602 +0200
@@ -361,6 +361,13 @@ static struct symbol *step_start_functio
/* Nonzero if we want to give control to the user when we're notified
of shared library events by the dynamic linker. */
@ -20,7 +20,7 @@ Index: gdb-7.4.50.20120602/gdb/infrun.c
static void
show_stop_on_solib_events (struct ui_file *file, int from_tty,
struct cmd_list_element *c, const char *value)
@@ -7267,7 +7274,7 @@ Show stopping for shared library events.
@@ -7229,7 +7236,7 @@ Show stopping for shared library events.
If nonzero, gdb will give control to the user when the dynamic linker\n\
notifies gdb of shared library events. The most common event of interest\n\
to the user would be loading/unloading of a new library."),
@ -29,20 +29,19 @@ Index: gdb-7.4.50.20120602/gdb/infrun.c
show_stop_on_solib_events,
&setlist, &showlist);
Index: gdb-7.4.50.20120602/gdb/solib-svr4.c
Index: gdb-7.4.91.20120801/gdb/solib-svr4.c
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/solib-svr4.c 2012-06-02 21:38:07.236442883 +0200
+++ gdb-7.4.50.20120602/gdb/solib-svr4.c 2012-06-02 21:44:23.973298737 +0200
@@ -47,6 +47,8 @@
--- gdb-7.4.91.20120801.orig/gdb/solib-svr4.c 2012-08-01 18:38:24.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/solib-svr4.c 2012-08-01 18:45:13.449441787 +0200
@@ -47,6 +47,7 @@
#include "auxv.h"
#include "exceptions.h"
#include "gdb_bfd.h"
+#include "probe.h"
+
static struct link_map_offsets *svr4_fetch_link_map_offsets (void);
static int svr4_have_link_map_offsets (void);
static void svr4_relocate_main_executable (void);
@@ -92,6 +94,32 @@ static const char * const solib_break_na
@@ -93,6 +94,32 @@ static const char * const solib_break_na
NULL
};
@ -75,7 +74,7 @@ Index: gdb-7.4.50.20120602/gdb/solib-svr4.c
static const char * const bkpt_names[] =
{
"_start",
@@ -313,6 +341,12 @@ struct svr4_info
@@ -314,6 +341,12 @@ struct svr4_info
CORE_ADDR interp_text_sect_high;
CORE_ADDR interp_plt_sect_low;
CORE_ADDR interp_plt_sect_high;
@ -88,7 +87,7 @@ Index: gdb-7.4.50.20120602/gdb/solib-svr4.c
};
/* Per-program-space data key. */
@@ -322,8 +356,15 @@ static void
@@ -323,8 +356,15 @@ static void
svr4_pspace_data_cleanup (struct program_space *pspace, void *arg)
{
struct svr4_info *info;
@ -104,7 +103,7 @@ Index: gdb-7.4.50.20120602/gdb/solib-svr4.c
xfree (info);
}
@@ -1449,6 +1490,126 @@ exec_entry_point (struct bfd *abfd, stru
@@ -1450,6 +1490,126 @@ exec_entry_point (struct bfd *abfd, stru
targ);
}
@ -231,7 +230,7 @@ Index: gdb-7.4.50.20120602/gdb/solib-svr4.c
/* Helper function for gdb_bfd_lookup_symbol. */
static int
@@ -1497,10 +1658,18 @@ enable_break (struct svr4_info *info, in
@@ -1498,10 +1658,18 @@ enable_break (struct svr4_info *info, in
asection *interp_sect;
gdb_byte *interp_name;
CORE_ADDR sym_addr;
@ -250,7 +249,7 @@ Index: gdb-7.4.50.20120602/gdb/solib-svr4.c
/* If we already have a shared library list in the target, and
r_debug contains r_brk, set the breakpoint there - this should
mean r_brk has already been relocated. Assume the dynamic linker
@@ -1532,7 +1701,7 @@ enable_break (struct svr4_info *info, in
@@ -1533,7 +1701,7 @@ enable_break (struct svr4_info *info, in
That knowledge is encoded in the address, if it's Thumb the low bit
is 1. However, we've stripped that info above and it's not clear
what all the consequences are of passing a non-addr_bits_remove'd
@ -259,7 +258,7 @@ Index: gdb-7.4.50.20120602/gdb/solib-svr4.c
find_pc_section verifies we know about the address and have some
hope of computing the right kind of breakpoint to use (via
symbol info). It does mean that GDB needs to be pointed at a
@@ -1570,7 +1739,7 @@ enable_break (struct svr4_info *info, in
@@ -1571,7 +1739,7 @@ enable_break (struct svr4_info *info, in
+ bfd_section_size (tmp_bfd, interp_sect);
}
@ -268,7 +267,7 @@ Index: gdb-7.4.50.20120602/gdb/solib-svr4.c
return 1;
}
}
@@ -1725,7 +1894,8 @@ enable_break (struct svr4_info *info, in
@@ -1729,7 +1897,8 @@ enable_break (struct svr4_info *info, in
if (sym_addr != 0)
{
@ -278,7 +277,7 @@ Index: gdb-7.4.50.20120602/gdb/solib-svr4.c
xfree (interp_name);
return 1;
}
@@ -1751,7 +1921,7 @@ enable_break (struct svr4_info *info, in
@@ -1755,7 +1924,7 @@ enable_break (struct svr4_info *info, in
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch,
sym_addr,
&current_target);
@ -287,7 +286,7 @@ Index: gdb-7.4.50.20120602/gdb/solib-svr4.c
return 1;
}
}
@@ -1767,7 +1937,7 @@ enable_break (struct svr4_info *info, in
@@ -1771,7 +1940,7 @@ enable_break (struct svr4_info *info, in
sym_addr = gdbarch_convert_from_func_ptr_addr (target_gdbarch,
sym_addr,
&current_target);
@ -296,17 +295,17 @@ Index: gdb-7.4.50.20120602/gdb/solib-svr4.c
return 1;
}
}
@@ -2543,4 +2713,5 @@ _initialize_svr4_solib (void)
@@ -2547,4 +2716,5 @@ _initialize_svr4_solib (void)
svr4_so_ops.lookup_lib_global_symbol = elf_lookup_lib_symbol;
svr4_so_ops.same = svr4_same;
svr4_so_ops.keep_data_in_core = svr4_keep_data_in_core;
+ svr4_so_ops.update_breakpoints = svr4_update_solib_event_breakpoints;
}
Index: gdb-7.4.50.20120602/gdb/solib.c
Index: gdb-7.4.91.20120801/gdb/solib.c
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/solib.c 2012-06-02 21:38:07.236442883 +0200
+++ gdb-7.4.50.20120602/gdb/solib.c 2012-06-02 21:38:13.455440507 +0200
@@ -1216,6 +1216,18 @@ no_shared_libraries (char *ignored, int
--- gdb-7.4.91.20120801.orig/gdb/solib.c 2012-08-01 18:38:24.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/solib.c 2012-08-01 18:44:59.573518572 +0200
@@ -1226,6 +1226,18 @@ no_shared_libraries (char *ignored, int
objfile_purge_solibs ();
}
@ -325,10 +324,10 @@ Index: gdb-7.4.50.20120602/gdb/solib.c
/* Reload shared libraries, but avoid reloading the same symbol file
we already have loaded. */
Index: gdb-7.4.50.20120602/gdb/solib.h
Index: gdb-7.4.91.20120801/gdb/solib.h
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/solib.h 2012-06-02 21:38:07.236442883 +0200
+++ gdb-7.4.50.20120602/gdb/solib.h 2012-06-02 21:38:13.464440503 +0200
--- gdb-7.4.91.20120801.orig/gdb/solib.h 2012-02-03 16:19:37.000000000 +0100
+++ gdb-7.4.91.20120801/gdb/solib.h 2012-08-01 18:44:59.574518566 +0200
@@ -91,4 +91,8 @@ extern CORE_ADDR gdb_bfd_lookup_symbol_f
void *),
void *data);
@ -338,10 +337,10 @@ Index: gdb-7.4.50.20120602/gdb/solib.h
+extern void update_solib_breakpoints (void);
+
#endif /* SOLIB_H */
Index: gdb-7.4.50.20120602/gdb/solist.h
Index: gdb-7.4.91.20120801/gdb/solist.h
===================================================================
--- gdb-7.4.50.20120602.orig/gdb/solist.h 2012-06-02 21:38:07.236442883 +0200
+++ gdb-7.4.50.20120602/gdb/solist.h 2012-06-02 21:38:13.465440503 +0200
--- gdb-7.4.91.20120801.orig/gdb/solist.h 2012-01-04 09:17:11.000000000 +0100
+++ gdb-7.4.91.20120801/gdb/solist.h 2012-08-01 18:44:59.574518566 +0200
@@ -149,6 +149,13 @@ struct target_so_ops
core file (in particular, for readonly sections). */
int (*keep_data_in_core) (CORE_ADDR vaddr,

View File

@ -1,8 +1,8 @@
Index: gdb-7.4.50.20120714/gdb/dwarf2read.c
Index: gdb-7.4.91.20120801/gdb/dwarf2read.c
===================================================================
--- gdb-7.4.50.20120714.orig/gdb/dwarf2read.c 2012-07-14 23:36:09.882136546 +0200
+++ gdb-7.4.50.20120714/gdb/dwarf2read.c 2012-07-14 23:36:11.032130182 +0200
@@ -11003,12 +11003,14 @@ read_set_type (struct die_info *die, str
--- gdb-7.4.91.20120801.orig/gdb/dwarf2read.c 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/dwarf2read.c 2012-08-01 18:38:54.201540500 +0200
@@ -11073,12 +11073,14 @@ read_set_type (struct die_info *die, str
return set_die_type (die, set_type, cu);
}
@ -19,7 +19,7 @@ Index: gdb-7.4.50.20120714/gdb/dwarf2read.c
struct attribute *attr;
struct symbol *sym;
CORE_ADDR base = (CORE_ADDR) 0;
@@ -11033,20 +11035,67 @@ read_common_block (struct die_info *die,
@@ -11103,20 +11105,67 @@ read_common_block (struct die_info *die,
}
if (die->child != NULL)
{
@ -87,7 +87,7 @@ Index: gdb-7.4.50.20120714/gdb/dwarf2read.c
}
}
@@ -15085,6 +15134,13 @@ new_symbol_full (struct die_info *die, s
@@ -15155,6 +15204,13 @@ new_symbol_full (struct die_info *die, s
{
var_decode_location (attr, sym, cu);
attr2 = dwarf2_attr (die, DW_AT_external, cu);
@ -101,7 +101,7 @@ Index: gdb-7.4.50.20120714/gdb/dwarf2read.c
if (SYMBOL_CLASS (sym) == LOC_STATIC
&& SYMBOL_VALUE_ADDRESS (sym) == 0
&& !dwarf2_per_objfile->has_section_at_zero)
@@ -15249,6 +15305,11 @@ new_symbol_full (struct die_info *die, s
@@ -15319,6 +15375,11 @@ new_symbol_full (struct die_info *die, s
SYMBOL_CLASS (sym) = LOC_TYPEDEF;
list_to_add = &global_symbols;
break;
@ -113,10 +113,10 @@ Index: gdb-7.4.50.20120714/gdb/dwarf2read.c
default:
/* Not a tag we recognize. Hopefully we aren't processing
trash data, but since we must specifically ignore things
Index: gdb-7.4.50.20120714/gdb/f-lang.c
Index: gdb-7.4.91.20120801/gdb/f-lang.c
===================================================================
--- gdb-7.4.50.20120714.orig/gdb/f-lang.c 2012-07-14 23:36:10.993130398 +0200
+++ gdb-7.4.50.20120714/gdb/f-lang.c 2012-07-14 23:36:11.033130176 +0200
--- gdb-7.4.91.20120801.orig/gdb/f-lang.c 2012-08-01 18:38:24.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/f-lang.c 2012-08-01 18:38:54.202540495 +0200
@@ -370,27 +370,3 @@ _initialize_f_language (void)
add_language (&f_language_defn);
@ -145,10 +145,10 @@ Index: gdb-7.4.50.20120714/gdb/f-lang.c
- }
- return (NULL);
-}
Index: gdb-7.4.50.20120714/gdb/f-lang.h
Index: gdb-7.4.91.20120801/gdb/f-lang.h
===================================================================
--- gdb-7.4.50.20120714.orig/gdb/f-lang.h 2012-07-14 23:36:10.994130392 +0200
+++ gdb-7.4.50.20120714/gdb/f-lang.h 2012-07-14 23:36:11.034130171 +0200
--- gdb-7.4.91.20120801.orig/gdb/f-lang.h 2012-08-01 18:38:24.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/f-lang.h 2012-08-01 18:38:54.203540489 +0200
@@ -52,37 +52,8 @@ enum f90_range_type
NONE_BOUND_DEFAULT /* "(low:high)" */
};
@ -187,10 +187,10 @@ Index: gdb-7.4.50.20120714/gdb/f-lang.h
/* When reasonable array bounds cannot be fetched, such as when
you ask to 'mt print symbols' and there is no stack frame and
Index: gdb-7.4.50.20120714/gdb/f-valprint.c
Index: gdb-7.4.91.20120801/gdb/f-valprint.c
===================================================================
--- gdb-7.4.50.20120714.orig/gdb/f-valprint.c 2012-07-14 23:36:10.995130387 +0200
+++ gdb-7.4.50.20120714/gdb/f-valprint.c 2012-07-14 23:36:53.747893779 +0200
--- gdb-7.4.91.20120801.orig/gdb/f-valprint.c 2012-08-01 18:38:24.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/f-valprint.c 2012-08-01 18:41:26.411698186 +0200
@@ -34,10 +34,11 @@
#include "gdbcore.h"
#include "command.h"
@ -257,14 +257,14 @@ Index: gdb-7.4.50.20120714/gdb/f-valprint.c
+ }
- printf_filtered (_("All COMMON blocks visible at this level:\n\n"));
+ putchar_filtered ('\n');
+ }
-
- while (tmp != NULL)
- {
- if (strcmp (tmp->owning_function, funname) == 0)
- printf_filtered ("%s\n", tmp->name);
-
+ putchar_filtered ('\n');
+ }
- tmp = tmp->next;
- }
+ return values_printed;
@ -285,7 +285,7 @@ Index: gdb-7.4.50.20120714/gdb/f-valprint.c
/* We have been told to display the contents of F77 COMMON
block supposedly visible in this function. Let us
@@ -461,74 +491,31 @@ info_common_command (char *comname, int
@@ -461,87 +491,31 @@ info_common_command (char *comname, int
/* The following is generally ripped off from stack.c's routine
print_frame_info(). */
@ -353,6 +353,8 @@ Index: gdb-7.4.50.20120714/gdb/f-valprint.c
- if (the_common)
+ if (!values_printed)
{
- struct frame_id frame_id = get_frame_id (fi);
-
- if (strcmp (comname, BLANK_COMMON_NAME_LOCAL) == 0)
- printf_filtered (_("Contents of blank COMMON block:\n"));
+ if (comname)
@ -365,7 +367,18 @@ Index: gdb-7.4.50.20120714/gdb/f-valprint.c
-
- while (entry != NULL)
- {
- fi = frame_find_by_id (frame_id);
- if (fi == NULL)
- {
- warning (_("Unable to restore previously selected frame."));
- break;
- }
-
- print_variable_and_value (NULL, entry->symbol, fi, gdb_stdout, 0);
-
- /* print_variable_and_value invalidates FI. */
- fi = NULL;
-
- entry = entry->next;
- }
+ printf_filtered (_("No common blocks.\n"));
@ -376,11 +389,11 @@ Index: gdb-7.4.50.20120714/gdb/f-valprint.c
}
void
Index: gdb-7.4.50.20120714/gdb/stack.c
Index: gdb-7.4.91.20120801/gdb/stack.c
===================================================================
--- gdb-7.4.50.20120714.orig/gdb/stack.c 2012-07-14 23:36:09.315139683 +0200
+++ gdb-7.4.50.20120714/gdb/stack.c 2012-07-14 23:36:11.036130161 +0200
@@ -1838,6 +1838,8 @@ iterate_over_block_locals (struct block
--- gdb-7.4.91.20120801.orig/gdb/stack.c 2012-08-01 18:36:51.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/stack.c 2012-08-01 18:38:54.206540471 +0200
@@ -1851,6 +1851,8 @@ iterate_over_block_locals (struct block
case LOC_COMPUTED:
if (SYMBOL_IS_ARGUMENT (sym))
break;
@ -389,10 +402,10 @@ Index: gdb-7.4.50.20120714/gdb/stack.c
(*cb) (SYMBOL_PRINT_NAME (sym), sym, cb_data);
break;
Index: gdb-7.4.50.20120714/gdb/symtab.h
Index: gdb-7.4.91.20120801/gdb/symtab.h
===================================================================
--- gdb-7.4.50.20120714.orig/gdb/symtab.h 2012-06-30 00:46:46.000000000 +0200
+++ gdb-7.4.50.20120714/gdb/symtab.h 2012-07-14 23:36:11.038130149 +0200
--- gdb-7.4.91.20120801.orig/gdb/symtab.h 2012-06-30 00:46:46.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/symtab.h 2012-08-01 18:38:54.206540471 +0200
@@ -394,7 +394,10 @@ typedef enum domain_enum_tag
/* LABEL_DOMAIN may be used for names of labels (for gotos). */
@ -405,10 +418,10 @@ Index: gdb-7.4.50.20120714/gdb/symtab.h
} domain_enum;
/* Searching domains, used for `search_symbols'. Element numbers are
Index: gdb-7.4.50.20120714/gdb/testsuite/gdb.fortran/common-block.exp
Index: gdb-7.4.91.20120801/gdb/testsuite/gdb.fortran/common-block.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120714/gdb/testsuite/gdb.fortran/common-block.exp 2012-07-14 23:36:11.038130149 +0200
+++ gdb-7.4.91.20120801/gdb/testsuite/gdb.fortran/common-block.exp 2012-08-01 18:38:54.207540465 +0200
@@ -0,0 +1,101 @@
+# Copyright 2008 Free Software Foundation, Inc.
+
@ -511,10 +524,10 @@ Index: gdb-7.4.50.20120714/gdb/testsuite/gdb.fortran/common-block.exp
+gdb_test "p ix_x" " = 1 *" "p ix_x in"
+gdb_test "p iy_y" " = 2 *" "p iy_y in"
+gdb_test "p iz_z2" " = 3 *" "p iz_z2 in"
Index: gdb-7.4.50.20120714/gdb/testsuite/gdb.fortran/common-block.f90
Index: gdb-7.4.91.20120801/gdb/testsuite/gdb.fortran/common-block.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120714/gdb/testsuite/gdb.fortran/common-block.f90 2012-07-14 23:36:11.038130149 +0200
+++ gdb-7.4.91.20120801/gdb/testsuite/gdb.fortran/common-block.f90 2012-08-01 18:38:54.207540465 +0200
@@ -0,0 +1,67 @@
+! Copyright 2008 Free Software Foundation, Inc.
+!

View File

@ -4,10 +4,10 @@ https://bugzilla.redhat.com/show_bug.cgi?id=834068
Patch by Alexander Larsson.
Review/modifications and testfile by Jan Kratochvil.
Index: gdb-7.4.50.20120703/gdb/Makefile.in
Index: gdb-7.4.91.20120801/gdb/Makefile.in
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/Makefile.in 2012-07-06 21:44:57.243444217 +0200
+++ gdb-7.4.50.20120703/gdb/Makefile.in 2012-07-06 21:44:57.768444937 +0200
--- gdb-7.4.91.20120801.orig/gdb/Makefile.in 2012-08-01 18:44:51.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/Makefile.in 2012-08-01 18:47:05.701820594 +0200
@@ -151,6 +151,9 @@ READLINE_CFLAGS = @READLINE_CFLAGS@
# Where is expat? This will be empty if expat was not available.
LIBEXPAT = @LIBEXPAT@
@ -27,10 +27,10 @@ Index: gdb-7.4.50.20120703/gdb/Makefile.in
$(LIBIBERTY) $(WIN32LIBS) $(LIBGNU)
CDEPS = $(XM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \
$(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU)
Index: gdb-7.4.50.20120703/gdb/config.in
Index: gdb-7.4.91.20120801/gdb/config.in
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/config.in 2012-07-06 21:44:57.599444705 +0200
+++ gdb-7.4.50.20120703/gdb/config.in 2012-07-06 21:44:57.769444938 +0200
--- gdb-7.4.91.20120801.orig/gdb/config.in 2012-08-01 18:45:21.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/config.in 2012-08-01 18:47:05.701820594 +0200
@@ -198,6 +198,9 @@
/* Define to 1 if you have the `libiconvlist' function. */
#undef HAVE_LIBICONVLIST
@ -41,10 +41,10 @@ Index: gdb-7.4.50.20120703/gdb/config.in
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
Index: gdb-7.4.50.20120703/gdb/configure
Index: gdb-7.4.91.20120801/gdb/configure
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/configure 2012-07-06 21:44:57.696444838 +0200
+++ gdb-7.4.50.20120703/gdb/configure 2012-07-06 21:53:47.667170352 +0200
--- gdb-7.4.91.20120801.orig/gdb/configure 2012-08-01 18:45:21.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/configure 2012-08-01 18:47:05.703820583 +0200
@@ -641,6 +641,9 @@ TCL_VERSION
WIN32LDAPP
GUI_CFLAGS_X
@ -569,10 +569,10 @@ Index: gdb-7.4.50.20120703/gdb/configure
LIBGUI="../libgui/src/libgui.a"
GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
Index: gdb-7.4.50.20120703/gdb/configure.ac
Index: gdb-7.4.91.20120801/gdb/configure.ac
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/configure.ac 2012-07-06 21:44:57.699444841 +0200
+++ gdb-7.4.50.20120703/gdb/configure.ac 2012-07-06 21:53:29.875146225 +0200
--- gdb-7.4.91.20120801.orig/gdb/configure.ac 2012-08-01 18:45:21.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/configure.ac 2012-08-01 18:47:05.704820577 +0200
@@ -2196,6 +2196,27 @@ LIBS=$OLD_LIBS
# Add any host-specific objects to GDB.
CONFIG_OBS="${CONFIG_OBS} ${gdb_host_obs}"
@ -601,10 +601,10 @@ Index: gdb-7.4.50.20120703/gdb/configure.ac
LIBGUI="../libgui/src/libgui.a"
GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
AC_SUBST(LIBGUI)
Index: gdb-7.4.50.20120703/gdb/elfread.c
Index: gdb-7.4.91.20120801/gdb/elfread.c
===================================================================
--- gdb-7.4.50.20120703.orig/gdb/elfread.c 2012-07-06 21:44:57.211444174 +0200
+++ gdb-7.4.50.20120703/gdb/elfread.c 2012-07-06 21:44:57.800444979 +0200
--- gdb-7.4.91.20120801.orig/gdb/elfread.c 2012-08-01 18:44:51.000000000 +0200
+++ gdb-7.4.91.20120801/gdb/elfread.c 2012-08-01 18:57:59.528202398 +0200
@@ -51,6 +51,10 @@
#include "observer.h"
#include "elf/external.h"
@ -852,14 +852,14 @@ Index: gdb-7.4.50.20120703/gdb/elfread.c
+ return NULL;
+
+ /* objfile->NAME lifetime is longer than the ABFD's lifetime. */
+ abfd = bfd_openr_iovec (objfile->name, gnutarget, lzma_open, section,
+ lzma_pread, lzma_close, lzma_stat);
+ abfd = gdb_bfd_openr_iovec (objfile->name, gnutarget, lzma_open, section,
+ lzma_pread, lzma_close, lzma_stat);
+ if (abfd == NULL)
+ return NULL;
+
+ if (!bfd_check_format (abfd, bfd_object))
+ {
+ bfd_close (abfd);
+ gdb_bfd_unref (abfd);
+ return NULL;
+ }
+
@ -879,42 +879,54 @@ Index: gdb-7.4.50.20120703/gdb/elfread.c
/* Scan and build partial symbols for a symbol file.
We have been initialized by a call to elf_symfile_init, which
currently does nothing.
@@ -2433,6 +2693,7 @@ elf_symfile_read (struct objfile *objfil
@@ -2433,6 +2693,8 @@ elf_symfile_read (struct objfile *objfil
else if (!objfile_has_partial_symbols (objfile))
{
char *debugfile, *build_id_filename;
+ bfd *abfd = NULL;
+ struct cleanup *cleanup;
debugfile = find_separate_debug_file_by_buildid (objfile,
&build_id_filename);
@@ -2442,9 +2703,7 @@ elf_symfile_read (struct objfile *objfil
@@ -2440,14 +2702,11 @@ elf_symfile_read (struct objfile *objfil
if (debugfile == NULL)
debugfile = find_separate_debug_file_by_debuglink (objfile);
+ cleanup = make_cleanup (xfree, debugfile);
if (debugfile)
{
- struct cleanup *cleanup = make_cleanup (xfree, debugfile);
- bfd *abfd = symfile_bfd_open (debugfile);
-
- symbol_file_add_separate (abfd, symfile_flags, objfile);
+ abfd = symfile_bfd_open (debugfile);
xfree (debugfile);
make_cleanup_bfd_unref (abfd);
- symbol_file_add_separate (abfd, symfile_flags, objfile);
- do_cleanups (cleanup);
}
/* Check if any separate debug info has been extracted out. */
@@ -2453,6 +2712,12 @@ elf_symfile_read (struct objfile *objfil
else if (bfd_get_section_by_name (objfile->obfd, ".gnu_debuglink")
@@ -2455,6 +2714,17 @@ elf_symfile_read (struct objfile *objfil
debug_print_missing (objfile->name, build_id_filename);
xfree (build_id_filename);
+
+ if (abfd == NULL)
+ abfd = find_separate_debug_file_in_section (objfile);
+ {
+ abfd = find_separate_debug_file_in_section (objfile);
+ make_cleanup_bfd_unref (abfd);
+ }
+
+ if (abfd != NULL)
+ symbol_file_add_separate (abfd, symfile_flags, objfile);
+
+ do_cleanups (cleanup);
}
if (symtab_create_debug)
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.c
Index: gdb-7.4.91.20120801/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.c 2012-07-06 21:44:57.802444983 +0200
+++ gdb-7.4.91.20120801/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.c 2012-08-01 18:47:05.705820572 +0200
@@ -0,0 +1,30 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -946,10 +958,10 @@ Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.c
+{
+ return debugdata_function () + 1;
+}
Index: gdb-7.4.50.20120703/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.exp
Index: gdb-7.4.91.20120801/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.4.50.20120703/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.exp 2012-07-06 21:44:57.809444991 +0200
+++ gdb-7.4.91.20120801/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.exp 2012-08-01 18:47:05.705820572 +0200
@@ -0,0 +1,91 @@
+# Copyright 2012 Free Software Foundation, Inc.
+#

View File

@ -1,295 +0,0 @@
http://sourceware.org/ml/gdb-patches/2012-07/msg00197.html
Subject: [patch] Fix another stale frame_info * (PR 11914, like PR 13866)
Hi,
http://sourceware.org/bugzilla/show_bug.cgi?id=11914
has another case of stale frame_info *. Originally I found it unfixable with
the current struct frame_info * usage but Pedro has shown in PR 13866 it is
possible to fix the cases one by one so I have fixed also this one.
It follows the path of valgrind backtrace showing where the memory is being
freed:
http://sourceware.org/bugzilla/show_bug.cgi?id=11914#c5
This message has been already present in GDB so I used it in more cases:
+ warning (_("Unable to restore previously selected frame."));
No regressions on {x86_64,x86_64-m32,i686}-fedorarawhide-linux-gnu.
I will check it in soon for 7.5.
I find it a bit difficult to reliably reproduce, this testcases mostly always
crashes for me (at least with -lmcheck).
Thanks,
Jan
gdb/
2012-07-14 Jan Kratochvil <jan.kratochvil@redhat.com>
PR 11914
* f-valprint.c (info_common_command): New variable frame_id.
Reinitialize FI form FRAME_ID after each print_variable_and_value.
* printcmd.c (print_variable_and_value): Extend function comment.
Add comment for invalidated FRAME.
* stack.c (backtrace_command_1): New variable frame_id. Reinitialize
FI form FRAME_ID after each print_frame_local_vars.
(struct print_variable_and_value_data): Change frame to frame_id.
(do_print_variable_and_value): New variable frame, initialize it from
p->frame_id. Add comment for invalidated FRAME.
(print_frame_local_vars, print_frame_arg_vars): New function comment.
Update CB_DATA.FRAME to CB_DATA.FRAME_ID initialization. Add comment
for invalidated FRAME.
gdb/testsuite/
2012-07-14 Jan Kratochvil <jan.kratochvil@redhat.com>
PR 11914
* gdb.python/py-prettyprint.c (eval_func, eval_sub): New.
(main): Call eval_sub.
* gdb.python/py-prettyprint.exp:
(python execfile ('py-prettyprint.py')): Move it earlier.
New breakpoint for eval-break.
(continue to breakpoint: eval-break, info locals): New test.
(python execfile ('py-prettyprint.py')): Move it from here.
* gdb.python/py-prettyprint.py (class pp_eval_type): New.
(register_pretty_printers): Register pp_eval_type.
diff --git a/gdb/printcmd.c b/gdb/printcmd.c
index 2a0a886..d5b5b63 100644
--- a/gdb/printcmd.c
+++ b/gdb/printcmd.c
@@ -1961,7 +1961,9 @@ clear_dangling_display_expressions (struct so_list *solib)
struct symbol. NAME is the name to print; if NULL then VAR's print
name will be used. STREAM is the ui_file on which to print the
value. INDENT specifies the number of indent levels to print
- before printing the variable name. */
+ before printing the variable name.
+
+ This function invalidates FRAME. */
void
print_variable_and_value (const char *name, struct symbol *var,
@@ -1983,6 +1985,10 @@ print_variable_and_value (const char *name, struct symbol *var,
get_user_print_options (&opts);
opts.deref_ref = 1;
common_val_print (val, stream, indent, &opts, current_language);
+
+ /* common_val_print invalidates FRAME when a pretty printer calls inferior
+ function. */
+ frame = NULL;
}
if (except.reason < 0)
fprintf_filtered(stream, "<error reading variable %s (%s)>", name,
diff --git a/gdb/stack.c b/gdb/stack.c
index 2520e2c..35d379d 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -1727,7 +1727,20 @@ backtrace_command_1 (char *count_exp, int show_locals, int from_tty)
the frame->prev field gets set to NULL in that case). */
print_frame_info (fi, 1, LOCATION, 1);
if (show_locals)
- print_frame_local_vars (fi, 1, gdb_stdout);
+ {
+ struct frame_id frame_id = get_frame_id (fi);
+
+ print_frame_local_vars (fi, 1, gdb_stdout);
+
+ /* print_frame_local_vars invalidates FI. */
+ fi = frame_find_by_id (frame_id);
+ if (fi == NULL)
+ {
+ trailing = NULL;
+ warning (_("Unable to restore previously selected frame."));
+ break;
+ }
+ }
/* Save the last frame to check for error conditions. */
trailing = fi;
@@ -1919,7 +1932,7 @@ iterate_over_block_local_vars (struct block *block,
struct print_variable_and_value_data
{
- struct frame_info *frame;
+ struct frame_id frame_id;
int num_tabs;
struct ui_file *stream;
int values_printed;
@@ -1933,12 +1946,28 @@ do_print_variable_and_value (const char *print_name,
void *cb_data)
{
struct print_variable_and_value_data *p = cb_data;
+ struct frame_info *frame;
+
+ frame = frame_find_by_id (p->frame_id);
+ if (frame == NULL)
+ {
+ warning (_("Unable to restore previously selected frame."));
+ return;
+ }
+
+ print_variable_and_value (print_name, sym, frame, p->stream, p->num_tabs);
+
+ /* print_variable_and_value invalidates FRAME. */
+ frame = NULL;
- print_variable_and_value (print_name, sym,
- p->frame, p->stream, p->num_tabs);
p->values_printed = 1;
}
+/* Print all variables from the innermost up to the function block of FRAME.
+ Print them with values to STREAM indented by NUM_TABS.
+
+ This function will invalidate FRAME. */
+
static void
print_frame_local_vars (struct frame_info *frame, int num_tabs,
struct ui_file *stream)
@@ -1961,7 +1990,7 @@ print_frame_local_vars (struct frame_info *frame, int num_tabs,
return;
}
- cb_data.frame = frame;
+ cb_data.frame_id = get_frame_id (frame);
cb_data.num_tabs = 4 * num_tabs;
cb_data.stream = stream;
cb_data.values_printed = 0;
@@ -1970,6 +1999,9 @@ print_frame_local_vars (struct frame_info *frame, int num_tabs,
do_print_variable_and_value,
&cb_data);
+ /* do_print_variable_and_value invalidates FRAME. */
+ frame = NULL;
+
if (!cb_data.values_printed)
fprintf_filtered (stream, _("No locals.\n"));
}
@@ -2016,6 +2048,11 @@ iterate_over_block_arg_vars (struct block *b,
}
}
+/* Print all argument variables of the function of FRAME.
+ Print them with values to STREAM.
+
+ This function will invalidate FRAME. */
+
static void
print_frame_arg_vars (struct frame_info *frame, struct ui_file *stream)
{
@@ -2036,7 +2073,7 @@ print_frame_arg_vars (struct frame_info *frame, struct ui_file *stream)
return;
}
- cb_data.frame = frame;
+ cb_data.frame_id = get_frame_id (frame);
cb_data.num_tabs = 0;
cb_data.stream = gdb_stdout;
cb_data.values_printed = 0;
@@ -2044,6 +2081,9 @@ print_frame_arg_vars (struct frame_info *frame, struct ui_file *stream)
iterate_over_block_arg_vars (SYMBOL_BLOCK_VALUE (func),
do_print_variable_and_value, &cb_data);
+ /* do_print_variable_and_value invalidates FRAME. */
+ frame = NULL;
+
if (!cb_data.values_printed)
fprintf_filtered (stream, _("No arguments.\n"));
}
diff --git a/gdb/testsuite/gdb.python/py-prettyprint.c b/gdb/testsuite/gdb.python/py-prettyprint.c
index 0ff7b33..1ff9e05 100644
--- a/gdb/testsuite/gdb.python/py-prettyprint.c
+++ b/gdb/testsuite/gdb.python/py-prettyprint.c
@@ -219,6 +219,22 @@ struct nullstr
struct string_repr string_1 = { { "one" } };
struct string_repr string_2 = { { "two" } };
+static int
+eval_func (int p1, int p2, int p3, int p4, int p5, int p6, int p7, int p8)
+{
+ return p1;
+}
+
+static void
+eval_sub (void)
+{
+ struct eval_type_s { int x; } eval1 = { 1 }, eval2 = { 2 }, eval3 = { 3 },
+ eval4 = { 4 }, eval5 = { 5 }, eval6 = { 6 },
+ eval7 = { 7 }, eval8 = { 8 }, eval9 = { 9 };
+
+ eval1.x++; /* eval-break */
+}
+
int
main ()
{
@@ -309,5 +325,7 @@ main ()
nstype2 = nstype;
+ eval_sub ();
+
return 0; /* break to inspect struct and union */
}
diff --git a/gdb/testsuite/gdb.python/py-prettyprint.exp b/gdb/testsuite/gdb.python/py-prettyprint.exp
index a6c241a..22af83c 100644
--- a/gdb/testsuite/gdb.python/py-prettyprint.exp
+++ b/gdb/testsuite/gdb.python/py-prettyprint.exp
@@ -123,14 +123,19 @@ if ![runto_main ] then {
return
}
-gdb_test "b [gdb_get_line_number {break to inspect} ${testfile}.c ]" \
- ".*Breakpoint.*"
-gdb_test "continue" ".*Breakpoint.*"
-
set remote_python_file [remote_download host ${srcdir}/${subdir}/${testfile}.py]
gdb_test_no_output "python execfile ('${remote_python_file}')"
+gdb_breakpoint [gdb_get_line_number "eval-break"]
+gdb_continue_to_breakpoint "eval-break" ".* eval-break .*"
+
+gdb_test "info locals" "eval9 = eval=<123456789>"
+
+gdb_test "b [gdb_get_line_number {break to inspect} ${testfile}.c ]" \
+ ".*Breakpoint.*"
+gdb_test "continue" ".*Breakpoint.*"
+
gdb_test "print ss" " = a=< a=<1> b=<$hex>> b=< a=<2> b=<$hex>>" \
"print ss enabled #1"
diff --git a/gdb/testsuite/gdb.python/py-prettyprint.py b/gdb/testsuite/gdb.python/py-prettyprint.py
index 52ffd1a..b02b90f 100644
--- a/gdb/testsuite/gdb.python/py-prettyprint.py
+++ b/gdb/testsuite/gdb.python/py-prettyprint.py
@@ -199,6 +199,14 @@ class MemoryErrorString:
def display_hint (self):
return 'string'
+class pp_eval_type:
+ def __init__(self, val):
+ self.val = val
+
+ def to_string(self):
+ gdb.execute("bt", to_string=True)
+ return "eval=<" + str(gdb.parse_and_eval("eval_func (123456789, 2, 3, 4, 5, 6, 7, 8)")) + ">"
+
def lookup_function (val):
"Look-up and return a pretty-printer that can print val."
@@ -276,6 +284,8 @@ def register_pretty_printers ():
pretty_printers_dict[re.compile ('^memory_error$')] = MemoryErrorString
+ pretty_printers_dict[re.compile ('^eval_type_s$')] = pp_eval_type
+
pretty_printers_dict = {}
register_pretty_printers ()

View File

@ -1,55 +0,0 @@
http://sourceware.org/ml/gdb-patches/2012-07/msg00200.html
Subject: [obv] testsuite: Fix fission-reread.S regression by me
Hi Doug,
I broke the testcase by patch
[patch 1/2] testcase: Make it -m32 compatible [Re: [commit] Fix rereading of DWO DIEs]
http://sourceware.org/ml/gdb-patches/2012-07/msg00009.html
The testcase itself usually PASSes but sometimes it does not. It is more
clear with 'readelf -wi':
<7b> DW_AT_frame_base : 97 byte block: 7a 0 1 7 19 8b 7e ac ce f1 22 90 2 fb 1 0 0 0 0 0 0 0 0 0 0 0 0 0 51 cd 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 (DW_OP_breg10 (r10): 0; (Unknown location op))
Checked in.
Sorry,
Jan
http://sourceware.org/ml/gdb-cvs/2012-07/msg00102.html
--- src/gdb/testsuite/ChangeLog 2012/07/13 20:26:10 1.3292
+++ src/gdb/testsuite/ChangeLog 2012/07/15 08:34:55 1.3293
@@ -1,3 +1,9 @@
+2012-07-15 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Fix a testcase regression by me.
+ * gdb.dwarf2/fission-reread.S: Fix two DW_FORM_data8 to be
+ DW_FORM_data4.
+
2012-07-13 Jan Kratochvil <jan.kratochvil@redhat.com>
Doug Evans <dje@google.com>
--- src/gdb/testsuite/gdb.dwarf2/fission-reread.S 2012/07/02 20:10:48 1.3
+++ src/gdb/testsuite/gdb.dwarf2/fission-reread.S 2012/07/15 08:34:55 1.4
@@ -231,7 +231,7 @@
.uleb128 0x11 /* (DW_AT_low_pc) */
.uleb128 0x1 /* (DW_FORM_addr) */
.uleb128 0x12 /* (DW_AT_high_pc) */
- .uleb128 0x7 /* (DW_FORM_data8) */
+ .uleb128 0x6 /* (DW_FORM_data4) */
.uleb128 0x10 /* (DW_AT_stmt_list) */
.uleb128 0x17 /* (DW_FORM_sec_offset) */
.uleb128 0x1b /* (DW_AT_comp_dir) */
@@ -351,7 +351,7 @@
.uleb128 0x11 /* (DW_AT_low_pc) */
.uleb128 0x1f01 /* (DW_FORM_GNU_addr_index) */
.uleb128 0x12 /* (DW_AT_high_pc) */
- .uleb128 0x7 /* (DW_FORM_data8) */
+ .uleb128 0x6 /* (DW_FORM_data4) */
.uleb128 0x40 /* (DW_AT_frame_base) */
.uleb128 0x18 /* (DW_FORM_exprloc) */
.byte 0

View File

@ -30,12 +30,12 @@ Name: %{?scl_prefix}gdb
# Set version to contents of gdb/version.in.
# 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).
%global snap 20120714
Version: 7.4.50.%{snap}
%global snap 20120801
Version: 7.4.91.%{snap}
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 16%{?dist}
Release: 17%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain
Group: Development/Debuggers
@ -264,7 +264,7 @@ Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch
# Backported fixups post the source tarball.
#Xdrop: Just backports.
Patch232: gdb-upstream.patch
#Patch232: gdb-upstream.patch
# Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
#=fedoratest+ppc
@ -548,10 +548,6 @@ Patch661: gdb-stale-frame_info.patch
#=push+work: But push it to glibc.
Patch690: gdb-glibc-strstr-workaround.patch
# Disable -lmcheck in the development builds.
#=fedora
Patch694: gdb-disable-mcheck.patch
# Include testcase for `Unable to see a variable inside a module (XLF)' (BZ 823789).
#=fedoratest
#+ppc
@ -565,10 +561,6 @@ Patch703: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch
#=fedora
Patch716: gdb-minidebuginfo.patch
# Fix another stale frame_info * (PR 11914, like PR 13866).
#=push
Patch718: gdb-stale-frame_info-python.patch
%if 0%{!?rhel:1} || 0%{?rhel} > 6
# RL_STATE_FEDORA_GDB would not be found for:
# Patch642: gdb-readline62-ask-more-rh.patch
@ -763,7 +755,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
# Match the Fedora's version info.
%patch2 -p1
%patch232 -p1
#patch232 -p1
%patch349 -p1
%patch1 -p1
%patch3 -p1
@ -867,11 +859,9 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch657 -p1
%patch661 -p1
%patch690 -p1
%patch694 -p1
%patch698 -p1
%patch703 -p1
%patch716 -p1
%patch718 -p1
%patch393 -p1
%if 0%{!?el5:1} || 0%{?scl:1}
@ -1366,6 +1356,10 @@ fi
%endif # 0%{!?el5:1} || "%{_target_cpu}" == "noarch"
%changelog
* Wed Aug 1 2012 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.4.91.20120801-17
- Rebase to FSF GDB 7.4.91.20120801.
- [dwz] Rebase it from FSF GDB HEAD.
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.4.50.20120714-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

View File

@ -1,2 +1,2 @@
04e5c4b1b9e633422cc48990fe61958d libstdc++-v3-python-r155978.tar.bz2
115a6a521aef2ce306fd3e7fadd79c02 gdb-7.4.50.20120714.tar.bz2
ed42ee95b7a114551094c84ee4192643 gdb-7.4.91.20120801.tar.bz2