Accepting request 63748 from devel:gcc

Accepted submit request 63748 from user rguenther

OBS-URL: https://build.opensuse.org/request/show/63748
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gdb?expand=0&rev=83
This commit is contained in:
Sascha Peilicke 2011-03-10 09:18:25 +00:00 committed by Git OBS Bridge
parent a0925cfe35
commit 4ef88615fc
69 changed files with 10284 additions and 9377 deletions

View File

@ -1,88 +0,0 @@
2005-12-01 Jeff Johnston <jjohnstn@redhat.com>
* frame.c (backtrace_past_zero_pc): New static variable.
(get_prev_frame): Don't return NULL for zero pc value if
backtrace past-zero-frame option is turned on.
(_initialize_frame): Initialize new command to allow backtracing
past a zero pc value (set backtrace past-zero-pc).
testsuite/gdb.base:
2005-12-01 Jeff Johnston <jjohnstn@redhat.com>
* setshow.exp: Add testing of "set backtrace past-zero-pc" option.
2007-10-15 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-7.1.90.20100711/gdb/testsuite/gdb.base/setshow.exp
===================================================================
--- gdb-7.1.90.20100711.orig/gdb/testsuite/gdb.base/setshow.exp 2010-06-11 22:56:06.000000000 +0200
+++ gdb-7.1.90.20100711/gdb/testsuite/gdb.base/setshow.exp 2010-07-12 10:46:06.000000000 +0200
@@ -96,6 +96,16 @@ if { ![target_info exists use_gdb_stub]
delete_breakpoints
gdb_test "run" "Starting program:.*foo bar blup baz bubble.*" "passing args"
}
+#test show backtrace past-zero-pc
+gdb_test "show backtrace past-zero-pc" "Whether backtraces should continue past a zero pc value is off." "default show backtrace past-zero-pc (off)"
+#test set backtrace past-zero-pc on
+gdb_test "set backtrace past-zero-pc on" "" "set backtrace past-zero-pc on"
+#test show backtrace past-zero-pc
+gdb_test "show backtrace past-zero-pc" "Whether backtraces should continue past a zero pc value is on." "show backtrace past-zero-pc (on)"
+#test set backtrace past-zero-pc off
+gdb_test "set backtrace past-zero-pc off" "" "set backtrace past-zero-pc off"
+#test show backtrace past-zero-pc
+gdb_test "show backtrace past-zero-pc" "Whether backtraces should continue past a zero pc value is off." "show backtrace past-zero-pc (off)"
#test set check range on
gdb_test "set check range on" ".*" "set check range on"
#test show check range on
Index: gdb-7.1.90.20100711/gdb/frame.c
===================================================================
--- gdb-7.1.90.20100711.orig/gdb/frame.c 2010-07-12 10:00:56.000000000 +0200
+++ gdb-7.1.90.20100711/gdb/frame.c 2010-07-12 10:45:18.000000000 +0200
@@ -185,6 +185,16 @@ Whether backtraces should continue past
value);
}
+static int backtrace_past_zero_pc;
+static void
+show_backtrace_past_zero_pc (struct ui_file *file, int from_tty,
+ struct cmd_list_element *c, const char *value)
+{
+ fprintf_filtered (file, _("\
+Whether backtraces should continue past a zero pc value is %s.\n"),
+ value);
+}
+
static int backtrace_past_entry;
static void
show_backtrace_past_entry (struct ui_file *file, int from_tty,
@@ -1784,9 +1794,7 @@ get_prev_frame (struct frame_info *this_
}
if (this_frame->level > 0
-#if 0
- && backtrace_past_zero_pc
-#endif
+ && !backtrace_past_zero_pc
&& get_frame_type (this_frame) == NORMAL_FRAME
&& get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME
&& get_frame_pc (this_frame) == 0)
@@ -2271,6 +2279,17 @@ the rest of the stack trace."),
&set_backtrace_cmdlist,
&show_backtrace_cmdlist);
+ add_setshow_boolean_cmd ("past-zero-pc", class_obscure,
+ &backtrace_past_zero_pc, _("\
+Set whether backtraces should continue past a zero pc value."), _("\
+Show whether backtraces should continue past a zero pc value."), _("\
+Normally GDB stops backtracing when it finds a zero pc.\n\
+Set this variable if you need to see the rest of the stack trace."),
+ NULL,
+ show_backtrace_past_zero_pc,
+ &set_backtrace_cmdlist,
+ &show_backtrace_cmdlist);
+
add_setshow_integer_cmd ("limit", class_obscure,
&backtrace_limit, _("\
Set an upper bound on the number of backtrace levels."), _("\

View File

@ -1,11 +1,11 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=231832 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=231832
Index: gdb-6.8/gdb/symmisc.c Index: gdb-7.2.50.20101116/gdb/symmisc.c
=================================================================== ===================================================================
--- gdb-6.8.orig/gdb/symmisc.c 2008-03-17 16:06:24.000000000 +0100 --- gdb-7.2.50.20101116.orig/gdb/symmisc.c 2010-11-16 07:53:59.000000000 +0100
+++ gdb-6.8/gdb/symmisc.c 2008-07-14 10:27:50.000000000 +0200 +++ gdb-7.2.50.20101116/gdb/symmisc.c 2010-11-16 08:03:08.000000000 +0100
@@ -230,8 +230,8 @@ print_objfile_statistics (void) @@ -186,8 +186,8 @@ print_objfile_statistics (void)
if (OBJSTAT (objfile, sz_strtab) > 0) if (OBJSTAT (objfile, sz_strtab) > 0)
printf_filtered (_(" Space used by a.out string tables: %d\n"), printf_filtered (_(" Space used by a.out string tables: %d\n"),
OBJSTAT (objfile, sz_strtab)); OBJSTAT (objfile, sz_strtab));
@ -14,12 +14,12 @@ Index: gdb-6.8/gdb/symmisc.c
+ printf_filtered (_(" Total memory used for objfile obstack: %ld\n"), + printf_filtered (_(" Total memory used for objfile obstack: %ld\n"),
+ (long) obstack_memory_used (&objfile->objfile_obstack)); + (long) obstack_memory_used (&objfile->objfile_obstack));
printf_filtered (_(" Total memory used for psymbol cache: %d\n"), printf_filtered (_(" Total memory used for psymbol cache: %d\n"),
bcache_memory_used (objfile->psymbol_cache)); bcache_memory_used (psymbol_bcache_get_bcache
printf_filtered (_(" Total memory used for macro cache: %d\n"), (objfile->psymbol_cache)));
Index: gdb-6.8/include/obstack.h Index: gdb-7.2.50.20101116/include/obstack.h
=================================================================== ===================================================================
--- gdb-6.8.orig/include/obstack.h 2005-05-10 12:21:08.000000000 +0200 --- gdb-7.2.50.20101116.orig/include/obstack.h 2008-10-21 01:03:31.000000000 +0200
+++ gdb-6.8/include/obstack.h 2008-07-14 10:27:50.000000000 +0200 +++ gdb-7.2.50.20101116/include/obstack.h 2010-11-16 08:02:37.000000000 +0100
@@ -188,31 +188,31 @@ struct obstack /* control current objec @@ -188,31 +188,31 @@ struct obstack /* control current objec
/* Declare the external functions we use; they are in obstack.c. */ /* Declare the external functions we use; they are in obstack.c. */
@ -134,10 +134,10 @@ Index: gdb-6.8/include/obstack.h
= (h)->temp + (char *) (h)->chunk) \ = (h)->temp + (char *) (h)->chunk) \
: (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0))) : (((obstack_free) ((h), (h)->temp + (char *) (h)->chunk), 0), 0)))
Index: gdb-6.8/libiberty/obstack.c Index: gdb-7.2.50.20101116/libiberty/obstack.c
=================================================================== ===================================================================
--- gdb-6.8.orig/libiberty/obstack.c 2005-05-10 17:33:33.000000000 +0200 --- gdb-7.2.50.20101116.orig/libiberty/obstack.c 2005-05-10 17:33:33.000000000 +0200
+++ gdb-6.8/libiberty/obstack.c 2008-07-14 10:27:50.000000000 +0200 +++ gdb-7.2.50.20101116/libiberty/obstack.c 2010-11-16 08:02:37.000000000 +0100
@@ -44,9 +44,11 @@ @@ -44,9 +44,11 @@
#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1 #if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
#include <gnu-versions.h> #include <gnu-versions.h>

View File

@ -1,28 +0,0 @@
2004-09-27 Andrew Cagney <cagney@gnu.org>
* frame.c (get_prev_frame): Stop backtrace when a zero PC and
successive normal frames.
Index: gdb-6.8.50.20081128/gdb/frame.c
===================================================================
--- gdb-6.8.50.20081128.orig/gdb/frame.c 2008-12-04 01:34:37.000000000 +0100
+++ gdb-6.8.50.20081128/gdb/frame.c 2008-12-04 01:35:47.000000000 +0100
@@ -1566,6 +1566,18 @@ get_prev_frame (struct frame_info *this_
return NULL;
}
+ if (this_frame->level > 0
+#if 0
+ && backtrace_past_zero_pc
+#endif
+ && get_frame_type (this_frame) == NORMAL_FRAME
+ && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME
+ && get_frame_pc (this_frame) == 0)
+ {
+ frame_debug_got_null_frame (this_frame, "zero PC");
+ return NULL;
+ }
+
return get_prev_frame_1 (this_frame);
}

View File

@ -4,20 +4,20 @@
to install and uninstall. to install and uninstall.
* gstack.sh, gstack.1: New files. * gstack.sh, gstack.1: New files.
Index: gdb-7.2/gdb/Makefile.in Index: gdb-7.2.50.20101116/gdb/Makefile.in
=================================================================== ===================================================================
--- gdb-7.2.orig/gdb/Makefile.in 2010-09-03 09:37:55.000000000 +0200 --- gdb-7.2.50.20101116.orig/gdb/Makefile.in 2010-11-05 15:31:25.000000000 +0100
+++ gdb-7.2/gdb/Makefile.in 2010-09-03 09:38:45.000000000 +0200 +++ gdb-7.2.50.20101116/gdb/Makefile.in 2010-11-16 07:56:10.000000000 +0100
@@ -1010,7 +1010,7 @@ install: all install-only @@ -972,7 +972,7 @@ gdb.z:gdb.1
install: all
@$(MAKE) $(FLAGS_TO_PASS) install-only
# The "install-only" target also installs the syscalls' XML files in -install-only: $(CONFIG_INSTALL)
# the system. +install-only: install-gstack $(CONFIG_INSTALL)
-install-only: $(CONFIG_INSTALL) xml-syscall-install
+install-only: install-gstack $(CONFIG_INSTALL) xml-syscall-install
transformed_name=`t='$(program_transform_name)'; \ transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e "$$t"` ; \ echo gdb | sed -e "$$t"` ; \
if test "x$$transformed_name" = x; then \ if test "x$$transformed_name" = x; then \
@@ -1046,7 +1046,25 @@ install-tui: @@ -1008,7 +1008,25 @@ install-tui:
install-python: install-python:
$(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(GDB_DATADIR)/python/gdb
@ -44,7 +44,7 @@ Index: gdb-7.2/gdb/Makefile.in
transformed_name=`t='$(program_transform_name)'; \ transformed_name=`t='$(program_transform_name)'; \
echo gdb | sed -e $$t` ; \ echo gdb | sed -e $$t` ; \
if test "x$$transformed_name" = x; then \ if test "x$$transformed_name" = x; then \
@@ -1068,6 +1086,17 @@ uninstall-tui: @@ -1030,6 +1048,17 @@ uninstall-tui:
fi ; \ fi ; \
rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \ rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \
$(DESTDIR)$(man1dir)/$$transformed_name.1 $(DESTDIR)$(man1dir)/$$transformed_name.1
@ -62,10 +62,10 @@ Index: gdb-7.2/gdb/Makefile.in
# The C++ name parser can be built standalone for testing. # The C++ name parser can be built standalone for testing.
test-cp-name-parser.o: cp-name-parser.c test-cp-name-parser.o: cp-name-parser.c
Index: gdb-7.2/gdb/gstack.sh Index: gdb-7.2.50.20101116/gdb/gstack.sh
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2/gdb/gstack.sh 2010-09-03 09:38:12.000000000 +0200 +++ gdb-7.2.50.20101116/gdb/gstack.sh 2010-11-16 07:55:47.000000000 +0100
@@ -0,0 +1,48 @@ @@ -0,0 +1,48 @@
+#!/bin/sh +#!/bin/sh
+ +
@ -115,10 +115,10 @@ Index: gdb-7.2/gdb/gstack.sh
+ -e 's/^\((gdb) \)*//' \ + -e 's/^\((gdb) \)*//' \
+ -e '/^#/p' \ + -e '/^#/p' \
+ -e '/^Thread/p' + -e '/^Thread/p'
Index: gdb-7.2/gdb/testsuite/gdb.base/gstack.exp Index: gdb-7.2.50.20101116/gdb/testsuite/gdb.base/gstack.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2/gdb/testsuite/gdb.base/gstack.exp 2010-09-03 09:38:12.000000000 +0200 +++ gdb-7.2.50.20101116/gdb/testsuite/gdb.base/gstack.exp 2010-11-16 07:55:47.000000000 +0100
@@ -0,0 +1,71 @@ @@ -0,0 +1,71 @@
+# Copyright (C) 2010 Free Software Foundation, Inc. +# Copyright (C) 2010 Free Software Foundation, Inc.
+ +
@ -191,10 +191,10 @@ Index: gdb-7.2/gdb/testsuite/gdb.base/gstack.exp
+gdb_exit +gdb_exit
+ +
+remote_exec host "kill -9 $pid" +remote_exec host "kill -9 $pid"
Index: gdb-7.2/gdb/testsuite/gdb.base/gstack.c Index: gdb-7.2.50.20101116/gdb/testsuite/gdb.base/gstack.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2/gdb/testsuite/gdb.base/gstack.c 2010-09-03 09:38:12.000000000 +0200 +++ gdb-7.2.50.20101116/gdb/testsuite/gdb.base/gstack.c 2010-11-16 07:55:47.000000000 +0100
@@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +

View File

@ -1,8 +1,8 @@
Index: gdb-6.8.50.20090802/gdb/gcore.c Index: gdb-7.2.50.20110107/gdb/gcore.c
=================================================================== ===================================================================
--- gdb-6.8.50.20090802.orig/gdb/gcore.c 2009-08-03 12:27:55.000000000 +0200 --- gdb-7.2.50.20110107.orig/gdb/gcore.c 2011-01-05 23:22:49.000000000 +0100
+++ gdb-6.8.50.20090802/gdb/gcore.c 2009-08-03 12:28:56.000000000 +0200 +++ gdb-7.2.50.20110107/gdb/gcore.c 2011-01-07 09:04:28.000000000 +0100
@@ -479,8 +479,14 @@ gcore_copy_callback (bfd *obfd, asection @@ -534,8 +534,14 @@ gcore_copy_callback (bfd *obfd, asection
if (size > total_size) if (size > total_size)
size = total_size; size = total_size;
@ -16,5 +16,5 @@ Index: gdb-6.8.50.20090802/gdb/gcore.c
+ "ia64") + "ia64")
+ || bfd_section_vma (obfd, osec) != 0)) + || bfd_section_vma (obfd, osec) != 0))
{ {
warning (_("Memory read failed for corefile section, %s bytes at %s."), warning (_("Memory read failed for corefile "
plongest (size), "section, %s bytes at %s."),

View File

@ -12,10 +12,10 @@ gdb/testsuite:
* gdb.arch/ia64-sigill.c: New test. * gdb.arch/ia64-sigill.c: New test.
* gdb.arch/ia64-sigill.exp: Ditto. * gdb.arch/ia64-sigill.exp: Ditto.
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.arch/ia64-sigill.exp Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.arch/ia64-sigill.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.arch/ia64-sigill.exp 2008-12-02 21:10:57.000000000 +0100 +++ gdb-7.2.50.20101231/gdb/testsuite/gdb.arch/ia64-sigill.exp 2011-01-01 00:55:04.000000000 +0100
@@ -0,0 +1,49 @@ @@ -0,0 +1,49 @@
+# Copyright 2005 Free Software Foundation, Inc. +# Copyright 2005 Free Software Foundation, Inc.
+ +
@ -66,10 +66,10 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.arch/ia64-sigill.exp
+gdb_test "handle SIGILL nostop noprint" "SIGILL.*No.*No.*Yes.*" "handle sigill" +gdb_test "handle SIGILL nostop noprint" "SIGILL.*No.*No.*Yes.*" "handle sigill"
+gdb_test "run" "Starting program.*ia64-sigill.*\[New thread.*\].*hello world.*Program exited normally." "run to exit" +gdb_test "run" "Starting program.*ia64-sigill.*\[New thread.*\].*hello world.*Program exited normally." "run to exit"
+ +
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.arch/ia64-sigill.c Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.arch/ia64-sigill.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.arch/ia64-sigill.c 2008-12-02 21:10:57.000000000 +0100 +++ gdb-7.2.50.20101231/gdb/testsuite/gdb.arch/ia64-sigill.c 2011-01-01 00:55:04.000000000 +0100
@@ -0,0 +1,8 @@ @@ -0,0 +1,8 @@
+#include <stdio.h> +#include <stdio.h>
+ +
@ -79,11 +79,11 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.arch/ia64-sigill.c
+ return 0; + return 0;
+} +}
+ +
Index: gdb-6.8.50.20081128/gdb/linux-nat.c Index: gdb-7.2.50.20101231/gdb/linux-nat.c
=================================================================== ===================================================================
--- gdb-6.8.50.20081128.orig/gdb/linux-nat.c 2008-12-02 19:04:38.000000000 +0100 --- gdb-7.2.50.20101231.orig/gdb/linux-nat.c 2011-01-01 00:54:04.000000000 +0100
+++ gdb-6.8.50.20081128/gdb/linux-nat.c 2008-12-02 21:11:11.000000000 +0100 +++ gdb-7.2.50.20101231/gdb/linux-nat.c 2011-01-01 00:55:58.000000000 +0100
@@ -2974,7 +2974,8 @@ retry: @@ -3652,7 +3652,8 @@ retry:
threads can be a bit time-consuming so if we want decent threads can be a bit time-consuming so if we want decent
performance with heavily multi-threaded programs, especially when performance with heavily multi-threaded programs, especially when
they're using a high frequency timer, we'd better avoid it if we they're using a high frequency timer, we'd better avoid it if we
@ -93,8 +93,8 @@ Index: gdb-6.8.50.20081128/gdb/linux-nat.c
if (WIFSTOPPED (status)) if (WIFSTOPPED (status))
{ {
@@ -2992,7 +2993,9 @@ retry: @@ -3670,7 +3671,9 @@ retry:
&& inf->stop_soon == NO_STOP_QUIETLY && inf->control.stop_soon == NO_STOP_QUIETLY
&& signal_stop_state (signo) == 0 && signal_stop_state (signo) == 0
&& signal_print_state (signo) == 0 && signal_print_state (signo) == 0
- && signal_pass_state (signo) == 1) - && signal_pass_state (signo) == 1)

View File

@ -1,26 +0,0 @@
2005-03-24 Jeff Johnston <jjohnstn@redhat.com>
* valops.c (check_field_in): Use check_typedef for base classes
to avoid problems with opaque type references.
Index: gdb-6.8.50.20081128/gdb/valops.c
===================================================================
--- gdb-6.8.50.20081128.orig/gdb/valops.c 2008-12-08 10:56:11.000000000 +0100
+++ gdb-6.8.50.20081128/gdb/valops.c 2008-12-08 10:59:14.000000000 +0100
@@ -2484,8 +2484,14 @@ check_field (struct type *type, const ch
}
for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--)
- if (check_field (TYPE_BASECLASS (type, i), name))
- return 1;
+ {
+ /* Check the base classes. Make sure we have the real type for
+ each base class as opposed to an opaque declaration. */
+ struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i));
+
+ if (check_field (baseclass, name))
+ return 1;
+ }
return 0;
}

View File

@ -1,305 +0,0 @@
2005-12-14 Jeff Johnston <jjohnstn@redhat.com>
* symfile-mem.c (read_memory): New static read callback function.
(symfile_add_from_memory): Pass read_memory to bfd instead of
target_read_memory.
* target.c (target_xfer_memory): Add support for LONGEST len and
change all callers.
(deprecated_debug_xfer_memory, target_read_memory): Ditto.
(target_write_memory, do_xfer_memory): Ditto.
(target_xfer_memory_partial, target_read_memory_partial): Ditto.
(target_write_memory_partial): Ditto.
* infptrace.c (child_xfer_memory): Ditto.
* linux-nat.c (linux_nat_xfer_memory): Ditto.
(linux_nat_proc_xfer_memory): Ditto.
* dcache.c (dcache_xfer_memory): Ditto.
* exec.c (xfer_memory): Ditto.
* remote.c (remote_xfer_memory): Ditto.
* remote-sim.c (gdbsim_xfer_interior_memory): Ditto.
* target.h: Change prototypes for functions changed above.
* linux-nat.h: Ditto.
* remote.h: Ditto.
* dcache.h: Ditto.
2007-10-15 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-7.1.90.20100711/gdb/symfile-mem.c
===================================================================
--- gdb-7.1.90.20100711.orig/gdb/symfile-mem.c 2010-01-01 08:31:42.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/symfile-mem.c 2010-07-12 10:46:24.000000000 +0200
@@ -57,6 +57,14 @@
#include "elf/common.h"
+/* Local callback routine to pass to bfd to read from target memory,
+ using a len constrained to INT_MAX. */
+static int
+read_target_memory (bfd_vma addr, bfd_byte *buf, int len)
+{
+ return target_read_memory (addr, buf, (LONGEST)len);
+}
+
/* Read inferior memory at ADDR to find the header of a loaded object file
and read its in-core symbols out of inferior memory. TEMPL is a bfd
representing the target's format. NAME is the name to use for this
@@ -77,7 +85,7 @@ symbol_file_add_from_memory (struct bfd
error (_("add-symbol-file-from-memory not supported for this target"));
nbfd = bfd_elf_bfd_from_remote_memory (templ, addr, &loadbase,
- target_read_memory);
+ read_target_memory);
if (nbfd == NULL)
error (_("Failed to read a valid object file image from memory."));
Index: gdb-7.1.90.20100711/gdb/target.c
===================================================================
--- gdb-7.1.90.20100711.orig/gdb/target.c 2010-07-12 10:00:56.000000000 +0200
+++ gdb-7.1.90.20100711/gdb/target.c 2010-07-12 10:47:04.000000000 +0200
@@ -58,7 +58,7 @@ static int nosymbol (char *, CORE_ADDR *
static void tcomplain (void) ATTRIBUTE_NORETURN;
-static int nomemory (CORE_ADDR, char *, int, int, struct target_ops *);
+static LONGEST nomemory (CORE_ADDR, char *, int, int, struct target_ops *);
static int return_zero (void);
@@ -513,7 +513,7 @@ target_terminal_inferior (void)
(*current_target.to_terminal_inferior) ();
}
-static int
+static LONGEST
nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write,
struct target_ops *t)
{
@@ -718,7 +718,7 @@ update_current_target (void)
(void (*) (struct regcache *))
noprocess);
de_fault (deprecated_xfer_memory,
- (int (*) (CORE_ADDR, gdb_byte *, int, int, struct mem_attrib *, struct target_ops *))
+ (LONGEST (*) (CORE_ADDR, gdb_byte *, LONGEST, int, struct mem_attrib *, struct target_ops *))
nomemory);
de_fault (to_files_info,
(void (*) (struct target_ops *))
@@ -1526,7 +1526,7 @@ target_xfer_partial (struct target_ops *
it makes no progress, and then return how much was transferred). */
int
-target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
+target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len)
{
/* Dispatch to the topmost target, not the flattened current_target.
Memory accesses check target->to_has_(all_)memory, and the
@@ -1542,7 +1542,7 @@ target_read_memory (CORE_ADDR memaddr, g
the target's stack. This may trigger different cache behavior. */
int
-target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len)
+target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len)
{
/* Dispatch to the topmost target, not the flattened current_target.
Memory accesses check target->to_has_(all_)memory, and the
@@ -1561,7 +1561,7 @@ target_read_stack (CORE_ADDR memaddr, gd
Callers that can deal with partial writes should call target_write. */
int
-target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, int len)
+target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr, LONGEST len)
{
/* Dispatch to the topmost target, not the flattened current_target.
Memory accesses check target->to_has_(all_)memory, and the
@@ -3218,8 +3218,8 @@ debug_to_prepare_to_store (struct regcac
fprintf_unfiltered (gdb_stdlog, "target_prepare_to_store ()\n");
}
-static int
-deprecated_debug_xfer_memory (CORE_ADDR memaddr, bfd_byte *myaddr, int len,
+static LONGEST
+deprecated_debug_xfer_memory (CORE_ADDR memaddr, bfd_byte *myaddr, LONGEST len,
int write, struct mem_attrib *attrib,
struct target_ops *target)
{
@@ -3229,8 +3229,8 @@ deprecated_debug_xfer_memory (CORE_ADDR
attrib, target);
fprintf_unfiltered (gdb_stdlog,
- "target_xfer_memory (%s, xxx, %d, %s, xxx) = %d",
- paddress (target_gdbarch, memaddr), len,
+ "target_xfer_memory (%s, xxx, %ld, %s, xxx) = %d",
+ paddress (target_gdbarch, memaddr), (long) len,
write ? "write" : "read", retval);
if (retval > 0)
Index: gdb-7.1.90.20100711/gdb/target.h
===================================================================
--- gdb-7.1.90.20100711.orig/gdb/target.h 2010-07-12 10:00:56.000000000 +0200
+++ gdb-7.1.90.20100711/gdb/target.h 2010-07-12 10:46:24.000000000 +0200
@@ -417,10 +417,10 @@ struct target_ops
NOTE: cagney/2004-10-01: This has been entirely superseeded by
to_xfer_partial and inferior inheritance. */
- int (*deprecated_xfer_memory) (CORE_ADDR memaddr, gdb_byte *myaddr,
- int len, int write,
- struct mem_attrib *attrib,
- struct target_ops *target);
+ LONGEST (*deprecated_xfer_memory) (CORE_ADDR memaddr, gdb_byte *myaddr,
+ LONGEST len, int write,
+ struct mem_attrib *attrib,
+ struct target_ops *target);
void (*to_files_info) (struct target_ops *);
int (*to_insert_breakpoint) (struct gdbarch *, struct bp_target_info *);
@@ -838,12 +838,12 @@ extern void target_dcache_invalidate (vo
extern int target_read_string (CORE_ADDR, char **, int, int *);
-extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len);
+extern int target_read_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len);
-extern int target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, int len);
+extern int target_read_stack (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len);
extern int target_write_memory (CORE_ADDR memaddr, const gdb_byte *myaddr,
- int len);
+ LONGEST len);
/* Fetches the target's memory map. If one is found it is sorted
and returned, after some consistency checking. Otherwise, NULL
Index: gdb-7.1.90.20100711/gdb/dcache.c
===================================================================
--- gdb-7.1.90.20100711.orig/gdb/dcache.c 2010-05-14 19:53:15.000000000 +0200
+++ gdb-7.1.90.20100711/gdb/dcache.c 2010-07-12 10:46:24.000000000 +0200
@@ -465,10 +465,10 @@ dcache_free (DCACHE *dcache)
NOTE: This is different than the to_xfer_partial interface, in which
positive values less than LEN mean further transfers may be possible. */
-int
+LONGEST
dcache_xfer_memory (struct target_ops *ops, DCACHE *dcache,
CORE_ADDR memaddr, gdb_byte *myaddr,
- int len, int should_write)
+ LONGEST len, int should_write)
{
int i;
int res;
Index: gdb-7.1.90.20100711/gdb/dcache.h
===================================================================
--- gdb-7.1.90.20100711.orig/gdb/dcache.h 2010-01-01 08:31:30.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/dcache.h 2010-07-12 10:46:24.000000000 +0200
@@ -35,8 +35,8 @@ void dcache_free (DCACHE *);
/* Simple to call from <remote>_xfer_memory */
-int dcache_xfer_memory (struct target_ops *ops, DCACHE *cache, CORE_ADDR mem,
- gdb_byte *my, int len, int should_write);
+LONGEST dcache_xfer_memory (struct target_ops *ops, DCACHE *cache, CORE_ADDR mem,
+ gdb_byte *my, LONGEST len, int should_write);
void dcache_update (DCACHE *dcache, CORE_ADDR memaddr, gdb_byte *myaddr,
int len);
Index: gdb-7.1.90.20100711/gdb/exec.c
===================================================================
--- gdb-7.1.90.20100711.orig/gdb/exec.c 2010-05-14 20:35:11.000000000 +0200
+++ gdb-7.1.90.20100711/gdb/exec.c 2010-07-12 10:46:24.000000000 +0200
@@ -571,7 +571,7 @@ map_vmap (bfd *abfd, bfd *arch)
}
-int
+LONGEST
section_table_xfer_memory_partial (gdb_byte *readbuf, const gdb_byte *writebuf,
ULONGEST offset, LONGEST len,
struct target_section *sections,
Index: gdb-7.1.90.20100711/gdb/linux-nat.c
===================================================================
--- gdb-7.1.90.20100711.orig/gdb/linux-nat.c 2010-07-12 10:44:36.000000000 +0200
+++ gdb-7.1.90.20100711/gdb/linux-nat.c 2010-07-12 10:46:24.000000000 +0200
@@ -5197,7 +5197,7 @@ linux_xfer_partial (struct target_ops *o
#endif
if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL)
{ /* This region contains ia64 rse registers, we have to re-read. */
- int xxfer;
+ LONGEST xxfer;
/* Re-read register stack area. */
xxfer = super_xfer_partial (ops, object, annex,
Index: gdb-7.1.90.20100711/gdb/remote.c
===================================================================
--- gdb-7.1.90.20100711.orig/gdb/remote.c 2010-07-07 18:15:16.000000000 +0200
+++ gdb-7.1.90.20100711/gdb/remote.c 2010-07-12 10:46:24.000000000 +0200
@@ -25,6 +25,7 @@
#include "gdb_string.h"
#include <ctype.h>
#include <fcntl.h>
+#include <limits.h>
#include "inferior.h"
#include "bfd.h"
#include "symfile.h"
@@ -6515,12 +6516,19 @@ handle_notification (char *buf, size_t l
if SHOULD_WRITE is nonzero. Returns length of data written or
read; 0 for error. TARGET is unused. */
-static int
-remote_xfer_memory (CORE_ADDR mem_addr, gdb_byte *buffer, int mem_len,
+static LONGEST
+remote_xfer_memory (CORE_ADDR mem_addr, gdb_byte *buffer, LONGEST mem_len,
int should_write, struct mem_attrib *attrib,
struct target_ops *target)
{
int res;
+ int len;
+
+ /* This routine is not set up to handle > INT_MAX bytes. */
+ if (mem_len >= (LONGEST)INT_MAX)
+ return 0;
+
+ len = (int)mem_len;
set_general_thread (inferior_ptid);
@@ -6529,7 +6537,7 @@ remote_xfer_memory (CORE_ADDR mem_addr,
else
res = remote_read_bytes (mem_addr, buffer, mem_len);
- return res;
+ return (LONGEST)res;
}
/* Sends a packet with content determined by the printf format string
Index: gdb-7.1.90.20100711/gdb/remote-sim.c
===================================================================
--- gdb-7.1.90.20100711.orig/gdb/remote-sim.c 2010-05-16 23:11:14.000000000 +0200
+++ gdb-7.1.90.20100711/gdb/remote-sim.c 2010-07-12 10:46:24.000000000 +0200
@@ -759,11 +759,14 @@ gdbsim_prepare_to_store (struct regcache
Returns the number of bytes transferred. */
-static int
-gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
+static LONGEST
+gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, gdb_byte *myaddr, LONGEST len,
int write, struct mem_attrib *attrib,
struct target_ops *target)
{
+ /* Convert to len type that sim_read and sim_write can handle. */
+ int xfer_len = (int)len;
+
/* If no program is running yet, then ignore the simulator for
memory. Pass the request down to the next target, hopefully
an exec file. */
Index: gdb-7.1.90.20100711/gdb/exec.h
===================================================================
--- gdb-7.1.90.20100711.orig/gdb/exec.h 2010-01-01 08:31:31.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/exec.h 2010-07-12 10:46:24.000000000 +0200
@@ -60,7 +60,7 @@ extern int resize_section_table (struct
One, and only one, of readbuf or writebuf must be non-NULL. */
-extern int section_table_xfer_memory_partial (gdb_byte *, const gdb_byte *,
+extern LONGEST section_table_xfer_memory_partial (gdb_byte *, const gdb_byte *,
ULONGEST, LONGEST,
struct target_section *,
struct target_section *,

View File

@ -6,10 +6,10 @@
use to skip over first half of a GNU/Linux syscall and update use to skip over first half of a GNU/Linux syscall and update
"func_start". "func_start".
Index: gdb-6.8.50.20090802/gdb/rs6000-tdep.c Index: gdb-7.2.50.20110117/gdb/rs6000-tdep.c
=================================================================== ===================================================================
--- gdb-6.8.50.20090802.orig/gdb/rs6000-tdep.c 2009-07-31 17:23:20.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/rs6000-tdep.c 2011-01-11 20:23:02.000000000 +0100
+++ gdb-6.8.50.20090802/gdb/rs6000-tdep.c 2009-08-03 09:52:39.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/rs6000-tdep.c 2011-01-17 15:48:19.000000000 +0100
@@ -126,6 +126,7 @@ static const char *powerpc_vector_abi_st @@ -126,6 +126,7 @@ static const char *powerpc_vector_abi_st
struct rs6000_framedata struct rs6000_framedata
@ -18,7 +18,7 @@ Index: gdb-6.8.50.20090802/gdb/rs6000-tdep.c
int offset; /* total size of frame --- the distance int offset; /* total size of frame --- the distance
by which we decrement sp to allocate by which we decrement sp to allocate
the frame */ the frame */
@@ -1488,7 +1489,6 @@ static CORE_ADDR @@ -1496,7 +1497,6 @@ static CORE_ADDR
skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
struct rs6000_framedata *fdata) struct rs6000_framedata *fdata)
{ {
@ -26,7 +26,7 @@ Index: gdb-6.8.50.20090802/gdb/rs6000-tdep.c
CORE_ADDR last_prologue_pc = pc; CORE_ADDR last_prologue_pc = pc;
CORE_ADDR li_found_pc = 0; CORE_ADDR li_found_pc = 0;
gdb_byte buf[4]; gdb_byte buf[4];
@@ -1506,12 +1506,14 @@ skip_prologue (struct gdbarch *gdbarch, @@ -1514,12 +1514,14 @@ skip_prologue (struct gdbarch *gdbarch,
int minimal_toc_loaded = 0; int minimal_toc_loaded = 0;
int prev_insn_was_prologue_insn = 1; int prev_insn_was_prologue_insn = 1;
int num_skip_non_prologue_insns = 0; int num_skip_non_prologue_insns = 0;
@ -41,7 +41,7 @@ Index: gdb-6.8.50.20090802/gdb/rs6000-tdep.c
fdata->saved_gpr = -1; fdata->saved_gpr = -1;
fdata->saved_fpr = -1; fdata->saved_fpr = -1;
fdata->saved_vr = -1; fdata->saved_vr = -1;
@@ -1545,6 +1547,55 @@ skip_prologue (struct gdbarch *gdbarch, @@ -1553,6 +1555,55 @@ skip_prologue (struct gdbarch *gdbarch,
break; break;
op = extract_unsigned_integer (buf, 4, byte_order); op = extract_unsigned_integer (buf, 4, byte_order);
@ -97,7 +97,7 @@ Index: gdb-6.8.50.20090802/gdb/rs6000-tdep.c
if ((op & 0xfc1fffff) == 0x7c0802a6) if ((op & 0xfc1fffff) == 0x7c0802a6)
{ /* mflr Rx */ { /* mflr Rx */
/* Since shared library / PIC code, which needs to get its /* Since shared library / PIC code, which needs to get its
@@ -1726,9 +1777,9 @@ skip_prologue (struct gdbarch *gdbarch, @@ -1734,9 +1785,9 @@ skip_prologue (struct gdbarch *gdbarch,
we have no line table information or the line info tells we have no line table information or the line info tells
us that the subroutine call is not part of the line us that the subroutine call is not part of the line
associated with the prologue. */ associated with the prologue. */
@ -108,4 +108,4 @@ Index: gdb-6.8.50.20090802/gdb/rs6000-tdep.c
+ struct symtab_and_line prologue_sal = find_pc_line (fdata->func_start, 0); + struct symtab_and_line prologue_sal = find_pc_line (fdata->func_start, 0);
struct symtab_and_line this_sal = find_pc_line (pc, 0); struct symtab_and_line this_sal = find_pc_line (pc, 0);
if ((prologue_sal.line == 0) || (prologue_sal.line != this_sal.line)) if ((prologue_sal.line == 0)

View File

@ -11,11 +11,11 @@
* gdb.texinfo (File Options): Document --readnever. * gdb.texinfo (File Options): Document --readnever.
Index: gdb-7.1.90.20100721/gdb/doc/gdb.texinfo Index: gdb-7.2.50.20110117/gdb/doc/gdb.texinfo
=================================================================== ===================================================================
--- gdb-7.1.90.20100721.orig/gdb/doc/gdb.texinfo 2010-07-23 20:58:52.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/doc/gdb.texinfo 2011-01-17 15:47:37.000000000 +0100
+++ gdb-7.1.90.20100721/gdb/doc/gdb.texinfo 2010-07-23 20:59:15.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/doc/gdb.texinfo 2011-01-17 15:50:41.000000000 +0100
@@ -998,6 +998,12 @@ Read each symbol file's entire symbol ta @@ -1007,6 +1007,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,11 +28,11 @@ Index: gdb-7.1.90.20100721/gdb/doc/gdb.texinfo
@end table @end table
@node Mode Options @node Mode Options
Index: gdb-7.1.90.20100721/gdb/main.c Index: gdb-7.2.50.20110117/gdb/main.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100721.orig/gdb/main.c 2010-07-23 20:58:55.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/main.c 2011-01-17 15:50:21.000000000 +0100
+++ gdb-7.1.90.20100721/gdb/main.c 2010-07-23 20:59:15.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/main.c 2011-01-17 15:50:41.000000000 +0100
@@ -391,6 +391,7 @@ captured_main (void *data) @@ -395,6 +395,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},
{"readnow", no_argument, &readnow_symbol_files, 1}, {"readnow", no_argument, &readnow_symbol_files, 1},
@ -40,7 +40,7 @@ Index: gdb-7.1.90.20100721/gdb/main.c
{"r", no_argument, &readnow_symbol_files, 1}, {"r", no_argument, &readnow_symbol_files, 1},
{"quiet", no_argument, &quiet, 1}, {"quiet", no_argument, &quiet, 1},
{"q", no_argument, &quiet, 1}, {"q", no_argument, &quiet, 1},
@@ -1038,6 +1039,7 @@ Options:\n\n\ @@ -1061,6 +1062,7 @@ Options:\n\n\
fputs_unfiltered (_("\ fputs_unfiltered (_("\
--quiet Do not print version number on startup.\n\ --quiet Do not print version number on startup.\n\
--readnow Fully read symbol files on first access.\n\ --readnow Fully read symbol files on first access.\n\
@ -48,31 +48,31 @@ Index: gdb-7.1.90.20100721/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.1.90.20100721/gdb/symfile.c Index: gdb-7.2.50.20110117/gdb/symfile.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100721.orig/gdb/symfile.c 2010-07-23 20:58:52.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/symfile.c 2011-01-11 22:53:24.000000000 +0100
+++ gdb-7.1.90.20100721/gdb/symfile.c 2010-07-23 20:59:15.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/symfile.c 2011-01-17 15:50:53.000000000 +0100
@@ -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. */
+int readnever_symbol_files; /* Never read full symbols. */ +int readnever_symbol_files; /* Never read full symbols. */
/* External variables and functions referenced. */ /* External variables and functions referenced. */
Index: gdb-7.1.90.20100721/gdb/dwarf2read.c Index: gdb-7.2.50.20110117/gdb/dwarf2read.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100721.orig/gdb/dwarf2read.c 2010-07-23 20:58:53.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/dwarf2read.c 2011-01-17 15:47:37.000000000 +0100
+++ gdb-7.1.90.20100721/gdb/dwarf2read.c 2010-07-23 20:59:26.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/dwarf2read.c 2011-01-17 15:50:41.000000000 +0100
@@ -54,6 +54,7 @@ @@ -57,6 +57,7 @@
#include "exceptions.h" #include "vec.h"
#include "gdb_stat.h" #include "c-lang.h"
#include "completer.h" #include "valprint.h"
+#include "top.h" +#include "top.h"
#include <fcntl.h> #include <fcntl.h>
#include "gdb_string.h" #include "gdb_string.h"
@@ -1283,8 +1284,9 @@ dwarf2_has_info (struct objfile *objfile @@ -1350,8 +1351,9 @@ dwarf2_has_info (struct objfile *objfile
bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL); bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL);
dwarf2_per_objfile->objfile = objfile; dwarf2_per_objfile->objfile = objfile;
} }
@ -84,15 +84,15 @@ Index: gdb-7.1.90.20100721/gdb/dwarf2read.c
} }
/* When loading sections, we can either look for ".<name>", or for /* When loading sections, we can either look for ".<name>", or for
Index: gdb-7.1.90.20100721/gdb/top.h Index: gdb-7.2.50.20110117/gdb/top.h
=================================================================== ===================================================================
--- gdb-7.1.90.20100721.orig/gdb/top.h 2010-04-07 18:54:39.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/top.h 2011-01-01 16:33:18.000000000 +0100
+++ gdb-7.1.90.20100721/gdb/top.h 2010-07-23 20:59:15.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/top.h 2011-01-17 15:50:41.000000000 +0100
@@ -61,6 +61,7 @@ extern void set_prompt (char *); @@ -61,6 +61,7 @@ extern void set_prompt (char *);
/* From random places. */ /* From random places. */
extern int readnow_symbol_files; extern int readnow_symbol_files;
+extern int readnever_symbol_files; +extern int readnever_symbol_files;
/* Perform _initialize initialization */ /* Perform _initialize initialization. */
extern void gdb_init (char *); extern void gdb_init (char *);

View File

@ -19,10 +19,10 @@ Proposed upstream but never committed upstream.
(source_command): Update documentation. Check permissions if (source_command): Update documentation. Check permissions if
FROM_TTY is -1. FROM_TTY is -1.
Index: gdb-7.1.90.20100720/gdb/cli/cli-cmds.c Index: gdb-7.2.50.20101231/gdb/cli/cli-cmds.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100720.orig/gdb/cli/cli-cmds.c 2010-05-17 21:28:12.000000000 +0200 --- gdb-7.2.50.20101231.orig/gdb/cli/cli-cmds.c 2010-12-29 03:11:04.000000000 +0100
+++ gdb-7.1.90.20100720/gdb/cli/cli-cmds.c 2010-07-21 20:30:30.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/cli/cli-cmds.c 2011-01-01 00:53:51.000000000 +0100
@@ -39,6 +39,7 @@ @@ -39,6 +39,7 @@
#include "source.h" #include "source.h"
#include "disasm.h" #include "disasm.h"
@ -31,7 +31,7 @@ Index: gdb-7.1.90.20100720/gdb/cli/cli-cmds.c
#include "ui-out.h" #include "ui-out.h"
@@ -487,7 +488,7 @@ Script filename extension recognition is @@ -488,7 +489,7 @@ Script filename extension recognition is
int int
find_and_open_script (const char *script_file, int search_path, find_and_open_script (const char *script_file, int search_path,
@ -40,7 +40,7 @@ Index: gdb-7.1.90.20100720/gdb/cli/cli-cmds.c
{ {
char *file; char *file;
int fd; int fd;
@@ -513,6 +514,32 @@ find_and_open_script (const char *script @@ -514,6 +515,32 @@ find_and_open_script (const char *script
return 0; return 0;
} }
@ -73,7 +73,7 @@ Index: gdb-7.1.90.20100720/gdb/cli/cli-cmds.c
do_cleanups (old_cleanups); do_cleanups (old_cleanups);
*streamp = fdopen (fd, FOPEN_RT); *streamp = fdopen (fd, FOPEN_RT);
@@ -572,13 +599,14 @@ source_script_with_search (const char *f @@ -573,13 +600,14 @@ source_script_with_search (const char *f
if (file == NULL || *file == 0) if (file == NULL || *file == 0)
error (_("source command requires file name of file to source.")); error (_("source command requires file name of file to source."));
@ -82,18 +82,18 @@ Index: gdb-7.1.90.20100720/gdb/cli/cli-cmds.c
+ from_tty)) + from_tty))
{ {
/* The script wasn't found, or was otherwise inaccessible. /* The script wasn't found, or was otherwise inaccessible.
If the source command was invoked interactively, throw an error. If the source command was invoked interactively, throw an
Otherwise (e.g. if it was invoked by a script), silently ignore error. Otherwise (e.g. if it was invoked by a script),
the error. */ silently ignore the error. */
- if (from_tty) - if (from_tty)
+ if (from_tty > 0) + if (from_tty > 0)
perror_with_name (file); perror_with_name (file);
else else
return; return;
Index: gdb-7.1.90.20100720/gdb/testsuite/gdb.base/gdbinit.exp Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.base/gdbinit.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.1.90.20100720/gdb/testsuite/gdb.base/gdbinit.exp 2010-07-20 22:25:40.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/testsuite/gdb.base/gdbinit.exp 2011-01-01 00:53:09.000000000 +0100
@@ -0,0 +1,91 @@ @@ -0,0 +1,91 @@
+# Copyright 2005 +# Copyright 2005
+# Free Software Foundation, Inc. +# Free Software Foundation, Inc.
@ -186,17 +186,17 @@ Index: gdb-7.1.90.20100720/gdb/testsuite/gdb.base/gdbinit.exp
+} +}
+ +
+remote_exec build "rm .gdbinit" +remote_exec build "rm .gdbinit"
Index: gdb-7.1.90.20100720/gdb/testsuite/gdb.base/gdbinit.sample Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.base/gdbinit.sample
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.1.90.20100720/gdb/testsuite/gdb.base/gdbinit.sample 2010-07-20 22:25:40.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/testsuite/gdb.base/gdbinit.sample 2011-01-01 00:53:09.000000000 +0100
@@ -0,0 +1 @@ @@ -0,0 +1 @@
+echo "\nin gdbinit" +echo "\nin gdbinit"
Index: gdb-7.1.90.20100720/gdb/main.c Index: gdb-7.2.50.20101231/gdb/main.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100720.orig/gdb/main.c 2010-06-26 08:44:47.000000000 +0200 --- gdb-7.2.50.20101231.orig/gdb/main.c 2010-12-29 01:58:14.000000000 +0100
+++ gdb-7.1.90.20100720/gdb/main.c 2010-07-21 20:09:03.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/main.c 2011-01-01 00:53:09.000000000 +0100
@@ -794,7 +794,7 @@ Excess command line arguments ignored. ( @@ -805,7 +805,7 @@ Excess command line arguments ignored. (
debugging or what directory you are in. */ debugging or what directory you are in. */
if (home_gdbinit && !inhibit_gdbinit) if (home_gdbinit && !inhibit_gdbinit)
@ -205,7 +205,7 @@ Index: gdb-7.1.90.20100720/gdb/main.c
/* Now perform all the actions indicated by the arguments. */ /* Now perform all the actions indicated by the arguments. */
if (cdarg != NULL) if (cdarg != NULL)
@@ -868,7 +868,7 @@ Can't attach to process and specify a co @@ -880,7 +880,7 @@ Can't attach to process and specify a co
/* Read the .gdbinit file in the current directory, *if* it isn't /* Read the .gdbinit file in the current directory, *if* it isn't
the same as the $HOME/.gdbinit file (it should exist, also). */ the same as the $HOME/.gdbinit file (it should exist, also). */
if (local_gdbinit && !inhibit_gdbinit) if (local_gdbinit && !inhibit_gdbinit)
@ -214,11 +214,11 @@ Index: gdb-7.1.90.20100720/gdb/main.c
/* Now that all .gdbinit's have been read and all -d options have been /* Now that all .gdbinit's have been read and all -d options have been
processed, we can read any scripts mentioned in SYMARG. processed, we can read any scripts mentioned in SYMARG.
Index: gdb-7.1.90.20100720/gdb/python/py-auto-load.c Index: gdb-7.2.50.20101231/gdb/python/py-auto-load.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100720.orig/gdb/python/py-auto-load.c 2010-05-17 23:23:25.000000000 +0200 --- gdb-7.2.50.20101231.orig/gdb/python/py-auto-load.c 2010-12-15 18:27:59.000000000 +0100
+++ gdb-7.1.90.20100720/gdb/python/py-auto-load.c 2010-07-20 22:25:40.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/python/py-auto-load.c 2011-01-01 00:53:09.000000000 +0100
@@ -219,7 +219,7 @@ source_section_scripts (struct objfile * @@ -224,7 +224,7 @@ source_section_scripts (struct objfile *
} }
opened = find_and_open_script (file, 1 /*search_path*/, opened = find_and_open_script (file, 1 /*search_path*/,
@ -227,10 +227,10 @@ Index: gdb-7.1.90.20100720/gdb/python/py-auto-load.c
/* If the file is not found, we still record the file in the hash table, /* If the file is not found, we still record the file in the hash table,
we only want to print an error message once. we only want to print an error message once.
Index: gdb-7.1.90.20100720/gdb/cli/cli-cmds.h Index: gdb-7.2.50.20101231/gdb/cli/cli-cmds.h
=================================================================== ===================================================================
--- gdb-7.1.90.20100720.orig/gdb/cli/cli-cmds.h 2010-05-03 01:52:14.000000000 +0200 --- gdb-7.2.50.20101231.orig/gdb/cli/cli-cmds.h 2010-12-29 03:11:04.000000000 +0100
+++ gdb-7.1.90.20100720/gdb/cli/cli-cmds.h 2010-07-20 22:25:40.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/cli/cli-cmds.h 2011-01-01 00:53:09.000000000 +0100
@@ -126,7 +126,8 @@ extern void source_script (char *, int); @@ -126,7 +126,8 @@ extern void source_script (char *, int);
/* Exported to objfiles.c. */ /* Exported to objfiles.c. */

View File

@ -1,28 +0,0 @@
2005-02-14 Jeff Johnston <jjohnstn@redhat.com>
* top.c (gdb_readline_wrapper): Ensure terminal is gdb's before calling
readline.
2007-10-14 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-6.7/gdb/top.c
===================================================================
--- gdb-6.7.orig/gdb/top.c 2007-09-02 23:13:56.000000000 +0200
+++ gdb-6.7/gdb/top.c 2007-10-14 23:38:27.000000000 +0200
@@ -795,6 +795,14 @@ gdb_readline_wrapper (char *prompt)
back_to = make_cleanup (gdb_readline_wrapper_cleanup, cleanup);
+ /* Before calling readline, ensure we have the terminal. If we don't
+ have the terminal and call readline, we risk the possibility of
+ gdb being thrown into the background. This problem occurs when
+ we attach to a background process on the same terminal the background
+ process was started from and then perform some action which requires
+ a page break prompt. */
+ terminal_ours ();
+
/* Display our prompt and prevent double prompt display. */
display_gdb_prompt (prompt);
rl_already_prompted = 1;

View File

@ -1,40 +1,40 @@
Index: gdb-7.0.90.20100306/gdb/testsuite/configure.ac Index: gdb-7.2.50.20110117/gdb/testsuite/configure.ac
=================================================================== ===================================================================
--- gdb-7.0.90.20100306.orig/gdb/testsuite/configure.ac 2010-02-19 20:16:36.000000000 +0100 --- gdb-7.2.50.20110117.orig/gdb/testsuite/configure.ac 2011-01-05 06:09:55.000000000 +0100
+++ gdb-7.0.90.20100306/gdb/testsuite/configure.ac 2010-03-06 23:19:56.000000000 +0100 +++ gdb-7.2.50.20110117/gdb/testsuite/configure.ac 2011-01-17 15:50:03.000000000 +0100
@@ -144,6 +144,6 @@ AC_OUTPUT([Makefile \ @@ -144,6 +144,6 @@ AC_OUTPUT([Makefile \
gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \ gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \
gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile \ gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile \
gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile \ gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile \
- gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile \ - gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile \
+ gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \ + gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \
gdb.python/Makefile gdb.reverse/Makefile \ gdb.python/Makefile gdb.reverse/Makefile \
gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile]) gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile])
Index: gdb-7.0.90.20100306/gdb/testsuite/configure Index: gdb-7.2.50.20110117/gdb/testsuite/configure
=================================================================== ===================================================================
--- gdb-7.0.90.20100306.orig/gdb/testsuite/configure 2010-02-19 20:16:36.000000000 +0100 --- gdb-7.2.50.20110117.orig/gdb/testsuite/configure 2011-01-07 03:51:09.000000000 +0100
+++ gdb-7.0.90.20100306/gdb/testsuite/configure 2010-03-06 23:20:12.000000000 +0100 +++ gdb-7.2.50.20110117/gdb/testsuite/configure 2011-01-17 15:50:09.000000000 +0100
@@ -3515,7 +3515,7 @@ done @@ -3515,7 +3515,7 @@ done
-ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" -ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
+ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" +ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
cat >confcache <<\_ACEOF cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure # This file is a shell script that caches the results of configure
@@ -4232,6 +4232,7 @@ do @@ -4233,6 +4233,7 @@ do
"gdb.objc/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.objc/Makefile" ;; "gdb.opencl/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opencl/Makefile" ;;
"gdb.opt/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;; "gdb.opt/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;;
"gdb.pascal/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;; "gdb.pascal/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;;
+ "gdb.pie/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pie/Makefile" ;; + "gdb.pie/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pie/Makefile" ;;
"gdb.python/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;; "gdb.python/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;;
"gdb.reverse/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.reverse/Makefile" ;; "gdb.reverse/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.reverse/Makefile" ;;
"gdb.threads/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;; "gdb.threads/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;;
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.c Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.c 2010-03-06 23:19:31.000000000 +0100 +++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach.c 2011-01-17 15:50:03.000000000 +0100
@@ -0,0 +1,20 @@ @@ -0,0 +1,20 @@
+/* This program is intended to be started outside of gdb, and then +/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop + attached to by gdb. Thus, it simply spins in a loop. The loop
@ -56,10 +56,10 @@ Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.c
+ } + }
+ return 0; + return 0;
+} +}
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach2.c Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach2.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach2.c 2010-03-06 23:19:31.000000000 +0100 +++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach2.c 2011-01-17 15:50:03.000000000 +0100
@@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
+/* This program is intended to be started outside of gdb, and then +/* This program is intended to be started outside of gdb, and then
+ attached to by gdb. Thus, it simply spins in a loop. The loop + attached to by gdb. Thus, it simply spins in a loop. The loop
@ -85,10 +85,10 @@ Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach2.c
+ } + }
+ return (0); + return (0);
+} +}
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.c Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.c 2010-03-06 23:19:31.000000000 +0100 +++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break.c 2011-01-17 15:50:03.000000000 +0100
@@ -0,0 +1,146 @@ @@ -0,0 +1,146 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -236,10 +236,10 @@ Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.c
+ } + }
+ return 0; + return 0;
+} +}
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break1.c Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break1.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break1.c 2010-03-06 23:19:31.000000000 +0100 +++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break1.c 2011-01-17 15:50:03.000000000 +0100
@@ -0,0 +1,44 @@ @@ -0,0 +1,44 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -285,10 +285,10 @@ Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break1.c
+void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */ +void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */
+void marker4 (d) long d; {} /* set breakpoint 13 here */ +void marker4 (d) long d; {} /* set breakpoint 13 here */
+#endif +#endif
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/coremaker.c Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/coremaker.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/coremaker.c 2010-03-06 23:19:31.000000000 +0100 +++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/coremaker.c 2011-01-17 15:50:03.000000000 +0100
@@ -0,0 +1,142 @@ @@ -0,0 +1,142 @@
+/* Copyright 1992, 1993, 1994, 1995, 1996, 1999 +/* Copyright 1992, 1993, 1994, 1995, 1996, 1999
+ Free Software Foundation, Inc. + Free Software Foundation, Inc.
@ -432,10 +432,10 @@ Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/coremaker.c
+ return 0; + return 0;
+} +}
+ +
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.exp Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.exp 2010-03-06 23:19:31.000000000 +0100 +++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/attach.exp 2011-01-17 15:50:03.000000000 +0100
@@ -0,0 +1,423 @@ @@ -0,0 +1,423 @@
+# Copyright 1997, 1999, 2002 Free Software Foundation, Inc. +# Copyright 1997, 1999, 2002 Free Software Foundation, Inc.
+ +
@ -860,10 +860,10 @@ Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.exp
+do_call_attach_tests +do_call_attach_tests
+ +
+return 0 +return 0
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.exp Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.exp 2010-03-06 23:19:31.000000000 +0100 +++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/break.exp 2011-01-17 15:50:03.000000000 +0100
@@ -0,0 +1,966 @@ @@ -0,0 +1,966 @@
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, +# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2002, 2003, 2004 +# 2000, 2002, 2003, 2004
@ -1831,10 +1831,10 @@ Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.exp
+ send_gdb "set args main\n" + send_gdb "set args main\n"
+ gdb_expect -re ".*$gdb_prompt $" {} + gdb_expect -re ".*$gdb_prompt $" {}
+} +}
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/corefile.exp Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/corefile.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/corefile.exp 2010-03-06 23:19:31.000000000 +0100 +++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/corefile.exp 2011-01-17 15:50:03.000000000 +0100
@@ -0,0 +1,233 @@ @@ -0,0 +1,233 @@
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc. +# Free Software Foundation, Inc.
@ -2069,10 +2069,10 @@ Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/corefile.exp
+gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp (reinit)" +gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp (reinit)"
+ +
+gdb_test "core" "No core file now." +gdb_test "core" "No core file now."
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/Makefile.in Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/Makefile.in
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/Makefile.in 2010-03-06 23:19:31.000000000 +0100 +++ gdb-7.2.50.20110117/gdb/testsuite/gdb.pie/Makefile.in 2011-01-17 15:50:03.000000000 +0100
@@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
+VPATH = @srcdir@ +VPATH = @srcdir@
+srcdir = @srcdir@ +srcdir = @srcdir@

View File

@ -30,11 +30,11 @@ glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug:
<81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location <81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location
<81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location <81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location
Index: gdb-7.0.50.20100128/gdb/gdbtypes.c Index: gdb-7.2.50.20101116/gdb/gdbtypes.c
=================================================================== ===================================================================
--- gdb-7.0.50.20100128.orig/gdb/gdbtypes.c 2010-01-28 12:52:17.000000000 +0100 --- gdb-7.2.50.20101116.orig/gdb/gdbtypes.c 2010-11-16 07:53:59.000000000 +0100
+++ gdb-7.0.50.20100128/gdb/gdbtypes.c 2010-01-28 12:52:48.000000000 +0100 +++ gdb-7.2.50.20101116/gdb/gdbtypes.c 2010-11-16 08:01:33.000000000 +0100
@@ -3978,6 +3978,9 @@ gdbtypes_post_init (struct gdbarch *gdba @@ -4262,6 +4262,9 @@ gdbtypes_post_init (struct gdbarch *gdba
= arch_type (gdbarch, TYPE_CODE_INTERNAL_FUNCTION, 0, = arch_type (gdbarch, TYPE_CODE_INTERNAL_FUNCTION, 0,
"<internal function>"); "<internal function>");
@ -44,11 +44,11 @@ Index: gdb-7.0.50.20100128/gdb/gdbtypes.c
return builtin_type; return builtin_type;
} }
Index: gdb-7.0.50.20100128/gdb/gdbtypes.h Index: gdb-7.2.50.20101116/gdb/gdbtypes.h
=================================================================== ===================================================================
--- gdb-7.0.50.20100128.orig/gdb/gdbtypes.h 2010-01-28 12:52:17.000000000 +0100 --- gdb-7.2.50.20101116.orig/gdb/gdbtypes.h 2010-11-16 07:53:59.000000000 +0100
+++ gdb-7.0.50.20100128/gdb/gdbtypes.h 2010-01-28 12:52:48.000000000 +0100 +++ gdb-7.2.50.20101116/gdb/gdbtypes.h 2010-11-16 08:01:33.000000000 +0100
@@ -1245,6 +1245,8 @@ struct builtin_type @@ -1294,6 +1294,8 @@ struct builtin_type
/* This type is used to represent a GDB internal function. */ /* This type is used to represent a GDB internal function. */
struct type *internal_fn; struct type *internal_fn;
@ -57,11 +57,11 @@ Index: gdb-7.0.50.20100128/gdb/gdbtypes.h
}; };
/* Return the type table for the specified architecture. */ /* Return the type table for the specified architecture. */
Index: gdb-7.0.50.20100128/gdb/parse.c Index: gdb-7.2.50.20101116/gdb/parse.c
=================================================================== ===================================================================
--- gdb-7.0.50.20100128.orig/gdb/parse.c 2010-01-28 12:52:19.000000000 +0100 --- gdb-7.2.50.20101116.orig/gdb/parse.c 2010-11-16 07:53:59.000000000 +0100
+++ gdb-7.0.50.20100128/gdb/parse.c 2010-01-28 12:53:20.000000000 +0100 +++ gdb-7.2.50.20101116/gdb/parse.c 2010-11-16 08:01:33.000000000 +0100
@@ -509,7 +509,11 @@ write_exp_msymbol (struct minimal_symbol @@ -530,7 +530,11 @@ write_exp_msymbol (struct minimal_symbol
case mst_text: case mst_text:
case mst_file_text: case mst_file_text:
case mst_solib_trampoline: case mst_solib_trampoline:
@ -74,12 +74,12 @@ Index: gdb-7.0.50.20100128/gdb/parse.c
break; break;
case mst_text_gnu_ifunc: case mst_text_gnu_ifunc:
Index: gdb-7.0.50.20100128/gdb/target.c Index: gdb-7.2.50.20101116/gdb/target.c
=================================================================== ===================================================================
--- gdb-7.0.50.20100128.orig/gdb/target.c 2010-01-28 12:52:29.000000000 +0100 --- gdb-7.2.50.20101116.orig/gdb/target.c 2010-11-16 08:00:37.000000000 +0100
+++ gdb-7.0.50.20100128/gdb/target.c 2010-01-28 12:52:48.000000000 +0100 +++ gdb-7.2.50.20101116/gdb/target.c 2010-11-16 08:01:52.000000000 +0100
@@ -1000,6 +1000,25 @@ pop_all_targets (int quitting) @@ -1067,6 +1067,25 @@ target_is_pushed (struct target_ops *t)
pop_all_targets_above (dummy_stratum, quitting); return 0;
} }
+static int +static int
@ -104,7 +104,7 @@ Index: gdb-7.0.50.20100128/gdb/target.c
/* Using the objfile specified in OBJFILE, find the address for the /* Using the objfile specified in OBJFILE, find the address for the
current thread's thread-local storage with offset OFFSET. */ current thread's thread-local storage with offset OFFSET. */
CORE_ADDR CORE_ADDR
@@ -1090,7 +1109,28 @@ target_translate_tls_address (struct obj @@ -1157,7 +1176,28 @@ target_translate_tls_address (struct obj
/* It wouldn't be wrong here to try a gdbarch method, too; finding /* It wouldn't be wrong here to try a gdbarch method, too; finding
TLS is an ABI-specific thing. But we don't do that yet. */ TLS is an ABI-specific thing. But we don't do that yet. */
else else
@ -134,10 +134,10 @@ Index: gdb-7.0.50.20100128/gdb/target.c
return addr; return addr;
} }
Index: gdb-7.0.50.20100128/gdb/testsuite/gdb.dwarf2/dw2-errno.c Index: gdb-7.2.50.20101116/gdb/testsuite/gdb.dwarf2/dw2-errno.c
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.50.20100128/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2010-01-28 12:52:48.000000000 +0100 +++ gdb-7.2.50.20101116/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2010-11-16 08:01:33.000000000 +0100
@@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger. +/* This testcase is part of GDB, the GNU debugger.
+ +
@ -167,10 +167,10 @@ Index: gdb-7.0.50.20100128/gdb/testsuite/gdb.dwarf2/dw2-errno.c
+ +
+ return 0; /* breakpoint */ + return 0; /* breakpoint */
+} +}
Index: gdb-7.0.50.20100128/gdb/testsuite/gdb.dwarf2/dw2-errno.exp Index: gdb-7.2.50.20101116/gdb/testsuite/gdb.dwarf2/dw2-errno.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.50.20100128/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2010-01-28 12:52:48.000000000 +0100 +++ gdb-7.2.50.20101116/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2010-11-16 08:01:33.000000000 +0100
@@ -0,0 +1,60 @@ @@ -0,0 +1,60 @@
+# Copyright 2007 Free Software Foundation, Inc. +# Copyright 2007 Free Software Foundation, Inc.
+ +

View File

@ -1,13 +1,13 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379 https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
Index: gdb-6.8.50.20090803/gdb/symtab.c Index: gdb-7.2.50.20110117/gdb/symtab.c
=================================================================== ===================================================================
--- gdb-6.8.50.20090803.orig/gdb/symtab.c 2009-08-03 16:09:36.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/symtab.c 2011-01-17 15:47:37.000000000 +0100
+++ gdb-6.8.50.20090803/gdb/symtab.c 2009-08-03 16:13:13.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/symtab.c 2011-01-17 15:51:48.000000000 +0100
@@ -2261,6 +2261,13 @@ find_pc_sect_line (CORE_ADDR pc, struct @@ -2015,6 +2015,13 @@ find_pc_sect_line (CORE_ADDR pc, struct
/* See above comment about why warning is commented out */ SYMBOL_LINKAGE_NAME (msymbol)); */
/* warning ("In stub for %s; unable to find real function/line info", SYMBOL_LINKAGE_NAME (msymbol)) */ ; ;
/* fall through */ /* fall through */
+ /* `msymbol' trampoline may be located before its .text symbol + /* `msymbol' trampoline may be located before its .text symbol
+ but this text symbol may be the address we were looking for. + but this text symbol may be the address we were looking for.

View File

@ -1,52 +0,0 @@
for gdb/ChangeLog:
2006-08-22 Will Drewry <wad@google.com>
Tavis Ormandy <taviso@google.com>
* dwarf2read.c (decode_locdesc): Enforce location description stack
boundaries.
* dwarfread.c (locval): Likewise.
2007-10-15 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-7.1.90.20100711/gdb/dwarf2read.c
===================================================================
--- gdb-7.1.90.20100711.orig/gdb/dwarf2read.c 2010-07-12 10:43:53.000000000 +0200
+++ gdb-7.1.90.20100711/gdb/dwarf2read.c 2010-07-12 10:49:32.000000000 +0200
@@ -11382,8 +11382,7 @@ read_signatured_type (struct objfile *ob
callers will only want a very basic result and this can become a
complaint.
- Note that stack[0] is unused except as a default error return.
- Note that stack overflow is not yet handled. */
+ Note that stack[0] is unused except as a default error return. */
static CORE_ADDR
decode_locdesc (struct dwarf_block *blk, struct dwarf2_cu *cu)
@@ -11399,7 +11398,7 @@ decode_locdesc (struct dwarf_block *blk,
i = 0;
stacki = 0;
- stack[stacki] = 0;
+ stack[++stacki] = 0;
while (i < size)
{
@@ -11581,6 +11580,16 @@ decode_locdesc (struct dwarf_block *blk,
dwarf_stack_op_name (op, 1));
return (stack[stacki]);
}
+ /* Enforce maximum stack depth of size-1 to avoid ++stacki writing
+ outside of the allocated space. Also enforce minimum > 0.
+ -- wad@google.com 14 Aug 2006 */
+ if (stacki >= sizeof (stack) / sizeof (*stack) - 1)
+ internal_error (__FILE__, __LINE__,
+ _("location description stack too deep: %d"),
+ stacki);
+ if (stacki <= 0)
+ internal_error (__FILE__, __LINE__,
+ _("location description stack too shallow"));
}
return (stack[stacki]);
}

View File

@ -0,0 +1,31 @@
--- ./gdb/elfread.c 2010-10-14 17:07:45.000000000 +0200
+++ ./gdb/elfread.c 2010-10-14 17:06:30.000000000 +0200
@@ -1382,6 +1382,18 @@ build_id_to_filename (struct build_id *b
#include <dlfcn.h>
#endif
+/* Workarodun https://bugzilla.redhat.com/show_bug.cgi?id=643031
+ librpm must not exit() an application on SIGINT
+
+ Enable or disable a signal handler. SIGNUM: signal to enable (or disable
+ if negative). HANDLER: sa_sigaction handler (or NULL to use
+ rpmsqHandler()). Returns: no. of refs, -1 on error. */
+int
+rpmsqEnable (int signum, /* rpmsqAction_t handler */ void *handler)
+{
+ return 0;
+}
+
/* This MISSING_RPM_HASH tracker is used to collect all the missing rpm files
and avoid their duplicities during a single inferior run. */
--- ./gdb/proc-service.list 2010-05-28 20:50:30.000000000 +0200
+++ ./gdb/proc-service.list 2010-10-14 17:06:30.000000000 +0200
@@ -37,4 +37,7 @@
ps_pstop;
ps_ptread;
ps_ptwrite;
+
+ /* gdb-6.6-buildid-locate-rpm.patch */
+ rpmsqEnable;
};

View File

@ -1,25 +1,25 @@
Index: gdb-7.1.90.20100806/gdb/event-top.c Index: gdb-7.2.50.20101231/gdb/event-top.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100806.orig/gdb/event-top.c 2010-08-06 17:42:01.000000000 +0200 --- gdb-7.2.50.20101231.orig/gdb/event-top.c 2010-12-29 01:58:14.000000000 +0100
+++ gdb-7.1.90.20100806/gdb/event-top.c 2010-08-06 17:42:05.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/event-top.c 2011-01-01 01:07:37.000000000 +0100
@@ -33,6 +33,7 @@ @@ -33,6 +33,7 @@
#include "cli/cli-script.h" /* for reset_command_nest_depth */ #include "cli/cli-script.h" /* for reset_command_nest_depth */
#include "main.h" #include "main.h"
#include "gdbthread.h" #include "gdbthread.h"
+#include "symfile.h" +#include "symfile.h"
/* For dont_repeat() */ #include "gdbcmd.h" /* for dont_repeat() */
#include "gdbcmd.h"
@@ -193,6 +194,8 @@ cli_command_loop (void) @@ -192,6 +193,8 @@ cli_command_loop (void)
char *a_prompt; char *a_prompt;
char *gdb_prompt = get_prompt (); char *gdb_prompt = get_prompt ();
+ debug_flush_missing (); + debug_flush_missing ();
+ +
/* Tell readline what the prompt to display is and what function it /* Tell readline what the prompt to display is and what function
will need to call after a whole line is read. This also displays it will need to call after a whole line is read. This also
the first prompt. */ displays the first prompt. */
@@ -264,6 +267,8 @@ display_gdb_prompt (char *new_prompt) @@ -263,6 +266,8 @@ display_gdb_prompt (char *new_prompt)
/* Reset the nesting depth used when trace-commands is set. */ /* Reset the nesting depth used when trace-commands is set. */
reset_command_nest_depth (); reset_command_nest_depth ();
@ -28,10 +28,10 @@ Index: gdb-7.1.90.20100806/gdb/event-top.c
/* Each interpreter has its own rules on displaying the command /* Each interpreter has its own rules on displaying the command
prompt. */ prompt. */
if (!current_interp_display_prompt_p ()) if (!current_interp_display_prompt_p ())
Index: gdb-7.1.90.20100806/gdb/elfread.c Index: gdb-7.2.50.20101231/gdb/elfread.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100806.orig/gdb/elfread.c 2010-08-06 17:42:01.000000000 +0200 --- gdb-7.2.50.20101231.orig/gdb/elfread.c 2011-01-01 01:05:01.000000000 +0100
+++ gdb-7.1.90.20100806/gdb/elfread.c 2010-08-06 18:11:49.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/elfread.c 2011-01-01 01:05:10.000000000 +0100
@@ -42,6 +42,7 @@ @@ -42,6 +42,7 @@
#include "gdbcore.h" #include "gdbcore.h"
#include "gdbcmd.h" #include "gdbcmd.h"
@ -40,7 +40,7 @@ Index: gdb-7.1.90.20100806/gdb/elfread.c
extern void _initialize_elfread (void); extern void _initialize_elfread (void);
@@ -1371,8 +1372,357 @@ build_id_to_filename (struct build_id *b @@ -1371,8 +1372,361 @@ build_id_to_filename (struct build_id *b
return retval; return retval;
} }
@ -114,6 +114,10 @@ Index: gdb-7.1.90.20100806/gdb/elfread.c
+#endif /* !DLOPEN_LIBRPM */ +#endif /* !DLOPEN_LIBRPM */
+ +
+ gdb_assert (filename != NULL); + gdb_assert (filename != NULL);
+
+ if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0)
+ return 0;
+
+ if (filename[0] != '/') + if (filename[0] != '/')
+ { + {
+ warning (_("Ignoring non-absolute filename: <%s>"), filename); + warning (_("Ignoring non-absolute filename: <%s>"), filename);
@ -399,7 +403,7 @@ Index: gdb-7.1.90.20100806/gdb/elfread.c
avoidance. */ avoidance. */
struct missing_filepair struct missing_filepair
@@ -1426,11 +1776,17 @@ missing_filepair_change (void) @@ -1426,11 +1780,17 @@ missing_filepair_change (void)
/* All their memory came just from missing_filepair_OBSTACK. */ /* All their memory came just from missing_filepair_OBSTACK. */
missing_filepair_hash = NULL; missing_filepair_hash = NULL;
} }
@ -417,7 +421,7 @@ Index: gdb-7.1.90.20100806/gdb/elfread.c
missing_filepair_change (); missing_filepair_change ();
} }
@@ -1497,14 +1853,35 @@ debug_print_missing (const char *binary, @@ -1497,14 +1857,35 @@ debug_print_missing (const char *binary,
*slot = missing_filepair; *slot = missing_filepair;
@ -460,23 +464,24 @@ Index: gdb-7.1.90.20100806/gdb/elfread.c
} }
static char * static char *
Index: gdb-7.1.90.20100806/gdb/symfile.h Index: gdb-7.2.50.20101231/gdb/symfile.h
=================================================================== ===================================================================
--- gdb-7.1.90.20100806.orig/gdb/symfile.h 2010-08-06 17:42:01.000000000 +0200 --- gdb-7.2.50.20101231.orig/gdb/symfile.h 2011-01-01 01:05:01.000000000 +0100
+++ gdb-7.1.90.20100806/gdb/symfile.h 2010-08-06 17:42:05.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/symfile.h 2011-01-01 01:05:10.000000000 +0100
@@ -577,6 +577,7 @@ extern struct build_id *build_id_addr_ge @@ -559,6 +559,8 @@ extern struct build_id *build_id_addr_ge
extern char *build_id_to_filename (struct build_id *build_id, extern char *build_id_to_filename (struct build_id *build_id,
char **link_return, int add_debug_suffix); char **link_return, int add_debug_suffix);
extern void debug_print_missing (const char *binary, const char *debug); extern void debug_print_missing (const char *binary, const char *debug);
+extern void debug_flush_missing (void); +extern void debug_flush_missing (void);
+#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file")
/* From dwarf2read.c */ /* From dwarf2read.c */
Index: gdb-7.1.90.20100806/gdb/testsuite/lib/gdb.exp Index: gdb-7.2.50.20101231/gdb/testsuite/lib/gdb.exp
=================================================================== ===================================================================
--- gdb-7.1.90.20100806.orig/gdb/testsuite/lib/gdb.exp 2010-08-06 17:42:01.000000000 +0200 --- gdb-7.2.50.20101231.orig/gdb/testsuite/lib/gdb.exp 2011-01-01 01:05:01.000000000 +0100
+++ gdb-7.1.90.20100806/gdb/testsuite/lib/gdb.exp 2010-08-06 17:42:05.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/testsuite/lib/gdb.exp 2011-01-01 01:05:10.000000000 +0100
@@ -1359,7 +1359,7 @@ proc default_gdb_start { } { @@ -1389,7 +1389,7 @@ proc default_gdb_start { } {
warning "Couldn't set the width to 0." warning "Couldn't set the width to 0."
} }
} }
@ -485,10 +490,10 @@ Index: gdb-7.1.90.20100806/gdb/testsuite/lib/gdb.exp
send_gdb "set build-id-verbose 0\n" send_gdb "set build-id-verbose 0\n"
gdb_expect 10 { gdb_expect 10 {
-re "$gdb_prompt $" { -re "$gdb_prompt $" {
Index: gdb-7.1.90.20100806/gdb/testsuite/lib/mi-support.exp Index: gdb-7.2.50.20101231/gdb/testsuite/lib/mi-support.exp
=================================================================== ===================================================================
--- gdb-7.1.90.20100806.orig/gdb/testsuite/lib/mi-support.exp 2010-08-06 17:42:01.000000000 +0200 --- gdb-7.2.50.20101231.orig/gdb/testsuite/lib/mi-support.exp 2011-01-01 01:05:01.000000000 +0100
+++ gdb-7.1.90.20100806/gdb/testsuite/lib/mi-support.exp 2010-08-06 17:42:05.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/testsuite/lib/mi-support.exp 2011-01-01 01:05:10.000000000 +0100
@@ -221,7 +221,7 @@ proc default_mi_gdb_start { args } { @@ -221,7 +221,7 @@ proc default_mi_gdb_start { args } {
} }
} }
@ -498,10 +503,10 @@ Index: gdb-7.1.90.20100806/gdb/testsuite/lib/mi-support.exp
send_gdb "190-gdb-set build-id-verbose 0\n" send_gdb "190-gdb-set build-id-verbose 0\n"
gdb_expect 10 { gdb_expect 10 {
-re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" { -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" {
Index: gdb-7.1.90.20100806/gdb/tui/tui-interp.c Index: gdb-7.2.50.20101231/gdb/tui/tui-interp.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100806.orig/gdb/tui/tui-interp.c 2010-08-06 17:42:01.000000000 +0200 --- gdb-7.2.50.20101231.orig/gdb/tui/tui-interp.c 2010-05-18 00:21:43.000000000 +0200
+++ gdb-7.1.90.20100806/gdb/tui/tui-interp.c 2010-08-06 17:42:05.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/tui/tui-interp.c 2011-01-01 01:05:10.000000000 +0100
@@ -30,6 +30,7 @@ @@ -30,6 +30,7 @@
#include "tui/tui.h" #include "tui/tui.h"
#include "tui/tui-io.h" #include "tui/tui-io.h"
@ -519,10 +524,10 @@ Index: gdb-7.1.90.20100806/gdb/tui/tui-interp.c
/* Tell readline what the prompt to display is and what function /* Tell readline what the prompt to display is and what function
it will need to call after a whole line is read. This also it will need to call after a whole line is read. This also
displays the first prompt. */ displays the first prompt. */
Index: gdb-7.1.90.20100806/gdb/aclocal.m4 Index: gdb-7.2.50.20101231/gdb/aclocal.m4
=================================================================== ===================================================================
--- gdb-7.1.90.20100806.orig/gdb/aclocal.m4 2010-08-06 17:42:01.000000000 +0200 --- gdb-7.2.50.20101231.orig/gdb/aclocal.m4 2010-05-23 02:56:59.000000000 +0200
+++ gdb-7.1.90.20100806/gdb/aclocal.m4 2010-08-06 17:42:05.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/aclocal.m4 2011-01-01 01:05:10.000000000 +0100
@@ -19,6 +19,162 @@ You have another version of autoconf. I @@ -19,6 +19,162 @@ You have another version of autoconf. I
If you have problems, you may need to regenerate the build system entirely. If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])]) To do so, use the procedure documented by the package, typically `autoreconf'.])])
@ -686,10 +691,10 @@ Index: gdb-7.1.90.20100806/gdb/aclocal.m4
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
# #
# This file is free software; the Free Software Foundation # This file is free software; the Free Software Foundation
Index: gdb-7.1.90.20100806/gdb/config.in Index: gdb-7.2.50.20101231/gdb/config.in
=================================================================== ===================================================================
--- gdb-7.1.90.20100806.orig/gdb/config.in 2010-08-06 17:42:01.000000000 +0200 --- gdb-7.2.50.20101231.orig/gdb/config.in 2010-09-02 19:12:35.000000000 +0200
+++ gdb-7.1.90.20100806/gdb/config.in 2010-08-06 17:42:05.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/config.in 2011-01-01 01:05:10.000000000 +0100
@@ -46,6 +46,9 @@ @@ -46,6 +46,9 @@
/* Define to BFD's default target vector. */ /* Define to BFD's default target vector. */
#undef DEFAULT_BFD_VEC #undef DEFAULT_BFD_VEC
@ -700,7 +705,7 @@ Index: gdb-7.1.90.20100806/gdb/config.in
/* Define to 1 if translation of program messages to the user's native /* Define to 1 if translation of program messages to the user's native
language is requested. */ language is requested. */
#undef ENABLE_NLS #undef ENABLE_NLS
@@ -231,6 +234,9 @@ @@ -232,6 +235,9 @@
/* Define if Python 2.7 is being used. */ /* Define if Python 2.7 is being used. */
#undef HAVE_LIBPYTHON2_7 #undef HAVE_LIBPYTHON2_7
@ -710,29 +715,29 @@ Index: gdb-7.1.90.20100806/gdb/config.in
/* Define if libunwind library is being used. */ /* Define if libunwind library is being used. */
#undef HAVE_LIBUNWIND #undef HAVE_LIBUNWIND
Index: gdb-7.1.90.20100806/gdb/configure Index: gdb-7.2.50.20101231/gdb/configure
=================================================================== ===================================================================
--- gdb-7.1.90.20100806.orig/gdb/configure 2010-08-06 17:42:01.000000000 +0200 --- gdb-7.2.50.20101231.orig/gdb/configure 2010-12-14 08:17:14.000000000 +0100
+++ gdb-7.1.90.20100806/gdb/configure 2010-08-06 17:42:05.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/configure 2011-01-01 01:08:50.000000000 +0100
@@ -679,6 +679,9 @@ REPORT_BUGS_TO @@ -680,6 +680,9 @@ REPORT_BUGS_TO
PKGVERSION PKGVERSION
TARGET_OBS TARGET_OBS
subdirs subdirs
+RPM_LIBS +RPM_LIBS
+RPM_CFLAGS +RPM_CFLAGS
+PKG_CONFIG +PKG_CONFIG
pythondir
GDB_DATADIR_PATH
GDB_DATADIR GDB_DATADIR
@@ -948,6 +951,7 @@ with_separate_debug_dir DEBUGDIR
am__fastdepCC_FALSE
@@ -946,6 +949,7 @@ enable_dependency_tracking
with_separate_debug_dir
with_gdb_datadir with_gdb_datadir
with_relocated_sources with_relocated_sources
with_pythondir
+with_rpm +with_rpm
enable_targets enable_targets
enable_64_bit_bfd enable_64_bit_bfd
enable_gdbcli enable_gdbcli
@@ -988,6 +992,9 @@ LDFLAGS @@ -987,6 +991,9 @@ LDFLAGS
LIBS LIBS
CPPFLAGS CPPFLAGS
CPP CPP
@ -742,16 +747,16 @@ Index: gdb-7.1.90.20100806/gdb/configure
YACC YACC
YFLAGS YFLAGS
XMKMF' XMKMF'
@@ -1653,6 +1660,8 @@ Optional Packages: @@ -1650,6 +1657,8 @@ Optional Packages:
[DATADIR/gdb] [DATADIR/gdb]
--with-pythondir install Python data files in this path --with-relocated-sources=PATH
[DATADIR/gdb/python] automatically relocate this path for source files
+ --with-rpm query rpm database for missing debuginfos (yes/no, + --with-rpm query rpm database for missing debuginfos (yes/no,
+ def. auto=librpm.so) + def. auto=librpm.so)
--with-libunwind use libunwind frame unwinding support --with-libunwind use libunwind frame unwinding support
--with-curses use the curses library instead of the termcap --with-curses use the curses library instead of the termcap
library library
@@ -1688,6 +1697,9 @@ Some influential environment variables: @@ -1685,6 +1694,9 @@ Some influential environment variables:
CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir> you have headers in a nonstandard directory <include dir>
CPP C preprocessor CPP C preprocessor
@ -761,7 +766,7 @@ Index: gdb-7.1.90.20100806/gdb/configure
YACC The `Yet Another C Compiler' implementation to use. Defaults to YACC The `Yet Another C Compiler' implementation to use. Defaults to
the first program found out of: `bison -y', `byacc', `yacc'. the first program found out of: `bison -y', `byacc', `yacc'.
YFLAGS The list of arguments that will be passed by default to $YACC. YFLAGS The list of arguments that will be passed by default to $YACC.
@@ -7951,6 +7963,485 @@ _ACEOF @@ -7882,6 +7894,486 @@ _ACEOF
fi fi
@ -1244,16 +1249,17 @@ Index: gdb-7.1.90.20100806/gdb/configure
+ fi + fi
+ fi + fi
+fi +fi
+
subdirs="$subdirs testsuite"
Index: gdb-7.1.90.20100806/gdb/configure.ac Index: gdb-7.2.50.20101231/gdb/configure.ac
=================================================================== ===================================================================
--- gdb-7.1.90.20100806.orig/gdb/configure.ac 2010-08-06 17:42:01.000000000 +0200 --- gdb-7.2.50.20101231.orig/gdb/configure.ac 2010-12-14 08:17:15.000000000 +0100
+++ gdb-7.1.90.20100806/gdb/configure.ac 2010-08-06 17:42:05.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/configure.ac 2011-01-01 01:08:28.000000000 +0100
@@ -152,6 +152,198 @@ else @@ -108,6 +108,199 @@ AS_HELP_STRING([--with-relocated-sources
fi [Relocated directory for source files. ])
AC_SUBST(pythondir) ])
+# Integration with rpm library to support missing debuginfo suggestions. +# Integration with rpm library to support missing debuginfo suggestions.
+# --without-rpm: Disable any rpm support. +# --without-rpm: Disable any rpm support.
@ -1447,13 +1453,14 @@ Index: gdb-7.1.90.20100806/gdb/configure.ac
+ fi + fi
+ fi + fi
+fi +fi
+
AC_CONFIG_SUBDIRS(testsuite)
AC_CONFIG_SUBDIRS(doc testsuite) # Check whether to support alternative target configurations
Index: gdb-7.2.50.20101231/gdb/acinclude.m4
Index: gdb-7.1.90.20100806/gdb/acinclude.m4
=================================================================== ===================================================================
--- gdb-7.1.90.20100806.orig/gdb/acinclude.m4 2010-08-06 17:42:01.000000000 +0200 --- gdb-7.2.50.20101231.orig/gdb/acinclude.m4 2010-05-27 05:40:45.000000000 +0200
+++ gdb-7.1.90.20100806/gdb/acinclude.m4 2010-08-06 17:42:05.000000000 +0200 +++ gdb-7.2.50.20101231/gdb/acinclude.m4 2011-01-01 01:05:10.000000000 +0100
@@ -1,3 +1,5 @@ @@ -1,3 +1,5 @@
+# serial 1 +# serial 1
+ +
@ -1469,3 +1476,16 @@ Index: gdb-7.1.90.20100806/gdb/acinclude.m4
# @defmac AC_PROG_CC_STDC # @defmac AC_PROG_CC_STDC
# @maindex PROG_CC_STDC # @maindex PROG_CC_STDC
# @ovindex CC # @ovindex CC
Index: gdb-7.2.50.20101231/gdb/corelow.c
===================================================================
--- gdb-7.2.50.20101231.orig/gdb/corelow.c 2011-01-01 01:05:01.000000000 +0100
+++ gdb-7.2.50.20101231/gdb/corelow.c 2011-01-01 01:05:10.000000000 +0100
@@ -317,7 +317,7 @@ build_id_locate_exec (int from_tty)
symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED;
}
else
- debug_print_missing (_("the main executable file"), build_id_filename);
+ debug_print_missing (BUILD_ID_MAIN_EXECUTABLE_FILENAME, build_id_filename);
do_cleanups (back_to);

View File

@ -1,7 +1,7 @@
Index: gdb-7.1.90.20100711/gdb/corelow.c Index: gdb-7.2.50.20110117/gdb/corelow.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/corelow.c 2010-05-14 01:53:32.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/corelow.c 2011-01-05 23:22:47.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/corelow.c 2010-07-12 11:07:33.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/corelow.c 2011-01-17 15:52:06.000000000 +0100
@@ -47,6 +47,9 @@ @@ -47,6 +47,9 @@
#include "filenames.h" #include "filenames.h"
#include "progspace.h" #include "progspace.h"
@ -12,8 +12,8 @@ Index: gdb-7.1.90.20100711/gdb/corelow.c
#ifndef O_LARGEFILE #ifndef O_LARGEFILE
@@ -289,6 +292,52 @@ add_to_thread_list (bfd *abfd, asection @@ -278,6 +281,52 @@ add_to_thread_list (bfd *abfd, asection
inferior_ptid = ptid; /* Yes, make it current */ inferior_ptid = ptid; /* Yes, make it current. */
} }
+static int build_id_core_loads = 1; +static int build_id_core_loads = 1;
@ -65,7 +65,7 @@ Index: gdb-7.1.90.20100711/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
@@ -386,6 +435,12 @@ core_open (char *filename, int from_tty) @@ -379,6 +428,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.1.90.20100711/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
@@ -924,4 +979,11 @@ _initialize_corelow (void) @@ -932,4 +987,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.1.90.20100711/gdb/corelow.c
+ NULL, NULL, NULL, + NULL, NULL, NULL,
+ &setlist, &showlist); + &setlist, &showlist);
} }
Index: gdb-7.1.90.20100711/gdb/doc/gdb.texinfo Index: gdb-7.2.50.20110117/gdb/doc/gdb.texinfo
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/doc/gdb.texinfo 2010-07-12 10:59:30.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/doc/gdb.texinfo 2011-01-17 15:50:41.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/doc/gdb.texinfo 2010-07-12 11:05:57.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/doc/gdb.texinfo 2011-01-17 15:52:06.000000000 +0100
@@ -14980,6 +14980,27 @@ information files. @@ -15220,6 +15220,27 @@ information files.
@end table @end table
@ -122,11 +122,11 @@ Index: gdb-7.1.90.20100711/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.1.90.20100711/gdb/solib-svr4.c Index: gdb-7.2.50.20110117/gdb/solib-svr4.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/solib-svr4.c 2010-07-12 10:00:56.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/solib-svr4.c 2011-01-17 15:47:37.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/solib-svr4.c 2010-07-12 11:05:57.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/solib-svr4.c 2011-01-17 15:52:06.000000000 +0100
@@ -1181,9 +1181,49 @@ svr4_current_sos (void) @@ -1179,9 +1179,49 @@ svr4_current_sos (void)
safe_strerror (errcode)); safe_strerror (errcode));
else else
{ {
@ -179,10 +179,10 @@ Index: gdb-7.1.90.20100711/gdb/solib-svr4.c
} }
xfree (buffer); xfree (buffer);
Index: gdb-7.1.90.20100711/gdb/elfread.c Index: gdb-7.2.50.20110117/gdb/elfread.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/elfread.c 2010-07-12 10:00:56.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/elfread.c 2011-01-17 15:47:37.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/elfread.c 2010-07-12 11:30:30.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/elfread.c 2011-01-17 15:52:06.000000000 +0100
@@ -38,6 +38,10 @@ @@ -38,6 +38,10 @@
#include "demangle.h" #include "demangle.h"
#include "psympriv.h" #include "psympriv.h"
@ -194,7 +194,7 @@ Index: gdb-7.1.90.20100711/gdb/elfread.c
extern void _initialize_elfread (void); extern void _initialize_elfread (void);
@@ -818,16 +822,65 @@ resolve_gnu_ifunc (const char *function_ @@ -823,16 +827,65 @@ resolve_gnu_ifunc (const char *function_
return 0; return 0;
} }
@ -262,7 +262,7 @@ Index: gdb-7.1.90.20100711/gdb/elfread.c
{ {
struct build_id *retval; struct build_id *retval;
@@ -843,6 +896,348 @@ build_id_bfd_get (bfd *abfd) @@ -848,6 +901,348 @@ build_id_bfd_get (bfd *abfd)
return retval; return retval;
} }
@ -611,7 +611,7 @@ Index: gdb-7.1.90.20100711/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
@@ -857,7 +1252,7 @@ build_id_verify (const char *filename, s @@ -862,7 +1257,7 @@ build_id_verify (const char *filename, s
if (abfd == NULL) if (abfd == NULL)
return 0; return 0;
@ -620,7 +620,7 @@ Index: gdb-7.1.90.20100711/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);
@@ -874,14 +1269,16 @@ build_id_verify (const char *filename, s @@ -880,14 +1275,16 @@ build_id_verify (const char *filename, s
return retval; return retval;
} }
@ -641,7 +641,7 @@ Index: gdb-7.1.90.20100711/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. */
@@ -912,7 +1309,10 @@ build_id_to_debug_filename (struct build @@ -918,7 +1315,10 @@ 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++);
@ -653,7 +653,7 @@ Index: gdb-7.1.90.20100711/gdb/elfread.c
/* lrealpath() is expensive even for the usually non-existent files. */ /* lrealpath() is expensive even for the usually non-existent files. */
if (access (link, F_OK) == 0) if (access (link, F_OK) == 0)
@@ -925,26 +1325,201 @@ build_id_to_debug_filename (struct build @@ -931,26 +1331,201 @@ build_id_to_debug_filename (struct build
} }
if (retval != NULL) if (retval != NULL)
@ -859,7 +859,7 @@ Index: gdb-7.1.90.20100711/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 && strcmp (build_id_name, objfile->name) == 0) if (build_id_name != NULL && strcmp (build_id_name, objfile->name) == 0)
@@ -954,7 +1529,7 @@ find_separate_debug_file_by_buildid (str @@ -960,7 +1535,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)
@ -868,8 +868,8 @@ Index: gdb-7.1.90.20100711/gdb/elfread.c
} }
return NULL; return NULL;
} }
@@ -1131,9 +1706,10 @@ elf_symfile_read (struct objfile *objfil @@ -1148,9 +1723,10 @@ elf_symfile_read (struct objfile *objfil
`.gnu_debuglink' may no longer be present with `.note.gnu.build-id'. */ `.note.gnu.build-id'. */
if (!objfile_has_partial_symbols (objfile)) if (!objfile_has_partial_symbols (objfile))
{ {
- char *debugfile; - char *debugfile;
@ -881,7 +881,7 @@ Index: gdb-7.1.90.20100711/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);
@@ -1145,6 +1721,12 @@ elf_symfile_read (struct objfile *objfil @@ -1162,6 +1738,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);
} }
@ -894,7 +894,7 @@ Index: gdb-7.1.90.20100711/gdb/elfread.c
} }
} }
@@ -1304,4 +1886,16 @@ void @@ -1337,4 +1919,16 @@ void
_initialize_elfread (void) _initialize_elfread (void)
{ {
add_symtab_fns (&elf_sym_fns); add_symtab_fns (&elf_sym_fns);
@ -911,11 +911,11 @@ Index: gdb-7.1.90.20100711/gdb/elfread.c
+ +
+ observer_attach_executable_changed (debug_print_executable_changed); + observer_attach_executable_changed (debug_print_executable_changed);
} }
Index: gdb-7.1.90.20100711/gdb/symfile.h Index: gdb-7.2.50.20110117/gdb/symfile.h
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/symfile.h 2010-05-08 06:58:45.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/symfile.h 2011-01-11 22:53:24.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/symfile.h 2010-07-12 11:06:18.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/symfile.h 2011-01-17 15:52:06.000000000 +0100
@@ -562,6 +562,13 @@ void free_symfile_segment_data (struct s @@ -554,6 +554,13 @@ void free_symfile_segment_data (struct s
extern struct cleanup *increment_reading_symtab (void); extern struct cleanup *increment_reading_symtab (void);
@ -929,11 +929,11 @@ Index: gdb-7.1.90.20100711/gdb/symfile.h
/* From dwarf2read.c */ /* From dwarf2read.c */
extern int dwarf2_has_info (struct objfile *); extern int dwarf2_has_info (struct objfile *);
Index: gdb-7.1.90.20100711/gdb/testsuite/lib/gdb.exp Index: gdb-7.2.50.20110117/gdb/testsuite/lib/gdb.exp
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/testsuite/lib/gdb.exp 2010-07-12 10:00:56.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/testsuite/lib/gdb.exp 2011-01-17 15:47:37.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/testsuite/lib/gdb.exp 2010-07-12 11:05:57.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/testsuite/lib/gdb.exp 2011-01-17 15:52:06.000000000 +0100
@@ -1353,6 +1353,16 @@ proc default_gdb_start { } { @@ -1395,6 +1395,16 @@ proc default_gdb_start { } {
warning "Couldn't set the width to 0." warning "Couldn't set the width to 0."
} }
} }
@ -950,10 +950,10 @@ Index: gdb-7.1.90.20100711/gdb/testsuite/lib/gdb.exp
return 0; return 0;
} }
Index: gdb-7.1.90.20100711/gdb/testsuite/lib/mi-support.exp Index: gdb-7.2.50.20110117/gdb/testsuite/lib/mi-support.exp
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/testsuite/lib/mi-support.exp 2010-03-15 04:43:13.000000000 +0100 --- gdb-7.2.50.20110117.orig/gdb/testsuite/lib/mi-support.exp 2011-01-01 16:33:52.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/testsuite/lib/mi-support.exp 2010-07-12 11:05:57.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/testsuite/lib/mi-support.exp 2011-01-17 15:52:06.000000000 +0100
@@ -221,6 +221,16 @@ proc default_mi_gdb_start { args } { @@ -221,6 +221,16 @@ proc default_mi_gdb_start { args } {
} }
} }
@ -971,11 +971,11 @@ Index: gdb-7.1.90.20100711/gdb/testsuite/lib/mi-support.exp
detect_async detect_async
Index: gdb-7.1.90.20100711/gdb/objfiles.h Index: gdb-7.2.50.20110117/gdb/objfiles.h
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/objfiles.h 2010-04-14 19:26:11.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/objfiles.h 2011-01-10 21:38:49.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/objfiles.h 2010-07-12 11:07:08.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/objfiles.h 2011-01-17 15:52:26.000000000 +0100
@@ -426,6 +426,10 @@ struct objfile @@ -434,6 +434,10 @@ struct objfile
#define OBJF_USERLOADED (1 << 3) /* User loaded */ #define OBJF_USERLOADED (1 << 3) /* User loaded */
@ -984,5 +984,5 @@ Index: gdb-7.1.90.20100711/gdb/objfiles.h
+#define OBJF_BUILD_ID_CORE_LOADED (1 << 12) +#define OBJF_BUILD_ID_CORE_LOADED (1 << 12)
+ +
/* The object file that contains the runtime common minimal symbols /* The object file that contains the runtime common minimal symbols
for SunOS4. Note that this objfile has no associated BFD. */ for SunOS4. Note that this objfile has no associated BFD. */

View File

@ -1,33 +0,0 @@
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=225783
Index: gdb-6.8.50.20081128/gdb/Makefile.in
===================================================================
--- gdb-6.8.50.20081128.orig/gdb/Makefile.in 2008-12-02 23:06:16.000000000 +0100
+++ gdb-6.8.50.20081128/gdb/Makefile.in 2008-12-02 23:28:02.000000000 +0100
@@ -1490,8 +1490,10 @@ po/$(PACKAGE).pot: force
.SUFFIXES: .y .l
.y.c:
- $(SHELL) $(YLWRAP) $< y.tab.c $@.tmp -- $(YACC) $(YFLAGS)
- -sed -e '/extern.*malloc/d' \
+ rm -f $@ $@.tmp
+ $(SHELL) $(YLWRAP) $< y.tab.c $@ -- $(YACC) $(YFLAGS) && mv $@ $@.tmp \
+ || (rm -f $@; false)
+ sed -e '/extern.*malloc/d' \
-e '/extern.*realloc/d' \
-e '/extern.*free/d' \
-e '/include.*malloc.h/d' \
@@ -1500,9 +1502,9 @@ po/$(PACKAGE).pot: force
-e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \
-e 's/\([ \t;,(]\)free$$/\1xfree/g' \
-e '/^#line.*y.tab.c/d' \
- < $@.tmp > $@.new
- -rm $@.tmp
- mv $@.new ./$*.c
+ -e "s/^\(#line.*\)`basename $<`/\1`echo $<|sed 's/\//\\\\\//g'`/" \
+ < $@.tmp > $@
+ rm -f $@.tmp
.l.c:
if [ "$(FLEX)" ] && $(FLEX) --version >/dev/null 2>&1; then \
$(FLEX) -o$@ $< && \

View File

@ -7,19 +7,6 @@
* gdb.base/gcorebg.exp, gdb.base/gcorebg.c: New files. * gdb.base/gcorebg.exp, gdb.base/gcorebg.c: New files.
--- gdb-6.6-orig/gdb/gdb_gcore.sh 2005-12-17 17:33:59.000000000 -0500
+++ gdb-6.6/gdb/gdb_gcore.sh 2007-04-22 05:42:50.000000000 -0400
@@ -71,7 +71,9 @@
quit
EOF
- gdb -x $tmpfile -batch
+ # `</dev/null' to avoid touching interactive terminal if it is
+ # available but not accessible (SIGTTIN risk)
+ gdb -x $tmpfile -batch </dev/null
if [ -r $name.$pid ] ; then
rc=0
--- /dev/null 1 Jan 1970 00:00:00 -0000 --- /dev/null 1 Jan 1970 00:00:00 -0000
+++ ./gdb/testsuite/gdb.base/gcorebg.c 25 Feb 2007 12:21:20 -0000 +++ ./gdb/testsuite/gdb.base/gcorebg.c 25 Feb 2007 12:21:20 -0000
@@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@

View File

@ -1,116 +0,0 @@
2007-10-16 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.7.
Index: gdb-6.7/gdb/doc/Makefile.in
===================================================================
--- gdb-6.7.orig/gdb/doc/Makefile.in 2007-07-26 12:34:00.000000000 +0200
+++ gdb-6.7/gdb/doc/Makefile.in 2007-10-16 16:31:08.000000000 +0200
@@ -109,9 +109,7 @@ DVIPS = dvips
GDB_DOC_SOURCE_INCLUDES = \
$(srcdir)/fdl.texi \
$(srcdir)/gpl.texi \
- $(srcdir)/agentexpr.texi \
- $(READLINE_DIR)/rluser.texi \
- $(READLINE_DIR)/inc-hist.texinfo
+ $(srcdir)/agentexpr.texi
GDB_DOC_BUILD_INCLUDES = \
gdb-cfg.texi \
GDBvn.texi
Index: gdb-6.7/gdb/doc/gdb.texinfo
===================================================================
--- gdb-6.7.orig/gdb/doc/gdb.texinfo 2007-10-16 16:19:19.000000000 +0200
+++ gdb-6.7/gdb/doc/gdb.texinfo 2007-10-16 16:32:10.000000000 +0200
@@ -158,8 +158,8 @@ software in general. We will miss him.
* GDB Bugs:: Reporting bugs in @value{GDBN}
-* Command Line Editing:: Command Line Editing
-* Using History Interactively:: Using History Interactively
+* Command Line Editing: (rluserman). Command Line Editing
+* Using History Interactively: (history). Using History Interactively
* Formatting Documentation:: How to format and print @value{GDBN} documentation
* Installing GDB:: Installing GDB
* Maintenance Commands:: Maintenance Commands
@@ -15533,7 +15533,7 @@ Disable command line editing.
Show whether command line editing is enabled.
@end table
-@xref{Command Line Editing}, for more details about the Readline
+@xref{Command Line Editing, , , rluserman, GNU Readline Library}, for more details about the Readline
interface. Users unfamiliar with @sc{gnu} Emacs or @code{vi} are
encouraged to read that chapter.
@@ -15548,7 +15548,8 @@ history facility.
@value{GDBN} uses the @sc{gnu} History library, a part of the Readline
package, to provide the history facility. @xref{Using History
-Interactively}, for the detailed description of the History library.
+Interactively, , , history, GNU History Library}, for the detailed description
+of the History library.
To issue a command to @value{GDBN} without affecting certain aspects of
the state which is seen by users, prefix it with @samp{server }
@@ -15600,7 +15601,7 @@ This defaults to the value of the enviro
@end table
History expansion assigns special meaning to the character @kbd{!}.
-@xref{Event Designators}, for more details.
+@xref{Event Designators, , , history, GNU History Library}, for more details.
@cindex history expansion, turn on/off
Since @kbd{!} is also the logical not operator in C, history expansion
@@ -16660,7 +16661,8 @@ Indicates the current program counter ad
@cindex TUI key bindings
The TUI installs several key bindings in the readline keymaps
-(@pxref{Command Line Editing}). The following key bindings
+(@pxref{Command Line Editing, , , rluserman, GNU Readline Library}).
+The following key bindings
are installed for both TUI mode and the @value{GDBN} standard mode.
@table @kbd
@@ -21937,15 +21939,6 @@ Such guesses are usually wrong. Even we
things without first using the debugger to find the facts.
@end itemize
-@c The readline documentation is distributed with the readline code
-@c and consists of the two following files:
-@c rluser.texinfo
-@c inc-hist.texinfo
-@c Use -I with makeinfo to point to the appropriate directory,
-@c environment var TEXINPUTS with TeX.
-@include rluser.texi
-@include inc-hist.texinfo
-
@node Formatting Documentation
@appendix Formatting Documentation
@@ -22115,9 +22108,6 @@ source for the @samp{-liberty} free soft
@item gdb-@value{GDBVN}/opcodes
source for the library of opcode tables and disassemblers
-@item gdb-@value{GDBVN}/readline
-source for the @sc{gnu} command-line interface
-
@item gdb-@value{GDBVN}/glob
source for the @sc{gnu} filename pattern-matching subroutine
@@ -22149,7 +22139,7 @@ where @var{host} is an identifier such a
correct value by examining your system.)
Running @samp{configure @var{host}} and then running @code{make} builds the
-@file{bfd}, @file{readline}, @file{mmalloc}, and @file{libiberty}
+@file{bfd}, @file{mmalloc}, and @file{libiberty}
libraries, then @code{gdb} itself. The configured source files, and the
binaries, are left in the corresponding source directories.
@@ -22175,7 +22165,7 @@ source tree, the @file{gdb-@var{version-
that subdirectory. That is usually not what you want. In particular,
if you run the first @file{configure} from the @file{gdb} subdirectory
of the @file{gdb-@var{version-number}} directory, you will omit the
-configuration of @file{bfd}, @file{readline}, and other sibling
+configuration of @file{bfd}, and other sibling
directories of the @file{gdb} subdirectory. This leads to build errors
about missing include files such as @file{bfd/bfd.h}.

View File

@ -21,11 +21,11 @@
Port to GDB-6.8pre. Port to GDB-6.8pre.
Index: gdb-7.1.90.20100711/gdb/inferior.h Index: gdb-7.2.50.20110117/gdb/inferior.h
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/inferior.h 2010-07-12 10:00:56.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/inferior.h 2011-01-09 04:08:56.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/inferior.h 2010-07-12 10:04:25.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/inferior.h 2011-01-17 15:48:39.000000000 +0100
@@ -198,7 +198,15 @@ extern void reopen_exec_file (void); @@ -186,7 +186,15 @@ extern void reopen_exec_file (void);
/* The `resume' routine should only be called in special circumstances. /* The `resume' routine should only be called in special circumstances.
Normally, use `proceed', which handles a lot of bookkeeping. */ Normally, use `proceed', which handles a lot of bookkeeping. */
@ -42,10 +42,10 @@ Index: gdb-7.1.90.20100711/gdb/inferior.h
/* From misc files */ /* From misc files */
Index: gdb-7.1.90.20100711/gdb/infrun.c Index: gdb-7.2.50.20110117/gdb/infrun.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/infrun.c 2010-07-12 10:00:56.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/infrun.c 2011-01-09 04:08:56.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/infrun.c 2010-07-12 10:05:26.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/infrun.c 2011-01-17 15:49:40.000000000 +0100
@@ -76,7 +76,7 @@ static int follow_fork (void); @@ -76,7 +76,7 @@ static int follow_fork (void);
static void set_schedlock_func (char *args, int from_tty, static void set_schedlock_func (char *args, int from_tty,
struct cmd_list_element *c); struct cmd_list_element *c);
@ -55,7 +55,7 @@ Index: gdb-7.1.90.20100711/gdb/infrun.c
static int currently_stepping_or_nexting_callback (struct thread_info *tp, static int currently_stepping_or_nexting_callback (struct thread_info *tp,
void *data); void *data);
@@ -1549,7 +1549,7 @@ maybe_software_singlestep (struct gdbarc @@ -1577,7 +1577,7 @@ maybe_software_singlestep (struct gdbarc
STEP nonzero if we should step (zero to continue instead). STEP nonzero if we should step (zero to continue instead).
SIG is the signal to give the inferior (zero for none). */ SIG is the signal to give the inferior (zero for none). */
void void
@ -64,24 +64,24 @@ Index: gdb-7.1.90.20100711/gdb/infrun.c
{ {
int should_resume = 1; int should_resume = 1;
struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0); struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0);
@@ -1562,10 +1562,12 @@ resume (int step, enum target_signal sig @@ -1609,10 +1609,12 @@ resume (int step, enum target_signal sig
QUIT; }
if (debug_infrun) if (debug_infrun)
- fprintf_unfiltered (gdb_stdlog, - fprintf_unfiltered (gdb_stdlog,
- "infrun: resume (step=%d, signal=%d), " - "infrun: resume (step=%d, signal=%d), "
- "trap_expected=%d\n", - "trap_expected=%d\n",
- step, sig, tp->trap_expected); - step, sig, tp->control.trap_expected);
+ fprintf_unfiltered (gdb_stdlog, "infrun: resume (step=%s, signal=%d), " + fprintf_unfiltered (gdb_stdlog, "infrun: resume (step=%s, signal=%d), "
+ "trap_expected=%d\n", + "trap_expected=%d\n",
+ (step == RESUME_STEP_CONTINUE ? "RESUME_STEP_CONTINUE" + (step == RESUME_STEP_CONTINUE ? "RESUME_STEP_CONTINUE"
+ : (step == RESUME_STEP_USER ? "RESUME_STEP_USER" + : (step == RESUME_STEP_USER ? "RESUME_STEP_USER"
+ : "RESUME_STEP_NEEDED")), + : "RESUME_STEP_NEEDED")),
+ sig, tp->trap_expected); + sig, tp->control.trap_expected);
/* Normally, by the time we reach `resume', the breakpoints are either /* Normally, by the time we reach `resume', the breakpoints are either
removed or inserted, as appropriate. The exception is if we're sitting removed or inserted, as appropriate. The exception is if we're sitting
@@ -1678,9 +1680,10 @@ a command like `return' or `jump' to con @@ -1730,9 +1732,10 @@ a command like `return' or `jump' to con
individually. */ individually. */
resume_ptid = inferior_ptid; resume_ptid = inferior_ptid;
} }
@ -92,9 +92,9 @@ Index: gdb-7.1.90.20100711/gdb/infrun.c
+ && (step == RESUME_STEP_USER + && (step == RESUME_STEP_USER
+ || singlestep_breakpoints_inserted_p))) + || singlestep_breakpoints_inserted_p)))
{ {
/* User-settable 'scheduler' mode requires solo thread resume. */ /* User-settable 'scheduler' mode requires solo thread resume. */
resume_ptid = inferior_ptid; resume_ptid = inferior_ptid;
@@ -1889,7 +1892,7 @@ proceed (CORE_ADDR addr, enum target_sig @@ -1941,7 +1944,7 @@ proceed (CORE_ADDR addr, enum target_sig
struct thread_info *tp; struct thread_info *tp;
CORE_ADDR pc; CORE_ADDR pc;
struct address_space *aspace; struct address_space *aspace;
@ -103,7 +103,7 @@ Index: gdb-7.1.90.20100711/gdb/infrun.c
/* If we're stopped at a fork/vfork, follow the branch set by the /* If we're stopped at a fork/vfork, follow the branch set by the
"set follow-fork-mode" command; otherwise, we'll just proceed "set follow-fork-mode" command; otherwise, we'll just proceed
@@ -1924,13 +1927,13 @@ proceed (CORE_ADDR addr, enum target_sig @@ -1976,13 +1979,13 @@ proceed (CORE_ADDR addr, enum target_sig
actually be executing the breakpoint insn anyway. actually be executing the breakpoint insn anyway.
We'll be (un-)executing the previous instruction. */ We'll be (un-)executing the previous instruction. */
@ -119,9 +119,9 @@ Index: gdb-7.1.90.20100711/gdb/infrun.c
} }
else else
{ {
@@ -1971,13 +1974,13 @@ proceed (CORE_ADDR addr, enum target_sig @@ -2023,13 +2026,13 @@ proceed (CORE_ADDR addr, enum target_sig
is required it returns TRUE and sets the current thread to is required it returns TRUE and sets the current thread to
the old thread. */ the old thread. */
if (prepare_to_proceed (step)) if (prepare_to_proceed (step))
- oneproc = 1; - oneproc = 1;
+ resume_step = RESUME_STEP_USER; + resume_step = RESUME_STEP_USER;
@ -133,9 +133,9 @@ Index: gdb-7.1.90.20100711/gdb/infrun.c
- if (oneproc) - if (oneproc)
+ if (resume_step == RESUME_STEP_USER) + if (resume_step == RESUME_STEP_USER)
{ {
tp->trap_expected = 1; tp->control.trap_expected = 1;
/* If displaced stepping is enabled, we can step over the /* If displaced stepping is enabled, we can step over the
@@ -2064,8 +2067,13 @@ proceed (CORE_ADDR addr, enum target_sig @@ -2116,8 +2119,13 @@ proceed (CORE_ADDR addr, enum target_sig
/* Reset to normal state. */ /* Reset to normal state. */
init_infwait_state (); init_infwait_state ();
@ -145,12 +145,12 @@ Index: gdb-7.1.90.20100711/gdb/infrun.c
+ resume_step = RESUME_STEP_NEEDED; + resume_step = RESUME_STEP_NEEDED;
+ +
/* Resume inferior. */ /* Resume inferior. */
- resume (oneproc || step || bpstat_should_step (), tp->stop_signal); - resume (oneproc || step || bpstat_should_step (), tp->suspend.stop_signal);
+ resume (resume_step, tp->stop_signal); + resume (resume_step, tp->suspend.stop_signal);
/* Wait for it to stop (if not standalone) /* Wait for it to stop (if not standalone)
and in any case decode why it stopped, and act accordingly. */ and in any case decode why it stopped, and act accordingly. */
@@ -4903,13 +4911,18 @@ infrun: not switching back to stepped th @@ -4957,14 +4965,19 @@ process_event_stop_test:
/* Is thread TP in the middle of single-stepping? */ /* Is thread TP in the middle of single-stepping? */
@ -158,12 +158,14 @@ Index: gdb-7.1.90.20100711/gdb/infrun.c
+static enum resume_step +static enum resume_step
currently_stepping (struct thread_info *tp) currently_stepping (struct thread_info *tp)
{ {
- return ((tp->step_range_end && tp->step_resume_breakpoint == NULL) - return ((tp->control.step_range_end
- || tp->trap_expected - && tp->control.step_resume_breakpoint == NULL)
- || tp->stepping_through_solib_after_catch - || tp->control.trap_expected
- || bpstat_should_step ()); - || tp->stepping_through_solib_after_catch
+ if ((tp->step_range_end && tp->step_resume_breakpoint == NULL) - || bpstat_should_step ());
+ || tp->trap_expected + if ((tp->control.step_range_end
+ && tp->control.step_resume_breakpoint == NULL)
+ || tp->control.trap_expected
+ || tp->stepping_through_solib_after_catch) + || tp->stepping_through_solib_after_catch)
+ return RESUME_STEP_USER; + return RESUME_STEP_USER;
+ +
@ -174,11 +176,11 @@ Index: gdb-7.1.90.20100711/gdb/infrun.c
} }
/* Returns true if any thread *but* the one passed in "data" is in the /* Returns true if any thread *but* the one passed in "data" is in the
Index: gdb-7.1.90.20100711/gdb/linux-nat.c Index: gdb-7.2.50.20110117/gdb/linux-nat.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/linux-nat.c 2010-07-12 10:00:56.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/linux-nat.c 2011-01-17 15:47:37.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/linux-nat.c 2010-07-12 10:04:25.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/linux-nat.c 2011-01-17 15:48:39.000000000 +0100
@@ -2827,7 +2827,10 @@ count_events_callback (struct lwp_info * @@ -2928,7 +2928,10 @@ count_events_callback (struct lwp_info *
static int static int
select_singlestep_lwp_callback (struct lwp_info *lp, void *data) select_singlestep_lwp_callback (struct lwp_info *lp, void *data)
{ {
@ -190,10 +192,10 @@ Index: gdb-7.1.90.20100711/gdb/linux-nat.c
return 1; return 1;
else else
return 0; return 0;
Index: gdb-7.1.90.20100711/gdb/linux-nat.h Index: gdb-7.2.50.20110117/gdb/linux-nat.h
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/linux-nat.h 2010-06-11 14:10:12.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/linux-nat.h 2011-01-17 15:47:37.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/linux-nat.h 2010-07-12 10:04:25.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/linux-nat.h 2011-01-17 15:48:39.000000000 +0100
@@ -55,8 +55,8 @@ struct lwp_info @@ -55,8 +55,8 @@ struct lwp_info
/* If non-zero, a pending wait status. */ /* If non-zero, a pending wait status. */
int status; int status;

View File

@ -1,8 +1,8 @@
Index: gdb-6.8.50.20090811/gdb/linux-nat.c Index: gdb-7.2.50.20101116/gdb/linux-nat.c
=================================================================== ===================================================================
--- gdb-6.8.50.20090811.orig/gdb/linux-nat.c 2009-08-12 07:21:20.000000000 +0200 --- gdb-7.2.50.20101116.orig/gdb/linux-nat.c 2010-11-16 07:58:15.000000000 +0100
+++ gdb-6.8.50.20090811/gdb/linux-nat.c 2009-08-12 08:11:25.000000000 +0200 +++ gdb-7.2.50.20101116/gdb/linux-nat.c 2010-11-16 07:59:06.000000000 +0100
@@ -1656,16 +1656,18 @@ resume_set_callback (struct lwp_info *lp @@ -1863,16 +1863,18 @@ resume_set_callback (struct lwp_info *lp
static void static void
linux_nat_resume (struct target_ops *ops, linux_nat_resume (struct target_ops *ops,
@ -21,9 +21,9 @@ Index: gdb-6.8.50.20090811/gdb/linux-nat.c
+ (step == RESUME_STEP_NEEDED + (step == RESUME_STEP_NEEDED
+ ? "needed" : (step ? "step" : "resume")), + ? "needed" : (step ? "step" : "resume")),
target_pid_to_str (ptid), target_pid_to_str (ptid),
signo ? strsignal (signo) : "0", (signo != TARGET_SIGNAL_0
target_pid_to_str (inferior_ptid)); ? strsignal (target_signal_to_host (signo)) : "0"),
@@ -2625,10 +2627,34 @@ linux_nat_filter_event (int lwpid, int s @@ -3171,10 +3173,34 @@ linux_nat_filter_event (int lwpid, int s
if (num_lwps (GET_PID (lp->ptid)) > 1) if (num_lwps (GET_PID (lp->ptid)) > 1)
{ {

View File

@ -1,41 +0,0 @@
Original patch was:
http://sourceware.org/ml/gdb-patches/2007-12/msg00397.html
http://sourceware.org/ml/gdb-cvs/2007-12/msg00123.html
extended for the RHEL safety:
2007-12-28 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2read.c (fixup_partial_die): Provide full
`DW_TAG_class_type'-type backing for `DW_TAG_interface_type', even for
namespaces which should not apply for Java `DW_TAG_interface_type'.
2008-02-24 Jan Kratochvil <jan.kratochvil@redhat.com>
Port to GDB-6.8pre.
Index: ./gdb/dwarf2read.c
===================================================================
RCS file: /cvs/src/src/gdb/dwarf2read.c,v
retrieving revision 1.245
diff -u -p -r1.245 dwarf2read.c
--- ./gdb/dwarf2read.c 26 Dec 2007 12:36:18 -0000 1.245
+++ ./gdb/dwarf2read.c 27 Dec 2007 23:25:49 -0000
@@ -5887,7 +5887,8 @@ fixup_partial_die (struct partial_die_in
/* Set default names for some unnamed DIEs. */
if (part_die->name == NULL && (part_die->tag == DW_TAG_structure_type
- || part_die->tag == DW_TAG_class_type))
+ || part_die->tag == DW_TAG_class_type
+ || part_die->tag == DW_TAG_interface_type))
part_die->name = "(anonymous class)";
if (part_die->name == NULL && part_die->tag == DW_TAG_namespace)
@@ -5895,6 +5896,7 @@ fixup_partial_die (struct partial_die_in
if (part_die->tag == DW_TAG_structure_type
|| part_die->tag == DW_TAG_class_type
+ || part_die->tag == DW_TAG_interface_type
|| part_die->tag == DW_TAG_union_type)
guess_structure_name (part_die, cu);
}

View File

@ -1,24 +0,0 @@
kernel-headers-2.6.25-0.40.rc1.git2.fc9.x86_64
In file included from /usr/include/asm/ptrace.h:4,
from ../../gdb/amd64-linux-nat.c:44:
/usr/include/asm/ptrace-abi.h:92: error: expected specifier-qualifier-list before u32
--- gdb-6.7.1-13.fc9.x86_64/gdb/amd64-linux-nat.c-orig 2008-02-15 15:37:28.000000000 -0500
+++ gdb-6.7.1-13.fc9.x86_64/gdb/amd64-linux-nat.c 2008-02-15 15:40:13.000000000 -0500
@@ -35,13 +35,13 @@
#include <sys/procfs.h>
#include <asm/prctl.h>
/* FIXME ezannoni-2003-07-09: we need <sys/reg.h> to be included after
- <asm/ptrace.h> because the latter redefines FS and GS for no apparent
+ <sys/ptrace.h> because the latter redefines FS and GS for no apparent
reason, and those definitions don't match the ones that libpthread_db
uses, which come from <sys/reg.h>. */
/* ezannoni-2003-07-09: I think this is fixed. The extraneous defs have
been removed from ptrace.h in the kernel. However, better safe than
sorry. */
-#include <asm/ptrace.h>
+#include <sys/ptrace.h>
#include <sys/reg.h>
#include "gdb_proc_service.h"

View File

@ -2,11 +2,12 @@ Index: gdb-7.1.90.20100711/bfd/elf-bfd.h
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/bfd/elf-bfd.h 2010-06-27 06:07:51.000000000 +0200 --- gdb-7.1.90.20100711.orig/bfd/elf-bfd.h 2010-06-27 06:07:51.000000000 +0200
+++ gdb-7.1.90.20100711/bfd/elf-bfd.h 2010-07-12 23:00:04.000000000 +0200 +++ gdb-7.1.90.20100711/bfd/elf-bfd.h 2010-07-12 23:00:04.000000000 +0200
@@ -2171,8 +2171,9 @@ extern Elf_Internal_Phdr * _bfd_elf_find @@ -2171,8 +2171,10 @@ extern Elf_Internal_Phdr * _bfd_elf_find
/* Exported interface for writing elf corefile notes. */ /* Exported interface for writing elf corefile notes. */
extern char *elfcore_write_note extern char *elfcore_write_note
(bfd *, char *, int *, const char *, int, const void *, int); (bfd *, char *, int *, const char *, int, const void *, int);
+#include <sys/procfs.h> +struct elf_prpsinfo;
+typedef struct elf_prpsinfo prpsinfo_t;
extern char *elfcore_write_prpsinfo extern char *elfcore_write_prpsinfo
- (bfd *, char *, int *, const char *, const char *); - (bfd *, char *, int *, const char *, const char *);
+ (bfd *, char *, int *, const prpsinfo_t *); + (bfd *, char *, int *, const prpsinfo_t *);

View File

@ -1,84 +0,0 @@
Index: gdb-7.1.90.20100711/gdb/dwarf2read.c
===================================================================
--- gdb-7.1.90.20100711.orig/gdb/dwarf2read.c 2010-07-12 23:07:35.000000000 +0200
+++ gdb-7.1.90.20100711/gdb/dwarf2read.c 2010-07-13 00:13:02.000000000 +0200
@@ -2251,6 +2251,7 @@ scan_partial_symbols (struct partial_die
add_partial_subprogram (pdi, lowpc, highpc, need_pc, cu);
break;
case DW_TAG_variable:
+ case DW_TAG_constant:
case DW_TAG_typedef:
case DW_TAG_union_type:
if (!pdi->is_declaration)
@@ -2452,6 +2453,7 @@ add_partial_symbol (struct partial_die_i
}
break;
case DW_TAG_variable:
+ case DW_TAG_constant:
if (pdi->is_external)
{
/* Global Variable.
@@ -3289,6 +3291,7 @@ die_needs_namespace (struct die_info *di
return 1;
case DW_TAG_variable:
+ case DW_TAG_constant:
/* We only need to prefix "globally" visible variables. These include
any variable marked with DW_AT_external or any variable that
lives in a namespace. [Variables in anonymous namespaces
@@ -4638,7 +4641,8 @@ dwarf2_add_field (struct field_info *fip
fip->non_public_fields = 1;
}
}
- else if (die->tag == DW_TAG_member || die->tag == DW_TAG_variable)
+ else if (die->tag == DW_TAG_member || die->tag == DW_TAG_variable
+ || die->tag == DW_TAG_constant)
{
/* C++ static member. */
@@ -5250,7 +5254,8 @@ read_structure_type (struct die_info *di
while (child_die && child_die->tag)
{
if (child_die->tag == DW_TAG_member
- || child_die->tag == DW_TAG_variable)
+ || child_die->tag == DW_TAG_variable
+ || child_die->tag == DW_TAG_constant)
{
/* NOTE: carlton/2002-11-05: A C++ static data member
should be a DW_TAG_member that is a declaration, but
@@ -5396,6 +5401,7 @@ process_structure_scope (struct die_info
{
if (child_die->tag == DW_TAG_member
|| child_die->tag == DW_TAG_variable
+ || child_die->tag == DW_TAG_constant
|| child_die->tag == DW_TAG_inheritance)
{
/* Do nothing. */
@@ -7109,6 +7115,7 @@ load_partial_dies (bfd *abfd, gdb_byte *
&& abbrev->tag != DW_TAG_subprogram
&& abbrev->tag != DW_TAG_lexical_block
&& abbrev->tag != DW_TAG_variable
+ && abbrev->tag != DW_TAG_constant
&& abbrev->tag != DW_TAG_namespace
&& abbrev->tag != DW_TAG_module
&& abbrev->tag != DW_TAG_member)
@@ -7217,6 +7224,7 @@ load_partial_dies (bfd *abfd, gdb_byte *
if (load_all
|| abbrev->tag == DW_TAG_subprogram
|| abbrev->tag == DW_TAG_variable
+ || abbrev->tag == DW_TAG_constant
|| abbrev->tag == DW_TAG_namespace
|| part_die->is_declaration)
{
@@ -9059,6 +9067,11 @@ new_symbol (struct die_info *die, struct
/* Do not add the symbol to any lists. It will be found via
BLOCK_FUNCTION from the blockvector. */
break;
+ case DW_TAG_constant:
+ SYMBOL_TYPE (sym) = make_cv_type (1,
+ TYPE_VOLATILE (SYMBOL_TYPE (sym)),
+ SYMBOL_TYPE (sym), NULL);
+ /* PASSTHRU */
case DW_TAG_variable:
case DW_TAG_member:
/* Compilation with minimal debug info may result in variables

View File

@ -1,18 +0,0 @@
--- ./gdb/dwarf2read.c 4 May 2008 17:27:01 -0000 1.260
+++ ./gdb/dwarf2read.c 4 May 2008 18:26:20 -0000
@@ -6754,7 +6754,14 @@ dwarf2_attr (struct die_info *die, unsig
for (i = 0; i < die->num_attrs; ++i)
{
if (die->attrs[i].name == name)
- return &die->attrs[i];
+ {
+ /* GCC PR ada/35998 workaround. */
+ if (name == DW_AT_byte_size
+ && DW_UNSND (&die->attrs[i]) == 0xffffffff)
+ return NULL;
+
+ return &die->attrs[i];
+ }
if (die->attrs[i].name == DW_AT_specification
|| die->attrs[i].name == DW_AT_abstract_origin)
spec = &die->attrs[i];

View File

@ -1,14 +0,0 @@
../../libiberty/strsignal.c:552: error: conflicting types for 'psignal'
/usr/include/signal.h:141: error: previous declaration of 'psignal' was here
--- gdb-6.8/libiberty/strsignal.c-orig 2007-01-31 00:13:04.000000000 +0100
+++ gdb-6.8/libiberty/strsignal.c 2008-06-17 16:30:13.000000000 +0200
@@ -549,7 +549,7 @@ followed by a newline.
#ifndef HAVE_PSIGNAL
void
-psignal (int signo, char *message)
+psignal (int signo, const char *message)
{
if (signal_names == NULL)
{

View File

@ -5,11 +5,11 @@ Some of the threads may not be properly PTRACE_DETACHed which hurts if they
should have been detached with SIGSTOP (as they are accidentally left running should have been detached with SIGSTOP (as they are accidentally left running
on the debugger termination). on the debugger termination).
Index: gdb-6.8.50.20081128/gdb/defs.h Index: gdb-7.2.50.20110117/gdb/defs.h
=================================================================== ===================================================================
--- gdb-6.8.50.20081128.orig/gdb/defs.h 2008-11-27 10:23:01.000000000 +0100 --- gdb-7.2.50.20110117.orig/gdb/defs.h 2011-01-17 15:47:37.000000000 +0100
+++ gdb-6.8.50.20081128/gdb/defs.h 2008-12-06 21:49:32.000000000 +0100 +++ gdb-7.2.50.20110117/gdb/defs.h 2011-01-17 15:53:05.000000000 +0100
@@ -155,6 +155,7 @@ extern char *gdb_sysroot; @@ -165,6 +165,7 @@ extern char *python_libdir;
extern char *debug_file_directory; extern char *debug_file_directory;
extern int quit_flag; extern int quit_flag;
@ -17,8 +17,8 @@ Index: gdb-6.8.50.20081128/gdb/defs.h
extern int immediate_quit; extern int immediate_quit;
extern int sevenbit_strings; extern int sevenbit_strings;
@@ -168,7 +169,7 @@ extern void quit (void); @@ -178,7 +179,7 @@ extern void quit (void);
needed. */ needed. */
#define QUIT { \ #define QUIT { \
- if (quit_flag) quit (); \ - if (quit_flag) quit (); \
@ -26,24 +26,24 @@ Index: gdb-6.8.50.20081128/gdb/defs.h
if (deprecated_interactive_hook) deprecated_interactive_hook (); \ if (deprecated_interactive_hook) deprecated_interactive_hook (); \
} }
Index: gdb-6.8.50.20081128/gdb/event-top.c Index: gdb-7.2.50.20110117/gdb/event-top.c
=================================================================== ===================================================================
--- gdb-6.8.50.20081128.orig/gdb/event-top.c 2008-12-04 10:34:31.000000000 +0100 --- gdb-7.2.50.20110117.orig/gdb/event-top.c 2011-01-17 15:52:39.000000000 +0100
+++ gdb-6.8.50.20081128/gdb/event-top.c 2008-12-06 21:49:07.000000000 +0100 +++ gdb-7.2.50.20110117/gdb/event-top.c 2011-01-17 15:52:49.000000000 +0100
@@ -939,7 +939,7 @@ async_request_quit (gdb_client_data arg) @@ -904,7 +904,7 @@ async_request_quit (gdb_client_data arg)
is no reason to call quit again here, unless immediate_quit is is no reason to call quit again here, unless immediate_quit is
set.*/ set. */
- if (quit_flag || immediate_quit) - if (quit_flag || immediate_quit)
+ if ((quit_flag || immediate_quit) && !quit_flag_cleanup) + if ((quit_flag || immediate_quit) && !quit_flag_cleanup)
quit (); quit ();
} }
Index: gdb-6.8.50.20081128/gdb/top.c Index: gdb-7.2.50.20110117/gdb/top.c
=================================================================== ===================================================================
--- gdb-6.8.50.20081128.orig/gdb/top.c 2008-12-04 10:23:12.000000000 +0100 --- gdb-7.2.50.20110117.orig/gdb/top.c 2011-01-17 15:47:37.000000000 +0100
+++ gdb-6.8.50.20081128/gdb/top.c 2008-12-06 21:49:07.000000000 +0100 +++ gdb-7.2.50.20110117/gdb/top.c 2011-01-17 15:52:49.000000000 +0100
@@ -1299,7 +1299,9 @@ quit_force (char *args, int from_tty) @@ -1257,7 +1257,9 @@ quit_force (char *args, int from_tty)
qt.args = args; qt.args = args;
qt.from_tty = from_tty; qt.from_tty = from_tty;
@ -54,11 +54,11 @@ Index: gdb-6.8.50.20081128/gdb/top.c
catch_errors (quit_target, &qt, catch_errors (quit_target, &qt,
"Quitting: ", RETURN_MASK_ALL); "Quitting: ", RETURN_MASK_ALL);
Index: gdb-6.8.50.20081128/gdb/utils.c Index: gdb-7.2.50.20110117/gdb/utils.c
=================================================================== ===================================================================
--- gdb-6.8.50.20081128.orig/gdb/utils.c 2008-12-04 10:31:00.000000000 +0100 --- gdb-7.2.50.20110117.orig/gdb/utils.c 2011-01-17 15:47:37.000000000 +0100
+++ gdb-6.8.50.20081128/gdb/utils.c 2008-12-06 21:49:07.000000000 +0100 +++ gdb-7.2.50.20110117/gdb/utils.c 2011-01-17 15:52:49.000000000 +0100
@@ -114,6 +114,11 @@ int job_control; @@ -121,6 +121,11 @@ int job_control;
int quit_flag; int quit_flag;

View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:481e5fb3f97cd023b74aff94090ae1d0c05bf0257addbd87e9a9b1b379dcab43
size 19762129

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:bf444b88ab845243364c3d410be9e3f43a57f96ff594d65a37842ea03c3410f0
size 18530613

View File

@ -1,23 +0,0 @@
From: Keith Seitz <keiths@redhat.com>
Message-ID: <4B7F207A.7020102@redhat.com>
[ read_partial_die part dropped in the port to Rawhide ]
--- gdb-7.0.1-orig/gdb/dwarf2read.c 2010-02-20 01:06:44.000000000 +0100
+++ gdb-7.0.1/gdb/dwarf2read.c 2010-02-20 01:08:28.000000000 +0100
@@ -9924,9 +9928,13 @@ dwarf2_canonicalize_name (char *name, st
static char *
dwarf2_name (struct die_info *die, struct dwarf2_cu *cu)
{
- struct attribute *attr;
+ struct attribute *attr = NULL;
+
+ if (cu->language == language_ada)
+ attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu);
- attr = dwarf2_attr (die, DW_AT_name, cu);
+ if (!attr)
+ attr = dwarf2_attr (die, DW_AT_name, cu);
if (!attr || !DW_STRING (attr))
return NULL;

View File

@ -1,8 +1,8 @@
Index: gdb-7.1.90.20100711/gdb/breakpoint.c Index: gdb-7.2.50.20110206/gdb/breakpoint.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/breakpoint.c 2010-07-12 23:07:33.000000000 +0200 --- gdb-7.2.50.20110206.orig/gdb/breakpoint.c 2011-02-06 20:39:24.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/breakpoint.c 2010-07-13 00:38:04.000000000 +0200 +++ gdb-7.2.50.20110206/gdb/breakpoint.c 2011-02-06 20:39:44.000000000 +0100
@@ -10159,6 +10159,50 @@ update_breakpoint_locations (struct brea @@ -10587,6 +10587,50 @@ update_breakpoint_locations (struct brea
update_global_location_list (1); update_global_location_list (1);
} }
@ -53,23 +53,23 @@ Index: gdb-7.1.90.20100711/gdb/breakpoint.c
/* Reset a breakpoint given it's struct breakpoint * BINT. /* Reset a breakpoint given it's struct breakpoint * BINT.
The value we return ends up being the return value from catch_errors. The value we return ends up being the return value from catch_errors.
Unused in this case. */ Unused in this case. */
Index: gdb-7.1.90.20100711/gdb/breakpoint.h Index: gdb-7.2.50.20110206/gdb/breakpoint.h
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/breakpoint.h 2010-07-12 23:07:33.000000000 +0200 --- gdb-7.2.50.20110206.orig/gdb/breakpoint.h 2011-02-06 20:39:24.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/breakpoint.h 2010-07-13 00:37:34.000000000 +0200 +++ gdb-7.2.50.20110206/gdb/breakpoint.h 2011-02-06 20:40:00.000000000 +0100
@@ -1088,4 +1088,7 @@ extern void check_tracepoint_command (ch @@ -1194,4 +1194,7 @@ extern struct breakpoint *iterate_over_b
extern void start_rbreak_breakpoints (void);
extern void end_rbreak_breakpoints (void); extern int user_breakpoint_p (struct breakpoint *);
+extern void breakpoints_relocate (struct objfile *objfile, +extern void breakpoints_relocate (struct objfile *objfile,
+ struct section_offsets *delta); + struct section_offsets *delta);
+ +
#endif /* !defined (BREAKPOINT_H) */ #endif /* !defined (BREAKPOINT_H) */
Index: gdb-7.1.90.20100711/gdb/objfiles.c Index: gdb-7.2.50.20110206/gdb/objfiles.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/objfiles.c 2010-05-16 02:46:46.000000000 +0200 --- gdb-7.2.50.20110206.orig/gdb/objfiles.c 2011-01-10 21:38:49.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/objfiles.c 2010-07-13 00:37:19.000000000 +0200 +++ gdb-7.2.50.20110206/gdb/objfiles.c 2011-02-06 20:39:44.000000000 +0100
@@ -834,6 +834,11 @@ objfile_relocate1 (struct objfile *objfi @@ -846,6 +846,11 @@ objfile_relocate1 (struct objfile *objfi
obj_section_addr (s)); obj_section_addr (s));
} }

View File

@ -1,8 +1,8 @@
Index: gdb-7.1.90.20100711/gdb/dwarf2read.c Index: gdb-7.2.50.20110117/gdb/dwarf2read.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/dwarf2read.c 2010-07-13 00:26:25.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/dwarf2read.c 2011-01-17 15:56:23.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/dwarf2read.c 2010-07-13 00:34:00.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/dwarf2read.c 2011-01-17 16:00:14.000000000 +0100
@@ -5737,7 +5737,12 @@ read_common_block (struct die_info *die, @@ -7475,7 +7475,12 @@ read_common_block (struct die_info *die,
{ {
struct attribute *attr; struct attribute *attr;
struct symbol *sym; struct symbol *sym;
@ -16,7 +16,7 @@ Index: gdb-7.1.90.20100711/gdb/dwarf2read.c
attr = dwarf2_attr (die, DW_AT_location, cu); attr = dwarf2_attr (die, DW_AT_location, cu);
if (attr) if (attr)
@@ -5746,6 +5751,7 @@ read_common_block (struct die_info *die, @@ -7484,6 +7489,7 @@ read_common_block (struct die_info *die,
if (attr_form_is_block (attr)) if (attr_form_is_block (attr))
{ {
base = decode_locdesc (DW_BLOCK (attr), cu); base = decode_locdesc (DW_BLOCK (attr), cu);
@ -24,7 +24,7 @@ Index: gdb-7.1.90.20100711/gdb/dwarf2read.c
} }
else if (attr_form_is_section_offset (attr)) else if (attr_form_is_section_offset (attr))
{ {
@@ -5807,12 +5813,15 @@ read_common_block (struct die_info *die, @@ -7545,12 +7551,15 @@ read_common_block (struct die_info *die,
else else
dwarf2_complex_location_expr_complaint (); dwarf2_complex_location_expr_complaint ();
@ -42,7 +42,7 @@ Index: gdb-7.1.90.20100711/gdb/dwarf2read.c
else else
SET_FIELD_PHYSNAME (*field, SYMBOL_LINKAGE_NAME (sym)); SET_FIELD_PHYSNAME (*field, SYMBOL_LINKAGE_NAME (sym));
FIELD_TYPE (*field) = SYMBOL_TYPE (sym); FIELD_TYPE (*field) = SYMBOL_TYPE (sym);
@@ -5826,7 +5835,7 @@ read_common_block (struct die_info *die, @@ -7564,7 +7573,7 @@ read_common_block (struct die_info *die,
sym = new_symbol (die, type, cu); sym = new_symbol (die, type, cu);
/* SYMBOL_VALUE_ADDRESS never gets used as all its fields are static. */ /* SYMBOL_VALUE_ADDRESS never gets used as all its fields are static. */
@ -51,11 +51,11 @@ Index: gdb-7.1.90.20100711/gdb/dwarf2read.c
set_die_type (die, type, cu); set_die_type (die, type, cu);
} }
Index: gdb-7.1.90.20100711/gdb/gdbtypes.h Index: gdb-7.2.50.20110117/gdb/gdbtypes.h
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/gdbtypes.h 2010-07-12 23:07:34.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/gdbtypes.h 2011-01-17 15:51:03.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/gdbtypes.h 2010-07-13 00:34:00.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/gdbtypes.h 2011-01-17 16:00:32.000000000 +0100
@@ -395,6 +395,7 @@ enum type_instance_flag_value @@ -394,6 +394,7 @@ enum type_instance_flag_value
enum field_loc_kind enum field_loc_kind
{ {
FIELD_LOC_KIND_BITPOS, /* bitpos */ FIELD_LOC_KIND_BITPOS, /* bitpos */
@ -63,15 +63,15 @@ Index: gdb-7.1.90.20100711/gdb/gdbtypes.h
FIELD_LOC_KIND_PHYSADDR, /* physaddr */ FIELD_LOC_KIND_PHYSADDR, /* physaddr */
FIELD_LOC_KIND_PHYSNAME /* physname */ FIELD_LOC_KIND_PHYSNAME /* physname */
}; };
@@ -577,6 +578,7 @@ struct main_type @@ -576,6 +577,7 @@ struct main_type
is the location (in the target) of the static field. is the location (in the target) of the static field.
Otherwise, physname is the mangled label of the static field. */ Otherwise, physname is the mangled label of the static field. */
+ /* This address is unrelocated by the objfile's ANOFFSET. */ + /* This address is unrelocated by the objfile's ANOFFSET. */
CORE_ADDR physaddr; CORE_ADDR physaddr;
char *physname; char *physname;
} }
@@ -1073,6 +1075,7 @@ extern void allocate_gnat_aux_type (stru @@ -1102,6 +1104,7 @@ extern void allocate_gnat_aux_type (stru
#define FIELD_LOC_KIND(thisfld) ((thisfld).loc_kind) #define FIELD_LOC_KIND(thisfld) ((thisfld).loc_kind)
#define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos) #define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos)
#define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname) #define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname)
@ -79,7 +79,7 @@ Index: gdb-7.1.90.20100711/gdb/gdbtypes.h
#define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr) #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
#define SET_FIELD_BITPOS(thisfld, bitpos) \ #define SET_FIELD_BITPOS(thisfld, bitpos) \
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_BITPOS, \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_BITPOS, \
@@ -1080,6 +1083,7 @@ extern void allocate_gnat_aux_type (stru @@ -1109,6 +1112,7 @@ extern void allocate_gnat_aux_type (stru
#define SET_FIELD_PHYSNAME(thisfld, name) \ #define SET_FIELD_PHYSNAME(thisfld, name) \
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \
FIELD_STATIC_PHYSNAME (thisfld) = (name)) FIELD_STATIC_PHYSNAME (thisfld) = (name))
@ -87,7 +87,7 @@ Index: gdb-7.1.90.20100711/gdb/gdbtypes.h
#define SET_FIELD_PHYSADDR(thisfld, addr) \ #define SET_FIELD_PHYSADDR(thisfld, addr) \
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \
FIELD_STATIC_PHYSADDR (thisfld) = (addr)) FIELD_STATIC_PHYSADDR (thisfld) = (addr))
@@ -1092,6 +1096,7 @@ extern void allocate_gnat_aux_type (stru @@ -1121,6 +1125,7 @@ extern void allocate_gnat_aux_type (stru
#define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n))
@ -95,21 +95,21 @@ Index: gdb-7.1.90.20100711/gdb/gdbtypes.h
#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n))
#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n)) #define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
#define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n)) #define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n))
Index: gdb-7.1.90.20100711/gdb/jv-lang.c Index: gdb-7.2.50.20110117/gdb/jv-lang.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/jv-lang.c 2010-05-17 19:18:39.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/jv-lang.c 2011-01-09 04:08:57.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/jv-lang.c 2010-07-13 00:34:00.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/jv-lang.c 2011-01-17 16:00:59.000000000 +0100
@@ -409,7 +409,8 @@ java_link_class_type (struct gdbarch *gd @@ -414,7 +414,8 @@ java_link_class_type (struct gdbarch *gd
fields = NULL; fields = NULL;
nfields--; /* First set up dummy "class" field. */ nfields--; /* First set up dummy "class" field. */
- SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields), value_address (clas)); - SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields), value_address (clas));
+ SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields), value_address (clas) + SET_FIELD_PHYSADDR (TYPE_FIELD (type, nfields), value_address (clas)
+ - (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type))))); + - (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
TYPE_FIELD_NAME (type, nfields) = "class"; TYPE_FIELD_NAME (type, nfields) = "class";
TYPE_FIELD_TYPE (type, nfields) = value_type (clas); TYPE_FIELD_TYPE (type, nfields) = value_type (clas);
SET_TYPE_FIELD_PRIVATE (type, nfields); SET_TYPE_FIELD_PRIVATE (type, nfields);
@@ -457,7 +458,8 @@ java_link_class_type (struct gdbarch *gd @@ -462,7 +463,8 @@ java_link_class_type (struct gdbarch *gd
SET_TYPE_FIELD_PROTECTED (type, i); SET_TYPE_FIELD_PROTECTED (type, i);
} }
if (accflags & 0x0008) /* ACC_STATIC */ if (accflags & 0x0008) /* ACC_STATIC */
@ -119,11 +119,11 @@ Index: gdb-7.1.90.20100711/gdb/jv-lang.c
else else
TYPE_FIELD_BITPOS (type, i) = 8 * boffset; TYPE_FIELD_BITPOS (type, i) = 8 * boffset;
if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */ if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */
Index: gdb-7.1.90.20100711/gdb/value.c Index: gdb-7.2.50.20110117/gdb/value.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/value.c 2010-07-12 23:07:33.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/value.c 2011-01-17 15:47:37.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/value.c 2010-07-13 00:35:21.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/value.c 2011-01-17 16:00:14.000000000 +0100
@@ -1943,7 +1943,8 @@ value_static_field (struct type *type, i @@ -1997,7 +1997,8 @@ value_static_field (struct type *type, i
{ {
case FIELD_LOC_KIND_PHYSADDR: case FIELD_LOC_KIND_PHYSADDR:
retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno), retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno),
@ -133,13 +133,3 @@ Index: gdb-7.1.90.20100711/gdb/value.c
break; break;
case FIELD_LOC_KIND_PHYSNAME: case FIELD_LOC_KIND_PHYSNAME:
{ {
@@ -1977,7 +1978,8 @@ value_static_field (struct type *type, i
}
if (retval && VALUE_LVAL (retval) == lval_memory)
SET_FIELD_PHYSADDR (TYPE_FIELD (type, fieldno),
- value_address (retval));
+ value_address (retval)
+ - (TYPE_OBJFILE (type) == NULL ? 0 : ANOFFSET (TYPE_OBJFILE (type)->section_offsets, SECT_OFF_TEXT (TYPE_OBJFILE (type)))));
break;
}
default:

File diff suppressed because it is too large Load Diff

View File

@ -21,11 +21,13 @@ debugging problem of GOMP outside of the scope of this Bug.
--- ./gdb/infrun.c 2009-12-09 22:03:33.000000000 +0100 Index: gdb-7.2.50.20101231/gdb/infrun.c
+++ ./gdb/infrun.c 2009-12-09 22:29:56.000000000 +0100 ===================================================================
@@ -3994,6 +3994,12 @@ infrun: not switching back to stepped th --- gdb-7.2.50.20101231.orig/gdb/infrun.c 2011-01-01 01:02:45.000000000 +0100
+++ gdb-7.2.50.20101231/gdb/infrun.c 2011-01-01 01:10:22.000000000 +0100
@@ -4585,6 +4585,12 @@ infrun: not switching back to stepped th
if (ecs->event_thread->step_over_calls == STEP_OVER_ALL) if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL)
{ {
+ struct symbol *stop_fn = find_pc_function (stop_pc); + struct symbol *stop_fn = find_pc_function (stop_pc);
+ +
@ -36,7 +38,7 @@ debugging problem of GOMP outside of the scope of this Bug.
/* We're doing a "next". /* We're doing a "next".
Normal (forward) execution: set a breakpoint at the Normal (forward) execution: set a breakpoint at the
@@ -4020,6 +4026,7 @@ infrun: not switching back to stepped th @@ -4612,6 +4618,7 @@ infrun: not switching back to stepped th
keep_going (ecs); keep_going (ecs);
return; return;
@ -44,8 +46,10 @@ debugging problem of GOMP outside of the scope of this Bug.
} }
/* If we are in a function call trampoline (a stub between the /* If we are in a function call trampoline (a stub between the
--- ./gdb/testsuite/gdb.fortran/omp-step.exp 1970-01-01 01:00:00.000000000 +0100 Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.exp
+++ ./gdb/testsuite/gdb.fortran/omp-step.exp 2009-12-09 22:31:04.000000000 +0100 ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.exp 2011-01-01 01:09:58.000000000 +0100
@@ -0,0 +1,31 @@ @@ -0,0 +1,31 @@
+# Copyright 2009 Free Software Foundation, Inc. +# Copyright 2009 Free Software Foundation, Inc.
+ +
@ -78,8 +82,10 @@ debugging problem of GOMP outside of the scope of this Bug.
+ +
+gdb_breakpoint [gdb_get_line_number "success"] +gdb_breakpoint [gdb_get_line_number "success"]
+gdb_continue_to_breakpoint "success" ".*success.*" +gdb_continue_to_breakpoint "success" ".*success.*"
--- ./gdb/testsuite/gdb.fortran/omp-step.f90 1970-01-01 01:00:00.000000000 +0100 Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.f90
+++ ./gdb/testsuite/gdb.fortran/omp-step.f90 2009-12-09 22:25:35.000000000 +0100 ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.f90 2011-01-01 01:09:58.000000000 +0100
@@ -0,0 +1,32 @@ @@ -0,0 +1,32 @@
+! Copyright 2009 Free Software Foundation, Inc. +! Copyright 2009 Free Software Foundation, Inc.
+ +

View File

@ -1,7 +1,7 @@
Index: gdb-7.1.90.20100711/gdb/config/i386/linux64.mh Index: gdb-7.2.50.20110117/gdb/config/i386/linux64.mh
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/config/i386/linux64.mh 2010-05-28 20:50:31.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/config/i386/linux64.mh 2010-05-28 20:50:31.000000000 +0200
+++ gdb-7.1.90.20100711/gdb/config/i386/linux64.mh 2010-07-13 19:02:54.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/config/i386/linux64.mh 2011-01-17 16:01:48.000000000 +0100
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
NATDEPFILES= inf-ptrace.o fork-child.o \ NATDEPFILES= inf-ptrace.o fork-child.o \
i386-nat.o amd64-nat.o amd64-linux-nat.o linux-nat.o \ i386-nat.o amd64-nat.o amd64-linux-nat.o linux-nat.o \
@ -11,10 +11,10 @@ Index: gdb-7.1.90.20100711/gdb/config/i386/linux64.mh
NAT_CDEPS = $(srcdir)/proc-service.list NAT_CDEPS = $(srcdir)/proc-service.list
# The dynamically loaded libthread_db needs access to symbols in the # The dynamically loaded libthread_db needs access to symbols in the
Index: gdb-7.1.90.20100711/gdb/config/i386/nm-linux64.h Index: gdb-7.2.50.20110117/gdb/config/i386/nm-linux64.h
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.1.90.20100711/gdb/config/i386/nm-linux64.h 2010-07-13 19:02:28.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/config/i386/nm-linux64.h 2011-01-17 16:01:48.000000000 +0100
@@ -0,0 +1,28 @@ @@ -0,0 +1,28 @@
+/* Native support for GNU/Linux amd64. +/* Native support for GNU/Linux amd64.
+ +
@ -44,11 +44,11 @@ Index: gdb-7.1.90.20100711/gdb/config/i386/nm-linux64.h
+#define target_can_use_hardware_watchpoint(type, cnt, ot) 1 +#define target_can_use_hardware_watchpoint(type, cnt, ot) 1
+ +
+#endif /* NM_LINUX64_H */ +#endif /* NM_LINUX64_H */
Index: gdb-7.1.90.20100711/gdb/target.h Index: gdb-7.2.50.20110117/gdb/target.h
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/target.h 2010-07-12 23:07:34.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/target.h 2011-01-14 14:47:15.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/target.h 2010-07-13 19:02:28.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/target.h 2011-01-17 16:02:08.000000000 +0100
@@ -1298,8 +1298,10 @@ extern char *normal_pid_to_str (ptid_t p @@ -1318,8 +1318,10 @@ extern char *normal_pid_to_str (ptid_t p
bp_hardware_breakpoint. CNT is the number of such watchpoints used so far bp_hardware_breakpoint. CNT is the number of such watchpoints used so far
(including this one?). OTHERTYPE is who knows what... */ (including this one?). OTHERTYPE is who knows what... */
@ -57,12 +57,12 @@ Index: gdb-7.1.90.20100711/gdb/target.h
(*current_target.to_can_use_hw_breakpoint) (TYPE, CNT, OTHERTYPE); (*current_target.to_can_use_hw_breakpoint) (TYPE, CNT, OTHERTYPE);
+#endif +#endif
#define target_region_ok_for_hw_watchpoint(addr, len) \ /* Returns the number of debug registers needed to watch the given
(*current_target.to_region_ok_for_hw_watchpoint) (addr, len) memory region, or zero if not supported. */
Index: gdb-7.1.90.20100711/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.1.90.20100711/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2010-07-13 19:02:28.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2011-01-17 16:01:48.000000000 +0100
@@ -0,0 +1,40 @@ @@ -0,0 +1,40 @@
+# Copyright 2009, 2010 Free Software Foundation, Inc. +# Copyright 2009, 2010 Free Software Foundation, Inc.
+ +

View File

@ -1,12 +0,0 @@
--- a/gdb/gdb_gcore.sh
+++ b/gdb/gdb_gcore.sh
@@ -64,6 +64,9 @@ for pid in $*
do
# Write gdb script for pid $pid.
cat >>$tmpfile <<EOF
+set pagination off
+set width 0
+set height 0
attach $pid
gcore $name.$pid
detach

View File

@ -12,10 +12,10 @@
* gdb.python/pr10659.exp. New file. * gdb.python/pr10659.exp. New file.
* gdb.python/pr10659.py: New file. * gdb.python/pr10659.py: New file.
Index: gdb-7.1/gdb/valprint.h Index: gdb-7.2.50.20110206/gdb/valprint.h
=================================================================== ===================================================================
--- gdb-7.1.orig/gdb/valprint.h 2010-06-30 14:02:16.000000000 +0200 --- gdb-7.2.50.20110206.orig/gdb/valprint.h 2011-01-25 18:59:00.000000000 +0100
+++ gdb-7.1/gdb/valprint.h 2010-06-30 14:35:24.000000000 +0200 +++ gdb-7.2.50.20110206/gdb/valprint.h 2011-02-06 20:55:59.000000000 +0100
@@ -90,6 +90,9 @@ struct value_print_options @@ -90,6 +90,9 @@ struct value_print_options
/* If nonzero, print the value in "summary" form. */ /* If nonzero, print the value in "summary" form. */
@ -26,21 +26,20 @@ Index: gdb-7.1/gdb/valprint.h
}; };
/* The global print options set by the user. In general this should /* The global print options set by the user. In general this should
Index: gdb-7.1/gdb/python/py-prettyprint.c Index: gdb-7.2.50.20110206/gdb/python/py-prettyprint.c
=================================================================== ===================================================================
--- gdb-7.1.orig/gdb/python/py-prettyprint.c 2010-06-30 14:01:40.000000000 +0200 --- gdb-7.2.50.20110206.orig/gdb/python/py-prettyprint.c 2011-01-26 21:58:48.000000000 +0100
+++ gdb-7.1/gdb/python/py-prettyprint.c 2010-06-30 14:34:49.000000000 +0200 +++ gdb-7.2.50.20110206/gdb/python/py-prettyprint.c 2011-02-06 20:56:30.000000000 +0100
@@ -385,7 +385,8 @@ print_children (PyObject *printer, const @@ -501,7 +501,7 @@ print_children (PyObject *printer, const
/* Use the prettyprint_arrays option if we are printing an array, /* Use the prettyprint_arrays option if we are printing an array,
and the pretty option otherwise. */ and the pretty option otherwise. */
- pretty = is_array ? options->prettyprint_arrays : options->pretty; - if (is_array)
+ pretty = (is_array || options->prettyprint_matrix) ? + if (is_array || options->prettyprint_matrix)
+ options->prettyprint_arrays : options->pretty; pretty = options->prettyprint_arrays;
else
/* Manufacture a dummy Python frame to work around Python 2.4 bug, {
where it insists on having a non-NULL tstate->frame when @@ -521,6 +521,9 @@ print_children (PyObject *printer, const
@@ -397,6 +398,9 @@ print_children (PyObject *printer, const
goto done; goto done;
} }
make_cleanup_py_decref (frame); make_cleanup_py_decref (frame);
@ -50,7 +49,7 @@ Index: gdb-7.1/gdb/python/py-prettyprint.c
done_flag = 0; done_flag = 0;
for (i = 0; i < options->print_max; ++i) for (i = 0; i < options->print_max; ++i)
@@ -431,12 +435,23 @@ print_children (PyObject *printer, const @@ -555,12 +558,23 @@ print_children (PyObject *printer, const
3. Other. Always print a ",". */ 3. Other. Always print a ",". */
if (i == 0) if (i == 0)
{ {
@ -79,7 +78,7 @@ Index: gdb-7.1/gdb/python/py-prettyprint.c
else if (! is_map || i % 2 == 0) else if (! is_map || i % 2 == 0)
fputs_filtered (pretty ? "," : ", ", stream); fputs_filtered (pretty ? "," : ", ", stream);
@@ -465,6 +480,10 @@ print_children (PyObject *printer, const @@ -589,6 +603,10 @@ print_children (PyObject *printer, const
if (is_map && i % 2 == 0) if (is_map && i % 2 == 0)
fputs_filtered ("[", stream); fputs_filtered ("[", stream);
@ -90,7 +89,7 @@ Index: gdb-7.1/gdb/python/py-prettyprint.c
else if (is_array) else if (is_array)
{ {
/* We print the index, not whatever the child method /* We print the index, not whatever the child method
@@ -539,7 +558,12 @@ print_children (PyObject *printer, const @@ -667,7 +685,12 @@ print_children (PyObject *printer, const
fputs_filtered ("\n", stream); fputs_filtered ("\n", stream);
print_spaces_filtered (2 * recurse, stream); print_spaces_filtered (2 * recurse, stream);
} }
@ -104,15 +103,15 @@ Index: gdb-7.1/gdb/python/py-prettyprint.c
} }
done: done:
@@ -561,6 +585,7 @@ apply_val_pretty_printer (struct type *t @@ -690,6 +713,7 @@ apply_val_pretty_printer (struct type *t
struct cleanup *cleanups; struct cleanup *cleanups;
int result = 0; int result = 0;
int is_py_none = 0; enum string_repr_result print_result;
+ struct value_print_options *options_copy; + struct value_print_options *options_copy;
cleanups = ensure_python_env (gdbarch, language); cleanups = ensure_python_env (gdbarch, language);
/* Instantiate the printer. */ /* Instantiate the printer. */
@@ -582,12 +607,23 @@ apply_val_pretty_printer (struct type *t @@ -721,9 +745,21 @@ apply_val_pretty_printer (struct type *t
/* If we are printing a map, we want some special formatting. */ /* If we are printing a map, we want some special formatting. */
hint = gdbpy_get_display_hint (printer); hint = gdbpy_get_display_hint (printer);
@ -128,21 +127,16 @@ Index: gdb-7.1/gdb/python/py-prettyprint.c
make_cleanup (free_current_contents, &hint); make_cleanup (free_current_contents, &hint);
/* Print the section */ /* Print the section */
- is_py_none = print_string_repr (printer, hint, stream, recurse, + if (options_copy->prettyprint_matrix)
- options, language, gdbarch); + print_result = string_repr_none;
- print_children (printer, hint, stream, recurse, options, language, +else /* Red Hat 2D matrix patch */
+ is_py_none = options_copy->prettyprint_matrix ? print_result = print_string_repr (printer, hint, stream, recurse,
+ 1 : print_string_repr (printer, hint, stream, options, language, gdbarch);
+ recurse, options_copy, if (print_result != string_repr_error)
+ language, gdbarch); Index: gdb-7.2.50.20110206/gdb/testsuite/gdb.python/pr10659.cc
+ print_children (printer, hint, stream, recurse, options_copy, language,
is_py_none);
result = 1;
Index: gdb-7.1/gdb/testsuite/gdb.python/pr10659.cc
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.1/gdb/testsuite/gdb.python/pr10659.cc 2010-06-30 14:34:49.000000000 +0200 +++ gdb-7.2.50.20110206/gdb/testsuite/gdb.python/pr10659.cc 2011-02-06 20:55:59.000000000 +0100
@@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
+#include <list> +#include <list>
+#include <vector> // /usr/include/c++/4.4.1/bits/vector.tcc +#include <vector> // /usr/include/c++/4.4.1/bits/vector.tcc
@ -187,10 +181,10 @@ Index: gdb-7.1/gdb/testsuite/gdb.python/pr10659.cc
+ +
+ return 0; // break + return 0; // break
+} +}
Index: gdb-7.1/gdb/testsuite/gdb.python/pr10659.exp Index: gdb-7.2.50.20110206/gdb/testsuite/gdb.python/pr10659.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.1/gdb/testsuite/gdb.python/pr10659.exp 2010-06-30 14:34:49.000000000 +0200 +++ gdb-7.2.50.20110206/gdb/testsuite/gdb.python/pr10659.exp 2011-02-06 20:55:59.000000000 +0100
@@ -0,0 +1,82 @@ @@ -0,0 +1,82 @@
+#Copyright 2010 Free Software Foundation, Inc. +#Copyright 2010 Free Software Foundation, Inc.
+ +
@ -274,10 +268,10 @@ Index: gdb-7.1/gdb/testsuite/gdb.python/pr10659.exp
+# +#
+ +
+ +
Index: gdb-7.1/gdb/testsuite/gdb.python/pr10659.py Index: gdb-7.2.50.20110206/gdb/testsuite/gdb.python/pr10659.py
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.1/gdb/testsuite/gdb.python/pr10659.py 2010-06-30 14:34:49.000000000 +0200 +++ gdb-7.2.50.20110206/gdb/testsuite/gdb.python/pr10659.py 2011-02-06 20:55:59.000000000 +0100
@@ -0,0 +1,109 @@ @@ -0,0 +1,109 @@
+# Copyright (C) 2008, 2009 Free Software Foundation, Inc. +# Copyright (C) 2008, 2009 Free Software Foundation, Inc.
+ +
@ -388,11 +382,11 @@ Index: gdb-7.1/gdb/testsuite/gdb.python/pr10659.py
+fake_pretty_printers_dict = {} +fake_pretty_printers_dict = {}
+ +
+build_libfakecxx_dictionary () +build_libfakecxx_dictionary ()
Index: gdb-7.1/gdb/valprint.c Index: gdb-7.2.50.20110206/gdb/valprint.c
=================================================================== ===================================================================
--- gdb-7.1.orig/gdb/valprint.c 2010-06-30 13:51:26.000000000 +0200 --- gdb-7.2.50.20110206.orig/gdb/valprint.c 2011-02-06 20:55:52.000000000 +0100
+++ gdb-7.1/gdb/valprint.c 2010-06-30 14:35:41.000000000 +0200 +++ gdb-7.2.50.20110206/gdb/valprint.c 2011-02-06 20:55:59.000000000 +0100
@@ -83,7 +83,8 @@ struct value_print_options user_print_op @@ -85,7 +85,8 @@ struct value_print_options user_print_op
1, /* static_field_print */ 1, /* static_field_print */
1, /* pascal_static_field_print */ 1, /* pascal_static_field_print */
0, /* raw */ 0, /* raw */

View File

@ -1,630 +0,0 @@
Made more safe (but less effective) by using a linked list.
Based on:
Re: [RFA] Delayed physname computation
http://sourceware.org/ml/gdb-patches/2010-05/msg00248.html
Neither its obstack-leak.patch nor
[patch] Fix duplicate types for single DIE
http://sourceware.org/ml/gdb-patches/2010-05/msg00271.html
is needed as the linked list is used instead.
Index: gdb-7.1.90.20100721/gdb/dwarf2read.c
===================================================================
--- gdb-7.1.90.20100721.orig/gdb/dwarf2read.c 2010-07-22 11:59:19.000000000 +0200
+++ gdb-7.1.90.20100721/gdb/dwarf2read.c 2010-07-22 12:00:08.000000000 +0200
@@ -253,6 +253,28 @@ struct comp_unit_head
unsigned int first_die_offset;
};
+/* Type used for delaying computation of method physnames.
+ See comments for compute_delayed_physnames. */
+struct delayed_method_info
+{
+ struct delayed_method_info *next;
+
+ /* The type to which the method is attached, i.e., its parent class. */
+ struct type *type;
+
+ /* The index of the method in the type's function fieldlists. */
+ int fnfield_index;
+
+ /* The index of the method in the fieldlist. */
+ int index;
+
+ /* The name of the DIE. */
+ const char *name;
+
+ /* The DIE associated with this method. */
+ struct die_info *die;
+};
+
/* Internal state when decoding a particular compilation unit. */
struct dwarf2_cu
{
@@ -331,6 +353,10 @@ struct dwarf2_cu
/* Header data from the line table, during full symbol processing. */
struct line_header *line_header;
+ /* A list of methods which need to have physnames computed
+ after all type information has been read. */
+ struct delayed_method_info *method_list;
+
/* Mark used when releasing cached dies. */
unsigned int mark : 1;
@@ -1239,6 +1265,9 @@ static gdb_byte *partial_read_comp_unit_
static void init_cu_die_reader (struct die_reader_specs *reader,
struct dwarf2_cu *cu);
+static const char *dwarf2_physname (char *name, struct die_info *die,
+ struct dwarf2_cu *cu);
+
#if WORDS_BIGENDIAN
/* Convert VALUE between big- and little-endian. */
@@ -4103,6 +4132,58 @@ load_full_comp_unit (struct dwarf2_per_c
discard_cleanups (free_cu_cleanup);
}
+/* Add a DIE to the delayed physname list. */
+static void
+add_to_method_list (struct type *type, int fnfield_index, int index,
+ const char *name, struct die_info *die,
+ struct dwarf2_cu *cu)
+{
+ struct delayed_method_info *mi;
+
+ mi = xmalloc (sizeof (*mi));
+ mi->next = cu->method_list;
+ cu->method_list = mi;
+ mi->type = type;
+ mi->fnfield_index = fnfield_index;
+ mi->index = index;
+ mi->name = name;
+ mi->die = die;
+}
+
+/* Compute the physnames of any methods on the CU's method list.
+
+ The computation of method physnames is delayed in order to avoid the
+ (bad) condition that one of the method's formal parameters is of an as yet
+ incomplete type. */
+static void
+compute_delayed_physnames (struct dwarf2_cu *cu)
+{
+ struct delayed_method_info *mi;
+
+ for (mi = cu->method_list; mi; mi = mi->next)
+ {
+ char *physname;
+ struct fn_fieldlist *fn_flp
+ = &TYPE_FN_FIELDLIST (mi->type, mi->fnfield_index);
+ physname = (char *) dwarf2_physname ((char *) mi->name, mi->die, cu);
+ fn_flp->fn_fields[mi->index].physname = physname ? physname : "";
+ }
+}
+
+static void
+method_list_cleanup (void *arg)
+{
+ struct delayed_method_info **method_list_pointer = arg;
+
+ while (*method_list_pointer)
+ {
+ struct delayed_method_info *mi = *method_list_pointer;
+
+ *method_list_pointer = mi->next;
+ xfree (mi);
+ }
+}
+
/* Generate full symbol information for PST and CU, whose DIEs have
already been loaded into memory. */
@@ -4113,7 +4194,7 @@ process_full_comp_unit (struct dwarf2_pe
struct objfile *objfile = per_cu->objfile;
CORE_ADDR lowpc, highpc;
struct symtab *symtab;
- struct cleanup *back_to;
+ struct cleanup *back_to, *delayed_list_cleanup;
CORE_ADDR baseaddr;
baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
@@ -4123,11 +4204,22 @@ process_full_comp_unit (struct dwarf2_pe
cu->list_in_scope = &file_symbols;
+ /* If methods were found in the partial symbol table, we allocate one
+ big buffer to hold the entire delayed list for the CU. */
+ delayed_list_cleanup = make_cleanup (method_list_cleanup,
+ &cu->method_list);
+
dwarf2_find_base_address (cu->dies, cu);
/* Do line number decoding in read_file_scope () */
process_die (cu->dies, cu);
+ /* Now that we have processed all the DIEs in the CU, all the types
+ should be complete, and it should now be safe to compute all of the
+ physnames. */
+ compute_delayed_physnames (cu);
+ do_cleanups (delayed_list_cleanup);
+
/* Some compilers don't define a DW_AT_high_pc attribute for the
compilation unit. If the DW_AT_high_pc is missing, synthesize
it, by scanning the DIE's below the compilation unit. */
@@ -5838,7 +5930,6 @@ dwarf2_add_member_fn (struct field_info
int i;
struct fn_field *fnp;
char *fieldname;
- char *physname;
struct nextfnfield *new_fnfield;
struct type *this_type;
@@ -5850,9 +5941,6 @@ dwarf2_add_member_fn (struct field_info
if (fieldname == NULL)
return;
- /* Get the mangled name. */
- physname = (char *) dwarf2_physname (fieldname, die, cu);
-
/* Look up member function name in fieldlist. */
for (i = 0; i < fip->nfnfields; i++)
{
@@ -5878,7 +5966,7 @@ dwarf2_add_member_fn (struct field_info
flp->name = fieldname;
flp->length = 0;
flp->head = NULL;
- fip->nfnfields++;
+ i = fip->nfnfields++;
}
/* Create a new member function field and chain it to the field list
@@ -5892,9 +5980,19 @@ dwarf2_add_member_fn (struct field_info
/* Fill in the member function field info. */
fnp = &new_fnfield->fnfield;
- /* The name is already allocated along with this objfile, so we don't
- need to duplicate it for the type. */
- fnp->physname = physname ? physname : "";
+
+ /* Delay processing of the physname until later. */
+ if (cu->language == language_cplus || cu->language == language_java)
+ {
+ add_to_method_list (type, i, flp->length - 1, fieldname,
+ die, cu);
+ }
+ else
+ {
+ char *physname = (char *) dwarf2_physname (fieldname, die, cu);
+ fnp->physname = physname ? physname : "";
+ }
+
fnp->type = alloc_type (objfile);
this_type = read_type_die (die, cu);
if (this_type && TYPE_CODE (this_type) == TYPE_CODE_FUNC)
@@ -5920,7 +6018,7 @@ dwarf2_add_member_fn (struct field_info
}
else
complaint (&symfile_complaints, _("member function type missing for '%s'"),
- physname);
+ dwarf2_full_name (fieldname, die, cu));
/* Get fcontext from DW_AT_containing_type if present. */
if (dwarf2_attr (die, DW_AT_containing_type, cu) != NULL)
@@ -8299,7 +8397,9 @@ load_partial_dies (bfd *abfd, gdb_byte *
|| last_die->tag == DW_TAG_interface_type
|| last_die->tag == DW_TAG_structure_type
|| last_die->tag == DW_TAG_union_type))
- || (cu->language == language_ada
+ || ((cu->language == language_ada
+ || cu->language == language_cplus
+ || cu->language == language_java)
&& (last_die->tag == DW_TAG_subprogram
|| last_die->tag == DW_TAG_lexical_block))))
{
Index: gdb-7.1.90.20100721/gdb/testsuite/gdb.dwarf2/pr11465.S
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.1.90.20100721/gdb/testsuite/gdb.dwarf2/pr11465.S 2010-07-22 11:59:29.000000000 +0200
@@ -0,0 +1,355 @@
+/* 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/>. */
+
+/* Compiled from:
+
+ namespace N
+ {
+ class C
+ {
+ public:
+ typedef void (*t) (C);
+ C (t) {}
+ };
+ typedef C::t u;
+ u f;
+ C c (f);
+ };
+
+ int
+ main ()
+ {
+ return 0;
+ }
+*/
+
+ .text
+_ZN1N1cE:
+ .section .debug_info
+d:
+ .long .Ldebug_info_end - 1f /* Length of CU info */
+1:
+ .2byte 0x2 /* DWARF version number */
+ .long .Ldebug_abbrev0 /* Abbrev offset */
+ .byte 0x4 /* Pointer size */
+dieb: .uleb128 0x1 /* DW_TAG_compile_unit */
+ .long .LASF4 /* DW_AT_producer */
+ .byte 0x4 /* DW_AT_language */
+ .long .LASF5 /* DW_AT_name */
+ .long .LASF6 /* DW_AT_comp_dir */
+ .long 0x0 /* DW_AT_low_pc */
+ .long 0x0 /* DW_AT_high_pc */
+ .long 0x0 /* DW_AT_entry_pc */
+die29: .uleb128 0x2 /* DW_TAG_namespace */
+ .string "N" /* DW_AT_name */
+die32: .uleb128 0x3 /* DW_TAG_class_type */
+ .string "C" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_declaration */
+die36: .uleb128 0x4 /* DW_TAG_typedef */
+ .string "u" /* DW_AT_name */
+ .long die7e-d /* DW_AT_type */
+die3f: .uleb128 0x5 /* DW_TAG_variable */
+ .string "f" /* DW_AT_name */
+ .long .LASF0 /* DW_AT_MIPS_linkage_name */
+ .long die36-d /* DW_AT_type */
+ .byte 0x1 /* DW_AT_external */
+ .byte 0x1 /* DW_AT_declaration */
+die4e: .uleb128 0x5 /* DW_TAG_variable */
+ .string "c" /* DW_AT_name */
+ .long .LASF1 /* DW_AT_MIPS_linkage_name */
+ .long die5e-d /* DW_AT_type */
+ .byte 0x1 /* DW_AT_external */
+ .byte 0x1 /* DW_AT_declaration */
+ .byte 0x0
+die5e: .uleb128 0x6 /* DW_TAG_class_type */
+ .long die32-d /* DW_AT_specification */
+ .byte 0x1 /* DW_AT_byte_size */
+die6a: .uleb128 0x7 /* DW_TAG_subprogram */
+ .byte 0x1 /* DW_AT_external */
+ .string "C" /* DW_AT_name */
+ .byte 0x1 /* DW_AT_declaration */
+die71: .uleb128 0x8 /* DW_TAG_formal_parameter */
+ .long die8f-d /* DW_AT_type */
+ .byte 0x1 /* DW_AT_artificial */
+die77: .uleb128 0x9 /* DW_TAG_formal_parameter */
+ .long die7e-d /* DW_AT_type */
+ .byte 0x0
+ .byte 0x0
+die7e: .uleb128 0xa /* DW_TAG_pointer_type */
+ .byte 0x4 /* DW_AT_byte_size */
+ .long die84-d /* DW_AT_type */
+die84: .uleb128 0xb /* DW_TAG_subroutine_type */
+die89: .uleb128 0x9 /* DW_TAG_formal_parameter */
+ .long die5e-d /* DW_AT_type */
+ .byte 0x0
+die8f: .uleb128 0xa /* DW_TAG_pointer_type */
+ .byte 0x4 /* DW_AT_byte_size */
+ .long die5e-d /* DW_AT_type */
+die95: .uleb128 0xc /* DW_TAG_subprogram */
+ .long die6a-d /* DW_AT_specification */
+ .byte 0x2 /* DW_AT_inline */
+die9f: .uleb128 0xd /* DW_TAG_formal_parameter */
+ .long .LASF7 /* DW_AT_name */
+ .long dieaf-d /* DW_AT_type */
+ .byte 0x1 /* DW_AT_artificial */
+diea9: .uleb128 0x9 /* DW_TAG_formal_parameter */
+ .long die7e-d /* DW_AT_type */
+ .byte 0x0
+dieaf: .uleb128 0xe /* DW_TAG_const_type */
+ .long die8f-d /* DW_AT_type */
+dieb4: .uleb128 0xf /* DW_TAG_subprogram */
+ .long die95-d /* DW_AT_abstract_origin */
+ .long _ZN1N1cE /* DW_AT_low_pc */
+ .long _ZN1N1cE /* DW_AT_high_pc */
+diec9: .uleb128 0x10 /* DW_TAG_subprogram */
+ .long die9f-d /* DW_AT_abstract_origin */
+ .byte 2f-1f /* DW_AT_location */
+1:
+ .byte 0x50 /* DW_OP_reg0 */
+2:
+died1: .uleb128 0x10 /* DW_TAG_formal_parameter */
+ .long diea9-d /* DW_AT_abstract_origin */
+ .byte 2f-1f /* DW_AT_location */
+1:
+ .byte 0x51 /* DW_OP_reg1 */
+2:
+ .byte 0x0
+dieda: .uleb128 0x11 /* DW_TAG_subprogram */
+ .byte 0x1 /* DW_AT_external */
+ .long .LASF8 /* DW_AT_name */
+ .long dief2-d /* DW_AT_type */
+ .long _ZN1N1cE /* DW_AT_low_pc */
+ .long _ZN1N1cE /* DW_AT_high_pc */
+dief2: .uleb128 0x12 /* DW_TAG_base_type */
+ .byte 0x4 /* DW_AT_byte_size */
+ .byte 0x5 /* DW_AT_encoding */
+ .string "int" /* DW_AT_name */
+die149: .uleb128 0x16 /* DW_TAG_variable */
+ .long die4e-d /* DW_AT_specification */
+ .byte 0x5 /* DW_AT_location */
+ .byte 0x3
+ .long _ZN1N1cE
+ .byte 0x0
+.Ldebug_info_end:
+ .section .debug_abbrev
+.Ldebug_abbrev0:
+ .uleb128 0x1 /* abbrev code*/
+ .uleb128 0x11 /* DW_TAG_compile_unit */
+ .byte 0x1 /* DW_children_yes */
+ .uleb128 0x25 /* DW_AT_producer*/
+ .uleb128 0xe /* DW_FORM_strp */
+ .uleb128 0x13 /* DW_AT_language */
+ .uleb128 0xb /* DW_FORM_data1 */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0xe /* DW_FORM_strp */
+ .uleb128 0x1b /* DW_AT_comp_dir */
+ .uleb128 0xe /* DW_FORM_strp */
+ .uleb128 0x11 /* DW_AT_low_pc */
+ .uleb128 0x1 /* DW_FORM_addr */
+ .uleb128 0x12 /* DW_AT_high_pc */
+ .uleb128 0x1 /* DW_FORM_addr */
+ .uleb128 0x52 /* DW_AT_entry_pc */
+ .uleb128 0x1 /* DW_FORM_addr */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x2 /* abbrev code */
+ .uleb128 0x39 /* DW_TAG_namespace */
+ .byte 0x1 /* DW_children_yes */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x3 /* abbrev code */
+ .uleb128 0x2 /* DW_TAG_class_type */
+ .byte 0x0 /* DW_has_children_no */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0x3c /* DW_AT_declaration */
+ .uleb128 0xc /* DW_FORM_flag */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x4 /* abbrev code */
+ .uleb128 0x16 /* DW_TAG_typedef */
+ .byte 0x0 /* DW_has_children_no */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0x49 /* DW_AT_type */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x5 /* abbrev code */
+ .uleb128 0x34 /* DW_TAG_variable */
+ .byte 0x0 /* DW_has_children_no */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0x2007 /* DW_AT_MIPS_linkage_name */
+ .uleb128 0xe /* DW_FORM_strp */
+ .uleb128 0x49 /* DW_AT_TYPE */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .uleb128 0x3f /* DW_AT_external */
+ .uleb128 0xc /* DW_FORM_flag */
+ .uleb128 0x3c /* DW_AT_declaration */
+ .uleb128 0xc /* DW_FORM_flag */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x6 /* abbrev code */
+ .uleb128 0x2 /* DW_TAG_class_type */
+ .byte 0x1 /* DW_has_children_yes */
+ .uleb128 0x47 /* DW_AT_specification */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .uleb128 0xb /* DW_AT_byte_size */
+ .uleb128 0xb /* DW_FORM_data1 */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x7 /* abbrev code */
+ .uleb128 0x2e /* DW_TAG_subprogra */
+ .byte 0x1 /* DW_has_children_yes */
+ .uleb128 0x3f /* DW_AT_external */
+ .uleb128 0xc /* DW_FORM_flag */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0x3c /* DW_AT_declaration */
+ .uleb128 0xc /* DW_FORM_flag */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x8 /* abbrev code */
+ .uleb128 0x5 /* DW_TAG_formal_parameter */
+ .byte 0x0 /* DW_has_children_no */
+ .uleb128 0x49 /* DW_AT_type */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .uleb128 0x34 /* DW_AT_artificial */
+ .uleb128 0xc /* DW_FORM_flag */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x9 /* abbrev code */
+ .uleb128 0x5 /* DW_TAG_formal_parameter */
+ .byte 0x0 /* DW_has_children_no */
+ .uleb128 0x49 /* DW_AT_type */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0xa /* abbrev code */
+ .uleb128 0xf /* DW_TAG_pointer_type */
+ .byte 0x0 /* DW_has_children_no */
+ .uleb128 0xb /* DW_AT_byte_size */
+ .uleb128 0xb /* DW_FORM_data1 */
+ .uleb128 0x49 /* DW_AT_type */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0xb /* abbrev code */
+ .uleb128 0x15 /* DW_TAG_subroutine_type */
+ .byte 0x1 /* DW_has_children_yes */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0xc /* abbrev code */
+ .uleb128 0x2e /* DW_TAG_subprogram */
+ .byte 0x1 /* DW_has_children_yes */
+ .uleb128 0x47 /* DW_AT_specification */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .uleb128 0x20 /* DW_AT_inline */
+ .uleb128 0xb /* DW_FORM_data1 */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0xd /* abbrev code */
+ .uleb128 0x5 /* DW_TAG_formal_parameter */
+ .byte 0x0 /* DW_has_children_no */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0xe /* DW_FORM_strp */
+ .uleb128 0x49 /* DW_AT_type */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .uleb128 0x34 /* DW_AT_artificial */
+ .uleb128 0xc /* DW_FORM_flag */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0xe /* abbrev code */
+ .uleb128 0x26 /* DW_TAG_const_type */
+ .byte 0x0 /* DW_has_children_no */
+ .uleb128 0x49 /* DW_AT_type */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0xf /* abbrev code */
+ .uleb128 0x2e /* DW_TAG_subprogram */
+ .byte 0x1 /* DW_has_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 */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x10 /* abbrev code */
+ .uleb128 0x5 /* DW_TAG_formal_parameter */
+ .byte 0x0 /* DW_has_children_no */
+ .uleb128 0x31 /* DW_AT_abstract_origin */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .uleb128 0x2 /* DW_AT_location */
+ .uleb128 0xa /* DW_FORM_block1 */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x11 /* abbrev code */
+ .uleb128 0x2e /* DW_TAG_subprogram */
+ .byte 0x0 /* DW_has_children_no */
+ .uleb128 0x3f /* DW_AT_external */
+ .uleb128 0xc /* DW_FORM_flag */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0xe /* DW_FORM_strp */
+ .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 */
+ .byte 0x0
+ .byte 0x0
+ .uleb128 0x12 /* abbrev code */
+ .uleb128 0x24 /* DW_TAG_base_type */
+ .byte 0x0 /* DW_has_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 0x0
+ .byte 0x0
+ .uleb128 0x16 /* abbrev code */
+ .uleb128 0x34 /* DW_TAG_variable */
+ .byte 0x0 /* DW_has_children_no */
+ .uleb128 0x47 /* DW_AT_specification */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .uleb128 0x2 /* DW_AT_location */
+ .uleb128 0xa /* DW_FORM_block1 */
+ .byte 0x0
+ .byte 0x0
+ .byte 0x0
+ .section .debug_str
+.LASF0:
+ .string "_ZN1N1fE"
+.LASF7:
+ .string "this"
+.LASF6:
+ .string ""
+.LASF8:
+ .string "main"
+.LASF1:
+ .string "_ZN1N1cE"
+.LASF5:
+ .string "pr11465.cc"
+.LASF4:
+ .string "GNU C++ 4.4.2"
+ .ident "GCC: (GNU) 4.4.2"
Index: gdb-7.1.90.20100721/gdb/testsuite/gdb.dwarf2/pr11465.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.1.90.20100721/gdb/testsuite/gdb.dwarf2/pr11465.exp 2010-07-22 11:59:29.000000000 +0200
@@ -0,0 +1,39 @@
+# 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/>.
+
+# This test can only be run on targets which support DWARF-2 and use gas.
+# For now pick a sampling of likely targets.
+if {![istarget *-*-linux*]
+ && ![istarget *-*-gnu*]
+ && ![istarget *-*-elf*]
+ && ![istarget *-*-openbsd*]
+ && ![istarget arm-*-eabi*]
+ && ![istarget powerpc-*-eabi*]} {
+ return 0
+}
+
+set testfile "pr11465"
+set srcfile ${testfile}.S
+set executable ${testfile}.x
+set binfile ${objdir}/${subdir}/${executable}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } {
+ return -1
+}
+
+clean_restart $executable
+
+# Test delayed physname computations
+gdb_test "p N::c.C" { = {void \(N::C \*, void \(\*\)\(N::C\)\)}.*}

View File

@ -0,0 +1,992 @@
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.2.50.20110117/gdb/linux-nat.c
===================================================================
--- gdb-7.2.50.20110117.orig/gdb/linux-nat.c 2011-01-17 15:53:14.000000000 +0100
+++ gdb-7.2.50.20110117/gdb/linux-nat.c 2011-01-17 16:05:57.000000000 +0100
@@ -2803,6 +2803,8 @@ stop_wait_callback (struct lwp_info *lp,
{
int status;
+ gdb_assert (lp->resumed);
+
status = wait_lwp (lp);
if (status == 0)
return 0;
@@ -2828,110 +2830,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 trap's siginfo in case we need it later. */
+ save_siginfo (lp);
- /* 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_sigtrap (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");
-
- /* 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, TARGET_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;
}
}
@@ -3514,52 +3467,6 @@ retry:
lp = NULL;
}
- if (lp && lp->signalled)
- {
- /* 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 ();
- linux_ops->to_resume (linux_ops, pid_to_ptid (GET_LWP (lp->ptid)),
- lp->step, TARGET_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.2.50.20110117/gdb/testsuite/gdb.threads/siginfo-threads.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/siginfo-threads.c 2011-01-17 16:02:40.000000000 +0100
@@ -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.2.50.20110117/gdb/testsuite/gdb.threads/siginfo-threads.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/siginfo-threads.exp 2011-01-17 16:02:40.000000000 +0100
@@ -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.2.50.20110117/gdb/testsuite/gdb.threads/sigstep-threads.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/sigstep-threads.c 2011-01-17 16:02:40.000000000 +0100
@@ -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.2.50.20110117/gdb/testsuite/gdb.threads/sigstep-threads.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.threads/sigstep-threads.exp 2011-01-17 16:02:40.000000000 +0100
@@ -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

@ -0,0 +1,141 @@
http://sourceware.org/ml/gdb-patches/2010-09/msg00361.html
Subject: [patch 4/4]#3 Remove redundant lp->siginfo
Hi,
this is a simplification which should not affect GDB behavior. As linux-nat
now stops on each received signal without any reordering of them then
PTRACE_GETSIGINFO is enough to access siginfo, without any need to copy it in
advance.
Thanks,
Jan
gdb/
2010-09-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* linux-nat.c (resume_callback) <lp->stopped && lp->status == 0>
(linux_nat_resume): Remove LP->SIGINFO clearing.
(save_siginfo): Remove.
(stop_wait_callback) <WSTOPSIG (status) != SIGSTOP>
(linux_nat_filter_event) <linux_nat_status_is_event (status)>: Remove
the save_siginfo call.
(resume_stopped_resumed_lwps): Remove LP->SIGINFO clearing.
(linux_nat_set_siginfo_fixup): Use PTRACE_GETSIGINFO.
* linux-nat.h (struct lwp_info) <siginfo>: Remove.
Index: gdb-7.2.50.20101116/gdb/linux-nat.c
===================================================================
--- gdb-7.2.50.20101116.orig/gdb/linux-nat.c 2010-11-16 09:12:26.000000000 +0100
+++ gdb-7.2.50.20101116/gdb/linux-nat.c 2010-11-16 09:13:21.000000000 +0100
@@ -1850,7 +1850,6 @@ resume_callback (struct lwp_info *lp, vo
target_pid_to_str (lp->ptid));
lp->stopped = 0;
lp->step = 0;
- memset (&lp->siginfo, 0, sizeof (lp->siginfo));
lp->stopped_by_watchpoint = 0;
}
else if (lp->stopped && debug_linux_nat)
@@ -1993,7 +1992,6 @@ linux_nat_resume (struct target_ops *ops
ptid = pid_to_ptid (GET_LWP (lp->ptid));
linux_ops->to_resume (linux_ops, ptid, step, signo);
- memset (&lp->siginfo, 0, sizeof (lp->siginfo));
lp->stopped_by_watchpoint = 0;
if (debug_linux_nat)
@@ -2503,22 +2501,6 @@ wait_lwp (struct lwp_info *lp)
return status;
}
-/* Save the most recent siginfo for LP. This is currently only called
- for SIGTRAP; some ports use the si_addr field for
- target_stopped_data_address. In the future, it may also be used to
- restore the siginfo of requeued signals. */
-
-static void
-save_siginfo (struct lwp_info *lp)
-{
- errno = 0;
- ptrace (PTRACE_GETSIGINFO, GET_LWP (lp->ptid),
- (PTRACE_TYPE_ARG3) 0, &lp->siginfo);
-
- if (errno != 0)
- memset (&lp->siginfo, 0, sizeof (lp->siginfo));
-}
-
/* Send a SIGSTOP to LP. */
static int
@@ -2787,9 +2769,6 @@ stop_wait_callback (struct lwp_info *lp,
{
/* The thread was stopped with a signal other than SIGSTOP. */
- /* Save the trap's siginfo in case we need it later. */
- save_siginfo (lp);
-
save_sigtrap (lp);
if (debug_linux_nat)
@@ -3155,12 +3134,7 @@ linux_nat_filter_event (int lwpid, int s
}
if (linux_nat_status_is_event (status))
- {
- /* Save the trap's siginfo in case we need it later. */
- save_siginfo (lp);
-
- save_sigtrap (lp);
- }
+ save_sigtrap (lp);
/* Check if the thread has exited. */
if ((WIFEXITED (status) || WIFSIGNALED (status))
@@ -3763,7 +3737,6 @@ resume_stopped_resumed_lwps (struct lwp_
linux_ops->to_resume (linux_ops, pid_to_ptid (GET_LWP (lp->ptid)),
lp->step, TARGET_SIGNAL_0);
lp->stopped = 0;
- memset (&lp->siginfo, 0, sizeof (lp->siginfo));
lp->stopped_by_watchpoint = 0;
}
@@ -5932,11 +5905,19 @@ linux_nat_set_siginfo_fixup (struct targ
struct siginfo *
linux_nat_get_siginfo (ptid_t ptid)
{
- struct lwp_info *lp = find_lwp_pid (ptid);
+ static struct siginfo siginfo;
+ int pid;
- gdb_assert (lp != NULL);
+ pid = GET_LWP (ptid);
+ if (pid == 0)
+ pid = GET_PID (ptid);
+
+ errno = 0;
+ ptrace (PTRACE_GETSIGINFO, pid, (PTRACE_TYPE_ARG3) 0, &siginfo);
+ if (errno != 0)
+ memset (&siginfo, 0, sizeof (siginfo));
- return &lp->siginfo;
+ return &siginfo;
}
/* Provide a prototype to silence -Wmissing-prototypes. */
Index: gdb-7.2.50.20101116/gdb/linux-nat.h
===================================================================
--- gdb-7.2.50.20101116.orig/gdb/linux-nat.h 2010-11-16 07:54:36.000000000 +0100
+++ gdb-7.2.50.20101116/gdb/linux-nat.h 2010-11-16 09:12:44.000000000 +0100
@@ -58,10 +58,6 @@ struct lwp_info
/* The kind of stepping of this LWP. */
enum resume_step step;
- /* Non-zero si_signo if this LWP stopped with a trap. si_addr may
- be the address of a hardware watchpoint. */
- struct siginfo siginfo;
-
/* STOPPED_BY_WATCHPOINT is non-zero if this LWP stopped with a data
watchpoint trap. */
int stopped_by_watchpoint;

View File

@ -1,164 +0,0 @@
--- ./gdb/doc/gdb.texinfo 2010-05-24 19:37:01.000000000 +0200
+++ ./gdb/doc/gdb.texinfo 2010-05-24 19:38:56.000000000 +0200
@@ -14768,33 +14768,21 @@ and @code{show architecture}.
@cindex active targets
@cindex multiple targets
-There are three classes of targets: processes, core files, and
-executable files. @value{GDBN} can work concurrently on up to three
-active targets, one in each class. This allows you to (for example)
-start a process and inspect its activity without abandoning your work on
-a core file.
-
-For example, if you execute @samp{gdb a.out}, then the executable file
-@code{a.out} is the only active target. If you designate a core file as
-well---presumably from a prior run that crashed and coredumped---then
-@value{GDBN} has two active targets and uses them in tandem, looking
-first in the corefile target, then in the executable file, to satisfy
-requests for memory addresses. (Typically, these two classes of target
-are complementary, since core files contain only a program's
-read-write memory---variables and so on---plus machine status, while
-executable files contain only the program text and initialized data.)
-
-When you type @code{run}, your executable file becomes an active process
-target as well. When a process target is active, all @value{GDBN}
-commands requesting memory addresses refer to that target; addresses in
-an active core file or executable file target are obscured while the
-process target is active.
-
-Use the @code{core-file} and @code{exec-file} commands to select a new
-core file or executable target (@pxref{Files, ,Commands to Specify
-Files}). To specify as a target a process that is already running, use
-the @code{attach} command (@pxref{Attach, ,Debugging an Already-running
-Process}).
+There are multiple classes of targets such as: processes, executable files or
+recording sessions. Core files belong to the process class, there can be
+active only one of a core or a running process. Otherwise @value{GDBN} can
+work concurrently on multiple active targets, one in each class. This allows
+you to (for example) start a process and inspect its activity while still
+having access to the executable file after the process finishes. Or if you
+start process recording (@pxref{Reverse Execution}) and @code{reverse-step}
+there you are presented a virtual layer of the recording target while the
+process target remains stopped at the chronologically last point of the process
+execution.
+
+Use the @code{core-file} and @code{exec-file} commands to select a new core
+file or executable target (@pxref{Files, ,Commands to Specify Files}). To
+specify as a target a process that is already running, use the @code{attach}
+command (@pxref{Attach, ,Debugging an Already-running Process}).
@node Target Commands
@section Commands for Managing Targets
--- ./gdb/infcmd.c 2010-05-24 19:37:01.000000000 +0200
+++ ./gdb/infcmd.c 2010-05-24 19:41:21.000000000 +0200
@@ -483,6 +483,13 @@ run_command_1 (char *args, int from_tty,
dont_repeat ();
+ if (core_bfd)
+ {
+ core_file_command (NULL, from_tty);
+ if (core_bfd)
+ warning (_("Core file not unloaded."));
+ }
+
kill_if_already_running (from_tty);
init_wait_for_inferior ();
@@ -2373,6 +2380,13 @@ attach_command (char *args, int from_tty
error (_("Not killed."));
}
+ if (core_bfd)
+ {
+ core_file_command (NULL, from_tty);
+ if (core_bfd)
+ warning (_("Core file not unloaded."));
+ }
+
/* Clean up any leftovers from other runs. Some other things from
this function should probably be moved into target_pre_inferior. */
target_pre_inferior (from_tty);
--- ./gdb/testsuite/gdb.base/corefile.exp 2010-01-09 01:14:11.000000000 +0100
+++ ./gdb/testsuite/gdb.base/corefile.exp 2010-05-24 19:38:56.000000000 +0200
@@ -182,3 +182,62 @@ gdb_load ${binfile}
gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp (reinit)"
gdb_test "core" "No core file now."
+
+
+# Test a run (start) command will clear any loaded core file.
+
+gdb_test "core-file $corefile" "Core was generated by .*" "run: load core again"
+gdb_test "info files" "\r\nLocal core dump file:\r\n.*" "run: sanity check we see the core file"
+
+set test "run: with core"
+if [runto_main] {
+ pass $test
+} else {
+ fail $test
+}
+
+set test "run: core file is cleared"
+gdb_test_multiple "info files" $test {
+ "\r\nLocal core dump file:\r\n.*\r\n$gdb_prompt $" {
+ fail $test
+ }
+ "\r\n$gdb_prompt $" {
+ pass $test
+ }
+}
+
+gdb_exit
+
+
+# Test an attach command will clear any loaded core file.
+
+if ![is_remote target] {
+ set test "attach: spawn sleep"
+ set res [remote_spawn host "$binfile sleep"];
+ if { $res < 0 || $res == "" } {
+ perror "$test failed."
+ fail $test
+ return
+ }
+ set pid [exp_pid -i $res]
+ # We do not care of the startup phase where it will be caught.
+
+ gdb_start
+
+ gdb_test "core-file $corefile" "Core was generated by .*" "attach: load core again"
+ gdb_test "info files" "\r\nLocal core dump file:\r\n.*" "attach: sanity check we see the core file"
+
+ gdb_test "attach $pid" "Attaching to process $pid\r\n.*" "attach: with core"
+
+ set test "attach: core file is cleared"
+ gdb_test_multiple "info files" $test {
+ "\r\nLocal core dump file:\r\n.*\r\n$gdb_prompt $" {
+ fail $test
+ }
+ "\r\n$gdb_prompt $" {
+ pass $test
+ }
+ }
+
+ gdb_exit
+}
--- ./gdb/testsuite/gdb.base/coremaker.c 2010-01-01 08:32:00.000000000 +0100
+++ ./gdb/testsuite/gdb.base/coremaker.c 2010-05-24 19:38:56.000000000 +0200
@@ -133,8 +133,14 @@ func1 ()
func2 ();
}
-int main ()
+int
+main (int argc, char **argv)
{
+ if (argc == 2 && strcmp (argv[1], "sleep") == 0)
+ {
+ sleep (60);
+ return 0;
+ }
mmapdata ();
func1 ();
return 0;

View File

@ -1,217 +0,0 @@
http://sourceware.org/ml/gdb-patches/2010-07/msg00237.html
Subject: [patch] Fix regression on prelinked executables
Hi,
there is a regression since gdb-7.0 for a combination of:
* prelinked
* main executable
* using separate debug info
* using copy relocations
It is since a patch for both PIE and (AFAIK) OSX support:
[commit] syms_from_objfile: Relativize also MAINLINE
http://sourceware.org/ml/gdb-patches/2010-01/msg00080.html
which started to use problematic addr_info_make_relative even for main
executables. prelink<->gdb discussion at:
https://bugzilla.redhat.com/show_bug.cgi?id=614659
Currently in the unfortunately executables GDB has invalid displcement for
symbols in .bss:
int bssvar, *bssvarp = &bssvar;
(gdb) p &bssvar
$1 = (int *) 0x600b54
(gdb) p bssvarp
$2 = (int *) 0x600b50
<abstract-higher-point-of-view>
addr_info_make_relative could just simply subtract entry point address and
provide single CORE_ADDR objfile->offset (instead of the current
section_offsets array with offsets specific for each section). Linux systems
use always single offset for the whole objfile. AFAIK these per-section
offsets are there for some embedded targets. Curiously GDB already uses at
many places
baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile));
instead of using offset for the appropriate section at that place and nobody
complains.
</abstract-higher-point-of-view>
No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
Proposing for the gdb-7.2 branch. I had problems fixing up my crashing X.
Thanks,
Jan
gdb/
2010-07-15 Jan Kratochvil <jan.kratochvil@redhat.com>
* symfile.c (addr_section_name): New function.
(addrs_section_compar): Use it.
(addr_info_make_relative): Use it. Move variable sect_name into a more
inner block. Make ".dynbss" and ".sdynbss" checks more strict.
gdb/testsuite/
2010-07-15 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/prelink-lib.c (copyreloc): New initialized variable.
* gdb.base/prelink.c (copyreloc, bssvar, bssvarp): New variables.
(main): Use copyreloc.
* gdb.base/prelink.exp (split debug of executable)
(.dynbss vs. .bss address shift): New tests.
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -547,6 +547,23 @@ relative_addr_info_to_section_offsets (struct section_offsets *section_offsets,
}
}
+/* Transform section name S for a name comparison. prelink can split section
+ `.bss' into two sections `.dynbss' and `.bss' (in this order). Similarly
+ prelink can split `.sbss' into `.sdynbss' and `.sbss'. Use virtual address
+ of the new `.dynbss' (`.sdynbss') section as the adjacent new `.bss'
+ (`.sbss') section has invalid (increased) virtual address. */
+
+static const char *
+addr_section_name (const char *s)
+{
+ if (strcmp (s, ".dynbss") == 0)
+ return ".bss";
+ if (strcmp (s, ".sdynbss") == 0)
+ return ".sbss";
+
+ return s;
+}
+
/* qsort comparator for addrs_section_sort. Sort entries in ascending order by
their (name, sectindex) pair. sectindex makes the sort by name stable. */
@@ -557,7 +574,7 @@ addrs_section_compar (const void *ap, const void *bp)
const struct other_sections *b = *((struct other_sections **) bp);
int retval, a_idx, b_idx;
- retval = strcmp (a->name, b->name);
+ retval = strcmp (addr_section_name (a->name), addr_section_name (b->name));
if (retval)
return retval;
@@ -641,14 +658,16 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
while (*addrs_sorted)
{
- const char *sect_name = (*addrs_sorted)->name;
+ const char *sect_name = addr_section_name ((*addrs_sorted)->name);
while (*abfd_addrs_sorted
- && strcmp ((*abfd_addrs_sorted)->name, sect_name) < 0)
+ && strcmp (addr_section_name ((*abfd_addrs_sorted)->name),
+ sect_name) < 0)
abfd_addrs_sorted++;
if (*abfd_addrs_sorted
- && strcmp ((*abfd_addrs_sorted)->name, sect_name) == 0)
+ && strcmp (addr_section_name ((*abfd_addrs_sorted)->name),
+ sect_name) == 0)
{
int index_in_addrs;
@@ -676,7 +695,6 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++)
{
- const char *sect_name = addrs->other[i].name;
struct other_sections *sect = addrs_to_abfd_addrs[i];
if (sect)
@@ -694,6 +712,9 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
}
else
{
+ /* addr_section_name transformation is not used for SECT_NAME. */
+ const char *sect_name = addrs->other[i].name;
+
/* This section does not exist in ABFD, which is normally
unexpected and we want to issue a warning.
@@ -704,12 +725,20 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
a warning. Shared libraries contain just the section
".gnu.liblist" but it is not marked as loadable there. There is
no other way to identify them than by their name as the sections
- created by prelink have no special flags. */
+ created by prelink have no special flags.
+
+ For the sections `.bss' and `.sbss' see addr_section_name. */
if (!(strcmp (sect_name, ".gnu.liblist") == 0
|| strcmp (sect_name, ".gnu.conflict") == 0
- || strcmp (sect_name, ".dynbss") == 0
- || strcmp (sect_name, ".sdynbss") == 0))
+ || (strcmp (sect_name, ".bss") == 0
+ && i > 0
+ && strcmp (addrs->other[i - 1].name, ".dynbss") == 0
+ && addrs_to_abfd_addrs[i - 1] != NULL)
+ || (strcmp (sect_name, ".sbss") == 0
+ && i > 0
+ && strcmp (addrs->other[i - 1].name, ".sdynbss") == 0
+ && addrs_to_abfd_addrs[i - 1] != NULL)))
warning (_("section %s not found in %s"), sect_name,
bfd_get_filename (abfd));
--- a/gdb/testsuite/gdb.base/prelink-lib.c
+++ b/gdb/testsuite/gdb.base/prelink-lib.c
@@ -16,6 +16,8 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+int copyreloc = 1;
+
int
g (void (*p)(void))
{
--- a/gdb/testsuite/gdb.base/prelink.c
+++ b/gdb/testsuite/gdb.base/prelink.c
@@ -18,6 +18,11 @@
#include <stdio.h>
+extern int copyreloc;
+
+/* Test GDB itself finds `&bssvar' right. */
+static int bssvar, *bssvarp = &bssvar;
+
extern void (*h (void)) (void (*)(void));
int
@@ -25,5 +30,6 @@ main (void)
{
void (*f) (void (*)(void)) = h ();
printf ("%p\n", f);
+ printf ("%d\n", copyreloc);
f (0);
}
--- a/gdb/testsuite/gdb.base/prelink.exp
+++ b/gdb/testsuite/gdb.base/prelink.exp
@@ -57,6 +57,13 @@ if {$prelink_args == ""} {
return -1
}
+set test "split debug of executable"
+if [gdb_gnu_strip_debug $binfile] {
+ fail $test
+} else {
+ pass $test
+}
+
if ![prelink_yes $prelink_args] {
# Maybe we don't have prelink.
return -1
@@ -105,3 +112,5 @@ clean_restart $executable
gdb_test_no_output "set verbose on"
gdb_test "core-file $objdir/$subdir/prelink.core" "Using PIC \\(Position Independent Code\\) prelink displacement 0x\[^0\]\[0-9a-f\]* for \[^\r\n\]*[file tail ${libfile}].*" "seen displacement message"
+
+gdb_test "p &bssvar == bssvarp" " = 1" ".dynbss vs. .bss address shift"

View File

@ -0,0 +1,169 @@
gdb:
https://bugzilla.redhat.com/show_bug.cgi?id=623749
kernel:
https://bugzilla.redhat.com/show_bug.cgi?id=636937
http://sourceware.org/ml/gdb-patches/2010-09/msg00395.html
Subject: Re: [patch] Fix gcore writer for -Wl,-z,relro (PR corefiles/11804)
gdb/testsuite/
2010-09-22 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix gcore writer for -Wl,-z,relro.
* gdb.base/gcore-relro.exp: New file.
* gdb.base/gcore-relro-main.c: New file.
* gdb.base/gcore-relro-lib.c: New file.
--- ./gdb/gcore.c 2010-09-23 20:14:56.000000000 +0200
+++ ./gdb/gcore.c 2010-09-23 20:37:56.000000000 +0200
@@ -401,6 +401,7 @@ gcore_create_callback (CORE_ADDR vaddr,
if (write == 0 && !solib_keep_data_in_core (vaddr, size))
{
+#if 0 /* https://bugzilla.redhat.com/show_bug.cgi?id=636937 */
/* See if this region of memory lies inside a known file on disk.
If so, we can avoid copying its contents by clearing SEC_LOAD. */
struct objfile *objfile;
@@ -433,6 +434,7 @@ gcore_create_callback (CORE_ADDR vaddr,
}
keep:
+#endif
flags |= SEC_READONLY;
}
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-relro-lib.c
@@ -0,0 +1,21 @@
+/* Copyright 2010 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ 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/>. */
+
+void
+lib (void)
+{
+}
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-relro-main.c
@@ -0,0 +1,25 @@
+/* Copyright 2010 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ 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/>. */
+
+extern void lib (void);
+
+int
+main (void)
+{
+ lib ();
+ return 0;
+}
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-relro.exp
@@ -0,0 +1,80 @@
+# 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/>.
+
+if {[skip_shlib_tests]} {
+ return 0
+}
+
+set testfile "gcore-relro"
+set srcmainfile ${testfile}-main.c
+set srclibfile ${testfile}-lib.c
+set libfile ${objdir}/${subdir}/${testfile}-lib.so
+set objfile ${objdir}/${subdir}/${testfile}-main.o
+set executable ${testfile}-main
+set binfile ${objdir}/${subdir}/${executable}
+set gcorefile ${objdir}/${subdir}/${executable}.gcore
+
+if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} {debug}] != ""
+ || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object {debug}] != "" } {
+ untested ${testfile}.exp
+ return -1
+}
+set opts [list debug shlib=${libfile} additional_flags=-Wl,-z,relro]
+if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
+ unsupported "-Wl,-z,relro compilation failed"
+ return -1
+}
+
+clean_restart $executable
+gdb_load_shlibs $libfile
+
+# Does this gdb support gcore?
+set test "help gcore"
+gdb_test_multiple $test $test {
+ -re "Undefined command: .gcore.*\r\n$gdb_prompt $" {
+ # gcore command not supported -- nothing to test here.
+ unsupported "gdb does not support gcore on this target"
+ return -1;
+ }
+ -re "Save a core file .*\r\n$gdb_prompt $" {
+ pass $test
+ }
+}
+
+if { ![runto lib] } then {
+ return -1
+}
+
+set escapedfilename [string_to_regexp ${gcorefile}]
+
+set test "save a corefile"
+gdb_test_multiple "gcore ${gcorefile}" $test {
+ -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "Can't create a corefile\r\n$gdb_prompt $" {
+ unsupported $test
+ return -1
+ }
+}
+
+# Now restart gdb and load the corefile.
+
+clean_restart $executable
+gdb_load_shlibs $libfile
+
+gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated corefile"
+
+gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded"

View File

@ -0,0 +1,29 @@
Fix gdb.solib_address (fix by Phil Muldoon).
--- /dev/null
+++ b/gdb/testsuite/gdb.python/rh634108-solib_address.exp
@@ -0,0 +1,24 @@
+# Copyright (C) 2008, 2009, 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/>.
+
+# https://bugzilla.redhat.com/show_bug.cgi?id=634108
+
+gdb_exit
+gdb_start
+
+# Skip all tests if Python scripting is not enabled.
+if { [skip_python_tests] } { continue }
+
+gdb_test "python print gdb.solib_address(-1)" "None" "gdb.solib_address exists"

View File

@ -0,0 +1,86 @@
http://sourceware.org/ml/gdb-patches/2011-01/msg00507.html
Subject: [patch] Fix DWARF-3+ DW_AT_accessibility default assumption
Hi,
GDB regresses on default compiler option -gdwarf-3 on gcc-4.6+ as this gcc
started to omit DW_AT_accessibility for the default value case. Normal
upstream gcc still has -gdwarf-2 default (Fedora uses -gdwarf-3 default).
No regressions on {x86_64,x86_64-m32,i686}-fedora15-linux-gnu.
(There are other regressions to be fixed due to gcc45->gcc46.)
I will check it in in some time.
Thanks,
Jan
-FAIL: gdb.cp/casts.exp: dynamic_cast simple downcast
-FAIL: gdb.cp/casts.exp: dynamic_cast simple downcast to intermediate class
-FAIL: gdb.cp/casts.exp: dynamic_cast unique downcast
-FAIL: gdb.cp/casts.exp: dynamic_cast to sibling
-FAIL: gdb.cp/classes.exp: ptype class default_private_class // wrong access specifier for field: public
-FAIL: gdb.cp/classes.exp: ptype class explicit_private_class // wrong access specifier for field: public
-FAIL: gdb.cp/classes.exp: ptype class mixed_protection_class // wrong access specifier for field: public
-FAIL: gdb.cp/virtfunc.exp: ptype A // wrong access specifier for field: public
-FAIL: gdb.cp/virtfunc.exp: ptype B // wrong access specifier for field: public
-FAIL: gdb.cp/virtfunc.exp: ptype a // wrong access specifier for field: public
-FAIL: gdb.cp/virtfunc.exp: ptype b // wrong access specifier for field: public
-FAIL: gdb.cp/virtfunc.exp: ptype pAa // wrong access specifier for field: public
-FAIL: gdb.cp/virtfunc.exp: ptype pAe // wrong access specifier for field: public
-FAIL: gdb.cp/virtfunc.exp: ptype pBe // wrong access specifier for field: public
-FAIL: gdb.mi/gdb792.exp: list children of class A
-FAIL: gdb.mi/gdb792.exp: list children of A.public
-FAIL: gdb.mi/gdb792.exp: list children of A.private
-FAIL: gdb.mi/gdb792.exp: list children of A.protected
-FAIL: gdb.mi/gdb792.exp: list children of A.protected.b
-FAIL: gdb.mi/gdb792.exp: list children of A.protected.b.public
-FAIL: gdb.mi/gdb792.exp: list children of A.protected.b.private
-FAIL: gdb.mi/gdb792.exp: list children of class C
-FAIL: gdb.python/py-value.exp: python print bool(gdb.parse_and_eval('base').dynamic_cast(gdb.lookup_type('Derived').pointer()))
gdb/
2011-01-25 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix DWARF-3+ DW_AT_accessibility default assumption.
* dwarf2read.c (dwarf2_add_field): Fix new_field->accessibility for
cu->header.version >= 3.
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -6186,13 +6186,25 @@ dwarf2_add_field (struct field_info *fip, struct die_info *die,
}
fip->nfields++;
- /* Handle accessibility and virtuality of field.
- The default accessibility for members is public, the default
- accessibility for inheritance is private. */
- if (die->tag != DW_TAG_inheritance)
- new_field->accessibility = DW_ACCESS_public;
+ if (cu->header.version < 3)
+ {
+ /* The default DWARF 2 accessibility for members is public, the default
+ accessibility for inheritance is private. */
+
+ if (die->tag != DW_TAG_inheritance)
+ new_field->accessibility = DW_ACCESS_public;
+ else
+ new_field->accessibility = DW_ACCESS_private;
+ }
else
- new_field->accessibility = DW_ACCESS_private;
+ {
+ /* DWARF 3 specifies the default accessibility explicitly. */
+
+ if (die->parent->tag == DW_TAG_class_type)
+ new_field->accessibility = DW_ACCESS_private;
+ else
+ new_field->accessibility = DW_ACCESS_public;
+ }
new_field->virtuality = DW_VIRTUALITY_none;
attr = dwarf2_attr (die, DW_AT_accessibility, cu);

View File

@ -1,8 +1,8 @@
Index: gdb-7.1.90.20100711/gdb/f-lang.c Index: gdb-7.2.50.20110117/gdb/f-lang.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/f-lang.c 2010-06-03 00:41:55.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/f-lang.c 2011-01-07 20:36:16.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/f-lang.c 2010-07-13 00:24:04.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/f-lang.c 2011-01-17 15:56:07.000000000 +0100
@@ -56,20 +56,6 @@ typedef struct saved_bf_symnum SAVED_BF, @@ -57,20 +57,6 @@ typedef struct saved_bf_symnum SAVED_BF,
/* Local functions */ /* Local functions */
extern void _initialize_f_language (void); extern void _initialize_f_language (void);
@ -23,7 +23,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
static void f_printchar (int c, struct type *type, struct ui_file * stream); static void f_printchar (int c, struct type *type, struct ui_file * stream);
static void f_emit_char (int c, struct type *type, static void f_emit_char (int c, struct type *type,
@@ -458,185 +444,7 @@ _initialize_f_language (void) @@ -461,185 +447,7 @@ _initialize_f_language (void)
add_language (&f_language_defn); add_language (&f_language_defn);
} }
@ -73,14 +73,14 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
-static SAVED_BF_PTR saved_bf_list = NULL; /* Ptr to (.bf,function) -static SAVED_BF_PTR saved_bf_list = NULL; /* Ptr to (.bf,function)
- list */ - list */
-static SAVED_BF_PTR saved_bf_list_end = NULL; /* Ptr to above list's end */ -static SAVED_BF_PTR saved_bf_list_end = NULL; /* Ptr to above list's end */
-static SAVED_BF_PTR current_head_bf_list = NULL; /* Current head of above list -static SAVED_BF_PTR current_head_bf_list = NULL; /* Current head of
- */ - above list. */
- -
-static SAVED_BF_PTR tmp_bf_ptr; /* Generic temporary for use -static SAVED_BF_PTR tmp_bf_ptr; /* Generic temporary for use
- in macros */ - in macros. */
- -
-/* The following function simply enters a given common block onto -/* The following function simply enters a given common block onto
- the global common block chain */ - the global common block chain. */
- -
-static void -static void
-add_common_block (char *name, CORE_ADDR offset, int secnum, char *func_stab) -add_common_block (char *name, CORE_ADDR offset, int secnum, char *func_stab)
@ -91,7 +91,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
- /* If the COMMON block we are trying to add has a blank - /* If the COMMON block we are trying to add has a blank
- name (i.e. "#BLNK_COM") then we set it to __BLANK - name (i.e. "#BLNK_COM") then we set it to __BLANK
- because the darn "#" character makes GDB's input - because the darn "#" character makes GDB's input
- parser have fits. */ - parser have fits. */
- -
- -
- if (strcmp (name, BLANK_COMMON_NAME_ORIGINAL) == 0 - if (strcmp (name, BLANK_COMMON_NAME_ORIGINAL) == 0
@ -111,7 +111,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
- tmp->name = xmalloc (strlen (name) + 1); - tmp->name = xmalloc (strlen (name) + 1);
- -
- /* local_copy_func_stab is a stabstring, let us first extract the - /* local_copy_func_stab is a stabstring, let us first extract the
- function name from the stab by NULLing out the ':' character. */ - function name from the stab by NULLing out the ':' character. */
- -
- -
- c = NULL; - c = NULL;
@ -148,7 +148,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
-#endif -#endif
- -
-/* The following function simply enters a given common entry onto -/* The following function simply enters a given common entry onto
- the "current_common" block that has been saved away. */ - the "current_common" block that has been saved away. */
- -
-#if 0 -#if 0
-static void -static void
@ -160,7 +160,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
- -
- /* The order of this list is important, since - /* The order of this list is important, since
- we expect the entries to appear in decl. - we expect the entries to appear in decl.
- order when we later issue "info common" calls */ - order when we later issue "info common" calls. */
- -
- tmp = allocate_common_entry_node (); - tmp = allocate_common_entry_node ();
- -
@ -185,7 +185,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
-} -}
-#endif -#endif
- -
-/* This routine finds the first encountred COMMON block named "name" */ -/* This routine finds the first encountred COMMON block named "name". */
- -
-#if 0 -#if 0
-static SAVED_F77_COMMON_PTR -static SAVED_F77_COMMON_PTR
@ -208,8 +208,8 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
-#endif -#endif
/* This routine finds the first encountred COMMON block named "name" /* This routine finds the first encountred COMMON block named "name"
that belongs to function funcname */ that belongs to function funcname. */
@@ -659,193 +467,3 @@ find_common_for_function (char *name, ch @@ -662,193 +470,3 @@ find_common_for_function (char *name, ch
} }
return (NULL); return (NULL);
} }
@ -226,7 +226,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
-{ -{
- COMMON_ENTRY_PTR entry; - COMMON_ENTRY_PTR entry;
- -
- blk->offset = offset; /* Keep this around for future use. */ - blk->offset = offset; /* Keep this around for future use. */
- -
- entry = blk->entries; - entry = blk->entries;
- -
@ -244,7 +244,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
- blocks occur with relative infrequency, we simply do a linear scan on - blocks occur with relative infrequency, we simply do a linear scan on
- the name. Eventually, the best way to do this will be a - the name. Eventually, the best way to do this will be a
- hashed-lookup. Secnum is the section number for the .bss section - hashed-lookup. Secnum is the section number for the .bss section
- (which is where common data lives). */ - (which is where common data lives). */
- -
-static void -static void
-patch_all_commons_by_name (char *name, CORE_ADDR offset, int secnum) -patch_all_commons_by_name (char *name, CORE_ADDR offset, int secnum)
@ -282,7 +282,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
- #line pragmas sometimes cause line ranges to get messed up - #line pragmas sometimes cause line ranges to get messed up
- we simply create a linear list. This list can then be searched - we simply create a linear list. This list can then be searched
- first by a queueing algorithm and upon failure fall back to - first by a queueing algorithm and upon failure fall back to
- a linear scan. */ - a linear scan. */
- -
-#if 0 -#if 0
-#define ADD_BF_SYMNUM(bf_sym,fcn_sym) \ -#define ADD_BF_SYMNUM(bf_sym,fcn_sym) \
@ -311,7 +311,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
- } - }
-#endif -#endif
- -
-/* This function frees the entire (.bf,function) list */ -/* This function frees the entire (.bf,function) list. */
- -
-#if 0 -#if 0
-static void -static void
@ -342,7 +342,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
- int nprobes = 0; - int nprobes = 0;
- -
- /* First use a simple queuing algorithm (i.e. look and see if the - /* First use a simple queuing algorithm (i.e. look and see if the
- item at the head of the queue is the one you want) */ - item at the head of the queue is the one you want). */
- -
- if (saved_bf_list == NULL) - if (saved_bf_list == NULL)
- internal_error (__FILE__, __LINE__, - internal_error (__FILE__, __LINE__,
@ -361,7 +361,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
- -
- /* If the above did not work (probably because #line directives were - /* If the above did not work (probably because #line directives were
- used in the sourcefile and they messed up our internal tables) we now do - used in the sourcefile and they messed up our internal tables) we now do
- the ugly linear scan */ - the ugly linear scan. */
- -
- if (global_remote_debug) - if (global_remote_debug)
- fprintf_unfiltered (gdb_stderr, "\ndefaulting to linear scan\n"); - fprintf_unfiltered (gdb_stderr, "\ndefaulting to linear scan\n");
@ -403,10 +403,10 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
- saved_function_list = NULL; - saved_function_list = NULL;
-} -}
-#endif -#endif
Index: gdb-7.1.90.20100711/gdb/f-lang.h Index: gdb-7.2.50.20110117/gdb/f-lang.h
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/f-lang.h 2010-07-12 23:07:33.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/f-lang.h 2011-01-17 15:47:37.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/f-lang.h 2010-07-13 00:24:04.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/f-lang.h 2011-01-17 15:54:14.000000000 +0100
@@ -76,14 +76,9 @@ typedef struct saved_f77_common SAVED_F7 @@ -76,14 +76,9 @@ typedef struct saved_f77_common SAVED_F7
typedef struct common_entry COMMON_ENTRY, *COMMON_ENTRY_PTR; typedef struct common_entry COMMON_ENTRY, *COMMON_ENTRY_PTR;
@ -422,10 +422,10 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.h
#define BLANK_COMMON_NAME_ORIGINAL "#BLNK_COM" /* XLF assigned */ #define BLANK_COMMON_NAME_ORIGINAL "#BLNK_COM" /* XLF assigned */
#define BLANK_COMMON_NAME_MF77 "__BLNK__" /* MF77 assigned */ #define BLANK_COMMON_NAME_MF77 "__BLNK__" /* MF77 assigned */
#define BLANK_COMMON_NAME_LOCAL "__BLANK" /* Local GDB */ #define BLANK_COMMON_NAME_LOCAL "__BLANK" /* Local GDB */
Index: gdb-7.1.90.20100711/gdb/f-valprint.c Index: gdb-7.2.50.20110117/gdb/f-valprint.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/f-valprint.c 2010-07-12 23:07:33.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/f-valprint.c 2011-01-17 15:47:37.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/f-valprint.c 2010-07-13 00:24:25.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/f-valprint.c 2011-01-17 15:54:36.000000000 +0100
@@ -35,10 +35,6 @@ @@ -35,10 +35,6 @@
#include "command.h" #include "command.h"
#include "block.h" #include "block.h"
@ -437,12 +437,12 @@ Index: gdb-7.1.90.20100711/gdb/f-valprint.c
extern void _initialize_f_valprint (void); extern void _initialize_f_valprint (void);
static void info_common_command (char *, int); static void info_common_command (char *, int);
static void list_all_visible_commons (char *); static void list_all_visible_commons (char *);
@@ -601,67 +597,6 @@ info_common_command (char *comname, int @@ -604,67 +600,6 @@ info_common_command (char *comname, int
comname, funname); comname, funname);
} }
-/* This function is used to determine whether there is a -/* This function is used to determine whether there is a
- F77 common block visible at the current scope called 'comname'. */ - F77 common block visible at the current scope called 'comname'. */
- -
-#if 0 -#if 0
-static int -static int
@ -459,7 +459,7 @@ Index: gdb-7.1.90.20100711/gdb/f-valprint.c
- fi = get_selected_frame (_("No frame selected")); - fi = get_selected_frame (_("No frame selected"));
- -
- /* The following is generally ripped off from stack.c's routine - /* The following is generally ripped off from stack.c's routine
- print_frame_info() */ - print_frame_info(). */
- -
- func = find_pc_function (fi->pc); - func = find_pc_function (fi->pc);
- if (func) - if (func)
@ -476,7 +476,7 @@ Index: gdb-7.1.90.20100711/gdb/f-valprint.c
- up with a larger address for the function use that instead. - up with a larger address for the function use that instead.
- I don't think this can ever cause any problems; there shouldn't - I don't think this can ever cause any problems; there shouldn't
- be any minimal symbols in the middle of a function. - be any minimal symbols in the middle of a function.
- FIXME: (Not necessarily true. What about text labels) */ - FIXME: (Not necessarily true. What about text labels?) */
- -
- struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (fi->pc); - struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (fi->pc);
- -

View File

@ -1,8 +1,8 @@
Index: gdb-7.1.90.20100711/gdb/dwarf2read.c Index: gdb-7.2.50.20110117/gdb/dwarf2read.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/dwarf2read.c 2010-07-13 00:13:02.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/dwarf2read.c 2011-01-17 15:50:41.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/dwarf2read.c 2010-07-13 00:26:25.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/dwarf2read.c 2011-01-17 15:56:23.000000000 +0100
@@ -5727,12 +5727,14 @@ read_set_type (struct die_info *die, str @@ -7465,12 +7465,14 @@ read_set_type (struct die_info *die, str
return set_die_type (die, set_type, cu); return set_die_type (die, set_type, cu);
} }
@ -19,7 +19,7 @@ Index: gdb-7.1.90.20100711/gdb/dwarf2read.c
struct attribute *attr; struct attribute *attr;
struct symbol *sym; struct symbol *sym;
CORE_ADDR base = (CORE_ADDR) 0; CORE_ADDR base = (CORE_ADDR) 0;
@@ -5757,10 +5759,40 @@ read_common_block (struct die_info *die, @@ -7495,10 +7497,40 @@ read_common_block (struct die_info *die,
} }
if (die->child != NULL) if (die->child != NULL)
{ {
@ -58,9 +58,9 @@ Index: gdb-7.1.90.20100711/gdb/dwarf2read.c
+ +
+ /* Undocumented in DWARF3, when it can be present? */ + /* Undocumented in DWARF3, when it can be present? */
attr = dwarf2_attr (child_die, DW_AT_data_member_location, cu); attr = dwarf2_attr (child_die, DW_AT_data_member_location, cu);
if (attr) if (sym != NULL && attr != NULL)
{ {
@@ -5778,8 +5810,25 @@ read_common_block (struct die_info *die, @@ -7516,8 +7548,25 @@ read_common_block (struct die_info *die,
SYMBOL_VALUE_ADDRESS (sym) = base + byte_offset; SYMBOL_VALUE_ADDRESS (sym) = base + byte_offset;
add_symbol_to_list (sym, &global_symbols); add_symbol_to_list (sym, &global_symbols);
} }
@ -86,7 +86,7 @@ Index: gdb-7.1.90.20100711/gdb/dwarf2read.c
} }
} }
@@ -9106,6 +9155,13 @@ new_symbol (struct die_info *die, struct @@ -11111,6 +11160,13 @@ new_symbol_full (struct die_info *die, s
{ {
var_decode_location (attr, sym, cu); var_decode_location (attr, sym, cu);
attr2 = dwarf2_attr (die, DW_AT_external, cu); attr2 = dwarf2_attr (die, DW_AT_external, cu);
@ -97,12 +97,12 @@ Index: gdb-7.1.90.20100711/gdb/dwarf2read.c
+ && die->parent->tag == DW_TAG_common_block) + && die->parent->tag == DW_TAG_common_block)
+ attr2 = NULL; + attr2 = NULL;
+ +
if (attr2 && (DW_UNSND (attr2) != 0)) if (SYMBOL_CLASS (sym) == LOC_STATIC
{ && SYMBOL_VALUE_ADDRESS (sym) == 0
struct pending **list_to_add; && !dwarf2_per_objfile->has_section_at_zero)
@@ -9277,6 +9333,11 @@ new_symbol (struct die_info *die, struct @@ -11283,6 +11339,11 @@ new_symbol_full (struct die_info *die, s
SYMBOL_CLASS (sym) = LOC_TYPEDEF; SYMBOL_CLASS (sym) = LOC_TYPEDEF;
add_symbol_to_list (sym, &global_symbols); list_to_add = &global_symbols;
break; break;
+ case DW_TAG_common_block: + case DW_TAG_common_block:
+ SYMBOL_CLASS (sym) = LOC_STATIC; + SYMBOL_CLASS (sym) = LOC_STATIC;
@ -112,11 +112,11 @@ Index: gdb-7.1.90.20100711/gdb/dwarf2read.c
default: default:
/* Not a tag we recognize. Hopefully we aren't processing /* Not a tag we recognize. Hopefully we aren't processing
trash data, but since we must specifically ignore things trash data, but since we must specifically ignore things
Index: gdb-7.1.90.20100711/gdb/f-lang.c Index: gdb-7.2.50.20110117/gdb/f-lang.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/f-lang.c 2010-07-13 00:24:04.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/f-lang.c 2011-01-17 15:56:07.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/f-lang.c 2010-07-13 00:25:56.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/f-lang.c 2011-01-17 15:56:48.000000000 +0100
@@ -443,27 +443,3 @@ _initialize_f_language (void) @@ -446,27 +446,3 @@ _initialize_f_language (void)
add_language (&f_language_defn); add_language (&f_language_defn);
} }
@ -124,7 +124,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
-SAVED_F77_COMMON_PTR head_common_list = NULL; /* Ptr to 1st saved COMMON */ -SAVED_F77_COMMON_PTR head_common_list = NULL; /* Ptr to 1st saved COMMON */
- -
-/* This routine finds the first encountred COMMON block named "name" -/* This routine finds the first encountred COMMON block named "name"
- that belongs to function funcname */ - that belongs to function funcname. */
- -
-SAVED_F77_COMMON_PTR -SAVED_F77_COMMON_PTR
-find_common_for_function (char *name, char *funcname) -find_common_for_function (char *name, char *funcname)
@ -144,10 +144,10 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c
- } - }
- return (NULL); - return (NULL);
-} -}
Index: gdb-7.1.90.20100711/gdb/f-lang.h Index: gdb-7.2.50.20110117/gdb/f-lang.h
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/f-lang.h 2010-07-13 00:24:04.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/f-lang.h 2011-01-17 15:54:14.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/f-lang.h 2010-07-13 00:25:56.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/f-lang.h 2011-01-17 15:56:23.000000000 +0100
@@ -52,36 +52,8 @@ enum f90_range_type @@ -52,36 +52,8 @@ enum f90_range_type
NONE_BOUND_DEFAULT /* "(low:high)" */ NONE_BOUND_DEFAULT /* "(low:high)" */
}; };
@ -185,10 +185,10 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.h
/* When reasonable array bounds cannot be fetched, such as when /* When reasonable array bounds cannot be fetched, such as when
you ask to 'mt print symbols' and there is no stack frame and you ask to 'mt print symbols' and there is no stack frame and
Index: gdb-7.1.90.20100711/gdb/f-valprint.c Index: gdb-7.2.50.20110117/gdb/f-valprint.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/f-valprint.c 2010-07-13 00:24:25.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/f-valprint.c 2011-01-17 15:54:36.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/f-valprint.c 2010-07-13 00:32:05.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/f-valprint.c 2011-01-17 15:59:38.000000000 +0100
@@ -34,6 +34,8 @@ @@ -34,6 +34,8 @@
#include "gdbcore.h" #include "gdbcore.h"
#include "command.h" #include "command.h"
@ -198,7 +198,7 @@ Index: gdb-7.1.90.20100711/gdb/f-valprint.c
extern void _initialize_f_valprint (void); extern void _initialize_f_valprint (void);
static void info_common_command (char *, int); static void info_common_command (char *, int);
@@ -486,22 +488,54 @@ f_val_print (struct type *type, const gd @@ -489,22 +491,54 @@ f_val_print (struct type *type, const gd
return 0; return 0;
} }
@ -266,7 +266,7 @@ Index: gdb-7.1.90.20100711/gdb/f-valprint.c
} }
/* This function is used to print out the values in a given COMMON /* This function is used to print out the values in a given COMMON
@@ -511,11 +545,9 @@ list_all_visible_commons (char *funname) @@ -514,11 +548,9 @@ list_all_visible_commons (char *funname)
static void static void
info_common_command (char *comname, int from_tty) info_common_command (char *comname, int from_tty)
{ {
@ -280,9 +280,9 @@ Index: gdb-7.1.90.20100711/gdb/f-valprint.c
/* We have been told to display the contents of F77 COMMON /* We have been told to display the contents of F77 COMMON
block supposedly visible in this function. Let us block supposedly visible in this function. Let us
@@ -527,74 +559,31 @@ info_common_command (char *comname, int @@ -530,74 +562,31 @@ info_common_command (char *comname, int
/* The following is generally ripped off from stack.c's routine /* The following is generally ripped off from stack.c's routine
print_frame_info() */ print_frame_info(). */
- func = find_pc_function (get_frame_pc (fi)); - func = find_pc_function (get_frame_pc (fi));
- if (func) - if (func)
@ -301,7 +301,7 @@ Index: gdb-7.1.90.20100711/gdb/f-valprint.c
- up with a larger address for the function use that instead. - up with a larger address for the function use that instead.
- I don't think this can ever cause any problems; there shouldn't - I don't think this can ever cause any problems; there shouldn't
- be any minimal symbols in the middle of a function. - be any minimal symbols in the middle of a function.
- FIXME: (Not necessarily true. What about text labels) */ - FIXME: (Not necessarily true. What about text labels?) */
- -
- struct minimal_symbol *msymbol = - struct minimal_symbol *msymbol =
- lookup_minimal_symbol_by_pc (get_frame_pc (fi)); - lookup_minimal_symbol_by_pc (get_frame_pc (fi));
@ -327,7 +327,7 @@ Index: gdb-7.1.90.20100711/gdb/f-valprint.c
} }
- /* If comname is NULL, we assume the user wishes to see the - /* If comname is NULL, we assume the user wishes to see the
- which COMMON blocks are visible here and then return */ - which COMMON blocks are visible here and then return. */
- -
- if (comname == 0) - if (comname == 0)
+ while (block) + while (block)
@ -371,11 +371,11 @@ Index: gdb-7.1.90.20100711/gdb/f-valprint.c
} }
void void
Index: gdb-7.1.90.20100711/gdb/stack.c Index: gdb-7.2.50.20110117/gdb/stack.c
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/stack.c 2010-07-01 17:36:17.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/stack.c 2011-01-17 15:47:37.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/stack.c 2010-07-13 00:29:49.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/stack.c 2011-01-17 15:56:23.000000000 +0100
@@ -1484,6 +1484,8 @@ iterate_over_block_locals (struct block @@ -1498,6 +1498,8 @@ iterate_over_block_locals (struct block
case LOC_COMPUTED: case LOC_COMPUTED:
if (SYMBOL_IS_ARGUMENT (sym)) if (SYMBOL_IS_ARGUMENT (sym))
break; break;
@ -384,11 +384,11 @@ Index: gdb-7.1.90.20100711/gdb/stack.c
(*cb) (SYMBOL_PRINT_NAME (sym), sym, cb_data); (*cb) (SYMBOL_PRINT_NAME (sym), sym, cb_data);
break; break;
Index: gdb-7.1.90.20100711/gdb/symtab.h Index: gdb-7.2.50.20110117/gdb/symtab.h
=================================================================== ===================================================================
--- gdb-7.1.90.20100711.orig/gdb/symtab.h 2010-07-12 23:07:33.000000000 +0200 --- gdb-7.2.50.20110117.orig/gdb/symtab.h 2011-01-17 15:47:37.000000000 +0100
+++ gdb-7.1.90.20100711/gdb/symtab.h 2010-07-13 00:27:02.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/symtab.h 2011-01-17 15:56:23.000000000 +0100
@@ -396,7 +396,10 @@ typedef enum domain_enum_tag @@ -408,7 +408,10 @@ typedef enum domain_enum_tag
FUNCTIONS_DOMAIN, FUNCTIONS_DOMAIN,
/* All defined types */ /* All defined types */
@ -400,10 +400,10 @@ Index: gdb-7.1.90.20100711/gdb/symtab.h
} }
domain_enum; domain_enum;
Index: gdb-7.1.90.20100711/gdb/testsuite/gdb.fortran/common-block.exp Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.fortran/common-block.exp
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.1.90.20100711/gdb/testsuite/gdb.fortran/common-block.exp 2010-07-13 00:25:56.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/testsuite/gdb.fortran/common-block.exp 2011-01-17 15:56:23.000000000 +0100
@@ -0,0 +1,101 @@ @@ -0,0 +1,101 @@
+# Copyright 2008 Free Software Foundation, Inc. +# Copyright 2008 Free Software Foundation, Inc.
+ +
@ -506,10 +506,10 @@ Index: gdb-7.1.90.20100711/gdb/testsuite/gdb.fortran/common-block.exp
+gdb_test "p ix_x" " = 1 *" "p ix_x in" +gdb_test "p ix_x" " = 1 *" "p ix_x in"
+gdb_test "p iy_y" " = 2 *" "p iy_y in" +gdb_test "p iy_y" " = 2 *" "p iy_y in"
+gdb_test "p iz_z2" " = 3 *" "p iz_z2 in" +gdb_test "p iz_z2" " = 3 *" "p iz_z2 in"
Index: gdb-7.1.90.20100711/gdb/testsuite/gdb.fortran/common-block.f90 Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.fortran/common-block.f90
=================================================================== ===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.1.90.20100711/gdb/testsuite/gdb.fortran/common-block.f90 2010-07-13 00:25:56.000000000 +0200 +++ gdb-7.2.50.20110117/gdb/testsuite/gdb.fortran/common-block.f90 2011-01-17 15:56:23.000000000 +0100
@@ -0,0 +1,67 @@ @@ -0,0 +1,67 @@
+! Copyright 2008 Free Software Foundation, Inc. +! Copyright 2008 Free Software Foundation, Inc.
+! +!

View File

@ -0,0 +1,24 @@
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 6a98d57..9fa9c3c 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -10371,6 +10371,9 @@ dwarf_decode_lines (struct line_header *lh, const char *comp_dir, bfd *abfd,
if (op_code >= lh->opcode_base)
{
+ CORE_ADDR saved_address = address;
+ unsigned int saved_line = line;
+
/* Special operand. */
adj_opcode = op_code - lh->opcode_base;
address += (((op_index + (adj_opcode / lh->line_range))
@@ -10383,7 +10386,8 @@ dwarf_decode_lines (struct line_header *lh, const char *comp_dir, bfd *abfd,
dwarf2_debug_line_missing_file_complaint ();
/* For now we ignore lines not starting on an
instruction boundary. */
- else if (op_index == 0)
+ else if (op_index == 0
+ && (address != saved_address || line != saved_line))
{
lh->file_names[file - 1].included_p = 1;
if (!decode_for_pst_p && is_stmt)

17
gdb-gcc46-typedef.patch Normal file
View File

@ -0,0 +1,17 @@
internal-error: could not find partial DIE
https://bugzilla.redhat.com/show_bug.cgi?id=672230
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 6a98d57..f33a327 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -8796,8 +8796,7 @@ load_partial_dies (bfd *abfd, gdb_byte *buffer, gdb_byte *info_ptr,
if (parent_die == NULL
&& part_die->has_specification == 0
&& part_die->is_declaration == 0
- && (part_die->tag == DW_TAG_typedef
- || part_die->tag == DW_TAG_base_type
+ && (part_die->tag == DW_TAG_base_type
|| part_die->tag == DW_TAG_subrange_type))
{
if (building_psymtab && part_die->name != NULL)

View File

@ -40,11 +40,11 @@ Subject: [PATCH 4/4] add gdb-add-index
5 files changed, 57 insertions(+), 1 deletions(-) 5 files changed, 57 insertions(+), 1 deletions(-)
create mode 100755 gdb/gdb-add-index create mode 100755 gdb/gdb-add-index
diff --git a/gdb/Makefile.in b/gdb/Makefile.in Index: gdb-7.2.50.20101116/gdb/Makefile.in
index 6dbb284..8210a2c 100644 ===================================================================
--- a/gdb/Makefile.in --- gdb-7.2.50.20101116.orig/gdb/Makefile.in 2010-11-16 08:03:17.000000000 +0100
+++ b/gdb/Makefile.in +++ gdb-7.2.50.20101116/gdb/Makefile.in 2010-11-16 08:47:45.000000000 +0100
@@ -1018,7 +1018,16 @@ install-only: $(CONFIG_INSTALL) xml-syscall-install @@ -986,7 +986,16 @@ install-only: install-gstack $(CONFIG_IN
$(SHELL) $(srcdir)/../mkinstalldirs \ $(SHELL) $(srcdir)/../mkinstalldirs \
$(DESTDIR)$(man1dir) ; \ $(DESTDIR)$(man1dir) ; \
$(INSTALL_DATA) $(srcdir)/gdb.1 \ $(INSTALL_DATA) $(srcdir)/gdb.1 \
@ -62,11 +62,11 @@ index 6dbb284..8210a2c 100644
@$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do
.PHONY: install-tui .PHONY: install-tui
install-tui: install-tui:
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo Index: gdb-7.2.50.20101116/gdb/doc/gdb.texinfo
index 69141e3..457e6b4 100644 ===================================================================
--- a/gdb/doc/gdb.texinfo --- gdb-7.2.50.20101116.orig/gdb/doc/gdb.texinfo 2010-11-16 08:04:18.000000000 +0100
+++ b/gdb/doc/gdb.texinfo +++ gdb-7.2.50.20101116/gdb/doc/gdb.texinfo 2010-11-16 08:56:30.000000000 +0100
@@ -15045,6 +15045,14 @@ There are currently some limitation on indices. They only work when @@ -15500,6 +15500,14 @@ There are currently some limitation on i
for DWARF debugging information, not stabs. And, they do not for DWARF debugging information, not stabs. And, they do not
currently work for programs using Ada. currently work for programs using Ada.
@ -78,14 +78,13 @@ index 69141e3..457e6b4 100644
+$ gdb-add-index symfile +$ gdb-add-index symfile
+@end smallexample +@end smallexample
+ +
@node Symbol Errors @node Symbol Errors
@section Errors Reading Symbol Files @section Errors Reading Symbol Files
diff --git a/gdb/gdb-add-index b/gdb/gdb-add-index
new file mode 100755 Index: gdb-7.2.50.20101116/gdb/gdb-add-index
index 0000000..c9a03b0 ===================================================================
--- /dev/null --- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ b/gdb/gdb-add-index +++ gdb-7.2.50.20101116/gdb/gdb-add-index 2010-11-16 08:47:45.000000000 +0100
@@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
+#! /bin/sh +#! /bin/sh
+ +
@ -117,6 +116,3 @@ index 0000000..c9a03b0
+fi +fi
+ +
+exit 0 +exit 0
--
1.6.2.5

View File

@ -1,11 +0,0 @@
--- gdb/configure.tgt.orig 2010-06-01 10:21:15.000000000 +0000
+++ gdb/configure.tgt 2010-06-01 10:21:34.000000000 +0000
@@ -134,7 +134,7 @@
hppa*-*-linux*)
# Target: HP PA-RISC running Linux
gdb_target_obs="hppa-tdep.o hppa-linux-tdep.o glibc-tdep.o \
- solib.o solib-svr4.o symfile-mem.o"
+ solib.o solib-svr4.o symfile-mem.o linux-tdep.o"
;;
hppa*-*-netbsd*)
# Target: NetBSD/hppa

View File

@ -0,0 +1,619 @@
http://sourceware.org/ml/gdb-patches/2010-12/msg00263.html
Index: gdb-7.2.50.20110206/gdb/cp-support.c
===================================================================
--- gdb-7.2.50.20110206.orig/gdb/cp-support.c 2011-02-06 23:12:16.000000000 +0100
+++ gdb-7.2.50.20110206/gdb/cp-support.c 2011-02-06 23:12:22.000000000 +0100
@@ -35,6 +35,7 @@
#include "exceptions.h"
#include "expression.h"
#include "value.h"
+#include "language.h"
#include "safe-ctype.h"
@@ -936,7 +937,8 @@ make_symbol_overload_list_qualified (con
ALL_OBJFILES (objfile)
{
if (objfile->sf)
- objfile->sf->qf->expand_symtabs_for_function (objfile, func_name);
+ objfile->sf->qf->expand_symtabs_for_function (objfile, func_name,
+ language_cplus);
}
/* Search upwards from currently selected frame (so that we can
Index: gdb-7.2.50.20110206/gdb/dwarf2read.c
===================================================================
--- gdb-7.2.50.20110206.orig/gdb/dwarf2read.c 2011-02-06 23:12:22.000000000 +0100
+++ gdb-7.2.50.20110206/gdb/dwarf2read.c 2011-02-06 23:12:22.000000000 +0100
@@ -2373,7 +2373,8 @@ dw2_lookup_symtab (struct objfile *objfi
static struct symtab *
dw2_lookup_symbol (struct objfile *objfile, int block_index,
- const char *name, domain_enum domain)
+ const char *name, domain_enum domain,
+ enum language language)
{
/* We do all the work in the pre_expand_symtabs_matching hook
instead. */
@@ -2449,7 +2450,8 @@ dw2_relocate (struct objfile *objfile, s
static void
dw2_expand_symtabs_for_function (struct objfile *objfile,
- const char *func_name)
+ const char *func_name,
+ enum language language)
{
dw2_do_expand_symtabs_matching (objfile, func_name);
}
@@ -2509,7 +2511,8 @@ dw2_expand_symtabs_with_filename (struct
}
static const char *
-dw2_find_symbol_file (struct objfile *objfile, const char *name)
+dw2_find_symbol_file (struct objfile *objfile, const char *name,
+ enum language language)
{
struct dwarf2_per_cu_data *per_cu;
offset_type *vec;
Index: gdb-7.2.50.20110206/gdb/linespec.c
===================================================================
--- gdb-7.2.50.20110206.orig/gdb/linespec.c 2011-02-06 23:12:16.000000000 +0100
+++ gdb-7.2.50.20110206/gdb/linespec.c 2011-02-06 23:12:26.000000000 +0100
@@ -1226,7 +1226,7 @@ decode_objc (char **argptr, int funfirst
static struct symtabs_and_lines
decode_compound (char **argptr, int funfirstline, char ***canonical,
- char *saved_arg, char *p, int *not_found_ptr)
+ char *the_real_saved_arg, char *p, int *not_found_ptr)
{
struct symtabs_and_lines values;
char *p2;
@@ -1237,7 +1237,23 @@ decode_compound (char **argptr, int funf
struct symbol *sym_class;
struct type *t;
char *saved_java_argptr = NULL;
+ char *saved_arg;
+ /* THE_REAL_SAVED_ARG cannot be altered, so make a copy that can be. */
+ saved_arg = alloca (strlen (the_real_saved_arg) + 1);
+ strcpy (saved_arg, the_real_saved_arg);
+
+ /* If the user specified "'foo::bar(baz)'" (note the quotes -- often
+ added to workaround completer issues) -- saved_arg will be
+ encapsulated in single-quotes. They are superfluous, so just strip
+ them off. */
+ if (*saved_arg == '\'')
+ {
+ char *end = skip_quoted (saved_arg);
+ memmove (saved_arg, saved_arg + 1, end - saved_arg);
+ memmove (end - 2, end, strlen (saved_arg) + 1);
+ }
+
/* First check for "global" namespace specification, of the form
"::foo". If found, skip over the colons and jump to normal
symbol processing. I.e. the whole line specification starts with
@@ -1489,7 +1505,7 @@ decode_compound (char **argptr, int funf
up. The quotes are important if copy is empty. */
if (not_found_ptr)
*not_found_ptr = 1;
- cplusplus_error (saved_arg,
+ cplusplus_error (the_real_saved_arg,
"Can't find member of namespace, "
"class, struct, or union named \"%s\"\n",
copy);
Index: gdb-7.2.50.20110206/gdb/psymtab.c
===================================================================
--- gdb-7.2.50.20110206.orig/gdb/psymtab.c 2011-02-06 23:12:16.000000000 +0100
+++ gdb-7.2.50.20110206/gdb/psymtab.c 2011-02-06 23:12:54.000000000 +0100
@@ -33,6 +33,8 @@
#include "readline/readline.h"
#include "gdb_regex.h"
#include "dictionary.h"
+#include "language.h"
+#include "cp-support.h"
#ifndef DEV_TTY
#define DEV_TTY "/dev/tty"
@@ -55,7 +57,8 @@ static struct partial_symbol *match_part
static struct partial_symbol *lookup_partial_symbol (struct partial_symtab *,
const char *, int,
- domain_enum);
+ domain_enum,
+ enum language);
static char *psymtab_to_fullname (struct partial_symtab *ps);
@@ -418,15 +421,35 @@ fixup_psymbol_section (struct partial_sy
static struct symtab *
lookup_symbol_aux_psymtabs (struct objfile *objfile,
int block_index, const char *name,
- const domain_enum domain)
+ const domain_enum domain, enum language language)
{
struct partial_symtab *ps;
const int psymtab_index = (block_index == GLOBAL_BLOCK ? 1 : 0);
ALL_OBJFILE_PSYMTABS (objfile, ps)
{
- if (!ps->readin && lookup_partial_symbol (ps, name, psymtab_index, domain))
- return PSYMTAB_TO_SYMTAB (ps);
+ if (!ps->readin
+ && lookup_partial_symbol (ps, name, psymtab_index, domain, language))
+ {
+ struct symbol *sym;
+ struct symtab *stab = PSYMTAB_TO_SYMTAB (ps);
+ sym = NULL;
+
+ /* Some caution must be observed with overloaded functions
+ and methods, since the psymtab will not contain any overload
+ information (but NAME might contain it). */
+ if (stab->primary)
+ {
+ struct blockvector *bv = BLOCKVECTOR (stab);
+ struct block *block = BLOCKVECTOR_BLOCK (bv, block_index);
+ sym = lookup_block_symbol (block, name, domain);
+ }
+
+ if (sym && strcmp_iw (SYMBOL_SEARCH_NAME (sym), name) == 0)
+ return stab;
+
+ /* Keep looking through other psymtabs. */
+ }
}
return NULL;
@@ -519,22 +542,58 @@ pre_expand_symtabs_matching_psymtabs (st
/* Nothing. */
}
+/* Returns the name used to search psymtabs. Unlike symtabs, psymtabs do
+ not contain any method/function instance information (since this would
+ force reading type information while reading psymtabs). Therefore,
+ if NAME contains overload information, it must be stripped before searching
+ psymtabs.
+
+ The caller is responsible for freeing the return result. */
+
+static const char *
+psymtab_search_name (const char *name, enum language language)
+{
+ switch (language)
+ {
+ case language_cplus:
+ case language_java:
+ {
+ if (strchr (name, '('))
+ {
+ char *ret = cp_remove_params (name);
+ if (ret)
+ return ret;
+ }
+ }
+
+ default:
+ break;
+ }
+
+ return xstrdup (name);
+}
+
/* Look, in partial_symtab PST, for symbol whose natural name is NAME.
Check the global symbols if GLOBAL, the static symbols if not. */
static struct partial_symbol *
lookup_partial_symbol (struct partial_symtab *pst, const char *name,
- int global, domain_enum domain)
+ int global, domain_enum domain, enum language language)
{
struct partial_symbol **start, **psym;
struct partial_symbol **top, **real_top, **bottom, **center;
int length = (global ? pst->n_global_syms : pst->n_static_syms);
int do_linear_search = 1;
+ const char *search_name;
+ struct cleanup *cleanup;
if (length == 0)
{
return (NULL);
}
+
+ search_name = psymtab_search_name (name, language);
+ cleanup = make_cleanup (xfree, (void *) search_name);
start = (global ?
pst->objfile->global_psymbols.list + pst->globals_offset :
pst->objfile->static_psymbols.list + pst->statics_offset);
@@ -563,7 +622,8 @@ lookup_partial_symbol (struct partial_sy
{
do_linear_search = 1;
}
- if (strcmp_iw_ordered (SYMBOL_SEARCH_NAME (*center), name) >= 0)
+ if (strcmp_iw_ordered (SYMBOL_SEARCH_NAME (*center),
+ search_name) >= 0)
{
top = center;
}
@@ -577,11 +637,14 @@ lookup_partial_symbol (struct partial_sy
_("failed internal consistency check"));
while (top <= real_top
- && SYMBOL_MATCHES_SEARCH_NAME (*top, name))
+ && SYMBOL_MATCHES_SEARCH_NAME (*top, search_name))
{
if (symbol_matches_domain (SYMBOL_LANGUAGE (*top),
SYMBOL_DOMAIN (*top), domain))
- return (*top);
+ {
+ do_cleanups (cleanup);
+ return (*top);
+ }
top++;
}
}
@@ -595,11 +658,15 @@ lookup_partial_symbol (struct partial_sy
{
if (symbol_matches_domain (SYMBOL_LANGUAGE (*psym),
SYMBOL_DOMAIN (*psym), domain)
- && SYMBOL_MATCHES_SEARCH_NAME (*psym, name))
- return (*psym);
+ && SYMBOL_MATCHES_SEARCH_NAME (*psym, search_name))
+ {
+ do_cleanups (cleanup);
+ return (*psym);
+ }
}
}
+ do_cleanups (cleanup);
return (NULL);
}
@@ -911,7 +978,8 @@ dump_psymtabs_for_objfile (struct objfil
by matching FUNC_NAME. Make sure we read that symbol table in. */
static void
-read_symtabs_for_function (struct objfile *objfile, const char *func_name)
+read_symtabs_for_function (struct objfile *objfile, const char *func_name,
+ enum language language)
{
struct partial_symtab *ps;
@@ -920,9 +988,9 @@ read_symtabs_for_function (struct objfil
if (ps->readin)
continue;
- if ((lookup_partial_symbol (ps, func_name, 1, VAR_DOMAIN)
+ if ((lookup_partial_symbol (ps, func_name, 1, VAR_DOMAIN, language)
!= NULL)
- || (lookup_partial_symbol (ps, func_name, 0, VAR_DOMAIN)
+ || (lookup_partial_symbol (ps, func_name, 0, VAR_DOMAIN, language)
!= NULL))
psymtab_to_symtab (ps);
}
@@ -1042,13 +1110,14 @@ psymtab_to_fullname (struct partial_symt
}
static const char *
-find_symbol_file_from_partial (struct objfile *objfile, const char *name)
+find_symbol_file_from_partial (struct objfile *objfile, const char *name,
+ enum language language)
{
struct partial_symtab *pst;
ALL_OBJFILE_PSYMTABS (objfile, pst)
{
- if (lookup_partial_symbol (pst, name, 1, VAR_DOMAIN))
+ if (lookup_partial_symbol (pst, name, 1, VAR_DOMAIN, language))
return pst->filename;
}
return NULL;
Index: gdb-7.2.50.20110206/gdb/symfile.h
===================================================================
--- gdb-7.2.50.20110206.orig/gdb/symfile.h 2011-02-06 23:12:16.000000000 +0100
+++ gdb-7.2.50.20110206/gdb/symfile.h 2011-02-06 23:12:22.000000000 +0100
@@ -167,14 +167,15 @@ struct quick_symbol_functions
/* Check to see if the symbol is defined in a "partial" symbol table
of OBJFILE. KIND should be either GLOBAL_BLOCK or STATIC_BLOCK,
depending on whether we want to search global symbols or static
- symbols. NAME is the name of the symbol to look for. DOMAIN
- indicates what sort of symbol to search for.
+ symbols. NAME (valid in LANGUAGE) is the name of the symbol to look for.
+ DOMAIN indicates what sort of symbol to search for.
Returns the newly-expanded symbol table in which the symbol is
defined, or NULL if no such symbol table exists. */
struct symtab *(*lookup_symbol) (struct objfile *objfile,
int kind, const char *name,
- domain_enum domain);
+ domain_enum domain,
+ enum language language);
/* This is called to expand symbol tables before looking up a
symbol. A backend can choose to implement this and then have its
@@ -200,10 +201,11 @@ struct quick_symbol_functions
struct section_offsets *new_offsets,
struct section_offsets *delta);
- /* Find all the symbols in OBJFILE named FUNC_NAME, and ensure that
- the corresponding symbol tables are loaded. */
+ /* Find all the symbols in OBJFILE named FUNC_NAME (valid in LANGUAGE),
+ and ensure that the corresponding symbol tables are loaded. */
void (*expand_symtabs_for_function) (struct objfile *objfile,
- const char *func_name);
+ const char *func_name,
+ enum language language);
/* Read all symbol tables associated with OBJFILE. */
void (*expand_all_symtabs) (struct objfile *objfile);
@@ -217,8 +219,10 @@ struct quick_symbol_functions
const char *filename);
/* Return the file name of the file holding the symbol in OBJFILE
- named NAME. If no such symbol exists in OBJFILE, return NULL. */
- const char *(*find_symbol_file) (struct objfile *objfile, const char *name);
+ named NAME (valid in LANGUAGE). If no such symbol exists in OBJFILE,
+ return NULL. */
+ const char *(*find_symbol_file) (struct objfile *objfile, const char *name,
+ enum language language);
/* Find global or static symbols in all tables that are in NAMESPACE
and for which MATCH (symbol name, NAME) == 0, passing each to
Index: gdb-7.2.50.20110206/gdb/symtab.c
===================================================================
--- gdb-7.2.50.20110206.orig/gdb/symtab.c 2011-02-06 23:12:16.000000000 +0100
+++ gdb-7.2.50.20110206/gdb/symtab.c 2011-02-06 23:12:22.000000000 +0100
@@ -1380,7 +1380,8 @@ lookup_symbol_aux_quick (struct objfile
if (!objfile->sf)
return NULL;
- symtab = objfile->sf->qf->lookup_symbol (objfile, kind, name, domain);
+ symtab = objfile->sf->qf->lookup_symbol (objfile, kind, name, domain,
+ current_language->la_language);
if (!symtab)
return NULL;
@@ -1554,7 +1555,8 @@ basic_lookup_transparent_type_quick (str
if (!objfile->sf)
return NULL;
- symtab = objfile->sf->qf->lookup_symbol (objfile, kind, name, STRUCT_DOMAIN);
+ symtab = objfile->sf->qf->lookup_symbol (objfile, kind, name, STRUCT_DOMAIN,
+ current_language->la_language);
if (!symtab)
return NULL;
@@ -1686,7 +1688,8 @@ find_main_filename (void)
if (!objfile->sf)
continue;
- result = objfile->sf->qf->find_symbol_file (objfile, name);
+ result = objfile->sf->qf->find_symbol_file (objfile, name,
+ current_language->la_language);
if (result)
return result;
}
Index: gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr11734-1.cc
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr11734-1.cc 2011-02-06 23:12:22.000000000 +0100
@@ -0,0 +1,30 @@
+/* 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/>.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@gnu.org */
+
+#include "pr11734.h"
+
+int
+main ()
+{
+ pr11734 *p = new pr11734;
+ p->foo ();
+ return 0;
+}
+
Index: gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr11734-2.cc
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr11734-2.cc 2011-02-06 23:12:22.000000000 +0100
@@ -0,0 +1,27 @@
+/* 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/>.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@gnu.org */
+
+#include "pr11734.h"
+
+void
+pr11734::foo(void)
+{
+}
+
Index: gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr11734-3.cc
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr11734-3.cc 2011-02-06 23:12:22.000000000 +0100
@@ -0,0 +1,27 @@
+/* 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/>.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@gnu.org */
+
+#include "pr11734.h"
+
+void
+pr11734::foo (int a)
+{
+}
+
Index: gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr11734-4.cc
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr11734-4.cc 2011-02-06 23:12:22.000000000 +0100
@@ -0,0 +1,27 @@
+/* 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/>.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@gnu.org */
+
+#include "pr11734.h"
+
+void
+pr11734::foo (char *a)
+{
+}
+
Index: gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr11734.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr11734.exp 2011-02-06 23:12:22.000000000 +0100
@@ -0,0 +1,55 @@
+# Copyright 2010 Free Software Foundation, Inc.
+#
+# Contributed by Red Hat, originally written by Keith Seitz.
+#
+# 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 part of the gdb testsuite.
+
+if { [skip_cplus_tests] } { continue }
+
+set testfile "pr11734"
+set class $testfile
+
+set srcfiles {}
+for {set i 1} {$i < 5} {incr i} {
+ lappend srcfiles $testfile-$i.cc
+}
+
+prepare_for_testing pr11734 $testfile $srcfiles {c++ debug}
+
+if {![runto_main]} {
+ perror "couldn't run to breakpoint"
+ continue
+}
+
+# An array holding the overload types for the method pr11734::foo. The
+# first element is the overloaded method parameter. The second element
+# is the expected source file number, e.g. "pr11734-?.cc".
+array set tests {
+ "char*" 4
+ "int" 3
+ "" 2
+}
+
+# Test each overload instance twice: once quoted, once unquoted
+foreach ovld [array names tests] {
+ set method "${class}::foo\($ovld\)"
+ set result "Breakpoint (\[0-9\]).*file .*/$class-$tests($ovld).*"
+ gdb_test "break $method" $result
+ gdb_test "break '$method'" $result
+}
+
+gdb_exit
+return 0
Index: gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr11734.h
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr11734.h 2011-02-06 23:12:22.000000000 +0100
@@ -0,0 +1,28 @@
+/* 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/>.
+
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@gnu.org */
+
+class pr11734
+{
+ public:
+ void foo ();
+ void foo (int);
+ void foo (char *);
+};
+

View File

@ -0,0 +1,18 @@
http://sourceware.org/ml/gdb-patches/2011-01/msg00460.html
Index: gdb-7.2/gdb/linespec.c
===================================================================
--- gdb-7.2.orig/gdb/linespec.c 2011-02-03 22:59:46.000000000 +0100
+++ gdb-7.2/gdb/linespec.c 2011-02-03 23:03:28.000000000 +0100
@@ -1230,7 +1230,10 @@ decode_compound (char **argptr, int funf
{
char *end = skip_quoted (saved_arg);
memmove (saved_arg, saved_arg + 1, end - saved_arg);
- memmove (end - 2, end, strlen (saved_arg) + 1);
+ if (&end[-2] >= saved_arg && end[-2] == '\'')
+ memmove (end - 2, end, strlen (end) + 1);
+ else
+ memmove (end - 1, end, strlen (end) + 1);
}
/* First check for "global" namespace specification, of the form

207
gdb-physname-pr12273.patch Normal file
View File

@ -0,0 +1,207 @@
http://sourceware.org/ml/gdb-patches/2010-12/msg00264.html
Index: gdb-7.2.50.20110206/gdb/linespec.c
===================================================================
--- gdb-7.2.50.20110206.orig/gdb/linespec.c 2011-02-06 23:06:26.000000000 +0100
+++ gdb-7.2.50.20110206/gdb/linespec.c 2011-02-06 23:08:23.000000000 +0100
@@ -1057,6 +1057,10 @@ locate_first_half (char **argptr, int *i
error (_("malformed template specification in command"));
p = temp_end;
}
+
+ if (p[0] == '(')
+ p = find_method_overload_end (p);
+
/* Check for a colon and a plus or minus and a [ (which
indicates an Objective-C method). */
if (is_objc_method_format (p))
@@ -1272,8 +1276,10 @@ decode_compound (char **argptr, int funf
find_method.
2) AAA::inA isn't the name of a class. In that case, either the
- user made a typo or AAA::inA is the name of a namespace.
- Either way, we just look up AAA::inA::fun with lookup_symbol.
+ user made a typo, AAA::inA is the name of a namespace, or it is
+ the name of a minimal symbol.
+ We just look up AAA::inA::fun with lookup_symbol. If that fails,
+ try lookup_minimal_symbol.
Thus, our first task is to find everything before the last set of
double-colons and figure out if it's the name of a class. So we
@@ -1294,6 +1300,8 @@ decode_compound (char **argptr, int funf
while (1)
{
+ static char *break_characters = " \t\'(";
+
/* Move pointer up to next possible class/namespace token. */
p = p2 + 1; /* Restart with old value +1. */
@@ -1304,8 +1312,7 @@ decode_compound (char **argptr, int funf
/* PASS2: p2->"::fun", p->":fun" */
/* Move pointer ahead to next double-colon. */
- while (*p && (p[0] != ' ') && (p[0] != '\t') && (p[0] != '\'')
- && (*p != '('))
+ while (*p && strchr (break_characters, *p) == NULL)
{
if (current_language->la_language == language_cplus)
p += cp_validate_operator (p);
@@ -1329,9 +1336,12 @@ decode_compound (char **argptr, int funf
else if ((p[0] == ':') && (p[1] == ':'))
break; /* Found double-colon. */
else
- /* PASS2: We'll keep getting here, until p->"", at which point
- we exit this loop. */
- p++;
+ {
+ /* PASS2: We'll keep getting here, until P points to one of the
+ break characters, at which point we exit this loop. */
+ if (strchr (break_characters, *p) == NULL)
+ p++;
+ }
}
if (*p != ':')
@@ -1340,7 +1350,7 @@ decode_compound (char **argptr, int funf
unsuccessfully all the components of the
string, and p->""(PASS2). */
- /* We get here if p points to ' ', '\t', '\'', "::" or ""(i.e
+ /* We get here if p points to one of the break characters or ""(i.e
string ended). */
/* Save restart for next time around. */
p2 = p;
@@ -1491,6 +1501,18 @@ decode_compound (char **argptr, int funf
/* We couldn't find a class, so we're in case 2 above. We check the
entire name as a symbol instead. */
+ if (current_language->la_language == language_cplus
+ || current_language->la_language == language_java)
+ {
+ char *paren = strchr (p, '(');
+ if (paren != NULL)
+ p = find_method_overload_end (paren);
+
+ /* Make sure we keep important kewords like "const" */
+ if (strncmp (p, " const", 6) == 0)
+ p += 6;
+ }
+
copy = (char *) alloca (p - saved_arg2 + 1);
memcpy (copy, saved_arg2, p - saved_arg2);
/* Note: if is_quoted should be true, we snuff out quote here
@@ -1503,9 +1525,18 @@ decode_compound (char **argptr, int funf
sym = lookup_symbol (copy, 0, VAR_DOMAIN, 0);
if (sym)
return symbol_found (funfirstline, canonical, copy, sym, NULL);
+ else
+ {
+ struct minimal_symbol *msym;
+
+ /* Couldn't find any interpretation as classes/namespaces. As a last
+ resort, try the minimal symbol tables. */
+ msym = lookup_minimal_symbol (copy, NULL, NULL);
+ if (msym != NULL)
+ return minsym_found (funfirstline, msym);
+ }
- /* Couldn't find any interpretation as classes/namespaces, so give
- up. The quotes are important if copy is empty. */
+ /* Couldn't find a minimal symbol, either, so give up. */
if (not_found_ptr)
*not_found_ptr = 1;
cplusplus_error (the_real_saved_arg,
Index: gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr12273.cc
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr12273.cc 2011-02-06 23:07:19.000000000 +0100
@@ -0,0 +1,37 @@
+/* This test case 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/>. */
+
+template <typename T>
+class GDB
+{
+ public:
+ static int simple (void) { return 0; }
+ static int harder (T a) { return 1; }
+ template <typename X>
+ static X even_harder (T a) { return static_cast<X> (a); }
+ int operator == (GDB const& other)
+ { return 1; }
+};
+
+int main(int argc, char **argv)
+{
+ GDB<int> a, b;
+ if (a == b)
+ return GDB<char>::harder('a') + GDB<int>::harder(3)
+ + GDB<char>::even_harder<int> ('a');
+ return GDB<int>::simple ();
+}
Index: gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr12273.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.2.50.20110206/gdb/testsuite/gdb.cp/pr12273.exp 2011-02-06 23:07:19.000000000 +0100
@@ -0,0 +1,46 @@
+# Copyright 2010 Free Software Foundation, Inc.
+#
+# Contributed by Red Hat, originally written by Keith Seitz.
+#
+# 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 part of the gdb testsuite.
+
+if {[skip_cplus_tests]} { continue }
+
+set testfile "pr12273"
+# Do NOT compile with debug flag.
+prepare_for_testing pr12273 $testfile $testfile.cc {c++}
+
+gdb_test_no_output "set language c++"
+
+# A list of minimal symbol names to check.
+# Note that GDB<char>::even_harder<int>(char) is quoted and includes
+# the return type. This is necessary because this is the demangled name
+# of the minimal symbol.
+set min_syms [list \
+ "GDB<int>::operator ==" \
+ "GDB<int>::operator==(GDB<int> const&)" \
+ "GDB<char>::harder(char)" \
+ "GDB<int>::harder(int)" \
+ {"int GDB<char>::even_harder<int>(char)"} \
+ "GDB<int>::simple()"]
+
+foreach sym $min_syms {
+ if {[gdb_breakpoint $sym]} {
+ pass "setting breakpoint at $sym"
+ }
+}
+
+gdb_exit

View File

@ -0,0 +1,154 @@
http://sourceware.org/ml/archer/2011-q1/msg00024.html
Subject: [patch] Fix RH BZ 672235
Bug:
http://bugzilla.redhat.com/show_bug.cgi?id=672235
The latter half of this bug was caused by removing the value function
from gdb.Symbol. This happened quite some time ago, so I am a little
surprised it took this long to surface.
The old Symbol.value function never returned anything except a gdb.Block
if the symbol happened to represent a function a block. Anything else
raised an error. Way back when, I removed this function as it was an
obvious stub, and it was superseded by frame.read_var() which is a more
accurate method of determining the value of a symbol.
Wind forward to today, and it turns out one of the unported
archer-tromey-python scripts we ship in Fedora relies on this (symbol ->
block) API. I thought about ways of trying to fix this. I thought about
just changing FrameWrapper to just take a block instead of a symbol
representing a function. But FrameWrapper has an API that we shipped.
I tried to find the block through the existing API, but that did not
work too well. The gdb.Block method block_for_pc can return a block
from a pc but this just turned out to be expensive and convoluted. I
eventually just elected to add a block() function to gdb.Symbol which,
if the symbol represented a method or a function, would return the block.
Yet I am still not entirely satisfied. It seems weird to ask the user
to retrieve symbol value from frame.read_var for most symbols, but in
the case of a function or method, use block(). I tried to use read_var
for this, but it returns a gdb.Value, and I could not figure out a way to
transform a gdb.Value to a gdb.Block.
Before I submit this for upstream review I'd like to see if anyone has
any comments.
Cheers
Phil
--
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 161ac1f..55eca2a 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -22718,6 +22718,13 @@ domain constant defined in the @code{gdb} module and described later
in this chapter.
@end defun
+A @code{gdb.Symbol} object has the following methods:
+
+@defmethod Symbol block
+Returns a @code{gdb.Block} object if the symbol is a function or a
+method. @xref{Blocks In Python}.
+@end defmethod
+
A @code{gdb.Symbol} object has the following attributes:
@table @code
diff --git a/gdb/python/lib/gdb/FrameWrapper.py b/gdb/python/lib/gdb/FrameWrapper.py
index b790a54..5d98b0f 100644
--- a/gdb/python/lib/gdb/FrameWrapper.py
+++ b/gdb/python/lib/gdb/FrameWrapper.py
@@ -46,7 +46,7 @@ class FrameWrapper:
return
first = True
- block = func.value
+ block = func.block ()
for sym in block:
if sym.is_argument:
@@ -60,7 +60,7 @@ class FrameWrapper:
return
first = True
- block = func.value
+ block = func.block ()
for sym in block:
if not sym.is_argument:
diff --git a/gdb/python/py-symbol.c b/gdb/python/py-symbol.c
index e072dc8..1dfe394 100644
--- a/gdb/python/py-symbol.c
+++ b/gdb/python/py-symbol.c
@@ -167,6 +167,27 @@ sympy_is_variable (PyObject *self, void *closure)
|| class == LOC_OPTIMIZED_OUT));
}
+static PyObject *
+sympy_get_block (PyObject *self, PyObject *args)
+{
+ struct symbol *symbol = NULL;
+
+ SYMPY_REQUIRE_VALID (self, symbol);
+
+ if (SYMBOL_CLASS (symbol) == LOC_BLOCK)
+ {
+ struct symtab *symt = SYMBOL_SYMTAB (symbol);
+
+ return block_to_block_object (SYMBOL_BLOCK_VALUE (symbol),
+ symt->objfile);
+ }
+ else
+ PyErr_SetString (PyExc_RuntimeError,
+ _("Symbol is not a block class."));
+
+ return NULL;
+}
+
/* Given a symbol, and a symbol_object that has previously been
allocated and initialized, populate the symbol_object with the
struct symbol data. Also, register the symbol_object life-cycle
@@ -362,6 +383,13 @@ gdbpy_initialize_symbols (void)
+static PyMethodDef symbol_object_methods[] = {
+ { "block", sympy_get_block, METH_NOARGS,
+ "block () -> gdb.Block.\n\
+Return the block of this symbol, if the symbol represents a function." },
+ {NULL} /* Sentinel */
+};
+
static PyGetSetDef symbol_object_getset[] = {
{ "symtab", sympy_get_symtab, NULL,
"Symbol table in which the symbol appears.", NULL },
@@ -415,7 +443,7 @@ PyTypeObject symbol_object_type = {
0, /*tp_weaklistoffset */
0, /*tp_iter */
0, /*tp_iternext */
- 0, /*tp_methods */
+ symbol_object_methods, /*tp_methods */
0, /*tp_members */
symbol_object_getset /*tp_getset */
};
diff --git a/gdb/testsuite/gdb.python/py-symbol.exp b/gdb/testsuite/gdb.python/py-symbol.exp
index 8e3aec1..6d43566 100644
--- a/gdb/testsuite/gdb.python/py-symbol.exp
+++ b/gdb/testsuite/gdb.python/py-symbol.exp
@@ -69,6 +69,10 @@ gdb_test "python print func.print_name" "func" "Test func.print_name"
gdb_test "python print func.linkage_name" "func" "Test func.linkage_name"
gdb_test "python print func.addr_class == gdb.SYMBOL_LOC_BLOCK" "True" "Test func.addr_class"
+# Test block() method
+gdb_py_test_silent_cmd "python func = frame.block().function" "Get block" 0
+gdb_test "python print func.block().function.name" "func" "Test block method"
+
gdb_breakpoint [gdb_get_line_number "Break at end."]
gdb_continue_to_breakpoint "Break at end."
gdb_py_test_silent_cmd "python frame = gdb.selected_frame()" "Get Frame" 0

View File

@ -0,0 +1,266 @@
http://sourceware.org/ml/gdb-patches/2009-11/msg00596.html
Subject: [gdb FYI-patch] callback-mode readline-6.0 regression
Hi Chet,
FSF GDB currently ships bundled with readline-5.2 which works fine.
But using --with-system-readline and readline-6.0-patchlevel4 has
a regression:
readline-5.2: Run `gdb -nx -q' and type CTRL-C:
(gdb) Quit
(gdb) _
readline-6.0: Run `gdb -nx -q' and type CTRL-C:
(gdb) _
= nothing happens (it gets buffered and executed later)
(It does also FAIL on gdb.gdb/selftest.exp.)
It is because GDB waits in its own poll() mainloop and readline uses via
rl_callback_handler_install and rl_callback_handler_remove. This way the
readline internal variable _rl_interrupt_immediately remains 0 and CTRL-C gets
only stored to _rl_caught_signal but not executed.
Seen in rl_signal_handler even if _rl_interrupt_immediately is set and
_rl_handle_signal is called then the signal is still stored to
_rl_caught_signal. In the _rl_interrupt_immediately case it should not be
stored when it was already processed.
rl_signal_handler does `_rl_interrupt_immediately = 0;' - while I am not aware
of its meaning it breaks the nest-counting of other routines which do
`_rl_interrupt_immediately++;' and `_rl_interrupt_immediately--;' possibly
creating problematic `_rl_interrupt_immediately == -1'.
`_rl_interrupt_immediately' is an internal variable, how it could be accessed
by a readline application? (OK, maybe it should not be used.)
Attaching a current GDB-side patch but it must access readline internal
variable _rl_caught_signal and it is generally just a workaround. Could you
please include support for signals in this asynchronous mode in readline-6.1?
I find it would be enough to make RL_CHECK_SIGNALS public?
GDB: No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
But this is not a patch intended to be accepted.
Thanks,
Jan
gdb/
2009-11-29 Jan Kratochvil <jan.kratochvil@redhat.com>
* config.in, configure: Regenerate.
* configure.ac (for readline_echoing_p): Move inside $LIBS change.
(for _rl_caught_signal): New.
* event-loop.c: Include readline/readline.h.
(gdb_do_one_event) [HAVE_READLINE_CAUGHT_SIGNAL]: New.
gdb/testsuite/
2009-11-29 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.gdb/selftest.exp (backtrace through signal handler): Move before
SIGINT pass, drop the timeout case.
(send SIGINT signal to child process): Use gdb_test.
(backtrace through readline handler): New.
Index: gdb-7.2.50.20110107/gdb/config.in
===================================================================
--- gdb-7.2.50.20110107.orig/gdb/config.in 2011-01-17 15:36:40.000000000 +0100
+++ gdb-7.2.50.20110107/gdb/config.in 2011-01-17 15:37:09.000000000 +0100
@@ -464,6 +464,9 @@
/* Define to 1 if wcwidth is declared even after undefining macros. */
#undef HAVE_RAW_DECL_WCWIDTH
+/* readline-6.0 workaround of blocked signals. */
+#undef HAVE_READLINE_CAUGHT_SIGNAL
+
/* Define to 1 if you have the `realpath' function. */
#undef HAVE_REALPATH
Index: gdb-7.2.50.20110107/gdb/configure.ac
===================================================================
--- gdb-7.2.50.20110107.orig/gdb/configure.ac 2011-01-17 15:36:42.000000000 +0100
+++ gdb-7.2.50.20110107/gdb/configure.ac 2011-01-17 15:37:09.000000000 +0100
@@ -736,17 +736,25 @@ if test "$with_system_readline" = yes; t
# readline-6.0 started to use the name `_rl_echoing_p'.
# `$(READLINE_DIR)/' of bundled readline would not resolve in configure.
- AC_MSG_CHECKING([for readline_echoing_p])
save_LIBS=$LIBS
LIBS="$LIBS $READLINE"
+ AC_MSG_CHECKING([for readline_echoing_p])
AC_LINK_IFELSE(AC_LANG_PROGRAM(,[[extern int readline_echoing_p;
return readline_echoing_p;]]),
[READLINE_ECHOING_P=yes],
[READLINE_ECHOING_P=no
AC_DEFINE([readline_echoing_p], [_rl_echoing_p],
[readline-6.0 started to use different name.])])
- LIBS="$save_LIBS"
AC_MSG_RESULT([$READLINE_ECHOING_P])
+ AC_MSG_CHECKING([for _rl_caught_signal])
+ AC_LINK_IFELSE(AC_LANG_PROGRAM(,[[extern int volatile _rl_caught_signal;
+ return _rl_caught_signal;]]),
+ [READLINE_CAUGHT_SIGNAL=yes
+ AC_DEFINE([HAVE_READLINE_CAUGHT_SIGNAL],,
+ [readline-6.0 workaround of blocked signals.])],
+ [READLINE_CAUGHT_SIGNAL=no])
+ AC_MSG_RESULT([$READLINE_CAUGHT_SIGNAL])
+ LIBS="$save_LIBS"
else
READLINE='$(READLINE_DIR)/libreadline.a'
READLINE_DEPS='$(READLINE)'
Index: gdb-7.2.50.20110107/gdb/event-loop.c
===================================================================
--- gdb-7.2.50.20110107.orig/gdb/event-loop.c 2011-01-05 23:22:48.000000000 +0100
+++ gdb-7.2.50.20110107/gdb/event-loop.c 2011-01-17 15:37:23.000000000 +0100
@@ -37,6 +37,7 @@
#include "exceptions.h"
#include "gdb_assert.h"
#include "gdb_select.h"
+#include "readline/readline.h"
/* Tell create_file_handler what events we are interested in.
This is used by the select version of the event loop. */
@@ -419,6 +420,9 @@ gdb_do_one_event (void *data)
static int event_source_head = 0;
const int number_of_sources = 3;
int current = 0;
+#ifdef HAVE_READLINE_CAUGHT_SIGNAL
+ extern int volatile _rl_caught_signal;
+#endif
/* Any events already waiting in the queue? */
if (process_event ())
@@ -463,6 +467,29 @@ gdb_do_one_event (void *data)
if (gdb_wait_for_event (1) < 0)
return -1;
+#ifdef HAVE_READLINE_CAUGHT_SIGNAL
+ if (async_command_editing_p && RL_ISSTATE (RL_STATE_CALLBACK)
+ && _rl_caught_signal)
+ {
+ char *prompt;
+
+ if (rl_prompt == NULL)
+ {
+ /* Should not happen, defensive only. */
+ prompt = "";
+ }
+ else
+ {
+ prompt = alloca (strlen (rl_prompt) + 1);
+ strcpy (prompt, rl_prompt);
+ }
+
+ /* Call RL_CHECK_SIGNALS this way. */
+ rl_callback_handler_remove ();
+ rl_callback_handler_install (prompt, input_handler);
+ }
+#endif
+
/* Handle any new events occurred while waiting. */
if (process_event ())
return 1;
Index: gdb-7.2.50.20110107/gdb/testsuite/gdb.gdb/selftest.exp
===================================================================
--- gdb-7.2.50.20110107.orig/gdb/testsuite/gdb.gdb/selftest.exp 2011-01-17 15:36:37.000000000 +0100
+++ gdb-7.2.50.20110107/gdb/testsuite/gdb.gdb/selftest.exp 2011-01-17 15:37:09.000000000 +0100
@@ -433,6 +433,28 @@ proc test_with_self { executable } {
}
}
+ # get a stack trace with the poll function
+ #
+ # This fails on some linux systems for unknown reasons. On the
+ # systems where it fails, sometimes it works fine when run manually.
+ # The testsuite failures may not be limited to just aout systems.
+ setup_xfail "i*86-pc-linuxaout-gnu"
+ set description "backtrace through signal handler"
+ gdb_test_multiple "backtrace" "$description" {
+ -re "#0.*(read|poll).*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
+ pass "$description"
+ }
+ -re ".*$gdb_prompt $" {
+ # On the alpha, we hit the infamous problem about gdb
+ # being unable to get the frame pointer (mentioned in
+ # gdb/README). As it is intermittent, there is no way to
+ # XFAIL it which will give us an XPASS if the problem goes
+ # away.
+ setup_xfail "alpha*-*-osf*"
+ fail "$description"
+ }
+ }
+
set description "send SIGINT signal to child process"
gdb_test "signal SIGINT" \
"Continuing with signal SIGINT.*" \
@@ -443,10 +465,11 @@ proc test_with_self { executable } {
# This fails on some linux systems for unknown reasons. On the
# systems where it fails, sometimes it works fine when run manually.
# The testsuite failures may not be limited to just aout systems.
+ # Optional system readline may not have symbols to be shown.
setup_xfail "i*86-pc-linuxaout-gnu"
- set description "backtrace through signal handler"
+ set description "backtrace through readline handler"
gdb_test_multiple "backtrace" "$description" {
- -re "#0.*(read|poll).*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
+ -re "#0.*gdb_do_one_event.*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
pass "$description"
}
-re ".*$gdb_prompt $" {
Index: gdb-7.2.50.20110107/gdb/configure
===================================================================
--- gdb-7.2.50.20110107.orig/gdb/configure 2011-01-17 15:36:42.000000000 +0100
+++ gdb-7.2.50.20110107/gdb/configure 2011-01-17 15:37:09.000000000 +0100
@@ -10237,10 +10237,10 @@ if test "$with_system_readline" = yes; t
# readline-6.0 started to use the name `_rl_echoing_p'.
# `$(READLINE_DIR)/' of bundled readline would not resolve in configure.
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline_echoing_p" >&5
-$as_echo_n "checking for readline_echoing_p... " >&6; }
save_LIBS=$LIBS
LIBS="$LIBS $READLINE"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline_echoing_p" >&5
+$as_echo_n "checking for readline_echoing_p... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -10263,9 +10263,35 @@ $as_echo "#define readline_echoing_p _rl
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- LIBS="$save_LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINE_ECHOING_P" >&5
$as_echo "$READLINE_ECHOING_P" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _rl_caught_signal" >&5
+$as_echo_n "checking for _rl_caught_signal... " >&6; }
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+extern int volatile _rl_caught_signal;
+ return _rl_caught_signal;
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ READLINE_CAUGHT_SIGNAL=yes
+
+$as_echo "#define HAVE_READLINE_CAUGHT_SIGNAL /**/" >>confdefs.h
+
+else
+ READLINE_CAUGHT_SIGNAL=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINE_CAUGHT_SIGNAL" >&5
+$as_echo "$READLINE_CAUGHT_SIGNAL" >&6; }
+ LIBS="$save_LIBS"
else
READLINE='$(READLINE_DIR)/libreadline.a'
READLINE_DEPS='$(READLINE)'

View File

@ -0,0 +1,220 @@
http://sourceware.org/ml/archer/2010-q3/msg00028.html
Subject: [delayed-symfile] [commit] Fix a regression on CFI without DIE [Re:
On Wed, 25 Feb 2009 00:14:29 +0100, Jan Kratochvil wrote:
> commit 6a37c2b9962258ecf9299cc34a650e64a06acaa5
>
> There was a regression on gdb.base/savedregs.exp.
>
> quick_addrmap/require_partial_symbols should be used even for the unwind debug
> info checking as its load has been also delayed by this branch.
[...]
> --- a/gdb/dwarf2-frame.c
> +++ b/gdb/dwarf2-frame.c
[...]
> @@ -1499,6 +1500,14 @@ dwarf2_frame_find_fde (CORE_ADDR *pc)
> struct dwarf2_fde *fde;
> CORE_ADDR offset;
>
> + if (objfile->quick_addrmap)
> + {
> + if (!addrmap_find (objfile->quick_addrmap, *pc))
> + continue;
> + }
> + /* FIXME: Read-in only .debug_frame/.eh_frame without .debug_info? */
> + require_partial_symbols (objfile);
> +
but this has caused a different regression (as discussed in the confcall).
QUICK_ADDRMAP is built only from .debug_aranges. But we can have existing
built .debug_aranges for CUs in OBJFILE but still some CUs do not need to have
DWARF at all while they can feature CFIs (.eh_frame or .debug_frame).
It has been described by Daniel Jacobowitz at:
Re: [2/4] RFC: check psymtabs_addrmap before reading FDEs
http://sourceware.org/ml/gdb-patches/2010-07/msg00012.html
Sorry for this regression by me (in that fix of a different regression).
Fixed it the "slow way" as this branch is now obsoleted by .gdb-index.
No regressions on {x86_64,x86_64-m32,i686}-fedora13-linux-gnu.
Checked-in.
Thanks,
Jan
eb8df8566acc1ed963e3e9b77c13b9c2c3db03fb
Test CFI is parsed even for range (function) not described by any DIE.
https://bugzilla.redhat.com/show_bug.cgi?id=614028
gdb/
* dwarf2-frame.c (dwarf2_frame_find_fde): Remove the
OBJFILE->QUICK_ADDRMAP check. New comment why.
gdb/testsuite/
* gdb.base/cfi-without-die.exp, gdb.base/cfi-without-die-main.c,
gdb.base/cfi-without-die-caller.c: New files.
---
gdb/dwarf2-frame.c | 8 +--
gdb/testsuite/gdb.base/cfi-without-die-caller.c | 28 ++++++++++
gdb/testsuite/gdb.base/cfi-without-die-main.c | 32 +++++++++++
gdb/testsuite/gdb.base/cfi-without-die.exp | 67 +++++++++++++++++++++++
4 files changed, 130 insertions(+), 5 deletions(-)
create mode 100644 gdb/testsuite/gdb.base/cfi-without-die-caller.c
create mode 100644 gdb/testsuite/gdb.base/cfi-without-die-main.c
create mode 100644 gdb/testsuite/gdb.base/cfi-without-die.exp
diff --git a/gdb/testsuite/gdb.base/cfi-without-die-caller.c b/gdb/testsuite/gdb.base/cfi-without-die-caller.c
new file mode 100644
index 0000000..afdfd53
--- /dev/null
+++ b/gdb/testsuite/gdb.base/cfi-without-die-caller.c
@@ -0,0 +1,28 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2005, 2007, 2008, 2009, 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/>. */
+
+typedef int (*callback_t) (void);
+
+int
+caller (callback_t callback)
+{
+ /* Ensure some frame content to push away the return address. */
+ volatile const long one = 1;
+
+ /* Modify the return value to prevent any tail-call optimization. */
+ return (*callback) () - one;
+}
diff --git a/gdb/testsuite/gdb.base/cfi-without-die-main.c b/gdb/testsuite/gdb.base/cfi-without-die-main.c
new file mode 100644
index 0000000..8451c4b
--- /dev/null
+++ b/gdb/testsuite/gdb.base/cfi-without-die-main.c
@@ -0,0 +1,32 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2005, 2007, 2008, 2009, 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/>. */
+
+typedef int (*callback_t) (void);
+
+extern int caller (callback_t callback);
+
+int
+callback (void)
+{
+ return 1;
+}
+
+int
+main (void)
+{
+ return caller (callback);
+}
diff --git a/gdb/testsuite/gdb.base/cfi-without-die.exp b/gdb/testsuite/gdb.base/cfi-without-die.exp
new file mode 100644
index 0000000..db6d248
--- /dev/null
+++ b/gdb/testsuite/gdb.base/cfi-without-die.exp
@@ -0,0 +1,67 @@
+# 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/>.
+
+# Test CFI is parsed even for range (function) not described by any DIE.
+
+set testfile cfi-without-die
+set srcmainfile ${testfile}-main.c
+set srccallerfile ${testfile}-caller.c
+set executable ${testfile}
+set objmainfile ${objdir}/${subdir}/${testfile}-main.o
+set objcallerfile ${objdir}/${subdir}/${testfile}-caller.o
+set binfile ${objdir}/${subdir}/${executable}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srccallerfile}" ${objcallerfile} \
+ object [list {additional_flags=-fomit-frame-pointer -fno-unwind-tables -fno-asynchronous-unwind-tables}]] != ""
+ || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" ${objmainfile} object {debug}] != ""
+ || [gdb_compile "${objmainfile} ${objcallerfile}" ${binfile} executable {}] != "" } {
+ untested ${testfile}.exp
+ return -1
+}
+
+clean_restart $executable
+
+if ![runto callback] then {
+ fail "verify unwinding: Can't run to callback"
+ return 0
+}
+set test "verify unwinding breaks without CFI"
+gdb_test_multiple "bt" $test {
+ -re " in main .*\r\n$gdb_prompt $" {
+ fail $test
+ }
+ -re "\r\n$gdb_prompt $" {
+ pass $test
+ }
+}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srccallerfile}" ${objcallerfile} \
+ object [list {additional_flags=-fomit-frame-pointer -funwind-tables -fasynchronous-unwind-tables}]] != ""
+ || [gdb_compile "${srcdir}/${subdir}/${srcmainfile}" ${objmainfile} object {debug}] != ""
+ || [gdb_compile "${objmainfile} ${objcallerfile}" ${binfile} executable {}] != "" } {
+ untested ${testfile}.exp
+ return -1
+}
+
+clean_restart $executable
+
+if ![runto callback] then {
+ fail "test CFI without DIEs: Can't run to callback"
+ return 0
+}
+# #0 callback () at ...
+# #1 0x00000000004004e9 in caller ()
+# #2 0x00000000004004cd in main () at ...
+gdb_test "bt" "#0 +callback \[^\r\n\]+\r\n#1 \[^\r\n\]+ in caller \[^\r\n\]+\r\n#2 \[^\r\n\]+ in main \[^\r\n\]+" "verify unwindin works for CFI without DIEs"
--
1.7.1.1

214
gdb-test-dw2-aranges.patch Normal file
View File

@ -0,0 +1,214 @@
[archer-tromey-delayed-symfile]
commit 77fa7778a37b0d28a7e4e5235f074a10ecf1815d
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date: Sat Aug 15 15:05:54 2009 +0200
Test for "handle incorrect aranges".
readelf:
Contents of the .debug_aranges section:
Length: 8
Version: 2
Offset into .debug_info: 0x0
Pointer Size: 0
Segment Size: 0
Address Length
Floating point exception
* gdb.dwarf2/dw2-aranges.exp, gdb.dwarf2/dw2-aranges.S: New files.
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.S b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S
new file mode 100644
index 0000000..d5b9ca5a
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.S
@@ -0,0 +1,140 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2004, 2007, 2008, 2009 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/>. */
+
+/* Test .debug_aranges containing zero address_size. */
+
+/* Dummy function to provide debug information for. */
+
+ .text
+.Lbegin_text1:
+ .globl main
+ .type main, %function
+main:
+.Lbegin_main:
+ .int 0
+.Lend_main:
+ .size main, .-main
+.Lend_text1:
+
+/* Debug information */
+
+ .section .debug_info
+.Lcu1_begin:
+ /* CU header */
+ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
+.Lcu1_start:
+ .2byte 2 /* DWARF Version */
+ .4byte .Labbrev1_begin /* Offset into abbrev section */
+ .byte 4 /* Pointer size */
+
+ /* CU die */
+ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
+ .4byte .Lend_text1 /* DW_AT_high_pc */
+ .4byte .Lbegin_text1 /* DW_AT_low_pc */
+ .ascii "file1.txt\0" /* DW_AT_name */
+ .ascii "GNU C 3.3.3\0" /* DW_AT_producer */
+ .byte 1 /* DW_AT_language (C) */
+
+ /* main */
+ .uleb128 2 /* Abbrev: DW_TAG_subprogram */
+ .byte 1 /* DW_AT_external */
+ .byte 1 /* DW_AT_decl_file */
+ .byte 2 /* DW_AT_decl_line */
+ .ascii "main\0" /* DW_AT_name */
+ .4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */
+ .4byte .Lbegin_main /* DW_AT_low_pc */
+ .4byte .Lend_main /* DW_AT_high_pc */
+ .byte 1 /* DW_AT_frame_base: length */
+ .byte 0x55 /* DW_AT_frame_base: DW_OP_reg5 */
+
+.Ltype_int:
+ .uleb128 3 /* Abbrev: DW_TAG_base_type */
+ .ascii "int\0" /* DW_AT_name */
+ .byte 4 /* DW_AT_byte_size */
+ .byte 5 /* DW_AT_encoding */
+
+ .byte 0 /* End of children of CU */
+
+.Lcu1_end:
+
+/* Abbrev table */
+ .section .debug_abbrev
+.Labbrev1_begin:
+ .uleb128 1 /* Abbrev code */
+ .uleb128 0x11 /* DW_TAG_compile_unit */
+ .byte 1 /* has_children */
+ .uleb128 0x12 /* DW_AT_high_pc */
+ .uleb128 0x1 /* DW_FORM_addr */
+ .uleb128 0x11 /* DW_AT_low_pc */
+ .uleb128 0x1 /* DW_FORM_addr */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0x25 /* DW_AT_producer */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0x13 /* DW_AT_language */
+ .uleb128 0xb /* DW_FORM_data1 */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+
+ .uleb128 2 /* Abbrev code */
+ .uleb128 0x2e /* DW_TAG_subprogram */
+ .byte 0 /* has_children */
+ .uleb128 0x3f /* DW_AT_external */
+ .uleb128 0xc /* DW_FORM_flag */
+ .uleb128 0x3a /* DW_AT_decl_file */
+ .uleb128 0xb /* DW_FORM_data1 */
+ .uleb128 0x3b /* DW_AT_decl_line */
+ .uleb128 0xb /* DW_FORM_data1 */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .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 */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+
+ .uleb128 3 /* Abbrev code */
+ .uleb128 0x24 /* DW_TAG_base_type */
+ .byte 0 /* has_children */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0xb /* DW_AT_byte_size */
+ .uleb128 0xb /* DW_FORM_data1 */
+ .uleb128 0x3e /* DW_AT_encoding */
+ .uleb128 0xb /* DW_FORM_data1 */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+
+/* aranges table */
+ .section .debug_aranges
+ .long .Laranges_end - 1f
+1:
+ .2byte 2 /* aranges Version */
+ .4byte .Lcu1_begin - .debug_info /* Offset into .debug_info section */
+ /* The GDB crasher is this zero value. */
+ .byte 0 /* aranges address_size */
+ .byte 0 /* aranges segment_size */
+
+.Laranges_end:
diff --git a/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp
new file mode 100644
index 0000000..39632d5
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-aranges.exp
@@ -0,0 +1,40 @@
+# Copyright 2004, 2005, 2007, 2008, 2009 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/>.
+
+# Test .debug_aranges containing zero address_size.
+
+# This test can only be run on targets which support DWARF-2 and use gas.
+# For now pick a sampling of likely targets.
+if {![istarget *-*-linux*]
+ && ![istarget *-*-gnu*]
+ && ![istarget *-*-elf*]
+ && ![istarget *-*-openbsd*]
+ && ![istarget arm-*-eabi*]
+ && ![istarget powerpc-*-eabi*]} {
+ return 0
+}
+
+set testfile "dw2-aranges"
+set srcfile ${testfile}.S
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {nodebug}] != "" } {
+ return -1
+}
+
+clean_restart $testfile
+
+# Failed gdb_load would abort the testcase execution earlier.
+pass "file loaded"

View File

@ -0,0 +1,207 @@
archer archer-keiths-expr-cumulative
b5a7497340b24199f0c7ba7fdf0d54d4df44d6bc
--- /dev/null 2011-01-12 06:28:36.282000001 +0100
+++ ./gdb/testsuite/gdb.cp/namespace-nested-imports.cc 2009-09-25 06:50:38.000000000 +0200
@@ -0,0 +1,36 @@
+namespace A
+{
+ namespace B
+ {
+ int ab = 11;
+ }
+}
+
+namespace C
+{
+ namespace D
+ {
+ using namespace A::B;
+
+ int
+ second()
+ {
+ ab;
+ return 0;
+ }
+ }
+
+ int
+ first()
+ {
+ //ab;
+ return D::second();
+ }
+}
+
+int
+main()
+{
+ //ab;
+ return C::first();
+}
--- /dev/null 2011-01-12 06:28:36.282000001 +0100
+++ ./gdb/testsuite/gdb.cp/namespace-nested-imports.exp 2009-09-25 06:50:38.000000000 +0200
@@ -0,0 +1,50 @@
+# Copyright 2008 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 namespace-nested-imports
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+
+# Get things started.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+############################################
+if ![runto_main] then {
+ perror "couldn't run to breakpoint main"
+ continue
+}
+
+gdb_test "print ab" "No symbol .* in current context."
+
+############################################
+gdb_breakpoint C::first
+gdb_continue_to_breakpoint "C::first"
+
+gdb_test "print ab" "No symbol .* in current context."
+gdb_test "print C::D::ab" "= 11"
+
+############################################
+gdb_breakpoint C::D::second
+gdb_continue_to_breakpoint "C::D::second"
+
+gdb_test "print ab" "= 11"
--- /dev/null 2011-01-12 06:28:36.282000001 +0100
+++ ./gdb/testsuite/gdb.cp/namespace-no-imports.cc 2009-09-25 06:50:38.000000000 +0200
@@ -0,0 +1,37 @@
+
+namespace A
+{
+ int _a = 11;
+
+ namespace B{
+
+ int ab = 22;
+
+ namespace C{
+
+ int abc = 33;
+
+ int second(){
+ return 0;
+ }
+
+ }
+
+ int first(){
+ _a;
+ ab;
+ C::abc;
+ return C::second();
+ }
+ }
+}
+
+
+int
+main()
+{
+ A::_a;
+ A::B::ab;
+ A::B::C::abc;
+ return A::B::first();
+}
--- /dev/null 2011-01-12 06:28:36.282000001 +0100
+++ ./gdb/testsuite/gdb.cp/namespace-no-imports.exp 2009-09-25 06:50:38.000000000 +0200
@@ -0,0 +1,69 @@
+# Copyright 2008 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 namespace-no-imports
+set srcfile ${testfile}.cc
+set binfile ${objdir}/${subdir}/${testfile}
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } {
+ untested "Couldn't compile test program"
+ return -1
+}
+
+# Get things started.
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+############################################
+if ![runto_main] then {
+ perror "couldn't run to breakpoint main"
+ continue
+}
+
+gdb_test "print A::_a" "= 11"
+gdb_test "print A::B::ab" "= 22"
+gdb_test "print A::B::C::abc" "= 33"
+
+gdb_test "print _a" "No symbol .* in current context."
+gdb_test "print ab" "No symbol .* in current context."
+gdb_test "print abc" "No symbol .* in current context."
+
+############################################
+gdb_breakpoint A::B::first
+gdb_continue_to_breakpoint "A::B::first"
+
+gdb_test "print A::_a" "= 11"
+gdb_test "print A::B::ab" "= 22"
+gdb_test "print A::B::C::abc" "= 33"
+
+gdb_test "print _a" "= 11"
+gdb_test "print ab" "= 22"
+gdb_test "print C::abc" "= 33"
+
+gdb_test "print abc" "No symbol .* in current context."
+
+############################################
+gdb_breakpoint A::B::C::second
+gdb_continue_to_breakpoint "A::B::C::second"
+
+gdb_test "print A::_a" "= 11"
+gdb_test "print A::B::ab" "= 22"
+gdb_test "print A::B::C::abc" "= 33"
+
+gdb_test "print _a" "= 11"
+gdb_test "print ab" "= 22"
+gdb_test "print abc" "= 33"

80
gdb-test-pid0-core.patch Normal file
View File

@ -0,0 +1,80 @@
https://bugzilla.redhat.com/show_bug.cgi?id=611435
Fix:
Re: [RFA]corelow.c: Add tid to add_to_thread_list
http://sourceware.org/ml/gdb-patches/2010-08/msg00085.html
http://sourceware.org/ml/gdb-cvs/2010-08/msg00026.html
2e5bcfdef1ec3883d48c3f87a4be5c0dff25e17e
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.core.bz2.uu
@@ -0,0 +1,20 @@
+begin 600 x86_64-pid0-core.core.bz2
+M0EIH.3%!629362,CA>P!$/'_____^*#EZ-A!SP36P&_:G0#=14``04A&8,'U
+M2*9`>$$)P`*RN"#*;#4R()IJ8C$TT&FC3$&@`T`#:C1H8C0T,@,FC,D"4T2!
+M"/2CU'B90]31ZAD#U`&AZF@/4:``!HT&F@!H<`#0-`-#0``#3$-&F@```#0R
+M``#")2FD]2>4]0TTT-!HTT--,0,"#$`R!I@AD`#1H,3&GZT.4TO$#H40/`0C
+M2$IRXS,<55!8T,&&,R.Z441"?J9I%G6GUA2!.[]Z"C5S[&19,%VS7E6[3"60
+M@`-*2G)QEQ(;?0Y<=MK]/U?Q)LB%+F37TJ9BI*46)H'*Z@V"`"$"P7]&<Q<?
+M>XZ:JE0E<*:#1M$P3G]>VCI)(A!O$64`5$4`E$$-.``7&(09`8HO`B6K!Q^&
+M562%N)2+0@*HB@%D@5$%!*0!L1&0D4D6\:-$A`)`+<6D82PP*H(J(H!?F;0$
+M%PXB7N!2D4!44`W7"ADEQM6<B]J<B(%1GF'5*0;_00KO55=43LPR0,Q?N72`
+M8"W*_;DV<AN#,XRU]Q-J2FDAFKAQ(9A+ZK$MCY#EI8:W-(15>O9TBO5,_]1)
+M($Q2))#),UE,QQK)E$,3D\W.>!4)QO8A_@^Z_SXS<OEHM*+"M8I1)-C(=DIJ
+MW+@WN)O)YO;3:I9YW-A$)N'2<A`F3),R3"3-'"S3E1;6VE*_95KD<!0050(G
+M,JV"N(Z:@0E#)50BSF)$T6_IN)#"Z8PLQ4UQ9]@Z'+;T]990-:Y:2`P26#!D
+MV+0L6"X@C9`GHAGSY7)%LWOY+E[2/>4;Q8=HV6[:&$@2$@$R29IBW)K%3"O`
+M9^Y0YJ&BXY1U2HTZ5)2H-V\_(.DZHWE+C#WS($(!I"3CUH2#(+(OWUV"*<<9
+MJ%A!J[%O.P&V%GI.`L7<1@0>,^1F\MY=V5UT,&NOG%7TTZ[03!@BHB@&)<A^
+4B.Z!/,0-IZ^W_Q=R13A0D",CA>P`
+`
+end
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp
@@ -0,0 +1,46 @@
+# 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 2 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, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Some kernel core files have PID 0 - for the idle task.
+
+if ![istarget "x86_64-*-*"] {
+ verbose "Skipping x86_64-pid0-core test."
+ return
+}
+
+set testfile "x86_64-pid0-core"
+set corebz2uufile ${srcdir}/${subdir}/${testfile}.core.bz2.uu
+set corefile ${objdir}/${subdir}/${testfile}.core
+
+if {[catch "system \"uudecode -o - ${corebz2uufile} | bzip2 -dc >${corefile}\""] != 0} {
+ untested "failed uudecode or bzip2"
+ return -1
+}
+file stat ${corefile} corestat
+if {$corestat(size) != 8798208} {
+ untested "uudecode or bzip2 produce invalid result"
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+
+# Former crash was:
+# thread.c:884: internal-error: switch_to_thread: Assertion `inf != NULL' failed.
+gdb_test "core-file ${corefile}" "Program terminated with signal 11, Segmentation fault\\.\r\n.*"

View File

@ -0,0 +1,98 @@
http://sourceware.org/ml/gdb-patches/2011-01/msg00016.html
Subject: [patch] New testcase: py-prettyprint.exp: print hint_error
Hi,
PASS: gdb.python/py-prettyprint.exp: print hint_error
for
FYI: fix buglet in gdbpy_get_display_hint
http://sourceware.org/ml/gdb-patches/2010-07/msg00190.html
http://sourceware.org/ml/gdb-cvs/2010-07/msg00061.html
I would check it in as obvious but the 2011 ChangeLog move process has to be
done first. So to be checked in later.
Thanks,
Jan
gdb/testsuite/
2011-01-01 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.python/py-prettyprint.c (struct hint_error): New.
(main): New variable hint_error.
* gdb.python/py-prettyprint.exp (run_lang_tests): New testcase
"print hint_error".
* gdb.python/py-prettyprint.py (class pp_hint_error): New.
(register_pretty_printers): Register it.
Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.python/py-prettyprint.c
===================================================================
--- gdb-7.2.50.20110117.orig/gdb/testsuite/gdb.python/py-prettyprint.c 2011-01-01 16:33:49.000000000 +0100
+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.python/py-prettyprint.c 2011-01-17 16:08:16.000000000 +0100
@@ -44,6 +44,10 @@ struct lazystring {
const char *lazy_str;
};
+struct hint_error {
+ int x;
+};
+
#ifdef __cplusplus
struct S : public s {
int zs;
@@ -215,6 +219,7 @@ main ()
nostring_type nstype;
struct ns ns, ns2;
struct lazystring estring, estring2;
+ struct hint_error hint_error;
nstype.elements = narray;
nstype.len = 0;
Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.python/py-prettyprint.exp
===================================================================
--- gdb-7.2.50.20110117.orig/gdb/testsuite/gdb.python/py-prettyprint.exp 2011-01-01 16:33:49.000000000 +0100
+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.python/py-prettyprint.exp 2011-01-17 16:08:33.000000000 +0100
@@ -97,6 +97,8 @@ proc run_lang_tests {lang} {
gdb_test_no_output "python pp_ls_encoding = 'UTF-8'"
gdb_test "print estring2" "\"embedded \", <incomplete sequence \\\\302>"
+ gdb_test "print hint_error" "Exception: hint failed\r\nhint_error_val"
+
gdb_test "print c" " = container \"container\" with 2 elements = {$nl *.0. = 23,$nl *.1. = 72$nl}"
gdb_test "print nstype" " = {$nl *.0. = 7,$nl *.1. = 42$nl}"
Index: gdb-7.2.50.20110117/gdb/testsuite/gdb.python/py-prettyprint.py
===================================================================
--- gdb-7.2.50.20110117.orig/gdb/testsuite/gdb.python/py-prettyprint.py 2011-01-01 16:33:49.000000000 +0100
+++ gdb-7.2.50.20110117/gdb/testsuite/gdb.python/py-prettyprint.py 2011-01-17 16:08:16.000000000 +0100
@@ -156,6 +156,18 @@ class pp_ls:
def display_hint (self):
return 'string'
+class pp_hint_error:
+ "Throw error from display_hint"
+
+ def __init__(self, val):
+ self.val = val
+
+ def to_string(self):
+ return 'hint_error_val'
+
+ def display_hint (self):
+ raise Exception("hint failed")
+
class pp_outer:
"Print struct outer"
@@ -241,6 +253,9 @@ def register_pretty_printers ():
pretty_printers_dict[re.compile ('^struct outerstruct$')] = pp_outer
pretty_printers_dict[re.compile ('^outerstruct$')] = pp_outer
+ pretty_printers_dict[re.compile ('^struct hint_error$')] = pp_hint_error
+ pretty_printers_dict[re.compile ('^hint_error$')] = pp_hint_error
+
pretty_printers_dict = {}
register_pretty_printers ()

View File

@ -1,46 +0,0 @@
https://bugzilla.redhat.com/show_bug.cgi?id=610986
http://sourceware.org/ml/gdb-cvs/2010-08/msg00112.html
### src/gdb/ChangeLog 2010/08/18 22:57:45 1.12097
### src/gdb/ChangeLog 2010/08/19 07:34:26 1.12098
## -1,3 +1,9 @@
+2010-08-19 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * varobj.c (varobj_create): Replace variable old_fi with old_id,
+ initialize it by null_frame_id, wrap its usage by get_frame_id,
+ frame_id_p and frame_find_by_id.
+
2010-08-18 Tom Tromey <tromey@redhat.com>
PR python/11900:
--- src/gdb/varobj.c 2010/08/06 14:17:56 1.159
+++ src/gdb/varobj.c 2010/08/19 07:34:27 1.160
@@ -524,7 +524,7 @@ varobj_create (char *objname,
{
struct varobj *var;
struct frame_info *fi;
- struct frame_info *old_fi = NULL;
+ struct frame_id old_id = null_frame_id;
struct block *block;
struct cleanup *old_chain;
@@ -611,7 +611,7 @@
var->root->frame = get_frame_id (fi);
var->root->thread_id = pid_to_thread_id (inferior_ptid);
- old_fi = get_selected_frame (NULL);
+ old_id = get_frame_id (get_selected_frame (NULL));
select_frame (fi);
}
@@ -639,8 +639,8 @@
var->root->rootvar = var;
/* Reset the selected frame */
- if (old_fi != NULL)
- select_frame (old_fi);
+ if (frame_id_p (old_id))
+ select_frame (frame_find_by_id (old_id));
}
/* If the variable object name is null, that means this

View File

@ -1,3 +1,133 @@
-------------------------------------------------------------------
Thu Mar 3 12:42:45 UTC 2011 - rguenther@novell.com
- Merge from gdb-7.2.50.20110206-19.fc15.src.rpm.
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 7.2.50.20110206-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Sun Feb 6 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110206-18.fc15
- Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz).
* Sun Feb 6 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110206-17.fc15
- Rebase to FSF GDB 7.2.50.20110206 (which is a 7.3 pre-release).
* Thu Jan 27 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110125-16.fc15
- Fix Python new-backtrace command (BZ 672235, Phil Muldoon).
* Wed Jan 26 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110125-15.fc15
- Temporary fix of F15 gcc-4.6 child DIEs of DW_TAG_typedef (BZ 672230).
- Workaround gcc-4.6 stdarg false prologue end (GDB PR 12435 + GCC PR 47471).
* Tue Jan 25 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110125-14.fc15
- Rebase to FSF GDB 7.2.50.20110125 (which is a 7.3 pre-release).
- Fix discontiguous address ranges in .gdb_index - v3->v4 (BZ 672281).
- Fix DWARF-3+ DW_AT_accessibility default assumption for F15 gcc-4.6.
* Thu Jan 20 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110117-13.fc15
- Use librpm.so.2 for rpm-4.9.0 in Fedora 15.
* Mon Jan 17 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110117-12.fc15
- Use %%{?dist} for sanity checking tools compliance (suggested by Petr Muller).
* Mon Jan 17 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110117-11.fc15
- Rebase to FSF GDB 7.2.50.20110117 (which is a 7.3 pre-release).
- Fix callback-mode readline-6.0 regression for CTRL-C (for RHEL-6.0).
- Fix occasional NULL dereference of the readline-6.0 workaround (BZ 575516).
* Sat Jan 15 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110107-10.fc15
- [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604).
- [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp.
- [archer-keiths-expr-cumulative+upstream] Import C++ testcases.
- testsuite: Fix gdb-test-expr-cumulative-archer.patch compatibility.
* Fri Jan 7 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110107-9.fc15
- Remove --with-pythondir as no longer valid.
- Provide %{_bindir}gdb-add-index even on RHEL-5.
- Provide again libstdc++ pretty printers for any RHEL.
* Fri Jan 7 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110107-8.fc15
- Rebase to FSF GDB 7.2.50.20110107 (which is a 7.3 pre-release).
- Import archer-tromey-python (BZ 666177, branch update by Phil Muldoon).
* Tue Jan 4 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20110104-7.fc15
- Rebase to FSF GDB 7.2.50.20110104 (which is a 7.3 pre-release).
- New testcase py-prettyprint.exp:print hint_error (for BZ 611569, BZ 629236).
- New test gdb.arch/x86_64-pid0-core.exp for kernel PID 0 cores (BZ 611435).
* Sat Jan 1 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20101231-6.fc15
- Fix --with-system-readline doc build upstream regression.
* Sat Jan 1 2011 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20101231-5.fc15
- Rebase to FSF GDB 7.2.50.20101231 (which is a 7.3 pre-release).
- Remove gdb-6.3-bt-past-zero-20051201.patch, gdb-archer-ada.patch and
gdb-6.3-framepczero-20040927.patch already removed from .spec before.
- Remove gdb-6.5-dwarf-stack-overflow.patch, upstreamed (Tom Tromey).
- Remove gdb-6.6-bz225783-gdb-debuginfo-paths.patch, upstreamed (Tom Tromey).
- Remove gdb-6.6-readline-system.patch, reimplemented upstream (Tom Tromey).
- Remove gdb-bz642879-elfread-sigint-stale.patch, upstreamed (Jan Kratochvil).
- Remove gdb-next-over-throw.patch, upstreamed (Tom Tromey).
* Mon Dec 27 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20101117-4.fc15
- Provide stub %%{_sysconfdir}/gdbinit (BZ 651232).
* Mon Dec 27 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20101117-3.fc15
- Fix ppc* compilation of PRPSINFO in the core files (BZ 662995, for BZ 254229).
- Fix (disable) non-x86* compilation of libinproctrace.so (for BZ 662995).
* Thu Nov 18 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20101117-2.fc15
- Drop gdb-6.8-glibc-headers-compat.patch: GNU/Linux irrelevant (Tom Tromey).
- Drop gdb-6.3-terminal-fix-20050214.patch: The bug is not reproducible.
- Drop gdb-6.7-kernel-headers-compat.patch: kernel-headers seem to be fixed.
- Drop gdb-archer-ada.patch: No longer needed for Ada (Keith Seitz).
- New PR backtrace/12237, drop gdb-6.3-framepczero-20040927.patch
gdb-6.3-bt-past-zero-20051201.patch as they already had no effect.
- Drop gdb-6.8-gcc35998-ada-memory-trash.patch as a different fix is upstream.
- Drop gdb-6.3-inheritance-20050324.patch: the call is redundent (Tom Tromey).
- Drop gdb-6.3-large-core-20051206.patch: obsoleted by MAX_COPY_BYTES.
* Thu Nov 18 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2.50.20101117-1.fc15
- Rebase to FSF GDB 7.2.50.20101117 (which is a 7.3 pre-release).
* Sun Nov 7 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2-25.fc14
- iFort compat. - case insensitive DWARF not in lowercase (BZ 645773).
* Thu Oct 14 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2-24.fc14
- Add gdb.spec comments on the *.patch files upstream merge status.
* Thu Oct 14 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2-23.fc14
- Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879).
- Fix crash on CTRL-C while reading an ELF symbol file (BZ 642879).
* Tue Oct 12 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2-22.fc14
- testsuite: Provide missing lib/gdb-python.exp (for BZ 639089).
* Tue Oct 12 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2-21.fc14
- Fix python stale error state, also fix its save/restore (BZ 639089).
- Fix inferior exec of new PIE x86_64 (BZ 638979).
* Tue Oct 12 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2-20.fc14
- Fixup Release for 20.fc14.
* Tue Oct 12 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2-19.fc14
- Use .gdb_index v3 to fix excessive resources rqmnts (BZ 640634, Tom Tromey).
* Wed Oct 6 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2-18.fc14
- Fix false warning: non-absolute filename: <the main exec. file> (BZ 640648).
* Thu Sep 30 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.2-17.fc14
- New Conflicts: elfutils < 0.149 due to the .gdb_index .debug support.
-------------------------------------------------------------------
Mon Dec 6 13:53:30 UTC 2010 - rguenther@novell.com
- On SLE10 package libinproctrace in the main gdb package.
-------------------------------------------------------------------
Wed Oct 13 10:52:15 UTC 2010 - rguenther@novell.com
- Merge from gdb-7.2-16.fc14.src.rpm.
------------------------------------------------------------------- -------------------------------------------------------------------
Mon Sep 13 10:42:49 UTC 2010 - rguenther@novell.com Mon Sep 13 10:42:49 UTC 2010 - rguenther@novell.com

3408
gdb.spec

File diff suppressed because it is too large Load Diff

4
gdbinit Normal file
View File

@ -0,0 +1,4 @@
# System-wide GDB initialization file.
# FIXME: provide a wildcard.
source %{_sysconfdir}/gdbinit.d/gdb-heap.py