diff --git a/gdb-6.3-bt-past-zero-20051201.patch b/gdb-6.3-bt-past-zero-20051201.patch deleted file mode 100644 index 3cb4381..0000000 --- a/gdb-6.3-bt-past-zero-20051201.patch +++ /dev/null @@ -1,88 +0,0 @@ -2005-12-01 Jeff Johnston - - * 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 - - * setshow.exp: Add testing of "set backtrace past-zero-pc" option. - -2007-10-15 Jan Kratochvil - - 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."), _("\ diff --git a/gdb-6.3-bz231832-obstack-2gb.patch b/gdb-6.3-bz231832-obstack-2gb.patch index c63124a..ec88c56 100644 --- a/gdb-6.3-bz231832-obstack-2gb.patch +++ b/gdb-6.3-bz231832-obstack-2gb.patch @@ -1,11 +1,11 @@ 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-6.8/gdb/symmisc.c 2008-07-14 10:27:50.000000000 +0200 -@@ -230,8 +230,8 @@ print_objfile_statistics (void) +--- gdb-7.2.50.20101116.orig/gdb/symmisc.c 2010-11-16 07:53:59.000000000 +0100 ++++ gdb-7.2.50.20101116/gdb/symmisc.c 2010-11-16 08:03:08.000000000 +0100 +@@ -186,8 +186,8 @@ print_objfile_statistics (void) if (OBJSTAT (objfile, sz_strtab) > 0) printf_filtered (_(" Space used by a.out string tables: %d\n"), 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"), + (long) obstack_memory_used (&objfile->objfile_obstack)); printf_filtered (_(" Total memory used for psymbol cache: %d\n"), - bcache_memory_used (objfile->psymbol_cache)); - printf_filtered (_(" Total memory used for macro cache: %d\n"), -Index: gdb-6.8/include/obstack.h + bcache_memory_used (psymbol_bcache_get_bcache + (objfile->psymbol_cache))); +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-6.8/include/obstack.h 2008-07-14 10:27:50.000000000 +0200 +--- gdb-7.2.50.20101116.orig/include/obstack.h 2008-10-21 01:03:31.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 /* 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) \ : (((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-6.8/libiberty/obstack.c 2008-07-14 10:27:50.000000000 +0200 +--- gdb-7.2.50.20101116.orig/libiberty/obstack.c 2005-05-10 17:33:33.000000000 +0200 ++++ gdb-7.2.50.20101116/libiberty/obstack.c 2010-11-16 08:02:37.000000000 +0100 @@ -44,9 +44,11 @@ #if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1 #include diff --git a/gdb-6.3-framepczero-20040927.patch b/gdb-6.3-framepczero-20040927.patch deleted file mode 100644 index 3c9ed05..0000000 --- a/gdb-6.3-framepczero-20040927.patch +++ /dev/null @@ -1,28 +0,0 @@ -2004-09-27 Andrew Cagney - - * 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); - } - diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch index 9804aed..539490e 100644 --- a/gdb-6.3-gstack-20050411.patch +++ b/gdb-6.3-gstack-20050411.patch @@ -4,20 +4,20 @@ to install and uninstall. * 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/gdb/Makefile.in 2010-09-03 09:38:45.000000000 +0200 -@@ -1010,7 +1010,7 @@ install: all install-only +--- gdb-7.2.50.20101116.orig/gdb/Makefile.in 2010-11-05 15:31:25.000000000 +0100 ++++ gdb-7.2.50.20101116/gdb/Makefile.in 2010-11-16 07:56:10.000000000 +0100 +@@ -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 - # the system. --install-only: $(CONFIG_INSTALL) xml-syscall-install -+install-only: install-gstack $(CONFIG_INSTALL) xml-syscall-install +-install-only: $(CONFIG_INSTALL) ++install-only: install-gstack $(CONFIG_INSTALL) transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e "$$t"` ; \ if test "x$$transformed_name" = x; then \ -@@ -1046,7 +1046,25 @@ install-tui: +@@ -1008,7 +1008,25 @@ install-tui: install-python: $(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)'; \ echo gdb | sed -e $$t` ; \ if test "x$$transformed_name" = x; then \ -@@ -1068,6 +1086,17 @@ uninstall-tui: +@@ -1030,6 +1048,17 @@ uninstall-tui: fi ; \ rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \ $(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. 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 -+++ 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 @@ +#!/bin/sh + @@ -115,10 +115,10 @@ Index: gdb-7.2/gdb/gstack.sh + -e 's/^\((gdb) \)*//' \ + -e '/^#/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 -+++ 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 @@ +# Copyright (C) 2010 Free Software Foundation, Inc. + @@ -191,10 +191,10 @@ Index: gdb-7.2/gdb/testsuite/gdb.base/gstack.exp +gdb_exit + +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 -+++ 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 @@ +/* This testcase is part of GDB, the GNU debugger. + diff --git a/gdb-6.3-ia64-gcore-page0-20050421.patch b/gdb-6.3-ia64-gcore-page0-20050421.patch index 8a548ae..ed7d827 100644 --- a/gdb-6.3-ia64-gcore-page0-20050421.patch +++ b/gdb-6.3-ia64-gcore-page0-20050421.patch @@ -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-6.8.50.20090802/gdb/gcore.c 2009-08-03 12:28:56.000000000 +0200 -@@ -479,8 +479,14 @@ gcore_copy_callback (bfd *obfd, asection +--- gdb-7.2.50.20110107.orig/gdb/gcore.c 2011-01-05 23:22:49.000000000 +0100 ++++ gdb-7.2.50.20110107/gdb/gcore.c 2011-01-07 09:04:28.000000000 +0100 +@@ -534,8 +534,14 @@ gcore_copy_callback (bfd *obfd, asection if (size > total_size) size = total_size; @@ -16,5 +16,5 @@ Index: gdb-6.8.50.20090802/gdb/gcore.c + "ia64") + || bfd_section_vma (obfd, osec) != 0)) { - warning (_("Memory read failed for corefile section, %s bytes at %s."), - plongest (size), + warning (_("Memory read failed for corefile " + "section, %s bytes at %s."), diff --git a/gdb-6.3-ia64-sigill-20051115.patch b/gdb-6.3-ia64-sigill-20051115.patch index dadfcb9..b8daf45 100644 --- a/gdb-6.3-ia64-sigill-20051115.patch +++ b/gdb-6.3-ia64-sigill-20051115.patch @@ -12,10 +12,10 @@ gdb/testsuite: * gdb.arch/ia64-sigill.c: New test. * 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 -+++ 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 @@ +# 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 "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 -+++ 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 @@ +#include + @@ -79,11 +79,11 @@ Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.arch/ia64-sigill.c + 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-6.8.50.20081128/gdb/linux-nat.c 2008-12-02 21:11:11.000000000 +0100 -@@ -2974,7 +2974,8 @@ retry: +--- gdb-7.2.50.20101231.orig/gdb/linux-nat.c 2011-01-01 00:54:04.000000000 +0100 ++++ gdb-7.2.50.20101231/gdb/linux-nat.c 2011-01-01 00:55:58.000000000 +0100 +@@ -3652,7 +3652,8 @@ retry: threads can be a bit time-consuming so if we want decent performance with heavily multi-threaded programs, especially when 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)) { -@@ -2992,7 +2993,9 @@ retry: - && inf->stop_soon == NO_STOP_QUIETLY +@@ -3670,7 +3671,9 @@ retry: + && inf->control.stop_soon == NO_STOP_QUIETLY && signal_stop_state (signo) == 0 && signal_print_state (signo) == 0 - && signal_pass_state (signo) == 1) diff --git a/gdb-6.3-inheritance-20050324.patch b/gdb-6.3-inheritance-20050324.patch deleted file mode 100644 index ba2b540..0000000 --- a/gdb-6.3-inheritance-20050324.patch +++ /dev/null @@ -1,26 +0,0 @@ -2005-03-24 Jeff Johnston - - * 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; - } diff --git a/gdb-6.3-large-core-20051206.patch b/gdb-6.3-large-core-20051206.patch deleted file mode 100644 index 31717f2..0000000 --- a/gdb-6.3-large-core-20051206.patch +++ /dev/null @@ -1,305 +0,0 @@ -2005-12-14 Jeff Johnston - - * 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 - - 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 _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 - #include -+#include - #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 *, diff --git a/gdb-6.3-ppc64syscall-20040622.patch b/gdb-6.3-ppc64syscall-20040622.patch index 9907c2c..32f04a7 100644 --- a/gdb-6.3-ppc64syscall-20040622.patch +++ b/gdb-6.3-ppc64syscall-20040622.patch @@ -6,10 +6,10 @@ use to skip over first half of a GNU/Linux syscall and update "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-6.8.50.20090802/gdb/rs6000-tdep.c 2009-08-03 09:52:39.000000000 +0200 +--- gdb-7.2.50.20110117.orig/gdb/rs6000-tdep.c 2011-01-11 20:23:02.000000000 +0100 ++++ 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 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 by which we decrement sp to allocate 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, 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 li_found_pc = 0; 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 prev_insn_was_prologue_insn = 1; 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_fpr = -1; fdata->saved_vr = -1; -@@ -1545,6 +1547,55 @@ skip_prologue (struct gdbarch *gdbarch, +@@ -1553,6 +1555,55 @@ skip_prologue (struct gdbarch *gdbarch, break; 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) { /* mflr Rx */ /* 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 us that the subroutine call is not part of the line 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 this_sal = find_pc_line (pc, 0); - if ((prologue_sal.line == 0) || (prologue_sal.line != this_sal.line)) + if ((prologue_sal.line == 0) diff --git a/gdb-6.3-readnever-20050907.patch b/gdb-6.3-readnever-20050907.patch index 42157e8..44ac1b5 100644 --- a/gdb-6.3-readnever-20050907.patch +++ b/gdb-6.3-readnever-20050907.patch @@ -11,11 +11,11 @@ * 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.1.90.20100721/gdb/doc/gdb.texinfo 2010-07-23 20:59:15.000000000 +0200 -@@ -998,6 +998,12 @@ Read each symbol file's entire symbol ta +--- gdb-7.2.50.20110117.orig/gdb/doc/gdb.texinfo 2011-01-17 15:47:37.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/doc/gdb.texinfo 2011-01-17 15:50:41.000000000 +0100 +@@ -1007,6 +1007,12 @@ Read each symbol file's entire symbol ta the default, which is to read it incrementally as it is needed. 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 @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.1.90.20100721/gdb/main.c 2010-07-23 20:59:15.000000000 +0200 -@@ -391,6 +391,7 @@ captured_main (void *data) +--- gdb-7.2.50.20110117.orig/gdb/main.c 2011-01-17 15:50:21.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/main.c 2011-01-17 15:50:41.000000000 +0100 +@@ -395,6 +395,7 @@ captured_main (void *data) {"xdb", no_argument, &xdb_commands, 1}, {"dbx", no_argument, &dbx_commands, 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}, {"quiet", 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 (_("\ --quiet Do not print version number on startup.\n\ --readnow Fully read symbol files on first access.\n\ @@ -48,31 +48,31 @@ Index: gdb-7.1.90.20100721/gdb/main.c "), stream); fputs_unfiltered (_("\ --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.1.90.20100721/gdb/symfile.c 2010-07-23 20:59:15.000000000 +0200 -@@ -80,6 +80,7 @@ static void clear_symtab_users_cleanup ( +--- gdb-7.2.50.20110117.orig/gdb/symfile.c 2011-01-11 22:53:24.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/symfile.c 2011-01-17 15:50:53.000000000 +0100 +@@ -81,6 +81,7 @@ static void clear_symtab_users_cleanup ( - /* Global variables owned by this file */ - int readnow_symbol_files; /* Read full symbols immediately */ + /* Global variables owned by this file. */ + int readnow_symbol_files; /* Read full symbols immediately. */ +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.1.90.20100721/gdb/dwarf2read.c 2010-07-23 20:59:26.000000000 +0200 -@@ -54,6 +54,7 @@ - #include "exceptions.h" - #include "gdb_stat.h" - #include "completer.h" +--- gdb-7.2.50.20110117.orig/gdb/dwarf2read.c 2011-01-17 15:47:37.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/dwarf2read.c 2011-01-17 15:50:41.000000000 +0100 +@@ -57,6 +57,7 @@ + #include "vec.h" + #include "c-lang.h" + #include "valprint.h" +#include "top.h" #include #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); 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 ".", 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.1.90.20100721/gdb/top.h 2010-07-23 20:59:15.000000000 +0200 +--- gdb-7.2.50.20110117.orig/gdb/top.h 2011-01-01 16:33:18.000000000 +0100 ++++ 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 *); /* From random places. */ extern int readnow_symbol_files; +extern int readnever_symbol_files; - /* Perform _initialize initialization */ + /* Perform _initialize initialization. */ extern void gdb_init (char *); diff --git a/gdb-6.3-security-errata-20050610.patch b/gdb-6.3-security-errata-20050610.patch index b7d2532..d2d22aa 100644 --- a/gdb-6.3-security-errata-20050610.patch +++ b/gdb-6.3-security-errata-20050610.patch @@ -19,10 +19,10 @@ Proposed upstream but never committed upstream. (source_command): Update documentation. Check permissions if 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.1.90.20100720/gdb/cli/cli-cmds.c 2010-07-21 20:30:30.000000000 +0200 +--- gdb-7.2.50.20101231.orig/gdb/cli/cli-cmds.c 2010-12-29 03:11:04.000000000 +0100 ++++ gdb-7.2.50.20101231/gdb/cli/cli-cmds.c 2011-01-01 00:53:51.000000000 +0100 @@ -39,6 +39,7 @@ #include "source.h" #include "disasm.h" @@ -31,7 +31,7 @@ Index: gdb-7.1.90.20100720/gdb/cli/cli-cmds.c #include "ui-out.h" -@@ -487,7 +488,7 @@ Script filename extension recognition is +@@ -488,7 +489,7 @@ Script filename extension recognition is int 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; 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; } @@ -73,7 +73,7 @@ Index: gdb-7.1.90.20100720/gdb/cli/cli-cmds.c do_cleanups (old_cleanups); *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) error (_("source command requires file name of file to source.")); @@ -81,19 +81,19 @@ Index: gdb-7.1.90.20100720/gdb/cli/cli-cmds.c + if (!find_and_open_script (file, search_path, &stream, &full_path, + from_tty)) { - /* The script wasn't found, or was otherwise inaccessible. - If the source command was invoked interactively, throw an error. - Otherwise (e.g. if it was invoked by a script), silently ignore - the error. */ + /* The script wasn't found, or was otherwise inaccessible. + If the source command was invoked interactively, throw an + error. Otherwise (e.g. if it was invoked by a script), + silently ignore the error. */ - if (from_tty) + if (from_tty > 0) perror_with_name (file); else 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 -+++ 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 @@ +# Copyright 2005 +# 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" -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 -+++ 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 @@ +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.1.90.20100720/gdb/main.c 2010-07-21 20:09:03.000000000 +0200 -@@ -794,7 +794,7 @@ Excess command line arguments ignored. ( +--- gdb-7.2.50.20101231.orig/gdb/main.c 2010-12-29 01:58:14.000000000 +0100 ++++ gdb-7.2.50.20101231/gdb/main.c 2011-01-01 00:53:09.000000000 +0100 +@@ -805,7 +805,7 @@ Excess command line arguments ignored. ( debugging or what directory you are in. */ 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. */ 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 the same as the $HOME/.gdbinit file (it should exist, also). */ 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 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.1.90.20100720/gdb/python/py-auto-load.c 2010-07-20 22:25:40.000000000 +0200 -@@ -219,7 +219,7 @@ source_section_scripts (struct objfile * +--- gdb-7.2.50.20101231.orig/gdb/python/py-auto-load.c 2010-12-15 18:27:59.000000000 +0100 ++++ gdb-7.2.50.20101231/gdb/python/py-auto-load.c 2011-01-01 00:53:09.000000000 +0100 +@@ -224,7 +224,7 @@ source_section_scripts (struct objfile * } 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, 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.1.90.20100720/gdb/cli/cli-cmds.h 2010-07-20 22:25:40.000000000 +0200 +--- gdb-7.2.50.20101231.orig/gdb/cli/cli-cmds.h 2010-12-29 03:11:04.000000000 +0100 ++++ 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); /* Exported to objfiles.c. */ diff --git a/gdb-6.3-terminal-fix-20050214.patch b/gdb-6.3-terminal-fix-20050214.patch deleted file mode 100644 index ea5b098..0000000 --- a/gdb-6.3-terminal-fix-20050214.patch +++ /dev/null @@ -1,28 +0,0 @@ -2005-02-14 Jeff Johnston - - * top.c (gdb_readline_wrapper): Ensure terminal is gdb's before calling - readline. - -2007-10-14 Jan Kratochvil - - 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; diff --git a/gdb-6.3-test-pie-20050107.patch b/gdb-6.3-test-pie-20050107.patch index 1b17e3f..3db364a 100644 --- a/gdb-6.3-test-pie-20050107.patch +++ b/gdb-6.3-test-pie-20050107.patch @@ -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.0.90.20100306/gdb/testsuite/configure.ac 2010-03-06 23:19:56.000000000 +0100 +--- gdb-7.2.50.20110117.orig/gdb/testsuite/configure.ac 2011-01-05 06:09:55.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 \ 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.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \ +- gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/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]) -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.0.90.20100306/gdb/testsuite/configure 2010-03-06 23:20:12.000000000 +0100 +--- gdb-7.2.50.20110117.orig/gdb/testsuite/configure 2011-01-07 03:51:09.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/testsuite/configure 2011-01-17 15:50:09.000000000 +0100 @@ -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.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.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 # This file is a shell script that caches the results of configure -@@ -4232,6 +4232,7 @@ do - "gdb.objc/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.objc/Makefile" ;; +@@ -4233,6 +4233,7 @@ do + "gdb.opencl/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opencl/Makefile" ;; "gdb.opt/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;; "gdb.pascal/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;; + "gdb.pie/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pie/Makefile" ;; "gdb.python/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;; "gdb.reverse/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.reverse/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 -+++ 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 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -56,10 +56,10 @@ Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.c + } + 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 -+++ 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 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -85,10 +85,10 @@ Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach2.c + } + 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 -+++ 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 @@ +/* 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; +} -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 -+++ 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 @@ +/* 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 marker4 (d) long d; {} /* set breakpoint 13 here */ +#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 -+++ 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 @@ +/* Copyright 1992, 1993, 1994, 1995, 1996, 1999 + Free Software Foundation, Inc. @@ -432,10 +432,10 @@ Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/coremaker.c + 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 -+++ 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 @@ +# 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 + +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 -+++ 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 @@ +# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, +# 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" + 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 -+++ 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 @@ +# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# 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 "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 -+++ 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 @@ +VPATH = @srcdir@ +srcdir = @srcdir@ diff --git a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch index 1882193..7429a5e 100644 --- a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +++ b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch @@ -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 <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.0.50.20100128/gdb/gdbtypes.c 2010-01-28 12:52:48.000000000 +0100 -@@ -3978,6 +3978,9 @@ gdbtypes_post_init (struct gdbarch *gdba +--- gdb-7.2.50.20101116.orig/gdb/gdbtypes.c 2010-11-16 07:53:59.000000000 +0100 ++++ gdb-7.2.50.20101116/gdb/gdbtypes.c 2010-11-16 08:01:33.000000000 +0100 +@@ -4262,6 +4262,9 @@ gdbtypes_post_init (struct gdbarch *gdba = arch_type (gdbarch, TYPE_CODE_INTERNAL_FUNCTION, 0, ""); @@ -44,11 +44,11 @@ Index: gdb-7.0.50.20100128/gdb/gdbtypes.c 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.0.50.20100128/gdb/gdbtypes.h 2010-01-28 12:52:48.000000000 +0100 -@@ -1245,6 +1245,8 @@ struct builtin_type +--- gdb-7.2.50.20101116.orig/gdb/gdbtypes.h 2010-11-16 07:53:59.000000000 +0100 ++++ gdb-7.2.50.20101116/gdb/gdbtypes.h 2010-11-16 08:01:33.000000000 +0100 +@@ -1294,6 +1294,8 @@ struct builtin_type /* This type is used to represent a GDB internal function. */ 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. */ -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.0.50.20100128/gdb/parse.c 2010-01-28 12:53:20.000000000 +0100 -@@ -509,7 +509,11 @@ write_exp_msymbol (struct minimal_symbol +--- gdb-7.2.50.20101116.orig/gdb/parse.c 2010-11-16 07:53:59.000000000 +0100 ++++ gdb-7.2.50.20101116/gdb/parse.c 2010-11-16 08:01:33.000000000 +0100 +@@ -530,7 +530,11 @@ write_exp_msymbol (struct minimal_symbol case mst_text: case mst_file_text: case mst_solib_trampoline: @@ -74,12 +74,12 @@ Index: gdb-7.0.50.20100128/gdb/parse.c break; 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.0.50.20100128/gdb/target.c 2010-01-28 12:52:48.000000000 +0100 -@@ -1000,6 +1000,25 @@ pop_all_targets (int quitting) - pop_all_targets_above (dummy_stratum, quitting); +--- gdb-7.2.50.20101116.orig/gdb/target.c 2010-11-16 08:00:37.000000000 +0100 ++++ gdb-7.2.50.20101116/gdb/target.c 2010-11-16 08:01:52.000000000 +0100 +@@ -1067,6 +1067,25 @@ target_is_pushed (struct target_ops *t) + return 0; } +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 current thread's thread-local storage with offset OFFSET. */ 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 TLS is an ABI-specific thing. But we don't do that yet. */ else @@ -134,10 +134,10 @@ Index: gdb-7.0.50.20100128/gdb/target.c 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 -+++ 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 @@ +/* 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 */ +} -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 -+++ 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 @@ +# Copyright 2007 Free Software Foundation, Inc. + diff --git a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch index f8acbe7..ebfef4d 100644 --- a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch +++ b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch @@ -1,13 +1,13 @@ 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-6.8.50.20090803/gdb/symtab.c 2009-08-03 16:13:13.000000000 +0200 -@@ -2261,6 +2261,13 @@ find_pc_sect_line (CORE_ADDR pc, struct - /* See above comment about why warning is commented out */ - /* warning ("In stub for %s; unable to find real function/line info", SYMBOL_LINKAGE_NAME (msymbol)) */ ; +--- gdb-7.2.50.20110117.orig/gdb/symtab.c 2011-01-17 15:47:37.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/symtab.c 2011-01-17 15:51:48.000000000 +0100 +@@ -2015,6 +2015,13 @@ find_pc_sect_line (CORE_ADDR pc, struct + SYMBOL_LINKAGE_NAME (msymbol)); */ + ; /* fall through */ + /* `msymbol' trampoline may be located before its .text symbol + but this text symbol may be the address we were looking for. diff --git a/gdb-6.5-dwarf-stack-overflow.patch b/gdb-6.5-dwarf-stack-overflow.patch deleted file mode 100644 index 92428ba..0000000 --- a/gdb-6.5-dwarf-stack-overflow.patch +++ /dev/null @@ -1,52 +0,0 @@ -for gdb/ChangeLog: -2006-08-22 Will Drewry - Tavis Ormandy - - * dwarf2read.c (decode_locdesc): Enforce location description stack - boundaries. - * dwarfread.c (locval): Likewise. - -2007-10-15 Jan Kratochvil - - 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]); - } diff --git a/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch new file mode 100644 index 0000000..f0d71c0 --- /dev/null +++ b/gdb-6.6-buildid-locate-rpm-librpm-workaround.patch @@ -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 + #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; + }; diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index cfdf0c3..502bfa8 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -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.1.90.20100806/gdb/event-top.c 2010-08-06 17:42:05.000000000 +0200 +--- gdb-7.2.50.20101231.orig/gdb/event-top.c 2010-12-29 01:58:14.000000000 +0100 ++++ gdb-7.2.50.20101231/gdb/event-top.c 2011-01-01 01:07:37.000000000 +0100 @@ -33,6 +33,7 @@ #include "cli/cli-script.h" /* for reset_command_nest_depth */ #include "main.h" #include "gdbthread.h" +#include "symfile.h" - /* For dont_repeat() */ - #include "gdbcmd.h" -@@ -193,6 +194,8 @@ cli_command_loop (void) + #include "gdbcmd.h" /* for dont_repeat() */ + +@@ -192,6 +193,8 @@ cli_command_loop (void) char *a_prompt; char *gdb_prompt = get_prompt (); + debug_flush_missing (); + - /* Tell readline what the prompt to display is and what function it - will need to call after a whole line is read. This also displays - the first prompt. */ -@@ -264,6 +267,8 @@ display_gdb_prompt (char *new_prompt) + /* Tell readline what the prompt to display is and what function + it will need to call after a whole line is read. This also + displays the first prompt. */ +@@ -263,6 +266,8 @@ display_gdb_prompt (char *new_prompt) /* Reset the nesting depth used when trace-commands is set. */ 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 prompt. */ 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.1.90.20100806/gdb/elfread.c 2010-08-06 18:11:49.000000000 +0200 +--- gdb-7.2.50.20101231.orig/gdb/elfread.c 2011-01-01 01:05:01.000000000 +0100 ++++ gdb-7.2.50.20101231/gdb/elfread.c 2011-01-01 01:05:10.000000000 +0100 @@ -42,6 +42,7 @@ #include "gdbcore.h" #include "gdbcmd.h" @@ -40,7 +40,7 @@ Index: gdb-7.1.90.20100806/gdb/elfread.c 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; } @@ -114,6 +114,10 @@ Index: gdb-7.1.90.20100806/gdb/elfread.c +#endif /* !DLOPEN_LIBRPM */ + + gdb_assert (filename != NULL); ++ ++ if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0) ++ return 0; ++ + if (filename[0] != '/') + { + warning (_("Ignoring non-absolute filename: <%s>"), filename); @@ -399,7 +403,7 @@ Index: gdb-7.1.90.20100806/gdb/elfread.c avoidance. */ 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. */ missing_filepair_hash = NULL; } @@ -417,7 +421,7 @@ Index: gdb-7.1.90.20100806/gdb/elfread.c 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; @@ -460,23 +464,24 @@ Index: gdb-7.1.90.20100806/gdb/elfread.c } 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.1.90.20100806/gdb/symfile.h 2010-08-06 17:42:05.000000000 +0200 -@@ -577,6 +577,7 @@ extern struct build_id *build_id_addr_ge +--- gdb-7.2.50.20101231.orig/gdb/symfile.h 2011-01-01 01:05:01.000000000 +0100 ++++ gdb-7.2.50.20101231/gdb/symfile.h 2011-01-01 01:05:10.000000000 +0100 +@@ -559,6 +559,8 @@ extern struct build_id *build_id_addr_ge extern char *build_id_to_filename (struct build_id *build_id, char **link_return, int add_debug_suffix); extern void debug_print_missing (const char *binary, const char *debug); +extern void debug_flush_missing (void); ++#define BUILD_ID_MAIN_EXECUTABLE_FILENAME _("the main executable file") /* 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.1.90.20100806/gdb/testsuite/lib/gdb.exp 2010-08-06 17:42:05.000000000 +0200 -@@ -1359,7 +1359,7 @@ proc default_gdb_start { } { +--- gdb-7.2.50.20101231.orig/gdb/testsuite/lib/gdb.exp 2011-01-01 01:05:01.000000000 +0100 ++++ gdb-7.2.50.20101231/gdb/testsuite/lib/gdb.exp 2011-01-01 01:05:10.000000000 +0100 +@@ -1389,7 +1389,7 @@ proc default_gdb_start { } { 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" gdb_expect 10 { -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.1.90.20100806/gdb/testsuite/lib/mi-support.exp 2010-08-06 17:42:05.000000000 +0200 +--- gdb-7.2.50.20101231.orig/gdb/testsuite/lib/mi-support.exp 2011-01-01 01:05:01.000000000 +0100 ++++ 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 } { } } @@ -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" gdb_expect 10 { -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.1.90.20100806/gdb/tui/tui-interp.c 2010-08-06 17:42:05.000000000 +0200 +--- gdb-7.2.50.20101231.orig/gdb/tui/tui-interp.c 2010-05-18 00:21:43.000000000 +0200 ++++ gdb-7.2.50.20101231/gdb/tui/tui-interp.c 2011-01-01 01:05:10.000000000 +0100 @@ -30,6 +30,7 @@ #include "tui/tui.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 it will need to call after a whole line is read. This also 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.1.90.20100806/gdb/aclocal.m4 2010-08-06 17:42:05.000000000 +0200 +--- gdb-7.2.50.20101231.orig/gdb/aclocal.m4 2010-05-23 02:56:59.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 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'.])]) @@ -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. # # 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.1.90.20100806/gdb/config.in 2010-08-06 17:42:05.000000000 +0200 +--- gdb-7.2.50.20101231.orig/gdb/config.in 2010-09-02 19:12:35.000000000 +0200 ++++ gdb-7.2.50.20101231/gdb/config.in 2011-01-01 01:05:10.000000000 +0100 @@ -46,6 +46,9 @@ /* Define to BFD's default target vector. */ #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 language is requested. */ #undef ENABLE_NLS -@@ -231,6 +234,9 @@ +@@ -232,6 +235,9 @@ /* Define if Python 2.7 is being used. */ #undef HAVE_LIBPYTHON2_7 @@ -710,29 +715,29 @@ Index: gdb-7.1.90.20100806/gdb/config.in /* Define if libunwind library is being used. */ #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.1.90.20100806/gdb/configure 2010-08-06 17:42:05.000000000 +0200 -@@ -679,6 +679,9 @@ REPORT_BUGS_TO +--- gdb-7.2.50.20101231.orig/gdb/configure 2010-12-14 08:17:14.000000000 +0100 ++++ gdb-7.2.50.20101231/gdb/configure 2011-01-01 01:08:50.000000000 +0100 +@@ -680,6 +680,9 @@ REPORT_BUGS_TO PKGVERSION TARGET_OBS subdirs +RPM_LIBS +RPM_CFLAGS +PKG_CONFIG - pythondir - GDB_DATADIR_PATH 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_relocated_sources - with_pythondir +with_rpm enable_targets enable_64_bit_bfd enable_gdbcli -@@ -988,6 +992,9 @@ LDFLAGS +@@ -987,6 +991,9 @@ LDFLAGS LIBS CPPFLAGS CPP @@ -742,16 +747,16 @@ Index: gdb-7.1.90.20100806/gdb/configure YACC YFLAGS XMKMF' -@@ -1653,6 +1660,8 @@ Optional Packages: +@@ -1650,6 +1657,8 @@ Optional Packages: [DATADIR/gdb] - --with-pythondir install Python data files in this path - [DATADIR/gdb/python] + --with-relocated-sources=PATH + automatically relocate this path for source files + --with-rpm query rpm database for missing debuginfos (yes/no, + def. auto=librpm.so) --with-libunwind use libunwind frame unwinding support --with-curses use the curses library instead of the termcap 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 if you have headers in a nonstandard directory 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 the first program found out of: `bison -y', `byacc', `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 @@ -1244,16 +1249,17 @@ Index: gdb-7.1.90.20100806/gdb/configure + fi + fi +fi ++ - -Index: gdb-7.1.90.20100806/gdb/configure.ac + subdirs="$subdirs testsuite" +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.1.90.20100806/gdb/configure.ac 2010-08-06 17:42:05.000000000 +0200 -@@ -152,6 +152,198 @@ else - fi - AC_SUBST(pythondir) +--- gdb-7.2.50.20101231.orig/gdb/configure.ac 2010-12-14 08:17:15.000000000 +0100 ++++ gdb-7.2.50.20101231/gdb/configure.ac 2011-01-01 01:08:28.000000000 +0100 +@@ -108,6 +108,199 @@ AS_HELP_STRING([--with-relocated-sources + [Relocated directory for source files. ]) + ]) +# Integration with rpm library to support missing debuginfo suggestions. +# --without-rpm: Disable any rpm support. @@ -1447,13 +1453,14 @@ Index: gdb-7.1.90.20100806/gdb/configure.ac + fi + fi +fi ++ + AC_CONFIG_SUBDIRS(testsuite) - AC_CONFIG_SUBDIRS(doc testsuite) - -Index: gdb-7.1.90.20100806/gdb/acinclude.m4 + # Check whether to support alternative target configurations +Index: gdb-7.2.50.20101231/gdb/acinclude.m4 =================================================================== ---- gdb-7.1.90.20100806.orig/gdb/acinclude.m4 2010-08-06 17:42:01.000000000 +0200 -+++ gdb-7.1.90.20100806/gdb/acinclude.m4 2010-08-06 17:42:05.000000000 +0200 +--- gdb-7.2.50.20101231.orig/gdb/acinclude.m4 2010-05-27 05:40:45.000000000 +0200 ++++ gdb-7.2.50.20101231/gdb/acinclude.m4 2011-01-01 01:05:10.000000000 +0100 @@ -1,3 +1,5 @@ +# serial 1 + @@ -1469,3 +1476,16 @@ Index: gdb-7.1.90.20100806/gdb/acinclude.m4 # @defmac AC_PROG_CC_STDC # @maindex PROG_CC_STDC # @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); + diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index de92140..397e080 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -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.1.90.20100711/gdb/corelow.c 2010-07-12 11:07:33.000000000 +0200 +--- gdb-7.2.50.20110117.orig/gdb/corelow.c 2011-01-05 23:22:47.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/corelow.c 2011-01-17 15:52:06.000000000 +0100 @@ -47,6 +47,9 @@ #include "filenames.h" #include "progspace.h" @@ -12,8 +12,8 @@ Index: gdb-7.1.90.20100711/gdb/corelow.c #ifndef O_LARGEFILE -@@ -289,6 +292,52 @@ add_to_thread_list (bfd *abfd, asection - inferior_ptid = ptid; /* Yes, make it current */ +@@ -278,6 +281,52 @@ add_to_thread_list (bfd *abfd, asection + inferior_ptid = ptid; /* Yes, make it current. */ } +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. */ 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); 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 post_create_inferior throws (can happen easilly if you're loading 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 (); add_target (&core_ops); @@ -90,11 +90,11 @@ Index: gdb-7.1.90.20100711/gdb/corelow.c + NULL, NULL, NULL, + &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.1.90.20100711/gdb/doc/gdb.texinfo 2010-07-12 11:05:57.000000000 +0200 -@@ -14980,6 +14980,27 @@ information files. +--- gdb-7.2.50.20110117.orig/gdb/doc/gdb.texinfo 2011-01-17 15:50:41.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/doc/gdb.texinfo 2011-01-17 15:52:06.000000000 +0100 +@@ -15220,6 +15220,27 @@ information files. @end table @@ -122,11 +122,11 @@ Index: gdb-7.1.90.20100711/gdb/doc/gdb.texinfo @cindex @code{.gnu_debuglink} sections @cindex debug link sections A debug link is a special section of the executable file named -Index: gdb-7.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.1.90.20100711/gdb/solib-svr4.c 2010-07-12 11:05:57.000000000 +0200 -@@ -1181,9 +1181,49 @@ svr4_current_sos (void) +--- gdb-7.2.50.20110117.orig/gdb/solib-svr4.c 2011-01-17 15:47:37.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/solib-svr4.c 2011-01-17 15:52:06.000000000 +0100 +@@ -1179,9 +1179,49 @@ svr4_current_sos (void) safe_strerror (errcode)); else { @@ -179,10 +179,10 @@ Index: gdb-7.1.90.20100711/gdb/solib-svr4.c } 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.1.90.20100711/gdb/elfread.c 2010-07-12 11:30:30.000000000 +0200 +--- gdb-7.2.50.20110117.orig/gdb/elfread.c 2011-01-17 15:47:37.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/elfread.c 2011-01-17 15:52:06.000000000 +0100 @@ -38,6 +38,10 @@ #include "demangle.h" #include "psympriv.h" @@ -194,7 +194,7 @@ Index: gdb-7.1.90.20100711/gdb/elfread.c 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; } @@ -262,7 +262,7 @@ Index: gdb-7.1.90.20100711/gdb/elfread.c { 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; } @@ -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. */ 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) return 0; @@ -620,7 +620,7 @@ Index: gdb-7.1.90.20100711/gdb/elfread.c if (found == NULL) 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; } @@ -641,7 +641,7 @@ Index: gdb-7.1.90.20100711/gdb/elfread.c /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will 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++ = '/'; while (size-- > 0) 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. */ 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) @@ -859,7 +859,7 @@ Index: gdb-7.1.90.20100711/gdb/elfread.c xfree (build_id); /* Prevent looping on a stripped .debug file. */ 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); } else if (build_id_name != NULL) @@ -868,8 +868,8 @@ Index: gdb-7.1.90.20100711/gdb/elfread.c } return NULL; } -@@ -1131,9 +1706,10 @@ elf_symfile_read (struct objfile *objfil - `.gnu_debuglink' may no longer be present with `.note.gnu.build-id'. */ +@@ -1148,9 +1723,10 @@ elf_symfile_read (struct objfile *objfil + `.note.gnu.build-id'. */ if (!objfile_has_partial_symbols (objfile)) { - char *debugfile; @@ -881,7 +881,7 @@ Index: gdb-7.1.90.20100711/gdb/elfread.c if (debugfile == NULL) 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); 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) { 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); } -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.1.90.20100711/gdb/symfile.h 2010-07-12 11:06:18.000000000 +0200 -@@ -562,6 +562,13 @@ void free_symfile_segment_data (struct s +--- gdb-7.2.50.20110117.orig/gdb/symfile.h 2011-01-11 22:53:24.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/symfile.h 2011-01-17 15:52:06.000000000 +0100 +@@ -554,6 +554,13 @@ void free_symfile_segment_data (struct s extern struct cleanup *increment_reading_symtab (void); @@ -929,11 +929,11 @@ Index: gdb-7.1.90.20100711/gdb/symfile.h /* From dwarf2read.c */ 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.1.90.20100711/gdb/testsuite/lib/gdb.exp 2010-07-12 11:05:57.000000000 +0200 -@@ -1353,6 +1353,16 @@ proc default_gdb_start { } { +--- gdb-7.2.50.20110117.orig/gdb/testsuite/lib/gdb.exp 2011-01-17 15:47:37.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/testsuite/lib/gdb.exp 2011-01-17 15:52:06.000000000 +0100 +@@ -1395,6 +1395,16 @@ proc default_gdb_start { } { 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; } -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.1.90.20100711/gdb/testsuite/lib/mi-support.exp 2010-07-12 11:05:57.000000000 +0200 +--- gdb-7.2.50.20110117.orig/gdb/testsuite/lib/mi-support.exp 2011-01-01 16:33:52.000000000 +0100 ++++ 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 } { } } @@ -971,11 +971,11 @@ Index: gdb-7.1.90.20100711/gdb/testsuite/lib/mi-support.exp 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.1.90.20100711/gdb/objfiles.h 2010-07-12 11:07:08.000000000 +0200 -@@ -426,6 +426,10 @@ struct objfile +--- gdb-7.2.50.20110117.orig/gdb/objfiles.h 2011-01-10 21:38:49.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/objfiles.h 2011-01-17 15:52:26.000000000 +0100 +@@ -434,6 +434,10 @@ struct objfile #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) + /* 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. */ diff --git a/gdb-6.6-bz225783-gdb-debuginfo-paths.patch b/gdb-6.6-bz225783-gdb-debuginfo-paths.patch deleted file mode 100644 index 4274109..0000000 --- a/gdb-6.6-bz225783-gdb-debuginfo-paths.patch +++ /dev/null @@ -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$@ $< && \ diff --git a/gdb-6.6-bz229517-gcore-without-terminal.patch b/gdb-6.6-bz229517-gcore-without-terminal.patch index 7d10dbd..2106fa4 100644 --- a/gdb-6.6-bz229517-gcore-without-terminal.patch +++ b/gdb-6.6-bz229517-gcore-without-terminal.patch @@ -7,19 +7,6 @@ * 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 -+ # ` - - 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}. - diff --git a/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch b/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch index f119fde..0597408 100644 --- a/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch +++ b/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch @@ -21,11 +21,11 @@ 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.1.90.20100711/gdb/inferior.h 2010-07-12 10:04:25.000000000 +0200 -@@ -198,7 +198,15 @@ extern void reopen_exec_file (void); +--- gdb-7.2.50.20110117.orig/gdb/inferior.h 2011-01-09 04:08:56.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/inferior.h 2011-01-17 15:48:39.000000000 +0100 +@@ -186,7 +186,15 @@ extern void reopen_exec_file (void); /* The `resume' routine should only be called in special circumstances. 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 */ -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.1.90.20100711/gdb/infrun.c 2010-07-12 10:05:26.000000000 +0200 +--- gdb-7.2.50.20110117.orig/gdb/infrun.c 2011-01-09 04:08:56.000000000 +0100 ++++ 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); static void set_schedlock_func (char *args, int from_tty, 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, 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). SIG is the signal to give the inferior (zero for none). */ void @@ -64,24 +64,24 @@ Index: gdb-7.1.90.20100711/gdb/infrun.c { int should_resume = 1; struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0); -@@ -1562,10 +1562,12 @@ resume (int step, enum target_signal sig - QUIT; +@@ -1609,10 +1609,12 @@ resume (int step, enum target_signal sig + } if (debug_infrun) - fprintf_unfiltered (gdb_stdlog, - "infrun: resume (step=%d, signal=%d), " - "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), " + "trap_expected=%d\n", + (step == RESUME_STEP_CONTINUE ? "RESUME_STEP_CONTINUE" + : (step == RESUME_STEP_USER ? "RESUME_STEP_USER" + : "RESUME_STEP_NEEDED")), -+ sig, tp->trap_expected); ++ sig, tp->control.trap_expected); /* Normally, by the time we reach `resume', the breakpoints are either 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. */ resume_ptid = inferior_ptid; } @@ -92,9 +92,9 @@ Index: gdb-7.1.90.20100711/gdb/infrun.c + && (step == RESUME_STEP_USER + || singlestep_breakpoints_inserted_p))) { - /* User-settable 'scheduler' mode requires solo thread resume. */ + /* User-settable 'scheduler' mode requires solo thread resume. */ 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; CORE_ADDR pc; 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 "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. We'll be (un-)executing the previous instruction. */ @@ -119,9 +119,9 @@ Index: gdb-7.1.90.20100711/gdb/infrun.c } 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 - the old thread. */ + the old thread. */ if (prepare_to_proceed (step)) - oneproc = 1; + resume_step = RESUME_STEP_USER; @@ -133,9 +133,9 @@ Index: gdb-7.1.90.20100711/gdb/infrun.c - if (oneproc) + 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 -@@ -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. */ init_infwait_state (); @@ -145,12 +145,12 @@ Index: gdb-7.1.90.20100711/gdb/infrun.c + resume_step = RESUME_STEP_NEEDED; + /* Resume inferior. */ -- resume (oneproc || step || bpstat_should_step (), tp->stop_signal); -+ resume (resume_step, tp->stop_signal); +- resume (oneproc || step || bpstat_should_step (), tp->suspend.stop_signal); ++ resume (resume_step, tp->suspend.stop_signal); /* Wait for it to stop (if not standalone) 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? */ @@ -158,12 +158,14 @@ Index: gdb-7.1.90.20100711/gdb/infrun.c +static enum resume_step currently_stepping (struct thread_info *tp) { -- return ((tp->step_range_end && tp->step_resume_breakpoint == NULL) -- || tp->trap_expected -- || tp->stepping_through_solib_after_catch -- || bpstat_should_step ()); -+ if ((tp->step_range_end && tp->step_resume_breakpoint == NULL) -+ || tp->trap_expected +- return ((tp->control.step_range_end +- && tp->control.step_resume_breakpoint == NULL) +- || tp->control.trap_expected +- || tp->stepping_through_solib_after_catch +- || bpstat_should_step ()); ++ if ((tp->control.step_range_end ++ && tp->control.step_resume_breakpoint == NULL) ++ || tp->control.trap_expected + || tp->stepping_through_solib_after_catch) + 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 -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.1.90.20100711/gdb/linux-nat.c 2010-07-12 10:04:25.000000000 +0200 -@@ -2827,7 +2827,10 @@ count_events_callback (struct lwp_info * +--- gdb-7.2.50.20110117.orig/gdb/linux-nat.c 2011-01-17 15:47:37.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/linux-nat.c 2011-01-17 15:48:39.000000000 +0100 +@@ -2928,7 +2928,10 @@ count_events_callback (struct lwp_info * static int 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; else 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.1.90.20100711/gdb/linux-nat.h 2010-07-12 10:04:25.000000000 +0200 +--- gdb-7.2.50.20110117.orig/gdb/linux-nat.h 2011-01-17 15:47:37.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/linux-nat.h 2011-01-17 15:48:39.000000000 +0100 @@ -55,8 +55,8 @@ struct lwp_info /* If non-zero, a pending wait status. */ int status; diff --git a/gdb-6.6-step-thread-exit.patch b/gdb-6.6-step-thread-exit.patch index 220884f..d3fde0b 100644 --- a/gdb-6.6-step-thread-exit.patch +++ b/gdb-6.6-step-thread-exit.patch @@ -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-6.8.50.20090811/gdb/linux-nat.c 2009-08-12 08:11:25.000000000 +0200 -@@ -1656,16 +1656,18 @@ resume_set_callback (struct lwp_info *lp +--- gdb-7.2.50.20101116.orig/gdb/linux-nat.c 2010-11-16 07:58:15.000000000 +0100 ++++ gdb-7.2.50.20101116/gdb/linux-nat.c 2010-11-16 07:59:06.000000000 +0100 +@@ -1863,16 +1863,18 @@ resume_set_callback (struct lwp_info *lp static void 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 + ? "needed" : (step ? "step" : "resume")), target_pid_to_str (ptid), - signo ? strsignal (signo) : "0", - target_pid_to_str (inferior_ptid)); -@@ -2625,10 +2627,34 @@ linux_nat_filter_event (int lwpid, int s + (signo != TARGET_SIGNAL_0 + ? strsignal (target_signal_to_host (signo)) : "0"), +@@ -3171,10 +3173,34 @@ linux_nat_filter_event (int lwpid, int s if (num_lwps (GET_PID (lp->ptid)) > 1) { diff --git a/gdb-6.7-bz426600-DW_TAG_interface_type-fix.patch b/gdb-6.7-bz426600-DW_TAG_interface_type-fix.patch deleted file mode 100644 index 14866e2..0000000 --- a/gdb-6.7-bz426600-DW_TAG_interface_type-fix.patch +++ /dev/null @@ -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 - - * 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 - - 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); - } diff --git a/gdb-6.7-kernel-headers-compat.patch b/gdb-6.7-kernel-headers-compat.patch deleted file mode 100644 index 309e0d7..0000000 --- a/gdb-6.7-kernel-headers-compat.patch +++ /dev/null @@ -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 - #include - /* FIXME ezannoni-2003-07-09: we need to be included after -- because the latter redefines FS and GS for no apparent -+ 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 . */ - /* 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 -+#include - #include - #include "gdb_proc_service.h" - diff --git a/gdb-6.8-bz254229-gcore-prpsinfo.patch b/gdb-6.8-bz254229-gcore-prpsinfo.patch index ca30b6e..55d1bc5 100644 --- a/gdb-6.8-bz254229-gcore-prpsinfo.patch +++ b/gdb-6.8-bz254229-gcore-prpsinfo.patch @@ -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/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. */ extern char *elfcore_write_note (bfd *, char *, int *, const char *, int, const void *, int); -+#include ++struct elf_prpsinfo; ++typedef struct elf_prpsinfo prpsinfo_t; extern char *elfcore_write_prpsinfo - (bfd *, char *, int *, const char *, const char *); + (bfd *, char *, int *, const prpsinfo_t *); diff --git a/gdb-6.8-fortran-tag-constant.patch b/gdb-6.8-fortran-tag-constant.patch deleted file mode 100644 index d990730..0000000 --- a/gdb-6.8-fortran-tag-constant.patch +++ /dev/null @@ -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 diff --git a/gdb-6.8-gcc35998-ada-memory-trash.patch b/gdb-6.8-gcc35998-ada-memory-trash.patch deleted file mode 100644 index 7a35438..0000000 --- a/gdb-6.8-gcc35998-ada-memory-trash.patch +++ /dev/null @@ -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]; diff --git a/gdb-6.8-glibc-headers-compat.patch b/gdb-6.8-glibc-headers-compat.patch deleted file mode 100644 index 2149c1a..0000000 --- a/gdb-6.8-glibc-headers-compat.patch +++ /dev/null @@ -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) - { diff --git a/gdb-6.8-quit-never-aborts.patch b/gdb-6.8-quit-never-aborts.patch index f3214cc..819d4f0 100644 --- a/gdb-6.8-quit-never-aborts.patch +++ b/gdb-6.8-quit-never-aborts.patch @@ -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 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-6.8.50.20081128/gdb/defs.h 2008-12-06 21:49:32.000000000 +0100 -@@ -155,6 +155,7 @@ extern char *gdb_sysroot; +--- gdb-7.2.50.20110117.orig/gdb/defs.h 2011-01-17 15:47:37.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/defs.h 2011-01-17 15:53:05.000000000 +0100 +@@ -165,6 +165,7 @@ extern char *python_libdir; extern char *debug_file_directory; extern int quit_flag; @@ -17,8 +17,8 @@ Index: gdb-6.8.50.20081128/gdb/defs.h extern int immediate_quit; extern int sevenbit_strings; -@@ -168,7 +169,7 @@ extern void quit (void); - needed. */ +@@ -178,7 +179,7 @@ extern void quit (void); + needed. */ #define 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 (); \ } -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-6.8.50.20081128/gdb/event-top.c 2008-12-06 21:49:07.000000000 +0100 -@@ -939,7 +939,7 @@ async_request_quit (gdb_client_data arg) +--- gdb-7.2.50.20110117.orig/gdb/event-top.c 2011-01-17 15:52:39.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/event-top.c 2011-01-17 15:52:49.000000000 +0100 +@@ -904,7 +904,7 @@ async_request_quit (gdb_client_data arg) is no reason to call quit again here, unless immediate_quit is - set.*/ + set. */ - if (quit_flag || immediate_quit) + if ((quit_flag || immediate_quit) && !quit_flag_cleanup) 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-6.8.50.20081128/gdb/top.c 2008-12-06 21:49:07.000000000 +0100 -@@ -1299,7 +1299,9 @@ quit_force (char *args, int from_tty) +--- gdb-7.2.50.20110117.orig/gdb/top.c 2011-01-17 15:47:37.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/top.c 2011-01-17 15:52:49.000000000 +0100 +@@ -1257,7 +1257,9 @@ quit_force (char *args, int from_tty) qt.args = args; qt.from_tty = from_tty; @@ -54,11 +54,11 @@ Index: gdb-6.8.50.20081128/gdb/top.c catch_errors (quit_target, &qt, "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-6.8.50.20081128/gdb/utils.c 2008-12-06 21:49:07.000000000 +0100 -@@ -114,6 +114,11 @@ int job_control; +--- gdb-7.2.50.20110117.orig/gdb/utils.c 2011-01-17 15:47:37.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/utils.c 2011-01-17 15:52:49.000000000 +0100 +@@ -121,6 +121,11 @@ int job_control; int quit_flag; diff --git a/gdb-7.2.50.20110206.tar.bz2 b/gdb-7.2.50.20110206.tar.bz2 new file mode 100644 index 0000000..0cfb1fe --- /dev/null +++ b/gdb-7.2.50.20110206.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:481e5fb3f97cd023b74aff94090ae1d0c05bf0257addbd87e9a9b1b379dcab43 +size 19762129 diff --git a/gdb-7.2.tar.bz2 b/gdb-7.2.tar.bz2 deleted file mode 100644 index 67f9e1a..0000000 --- a/gdb-7.2.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:bf444b88ab845243364c3d410be9e3f43a57f96ff594d65a37842ea03c3410f0 -size 18530613 diff --git a/gdb-archer-ada.patch b/gdb-archer-ada.patch deleted file mode 100644 index d9052f6..0000000 --- a/gdb-archer-ada.patch +++ /dev/null @@ -1,23 +0,0 @@ -From: Keith Seitz -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; - diff --git a/gdb-archer-pie-addons-keep-disabled.patch b/gdb-archer-pie-addons-keep-disabled.patch index 0beb530..4c140e9 100644 --- a/gdb-archer-pie-addons-keep-disabled.patch +++ b/gdb-archer-pie-addons-keep-disabled.patch @@ -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.1.90.20100711/gdb/breakpoint.c 2010-07-13 00:38:04.000000000 +0200 -@@ -10159,6 +10159,50 @@ update_breakpoint_locations (struct brea +--- gdb-7.2.50.20110206.orig/gdb/breakpoint.c 2011-02-06 20:39:24.000000000 +0100 ++++ gdb-7.2.50.20110206/gdb/breakpoint.c 2011-02-06 20:39:44.000000000 +0100 +@@ -10587,6 +10587,50 @@ update_breakpoint_locations (struct brea 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. The value we return ends up being the return value from catch_errors. 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.1.90.20100711/gdb/breakpoint.h 2010-07-13 00:37:34.000000000 +0200 -@@ -1088,4 +1088,7 @@ extern void check_tracepoint_command (ch - extern void start_rbreak_breakpoints (void); - extern void end_rbreak_breakpoints (void); +--- gdb-7.2.50.20110206.orig/gdb/breakpoint.h 2011-02-06 20:39:24.000000000 +0100 ++++ gdb-7.2.50.20110206/gdb/breakpoint.h 2011-02-06 20:40:00.000000000 +0100 +@@ -1194,4 +1194,7 @@ extern struct breakpoint *iterate_over_b + + extern int user_breakpoint_p (struct breakpoint *); +extern void breakpoints_relocate (struct objfile *objfile, + struct section_offsets *delta); + #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.1.90.20100711/gdb/objfiles.c 2010-07-13 00:37:19.000000000 +0200 -@@ -834,6 +834,11 @@ objfile_relocate1 (struct objfile *objfi +--- gdb-7.2.50.20110206.orig/gdb/objfiles.c 2011-01-10 21:38:49.000000000 +0100 ++++ gdb-7.2.50.20110206/gdb/objfiles.c 2011-02-06 20:39:44.000000000 +0100 +@@ -846,6 +846,11 @@ objfile_relocate1 (struct objfile *objfi obj_section_addr (s)); } diff --git a/gdb-archer-pie-addons.patch b/gdb-archer-pie-addons.patch index 7419adc..cee7ca8 100644 --- a/gdb-archer-pie-addons.patch +++ b/gdb-archer-pie-addons.patch @@ -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.1.90.20100711/gdb/dwarf2read.c 2010-07-13 00:34:00.000000000 +0200 -@@ -5737,7 +5737,12 @@ read_common_block (struct die_info *die, +--- gdb-7.2.50.20110117.orig/gdb/dwarf2read.c 2011-01-17 15:56:23.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/dwarf2read.c 2011-01-17 16:00:14.000000000 +0100 +@@ -7475,7 +7475,12 @@ read_common_block (struct die_info *die, { struct attribute *attr; struct symbol *sym; @@ -16,7 +16,7 @@ Index: gdb-7.1.90.20100711/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_location, cu); 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)) { 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)) { -@@ -5807,12 +5813,15 @@ read_common_block (struct die_info *die, +@@ -7545,12 +7551,15 @@ read_common_block (struct die_info *die, else dwarf2_complex_location_expr_complaint (); @@ -42,7 +42,7 @@ Index: gdb-7.1.90.20100711/gdb/dwarf2read.c else SET_FIELD_PHYSNAME (*field, SYMBOL_LINKAGE_NAME (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); /* 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); } -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.1.90.20100711/gdb/gdbtypes.h 2010-07-13 00:34:00.000000000 +0200 -@@ -395,6 +395,7 @@ enum type_instance_flag_value +--- gdb-7.2.50.20110117.orig/gdb/gdbtypes.h 2011-01-17 15:51:03.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/gdbtypes.h 2011-01-17 16:00:32.000000000 +0100 +@@ -394,6 +394,7 @@ enum type_instance_flag_value enum field_loc_kind { 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_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. - 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. */ CORE_ADDR physaddr; 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_BITPOS(thisfld) ((thisfld).loc.bitpos) #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 SET_FIELD_BITPOS(thisfld, 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) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \ FIELD_STATIC_PHYSNAME (thisfld) = (name)) @@ -87,7 +87,7 @@ Index: gdb-7.1.90.20100711/gdb/gdbtypes.h #define SET_FIELD_PHYSADDR(thisfld, addr) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \ 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_BITPOS(thistype, n) FIELD_BITPOS (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_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(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.1.90.20100711/gdb/jv-lang.c 2010-07-13 00:34:00.000000000 +0200 -@@ -409,7 +409,8 @@ java_link_class_type (struct gdbarch *gd +--- gdb-7.2.50.20110117.orig/gdb/jv-lang.c 2011-01-09 04:08:57.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/jv-lang.c 2011-01-17 16:00:59.000000000 +0100 +@@ -414,7 +414,8 @@ java_link_class_type (struct gdbarch *gd 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) + - (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_TYPE (type, nfields) = value_type (clas); 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); } if (accflags & 0x0008) /* ACC_STATIC */ @@ -119,11 +119,11 @@ Index: gdb-7.1.90.20100711/gdb/jv-lang.c else TYPE_FIELD_BITPOS (type, i) = 8 * boffset; 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.1.90.20100711/gdb/value.c 2010-07-13 00:35:21.000000000 +0200 -@@ -1943,7 +1943,8 @@ value_static_field (struct type *type, i +--- gdb-7.2.50.20110117.orig/gdb/value.c 2011-01-17 15:47:37.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/value.c 2011-01-17 16:00:14.000000000 +0100 +@@ -1997,7 +1997,8 @@ value_static_field (struct type *type, i { case FIELD_LOC_KIND_PHYSADDR: retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno), @@ -133,13 +133,3 @@ Index: gdb-7.1.90.20100711/gdb/value.c break; 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: diff --git a/gdb-archer.patch b/gdb-archer.patch index 2a03acb..c17d4f0 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -2,62 +2,32 @@ http://sourceware.org/gdb/wiki/ProjectArcher http://sourceware.org/gdb/wiki/ArcherBranchManagement GIT snapshot: -commit 30a7ce8ffc2b54bc4453a127be8dd28a3ea6d299 +commit 8d1fce85d351ec7fec64ed392932fe59148b83fc branch `archer' - the merge of branches: archer-jankratochvil-vla archer-jankratochvil-watchpoint3 archer-jankratochvil-ifunc -archer-pmuldoon-next-over-throw2 -archer-tromey-python (not a merge) -archer-tromey-optional-psymtab (cherry-picked from post-7.2 master) -#TODO:archer-tromey-threaded-dwarf +archer-tromey-python +#TODO?:archer-tromey-optional-psymtab (cherry-picked from post-7.2 master) +#TODO?:archer-tromey-threaded-dwarf diff --git a/gdb/Makefile.in b/gdb/Makefile.in -index f07bc8b..3703dca 100644 +index 66521a2..66a6fc2 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in -@@ -169,6 +169,12 @@ TARGET_SYSTEM_ROOT = @TARGET_SYSTEM_ROOT@ - TARGET_SYSTEM_ROOT_DEFINE = @TARGET_SYSTEM_ROOT_DEFINE@ - - # Did the user give us a --with-gdb-datadir option? -+GDB_DATADIR_PATH = @GDB_DATADIR_PATH@ -+ -+# The argument to --with-pythondir. If not given, this is -+# GDB_DATADIR_PATH/python. -+pythondir = @pythondir@ -+ - GDB_DATADIR = @GDB_DATADIR@ - - # Helper code from gnulib. -@@ -295,13 +301,13 @@ SUBDIR_PYTHON_SRCS = \ - python/py-cmd.c \ - python/py-frame.c \ - python/py-function.c \ -+ python/py-hooks.c \ - python/py-inferior.c \ - python/py-infthread.c \ - python/py-lazy-string.c \ - python/py-objfile.c \ - python/py-param.c \ - python/py-prettyprint.c \ -- python/py-progspace.c \ - python/py-symbol.c \ - python/py-symtab.c \ - python/py-type.c \ -@@ -780,8 +786,8 @@ config/rs6000/nm-rs6000.h top.h bsd-kvm.h gdb-stabs.h reggroups.h \ - annotate.h sim-regno.h dictionary.h dfp.h main.h frame-unwind.h \ +@@ -807,7 +807,8 @@ annotate.h sim-regno.h dictionary.h dfp.h main.h frame-unwind.h \ remote-fileio.h i386-linux-tdep.h vax-tdep.h objc-lang.h \ sentinel-frame.h bcache.h symfile.h windows-tdep.h linux-tdep.h \ --gdb_usleep.h jit.h xml-syscall.h ada-operator.inc microblaze-tdep.h \ --psymtab.h psympriv.h -+gdb_usleep.h jit.h python/python.h python/python-internal.h \ -+xml-syscall.h ada-operator.inc microblaze-tdep.h + gdb_usleep.h jit.h xml-syscall.h ada-operator.inc microblaze-tdep.h \ +-psymtab.h psympriv.h progspace.h bfin-tdep.h ia64-hpux-tdep.h ++psymtab.h psympriv.h progspace.h bfin-tdep.h ia64-hpux-tdep.h \ ++python/python.h python/python-internal.h # Header files that already have srcdir in them, or which are in objdir. -@@ -1301,6 +1307,12 @@ stamp-h: $(srcdir)/config.in config.status +@@ -1313,6 +1314,12 @@ stamp-h: $(srcdir)/config.in config.status CONFIG_LINKS= \ $(SHELL) config.status @@ -70,59 +40,11 @@ index f07bc8b..3703dca 100644 config.status: $(srcdir)/configure configure.tgt configure.host $(SHELL) config.status --recheck -@@ -2024,6 +2036,10 @@ py-function.o: $(srcdir)/python/py-function.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-function.c - $(POSTCOMPILE) - -+py-hooks.o: $(srcdir)/python/py-hooks.c -+ $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-hooks.c -+ $(POSTCOMPILE) -+ - py-inferior.o: $(srcdir)/python/py-inferior.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-inferior.c - $(POSTCOMPILE) -@@ -2072,6 +2088,36 @@ py-value.o: $(srcdir)/python/py-value.c - $(COMPILE) $(PYTHON_CFLAGS) $(srcdir)/python/py-value.c - $(POSTCOMPILE) - -+# All python library files, with the "python/lib" stripped off. -+# Note that we should only install files in the "gdb" module. -+PY_FILES = gdb/FrameIterator.py gdb/FrameWrapper.py gdb/command/alias.py \ -+ gdb/command/backtrace.py gdb/command/require.py \ -+ gdb/command/pahole.py gdb/command/upto.py gdb/command/__init__.py \ -+ gdb/command/ignore_errors.py gdb/command/save_breakpoints.py \ -+ gdb/function/caller_is.py gdb/function/in_scope.py \ -+ gdb/function/__init__.py gdb/backtrace.py gdb/__init__.py -+ -+# Install the Python library. Python library files go under -+# $(pythondir). -+install-python: -+ files='$(PY_FILES)'; for file in $$files; do \ -+ dir=`echo "$$file" | sed 's,/[^/]*$$,,'`; \ -+ $(SHELL) $(srcdir)/../mkinstalldirs $(DESTDIR)$(pythondir)/$$dir; \ -+ $(INSTALL_DATA) $(srcdir)/python/lib/$$file $(DESTDIR)$(pythondir)/$$file; \ -+ done -+ -+# Other packages may have their files installed in $(pythondir). -+uninstall-python: -+ files='$(PY_FILES)'; for file in $$files; do \ -+ slashdir=`echo "/$$file" | sed 's,/[^/]*$$,,'`; \ -+ rm -f $(DESTDIR)$(pythondir)/$$file; \ -+ while test "x$$file" != "x$$slashdir"; do \ -+ rmdir 2>/dev/null "$(DESTDIR)$(pythondir)$$slashdir"; \ -+ file="$$slashdir"; \ -+ slashdir=`echo "$$file" | sed 's,/[^/]*$$,,'`; \ -+ done \ -+ done -+ - # - # Dependency tracking. Most of this is conditional on GNU Make being - # found by configure; if GNU Make is not found, we fall back to a diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c -index 1d4c38b..cafb88e 100644 +index 890e091..d1e1f8f 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c -@@ -11114,6 +11114,7 @@ ada_operator_length (const struct expression *exp, int pc, int *oplenp, +@@ -11372,6 +11372,7 @@ ada_operator_length (const struct expression *exp, int pc, int *oplenp, static int ada_operator_check (struct expression *exp, int pos, @@ -130,7 +52,7 @@ index 1d4c38b..cafb88e 100644 int (*objfile_func) (struct objfile *objfile, void *data), void *data) { -@@ -11128,12 +11129,15 @@ ada_operator_check (struct expression *exp, int pos, +@@ -11386,12 +11387,15 @@ ada_operator_check (struct expression *exp, int pos, break; default: @@ -149,43 +71,232 @@ index 1d4c38b..cafb88e 100644 return 1; diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c -index c0edc10..17d36b5 100644 +index a869f85..c59daa0 100644 --- a/gdb/amd64-linux-nat.c +++ b/gdb/amd64-linux-nat.c -@@ -375,6 +375,20 @@ amd64_linux_dr_unset_status (unsigned long mask) - } +@@ -265,18 +265,11 @@ amd64_linux_store_inferior_registers (struct target_ops *ops, + + /* Support for debug registers. */ + +-static unsigned long amd64_linux_dr[DR_CONTROL + 1]; +- + static unsigned long +-amd64_linux_dr_get (ptid_t ptid, int regnum) ++amd64_linux_dr_get (int tid, int regnum) + { +- int tid; + unsigned long value; + +- tid = TIDGET (ptid); +- if (tid == 0) +- tid = PIDGET (ptid); +- + /* FIXME: kettenis/2001-03-27: Calling perror_with_name if the + ptrace call fails breaks debugging remote targets. The correct + way to fix this is to add the hardware breakpoint and watchpoint +@@ -298,14 +291,8 @@ amd64_linux_dr_get (ptid_t ptid, int regnum) + /* Set debug register REGNUM to VALUE in only the one LWP of PTID. */ + + static void +-amd64_linux_dr_set (ptid_t ptid, int regnum, unsigned long value) ++amd64_linux_dr_set (int tid, int regnum, unsigned long value) + { +- int tid; +- +- tid = TIDGET (ptid); +- if (tid == 0) +- tid = PIDGET (ptid); +- + errno = 0; + ptrace (PTRACE_POKEUSER, tid, + offsetof (struct user, u_debugreg[regnum]), value); +@@ -313,35 +300,96 @@ amd64_linux_dr_set (ptid_t ptid, int regnum, unsigned long value) + perror_with_name (_("Couldn't write debug register")); } -+/* See i386_dr_low_type.detach. Do not use wrappers amd64_linux_dr_set_control -+ or amd64_linux_dr_reset_addr as they would modify the register cache -+ (amd64_linux_dr). */ +-/* Set DR_CONTROL to ADDR in all LWPs of LWP_LIST. */ ++/* Helper for amd64_linux_dr_set_control. */ + +static void -+amd64_linux_dr_detach (void) ++amd64_linux_dr_set_control_callback (int tid, void *control_voidp) +{ -+ int regnum; ++ unsigned long control = *(unsigned long *) control_voidp; + -+ amd64_linux_dr_set (inferior_ptid, DR_CONTROL, 0); -+ amd64_linux_dr_unset_status (~0UL); -+ for (regnum = DR_FIRSTADDR; regnum <= DR_LASTADDR; regnum++) -+ amd64_linux_dr_set (inferior_ptid, regnum, 0); ++ amd64_linux_dr_set (tid, DR_CONTROL, control); ++} ++ ++static void amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr); ++ ++/* Set DR_CONTROL to ADDR in all LWPs of CURRENT_INFERIOR. */ + + static void + amd64_linux_dr_set_control (unsigned long control) + { +- struct lwp_info *lp; +- ptid_t ptid; ++ int inferior_pid = ptid_get_pid (inferior_ptid); ++ struct inferior *inf = current_inferior (); ++ ++ /* Are we detaching breakpoints from a fork-ed child? ++ See linux_nat_iterate_watchpoint_lwps for the fork-ed child description. ++ The i386 counterpart is i386_linux_dr_set_control. */ ++ if (inf->pid != inferior_pid) ++ { ++ struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get (); ++ int i; ++ ++ /* There were two changes in Linux kernel 2.6.33 by the commit: ++ 72f674d203cd230426437cdcf7dd6f681dad8b0d ++ ++ (1) After fork/vfork/clone the new task no longer inherits the debug ++ registers. It has them zeroed instead. Either case is OK for GDB as ++ GDB already registers a fix up by linux_nat_set_new_thread. ++ ++ (2) If you enable a breakpoint by the CONTROL bits you have already ++ written its ADDRESS. Otherwise Linux kernel will report EINVAL. ++ For this case the workaround here ensures that during resetting ++ (detaching) watchpoints for a fork-ed child we can set CONTROL ++ arbitrarily as the addresses get pre-set here just to be sure. ++ ++ The second issue is hopefully going to be fixed in Linux kernel: ++ https://bugzilla.redhat.com/show_bug.cgi?id=660204 */ ++ ++ if (!dr_mirror->addr_preset) ++ { ++ dr_mirror->addr_preset = 1; ++ ++ for (i = 0; i < DR_LASTADDR - DR_FIRSTADDR; i++) ++ amd64_linux_dr_set_addr (i, dr_mirror->addr[i]); ++ } ++ } ++ ++ linux_nat_iterate_watchpoint_lwps (amd64_linux_dr_set_control_callback, ++ &control); ++} ++ ++/* Helper for amd64_linux_dr_set_addr. */ ++ ++struct amd64_linux_dr_set_addr_data ++ { ++ int regnum; ++ CORE_ADDR addr; ++ }; ++ ++static void ++amd64_linux_dr_set_addr_callback (int tid, void *datap_voidp) ++{ ++ const struct amd64_linux_dr_set_addr_data *datap = datap_voidp; + +- amd64_linux_dr[DR_CONTROL] = control; +- ALL_LWPS (lp, ptid) +- amd64_linux_dr_set (ptid, DR_CONTROL, control); ++ amd64_linux_dr_set (tid, DR_FIRSTADDR + datap->regnum, datap->addr); + } + +-/* Set address REGNUM (zero based) to ADDR in all LWPs of LWP_LIST. */ ++/* Set address REGNUM (zero based) to ADDR in all LWPs of CURRENT_INFERIOR. ++ */ + + static void + amd64_linux_dr_set_addr (int regnum, CORE_ADDR addr) + { +- struct lwp_info *lp; +- ptid_t ptid; ++ struct amd64_linux_dr_set_addr_data data; + + gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR); + +- amd64_linux_dr[DR_FIRSTADDR + regnum] = addr; +- ALL_LWPS (lp, ptid) +- amd64_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr); ++ data.regnum = regnum; ++ data.addr = addr; ++ linux_nat_iterate_watchpoint_lwps (amd64_linux_dr_set_addr_callback, &data); + } + +-/* Set address REGNUM (zero based) to zero in all LWPs of LWP_LIST. */ ++/* Set address REGNUM (zero based) to zero in all LWPs of CURRENT_INFERIOR. ++ */ + + static void + amd64_linux_dr_reset_addr (int regnum) +@@ -354,37 +402,54 @@ amd64_linux_dr_reset_addr (int regnum) + static unsigned long + amd64_linux_dr_get_status (void) + { +- return amd64_linux_dr_get (inferior_ptid, DR_STATUS); ++ int tid; ++ ++ tid = TIDGET (inferior_ptid); ++ if (tid == 0) ++ tid = PIDGET (inferior_ptid); ++ ++ return amd64_linux_dr_get (tid, DR_STATUS); + } + +-/* Unset MASK bits in DR_STATUS in all LWPs of LWP_LIST. */ ++/* Helper for amd64_linux_dr_unset_status. */ + + static void +-amd64_linux_dr_unset_status (unsigned long mask) ++amd64_linux_dr_unset_status_callback (int tid, void *mask_voidp) + { +- struct lwp_info *lp; +- ptid_t ptid; +- +- ALL_LWPS (lp, ptid) +- { +- unsigned long value; ++ unsigned long mask = *(unsigned long *) mask_voidp; ++ unsigned long value; + +- value = amd64_linux_dr_get (ptid, DR_STATUS); +- value &= ~mask; +- amd64_linux_dr_set (ptid, DR_STATUS, value); +- } ++ value = amd64_linux_dr_get (tid, DR_STATUS); ++ value &= ~mask; ++ amd64_linux_dr_set (tid, DR_STATUS, value); + } + ++/* Unset MASK bits in DR_STATUS in all LWPs of CURRENT_INFERIOR. */ ++ ++static void ++amd64_linux_dr_unset_status (unsigned long mask) ++{ ++ linux_nat_iterate_watchpoint_lwps (amd64_linux_dr_unset_status_callback, ++ &mask); +} static void amd64_linux_new_thread (ptid_t ptid) -@@ -796,6 +810,7 @@ _initialize_amd64_linux_nat (void) - i386_dr_low.reset_addr = amd64_linux_dr_reset_addr; - i386_dr_low.get_status = amd64_linux_dr_get_status; - i386_dr_low.unset_status = amd64_linux_dr_unset_status; -+ i386_dr_low.detach = amd64_linux_dr_detach; - i386_set_debug_register_length (8); + { +- int i; ++ struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get (); ++ int i, tid; ++ ++ /* Verify DR_MIRROR is valid. */ ++ gdb_assert (PIDGET (ptid) == PIDGET (inferior_ptid)); ++ ++ tid = TIDGET (ptid); ++ if (tid == 0) ++ tid = PIDGET (ptid); + +- for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++) +- amd64_linux_dr_set (ptid, i, amd64_linux_dr[i]); ++ for (i = 0; i < DR_LASTADDR - DR_FIRSTADDR; i++) ++ amd64_linux_dr_set (tid, DR_FIRSTADDR + i, dr_mirror->addr[i]); + +- amd64_linux_dr_set (ptid, DR_CONTROL, amd64_linux_dr[DR_CONTROL]); ++ amd64_linux_dr_set (tid, DR_CONTROL, dr_mirror->control); + } + - /* Override the GNU/Linux inferior startup hook. */ diff --git a/gdb/block.c b/gdb/block.c -index 48ac21b..ffcc97f 100644 +index 776ae53..3544cf2 100644 --- a/gdb/block.c +++ b/gdb/block.c -@@ -321,3 +321,21 @@ allocate_block (struct obstack *obstack) +@@ -322,3 +322,21 @@ allocate_block (struct obstack *obstack) return bl; } @@ -208,10 +319,10 @@ index 48ac21b..ffcc97f 100644 + return SYMBOL_SYMTAB (func)->objfile; +} diff --git a/gdb/block.h b/gdb/block.h -index 7eedb6c..a517e80 100644 +index 07d5bc7..fad89b1 100644 --- a/gdb/block.h +++ b/gdb/block.h -@@ -166,4 +166,6 @@ extern const struct block *block_global_block (const struct block *block); +@@ -167,4 +167,6 @@ extern const struct block *block_global_block (const struct block *block); extern struct block *allocate_block (struct obstack *obstack); @@ -219,26 +330,18 @@ index 7eedb6c..a517e80 100644 + #endif /* BLOCK_H */ diff --git a/gdb/blockframe.c b/gdb/blockframe.c -index 0348bf4..f01d0ee 100644 +index b9aaf54..e1f3242 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c -@@ -38,6 +38,7 @@ - #include "block.h" - #include "inline-frame.h" - #include "psymtab.h" -+#include "elf-bfd.h" - - /* Return the innermost lexical block in execution - in a specified stack frame. The frame address is assumed valid. -@@ -159,6 +160,7 @@ static CORE_ADDR cache_pc_function_low = 0; +@@ -160,6 +160,7 @@ static CORE_ADDR cache_pc_function_low = 0; static CORE_ADDR cache_pc_function_high = 0; static char *cache_pc_function_name = 0; static struct obj_section *cache_pc_function_section = NULL; +static int cache_pc_function_is_gnu_ifunc = 0; - /* Clear cache, e.g. when symbol table is discarded. */ + /* Clear cache, e.g. when symbol table is discarded. */ -@@ -169,6 +171,7 @@ clear_pc_function_cache (void) +@@ -170,6 +171,7 @@ clear_pc_function_cache (void) cache_pc_function_high = 0; cache_pc_function_name = (char *) 0; cache_pc_function_section = NULL; @@ -246,7 +349,7 @@ index 0348bf4..f01d0ee 100644 } /* Finds the "function" (text symbol) that is smaller than PC but -@@ -184,7 +187,7 @@ clear_pc_function_cache (void) +@@ -185,7 +187,7 @@ clear_pc_function_cache (void) /* Backward compatibility, no section argument. */ @@ -255,7 +358,7 @@ index 0348bf4..f01d0ee 100644 find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address, CORE_ADDR *endaddr) { -@@ -236,6 +239,7 @@ find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address, +@@ -237,6 +239,7 @@ find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address, cache_pc_function_high = BLOCK_END (SYMBOL_BLOCK_VALUE (f)); cache_pc_function_name = SYMBOL_LINKAGE_NAME (f); cache_pc_function_section = section; @@ -263,7 +366,7 @@ index 0348bf4..f01d0ee 100644 goto return_cached_value; } } -@@ -258,12 +262,13 @@ find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address, +@@ -259,12 +262,13 @@ find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address, *address = 0; if (endaddr != NULL) *endaddr = 0; @@ -278,7 +381,7 @@ index 0348bf4..f01d0ee 100644 /* If the minimal symbol has a size, use it for the cache. Otherwise use the lesser of the next minimal symbol in the same -@@ -323,7 +328,8 @@ find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address, +@@ -327,7 +331,8 @@ find_pc_partial_function (CORE_ADDR pc, char **name, CORE_ADDR *address, *endaddr = cache_pc_function_high; } @@ -287,9 +390,9 @@ index 0348bf4..f01d0ee 100644 + : FIND_PC_PARTIAL_FUNCTION_NORMAL; } - /* Return the innermost stack frame executing inside of BLOCK, + /* Return the innermost stack frame executing inside of BLOCK, or NULL diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c -index 6a6864c..5df336d 100644 +index 656dedd..2a5f761 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -62,6 +62,7 @@ @@ -300,27 +403,17 @@ index 6a6864c..5df336d 100644 /* readline include files */ #include "readline/readline.h" -@@ -92,6 +93,9 @@ static void map_breakpoint_numbers (char *, void (*) (struct breakpoint *, - - static void ignore_command (char *, int); - -+static void update_breakpoint_locations (struct breakpoint *b, -+ struct symtabs_and_lines sals); -+ - static int breakpoint_re_set_one (void *); - - static void clear_command (char *, int); -@@ -106,6 +110,9 @@ static void break_command_1 (char *, int, int); +@@ -104,6 +105,9 @@ static void break_command_1 (char *, int, int); static void mention (struct breakpoint *); +static struct bp_location *add_location_to_breakpoint (struct breakpoint *b, + const struct symtab_and_line *sal); + - /* This function is used in gdbtk sources and thus can not be made static. */ + /* This function is used in gdbtk sources and thus can not be made + static. */ struct breakpoint *set_raw_breakpoint (struct gdbarch *gdbarch, - struct symtab_and_line, -@@ -230,6 +237,10 @@ static void disable_trace_command (char *, int); +@@ -220,6 +224,10 @@ static void disable_trace_command (char *, int); static void trace_pass_command (char *, int); @@ -331,16 +424,7 @@ index 6a6864c..5df336d 100644 /* Assuming we're creating a static tracepoint, does S look like a static tracepoint marker spec ("-m MARKER_ID")? */ #define is_marker_spec(s) \ -@@ -430,7 +441,7 @@ static int tracepoint_count; - - static struct cmd_list_element *breakpoint_set_cmdlist; - static struct cmd_list_element *breakpoint_show_cmdlist; --static struct cmd_list_element *save_cmdlist; -+struct cmd_list_element *save_cmdlist; - - /* Return whether a breakpoint is an active enabled breakpoint. */ - static int -@@ -1252,6 +1263,22 @@ watchpoint_in_thread_scope (struct breakpoint *b) +@@ -1309,6 +1317,22 @@ watchpoint_in_thread_scope (struct breakpoint *b) && !is_executing (inferior_ptid))); } @@ -363,7 +447,7 @@ index 6a6864c..5df336d 100644 /* Assuming that B is a watchpoint: - Reparse watchpoint expression, if REPARSE is non-zero - Evaluate expression and store the result in B->val -@@ -1307,6 +1334,8 @@ update_watchpoint (struct breakpoint *b, int reparse) +@@ -1368,12 +1392,17 @@ update_watchpoint (struct breakpoint *b, int reparse) struct frame_id saved_frame_id; int frame_saved; @@ -372,7 +456,16 @@ index 6a6864c..5df336d 100644 /* If this is a local watchpoint, we only want to check if the watchpoint frame is in scope if the current thread is the thread that was used to create the watchpoint. */ -@@ -1510,13 +1539,7 @@ update_watchpoint (struct breakpoint *b, int reparse) + if (!watchpoint_in_thread_scope (b)) + return; + ++ if (b->pspace != current_program_space) ++ return; ++ + /* We don't free locations. They are stored in the bp_location array + and update_global_location_list will eventually delete them and + remove breakpoints if needed. */ +@@ -1595,13 +1624,7 @@ update_watchpoint (struct breakpoint *b, int reparse) Watchpoint %d deleted because the program has left the block\n\ in which its expression is valid.\n"), b->number); @@ -387,114 +480,57 @@ index 6a6864c..5df336d 100644 } /* Restore the selected frame. */ -@@ -2201,6 +2224,33 @@ create_std_terminate_master_breakpoint (const char *func_name) - do_cleanups (old_chain); - } +@@ -1992,6 +2015,7 @@ insert_breakpoint_locations (void) + int val = 0; + int disabled_breaks = 0; + int hw_breakpoint_error = 0; ++ struct program_space *saved_current_program_space = current_program_space; -+/* Install a master breakpoint on the unwinder's debug hook. */ + struct ui_file *tmp_error_stream = mem_fileopen (); + struct cleanup *cleanups = make_cleanup_ui_file_delete (tmp_error_stream); +@@ -2019,9 +2043,13 @@ insert_breakpoint_locations (void) + /* For targets that support global breakpoints, there's no need + to select an inferior to insert breakpoint to. In fact, even + if we aren't attached to any process yet, we should still +- insert breakpoints. */ ++ insert breakpoints. + -+void -+create_exception_master_breakpoint (void) -+{ -+ struct objfile *objfile; ++ Also inserting breakpoints into inappropriate inferior must be ++ prevented. */ + if (!gdbarch_has_global_breakpoints (target_gdbarch) +- && ptid_equal (inferior_ptid, null_ptid)) ++ && (ptid_equal (inferior_ptid, null_ptid) ++ || bl->pspace != saved_current_program_space)) + continue; + + val = insert_bp_location (bl, tmp_error_stream, &disabled_breaks, +@@ -2045,13 +2073,19 @@ insert_breakpoint_locations (void) + + if (bpt->disposition == disp_del_at_next_stop) + continue; +- + -+ ALL_OBJFILES (objfile) -+ { -+ struct minimal_symbol *debug_hook; -+ -+ debug_hook = lookup_minimal_symbol_text ("_Unwind_DebugHook", objfile); -+ if (debug_hook != NULL) + for (loc = bpt->loc; loc; loc = loc->next) +- if (!loc->inserted && should_be_inserted (loc)) +- { +- some_failed = 1; +- break; +- } + { -+ struct breakpoint *b; -+ -+ b = create_internal_breakpoint (get_objfile_arch (objfile), -+ SYMBOL_VALUE_ADDRESS (debug_hook), -+ bp_exception_master); -+ b->addr_string = xstrdup ("_Unwind_DebugHook"); -+ b->enable_state = bp_disabled; ++ /* Verify the first loop above really tried to insert this LOC. */ ++ if (!loc->inserted && should_be_inserted (loc) ++ && (gdbarch_has_global_breakpoints (target_gdbarch) ++ || (!ptid_equal (inferior_ptid, null_ptid) ++ && loc->pspace == saved_current_program_space))) ++ { ++ some_failed = 1; ++ break; ++ } + } -+ } -+ -+ update_global_location_list (1); -+} -+ - void - update_breakpoints_after_exec (void) - { -@@ -2242,7 +2292,8 @@ update_breakpoints_after_exec (void) - /* Thread event breakpoints must be set anew after an exec(), - as must overlay event and longjmp master breakpoints. */ - if (b->type == bp_thread_event || b->type == bp_overlay_event -- || b->type == bp_longjmp_master || b->type == bp_std_terminate_master) -+ || b->type == bp_longjmp_master || b->type == bp_std_terminate_master -+ || b->type == bp_exception_master) - { - delete_breakpoint (b); - continue; -@@ -2257,7 +2308,8 @@ update_breakpoints_after_exec (void) - - /* Longjmp and longjmp-resume breakpoints are also meaningless - after an exec. */ -- if (b->type == bp_longjmp || b->type == bp_longjmp_resume) -+ if (b->type == bp_longjmp || b->type == bp_longjmp_resume -+ || b->type == bp_exception || b->type == bp_exception_resume) - { - delete_breakpoint (b); - continue; -@@ -2319,6 +2371,7 @@ update_breakpoints_after_exec (void) - create_longjmp_master_breakpoint ("siglongjmp"); - create_longjmp_master_breakpoint ("_siglongjmp"); - create_std_terminate_master_breakpoint ("std::terminate()"); -+ create_exception_master_breakpoint (); - } - - int -@@ -2346,6 +2399,8 @@ detach_breakpoints (int pid) - /* Detach single-step breakpoints as well. */ - detach_single_step_breakpoints (); - -+ val |= target_detach_watchpoints (); -+ - do_cleanups (old_chain); - return val; - } -@@ -2447,9 +2502,11 @@ remove_breakpoint_1 (struct bp_location *b, insertion_state_t is) - return val; - b->inserted = (is == mark_inserted); - } -- else if (b->loc_type == bp_loc_hardware_watchpoint) -+ /* bp_loc_hardware_watchpoint with mark_inserted is being handled by -+ target_detach_watchpoints. */ -+ else if (b->loc_type == bp_loc_hardware_watchpoint && is == mark_uninserted) - { -- b->inserted = (is == mark_inserted); -+ b->inserted = 0; - val = target_remove_watchpoint (b->address, b->length, - b->watchpoint_type, b->owner->cond_exp); - -@@ -3237,6 +3294,12 @@ print_it_typical (bpstat bs) - result = PRINT_NOTHING; - break; - -+ case bp_exception_master: -+ /* These should never be enabled. */ -+ printf_filtered (_("Exception Master Breakpoint: gdb should not stop!\n")); -+ result = PRINT_NOTHING; -+ break; -+ - case bp_watchpoint: - case bp_hardware_watchpoint: - annotate_watchpoint (b->number); -@@ -3324,6 +3387,8 @@ print_it_typical (bpstat bs) - case bp_none: - case bp_longjmp: - case bp_longjmp_resume: -+ case bp_exception: -+ case bp_exception_resume: - case bp_step_resume: - case bp_watchpoint_scope: - case bp_call_dummy: -@@ -3331,6 +3396,8 @@ print_it_typical (bpstat bs) + if (some_failed) + { + for (loc = bpt->loc; loc; loc = loc->next) +@@ -3501,6 +3535,8 @@ print_it_typical (bpstat bs) case bp_tracepoint: case bp_fast_tracepoint: case bp_jit_event: @@ -503,17 +539,17 @@ index 6a6864c..5df336d 100644 default: result = PRINT_UNKNOWN; break; -@@ -3549,6 +3616,8 @@ watchpoint_check (void *p) - gdb_assert (bs->breakpoint_at->owner != NULL); - b = bs->breakpoint_at->owner; +@@ -3722,6 +3758,8 @@ watchpoint_check (void *p) + gdb_assert (bs->breakpoint_at != NULL); + b = bs->breakpoint_at; + gdb_assert (is_watchpoint (b)); + /* If this is a local watchpoint, we only want to check if the watchpoint frame is in scope if the current thread is the thread that was used to create the watchpoint. */ -@@ -3655,13 +3724,7 @@ watchpoint_check (void *p) - ui_out_text (uiout, " deleted because the program has left the block in\n\ +@@ -3831,13 +3869,7 @@ watchpoint_check (void *p) + " deleted because the program has left the block in\n\ which its expression is valid.\n"); - if (b->related_breakpoint) @@ -527,22 +563,7 @@ index 6a6864c..5df336d 100644 return WP_DELETED; } -@@ -3730,8 +3793,12 @@ bpstat_check_location (const struct bp_location *bl, - - /* If BS refers to a watchpoint, determine if the watched values - has actually changed, and we should stop. If not, set BS->stop -- to 0. */ --static void -+ to 0. -+ Return 0 for watchpoints which could not be the cause of this trap. -+ In such case PRINT_IT will be print_it_noop and STOP will be 0. -+ Otherwise return 1 but in such case it is not guaranteed whether this -+ breakpoint did or did not trigger this trap. */ -+static int - bpstat_check_watchpoint (bpstat bs) - { - const struct bp_location *bl; -@@ -3865,9 +3932,7 @@ bpstat_check_watchpoint (bpstat bs) +@@ -4042,9 +4074,7 @@ bpstat_check_watchpoint (bpstat bs) case 0: /* Error from catch_errors. */ printf_filtered (_("Watchpoint %d deleted.\n"), b->number); @@ -553,72 +574,16 @@ index 6a6864c..5df336d 100644 /* We've already printed what needs to be printed. */ bs->print_it = print_it_done; break; -@@ -3881,8 +3946,10 @@ bpstat_check_watchpoint (bpstat bs) - anything for this watchpoint. */ - bs->print_it = print_it_noop; - bs->stop = 0; -+ return 0; +@@ -4250,7 +4280,7 @@ bpstat_stop_status (struct address_space *aspace, + watchpoint as triggered so that we will handle the + out-of-scope event. We'll get to the watchpoint next + iteration. */ +- if (b->type == bp_watchpoint_scope) ++ if (b->type == bp_watchpoint_scope && b->related_breakpoint != b) + b->related_breakpoint->watchpoint_triggered = watch_triggered_yes; } } -+ return 1; - } - - -@@ -3914,7 +3981,7 @@ bpstat_check_breakpoint_conditions (bpstat bs, ptid_t ptid) - watchpoint as triggered so that we will handle the - out-of-scope event. We'll get to the watchpoint next - iteration. */ -- if (b->type == bp_watchpoint_scope) -+ if (b->type == bp_watchpoint_scope && b->related_breakpoint != b) - b->related_breakpoint->watchpoint_triggered = watch_triggered_yes; - - if (is_watchpoint (b)) -@@ -4045,6 +4112,8 @@ bpstat_stop_status (struct address_space *aspace, - - for (bl = b->loc; bl != NULL; bl = bl->next) - { -+ bpstat bs_prev = bs; -+ - /* For hardware watchpoints, we look only at the first location. - The watchpoint_check function will work on the entire expression, - not the individual locations. For read watchpoints, the -@@ -4062,6 +4131,7 @@ bpstat_stop_status (struct address_space *aspace, - /* Come here if it's a watchpoint, or if the break address matches */ - - bs = bpstat_alloc (bl, bs); /* Alloc a bpstat to explain stop */ -+ gdb_assert (bs_prev->next == bs); - - /* Assume we stop. Should we find watchpoint that is not actually - triggered, or if condition of breakpoint is false, we'll reset -@@ -4069,13 +4139,23 @@ bpstat_stop_status (struct address_space *aspace, - bs->stop = 1; - bs->print = 1; - -- bpstat_check_watchpoint (bs); -- if (!bs->stop) -- continue; -+ if (!bpstat_check_watchpoint (bs)) -+ { -+ /* Ensure bpstat_explains_signal stays false if this BL could not be -+ the cause of this trap. */ -+ -+ gdb_assert (bs->print_it == print_it_noop); -+ gdb_assert (!bs->stop); -+ xfree (bs); -+ bs = bs_prev; -+ bs->next = NULL; -+ continue; -+ } - - if (b->type == bp_thread_event || b->type == bp_overlay_event - || b->type == bp_longjmp_master -- || b->type == bp_std_terminate_master) -+ || b->type == bp_std_terminate_master -+ || b->type == bp_exception_master) - /* We do not stop for these. */ - bs->stop = 0; - else -@@ -4176,7 +4256,7 @@ handle_jit_event (void) +@@ -4372,7 +4402,7 @@ handle_jit_event (void) /* Decide what infrun needs to do with this bpstat. */ struct bpstat_what @@ -627,7 +592,7 @@ index 6a6864c..5df336d 100644 { struct bpstat_what retval; /* We need to defer calling `solib_add', as adding new symbols -@@ -4184,11 +4264,13 @@ bpstat_what (bpstat bs) +@@ -4380,12 +4410,13 @@ bpstat_what (bpstat bs) and hence may clear unprocessed entries in the BS chain. */ int shlib_event = 0; int jit_event = 0; @@ -635,38 +600,14 @@ index 6a6864c..5df336d 100644 retval.main_action = BPSTAT_WHAT_KEEP_CHECKING; retval.call_dummy = STOP_NONE; -+ retval.is_longjmp = 0; + retval.is_longjmp = 0; - for (; bs != NULL; bs = bs->next) + for (bs = bs_head; bs != NULL; bs = bs->next) { /* Extract this BS's action. After processing each BS, we check if its action overrides all we've seem so far. */ -@@ -4242,10 +4324,15 @@ bpstat_what (bpstat bs) - } - break; - case bp_longjmp: -+ case bp_exception: - this_action = BPSTAT_WHAT_SET_LONGJMP_RESUME; -+ retval.is_longjmp = bs->breakpoint_at->owner->type == bp_longjmp; - break; - case bp_longjmp_resume: -+ case bp_exception_resume: - this_action = BPSTAT_WHAT_CLEAR_LONGJMP_RESUME; -+ retval.is_longjmp -+ = bs->breakpoint_at->owner->type == bp_longjmp_resume; - break; - case bp_step_resume: - if (bs->stop) -@@ -4261,6 +4348,7 @@ bpstat_what (bpstat bs) - case bp_overlay_event: - case bp_longjmp_master: - case bp_std_terminate_master: -+ case bp_exception_master: - this_action = BPSTAT_WHAT_SINGLE; - break; - case bp_catchpoint: -@@ -4313,6 +4401,20 @@ bpstat_what (bpstat bs) +@@ -4515,6 +4546,20 @@ bpstat_what (bpstat bs) out already. */ internal_error (__FILE__, __LINE__, _("bpstat_what: tracepoint encountered")); @@ -687,7 +628,7 @@ index 6a6864c..5df336d 100644 default: internal_error (__FILE__, __LINE__, _("bpstat_what: unhandled bptype %d"), (int) bptype); -@@ -4350,6 +4452,23 @@ bpstat_what (bpstat bs) +@@ -4552,6 +4597,21 @@ bpstat_what (bpstat bs) handle_jit_event (); } @@ -695,15 +636,13 @@ index 6a6864c..5df336d 100644 + { + if (bs->breakpoint_at == NULL) + continue; -+ if (bs->breakpoint_at->owner == NULL) -+ continue; -+ switch (bs->breakpoint_at->owner->type) ++ switch (bs->breakpoint_at->type) + { + case bp_gnu_ifunc_resolver: -+ gnu_ifunc_resolver_stop (bs->breakpoint_at->owner); ++ gnu_ifunc_resolver_stop (bs->breakpoint_at); + break; + case bp_gnu_ifunc_resolver_return: -+ gnu_ifunc_resolver_return_stop (bs->breakpoint_at->owner); ++ gnu_ifunc_resolver_return_stop (bs->breakpoint_at); + break; + } + } @@ -711,45 +650,16 @@ index 6a6864c..5df336d 100644 return retval; } -@@ -4461,6 +4580,8 @@ print_one_breakpoint_location (struct breakpoint *b, - {bp_access_watchpoint, "acc watchpoint"}, - {bp_longjmp, "longjmp"}, - {bp_longjmp_resume, "longjmp resume"}, -+ {bp_exception, "exception"}, -+ {bp_exception_resume, "exception resume"}, - {bp_step_resume, "step resume"}, - {bp_watchpoint_scope, "watchpoint scope"}, - {bp_call_dummy, "call dummy"}, -@@ -4470,11 +4591,14 @@ print_one_breakpoint_location (struct breakpoint *b, - {bp_overlay_event, "overlay events"}, - {bp_longjmp_master, "longjmp master"}, - {bp_std_terminate_master, "std::terminate master"}, -+ {bp_exception_master, "exception master"}, - {bp_catchpoint, "catchpoint"}, - {bp_tracepoint, "tracepoint"}, +@@ -4673,6 +4733,8 @@ bptype_string (enum bptype type) {bp_fast_tracepoint, "fast tracepoint"}, {bp_static_tracepoint, "static tracepoint"}, {bp_jit_event, "jit events"}, + {bp_gnu_ifunc_resolver, "gnu-ifunc resolver"}, + {bp_gnu_ifunc_resolver_return, "gnu-func resolver return"}, }; - - static char bpenables[] = "nynny"; -@@ -4595,6 +4719,8 @@ print_one_breakpoint_location (struct breakpoint *b, - case bp_finish: - case bp_longjmp: - case bp_longjmp_resume: -+ case bp_exception: -+ case bp_exception_resume: - case bp_step_resume: - case bp_watchpoint_scope: - case bp_call_dummy: -@@ -4604,10 +4730,13 @@ print_one_breakpoint_location (struct breakpoint *b, - case bp_overlay_event: - case bp_longjmp_master: - case bp_std_terminate_master: -+ case bp_exception_master: - case bp_tracepoint: + + if (((int) type >= (sizeof (bptypes) / sizeof (bptypes[0]))) +@@ -4820,6 +4882,8 @@ print_one_breakpoint_location (struct breakpoint *b, case bp_fast_tracepoint: case bp_static_tracepoint: case bp_jit_event: @@ -758,7 +668,7 @@ index 6a6864c..5df336d 100644 if (opts.addressprint) { annotate_field (4); -@@ -4888,7 +5017,8 @@ user_settable_breakpoint (const struct breakpoint *b) +@@ -5101,7 +5165,8 @@ user_settable_breakpoint (const struct breakpoint *b) || b->type == bp_catchpoint || b->type == bp_hardware_breakpoint || is_tracepoint (b) @@ -766,36 +676,26 @@ index 6a6864c..5df336d 100644 + || is_watchpoint (b) + || b->type == bp_gnu_ifunc_resolver); } - - /* Print information on user settable breakpoint (watchpoint, etc) -@@ -5334,6 +5464,8 @@ allocate_bp_location (struct breakpoint *bpt) - case bp_finish: - case bp_longjmp: - case bp_longjmp_resume: -+ case bp_exception: -+ case bp_exception_resume: - case bp_step_resume: - case bp_watchpoint_scope: - case bp_call_dummy: -@@ -5344,6 +5476,9 @@ allocate_bp_location (struct breakpoint *bpt) - case bp_jit_event: + + /* Return true if this breakpoint was set by the user, false if it is +@@ -5590,6 +5655,8 @@ allocate_bp_location (struct breakpoint *bpt) case bp_longjmp_master: case bp_std_terminate_master: + case bp_exception_master: + case bp_gnu_ifunc_resolver: + case bp_gnu_ifunc_resolver_return: -+ case bp_exception_master: loc->loc_type = bp_loc_software_breakpoint; break; case bp_hardware_breakpoint: -@@ -5420,6 +5555,7 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch, - b->syscalls_to_be_caught = NULL; +@@ -5679,6 +5746,7 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch, b->ops = NULL; b->condition_not_parsed = 0; + b->py_bp_object = NULL; + b->related_breakpoint = b; - /* Add this breakpoint to the end of the chain - so that a list of breakpoints will come out in order -@@ -5439,7 +5575,7 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch, + /* Add this breakpoint to the end of the chain so that a list of + breakpoints will come out in order of increasing numbers. */ +@@ -5697,7 +5765,7 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch, /* Initialize loc->function_name. */ static void @@ -804,7 +704,7 @@ index 6a6864c..5df336d 100644 { gdb_assert (loc->owner != NULL); -@@ -5447,8 +5583,29 @@ set_breakpoint_location_function (struct bp_location *loc) +@@ -5705,8 +5773,29 @@ set_breakpoint_location_function (struct bp_location *loc) || loc->owner->type == bp_hardware_breakpoint || is_tracepoint (loc->owner)) { @@ -836,7 +736,7 @@ index 6a6864c..5df336d 100644 if (loc->function_name) loc->function_name = xstrdup (loc->function_name); } -@@ -5521,7 +5678,8 @@ set_raw_breakpoint (struct gdbarch *gdbarch, +@@ -5781,7 +5870,8 @@ set_raw_breakpoint (struct gdbarch *gdbarch, b->loc->section = sal.section; b->line_number = sal.line; @@ -846,41 +746,7 @@ index 6a6864c..5df336d 100644 breakpoints_changed (); -@@ -5548,8 +5706,7 @@ make_breakpoint_permanent (struct breakpoint *b) - } - - /* Call this routine when stepping and nexting to enable a breakpoint -- if we do a longjmp() in THREAD. When we hit that breakpoint, call -- set_longjmp_resume_breakpoint() to figure out where we are going. */ -+ if we do a longjmp() or 'throw' in THREAD. */ - - void - set_longjmp_breakpoint (int thread) -@@ -5562,11 +5719,12 @@ set_longjmp_breakpoint (int thread) - clones of those and enable them for the requested thread. */ - ALL_BREAKPOINTS_SAFE (b, temp) - if (b->pspace == current_program_space -- && b->type == bp_longjmp_master) -+ && (b->type == bp_longjmp_master -+ || b->type == bp_exception_master)) - { - struct breakpoint *clone = clone_momentary_breakpoint (b); - -- clone->type = bp_longjmp; -+ clone->type = b->type == bp_longjmp_master ? bp_longjmp : bp_exception; - clone->thread = thread; - } - } -@@ -5578,7 +5736,7 @@ delete_longjmp_breakpoint (int thread) - struct breakpoint *b, *temp; - - ALL_BREAKPOINTS_SAFE (b, temp) -- if (b->type == bp_longjmp) -+ if (b->type == bp_longjmp || b->type == bp_exception) - { - if (b->thread == thread) - delete_breakpoint (b); -@@ -6595,7 +6753,7 @@ clone_momentary_breakpoint (struct breakpoint *orig) +@@ -6898,7 +6988,7 @@ clone_momentary_breakpoint (struct breakpoint *orig) copy = set_raw_breakpoint_without_location (orig->gdbarch, orig->type); copy->loc = allocate_bp_location (copy); @@ -889,7 +755,7 @@ index 6a6864c..5df336d 100644 copy->loc->gdbarch = orig->loc->gdbarch; copy->loc->requested_address = orig->loc->requested_address; -@@ -6694,6 +6852,7 @@ mention (struct breakpoint *b) +@@ -6998,6 +7088,7 @@ mention (struct breakpoint *b) do_cleanups (ui_out_chain); break; case bp_breakpoint: @@ -897,7 +763,7 @@ index 6a6864c..5df336d 100644 if (ui_out_is_mi_like_p (uiout)) { say_where = 0; -@@ -6704,6 +6863,8 @@ mention (struct breakpoint *b) +@@ -7008,6 +7099,8 @@ mention (struct breakpoint *b) else printf_filtered (_("Breakpoint")); printf_filtered (_(" %d"), b->number); @@ -906,25 +772,15 @@ index 6a6864c..5df336d 100644 say_where = 1; break; case bp_hardware_breakpoint: -@@ -6750,6 +6911,8 @@ mention (struct breakpoint *b) - case bp_finish: - case bp_longjmp: - case bp_longjmp_resume: -+ case bp_exception: -+ case bp_exception_resume: - case bp_step_resume: - case bp_call_dummy: - case bp_std_terminate: -@@ -6760,6 +6923,8 @@ mention (struct breakpoint *b) - case bp_jit_event: +@@ -7067,6 +7160,7 @@ mention (struct breakpoint *b) case bp_longjmp_master: case bp_std_terminate_master: + case bp_exception_master: + case bp_gnu_ifunc_resolver_return: -+ case bp_exception_master: break; } -@@ -6820,7 +6985,8 @@ add_location_to_breakpoint (struct breakpoint *b, +@@ -7127,7 +7221,8 @@ add_location_to_breakpoint (struct breakpoint *b, gdb_assert (loc->pspace != NULL); loc->section = sal->section; @@ -934,64 +790,28 @@ index 6a6864c..5df336d 100644 return loc; } -@@ -8346,6 +8512,7 @@ struct until_break_command_continuation_args - { - struct breakpoint *breakpoint; - struct breakpoint *breakpoint2; -+ int thread_num; - }; +@@ -8573,6 +8668,7 @@ watch_command_1 (char *arg, int accessflag, int from_tty, + b = set_raw_breakpoint_without_location (NULL, bp_type); + set_breakpoint_number (internal, b); + b->thread = thread; ++ b->pspace = current_program_space; + b->disposition = disp_donttouch; + b->exp = exp; + b->exp_valid_block = exp_valid_block; +@@ -9744,6 +9840,9 @@ update_global_location_list (int should_insert) + int keep_in_target = 0; + int removed = 0; - /* This function is called by fetch_inferior_event via the -@@ -8360,6 +8527,7 @@ until_break_command_continuation (void *arg) - delete_breakpoint (a->breakpoint); - if (a->breakpoint2) - delete_breakpoint (a->breakpoint2); -+ delete_longjmp_breakpoint (a->thread_num); - } - - void -@@ -8371,6 +8539,8 @@ until_break_command (char *arg, int from_tty, int anywhere) - struct breakpoint *breakpoint; - struct breakpoint *breakpoint2 = NULL; - struct cleanup *old_chain; -+ int thread; -+ struct thread_info *tp; - - clear_proceed_status (); - -@@ -8409,6 +8579,9 @@ until_break_command (char *arg, int from_tty, int anywhere) - - old_chain = make_cleanup_delete_breakpoint (breakpoint); - -+ tp = inferior_thread (); -+ thread = tp->num; ++ if (old_loc->pspace != current_program_space) ++ continue; + - /* Keep within the current frame, or in frames called by the current - one. */ + /* Skip LOCP entries which will definitely never be needed. + Stop either at or being the one matching OLD_LOC. */ + while (locp < bp_location + bp_location_count +@@ -10060,12 +10159,20 @@ delete_breakpoint (struct breakpoint *bpt) -@@ -8421,6 +8594,10 @@ until_break_command (char *arg, int from_tty, int anywhere) - frame_unwind_caller_id (frame), - bp_until); - make_cleanup_delete_breakpoint (breakpoint2); -+ -+ set_longjmp_breakpoint (thread); -+ tp->initiating_frame = frame_unwind_caller_id (frame); -+ make_cleanup (delete_longjmp_breakpoint_cleanup, &thread); - } - - proceed (-1, TARGET_SIGNAL_DEFAULT, 0); -@@ -8437,6 +8614,7 @@ until_break_command (char *arg, int from_tty, int anywhere) - - args->breakpoint = breakpoint; - args->breakpoint2 = breakpoint2; -+ args->thread_num = thread; - - discard_cleanups (old_chain); - add_continuation (inferior_thread (), -@@ -9564,12 +9742,22 @@ delete_breakpoint (struct breakpoint *bpt) - - /* At least avoid this stale reference until the reference counting of - breakpoints gets resolved. */ + /* At least avoid this stale reference until the reference counting + of breakpoints gets resolved. */ - if (bpt->related_breakpoint != NULL) + if (bpt->related_breakpoint != bpt) { @@ -999,40 +819,22 @@ index 6a6864c..5df336d 100644 - bpt->related_breakpoint->disposition = disp_del_at_next_stop; - bpt->related_breakpoint->related_breakpoint = NULL; - bpt->related_breakpoint = NULL; ++ struct breakpoint *related; ++ + if (bpt->type == bp_watchpoint_scope) + watchpoint_del_at_next_stop (bpt->related_breakpoint); + else if (bpt->related_breakpoint->type == bp_watchpoint_scope) + watchpoint_del_at_next_stop (bpt); -+ else -+ { -+ struct breakpoint *related; + -+ /* Unlink bpt from the bpt->related_breakpoint ring. */ -+ for (related = bpt; related->related_breakpoint != bpt; -+ related = related->related_breakpoint); -+ related->related_breakpoint = bpt->related_breakpoint; -+ bpt->related_breakpoint = bpt; -+ } ++ /* Unlink bpt from the bpt->related_breakpoint ring. */ ++ for (related = bpt; related->related_breakpoint != bpt; ++ related = related->related_breakpoint); ++ related->related_breakpoint = bpt->related_breakpoint; ++ bpt->related_breakpoint = bpt; } observer_notify_breakpoint_deleted (bpt->number); -@@ -9658,6 +9846,7 @@ delete_command (char *arg, int from_tty) - && b->type != bp_overlay_event - && b->type != bp_longjmp_master - && b->type != bp_std_terminate_master -+ && b->type != bp_exception_master - && b->number >= 0) - { - breaks_to_delete = 1; -@@ -9679,6 +9868,7 @@ delete_command (char *arg, int from_tty) - && b->type != bp_overlay_event - && b->type != bp_longjmp_master - && b->type != bp_std_terminate_master -+ && b->type != bp_exception_master - && b->number >= 0) - delete_breakpoint (b); - } -@@ -9887,6 +10077,9 @@ update_breakpoint_locations (struct breakpoint *b, +@@ -10396,6 +10503,9 @@ update_breakpoint_locations (struct breakpoint *b, return; b->loc = NULL; @@ -1042,7 +844,7 @@ index 6a6864c..5df336d 100644 for (i = 0; i < sals.nelts; ++i) { -@@ -9913,11 +10106,7 @@ update_breakpoint_locations (struct breakpoint *b, +@@ -10423,11 +10533,7 @@ update_breakpoint_locations (struct breakpoint *b, } } @@ -1055,7 +857,7 @@ index 6a6864c..5df336d 100644 b->source_file = xstrdup (sals.sals[i].symtab->filename); if (b->line_number == 0) -@@ -9999,6 +10188,7 @@ breakpoint_re_set_one (void *bint) +@@ -10510,6 +10616,7 @@ breakpoint_re_set_one (void *bint) case bp_tracepoint: case bp_fast_tracepoint: case bp_static_tracepoint: @@ -1063,34 +865,15 @@ index 6a6864c..5df336d 100644 /* Do not attempt to re-set breakpoints disabled during startup. */ if (b->enable_state == bp_startup_disabled) return 0; -@@ -10139,6 +10329,7 @@ breakpoint_re_set_one (void *bint) - case bp_overlay_event: - case bp_longjmp_master: - case bp_std_terminate_master: -+ case bp_exception_master: - delete_breakpoint (b); - break; - -@@ -10162,7 +10353,10 @@ breakpoint_re_set_one (void *bint) - case bp_step_resume: - case bp_longjmp: - case bp_longjmp_resume: -+ case bp_exception: -+ case bp_exception_resume: +@@ -10680,6 +10787,7 @@ breakpoint_re_set_one (void *bint) + case bp_exception: + case bp_exception_resume: case bp_jit_event: + case bp_gnu_ifunc_resolver_return: break; } -@@ -10205,6 +10399,7 @@ breakpoint_re_set (void) - create_longjmp_master_breakpoint ("siglongjmp"); - create_longjmp_master_breakpoint ("_siglongjmp"); - create_std_terminate_master_breakpoint ("std::terminate()"); -+ create_exception_master_breakpoint (); - } - - /* Reset the thread number of this breakpoint: -@@ -10334,11 +10529,20 @@ map_breakpoint_numbers (char *args, void (*function) (struct breakpoint *, +@@ -10847,11 +10955,25 @@ map_breakpoint_numbers (char *args, void (*function) (struct breakpoint *, ALL_BREAKPOINTS_SAFE (b, tmp) if (b->number == num) { @@ -1109,13 +892,18 @@ index 6a6864c..5df336d 100644 + /* FUNCTION can be also delete_breakpoint. */ + next_related_b = related_breakpoint->related_breakpoint; + function (related_breakpoint, data); ++ ++ /* For delete_breakpoint of the last entry of the ring we ++ were traversing we would never get back to B. */ ++ if (next_related_b == related_breakpoint) ++ break; + related_breakpoint = next_related_b; + } + while (related_breakpoint != b); break; } if (match == 0) -@@ -11428,6 +11632,22 @@ all_tracepoints () +@@ -11966,6 +12088,22 @@ all_tracepoints () return tp_vec; } @@ -1136,10 +924,10 @@ index 6a6864c..5df336d 100644 +} + - /* This help string is used for the break, hbreak, tbreak and thbreak commands. - It is defined as a macro to prevent duplication. -@@ -11497,6 +11717,107 @@ save_command (char *arg, int from_tty) - help_list (save_cmdlist, "save ", -1, gdb_stdout); + /* This help string is used for the break, hbreak, tbreak and thbreak + commands. It is defined as a macro to prevent duplication. +@@ -12051,6 +12189,107 @@ iterate_over_breakpoints (int (*callback) (struct breakpoint *, void *), + return NULL; } +static void @@ -1246,41 +1034,17 @@ index 6a6864c..5df336d 100644 void _initialize_breakpoint (void) { -@@ -12022,4 +12343,5 @@ inferior in all-stop mode, gdb behaves as if always-inserted mode is off."), +@@ -12585,4 +12824,5 @@ inferior in all-stop mode, gdb behaves as if always-inserted mode is off."), automatic_hardware_breakpoints = 1; observer_attach_about_to_proceed (breakpoint_about_to_proceed); + observer_attach_mark_used (breakpoint_types_mark_used); } diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h -index 6f5d050..d0c3cc1 100644 +index 86fae66..ffef340 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h -@@ -56,6 +56,13 @@ enum bptype - bp_longjmp, /* secret breakpoint to find longjmp() */ - bp_longjmp_resume, /* secret breakpoint to escape longjmp() */ - -+ /* An internal breakpoint that is installed on the unwinder's -+ debug hook. */ -+ bp_exception, -+ /* An internal breakpoint that is set at the point where an -+ exception will land. */ -+ bp_exception_resume, -+ - /* Used by wait_for_inferior for stepping over subroutine calls, for - stepping over signal handlers, and for skipping prologues. */ - bp_step_resume, -@@ -125,6 +132,9 @@ enum bptype - /* Master copies of std::terminate breakpoints. */ - bp_std_terminate_master, - -+ /* Like bp_longjmp_master, but for exceptions. */ -+ bp_exception_master, -+ - bp_catchpoint, - - bp_tracepoint, -@@ -133,6 +143,9 @@ enum bptype +@@ -148,6 +148,9 @@ enum bptype /* Event for JIT compiled code generation or deletion. */ bp_jit_event, @@ -1289,248 +1053,78 @@ index 6f5d050..d0c3cc1 100644 + bp_gnu_ifunc_resolver_return, }; - /* States of enablement of breakpoint. */ -@@ -653,6 +666,10 @@ struct bpstat_what - continuing from a call dummy without popping the frame is not a - useful one). */ - enum stop_stack_kind call_dummy; -+ -+ /* Used for BPSTAT_WHAT_SET_LONGJMP_RESUME. True if we are -+ handling a longjmp, false if we are handling an exception. */ -+ int is_longjmp; - }; - - /* The possible return values for print_bpstat, print_it_normal, + /* States of enablement of breakpoint. */ diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c -index 926ae2f..a59b965 100644 +index 9909e13..30c3dfe 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c -@@ -585,7 +585,13 @@ c_type_print_varspec_suffix (struct type *type, struct ui_file *stream, - fprintf_filtered (stream, ")"); +@@ -609,9 +609,14 @@ c_type_print_varspec_suffix (struct type *type, + fprintf_filtered (stream, ")"); - fprintf_filtered (stream, "["); -- if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0 -+ if (TYPE_RANGE_DATA (TYPE_INDEX_TYPE (type))->high.kind -+ != RANGE_BOUND_KIND_CONSTANT) -+ { -+ /* No _() - printed sources should not be locale dependent. */ -+ fprintf_filtered (stream, "variable"); -+ } -+ else if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0 - && !TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) - fprintf_filtered (stream, "%d", - (TYPE_LENGTH (type) -diff --git a/gdb/config.in b/gdb/config.in -index 1fc457d..f4c846a 100644 ---- a/gdb/config.in -+++ b/gdb/config.in -@@ -50,11 +50,10 @@ - language is requested. */ - #undef ENABLE_NLS + fprintf_filtered (stream, "["); +- if (get_array_bounds (type, &low_bound, &high_bound)) +- fprintf_filtered (stream, "%d", +- (int) (high_bound - low_bound + 1)); ++ if (TYPE_RANGE_DATA (TYPE_INDEX_TYPE (type))->high.kind ++ != RANGE_BOUND_KIND_CONSTANT) ++ { ++ /* No _() - printed sources should not be locale dependent. */ ++ fprintf_filtered (stream, "variable"); ++ } ++ else if (get_array_bounds (type, &low_bound, &high_bound)) ++ fprintf_filtered (stream, "%d", (int) (high_bound - low_bound + 1)); + fprintf_filtered (stream, "]"); --/* look for global separate data files in this path [DATADIR/gdb] */ -+/* Global directory for GDB data files. */ - #undef GDB_DATADIR + c_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, +diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in +index 11cf2e6..9a2a8f8 100644 +--- a/gdb/data-directory/Makefile.in ++++ b/gdb/data-directory/Makefile.in +@@ -52,11 +52,23 @@ SYSCALLS_FILES = \ + PYTHON_DIR = python + PYTHON_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(PYTHON_DIR) + PYTHON_FILES = \ ++ gdb/FrameIterator.py \ ++ gdb/FrameWrapper.py \ + gdb/__init__.py \ +- gdb/types.py \ +- gdb/printing.py \ ++ gdb/backtrace.py \ + gdb/command/__init__.py \ +- gdb/command/pretty_printers.py ++ gdb/command/alias.py \ ++ gdb/command/backtrace.py \ ++ gdb/command/ignore_errors.py \ ++ gdb/command/pahole.py \ ++ gdb/command/pretty_printers.py \ ++ gdb/command/require.py \ ++ gdb/command/upto.py \ ++ gdb/function/__init__.py \ ++ gdb/function/caller_is.py \ ++ gdb/function/in_scope.py \ ++ gdb/printing.py \ ++ gdb/types.py --/* Define if the gdb-datadir directory should be relocated when GDB is moved. -- */ -+/* Define if GDB datadir should be relocated when GDB is moved. */ - #undef GDB_DATADIR_RELOCATABLE + FLAGS_TO_PASS = \ + "prefix=$(prefix)" \ +diff --git a/gdb/defs.h b/gdb/defs.h +index 9409dde..f0fa4c7 100644 +--- a/gdb/defs.h ++++ b/gdb/defs.h +@@ -398,6 +398,8 @@ extern struct cleanup *make_cleanup_restore_page_info (void); + extern struct cleanup * + set_batch_flag_and_make_cleanup_restore_page_info (void); - /* Define to be a string naming the default host character set. */ -@@ -769,6 +768,9 @@ - 'ptrdiff_t'. */ - #undef PTRDIFF_T_SUFFIX ++extern struct cleanup *make_cleanup_restore_selected_frame (void); ++ + extern char *gdb_realpath (const char *); + extern char *xfullpath (const char *); -+/* Define to install path for Python sources */ -+#undef PYTHONDIR -+ - /* Define if the python directory should be relocated when GDB is moved. */ - #undef PYTHON_PATH_RELOCATABLE - -diff --git a/gdb/configure b/gdb/configure -index 041ffc1..8243abb 100755 ---- a/gdb/configure -+++ b/gdb/configure -@@ -679,6 +679,8 @@ REPORT_BUGS_TO - PKGVERSION - TARGET_OBS - subdirs -+pythondir -+GDB_DATADIR_PATH - GDB_DATADIR - DEBUGDIR - am__fastdepCC_FALSE -@@ -945,6 +947,7 @@ enable_dependency_tracking - with_separate_debug_dir - with_gdb_datadir - with_relocated_sources -+with_pythondir - enable_targets - enable_64_bit_bfd - enable_gdbcli -@@ -1646,6 +1649,10 @@ Optional Packages: - [DATADIR/gdb] - --with-relocated-sources=PATH - automatically relocate this path for source files -+ --with-gdb-datadir look for global separate data files in this path -+ [DATADIR/gdb] -+ --with-pythondir install Python data files in this path -+ [DATADIR/gdb/python] - --with-libunwind use libunwind frame unwinding support - --with-curses use the curses library instead of the termcap - library -@@ -7878,6 +7885,73 @@ _ACEOF - fi - - -+# GDB's datadir relocation -+ -+gdbdatadir=${datadir}/gdb -+ -+ -+# Check whether --with-gdb-datadir was given. -+if test "${with_gdb_datadir+set}" = set; then : -+ withval=$with_gdb_datadir; gdbdatadir="${withval}" -+fi -+ -+ -+ -+ test "x$prefix" = xNONE && prefix="$ac_default_prefix" -+ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -+ ac_define_dir=`eval echo $gdbdatadir` -+ ac_define_dir=`eval echo $ac_define_dir` -+ -+cat >>confdefs.h <<_ACEOF -+#define GDB_DATADIR "$ac_define_dir" -+_ACEOF -+ -+ -+ -+if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then -+ if test "x$prefix" = xNONE; then -+ test_prefix=/usr/local -+ else -+ test_prefix=$prefix -+ fi -+else -+ test_prefix=$exec_prefix -+fi -+ -+case ${gdbdatadir} in -+ "${test_prefix}"|"${test_prefix}/"*|\ -+ '${exec_prefix}'|'${exec_prefix}/'*) -+ -+$as_echo "#define GDB_DATADIR_RELOCATABLE 1" >>confdefs.h -+ -+ ;; -+esac -+GDB_DATADIR_PATH=${gdbdatadir} -+ -+ -+ -+# Check whether --with-pythondir was given. -+if test "${with_pythondir+set}" = set; then : -+ withval=$with_pythondir; pythondir="${withval}" -+else -+ pythondir=no -+fi -+ -+ -+# If the user passed in a path, define it. Otherwise, compute it at -+# runtime based on the possibly-relocatable datadir. -+if test "$pythondir" = "no"; then -+ pythondir='$(GDB_DATADIR_PATH)/python' -+else -+ -+cat >>confdefs.h <<_ACEOF -+#define PYTHONDIR "$pythondir" -+_ACEOF -+ -+fi -+ -+ -+ - - - subdirs="$subdirs doc testsuite" -@@ -10919,6 +10993,7 @@ $as_echo "#define HAVE_PYTHON 1" >>confdefs.h - CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_PYTHON_DEPS)" - CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_PYTHON_SRCS)" - CONFIG_INSTALL="$CONFIG_INSTALL install-python" -+ CONFIG_UNINSTALL="$CONFIG_UNINSTALL uninstall-python" - ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_PYTHON_CFLAGS)" - - # Flags needed to compile Python code (taken from python-config --cflags). -diff --git a/gdb/configure.ac b/gdb/configure.ac -index b69c3b6..4e89558 100644 ---- a/gdb/configure.ac -+++ b/gdb/configure.ac -@@ -108,6 +108,51 @@ AS_HELP_STRING([--with-relocated-sources=PATH], [automatically relocate this pat - [Relocated directory for source files. ]) - ]) - -+# GDB's datadir relocation -+ -+gdbdatadir=${datadir}/gdb -+ -+AC_ARG_WITH([gdb-datadir], -+ [AS_HELP_STRING([--with-gdb-datadir], -+ [look for global separate data files in this path [DATADIR/gdb]])], [gdbdatadir="${withval}"]) -+ -+AC_DEFINE_DIR(GDB_DATADIR, gdbdatadir, -+ [Global directory for GDB data files. ]) -+ -+if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then -+ if test "x$prefix" = xNONE; then -+ test_prefix=/usr/local -+ else -+ test_prefix=$prefix -+ fi -+else -+ test_prefix=$exec_prefix -+fi -+ -+case ${gdbdatadir} in -+ "${test_prefix}"|"${test_prefix}/"*|\ -+ '${exec_prefix}'|'${exec_prefix}/'*) -+ AC_DEFINE(GDB_DATADIR_RELOCATABLE, 1, [Define if GDB datadir should be relocated when GDB is moved.]) -+ ;; -+esac -+GDB_DATADIR_PATH=${gdbdatadir} -+AC_SUBST(GDB_DATADIR_PATH) -+ -+AC_ARG_WITH([pythondir], -+ [AS_HELP_STRING([--with-pythondir], -+ [install Python data files in this path [DATADIR/gdb/python]])], [pythondir="${withval}"], [pythondir=no]) -+ -+# If the user passed in a path, define it. Otherwise, compute it at -+# runtime based on the possibly-relocatable datadir. -+if test "$pythondir" = "no"; then -+ pythondir='$(GDB_DATADIR_PATH)/python' -+else -+ AC_DEFINE_UNQUOTED(PYTHONDIR, "$pythondir", -+ [Define to install path for Python sources]) -+fi -+AC_SUBST(pythondir) -+ -+ - AC_CONFIG_SUBDIRS(doc testsuite) - - # Check whether to support alternative target configurations -@@ -833,6 +878,7 @@ if test "${have_libpython}" != no; then - CONFIG_DEPS="$CONFIG_DEPS \$(SUBDIR_PYTHON_DEPS)" - CONFIG_SRCS="$CONFIG_SRCS \$(SUBDIR_PYTHON_SRCS)" - CONFIG_INSTALL="$CONFIG_INSTALL install-python" -+ CONFIG_UNINSTALL="$CONFIG_UNINSTALL uninstall-python" - ENABLE_CFLAGS="$ENABLE_CFLAGS \$(SUBDIR_PYTHON_CFLAGS)" - - # Flags needed to compile Python code (taken from python-config --cflags). diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo -index 65d4899..96767b0 100644 +index 6a3c7de..b2165f8 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo -@@ -1162,6 +1162,16 @@ for remote debugging. +@@ -1177,6 +1177,16 @@ for remote debugging. Run using @var{device} for your program's standard input and output. @c FIXME: kingdon thinks there is more to -tty. Investigate. @@ -1547,62 +1141,7 @@ index 65d4899..96767b0 100644 @c resolve the situation of these eventually @item -tui @cindex @code{--tui} -@@ -14308,6 +14318,7 @@ program. To debug a core dump of a previous run, you must also tell - @menu - * Files:: Commands to specify files - * Separate Debug Files:: Debugging information in separate files -+* Index Files:: Index files speed up GDB - * Symbol Errors:: Errors reading symbol files - * Data Files:: GDB data files - @end menu -@@ -15197,6 +15208,46 @@ gnu_debuglink_crc32 (unsigned long crc, - This computation does not apply to the ``build ID'' method. - - -+@node Index Files -+@section Index Files Speed Up @value{GDBN} -+@cindex index files -+@cindex @samp{.gdb_index} section -+ -+When @value{GDBN} finds a symbol file, it scans the symbols in the -+file in order to construct an internal symbol table. This lets most -+@value{GDBN} operations work quickly---at the cost of a delay early -+on. For large programs, this delay can be quite lengthy, so -+@value{GDBN} provides a way to build an index, which speeds up -+startup. -+ -+The index is stored as a section in the symbol file. @value{GDBN} can -+write the index to a file, then you can put it into the symbol file -+using @command{objcopy}. -+ -+To create an index file, use the @code{save gdb-index} command: -+ -+@table @code -+@item save gdb-index @var{directory} -+@kindex save gdb-index -+Create an index file for each symbol file currently known by -+@value{GDBN}. Each file is named after its corresponding symbol file, -+with @samp{.gdb-index} appended, and is written into the given -+@var{directory}. -+@end table -+ -+Once you have created an index file you can merge it into your symbol -+file, here named @file{symfile}, using @command{objcopy}: -+ -+@smallexample -+$ objcopy --add-section .gdb_index=symfile.gdb-index \ -+ --set-section-flags .gdb_index=readonly symfile symfile -+@end smallexample -+ -+There are currently some limitation on indices. They only work when -+for DWARF debugging information, not stabs. And, they do not -+currently work for programs using Ada. -+ -+ - @node Symbol Errors - @section Errors Reading Symbol Files - -@@ -20349,8 +20400,6 @@ containing @code{end}. For example: +@@ -20652,8 +20662,6 @@ containing @code{end}. For example: @smallexample (@value{GDBP}) python @@ -1611,7 +1150,7 @@ index 65d4899..96767b0 100644 >print 23 >end 23 -@@ -20363,6 +20412,14 @@ in a Python script. This can be controlled using @code{maint set +@@ -20666,6 +20674,14 @@ in a Python script. This can be controlled using @code{maint set python print-stack}: if @code{on}, the default, then Python stack printing is enabled; if @code{off}, then Python stack printing is disabled. @@ -1626,7 +1165,7 @@ index 65d4899..96767b0 100644 @end table It is also possible to execute a Python script from the @value{GDBN} -@@ -20384,6 +20441,14 @@ and thus is always available. +@@ -20687,6 +20703,14 @@ and thus is always available. @cindex python api @cindex programming in python @@ -1641,63 +1180,11 @@ index 65d4899..96767b0 100644 @cindex python stdout @cindex python pagination At startup, @value{GDBN} overrides Python's @code{sys.stdout} and -@@ -20395,7 +20460,7 @@ situation, a Python @code{KeyboardInterrupt} exception is thrown. - @menu - * Basic Python:: Basic Python Functions. - * Exception Handling:: --* Values From Inferior:: -+* Values From Inferior:: Python representation of values. - * Types In Python:: Python representation of types. - * Pretty Printing API:: Pretty-printing values. - * Selecting Pretty-Printers:: How GDB chooses a pretty-printer. -@@ -20456,6 +20521,12 @@ Return a sequence holding all of @value{GDBN}'s breakpoints. - @xref{Breakpoints In Python}, for more information. - @end defun - -+@findex gdb.breakpoints -+@defun breakpoints -+Return a sequence holding all of @value{GDBN}'s breakpoints. -+@xref{Breakpoints In Python}, for more information. -+@end defun -+ - @findex gdb.parameter - @defun parameter parameter - Return the value of a @value{GDBN} parameter. @var{parameter} is a -@@ -20472,6 +20543,7 @@ a Python value of the appropriate type, and returned. - @defun history number - Return a value from @value{GDBN}'s value history (@pxref{Value - History}). @var{number} indicates which history element to return. -+ - If @var{number} is negative, then @value{GDBN} will take its absolute value - and count backward from the last element (i.e., the most recent element) to - find the value to return. If @var{number} is zero, then @value{GDBN} will -@@ -20496,6 +20568,21 @@ compute values, for example, it is the only way to get the value of a - convenience variable (@pxref{Convenience Vars}) as a @code{gdb.Value}. - @end defun - -+@findex gdb.post_event -+@defun post_event event -+Put @var{event}, a callable object taking no arguments, into -+@value{GDBN}'s internal event queue. This callable will be invoked at -+some later point, during @value{GDBN}'s event processing. Events -+posted using @code{post_event} will be run in the order in which they -+were posted; however, there is no way to know when they will be -+processed relative to other events inside @value{GDBN}. -+ -+@value{GDBN} is not thread-safe. If your Python program uses multiple -+threads, you must be careful to only call @value{GDBN}-specific -+functions in the main @value{GDBN} thread. @code{post_event} ensures -+this. -+@end defun -+ - @findex gdb.write - @defun write string - Print a string to @value{GDBN}'s paginated standard output stream. diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo -index 54187dd..320b501 100644 +index a494707..d5b9cf8 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo -@@ -2102,6 +2102,18 @@ time, and so we attempt to handle symbols incrementally. For instance, +@@ -2104,6 +2104,18 @@ time, and so we attempt to handle symbols incrementally. For instance, we create @dfn{partial symbol tables} consisting of only selected symbols, and only expand them to full symbol tables when necessary. @@ -1716,7 +1203,7 @@ index 54187dd..320b501 100644 @section Symbol Reading @cindex symbol reading -@@ -2194,6 +2206,7 @@ symtab. Upon return, @code{pst->readin} should have been set to 1, and +@@ -2196,6 +2208,7 @@ symtab. Upon return, @code{pst->readin} should have been set to 1, and zero if there were no symbols in that part of the symbol file. @end table @@ -1724,7 +1211,7 @@ index 54187dd..320b501 100644 @section Partial Symbol Tables @value{GDBN} has three types of symbol tables: -@@ -2295,6 +2308,7 @@ and partial symbol tables behind a set of function pointers known as +@@ -2297,6 +2310,7 @@ and partial symbol tables behind a set of function pointers known as the @dfn{quick symbol functions}. These are documented in @file{symfile.h}. @@ -1732,7 +1219,7 @@ index 54187dd..320b501 100644 @section Types @unnumberedsubsec Fundamental Types (e.g., @code{FT_VOID}, @code{FT_BOOLEAN}). -@@ -2317,6 +2331,7 @@ types map to one @code{TYPE_CODE_*} type, and are distinguished by +@@ -2319,6 +2333,7 @@ types map to one @code{TYPE_CODE_*} type, and are distinguished by other members of the type struct, such as whether the type is signed or unsigned, and how many bits it uses. @@ -1740,7 +1227,7 @@ index 54187dd..320b501 100644 @unnumberedsubsec Builtin Types (e.g., @code{builtin_type_void}, @code{builtin_type_char}). These are instances of type structs that roughly correspond to -@@ -2331,6 +2346,7 @@ only one instance exists, while @file{c-lang.c} builds as many +@@ -2333,6 +2348,7 @@ only one instance exists, while @file{c-lang.c} builds as many @code{TYPE_CODE_INT} types as needed, with each one associated with some particular objfile. @@ -1748,7 +1235,7 @@ index 54187dd..320b501 100644 @section Object File Formats @cindex object file formats -@@ -2416,6 +2432,7 @@ SOM, which is a cross-language ABI). +@@ -2418,6 +2434,7 @@ SOM, which is a cross-language ABI). The SOM reader is in @file{somread.c}. @@ -1756,7 +1243,7 @@ index 54187dd..320b501 100644 @section Debugging File Formats This section describes characteristics of debugging information that -@@ -2487,6 +2504,7 @@ DWARF 3 is an improved version of DWARF 2. +@@ -2489,6 +2506,7 @@ DWARF 3 is an improved version of DWARF 2. @cindex SOM debugging info Like COFF, the SOM definition includes debugging information. @@ -1764,7 +1251,7 @@ index 54187dd..320b501 100644 @section Adding a New Symbol Reader to @value{GDBN} @cindex adding debugging info reader -@@ -2509,6 +2527,7 @@ will only ever be implemented by one object file format may be called +@@ -2511,6 +2529,7 @@ will only ever be implemented by one object file format may be called directly. This interface should be described in a file @file{bfd/lib@var{xyz}.h}, which is included by @value{GDBN}. @@ -1772,7 +1259,7 @@ index 54187dd..320b501 100644 @section Memory Management for Symbol Files Most memory associated with a loaded symbol file is stored on -@@ -2520,10 +2539,45 @@ released when the objfile is unloaded or reloaded. Therefore one +@@ -2522,10 +2541,45 @@ released when the objfile is unloaded or reloaded. Therefore one objfile must not reference symbol or type data from another objfile; they could be unloaded at different times. @@ -1823,7 +1310,7 @@ index 54187dd..320b501 100644 @node Language Support diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi -index e19b8ed..343e160 100644 +index d16c865..d8d24d9 100644 --- a/gdb/doc/observer.texi +++ b/gdb/doc/observer.texi @@ -223,6 +223,11 @@ Bytes from @var{data} to @var{data} + @var{len} have been written @@ -1839,10 +1326,10 @@ index e19b8ed..343e160 100644 This observer is used for internal testing. Do not use. See testsuite/gdb.gdb/observer.exp. diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c -index b9ae108..2555908 100644 +index afe6dde..d364b14 100644 --- a/gdb/dwarf2expr.c +++ b/gdb/dwarf2expr.c -@@ -875,6 +875,13 @@ execute_stack_op (struct dwarf_expr_context *ctx, +@@ -905,6 +905,13 @@ execute_stack_op (struct dwarf_expr_context *ctx, ctx->dwarf_call (ctx, result); goto no_push; @@ -1857,10 +1344,10 @@ index b9ae108..2555908 100644 error (_("Unhandled dwarf expression opcode 0x%x"), op); } diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h -index 61b8f00..d94c03c 100644 +index 3858dc8..a172585 100644 --- a/gdb/dwarf2expr.h +++ b/gdb/dwarf2expr.h -@@ -108,9 +108,15 @@ struct dwarf_expr_context +@@ -114,9 +114,15 @@ struct dwarf_expr_context #if 0 /* Not yet implemented. */ @@ -1878,23 +1365,10 @@ index 61b8f00..d94c03c 100644 /* The current depth of dwarf expression recursion, via DW_OP_call*, DW_OP_fbreg, DW_OP_push_object_address, etc., and the maximum diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c -index f59bc40..7ff0ef9 100644 +index d9580c6..559e0b5 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c -@@ -48,6 +48,12 @@ static void - dwarf_expr_frame_base_1 (struct symbol *framefunc, CORE_ADDR pc, - const gdb_byte **start, size_t *length); - -+static struct value *dwarf2_evaluate_loc_desc (struct type *type, -+ struct frame_info *frame, -+ const gdb_byte *data, -+ unsigned short size, -+ struct dwarf2_per_cu_data *per_cu); -+ - /* A helper function for dealing with location lists. Given a - symbol baton (BATON) and a pc value (PC), find the appropriate - location expression, set *LOCEXPR_LENGTH, and return a pointer -@@ -127,6 +133,9 @@ struct dwarf_expr_baton +@@ -134,6 +134,9 @@ struct dwarf_expr_baton { struct frame_info *frame; struct dwarf2_per_cu_data *per_cu; @@ -1904,9 +1378,9 @@ index f59bc40..7ff0ef9 100644 }; /* Helper functions for dwarf2_evaluate_loc_desc. */ -@@ -195,23 +204,33 @@ dwarf_expr_frame_base_1 (struct symbol *framefunc, CORE_ADDR pc, +@@ -202,23 +205,33 @@ dwarf_expr_frame_base_1 (struct symbol *framefunc, CORE_ADDR pc, symbaton = SYMBOL_LOCATION_BATON (framefunc); - *start = find_location_expression (symbaton, length, pc); + *start = dwarf2_find_location_expression (symbaton, length, pc); } - else + else if (SYMBOL_COMPUTED_OPS (framefunc) == &dwarf2_locexpr_funcs) @@ -1947,8 +1421,8 @@ index f59bc40..7ff0ef9 100644 } /* Helper function for dwarf2_evaluate_loc_desc. Computes the CFA for -@@ -263,6 +282,158 @@ dwarf_expr_dwarf_call (struct dwarf_expr_context *ctx, size_t die_offset) - return per_cu_dwarf_call (ctx, die_offset, debaton->per_cu); +@@ -286,6 +299,159 @@ dwarf_expr_dwarf_call (struct dwarf_expr_context *ctx, size_t die_offset) + ctx->get_frame_pc, ctx->baton); } +static CORE_ADDR @@ -2029,6 +1503,7 @@ index f59bc40..7ff0ef9 100644 + ctx->read_mem = dwarf_expr_read_mem; + ctx->get_frame_base = dwarf_expr_frame_base; + ctx->get_frame_cfa = dwarf_expr_frame_cfa; ++ ctx->get_frame_pc = dwarf_expr_frame_pc; + ctx->get_tls_address = dwarf_expr_tls_address; + ctx->dwarf_call = dwarf_expr_dwarf_call; + ctx->get_object_address = dwarf_expr_object_address; @@ -2090,8 +1565,8 @@ index f59bc40..7ff0ef9 100644 + if (!dllbaton) + return 0; + -+ data = find_location_expression (dllbaton, &size, -+ get_frame_address_in_block (frame)); ++ data = dwarf2_find_location_expression (dllbaton, &size, ++ get_frame_address_in_block (frame)); + if (data == NULL) + return 0; + @@ -2106,29 +1581,29 @@ index f59bc40..7ff0ef9 100644 struct piece_closure { /* Reference count. */ -@@ -887,10 +1058,8 @@ dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame, - struct dwarf2_per_cu_data *per_cu) +@@ -1045,10 +1211,8 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, + LONGEST byte_offset) { struct value *retval; - struct dwarf_expr_baton baton; struct dwarf_expr_context *ctx; -- struct cleanup *old_chain; + struct cleanup *old_chain; - struct objfile *objfile = dwarf2_per_cu_objfile (per_cu); -+ struct cleanup *old_chain = make_cleanup (null_cleanup, 0); - if (size == 0) - { -@@ -900,24 +1069,8 @@ dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame, + if (byte_offset < 0) + invalid_synthetic_pointer (); +@@ -1061,25 +1225,10 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, return retval; } - baton.frame = frame; - baton.per_cu = per_cu; -+ ctx = dwarf_expr_prep_ctx (frame, data, size, per_cu); ++ old_chain = make_cleanup (null_cleanup, 0); - ctx = new_dwarf_expr_context (); - old_chain = make_cleanup_free_dwarf_expr_context (ctx); -- ++ ctx = dwarf_expr_prep_ctx (frame, data, size, per_cu); + - ctx->gdbarch = get_objfile_arch (objfile); - ctx->addr_size = dwarf2_per_cu_addr_size (per_cu); - ctx->offset = dwarf2_per_cu_text_offset (per_cu); @@ -2137,6 +1612,7 @@ index f59bc40..7ff0ef9 100644 - ctx->read_mem = dwarf_expr_read_mem; - ctx->get_frame_base = dwarf_expr_frame_base; - ctx->get_frame_cfa = dwarf_expr_frame_cfa; +- ctx->get_frame_pc = dwarf_expr_frame_pc; - ctx->get_tls_address = dwarf_expr_tls_address; - ctx->dwarf_call = dwarf_expr_dwarf_call; - @@ -2144,19 +1620,23 @@ index f59bc40..7ff0ef9 100644 if (ctx->num_pieces > 0) { struct piece_closure *c; -@@ -951,6 +1104,11 @@ dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame, +@@ -1123,6 +1272,15 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, CORE_ADDR address = dwarf_expr_fetch_address (ctx, 0); int in_stack_memory = dwarf_expr_fetch_in_stack_memory (ctx, 0); ++ /* Frame may be needed for check_typedef of TYPE_DYNAMIC. */ ++ make_cleanup_restore_selected_frame (); ++ select_frame (frame); ++ + /* object_address_set called here is required in ALLOCATE_VALUE's + CHECK_TYPEDEF for the object's possible + DW_OP_push_object_address. */ + object_address_set (address); + - retval = allocate_value (type); + retval = allocate_value_lazy (type); VALUE_LVAL (retval) = lval_memory; - set_value_lazy (retval, 1); -@@ -2590,11 +2748,51 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, + if (in_stack_memory) +@@ -2821,11 +2979,51 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, dlbaton->per_cu); } @@ -2211,10 +1691,10 @@ index f59bc40..7ff0ef9 100644 + missing_tracepoint_var_ref +}; diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h -index 826bc45..1e7d8dc 100644 +index ee52506..6a77c3f 100644 --- a/gdb/dwarf2loc.h +++ b/gdb/dwarf2loc.h -@@ -86,5 +86,14 @@ struct dwarf2_loclist_baton +@@ -105,5 +105,14 @@ struct dwarf2_loclist_baton extern const struct symbol_computed_ops dwarf2_locexpr_funcs; extern const struct symbol_computed_ops dwarf2_loclist_funcs; @@ -2230,144 +1710,12 @@ index 826bc45..1e7d8dc 100644 #endif /* dwarf2loc.h */ diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 1e75235..d54e266 100644 +index f269dee..284a22f 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c -@@ -51,6 +51,9 @@ - #include "typeprint.h" - #include "jv-lang.h" - #include "psympriv.h" -+#include "exceptions.h" -+#include "gdb_stat.h" -+#include "completer.h" - - #include - #include "gdb_string.h" -@@ -129,6 +132,33 @@ struct dwarf2_section_info - int readin; - }; - -+/* All offsets in the index are of this type. It must be -+ architecture-independent. */ -+typedef uint32_t offset_type; -+ -+DEF_VEC_I (offset_type); -+ -+/* A description of the mapped index. The file format is described in -+ a comment by the code that writes the index. */ -+struct mapped_index -+{ -+ /* The total length of the buffer. */ -+ off_t total_size; -+ /* A pointer to the address table data. */ -+ const gdb_byte *address_table; -+ /* Size of the address table data in bytes. */ -+ offset_type address_table_size; -+ /* The hash table. */ -+ const offset_type *index_table; -+ /* Size in slots, each slot is 2 offset_types. */ -+ offset_type index_table_slots; -+ /* A pointer to the constant pool. */ -+ const char *constant_pool; -+}; -+ -+typedef struct dwarf2_per_cu_data *dwarf2_per_cu_data_ptr; -+DEF_VEC_P (dwarf2_per_cu_data_ptr); -+ - struct dwarf2_per_objfile - { - struct dwarf2_section_info info; -@@ -141,6 +171,7 @@ struct dwarf2_per_objfile - struct dwarf2_section_info types; - struct dwarf2_section_info frame; - struct dwarf2_section_info eh_frame; -+ struct dwarf2_section_info gdb_index; - - /* Back link. */ - struct objfile *objfile; -@@ -163,6 +194,12 @@ struct dwarf2_per_objfile - /* A flag indicating wether this objfile has a section loaded at a - VMA of 0. */ - int has_section_at_zero; -+ -+ /* True if we are using the mapped index. */ -+ unsigned char using_index; -+ -+ /* The mapped index. */ -+ struct mapped_index *index_table; - }; - - static struct dwarf2_per_objfile *dwarf2_per_objfile; -@@ -182,6 +219,7 @@ static struct dwarf2_per_objfile *dwarf2_per_objfile; - #define TYPES_SECTION "debug_types" - #define FRAME_SECTION "debug_frame" - #define EH_FRAME_SECTION "eh_frame" -+#define GDB_INDEX_SECTION "gdb_index" - - /* local data types */ - -@@ -307,6 +345,32 @@ struct dwarf2_cu - unsigned int has_namespace_info : 1; - }; - -+/* When using the index (and thus not using psymtabs), each CU has an -+ object of this type. This is used to hold information needed by -+ the various "quick" methods. */ -+struct dwarf2_per_cu_quick_data -+{ -+ /* The line table. This can be NULL if there was no line table. */ -+ struct line_header *lines; -+ -+ /* The file names from the line table. */ -+ const char **file_names; -+ /* The file names from the line table after being run through -+ gdb_realpath. */ -+ const char **full_names; -+ -+ /* The corresponding symbol table. This is NULL if symbols for this -+ CU have not yet been read. */ -+ struct symtab *symtab; -+ -+ /* A temporary mark bit used when iterating over all CUs in -+ expand_symtabs_matching. */ -+ unsigned int mark : 1; -+ -+ /* True if we've tried to read the line table. */ -+ unsigned int read_lines : 1; -+}; -+ - /* Persistent data held for a compilation unit, even when not - processing it. We put a pointer to this structure in the - read_symtab_private field of the psymtab. If we encounter -@@ -347,10 +411,21 @@ struct dwarf2_per_cu_data - it. */ - htab_t type_hash; - -- /* The partial symbol table associated with this compilation unit, -- or NULL for partial units (which do not have an associated -- symtab). */ -- struct partial_symtab *psymtab; -+ /* The corresponding objfile. */ -+ struct objfile *objfile; -+ -+ /* When using partial symbol tables, the 'psymtab' field is active. -+ Otherwise the 'quick' field is active. */ -+ union -+ { -+ /* The partial symbol table associated with this compilation unit, -+ or NULL for partial units (which do not have an associated -+ symtab). */ -+ struct partial_symtab *psymtab; -+ -+ /* Data needed by the "quick" functions. */ -+ struct dwarf2_per_cu_quick_data *quick; -+ } v; - }; - - /* Entry in the signatured_types hash table. */ -@@ -1083,6 +1158,9 @@ static int attr_form_is_section_offset (struct attribute *); - - static int attr_form_is_constant (struct attribute *); +@@ -1211,6 +1211,9 @@ static void fill_in_loclist_baton (struct dwarf2_cu *cu, + struct dwarf2_loclist_baton *baton, + struct attribute *attr); +static struct dwarf2_loclist_baton *dwarf2_attr_to_loclist_baton + (struct attribute *attr, struct dwarf2_cu *cu); @@ -2375,7 +1723,7 @@ index 1e75235..d54e266 100644 static void dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, struct dwarf2_cu *cu); -@@ -1113,6 +1191,9 @@ static void age_cached_comp_units (void); +@@ -1245,6 +1248,9 @@ static void age_cached_comp_units (void); static void free_one_cached_comp_unit (void *); @@ -2385,1269 +1733,17 @@ index 1e75235..d54e266 100644 static struct type *set_die_type (struct die_info *, struct type *, struct dwarf2_cu *); -@@ -1132,6 +1213,56 @@ static void dwarf2_clear_marks (struct dwarf2_per_cu_data *); +@@ -1269,6 +1275,9 @@ static struct type *get_die_type_at_offset (unsigned int, static struct type *get_die_type (struct die_info *die, struct dwarf2_cu *cu); +static struct dwarf2_locexpr_baton *dwarf2_attr_to_locexpr_baton + (struct attribute *attr, struct dwarf2_cu *cu); + -+static void dwarf2_release_queue (void *dummy); -+ -+static void queue_comp_unit (struct dwarf2_per_cu_data *per_cu, -+ struct objfile *objfile); -+ -+static void process_queue (struct objfile *objfile); -+ -+static void find_file_and_directory (struct die_info *die, -+ struct dwarf2_cu *cu, -+ char **name, char **comp_dir); -+ -+static char *file_full_name (int file, struct line_header *lh, -+ const char *comp_dir); -+ -+static gdb_byte *partial_read_comp_unit_head (struct comp_unit_head *header, -+ gdb_byte *info_ptr, -+ gdb_byte *buffer, -+ unsigned int buffer_size, -+ bfd *abfd); -+ -+static void init_cu_die_reader (struct die_reader_specs *reader, -+ struct dwarf2_cu *cu); -+ -+#if WORDS_BIGENDIAN -+ -+/* Convert VALUE between big- and little-endian. */ -+static offset_type -+byte_swap (offset_type value) -+{ -+ offset_type result; -+ -+ result = (value & 0xff) << 24; -+ result |= (value & 0xff00) << 8; -+ result |= (value & 0xff0000) >> 8; -+ result |= (value & 0xff000000) >> 24; -+ return result; -+} -+ -+#define MAYBE_SWAP(V) byte_swap (V) -+ -+#else -+#define MAYBE_SWAP(V) (V) -+#endif /* WORDS_BIGENDIAN */ -+ -+/* The suffix for an index file. */ -+#define INDEX_SUFFIX ".gdb-index" -+ - /* Try to locate the sections we need for DWARF 2 debugging - information and return true if we have enough to do something. */ + static void dwarf2_release_queue (void *dummy); -@@ -1230,6 +1361,11 @@ dwarf2_locate_sections (bfd *abfd, asection *sectp, void *ignore_ptr) - dwarf2_per_objfile->types.asection = sectp; - dwarf2_per_objfile->types.size = bfd_get_section_size (sectp); - } -+ else if (section_is_p (sectp->name, GDB_INDEX_SECTION)) -+ { -+ dwarf2_per_objfile->gdb_index.asection = sectp; -+ dwarf2_per_objfile->gdb_index.size = bfd_get_section_size (sectp); -+ } - - if ((bfd_get_section_flags (abfd, sectp) & SEC_LOAD) - && bfd_section_vma (abfd, sectp) == 0) -@@ -1353,87 +1489,940 @@ dwarf2_read_section (struct objfile *objfile, struct dwarf2_section_info *info) - if (pagesize == 0) - pagesize = getpagesize (); - -- /* Only try to mmap sections which are large enough: we don't want to -- waste space due to fragmentation. Also, only try mmap for sections -- without relocations. */ -+ /* Only try to mmap sections which are large enough: we don't want to -+ waste space due to fragmentation. Also, only try mmap for sections -+ without relocations. */ -+ -+ if (info->size > 4 * pagesize && (sectp->flags & SEC_RELOC) == 0) -+ { -+ off_t pg_offset = sectp->filepos & ~(pagesize - 1); -+ size_t map_length = info->size + sectp->filepos - pg_offset; -+ caddr_t retbuf = bfd_mmap (abfd, 0, map_length, PROT_READ, -+ MAP_PRIVATE, pg_offset); -+ -+ if (retbuf != MAP_FAILED) -+ { -+ info->was_mmapped = 1; -+ info->buffer = retbuf + (sectp->filepos & (pagesize - 1)) ; -+#if HAVE_POSIX_MADVISE -+ posix_madvise (retbuf, map_length, POSIX_MADV_WILLNEED); -+#endif -+ return; -+ } -+ } -+#endif -+ -+ /* If we get here, we are a normal, not-compressed section. */ -+ info->buffer = buf -+ = obstack_alloc (&objfile->objfile_obstack, info->size); -+ -+ /* When debugging .o files, we may need to apply relocations; see -+ http://sourceware.org/ml/gdb-patches/2002-04/msg00136.html . -+ We never compress sections in .o files, so we only need to -+ try this when the section is not compressed. */ -+ retbuf = symfile_relocate_debug_section (objfile, sectp, buf); -+ if (retbuf != NULL) -+ { -+ info->buffer = retbuf; -+ return; -+ } -+ -+ if (bfd_seek (abfd, sectp->filepos, SEEK_SET) != 0 -+ || bfd_bread (buf, info->size, abfd) != info->size) -+ error (_("Dwarf Error: Can't read DWARF data from '%s'"), -+ bfd_get_filename (abfd)); -+} -+ -+/* Fill in SECTP, BUFP and SIZEP with section info, given OBJFILE and -+ SECTION_NAME. */ -+ -+void -+dwarf2_get_section_info (struct objfile *objfile, const char *section_name, -+ asection **sectp, gdb_byte **bufp, -+ bfd_size_type *sizep) -+{ -+ struct dwarf2_per_objfile *data -+ = objfile_data (objfile, dwarf2_objfile_data_key); -+ struct dwarf2_section_info *info; -+ -+ /* We may see an objfile without any DWARF, in which case we just -+ return nothing. */ -+ if (data == NULL) -+ { -+ *sectp = NULL; -+ *bufp = NULL; -+ *sizep = 0; -+ return; -+ } -+ if (section_is_p (section_name, EH_FRAME_SECTION)) -+ info = &data->eh_frame; -+ else if (section_is_p (section_name, FRAME_SECTION)) -+ info = &data->frame; -+ else -+ gdb_assert (0); -+ -+ if (info->asection != NULL && info->size != 0 && info->buffer == NULL) -+ /* We haven't read this section in yet. Do it now. */ -+ dwarf2_read_section (objfile, info); -+ -+ *sectp = info->asection; -+ *bufp = info->buffer; -+ *sizep = info->size; -+} -+ -+ -+ -+/* Read in the symbols for PER_CU. OBJFILE is the objfile from which -+ this CU came. */ -+static void -+dw2_do_instantiate_symtab (struct objfile *objfile, -+ struct dwarf2_per_cu_data *per_cu) -+{ -+ struct cleanup *back_to; -+ -+ back_to = make_cleanup (dwarf2_release_queue, NULL); -+ -+ queue_comp_unit (per_cu, objfile); -+ -+ if (per_cu->from_debug_types) -+ read_signatured_type_at_offset (objfile, per_cu->offset); -+ else -+ load_full_comp_unit (per_cu, objfile); -+ -+ process_queue (objfile); -+ -+ /* Age the cache, releasing compilation units that have not -+ been used recently. */ -+ age_cached_comp_units (); -+ -+ do_cleanups (back_to); -+} -+ -+/* Ensure that the symbols for PER_CU have been read in. OBJFILE is -+ the objfile from which this CU came. Returns the resulting symbol -+ table. */ -+static struct symtab * -+dw2_instantiate_symtab (struct objfile *objfile, -+ struct dwarf2_per_cu_data *per_cu) -+{ -+ if (!per_cu->v.quick->symtab) -+ { -+ struct cleanup *back_to = make_cleanup (free_cached_comp_units, NULL); -+ increment_reading_symtab (); -+ dw2_do_instantiate_symtab (objfile, per_cu); -+ do_cleanups (back_to); -+ } -+ return per_cu->v.quick->symtab; -+} -+ -+/* A helper function that knows how to read a 64-bit value in a way -+ that doesn't make gdb die. Returns 1 if the conversion went ok, 0 -+ otherwise. */ -+static int -+extract_cu_value (const char *bytes, ULONGEST *result) -+{ -+ if (sizeof (ULONGEST) < 8) -+ { -+ int i; -+ -+ /* Ignore the upper 4 bytes if they are all zero. */ -+ for (i = 0; i < 4; ++i) -+ if (bytes[i + 4] != 0) -+ return 0; -+ -+ *result = extract_unsigned_integer (bytes, 4, BFD_ENDIAN_LITTLE); -+ } -+ else -+ *result = extract_unsigned_integer (bytes, 8, BFD_ENDIAN_LITTLE); -+ return 1; -+} -+ -+/* Read the CU list from the mapped index, and use it to create all -+ the CU objects for this objfile. Return 0 if something went wrong, -+ 1 if everything went ok. */ -+static int -+create_cus_from_index (struct objfile *objfile, struct mapped_index *index, -+ const gdb_byte *cu_list, offset_type cu_list_elements) -+{ -+ offset_type i; -+ const char *entry; -+ -+ dwarf2_per_objfile->n_comp_units = cu_list_elements / 2; -+ dwarf2_per_objfile->all_comp_units -+ = obstack_alloc (&objfile->objfile_obstack, -+ dwarf2_per_objfile->n_comp_units -+ * sizeof (struct dwarf2_per_cu_data *)); -+ -+ for (i = 0; i < cu_list_elements; i += 2) -+ { -+ struct dwarf2_per_cu_data *the_cu; -+ ULONGEST offset, length; -+ -+ if (!extract_cu_value (cu_list, &offset) -+ || !extract_cu_value (cu_list + 8, &length)) -+ return 0; -+ cu_list += 2 * 8; -+ -+ the_cu = OBSTACK_ZALLOC (&objfile->objfile_obstack, -+ struct dwarf2_per_cu_data); -+ the_cu->offset = offset; -+ the_cu->length = length; -+ the_cu->objfile = objfile; -+ the_cu->v.quick = OBSTACK_ZALLOC (&objfile->objfile_obstack, -+ struct dwarf2_per_cu_quick_data); -+ dwarf2_per_objfile->all_comp_units[i / 2] = the_cu; -+ } -+ -+ return 1; -+} -+ -+/* Read the address map data from the mapped index, and use it to -+ populate the objfile's psymtabs_addrmap. */ -+static void -+create_addrmap_from_index (struct objfile *objfile, struct mapped_index *index) -+{ -+ const gdb_byte *iter, *end; -+ struct obstack temp_obstack; -+ struct addrmap *mutable_map; -+ struct cleanup *cleanup; -+ CORE_ADDR baseaddr; -+ -+ obstack_init (&temp_obstack); -+ cleanup = make_cleanup_obstack_free (&temp_obstack); -+ mutable_map = addrmap_create_mutable (&temp_obstack); -+ -+ iter = index->address_table; -+ end = iter + index->address_table_size; -+ -+ baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); -+ -+ while (iter < end) -+ { -+ ULONGEST hi, lo, cu_index; -+ lo = extract_unsigned_integer (iter, 8, BFD_ENDIAN_LITTLE); -+ iter += 8; -+ hi = extract_unsigned_integer (iter, 8, BFD_ENDIAN_LITTLE); -+ iter += 8; -+ cu_index = extract_unsigned_integer (iter, 4, BFD_ENDIAN_LITTLE); -+ iter += 4; -+ -+ addrmap_set_empty (mutable_map, lo + baseaddr, hi + baseaddr - 1, -+ dwarf2_per_objfile->all_comp_units[cu_index]); -+ } -+ -+ objfile->psymtabs_addrmap = addrmap_create_fixed (mutable_map, -+ &objfile->objfile_obstack); -+ do_cleanups (cleanup); -+} -+ -+/* The hash function for strings in the mapped index. This is the -+ same as the hashtab.c hash function, but we keep a separate copy to -+ maintain control over the implementation. This is necessary -+ because the hash function is tied to the format of the mapped index -+ file. */ -+static hashval_t -+mapped_index_string_hash (const void *p) -+{ -+ const unsigned char *str = (const unsigned char *) p; -+ hashval_t r = 0; -+ unsigned char c; -+ -+ while ((c = *str++) != 0) -+ r = r * 67 + c - 113; -+ -+ return r; -+} -+ -+/* Find a slot in the mapped index INDEX for the object named NAME. -+ If NAME is found, set *VEC_OUT to point to the CU vector in the -+ constant pool and return 1. If NAME cannot be found, return 0. */ -+static int -+find_slot_in_mapped_hash (struct mapped_index *index, const char *name, -+ offset_type **vec_out) -+{ -+ offset_type hash = mapped_index_string_hash (name); -+ offset_type slot, step; -+ -+ slot = hash & (index->index_table_slots - 1); -+ step = ((hash * 17) & (index->index_table_slots - 1)) | 1; -+ -+ for (;;) -+ { -+ /* Convert a slot number to an offset into the table. */ -+ offset_type i = 2 * slot; -+ const char *str; -+ if (index->index_table[i] == 0 && index->index_table[i + 1] == 0) -+ return 0; -+ -+ str = index->constant_pool + MAYBE_SWAP (index->index_table[i]); -+ if (!strcmp (name, str)) -+ { -+ *vec_out = (offset_type *) (index->constant_pool -+ + MAYBE_SWAP (index->index_table[i + 1])); -+ return 1; -+ } -+ -+ slot = (slot + step) & (index->index_table_slots - 1); -+ } -+} -+ -+/* Read the index file. If everything went ok, initialize the "quick" -+ elements of all the CUs and return 1. Otherwise, return 0. */ -+static int -+dwarf2_read_index (struct objfile *objfile) -+{ -+ char *addr; -+ struct mapped_index *map; -+ offset_type *metadata; -+ const gdb_byte *cu_list; -+ offset_type cu_list_elements; -+ -+ if (dwarf2_per_objfile->gdb_index.asection == NULL -+ || dwarf2_per_objfile->gdb_index.size == 0) -+ return 0; -+ dwarf2_read_section (objfile, &dwarf2_per_objfile->gdb_index); -+ -+ addr = dwarf2_per_objfile->gdb_index.buffer; -+ /* Version check. */ -+ if (MAYBE_SWAP (*(offset_type *) addr) != 1) -+ return 0; -+ -+ map = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct mapped_index); -+ map->total_size = dwarf2_per_objfile->gdb_index.size; -+ -+ metadata = (offset_type *) (addr + sizeof (offset_type)); -+ cu_list = addr + MAYBE_SWAP (metadata[0]); -+ cu_list_elements = ((MAYBE_SWAP (metadata[1]) - MAYBE_SWAP (metadata[0])) -+ / 8); -+ map->address_table = addr + MAYBE_SWAP (metadata[1]); -+ map->address_table_size = (MAYBE_SWAP (metadata[2]) -+ - MAYBE_SWAP (metadata[1])); -+ map->index_table = (offset_type *) (addr + MAYBE_SWAP (metadata[2])); -+ map->index_table_slots = ((MAYBE_SWAP (metadata[3]) -+ - MAYBE_SWAP (metadata[2])) -+ / (2 * sizeof (offset_type))); -+ map->constant_pool = addr + MAYBE_SWAP (metadata[3]); -+ -+ if (!create_cus_from_index (objfile, map, cu_list, cu_list_elements)) -+ return 0; -+ -+ create_addrmap_from_index (objfile, map); -+ -+ dwarf2_per_objfile->index_table = map; -+ dwarf2_per_objfile->using_index = 1; -+ -+ return 1; -+} -+ -+/* A helper for the "quick" functions which sets the global -+ dwarf2_per_objfile according to OBJFILE. */ -+static void -+dw2_setup (struct objfile *objfile) -+{ -+ dwarf2_per_objfile = objfile_data (objfile, dwarf2_objfile_data_key); -+ gdb_assert (dwarf2_per_objfile); -+} -+ -+/* A helper for the "quick" functions which attempts to read the line -+ table for THIS_CU. */ -+static void -+dw2_require_line_header (struct objfile *objfile, -+ struct dwarf2_per_cu_data *this_cu) -+{ -+ bfd *abfd = objfile->obfd; -+ struct line_header *lh = NULL; -+ struct attribute *attr; -+ struct cleanup *cleanups; -+ struct die_info *comp_unit_die; -+ gdb_byte *beg_of_comp_unit, *info_ptr, *buffer; -+ int has_children, i; -+ struct dwarf2_cu cu; -+ unsigned int bytes_read, buffer_size; -+ struct die_reader_specs reader_specs; -+ char *name, *comp_dir; -+ -+ if (this_cu->v.quick->read_lines) -+ return; -+ this_cu->v.quick->read_lines = 1; -+ -+ memset (&cu, 0, sizeof (cu)); -+ cu.objfile = objfile; -+ obstack_init (&cu.comp_unit_obstack); -+ -+ cleanups = make_cleanup (free_stack_comp_unit, &cu); -+ -+ dwarf2_read_section (objfile, &dwarf2_per_objfile->info); -+ buffer_size = dwarf2_per_objfile->info.size; -+ buffer = dwarf2_per_objfile->info.buffer; -+ info_ptr = buffer + this_cu->offset; -+ beg_of_comp_unit = info_ptr; -+ -+ info_ptr = partial_read_comp_unit_head (&cu.header, info_ptr, -+ buffer, buffer_size, -+ abfd); -+ -+ /* Complete the cu_header. */ -+ cu.header.offset = beg_of_comp_unit - buffer; -+ cu.header.first_die_offset = info_ptr - beg_of_comp_unit; -+ -+ this_cu->cu = &cu; -+ cu.per_cu = this_cu; -+ -+ dwarf2_read_abbrevs (abfd, &cu); -+ make_cleanup (dwarf2_free_abbrev_table, &cu); -+ -+ if (this_cu->from_debug_types) -+ info_ptr += 8 /*signature*/ + cu.header.offset_size; -+ init_cu_die_reader (&reader_specs, &cu); -+ info_ptr = read_full_die (&reader_specs, &comp_unit_die, info_ptr, -+ &has_children); -+ -+ attr = dwarf2_attr (comp_unit_die, DW_AT_stmt_list, &cu); -+ if (attr) -+ { -+ unsigned int line_offset = DW_UNSND (attr); -+ lh = dwarf_decode_line_header (line_offset, abfd, &cu); -+ } -+ if (lh == NULL) -+ { -+ do_cleanups (cleanups); -+ return; -+ } -+ -+ find_file_and_directory (comp_unit_die, &cu, &name, &comp_dir); -+ -+ this_cu->v.quick->lines = lh; -+ -+ this_cu->v.quick->file_names -+ = obstack_alloc (&objfile->objfile_obstack, -+ lh->num_file_names * sizeof (char *)); -+ for (i = 0; i < lh->num_file_names; ++i) -+ this_cu->v.quick->file_names[i] = file_full_name (i + 1, lh, comp_dir); -+ -+ do_cleanups (cleanups); -+} -+ -+/* A helper for the "quick" functions which computes and caches the -+ real path for a given file name from the line table. -+ dw2_require_line_header must have been called before this is -+ invoked. */ -+static const char * -+dw2_require_full_path (struct objfile *objfile, -+ struct dwarf2_per_cu_data *cu, -+ int index) -+{ -+ if (!cu->v.quick->full_names) -+ cu->v.quick->full_names -+ = OBSTACK_CALLOC (&objfile->objfile_obstack, -+ cu->v.quick->lines->num_file_names, -+ sizeof (char *)); -+ -+ if (!cu->v.quick->full_names[index]) -+ cu->v.quick->full_names[index] -+ = gdb_realpath (cu->v.quick->file_names[index]); -+ -+ return cu->v.quick->full_names[index]; -+} -+ -+static struct symtab * -+dw2_find_last_source_symtab (struct objfile *objfile) -+{ -+ int index; -+ dw2_setup (objfile); -+ index = dwarf2_per_objfile->n_comp_units - 1; -+ return dw2_instantiate_symtab (objfile, -+ dwarf2_per_objfile->all_comp_units[index]); -+} -+ -+static void -+dw2_forget_cached_source_info (struct objfile *objfile) -+{ -+ int i; -+ -+ dw2_setup (objfile); -+ for (i = 0; i < dwarf2_per_objfile->n_comp_units; ++i) -+ { -+ struct dwarf2_per_cu_data *cu = dwarf2_per_objfile->all_comp_units[i]; -+ -+ if (cu->v.quick->full_names) -+ { -+ int j; -+ -+ for (j = 0; j < cu->v.quick->lines->num_file_names; ++j) -+ xfree ((void *) cu->v.quick->full_names[j]); -+ } -+ } -+} -+ -+static int -+dw2_lookup_symtab (struct objfile *objfile, const char *name, -+ const char *full_path, const char *real_path, -+ struct symtab **result) -+{ -+ int i; -+ int check_basename = lbasename (name) == name; -+ struct dwarf2_per_cu_data *base_cu = NULL; -+ -+ dw2_setup (objfile); -+ for (i = 0; i < dwarf2_per_objfile->n_comp_units; ++i) -+ { -+ int j; -+ struct dwarf2_per_cu_data *cu = dwarf2_per_objfile->all_comp_units[i]; -+ -+ if (cu->v.quick->symtab) -+ continue; -+ -+ dw2_require_line_header (objfile, cu); -+ if (!cu->v.quick->lines) -+ continue; -+ -+ for (j = 0; j < cu->v.quick->lines->num_file_names; ++j) -+ { -+ const char *this_name = cu->v.quick->file_names[j]; -+ -+ if (FILENAME_CMP (name, this_name) == 0) -+ { -+ *result = dw2_instantiate_symtab (objfile, cu); -+ return 1; -+ } -+ -+ if (check_basename && ! base_cu -+ && FILENAME_CMP (lbasename (this_name), name) == 0) -+ base_cu = cu; -+ -+ if (full_path != NULL) -+ { -+ const char *this_full_name = dw2_require_full_path (objfile, -+ cu, j); -+ -+ if (this_full_name -+ && FILENAME_CMP (full_path, this_full_name) == 0) -+ { -+ *result = dw2_instantiate_symtab (objfile, cu); -+ return 1; -+ } -+ } -+ -+ if (real_path != NULL) -+ { -+ const char *this_full_name = dw2_require_full_path (objfile, -+ cu, j); -+ -+ if (this_full_name != NULL) -+ { -+ char *rp = gdb_realpath (this_full_name); -+ if (rp != NULL && FILENAME_CMP (real_path, rp) == 0) -+ { -+ xfree (rp); -+ *result = dw2_instantiate_symtab (objfile, cu); -+ return 1; -+ } -+ xfree (rp); -+ } -+ } -+ } -+ } -+ -+ if (base_cu) -+ { -+ *result = dw2_instantiate_symtab (objfile, base_cu); -+ return 1; -+ } -+ -+ return 0; -+} -+ -+static struct symtab * -+dw2_lookup_symbol (struct objfile *objfile, int block_index, -+ const char *name, domain_enum domain) -+{ -+ /* We do all the work in the pre_expand_symtabs_matching hook -+ instead. */ -+ return NULL; -+} -+ -+/* A helper function that expands all symtabs that hold an object -+ named NAME. */ -+static void -+dw2_do_expand_symtabs_matching (struct objfile *objfile, const char *name) -+{ -+ dw2_setup (objfile); -+ -+ if (dwarf2_per_objfile->index_table) -+ { -+ offset_type *vec; -+ -+ if (find_slot_in_mapped_hash (dwarf2_per_objfile->index_table, -+ name, &vec)) -+ { -+ offset_type i, len = MAYBE_SWAP (*vec); -+ for (i = 0; i < len; ++i) -+ { -+ offset_type cu_index = MAYBE_SWAP (vec[i + 1]); -+ struct dwarf2_per_cu_data *cu; -+ cu = dwarf2_per_objfile->all_comp_units[cu_index]; -+ dw2_instantiate_symtab (objfile, cu); -+ } -+ } -+ } -+} -+ -+static void -+dw2_pre_expand_symtabs_matching (struct objfile *objfile, -+ int kind, const char *name, -+ domain_enum domain) -+{ -+ dw2_do_expand_symtabs_matching (objfile, name); -+} -+ -+static void -+dw2_print_stats (struct objfile *objfile) -+{ -+ int i, count; -+ -+ dw2_setup (objfile); -+ count = 0; -+ for (i = 0; i < dwarf2_per_objfile->n_comp_units; ++i) -+ { -+ struct dwarf2_per_cu_data *cu = dwarf2_per_objfile->all_comp_units[i]; -+ -+ if (!cu->v.quick->symtab) -+ ++count; -+ } -+ printf_filtered (_(" Number of unread CUs: %d\n"), count); -+} -+ -+static void -+dw2_dump (struct objfile *objfile) -+{ -+ /* Nothing worth printing. */ -+} -+ -+static void -+dw2_relocate (struct objfile *objfile, struct section_offsets *new_offsets, -+ struct section_offsets *delta) -+{ -+ /* There's nothing to relocate here. */ -+} -+ -+static void -+dw2_expand_symtabs_for_function (struct objfile *objfile, -+ const char *func_name) -+{ -+ dw2_do_expand_symtabs_matching (objfile, func_name); -+} -+ -+static void -+dw2_expand_all_symtabs (struct objfile *objfile) -+{ -+ int i; -+ -+ dw2_setup (objfile); -+ for (i = 0; i < dwarf2_per_objfile->n_comp_units; ++i) -+ { -+ struct dwarf2_per_cu_data *cu = dwarf2_per_objfile->all_comp_units[i]; -+ -+ dw2_instantiate_symtab (objfile, cu); -+ } -+} -+ -+static void -+dw2_expand_symtabs_with_filename (struct objfile *objfile, -+ const char *filename) -+{ -+ int i; -+ -+ dw2_setup (objfile); -+ for (i = 0; i < dwarf2_per_objfile->n_comp_units; ++i) -+ { -+ int j; -+ struct dwarf2_per_cu_data *cu = dwarf2_per_objfile->all_comp_units[i]; -+ -+ if (cu->v.quick->symtab) -+ continue; -+ -+ dw2_require_line_header (objfile, cu); -+ if (!cu->v.quick->lines) -+ continue; -+ -+ for (j = 0; j < cu->v.quick->lines->num_file_names; ++j) -+ { -+ const char *this_name = cu->v.quick->file_names[j]; -+ if (strcmp (this_name, filename) == 0) -+ { -+ dw2_instantiate_symtab (objfile, cu); -+ break; -+ } -+ } -+ } -+} -+ -+static const char * -+dw2_find_symbol_file (struct objfile *objfile, const char *name) -+{ -+ struct dwarf2_per_cu_data *cu; -+ offset_type *vec; -+ -+ dw2_setup (objfile); -+ -+ if (!dwarf2_per_objfile->index_table) -+ return NULL; -+ -+ if (!find_slot_in_mapped_hash (dwarf2_per_objfile->index_table, -+ name, &vec)) -+ return NULL; -+ -+ /* Note that this just looks at the very first one named NAME -- but -+ actually we are looking for a function. find_main_filename -+ should be rewritten so that it doesn't require a custom hook. It -+ could just use the ordinary symbol tables. */ -+ /* vec[0] is the length, which must always be >0. */ -+ cu = dwarf2_per_objfile->all_comp_units[MAYBE_SWAP (vec[1])]; -+ -+ dw2_require_line_header (objfile, cu); -+ if (!cu->v.quick->lines) -+ return NULL; -+ -+ return cu->v.quick->file_names[cu->v.quick->lines->num_file_names - 1]; -+} -+ -+static void -+dw2_map_ada_symtabs (struct objfile *objfile, -+ int (*wild_match) (const char *, int, const char *), -+ int (*is_name_suffix) (const char *), -+ void (*callback) (struct objfile *, -+ struct symtab *, void *), -+ const char *name, int global, -+ domain_enum namespace, int wild, -+ void *data) -+{ -+ /* For now, we don't support Ada, so this function can't be -+ reached. */ -+ internal_error (__FILE__, __LINE__, -+ _("map_ada_symtabs called via index method")); -+} -+ -+static void -+dw2_expand_symtabs_matching (struct objfile *objfile, -+ int (*file_matcher) (const char *, void *), -+ int (*name_matcher) (const char *, void *), -+ domain_enum kind, -+ void *data) -+{ -+ int i; -+ offset_type iter; -+ -+ dw2_setup (objfile); -+ if (!dwarf2_per_objfile->index_table) -+ return; -+ -+ for (i = 0; i < dwarf2_per_objfile->n_comp_units; ++i) -+ { -+ int j; -+ struct dwarf2_per_cu_data *cu = dwarf2_per_objfile->all_comp_units[i]; -+ -+ cu->v.quick->mark = 0; -+ if (cu->v.quick->symtab) -+ continue; -+ -+ dw2_require_line_header (objfile, cu); -+ if (!cu->v.quick->lines) -+ continue; -+ -+ for (j = 0; j < cu->v.quick->lines->num_file_names; ++j) -+ { -+ if (file_matcher (cu->v.quick->file_names[j], data)) -+ { -+ cu->v.quick->mark = 1; -+ break; -+ } -+ } -+ } -+ -+ for (iter = 0; -+ iter < dwarf2_per_objfile->index_table->index_table_slots; -+ ++iter) -+ { -+ offset_type idx = 2 * iter; -+ const char *name; -+ offset_type *vec, vec_len, vec_idx; -+ -+ if (dwarf2_per_objfile->index_table->index_table[idx] == 0 -+ && dwarf2_per_objfile->index_table->index_table[idx + 1] == 0) -+ continue; -+ -+ name = (dwarf2_per_objfile->index_table->constant_pool -+ + dwarf2_per_objfile->index_table->index_table[idx]); -+ -+ if (! (*name_matcher) (name, data)) -+ continue; -+ -+ /* The name was matched, now expand corresponding CUs that were -+ marked. */ -+ vec = (offset_type *) (dwarf2_per_objfile->index_table->constant_pool -+ + dwarf2_per_objfile->index_table->index_table[idx + 1]); -+ vec_len = MAYBE_SWAP (vec[0]); -+ for (vec_idx = 0; vec_idx < vec_len; ++vec_idx) -+ { -+ struct dwarf2_per_cu_data *cu -+ = dwarf2_per_objfile->all_comp_units[MAYBE_SWAP (vec[vec_idx + 1])]; -+ if (cu->v.quick->mark) -+ dw2_instantiate_symtab (objfile, cu); -+ } -+ } -+} -+ -+static struct symtab * -+dw2_find_pc_sect_symtab (struct objfile *objfile, -+ struct minimal_symbol *msymbol, -+ CORE_ADDR pc, -+ struct obj_section *section, -+ int warn_if_readin) -+{ -+ struct dwarf2_per_cu_data *data; -+ -+ dw2_setup (objfile); -+ -+ if (!objfile->psymtabs_addrmap) -+ return NULL; -+ -+ data = addrmap_find (objfile->psymtabs_addrmap, pc); -+ if (!data) -+ return NULL; -+ -+ if (warn_if_readin && data->v.quick->symtab) -+ warning (_("(Internal error: pc %s in read in CU, but not in symtab.)\n"), -+ paddress (get_objfile_arch (objfile), pc)); -+ -+ return dw2_instantiate_symtab (objfile, data); -+} -+ -+static void -+dw2_map_symbol_names (struct objfile *objfile, -+ void (*fun) (const char *, void *), -+ void *data) -+{ -+ offset_type iter; -+ dw2_setup (objfile); - -- if (info->size > 4 * pagesize && (sectp->flags & SEC_RELOC) == 0) -+ if (!dwarf2_per_objfile->index_table) -+ return; -+ -+ for (iter = 0; -+ iter < dwarf2_per_objfile->index_table->index_table_slots; -+ ++iter) - { -- off_t pg_offset = sectp->filepos & ~(pagesize - 1); -- size_t map_length = info->size + sectp->filepos - pg_offset; -- caddr_t retbuf = bfd_mmap (abfd, 0, map_length, PROT_READ, -- MAP_PRIVATE, pg_offset); -+ offset_type idx = 2 * iter; -+ const char *name; -+ offset_type *vec, vec_len, vec_idx; - -- if (retbuf != MAP_FAILED) -- { -- info->was_mmapped = 1; -- info->buffer = retbuf + (sectp->filepos & (pagesize - 1)) ; --#if HAVE_POSIX_MADVISE -- posix_madvise (retbuf, map_length, POSIX_MADV_WILLNEED); --#endif -- return; -- } -+ if (dwarf2_per_objfile->index_table->index_table[idx] == 0 -+ && dwarf2_per_objfile->index_table->index_table[idx + 1] == 0) -+ continue; -+ -+ name = (dwarf2_per_objfile->index_table->constant_pool -+ + dwarf2_per_objfile->index_table->index_table[idx]); -+ -+ (*fun) (name, data); - } --#endif -+} - -- /* If we get here, we are a normal, not-compressed section. */ -- info->buffer = buf -- = obstack_alloc (&objfile->objfile_obstack, info->size); -+static void -+dw2_map_symbol_filenames (struct objfile *objfile, -+ void (*fun) (const char *, const char *, void *), -+ void *data) -+{ -+ int i; - -- /* When debugging .o files, we may need to apply relocations; see -- http://sourceware.org/ml/gdb-patches/2002-04/msg00136.html . -- We never compress sections in .o files, so we only need to -- try this when the section is not compressed. */ -- retbuf = symfile_relocate_debug_section (objfile, sectp, buf); -- if (retbuf != NULL) -+ dw2_setup (objfile); -+ for (i = 0; i < dwarf2_per_objfile->n_comp_units; ++i) - { -- info->buffer = retbuf; -- return; -+ int j; -+ struct dwarf2_per_cu_data *cu = dwarf2_per_objfile->all_comp_units[i]; -+ -+ if (cu->v.quick->symtab) -+ continue; -+ -+ dw2_require_line_header (objfile, cu); -+ if (!cu->v.quick->lines) -+ continue; -+ -+ for (j = 0; j < cu->v.quick->lines->num_file_names; ++j) -+ { -+ const char *this_full_name = dw2_require_full_path (objfile, cu, j); -+ (*fun) (cu->v.quick->file_names[j], this_full_name, data); -+ } - } -+} - -- if (bfd_seek (abfd, sectp->filepos, SEEK_SET) != 0 -- || bfd_bread (buf, info->size, abfd) != info->size) -- error (_("Dwarf Error: Can't read DWARF data from '%s'"), -- bfd_get_filename (abfd)); -+static int -+dw2_has_symbols (struct objfile *objfile) -+{ -+ return 1; - } - --/* Fill in SECTP, BUFP and SIZEP with section info, given OBJFILE and -- SECTION_NAME. */ -+const struct quick_symbol_functions dwarf2_gdb_index_functions = -+{ -+ dw2_has_symbols, -+ dw2_find_last_source_symtab, -+ dw2_forget_cached_source_info, -+ dw2_lookup_symtab, -+ dw2_lookup_symbol, -+ dw2_pre_expand_symtabs_matching, -+ dw2_print_stats, -+ dw2_dump, -+ dw2_relocate, -+ dw2_expand_symtabs_for_function, -+ dw2_expand_all_symtabs, -+ dw2_expand_symtabs_with_filename, -+ dw2_find_symbol_file, -+ dw2_map_ada_symtabs, -+ dw2_expand_symtabs_matching, -+ dw2_find_pc_sect_symtab, -+ dw2_map_symbol_names, -+ dw2_map_symbol_filenames -+}; - --void --dwarf2_get_section_info (struct objfile *objfile, const char *section_name, -- asection **sectp, gdb_byte **bufp, -- bfd_size_type *sizep) --{ -- struct dwarf2_per_objfile *data -- = objfile_data (objfile, dwarf2_objfile_data_key); -- struct dwarf2_section_info *info; -+/* Initialize for reading DWARF for this objfile. Return 0 if this -+ file will use psymtabs, or 1 if using the GNU index. */ - -- /* We may see an objfile without any DWARF, in which case we just -- return nothing. */ -- if (data == NULL) -+int -+dwarf2_initialize_objfile (struct objfile *objfile) -+{ -+ /* If we're about to read full symbols, don't bother with the -+ indices. In this case we also don't care if some other debug -+ format is making psymtabs, because they are all about to be -+ expanded anyway. */ -+ if ((objfile->flags & OBJF_READNOW)) - { -- *sectp = NULL; -- *bufp = NULL; -- *sizep = 0; -- return; -+ int i; -+ -+ dwarf2_per_objfile->using_index = 1; -+ create_all_comp_units (objfile); -+ -+ for (i = 0; i < dwarf2_per_objfile->n_comp_units; ++i) -+ { -+ struct dwarf2_per_cu_data *cu = dwarf2_per_objfile->all_comp_units[i]; -+ -+ cu->v.quick = OBSTACK_ZALLOC (&objfile->objfile_obstack, -+ struct dwarf2_per_cu_quick_data); -+ } -+ -+ /* Return 1 so that gdb sees the "quick" functions. However, -+ these functions will be no-ops because we will have expanded -+ all symtabs. */ -+ return 1; - } -- if (section_is_p (section_name, EH_FRAME_SECTION)) -- info = &data->eh_frame; -- else if (section_is_p (section_name, FRAME_SECTION)) -- info = &data->frame; -- else -- gdb_assert (0); - -- if (info->asection != NULL && info->size != 0 && info->buffer == NULL) -- /* We haven't read this section in yet. Do it now. */ -- dwarf2_read_section (objfile, info); -+ if (dwarf2_read_index (objfile)) -+ return 1; - -- *sectp = info->asection; -- *bufp = info->buffer; -- *sizep = info->size; -+ dwarf2_build_psymtabs (objfile); -+ return 0; - } - -+ -+ - /* Build a partial symbol table. */ - - void -@@ -1699,6 +2688,7 @@ create_debug_types_hash_table (struct objfile *objfile) - type_sig->signature = signature; - type_sig->offset = offset; - type_sig->type_offset = type_offset; -+ type_sig->per_cu.objfile = objfile; - - slot = htab_find_slot (types_htab, type_sig, INSERT); - gdb_assert (slot != NULL); -@@ -1897,7 +2887,7 @@ process_psymtab_comp_unit (struct objfile *objfile, - /* Store the function that reads in the rest of the symbol table */ - pst->read_symtab = dwarf2_psymtab_to_symtab; - -- this_cu->psymtab = pst; -+ this_cu->v.psymtab = pst; - - dwarf2_find_base_address (comp_unit_die, &cu); - -@@ -2182,6 +3172,7 @@ create_all_comp_units (struct objfile *objfile) - memset (this_cu, 0, sizeof (*this_cu)); - this_cu->offset = offset; - this_cu->length = length + initial_length_size; -+ this_cu->objfile = objfile; - - if (n_comp_units == n_allocated) - { -@@ -2613,7 +3604,7 @@ add_partial_subprogram (struct partial_die_info *pdi, - addrmap_set_empty (objfile->psymtabs_addrmap, - pdi->lowpc + baseaddr, - pdi->highpc - 1 + baseaddr, -- cu->per_cu->psymtab); -+ cu->per_cu->v.psymtab); - } - if (!pdi->is_declaration) - /* Ignore subprogram DIEs that do not have a name, they are -@@ -2885,7 +3876,6 @@ locate_pdi_sibling (struct partial_die_info *orig_pdi, - static void - dwarf2_psymtab_to_symtab (struct partial_symtab *pst) - { -- /* FIXME: This is barely more than a stub. */ - if (pst != NULL) - { - if (pst->readin) -@@ -2958,7 +3948,9 @@ process_queue (struct objfile *objfile) - may load a new CU, adding it to the end of the queue. */ - for (item = dwarf2_queue; item != NULL; dwarf2_queue = item = next_item) - { -- if (item->per_cu->psymtab && !item->per_cu->psymtab->readin) -+ if (dwarf2_per_objfile->using_index -+ ? !item->per_cu->v.quick->symtab -+ : (item->per_cu->v.psymtab && !item->per_cu->v.psymtab->readin)) - process_full_comp_unit (item->per_cu); - - item->per_cu->queued = 0; -@@ -3035,22 +4027,7 @@ psymtab_to_symtab_1 (struct partial_symtab *pst) - return; - } - -- back_to = make_cleanup (dwarf2_release_queue, NULL); -- -- queue_comp_unit (per_cu, pst->objfile); -- -- if (per_cu->from_debug_types) -- read_signatured_type_at_offset (pst->objfile, per_cu->offset); -- else -- load_full_comp_unit (per_cu, pst->objfile); -- -- process_queue (pst->objfile); -- -- /* Age the cache, releasing compilation units that have not -- been used recently. */ -- age_cached_comp_units (); -- -- do_cleanups (back_to); -+ dw2_do_instantiate_symtab (pst->objfile, per_cu); - } - - /* Load the DIEs associated with PER_CU into memory. */ -@@ -3130,9 +4107,8 @@ load_full_comp_unit (struct dwarf2_per_cu_data *per_cu, struct objfile *objfile) - static void - process_full_comp_unit (struct dwarf2_per_cu_data *per_cu) - { -- struct partial_symtab *pst = per_cu->psymtab; - struct dwarf2_cu *cu = per_cu->cu; -- struct objfile *objfile = pst->objfile; -+ struct objfile *objfile = per_cu->objfile; - CORE_ADDR lowpc, highpc; - struct symtab *symtab; - struct cleanup *back_to; -@@ -3165,8 +4141,15 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu) - { - symtab->language = cu->language; - } -- pst->symtab = symtab; -- pst->readin = 1; -+ -+ if (dwarf2_per_objfile->using_index) -+ per_cu->v.quick->symtab = symtab; -+ else -+ { -+ struct partial_symtab *pst = per_cu->v.psymtab; -+ pst->symtab = symtab; -+ pst->readin = 1; -+ } - - do_cleanups (back_to); - } -@@ -3557,6 +4540,46 @@ free_cu_line_header (void *arg) - } - - static void -+find_file_and_directory (struct die_info *die, struct dwarf2_cu *cu, -+ char **name, char **comp_dir) -+{ -+ struct attribute *attr; -+ -+ *name = NULL; -+ *comp_dir = NULL; -+ -+ /* Find the filename. Do not use dwarf2_name here, since the filename -+ is not a source language identifier. */ -+ attr = dwarf2_attr (die, DW_AT_name, cu); -+ if (attr) -+ { -+ *name = DW_STRING (attr); -+ } -+ -+ attr = dwarf2_attr (die, DW_AT_comp_dir, cu); -+ if (attr) -+ *comp_dir = DW_STRING (attr); -+ else if (*name != NULL && IS_ABSOLUTE_PATH (*name)) -+ { -+ *comp_dir = ldirname (*name); -+ if (*comp_dir != NULL) -+ make_cleanup (xfree, *comp_dir); -+ } -+ if (*comp_dir != NULL) -+ { -+ /* Irix 6.2 native cc prepends .: to the compilation -+ directory, get rid of it. */ -+ char *cp = strchr (*comp_dir, ':'); -+ -+ if (cp && cp != *comp_dir && cp[-1] == '.' && cp[1] == '/') -+ *comp_dir = cp + 1; -+ } -+ -+ if (*name == NULL) -+ *name = ""; -+} -+ -+static void - read_file_scope (struct die_info *die, struct dwarf2_cu *cu) - { - struct objfile *objfile = cu->objfile; -@@ -3582,35 +4605,7 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu) - lowpc += baseaddr; - highpc += baseaddr; - -- /* Find the filename. Do not use dwarf2_name here, since the filename -- is not a source language identifier. */ -- attr = dwarf2_attr (die, DW_AT_name, cu); -- if (attr) -- { -- name = DW_STRING (attr); -- } -- -- attr = dwarf2_attr (die, DW_AT_comp_dir, cu); -- if (attr) -- comp_dir = DW_STRING (attr); -- else if (name != NULL && IS_ABSOLUTE_PATH (name)) -- { -- comp_dir = ldirname (name); -- if (comp_dir != NULL) -- make_cleanup (xfree, comp_dir); -- } -- if (comp_dir != NULL) -- { -- /* Irix 6.2 native cc prepends .: to the compilation -- directory, get rid of it. */ -- char *cp = strchr (comp_dir, ':'); -- -- if (cp && cp != comp_dir && cp[-1] == '.' && cp[1] == '/') -- comp_dir = cp + 1; -- } -- -- if (name == NULL) -- name = ""; -+ find_file_and_directory (die, cu, &name, &comp_dir); - - attr = dwarf2_attr (die, DW_AT_language, cu); - if (attr) -@@ -5529,6 +6524,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) + static void queue_comp_unit (struct dwarf2_per_cu_data *per_cu, +@@ -7312,6 +7321,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) new_symbol (die, this_type, cu); } @@ -3677,7 +1773,7 @@ index 1e75235..d54e266 100644 /* Extract all information from a DW_TAG_array_type DIE and put it in the DIE's type field. For now, this only handles one dimensional arrays. */ -@@ -5542,7 +6560,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -7325,7 +7357,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) struct type *element_type, *range_type, *index_type; struct type **range_types = NULL; struct attribute *attr; @@ -3686,7 +1782,7 @@ index 1e75235..d54e266 100644 struct cleanup *back_to; char *name; -@@ -5595,17 +6613,11 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -7378,17 +7410,11 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) type = element_type; if (read_array_order (die, cu) == DW_ORD_col_major) @@ -3709,7 +1805,7 @@ index 1e75235..d54e266 100644 /* Understand Dwarf2 support for vector types (like they occur on the PowerPC w/ AltiVec). Gcc just adds another attribute to the -@@ -6059,29 +7071,114 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -7882,29 +7908,114 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) struct gdbarch *gdbarch = get_objfile_arch (objfile); struct type *type, *range_type, *index_type, *char_type; struct attribute *attr; @@ -3801,7 +1897,7 @@ index 1e75235..d54e266 100644 } else { -- /* check for the DW_AT_byte_size attribute */ +- /* Check for the DW_AT_byte_size attribute. */ + if (attr && attr_form_is_constant (attr)) + { + /* We currently do not support a constant address where the location @@ -3838,7 +1934,7 @@ index 1e75235..d54e266 100644 char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -6324,60 +7421,136 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -8185,8 +8296,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) struct type *base_type; struct type *range_type; struct attribute *attr; @@ -3848,12 +1944,7 @@ index 1e75235..d54e266 100644 char *name; LONGEST negative_mask; - base_type = die_type (die, cu); -+ /* Preserve BASE_TYPE's original type, just set its LENGTH. */ -+ check_typedef (base_type); - - /* The die_type call above may have already set the type for this DIE. */ - range_type = get_die_type (die, cu); +@@ -8199,53 +8309,126 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) if (range_type) return range_type; @@ -3864,21 +1955,25 @@ index 1e75235..d54e266 100644 - } + /* LOW_BOUND and HIGH_BOUND are set for real below. */ + range_type = create_range_type (NULL, base_type, 0, -1); -+ -+ negative_mask = -+ (LONGEST) -1 << (TYPE_LENGTH (base_type) * TARGET_CHAR_BIT - 1); -+ -+ /* Exclude language_ada from any TYPE_DYNAMIC constructs below. GDB Ada -+ supports implements the dynamic bounds in a non-DWARF way and the -+ existing DWARF dynamic bounds are invalid, leading to memory access -+ errors. */ ++ TYPE_UNSIGNED (range_type) = 0; - /* FIXME: For variable sized arrays either of these could be - a variable rather than a constant value. We'll allow it, - but we don't know how to handle it. */ - attr = dwarf2_attr (die, DW_AT_lower_bound, cu); +- attr = dwarf2_attr (die, DW_AT_lower_bound, cu); - if (attr) - low = dwarf2_get_attr_constant_value (attr, 0); ++ negative_mask = ++ (LONGEST) -1 << (TYPE_LENGTH (base_type) * TARGET_CHAR_BIT - 1); + +- attr = dwarf2_attr (die, DW_AT_upper_bound, cu); +- if (attr) ++ /* Exclude language_ada from any TYPE_DYNAMIC constructs below. GDB Ada ++ supports implements the dynamic bounds in a non-DWARF way and the ++ existing DWARF dynamic bounds are invalid, leading to memory access ++ errors. */ ++ ++ attr = dwarf2_attr (die, DW_AT_lower_bound, cu); + if (attr && attr_form_is_block (attr) && cu->language != language_ada) + { + TYPE_RANGE_DATA (range_type)->low.kind = RANGE_BOUND_KIND_DWARF_BLOCK; @@ -3908,10 +2003,26 @@ index 1e75235..d54e266 100644 + low = 0; + } + else -+ { + { +- if (attr->form == DW_FORM_block1 || is_ref_attr (attr)) +- { +- /* GCC encodes arrays with unspecified or dynamic length +- with a DW_FORM_block1 attribute or a reference attribute. +- FIXME: GDB does not yet know how to handle dynamic +- arrays properly, treat them as arrays with unspecified +- length for now. +- +- FIXME: jimb/2003-09-22: GDB does not really know +- how to handle arrays of unspecified length +- either; we just represent them as zero-length +- arrays. Choose an appropriate upper bound given +- the lower bound we've computed above. */ +- high = low - 1; +- } + if (attr && attr_form_is_constant (attr)) + low = dwarf2_get_attr_constant_value (attr, 0); -+ else + else +- high = dwarf2_get_attr_constant_value (attr, 1); + { + if (cu->language == language_fortran) + { @@ -3930,37 +2041,24 @@ index 1e75235..d54e266 100644 + TYPE_LOW_BOUND (range_type) = low; + if (low >= 0) + TYPE_UNSIGNED (range_type) = 1; -+ } - - attr = dwarf2_attr (die, DW_AT_upper_bound, cu); -- if (attr) + } +- else ++ ++ attr = dwarf2_attr (die, DW_AT_upper_bound, cu); + if (!attr || (!attr_form_is_block (attr) && !attr_form_is_constant (attr) + && !is_ref_attr (attr))) { -- if (attr->form == DW_FORM_block1 || is_ref_attr (attr)) -- { -- /* GCC encodes arrays with unspecified or dynamic length -- with a DW_FORM_block1 attribute or a reference attribute. -- FIXME: GDB does not yet know how to handle dynamic -- arrays properly, treat them as arrays with unspecified -- length for now. -- -- FIXME: jimb/2003-09-22: GDB does not really know -- how to handle arrays of unspecified length -- either; we just represent them as zero-length -- arrays. Choose an appropriate upper bound given -- the lower bound we've computed above. */ -- high = low - 1; -- } -- else -- high = dwarf2_get_attr_constant_value (attr, 1); -+ attr = dwarf2_attr (die, DW_AT_count, cu); + attr = dwarf2_attr (die, DW_AT_count, cu); +- if (attr) +- { +- int count = dwarf2_get_attr_constant_value (attr, 1); +- high = low + count - 1; + /* It does not hurt but it is needlessly ineffective in check_typedef. */ + if (attr && (attr_form_is_block (attr) || attr_form_is_constant (attr))) + { + TYPE_RANGE_HIGH_BOUND_IS_COUNT (range_type) = 1; + TYPE_DYNAMIC (range_type) = 1; -+ } + } + /* Pass it now as the regular DW_AT_upper_bound. */ + } + @@ -3987,21 +2085,20 @@ index 1e75235..d54e266 100644 + TYPE_RANGE_DATA (range_type)->high.u.dwarf_loclist.type + = die_type (target_die, target_cu); + TYPE_DYNAMIC (range_type) = 1; - } - else - { -- attr = dwarf2_attr (die, DW_AT_count, cu); -- if (attr) ++ } ++ else ++ { + LONGEST high; + + if (attr && attr_form_is_constant (attr)) + high = dwarf2_get_attr_constant_value (attr, 0); -+ else + else { -- int count = dwarf2_get_attr_constant_value (attr, 1); -- high = low + count - 1; -+ TYPE_HIGH_BOUND_UNDEFINED (range_type) = 1; -+ high = low - 1; +- /* Unspecified array length. */ ++ /* Ada expects an empty array on no boundary attributes. */ ++ if (cu->language != language_ada) ++ TYPE_HIGH_BOUND_UNDEFINED (range_type) = 1; + high = low - 1; } + if (!TYPE_UNSIGNED (base_type) && (high & negative_mask)) + high |= negative_mask; @@ -4009,7 +2106,7 @@ index 1e75235..d54e266 100644 } /* Dwarf-2 specifications explicitly allows to create subrange types -@@ -6419,20 +7592,41 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) +@@ -8286,24 +8469,41 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) } } @@ -4019,6 +2116,8 @@ index 1e75235..d54e266 100644 - low |= negative_mask; - if (!TYPE_UNSIGNED (base_type) && (high & negative_mask)) - high |= negative_mask; +- +- range_type = create_range_type (NULL, base_type, low, high); + /* DW_AT_bit_stride is currently unsupported as we count in bytes. */ + attr = dwarf2_attr (die, DW_AT_byte_stride, cu); + if (attr && attr_form_is_block (attr) && cu->language != language_ada) @@ -4035,16 +2134,18 @@ index 1e75235..d54e266 100644 + struct dwarf2_cu *target_cu = cu; + struct attribute *target_loc_attr; -- range_type = create_range_type (NULL, base_type, low, high); -+ target_die = follow_die_ref_or_sig (die, attr, &target_cu); -+ gdb_assert (target_cu->objfile == cu->objfile); -+ target_loc_attr = dwarf2_attr (target_die, DW_AT_location, target_cu); - - /* Mark arrays with dynamic length at least as an array of unspecified - length. GDB could check the boundary but before it gets implemented at - least allow accessing the array elements. */ - if (attr && attr->form == DW_FORM_block1) - TYPE_HIGH_BOUND_UNDEFINED (range_type) = 1; ++ target_die = follow_die_ref_or_sig (die, attr, &target_cu); ++ gdb_assert (target_cu->objfile == cu->objfile); ++ target_loc_attr = dwarf2_attr (target_die, DW_AT_location, target_cu); + +- /* Ada expects an empty array on no boundary attributes. */ +- if (attr == NULL && cu->language != language_ada) +- TYPE_HIGH_BOUND_UNDEFINED (range_type) = 1; + TYPE_RANGE_DATA (range_type)->byte_stride.kind + = RANGE_BOUND_KIND_DWARF_LOCLIST; + TYPE_RANGE_DATA (range_type)->byte_stride.u.dwarf_loclist.loclist @@ -4063,7 +2164,7 @@ index 1e75235..d54e266 100644 name = dwarf2_name (die, cu); if (name) -@@ -8712,10 +9906,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym, +@@ -10780,10 +10980,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym, (i.e. when the value of a register or memory location is referenced, or a thread-local block, etc.). Then again, it might not be worthwhile. I'm assuming that it isn't unless performance @@ -4078,16 +2179,16 @@ index 1e75235..d54e266 100644 } /* Given a pointer to a DWARF information entry, figure out if we need -@@ -8746,6 +9942,8 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) - sizeof (struct symbol)); +@@ -10821,6 +11023,8 @@ new_symbol_full (struct die_info *die, struct type *type, struct dwarf2_cu *cu, + else + sym = OBSTACK_ZALLOC (&objfile->objfile_obstack, struct symbol); OBJSTAT (objfile, n_syms++); - memset (sym, 0, sizeof (struct symbol)); + /* Some methods are called w/o checking SYMBOL_COMPUTED_OPS validity. */ + SYMBOL_COMPUTED_OPS (sym) = &dwarf2_missing_funcs; /* Cache this symbol's name and the name's demangled form (if any). */ - SYMBOL_LANGUAGE (sym) = cu->language; -@@ -9375,6 +10573,9 @@ read_type_die (struct die_info *die, struct dwarf2_cu *cu) + SYMBOL_SET_LANGUAGE (sym, cu->language); +@@ -11593,6 +11797,9 @@ read_type_die_1 (struct die_info *die, struct dwarf2_cu *cu) break; } @@ -4097,8 +2198,8 @@ index 1e75235..d54e266 100644 return this_type; } -@@ -11979,67 +13180,102 @@ attr_form_is_constant (struct attribute *attr) - } +@@ -14405,61 +14612,99 @@ fill_in_loclist_baton (struct dwarf2_cu *cu, + baton->base_address = cu->base_address; } -static void @@ -4114,31 +2215,21 @@ index 1e75235..d54e266 100644 - /* ".debug_loc" may not exist at all, or the offset may be outside - the section. If so, fall through to the complaint in the - other branch. */ -- && DW_UNSND (attr) < dwarf2_per_objfile->loc.size) +- && DW_UNSND (attr) < dwarf2_section_size (dwarf2_per_objfile->objfile, +- &dwarf2_per_objfile->loc)) - { - struct dwarf2_loclist_baton *baton; + struct dwarf2_locexpr_baton *baton; ++ ++ gdb_assert (attr_form_is_block (attr)); - baton = obstack_alloc (&cu->objfile->objfile_obstack, - sizeof (struct dwarf2_loclist_baton)); -- baton->per_cu = cu->per_cu; -- gdb_assert (baton->per_cu); -+ gdb_assert (attr_form_is_block (attr)); - -- dwarf2_read_section (dwarf2_per_objfile->objfile, -- &dwarf2_per_objfile->loc); + baton = obstack_alloc (&cu->objfile->objfile_obstack, sizeof (*baton)); + baton->per_cu = cu->per_cu; + gdb_assert (baton->per_cu); -- /* We don't know how long the location list is, but make sure we -- don't run off the edge of the section. */ -- baton->size = dwarf2_per_objfile->loc.size - DW_UNSND (attr); -- baton->data = dwarf2_per_objfile->loc.buffer + DW_UNSND (attr); -- baton->base_address = cu->base_address; -- if (cu->base_known == 0) -- complaint (&symfile_complaints, -- _("Location list used without specifying the CU base address.")); +- fill_in_loclist_baton (cu, baton, attr); + /* Note that we're just copying the block's data pointer + here, not the actual data. We're still pointing into the + info_buffer for SYM's objfile; right now we never release @@ -4147,7 +2238,11 @@ index 1e75235..d54e266 100644 + baton->size = DW_BLOCK (attr)->size; + baton->data = DW_BLOCK (attr)->data; + gdb_assert (baton->size == 0 || baton->data != NULL); -+ + +- if (cu->base_known == 0) +- complaint (&symfile_complaints, +- _("Location list used without " +- "specifying the CU base address.")); + return baton; +} + @@ -4168,26 +2263,23 @@ index 1e75235..d54e266 100644 + /* ".debug_loc" may not exist at all, or the offset may be outside + the section. If so, fall through to the complaint in the + other branch. */ -+ && DW_UNSND (attr) < dwarf2_per_objfile->loc.size)) ++ && DW_UNSND (attr) < dwarf2_section_size (dwarf2_per_objfile->objfile, ++ &dwarf2_per_objfile->loc))) + return NULL; + + baton = obstack_alloc (&cu->objfile->objfile_obstack, + sizeof (struct dwarf2_loclist_baton)); -+ baton->per_cu = cu->per_cu; -+ gdb_assert (baton->per_cu); + -+ /* We don't know how long the location list is, but make sure we -+ don't run off the edge of the section. */ -+ baton->size = dwarf2_per_objfile->loc.size - DW_UNSND (attr); -+ baton->data = dwarf2_per_objfile->loc.buffer + DW_UNSND (attr); -+ baton->base_address = cu->base_address; ++ fill_in_loclist_baton (cu, baton, attr); ++ + if (cu->base_known == 0) + complaint (&symfile_complaints, -+ _("Location list used without specifying the CU base address.")); ++ _("Location list used without " ++ "specifying the CU base address.")); + + return baton; +} -+ + +/* SYM may get its SYMBOL_CLASS overriden on invalid ATTR content. */ + +static void @@ -4195,7 +2287,7 @@ index 1e75235..d54e266 100644 + struct dwarf2_cu *cu) +{ + struct dwarf2_loclist_baton *loclist_baton; - ++ + loclist_baton = dwarf2_attr_to_loclist_baton (attr, cu); + if (loclist_baton) + { @@ -4249,74 +2341,7 @@ index 1e75235..d54e266 100644 } } -@@ -12050,7 +13286,7 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, - struct objfile * - dwarf2_per_cu_objfile (struct dwarf2_per_cu_data *per_cu) - { -- struct objfile *objfile = per_cu->psymtab->objfile; -+ struct objfile *objfile = per_cu->objfile; - - /* Return the master objfile, so that we can report and look up the - correct file containing this variable. */ -@@ -12070,7 +13306,7 @@ dwarf2_per_cu_addr_size (struct dwarf2_per_cu_data *per_cu) - else - { - /* If the CU is not currently read in, we re-read its header. */ -- struct objfile *objfile = per_cu->psymtab->objfile; -+ struct objfile *objfile = per_cu->objfile; - struct dwarf2_per_objfile *per_objfile - = objfile_data (objfile, dwarf2_objfile_data_key); - gdb_byte *info_ptr = per_objfile->info.buffer + per_cu->offset; -@@ -12092,7 +13328,7 @@ dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *per_cu) - else - { - /* If the CU is not currently read in, we re-read its header. */ -- struct objfile *objfile = per_cu->psymtab->objfile; -+ struct objfile *objfile = per_cu->objfile; - struct dwarf2_per_objfile *per_objfile - = objfile_data (objfile, dwarf2_objfile_data_key); - gdb_byte *info_ptr = per_objfile->info.buffer + per_cu->offset; -@@ -12112,7 +13348,7 @@ dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *per_cu) - CORE_ADDR - dwarf2_per_cu_text_offset (struct dwarf2_per_cu_data *per_cu) - { -- struct objfile *objfile = per_cu->psymtab->objfile; -+ struct objfile *objfile = per_cu->objfile; - - return ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); - } -@@ -12334,6 +13570,30 @@ dwarf2_free_objfile (struct objfile *objfile) - /* Cached DIE trees use xmalloc and the comp_unit_obstack. */ - free_cached_comp_units (NULL); - -+ if (dwarf2_per_objfile->using_index) -+ { -+ int i; -+ -+ for (i = 0; i < dwarf2_per_objfile->n_comp_units; ++i) -+ { -+ int j; -+ struct dwarf2_per_cu_data *cu = dwarf2_per_objfile->all_comp_units[i]; -+ -+ if (!cu->v.quick->lines) -+ continue; -+ -+ for (j = 0; j < cu->v.quick->lines->num_file_names; ++j) -+ { -+ if (cu->v.quick->file_names) -+ xfree ((void *) cu->v.quick->file_names[j]); -+ if (cu->v.quick->full_names) -+ xfree ((void *) cu->v.quick->full_names[j]); -+ } -+ -+ free_line_header (cu->v.quick->lines); -+ } -+ } -+ - /* Everything else should be on the objfile obstack. */ - } - -@@ -12368,6 +13628,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) +@@ -14805,6 +15050,31 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) return ofs_lhs->offset == ofs_rhs->offset; } @@ -4348,607 +2373,20 @@ index 1e75235..d54e266 100644 /* Set the type associated with DIE to TYPE. Save it in CU's hash table if necessary. For convenience, return TYPE. -@@ -12391,6 +13676,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) - { - struct dwarf2_offset_and_type **slot, ofs; +@@ -14830,6 +15100,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) + struct objfile *objfile = cu->objfile; + htab_t *type_hash_ptr; + fetch_die_type_attrs (die, type, cu); + /* For Ada types, make sure that the gnat-specific data is always initialized (if not already set). There are a few types where we should not be doing so, because the type-specific area is -@@ -12591,8 +13878,567 @@ dwarf2_per_objfile_free (struct objfile *objfile, void *d) - munmap_section_buffer (&data->types); - munmap_section_buffer (&data->frame); - munmap_section_buffer (&data->eh_frame); -+ munmap_section_buffer (&data->gdb_index); -+} -+ -+ -+ -+/* The contents of the hash table we create when building the string -+ table. */ -+struct strtab_entry -+{ -+ offset_type offset; -+ const char *str; -+}; -+ -+/* Hash function for a strtab_entry. */ -+static hashval_t -+hash_strtab_entry (const void *e) -+{ -+ const struct strtab_entry *entry = e; -+ return mapped_index_string_hash (entry->str); -+} -+ -+/* Equality function for a strtab_entry. */ -+static int -+eq_strtab_entry (const void *a, const void *b) -+{ -+ const struct strtab_entry *ea = a; -+ const struct strtab_entry *eb = b; -+ return !strcmp (ea->str, eb->str); -+} -+ -+/* Create a strtab_entry hash table. */ -+static htab_t -+create_strtab (void) -+{ -+ return htab_create_alloc (100, hash_strtab_entry, eq_strtab_entry, -+ xfree, xcalloc, xfree); -+} -+ -+/* Add a string to the constant pool. Return the string's offset in -+ host order. */ -+static offset_type -+add_string (htab_t table, struct obstack *cpool, const char *str) -+{ -+ void **slot; -+ struct strtab_entry entry; -+ struct strtab_entry *result; -+ -+ entry.str = str; -+ slot = htab_find_slot (table, &entry, INSERT); -+ if (*slot) -+ result = *slot; -+ else -+ { -+ result = XNEW (struct strtab_entry); -+ result->offset = obstack_object_size (cpool); -+ result->str = str; -+ obstack_grow_str0 (cpool, str); -+ *slot = result; -+ } -+ return result->offset; -+} -+ -+/* An entry in the symbol table. */ -+struct symtab_index_entry -+{ -+ /* The name of the symbol. */ -+ const char *name; -+ /* The offset of the name in the constant pool. */ -+ offset_type index_offset; -+ /* A sorted vector of the indices of all the CUs that hold an object -+ of this name. */ -+ VEC (offset_type) *cu_indices; -+}; -+ -+/* The symbol table. This is a power-of-2-sized hash table. */ -+struct mapped_symtab -+{ -+ offset_type n_elements; -+ offset_type size; -+ struct symtab_index_entry **data; -+}; -+ -+/* Hash function for a symtab_index_entry. */ -+static hashval_t -+hash_symtab_entry (const void *e) -+{ -+ const struct symtab_index_entry *entry = e; -+ return iterative_hash (VEC_address (offset_type, entry->cu_indices), -+ sizeof (offset_type) * VEC_length (offset_type, -+ entry->cu_indices), -+ 0); -+} -+ -+/* Equality function for a symtab_index_entry. */ -+static int -+eq_symtab_entry (const void *a, const void *b) -+{ -+ const struct symtab_index_entry *ea = a; -+ const struct symtab_index_entry *eb = b; -+ int len = VEC_length (offset_type, ea->cu_indices); -+ if (len != VEC_length (offset_type, eb->cu_indices)) -+ return 0; -+ return !memcmp (VEC_address (offset_type, ea->cu_indices), -+ VEC_address (offset_type, eb->cu_indices), -+ sizeof (offset_type) * len); -+} -+ -+/* Destroy a symtab_index_entry. */ -+static void -+delete_symtab_entry (void *p) -+{ -+ struct symtab_index_entry *entry = p; -+ VEC_free (offset_type, entry->cu_indices); -+ xfree (entry); -+} -+ -+/* Create a hash table holding symtab_index_entry objects. */ -+static htab_t -+create_index_table (void) -+{ -+ return htab_create_alloc (100, hash_symtab_entry, eq_symtab_entry, -+ delete_symtab_entry, xcalloc, xfree); -+} -+ -+/* Create a new mapped symtab object. */ -+static struct mapped_symtab * -+create_mapped_symtab (void) -+{ -+ struct mapped_symtab *symtab = XNEW (struct mapped_symtab); -+ symtab->n_elements = 0; -+ symtab->size = 1024; -+ symtab->data = XCNEWVEC (struct symtab_index_entry *, symtab->size); -+ return symtab; -+} -+ -+/* Destroy a mapped_symtab. */ -+static void -+cleanup_mapped_symtab (void *p) -+{ -+ struct mapped_symtab *symtab = p; -+ /* The contents of the array are freed when the other hash table is -+ destroyed. */ -+ xfree (symtab->data); -+ xfree (symtab); -+} -+ -+/* Find a slot in SYMTAB for the symbol NAME. Returns a pointer to -+ the slot. */ -+static struct symtab_index_entry ** -+find_slot (struct mapped_symtab *symtab, const char *name) -+{ -+ offset_type index, step, hash = mapped_index_string_hash (name); -+ -+ index = hash & (symtab->size - 1); -+ step = ((hash * 17) & (symtab->size - 1)) | 1; -+ -+ for (;;) -+ { -+ if (!symtab->data[index] || !strcmp (name, symtab->data[index]->name)) -+ return &symtab->data[index]; -+ index = (index + step) & (symtab->size - 1); -+ } - } - -+/* Expand SYMTAB's hash table. */ -+static void -+hash_expand (struct mapped_symtab *symtab) -+{ -+ offset_type old_size = symtab->size; -+ offset_type i; -+ struct symtab_index_entry **old_entries = symtab->data; -+ -+ symtab->size *= 2; -+ symtab->data = XCNEWVEC (struct symtab_index_entry *, symtab->size); -+ -+ for (i = 0; i < old_size; ++i) -+ { -+ if (old_entries[i]) -+ { -+ struct symtab_index_entry **slot = find_slot (symtab, -+ old_entries[i]->name); -+ *slot = old_entries[i]; -+ } -+ } -+ -+ xfree (old_entries); -+} -+ -+/* Add an entry to SYMTAB. NAME is the name of the symbol. CU_INDEX -+ is the index of the CU in which the symbol appears. */ -+static void -+add_index_entry (struct mapped_symtab *symtab, const char *name, -+ offset_type cu_index) -+{ -+ struct symtab_index_entry **slot; -+ -+ ++symtab->n_elements; -+ if (4 * symtab->n_elements / 3 >= symtab->size) -+ hash_expand (symtab); -+ -+ slot = find_slot (symtab, name); -+ if (!*slot) -+ { -+ *slot = XNEW (struct symtab_index_entry); -+ (*slot)->name = name; -+ (*slot)->cu_indices = NULL; -+ } -+ /* Don't push an index twice. Due to how we add entries we only -+ have to check the last one. */ -+ if (VEC_empty (offset_type, (*slot)->cu_indices) -+ || VEC_length (offset_type, (*slot)->cu_indices) != cu_index) -+ VEC_safe_push (offset_type, (*slot)->cu_indices, cu_index); -+} -+ -+/* Add a vector of indices to the constant pool. */ -+static offset_type -+add_indices_to_cpool (htab_t index_table, struct obstack *cpool, -+ struct symtab_index_entry *entry) -+{ -+ void **slot; -+ -+ slot = htab_find_slot (index_table, entry, INSERT); -+ if (!*slot) -+ { -+ offset_type len = VEC_length (offset_type, entry->cu_indices); -+ offset_type val = MAYBE_SWAP (len); -+ offset_type iter; -+ int i; -+ -+ *slot = entry; -+ entry->index_offset = obstack_object_size (cpool); -+ -+ obstack_grow (cpool, &val, sizeof (val)); -+ for (i = 0; -+ VEC_iterate (offset_type, entry->cu_indices, i, iter); -+ ++i) -+ { -+ val = MAYBE_SWAP (iter); -+ obstack_grow (cpool, &val, sizeof (val)); -+ } -+ } -+ else -+ { -+ struct symtab_index_entry *old_entry = *slot; -+ entry->index_offset = old_entry->index_offset; -+ entry = old_entry; -+ } -+ return entry->index_offset; -+} -+ -+/* Write the mapped hash table SYMTAB to the obstack OUTPUT, with -+ constant pool entries going into the obstack CPOOL. */ -+static void -+write_hash_table (struct mapped_symtab *symtab, -+ struct obstack *output, struct obstack *cpool) -+{ -+ offset_type i; -+ htab_t index_table; -+ htab_t str_table; -+ -+ index_table = create_index_table (); -+ str_table = create_strtab (); -+ /* We add all the index vectors to the constant pool first, to -+ ensure alignment is ok. */ -+ for (i = 0; i < symtab->size; ++i) -+ { -+ if (symtab->data[i]) -+ add_indices_to_cpool (index_table, cpool, symtab->data[i]); -+ } -+ -+ /* Now write out the hash table. */ -+ for (i = 0; i < symtab->size; ++i) -+ { -+ offset_type str_off, vec_off; -+ -+ if (symtab->data[i]) -+ { -+ str_off = add_string (str_table, cpool, symtab->data[i]->name); -+ vec_off = symtab->data[i]->index_offset; -+ } -+ else -+ { -+ /* While 0 is a valid constant pool index, it is not valid -+ to have 0 for both offsets. */ -+ str_off = 0; -+ vec_off = 0; -+ } -+ -+ str_off = MAYBE_SWAP (str_off); -+ vec_off = MAYBE_SWAP (vec_off); -+ -+ obstack_grow (output, &str_off, sizeof (str_off)); -+ obstack_grow (output, &vec_off, sizeof (vec_off)); -+ } -+ -+ htab_delete (str_table); -+ htab_delete (index_table); -+} -+ -+/* Write an address entry to ADDR_OBSTACK. The addresses are taken -+ from PST; CU_INDEX is the index of the CU in the vector of all -+ CUs. */ -+static void -+add_address_entry (struct objfile *objfile, -+ struct obstack *addr_obstack, struct partial_symtab *pst, -+ unsigned int cu_index) -+{ -+ offset_type offset; -+ char addr[8]; -+ CORE_ADDR baseaddr; -+ -+ baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); -+ -+ store_unsigned_integer (addr, 8, BFD_ENDIAN_LITTLE, pst->textlow - baseaddr); -+ obstack_grow (addr_obstack, addr, 8); -+ store_unsigned_integer (addr, 8, BFD_ENDIAN_LITTLE, pst->texthigh - baseaddr); -+ obstack_grow (addr_obstack, addr, 8); -+ offset = MAYBE_SWAP (cu_index); -+ obstack_grow (addr_obstack, &offset, sizeof (offset_type)); -+} -+ -+/* Add a list of partial symbols to SYMTAB. */ -+static void -+write_psymbols (struct mapped_symtab *symtab, -+ struct partial_symbol **psymp, -+ int count, -+ offset_type cu_index) -+{ -+ for (; count-- > 0; ++psymp) -+ { -+ if (SYMBOL_LANGUAGE (*psymp) == language_ada) -+ error (_("Ada is not currently supported by the index")); -+ add_index_entry (symtab, SYMBOL_NATURAL_NAME (*psymp), cu_index); -+ } -+} -+ -+/* Write the contents of an ("unfinished") obstack to FILE. Throw an -+ exception if there is an error. */ -+static void -+write_obstack (FILE *file, struct obstack *obstack) -+{ -+ if (fwrite (obstack_base (obstack), 1, obstack_object_size (obstack), -+ file) -+ != obstack_object_size (obstack)) -+ error (_("couldn't data write to file")); -+} -+ -+/* Unlink a file if the argument is not NULL. */ -+static void -+unlink_if_set (void *p) -+{ -+ char **filename = p; -+ if (*filename) -+ unlink (*filename); -+} -+ -+/* Create an index file for OBJFILE in the directory DIR. */ -+static void -+write_psymtabs_to_index (struct objfile *objfile, const char *dir) -+{ -+ struct cleanup *cleanup; -+ char *filename, *cleanup_filename; -+ struct obstack contents, addr_obstack, constant_pool, symtab_obstack, cu_list; -+ int i; -+ FILE *out_file; -+ struct mapped_symtab *symtab; -+ offset_type val, size_of_contents, total_len; -+ struct stat st; -+ char buf[8]; -+ -+ if (!objfile->psymtabs) -+ return; -+ if (dwarf2_per_objfile->using_index) -+ error (_("Cannot use an index to create the index")); -+ -+ if (stat (objfile->name, &st) < 0) -+ perror_with_name (_("Could not stat")); -+ -+ filename = concat (dir, SLASH_STRING, lbasename (objfile->name), -+ INDEX_SUFFIX, (char *) NULL); -+ cleanup = make_cleanup (xfree, filename); -+ -+ out_file = fopen (filename, "wb"); -+ if (!out_file) -+ error (_("Can't open `%s' for writing"), filename); -+ -+ cleanup_filename = filename; -+ make_cleanup (unlink_if_set, &cleanup_filename); -+ -+ symtab = create_mapped_symtab (); -+ make_cleanup (cleanup_mapped_symtab, symtab); -+ -+ obstack_init (&addr_obstack); -+ make_cleanup_obstack_free (&addr_obstack); -+ -+ obstack_init (&cu_list); -+ make_cleanup_obstack_free (&cu_list); -+ -+ for (i = 0; i < dwarf2_per_objfile->n_comp_units; ++i) -+ { -+ struct dwarf2_per_cu_data *cu = dwarf2_per_objfile->all_comp_units[i]; -+ struct partial_symtab *psymtab = cu->v.psymtab; -+ gdb_byte val[8]; -+ -+ write_psymbols (symtab, -+ objfile->global_psymbols.list + psymtab->globals_offset, -+ psymtab->n_global_syms, i); -+ write_psymbols (symtab, -+ objfile->static_psymbols.list + psymtab->statics_offset, -+ psymtab->n_static_syms, i); -+ -+ add_address_entry (objfile, &addr_obstack, psymtab, i); -+ -+ store_unsigned_integer (val, 8, BFD_ENDIAN_LITTLE, cu->offset); -+ obstack_grow (&cu_list, val, 8); -+ store_unsigned_integer (val, 8, BFD_ENDIAN_LITTLE, cu->length); -+ obstack_grow (&cu_list, val, 8); -+ } -+ -+ obstack_init (&constant_pool); -+ make_cleanup_obstack_free (&constant_pool); -+ obstack_init (&symtab_obstack); -+ make_cleanup_obstack_free (&symtab_obstack); -+ write_hash_table (symtab, &symtab_obstack, &constant_pool); -+ -+ obstack_init (&contents); -+ make_cleanup_obstack_free (&contents); -+ size_of_contents = 5 * sizeof (offset_type); -+ total_len = size_of_contents; -+ -+ /* The version number. */ -+ val = MAYBE_SWAP (1); -+ obstack_grow (&contents, &val, sizeof (val)); -+ -+ /* The offset of the CU list from the start of the file. */ -+ val = MAYBE_SWAP (total_len); -+ obstack_grow (&contents, &val, sizeof (val)); -+ total_len += obstack_object_size (&cu_list); -+ -+ /* The offset of the address table from the start of the file. */ -+ val = MAYBE_SWAP (total_len); -+ obstack_grow (&contents, &val, sizeof (val)); -+ total_len += obstack_object_size (&addr_obstack); -+ -+ /* The offset of the symbol table from the start of the file. */ -+ val = MAYBE_SWAP (total_len); -+ obstack_grow (&contents, &val, sizeof (val)); -+ total_len += obstack_object_size (&symtab_obstack); -+ -+ /* The offset of the constant pool from the start of the file. */ -+ val = MAYBE_SWAP (total_len); -+ obstack_grow (&contents, &val, sizeof (val)); -+ total_len += obstack_object_size (&constant_pool); -+ -+ gdb_assert (obstack_object_size (&contents) == size_of_contents); -+ -+ write_obstack (out_file, &contents); -+ write_obstack (out_file, &cu_list); -+ write_obstack (out_file, &addr_obstack); -+ write_obstack (out_file, &symtab_obstack); -+ write_obstack (out_file, &constant_pool); -+ -+ fclose (out_file); -+ -+ /* We want to keep the file, so we set cleanup_filename to NULL -+ here. See unlink_if_set. */ -+ cleanup_filename = NULL; -+ -+ do_cleanups (cleanup); -+} -+ -+/* The mapped index file format is designed to be directly mmap()able -+ on any architecture. In most cases, a datum is represented using a -+ little-endian 32-bit integer value, called an offset_type. Big -+ endian machines must byte-swap the values before using them. -+ Exceptions to this rule are noted. The data is laid out such that -+ alignment is always respected. -+ -+ A mapped index consists of several sections. -+ -+ 1. The file header. This is a sequence of values, of offset_type -+ unless otherwise noted: -+ [0] The version number. Currently 1. -+ [1] The offset, from the start of the file, of the CU list. -+ [2] The offset, from the start of the file, of the address section. -+ [3] The offset, from the start of the file, of the symbol table. -+ [4] The offset, from the start of the file, of the constant pool. -+ -+ 2. The CU list. This is a sequence of pairs of 64-bit -+ little-endian values. The first element in each pair is the offset -+ of a CU in the .debug_info section. The second element in each -+ pair is the length of that CU. References to a CU elsewhere in the -+ map are done using a CU index, which is just the 0-based index into -+ this table. -+ -+ 3. The address section. The address section consists of a sequence -+ of address entries. Each address entry has three elements. -+ [0] The low address. This is a 64-bit little-endian value. -+ [1] The high address. This is a 64-bit little-endian value. -+ [2] The CU index. This is an offset_type value. -+ -+ 4. The symbol table. This is a hash table. The size of the hash -+ table is always a power of 2. The initial hash and the step are -+ currently defined by the `find_slot' function. -+ -+ Each slot in the hash table consists of a pair of offset_type -+ values. The first value is the offset of the symbol's name in the -+ constant pool. The second value is the offset of the CU vector in -+ the constant pool. -+ -+ If both values are 0, then this slot in the hash table is empty. -+ This is ok because while 0 is a valid constant pool index, it -+ cannot be a valid index for both a string and a CU vector. -+ -+ A string in the constant pool is stored as a \0-terminated string, -+ as you'd expect. -+ -+ A CU vector in the constant pool is a sequence of offset_type -+ values. The first value is the number of CU indices in the vector. -+ Each subsequent value is the index of a CU in the CU list. This -+ element in the hash table is used to indicate which CUs define the -+ symbol. -+ -+ 5. The constant pool. This is simply a bunch of bytes. It is -+ organized so that alignment is correct: CU vectors are stored -+ first, followed by strings. */ -+static void -+save_gdb_index_command (char *arg, int from_tty) -+{ -+ struct objfile *objfile; -+ -+ if (!arg || !*arg) -+ error (_("usage: save gdb-index DIRECTORY")); -+ -+ ALL_OBJFILES (objfile) -+ { -+ struct stat st; -+ -+ /* If the objfile does not correspond to an actual file, skip it. */ -+ if (stat (objfile->name, &st) < 0) -+ continue; -+ -+ dwarf2_per_objfile = objfile_data (objfile, dwarf2_objfile_data_key); -+ if (dwarf2_per_objfile) -+ { -+ volatile struct gdb_exception except; -+ -+ TRY_CATCH (except, RETURN_MASK_ERROR) -+ { -+ write_psymtabs_to_index (objfile, arg); -+ } -+ if (except.reason < 0) -+ exception_fprintf (gdb_stderr, except, -+ _("Error while writing index for `%s': "), -+ objfile->name); -+ } -+ } -+} -+ -+ -+ - int dwarf2_always_disassemble; - - static void -@@ -12609,6 +14455,8 @@ void _initialize_dwarf2_read (void); - void - _initialize_dwarf2_read (void) - { -+ struct cmd_list_element *c; -+ - dwarf2_objfile_data_key - = register_objfile_data_with_cleanup (NULL, dwarf2_per_objfile_free); - -@@ -12656,4 +14504,9 @@ The value is the maximum depth to print."), - NULL, - NULL, - &setdebuglist, &showdebuglist); -+ -+ c = add_cmd ("gdb-index", class_files, save_gdb_index_command, -+ _("Save a .gdb-index file"), -+ &save_cmdlist); -+ set_cmd_completer (c, filename_completer); - } diff --git a/gdb/elfread.c b/gdb/elfread.c -index 8c00938..a250c58 100644 +index c59134b..c2c8229 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c -@@ -37,9 +37,13 @@ +@@ -37,6 +37,7 @@ #include "complaints.h" #include "demangle.h" #include "psympriv.h" @@ -4956,13 +2394,7 @@ index 8c00938..a250c58 100644 extern void _initialize_elfread (void); -+/* Forward declaration. */ -+static struct sym_fns elf_sym_fns_gdb_index; -+ - /* The struct elfinfo is available only during ELF symbol table and - psymtab reading. It is destroyed at the completion of psymtab-reading. - It's local to elf_symfile_read. */ -@@ -180,7 +184,8 @@ record_minimal_symbol (const char *name, int name_len, int copy_name, +@@ -183,7 +184,8 @@ record_minimal_symbol (const char *name, int name_len, int copy_name, { struct gdbarch *gdbarch = get_objfile_arch (objfile); @@ -4972,7 +2404,7 @@ index 8c00938..a250c58 100644 address = gdbarch_smash_text_address (gdbarch, address); return prim_record_minimal_symbol_full (name, name_len, copy_name, address, -@@ -388,7 +393,10 @@ elf_symtab_read (struct objfile *objfile, int type, +@@ -391,7 +393,10 @@ elf_symtab_read (struct objfile *objfile, int type, { if (sym->flags & (BSF_GLOBAL | BSF_WEAK)) { @@ -4984,7 +2416,7 @@ index 8c00938..a250c58 100644 } else if ((sym->name[0] == '.' && sym->name[1] == 'L') || ((sym->flags & BSF_LOCAL) -@@ -569,6 +577,250 @@ elf_symtab_read (struct objfile *objfile, int type, +@@ -574,6 +579,250 @@ elf_symtab_read (struct objfile *objfile, int type, } } @@ -5235,7 +2667,7 @@ index 8c00938..a250c58 100644 struct build_id { size_t size; -@@ -797,6 +1049,8 @@ elf_symfile_read (struct objfile *objfile, int symfile_flags) +@@ -814,6 +1063,8 @@ elf_symfile_read (struct objfile *objfile, int symfile_flags) bfd_errmsg (bfd_get_error ())); elf_symtab_read (objfile, ST_DYNAMIC, dynsymcount, dyn_symbol_table, 0); @@ -5244,48 +2676,8 @@ index 8c00938..a250c58 100644 } /* Add synthetic symbols - for instance, names for any PLT entries. */ -@@ -869,11 +1123,9 @@ elf_symfile_read (struct objfile *objfile, int symfile_flags) - str_sect->filepos, - bfd_section_size (abfd, str_sect)); - } -- if (dwarf2_has_info (objfile)) -- { -- /* DWARF 2 sections */ -- dwarf2_build_psymtabs (objfile); -- } -+ -+ if (dwarf2_has_info (objfile) && dwarf2_initialize_objfile (objfile)) -+ objfile->sf = &elf_sym_fns_gdb_index; - - /* If the file has its own symbol tables it has no separate debug info. - `.dynsym'/`.symtab' go to MSYMBOLS, `.debug_info' goes to SYMTABS/PSYMTABS. -@@ -1049,6 +1301,24 @@ static struct sym_fns elf_sym_fns = - NULL /* next: pointer to next struct sym_fns */ - }; - -+/* The same as elf_sym_fns, but not registered and uses the -+ DWARF-specific GNU index rather than psymtab. */ -+static struct sym_fns elf_sym_fns_gdb_index = -+{ -+ bfd_target_elf_flavour, -+ elf_new_init, /* sym_new_init: init anything gbl to entire symab */ -+ elf_symfile_init, /* sym_init: read initial info, setup for sym_red() */ -+ elf_symfile_read, /* sym_read: read a symbol file into symtab */ -+ elf_symfile_finish, /* sym_finish: finished with file, cleanup */ -+ default_symfile_offsets, /* sym_offsets: Translate ext. to int. relocatin */ -+ elf_symfile_segments, /* sym_segments: Get segment information from -+ a file. */ -+ NULL, /* sym_read_linetable */ -+ default_symfile_relocate, /* sym_relocate: Relocate a debug section. */ -+ &dwarf2_gdb_index_functions, -+ NULL /* next: pointer to next struct sym_fns */ -+}; -+ - void - _initialize_elfread (void) - { diff --git a/gdb/eval.c b/gdb/eval.c -index ff17c34..7b9e871 100644 +index de25b39..cced13c 100644 --- a/gdb/eval.c +++ b/gdb/eval.c @@ -44,6 +44,7 @@ @@ -5296,7 +2688,222 @@ index ff17c34..7b9e871 100644 #include "gdb_assert.h" -@@ -788,6 +789,7 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -505,27 +506,198 @@ init_array_element (struct value *array, struct value *element, + } + + static struct value * +-value_f90_subarray (struct value *array, +- struct expression *exp, int *pos, enum noside noside) ++value_f90_subarray (struct value *array, struct expression *exp, int *pos, ++ int nargs, enum noside noside) + { +- int pc = (*pos) + 1; +- LONGEST low_bound, high_bound; +- struct type *range = check_typedef (TYPE_INDEX_TYPE (value_type (array))); +- enum f90_range_type range_type = longest_to_int (exp->elts[pc].longconst); +- +- *pos += 3; +- +- if (range_type == LOW_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT) +- low_bound = TYPE_LOW_BOUND (range); ++ /* Type to use for the newly allocated value ARRAY. */ ++ struct type *new_array_type; ++ ++ /* Type being iterated for each dimension. */ ++ struct type *type; ++ ++ /* Pointer in the last holder to the type of current dimension. */ ++ struct type **typep = &new_array_type; ++ ++ struct subscript_index ++ { ++ enum { SUBSCRIPT_RANGE, SUBSCRIPT_NUMBER } kind; ++ union ++ { ++ struct subscript_range ++ { ++ enum f90_range_type f90_range_type; ++ LONGEST low_bound, high_bound; ++ } ++ range; ++ LONGEST number; ++ }; ++ } ++ *subscript_array; ++ int i; ++ struct cleanup *old_chain; ++ CORE_ADDR value_byte_address, value_byte_offset = 0; ++ htab_t copied_types; ++ struct value *saved_array; ++ ++ old_chain = make_cleanup (null_cleanup, 0); ++ object_address_set (value_raw_address (array)); ++ ++ if (value_optimized_out (array) ++ || (VALUE_LVAL (array) != not_lval ++ && VALUE_LVAL (array) != lval_memory ++ && VALUE_LVAL (array) != lval_internalvar_component ++ && VALUE_LVAL (array) != lval_internalvar)) ++ error (_("value being subranged must be in memory")); ++ type = check_typedef (value_type (array)); ++ f_object_address_data_valid_or_error (type); ++ ++ copied_types = create_copied_types_hash (NULL); ++ type = copy_type_recursive (type, copied_types); ++ htab_delete (copied_types); ++ ++ if (nargs != calc_f77_array_dims (type)) ++ error (_("Wrong number of subscripts")); ++ ++ if (TYPE_DATA_LOCATION_IS_ADDR (type)) ++ { ++ value_byte_address = (TYPE_DATA_LOCATION_ADDR (type) ++ + value_offset (array)); ++ TYPE_DATA_LOCATION_IS_ADDR (type) = 0; ++ } + else +- low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); ++ value_byte_address = value_address (array); ++ ++ new_array_type = type; ++ ++ subscript_array = alloca (sizeof (*subscript_array) * nargs); ++ ++ gdb_assert (nargs > 0); ++ ++ /* Now that we know we have a legal array subscript expression ++ let us actually find out where this element exists in the array. */ ++ ++ /* Take array indices left to right. */ ++ for (i = 0; i < nargs; i++) ++ { ++ struct subscript_index *index = &subscript_array[i]; ++ ++ if (exp->elts[*pos].opcode == OP_F90_RANGE) ++ { ++ int pc = (*pos) + 1; ++ struct subscript_range *range; ++ ++ index->kind = SUBSCRIPT_RANGE; ++ range = &index->range; ++ ++ *pos += 3; ++ range->f90_range_type = longest_to_int (exp->elts[pc].longconst); ++ ++ if (range->f90_range_type == HIGH_BOUND_DEFAULT ++ || range->f90_range_type == NONE_BOUND_DEFAULT) ++ range->low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, ++ pos, noside)); ++ ++ if (range->f90_range_type == LOW_BOUND_DEFAULT ++ || range->f90_range_type == NONE_BOUND_DEFAULT) ++ range->high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, ++ pos, noside)); ++ } ++ else ++ { ++ struct value *val; ++ ++ index->kind = SUBSCRIPT_NUMBER; + +- if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT) +- high_bound = TYPE_HIGH_BOUND (range); ++ /* Evaluate each subscript; it must be a legal integer in F77. */ ++ val = evaluate_subexp_with_coercion (exp, pos, noside); ++ index->number = value_as_long (val); ++ } ++ } ++ ++ /* Internal type of array is arranged right to left. */ ++ for (i = nargs - 1; i >= 0; i--) ++ { ++ struct subscript_index *index = &subscript_array[i]; ++ struct type *range_type = TYPE_INDEX_TYPE (type); ++ ++ switch (index->kind) ++ { ++ case SUBSCRIPT_RANGE: ++ { ++ struct subscript_range *range = &index->range; ++ CORE_ADDR byte_offset; ++ ++ if (range->f90_range_type == LOW_BOUND_DEFAULT ++ || range->f90_range_type == BOTH_BOUND_DEFAULT) ++ range->low_bound = TYPE_LOW_BOUND (range_type); ++ ++ if (range->f90_range_type == HIGH_BOUND_DEFAULT ++ || range->f90_range_type == BOTH_BOUND_DEFAULT) ++ range->high_bound = TYPE_HIGH_BOUND (range_type); ++ ++ if (range->low_bound < TYPE_LOW_BOUND (range_type) ++ || (!TYPE_HIGH_BOUND_UNDEFINED (range_type) ++ && range->high_bound > TYPE_HIGH_BOUND (range_type))) ++ error (_("slice out of range")); ++ ++ byte_offset = ((range->low_bound - TYPE_LOW_BOUND (range_type)) ++ * TYPE_ARRAY_BYTE_STRIDE_VALUE (type)); ++ TYPE_LOW_BOUND (range_type) = range->low_bound; ++ TYPE_HIGH_BOUND (range_type) = range->high_bound; ++ if (range->f90_range_type == LOW_BOUND_DEFAULT ++ || range->f90_range_type == NONE_BOUND_DEFAULT) ++ TYPE_HIGH_BOUND_UNDEFINED (range_type) = 0; ++ ++ typep = &TYPE_TARGET_TYPE (type); ++ value_byte_offset += byte_offset; ++ type = TYPE_TARGET_TYPE (type); ++ } ++ break; ++ ++ case SUBSCRIPT_NUMBER: ++ { ++ CORE_ADDR byte_offset; ++ ++ if (index->number < TYPE_LOW_BOUND (range_type) ++ || (!TYPE_HIGH_BOUND_UNDEFINED (range_type) ++ && index->number > TYPE_HIGH_BOUND (range_type))) ++ error (_("no such vector element")); ++ ++ byte_offset = ((index->number - TYPE_LOW_BOUND (range_type)) ++ * TYPE_ARRAY_BYTE_STRIDE_VALUE (type)); ++ ++ type = TYPE_TARGET_TYPE (type); ++ *typep = type; ++ value_byte_offset += byte_offset; ++ } ++ break; ++ } ++ } ++ ++ check_typedef (new_array_type); ++ saved_array = array; ++ array = allocate_value_lazy (new_array_type); ++ VALUE_LVAL (array) = VALUE_LVAL (saved_array); ++ if (VALUE_LVAL (saved_array) == lval_internalvar_component) ++ VALUE_LVAL (array) = lval_internalvar; + else +- high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); ++ VALUE_LVAL (array) = VALUE_LVAL (saved_array); ++ VALUE_FRAME_ID (array) = VALUE_FRAME_ID (saved_array); ++ if (VALUE_LVAL (array) != lval_internalvar) ++ set_value_address (array, value_byte_address + value_byte_offset); ++ ++ if (!value_lazy (saved_array)) ++ { ++ allocate_value_contents (array); ++ set_value_lazy (array, 0); + +- return value_slice (array, low_bound, high_bound - low_bound + 1); ++ memcpy (value_contents_writeable (array), ++ value_contents (saved_array) + value_byte_offset, ++ TYPE_LENGTH (new_array_type)); ++ } ++ ++ do_cleanups (old_chain); ++ return array; + } + + +@@ -806,6 +978,7 @@ evaluate_subexp_standard (struct type *expect_type, int save_pos1; struct symbol *function = NULL; char *function_name = NULL; @@ -5304,7 +2911,7 @@ index ff17c34..7b9e871 100644 pc = (*pos)++; op = exp->elts[pc].opcode; -@@ -1772,6 +1774,8 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1849,6 +2022,8 @@ evaluate_subexp_standard (struct type *expect_type, return value_zero (builtin_type (exp->gdbarch)->builtin_int, not_lval); } @@ -5313,7 +2920,7 @@ index ff17c34..7b9e871 100644 else if (TYPE_TARGET_TYPE (ftype)) return allocate_value (TYPE_TARGET_TYPE (ftype)); else -@@ -1798,6 +1802,8 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1877,6 +2052,8 @@ evaluate_subexp_standard (struct type *expect_type, /* First determine the type code we are dealing with. */ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); @@ -5322,7 +2929,7 @@ index ff17c34..7b9e871 100644 type = check_typedef (value_type (arg1)); code = TYPE_CODE (type); -@@ -1818,6 +1824,7 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -1897,23 +2074,13 @@ evaluate_subexp_standard (struct type *expect_type, code = TYPE_CODE (type); } } @@ -5330,76 +2937,75 @@ index ff17c34..7b9e871 100644 switch (code) { -@@ -2254,13 +2261,19 @@ evaluate_subexp_standard (struct type *expect_type, - { - int subscript_array[MAX_FORTRAN_DIMS]; - int array_size_array[MAX_FORTRAN_DIMS]; -+ int byte_stride_array[MAX_FORTRAN_DIMS]; - int ndimensions = 1, i; - struct type *tmp_type; - int offset_item; /* The array offset where the item lives */ -+ CORE_ADDR offset_byte; /* byte_stride based offset */ -+ unsigned element_size; + case TYPE_CODE_ARRAY: +- if (exp->elts[*pos].opcode == OP_F90_RANGE) +- return value_f90_subarray (arg1, exp, pos, noside); +- else +- goto multi_f77_subscript; +- + case TYPE_CODE_STRING: +- if (exp->elts[*pos].opcode == OP_F90_RANGE) +- return value_f90_subarray (arg1, exp, pos, noside); +- else +- { +- arg2 = evaluate_subexp_with_coercion (exp, pos, noside); +- return value_subscript (arg1, value_as_long (arg2)); +- } ++ return value_f90_subarray (arg1, exp, pos, nargs, noside); - if (nargs > MAX_FORTRAN_DIMS) - error (_("Too many subscripts for F77 (%d Max)"), MAX_FORTRAN_DIMS); - -+ old_chain = make_cleanup (null_cleanup, 0); -+ object_address_set (value_raw_address (arg1)); -+ - tmp_type = check_typedef (value_type (arg1)); - ndimensions = calc_f77_array_dims (type); - -@@ -2290,6 +2303,9 @@ evaluate_subexp_standard (struct type *expect_type, - upper = f77_get_upperbound (tmp_type); - lower = f77_get_lowerbound (tmp_type); - -+ byte_stride_array[nargs - i - 1] = -+ TYPE_ARRAY_BYTE_STRIDE_VALUE (tmp_type); -+ - array_size_array[nargs - i - 1] = upper - lower + 1; - - /* Zero-normalize subscripts so that offsetting will work. */ -@@ -2308,13 +2324,25 @@ evaluate_subexp_standard (struct type *expect_type, - tmp_type = check_typedef (TYPE_TARGET_TYPE (tmp_type)); - } - -+ /* Kept for the f77_get_upperbound / f77_get_lowerbound calls above. */ -+ do_cleanups (old_chain); -+ - /* Now let us calculate the offset for this item */ - -- offset_item = subscript_array[ndimensions - 1]; -+ offset_item = 0; -+ offset_byte = 0; -+ -+ for (i = ndimensions - 1; i >= 0; --i) -+ { -+ offset_item *= array_size_array[i]; -+ if (byte_stride_array[i] == 0) -+ offset_item += subscript_array[i]; -+ else -+ offset_byte += subscript_array[i] * byte_stride_array[i]; -+ } - -- for (i = ndimensions - 1; i > 0; --i) -- offset_item = -- array_size_array[i - 1] * offset_item + subscript_array[i - 1]; -+ element_size = TYPE_LENGTH (TYPE_TARGET_TYPE (tmp_type)); -+ offset_byte += offset_item * element_size; - - /* Let us now play a dirty trick: we will take arg1 - which is a value node pointing to the topmost level -@@ -2324,7 +2352,7 @@ evaluate_subexp_standard (struct type *expect_type, - returns the correct type value */ - - deprecated_set_value_type (arg1, tmp_type); -- return value_subscripted_rvalue (arg1, offset_item, 0); -+ return value_subscripted_rvalue (arg1, offset_byte); - } + case TYPE_CODE_PTR: + case TYPE_CODE_FUNC: +@@ -2352,49 +2519,6 @@ evaluate_subexp_standard (struct type *expect_type, + } + return (arg1); +- multi_f77_subscript: +- { +- LONGEST subscript_array[MAX_FORTRAN_DIMS]; +- int ndimensions = 1, i; +- struct value *array = arg1; +- +- if (nargs > MAX_FORTRAN_DIMS) +- error (_("Too many subscripts for F77 (%d Max)"), MAX_FORTRAN_DIMS); +- +- ndimensions = calc_f77_array_dims (type); +- +- if (nargs != ndimensions) +- error (_("Wrong number of subscripts")); +- +- gdb_assert (nargs > 0); +- +- /* Now that we know we have a legal array subscript expression +- let us actually find out where this element exists in the array. */ +- +- /* Take array indices left to right. */ +- for (i = 0; i < nargs; i++) +- { +- /* Evaluate each subscript; it must be a legal integer in F77. */ +- arg2 = evaluate_subexp_with_coercion (exp, pos, noside); +- +- /* Fill in the subscript array. */ +- +- subscript_array[i] = value_as_long (arg2); +- } +- +- /* Internal type of array is arranged right to left. */ +- for (i = nargs; i > 0; i--) +- { +- struct type *array_type = check_typedef (value_type (array)); +- LONGEST index = subscript_array[i - 1]; +- +- lower = f77_get_lowerbound (array_type); +- array = value_subscripted_rvalue (array, index, lower); +- } +- +- return array; +- } +- case BINOP_LOGICAL_AND: -@@ -2558,14 +2586,22 @@ evaluate_subexp_standard (struct type *expect_type, + arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); + if (noside == EVAL_SKIP) +@@ -2626,15 +2750,23 @@ evaluate_subexp_standard (struct type *expect_type, if (expect_type && TYPE_CODE (expect_type) == TYPE_CODE_PTR) expect_type = TYPE_TARGET_TYPE (check_typedef (expect_type)); arg1 = evaluate_subexp (expect_type, exp, pos, noside); @@ -5408,7 +3014,8 @@ index ff17c34..7b9e871 100644 type = check_typedef (value_type (arg1)); if (TYPE_CODE (type) == TYPE_CODE_METHODPTR || TYPE_CODE (type) == TYPE_CODE_MEMBERPTR) - error (_("Attempt to dereference pointer to member without an object")); + error (_("Attempt to dereference pointer " + "to member without an object")); if (noside == EVAL_SKIP) - goto nosideret; + { @@ -5424,7 +3031,7 @@ index ff17c34..7b9e871 100644 else if (noside == EVAL_AVOID_SIDE_EFFECTS) { type = check_typedef (value_type (arg1)); -@@ -2574,12 +2610,18 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2643,12 +2775,18 @@ evaluate_subexp_standard (struct type *expect_type, /* In C you can dereference an array to get the 1st elt. */ || TYPE_CODE (type) == TYPE_CODE_ARRAY ) @@ -5448,7 +3055,7 @@ index ff17c34..7b9e871 100644 else error (_("Attempt to take contents of a non-pointer value.")); } -@@ -2589,9 +2631,14 @@ evaluate_subexp_standard (struct type *expect_type, +@@ -2658,9 +2796,14 @@ evaluate_subexp_standard (struct type *expect_type, do. "long long" variables are rare enough that BUILTIN_TYPE_LONGEST would seem to be a mistake. */ if (TYPE_CODE (type) == TYPE_CODE_INT) @@ -5466,7 +3073,7 @@ index ff17c34..7b9e871 100644 case UNOP_ADDR: /* C++: check for and handle pointer to members. */ -@@ -2933,7 +2980,7 @@ evaluate_subexp_with_coercion (struct expression *exp, +@@ -3006,7 +3149,7 @@ evaluate_subexp_with_coercion (struct expression *exp, { enum exp_opcode op; int pc; @@ -5475,7 +3082,7 @@ index ff17c34..7b9e871 100644 struct symbol *var; struct type *type; -@@ -2944,12 +2991,17 @@ evaluate_subexp_with_coercion (struct expression *exp, +@@ -3017,13 +3160,18 @@ evaluate_subexp_with_coercion (struct expression *exp, { case OP_VAR_VALUE: var = exp->elts[pc + 2].symbol; @@ -5485,6 +3092,7 @@ index ff17c34..7b9e871 100644 + val = address_of_variable (var, exp->elts[pc + 1].block); type = check_typedef (SYMBOL_TYPE (var)); if (TYPE_CODE (type) == TYPE_CODE_ARRAY + && !TYPE_VECTOR (type) && CAST_IS_CONVERSION (exp->language_defn)) { (*pos) += 4; @@ -5494,7 +3102,7 @@ index ff17c34..7b9e871 100644 return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)), val); } -@@ -3001,9 +3053,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) +@@ -3075,9 +3223,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) case OP_VAR_VALUE: (*pos) += 4; @@ -5511,8 +3119,59 @@ index ff17c34..7b9e871 100644 default: val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); +@@ -3108,18 +3260,25 @@ parse_and_eval_type (char *p, int length) + int + calc_f77_array_dims (struct type *array_type) + { +- int ndimen = 1; +- struct type *tmp_type; ++ switch (TYPE_CODE (array_type)) ++ { ++ case TYPE_CODE_STRING: ++ return 1; + +- if ((TYPE_CODE (array_type) != TYPE_CODE_ARRAY)) +- error (_("Can't get dimensions for a non-array type")); ++ case TYPE_CODE_ARRAY: ++ { ++ int ndimen = 1; + +- tmp_type = array_type; ++ while ((array_type = TYPE_TARGET_TYPE (array_type))) ++ { ++ if (TYPE_CODE (array_type) == TYPE_CODE_ARRAY) ++ ++ndimen; ++ } ++ return ndimen; ++ } + +- while ((tmp_type = TYPE_TARGET_TYPE (tmp_type))) +- { +- if (TYPE_CODE (tmp_type) == TYPE_CODE_ARRAY) +- ++ndimen; ++ default: ++ error (_("Can't get dimensions for a non-array/non-string type")); + } +- return ndimen; ++ + } +diff --git a/gdb/f-exp.y b/gdb/f-exp.y +index 02745c8..3a730e7 100644 +--- a/gdb/f-exp.y ++++ b/gdb/f-exp.y +@@ -293,7 +293,9 @@ arglist : subrange + { arglist_len = 1; } + ; + +-arglist : arglist ',' exp %prec ABOVE_COMMA ++arglist : arglist ',' exp %prec ABOVE_COMMA ++ { arglist_len++; } ++ | arglist ',' subrange %prec ABOVE_COMMA + { arglist_len++; } + ; + diff --git a/gdb/f-lang.h b/gdb/f-lang.h -index f5bb82d..29cf5ba 100644 +index 8043577..94a5f31 100644 --- a/gdb/f-lang.h +++ b/gdb/f-lang.h @@ -28,6 +28,10 @@ extern void f_error (char *); /* Defined in f-exp.y */ @@ -5527,7 +3186,7 @@ index f5bb82d..29cf5ba 100644 struct ui_file *, int, const struct value *, diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c -index d35a255..dec81d5 100644 +index ad988d2..985fef6 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -32,7 +32,7 @@ @@ -5595,18 +3254,18 @@ index d35a255..dec81d5 100644 { case TYPE_CODE_ARRAY: diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c -index 85f698d..2f72b97 100644 +index a15e777..4d133bc 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -54,15 +54,17 @@ int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; /* The following macro gives us the size of the nth dimension, Where - n is 1 based. */ + n is 1 based. */ -#define F77_DIM_SIZE(n) (f77_array_offset_tbl[n][1]) +#define F77_DIM_COUNT(n) (f77_array_offset_tbl[n][1]) --/* The following gives us the offset for row n where n is 1-based. */ -+/* The following gives us the element size for row n where n is 1-based. */ +-/* The following gives us the offset for row n where n is 1-based. */ ++/* The following gives us the element size for row n where n is 1-based. */ -#define F77_DIM_OFFSET(n) (f77_array_offset_tbl[n][0]) +#define F77_DIM_BYTE_STRIDE(n) (f77_array_offset_tbl[n][0]) @@ -5642,7 +3301,7 @@ index 85f698d..2f72b97 100644 } return TYPE_ARRAY_UPPER_BOUND_VALUE (type); -@@ -134,24 +139,29 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) +@@ -135,24 +140,29 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) upper = f77_get_upperbound (tmp_type); lower = f77_get_lowerbound (tmp_type); @@ -5660,8 +3319,8 @@ index 85f698d..2f72b97 100644 + /* Now we multiply eltlen by all the BYTE_STRIDEs, so that later we can print out array elements correctly. Up till now we - know an offset to apply to get the item but we also -+ know an eltlen to apply to get the item but we also - have to know how much to add to get to the next item */ ++ know an eltlen to apply to get the item but we also + have to know how much to add to get to the next item. */ ndimen--; eltlen = TYPE_LENGTH (tmp_type); @@ -5678,19 +3337,21 @@ index 85f698d..2f72b97 100644 } } -@@ -172,34 +182,34 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, +@@ -174,37 +184,35 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, if (nss != ndimensions) { -- for (i = 0; (i < F77_DIM_SIZE (nss) && (*elts) < options->print_max); i++) +- for (i = 0; +- (i < F77_DIM_SIZE (nss) && (*elts) < options->print_max); +- i++) + for (i = 0; (i < F77_DIM_COUNT (nss) && (*elts) < options->print_max); i++) { fprintf_filtered (stream, "( "); f77_print_array_1 (nss + 1, ndimensions, TYPE_TARGET_TYPE (type), -- valaddr + i * F77_DIM_OFFSET (nss), -- address + i * F77_DIM_OFFSET (nss), -+ valaddr + i * F77_DIM_BYTE_STRIDE (nss), -+ address + i * F77_DIM_BYTE_STRIDE (nss), + valaddr, +- embedded_offset + i * F77_DIM_OFFSET (nss), ++ embedded_offset + i * F77_DIM_BYTE_STRIDE (nss), + address, stream, recurse, val, options, elts); fprintf_filtered (stream, ") "); } @@ -5705,12 +3366,11 @@ index 85f698d..2f72b97 100644 i++, (*elts)++) { val_print (TYPE_TARGET_TYPE (type), -- valaddr + i * F77_DIM_OFFSET (ndimensions), -+ valaddr + i * F77_DIM_BYTE_STRIDE (ndimensions), - 0, -- address + i * F77_DIM_OFFSET (ndimensions), -+ address + i * F77_DIM_BYTE_STRIDE (ndimensions), - stream, recurse, val, options, current_language); + valaddr, +- embedded_offset + i * F77_DIM_OFFSET (ndimensions), ++ embedded_offset + i * F77_DIM_BYTE_STRIDE (ndimensions), + address, stream, recurse, + val, options, current_language); - if (i != (F77_DIM_SIZE (nss) - 1)) + if (i != (F77_DIM_COUNT (nss) - 1)) @@ -5722,7 +3382,7 @@ index 85f698d..2f72b97 100644 fprintf_filtered (stream, "..."); } } -@@ -256,6 +266,9 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, +@@ -263,6 +271,9 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR addr; int index; @@ -5732,173 +3392,8 @@ index 85f698d..2f72b97 100644 CHECK_TYPEDEF (type); switch (TYPE_CODE (type)) { -diff --git a/gdb/findcmd.c b/gdb/findcmd.c -index ac63a9e..e9ba45c 100644 ---- a/gdb/findcmd.c -+++ b/gdb/findcmd.c -@@ -45,6 +45,41 @@ put_bits (bfd_uint64_t data, char *buf, int bits, bfd_boolean big_p) - } - } - -+/* Allocates a buffer in *PATTERN_BUF, with a hard-coded initial size which -+ will be returned in *PATTERN_BUF_SIZE. *PATTERN_BUF_END points to the same -+ place as *PATTERN_BUF, indicating that the buffer is initially empty. */ -+ -+void -+allocate_pattern_buffer (char **pattern_buf, char **pattern_buf_end, -+ ULONGEST *pattern_buf_size) -+{ -+#define INITIAL_PATTERN_BUF_SIZE 100 -+ *pattern_buf_size = INITIAL_PATTERN_BUF_SIZE; -+ *pattern_buf = xmalloc (*pattern_buf_size); -+ *pattern_buf_end = *pattern_buf; -+} -+ -+/* Grows *PATTERN_BUF by a factor of two if it's not large enough to hold -+ VAL_BYTES more bytes or a 64-bit value, whichever is larger. -+ *PATTERN_BUF_END is updated as necessary. */ -+ -+void -+increase_pattern_buffer (char **pattern_buf, char **pattern_buf_end, -+ ULONGEST *pattern_buf_size, int val_bytes) -+{ -+ /* Keep it simple and assume size == 'g' when watching for when we -+ need to grow the pattern buf. */ -+ if ((*pattern_buf_end - *pattern_buf + max (val_bytes, sizeof (int64_t))) -+ > *pattern_buf_size) -+ { -+ size_t current_offset = *pattern_buf_end - *pattern_buf; -+ -+ *pattern_buf_size *= 2; -+ *pattern_buf = xrealloc (*pattern_buf, *pattern_buf_size); -+ *pattern_buf_end = *pattern_buf + current_offset; -+ } -+} -+ - /* Subroutine of find_command to simplify it. - Parse the arguments of the "find" command. */ - -@@ -61,8 +96,7 @@ parse_find_args (char *args, ULONGEST *max_countp, - char *pattern_buf; - /* Current size of search pattern buffer. - We realloc space as needed. */ --#define INITIAL_PATTERN_BUF_SIZE 100 -- ULONGEST pattern_buf_size = INITIAL_PATTERN_BUF_SIZE; -+ ULONGEST pattern_buf_size; - /* Pointer to one past the last in-use part of pattern_buf. */ - char *pattern_buf_end; - ULONGEST pattern_len; -@@ -75,8 +109,7 @@ parse_find_args (char *args, ULONGEST *max_countp, - if (args == NULL) - error (_("Missing search parameters.")); - -- pattern_buf = xmalloc (pattern_buf_size); -- pattern_buf_end = pattern_buf; -+ allocate_pattern_buffer (&pattern_buf, &pattern_buf_end, &pattern_buf_size); - old_cleanups = make_cleanup (free_current_contents, &pattern_buf); - - /* Get search granularity and/or max count if specified. -@@ -175,17 +208,9 @@ parse_find_args (char *args, ULONGEST *max_countp, - v = parse_to_comma_and_eval (&s); - val_bytes = TYPE_LENGTH (value_type (v)); - -- /* Keep it simple and assume size == 'g' when watching for when we -- need to grow the pattern buf. */ -- if ((pattern_buf_end - pattern_buf + max (val_bytes, sizeof (int64_t))) -- > pattern_buf_size) -- { -- size_t current_offset = pattern_buf_end - pattern_buf; -+ increase_pattern_buffer (&pattern_buf, &pattern_buf_end, -+ &pattern_buf_size, val_bytes); - -- pattern_buf_size *= 2; -- pattern_buf = xrealloc (pattern_buf, pattern_buf_size); -- pattern_buf_end = pattern_buf + current_offset; -- } - - if (size != '\0') - { -@@ -240,6 +265,45 @@ parse_find_args (char *args, ULONGEST *max_countp, - discard_cleanups (old_cleanups); - } - -+/* Drives target_search_memory to sweep through the specified search space, -+ possibly in several iterations (with one call to this function for each -+ iteration). *START_ADDR is the address where the search starts, and is -+ updated to the next starting address to continue the search. -+ *SEARCH_SPACE_LEN is the amount of bytes which will be searched, and is -+ updated for the next iteration. PATTERN_BUF holds the pattern to be searched -+ for, PATTERN_LEN is the size of the pattern in bytes. If a match is found, -+ it's address is put in *FOUND_ADDR. -+ -+ Returns 1 if found, 0 if not found, and -1 if there was an error requiring -+ halting of the search (e.g. memory read error). */ -+ -+int -+search_memory (CORE_ADDR *start_addr, ULONGEST *search_space_len, -+ const char *pattern_buf, ULONGEST pattern_len, -+ CORE_ADDR *found_addr) -+{ -+ /* Offset from start of this iteration to the next iteration. */ -+ ULONGEST next_iter_incr; -+ int found; -+ -+ found = target_search_memory (*start_addr, *search_space_len, -+ pattern_buf, pattern_len, found_addr); -+ if (found <= 0) -+ return found; -+ -+ /* Begin next iteration at one byte past this match. */ -+ next_iter_incr = (*found_addr - *start_addr) + 1; -+ -+ /* For robustness, we don't let search_space_len go -ve here. */ -+ if (*search_space_len >= next_iter_incr) -+ *search_space_len -= next_iter_incr; -+ else -+ *search_space_len = 0; -+ *start_addr += next_iter_incr; -+ -+ return found; -+} -+ - static void - find_command (char *args, int from_tty) - { -@@ -270,12 +334,11 @@ find_command (char *args, int from_tty) - while (search_space_len >= pattern_len - && found_count < max_count) - { -- /* Offset from start of this iteration to the next iteration. */ -- ULONGEST next_iter_incr; - CORE_ADDR found_addr; -- int found = target_search_memory (start_addr, search_space_len, -- pattern_buf, pattern_len, &found_addr); -+ int found; - -+ found = search_memory (&start_addr, &search_space_len, pattern_buf, -+ pattern_len, &found_addr); - if (found <= 0) - break; - -@@ -283,16 +346,6 @@ find_command (char *args, int from_tty) - printf_filtered ("\n"); - ++found_count; - last_found_addr = found_addr; -- -- /* Begin next iteration at one byte past this match. */ -- next_iter_incr = (found_addr - start_addr) + 1; -- -- /* For robustness, we don't let search_space_len go -ve here. */ -- if (search_space_len >= next_iter_incr) -- search_space_len -= next_iter_incr; -- else -- search_space_len = 0; -- start_addr += next_iter_incr; - } - - /* Record and print the results. */ diff --git a/gdb/findvar.c b/gdb/findvar.c -index e0ca12c..de6311a 100644 +index 6463342..951c2fe 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -35,6 +35,7 @@ @@ -5909,11 +3404,13 @@ index e0ca12c..de6311a 100644 /* Basic byte-swapping routines. All 'extract' functions return a host-format integer from a target-format integer at ADDR which is -@@ -401,27 +402,16 @@ symbol_read_needs_frame (struct symbol *sym) +@@ -399,8 +400,11 @@ symbol_read_needs_frame (struct symbol *sym) + /* Given a struct symbol for a variable, and a stack frame id, read the value of the variable - and return a (pointer to a) struct value containing the value. +- and return a (pointer to a) struct value containing the value. - If the variable cannot be found, return a zero pointer. */ ++ and return a (pointer to a) struct value containing the value. + If the variable cannot be found, return a zero pointer. + We have to first find the address of the variable before allocating struct + value to return as its size may depend on DW_OP_PUSH_OBJECT_ADDRESS possibly @@ -5921,171 +3418,106 @@ index e0ca12c..de6311a 100644 struct value * read_var_value (struct symbol *var, struct frame_info *frame) - { -- struct value *v; +@@ -408,16 +412,6 @@ read_var_value (struct symbol *var, struct frame_info *frame) + struct value *v; struct type *type = SYMBOL_TYPE (var); CORE_ADDR addr; - int len; - -- if (SYMBOL_CLASS (var) == LOC_COMPUTED -- || SYMBOL_CLASS (var) == LOC_REGISTER) -- /* These cases do not use V. */ -- v = NULL; -- else -- { -- v = allocate_value (type); -- VALUE_LVAL (v) = lval_memory; /* The most likely possibility. */ -- } +- /* Call check_typedef on our type to make sure that, if TYPE is +- a TYPE_CODE_TYPEDEF, its length is set to the length of the target type +- instead of zero. However, we do not replace the typedef type by the +- target type, because we want to keep the typedef in order to be able to +- set the returned value type description correctly. */ +- check_typedef (type); - - len = TYPE_LENGTH (type); if (symbol_read_needs_frame (var)) gdb_assert (frame); -@@ -429,33 +419,43 @@ read_var_value (struct symbol *var, struct frame_info *frame) - switch (SYMBOL_CLASS (var)) - { +@@ -427,7 +421,7 @@ read_var_value (struct symbol *var, struct frame_info *frame) case LOC_CONST: -- /* Put the constant back in target format. */ + /* Put the constant back in target format. */ + v = allocate_value (type); - store_signed_integer (value_contents_raw (v), len, -- gdbarch_byte_order (get_type_arch (type)), -- (LONGEST) SYMBOL_VALUE (var)); -- VALUE_LVAL (v) = not_lval; -- return v; -+ { -+ /* Put the constant back in target format. */ -+ struct value *v = allocate_value (type); -+ VALUE_LVAL (v) = not_lval; -+ store_signed_integer (value_contents_raw (v), TYPE_LENGTH (type), -+ gdbarch_byte_order (get_type_arch (type)), -+ (LONGEST) SYMBOL_VALUE (var)); -+ return v; -+ } - - case LOC_LABEL: -- /* Put the constant back in target format. */ -- if (overlay_debugging) -- { -- CORE_ADDR addr -- = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var), -- SYMBOL_OBJ_SECTION (var)); -+ { -+ /* Put the constant back in target format. */ -+ struct value *v = allocate_value (type); -+ VALUE_LVAL (v) = not_lval; -+ if (overlay_debugging) -+ { -+ CORE_ADDR addr -+ = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var), -+ SYMBOL_OBJ_SECTION (var)); - -- store_typed_address (value_contents_raw (v), type, addr); -- } -- else -- store_typed_address (value_contents_raw (v), type, -- SYMBOL_VALUE_ADDRESS (var)); -- VALUE_LVAL (v) = not_lval; -- return v; -+ store_typed_address (value_contents_raw (v), type, addr); -+ } -+ else -+ store_typed_address (value_contents_raw (v), type, -+ SYMBOL_VALUE_ADDRESS (var)); -+ return v; -+ } ++ store_signed_integer (value_contents_raw (v), TYPE_LENGTH (type), + gdbarch_byte_order (get_type_arch (type)), + (LONGEST) SYMBOL_VALUE (var)); + VALUE_LVAL (v) = not_lval; +@@ -452,12 +446,12 @@ read_var_value (struct symbol *var, struct frame_info *frame) case LOC_CONST_BYTES: + v = allocate_value (type); - memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var), len); -- VALUE_LVAL (v) = not_lval; -- return v; -+ { -+ struct value *v = allocate_value (type); -+ VALUE_LVAL (v) = not_lval; -+ memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var), -+ TYPE_LENGTH (type)); -+ return v; -+ } ++ memcpy (value_contents_raw (v), SYMBOL_VALUE_BYTES (var), ++ TYPE_LENGTH (type)); + VALUE_LVAL (v) = not_lval; + return v; case LOC_STATIC: +- v = allocate_value_lazy (type); if (overlay_debugging) -@@ -496,12 +496,23 @@ read_var_value (struct symbol *var, struct frame_info *frame) + addr = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var), + SYMBOL_OBJ_SECTION (var)); +@@ -470,7 +464,6 @@ read_var_value (struct symbol *var, struct frame_info *frame) + if (!addr) + return 0; + addr += SYMBOL_VALUE (var); +- v = allocate_value_lazy (type); + break; + + case LOC_REF_ARG: +@@ -484,14 +477,12 @@ read_var_value (struct symbol *var, struct frame_info *frame) + argref += SYMBOL_VALUE (var); + ref = value_at (lookup_pointer_type (type), argref); + addr = value_as_address (ref); +- v = allocate_value_lazy (type); + break; + } + + case LOC_LOCAL: + addr = get_frame_locals_address (frame); + addr += SYMBOL_VALUE (var); +- v = allocate_value_lazy (type); + break; + + case LOC_TYPEDEF: +@@ -499,7 +490,6 @@ read_var_value (struct symbol *var, struct frame_info *frame) break; case LOC_BLOCK: -- if (overlay_debugging) -- set_value_address (v, symbol_overlayed_address -- (BLOCK_START (SYMBOL_BLOCK_VALUE (var)), SYMBOL_OBJ_SECTION (var))); -- else -- set_value_address (v, BLOCK_START (SYMBOL_BLOCK_VALUE (var))); -- return v; -+ { -+ CORE_ADDR addr; -+ struct value *v; -+ -+ if (overlay_debugging) -+ addr = symbol_overlayed_address -+ (BLOCK_START (SYMBOL_BLOCK_VALUE (var)), SYMBOL_OBJ_SECTION (var)); -+ else -+ addr = BLOCK_START (SYMBOL_BLOCK_VALUE (var)); -+ /* ADDR is set here for ALLOCATE_VALUE's CHECK_TYPEDEF for -+ DW_OP_push_object_address. */ -+ object_address_set (addr); -+ v = allocate_value (type); -+ VALUE_LVAL (v) = lval_memory; -+ set_value_address (v, addr); -+ return v; -+ } - - case LOC_REGISTER: - case LOC_REGPARM_ADDR: -@@ -520,7 +531,6 @@ read_var_value (struct symbol *var, struct frame_info *frame) +- v = allocate_value_lazy (type); + if (overlay_debugging) + addr = symbol_overlayed_address + (BLOCK_START (SYMBOL_BLOCK_VALUE (var)), SYMBOL_OBJ_SECTION (var)); +@@ -524,7 +514,6 @@ read_var_value (struct symbol *var, struct frame_info *frame) error (_("Value of register variable not available.")); addr = value_as_address (regval); -- VALUE_LVAL (v) = lval_memory; +- v = allocate_value_lazy (type); } else { -@@ -563,18 +573,33 @@ read_var_value (struct symbol *var, struct frame_info *frame) +@@ -563,7 +552,6 @@ read_var_value (struct symbol *var, struct frame_info *frame) + if (obj_section + && (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0) + addr = target_translate_tls_address (obj_section->objfile, addr); +- v = allocate_value_lazy (type); + } break; - case LOC_OPTIMIZED_OUT: -- VALUE_LVAL (v) = not_lval; -- set_value_optimized_out (v, 1); -- return v; -+ { -+ struct value *v = allocate_value (type); -+ -+ VALUE_LVAL (v) = not_lval; -+ set_value_optimized_out (v, 1); -+ return v; -+ } - - default: - error (_("Cannot look up value of a botched symbol.")); +@@ -578,6 +566,10 @@ read_var_value (struct symbol *var, struct frame_info *frame) break; } -- set_value_address (v, addr); -- set_value_lazy (v, 1); -- return v; -+ { -+ struct value *v; -+ -+ /* ADDR is set here for ALLOCATE_VALUE's CHECK_TYPEDEF for -+ DW_OP_PUSH_OBJECT_ADDRESS. */ -+ object_address_set (addr); -+ v = allocate_value (type); -+ VALUE_LVAL (v) = lval_memory; -+ set_value_address (v, addr); -+ -+ set_value_lazy (v, 1); -+ -+ return v; -+ } - } - - /* Install default attributes for register values. */ -@@ -611,10 +636,11 @@ struct value * ++ /* ADDR is set here for ALLOCATE_VALUE's CHECK_TYPEDEF for ++ DW_OP_PUSH_OBJECT_ADDRESS. */ ++ object_address_set (addr); ++ v = allocate_value_lazy (type); + VALUE_LVAL (v) = lval_memory; + set_value_address (v, addr); + return v; +@@ -617,10 +609,11 @@ struct value * value_from_register (struct type *type, int regnum, struct frame_info *frame) { struct gdbarch *gdbarch = get_frame_arch (frame); @@ -6099,7 +3531,7 @@ index e0ca12c..de6311a 100644 { /* The ISA/ABI need to something weird when obtaining the specified value from this register. It might need to -@@ -628,7 +654,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) +@@ -634,7 +627,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) VALUE_FRAME_ID (v) = get_frame_id (frame); VALUE_REGNUM (v) = regnum; gdbarch_register_to_value (gdbarch, @@ -6108,21 +3540,6 @@ index e0ca12c..de6311a 100644 } else { -diff --git a/gdb/gdbcmd.h b/gdb/gdbcmd.h -index 78151dd..da11686 100644 ---- a/gdb/gdbcmd.h -+++ b/gdb/gdbcmd.h -@@ -124,6 +124,10 @@ extern struct cmd_list_element *setchecklist; - - extern struct cmd_list_element *showchecklist; - -+/* Chain containing all defined "save" subcommands. */ -+ -+extern struct cmd_list_element *save_cmdlist; -+ - extern void execute_command (char *, int); - extern char *execute_command_to_string (char *p, int from_tty); - diff --git a/gdb/gdbinit.in b/gdb/gdbinit.in index ffb7f53..a2e7e94 100644 --- a/gdb/gdbinit.in @@ -6143,43 +3560,8 @@ index ffb7f53..a2e7e94 100644 set complaints 1 b internal_error -diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h -index cd24eaf..9638368 100644 ---- a/gdb/gdbthread.h -+++ b/gdb/gdbthread.h -@@ -66,6 +66,9 @@ struct thread_info - /* Step-resume or longjmp-resume breakpoint. */ - struct breakpoint *step_resume_breakpoint; - -+ /* Exception-resume breakpoint. */ -+ struct breakpoint *exception_resume_breakpoint; -+ - /* Range to single step within. - - If this is nonzero, respond to a single-step signal by continuing -@@ -185,6 +188,10 @@ struct thread_info - /* True if this thread has been explicitly requested to stop. */ - int stop_requested; - -+ /* The initiating frame of a nexting operation, used for deciding -+ which exceptions to intercept. */ -+ struct frame_id initiating_frame; -+ - /* Private data used by the target vector implementation. */ - struct private_thread_info *private; - -@@ -221,6 +228,9 @@ extern void delete_thread_silent (ptid_t); - /* Delete a step_resume_breakpoint from the thread database. */ - extern void delete_step_resume_breakpoint (struct thread_info *); - -+/* Delete an exception_resume_breakpoint from the thread database. */ -+extern void delete_exception_resume_breakpoint (struct thread_info *); -+ - /* Translate the integer thread id (GDB's homegrown id, not the system's) - into a "pid" (which may be overloaded with extra thread information). */ - extern ptid_t thread_id_to_pid (int); diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c -index 443f6f7..d852a14 100644 +index 2cf1b4d..d145fd9 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -39,6 +39,9 @@ @@ -6191,10 +3573,13 @@ index 443f6f7..d852a14 100644 +#include "dwarf2loc.h" - /* Floatformat pairs. */ -@@ -123,6 +126,11 @@ static void print_arg_types (struct field *, int, int); + /* Initialize BADNESS constants. */ +@@ -144,7 +147,14 @@ static void print_bit_vector (B_TYPE *, int); + static void print_arg_types (struct field *, int, int); static void dump_fn_fieldlists (struct type *, int); static void print_cplus_stuff (struct type *, int); ++static LONGEST type_length_get (struct type *type, struct type *target_type, ++ int full_span); +/* The hash table holding all discardable `struct type *' references. */ +static htab_t type_discardable_table; @@ -6204,7 +3589,7 @@ index 443f6f7..d852a14 100644 /* Allocate a new OBJFILE-associated type structure and fill it with some defaults. Space for the type structure is allocated -@@ -153,6 +161,39 @@ alloc_type (struct objfile *objfile) +@@ -175,6 +185,39 @@ alloc_type (struct objfile *objfile) return type; } @@ -6244,7 +3629,7 @@ index 443f6f7..d852a14 100644 /* Allocate a new GDBARCH-associated type structure and fill it with some defaults. Space for the type structure is allocated on the heap. */ -@@ -278,7 +319,7 @@ make_pointer_type (struct type *type, struct type **typeptr) +@@ -300,7 +343,7 @@ make_pointer_type (struct type *type, struct type **typeptr) if (typeptr == 0 || *typeptr == 0) /* We'll need to allocate one. */ { @@ -6253,7 +3638,7 @@ index 443f6f7..d852a14 100644 if (typeptr) *typeptr = ntype; } -@@ -355,7 +396,7 @@ make_reference_type (struct type *type, struct type **typeptr) +@@ -377,7 +420,7 @@ make_reference_type (struct type *type, struct type **typeptr) if (typeptr == 0 || *typeptr == 0) /* We'll need to allocate one. */ { @@ -6262,7 +3647,7 @@ index 443f6f7..d852a14 100644 if (typeptr) *typeptr = ntype; } -@@ -726,6 +767,7 @@ create_range_type (struct type *result_type, struct type *index_type, +@@ -748,6 +791,7 @@ create_range_type (struct type *result_type, struct type *index_type, TYPE_ZALLOC (result_type, sizeof (struct range_bounds)); TYPE_LOW_BOUND (result_type) = low_bound; TYPE_HIGH_BOUND (result_type) = high_bound; @@ -6270,7 +3655,7 @@ index 443f6f7..d852a14 100644 if (low_bound >= 0) TYPE_UNSIGNED (result_type) = 1; -@@ -825,26 +867,45 @@ create_array_type (struct type *result_type, +@@ -891,26 +935,31 @@ create_array_type (struct type *result_type, TYPE_CODE (result_type) = TYPE_CODE_ARRAY; TYPE_TARGET_TYPE (result_type) = element_type; @@ -6291,34 +3676,20 @@ index 443f6f7..d852a14 100644 TYPE_INDEX_TYPE (result_type) = range_type; TYPE_VPTR_FIELDNO (result_type) = -1; -- /* TYPE_FLAG_TARGET_STUB will take care of zero length arrays */ +- /* TYPE_FLAG_TARGET_STUB will take care of zero length arrays. */ + /* DWARF blocks may depend on runtime information like + DW_OP_PUSH_OBJECT_ADDRESS not being available during the + CREATE_ARRAY_TYPE time. */ + if (TYPE_RANGE_DATA (range_type)->low.kind != RANGE_BOUND_KIND_CONSTANT + || TYPE_RANGE_DATA (range_type)->high.kind != RANGE_BOUND_KIND_CONSTANT -+ || TYPE_LOW_BOUND_UNDEFINED (range_type) -+ || TYPE_HIGH_BOUND_UNDEFINED (range_type) -+ || get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) -+ { -+ low_bound = 0; -+ high_bound = -1; -+ } -+ -+ /* Be careful when setting the array length. Ada arrays can be -+ empty arrays with the high_bound being smaller than the low_bound. -+ In such cases, the array length should be zero. TYPE_TARGET_STUB needs to -+ be checked as it may have dependencies on DWARF blocks depending on -+ runtime information not available during the CREATE_ARRAY_TYPE time. */ -+ if (high_bound < low_bound || TYPE_TARGET_STUB (element_type)) ++ || TYPE_DYNAMIC (element_type)) + TYPE_LENGTH (result_type) = 0; + else + { + CHECK_TYPEDEF (element_type); -+ TYPE_LENGTH (result_type) = -+ TYPE_LENGTH (element_type) * (high_bound - low_bound + 1); ++ TYPE_LENGTH (result_type) = type_length_get (result_type, element_type, ++ 0); + } -+ if (TYPE_LENGTH (result_type) == 0) - TYPE_TARGET_STUB (result_type) = 1; + { @@ -6329,7 +3700,7 @@ index 443f6f7..d852a14 100644 return result_type; } -@@ -1353,6 +1414,105 @@ stub_noname_complaint (void) +@@ -1413,6 +1462,105 @@ stub_noname_complaint (void) complaint (&symfile_complaints, _("stub type has NULL name")); } @@ -6432,10 +3803,10 @@ index 443f6f7..d852a14 100644 + TYPE_DYNAMIC (type) = 1; +} + - /* Added by Bryan Boreham, Kewill, Sun Sep 17 18:07:17 1989. - - If this is a stubbed struct (i.e. declared as struct foo *), see if -@@ -1486,52 +1646,36 @@ check_typedef (struct type *type) + /* Find the real type of TYPE. This function returns the real type, + after removing all layers of typedefs, and completing opaque or stub + types. Completion changes the TYPE argument, but stripping of +@@ -1575,52 +1723,35 @@ check_typedef (struct type *type) } } @@ -6445,7 +3816,6 @@ index 443f6f7..d852a14 100644 + if (TYPE_DYNAMIC (type)) + { + htab_t copied_types; -+ struct type *type_old = type; + + copied_types = create_copied_types_hash (NULL); + type = copy_type_recursive (type, copied_types); @@ -6463,7 +3833,7 @@ index 443f6f7..d852a14 100644 + TYPE_TARGET_TYPE (type) = target_type; if (TYPE_STUB (target_type) || TYPE_TARGET_STUB (target_type)) { - /* Empty. */ + /* Nothing we can do. */ } else if (TYPE_CODE (type) == TYPE_CODE_ARRAY - && TYPE_NFIELDS (type) == 1 @@ -6474,7 +3844,7 @@ index 443f6f7..d852a14 100644 /* Now recompute the length of the array type, based on its - number of elements and the target type's length. - Watch out for Ada null Ada arrays where the high bound -- is smaller than the low bound. */ +- is smaller than the low bound. */ - const LONGEST low_bound = TYPE_LOW_BOUND (range_type); - const LONGEST high_bound = TYPE_HIGH_BOUND (range_type); - ULONGEST len; @@ -6488,12 +3858,12 @@ index 443f6f7..d852a14 100644 - that for x < 0, (ULONGEST) x == -x + ULONGEST_MAX + 1, - which is technically not guaranteed by C, but is usually true - (because it would be true if x were unsigned with its -- high-order bit on). It uses the fact that +- high-order bit on). It uses the fact that - high_bound-low_bound is always representable in - ULONGEST and that if high_bound-low_bound+1 overflows, - it overflows to 0. We must change these tests if we - decide to increase the representation of TYPE_LENGTH -- from unsigned int to ULONGEST. */ +- from unsigned int to ULONGEST. */ - ULONGEST ulow = low_bound, uhigh = high_bound; - ULONGEST tlen = TYPE_LENGTH (target_type); - @@ -6508,21 +3878,16 @@ index 443f6f7..d852a14 100644 TYPE_TARGET_STUB (type) = 0; } else if (TYPE_CODE (type) == TYPE_CODE_RANGE) -@@ -1539,9 +1683,12 @@ check_typedef (struct type *type) +@@ -1628,6 +1759,7 @@ check_typedef (struct type *type) TYPE_LENGTH (type) = TYPE_LENGTH (target_type); TYPE_TARGET_STUB (type) = 0; } + TYPE_DYNAMIC (type) = 0; } -+ - /* Cache TYPE_LENGTH for future use. */ - TYPE_LENGTH (orig_type) = TYPE_LENGTH (type); -+ - return type; - } -@@ -1811,6 +1958,8 @@ init_type (enum type_code code, int length, int flags, - TYPE_NOTTEXT (type) = 1; + type = make_qualified_type (type, instance_flags, NULL); +@@ -1902,6 +2034,8 @@ init_type (enum type_code code, int length, int flags, + TYPE_STUB_SUPPORTED (type) = 1; if (flags & TYPE_FLAG_FIXED_INSTANCE) TYPE_FIXED_INSTANCE (type) = 1; + if (flags & TYPE_FLAG_GNU_IFUNC) @@ -6530,7 +3895,7 @@ index 443f6f7..d852a14 100644 if (name) TYPE_NAME (type) = obsavestring (name, strlen (name), -@@ -3006,33 +3155,42 @@ type_pair_eq (const void *item_lhs, const void *item_rhs) +@@ -3259,33 +3393,42 @@ type_pair_eq (const void *item_lhs, const void *item_rhs) } /* Allocate the hash table used by copy_type_recursive to walk @@ -6588,12 +3953,13 @@ index 443f6f7..d852a14 100644 return type; /* This type shouldn't be pointing to any types in other objfiles; -@@ -3047,8 +3205,10 @@ copy_type_recursive (struct objfile *objfile, +@@ -3300,9 +3443,10 @@ copy_type_recursive (struct objfile *objfile, new_type = alloc_type_arch (get_type_arch (type)); /* We must add the new type to the hash table immediately, in case - we encounter this type again during a recursive call below. */ -- stored = obstack_alloc (&objfile->objfile_obstack, sizeof (struct type_pair)); +- stored +- = obstack_alloc (&objfile->objfile_obstack, sizeof (struct type_pair)); + we encounter this type again during a recursive call below. Memory could + be allocated from OBJFILE in the case we will be removing OBJFILE, this + optimization is missed and xfree is called for it from COPIED_TYPES. */ @@ -6601,7 +3967,7 @@ index 443f6f7..d852a14 100644 stored->old = type; stored->new = new_type; *slot = stored; -@@ -3059,6 +3219,19 @@ copy_type_recursive (struct objfile *objfile, +@@ -3313,6 +3457,19 @@ copy_type_recursive (struct objfile *objfile, TYPE_OBJFILE_OWNED (new_type) = 0; TYPE_OWNER (new_type).gdbarch = get_type_arch (type); @@ -6621,7 +3987,7 @@ index 443f6f7..d852a14 100644 if (TYPE_NAME (type)) TYPE_NAME (new_type) = xstrdup (TYPE_NAME (type)); if (TYPE_TAG_NAME (type)) -@@ -3067,12 +3240,48 @@ copy_type_recursive (struct objfile *objfile, +@@ -3321,12 +3478,48 @@ copy_type_recursive (struct objfile *objfile, TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type); TYPE_LENGTH (new_type) = TYPE_LENGTH (type); @@ -6670,7 +4036,7 @@ index 443f6f7..d852a14 100644 TYPE_FIELDS (new_type) = XCALLOC (nfields, struct field); for (i = 0; i < nfields; i++) { -@@ -3081,8 +3290,8 @@ copy_type_recursive (struct objfile *objfile, +@@ -3335,8 +3528,8 @@ copy_type_recursive (struct objfile *objfile, TYPE_FIELD_BITSIZE (new_type, i) = TYPE_FIELD_BITSIZE (type, i); if (TYPE_FIELD_TYPE (type, i)) TYPE_FIELD_TYPE (new_type, i) @@ -6681,7 +4047,7 @@ index 443f6f7..d852a14 100644 if (TYPE_FIELD_NAME (type, i)) TYPE_FIELD_NAME (new_type, i) = xstrdup (TYPE_FIELD_NAME (type, i)); -@@ -3109,24 +3318,166 @@ copy_type_recursive (struct objfile *objfile, +@@ -3363,24 +3556,184 @@ copy_type_recursive (struct objfile *objfile, } } @@ -6689,7 +4055,7 @@ index 443f6f7..d852a14 100644 + possibly converted. */ + TYPE_DYNAMIC (new_type) = 0; + - /* For range types, copy the bounds information. */ + /* For range types, copy the bounds information. */ - if (TYPE_CODE (type) == TYPE_CODE_RANGE) + if (TYPE_CODE (new_type) == TYPE_CODE_RANGE) { @@ -6713,8 +4079,12 @@ index 443f6f7..d852a14 100644 + TYPE_LOW_BOUND_UNDEFINED (new_type) = 1; + } + else -+ TYPE_LOW_BOUND (new_type) = dwarf_locexpr_baton_eval ++ { ++ TYPE_LOW_BOUND (new_type) = dwarf_locexpr_baton_eval + (TYPE_RANGE_DATA (new_type)->low.u.dwarf_block); ++ if (TYPE_LOW_BOUND (new_type) >= 0) ++ TYPE_UNSIGNED (new_type) = 1; ++ } + TYPE_RANGE_DATA (new_type)->low.kind = RANGE_BOUND_KIND_CONSTANT; + break; + case RANGE_BOUND_KIND_DWARF_LOCLIST: @@ -6730,7 +4100,11 @@ index 443f6f7..d852a14 100644 + && dwarf_loclist_baton_eval + (TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.loclist, + TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.type, &addr)) -+ TYPE_LOW_BOUND (new_type) = addr; ++ { ++ TYPE_LOW_BOUND (new_type) = addr; ++ if (TYPE_LOW_BOUND (new_type) >= 0) ++ TYPE_UNSIGNED (new_type) = 1; ++ } + else + { + /* We should set 1 for Fortran but how to find the language? */ @@ -6852,10 +4226,20 @@ index 443f6f7..d852a14 100644 + copy_type_recursive_1 (objfile, + TYPE_VPTR_BASETYPE (type), + copied_types); ++ ++ if (TYPE_CODE (new_type) == TYPE_CODE_ARRAY) ++ { ++ struct type *new_index_type = TYPE_INDEX_TYPE (new_type); ++ ++ if (TYPE_BYTE_STRIDE (new_index_type) == 0) ++ TYPE_BYTE_STRIDE (new_index_type) ++ = TYPE_LENGTH (TYPE_TARGET_TYPE (new_type)); ++ } ++ /* Maybe copy the type_specific bits. NOTE drow/2005-12-09: We do not copy the C++-specific bits like -@@ -3143,6 +3494,17 @@ copy_type_recursive (struct objfile *objfile, +@@ -3397,6 +3750,17 @@ copy_type_recursive (struct objfile *objfile, return new_type; } @@ -6873,7 +4257,7 @@ index 443f6f7..d852a14 100644 /* Make a copy of the given TYPE, except that the pointer & reference types are not preserved. -@@ -3165,6 +3527,199 @@ copy_type (const struct type *type) +@@ -3419,6 +3783,199 @@ copy_type (const struct type *type) return new_type; } @@ -7073,7 +4457,7 @@ index 443f6f7..d852a14 100644 /* Helper functions to initialize architecture-specific types. */ -@@ -3511,6 +4066,8 @@ gdbtypes_post_init (struct gdbarch *gdbarch) +@@ -3767,6 +4324,8 @@ gdbtypes_post_init (struct gdbarch *gdbarch) = lookup_pointer_type (builtin_type->builtin_void); builtin_type->builtin_func_ptr = lookup_pointer_type (lookup_function_type (builtin_type->builtin_void)); @@ -7082,7 +4466,7 @@ index 443f6f7..d852a14 100644 /* This type represents a GDB internal function. */ builtin_type->internal_fn -@@ -3624,6 +4181,18 @@ objfile_type (struct objfile *objfile) +@@ -3880,6 +4439,18 @@ objfile_type (struct objfile *objfile) "", objfile); TYPE_TARGET_TYPE (objfile_type->nodebug_text_symbol) = objfile_type->builtin_int; @@ -7101,7 +4485,7 @@ index 443f6f7..d852a14 100644 objfile_type->nodebug_data_symbol = init_type (TYPE_CODE_INT, gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT, 0, -@@ -3678,6 +4247,11 @@ void +@@ -3934,6 +4505,11 @@ void _initialize_gdbtypes (void) { gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init); @@ -7112,15 +4496,15 @@ index 443f6f7..d852a14 100644 + objfile_type_data = register_objfile_data (); - add_setshow_zinteger_cmd ("overload", no_class, &overload_debug, _("\ + add_setshow_zinteger_cmd ("overload", no_class, &overload_debug, diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h -index 085270e..cb2b88e 100644 +index debb41c..c31c9b8 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h -@@ -171,6 +171,7 @@ enum type_flag_value - TYPE_FLAG_FIXED_INSTANCE = (1 << 15), - TYPE_FLAG_STUB_SUPPORTED = (1 << 16), - TYPE_FLAG_NOTTEXT = (1 << 17), +@@ -170,6 +170,7 @@ enum type_flag_value + TYPE_FLAG_VECTOR = (1 << 15), + TYPE_FLAG_FIXED_INSTANCE = (1 << 16), + TYPE_FLAG_STUB_SUPPORTED = (1 << 17), + TYPE_FLAG_GNU_IFUNC = (1 << 18), /* Used for error-checking. */ @@ -7135,11 +4519,11 @@ index 085270e..cb2b88e 100644 +#define TYPE_DYNAMIC(t) (TYPE_MAIN_TYPE (t)->flag_dynamic) + /* Static type. If this is set, the corresponding type had - * a static modifier. - * Note: This may be unnecessary, since static data members + a static modifier. + Note: This may be unnecessary, since static data members @@ -271,6 +277,12 @@ enum type_instance_flag_value - #define TYPE_NOTTEXT(t) (TYPE_MAIN_TYPE (t)->flag_nottext) + #define TYPE_NOTTEXT(t) (TYPE_INSTANCE_FLAGS (t) & TYPE_INSTANCE_FLAG_NOTTEXT) +/* Used only for TYPE_CODE_FUNC where it specifies the real function + address is returned by this function call. TYPE_TARGET_TYPE determines the @@ -7197,12 +4581,12 @@ index 085270e..cb2b88e 100644 + (TYPE_MAIN_TYPE (t)->flag_data_location_is_addr) + /* Constant type. If this is set, the corresponding type has a - * const modifier. - */ -@@ -389,11 +443,19 @@ struct main_type + const modifier. */ + +@@ -387,11 +441,19 @@ struct main_type + unsigned int flag_varargs : 1; unsigned int flag_vector : 1; unsigned int flag_stub_supported : 1; - unsigned int flag_nottext : 1; + unsigned int flag_gnu_ifunc : 1; unsigned int flag_fixed_instance : 1; unsigned int flag_objfile_owned : 1; @@ -7219,7 +4603,7 @@ index 085270e..cb2b88e 100644 /* A discriminant telling us which field of the type_specific union is being used for this type, if any. */ -@@ -467,6 +529,20 @@ struct main_type +@@ -465,6 +527,20 @@ struct main_type struct type *target_type; @@ -7240,7 +4624,7 @@ index 085270e..cb2b88e 100644 /* For structure and union types, a description of each field. For set and pascal array types, there is one "field", whose type is the domain type of the set or array. -@@ -540,13 +616,34 @@ struct main_type +@@ -539,13 +615,34 @@ struct main_type struct range_bounds { @@ -7266,21 +4650,21 @@ index 085270e..cb2b88e 100644 + } + kind; + } - /* Low bound of range. */ + /* Low bound of range. */ - - LONGEST low; - + low, - /* High bound of range. */ + /* High bound of range. */ - - LONGEST high; + high, -+ /* Byte stride of range. */ ++ /* Byte stride of range. */ + byte_stride; /* Flags indicating whether the values of low and high are valid. When true, the respective range value is -@@ -889,9 +986,9 @@ extern void allocate_gnat_aux_type (struct type *); +@@ -918,9 +1015,9 @@ extern void allocate_gnat_aux_type (struct type *); #define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type #define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type #define TYPE_CHAIN(thistype) (thistype)->chain @@ -7293,7 +4677,7 @@ index 085270e..cb2b88e 100644 calls check_typedef, TYPE_LENGTH (VALUE_TYPE (X)) is safe. */ #define TYPE_LENGTH(thistype) (thistype)->length /* Note that TYPE_CODE can be TYPE_CODE_TYPEDEF, so if you want the real -@@ -899,11 +996,16 @@ extern void allocate_gnat_aux_type (struct type *); +@@ -928,11 +1025,16 @@ extern void allocate_gnat_aux_type (struct type *); #define TYPE_CODE(thistype) TYPE_MAIN_TYPE(thistype)->code #define TYPE_NFIELDS(thistype) TYPE_MAIN_TYPE(thistype)->nfields #define TYPE_FIELDS(thistype) TYPE_MAIN_TYPE(thistype)->flds_bnds.fields @@ -7312,7 +4696,7 @@ index 085270e..cb2b88e 100644 #define TYPE_LOW_BOUND_UNDEFINED(range_type) \ TYPE_RANGE_DATA(range_type)->low_undefined #define TYPE_HIGH_BOUND_UNDEFINED(range_type) \ -@@ -920,7 +1022,14 @@ extern void allocate_gnat_aux_type (struct type *); +@@ -949,7 +1051,14 @@ extern void allocate_gnat_aux_type (struct type *); (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype)))) #define TYPE_ARRAY_LOWER_BOUND_VALUE(arraytype) \ @@ -7328,7 +4712,7 @@ index 085270e..cb2b88e 100644 /* C++ */ -@@ -1141,6 +1250,10 @@ struct builtin_type +@@ -1178,6 +1287,10 @@ struct builtin_type (*) () can server as a generic function pointer. */ struct type *builtin_func_ptr; @@ -7339,7 +4723,7 @@ index 085270e..cb2b88e 100644 /* Special-purpose types. */ -@@ -1181,6 +1294,8 @@ struct objfile_type +@@ -1218,6 +1331,8 @@ struct objfile_type /* Types used for symbols with no debug information. */ struct type *nodebug_text_symbol; @@ -7348,7 +4732,7 @@ index 085270e..cb2b88e 100644 struct type *nodebug_data_symbol; struct type *nodebug_unknown_symbol; struct type *nodebug_tls_symbol; -@@ -1328,6 +1443,18 @@ extern struct type *create_array_type (struct type *, struct type *, +@@ -1365,6 +1480,18 @@ extern struct type *create_array_type (struct type *, struct type *, struct type *); extern struct type *lookup_array_range_type (struct type *, int, int); @@ -7367,7 +4751,7 @@ index 085270e..cb2b88e 100644 extern struct type *create_string_type (struct type *, struct type *, struct type *); extern struct type *lookup_string_range_type (struct type *, int, int); -@@ -1370,6 +1497,8 @@ extern int is_public_ancestor (struct type *, struct type *); +@@ -1410,6 +1537,8 @@ extern int is_public_ancestor (struct type *, struct type *); extern int is_unique_ancestor (struct type *, struct value *); @@ -7376,7 +4760,7 @@ index 085270e..cb2b88e 100644 /* Overload resolution */ #define LENGTH_MATCH(bv) ((bv)->rank[0]) -@@ -1432,10 +1561,11 @@ extern void maintenance_print_type (char *, int); +@@ -1482,10 +1611,11 @@ extern void maintenance_print_type (char *, int); extern htab_t create_copied_types_hash (struct objfile *objfile); @@ -7391,97 +4775,606 @@ index 085270e..cb2b88e 100644 + #endif /* GDBTYPES_H */ diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c -index 4fce1ac..144a899 100644 +index c3cbbcc..7f86c29 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c -@@ -747,6 +747,21 @@ i386_linux_dr_unset_status (unsigned long mask) - } +@@ -649,22 +649,13 @@ i386_linux_store_inferior_registers (struct target_ops *ops, + } + + +-/* Support for debug registers. */ +- +-static unsigned long i386_linux_dr[DR_CONTROL + 1]; +- + /* Get debug register REGNUM value from only the one LWP of PTID. */ + + static unsigned long +-i386_linux_dr_get (ptid_t ptid, int regnum) ++i386_linux_dr_get (int tid, int regnum) + { +- int tid; + unsigned long value; + +- tid = TIDGET (ptid); +- if (tid == 0) +- tid = PIDGET (ptid); +- + /* FIXME: kettenis/2001-03-27: Calling perror_with_name if the + ptrace call fails breaks debugging remote targets. The correct + way to fix this is to add the hardware breakpoint and watchpoint +@@ -686,14 +677,8 @@ i386_linux_dr_get (ptid_t ptid, int regnum) + /* Set debug register REGNUM to VALUE in only the one LWP of PTID. */ + + static void +-i386_linux_dr_set (ptid_t ptid, int regnum, unsigned long value) ++i386_linux_dr_set (int tid, int regnum, unsigned long value) + { +- int tid; +- +- tid = TIDGET (ptid); +- if (tid == 0) +- tid = PIDGET (ptid); +- + errno = 0; + ptrace (PTRACE_POKEUSER, tid, + offsetof (struct user, u_debugreg[regnum]), value); +@@ -701,35 +686,78 @@ i386_linux_dr_set (ptid_t ptid, int regnum, unsigned long value) + perror_with_name (_("Couldn't write debug register")); } -+/* See i386_dr_low_type.detach. Do not use wrappers i386_linux_dr_set_control -+ or i386_linux_dr_reset_addr as they would modify the register cache -+ (i386_linux_dr). */ +-/* Set DR_CONTROL to ADDR in all LWPs of LWP_LIST. */ ++/* Helper for i386_linux_dr_set_control. */ + +static void -+i386_linux_dr_detach (void) ++i386_linux_dr_set_control_callback (int tid, void *control_voidp) +{ -+ int regnum; ++ unsigned long control = *(unsigned long *) control_voidp; + -+ i386_linux_dr_set (inferior_ptid, DR_CONTROL, 0); -+ i386_linux_dr_unset_status (~0UL); -+ for (regnum = DR_FIRSTADDR; regnum <= DR_LASTADDR; regnum++) -+ i386_linux_dr_set (inferior_ptid, regnum, 0); ++ i386_linux_dr_set (tid, DR_CONTROL, control); +} + ++static void i386_linux_dr_set_addr (int regnum, CORE_ADDR addr); ++ ++/* Set DR_CONTROL to ADDR in all LWPs of CURRENT_INFERIOR. */ + + static void + i386_linux_dr_set_control (unsigned long control) + { +- struct lwp_info *lp; +- ptid_t ptid; ++ int inferior_pid = ptid_get_pid (inferior_ptid); ++ struct inferior *inf = current_inferior (); ++ ++ /* The amd64 counterpart and description is amd64_linux_dr_set_control. */ ++ if (inf->pid != inferior_pid) ++ { ++ struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get (); ++ int i; ++ ++ if (!dr_mirror->addr_preset) ++ { ++ dr_mirror->addr_preset = 1; + +- i386_linux_dr[DR_CONTROL] = control; +- ALL_LWPS (lp, ptid) +- i386_linux_dr_set (ptid, DR_CONTROL, control); ++ for (i = 0; i < DR_LASTADDR - DR_FIRSTADDR; i++) ++ i386_linux_dr_set_addr (i, dr_mirror->addr[i]); ++ } ++ } ++ ++ linux_nat_iterate_watchpoint_lwps (i386_linux_dr_set_control_callback, ++ &control); + } + +-/* Set address REGNUM (zero based) to ADDR in all LWPs of LWP_LIST. */ ++/* Helper for i386_linux_dr_set_addr. */ ++ ++struct i386_linux_dr_set_addr_data ++ { ++ int regnum; ++ CORE_ADDR addr; ++ }; ++ ++static void ++i386_linux_dr_set_addr_callback (int tid, void *datap_voidp) ++{ ++ const struct i386_linux_dr_set_addr_data *datap = datap_voidp; ++ ++ i386_linux_dr_set (tid, DR_FIRSTADDR + datap->regnum, datap->addr); ++} ++ ++/* Set address REGNUM (zero based) to ADDR in all LWPs of CURRENT_INFERIOR. ++ */ + + static void + i386_linux_dr_set_addr (int regnum, CORE_ADDR addr) + { +- struct lwp_info *lp; +- ptid_t ptid; ++ struct i386_linux_dr_set_addr_data data; + + gdb_assert (regnum >= 0 && regnum <= DR_LASTADDR - DR_FIRSTADDR); + +- i386_linux_dr[DR_FIRSTADDR + regnum] = addr; +- ALL_LWPS (lp, ptid) +- i386_linux_dr_set (ptid, DR_FIRSTADDR + regnum, addr); ++ data.regnum = regnum; ++ data.addr = addr; ++ linux_nat_iterate_watchpoint_lwps (i386_linux_dr_set_addr_callback, &data); + } + +-/* Set address REGNUM (zero based) to zero in all LWPs of LWP_LIST. */ ++/* Set address REGNUM (zero based) to zero in all LWPs of CURRENT_INFERIOR. ++ */ + + static void + i386_linux_dr_reset_addr (int regnum) +@@ -742,36 +770,54 @@ i386_linux_dr_reset_addr (int regnum) + static unsigned long + i386_linux_dr_get_status (void) + { +- return i386_linux_dr_get (inferior_ptid, DR_STATUS); ++ int tid; ++ ++ tid = TIDGET (inferior_ptid); ++ if (tid == 0) ++ tid = PIDGET (inferior_ptid); ++ ++ return i386_linux_dr_get (tid, DR_STATUS); + } + +-/* Unset MASK bits in DR_STATUS in all LWPs of LWP_LIST. */ ++/* Helper for i386_linux_dr_unset_status. */ + + static void +-i386_linux_dr_unset_status (unsigned long mask) ++i386_linux_dr_unset_status_callback (int tid, void *mask_voidp) + { +- struct lwp_info *lp; +- ptid_t ptid; +- +- ALL_LWPS (lp, ptid) +- { +- unsigned long value; ++ unsigned long mask = *(unsigned long *) mask_voidp; ++ unsigned long value; + +- value = i386_linux_dr_get (ptid, DR_STATUS); +- value &= ~mask; +- i386_linux_dr_set (ptid, DR_STATUS, value); +- } ++ value = i386_linux_dr_get (tid, DR_STATUS); ++ value &= ~mask; ++ i386_linux_dr_set (tid, DR_STATUS, value); ++} ++ ++/* Unset MASK bits in DR_STATUS in all LWPs of CURRENT_INFERIOR. */ ++ ++static void ++i386_linux_dr_unset_status (unsigned long mask) ++{ ++ linux_nat_iterate_watchpoint_lwps (i386_linux_dr_unset_status_callback, ++ &mask); + } + static void i386_linux_new_thread (ptid_t ptid) { -@@ -976,6 +991,7 @@ _initialize_i386_linux_nat (void) - i386_dr_low.reset_addr = i386_linux_dr_reset_addr; - i386_dr_low.get_status = i386_linux_dr_get_status; - i386_dr_low.unset_status = i386_linux_dr_unset_status; -+ i386_dr_low.detach = i386_linux_dr_detach; - i386_set_debug_register_length (4); +- int i; ++ struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get (); ++ int i, tid; ++ ++ /* Verify DR_MIRROR is valid. */ ++ gdb_assert (PIDGET (ptid) == PIDGET (inferior_ptid)); ++ ++ tid = TIDGET (ptid); ++ if (tid == 0) ++ tid = PIDGET (ptid); + +- for (i = DR_FIRSTADDR; i <= DR_LASTADDR; i++) +- i386_linux_dr_set (ptid, i, i386_linux_dr[i]); ++ for (i = 0; i < DR_LASTADDR - DR_FIRSTADDR; i++) ++ i386_linux_dr_set (tid, DR_FIRSTADDR + i, dr_mirror->addr[i]); + +- i386_linux_dr_set (ptid, DR_CONTROL, i386_linux_dr[DR_CONTROL]); ++ i386_linux_dr_set (tid, DR_CONTROL, dr_mirror->control); + } + - /* Override the default ptrace resume method. */ diff --git a/gdb/i386-nat.c b/gdb/i386-nat.c -index eaa3644..0921c7e 100644 +index 0606ce1..1ad0e39 100644 --- a/gdb/i386-nat.c +++ b/gdb/i386-nat.c -@@ -533,6 +533,17 @@ i386_remove_watchpoint (CORE_ADDR addr, int len, int type, - return retval; - } +@@ -25,6 +25,7 @@ + #include "gdbcmd.h" + #include "target.h" + #include "gdb_assert.h" ++#include "inferior.h" -+/* See target_detach_watchpoints. */ + /* Support for hardware watchpoints and breakpoints using the i386 + debug registers. +@@ -44,7 +45,6 @@ struct i386_dr_low_type i386_dr_low; + #define TARGET_HAS_DR_LEN_8 (i386_dr_low.debug_register_length == 8) + + /* Debug registers' indices. */ +-#define DR_NADDR 4 /* The number of debug address registers. */ + #define DR_STATUS 6 /* Index of debug status register (DR6). */ + #define DR_CONTROL 7 /* Index of debug control register (DR7). */ + +@@ -111,49 +111,60 @@ struct i386_dr_low_type i386_dr_low; + + /* The I'th debug register is vacant if its Local and Global Enable + bits are reset in the Debug Control register. */ +-#define I386_DR_VACANT(i) \ +- ((dr_control_mirror & (3 << (DR_ENABLE_SIZE * (i)))) == 0) + -+static int -+i386_detach_watchpoints (void) ++static inline int ++i386_dr_vacant (struct i386_dr_mirror *dr_mirror, int i) +{ -+ if (i386_dr_low.detach) -+ i386_dr_low.detach (); ++ return (dr_mirror->control & (3 << (DR_ENABLE_SIZE * i))) == 0; ++} + + /* Locally enable the break/watchpoint in the I'th debug register. */ +-#define I386_DR_LOCAL_ENABLE(i) \ +- dr_control_mirror |= (1 << (DR_LOCAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i))) + +-/* Globally enable the break/watchpoint in the I'th debug register. */ +-#define I386_DR_GLOBAL_ENABLE(i) \ +- dr_control_mirror |= (1 << (DR_GLOBAL_ENABLE_SHIFT + DR_ENABLE_SIZE * (i))) ++static inline void ++i386_dr_local_enable (struct i386_dr_mirror *dr_mirror, int i) ++{ ++ dr_mirror->control |= 1 << (DR_LOCAL_ENABLE_SHIFT + DR_ENABLE_SIZE * i); ++} + + /* Disable the break/watchpoint in the I'th debug register. */ +-#define I386_DR_DISABLE(i) \ +- dr_control_mirror &= ~(3 << (DR_ENABLE_SIZE * (i))) + -+ return 0; ++static inline void ++i386_dr_disable (struct i386_dr_mirror *dr_mirror, int i) ++{ ++ dr_mirror->control &= ~(3 << (DR_ENABLE_SIZE * i)); ++} + + /* Set in DR7 the RW and LEN fields for the I'th debug register. */ +-#define I386_DR_SET_RW_LEN(i,rwlen) \ +- do { \ +- dr_control_mirror &= ~(0x0f << (DR_CONTROL_SHIFT+DR_CONTROL_SIZE*(i))); \ +- dr_control_mirror |= ((rwlen) << (DR_CONTROL_SHIFT+DR_CONTROL_SIZE*(i))); \ +- } while (0) ++ ++static inline void ++i386_dr_set_rw_len (struct i386_dr_mirror *dr_mirror, int i, unsigned rwlen) ++{ ++ dr_mirror->control &= ~(0x0f << (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * i)); ++ dr_mirror->control |= rwlen << (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * i); ++} + + /* Get from DR7 the RW and LEN fields for the I'th debug register. */ +-#define I386_DR_GET_RW_LEN(i) \ +- ((dr_control_mirror >> (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * (i))) & 0x0f) ++ ++static inline unsigned ++i386_dr_get_rw_len (struct i386_dr_mirror *dr_mirror, int i) ++{ ++ return ((dr_mirror->control >> (DR_CONTROL_SHIFT + DR_CONTROL_SIZE * i)) ++ & 0x0f); ++} + + /* Mask that this I'th watchpoint has triggered. */ + #define I386_DR_WATCH_MASK(i) (1 << (i)) + + /* Did the watchpoint whose address is in the I'th register break? */ +-#define I386_DR_WATCH_HIT(i) (dr_status_mirror & I386_DR_WATCH_MASK (i)) ++static inline int ++i386_dr_watch_hit (struct i386_dr_mirror *dr_mirror, int i) ++{ ++ return (dr_mirror->status & I386_DR_WATCH_MASK (i)) != 0; ++} + + /* A macro to loop over all debug registers. */ + #define ALL_DEBUG_REGISTERS(i) for (i = 0; i < DR_NADDR; i++) + +-/* Mirror the inferior's DRi registers. We keep the status and +- control registers separated because they don't hold addresses. */ +-static CORE_ADDR dr_mirror[DR_NADDR]; +-static unsigned long dr_status_mirror, dr_control_mirror; +- +-/* Reference counts for each debug register. */ +-static int dr_ref_count[DR_NADDR]; +- + /* Whether or not to print the mirrored debug registers. */ + static int maint_show_dr; + +@@ -195,21 +206,80 @@ static int i386_handle_nonaligned_watchpoint (i386_wp_op_t what, + + /* Implementation. */ + ++/* Per-inferior data key. */ ++static const struct inferior_data *i386_inferior_data; ++ ++struct i386_inferior_data ++ { ++ /* Copy of i386 hardware debug registers for performance reasons. */ ++ struct i386_dr_mirror dr_mirror; ++ }; ++ ++static void ++i386_inferior_data_cleanup (struct inferior *inf, void *arg) ++{ ++ struct i386_inferior_data *inf_data = arg; ++ ++ xfree (inf_data); +} + - /* Return non-zero if we can watch a memory region that starts at - address ADDR and whose length is LEN bytes. */ ++static struct i386_inferior_data * ++i386_inferior_data_get (void) ++{ ++ struct inferior *inf = current_inferior (); ++ struct i386_inferior_data *inf_data; ++ ++ inf_data = inferior_data (inf, i386_inferior_data); ++ if (inf_data == NULL) ++ { ++ inf_data = xzalloc (sizeof (*inf_data)); ++ set_inferior_data (current_inferior (), i386_inferior_data, inf_data); ++ } ++ ++ if (inf->pid != ptid_get_pid (inferior_ptid)) ++ { ++ static struct i386_inferior_data detached_inf_data_local; ++ static int detached_inf_pid = -1; ++ ++ if (detached_inf_pid != ptid_get_pid (inferior_ptid)) ++ { ++ detached_inf_pid = ptid_get_pid (inferior_ptid); ++ ++ /* Forked processes get a copy of the debug registers. */ ++ memcpy (&detached_inf_data_local, inf_data, ++ sizeof (detached_inf_data_local)); ++ detached_inf_data_local.dr_mirror.addr_preset = 0; ++ } ++ ++ return &detached_inf_data_local; ++ } ++ ++ return inf_data; ++} ++ + /* Clear the reference counts and forget everything we knew about the + debug registers. */ -@@ -685,6 +696,7 @@ i386_use_watchpoints (struct target_ops *t) - t->to_stopped_data_address = i386_stopped_data_address; - t->to_insert_watchpoint = i386_insert_watchpoint; ++struct i386_dr_mirror * ++i386_dr_mirror_get (void) ++{ ++ return &i386_inferior_data_get ()->dr_mirror; ++} ++ + void + i386_cleanup_dregs (void) + { ++ struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get (); + int i; + + ALL_DEBUG_REGISTERS(i) + { +- dr_mirror[i] = 0; +- dr_ref_count[i] = 0; ++ dr_mirror->addr[i] = 0; ++ dr_mirror->ref_count[i] = 0; + } +- dr_control_mirror = 0; +- dr_status_mirror = 0; ++ dr_mirror->addr_preset = 0; ++ dr_mirror->control = 0; ++ dr_mirror->status = 0; + } + + /* Print the values of the mirrored debug registers. This is called +@@ -220,6 +290,7 @@ static void + i386_show_dr (const char *func, CORE_ADDR addr, + int len, enum target_hw_bp_type type) + { ++ struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get (); + int addr_size = gdbarch_addr_bit (target_gdbarch) / 8; + int i; + +@@ -239,13 +310,16 @@ i386_show_dr (const char *func, CORE_ADDR addr, + : "??unknown??")))); + puts_unfiltered (":\n"); + printf_unfiltered ("\tCONTROL (DR7): %s STATUS (DR6): %s\n", +- phex (dr_control_mirror, 8), phex (dr_status_mirror, 8)); ++ phex (dr_mirror->control, 8), ++ phex (dr_mirror->status, 8)); + ALL_DEBUG_REGISTERS(i) + { + printf_unfiltered ("\ + \tDR%d: addr=0x%s, ref.count=%d DR%d: addr=0x%s, ref.count=%d\n", +- i, phex (dr_mirror[i], addr_size), dr_ref_count[i], +- i+1, phex (dr_mirror[i+1], addr_size), dr_ref_count[i+1]); ++ i, phex (dr_mirror->addr[i], addr_size), ++ dr_mirror->ref_count[i], i + 1, ++ phex (dr_mirror->addr[i + 1], addr_size), ++ dr_mirror->ref_count[i + 1]); + i++; + } + } +@@ -312,6 +386,7 @@ Invalid hardware breakpoint length %d in i386_length_and_rw_bits.\n"), len); + static int + i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits) + { ++ struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get (); + int i; + + if (!i386_dr_low.set_addr || !i386_dr_low.set_control) +@@ -322,11 +397,10 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits) + reuse it for this watchpoint as well (and save a register). */ + ALL_DEBUG_REGISTERS(i) + { +- if (!I386_DR_VACANT (i) +- && dr_mirror[i] == addr +- && I386_DR_GET_RW_LEN (i) == len_rw_bits) ++ if (!i386_dr_vacant (dr_mirror, i) && dr_mirror->addr[i] == addr ++ && i386_dr_get_rw_len (dr_mirror, i) == len_rw_bits) + { +- dr_ref_count[i]++; ++ dr_mirror->ref_count[i]++; + return 0; + } + } +@@ -334,7 +408,7 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits) + /* Next, look for a vacant debug register. */ + ALL_DEBUG_REGISTERS(i) + { +- if (I386_DR_VACANT (i)) ++ if (i386_dr_vacant (dr_mirror, i)) + break; + } + +@@ -345,9 +419,9 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits) + /* Now set up the register I to watch our region. */ + + /* Record the info in our local mirrored array. */ +- dr_mirror[i] = addr; +- dr_ref_count[i] = 1; +- I386_DR_SET_RW_LEN (i, len_rw_bits); ++ dr_mirror->addr[i] = addr; ++ dr_mirror->ref_count[i] = 1; ++ i386_dr_set_rw_len (dr_mirror, i, len_rw_bits); + /* Note: we only enable the watchpoint locally, i.e. in the current + task. Currently, no i386 target allows or supports global + watchpoints; however, if any target would want that in the +@@ -355,13 +429,13 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits) + to enable watchpoints globally or locally, and the code below + should use global or local enable and slow-down flags as + appropriate. */ +- I386_DR_LOCAL_ENABLE (i); +- dr_control_mirror |= DR_LOCAL_SLOWDOWN; +- dr_control_mirror &= I386_DR_CONTROL_MASK; ++ i386_dr_local_enable (dr_mirror, i); ++ dr_mirror->control |= DR_LOCAL_SLOWDOWN; ++ dr_mirror->control &= I386_DR_CONTROL_MASK; + + /* Finally, actually pass the info to the inferior. */ + i386_dr_low.set_addr (i, addr); +- i386_dr_low.set_control (dr_control_mirror); ++ i386_dr_low.set_control (dr_mirror->control); + + /* Only a sanity check for leftover bits (set possibly only by inferior). */ + if (i386_dr_low.unset_status) +@@ -379,21 +453,21 @@ i386_insert_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits) + static int + i386_remove_aligned_watchpoint (CORE_ADDR addr, unsigned len_rw_bits) + { ++ struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get (); + int i, retval = -1; + + ALL_DEBUG_REGISTERS(i) + { +- if (!I386_DR_VACANT (i) +- && dr_mirror[i] == addr +- && I386_DR_GET_RW_LEN (i) == len_rw_bits) ++ if (!i386_dr_vacant (dr_mirror, i) && dr_mirror->addr[i] == addr ++ && i386_dr_get_rw_len (dr_mirror, i) == len_rw_bits) + { +- if (--dr_ref_count[i] == 0) /* no longer in use? */ ++ if (--dr_mirror->ref_count[i] == 0) /* no longer in use? */ + { + /* Reset our mirror. */ +- dr_mirror[i] = 0; +- I386_DR_DISABLE (i); ++ dr_mirror->addr[i] = 0; ++ i386_dr_disable (dr_mirror, i); + /* Reset it in the inferior. */ +- i386_dr_low.set_control (dr_control_mirror); ++ i386_dr_low.set_control (dr_mirror->control); + if (i386_dr_low.reset_addr) + i386_dr_low.reset_addr (i); + } +@@ -555,26 +629,27 @@ i386_region_ok_for_watchpoint (CORE_ADDR addr, int len) + static int + i386_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p) + { ++ struct i386_dr_mirror *dr_mirror = i386_dr_mirror_get (); + CORE_ADDR addr = 0; + int i; + int rc = 0; + +- dr_status_mirror = i386_dr_low.get_status (); ++ dr_mirror->status = i386_dr_low.get_status (); + + ALL_DEBUG_REGISTERS(i) + { +- if (I386_DR_WATCH_HIT (i) ++ if (i386_dr_watch_hit (dr_mirror, i) + /* This second condition makes sure DRi is set up for a data + watchpoint, not a hardware breakpoint. The reason is + that GDB doesn't call the target_stopped_data_address + method except for data watchpoints. In other words, I'm + being paranoiac. */ +- && I386_DR_GET_RW_LEN (i) != 0 ++ && i386_dr_get_rw_len (dr_mirror, i) != 0 + /* This third condition makes sure DRi is not vacant, this + avoids false positives in windows-nat.c. */ +- && !I386_DR_VACANT (i)) ++ && !i386_dr_vacant (dr_mirror, i)) + { +- addr = dr_mirror[i]; ++ addr = dr_mirror->addr[i]; + rc = 1; + if (maint_show_dr) + i386_show_dr ("watchpoint_hit", addr, -1, hw_write); +@@ -688,6 +763,10 @@ i386_use_watchpoints (struct target_ops *t) t->to_remove_watchpoint = i386_remove_watchpoint; -+ t->to_detach_watchpoints = i386_detach_watchpoints; t->to_insert_hw_breakpoint = i386_insert_hw_breakpoint; t->to_remove_hw_breakpoint = i386_remove_hw_breakpoint; ++ ++ if (i386_inferior_data == NULL) ++ i386_inferior_data ++ = register_inferior_data_with_cleanup (i386_inferior_data_cleanup); } + + void diff --git a/gdb/i386-nat.h b/gdb/i386-nat.h -index 7317e7d..ea914a5 100644 +index 819c6b8..bef8a35 100644 --- a/gdb/i386-nat.h +++ b/gdb/i386-nat.h -@@ -62,6 +62,10 @@ extern void i386_use_watchpoints (struct target_ops *); - unset_status -- unset the specified bits of the debug - status (DR6) register for all LWPs +@@ -78,6 +78,28 @@ struct i386_dr_low_type -+ detach -- clear all debug registers of only the -+ INFERIOR_PTID task without affecting any -+ register caches. + extern struct i386_dr_low_type i386_dr_low; + ++/* The number of debug address registers. */ ++#define DR_NADDR 4 + - Additionally, the native file should set the debug_register_length - field to 4 or 8 depending on the number of bytes used for - deubg registers. */ -@@ -73,6 +77,7 @@ struct i386_dr_low_type - void (*reset_addr) (int); - unsigned long (*get_status) (void); - void (*unset_status) (unsigned long); -+ void (*detach) (void); - int debug_register_length; - }; - ++/* Copy of hardware debug registers for performance reasons. */ ++ ++struct i386_dr_mirror ++ { ++ /* Mirror the inferior's DRi registers. We keep the status and ++ control registers separated because they don't hold addresses. */ ++ CORE_ADDR addr[DR_NADDR]; ++ ++ /* All the ADDR hardware registers have been written at least once. */ ++ unsigned addr_preset : 1; ++ ++ /* Reference counts for each debug register. */ ++ int ref_count[DR_NADDR]; ++ ++ unsigned long status, control; ++ }; ++ ++extern struct i386_dr_mirror *i386_dr_mirror_get (void); ++ + /* Use this function to set i386_dr_low debug_register_length field + rather than setting it directly to check that the length is only + set once. It also enables the 'maint set/show show-debug-regs' diff --git a/gdb/infcall.c b/gdb/infcall.c -index 0c9a3af..957ec1d 100644 +index 75de56c..2a64a0e 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c -@@ -225,6 +225,56 @@ value_arg_coerce (struct gdbarch *gdbarch, struct value *arg, +@@ -228,6 +228,56 @@ value_arg_coerce (struct gdbarch *gdbarch, struct value *arg, return value_cast (type, arg); } @@ -7538,7 +5431,7 @@ index 0c9a3af..957ec1d 100644 /* Determine a function's address and its return type from its value. Calls error() if the function is not valid for calling. */ -@@ -233,7 +283,6 @@ find_function_addr (struct value *function, struct type **retval_type) +@@ -236,7 +286,6 @@ find_function_addr (struct value *function, struct type **retval_type) { struct type *ftype = check_typedef (value_type (function)); struct gdbarch *gdbarch = get_type_arch (ftype); @@ -7546,7 +5439,7 @@ index 0c9a3af..957ec1d 100644 struct type *value_type = NULL; CORE_ADDR funaddr; -@@ -241,24 +290,34 @@ find_function_addr (struct value *function, struct type **retval_type) +@@ -244,24 +293,34 @@ find_function_addr (struct value *function, struct type **retval_type) part of it. */ /* Determine address to call. */ @@ -7590,498 +5483,94 @@ index 0c9a3af..957ec1d 100644 + else if (TYPE_CODE (ftype) == TYPE_CODE_INT) { /* Handle the case of functions lacking debugging info. - Their values are characters since their addresses are char */ -diff --git a/gdb/infcmd.c b/gdb/infcmd.c -index c4cdb06..d213f6a 100644 ---- a/gdb/infcmd.c -+++ b/gdb/infcmd.c -@@ -822,7 +822,7 @@ nexti_command (char *count_string, int from_tty) - step_1 (1, 1, count_string); - } - --static void -+void - delete_longjmp_breakpoint_cleanup (void *arg) - { - int thread = * (int *) arg; -@@ -862,10 +862,13 @@ step_1 (int skip_subroutines, int single_inst, char *count_string) - - if (!single_inst || skip_subroutines) /* leave si command alone */ - { -+ struct thread_info *tp = inferior_thread (); -+ - if (in_thread_list (inferior_ptid)) - thread = pid_to_thread_id (inferior_ptid); - - set_longjmp_breakpoint (thread); -+ tp->initiating_frame = get_frame_id (get_current_frame ()); - - make_cleanup (delete_longjmp_breakpoint_cleanup, &thread); - } -@@ -1219,6 +1222,15 @@ signal_command (char *signum_exp, int from_tty) - proceed ((CORE_ADDR) -1, oursig, 0); - } - -+/* A continuation callback for until_next_command. */ -+ -+static void -+until_next_continuation (void *arg) -+{ -+ struct thread_info *tp = arg; -+ delete_longjmp_breakpoint (tp->num); -+} -+ - /* Proceed until we reach a different source line with pc greater than - our current one or exit the function. We skip calls in both cases. - -@@ -1235,6 +1247,8 @@ until_next_command (int from_tty) - struct symbol *func; - struct symtab_and_line sal; - struct thread_info *tp = inferior_thread (); -+ int thread = tp->num; -+ struct cleanup *old_chain; - - clear_proceed_status (); - set_step_frame (); -@@ -1270,7 +1284,19 @@ until_next_command (int from_tty) - - tp->step_multi = 0; /* Only one call to proceed */ - -+ set_longjmp_breakpoint (thread); -+ tp->initiating_frame = get_frame_id (frame); -+ old_chain = make_cleanup (delete_longjmp_breakpoint_cleanup, &thread); -+ - proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1); -+ -+ if (target_can_async_p () && is_running (inferior_ptid)) -+ { -+ discard_cleanups (old_chain); -+ add_continuation (tp, until_next_continuation, tp, NULL); -+ } -+ else -+ do_cleanups (old_chain); - } - - static void -@@ -1463,6 +1489,7 @@ finish_command_continuation (void *arg) - if (bs != NULL && tp->proceed_to_finish) - observer_notify_normal_stop (bs, 1 /* print frame */); - delete_breakpoint (a->breakpoint); -+ delete_longjmp_breakpoint (inferior_thread ()->num); - } - - static void -@@ -1546,6 +1573,7 @@ finish_forward (struct symbol *function, struct frame_info *frame) - struct breakpoint *breakpoint; - struct cleanup *old_chain; - struct finish_command_continuation_args *cargs; -+ int thread = tp->num; - - sal = find_pc_line (get_frame_pc (frame), 0); - sal.pc = get_frame_pc (frame); -@@ -1556,6 +1584,10 @@ finish_forward (struct symbol *function, struct frame_info *frame) - - old_chain = make_cleanup_delete_breakpoint (breakpoint); - -+ set_longjmp_breakpoint (thread); -+ tp->initiating_frame = get_frame_id (frame); -+ make_cleanup (delete_longjmp_breakpoint_cleanup, &thread); -+ - tp->proceed_to_finish = 1; /* We want stop_registers, please... */ - cargs = xmalloc (sizeof (*cargs)); - -diff --git a/gdb/inferior.h b/gdb/inferior.h -index 5abec68..e309277 100644 ---- a/gdb/inferior.h -+++ b/gdb/inferior.h -@@ -291,6 +291,8 @@ extern void interrupt_target_command (char *args, int from_tty); - - extern void interrupt_target_1 (int all_threads); - -+extern void delete_longjmp_breakpoint_cleanup (void *arg); -+ - extern void detach_command (char *, int); - - extern void notice_new_inferior (ptid_t, int, int); -diff --git a/gdb/infrun.c b/gdb/infrun.c -index 54b1d9f..58d045a 100644 ---- a/gdb/infrun.c -+++ b/gdb/infrun.c -@@ -45,6 +45,8 @@ - #include "language.h" - #include "solib.h" - #include "main.h" -+#include "dictionary.h" -+#include "block.h" - #include "gdb_assert.h" - #include "mi/mi-common.h" - #include "event-top.h" -@@ -367,6 +369,7 @@ follow_fork (void) - parent thread structure's run control related fields, not just these. - Initialized to avoid "may be used uninitialized" warnings from gcc. */ - struct breakpoint *step_resume_breakpoint = NULL; -+ struct breakpoint *exception_resume_breakpoint = NULL; - CORE_ADDR step_range_start = 0; - CORE_ADDR step_range_end = 0; - struct frame_id step_frame_id = { 0 }; -@@ -419,6 +422,8 @@ follow_fork (void) - step_range_start = tp->step_range_start; - step_range_end = tp->step_range_end; - step_frame_id = tp->step_frame_id; -+ exception_resume_breakpoint -+ = clone_momentary_breakpoint (tp->exception_resume_breakpoint); - - /* For now, delete the parent's sr breakpoint, otherwise, - parent/child sr breakpoints are considered duplicates, -@@ -429,6 +434,7 @@ follow_fork (void) - tp->step_range_start = 0; - tp->step_range_end = 0; - tp->step_frame_id = null_frame_id; -+ delete_exception_resume_breakpoint (tp); - } - - parent = inferior_ptid; -@@ -470,6 +476,8 @@ follow_fork (void) - tp->step_range_start = step_range_start; - tp->step_range_end = step_range_end; - tp->step_frame_id = step_frame_id; -+ tp->exception_resume_breakpoint -+ = exception_resume_breakpoint; - } - else - { -@@ -523,6 +531,9 @@ follow_inferior_reset_breakpoints (void) - if (tp->step_resume_breakpoint) - breakpoint_re_set_thread (tp->step_resume_breakpoint); - -+ if (tp->exception_resume_breakpoint) -+ breakpoint_re_set_thread (tp->exception_resume_breakpoint); -+ - /* Reinsert all breakpoints in the child. The user may have set - breakpoints after catching the fork, in which case those - were never set in the child, but only in the parent. This makes -@@ -760,6 +771,7 @@ follow_exec (ptid_t pid, char *execd_pathname) - /* If there was one, it's gone now. We cannot truly step-to-next - statement through an exec(). */ - th->step_resume_breakpoint = NULL; -+ th->exception_resume_breakpoint = NULL; - th->step_range_start = 0; - th->step_range_end = 0; - -@@ -2190,6 +2202,8 @@ static void insert_step_resume_breakpoint_at_sal (struct gdbarch *gdbarch, - struct symtab_and_line sr_sal, - struct frame_id sr_id); - static void insert_longjmp_resume_breakpoint (struct gdbarch *, CORE_ADDR); -+static void check_exception_resume (struct execution_control_state *, -+ struct frame_info *, struct symbol *); - - static void stop_stepping (struct execution_control_state *ecs); - static void prepare_to_wait (struct execution_control_state *ecs); -@@ -2313,6 +2327,7 @@ delete_step_resume_breakpoint_callback (struct thread_info *info, void *data) - return 0; - - delete_step_resume_breakpoint (info); -+ delete_exception_resume_breakpoint (info); - return 0; - } - -@@ -2337,6 +2352,7 @@ delete_step_thread_step_resume_breakpoint (void) - struct thread_info *tp = inferior_thread (); - - delete_step_resume_breakpoint (tp); -+ delete_exception_resume_breakpoint (tp); - } - else - /* In all-stop mode, delete all step-resume and longjmp-resume -@@ -3241,6 +3257,10 @@ handle_inferior_event (struct execution_control_state *ecs) - - stop_pc = regcache_read_pc (get_thread_regcache (ecs->ptid)); - -+ /* Clear WATCHPOINT_TRIGGERED values from previous stop which could -+ confuse bpstat_stop_status and bpstat_explains_signal. */ -+ watchpoints_triggered (&ecs->ws); -+ - ecs->event_thread->stop_bpstat - = bpstat_stop_status (get_regcache_aspace (get_current_regcache ()), - stop_pc, ecs->ptid); -@@ -3328,6 +3348,10 @@ handle_inferior_event (struct execution_control_state *ecs) - - stop_pc = regcache_read_pc (get_thread_regcache (ecs->ptid)); - -+ /* Clear WATCHPOINT_TRIGGERED values from previous stop which could -+ confuse bpstat_stop_status and bpstat_explains_signal. */ -+ watchpoints_triggered (&ecs->ws); -+ - /* Do whatever is necessary to the parent branch of the vfork. */ - handle_vfork_child_exec_or_exit (1); - -@@ -4076,23 +4100,33 @@ process_event_stop_test: - - ecs->event_thread->stepping_over_breakpoint = 1; - -- if (!gdbarch_get_longjmp_target_p (gdbarch) -- || !gdbarch_get_longjmp_target (gdbarch, frame, &jmp_buf_pc)) -+ if (what.is_longjmp) - { -- if (debug_infrun) -- fprintf_unfiltered (gdb_stdlog, "\ -+ if (!gdbarch_get_longjmp_target_p (gdbarch) -+ || !gdbarch_get_longjmp_target (gdbarch, -+ frame, &jmp_buf_pc)) -+ { -+ if (debug_infrun) -+ fprintf_unfiltered (gdb_stdlog, "\ - infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n"); -- keep_going (ecs); -- return; -- } -+ keep_going (ecs); -+ return; -+ } - -- /* We're going to replace the current step-resume breakpoint -- with a longjmp-resume breakpoint. */ -- delete_step_resume_breakpoint (ecs->event_thread); -+ /* We're going to replace the current step-resume breakpoint -+ with a longjmp-resume breakpoint. */ -+ delete_step_resume_breakpoint (ecs->event_thread); - -- /* Insert a breakpoint at resume address. */ -- insert_longjmp_resume_breakpoint (gdbarch, jmp_buf_pc); -+ /* Insert a breakpoint at resume address. */ -+ insert_longjmp_resume_breakpoint (gdbarch, jmp_buf_pc); -+ } -+ else -+ { -+ struct symbol *func = get_frame_function (frame); - -+ if (func) -+ check_exception_resume (ecs, frame, func); -+ } - keep_going (ecs); - return; - -@@ -4101,8 +4135,52 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME (!gdbarch_get_longjmp_target)\n"); - fprintf_unfiltered (gdb_stdlog, - "infrun: BPSTAT_WHAT_CLEAR_LONGJMP_RESUME\n"); - -- gdb_assert (ecs->event_thread->step_resume_breakpoint != NULL); -- delete_step_resume_breakpoint (ecs->event_thread); -+ if (what.is_longjmp) -+ { -+ gdb_assert (ecs->event_thread->step_resume_breakpoint != NULL); -+ delete_step_resume_breakpoint (ecs->event_thread); -+ } -+ else -+ { -+ /* There are several cases to consider. -+ -+ 1. The initiating frame no longer exists. In this case -+ we must stop, because the exception has gone too far. -+ -+ 2. The initiating frame exists, and is the same as the -+ current frame. We stop, because the exception has been -+ caught. -+ -+ 3. The initiating frame exists and is different from -+ the current frame. This means the exception has been -+ caught beneath the initiating frame, so keep going. */ -+ struct frame_info *init_frame -+ = frame_find_by_id (ecs->event_thread->initiating_frame); -+ -+ gdb_assert (ecs->event_thread->exception_resume_breakpoint != NULL); -+ delete_exception_resume_breakpoint (ecs->event_thread); -+ -+ if (init_frame) -+ { -+ struct frame_id current_id -+ = get_frame_id (get_current_frame ()); -+ if (frame_id_eq (current_id, -+ ecs->event_thread->initiating_frame)) -+ { -+ /* Case 2. Fall through. */ -+ } -+ else -+ { -+ /* Case 3. */ -+ keep_going (ecs); -+ return; -+ } -+ } -+ -+ /* For Cases 1 and 2, remove the step-resume breakpoint, -+ if it exists. */ -+ delete_step_resume_breakpoint (ecs->event_thread); -+ } - - ecs->event_thread->stop_step = 1; - print_stop_reason (END_STEPPING_RANGE, 0); -@@ -5070,6 +5148,97 @@ insert_longjmp_resume_breakpoint (struct gdbarch *gdbarch, CORE_ADDR pc) - set_momentary_breakpoint_at_pc (gdbarch, pc, bp_longjmp_resume); - } - -+/* Insert an exception resume breakpoint. TP is the thread throwing -+ the exception. The block B is the block of the unwinder debug hook -+ function. FRAME is the frame corresponding to the call to this -+ function. SYM is the symbol of the function argument holding the -+ target PC of the exception. */ -+ -+static void -+insert_exception_resume_breakpoint (struct thread_info *tp, -+ struct block *b, -+ struct frame_info *frame, -+ struct symbol *sym) -+{ -+ struct gdb_exception e; -+ -+ /* We want to ignore errors here. */ -+ TRY_CATCH (e, RETURN_MASK_ALL) -+ { -+ struct symbol *vsym; -+ struct value *value; -+ CORE_ADDR handler; -+ struct breakpoint *bp; -+ -+ vsym = lookup_symbol (SYMBOL_LINKAGE_NAME (sym), b, VAR_DOMAIN, NULL); -+ value = read_var_value (vsym, frame); -+ /* If the value was optimized out, revert to the old behavior. */ -+ if (! value_optimized_out (value)) -+ { -+ handler = value_as_address (value); -+ -+ if (debug_infrun) -+ fprintf_unfiltered (gdb_stdlog, -+ "infrun: exception resume at %lx\n", -+ (unsigned long) handler); -+ -+ bp = set_momentary_breakpoint_at_pc (get_frame_arch (frame), -+ handler, bp_exception_resume); -+ bp->thread = tp->num; -+ inferior_thread ()->exception_resume_breakpoint = bp; -+ } -+ } -+} -+ -+/* This is called when an exception has been intercepted. Check to -+ see whether the exception's destination is of interest, and if so, -+ set an exception resume breakpoint there. */ -+ -+static void -+check_exception_resume (struct execution_control_state *ecs, -+ struct frame_info *frame, struct symbol *func) -+{ -+ struct gdb_exception e; -+ -+ TRY_CATCH (e, RETURN_MASK_ALL) -+ { -+ struct block *b; -+ struct dict_iterator iter; -+ struct symbol *sym; -+ int argno = 0; -+ -+ /* The exception breakpoint is a thread-specific breakpoint on -+ the unwinder's debug hook, declared as: -+ -+ void _Unwind_DebugHook (void *cfa, void *handler); -+ -+ The CFA argument indicates the frame to which control is -+ about to be transferred. HANDLER is the destination PC. -+ -+ We ignore the CFA and set a temporary breakpoint at HANDLER. -+ This is not extremely efficient but it avoids issues in gdb -+ with computing the DWARF CFA, and it also works even in weird -+ cases such as throwing an exception from inside a signal -+ handler. */ -+ -+ b = SYMBOL_BLOCK_VALUE (func); -+ ALL_BLOCK_SYMBOLS (b, iter, sym) -+ { -+ if (!SYMBOL_IS_ARGUMENT (sym)) -+ continue; -+ -+ if (argno == 0) -+ ++argno; -+ else -+ { -+ insert_exception_resume_breakpoint (ecs->event_thread, -+ b, frame, sym); -+ break; -+ } -+ } -+ } -+} -+ - static void - stop_stepping (struct execution_control_state *ecs) - { + Their values are characters since their addresses are char. */ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c -index 93adfcd..34412a6 100644 +index a855219..1668f95 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c -@@ -2587,6 +2587,39 @@ linux_nat_stopped_data_address (struct target_ops *ops, CORE_ADDR *addr_p) - return lp->stopped_data_address_p; +@@ -1254,6 +1254,64 @@ iterate_over_lwps (ptid_t filter, + return NULL; } -+/* In `set follow-fork-mode child' with multithreaded parent we need to detach -+ watchpoints from all the LWPs. In such case INFERIOR_PTID will be the -+ non-threaded new child while LWP_LIST will still contain all the threads of -+ the parent being detached. */ ++/* Helper for linux_nat_iterate_watchpoint_lwps. */ ++ ++struct iterate_watchpoint_lwps_data ++ { ++ linux_nat_iterate_watchpoint_lwps_ftype callback; ++ void *callback_data; ++ }; + +static int -+linux_nat_detach_watchpoints (void) ++iterate_watchpoint_lwps_callback (struct lwp_info *lp, void *datap_voidp) +{ -+ struct lwp_info *lp; -+ int found = 0, retval = 0; -+ ptid_t filter = pid_to_ptid (ptid_get_pid (inferior_ptid)); -+ struct cleanup *old_chain = save_inferior_ptid (); ++ struct iterate_watchpoint_lwps_data *datap = datap_voidp; ++ int tid; + -+ for (lp = lwp_list; lp; lp = lp->next) -+ if (ptid_match (lp->ptid, filter)) -+ { -+ inferior_ptid = lp->ptid; -+ retval |= linux_ops->to_detach_watchpoints (); -+ found = 1; -+ } ++ tid = TIDGET (lp->ptid); ++ if (tid == 0) ++ tid = PIDGET (lp->ptid); + -+ do_cleanups (old_chain); ++ datap->callback (tid, datap->callback_data); + -+ if (!found) -+ { -+ gdb_assert (!is_lwp (inferior_ptid)); -+ -+ retval |= linux_ops->to_detach_watchpoints (); -+ } -+ -+ return retval; ++ /* Continue the traversal. */ ++ return 0; +} + - /* Wait until LP is stopped. */ ++/* Iterate like iterate_over_lwps does except when forking-off a child call ++ CALLBACK with CALLBACK_DATA specifically only for that new child PID. ++ ++ During `set follow-fork-mode child' the call is also made for the new child ++ PID; parent watchpoints get detached elsewhere (during target_detach). */ ++ ++void ++linux_nat_iterate_watchpoint_lwps ++ (linux_nat_iterate_watchpoint_lwps_ftype callback, void *callback_data) ++{ ++ struct iterate_watchpoint_lwps_data data; ++ int inferior_pid = ptid_get_pid (inferior_ptid); ++ struct inferior *inf = current_inferior (); ++ ++ data.callback = callback; ++ data.callback_data = callback_data; ++ ++ if (inf->pid == inferior_pid) ++ { ++ /* Standard mode. Iterate all the threads of the current inferior. ++ Without specifying INFERIOR_PID it would iterate all the threads of ++ all the inferiors, which is inappropriate for watchpoints. */ ++ ++ iterate_over_lwps (pid_to_ptid (inferior_pid), ++ iterate_watchpoint_lwps_callback, &data); ++ } ++ else ++ { ++ /* Detaching a new child PID temporarily present in INFERIOR_PID. */ ++ ++ callback (inferior_pid, callback_data); ++ } ++} ++ + /* Update our internal state when changing from one checkpoint to + another indicated by NEW_PTID. We can only switch single-threaded + applications, so we only create one new LWP, and the previous list +diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h +index 42cb2fc..05ac11d 100644 +--- a/gdb/linux-nat.h ++++ b/gdb/linux-nat.h +@@ -140,6 +140,11 @@ struct lwp_info *iterate_over_lwps (ptid_t filter, + void *), + void *data); - static int -@@ -5606,6 +5639,8 @@ linux_nat_add_target (struct target_ops *t) - t->to_thread_address_space = linux_nat_thread_address_space; - t->to_stopped_by_watchpoint = linux_nat_stopped_by_watchpoint; - t->to_stopped_data_address = linux_nat_stopped_data_address; -+ if (linux_ops->to_detach_watchpoints) -+ t->to_detach_watchpoints = linux_nat_detach_watchpoints; - - t->to_can_async_p = linux_nat_can_async_p; - t->to_is_async_p = linux_nat_is_async_p; -diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c -index 07fd67c..2524250 100644 ---- a/gdb/linux-tdep.c -+++ b/gdb/linux-tdep.c -@@ -23,6 +23,8 @@ - #include "auxv.h" - #include "target.h" - #include "elf/common.h" -+#include "value.h" -+#include "infcall.h" - - /* This function is suitable for architectures that don't - extend/override the standard siginfo structure. */ ++typedef void (*linux_nat_iterate_watchpoint_lwps_ftype) (int tid, void *data); ++ ++extern void linux_nat_iterate_watchpoint_lwps ++ (linux_nat_iterate_watchpoint_lwps_ftype callback, void *callback_data); ++ + /* Create a prototype generic GNU/Linux target. The client can + override it with local methods. */ + struct target_ops * linux_target (void); diff --git a/gdb/main.c b/gdb/main.c -index bfd1213..72faabd 100644 +index 6be4805..1b00759 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -39,6 +39,7 @@ @@ -8092,16 +5581,16 @@ index bfd1213..72faabd 100644 #include "source.h" #include "cli/cli-cmds.h" #include "python/python.h" -@@ -259,6 +260,8 @@ captured_main (void *data) +@@ -260,6 +261,8 @@ captured_main (void *data) char *cdarg = NULL; char *ttyarg = NULL; + int python_script = 0; + - /* These are static so that we can take their address in an initializer. */ + /* These are static so that we can take their address in an + initializer. */ static int print_help; - static int print_version; -@@ -443,10 +446,14 @@ captured_main (void *data) +@@ -448,10 +451,14 @@ captured_main (void *data) {"args", no_argument, &set_args, 1}, {"l", required_argument, 0, 'l'}, {"return-child-result", no_argument, &return_child_result, 1}, @@ -8117,7 +5606,7 @@ index bfd1213..72faabd 100644 { int option_index; -@@ -464,6 +471,9 @@ captured_main (void *data) +@@ -469,6 +476,9 @@ captured_main (void *data) case 0: /* Long option that just sets a flag. */ break; @@ -8127,10 +5616,10 @@ index bfd1213..72faabd 100644 case OPT_SE: symarg = optarg; execarg = optarg; -@@ -650,7 +660,31 @@ extern int gdbtk_test (char *); +@@ -664,7 +674,31 @@ captured_main (void *data) - /* Now that gdb_init has created the initial inferior, we're in position - to set args for that inferior. */ + /* Now that gdb_init has created the initial inferior, we're in + position to set args for that inferior. */ - if (set_args) + if (python_script) + { @@ -8160,24 +5649,24 @@ index bfd1213..72faabd 100644 { /* The remaining options are the command-line options for the inferior. The first one is the sym/exec file, and the rest -@@ -890,7 +924,8 @@ Can't attach to process and specify a core file at the same time.")); - xfree (cmdarg); +@@ -913,7 +947,8 @@ captured_main (void *data) - /* Read in the old history after all the command files have been read. */ + /* Read in the old history after all the command files have been + read. */ - init_history (); + if (!python_script) + init_history (); if (batch_flag) { -@@ -901,13 +936,25 @@ Can't attach to process and specify a core file at the same time.")); +@@ -924,13 +959,25 @@ captured_main (void *data) /* Show time and/or space usage. */ do_cleanups (pre_stat_chain); - /* NOTE: cagney/1999-11-07: There is probably no reason for not - moving this loop and the code found in captured_command_loop() - into the command_loop() proper. The main thing holding back that -- change - SET_TOP_LEVEL() - has been eliminated. */ +- change - SET_TOP_LEVEL() - has been eliminated. */ - while (1) +#if HAVE_PYTHON + if (python_script) @@ -8202,7 +5691,7 @@ index bfd1213..72faabd 100644 } /* No exit -- exit is through quit_command. */ } -@@ -939,7 +986,12 @@ print_gdb_help (struct ui_file *stream) +@@ -962,7 +1009,12 @@ print_gdb_help (struct ui_file *stream) fputs_unfiltered (_("\ This is the GNU debugger. Usage:\n\n\ gdb [options] [executable-file [core-file or process-id]]\n\ @@ -8216,7 +5705,7 @@ index bfd1213..72faabd 100644 Options:\n\n\ "), stream); fputs_unfiltered (_("\ -@@ -977,7 +1029,13 @@ Options:\n\n\ +@@ -1000,7 +1052,13 @@ Options:\n\n\ --nw Do not use a window interface.\n\ --nx Do not read "), stream); fputs_unfiltered (gdbinit, stream); @@ -8231,28 +5720,11 @@ index bfd1213..72faabd 100644 --quiet Do not print version number on startup.\n\ --readnow Fully read symbol files on first access.\n\ "), stream); -diff --git a/gdb/maint.c b/gdb/maint.c -index 28fd610..4e21476 100644 ---- a/gdb/maint.c -+++ b/gdb/maint.c -@@ -909,4 +909,12 @@ When enabled GDB is profiled."), - show_maintenance_profile_p, - &maintenance_set_cmdlist, - &maintenance_show_cmdlist); -+ add_setshow_filename_cmd ("gdb_datadir", class_maintenance, -+ &gdb_datadir, _("Set GDB's datadir path."), -+ _("Show GDB's datadir path."), -+ _("\ -+When set, GDB uses the specified path to search for data files."), -+ NULL, NULL, -+ &maintenance_set_cmdlist, -+ &maintenance_show_cmdlist); - } diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c -index 310ade9..d8710a1 100644 +index a401846..26dca8c 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c -@@ -702,7 +702,6 @@ mi_cmd_var_update (char *command, char **argv, int argc) +@@ -707,7 +707,6 @@ mi_cmd_var_update (char *command, char **argv, int argc) } else { @@ -8261,10 +5733,10 @@ index 310ade9..d8710a1 100644 varobj_update_one (var, print_values, 1 /* explicit */); diff --git a/gdb/minsyms.c b/gdb/minsyms.c -index cb4545c..92d4027 100644 +index 8497991..4635853 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c -@@ -337,8 +337,9 @@ lookup_minimal_symbol_text (const char *name, struct objfile *objf) +@@ -338,8 +338,9 @@ lookup_minimal_symbol_text (const char *name, struct objfile *objf) msymbol = msymbol->hash_next) { if (strcmp (SYMBOL_LINKAGE_NAME (msymbol), name) == 0 && @@ -8276,7 +5748,7 @@ index cb4545c..92d4027 100644 { switch (MSYMBOL_TYPE (msymbol)) { -@@ -700,6 +701,16 @@ lookup_minimal_symbol_by_pc (CORE_ADDR pc) +@@ -701,6 +702,16 @@ lookup_minimal_symbol_by_pc (CORE_ADDR pc) return lookup_minimal_symbol_by_pc_section (pc, NULL); } @@ -8293,7 +5765,7 @@ index cb4545c..92d4027 100644 /* Find the minimal symbol named NAME, and return both the minsym struct and its objfile. This only checks the linkage name. Sets *OBJFILE_P and returns the minimal symbol, if it is found. If it -@@ -769,6 +780,7 @@ prim_record_minimal_symbol (const char *name, CORE_ADDR address, +@@ -770,6 +781,7 @@ prim_record_minimal_symbol (const char *name, CORE_ADDR address, switch (ms_type) { case mst_text: @@ -8311,25 +5783,8 @@ index cb4545c..92d4027 100644 && strcmp (SYMBOL_LINKAGE_NAME (msymbol), SYMBOL_LINKAGE_NAME (tsymbol)) == 0) return SYMBOL_VALUE_ADDRESS (msymbol); -diff --git a/gdb/p-lang.c b/gdb/p-lang.c -index 08738ac..64d2e9f 100644 ---- a/gdb/p-lang.c -+++ b/gdb/p-lang.c -@@ -222,7 +222,11 @@ pascal_printstr (struct ui_file *stream, struct type *type, - unsigned int things_printed = 0; - int in_quotes = 0; - int need_comma = 0; -- int width = TYPE_LENGTH (type); -+ int width; -+ -+ /* Preserve TYPE's original type, just set its LENGTH. */ -+ check_typedef (type); -+ width = TYPE_LENGTH (type); - - /* If the string was not truncated due to `set print elements', and - the last byte of it is a null, we don't print that, in traditional C diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c -index 4d39bed..d0ddebc 100644 +index ca7606a..d73f54d 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -38,6 +38,7 @@ @@ -8340,7 +5795,7 @@ index 4d39bed..d0ddebc 100644 -@@ -68,8 +69,27 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, +@@ -68,8 +69,31 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, struct type *char_type; LONGEST val; CORE_ADDR addr; @@ -8349,6 +5804,7 @@ index 4d39bed..d0ddebc 100644 + CORE_ADDR saved_address = address; + + back_to = make_cleanup (null_cleanup, 0); ++ address += embedded_offset; + type = object_address_get_data (type, &address); + if (type == NULL) + { @@ -8357,7 +5813,7 @@ index 4d39bed..d0ddebc 100644 + do_cleanups (back_to); + return 0; + } -+ if (address != saved_address) ++ if (address != saved_address + embedded_offset) + { + size_t length = TYPE_LENGTH (type); @@ -8365,23 +5821,25 @@ index 4d39bed..d0ddebc 100644 + valaddr = xmalloc (length); + make_cleanup (xfree, (gdb_byte *) valaddr); + read_memory (address, (gdb_byte *) valaddr, length); ++ embedded_offset = 0; + } ++ else ++ address -= embedded_offset; switch (TYPE_CODE (type)) { case TYPE_CODE_ARRAY: -@@ -125,8 +145,9 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, +@@ -125,8 +149,8 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, { i = 0; } -- val_print_array_elements (type, valaddr + embedded_offset, address, stream, -- recurse, original_value, options, i); -+ val_print_array_elements (saved_type, valaddr + embedded_offset, +- val_print_array_elements (type, valaddr, embedded_offset, +- address, stream, recurse, ++ val_print_array_elements (saved_type, valaddr, embedded_offset, + saved_address, stream, recurse, -+ original_value, options, i); + original_value, options, i); fprintf_filtered (stream, "}"); } - break; -@@ -164,6 +185,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, +@@ -165,6 +189,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, /* Try to print what function it points to. */ print_address_demangle (gdbarch, addr, stream, demangle); /* Return value is irrelevant except for string pointers. */ @@ -8389,7 +5847,7 @@ index 4d39bed..d0ddebc 100644 return (0); } -@@ -252,6 +274,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, +@@ -256,6 +281,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, /* Return number of characters printed, including the terminating '\0' if we reached the end. val_print_string takes care including the terminating '\0' if necessary. */ @@ -8397,8 +5855,8 @@ index 4d39bed..d0ddebc 100644 return i; break; -@@ -554,6 +577,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, - error (_("Invalid pascal type code %d in symbol table."), TYPE_CODE (type)); +@@ -572,6 +598,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, + TYPE_CODE (type)); } gdb_flush (stream); + do_cleanups (back_to); @@ -8406,7 +5864,7 @@ index 4d39bed..d0ddebc 100644 } diff --git a/gdb/parse.c b/gdb/parse.c -index c885c6a..cbf9c65 100644 +index 856c24d..dbb38c5 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -487,9 +487,21 @@ write_exp_msymbol (struct minimal_symbol *msymbol) @@ -8455,7 +5913,7 @@ index c885c6a..cbf9c65 100644 default: write_exp_elt_type (objfile_type (objfile)->nodebug_unknown_symbol); break; -@@ -1412,6 +1433,7 @@ parser_fprintf (FILE *x, const char *y, ...) +@@ -1480,6 +1501,7 @@ parser_fprintf (FILE *x, const char *y, ...) int operator_check_standard (struct expression *exp, int pos, @@ -8463,7 +5921,7 @@ index c885c6a..cbf9c65 100644 int (*objfile_func) (struct objfile *objfile, void *data), void *data) -@@ -1453,7 +1475,7 @@ operator_check_standard (struct expression *exp, int pos, +@@ -1521,7 +1543,7 @@ operator_check_standard (struct expression *exp, int pos, struct type *type = elts[pos + 2 + arg].type; struct objfile *objfile = TYPE_OBJFILE (type); @@ -8472,7 +5930,7 @@ index c885c6a..cbf9c65 100644 return 1; } } -@@ -1471,7 +1493,8 @@ operator_check_standard (struct expression *exp, int pos, +@@ -1539,7 +1561,8 @@ operator_check_standard (struct expression *exp, int pos, /* Check objfile where the variable itself is placed. SYMBOL_OBJ_SECTION (symbol) may be NULL. */ @@ -8482,7 +5940,7 @@ index c885c6a..cbf9c65 100644 return 1; /* Check objfile where is placed the code touching the variable. */ -@@ -1484,24 +1507,27 @@ operator_check_standard (struct expression *exp, int pos, +@@ -1552,24 +1575,27 @@ operator_check_standard (struct expression *exp, int pos, /* Invoke callbacks for TYPE and OBJFILE if they were set as non-NULL. */ @@ -8518,7 +5976,7 @@ index c885c6a..cbf9c65 100644 int (*objfile_func) (struct objfile *objfile, void *data), void *data) { -@@ -1516,7 +1542,9 @@ exp_iterate (struct expression *exp, +@@ -1584,7 +1610,9 @@ exp_iterate (struct expression *exp, pos = endpos - oplen; if (exp->language_defn->la_exp_desc->operator_check (exp, pos, @@ -8529,7 +5987,7 @@ index c885c6a..cbf9c65 100644 return 1; endpos = pos; -@@ -1547,7 +1575,26 @@ exp_uses_objfile (struct expression *exp, struct objfile *objfile) +@@ -1615,7 +1643,26 @@ exp_uses_objfile (struct expression *exp, struct objfile *objfile) { gdb_assert (objfile->separate_debug_objfile_backlink == NULL); @@ -8558,7 +6016,7 @@ index c885c6a..cbf9c65 100644 void diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h -index bb79ae1..fbbd600 100644 +index 3f743d1..0ee19f5 100644 --- a/gdb/parser-defs.h +++ b/gdb/parser-defs.h @@ -194,6 +194,8 @@ extern void operator_length_standard (const struct expression *, int, int *, @@ -8570,7 +6028,7 @@ index bb79ae1..fbbd600 100644 int (*objfile_func) (struct objfile *objfile, void *data), void *data); -@@ -285,6 +287,7 @@ struct exp_descriptor +@@ -291,6 +293,7 @@ struct exp_descriptor value should be immediately returned to the caller. Otherwise zero should be returned. */ int (*operator_check) (struct expression *exp, int pos, @@ -8578,7 +6036,7 @@ index bb79ae1..fbbd600 100644 int (*objfile_func) (struct objfile *objfile, void *data), void *data); -@@ -323,4 +326,8 @@ extern void parser_fprintf (FILE *, const char *, ...) ATTRIBUTE_PRINTF (2, 3); +@@ -329,4 +332,8 @@ extern void parser_fprintf (FILE *, const char *, ...) ATTRIBUTE_PRINTF (2, 3); extern int exp_uses_objfile (struct expression *exp, struct objfile *objfile); @@ -8588,47 +6046,154 @@ index bb79ae1..fbbd600 100644 + #endif /* PARSER_DEFS_H */ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c -index 18ddee7..652b02a 100644 +index 0c5563e..e4f0b25 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c -@@ -2010,6 +2010,24 @@ ppc_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw, - return ret; +@@ -1637,12 +1637,18 @@ booke_remove_point (struct ppc_hw_breakpoint *b, int tid) + hw_breaks[i].hw_break = NULL; } -+/* See target_detach_watchpoints. Do not use wrapper -+ ppc_linux_remove_watchpoint as it would modify the register cache -+ (saved_dabr_value). */ -+ -+static int -+ppc_linux_detach_watchpoints (void) ++static void ++booke_insert_point_callback (int tid, void *pp_voidp) +{ -+ pid_t tid; ++ struct ppc_hw_breakpoint *pp = pp_voidp; + -+ tid = TIDGET (inferior_ptid); -+ if (tid == 0) -+ tid = PIDGET (inferior_ptid); -+ -+ if (ptrace (PTRACE_SET_DEBUGREG, tid, NULL, NULL) < 0) -+ return -1; -+ return 0; ++ booke_insert_point (pp, tid); +} + - static void - ppc_linux_new_thread (ptid_t ptid) + static int + ppc_linux_insert_hw_breakpoint (struct gdbarch *gdbarch, + struct bp_target_info *bp_tgt) { -@@ -2349,6 +2367,7 @@ _initialize_ppc_linux_nat (void) - t->to_region_ok_for_hw_watchpoint = ppc_linux_region_ok_for_hw_watchpoint; - t->to_insert_watchpoint = ppc_linux_insert_watchpoint; - t->to_remove_watchpoint = ppc_linux_remove_watchpoint; -+ t->to_detach_watchpoints = ppc_linux_detach_watchpoints; - t->to_stopped_by_watchpoint = ppc_linux_stopped_by_watchpoint; - t->to_stopped_data_address = ppc_linux_stopped_data_address; - t->to_watchpoint_addr_within_range = ppc_linux_watchpoint_addr_within_range; +- ptid_t ptid; +- struct lwp_info *lp; + struct ppc_hw_breakpoint p; + + if (!have_ptrace_booke_interface ()) +@@ -1656,18 +1662,23 @@ ppc_linux_insert_hw_breakpoint (struct gdbarch *gdbarch, + p.addr2 = 0; + p.condition_value = 0; + +- ALL_LWPS (lp, ptid) +- booke_insert_point (&p, TIDGET (ptid)); ++ linux_nat_iterate_watchpoint_lwps (booke_insert_point_callback, &p); + + return 0; + } + ++static void ++booke_remove_point_callback (int tid, void *pp_voidp) ++{ ++ struct ppc_hw_breakpoint *pp = pp_voidp; ++ ++ booke_remove_point (pp, tid); ++} ++ + static int + ppc_linux_remove_hw_breakpoint (struct gdbarch *gdbarch, + struct bp_target_info *bp_tgt) + { +- ptid_t ptid; +- struct lwp_info *lp; + struct ppc_hw_breakpoint p; + + if (!have_ptrace_booke_interface ()) +@@ -1681,8 +1692,7 @@ ppc_linux_remove_hw_breakpoint (struct gdbarch *gdbarch, + p.addr2 = 0; + p.condition_value = 0; + +- ALL_LWPS (lp, ptid) +- booke_remove_point (&p, TIDGET (ptid)); ++ linux_nat_iterate_watchpoint_lwps (booke_remove_point_callback, &p); + + return 0; + } +@@ -1896,6 +1906,15 @@ ppc_linux_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw, + && check_condition (addr, cond, &data_value)); + } + ++static void ++set_saved_dabr_value_callback (int tid, void *retp_voidp) ++{ ++ int *retp = retp_voidp; ++ ++ if (ptrace (PTRACE_SET_DEBUGREG, tid, 0, saved_dabr_value) < 0) ++ *retp = -1; ++} ++ + /* Set up P with the parameters necessary to request a watchpoint covering + LEN bytes starting at ADDR and if possible with condition expression COND + evaluated by hardware. INSERT tells if we are creating a request for +@@ -1949,8 +1968,6 @@ static int + ppc_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, + struct expression *cond) + { +- struct lwp_info *lp; +- ptid_t ptid; + int ret = -1; + + if (have_ptrace_booke_interface ()) +@@ -1959,8 +1976,7 @@ ppc_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, + + create_watchpoint_request (&p, addr, len, rw, cond, 1); + +- ALL_LWPS (lp, ptid) +- booke_insert_point (&p, TIDGET (ptid)); ++ linux_nat_iterate_watchpoint_lwps (booke_insert_point_callback, &p); + + ret = 0; + } +@@ -2003,12 +2019,8 @@ ppc_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, + + saved_dabr_value = dabr_value; + +- ALL_LWPS (lp, ptid) +- if (ptrace (PTRACE_SET_DEBUGREG, TIDGET (ptid), 0, +- saved_dabr_value) < 0) +- return -1; +- + ret = 0; ++ linux_nat_iterate_watchpoint_lwps (set_saved_dabr_value_callback, &ret); + } + + return ret; +@@ -2018,8 +2030,6 @@ static int + ppc_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw, + struct expression *cond) + { +- struct lwp_info *lp; +- ptid_t ptid; + int ret = -1; + + if (have_ptrace_booke_interface ()) +@@ -2028,20 +2038,16 @@ ppc_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw, + + create_watchpoint_request (&p, addr, len, rw, cond, 0); + +- ALL_LWPS (lp, ptid) +- booke_remove_point (&p, TIDGET (ptid)); ++ linux_nat_iterate_watchpoint_lwps (booke_remove_point_callback, &p); + + ret = 0; + } + else + { + saved_dabr_value = 0; +- ALL_LWPS (lp, ptid) +- if (ptrace (PTRACE_SET_DEBUGREG, TIDGET (ptid), 0, +- saved_dabr_value) < 0) +- return -1; + + ret = 0; ++ linux_nat_iterate_watchpoint_lwps (set_saved_dabr_value_callback, &ret); + } + + return ret; diff --git a/gdb/printcmd.c b/gdb/printcmd.c -index 5ffa099..58d9c79 100644 +index 29ffbf5..42b7821 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c -@@ -971,6 +971,11 @@ print_command_1 (char *exp, int inspect, int voidprint) +@@ -964,6 +964,11 @@ print_command_1 (char *exp, int inspect, int voidprint) else val = access_value_history (0); @@ -8640,7 +6205,7 @@ index 5ffa099..58d9c79 100644 if (voidprint || (val && value_type (val) && TYPE_CODE (value_type (val)) != TYPE_CODE_VOID)) { -@@ -1471,6 +1476,22 @@ x_command (char *exp, int from_tty) +@@ -1465,6 +1470,22 @@ x_command (char *exp, int from_tty) set_internalvar (lookup_internalvar ("__"), last_examine_value); } } @@ -8663,68 +6228,13 @@ index 5ffa099..58d9c79 100644 /* Add an expression to the auto-display chain. -@@ -2869,4 +2890,6 @@ Show printing of source filename and line number with ."), NULL, +@@ -2865,4 +2886,6 @@ Show printing of source filename and line number with ."), NULL, add_com ("eval", no_class, eval_command, _("\ Convert \"printf format string\", arg1, arg2, arg3, ..., argn to\n\ a command line, and call it.")); + + observer_attach_mark_used (print_types_mark_used); } -diff --git a/gdb/psymtab.c b/gdb/psymtab.c -index 97a4eec..fce19c9 100644 ---- a/gdb/psymtab.c -+++ b/gdb/psymtab.c -@@ -421,6 +421,14 @@ lookup_symbol_aux_psymtabs (struct objfile *objfile, - return NULL; - } - -+static void -+pre_expand_symtabs_matching_psymtabs (struct objfile *objfile, -+ int kind, const char *name, -+ domain_enum domain) -+{ -+ /* Nothing. */ -+} -+ - /* Look, in partial_symtab PST, for symbol whose natural name is NAME. - Check the global symbols if GLOBAL, the static symbols if not. */ - -@@ -941,7 +949,7 @@ psymtab_to_fullname (struct partial_symtab *ps) - return NULL; - } - --static char * -+static const char * - find_symbol_file_from_partial (struct objfile *objfile, const char *name) - { - struct partial_symtab *pst; -@@ -1199,6 +1207,7 @@ const struct quick_symbol_functions psym_functions = - forget_cached_source_info_partial, - lookup_symtab_via_partial_symtab, - lookup_symbol_aux_psymtabs, -+ pre_expand_symtabs_matching_psymtabs, - print_psymtab_stats_for_objfile, - dump_psymtabs_for_objfile, - relocate_psymtabs, -diff --git a/gdb/psymtab.h b/gdb/psymtab.h -index 9b8c8df..de8b67e 100644 ---- a/gdb/psymtab.h -+++ b/gdb/psymtab.h -@@ -1,6 +1,6 @@ - /* Public partial symbol table definitions. - -- Copyright (C) 2009 Free Software Foundation, Inc. -+ Copyright (C) 2009, 2010 Free Software Foundation, Inc. - - This file is part of GDB. - -@@ -28,4 +28,6 @@ void map_partial_symbol_filenames (void (*) (const char *, const char *, - - extern const struct quick_symbol_functions psym_functions; - -+extern const struct quick_symbol_functions dwarf2_gdb_index_functions; -+ - #endif /* PSYMTAB_H */ diff --git a/gdb/python/lib/gdb/FrameIterator.py b/gdb/python/lib/gdb/FrameIterator.py new file mode 100644 index 0000000..5654546 @@ -8882,40 +6392,15 @@ index 0000000..b790a54 + + def __getattr__ (self, name): + return getattr (self.frame, name) -diff --git a/gdb/python/lib/gdb/__init__.py b/gdb/python/lib/gdb/__init__.py -new file mode 100644 -index 0000000..b375c68 ---- /dev/null -+++ b/gdb/python/lib/gdb/__init__.py -@@ -0,0 +1,19 @@ -+# Startup code. -+ -+# Copyright (C) 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 . -+ -+# Load the require command by default. -+import gdb.command.require diff --git a/gdb/python/lib/gdb/backtrace.py b/gdb/python/lib/gdb/backtrace.py new file mode 100644 -index 0000000..2baab5f +index 0000000..6bb4fb1 --- /dev/null +++ b/gdb/python/lib/gdb/backtrace.py @@ -0,0 +1,42 @@ +# Filtering backtrace. + -+# Copyright (C) 2008 Free Software Foundation, Inc. ++# Copyright (C) 2008, 2011 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 @@ -8947,7 +6432,7 @@ index 0000000..2baab5f + if frame_filter == None: + frame_filter = constructor + else: -+ frame_filter = lambda iterator: constructor (frame_filter (iterator)) ++ frame_filter = lambda iterator, filter = frame_filter: constructor (filter (iterator)) + +def create_frame_filter (iter): + global frame_filter @@ -8955,13 +6440,6 @@ index 0000000..2baab5f + return iter + return frame_filter (iter) + -diff --git a/gdb/python/lib/gdb/command/__init__.py b/gdb/python/lib/gdb/command/__init__.py -new file mode 100644 -index 0000000..8b13789 ---- /dev/null -+++ b/gdb/python/lib/gdb/command/__init__.py -@@ -0,0 +1 @@ -+ diff --git a/gdb/python/lib/gdb/command/alias.py b/gdb/python/lib/gdb/command/alias.py new file mode 100644 index 0000000..96b6618 @@ -9029,13 +6507,13 @@ index 0000000..96b6618 +AliasCommand() diff --git a/gdb/python/lib/gdb/command/backtrace.py b/gdb/python/lib/gdb/command/backtrace.py new file mode 100644 -index 0000000..ec9a527 +index 0000000..eeea909 --- /dev/null +++ b/gdb/python/lib/gdb/command/backtrace.py @@ -0,0 +1,106 @@ +# New backtrace command. + -+# Copyright (C) 2008, 2009 Free Software Foundation, Inc. ++# Copyright (C) 2008, 2009, 2011 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 @@ -9115,7 +6593,7 @@ index 0000000..ec9a527 + + # FIXME: provide option to start at selected frame + # However, should still number as if starting from newest -+ newest_frame = gdb.selected_thread ().newest_frame () ++ newest_frame = gdb.newest_frame() + iter = itertools.imap (FrameWrapper, + FrameIterator (newest_frame)) + if filter: @@ -9326,77 +6804,6 @@ index 0000000..1fbc1e8 +RequireCommand() +RequireSubcommand("command") +RequireSubcommand("function") -diff --git a/gdb/python/lib/gdb/command/save_breakpoints.py b/gdb/python/lib/gdb/command/save_breakpoints.py -new file mode 100644 -index 0000000..6143187 ---- /dev/null -+++ b/gdb/python/lib/gdb/command/save_breakpoints.py -@@ -0,0 +1,65 @@ -+# Save breakpoints. -+ -+# Copyright (C) 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 . -+ -+from __future__ import with_statement -+import gdb -+ -+class SavePrefixCommand (gdb.Command): -+ "Prefix command for saving things." -+ -+ def __init__ (self): -+ super (SavePrefixCommand, self).__init__ ("save", -+ gdb.COMMAND_SUPPORT, -+ gdb.COMPLETE_NONE, True) -+ -+class SaveBreakpointsCommand (gdb.Command): -+ """Save the current breakpoints to a file. -+This command takes a single argument, a file name. -+The breakpoints can be restored using the 'source' command.""" -+ -+ def __init__ (self): -+ super (SaveBreakpointsCommand, self).__init__ ("save breakpoints", -+ gdb.COMMAND_SUPPORT, -+ gdb.COMPLETE_FILENAME) -+ -+ def invoke (self, arg, from_tty): -+ self.dont_repeat () -+ bps = gdb.breakpoints () -+ if bps is None: -+ raise RuntimeError, 'No breakpoints to save' -+ with open (arg.strip (), 'w') as f: -+ for bp in bps: -+ print >> f, "break", bp.location, -+ if bp.thread is not None: -+ print >> f, " thread", bp.thread, -+ if bp.condition is not None: -+ print >> f, " if", bp.condition, -+ print >> f -+ if not bp.enabled: -+ print >> f, "disable $bpnum" -+ # Note: we don't save the ignore count; there doesn't -+ # seem to be much point. -+ commands = bp.commands -+ if commands is not None: -+ print >> f, "commands" -+ # Note that COMMANDS has a trailing newline. -+ print >> f, commands, -+ print >> f, "end" -+ print >> f -+ -+SavePrefixCommand () -+SaveBreakpointsCommand () diff --git a/gdb/python/lib/gdb/command/upto.py b/gdb/python/lib/gdb/command/upto.py new file mode 100644 index 0000000..faf54ed @@ -9656,398 +7063,20 @@ index 0000000..debb3bb + return wanted == found + +InScope () -diff --git a/gdb/python/py-cmd.c b/gdb/python/py-cmd.c -index 2cff4ba..9255336 100644 ---- a/gdb/python/py-cmd.c -+++ b/gdb/python/py-cmd.c -@@ -49,8 +49,7 @@ static struct cmdpy_completer completers[] = - - #define N_COMPLETERS (sizeof (completers) / sizeof (completers[0])) - --/* A gdb command. For the time being only ordinary commands (not -- set/show commands) are allowed. */ -+/* A gdb command. */ - struct cmdpy_object - { - PyObject_HEAD -diff --git a/gdb/python/py-hooks.c b/gdb/python/py-hooks.c -new file mode 100644 -index 0000000..a3140bc ---- /dev/null -+++ b/gdb/python/py-hooks.c -@@ -0,0 +1,50 @@ -+/* Notifications from gdb to Python -+ -+ Copyright (C) 2008 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 . */ -+ -+#include "defs.h" -+#include "cli/cli-decode.h" -+#include "charset.h" -+#include "python.h" -+#include "python-internal.h" -+#include "observer.h" -+ -+PyObject * -+gdbpy_get_hook_function (const char *name) -+{ -+ PyObject *hooks; -+ PyObject *result; -+ -+ if (! PyObject_HasAttrString (gdb_module, "hooks")) -+ return NULL; -+ hooks = PyObject_GetAttrString (gdb_module, "hooks"); -+ if (! hooks) -+ return NULL; -+ /* The cast is because the Python function doesn't declare const argument. -+ This is a problem in Python version 2.4, but not in 2.5. */ -+ if (! PyObject_HasAttrString (hooks, (char *) name)) -+ { -+ Py_DECREF (hooks); -+ return NULL; -+ } -+ /* The cast is because the Python function doesn't declare const argument. -+ This is a problem in Python version 2.4, but not in 2.5. */ -+ result = PyObject_GetAttrString (hooks, (char *) name); -+ Py_DECREF (hooks); -+ return result; -+} -diff --git a/gdb/python/py-membuf.c b/gdb/python/py-membuf.c -new file mode 100644 -index 0000000..7bc294c ---- /dev/null -+++ b/gdb/python/py-membuf.c -@@ -0,0 +1,268 @@ -+/* Python interface to the inferior memory. -+ -+ Copyright (C) 2008, 2009 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 . */ -+ -+#include "defs.h" -+#include "exceptions.h" -+#include "gdbcore.h" -+#include "python-internal.h" -+ -+typedef struct { -+ PyObject_HEAD -+ void *buffer; -+ -+ /* These are kept just for mbpy_str. */ -+ CORE_ADDR addr; -+ CORE_ADDR length; -+} membuf_object; -+ -+static PyTypeObject membuf_object_type; -+ -+/* Implementation of gdb.read_memory (address, length). -+ Returns a Python buffer object with LENGTH bytes of the inferior's memory -+ at ADDRESS. Both arguments are integers. */ -+ -+PyObject * -+gdbpy_read_memory (PyObject *self, PyObject *args) -+{ -+ int error = 0; -+ CORE_ADDR addr, length; -+ void *buffer = NULL; -+ membuf_object *membuf_obj; -+ PyObject *addr_obj, *length_obj; -+ struct cleanup *cleanups = NULL; -+ volatile struct gdb_exception except; -+ -+ if (! PyArg_ParseTuple (args, "OO", &addr_obj, &length_obj)) -+ return NULL; -+ -+ TRY_CATCH (except, RETURN_MASK_ALL) -+ { -+ if (!get_addr_from_python (addr_obj, &addr) -+ || !get_addr_from_python (length_obj, &length)) -+ { -+ error = 1; -+ break; -+ } -+ -+ buffer = xmalloc (length); -+ cleanups = make_cleanup (xfree, buffer); -+ -+ read_memory (addr, buffer, length); -+ } -+ GDB_PY_HANDLE_EXCEPTION (except); -+ -+ if (error) -+ return NULL; -+ -+ discard_cleanups (cleanups); -+ -+ membuf_obj = PyObject_New (membuf_object, &membuf_object_type); -+ if (membuf_obj == NULL) -+ { -+ xfree (buffer); -+ PyErr_SetString (PyExc_MemoryError, -+ "Could not allocate memory buffer object."); -+ return NULL; -+ } -+ -+ membuf_obj->buffer = buffer; -+ membuf_obj->addr = addr; -+ membuf_obj->length = length; -+ -+ return PyBuffer_FromReadWriteObject ((PyObject *) membuf_obj, 0, -+ Py_END_OF_BUFFER); -+} -+ -+/* Implementation of gdb.write_memory (address, buffer [, length]). -+ Writes the contents of BUFFER (a Python object supporting the read buffer -+ protocol) at ADDRESS in the inferior's memory. Write LENGTH bytes from -+ BUFFER, or its entire contents if the argument is not provided. The -+ function returns nothing. */ -+ -+PyObject * -+gdbpy_write_memory (PyObject *self, PyObject *args) -+{ -+ int buf_len, error = 0; -+ const char *buffer; -+ CORE_ADDR addr, length; -+ PyObject *addr_obj, *length_obj = NULL; -+ volatile struct gdb_exception except; -+ -+ if (! PyArg_ParseTuple (args, "Os#|O", &addr_obj, &buffer, &buf_len, -+ &length_obj)) -+ return NULL; -+ -+ TRY_CATCH (except, RETURN_MASK_ALL) -+ { -+ if (!get_addr_from_python (addr_obj, &addr)) -+ { -+ error = 1; -+ break; -+ } -+ -+ if (!length_obj) -+ length = buf_len; -+ else if (!get_addr_from_python (length_obj, &length)) -+ { -+ error = 1; -+ break; -+ } -+ -+ write_memory (addr, buffer, length); -+ } -+ GDB_PY_HANDLE_EXCEPTION (except); -+ -+ if (error) -+ return NULL; -+ -+ Py_RETURN_NONE; -+} -+ -+/* Destructor of Membuf objects. */ -+ -+static void -+mbpy_dealloc (PyObject *self) -+{ -+ xfree (((membuf_object *) self)->buffer); -+ self->ob_type->tp_free (self); -+} -+ -+/* Return a description of the Membuf object. */ -+ -+static PyObject * -+mbpy_str (PyObject *self) -+{ -+ membuf_object *membuf_obj = (membuf_object *) self; -+ -+ return PyString_FromFormat ("memory buffer for address %s, %s bytes long", -+ paddress (membuf_obj->addr), -+ pulongest (membuf_obj->length)); -+} -+ -+static Py_ssize_t -+get_read_buffer (PyObject *self, Py_ssize_t segment, void **ptrptr) -+{ -+ membuf_object *membuf_obj = (membuf_object *) self; -+ -+ if (segment) -+ { -+ PyErr_SetString (PyExc_SystemError, -+ "The memory buffer supports only one segment."); -+ return -1; -+ } -+ -+ *ptrptr = membuf_obj->buffer; -+ -+ return membuf_obj->length; -+} -+ -+static Py_ssize_t -+get_write_buffer (PyObject *self, Py_ssize_t segment, void **ptrptr) -+{ -+ return get_read_buffer (self, segment, ptrptr); -+} -+ -+static Py_ssize_t -+get_seg_count (PyObject *self, Py_ssize_t *lenp) -+{ -+ if (lenp) -+ *lenp = ((membuf_object *) self)->length; -+ -+ return 1; -+} -+ -+static Py_ssize_t -+get_char_buffer (PyObject *self, Py_ssize_t segment, char **ptrptr) -+{ -+ void *ptr = NULL; -+ Py_ssize_t ret; -+ -+ ret = get_read_buffer (self, segment, &ptr); -+ *ptrptr = (char *) ptr; -+ -+ return ret; -+} -+ -+/* Python doesn't provide a decent way to get compatibility here. */ -+#if HAVE_LIBPYTHON2_4 -+#define CHARBUFFERPROC_NAME getcharbufferproc -+#else -+#define CHARBUFFERPROC_NAME charbufferproc -+#endif -+ -+static PyBufferProcs buffer_procs = { -+ get_read_buffer, -+ get_write_buffer, -+ get_seg_count, -+ /* The cast here works around a difference between Python 2.4 and -+ Python 2.5. */ -+ (CHARBUFFERPROC_NAME) get_char_buffer -+}; -+ -+static PyTypeObject membuf_object_type = { -+ PyObject_HEAD_INIT (NULL) -+ 0, /*ob_size*/ -+ "gdb.Membuf", /*tp_name*/ -+ sizeof (membuf_object), /*tp_basicsize*/ -+ 0, /*tp_itemsize*/ -+ mbpy_dealloc, /*tp_dealloc*/ -+ 0, /*tp_print*/ -+ 0, /*tp_getattr*/ -+ 0, /*tp_setattr*/ -+ 0, /*tp_compare*/ -+ 0, /*tp_repr*/ -+ 0, /*tp_as_number*/ -+ 0, /*tp_as_sequence*/ -+ 0, /*tp_as_mapping*/ -+ 0, /*tp_hash */ -+ 0, /*tp_call*/ -+ mbpy_str, /*tp_str*/ -+ 0, /*tp_getattro*/ -+ 0, /*tp_setattro*/ -+ &buffer_procs, /*tp_as_buffer*/ -+ Py_TPFLAGS_DEFAULT, /*tp_flags*/ -+ "GDB memory buffer object", /*tp_doc*/ -+ 0, /* tp_traverse */ -+ 0, /* tp_clear */ -+ 0, /* tp_richcompare */ -+ 0, /* tp_weaklistoffset */ -+ 0, /* tp_iter */ -+ 0, /* tp_iternext */ -+ 0, /* tp_methods */ -+ 0, /* tp_members */ -+ 0, /* tp_getset */ -+ 0, /* tp_base */ -+ 0, /* tp_dict */ -+ 0, /* tp_descr_get */ -+ 0, /* tp_descr_set */ -+ 0, /* tp_dictoffset */ -+ 0, /* tp_init */ -+ 0, /* tp_alloc */ -+ PyType_GenericNew /* tp_new */ -+}; -+ -+void -+gdbpy_initialize_membuf (void) -+{ -+ if (PyType_Ready (&membuf_object_type) < 0) -+ return; -+ -+ Py_INCREF (&membuf_object_type); -+ PyModule_AddObject (gdb_module, "Membuf", (PyObject *) &membuf_object_type); -+} -diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c -index 434c8a5..b22c557 100644 ---- a/gdb/python/py-prettyprint.c -+++ b/gdb/python/py-prettyprint.c -@@ -204,10 +204,10 @@ pretty_print_one_value (PyObject *printer, struct value **out_value) - && result != Py_None) - { - *out_value = convert_value_from_python (result); -- if (PyErr_Occurred ()) -- *out_value = NULL; -- Py_DECREF (result); -- result = NULL; -+ if (PyErr_Occurred ()) -+ *out_value = NULL; -+ Py_DECREF (result); -+ result = NULL; - } - } - } -@@ -700,14 +700,7 @@ gdbpy_get_varobj_pretty_printer (struct value *value) - { - PyObject *val_obj; - PyObject *pretty_printer = NULL; -- volatile struct gdb_exception except; - -- TRY_CATCH (except, RETURN_MASK_ALL) -- { -- value = value_copy (value); -- } -- GDB_PY_HANDLE_EXCEPTION (except); -- - val_obj = value_to_value_object (value); - if (! val_obj) - return NULL; diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c -index b901255..4ff18e5 100644 +index c010420..92073f6 100644 --- a/gdb/python/py-type.c +++ b/gdb/python/py-type.c -@@ -27,6 +27,8 @@ - #include "demangle.h" - #include "objfiles.h" +@@ -29,6 +29,8 @@ #include "language.h" + #include "vec.h" + #include "bcache.h" +#include "observer.h" +#include "gdb_assert.h" typedef struct pyty_type_object { -@@ -35,11 +37,17 @@ typedef struct pyty_type_object +@@ -37,11 +39,17 @@ typedef struct pyty_type_object /* If a Type object is associated with an objfile, it is kept on a doubly-linked list, rooted in the objfile. This lets us copy the @@ -10066,7 +7095,7 @@ index b901255..4ff18e5 100644 static PyTypeObject type_object_type; /* A Field object. */ -@@ -618,8 +626,59 @@ typy_str (PyObject *self) +@@ -919,8 +927,59 @@ typy_richcompare (PyObject *self, PyObject *other, int op) @@ -10126,7 +7155,7 @@ index b901255..4ff18e5 100644 static void save_objfile_types (struct objfile *objfile, void *datum) { -@@ -637,12 +696,13 @@ save_objfile_types (struct objfile *objfile, void *datum) +@@ -938,12 +997,13 @@ save_objfile_types (struct objfile *objfile, void *datum) { type_object *next = obj->next; @@ -10144,7 +7173,7 @@ index b901255..4ff18e5 100644 obj = next; } -@@ -653,42 +713,25 @@ save_objfile_types (struct objfile *objfile, void *datum) +@@ -954,42 +1014,25 @@ save_objfile_types (struct objfile *objfile, void *datum) } static void @@ -10199,7 +7228,7 @@ index b901255..4ff18e5 100644 } /* Create a new Type referring to TYPE. */ -@@ -699,7 +742,10 @@ type_to_type_object (struct type *type) +@@ -1000,7 +1043,10 @@ type_to_type_object (struct type *type) type_obj = PyObject_New (type_object, &type_object_type); if (type_obj) @@ -10211,7 +7240,7 @@ index b901255..4ff18e5 100644 return (PyObject *) type_obj; } -@@ -773,6 +819,8 @@ gdbpy_initialize_types (void) +@@ -1074,6 +1120,8 @@ gdbpy_initialize_types (void) Py_INCREF (&field_object_type); PyModule_AddObject (gdb_module, "Field", (PyObject *) &field_object_type); @@ -10221,18 +7250,18 @@ index b901255..4ff18e5 100644 diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c -index 2024021..e8be12d 100644 +index 27bf101..8c08f39 100644 --- a/gdb/python/py-value.c +++ b/gdb/python/py-value.c -@@ -25,6 +25,7 @@ - #include "language.h" - #include "dfp.h" - #include "valprint.h" +@@ -28,6 +28,7 @@ + #include "infcall.h" + #include "expression.h" + #include "cp-abi.h" +#include "observer.h" #ifdef HAVE_PYTHON -@@ -1067,6 +1068,17 @@ gdbpy_is_value_object (PyObject *obj) +@@ -1211,6 +1212,17 @@ gdbpy_is_value_object (PyObject *obj) return PyObject_TypeCheck (obj, &value_object_type); } @@ -10250,7 +7279,7 @@ index 2024021..e8be12d 100644 void gdbpy_initialize_values (void) { -@@ -1077,6 +1089,8 @@ gdbpy_initialize_values (void) +@@ -1221,6 +1233,8 @@ gdbpy_initialize_values (void) PyModule_AddObject (gdb_module, "Value", (PyObject *) &value_object_type); values_in_python = NULL; @@ -10259,104 +7288,13 @@ index 2024021..e8be12d 100644 } -diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h -index 2b8d301..0af99c8 100644 ---- a/gdb/python/python-internal.h -+++ b/gdb/python/python-internal.h -@@ -82,10 +82,11 @@ struct language_defn; - struct program_space; - - extern PyObject *gdb_module; --extern PyTypeObject value_object_type; - extern PyTypeObject block_object_type; -+extern PyTypeObject value_object_type; - extern PyTypeObject symbol_object_type; - -+/* Used in python-inferior.c. */ - typedef struct - { - PyObject_HEAD -@@ -126,6 +127,10 @@ PyObject *block_to_block_object (struct block *block, struct objfile *objfile); - PyObject *value_to_value_object (struct value *v); - PyObject *type_to_type_object (struct type *); - PyObject *frame_info_to_frame_object (struct frame_info *frame); -+PyObject *frame_info_to_frame_object (struct frame_info *frame); -+thread_object *create_thread_object (struct thread_info *tp); -+thread_object *find_thread_object (ptid_t ptid); -+PyObject *find_inferior_object (int pid); - - PyObject *pspace_to_pspace_object (struct program_space *); - PyObject *pspy_get_printers (PyObject *, void *); -@@ -145,8 +150,11 @@ struct type *type_object_to_type (PyObject *obj); - struct symtab *symtab_object_to_symtab (PyObject *obj); - struct symtab_and_line *sal_object_to_symtab_and_line (PyObject *obj); - -+PyObject *gdbpy_get_hook_function (const char *); - void gdbpy_initialize_auto_load (void); -+ - void gdbpy_initialize_values (void); -+void gdbpy_initialize_breakpoints (void); - void gdbpy_initialize_frames (void); - void gdbpy_initialize_symtabs (void); - void gdbpy_initialize_commands (void); -@@ -154,6 +162,7 @@ void gdbpy_initialize_symbols (void); - void gdbpy_initialize_symtabs (void); - void gdbpy_initialize_blocks (void); - void gdbpy_initialize_types (void); -+void gdbpy_initialize_blocks (void); - void gdbpy_initialize_functions (void); - void gdbpy_initialize_pspace (void); - void gdbpy_initialize_objfile (void); -@@ -171,6 +180,12 @@ struct cleanup *ensure_python_env (struct gdbarch *gdbarch, - extern struct gdbarch *python_gdbarch; - extern const struct language_defn *python_language; - -+char *gdbpy_parse_command_name (char *text, -+ struct cmd_list_element ***base_list, -+ struct cmd_list_element **start_list); -+ -+PyObject *gdbpy_parameter_value (enum var_types, void *); -+ - /* Use this after a TRY_EXCEPT to throw the appropriate Python - exception. */ - #define GDB_PY_HANDLE_EXCEPTION(Exception) \ -@@ -221,13 +236,14 @@ int gdbpy_is_value_object (PyObject *obj); - PyObject *apply_varobj_pretty_printer (PyObject *print_obj, - struct value **replacement); - PyObject *gdbpy_get_varobj_pretty_printer (struct value *value); -+PyObject *gdbpy_instantiate_printer (PyObject *cons, PyObject *value); - char *gdbpy_get_display_hint (PyObject *printer); - PyObject *gdbpy_default_visualizer (PyObject *self, PyObject *args); - --extern PyObject *gdbpy_doc_cst; - extern PyObject *gdbpy_children_cst; - extern PyObject *gdbpy_to_string_cst; - extern PyObject *gdbpy_display_hint_cst; -+extern PyObject *gdbpy_doc_cst; - extern PyObject *gdbpy_enabled_cst; - - extern PyObject *gdbpy_gdberror_exc; diff --git a/gdb/python/python.c b/gdb/python/python.c -index 7346fba..ee6e476 100644 +index b79504a..2011668 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c -@@ -28,6 +28,7 @@ - #include "value.h" - #include "language.h" - #include "exceptions.h" -+#include "event-loop.h" - - #include - -@@ -42,10 +43,17 @@ static int gdbpy_should_print_stack = 1; - #include "cli/cli-decode.h" - #include "charset.h" - #include "top.h" -+#include "solib.h" - #include "python-internal.h" -+#include "linespec.h" -+#include "symtab.h" -+#include "source.h" +@@ -49,8 +49,11 @@ static int gdbpy_should_print_stack = 1; + #include "linespec.h" + #include "source.h" #include "version.h" +#include "inferior.h" +#include "gdbthread.h" @@ -10366,228 +7304,7 @@ index 7346fba..ee6e476 100644 static PyMethodDef GdbMethods[]; -@@ -374,6 +382,105 @@ execute_gdb_command (PyObject *self, PyObject *args, PyObject *kw) - Py_RETURN_NONE; - } - -+/* Implementation of gdb.solib_address (Long) -> String. -+ Returns the name of the shared library holding a given address, or None. */ -+ -+static PyObject * -+gdbpy_solib_address (PyObject *self, PyObject *args) -+{ -+ unsigned long long pc; -+ char *soname; -+ PyObject *str_obj; -+ -+ if (!PyArg_ParseTuple (args, "K", &pc)) -+ return NULL; -+ -+ soname = solib_name_from_address (current_program_space, pc); -+ if (soname) -+ str_obj = PyString_Decode (soname, strlen (soname), host_charset (), NULL); -+ else -+ { -+ str_obj = Py_None; -+ Py_INCREF (Py_None); -+ } -+ -+ return str_obj; -+} -+ -+/* A Python function which is a wrapper for decode_line_1. */ -+ -+static PyObject * -+gdbpy_decode_line (PyObject *self, PyObject *args) -+{ -+ struct symtabs_and_lines sals = { NULL, 0 }; /* Initialize to appease gcc. */ -+ struct symtab_and_line sal; -+ char *arg = NULL; -+ int free_sals = 0, i; -+ PyObject *result = NULL; -+ volatile struct gdb_exception except; -+ -+ if (! PyArg_ParseTuple (args, "|s", &arg)) -+ return NULL; -+ -+ TRY_CATCH (except, RETURN_MASK_ALL) -+ { -+ if (arg) -+ { -+ char *copy; -+ -+ arg = strdup (arg); -+ copy = arg; -+ -+ sals = decode_line_1 (©, 0, 0, 0, 0, 0); -+ free_sals = 1; -+ } -+ else -+ { -+ set_default_source_symtab_and_line (); -+ sal = get_current_source_symtab_and_line (); -+ sals.sals = &sal; -+ sals.nelts = 1; -+ } -+ } -+ if (arg) -+ xfree (arg); -+ -+ if (except.reason < 0) -+ { -+ if (free_sals) -+ xfree (sals.sals); -+ /* We know this will always throw. */ -+ GDB_PY_HANDLE_EXCEPTION (except); -+ } -+ -+ if (sals.nelts) -+ { -+ result = PyTuple_New (sals.nelts); -+ for (i = 0; i < sals.nelts; ++i) -+ { -+ PyObject *obj; -+ char *str; -+ -+ obj = symtab_and_line_to_sal_object (sals.sals[i]); -+ if (! obj) -+ { -+ Py_DECREF (result); -+ result = NULL; -+ break; -+ } -+ -+ PyTuple_SetItem (result, i, obj); -+ } -+ } -+ -+ if (free_sals) -+ xfree (sals.sals); -+ -+ if (result) -+ return result; -+ Py_RETURN_NONE; -+} -+ - /* Parse a string and evaluate it as an expression. */ - static PyObject * - gdbpy_parse_and_eval (PyObject *self, PyObject *args) -@@ -414,6 +521,114 @@ source_python_script (FILE *stream, const char *file) - - - -+/* Posting and handling events. */ -+ -+/* A single event. */ -+struct gdbpy_event -+{ -+ /* The Python event. This is just a callable object. */ -+ PyObject *event; -+ /* The next event. */ -+ struct gdbpy_event *next; -+}; -+ -+/* All pending events. */ -+static struct gdbpy_event *gdbpy_event_list; -+/* The final link of the event list. */ -+static struct gdbpy_event **gdbpy_event_list_end; -+ -+/* We use a file handler, and not an async handler, so that we can -+ wake up the main thread even when it is blocked in poll(). */ -+static int gdbpy_event_fds[2]; -+ -+/* The file handler callback. This reads from the internal pipe, and -+ then processes the Python event queue. This will always be run in -+ the main gdb thread. */ -+static void -+gdbpy_run_events (int err, gdb_client_data ignore) -+{ -+ struct cleanup *cleanup; -+ char buffer[100]; -+ int r; -+ -+ cleanup = ensure_python_env (get_current_arch (), current_language); -+ -+ /* Just read whatever is available on the fd. It is relatively -+ harmless if there are any bytes left over. */ -+ r = read (gdbpy_event_fds[0], buffer, sizeof (buffer)); -+ -+ while (gdbpy_event_list) -+ { -+ /* Dispatching the event might push a new element onto the event -+ loop, so we update here "atomically enough". */ -+ struct gdbpy_event *item = gdbpy_event_list; -+ gdbpy_event_list = gdbpy_event_list->next; -+ if (gdbpy_event_list == NULL) -+ gdbpy_event_list_end = &gdbpy_event_list; -+ -+ /* Ignore errors. */ -+ PyObject_CallObject (item->event, NULL); -+ -+ Py_DECREF (item->event); -+ xfree (item); -+ } -+ -+ do_cleanups (cleanup); -+} -+ -+/* Submit an event to the gdb thread. */ -+static PyObject * -+gdbpy_post_event (PyObject *self, PyObject *args) -+{ -+ struct gdbpy_event *event; -+ PyObject *func; -+ int wakeup; -+ -+ if (!PyArg_ParseTuple (args, "O", &func)) -+ return NULL; -+ -+ if (!PyCallable_Check (func)) -+ { -+ PyErr_SetString (PyExc_RuntimeError, "Posted event is not callable"); -+ return NULL; -+ } -+ -+ Py_INCREF (func); -+ -+ /* From here until the end of the function, we have the GIL, so we -+ can operate on our global data structures without worrying. */ -+ wakeup = gdbpy_event_list == NULL; -+ -+ event = XNEW (struct gdbpy_event); -+ event->event = func; -+ event->next = NULL; -+ *gdbpy_event_list_end = event; -+ gdbpy_event_list_end = &event->next; -+ -+ /* Wake up gdb when needed. */ -+ if (wakeup) -+ { -+ char c = 'q'; /* Anything. */ -+ if (write (gdbpy_event_fds[1], &c, 1) != 1) -+ return PyErr_SetFromErrno (PyExc_IOError); -+ } -+ -+ Py_RETURN_NONE; -+} -+ -+/* Initialize the Python event handler. */ -+static void -+gdbpy_initialize_events (void) -+{ -+ if (!pipe (gdbpy_event_fds)) -+ { -+ gdbpy_event_list_end = &gdbpy_event_list; -+ add_file_handler (gdbpy_event_fds[0], gdbpy_run_events, NULL); -+ } -+} -+ -+ -+ - /* Printing. */ - - /* A python function to write a single string using gdb's filtered -@@ -459,6 +674,53 @@ gdbpy_print_stack (void) +@@ -722,6 +725,53 @@ gdbpy_print_stack (void) /* Return the current Progspace. There always is one. */ @@ -10641,15 +7358,7 @@ index 7346fba..ee6e476 100644 static PyObject * gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2) -@@ -720,6 +982,7 @@ Enables or disables printing of Python stack traces."), - gdbpy_initialize_lazy_string (); - gdbpy_initialize_thread (); - gdbpy_initialize_inferior (); -+ gdbpy_initialize_events (); - - PyRun_SimpleString ("import gdb"); - PyRun_SimpleString ("gdb.pretty_printers = []"); -@@ -787,6 +1050,8 @@ static PyMethodDef GdbMethods[] = +@@ -1106,6 +1156,8 @@ static PyMethodDef GdbMethods[] = "Get a value from history" }, { "execute", (PyCFunction) execute_gdb_command, METH_VARARGS | METH_KEYWORDS, "Execute a gdb command" }, @@ -10658,33 +7367,11 @@ index 7346fba..ee6e476 100644 { "parameter", gdbpy_parameter, METH_VARARGS, "Return a gdb parameter's value" }, -@@ -825,11 +1090,21 @@ a boolean indicating if name is a field of the current implied argument\n\ - `this' (when the current language is object-oriented)." }, - { "block_for_pc", gdbpy_block_for_pc, METH_VARARGS, - "Return the block containing the given pc value, or None." }, -+ { "solib_address (Long) -> String.\n\ -+Return the name of the shared library holding a given address, or None." }, -+ -+ { "decode_line", gdbpy_decode_line, METH_VARARGS, -+ "Decode a string argument the way that 'break' or 'edit' does.\n\ -+Return a tuple holding the file name (or None) and line number (or None).\n\ -+Note: may later change to return an object." }, - { "parse_and_eval", gdbpy_parse_and_eval, METH_VARARGS, - "parse_and_eval (String) -> Value.\n\ - Parse String as an expression, evaluate it, and return the result as a Value." - }, - -+ { "post_event", gdbpy_post_event, METH_VARARGS, -+ "Post an event into gdb's event loop." }, -+ - { "target_charset", gdbpy_target_charset, METH_NOARGS, - "target_charset () -> string.\n\ - Return the name of the current target charset." }, diff --git a/gdb/python/python.h b/gdb/python/python.h -index affd4a4..5407878 100644 +index 58d97fc..93d56ef 100644 --- a/gdb/python/python.h +++ b/gdb/python/python.h -@@ -28,6 +28,8 @@ void eval_python_from_control_command (struct command_line *); +@@ -30,6 +30,8 @@ void eval_python_from_control_command (struct command_line *); void source_python_script (FILE *stream, const char *file); @@ -10694,10 +7381,10 @@ index affd4a4..5407878 100644 int embedded_offset, CORE_ADDR address, struct ui_file *stream, int recurse, diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c -index 1f135d4..489838d 100644 +index 432da99..78c6b1c 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c -@@ -1278,7 +1278,8 @@ svr4_in_dynsym_resolve_code (CORE_ADDR pc) +@@ -1276,7 +1276,8 @@ svr4_in_dynsym_resolve_code (CORE_ADDR pc) && pc < info->interp_text_sect_high) || (pc >= info->interp_plt_sect_low && pc < info->interp_plt_sect_high) @@ -10707,89 +7394,37 @@ index 1f135d4..489838d 100644 } /* Given an executable's ABFD and target, compute the entry-point -diff --git a/gdb/symfile.c b/gdb/symfile.c -index 42f7ae3..371db0d 100644 ---- a/gdb/symfile.c -+++ b/gdb/symfile.c -@@ -1059,6 +1059,9 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, - const char *name = bfd_get_filename (abfd); - const int from_tty = add_flags & SYMFILE_VERBOSE; +diff --git a/gdb/stack.c b/gdb/stack.c +index 6e59cd0..0eacac9 100644 +--- a/gdb/stack.c ++++ b/gdb/stack.c +@@ -366,6 +366,7 @@ print_frame_args (struct symbol *func, struct frame_info *frame, + { + const struct language_defn *language; + struct value_print_options opts; ++ struct cleanup *old_chain; -+ if (readnow_symbol_files) -+ flags |= OBJF_READNOW; + /* Use the appropriate language to display our symbol, + unless the user forced the language to a specific +@@ -378,7 +379,13 @@ print_frame_args (struct symbol *func, struct frame_info *frame, + get_raw_print_options (&opts); + opts.deref_ref = 0; + opts.summary = summary; + - my_cleanups = make_cleanup_bfd_close (abfd); - - /* Give user a chance to burp if we'd be -@@ -1095,7 +1098,7 @@ symbol_file_add_with_addrs_or_offsets (bfd *abfd, - the gdb startup command line or on a per symbol file basis. Expand - all partial symbol tables for this objfile if so. */ - -- if ((flags & OBJF_READNOW) || readnow_symbol_files) -+ if ((flags & OBJF_READNOW)) - { - if (from_tty || info_verbose) - { -@@ -1533,7 +1536,7 @@ symbol_file_command (char *args, int from_tty) - void - set_initial_language (void) - { -- char *filename; -+ const char *filename; - enum language lang = language_unknown; - - filename = find_main_filename (); -@@ -2660,7 +2663,7 @@ init_filename_language_table (void) - } - - enum language --deduce_language_from_filename (char *filename) -+deduce_language_from_filename (const char *filename) - { - int i; - char *cp; -diff --git a/gdb/symfile.h b/gdb/symfile.h -index d53c465..5815354 100644 ---- a/gdb/symfile.h -+++ b/gdb/symfile.h -@@ -171,6 +171,15 @@ struct quick_symbol_functions - int kind, const char *name, - domain_enum domain); - -+ /* This is called to expand symbol tables before looking up a -+ symbol. A backend can choose to implement this and then have its -+ `lookup_symbol' hook always return NULL, or the reverse. (It -+ doesn't make sense to implement both.) The arguments are as for -+ `lookup_symbol'. */ -+ void (*pre_expand_symtabs_matching) (struct objfile *objfile, -+ int kind, const char *name, -+ domain_enum domain); ++ /* Frame may be needed for check_typedef of TYPE_DYNAMIC. */ ++ old_chain = make_cleanup_restore_selected_frame (); ++ select_frame (frame); + common_val_print (val, stb->stream, 2, &opts, language); ++ do_cleanups (old_chain); + - /* Print statistics about any indices loaded for OBJFILE. The - statistics should be printed to gdb_stdout. This is used for - "maint print statistics". */ -@@ -201,7 +210,7 @@ struct quick_symbol_functions - - /* Return the file name of the file holding the symbol in OBJFILE - named NAME. If no such symbol exists in OBJFILE, return NULL. */ -- char *(*find_symbol_file) (struct objfile *objfile, const char *name); -+ const char *(*find_symbol_file) (struct objfile *objfile, const char *name); - - /* This method is specific to Ada. It walks the partial symbol - tables of OBJFILE looking for a name match. WILD_MATCH and -@@ -566,6 +575,7 @@ extern struct cleanup *increment_reading_symtab (void); - - extern int dwarf2_has_info (struct objfile *); - -+extern int dwarf2_initialize_objfile (struct objfile *); - extern void dwarf2_build_psymtabs (struct objfile *); - extern void dwarf2_build_frame_info (struct objfile *); - + ui_out_field_stream (uiout, "value", stb); + } + else diff --git a/gdb/symmisc.c b/gdb/symmisc.c -index 62e6b97..00dc613 100644 +index 4be8106..081b532 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c -@@ -262,6 +262,9 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile) +@@ -264,6 +264,9 @@ dump_msymbols (struct objfile *objfile, struct ui_file *outfile) case mst_text: ms_type = 'T'; break; @@ -10800,110 +7435,23 @@ index 62e6b97..00dc613 100644 ms_type = 'S'; break; diff --git a/gdb/symtab.c b/gdb/symtab.c -index 2c4c9e4..28f0450 100644 +index 68666da..aa45042 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c -@@ -1295,16 +1295,25 @@ lookup_symbol_aux_symtabs (int block_index, const char *name, - const struct block *block; - struct symtab *s; - -- ALL_PRIMARY_SYMTABS (objfile, s) -+ ALL_OBJFILES (objfile) - { -- bv = BLOCKVECTOR (s); -- block = BLOCKVECTOR_BLOCK (bv, block_index); -- sym = lookup_block_symbol (block, name, domain); -- if (sym) -- { -- block_found = block; -- return fixup_symbol_section (sym, objfile); -- } -+ if (objfile->sf) -+ objfile->sf->qf->pre_expand_symtabs_matching (objfile, -+ block_index, -+ name, domain); -+ -+ ALL_OBJFILE_SYMTABS (objfile, s) -+ if (s->primary) -+ { -+ bv = BLOCKVECTOR (s); -+ block = BLOCKVECTOR_BLOCK (bv, block_index); -+ sym = lookup_block_symbol (block, name, domain); -+ if (sym) -+ { -+ block_found = block; -+ return fixup_symbol_section (sym, objfile); -+ } -+ } - } - - return NULL; -@@ -1547,15 +1556,24 @@ basic_lookup_transparent_type (const char *name) - of the desired name as a global, then do psymtab-to-symtab - conversion on the fly and return the found symbol. */ - -- ALL_PRIMARY_SYMTABS (objfile, s) -+ ALL_OBJFILES (objfile) - { -- bv = BLOCKVECTOR (s); -- block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); -- sym = lookup_block_symbol (block, name, STRUCT_DOMAIN); -- if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym))) -- { -- return SYMBOL_TYPE (sym); -- } -+ if (objfile->sf) -+ objfile->sf->qf->pre_expand_symtabs_matching (objfile, -+ GLOBAL_BLOCK, -+ name, STRUCT_DOMAIN); -+ -+ ALL_OBJFILE_SYMTABS (objfile, s) -+ if (s->primary) -+ { -+ bv = BLOCKVECTOR (s); -+ block = BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); -+ sym = lookup_block_symbol (block, name, STRUCT_DOMAIN); -+ if (sym && !TYPE_IS_OPAQUE (SYMBOL_TYPE (sym))) -+ { -+ return SYMBOL_TYPE (sym); -+ } -+ } - } - - ALL_OBJFILES (objfile) -@@ -1599,14 +1617,16 @@ basic_lookup_transparent_type (const char *name) - /* FIXME: What about languages without main() or specially linked - executables that have no main() ? */ - --char * -+const char * - find_main_filename (void) - { - struct objfile *objfile; -- char *result, *name = main_name (); -+ char *name = main_name (); - - ALL_OBJFILES (objfile) - { -+ const char *result; -+ - if (!objfile->sf) - continue; - result = objfile->sf->qf->find_symbol_file (objfile, name); -@@ -2914,7 +2934,7 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[], - static enum minimal_symbol_type types3[] +@@ -3001,7 +3001,7 @@ search_symbols (char *regexp, domain_enum kind, int nfiles, char *files[], + static const enum minimal_symbol_type types3[] = {mst_file_data, mst_solib_trampoline, mst_abs, mst_unknown}; - static enum minimal_symbol_type types4[] + static const enum minimal_symbol_type types4[] - = {mst_file_bss, mst_text, mst_abs, mst_unknown}; + = {mst_file_bss, mst_text_gnu_ifunc, mst_abs, mst_unknown}; enum minimal_symbol_type ourtype; enum minimal_symbol_type ourtype2; enum minimal_symbol_type ourtype3; diff --git a/gdb/symtab.h b/gdb/symtab.h -index bedc10a..dc284e4 100644 +index e4ec4bf..754d89d 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h -@@ -277,6 +277,9 @@ enum minimal_symbol_type +@@ -290,6 +290,9 @@ enum minimal_symbol_type { mst_unknown = 0, /* Unknown type, the default */ mst_text, /* Generally executable instructions */ @@ -10913,9 +7461,9 @@ index bedc10a..dc284e4 100644 mst_data, /* Generally initialized data */ mst_bss, /* Generally uninitialized data */ mst_abs, /* Generally absolute (nonrelocatable) */ -@@ -917,11 +920,25 @@ extern struct symbol *find_pc_sect_function (CORE_ADDR, struct obj_section *); +@@ -956,11 +959,25 @@ extern struct symbol *find_pc_sect_function (CORE_ADDR, struct obj_section *); - /* lookup function from address, return name, start addr and end addr */ + /* lookup function from address, return name, start addr and end addr. */ -extern int find_pc_partial_function (CORE_ADDR, char **, CORE_ADDR *, - CORE_ADDR *); @@ -10938,10 +7486,10 @@ index bedc10a..dc284e4 100644 + const char *function_name, + CORE_ADDR function_address); + - /* lookup partial symbol table by address and section */ + /* lookup partial symbol table by address and section. */ extern struct symtab *find_pc_sect_symtab_via_partial (CORE_ADDR, -@@ -996,6 +1013,8 @@ extern struct minimal_symbol *lookup_minimal_symbol_by_pc_name +@@ -1035,6 +1052,8 @@ extern struct minimal_symbol *lookup_minimal_symbol_by_pc_name extern struct minimal_symbol *lookup_minimal_symbol_by_pc (CORE_ADDR); @@ -10950,130 +7498,6 @@ index bedc10a..dc284e4 100644 extern struct minimal_symbol * lookup_minimal_symbol_and_objfile (const char *, struct objfile **); -@@ -1137,7 +1156,7 @@ extern char **make_source_files_completion_list (char *, char *); - - int matching_obj_sections (struct obj_section *, struct obj_section *); - --extern char *find_main_filename (void); -+extern const char *find_main_filename (void); - - extern struct symtab *find_line_symtab (struct symtab *, int, int *, int *); - -@@ -1150,7 +1169,7 @@ extern void skip_prologue_sal (struct symtab_and_line *); - - extern void clear_symtab_users (void); - --extern enum language deduce_language_from_filename (char *); -+extern enum language deduce_language_from_filename (const char *); - - /* symtab.c */ - -diff --git a/gdb/target.c b/gdb/target.c -index 4cabcbd..34b3b60 100644 ---- a/gdb/target.c -+++ b/gdb/target.c -@@ -123,6 +123,8 @@ static int debug_to_insert_watchpoint (CORE_ADDR, int, int, - static int debug_to_remove_watchpoint (CORE_ADDR, int, int, - struct expression *); - -+static int debug_to_detach_watchpoints (void); -+ - static int debug_to_stopped_by_watchpoint (void); - - static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *); -@@ -606,6 +608,7 @@ update_current_target (void) - INHERIT (to_remove_hw_breakpoint, t); - INHERIT (to_insert_watchpoint, t); - INHERIT (to_remove_watchpoint, t); -+ INHERIT (to_detach_watchpoints, t); - INHERIT (to_stopped_data_address, t); - INHERIT (to_have_steppable_watchpoint, t); - INHERIT (to_have_continuable_watchpoint, t); -@@ -739,6 +742,9 @@ update_current_target (void) - de_fault (to_remove_watchpoint, - (int (*) (CORE_ADDR, int, int, struct expression *)) - return_minus_one); -+ de_fault (to_detach_watchpoints, -+ (int (*) (void)) -+ return_zero); - de_fault (to_stopped_by_watchpoint, - (int (*) (void)) - return_zero); -@@ -3440,6 +3446,19 @@ debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type, - return retval; - } - -+static int -+debug_to_detach_watchpoints (void) -+{ -+ int retval; -+ -+ retval = debug_target.to_detach_watchpoints (); -+ -+ fprintf_unfiltered (gdb_stdlog, -+ "target_detach_watchpoints () = %ld\n", -+ (unsigned long) retval); -+ return retval; -+} -+ - static void - debug_to_terminal_init (void) - { -@@ -3687,6 +3706,7 @@ setup_target_debug (void) - current_target.to_remove_hw_breakpoint = debug_to_remove_hw_breakpoint; - current_target.to_insert_watchpoint = debug_to_insert_watchpoint; - current_target.to_remove_watchpoint = debug_to_remove_watchpoint; -+ current_target.to_detach_watchpoints = debug_to_detach_watchpoints; - current_target.to_stopped_by_watchpoint = debug_to_stopped_by_watchpoint; - current_target.to_stopped_data_address = debug_to_stopped_data_address; - current_target.to_watchpoint_addr_within_range = debug_to_watchpoint_addr_within_range; -diff --git a/gdb/target.h b/gdb/target.h -index 3c8c017..608a742 100644 ---- a/gdb/target.h -+++ b/gdb/target.h -@@ -433,6 +433,7 @@ struct target_ops - provided with the corresponding target_* macros. */ - int (*to_remove_watchpoint) (CORE_ADDR, int, int, struct expression *); - int (*to_insert_watchpoint) (CORE_ADDR, int, int, struct expression *); -+ int (*to_detach_watchpoints) (void); - - int (*to_stopped_by_watchpoint) (void); - int to_have_steppable_watchpoint; -@@ -1316,6 +1317,15 @@ extern char *normal_pid_to_str (ptid_t ptid); - #define target_remove_watchpoint(addr, len, type, cond) \ - (*current_target.to_remove_watchpoint) (addr, len, type, cond) - -+/* Clear all debug registers without affecting any register caches. Function -+ acts on INFERIOR_PTID which should be the forked-off process, either the -+ non-threaded child one or the threaded parent one, depending on `set -+ follow-fork-mode'. Both watchpoints and hardware breakpoints get removed. -+ Return 0 on success, -1 on failure. */ -+ -+#define target_detach_watchpoints() \ -+ (*current_target.to_detach_watchpoints) () -+ - #define target_insert_hw_breakpoint(gdbarch, bp_tgt) \ - (*current_target.to_insert_hw_breakpoint) (gdbarch, bp_tgt) - -@@ -1369,6 +1379,18 @@ extern int target_search_memory (CORE_ADDR start_addr, - ULONGEST pattern_len, - CORE_ADDR *found_addrp); - -+/* Utility functions which can be used by search_memory implementations. */ -+ -+void allocate_pattern_buffer (char **pattern_bufp, char **pattern_buf_end, -+ ULONGEST *pattern_buf_size); -+ -+void increase_pattern_buffer (char **pattern_bufp, char **pattern_buf_end, -+ ULONGEST *pattern_buf_size, int val_bytes); -+ -+int search_memory (CORE_ADDR *start_addr, ULONGEST *search_space_len, -+ const char *pattern_buf, ULONGEST pattern_len, -+ CORE_ADDR *found_addr); -+ - /* Tracepoint-related operations. */ - - #define target_trace_init() \ diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S b/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S new file mode 100644 index 0000000..83faaf6 @@ -12239,7 +8663,7 @@ index 0000000..b05411e + +gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array" diff --git a/gdb/testsuite/gdb.base/arrayidx.c b/gdb/testsuite/gdb.base/arrayidx.c -index ecc3289..f79ad40 100644 +index 6c158bf..739ce34 100644 --- a/gdb/testsuite/gdb.base/arrayidx.c +++ b/gdb/testsuite/gdb.base/arrayidx.c @@ -17,6 +17,13 @@ @@ -12257,7 +8681,7 @@ index ecc3289..f79ad40 100644 main (void) { diff --git a/gdb/testsuite/gdb.base/arrayidx.exp b/gdb/testsuite/gdb.base/arrayidx.exp -index 3a33618..f2e11dd 100644 +index d8ee5c0..de4ba75 100644 --- a/gdb/testsuite/gdb.base/arrayidx.exp +++ b/gdb/testsuite/gdb.base/arrayidx.exp @@ -57,4 +57,12 @@ gdb_test "print array" \ @@ -12382,10 +8806,10 @@ index 0000000..106271f +} diff --git a/gdb/testsuite/gdb.base/gnu-ifunc.exp b/gdb/testsuite/gdb.base/gnu-ifunc.exp new file mode 100644 -index 0000000..8ecf558 +index 0000000..de59785 --- /dev/null +++ b/gdb/testsuite/gdb.base/gnu-ifunc.exp -@@ -0,0 +1,110 @@ +@@ -0,0 +1,130 @@ +# Copyright (C) 2009, 2010 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -12406,12 +8830,17 @@ index 0000000..8ecf558 +} + +set testfile "gnu-ifunc" ++set executable ${testfile} +set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} ++set binfile ${objdir}/${subdir}/${executable} ++set staticexecutable ${executable}-static ++set staticbinfile ${objdir}/${subdir}/${staticexecutable} + +set libfile "${testfile}-lib" +set libsrc ${libfile}.c +set lib_so ${objdir}/${subdir}/${libfile}.so ++# $lib_o must not have {debug}, it would override the gnu-ifunc ELF markers. ++set lib_o ${objdir}/${subdir}/${libfile}.o + +# We need DWARF for the "final" function as we "step" into the function and GDB +# would step-over the "final" function if there would be no line number debug @@ -12435,14 +8864,16 @@ index 0000000..8ecf558 +} + +if { [gdb_compile_shlib ${srcdir}/${subdir}/$libsrc $lib_so $lib_opts] != "" -+ || [gdb_compile ${srcdir}/${subdir}/$srcfile $binfile executable $exec_opts] != ""} { ++ || [gdb_compile ${srcdir}/${subdir}/$srcfile $binfile executable $exec_opts] != "" ++ || [gdb_compile ${srcdir}/${subdir}/$libsrc $lib_o object {}] != "" ++ || [gdb_compile "${srcdir}/${subdir}/$srcfile $lib_o" $staticbinfile executable {debug}] != ""} { + untested "Could not compile either $libsrc or $srcfile." + return -1 +} + +# Start with a fresh gdb. + -+clean_restart $testfile ++clean_restart $executable +gdb_load_shlibs ${lib_so} + +if ![runto_main] then { @@ -12496,6 +8927,19 @@ index 0000000..8ecf558 + } +} +gdb_test "info sym $expect_out(1,string)" "gnu_ifunc in section .*" "info sym " ++ ++ ++# Test statically linked ifunc resolving during inferior start. ++# https://bugzilla.redhat.com/show_bug.cgi?id=624967 ++ ++if ![target_info exists gdb_stub] { ++ clean_restart $staticexecutable ++ ++ gdb_breakpoint "gnu_ifunc" ++ gdb_breakpoint "main" ++ gdb_run_cmd ++ gdb_test "" "Breakpoint \[0-9\]*, main .*" "static gnu_ifunc" ++} diff --git a/gdb/testsuite/gdb.base/internal-var-field-address.c b/gdb/testsuite/gdb.base/internal-var-field-address.c new file mode 100644 index 0000000..eeb7b85 @@ -12834,15 +9278,15 @@ index 0000000..5da7378 +gdb_test "p temp1" " = '1' " "second: print temp1" +gdb_test "p temp2" " = '2' " "second: print temp2" +gdb_test "p temp3" " = '3' " "second: print temp3" -diff --git a/gdb/testsuite/gdb.cp/gdb9593.cc b/gdb/testsuite/gdb.cp/gdb9593.cc +diff --git a/gdb/testsuite/gdb.base/watchpoint-delete.c b/gdb/testsuite/gdb.base/watchpoint-delete.c new file mode 100644 -index 0000000..783c962 +index 0000000..031ef92 --- /dev/null -+++ b/gdb/testsuite/gdb.cp/gdb9593.cc -@@ -0,0 +1,180 @@ ++++ b/gdb/testsuite/gdb.base/watchpoint-delete.c +@@ -0,0 +1,33 @@ +/* This testcase is part of GDB, the GNU debugger. + -+ Copyright 2008, 2009 Free Software Foundation, Inc. ++ 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 @@ -12855,178 +9299,31 @@ index 0000000..783c962 + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+ */ -+#include ++ along with this program. If not, see . */ + -+using namespace std; -+ -+class NextOverThrowDerivates ++void ++func (void) +{ ++ volatile int x = 0; + -+public: -+ -+ -+ // Single throw an exception in this function. -+ void function1() -+ { -+ throw 20; -+ } -+ -+ // Throw an exception in another function. -+ void function2() -+ { -+ function1(); -+ } -+ -+ // Throw an exception in another function, but handle it -+ // locally. -+ void function3 () -+ { -+ { -+ try -+ { -+ function1 (); -+ } -+ catch (...) -+ { -+ cout << "Caught and handled function1 exception" << endl; -+ } -+ } -+ } -+ -+ void rethrow () -+ { -+ try -+ { -+ function1 (); -+ } -+ catch (...) -+ { -+ throw; -+ } -+ } -+ -+ void finish () -+ { -+ // We use this to test that a "finish" here does not end up in -+ // this frame, but in the one above. -+ try -+ { -+ function1 (); -+ } -+ catch (int x) -+ { -+ } -+ function1 (); // marker for until -+ } -+ -+ void until () -+ { -+ function1 (); -+ function1 (); // until here -+ } -+ -+}; -+NextOverThrowDerivates next_cases; -+ -+ -+int main () -+{ -+ try -+ { -+ next_cases.function1 (); -+ } -+ catch (...) -+ { -+ // Discard -+ } -+ -+ try -+ { -+ next_cases.function2 (); -+ } -+ catch (...) -+ { -+ // Discard -+ } -+ -+ try -+ { -+ // This is duplicated so we can next over one but step into -+ // another. -+ next_cases.function2 (); -+ } -+ catch (...) -+ { -+ // Discard -+ } -+ -+ next_cases.function3 (); -+ -+ try -+ { -+ next_cases.rethrow (); -+ } -+ catch (...) -+ { -+ // Discard -+ } -+ -+ try -+ { -+ // Another duplicate so we can test "finish". -+ next_cases.function2 (); -+ } -+ catch (...) -+ { -+ // Discard -+ } -+ -+ // Another test for "finish". -+ try -+ { -+ next_cases.finish (); -+ } -+ catch (...) -+ { -+ } -+ -+ // Test of "until". -+ try -+ { -+ next_cases.finish (); -+ } -+ catch (...) -+ { -+ } -+ -+ // Test of "until" with an argument. -+ try -+ { -+ next_cases.until (); -+ } -+ catch (...) -+ { -+ } -+ -+ // Test of "advance". -+ try -+ { -+ next_cases.until (); -+ } -+ catch (...) -+ { -+ } ++ x++; /* break-here */ ++ x++; +} + -diff --git a/gdb/testsuite/gdb.cp/gdb9593.exp b/gdb/testsuite/gdb.cp/gdb9593.exp ++int ++main (void) ++{ ++ func (); ++ ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.base/watchpoint-delete.exp b/gdb/testsuite/gdb.base/watchpoint-delete.exp new file mode 100644 -index 0000000..3dad7ca +index 0000000..45bc650 --- /dev/null -+++ b/gdb/testsuite/gdb.cp/gdb9593.exp -@@ -0,0 +1,182 @@ -+# Copyright 2008, 2009 Free Software Foundation, Inc. ++++ b/gdb/testsuite/gdb.base/watchpoint-delete.exp +@@ -0,0 +1,38 @@ ++# 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 @@ -13041,179 +9338,35 @@ index 0000000..3dad7ca +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + ++set testfile "watchpoint-delete" ++set srcfile ${testfile}.c ++set binfile ${objdir}/${subdir}/${testfile} + -+if $tracelevel then { -+ strace $tracelevel -+} -+ -+if { [skip_cplus_tests] } { continue } -+ -+set testfile "gdb9593" -+set srcfile ${testfile}.cc -+set binfile $objdir/$subdir/$testfile -+ -+# Create and source the file that provides information about the compiler -+# used to compile the test case. -+if [get_compiler_info ${binfile} "c++"] { -+ untested gdb9593.exp ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { ++ untested ${testfile}.exp + return -1 +} + -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { -+ untested gdb9593.exp ++# It is more compatible this way. ++gdb_test_no_output "set can-use-hw-watchpoints 0" ++ ++if ![runto_main] { + return -1 +} + -+# Some targets can't do function calls, so don't even bother with this -+# test. -+if [target_info exists gdb,cannot_call_functions] { -+ setup_xfail "*-*-*" 9593 -+ fail "This target can not call functions" -+ continue -+} ++# Ensure there is a parent frame to create related bp_watchpoint_scope. ++gdb_breakpoint [gdb_get_line_number "break-here"] ++gdb_continue_to_breakpoint "break-here" ".* break-here .*" + -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} ++gdb_test "watch x" {Watchpoint [0-9]+: x} + -+if ![runto_main] then { -+ perror "couldn't run to main" -+ continue -+} -+ -+# See whether we have the needed unwinder hooks. -+set ok 1 -+gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook" { -+ -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" { -+ pass "check for unwinder hook" -+ } -+ -re "No symbol .* in current context.\r\n$gdb_prompt $" { -+ # Pass the test so we don't get bogus fails in the results. -+ pass "check for unwinder hook" -+ set ok 0 -+ } -+} -+if {!$ok} { -+ untested gdb9593.exp -+ return -1 -+} -+ -+# See http://sourceware.org/bugzilla/show_bug.cgi?id=9593 -+ -+gdb_test "next" \ -+ ".*catch (...).*" \ -+ "next over a throw 1" -+ -+gdb_test "next" \ -+ ".*next_cases.function2.*" \ -+ "next past catch 1" -+ -+gdb_test "next" \ -+ ".*catch (...).*" \ -+ "next over a throw 2" -+ -+gdb_test "next" \ -+ ".*next_cases.function2.*" \ -+ "next past catch 2" -+ -+gdb_test "step" \ -+ ".*function1().*" \ -+ "step into function2 1" -+ -+gdb_test "next" \ -+ ".*catch (...).*" \ -+ "next over a throw 3" -+ -+gdb_test "next" \ -+ ".*next_cases.function3.*" \ -+ "next past catch 3" -+ -+gdb_test "next" \ -+ ".*next_cases.rethrow.*" \ -+ "next over a throw 4" -+ -+gdb_test "next" \ -+ ".*catch (...).*" \ -+ "next over a rethrow" -+ -+gdb_test "next" \ -+ ".*next_cases.function2.*" \ -+ "next after a rethrow" -+ -+gdb_test "step" \ -+ ".*function1().*" \ -+ "step into function2 2" -+ -+gdb_test "finish" \ -+ ".*catch (...).*" \ -+ "finish 1" -+ -+gdb_test "next" \ -+ ".*next_cases.finish ().*" \ -+ "next past catch 4" -+ -+gdb_test "step" \ -+ ".*function1 ().*" \ -+ "step into finish method" -+ -+gdb_test "finish" \ -+ ".*catch (...).*" \ -+ "finish 2" -+ -+gdb_test "next" \ -+ ".*next_cases.finish ().*" \ -+ "next past catch 5" -+ -+gdb_test "step" \ -+ ".*function1 ().*" \ -+ "step into finish, for until" -+ -+gdb_test "until" \ -+ ".*function1 ().*" \ -+ "until with no argument 1" -+ -+set line [gdb_get_line_number "marker for until" $testfile.cc] -+ -+gdb_test "until $line" \ -+ ".*function1 ().*" \ -+ "next past catch 6" -+ -+gdb_test "until" \ -+ ".*catch (...).*" \ -+ "until with no argument 2" -+ -+set line [gdb_get_line_number "until here" $testfile.cc] -+ -+gdb_test "next" \ -+ ".*next_cases.until ().*" \ -+ "next past catch 6" -+ -+gdb_test "step" \ -+ ".*function1 ().*" \ -+ "step into until" -+ -+gdb_test "until $line" \ -+ ".*catch (...).*" \ -+ "until-over-throw" -+ -+gdb_test "next" \ -+ ".*next_cases.until ().*" \ -+ "next past catch 7" -+ -+gdb_test "step" \ -+ ".*function1 ().*" \ -+ "step into until, for advance" -+ -+gdb_test "advance $line" \ -+ ".*catch (...).*" \ -+ "advance-over-throw" ++gdb_test_no_output {delete $bpnum} diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S new file mode 100644 -index 0000000..7fb00ea +index 0000000..aac3baa --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S -@@ -0,0 +1,212 @@ +@@ -0,0 +1,246 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2010 Free Software Foundation, Inc. @@ -13278,6 +9431,19 @@ index 0000000..7fb00ea + .4byte .Llenb_var-.Lcu1_begin /* DW_AT_upper_bound */ + .byte 0 /* End of children of die */ + ++ /* DW_AT_upper_bound is referencing register. */ ++.Larrayreg_type: ++ .uleb128 2 /* Abbrev: DW_TAG_array_type */ ++ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */ ++ ++ .uleb128 8 /* Abbrev: DW_TAG_subrange_type with block */ ++ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */ ++ .byte 0 /* DW_AT_lower_bound */ ++ .byte 2f - 1f /* DW_AT_upper_bound */ ++1: .byte 0x50 /* DW_OP_reg0 */ ++2: ++ .byte 0 /* End of children of die */ ++ +.Luint_type: + .uleb128 4 /* Abbrev: DW_TAG_base_type */ + .4byte .Luint_str /* DW_AT_name */ @@ -13319,6 +9485,15 @@ index 0000000..7fb00ea + .4byte vardata /* */ +2: + ++ /* DW_AT_upper_bound is referencing register. */ ++ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */ ++ .string "reg_string" /* DW_AT_name */ ++ .4byte .Larrayreg_type-.Lcu1_begin /* DW_AT_type */ ++ .byte 2f - 1f /* DW_AT_location */ ++1: .byte 3 /* DW_OP_addr */ ++ .4byte vardata /* */ ++2: ++ + .byte 0 /* End of children of CU */ +.Lcu1_end: + @@ -13416,6 +9591,18 @@ index 0000000..7fb00ea + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ + ++ .uleb128 8 /* Abbrev code */ ++ .uleb128 0x21 /* DW_TAG_subrange_type with block */ ++ .byte 0x0 /* no children */ ++ .uleb128 0x49 /* DW_AT_type */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .uleb128 0x22 /* DW_AT_lower_bound */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .uleb128 0x2f /* DW_AT_upper_bound */ ++ .uleb128 0xa /* DW_FORM_block1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ + .byte 0x0 /* Terminator */ + +/* String table */ @@ -13428,10 +9615,10 @@ index 0000000..7fb00ea + .string "unsigned int" diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp new file mode 100644 -index 0000000..5dbed3f +index 0000000..815ed93 --- /dev/null +++ b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp -@@ -0,0 +1,51 @@ +@@ -0,0 +1,54 @@ +# Copyright 2010 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -13483,6 +9670,9 @@ index 0000000..5dbed3f + +gdb_test "p b_string" { = (0x[0-9a-f]+ )?"seennotseen"} +gdb_test "ptype b_string" {type = char \[\]} ++ ++# The register contains unpredictable value - the array size. ++gdb_test "ptype reg_string" {type = char \[-?[0-9]+\]} diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.c b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c new file mode 100644 index 0000000..1f02d90 @@ -13842,6 +10032,121 @@ index 0000000..e492b3a + print *, c40pt ! break-here + +end program repro +diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 +new file mode 100644 +index 0000000..261ce17 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 +@@ -0,0 +1,24 @@ ++! 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. ++! ++! Ihis file is the Fortran source file for dynamic.exp. ++! Original file written by Jakub Jelinek . ++! Modified for the GDB testcase by Jan Kratochvil . ++ ++subroutine bar ++ real :: dummy ++ dummy = 1 ++end subroutine bar +diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp +new file mode 100644 +index 0000000..4fdd5ee +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp +@@ -0,0 +1,37 @@ ++# 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. ++ ++set testfile "dynamic-other-frame" ++set srcfile1 ${testfile}.f90 ++set srcfile2 ${testfile}-stub.f90 ++set objfile2 ${objdir}/${subdir}/${testfile}-stub.o ++set executable ${testfile} ++set binfile ${objdir}/${subdir}/${executable} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${objfile2}" object {f77}] != "" ++ || [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${objfile2}" "${binfile}" executable {debug f77}] != "" } { ++ untested "Couldn't compile ${srcfile1} or ${srcfile2}" ++ return -1 ++} ++ ++clean_restart ${executable} ++ ++if ![runto bar_] then { ++ perror "couldn't run to bar_" ++ continue ++} ++ ++gdb_test "bt" {foo \(string='hello'.*} +diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 +new file mode 100644 +index 0000000..2bc637d +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 +@@ -0,0 +1,36 @@ ++! 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. ++! ++! Ihis file is the Fortran source file for dynamic.exp. ++! Original file written by Jakub Jelinek . ++! Modified for the GDB testcase by Jan Kratochvil . ++ ++subroutine foo (string) ++ interface ++ subroutine bar ++ end subroutine ++ end interface ++ character string*(*) ++ call bar ! stop-here ++end subroutine foo ++program test ++ interface ++ subroutine foo (string) ++ character string*(*) ++ end subroutine ++ end interface ++ call foo ('hello') ++end diff --git a/gdb/testsuite/gdb.fortran/dynamic.exp b/gdb/testsuite/gdb.fortran/dynamic.exp new file mode 100644 index 0000000..0ccebe0 @@ -14205,28 +10510,13 @@ index 0000000..226dc5d + h = 'h' + call foo (g, h) +end -diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp -index fc8bccc..e053813 100644 ---- a/gdb/testsuite/gdb.gdb/selftest.exp -+++ b/gdb/testsuite/gdb.gdb/selftest.exp -@@ -92,6 +92,10 @@ proc do_steps_and_nexts {} { - set description "step over ttyarg initialization" - set command "step" - } -+ -re ".*python_script = 0.*$gdb_prompt $" { -+ set description "step over python_script initialization" -+ set command "step" -+ } - -re ".*pre_stat_chain = make_command_stats_cleanup.*$gdb_prompt $" { - set description "next over make_command_stats_cleanup and everything it calls" - set command "next" -diff --git a/gdb/testsuite/gdb.java/jnpe.exp b/gdb/testsuite/gdb.java/jnpe.exp +diff --git a/gdb/testsuite/gdb.fortran/subrange.exp b/gdb/testsuite/gdb.fortran/subrange.exp new file mode 100644 -index 0000000..55aa80d +index 0000000..55598f9 --- /dev/null -+++ b/gdb/testsuite/gdb.java/jnpe.exp -@@ -0,0 +1,74 @@ -+# Copyright 2009 Free Software Foundation, Inc. ++++ b/gdb/testsuite/gdb.fortran/subrange.exp +@@ -0,0 +1,51 @@ ++# Copyright 2011 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 @@ -14241,75 +10531,95 @@ index 0000000..55aa80d +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + -+if $tracelevel then { -+ strace $tracelevel -+} ++if { [skip_fortran_tests] } { return -1 } + -+load_lib "java.exp" -+ -+set testfile "jnpe" -+set srcfile ${testfile}.java -+set binfile ${objdir}/${subdir}/${testfile} -+if { [compile_java_from_source ${srcdir}/$subdir/${srcfile} ${binfile} "-g"] != "" } { -+ untested "Couldn't compile ${srcdir}/$subdir/${srcfile}" ++set testfile "subrange" ++set srcfile ${testfile}.f90 ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f77}] } { + return -1 +} + -+# Start with a fresh gdb. -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+set line [gdb_get_line_number "break here" $testfile.java] -+gdb_test "break $testfile.java:$line" "" -+ -+gdb_test "run" \ -+ "// break here.*" \ -+ "run java next-over-throw" -+ -+# See whether we have the needed unwinder hooks. -+set ok 1 -+gdb_test_multiple "print _Unwind_DebugHook" "check for unwinder hook in java" { -+ -re "= .*_Unwind_DebugHook.*\r\n$gdb_prompt $" { -+ pass "check for unwinder hook in java" -+ } -+ -re "No symbol .* in current context.?\r\n$gdb_prompt $" { -+ # Pass the test so we don't get bogus fails in the results. -+ setup_xfail *-*-* -+ fail "check for unwinder hook in java" -+ set ok 0 -+ } -+} -+if {!$ok} { -+ untested jnpe.exp -+ return -1 ++if ![runto MAIN__] { ++ perror "Couldn't run to MAIN__" ++ continue +} + -+gdb_test "handle SIGSEGV nostop noprint" \ -+ "SIGSEGV.*fault" \ -+ "disable SIGSEGV for next-over-NPE" ++# Depending on the compiler version being used, the name of the 4-byte integer ++# and real types can be printed differently. For instance, gfortran-4.1 uses ++# "int4" whereas gfortran-4.3 uses "int(kind=4)". ++set int4 "(int4|integer\\(kind=4\\))" + -+# The line where we stop differ according to gcj; check just we did not already -+# execute the catch point. ++gdb_breakpoint [gdb_get_line_number "break-static"] ++gdb_continue_to_breakpoint "break-static" ".*break-static.*" + -+gdb_test "next" \ -+ "" \ -+ "next over NPE" -+ -+gdb_breakpoint [gdb_get_line_number "catch point"] -+gdb_continue_to_breakpoint "catch point" ".*// catch point.*" -diff --git a/gdb/testsuite/gdb.java/jnpe.java b/gdb/testsuite/gdb.java/jnpe.java ++gdb_test "p a (2, 2:3)" { = \(22, 32\)} ++gdb_test "p a (2:3, 3)" { = \(32, 33\)} ++gdb_test "p a (1, 2:)" { = \(21, 31\)} ++gdb_test "p a (2, :2)" { = \(12, 22\)} ++gdb_test "p a (3, 2:2)" { = \(23\)} ++gdb_test "ptype a (3, 2:2)" " = $int4 \\(2:2\\)" ++gdb_test "p a (4, :)" { = \(14, 24, 34\)} ++gdb_test "p a (:, :)" { = \(\( *11, 12, 13, 14\) \( *21, 22, 23, 24\) \( *31, 32, 33, 34\) *\)} ++gdb_test "ptype a (:, :)" " = $int4 \\(4,3\\)" ++gdb_test "p a (:)" "Wrong number of subscripts" ++gdb_test "p a (:, :, :)" "Wrong number of subscripts" ++gdb_test_no_output {set $a=a} ++delete_breakpoints ++gdb_unload ++gdb_test {p $a (3, 2:2)} { = \(23\)} +diff --git a/gdb/testsuite/gdb.fortran/subrange.f90 b/gdb/testsuite/gdb.fortran/subrange.f90 new file mode 100644 -index 0000000..3524830 +index 0000000..fe33c2c --- /dev/null -+++ b/gdb/testsuite/gdb.java/jnpe.java -@@ -0,0 +1,38 @@ -+// Test next-over-NPE. ++++ b/gdb/testsuite/gdb.fortran/subrange.f90 +@@ -0,0 +1,23 @@ ++! Copyright 2011 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 . ++ ++program test ++ integer :: a (4, 3) ++ do 1 i = 1, 4 ++ do 1 j = 1, 3 ++ a (i, j) = j * 10 + i ++1 continue ++ write (*,*) a ! break-static ++end +diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp +index 30a71dd..4bb8e7d 100644 +--- a/gdb/testsuite/gdb.gdb/selftest.exp ++++ b/gdb/testsuite/gdb.gdb/selftest.exp +@@ -92,6 +92,10 @@ proc do_steps_and_nexts {} { + set description "step over ttyarg initialization" + set command "step" + } ++ -re ".*python_script = 0.*$gdb_prompt $" { ++ set description "step over python_script initialization" ++ set command "step" ++ } + -re ".*pre_stat_chain = make_command_stats_cleanup.*$gdb_prompt $" { + set description "next over make_command_stats_cleanup and everything it calls" + set command "next" +diff --git a/gdb/testsuite/gdb.multi/watchpoint-multi.c b/gdb/testsuite/gdb.multi/watchpoint-multi.c +new file mode 100644 +index 0000000..153c18b +--- /dev/null ++++ b/gdb/testsuite/gdb.multi/watchpoint-multi.c +@@ -0,0 +1,59 @@ +/* This testcase is part of GDB, the GNU debugger. + -+ Copyright 2009 Free Software Foundation, Inc. ++ 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 @@ -14322,28 +10632,169 @@ index 0000000..3524830 + 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 . -+ */ ++ along with this program. If not, see . */ + -+public class jnpe ++#include ++#include ++ ++static volatile int a, b, c; ++ ++static void ++marker_exit1 (void) +{ -+ public static String npe () -+ { -+ return ((Object) null).toString(); -+ } -+ -+ public static void main (String[] args) -+ { -+ try -+ { -+ System.out.println (npe ()); // break here -+ } -+ catch (NullPointerException n) -+ { -+ System.out.println ("success"); // catch point -+ } -+ } ++ a = 1; +} ++ ++/* Workaround PR breakpoints/12272 by two different breakpoint locations. */ ++static void ++marker_exit2 (void) ++{ ++ a = 1; ++} ++ ++static void * ++start (void *arg) ++{ ++ b = 2; ++ c = 3; ++ ++ return NULL; ++} ++ ++int ++main (void) ++{ ++ pthread_t thread; ++ int i; ++ ++ i = pthread_create (&thread, NULL, start, NULL); ++ assert (i == 0); ++ i = pthread_join (thread, NULL); ++ assert (i == 0); ++ ++ marker_exit1 (); ++ marker_exit2 (); ++ return 0; ++} +diff --git a/gdb/testsuite/gdb.multi/watchpoint-multi.exp b/gdb/testsuite/gdb.multi/watchpoint-multi.exp +new file mode 100644 +index 0000000..97fa6cd +--- /dev/null ++++ b/gdb/testsuite/gdb.multi/watchpoint-multi.exp +@@ -0,0 +1,113 @@ ++# 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 . ++ ++if { [is_remote target] || ![isnative] } then { ++ continue ++} ++ ++set testfile "watchpoint-multi" ++ ++set executable ${testfile} ++set srcfile ${testfile}.c ++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 ++} ++# Never keep/use any non-hw breakpoints to workaround a multi-inferior bug. ++delete_breakpoints ++ ++gdb_test "add-inferior" "Added inferior 2" ++gdb_test "inferior 2" "witching to inferior 2 .*" ++gdb_load $binfile ++ ++if ![runto_main] { ++ return ++} ++delete_breakpoints ++ ++# Simulate non-stop+target-async which also uses breakpoint always-inserted. ++gdb_test_no_output "set breakpoint always-inserted on" ++# displaced-stepping is also needed as other GDB sometimes still removes the ++# breakpoints, even with always-inserted on. ++gdb_test_no_output "set displaced-stepping on" ++ ++# Debugging of this testcase: ++#gdb_test_no_output "maintenance set show-debug-regs on" ++#gdb_test_no_output "set debug infrun 1" ++ ++# Do not use simple hardware watchpoint ("watch") as its false hit may be ++# unnoticed by GDB if it reads it still has the same value. ++gdb_test "awatch c" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: c" ++# Never keep/use any non-hw breakpoints to workaround a multi-inferior bug. ++# Use `*' to workaround a multi-inferior bug. ++set test "hbreak *marker_exit2" ++gdb_test_multiple $test $test { ++ -re "Hardware assisted breakpoint \[0-9\]+ at .*\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "(No hardware breakpoint support in the target\\.|Hardware breakpoints used exceeds limit\\.)\r\n$gdb_prompt $" { ++ pass $test ++ untested ${testfile}.exp ++ return ++ } ++} ++ ++gdb_test "inferior 1" "witching to inferior 1 .*" ++ ++gdb_test "awatch b" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: b" ++gdb_test "hbreak *marker_exit1" {Hardware assisted breakpoint [0-9]+ at .*} ++ ++gdb_test "inferior 2" "witching to inferior 2 .*" ++ ++# FAIL would be a hit on watchpoint for `b' - that one is for the other ++# inferior. ++gdb_test "continue" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: c\r\n\r\nOld value = 0\r\nNew value = 3\r\n.*" "catch c" ++ ++set test "catch marker_exit2" ++gdb_test_multiple "continue" $test { ++ -re "Breakpoint \[0-9\]+, marker_exit2 .*\r\n$gdb_prompt $" { ++ setup_kfail breakpoints/12312 *-*-* ++ pass $test ++ } ++ -re "Hardware access \\(read/write\\) watchpoint \[0-9\]+: c\r\n\r\nValue = 3\r\n(.* in )?__nptl_death_event .*\r\n$gdb_prompt $" { ++ setup_kfail breakpoints/12312 *-*-* ++ fail $test ++ } ++} ++ ++gdb_test "inferior 1" "witching to inferior 1 .*" ++ ++gdb_test "continue" "Hardware access \\(read/write\\) watchpoint \[0-9\]+: b\r\n\r\nOld value = 0\r\nNew value = 2\r\n.*" "catch b" ++ ++set test "catch marker_exit1" ++gdb_test_multiple "continue" $test { ++ -re "Breakpoint \[0-9\]+, marker_exit1 .*\r\n$gdb_prompt $" { ++ setup_kfail breakpoints/12312 *-*-* ++ pass $test ++ } ++ -re "Hardware access \\(read/write\\) watchpoint \[0-9\]+: b\r\n\r\nValue = 2\r\n(.* in )?__nptl_death_event .*\r\n$gdb_prompt $" { ++ setup_kfail breakpoints/12312 *-*-* ++ fail $test ++ } ++} ++ diff --git a/gdb/testsuite/gdb.opt/array-from-register-func.c b/gdb/testsuite/gdb.opt/array-from-register-func.c new file mode 100644 index 0000000..729f457 @@ -14445,87 +10896,6 @@ index 0000000..f2de718 +# Seen regression: +# Address requested for identifier "arr" which is in register $rdi +gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42" -diff --git a/gdb/testsuite/gdb.opt/fortran-string.exp b/gdb/testsuite/gdb.opt/fortran-string.exp -new file mode 100644 -index 0000000..f997eec ---- /dev/null -+++ b/gdb/testsuite/gdb.opt/fortran-string.exp -@@ -0,0 +1,41 @@ -+# Copyright 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 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. -+ -+# This file was written by Jan Kratochvil . -+ -+# Test GDB can cope with Fortran strings having their length present in a CPU -+# register. With -O0 the string length is passed on the stack. To make this -+# test meaningful the follow assertion should pass. It is not being checked -+# here as the "_s" symbol is compiler dependent: -+# (gdb) info address _s -+# Symbol "_s" is a variable in register XX. -+ -+set test fortran-string -+set srcfile ${test}.f90 -+if { [prepare_for_testing ${test}.exp ${test} ${srcfile} {debug f77 additional_flags=-O2}] } { -+ return -1 -+} -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+gdb_breakpoint [gdb_get_line_number "s = s"] -+gdb_continue_to_breakpoint "s = s" -+gdb_test "frame" ".*s='foo'.*" -+gdb_test "ptype s" "type = character\\*3" -+gdb_test "p s" "\\$\[0-9\]* = 'foo'" -diff --git a/gdb/testsuite/gdb.opt/fortran-string.f90 b/gdb/testsuite/gdb.opt/fortran-string.f90 -new file mode 100644 -index 0000000..e48d520 ---- /dev/null -+++ b/gdb/testsuite/gdb.opt/fortran-string.f90 -@@ -0,0 +1,28 @@ -+! Copyright 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 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. -+! -+! Ihis file is the Fortran source file for dynamic.exp. -+! Original file written by Jakub Jelinek . -+! Modified for the GDB testcase by Jan Kratochvil . -+ -+ subroutine f(s) -+ character*(*) s -+ s = s -+ end -+ -+ program main -+ call f ('foo') -+ end diff --git a/gdb/testsuite/gdb.pascal/arrays.exp b/gdb/testsuite/gdb.pascal/arrays.exp new file mode 100644 index 0000000..ccc6e1e @@ -14724,40 +11094,11 @@ index 0000000..295602d + s := 'test'#0'string'; + writeln(s); { set breakpoint 2 here } +end. -diff --git a/gdb/testsuite/gdb.python/py-cmd.exp b/gdb/testsuite/gdb.python/py-cmd.exp -index 0f250d2..84e5038 100644 ---- a/gdb/testsuite/gdb.python/py-cmd.exp -+++ b/gdb/testsuite/gdb.python/py-cmd.exp -@@ -20,24 +20,6 @@ if $tracelevel then { - strace $tracelevel - } - --# Usage: gdb_py_test_multiple NAME INPUT RESULT {INPUT RESULT}... --# Run a test named NAME, consisting of multiple lines of input. --# After each input line INPUT, search for result line RESULT. --# Succeed if all results are seen; fail otherwise. --proc gdb_py_test_multiple {name args} { -- global gdb_prompt -- foreach {input result} $args { -- if {[gdb_test_multiple $input "$name - $input" { -- -re "\[\r\n\]*($result)\[\r\n\]+($gdb_prompt | *>)$" { -- pass "$name - $input" -- } -- }]} { -- return 1 -- } -- } -- return 0 --} -- - # Start with a fresh gdb. - - gdb_exit diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp -index e1212d3..77f44f5 100644 +index e3b5629..2a63d8d 100644 --- a/gdb/testsuite/gdb.python/py-frame.exp +++ b/gdb/testsuite/gdb.python/py-frame.exp -@@ -89,8 +89,6 @@ gdb_py_test_silent_cmd "python f0 = f1.newer ()" "get first frame" 0 +@@ -87,8 +87,6 @@ gdb_test "python print bframe == gdb.newest_frame()" True \ gdb_test "python print 'result =', f0 == f1" " = False" "test equality comparison (false)" gdb_test "python print 'result =', f0 == f0" " = True" "test equality comparison (true)" @@ -14766,59 +11107,17 @@ index e1212d3..77f44f5 100644 gdb_test "python print 'result =', f0.is_valid ()" " = True" "test Frame.is_valid" gdb_test "python print 'result =', f0.name ()" " = f2" "test Frame.name" gdb_test "python print 'result =', f0.type () == gdb.NORMAL_FRAME" " = True" "test Frame.type" -@@ -105,3 +103,5 @@ gdb_test "python print 'result =', f0.read_var ('variable_which_surely_doesnt_ex +@@ -103,3 +101,5 @@ gdb_test "python print 'result =', f0.read_var ('variable_which_surely_doesnt_ex gdb_test "python print 'result =', f0.read_var ('a')" " = 1" "test Frame.read_var - success" gdb_test "python print 'result =', gdb.selected_frame () == f1" " = True" "test gdb.selected_frame" + +gdb_test "python print 'result =', f0.block ()" "" "test Frame.block" -diff --git a/gdb/testsuite/gdb.python/py-function.exp b/gdb/testsuite/gdb.python/py-function.exp -index 38c5693..e7f0037 100644 ---- a/gdb/testsuite/gdb.python/py-function.exp -+++ b/gdb/testsuite/gdb.python/py-function.exp -@@ -20,24 +20,6 @@ if $tracelevel then { - strace $tracelevel - } - --# Usage: gdb_py_test_multiple NAME INPUT RESULT {INPUT RESULT}... --# Run a test named NAME, consisting of multiple lines of input. --# After each input line INPUT, search for result line RESULT. --# Succeed if all results are seen; fail otherwise. --proc gdb_py_test_multiple {name args} { -- global gdb_prompt -- foreach {input result} $args { -- if {[gdb_test_multiple $input "$name - $input" { -- -re "\[\r\n\]*($result)\[\r\n\]+($gdb_prompt | *>)$" { -- pass "$name - $input" -- } -- }]} { -- return 1 -- } -- } -- return 0 --} -- - # Start with a fresh gdb. - - gdb_exit -diff --git a/gdb/testsuite/gdb.python/py-prettyprint.exp b/gdb/testsuite/gdb.python/py-prettyprint.exp -index 3b2aadd..03bbf3e 100644 ---- a/gdb/testsuite/gdb.python/py-prettyprint.exp -+++ b/gdb/testsuite/gdb.python/py-prettyprint.exp -@@ -102,6 +102,8 @@ proc run_lang_tests {lang} { - gdb_test "print estring" "\"embedded x\\\\201\\\\202\\\\203\\\\204\"" - gdb_test "print c" " = container \"container\" with 2 elements = {$nl *.0. = 23,$nl *.1. = 72$nl}" - -+ gdb_test "print nullstr" "RuntimeError: Error reading string from inferior.*" -+ - gdb_test "print nstype" " = {$nl *.0. = 7,$nl *.1. = 42$nl}" - gdb_test "continue" "Program exited normally\." - diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp -index a24bc11..e3043bc 100644 +index e012d53..1bd9e53 100644 --- a/gdb/testsuite/gdb.python/py-value.exp +++ b/gdb/testsuite/gdb.python/py-value.exp -@@ -313,6 +313,15 @@ proc test_value_after_death {} { +@@ -318,6 +318,15 @@ proc test_value_after_death {} { "print value's type" } @@ -14834,23 +11133,23 @@ index a24bc11..e3043bc 100644 # Regression test for invalid subscript operations. The bug was that # the type of the value was not being checked before allowing a # subscript operation to proceed. -@@ -437,6 +446,7 @@ if ![runto_main] then { - test_value_in_inferior +@@ -455,6 +464,7 @@ test_value_in_inferior + test_inferior_function_call test_lazy_strings test_value_after_death +test_cast_regression # The following test recompiles the binary to test either C or C++ # values. -diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c b/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c +diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-child.c b/gdb/testsuite/gdb.threads/watchpoint-fork-child.c new file mode 100644 -index 0000000..4dc308b +index 0000000..a2ad29a --- /dev/null -+++ b/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c -@@ -0,0 +1,175 @@ ++++ b/gdb/testsuite/gdb.threads/watchpoint-fork-child.c +@@ -0,0 +1,127 @@ +/* Test case for forgotten hw-watchpoints after fork()-off of a process. + -+ Copyright 2008, 2009 Free Software Foundation, Inc. ++ Copyright 2008, 2009, 2010 Free Software Foundation, Inc. + + This file is part of GDB. + @@ -14871,61 +11170,12 @@ index 0000000..4dc308b + +#include +#include ++#include ++#include ++#include ++#include + -+static void -+delay (void) -+{ -+ int i = usleep (1000000 / 100); -+ assert (i == 0 || errno == EINTR); -+} -+ -+#if defined FOLLOW_PARENT -+ -+static void -+forkoff (int nr) -+{ -+ pid_t child, pid_got; -+ int exit_code = 42 + nr; -+ int status, i; -+ -+ child = fork (); -+ switch (child) -+ { -+ case -1: -+ assert (0); -+ case 0: -+ printf ("child%d: %d\n", nr, (int) getpid ()); -+ /* Delay to get both the "child%d" and "parent%d" message printed without -+ a race breaking expect by its endless wait on `$gdb_prompt$': -+ Breakpoint 3, breakpoint () at ../../../gdb/testsuite/gdb.threads/watchpoint-fork.c:33 -+ 33 } -+ (gdb) parent2: 14223 */ -+ i = sleep (1); -+ assert (i == 0); -+ -+ /* We must not get caught here (against a forgotten breakpoint). */ -+ var++; -+ breakpoint (); -+ -+ _exit (exit_code); -+ default: -+ printf ("parent%d: %d\n", nr, (int) child); -+ /* Delay to get both the "child%d" and "parent%d" message printed, see -+ above. */ -+ i = sleep (1); -+ assert (i == 0); -+ -+ pid_got = wait (&status); -+ assert (pid_got == child); -+ assert (WIFEXITED (status)); -+ assert (WEXITSTATUS (status) == exit_code); -+ -+ /* We must get caught here (against a false watchpoint removal). */ -+ breakpoint (); -+ } -+} -+ -+#elif defined FOLLOW_CHILD ++#include "watchpoint-fork.h" + +static volatile int usr1_got; + @@ -14935,11 +11185,11 @@ index 0000000..4dc308b + usr1_got++; +} + -+static void ++void +forkoff (int nr) +{ -+ pid_t child; -+ int i, loop; ++ pid_t child, save_parent = getpid (); ++ int i; + struct sigaction act, oldact; +#ifdef THREAD + void *thread_result; @@ -14970,7 +11220,7 @@ index 0000000..4dc308b + /* We must not get caught here (against a forgotten breakpoint). */ + + var++; -+ breakpoint (); ++ marker (); + +#ifdef THREAD + /* And neither got caught our thread. */ @@ -14998,40 +11248,41 @@ index 0000000..4dc308b + + /* Let the parent signal us about its success. Be careful of races. */ + -+ for (loop = 0; loop < 1000; loop++) ++ for (;;) + { + /* Parent either died (and USR1_GOT is zero) or it succeeded. */ ++ if (getppid () != save_parent) ++ break; + if (kill (getppid (), 0) != 0) + break; + /* Parent succeeded? */ + if (usr1_got) + break; + -+ delay (); ++#ifdef THREAD ++ i = pthread_yield (); ++ assert (i == 0); ++#endif + } + assert (usr1_got); + + /* We must get caught here (against a false watchpoint removal). */ + -+ breakpoint (); ++ marker (); + } + + i = sigaction (SIGUSR1, &oldact, NULL); + assert (i == 0); +} -+ -+#else -+# error "!FOLLOW_PARENT && !FOLLOW_CHILD" -+#endif diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c b/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c new file mode 100644 -index 0000000..edacfc0 +index 0000000..08a5aff --- /dev/null +++ b/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c -@@ -0,0 +1,157 @@ +@@ -0,0 +1,174 @@ +/* Test case for forgotten hw-watchpoints after fork()-off of a process. + -+ Copyright 2008, 2009 Free Software Foundation, Inc. ++ Copyright 2008, 2009, 2010 Free Software Foundation, Inc. + + This file is part of GDB. + @@ -15061,49 +11312,56 @@ index 0000000..edacfc0 +#include +#define gettid() syscall (__NR_gettid) + ++#include "watchpoint-fork.h" ++ +/* Non-atomic `var++' should not hurt as we synchronize the threads by the STEP + variable. Hit-comments need to be duplicite there to catch both at-stops + and behind-stops, depending on the target. */ + -+static volatile int var; ++volatile int var; + -+static void -+dummy (void) ++void ++marker (void) +{ +} + +static void -+breakpoint (void) ++empty (void) +{ +} + -+/* Include here the functions: -+ static void forkoff (int nr); -+ static void delay (void); */ ++static void ++mark_exit (void) ++{ ++} + -+static pthread_t thread; -+static volatile int step; -+#define THREAD -+ -+#include "watchpoint-fork-forkoff.c" ++pthread_t thread; ++volatile int step; + +static void * +start (void *arg) +{ ++ int i; ++ + if (step >= 3) + goto step_3; + + while (step != 1) -+ delay (); ++ { ++ i = pthread_yield (); ++ assert (i == 0); ++ } + + var++; /* validity-thread-B */ -+ dummy (); /* validity-thread-B */ ++ empty (); /* validity-thread-B */ + step = 2; + while (step != 3) + { + if (step == 99) + goto step_99; -+ delay (); ++ ++ i = pthread_yield (); ++ assert (i == 0); + } + +step_3: @@ -15111,24 +11369,26 @@ index 0000000..edacfc0 + goto step_5; + + var++; /* after-fork1-B */ -+ dummy (); /* after-fork1-B */ ++ empty (); /* after-fork1-B */ + step = 4; + while (step != 5) + { + if (step == 99) + goto step_99; -+ delay (); ++ ++ i = pthread_yield (); ++ assert (i == 0); + } + +step_5: + var++; /* after-fork2-B */ -+ dummy (); /* after-fork2-B */ ++ empty (); /* after-fork2-B */ + return (void *) 5UL; + +step_99: + /* We must not get caught here (against a forgotten breakpoint). */ + var++; -+ breakpoint (); ++ marker (); + return (void *) 99UL; +} + @@ -15141,24 +11401,28 @@ index 0000000..edacfc0 + setbuf (stdout, NULL); + printf ("main: %d\n", (int) gettid ()); + -+ /* General watchpoints validity. */ ++ /* General hardware breakpoints and watchpoints validity. */ ++ marker (); + var++; /* validity-first */ -+ dummy (); /* validity-first */ ++ empty (); /* validity-first */ + + i = pthread_create (&thread, NULL, start, NULL); + assert (i == 0); + + var++; /* validity-thread-A */ -+ dummy (); /* validity-thread-A */ ++ empty (); /* validity-thread-A */ + step = 1; + while (step != 2) -+ delay (); ++ { ++ i = pthread_yield (); ++ assert (i == 0); ++ } + + /* Hardware watchpoints got disarmed here. */ + forkoff (1); + + var++; /* after-fork1-A */ -+ dummy (); /* after-fork1-A */ ++ empty (); /* after-fork1-A */ + step = 3; +#ifdef FOLLOW_CHILD + /* Spawn new thread as it was deleted in the child of FORK. */ @@ -15166,13 +11430,16 @@ index 0000000..edacfc0 + assert (i == 0); +#endif + while (step != 4) -+ delay (); ++ { ++ i = pthread_yield (); ++ assert (i == 0); ++ } + + /* A sanity check for double hardware watchpoints removal. */ + forkoff (2); + + var++; /* after-fork2-A */ -+ dummy (); /* after-fork2-A */ ++ empty (); /* after-fork2-A */ + step = 5; +#ifdef FOLLOW_CHILD + /* Spawn new thread as it was deleted in the child of FORK. */ @@ -15184,17 +11451,98 @@ index 0000000..edacfc0 + assert (i == 0); + assert (thread_result == (void *) 5UL); + ++ mark_exit (); + return 0; +} -diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork.c b/gdb/testsuite/gdb.threads/watchpoint-fork.c +diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-parent.c b/gdb/testsuite/gdb.threads/watchpoint-fork-parent.c new file mode 100644 -index 0000000..5f62e7f +index 0000000..82d1182 --- /dev/null -+++ b/gdb/testsuite/gdb.threads/watchpoint-fork.c -@@ -0,0 +1,57 @@ ++++ b/gdb/testsuite/gdb.threads/watchpoint-fork-parent.c +@@ -0,0 +1,74 @@ +/* Test case for forgotten hw-watchpoints after fork()-off of a process. + -+ Copyright 2008, 2009 Free Software Foundation, Inc. ++ Copyright 2008, 2009, 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 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. */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include "watchpoint-fork.h" ++ ++void ++forkoff (int nr) ++{ ++ pid_t child, pid_got; ++ int exit_code = 42 + nr; ++ int status, i; ++ ++ child = fork (); ++ switch (child) ++ { ++ case -1: ++ assert (0); ++ case 0: ++ printf ("child%d: %d\n", nr, (int) getpid ()); ++ /* Delay to get both the "child%d" and "parent%d" message printed without ++ a race breaking expect by its endless wait on `$gdb_prompt$': ++ Breakpoint 3, marker () at ../../../gdb/testsuite/gdb.threads/watchpoint-fork.c:33 ++ 33 } ++ (gdb) parent2: 14223 */ ++ i = sleep (1); ++ assert (i == 0); ++ ++ /* We must not get caught here (against a forgotten breakpoint). */ ++ var++; ++ marker (); ++ ++ _exit (exit_code); ++ default: ++ printf ("parent%d: %d\n", nr, (int) child); ++ /* Delay to get both the "child%d" and "parent%d" message printed, see ++ above. */ ++ i = sleep (1); ++ assert (i == 0); ++ ++ pid_got = wait (&status); ++ assert (pid_got == child); ++ assert (WIFEXITED (status)); ++ assert (WEXITSTATUS (status) == exit_code); ++ ++ /* We must get caught here (against a false watchpoint removal). */ ++ marker (); ++ } ++} +diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork-st.c b/gdb/testsuite/gdb.threads/watchpoint-fork-st.c +new file mode 100644 +index 0000000..a7eeedd +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/watchpoint-fork-st.c +@@ -0,0 +1,61 @@ ++/* Test case for forgotten hw-watchpoints after fork()-off of a process. ++ ++ Copyright 2008, 2009, 2010 Free Software Foundation, Inc. + + This file is part of GDB. + @@ -15219,17 +11567,19 @@ index 0000000..5f62e7f +#include +#include + -+static volatile int var; ++#include "watchpoint-fork.h" + -+static void -+breakpoint (void) ++volatile int var; ++ ++void ++marker (void) +{ +} + -+/* Include here the function: -+ static void forkoff (int nr); */ -+ -+#include "watchpoint-fork-forkoff.c" ++static void ++mark_exit (void) ++{ ++} + +int +main (void) @@ -15237,7 +11587,8 @@ index 0000000..5f62e7f + setbuf (stdout, NULL); + printf ("main: %d\n", (int) getpid ()); + -+ /* General watchpoints validity. */ ++ /* General hardware breakpoints and watchpoints validity. */ ++ marker (); + var++; + /* Hardware watchpoints got disarmed here. */ + forkoff (1); @@ -15247,15 +11598,16 @@ index 0000000..5f62e7f + forkoff (2); + var++; + ++ mark_exit (); + return 0; +} diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork.exp b/gdb/testsuite/gdb.threads/watchpoint-fork.exp new file mode 100644 -index 0000000..1dc93ab +index 0000000..117700b --- /dev/null +++ b/gdb/testsuite/gdb.threads/watchpoint-fork.exp -@@ -0,0 +1,130 @@ -+# Copyright 2008, 2009 Free Software Foundation, Inc. +@@ -0,0 +1,149 @@ ++# Copyright 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 @@ -15273,56 +11625,72 @@ index 0000000..1dc93ab +# Test case for forgotten hw-watchpoints after fork()-off of a process. + +proc test {type symbol} { -+ global objdir subdir srcdir ++ global objdir subdir srcdir gdb_prompt + -+ set test watchpoint-fork ++ set testfile watchpoint-fork + + global pf_prefix + set prefix_test $pf_prefix + lappend pf_prefix "$type:" + set prefix_mt $pf_prefix + ++ set srcfile_type ${srcdir}/${subdir}/${testfile}-${type}.c ++ ++ + # no threads + + set pf_prefix $prefix_mt + lappend pf_prefix "singlethreaded:" + -+ set executable ${test}-${type} -+ if { [gdb_compile ${srcdir}/${subdir}/${test}.c ${objdir}/${subdir}/${executable} executable [list debug additional_flags=-D$symbol]] != "" } { -+ untested ${test}.exp -+ return -1 ++ set executable ${testfile}-${type}-st ++ set srcfile_main ${srcdir}/${subdir}/${testfile}-st.c ++ if { [gdb_compile "${srcfile_main} ${srcfile_type}" ${objdir}/${subdir}/${executable} executable [list debug additional_flags=-D$symbol]] != "" } { ++ untested ${testfile}.exp ++ return + } + clean_restart $executable + -+ gdb_test "show detach-on-fork" "Whether gdb will detach the child of a fork is on." -+ gdb_test "set follow-fork-mode $type" -+ gdb_test "show follow-fork-mode" "Debugger response to a program call of fork or vfork is \"$type\"." ++ gdb_test "show detach-on-fork" "Whether gdb will detach the child of a fork is on\\." ++ gdb_test_no_output "set follow-fork-mode $type" ++ gdb_test "show follow-fork-mode" "Debugger response to a program call of fork or vfork is \"$type\"\\." + # Testcase uses it for the `follow-fork-mode child' type. -+ gdb_test "handle SIGUSR1 nostop noprint pass" ++ gdb_test "handle SIGUSR1 nostop noprint pass" "No\[ \t\]+No\[ \t\]+Yes.*" + -+ if { ![runto_main] } then { -+ gdb_suppress_tests ++ if ![runto_main] { + return + } + -+ # Install the watchpoint only after getting into MAIN - workaround some PPC -+ # problem. -+ gdb_test "watch var" "atchpoint 2: var" "Set the watchpoint" ++ gdb_test "watch var" "atchpoint \[0-9\]+: var" "Set the watchpoint" + + # It is never hit but it should not be left over in the fork()ed-off child. -+ gdb_breakpoint "breakpoint" ++ set hbreak "hbreak" ++ set test "hbreak marker" ++ gdb_test_multiple $test $test { ++ -re "Hardware assisted breakpoint \[0-9\]+ at .*\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "(No hardware breakpoint support in the target\\.|Hardware breakpoints used exceeds limit\\.)\r\n$gdb_prompt $" { ++ pass $test ++ set hbreak "break" ++ gdb_test "break marker" ++ } ++ } ++ ++ gdb_breakpoint "mark_exit" + + gdb_test "continue" \ -+ "atchpoint 2: var.*Old value = 0.*New value = 1.*forkoff *\\(1\\).*" "watchpoints work" ++ "reakpoint \[0-9\]+, marker.*" "hardware breakpoints work" + gdb_test "continue" \ -+ "reakpoint 3, breakpoint.*" "breakpoint after the first fork" ++ "atchpoint \[0-9\]+: var.*Old value = 0.*New value = 1.*forkoff *\\(1\\).*" "watchpoints work" + gdb_test "continue" \ -+ "atchpoint 2: var.*Old value = 1.*New value = 2.*forkoff *\\(2\\).*" "watchpoint after the first fork" ++ "reakpoint \[0-9\]+, marker.*" "breakpoint after the first fork" + gdb_test "continue" \ -+ "reakpoint 3, breakpoint.*" "breakpoint after the second fork" ++ "atchpoint \[0-9\]+: var.*Old value = 1.*New value = 2.*forkoff *\\(2\\).*" "watchpoint after the first fork" + gdb_test "continue" \ -+ "atchpoint 2: var.*Old value = 2.*New value = 3.*return *0;" "watchpoint after the second fork" -+ gdb_test "continue" "Continuing..*Program exited normally." "finish" ++ "reakpoint \[0-9\]+, marker.*" "breakpoint after the second fork" ++ gdb_test "continue" \ ++ "atchpoint \[0-9\]+: var.*Old value = 2.*New value = 3.*mark_exit \\(\\);" "watchpoint after the second fork" ++ gdb_test "continue" "Continuing\\..*\r\nBreakpoint \[0-9\]+, mark_exit .*" "finish" + + + # threads @@ -15330,75 +11698,120 @@ index 0000000..1dc93ab + set pf_prefix $prefix_mt + lappend pf_prefix "multithreaded:" + -+ set executable ${test}-mt-${type} -+ if { [gdb_compile_pthreads ${srcdir}/${subdir}/${test}-mt.c ${objdir}/${subdir}/${executable} executable [list debug additional_flags=-D$symbol]] != "" } { -+ untested ${test}.exp -+ return -1 ++ set executable ${testfile}-${type}-mt ++ set srcfile_main ${srcdir}/${subdir}/${testfile}-mt.c ++ if { [gdb_compile_pthreads "${srcfile_main} ${srcfile_type}" ${objdir}/${subdir}/${executable} executable [list debug "additional_flags=-D$symbol -DTHREAD"]] != "" } { ++ untested ${testfile}.exp ++ return + } + clean_restart $executable + -+ gdb_test "set follow-fork-mode $type" ++ gdb_test_no_output "set follow-fork-mode $type" + # Testcase uses it for the `follow-fork-mode child' type. -+ gdb_test "handle SIGUSR1 nostop noprint pass" ++ gdb_test "handle SIGUSR1 nostop noprint pass" "No\[ \t\]+No\[ \t\]+Yes.*" + -+ if { ![runto_main] } then { -+ gdb_suppress_tests ++ if ![runto_main] { + return + } + -+ # Install the watchpoint only after getting into MAIN - workaround some PPC -+ # problem. -+ gdb_test "watch var" "atchpoint 2: var" "Set the watchpoint" ++ gdb_test "watch var" "atchpoint \[0-9\]+: var" "Set the watchpoint" + -+ # It is never hit but it should not be left over in the fork()ed-off child. -+ gdb_breakpoint "breakpoint" ++ # It should not be left over in the fork()ed-off child. ++ gdb_test "$hbreak marker" {reakpoint [0-9]+.*} ++ ++ gdb_breakpoint "mark_exit" + + gdb_test "continue" \ -+ "atchpoint 2: var.*Old value = 0.*New value = 1.*validity-first.*" "singlethread watchpoints work" ++ "reakpoint \[0-9\]+, marker.*" "hardware breakpoints work" + gdb_test "continue" \ -+ "atchpoint 2: var.*Old value = 1.*New value = 2.*validity-thread-A.*" "multithreaded watchpoints work at A" ++ "atchpoint \[0-9\]+: var.*Old value = 0.*New value = 1.*validity-first.*" "singlethread watchpoints work" + gdb_test "continue" \ -+ "atchpoint 2: var.*Old value = 2.*New value = 3.*validity-thread-B.*" "multithreaded watchpoints work at B" ++ "atchpoint \[0-9\]+: var.*Old value = 1.*New value = 2.*validity-thread-A.*" "multithreaded watchpoints work at A" + gdb_test "continue" \ -+ "reakpoint 3, breakpoint.*" "breakpoint (A) after the first fork" ++ "atchpoint \[0-9\]+: var.*Old value = 2.*New value = 3.*validity-thread-B.*" "multithreaded watchpoints work at B" + gdb_test "continue" \ -+ "atchpoint 2: var.*Old value = 3.*New value = 4.*after-fork1-A.*" "watchpoint A after the first fork" ++ "reakpoint \[0-9\]+, marker.*" "breakpoint (A) after the first fork" + gdb_test "continue" \ -+ "atchpoint 2: var.*Old value = 4.*New value = 5.*after-fork1-B.*" "watchpoint B after the first fork" ++ "atchpoint \[0-9\]+: var.*Old value = 3.*New value = 4.*after-fork1-A.*" "watchpoint A after the first fork" + gdb_test "continue" \ -+ "reakpoint 3, breakpoint.*" "breakpoint (A) after the second fork" ++ "atchpoint \[0-9\]+: var.*Old value = 4.*New value = 5.*after-fork1-B.*" "watchpoint B after the first fork" + gdb_test "continue" \ -+ "atchpoint 2: var.*Old value = 5.*New value = 6.*after-fork2-A.*" "watchpoint A after the second fork" ++ "reakpoint \[0-9\]+, marker.*" "breakpoint (A) after the second fork" + gdb_test "continue" \ -+ "atchpoint 2: var.*Old value = 6.*New value = 7.*after-fork2-B.*" "watchpoint B after the second fork" -+ gdb_test "continue" "Continuing..*Program exited normally." "finish" ++ "atchpoint \[0-9\]+: var.*Old value = 5.*New value = 6.*after-fork2-A.*" "watchpoint A after the second fork" ++ gdb_test "continue" \ ++ "atchpoint \[0-9\]+: var.*Old value = 6.*New value = 7.*after-fork2-B.*" "watchpoint B after the second fork" ++ gdb_test "continue" "Continuing\\..*\r\nBreakpoint \[0-9\]+, mark_exit .*" "finish" + + + # cleanup -+ + set pf_prefix $prefix_test +} + +test parent FOLLOW_PARENT + +# Only GNU/Linux is known to support `set follow-fork-mode child'. -+if {[istarget "*-*-linux*"]} { ++if {[istarget "*-*-linux*"] && ![is_remote target]} { + test child FOLLOW_CHILD ++} else { ++ untested "child" +} +diff --git a/gdb/testsuite/gdb.threads/watchpoint-fork.h b/gdb/testsuite/gdb.threads/watchpoint-fork.h +new file mode 100644 +index 0000000..31f7656 +--- /dev/null ++++ b/gdb/testsuite/gdb.threads/watchpoint-fork.h +@@ -0,0 +1,32 @@ ++/* Test case for forgotten hw-watchpoints after fork()-off of a process. ++ ++ Copyright 2008, 2009, 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 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. */ ++ ++#ifdef THREAD ++#include ++ ++extern volatile int step; ++extern pthread_t thread; ++#endif /* THREAD */ ++ ++extern volatile int var; ++ ++extern void marker (void); ++extern void forkoff (int nr); diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 20e2fb7..b27d25c 100644 +index 5a3f1fc..4716626 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp -@@ -27,6 +27,7 @@ if {$tool == ""} { - } - - load_lib libgloss.exp -+load_lib python-support.exp - - global GDB - +@@ -140,6 +140,11 @@ proc gdb_unload {} { + verbose "\t\tKilling previous program being debugged" + exp_continue + } ++ -re "A program is being debugged already..*Are you sure you want to change the file.*y or n. $"\ ++ { send_gdb "y\n" ++ verbose "\t\tUnloading symbols for program being debugged" ++ exp_continue ++ } + -re "Discard symbol table from .*y or n.*$" { + send_gdb "y\n" + exp_continue diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp -index 9691bc1..13ea8b5 100644 +index 891da37..236c5ca 100644 --- a/gdb/testsuite/lib/pascal.exp +++ b/gdb/testsuite/lib/pascal.exp @@ -37,6 +37,9 @@ proc pascal_init {} { @@ -15432,113 +11845,20 @@ index 9691bc1..13ea8b5 100644 } set pascal_init_done 1 } -diff --git a/gdb/testsuite/lib/python-support.exp b/gdb/testsuite/lib/python-support.exp -new file mode 100644 -index 0000000..b8e9836 ---- /dev/null -+++ b/gdb/testsuite/lib/python-support.exp -@@ -0,0 +1,53 @@ -+global python_supported_saved -+ -+# Return 1 if Python scripting is supported in GDB, 0 if not. -+proc python_supported { } { -+ global gdb_prompt -+ global python_supported_saved -+ -+ if [info exists python_supported_saved] { -+ verbose "python_supported: returning saved $python_supported_saved" 2 -+ return $python_supported_saved -+ } -+ -+ gdb_test_multiple "python print 'hello, world!'" "verify python support" { -+ -re "not supported.*$gdb_prompt $" { -+ return [set python_supported_saved 0] -+ } -+ -re "$gdb_prompt $" { -+ return [set python_supported_saved 1] -+ } -+ } -+ -+ return [set python_supported_saved 0] -+} -+ -+# Run a command in GDB, and report a failure if a Python exception is thrown. -+# If report_pass is true, report a pass if no exception is thrown. -+proc gdb_py_test_silent_cmd {cmd name report_pass} { -+ global gdb_prompt -+ -+ gdb_test_multiple $cmd $name { -+ -re "Traceback.*$gdb_prompt $" { fail $name } -+ -re "$gdb_prompt $" { if $report_pass { pass $name } } -+ } -+} -+ -+# Usage: gdb_py_test_multiple NAME INPUT RESULT {INPUT RESULT}... -+# Run a test named NAME, consisting of multiple lines of input. -+# After each input line INPUT, search for result line RESULT. -+# Succeed if all results are seen; fail otherwise. -+proc gdb_py_test_multiple {name args} { -+ global gdb_prompt -+ -+ foreach {input result} $args { -+ if {[gdb_test_multiple $input "$name - $input" { -+ -re "\[\r\n\]*($result)\[\r\n\]+($gdb_prompt | *>)$" { -+ pass "$name - $input" -+ } -+ }]} { -+ return 1 -+ } -+ } -+ return 0 -+} -diff --git a/gdb/thread.c b/gdb/thread.c -index 0b291ba..ae3e4ff 100644 ---- a/gdb/thread.c -+++ b/gdb/thread.c -@@ -90,6 +90,16 @@ delete_step_resume_breakpoint (struct thread_info *tp) - } - } - -+void -+delete_exception_resume_breakpoint (struct thread_info *tp) -+{ -+ if (tp && tp->exception_resume_breakpoint) -+ { -+ delete_breakpoint (tp->exception_resume_breakpoint); -+ tp->exception_resume_breakpoint = NULL; -+ } -+} -+ - static void - clear_thread_inferior_resources (struct thread_info *tp) - { -@@ -103,6 +113,12 @@ clear_thread_inferior_resources (struct thread_info *tp) - tp->step_resume_breakpoint = NULL; - } - -+ if (tp->exception_resume_breakpoint) -+ { -+ tp->exception_resume_breakpoint->disposition = disp_del_at_next_stop; -+ tp->exception_resume_breakpoint = NULL; -+ } -+ - bpstat_clear (&tp->stop_bpstat); - - discard_all_intermediate_continuations_thread (tp); diff --git a/gdb/top.c b/gdb/top.c -index b29e68d..8edac70 100644 +index df2b163..a205d00 100644 --- a/gdb/top.c +++ b/gdb/top.c -@@ -337,6 +337,7 @@ void +@@ -343,6 +343,7 @@ void prepare_execute_command (void) { free_all_values (); + free_all_types (); - /* With multiple threads running while the one we're examining is stopped, - the dcache can get stale without us being able to detect it. + /* With multiple threads running while the one we're examining is + stopped, the dcache can get stale without us being able to detect diff --git a/gdb/typeprint.c b/gdb/typeprint.c -index ce9f551..5f9d739 100644 +index 03e6332..ce6d1e0 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -36,6 +36,7 @@ @@ -15593,91 +11913,65 @@ index ce9f551..5f9d739 100644 + do_cleanups (old_chain); } + static void +diff --git a/gdb/utils.c b/gdb/utils.c +index 82e3adb..a5b9146 100644 +--- a/gdb/utils.c ++++ b/gdb/utils.c +@@ -2238,6 +2238,36 @@ set_batch_flag_and_make_cleanup_restore_page_info (void) + return back_to; + } + ++/* Helper for make_cleanup_restore_page_info. */ ++ ++static void ++do_restore_selected_frame_cleanup (void *arg) ++{ ++ struct frame_id *frame_idp = arg; ++ ++ select_frame (frame_find_by_id (*frame_idp)); ++ ++ xfree (frame_idp); ++} ++ ++/* Provide cleanup for restoring currently selected frame. Use frame_id for ++ the case the current frame becomes stale in the meantime. */ ++ ++struct cleanup * ++make_cleanup_restore_selected_frame (void) ++{ ++ struct frame_id *frame_idp; ++ ++ /* get_selected_frame->get_current_frame would error otherwise. */ ++ if (!has_stack_frames ()) ++ return make_cleanup (null_cleanup, NULL); ++ ++ frame_idp = xmalloc (sizeof (*frame_idp)); ++ *frame_idp = get_frame_id (get_selected_frame (NULL)); ++ ++ return make_cleanup (do_restore_selected_frame_cleanup, frame_idp); ++} ++ + /* Set the screen size based on LINES_PER_PAGE and CHARS_PER_LINE. */ + static void diff --git a/gdb/valarith.c b/gdb/valarith.c -index 0c40905..a781636 100644 +index 265532c..1e419dd 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c -@@ -161,12 +161,26 @@ value_subscript (struct value *array, LONGEST index) - - get_discrete_bounds (range_type, &lowerbound, &upperbound); - if (VALUE_LVAL (array) != lval_memory) -- return value_subscripted_rvalue (array, index, lowerbound); -+ { -+ if (index >= lowerbound && index <= upperbound) -+ { -+ CORE_ADDR element_size = TYPE_LENGTH (TYPE_TARGET_TYPE (tarray)); -+ CORE_ADDR offset = (index - lowerbound) * element_size; -+ -+ return value_subscripted_rvalue (array, offset); -+ } -+ error (_("array or string index out of range")); -+ } - - if (c_style == 0) - { - if (index >= lowerbound && index <= upperbound) -- return value_subscripted_rvalue (array, index, lowerbound); -+ { -+ CORE_ADDR element_size = TYPE_LENGTH (TYPE_TARGET_TYPE (tarray)); -+ CORE_ADDR offset = (index - lowerbound) * element_size; -+ -+ return value_subscripted_rvalue (array, offset); -+ } - /* Emit warning unless we have an array of unknown size. - An array of unknown size has lowerbound 0 and upperbound -1. */ - if (upperbound > -1) -@@ -185,34 +199,37 @@ value_subscript (struct value *array, LONGEST index) - error (_("not an array or string")); - } - --/* Return the value of EXPR[IDX], expr an aggregate rvalue -- (eg, a vector register). This routine used to promote floats -- to doubles, but no longer does. */ -+/* Return the value of *((void *) ARRAY + ELEMENT), ARRAY an aggregate rvalue -+ (eg, a vector register). This routine used to promote floats to doubles, -+ but no longer does. OFFSET is zero-based with 0 for the lowermost existing -+ element, it must be expressed in bytes (therefore multiplied by -+ check_typedef (TYPE_TARGET_TYPE (array_type)). */ - - struct value * --value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) -+value_subscripted_rvalue (struct value *array, CORE_ADDR offset) - { +@@ -198,7 +198,10 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) struct type *array_type = check_typedef (value_type (array)); struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); -- unsigned int elt_size = TYPE_LENGTH (elt_type); + unsigned int elt_size = TYPE_LENGTH (elt_type); - unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound); ++ unsigned int elt_stride ++ = (TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (array_type)) == 0 ++ ? elt_size : TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (array_type))); ++ unsigned int elt_offs = elt_stride * longest_to_int (index - lowerbound); struct value *v; -- if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) -- && elt_offs >= TYPE_LENGTH (array_type))) -- error (_("no such vector element")); -+ /* Do not check TYPE_LENGTH (array_type) as we may have been given the -+ innermost dimension of a multi-dimensional Fortran array where its length -+ is shorter than the possibly accessed element offset. */ - - v = allocate_value (elt_type); - if (VALUE_LVAL (array) == lval_memory && value_lazy (array)) - set_value_lazy (v, 1); - else -- memcpy (value_contents_writeable (v), -- value_contents (array) + elt_offs, elt_size); -+ { -+ unsigned int elt_size = TYPE_LENGTH (elt_type); -+ memcpy (value_contents_writeable (v), -+ value_contents (array) + offset, elt_size); -+ } - - set_value_component_location (v, array); - VALUE_REGNUM (v) = VALUE_REGNUM (array); - VALUE_FRAME_ID (v) = VALUE_FRAME_ID (array); -- set_value_offset (v, value_offset (array) + elt_offs); -+ set_value_offset (v, value_offset (array) + offset); - return v; - } - -@@ -292,6 +309,10 @@ int + if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) +@@ -297,6 +300,10 @@ int binop_user_defined_p (enum exp_opcode op, struct value *arg1, struct value *arg2) { @@ -15689,7 +11983,7 @@ index 0c40905..a781636 100644 } diff --git a/gdb/valops.c b/gdb/valops.c -index 7fbad10..8e32405 100644 +index 24c2269..21fb35f 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -38,6 +38,7 @@ @@ -15700,7 +11994,7 @@ index 7fbad10..8e32405 100644 #include #include "gdb_string.h" -@@ -858,6 +859,65 @@ value_one (struct type *type, enum lval_type lv) +@@ -907,6 +908,65 @@ value_one (struct type *type, enum lval_type lv) return val; } @@ -15766,7 +12060,7 @@ index 7fbad10..8e32405 100644 /* Helper function for value_at, value_at_lazy, and value_at_lazy_stack. */ static struct value * -@@ -956,15 +1016,21 @@ value_fetch_lazy (struct value *val) +@@ -1005,15 +1065,21 @@ value_fetch_lazy (struct value *val) } else if (VALUE_LVAL (val) == lval_memory) { @@ -15795,7 +12089,7 @@ index 7fbad10..8e32405 100644 } } else if (VALUE_LVAL (val) == lval_register) -@@ -1374,7 +1440,18 @@ address_of_variable (struct symbol *var, struct block *b) +@@ -1429,7 +1495,18 @@ address_of_variable (struct symbol *var, struct block *b) if ((VALUE_LVAL (val) == lval_memory && value_lazy (val)) || TYPE_CODE (type) == TYPE_CODE_FUNC) { @@ -15815,7 +12109,7 @@ index 7fbad10..8e32405 100644 return value_from_pointer (lookup_pointer_type (type), addr); } -@@ -1481,6 +1558,7 @@ struct value * +@@ -1536,6 +1613,7 @@ struct value * value_coerce_array (struct value *arg1) { struct type *type = check_typedef (value_type (arg1)); @@ -15823,7 +12117,7 @@ index 7fbad10..8e32405 100644 /* If the user tries to do something requiring a pointer with an array that has not yet been pushed to the target, then this would -@@ -1490,8 +1568,12 @@ value_coerce_array (struct value *arg1) +@@ -1545,8 +1623,12 @@ value_coerce_array (struct value *arg1) if (VALUE_LVAL (arg1) != lval_memory) error (_("Attempt to take address of value not located in memory.")); @@ -15837,8 +12131,17 @@ index 7fbad10..8e32405 100644 } /* Given a value which is a function, return a value which is a pointer +@@ -3587,6 +3669,8 @@ value_slice (struct value *array, int lowbound, int length) + TYPE_TARGET_TYPE (range_type), + lowbound, + lowbound + length - 1); ++ TYPE_BYTE_STRIDE (slice_range_type) = TYPE_BYTE_STRIDE (range_type); ++ + if (TYPE_CODE (array_type) == TYPE_CODE_BITSTRING) + { + int i; diff --git a/gdb/valprint.c b/gdb/valprint.c -index ad6268e..fb0ef7a 100644 +index b6b96d4..934bf9c 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -36,6 +36,7 @@ @@ -15849,7 +12152,7 @@ index ad6268e..fb0ef7a 100644 #include -@@ -237,7 +238,6 @@ scalar_type_p (struct type *type) +@@ -239,7 +240,6 @@ scalar_type_p (struct type *type) case TYPE_CODE_STRUCT: case TYPE_CODE_UNION: case TYPE_CODE_SET: @@ -15857,7 +12160,7 @@ index ad6268e..fb0ef7a 100644 case TYPE_CODE_BITSTRING: return 0; default: -@@ -1142,6 +1142,7 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr, +@@ -1165,6 +1165,7 @@ val_print_array_elements (struct type *type, { unsigned int things_printed = 0; unsigned len; @@ -15865,10 +12168,10 @@ index ad6268e..fb0ef7a 100644 struct type *elttype, *index_type; unsigned eltlen; /* Position of the array element we are examining to see -@@ -1150,9 +1151,33 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr, +@@ -1173,9 +1174,33 @@ val_print_array_elements (struct type *type, /* Number of repetitions we have detected so far. */ unsigned int reps; - LONGEST low_bound_index = 0; + LONGEST low_bound, high_bound; + struct cleanup *back_to; + CORE_ADDR saved_address = address; + @@ -15900,18 +12203,8 @@ index ad6268e..fb0ef7a 100644 + eltlen = TYPE_ARRAY_BYTE_STRIDE_VALUE (type); index_type = TYPE_INDEX_TYPE (type); - /* Compute the number of elements in the array. On most arrays, -@@ -1160,9 +1185,6 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr, - is simply the size of the array divided by the size of the elements. - But for arrays of elements whose size is zero, we need to look at - the bounds. */ -- if (eltlen != 0) -- len = TYPE_LENGTH (type) / eltlen; -- else - { - LONGEST low, hi; - -@@ -1236,6 +1258,8 @@ val_print_array_elements (struct type *type, const gdb_byte *valaddr, + if (get_array_bounds (type, &low_bound, &high_bound)) +@@ -1254,6 +1279,8 @@ val_print_array_elements (struct type *type, { fprintf_filtered (stream, "..."); } @@ -15921,7 +12214,7 @@ index ad6268e..fb0ef7a 100644 /* Read LEN bytes of target memory at address MEMADDR, placing the diff --git a/gdb/value.c b/gdb/value.c -index d552402..b10269c 100644 +index e26270c..29bb0ca 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -39,6 +39,7 @@ @@ -15932,7 +12225,7 @@ index d552402..b10269c 100644 #include "python/python.h" -@@ -828,12 +829,15 @@ void +@@ -870,12 +871,15 @@ void set_value_component_location (struct value *component, const struct value *whole) { @@ -15948,7 +12241,7 @@ index d552402..b10269c 100644 if (whole->lval == lval_computed) { struct lval_funcs *funcs = whole->location.computed.funcs; -@@ -841,6 +845,12 @@ set_value_component_location (struct value *component, +@@ -883,6 +887,12 @@ set_value_component_location (struct value *component, if (funcs->copy_closure) component->location.computed.closure = funcs->copy_closure (whole); } @@ -15961,7 +12254,7 @@ index d552402..b10269c 100644 } -@@ -973,6 +983,29 @@ show_values (char *num_exp, int from_tty) +@@ -1016,6 +1026,29 @@ show_values (char *num_exp, int from_tty) num_exp[1] = '\0'; } } @@ -15991,7 +12284,7 @@ index d552402..b10269c 100644 /* Internal variables. These are variables within the debugger that hold values assigned by debugger commands. -@@ -1451,6 +1484,40 @@ call_internal_function (struct gdbarch *gdbarch, +@@ -1511,6 +1544,40 @@ call_internal_function (struct gdbarch *gdbarch, return (*ifn->handler) (gdbarch, language, ifn->cookie, argc, argv); } @@ -16032,7 +12325,7 @@ index d552402..b10269c 100644 /* The 'function' command. This does nothing -- it is just a placeholder to let "help function NAME" work. This is also used as the implementation of the sub-command that is created when -@@ -1498,11 +1565,10 @@ preserve_one_value (struct value *value, struct objfile *objfile, +@@ -1558,11 +1625,10 @@ preserve_one_value (struct value *value, struct objfile *objfile, htab_t copied_types) { if (TYPE_OBJFILE (value->type) == objfile) @@ -16046,7 +12339,7 @@ index d552402..b10269c 100644 copied_types); } -@@ -1517,13 +1583,13 @@ preserve_one_internalvar (struct internalvar *var, struct objfile *objfile, +@@ -1577,13 +1643,13 @@ preserve_one_internalvar (struct internalvar *var, struct objfile *objfile, case INTERNALVAR_INTEGER: if (var->u.integer.type && TYPE_OBJFILE (var->u.integer.type) == objfile) var->u.integer.type @@ -16062,7 +12355,7 @@ index d552402..b10269c 100644 break; case INTERNALVAR_VALUE: -@@ -2387,7 +2453,24 @@ value_from_decfloat (struct type *type, const gdb_byte *dec) +@@ -2449,7 +2515,24 @@ value_from_decfloat (struct type *type, const gdb_byte *dec) struct value * coerce_ref (struct value *arg) { @@ -16088,7 +12381,7 @@ index d552402..b10269c 100644 if (TYPE_CODE (value_type_arg_tmp) == TYPE_CODE_REF) arg = value_at_lazy (TYPE_TARGET_TYPE (value_type_arg_tmp), -@@ -2485,4 +2568,8 @@ VARIABLE is already initialized.")); +@@ -2547,4 +2630,8 @@ VARIABLE is already initialized.")); add_prefix_cmd ("function", no_class, function_command, _("\ Placeholder command for showing help on convenience functions."), &functionlist, "function ", 0, &cmdlist); @@ -16098,10 +12391,10 @@ index d552402..b10269c 100644 + observer_attach_mark_used (value_types_mark_used); } diff --git a/gdb/value.h b/gdb/value.h -index 12cbc0a..a508bf6 100644 +index aa8ff3c..2b4543c 100644 --- a/gdb/value.h +++ b/gdb/value.h -@@ -372,6 +372,10 @@ extern struct value *value_from_double (struct type *type, DOUBLEST num); +@@ -395,6 +395,10 @@ extern struct value *value_from_double (struct type *type, DOUBLEST num); extern struct value *value_from_decfloat (struct type *type, const gdb_byte *decbytes); @@ -16112,25 +12405,3 @@ index 12cbc0a..a508bf6 100644 extern struct value *value_at (struct type *type, CORE_ADDR addr); extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr); -@@ -729,7 +733,7 @@ extern struct value *value_allocate_space_in_inferior (int); - extern struct value *value_of_local (const char *name, int complain); - - extern struct value *value_subscripted_rvalue (struct value *array, -- LONGEST index, int lowerbound); -+ CORE_ADDR offset); - - /* User function handler. */ - -diff --git a/gdb/varobj.c b/gdb/varobj.c -index b9b8e91..a81d25c 100644 ---- a/gdb/varobj.c -+++ b/gdb/varobj.c -@@ -26,6 +26,8 @@ - #include "gdbcmd.h" - #include "block.h" - #include "valprint.h" -+#include "objfiles.h" -+#include "parser-defs.h" - - #include "gdb_assert.h" - #include "gdb_string.h" diff --git a/gdb-bz533176-fortran-omp-step.patch b/gdb-bz533176-fortran-omp-step.patch index 5c0db43..6e28c78 100644 --- a/gdb-bz533176-fortran-omp-step.patch +++ b/gdb-bz533176-fortran-omp-step.patch @@ -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 -+++ ./gdb/infrun.c 2009-12-09 22:29:56.000000000 +0100 -@@ -3994,6 +3994,12 @@ infrun: not switching back to stepped th +Index: gdb-7.2.50.20101231/gdb/infrun.c +=================================================================== +--- 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); + @@ -36,7 +38,7 @@ debugging problem of GOMP outside of the scope of this Bug. /* We're doing a "next". 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); 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 ---- ./gdb/testsuite/gdb.fortran/omp-step.exp 1970-01-01 01:00:00.000000000 +0100 -+++ ./gdb/testsuite/gdb.fortran/omp-step.exp 2009-12-09 22:31:04.000000000 +0100 +Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.exp +=================================================================== +--- /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 @@ +# 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_continue_to_breakpoint "success" ".*success.*" ---- ./gdb/testsuite/gdb.fortran/omp-step.f90 1970-01-01 01:00:00.000000000 +0100 -+++ ./gdb/testsuite/gdb.fortran/omp-step.f90 2009-12-09 22:25:35.000000000 +0100 +Index: gdb-7.2.50.20101231/gdb/testsuite/gdb.fortran/omp-step.f90 +=================================================================== +--- /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 @@ +! Copyright 2009 Free Software Foundation, Inc. + diff --git a/gdb-bz541866-rwatch-before-run.patch b/gdb-bz541866-rwatch-before-run.patch index 403e41d..2dadb2b 100644 --- a/gdb-bz541866-rwatch-before-run.patch +++ b/gdb-bz541866-rwatch-before-run.patch @@ -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.1.90.20100711/gdb/config/i386/linux64.mh 2010-07-13 19:02:54.000000000 +0200 +--- gdb-7.2.50.20110117.orig/gdb/config/i386/linux64.mh 2010-05-28 20:50:31.000000000 +0200 ++++ gdb-7.2.50.20110117/gdb/config/i386/linux64.mh 2011-01-17 16:01:48.000000000 +0100 @@ -2,7 +2,7 @@ NATDEPFILES= inf-ptrace.o fork-child.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 # 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 -+++ 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 @@ +/* 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 + +#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.1.90.20100711/gdb/target.h 2010-07-13 19:02:28.000000000 +0200 -@@ -1298,8 +1298,10 @@ extern char *normal_pid_to_str (ptid_t p +--- gdb-7.2.50.20110117.orig/gdb/target.h 2011-01-14 14:47:15.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/target.h 2011-01-17 16:02:08.000000000 +0100 +@@ -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 (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); +#endif - #define target_region_ok_for_hw_watchpoint(addr, len) \ - (*current_target.to_region_ok_for_hw_watchpoint) (addr, len) -Index: gdb-7.1.90.20100711/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp + /* Returns the number of debug registers needed to watch the given + memory region, or zero if not supported. */ +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 -+++ 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 @@ +# Copyright 2009, 2010 Free Software Foundation, Inc. + diff --git a/gdb-bz555076-gcore-small-height.patch b/gdb-bz555076-gcore-small-height.patch deleted file mode 100644 index 5ae0853..0000000 --- a/gdb-bz555076-gcore-small-height.patch +++ /dev/null @@ -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 <prettyprint_arrays : options->pretty; -+ pretty = (is_array || options->prettyprint_matrix) ? -+ options->prettyprint_arrays : options->pretty; - - /* Manufacture a dummy Python frame to work around Python 2.4 bug, - where it insists on having a non-NULL tstate->frame when -@@ -397,6 +398,9 @@ print_children (PyObject *printer, const +- if (is_array) ++ if (is_array || options->prettyprint_matrix) + pretty = options->prettyprint_arrays; + else + { +@@ -521,6 +521,9 @@ print_children (PyObject *printer, const goto done; } make_cleanup_py_decref (frame); @@ -50,7 +49,7 @@ Index: gdb-7.1/gdb/python/py-prettyprint.c done_flag = 0; 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 ",". */ if (i == 0) { @@ -79,7 +78,7 @@ Index: gdb-7.1/gdb/python/py-prettyprint.c else if (! is_map || i % 2 == 0) 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) fputs_filtered ("[", stream); @@ -90,7 +89,7 @@ Index: gdb-7.1/gdb/python/py-prettyprint.c else if (is_array) { /* 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); print_spaces_filtered (2 * recurse, stream); } @@ -104,15 +103,15 @@ Index: gdb-7.1/gdb/python/py-prettyprint.c } 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; int result = 0; - int is_py_none = 0; + enum string_repr_result print_result; + struct value_print_options *options_copy; cleanups = ensure_python_env (gdbarch, language); /* 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. */ 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); /* Print the section */ -- is_py_none = print_string_repr (printer, hint, stream, recurse, -- options, language, gdbarch); -- print_children (printer, hint, stream, recurse, options, language, -+ is_py_none = options_copy->prettyprint_matrix ? -+ 1 : print_string_repr (printer, hint, stream, -+ recurse, options_copy, -+ language, gdbarch); -+ print_children (printer, hint, stream, recurse, options_copy, language, - is_py_none); - - result = 1; -Index: gdb-7.1/gdb/testsuite/gdb.python/pr10659.cc ++ if (options_copy->prettyprint_matrix) ++ print_result = string_repr_none; ++else /* Red Hat 2D matrix patch */ + print_result = print_string_repr (printer, hint, stream, recurse, + options, language, gdbarch); + if (print_result != string_repr_error) +Index: gdb-7.2.50.20110206/gdb/testsuite/gdb.python/pr10659.cc =================================================================== --- /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 @@ +#include +#include // /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 +} -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 -+++ 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 @@ +#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 -+++ 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 @@ +# 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 = {} + +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.1/gdb/valprint.c 2010-06-30 14:35:41.000000000 +0200 -@@ -83,7 +83,8 @@ struct value_print_options user_print_op +--- gdb-7.2.50.20110206.orig/gdb/valprint.c 2011-02-06 20:55:52.000000000 +0100 ++++ gdb-7.2.50.20110206/gdb/valprint.c 2011-02-06 20:55:59.000000000 +0100 +@@ -85,7 +85,8 @@ struct value_print_options user_print_op 1, /* static_field_print */ 1, /* pascal_static_field_print */ 0, /* raw */ diff --git a/gdb-bz575292-delayed-physname.patch b/gdb-bz575292-delayed-physname.patch deleted file mode 100644 index 3128473..0000000 --- a/gdb-bz575292-delayed-physname.patch +++ /dev/null @@ -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 . */ -+ -+/* 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 . -+ -+# 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\)\)}.*} diff --git a/gdb-bz592031-siginfo-lost-4of5.patch b/gdb-bz592031-siginfo-lost-4of5.patch new file mode 100644 index 0000000..99e8a8e --- /dev/null +++ b/gdb-bz592031-siginfo-lost-4of5.patch @@ -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 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 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 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 + + * 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) signalled>: Remove. + +gdb/testsuite/ +2010-09-20 Jan Kratochvil + + * 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 . */ ++ ++#define _GNU_SOURCE ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#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 . ++ ++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 . */ ++ ++#include ++#include ++#include ++ ++#include ++#include ++#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 . ++ ++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" diff --git a/gdb-bz592031-siginfo-lost-5of5.patch b/gdb-bz592031-siginfo-lost-5of5.patch new file mode 100644 index 0000000..51861c5 --- /dev/null +++ b/gdb-bz592031-siginfo-lost-5of5.patch @@ -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 + + * linux-nat.c (resume_callback) stopped && lp->status == 0> + (linux_nat_resume): Remove LP->SIGINFO clearing. + (save_siginfo): Remove. + (stop_wait_callback) + (linux_nat_filter_event) : 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) : 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; diff --git a/gdb-bz594560-core-vs-process.patch b/gdb-bz594560-core-vs-process.patch deleted file mode 100644 index 16625cd..0000000 --- a/gdb-bz594560-core-vs-process.patch +++ /dev/null @@ -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; diff --git a/gdb-bz614659-prelink-dynbss.patch b/gdb-bz614659-prelink-dynbss.patch deleted file mode 100644 index 09fb1bb..0000000 --- a/gdb-bz614659-prelink-dynbss.patch +++ /dev/null @@ -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 - - -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. - - -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 - - * 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 - - * 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 . - */ - -+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 - -+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" - diff --git a/gdb-bz623749-gcore-relro.patch b/gdb-bz623749-gcore-relro.patch new file mode 100644 index 0000000..99d1486 --- /dev/null +++ b/gdb-bz623749-gcore-relro.patch @@ -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 + + 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 . */ ++ ++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 . */ ++ ++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 . ++ ++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" diff --git a/gdb-bz634108-solib_address.patch b/gdb-bz634108-solib_address.patch new file mode 100644 index 0000000..fd4ca39 --- /dev/null +++ b/gdb-bz634108-solib_address.patch @@ -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 . ++ ++# 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" diff --git a/gdb-dwarf3-accessibility.patch b/gdb-dwarf3-accessibility.patch new file mode 100644 index 0000000..e9af84c --- /dev/null +++ b/gdb-dwarf3-accessibility.patch @@ -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 + + 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); + diff --git a/gdb-fortran-common-reduce.patch b/gdb-fortran-common-reduce.patch index 9108a73..9538865 100644 --- a/gdb-fortran-common-reduce.patch +++ b/gdb-fortran-common-reduce.patch @@ -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.1.90.20100711/gdb/f-lang.c 2010-07-13 00:24:04.000000000 +0200 -@@ -56,20 +56,6 @@ typedef struct saved_bf_symnum SAVED_BF, +--- gdb-7.2.50.20110117.orig/gdb/f-lang.c 2011-01-07 20:36:16.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/f-lang.c 2011-01-17 15:56:07.000000000 +0100 +@@ -57,20 +57,6 @@ typedef struct saved_bf_symnum SAVED_BF, /* Local functions */ 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_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); } @@ -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) - list */ -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 -- in macros */ +- in macros. */ - -/* The following function simply enters a given common block onto -- the global common block chain */ +- the global common block chain. */ - -static void -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 - name (i.e. "#BLNK_COM") then we set it to __BLANK - because the darn "#" character makes GDB's input -- parser have fits. */ +- parser have fits. */ - - - 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); - - /* 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; @@ -148,7 +148,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c -#endif - -/* 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 -static void @@ -160,7 +160,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c - - /* The order of this list is important, since - 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 (); - @@ -185,7 +185,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c -} -#endif - --/* This routine finds the first encountred COMMON block named "name" */ +-/* This routine finds the first encountred COMMON block named "name". */ - -#if 0 -static SAVED_F77_COMMON_PTR @@ -208,8 +208,8 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c -#endif /* This routine finds the first encountred COMMON block named "name" - that belongs to function funcname */ -@@ -659,193 +467,3 @@ find_common_for_function (char *name, ch + that belongs to function funcname. */ +@@ -662,193 +470,3 @@ find_common_for_function (char *name, ch } return (NULL); } @@ -226,7 +226,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c -{ - 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; - @@ -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 - the name. Eventually, the best way to do this will be a - 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 -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 - we simply create a linear list. This list can then be searched - first by a queueing algorithm and upon failure fall back to -- a linear scan. */ +- a linear scan. */ - -#if 0 -#define ADD_BF_SYMNUM(bf_sym,fcn_sym) \ @@ -311,7 +311,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c - } -#endif - --/* This function frees the entire (.bf,function) list */ +-/* This function frees the entire (.bf,function) list. */ - -#if 0 -static void @@ -342,7 +342,7 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c - int nprobes = 0; - - /* 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) - 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 - 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) - 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; -} -#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.1.90.20100711/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:47:37.000000000 +0100 ++++ 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 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_MF77 "__BLNK__" /* MF77 assigned */ #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.1.90.20100711/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:47:37.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/f-valprint.c 2011-01-17 15:54:36.000000000 +0100 @@ -35,10 +35,6 @@ #include "command.h" #include "block.h" @@ -437,12 +437,12 @@ Index: gdb-7.1.90.20100711/gdb/f-valprint.c extern void _initialize_f_valprint (void); static void info_common_command (char *, int); 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); } -/* 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 -static int @@ -459,7 +459,7 @@ Index: gdb-7.1.90.20100711/gdb/f-valprint.c - fi = get_selected_frame (_("No frame selected")); - - /* The following is generally ripped off from stack.c's routine -- print_frame_info() */ +- print_frame_info(). */ - - func = find_pc_function (fi->pc); - 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. - I don't think this can ever cause any problems; there shouldn't - 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); - diff --git a/gdb-fortran-common.patch b/gdb-fortran-common.patch index 5676c4b..10e1eaa 100644 --- a/gdb-fortran-common.patch +++ b/gdb-fortran-common.patch @@ -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.1.90.20100711/gdb/dwarf2read.c 2010-07-13 00:26:25.000000000 +0200 -@@ -5727,12 +5727,14 @@ read_set_type (struct die_info *die, str +--- gdb-7.2.50.20110117.orig/gdb/dwarf2read.c 2011-01-17 15:50:41.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/dwarf2read.c 2011-01-17 15:56:23.000000000 +0100 +@@ -7465,12 +7465,14 @@ read_set_type (struct die_info *die, str 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 symbol *sym; 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) { @@ -58,9 +58,9 @@ Index: gdb-7.1.90.20100711/gdb/dwarf2read.c + + /* Undocumented in DWARF3, when it can be present? */ 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; 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); 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) + attr2 = NULL; + - if (attr2 && (DW_UNSND (attr2) != 0)) - { - struct pending **list_to_add; -@@ -9277,6 +9333,11 @@ new_symbol (struct die_info *die, struct + if (SYMBOL_CLASS (sym) == LOC_STATIC + && SYMBOL_VALUE_ADDRESS (sym) == 0 + && !dwarf2_per_objfile->has_section_at_zero) +@@ -11283,6 +11339,11 @@ new_symbol_full (struct die_info *die, s SYMBOL_CLASS (sym) = LOC_TYPEDEF; - add_symbol_to_list (sym, &global_symbols); + list_to_add = &global_symbols; break; + case DW_TAG_common_block: + SYMBOL_CLASS (sym) = LOC_STATIC; @@ -112,11 +112,11 @@ Index: gdb-7.1.90.20100711/gdb/dwarf2read.c default: /* Not a tag we recognize. Hopefully we aren't processing trash data, but since we must specifically ignore things -Index: gdb-7.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.1.90.20100711/gdb/f-lang.c 2010-07-13 00:25:56.000000000 +0200 -@@ -443,27 +443,3 @@ _initialize_f_language (void) +--- gdb-7.2.50.20110117.orig/gdb/f-lang.c 2011-01-17 15:56:07.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/f-lang.c 2011-01-17 15:56:48.000000000 +0100 +@@ -446,27 +446,3 @@ _initialize_f_language (void) 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 */ - -/* This routine finds the first encountred COMMON block named "name" -- that belongs to function funcname */ +- that belongs to function funcname. */ - -SAVED_F77_COMMON_PTR -find_common_for_function (char *name, char *funcname) @@ -144,10 +144,10 @@ Index: gdb-7.1.90.20100711/gdb/f-lang.c - } - 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.1.90.20100711/gdb/f-lang.h 2010-07-13 00:25:56.000000000 +0200 +--- gdb-7.2.50.20110117.orig/gdb/f-lang.h 2011-01-17 15:54:14.000000000 +0100 ++++ 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 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 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.1.90.20100711/gdb/f-valprint.c 2010-07-13 00:32:05.000000000 +0200 +--- gdb-7.2.50.20110117.orig/gdb/f-valprint.c 2011-01-17 15:54:36.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/f-valprint.c 2011-01-17 15:59:38.000000000 +0100 @@ -34,6 +34,8 @@ #include "gdbcore.h" #include "command.h" @@ -198,7 +198,7 @@ Index: gdb-7.1.90.20100711/gdb/f-valprint.c extern void _initialize_f_valprint (void); 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; } @@ -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 -@@ -511,11 +545,9 @@ list_all_visible_commons (char *funname) +@@ -514,11 +548,9 @@ list_all_visible_commons (char *funname) static void 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 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 - print_frame_info() */ + print_frame_info(). */ - func = find_pc_function (get_frame_pc (fi)); - 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. - I don't think this can ever cause any problems; there shouldn't - 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 (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 -- which COMMON blocks are visible here and then return */ +- which COMMON blocks are visible here and then return. */ - - if (comname == 0) + while (block) @@ -371,11 +371,11 @@ Index: gdb-7.1.90.20100711/gdb/f-valprint.c } 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.1.90.20100711/gdb/stack.c 2010-07-13 00:29:49.000000000 +0200 -@@ -1484,6 +1484,8 @@ iterate_over_block_locals (struct block +--- gdb-7.2.50.20110117.orig/gdb/stack.c 2011-01-17 15:47:37.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/stack.c 2011-01-17 15:56:23.000000000 +0100 +@@ -1498,6 +1498,8 @@ iterate_over_block_locals (struct block case LOC_COMPUTED: if (SYMBOL_IS_ARGUMENT (sym)) break; @@ -384,11 +384,11 @@ Index: gdb-7.1.90.20100711/gdb/stack.c (*cb) (SYMBOL_PRINT_NAME (sym), sym, cb_data); 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.1.90.20100711/gdb/symtab.h 2010-07-13 00:27:02.000000000 +0200 -@@ -396,7 +396,10 @@ typedef enum domain_enum_tag +--- gdb-7.2.50.20110117.orig/gdb/symtab.h 2011-01-17 15:47:37.000000000 +0100 ++++ gdb-7.2.50.20110117/gdb/symtab.h 2011-01-17 15:56:23.000000000 +0100 +@@ -408,7 +408,10 @@ typedef enum domain_enum_tag FUNCTIONS_DOMAIN, /* All defined types */ @@ -400,10 +400,10 @@ Index: gdb-7.1.90.20100711/gdb/symtab.h } 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 -+++ 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 @@ +# 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 iy_y" " = 2 *" "p iy_y 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 -+++ 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 @@ +! Copyright 2008 Free Software Foundation, Inc. +! diff --git a/gdb-gcc46-stdarg-prologue.patch b/gdb-gcc46-stdarg-prologue.patch new file mode 100644 index 0000000..62429c3 --- /dev/null +++ b/gdb-gcc46-stdarg-prologue.patch @@ -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) diff --git a/gdb-gcc46-typedef.patch b/gdb-gcc46-typedef.patch new file mode 100644 index 0000000..d54d002 --- /dev/null +++ b/gdb-gcc46-typedef.patch @@ -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) diff --git a/gdb-gdb-add-index-script.patch b/gdb-gdb-add-index-script.patch index fe2fcf4..5beef67 100644 --- a/gdb-gdb-add-index-script.patch +++ b/gdb-gdb-add-index-script.patch @@ -40,11 +40,11 @@ Subject: [PATCH 4/4] add gdb-add-index 5 files changed, 57 insertions(+), 1 deletions(-) create mode 100755 gdb/gdb-add-index -diff --git a/gdb/Makefile.in b/gdb/Makefile.in -index 6dbb284..8210a2c 100644 ---- a/gdb/Makefile.in -+++ b/gdb/Makefile.in -@@ -1018,7 +1018,16 @@ install-only: $(CONFIG_INSTALL) xml-syscall-install +Index: gdb-7.2.50.20101116/gdb/Makefile.in +=================================================================== +--- gdb-7.2.50.20101116.orig/gdb/Makefile.in 2010-11-16 08:03:17.000000000 +0100 ++++ gdb-7.2.50.20101116/gdb/Makefile.in 2010-11-16 08:47:45.000000000 +0100 +@@ -986,7 +986,16 @@ install-only: install-gstack $(CONFIG_IN $(SHELL) $(srcdir)/../mkinstalldirs \ $(DESTDIR)$(man1dir) ; \ $(INSTALL_DATA) $(srcdir)/gdb.1 \ @@ -62,11 +62,11 @@ index 6dbb284..8210a2c 100644 @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do .PHONY: install-tui install-tui: -diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo -index 69141e3..457e6b4 100644 ---- a/gdb/doc/gdb.texinfo -+++ b/gdb/doc/gdb.texinfo -@@ -15045,6 +15045,14 @@ There are currently some limitation on indices. They only work when +Index: gdb-7.2.50.20101116/gdb/doc/gdb.texinfo +=================================================================== +--- gdb-7.2.50.20101116.orig/gdb/doc/gdb.texinfo 2010-11-16 08:04:18.000000000 +0100 ++++ gdb-7.2.50.20101116/gdb/doc/gdb.texinfo 2010-11-16 08:56:30.000000000 +0100 +@@ -15500,6 +15500,14 @@ There are currently some limitation on i for DWARF debugging information, not stabs. And, they do not currently work for programs using Ada. @@ -78,14 +78,13 @@ index 69141e3..457e6b4 100644 +$ gdb-add-index symfile +@end smallexample + - @node Symbol Errors @section Errors Reading Symbol Files -diff --git a/gdb/gdb-add-index b/gdb/gdb-add-index -new file mode 100755 -index 0000000..c9a03b0 ---- /dev/null -+++ b/gdb/gdb-add-index + +Index: gdb-7.2.50.20101116/gdb/gdb-add-index +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.2.50.20101116/gdb/gdb-add-index 2010-11-16 08:47:45.000000000 +0100 @@ -0,0 +1,30 @@ +#! /bin/sh + @@ -117,6 +116,3 @@ index 0000000..c9a03b0 +fi + +exit 0 --- -1.6.2.5 - diff --git a/gdb-hppa.patch b/gdb-hppa.patch deleted file mode 100644 index 3920b6b..0000000 --- a/gdb-hppa.patch +++ /dev/null @@ -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 diff --git a/gdb-physname-pr11734-1of2.patch b/gdb-physname-pr11734-1of2.patch new file mode 100644 index 0000000..64c6bcd --- /dev/null +++ b/gdb-physname-pr11734-1of2.patch @@ -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 . ++ ++ 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 . ++ ++ 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 . ++ ++ 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 . ++ ++ 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 . ++ ++# 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 . ++ ++ 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 *); ++}; ++ diff --git a/gdb-physname-pr11734-2of2.patch b/gdb-physname-pr11734-2of2.patch new file mode 100644 index 0000000..79b5f2f --- /dev/null +++ b/gdb-physname-pr11734-2of2.patch @@ -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 diff --git a/gdb-physname-pr12273.patch b/gdb-physname-pr12273.patch new file mode 100644 index 0000000..58f9d3b --- /dev/null +++ b/gdb-physname-pr12273.patch @@ -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 . */ ++ ++template ++class GDB ++{ ++ public: ++ static int simple (void) { return 0; } ++ static int harder (T a) { return 1; } ++ template ++ static X even_harder (T a) { return static_cast (a); } ++ int operator == (GDB const& other) ++ { return 1; } ++}; ++ ++int main(int argc, char **argv) ++{ ++ GDB a, b; ++ if (a == b) ++ return GDB::harder('a') + GDB::harder(3) ++ + GDB::even_harder ('a'); ++ return GDB::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 . ++ ++# 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::even_harder(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::operator ==" \ ++ "GDB::operator==(GDB const&)" \ ++ "GDB::harder(char)" \ ++ "GDB::harder(int)" \ ++ {"int GDB::even_harder(char)"} \ ++ "GDB::simple()"] ++ ++foreach sym $min_syms { ++ if {[gdb_breakpoint $sym]} { ++ pass "setting breakpoint at $sym" ++ } ++} ++ ++gdb_exit diff --git a/gdb-python-newbacktrace.patch b/gdb-python-newbacktrace.patch new file mode 100644 index 0000000..4e2982c --- /dev/null +++ b/gdb-python-newbacktrace.patch @@ -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 + diff --git a/gdb-readline-6.0-signal.patch b/gdb-readline-6.0-signal.patch new file mode 100644 index 0000000..592ef04 --- /dev/null +++ b/gdb-readline-6.0-signal.patch @@ -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 + + * 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 + + * 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)' diff --git a/gdb-test-bt-cfi-without-die.patch b/gdb-test-bt-cfi-without-die.patch new file mode 100644 index 0000000..aa1cabc --- /dev/null +++ b/gdb-test-bt-cfi-without-die.patch @@ -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 . */ ++ ++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 . */ ++ ++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 . ++ ++# 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 + diff --git a/gdb-test-dw2-aranges.patch b/gdb-test-dw2-aranges.patch new file mode 100644 index 0000000..07bd008 --- /dev/null +++ b/gdb-test-dw2-aranges.patch @@ -0,0 +1,214 @@ +[archer-tromey-delayed-symfile] + +commit 77fa7778a37b0d28a7e4e5235f074a10ecf1815d +Author: Jan Kratochvil +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 . */ ++ ++/* 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 . ++ ++# 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" diff --git a/gdb-test-expr-cumulative-archer.patch b/gdb-test-expr-cumulative-archer.patch new file mode 100644 index 0000000..9f414ca --- /dev/null +++ b/gdb-test-expr-cumulative-archer.patch @@ -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 . ++ ++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 . ++ ++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" diff --git a/gdb-test-pid0-core.patch b/gdb-test-pid0-core.patch new file mode 100644 index 0000000..edb800d --- /dev/null +++ b/gdb-test-pid0-core.patch @@ -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]&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"ADEQM6O9TBO5,_]1) ++M($Q2))#),UE,QQK)E$,3D\W.>!4)QO8A_@^Z_SXS4;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@&)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.*" diff --git a/gdb-test-pp-hint-error.patch b/gdb-test-pp-hint-error.patch new file mode 100644 index 0000000..065acc1 --- /dev/null +++ b/gdb-test-pp-hint-error.patch @@ -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 + + * 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 \", " + ++ 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 () diff --git a/gdb-upstream.patch b/gdb-upstream.patch deleted file mode 100644 index 1a2d2d8..0000000 --- a/gdb-upstream.patch +++ /dev/null @@ -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 -+ -+ * 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 - - 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 diff --git a/gdb.changes b/gdb.changes index 83ba9db..2580bb3 100644 --- a/gdb.changes +++ b/gdb.changes @@ -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 - 7.2.50.20110206-19 + - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + + * Sun Feb 6 2011 Jan Kratochvil - 7.2.50.20110206-18.fc15 + - Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). + + * Sun Feb 6 2011 Jan Kratochvil - 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 - 7.2.50.20110125-16.fc15 + - Fix Python new-backtrace command (BZ 672235, Phil Muldoon). + + * Wed Jan 26 2011 Jan Kratochvil - 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 - 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 - 7.2.50.20110117-13.fc15 + - Use librpm.so.2 for rpm-4.9.0 in Fedora 15. + + * Mon Jan 17 2011 Jan Kratochvil - 7.2.50.20110117-12.fc15 + - Use %%{?dist} for sanity checking tools compliance (suggested by Petr Muller). + + * Mon Jan 17 2011 Jan Kratochvil - 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 - 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 - 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 - 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 - 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 - 7.2.50.20101231-6.fc15 + - Fix --with-system-readline doc build upstream regression. + + * Sat Jan 1 2011 Jan Kratochvil - 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 - 7.2.50.20101117-4.fc15 + - Provide stub %%{_sysconfdir}/gdbinit (BZ 651232). + + * Mon Dec 27 2010 Jan Kratochvil - 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 - 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 - 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 - 7.2-25.fc14 + - iFort compat. - case insensitive DWARF not in lowercase (BZ 645773). + + * Thu Oct 14 2010 Jan Kratochvil - 7.2-24.fc14 + - Add gdb.spec comments on the *.patch files upstream merge status. + + * Thu Oct 14 2010 Jan Kratochvil - 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 - 7.2-22.fc14 + - testsuite: Provide missing lib/gdb-python.exp (for BZ 639089). + + * Tue Oct 12 2010 Jan Kratochvil - 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 - 7.2-20.fc14 + - Fixup Release for 20.fc14. + + * Tue Oct 12 2010 Jan Kratochvil - 7.2-19.fc14 + - Use .gdb_index v3 to fix excessive resources rqmnts (BZ 640634, Tom Tromey). + + * Wed Oct 6 2010 Jan Kratochvil - 7.2-18.fc14 + - Fix false warning: non-absolute filename: (BZ 640648). + + * Thu Sep 30 2010 Jan Kratochvil - 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 diff --git a/gdb.spec b/gdb.spec index fc0b707..66c7b4b 100644 --- a/gdb.spec +++ b/gdb.spec @@ -1,42 +1,32 @@ -# -# spec file for package gdb (Version 7.2) -# -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. -# -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. +# rpmbuild parameters: +# --with testsuite: Run the testsuite (biarch if possible). Default is without. +# --with debug: Build without optimizations and without splitting the debuginfo. +# --with upstream: No Fedora specific patches get applied. +# --without python: No python support. +# --with profile: gcc -fprofile-generate / -fprofile-use: Before better +# workload gets run it decreases the general performance now. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ -# - - -Summary: A GNU source-level debugger for C, C++, Java and other languages - -Name: gdb +Summary: A GNU source-level debugger for C, C++, Java and other languages +Name: gdb # Set version to contents of gdb/version.in. # NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3 # and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch). -Version: 7.2 -Release: 2 +Version: 7.2.50.20110206 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. +Release: 39 -License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and GFDL and BSD and Public Domain -Group: Development/Debuggers +License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and GFDL and BSD and Public Domain +Group: Development/Debuggers # Do not provide URL for snapshots as the file lasts there only for 2 days. +# ftp://sourceware.org/pub/gdb/snapshots/current/gdb-%{version}.tar.bz2 # ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{version}.tar.bz2 # ftp://sourceware.org/pub/gdb/releases/gdb-%{version}.tar.bz2 -Source: ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{version}.tar.bz2 -BuildRoot: %{_tmppath}/%{name}-%{version}-build -Url: http://gnu.org/software/gdb/ +Source: ftp://sourceware.org/pub/gdb/snapshots/current/gdb-%{version}.tar.bz2 +Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) +URL: http://gnu.org/software/gdb/ # For our convenience %define gdb_src gdb-%{version} @@ -52,375 +42,503 @@ Url: http://gnu.org/software/gdb/ # Make sure we get rid of the old package gdb64, now that we have unified # support for 32-64 bits in one single 64-bit gdb. %ifarch ppc64 -Obsoletes: gdb64 < 5.3.91 +Obsoletes: gdb64 < 5.3.91 %endif # GDB patches have the format `gdb--bz-.patch'. # They should be created using patch level 1: diff -up ./gdb (or gdb-6.3/gdb). +#= +#push=Should be pushed upstream. +#maybepush=Should be pushed upstream unless it got obsoleted there. +#fedora=Should stay as a Fedora patch. +#ia64=Drop after RHEL-5 rebases and rebuilds are no longer meaningful. +#fedoratest=Keep it in Fedora only as a regression test safety. +#+ppc=Specific for ppc32/ppc64/ppc* +#+work=Requires some nontrivial work. + # Cleanup any leftover testsuite processes as it may stuck mock(1) builds. -Source2: gdb-orphanripper.c +#=push +Source2: gdb-orphanripper.c # Man page for gstack(1). -Source3: gdb-gstack.man +#=push +Source3: gdb-gstack.man + +# /etc/gdbinit (from Debian but with Fedora compliant location). +#=fedora +Source4: gdbinit # Work around out-of-date dejagnu that does not have KFAIL -Patch1: gdb-6.3-rh-dummykfail-20041202.patch +#=drop: That dejagnu is too old to be supported. +Patch1: gdb-6.3-rh-dummykfail-20041202.patch # Match the Fedora's version info. -Patch2: gdb-6.3-rh-testversion-20041202.patch +#=fedora +Patch2: gdb-6.3-rh-testversion-20041202.patch # Check that libunwind works - new test then fix -Patch3: gdb-6.3-rh-testlibunwind-20041202.patch +#=ia64 +Patch3: gdb-6.3-rh-testlibunwind-20041202.patch # Use convert_from_func_ptr_addr on the solib breakpoint address; # simplifies and makes more consistent the logic. -Patch104: gdb-6.3-ppcdotsolib-20041022.patch +#=maybepush+ppc: Write new testcase. +Patch104: gdb-6.3-ppcdotsolib-20041022.patch # Better parse 64-bit PPC system call prologues. -Patch105: gdb-6.3-ppc64syscall-20040622.patch - -# Stop a backtrace when a zero PC is encountered. -Patch106: gdb-6.3-framepczero-20040927.patch +#=maybepush+ppc: Write new testcase. +Patch105: gdb-6.3-ppc64syscall-20040622.patch # Include the pc's section when doing a symbol lookup so that the # correct symbol is found. -Patch111: gdb-6.3-ppc64displaysymbol-20041124.patch +#=maybepush: Write new testcase. +Patch111: gdb-6.3-ppc64displaysymbol-20041124.patch # Fix upstream `set scheduler-locking step' vs. upstream PPC atomic seqs. -Patch112: gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch +#=maybepush+work: It is a bit difficult patch, a part is ppc specific. +Patch112: gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch # Make upstream `set scheduler-locking step' as default. -Patch260: gdb-6.6-scheduler_locking-step-is-default.patch +#=maybepush+work: How much is scheduler-locking relevant after non-stop? +Patch260: gdb-6.6-scheduler_locking-step-is-default.patch # Add a wrapper script to GDB that implements pstack using the # --readnever option. -Patch118: gdb-6.3-gstack-20050411.patch +#=push+work: with gdbindex maybe --readnever should no longer be used. +Patch118: gdb-6.3-gstack-20050411.patch # VSYSCALL and PIE -Patch122: gdb-6.3-test-pie-20050107.patch -Patch389: gdb-archer-pie-addons.patch -Patch394: gdb-archer-pie-addons-keep-disabled.patch +#=fedoratest +Patch122: gdb-6.3-test-pie-20050107.patch +#=maybepush: May get obsoleted by Tom's unrelocated objfiles patch. +Patch389: gdb-archer-pie-addons.patch +#=push+work: Breakpoints disabling matching should not be based on address. +Patch394: gdb-archer-pie-addons-keep-disabled.patch # Get selftest working with sep-debug-info -Patch125: gdb-6.3-test-self-20050110.patch +#=maybepush +Patch125: gdb-6.3-test-self-20050110.patch # Test support of multiple destructors just like multiple constructors -Patch133: gdb-6.3-test-dtorfix-20050121.patch +#=fedoratest +Patch133: gdb-6.3-test-dtorfix-20050121.patch # Fix to support executable moving -Patch136: gdb-6.3-test-movedir-20050125.patch +#=fedoratest +Patch136: gdb-6.3-test-movedir-20050125.patch # Fix gcore for threads -Patch140: gdb-6.3-gcore-thread-20050204.patch +#=ia64 +Patch140: gdb-6.3-gcore-thread-20050204.patch # Stop while intentionally stepping and the thread exit is met. -Patch141: gdb-6.6-step-thread-exit.patch -Patch259: gdb-6.3-step-thread-exit-20050211-test.patch - -# Prevent gdb from being pushed into background -Patch142: gdb-6.3-terminal-fix-20050214.patch +#=push +Patch141: gdb-6.6-step-thread-exit.patch +#=push +Patch259: gdb-6.3-step-thread-exit-20050211-test.patch # Test sibling threads to set threaded watchpoints for x86 and x86-64 -Patch145: gdb-6.3-threaded-watchpoints2-20050225.patch - -# Fix printing of inherited members -Patch148: gdb-6.3-inheritance-20050324.patch +#=fedoratest +Patch145: gdb-6.3-threaded-watchpoints2-20050225.patch # Do not issue warning message about first page of storage for ia64 gcore -Patch153: gdb-6.3-ia64-gcore-page0-20050421.patch +#=ia64 +Patch153: gdb-6.3-ia64-gcore-page0-20050421.patch # Security errata for untrusted .gdbinit -Patch157: gdb-6.3-security-errata-20050610.patch +#=push +Patch157: gdb-6.3-security-errata-20050610.patch # IA64 sigtramp prev register patch -Patch158: gdb-6.3-ia64-sigtramp-frame-20050708.patch +#=ia64 +Patch158: gdb-6.3-ia64-sigtramp-frame-20050708.patch # IA64 gcore speed-up patch -Patch160: gdb-6.3-ia64-gcore-speedup-20050714.patch +#=ia64 +Patch160: gdb-6.3-ia64-gcore-speedup-20050714.patch # Notify observers that the inferior has been created -Patch161: gdb-6.3-inferior-notification-20050721.patch +#=fedoratest +Patch161: gdb-6.3-inferior-notification-20050721.patch # Fix ia64 info frame bug -Patch162: gdb-6.3-ia64-info-frame-fix-20050725.patch +#=ia64 +Patch162: gdb-6.3-ia64-info-frame-fix-20050725.patch # Verify printing of inherited members test -Patch163: gdb-6.3-inheritancetest-20050726.patch +#=fedoratest +Patch163: gdb-6.3-inheritancetest-20050726.patch # Add readnever option -Patch164: gdb-6.3-readnever-20050907.patch +#=push +Patch164: gdb-6.3-readnever-20050907.patch # Fix ia64 gdb problem with user-specified SIGILL handling -Patch169: gdb-6.3-ia64-sigill-20051115.patch - -# Allow option to continue backtracing past a zero pc value -Patch170: gdb-6.3-bt-past-zero-20051201.patch - -# Use bigger numbers than int. -Patch176: gdb-6.3-large-core-20051206.patch +#=ia64 +Patch169: gdb-6.3-ia64-sigill-20051115.patch # Fix debuginfo addresses resolving for --emit-relocs Linux kernels (BZ 203661). -Patch188: gdb-6.5-bz203661-emit-relocs.patch - -# Security patch: avoid stack overflows in dwarf expression computation. -# CVE-2006-4146 -Patch190: gdb-6.5-dwarf-stack-overflow.patch +#=push+work: There was some mail thread about it, this patch may be a hack. +Patch188: gdb-6.5-bz203661-emit-relocs.patch # Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337). -Patch194: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +#=push+work: It should be replaced by existing uncommitted Roland's glibc patch for TLS without libpthreads. +Patch194: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch # Fix TLS symbols resolving for shared libraries with a relative pathname. # The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'. -Patch196: gdb-6.5-sharedlibrary-path.patch +#=fedoratest+work: One should recheck if it is really fixed upstream. +Patch196: gdb-6.5-sharedlibrary-path.patch # Suggest fixing your target architecture for gdbserver(1) (BZ 190810). # FIXME: It could be autodetected. -Patch199: gdb-6.5-bz190810-gdbserver-arch-advice.patch +#=push+work: There are more such error cases that can happen. +Patch199: gdb-6.5-bz190810-gdbserver-arch-advice.patch # Testcase for deadlocking on last address space byte; for corrupted backtraces. -Patch211: gdb-6.5-last-address-space-byte-test.patch +#=fedoratest +Patch211: gdb-6.5-last-address-space-byte-test.patch # Improved testsuite results by the testsuite provided by the courtesy of BEA. -Patch208: gdb-6.5-BEA-testsuite.patch +#=fedoratest+work: For upstream it should be rewritten as a dejagnu test, the test of no "??" was useful. +Patch208: gdb-6.5-BEA-testsuite.patch # Fix readline segfault on excessively long hand-typed lines. -Patch209: gdb-6.5-readline-long-line-crash.patch -Patch213: gdb-6.5-readline-long-line-crash-test.patch +#=drop: After upstream's readline rebase it will be obsolete. +Patch209: gdb-6.5-readline-long-line-crash.patch +#=fedoratest +Patch213: gdb-6.5-readline-long-line-crash-test.patch # Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711). -Patch214: gdb-6.5-bz216711-clone-is-outermost.patch +#=fedoratest +Patch214: gdb-6.5-bz216711-clone-is-outermost.patch # Test sideeffects of skipping ppc .so libs trampolines (BZ 218379). -Patch216: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch +#=fedoratest +Patch216: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch # Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379). -Patch217: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch +#=push +Patch217: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch # Find symbols properly at their original (included) file (BZ 109921). -Patch225: gdb-6.5-bz109921-DW_AT_decl_file-test.patch +#=fedoratest +Patch225: gdb-6.5-bz109921-DW_AT_decl_file-test.patch # Update PPC unwinding patches to their upstream variants (BZ 140532). -Patch229: gdb-6.3-bz140532-ppc-unwinding-test.patch +#=fedoratest+ppc +Patch229: gdb-6.3-bz140532-ppc-unwinding-test.patch # Testcase for exec() from threaded program (BZ 202689). -Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch +#=fedoratest +Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch # Backported fixups post the source tarball. -Patch232: gdb-upstream.patch +#Xdrop: Just backports. +#Patch232: gdb-upstream.patch # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). -Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch +#=fedoratest+ppc +Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch # Temporary support for shared libraries >2GB on 64bit hosts. (BZ 231832) -Patch235: gdb-6.3-bz231832-obstack-2gb.patch - -# Fix debugging GDB itself - the compiled in source files paths (BZ 225783). -Patch241: gdb-6.6-bz225783-gdb-debuginfo-paths.patch +#=push+work: Upstream should have backward compat. API: libc-alpha: <20070127104539.GA9444@.*> +Patch235: gdb-6.3-bz231832-obstack-2gb.patch # Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517). -Patch245: gdb-6.6-bz229517-gcore-without-terminal.patch +#=fedoratest +Patch245: gdb-6.6-bz229517-gcore-without-terminal.patch # Notify user of a child forked process being detached (BZ 235197). -Patch247: gdb-6.6-bz235197-fork-detach-info.patch +#=push: This is more about discussion if/what should be printed. +Patch247: gdb-6.6-bz235197-fork-detach-info.patch # Avoid too long timeouts on failing cases of "annota1.exp annota3.exp". -Patch254: gdb-6.6-testsuite-timeouts.patch +#=push +Patch254: gdb-6.6-testsuite-timeouts.patch # Support for stepping over PPC atomic instruction sequences (BZ 237572). -Patch258: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch - -# Link with libreadline provided by the operating system. -Patch261: gdb-6.6-readline-system.patch +#=fedoratest +Patch258: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch # Test kernel VDSO decoding while attaching to an i386 process. -Patch263: gdb-6.3-attach-see-vdso-test.patch +#=fedoratest +Patch263: gdb-6.3-attach-see-vdso-test.patch # Do not hang on exit of a thread group leader (BZ 247354). -Patch265: gdb-6.6-bz247354-leader-exit-fix.patch -Patch266: gdb-6.6-bz247354-leader-exit-test.patch +#=push +Patch265: gdb-6.6-bz247354-leader-exit-fix.patch +#=push +Patch266: gdb-6.6-bz247354-leader-exit-test.patch # Test leftover zombie process (BZ 243845). -Patch271: gdb-6.5-bz243845-stale-testing-zombie-test.patch +#=fedoratest +Patch271: gdb-6.5-bz243845-stale-testing-zombie-test.patch # New locating of the matching binaries from the pure core file (build-id). -Patch274: gdb-6.6-buildid-locate.patch -Patch353: gdb-6.6-buildid-locate-rpm.patch +#=push +Patch274: gdb-6.6-buildid-locate.patch +#=push +Patch353: gdb-6.6-buildid-locate-rpm.patch +# Workaround librpm BZ 643031 due to its unexpected exit() calls (BZ 642879). +#=push +Patch519: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch # Fix displaying of numeric char arrays as strings (BZ 224128). -Patch282: gdb-6.7-charsign-test.patch +#=fedoratest: But it is failing anyway, one should check the behavior more. +Patch282: gdb-6.7-charsign-test.patch # Test PPC hiding of call-volatile parameter register. -Patch284: gdb-6.7-ppc-clobbered-registers-O2-test.patch +#=fedoratest+ppc +Patch284: gdb-6.7-ppc-clobbered-registers-O2-test.patch # Testsuite fixes for more stable/comparable results. -Patch287: gdb-6.7-testsuite-stable-results.patch +#=push +Patch287: gdb-6.7-testsuite-stable-results.patch # Test ia64 memory leaks of the code using libunwind. -Patch289: gdb-6.5-ia64-libunwind-leak-test.patch +#=fedoratest +Patch289: gdb-6.5-ia64-libunwind-leak-test.patch # Test hiding unexpected breakpoints on intentional step commands. -Patch290: gdb-6.5-missed-trap-on-step-test.patch +#=fedoratest +Patch290: gdb-6.5-missed-trap-on-step-test.patch # Support DW_TAG_interface_type the same way as DW_TAG_class_type (BZ 426600). -Patch293: gdb-6.7-bz426600-DW_TAG_interface_type-fix.patch -Patch294: gdb-6.7-bz426600-DW_TAG_interface_type-test.patch +#=fedoratest +Patch294: gdb-6.7-bz426600-DW_TAG_interface_type-test.patch # Test gcore memory and time requirements for large inferiors. -Patch296: gdb-6.5-gcore-buffer-limit-test.patch +#=fedoratest +Patch296: gdb-6.5-gcore-buffer-limit-test.patch # Test debugging statically linked threaded inferiors (BZ 239652). # - It requires recent glibc to work in this case properly. -Patch298: gdb-6.6-threads-static-test.patch - -# Fix #include on kernel-headers-2.6.25-0.40.rc1.git2.fc9.x86_64. -Patch304: gdb-6.7-kernel-headers-compat.patch +#=fedoratest +Patch298: gdb-6.6-threads-static-test.patch # Test GCORE for shmid 0 shared memory mappings. -Patch309: gdb-6.3-mapping-zero-inode-test.patch +#=fedoratest: But it is broken anyway, sometimes the case being tested is not reproducible. +Patch309: gdb-6.3-mapping-zero-inode-test.patch # Test a crash on `focus cmd', `focus prev' commands. -Patch311: gdb-6.3-focus-cmd-prev-test.patch +#=fedoratest +Patch311: gdb-6.3-focus-cmd-prev-test.patch # Test various forms of threads tracking across exec() (BZ 442765). -Patch315: gdb-6.8-bz442765-threaded-exec-test.patch +#=fedoratest +Patch315: gdb-6.8-bz442765-threaded-exec-test.patch # Silence memcpy check which returns false positive (sparc64) -Patch317: gdb-6.8-sparc64-silence-memcpy-check.patch - -# Fix memory trashing on binaries from GCC Ada (workaround GCC PR 35998). -Patch318: gdb-6.8-gcc35998-ada-memory-trash.patch +#=push: But it is just a GCC workaround, look up the existing GCC PR for it. +Patch317: gdb-6.8-sparc64-silence-memcpy-check.patch # Test a crash on libraries missing the .text section. -Patch320: gdb-6.5-section-num-fixup-test.patch - -# Fix compatibility with recent glibc headers. -Patch324: gdb-6.8-glibc-headers-compat.patch +#=fedoratest +Patch320: gdb-6.5-section-num-fixup-test.patch # Create a single binary `gdb' autodetecting --tui by its argv[0]. -Patch326: gdb-6.8-tui-singlebinary.patch +#=push+work: IIRC Tom told argv[0] should not be used by GNU programs, also drop libgdb.a. +Patch326: gdb-6.8-tui-singlebinary.patch # Fix PRPSINFO in the core files dumped by gcore (BZ 254229). -Patch329: gdb-6.8-bz254229-gcore-prpsinfo.patch +#=push +Patch329: gdb-6.8-bz254229-gcore-prpsinfo.patch # Fix register assignments with no GDB stack frames (BZ 436037). -Patch330: gdb-6.8-bz436037-reg-no-longer-active.patch +#=push+work: This fix is incorrect. +Patch330: gdb-6.8-bz436037-reg-no-longer-active.patch # Make the GDB quit processing non-abortable to cleanup everything properly. -Patch331: gdb-6.8-quit-never-aborts.patch - -# Support DW_TAG_constant for Fortran in recent Fedora/RH GCCs. -Patch332: gdb-6.8-fortran-tag-constant.patch +#=push: Useful only after gdb-6.8-attach-signalled-detach-stopped.patch . +Patch331: gdb-6.8-quit-never-aborts.patch # Fix attaching to stopped processes and/or pending signals. -Patch337: gdb-6.8-attach-signalled-detach-stopped.patch +#=push+work +Patch337: gdb-6.8-attach-signalled-detach-stopped.patch # Test the watchpoints conditionals works. -Patch343: gdb-6.8-watchpoint-conditionals-test.patch +#=fedoratest +Patch343: gdb-6.8-watchpoint-conditionals-test.patch # Fix resolving of variables at locations lists in prelinked libs (BZ 466901). -Patch348: gdb-6.8-bz466901-backtrace-full-prelinked.patch +#=fedoratest +Patch348: gdb-6.8-bz466901-backtrace-full-prelinked.patch -# The merged branch `archer' of: http://sourceware.org/gdb/wiki/ProjectArcher -Patch349: gdb-archer.patch -Patch420: gdb-archer-ada.patch +# The merged branch `archer-jankratochvil-fedora15' of: +# http://sourceware.org/gdb/wiki/ProjectArcher +#=push +#archer-jankratochvil-vla +#=push +#archer-jankratochvil-watchpoint3 +#=push +#archer-jankratochvil-ifunc +Patch349: gdb-archer.patch # Fix parsing elf64-i386 files for kdump PAE vmcore dumps (BZ 457187). # - Turn on 64-bit BFD support, globally enable AC_SYS_LARGEFILE. -Patch360: gdb-6.8-bz457187-largefile-test.patch +#=fedoratest +Patch360: gdb-6.8-bz457187-largefile-test.patch # New test for step-resume breakpoint placed in multiple threads at once. -Patch381: gdb-simultaneous-step-resume-breakpoint-test.patch +#=fedoratest +Patch381: gdb-simultaneous-step-resume-breakpoint-test.patch # Fix GNU/Linux core open: Can't read pathname for load map: Input/output error. -Patch382: gdb-core-open-vdso-warning.patch +#=push+work: It should be in glibc: libc-alpha: <20091004161706.GA27450@.*> +Patch382: gdb-core-open-vdso-warning.patch + +# Fix callback-mode readline-6.0 regression for CTRL-C (for RHEL-6.0). +Patch390: gdb-readline-6.0-signal.patch # Fix syscall restarts for amd64->i386 biarch. -Patch391: gdb-x86_64-i386-syscall-restart.patch +#=push +Patch391: gdb-x86_64-i386-syscall-restart.patch # Fix stepping with OMP parallel Fortran sections (BZ 533176). -Patch392: gdb-bz533176-fortran-omp-step.patch +#=push+work: It requires some better DWARF annotations. +Patch392: gdb-bz533176-fortran-omp-step.patch # Fix regression by python on ia64 due to stale current frame. -Patch397: gdb-follow-child-stale-parent.patch +#=push +Patch397: gdb-follow-child-stale-parent.patch # Workaround ccache making lineno non-zero for command-line definitions. -Patch403: gdb-ccache-workaround.patch +#=drop: ccache is rarely used and it is even fixed now. +Patch403: gdb-ccache-workaround.patch # Implement `info common' for Fortran. -Patch404: gdb-fortran-common-reduce.patch -Patch405: gdb-fortran-common.patch +#=push +Patch404: gdb-fortran-common-reduce.patch +#=push +Patch405: gdb-fortran-common.patch # Testcase for "Do not make up line information" fix by Daniel Jacobowitz. -Patch407: gdb-lineno-makeup-test.patch +#=fedoratest +Patch407: gdb-lineno-makeup-test.patch # Test power7 ppc disassembly. -Patch408: gdb-ppc-power7-test.patch +#=fedoratest+ppc +Patch408: gdb-ppc-power7-test.patch # Revert: Add -Wunused-function to compile flags. -Patch412: gdb-unused-revert.patch +#=drop +Patch412: gdb-unused-revert.patch # Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866). -Patch417: gdb-bz541866-rwatch-before-run.patch - -# Fix crash on C++ types in some debug info files (BZ 575292, Keith Seitz). -# Temporarily workaround the crash of BZ 575292 as there was now BZ 585445. -# Re-enable the BZ 575292 and BZ 585445 C++ fix using an updated patch. -Patch451: gdb-bz575292-delayed-physname.patch +#=push+work: It should be fixed properly instead. +Patch417: gdb-bz541866-rwatch-before-run.patch # Fix crash when using GNU IFUNC call from breakpoint condition. -Patch454: gdb-bz539590-gnu-ifunc-fix-cond.patch +#=drop: After archer-jankratochvil-ifunc gets in this one gets obsoleted. +Patch454: gdb-bz539590-gnu-ifunc-fix-cond.patch # Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623). -Patch459: gdb-moribund-utrace-workaround.patch - -# Remove core file when starting a process (BZ 594560). -Patch461: gdb-bz594560-core-vs-process.patch +#=push+work: Currently it is still not fully safe. +Patch459: gdb-moribund-utrace-workaround.patch # Fix follow-exec for C++ programs (bugreported by Martin Stransky). -Patch470: gdb-archer-next-over-throw-cxx-exec.patch +#=fedoratest +Patch470: gdb-archer-next-over-throw-cxx-exec.patch # Backport DWARF-4 support (BZ 601887, Tom Tromey). -Patch475: gdb-bz601887-dwarf4-rh-test.patch +#=fedoratest +Patch475: gdb-bz601887-dwarf4-rh-test.patch # Print 2D C++ vectors as matrices (BZ 562763, sourceware10659, Chris Moller). -Patch486: gdb-bz562763-pretty-print-2d-vectors.patch -Patch487: gdb-bz562763-pretty-print-2d-vectors-libstdcxx.patch +#=push+work: There are some outstanding issues, check the mails. +Patch486: gdb-bz562763-pretty-print-2d-vectors.patch +#=push+work: There are some outstanding issues, check the mails. +Patch487: gdb-bz562763-pretty-print-2d-vectors-libstdcxx.patch -# Fix prelinked executables with sepdebug and copy relocations (BZ 614659). -Patch489: gdb-bz614659-prelink-dynbss.patch +# [delayed-symfile] Test a backtrace regression on CFIs without DIE (BZ 614604). +#=fedoratest +Patch490: gdb-test-bt-cfi-without-die.patch # Provide /usr/bin/gdb-add-index for rpm-build (Tom Tromey). -Patch491: gdb-gdb-add-index-script.patch - -# Fix gcore from very small terminal windows (BZ 555076). -Patch493: gdb-bz555076-gcore-small-height.patch +#=drop: Re-check against the upstream version. +Patch491: gdb-gdb-add-index-script.patch # Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248). -Patch496: gdb-bz568248-oom-is-error.patch +#=drop+work: Inferior objects should be read in parts, then this patch gets obsoleted. +Patch496: gdb-bz568248-oom-is-error.patch # Workaround false GCC warning(s). -Patch497: gdb-false-gcc-warning.patch +#=push +Patch497: gdb-false-gcc-warning.patch + +# Fix gcore writer for -Wl,-z,relro (PR corefiles/11804). +#=push: There is different patch on gdb-patches, waiting now for resolution in kernel. +Patch504: gdb-bz623749-gcore-relro.patch + +# Fix lost siginfo_t in linux-nat (BZ 592031). +#=push +Patch510: gdb-bz592031-siginfo-lost-4of5.patch +#=push +Patch511: gdb-bz592031-siginfo-lost-5of5.patch + +# Verify GDB Python built-in function gdb.solib_address exists (BZ # 634108). +#=fedoratest +Patch526: gdb-bz634108-solib_address.patch + +# New testcase py-prettyprint.exp:print hint_error (for BZ 611569, BZ 629236). +#=fedoratest +Patch541: gdb-test-pp-hint-error.patch + +# New test gdb.arch/x86_64-pid0-core.exp for kernel PID 0 cores (BZ 611435). +#=fedoratest +Patch542: gdb-test-pid0-core.patch + +# [archer-tromey-delayed-symfile] New test gdb.dwarf2/dw2-aranges.exp. +# =fedoratest +Patch547: gdb-test-dw2-aranges.patch + +# [archer-keiths-expr-cumulative+upstream] Import C++ testcases. +# =fedoratest +Patch548: gdb-test-expr-cumulative-archer.patch + +# Fix DWARF-3+ DW_AT_accessibility default assumption for F15 gcc-4.6. +# =push +Patch554: gdb-dwarf3-accessibility.patch + +# Temporary fix of F15 gcc-4.6 child DIEs of DW_TAG_typedef (BZ 672230). +# =push +Patch555: gdb-gcc46-typedef.patch + +# Workaround gcc-4.6 stdarg false prologue end (GDB PR 12435 + GCC PR 47471). +# =push +Patch556: gdb-gcc46-stdarg-prologue.patch + +# Fix Python new-backtrace command (BZ 672235, Phil Muldoon). +# =push +Patch557: gdb-python-newbacktrace.patch + +# Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). +Patch565: gdb-physname-pr11734-1of2.patch +Patch566: gdb-physname-pr11734-2of2.patch +Patch567: gdb-physname-pr12273.patch + # Fix readline 5.1 warnings -Patch1000: readline-5.1-random.patch +Patch1000: readline-5.1-random.patch # Upstream patch to fix gcc -Werror -Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch -# Fix build on hppa -Patch1003: gdb-hppa.patch +Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch -BuildRequires: bison flex gettext glibc-devel ncurses-devel texinfo zlib-devel + + +BuildRequires: ncurses-devel texinfo gettext flex bison glibc-devel zlib-devel %if %{suse_version} < 1020 -BuildRequires: expat +BuildRequires: expat %else -BuildRequires: libexpat-devel +BuildRequires: libexpat-devel %endif -BuildRequires: readline-devel -BuildRequires: zlib-devel +BuildRequires: readline-devel +BuildRequires: zlib-devel %if 0%{!?_without_python:1} %if 0%{suse_version} > 1000 -Requires: python-base +Requires: python-base %endif -BuildRequires: python-devel +BuildRequires: python-devel %endif # 0%{!?_without_python:1} %if 0%{?_with_testsuite:1} @@ -442,26 +560,26 @@ BuildRequires: python-devel %endif #!s390x %endif #!el5 -BuildRequires: dejagnu sharutils +BuildRequires: sharutils dejagnu # gcc-objc++ is not covered by the GDB testsuite. -BuildRequires: gcc gcc-c++ gcc-gfortran gcc-java gcc-objc +BuildRequires: gcc gcc-c++ gcc-gfortran gcc-java gcc-objc # Copied from gcc-4.1.2-32. %ifarch %{ix86} x86_64 ia64 ppc alpha -BuildRequires: gcc-ada +BuildRequires: gcc-ada %endif -BuildRequires: glibc-devel-32bit +BuildRequires: glibc-devel-32bit %if 0%{suse_version} > 1120 -BuildRequires: gcc-c++-32bit +BuildRequires: gcc-c++-32bit %endif %endif # 0%{?_with_testsuite:1} %ifarch ia64 -BuildRequires: libunwind-devel -Requires: libunwind +BuildRequires: libunwind-devel +Requires: libunwind %endif - -PreReq: %install_info_prereq + +PreReq: %install_info_prereq %description GDB, the GNU debugger, allows you to debug programs written in C, C++, @@ -469,11 +587,9 @@ Java, and other languages, by executing them in a controlled fashion and printing their data. %if %{suse_version} > 1010 - %package -n gdbserver -License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and GFDL and BSD and Public Domain -Summary: A standalone server for GDB (the GNU source-level debugger) -Group: Development/Debuggers +Summary: A standalone server for GDB (the GNU source-level debugger) +Group: Development/Debuggers %description -n gdbserver GDB, the GNU debugger, allows you to debug programs written in C, C++, @@ -491,30 +607,18 @@ machine than the one which is running the program being debugged. %setup -q -n %{gdb_src} -# libstdc++ pretty printers. -# Disabled now for F-14 before rebase. -#tar xjf %{SOURCE4} - -# Files have `# ' statements breaking VPATH / find-debuginfo.sh . -rm -f gdb/ada-exp.c gdb/ada-lex.c gdb/c-exp.c gdb/cp-name-parser.c gdb/f-exp.c -rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c - -# Apply patches defined above. - # Match the Fedora's version info. %patch2 -p1 %if 0%{!?_with_upstream:1} -%patch232 -p1 +#patch232 -p1 %patch349 -p1 -%patch420 -p1 %patch1 -p1 %patch3 -p1 %patch104 -p1 %patch105 -p1 -%patch106 -p1 %patch111 -p1 %patch112 -p1 %patch118 -p1 @@ -525,9 +629,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch140 -p1 %patch141 -p1 %patch259 -p1 -%patch142 -p1 %patch145 -p1 -%patch148 -p1 %patch153 -p1 %patch157 -p1 %patch158 -p1 @@ -537,10 +639,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch163 -p1 %patch164 -p1 %patch169 -p1 -%patch170 -p1 -%patch176 -p1 %patch188 -p1 -%patch190 -p1 %patch194 -p1 %patch196 -p1 %patch199 -p1 @@ -556,13 +655,11 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch231 -p1 %patch234 -p1 %patch235 -p1 -%patch241 -p1 %patch245 -p1 %patch247 -p1 %patch254 -p1 %patch258 -p1 %patch260 -p1 -%patch261 -p1 %patch263 -p1 %patch265 -p1 %patch266 -p1 @@ -574,23 +671,18 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch287 -p1 %patch289 -p1 %patch290 -p1 -%patch293 -p1 %patch294 -p1 %patch296 -p1 %patch298 -p1 -%patch304 -p1 %patch309 -p1 %patch311 -p1 %patch315 -p1 %patch317 -p1 -%patch318 -p1 %patch320 -p1 -%patch324 -p1 %patch326 -p1 %patch329 -p1 %patch330 -p1 %patch331 -p1 -%patch332 -p1 %patch337 -p1 %patch343 -p1 %patch348 -p1 @@ -609,24 +701,43 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch408 -p1 %patch412 -p1 %patch417 -p1 -%patch451 -p1 %patch454 -p1 %patch459 -p1 -%patch461 -p1 %patch470 -p1 %patch475 -p1 %patch486 -p1 -# This patch should be applied to gcc-4.5+.src.rpm: -#patch487 -p1 -%patch489 -p1 +%patch519 -p1 +%patch490 -p1 %patch491 -p1 -%patch493 -p1 %patch496 -p1 %patch497 -p1 +%patch504 -p1 +%patch510 -p1 +%patch511 -p1 +%patch526 -p1 +%patch541 -p1 +%patch542 -p1 +%patch547 -p1 +%patch548 -p1 +%patch554 -p1 +%patch555 -p1 +%patch556 -p1 +%patch557 -p1 +%patch565 -p1 +%patch566 -p1 +%patch567 -p1 +%patch390 -p1 +readline="$(readlink -f %{_libdir}/libreadline.so)" +if [ "$readline" = "${readline%/libreadline.so.6.0}" ] +then +%patch390 -p1 -R +fi +%if 0%{?rhel:1} +%patch487 -p1 +%endif # 0%{?rhel:1} %patch1000 %patch1002 -p1 -%patch1003 find -name "*.orig" | xargs rm -f ! find -name "*.rej" # Should not happen. @@ -680,8 +791,8 @@ CFLAGS="$CFLAGS -O0 -ggdb2" --sysconfdir=%{_sysconfdir} \ --mandir=%{_mandir} \ --infodir=%{_infodir} \ + --with-system-gdbinit=%{_sysconfdir}/gdbinit \ --with-gdb-datadir=%{_datadir}/gdb \ - --with-pythondir=%{_datadir}/gdb/python \ --enable-gdb-build-warnings=,-Wno-unused \ %ifnarch %{ix86} alpha ia64 ppc s390 s390x x86_64 ppc64 sparcv9 sparc64 --disable-werror \ @@ -884,22 +995,32 @@ ln -sf gdb $RPM_BUILD_ROOT%{_prefix}/bin/gdbtui cmp $RPM_BUILD_ROOT%{_mandir}/*/gdb.1 $RPM_BUILD_ROOT%{_mandir}/*/gdbtui.1 ln -sf gdb.1 $RPM_BUILD_ROOT%{_mandir}/*/gdbtui.1 -# Disabled now for F-14 before rebase. -#%if 0%{!?_without_python:1} -## Temporarily now: -#for LIB in lib lib64;do -# LIBPATH="$RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{_prefix}/$LIB" -# mkdir -p $LIBPATH -# # basename is being run only for the native (non-biarch) file. -# sed -e 's,@pythondir@,%{_datadir}/gdb/python,' \ -# -e 's,@toolexeclibdir@,%{_prefix}/'"$LIB," \ -# < $RPM_BUILD_DIR/%{gdb_src}/%{libstdcxxpython}/hook.in \ -# > $LIBPATH/$(basename %{_prefix}/%{_lib}/libstdc++.so.6.*)-gdb.py -#done -#test ! -e $RPM_BUILD_ROOT%{_datadir}/gdb/python/libstdcxx -#cp -a $RPM_BUILD_DIR/%{gdb_src}/%{libstdcxxpython}/libstdcxx \ -# $RPM_BUILD_ROOT%{_datadir}/gdb/python/libstdcxx -#%endif # 0%{!?_without_python:1} +mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/gdbinit.d +sed 's#%%{_sysconfdir}#%{_sysconfdir}#g' <%{SOURCE4} >$RPM_BUILD_ROOT%{_sysconfdir}/gdbinit + +for i in `find $RPM_BUILD_ROOT%{_datadir}/gdb/python/gdb -name "*.py"` +do + # Files could be also patched getting the current time. + touch -r $RPM_BUILD_DIR/%{gdb_src}/gdb/ChangeLog $i +done + +%if 0%{?rhel:1} +%if 0%{!?_without_python:1} +# Temporarily now: +for LIB in lib lib64;do + LIBPATH="$RPM_BUILD_ROOT%{_datadir}/gdb/auto-load%{_prefix}/$LIB" + mkdir -p $LIBPATH + # basename is being run only for the native (non-biarch) file. + sed -e 's,@pythondir@,%{_datadir}/gdb/python,' \ + -e 's,@toolexeclibdir@,%{_prefix}/'"$LIB," \ + < $RPM_BUILD_DIR/%{gdb_src}/%{libstdcxxpython}/hook.in \ + > $LIBPATH/$(basename %{_prefix}/%{_lib}/libstdc++.so.6.*)-gdb.py +done +test ! -e $RPM_BUILD_ROOT%{_datadir}/gdb/python/libstdcxx +cp -a $RPM_BUILD_DIR/%{gdb_src}/%{libstdcxxpython}/libstdcxx \ + $RPM_BUILD_ROOT%{_datadir}/gdb/python/libstdcxx +%endif # 0%{!?_without_python:1} +%endif # 0%{?rhel:1} # Remove the files that are part of a gdb build but that are owned and # provided by other packages. @@ -959,13 +1080,15 @@ fi %{_bindir}/gcore %{_bindir}/gdb %{_bindir}/gdbtui -%{_bindir}/gdb-add-index +%{_sysconfdir}/gdbinit +%{_sysconfdir}/gdbinit.d %{_mandir}/*/gdb.1* %{_mandir}/*/gdbtui.1* %if 0%{!?_with_upstream:1} %{_bindir}/gstack %{_mandir}/*/gstack.1* -%endif # 0%{!?_with_upstream:1} +%{_bindir}/gdb-add-index +%endif # 0%{!?_with_upstream:1} %{_datadir}/gdb %{_infodir}/annotate.info* %{_infodir}/gdb.info* @@ -975,21 +1098,2792 @@ fi %if %{suse_version} <= 1010 %{_bindir}/gdbserver %{_mandir}/*/gdbserver.1* +%ifnarch s390 s390x ia64 ppc %{sparc} +%{_libdir}/libinproctrace.so +%endif %endif # don't include the files in include, they are part of binutils %if %{suse_version} > 1010 %ifnarch sparcv9 hppa - %files -n gdbserver %defattr(-,root,root) %{_bindir}/gdbserver %{_mandir}/*/gdbserver.1* -%ifnarch s390 s390x ia64 ppc +%ifarch %{ix86} x86_64 %{_libdir}/libinproctrace.so %endif %endif %endif %changelog +* Tue Feb 08 2011 Fedora Release Engineering - 7.2.50.20110206-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Sun Feb 6 2011 Jan Kratochvil - 7.2.50.20110206-18.fc15 +- Fix regressions on C++ names resolving (PR 11734, PR 12273, Keith Seitz). + +* Sun Feb 6 2011 Jan Kratochvil - 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 - 7.2.50.20110125-16.fc15 +- Fix Python new-backtrace command (BZ 672235, Phil Muldoon). + +* Wed Jan 26 2011 Jan Kratochvil - 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 - 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 - 7.2.50.20110117-13.fc15 +- Use librpm.so.2 for rpm-4.9.0 in Fedora 15. + +* Mon Jan 17 2011 Jan Kratochvil - 7.2.50.20110117-12.fc15 +- Use %%{?dist} for sanity checking tools compliance (suggested by Petr Muller). + +* Mon Jan 17 2011 Jan Kratochvil - 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 - 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 - 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 - 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 - 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 - 7.2.50.20101231-6.fc15 +- Fix --with-system-readline doc build upstream regression. + +* Sat Jan 1 2011 Jan Kratochvil - 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 - 7.2.50.20101117-4.fc15 +- Provide stub %%{_sysconfdir}/gdbinit (BZ 651232). + +* Mon Dec 27 2010 Jan Kratochvil - 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 - 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 - 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 - 7.2-25.fc14 +- iFort compat. - case insensitive DWARF not in lowercase (BZ 645773). + +* Thu Oct 14 2010 Jan Kratochvil - 7.2-24.fc14 +- Add gdb.spec comments on the *.patch files upstream merge status. + +* Thu Oct 14 2010 Jan Kratochvil - 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 - 7.2-22.fc14 +- testsuite: Provide missing lib/gdb-python.exp (for BZ 639089). + +* Tue Oct 12 2010 Jan Kratochvil - 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 - 7.2-20.fc14 +- Fixup Release for 20.fc14. + +* Tue Oct 12 2010 Jan Kratochvil - 7.2-19.fc14 +- Use .gdb_index v3 to fix excessive resources rqmnts (BZ 640634, Tom Tromey). + +* Wed Oct 6 2010 Jan Kratochvil - 7.2-18.fc14 +- Fix false warning: non-absolute filename: (BZ 640648). + +* Thu Sep 30 2010 Jan Kratochvil - 7.2-17.fc14 +- New Conflicts: elfutils < 0.149 due to the .gdb_index .debug support. + +* Wed Sep 29 2010 Jan Kratochvil - 7.2-16.fc14 +- [ifunc] Fix crash on deleting watchpoint of an autovariable (BZ 637770). + +* Mon Sep 27 2010 Jan Kratochvil - 7.2-15.fc14 +- Revert the -O0 switch formerly to workaround GCC BZ 634757 (cmove bug). +- Remove no longer used BuildRequires: libstdc++. +- Remove commented out python libstdc++ .spec code. + +* Sat Sep 25 2010 Jan Kratochvil - 7.2-14.fc14 +- Fixup %{_datadir}/gdb/python/gdb timestamps for multilib conflicts. + +* Sat Sep 25 2010 Jan Kratochvil - 7.2-13.fc14 +- Fix .gdb_index for big-endian hosts (Tom Tromey). + +* Sat Sep 25 2010 Jan Kratochvil - 7.2-12.fc14 +- Fix lost siginfo_t in linux-nat (BZ 592031). + +* Sat Sep 25 2010 Jan Kratochvil - 7.2-11.fc14 +- Fix infinite loop crash on self-referencing class (BZ 627432). + +* Thu Sep 23 2010 Jan Kratochvil - 7.2-10.fc14 +- gcore/-Wl,-z,relro: Always write out all the pages until kernel gets a fix. + +* Wed Sep 22 2010 Jan Kratochvil - 7.2-9.fc14 +- Fix gcore writer for -Wl,-z,relro (PR corefiles/11804). + +* Wed Sep 22 2010 Jan Kratochvil - 7.2-8.fc14 +- Enable python by default even in Brew and on all the arches (BZ 609157). + +* Wed Sep 22 2010 Jan Kratochvil - 7.2-7.fc14 +- python: load *-gdb.py for shlibs during attach (BZ 634660). +- Fix double free crash during overload resolution (PR 12028, Sami Wagiaalla). + +* Sat Sep 18 2010 Jan Kratochvil - 7.2-6.fc14 +- Fix python gdb.solib_address (BZ 634108, fix by Phil Muldoon). +- Temporarily build with -O0 to workaround GCC BZ 634757 (cmove bug). + +* Tue Sep 14 2010 Jan Kratochvil - 7.2-5.fc14 +- Fix Ada regression when any .gdb_index library is present. + +* Sat Sep 11 2010 Jan Kratochvil - 7.2-4.fc14 +- Fix symbol lookup misses methods of current class (BZ 631158, Sami Wagiaalla). +- Fix python gdb.execute-to_string redirection (BZ 627506, with Paul Bolle). + +* Wed Sep 8 2010 Jan Kratochvil - 7.2-3.fc14 +- Do not crash on broken separate debuginfo due to old elfutils (BZ 631575). + +* Sat Sep 04 2010 Dennis Gilmore - 7.2-2.fc14 +- libinproctrace doesnt exist on sparc arches + +* Fri Sep 3 2010 Jan Kratochvil - 7.2-1.fc14 +- Formal update to the final FSF GDB release. + +* Tue Aug 24 2010 Dan Horák - 7.1.90.20100806-12.fc14 +- libinproctrace doesn't exist on s390(x) + +* Thu Aug 19 2010 Jan Kratochvil - 7.1.90.20100806-11.fc14 +- Fix crash on MI variable calling inferior function (BZ 610986). + +* Tue Aug 10 2010 Jan Kratochvil - 7.1.90.20100806-10.fc14 +- Fix /usr/bin/gdb-add-index missing -nx for gdb. +- New option --with profile (disabled by default - missing workload, BZ 615603). + +* Sat Aug 7 2010 Jan Kratochvil - 7.1.90.20100806-9.fc14 +- Fix python gdb.execute to_string pagination (BZ 620930). + +* Fri Aug 6 2010 Jan Kratochvil - 7.1.90.20100806-8.fc14 +- Out of memory is just an error, not fatal (uninitialized VLS vars, BZ 568248). + +* Fri Aug 6 2010 Jan Kratochvil - 7.1.90.20100806-7.fc14 +- Fix gcore from very small terminal windows (BZ 555076). +- Fix false `filesystem' debuginfo rpm request (BZ 599598). + +* Wed Jul 28 2010 Mamoru Tasaka - 7.1.90.20100721-6.fc14 +- Rebuild against python 2.7 + +* Thu Jul 22 2010 Jan Kratochvil - 7.1.90.20100721-5.fc14 +- Fix /usr/bin/gdb-add-index $d -> $dir typo. + +* Thu Jul 22 2010 Jan Kratochvil - 7.1.90.20100721-4.fc14 +- Import archer-tromey-python. +- Import archer-tromey-optional-psymtab (as present in FSF GDB post-7.2). + - Provide /usr/bin/gdb-add-index for rpm-build (Tom Tromey). + +* Thu Jul 22 2010 David Malcolm - 7.1.90.20100721-3.fc14 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Wed Jul 21 2010 Jan Kratochvil - 7.1.90.20100721-2.fc14 +- Fix prelinked executables with sepdebug and copy relocations (BZ 614659). + +* Wed Jul 21 2010 Jan Kratochvil - 7.1.90.20100721-1.fc14 +- Rebase to FSF GDB 7.1.90.20100721 (which is 7.2 pre-release). + +* Tue Jul 13 2010 Jan Kratochvil - 7.1-29.fc14 +- Disable temporarily Python files before the new rebase is done (BZ 613710). + +* Sun Jul 11 2010 Jan Kratochvil - 7.1-28.fc14 +- Rebuild for Fedora 14. + +* Wed Jun 30 2010 Jan Kratochvil - 7.1-28.fc13 +- Print 2D C++ vectors as matrices (BZ 562763, sourceware10659, Chris Moller). + +* Wed Jun 30 2010 Jan Kratochvil - 7.1-27.fc13 +- Fix obstack corruptions on C++ (BZ 606185, Chris Moller, Jan Kratochvil). +- Improve support for typedefs in classes (BZ 602314). +- Fix `set print object on' for some non-dynamic classes (BZ 606660). + +* Wed Jun 9 2010 Jan Kratochvil - 7.1-26.fc13 +- Backport DWARF-4 support (BZ 601887, Tom Tromey). + +* Wed Jun 9 2010 Jan Kratochvil - 7.1-25.fc13 +- Fix ADL anonymous type crash (BZ 600746, Sami Wagiaalla). + +* Tue Jun 1 2010 Jan Kratochvil - 7.1-24.fc13 +- Fix crash on /proc/PID/stat race during inferior exit (BZ 596751). +- testsuite: gdb.threads/watchthreads-reorder.exp kernel-2.6.33 compat. fix. + +* Sun May 30 2010 Jan Kratochvil - 7.1-23.fc13 +- Fix and support DW_OP_*piece (Tom Tromey, BZ 589467). +- Fix follow-exec for C++ programs (bugreported by Martin Stransky). + +* Mon May 24 2010 Jan Kratochvil - 7.1-22.fc13 +- Remove core file when starting a process (BZ 594560). +- Fix lock up on loops in the solib chain (BZ 593926). +- Import fix of TUI layout internal error (BZ 595475). + +* Sun May 16 2010 Jan Kratochvil - 7.1-21.fc13 +- Make gdb-6.8-bz254229-gcore-prpsinfo.patch RHEL-5 /usr/bin/patch compatible + (bugreported by Jonas Maebe). + +* Thu May 13 2010 Jan Kratochvil - 7.1-20.fc13 +- Fix crash on VLA bound referencing an optimized-out variable (BZ 591879). +- Re-enable the BZ 575292 and BZ 585445 C++ fix using an updated patch. + +* Wed May 12 2010 Jan Kratochvil - 7.1-19.fc13 +- Backport -completion bug on anonymous structure fields (BZ 590648). +- testsuite: Fix gdb.base/vla-overflow.exp FAILing on s390x (BZ 590635). +- Workaround non-stop moribund locations exploited by kernel utrace (BZ 590623). + +* Thu Apr 29 2010 Jan Kratochvil - 7.1-18.fc13 +- Make _Unwind_DebugHook independent from step-resume breakpoint (Tom Tromey). + +* Tue Apr 27 2010 Jan Kratochvil - 7.1-17.fc13 +- Fail gracefully if the _Unwind_DebugHook arg. is optimized out (Tom Tromey). + +* Tue Apr 27 2010 Jan Kratochvil - 7.1-16.fc13 +- Temporarily workaround the crash of BZ 575292 as there was now BZ 585445. + +* Mon Apr 26 2010 Jan Kratochvil - 7.1-15.fc13 +- Fix crash when using GNU IFUNC call from breakpoint condition. +- Avoid internal error by disabling the previous BZ 575292 fix (BZ 585445). + +* Thu Apr 22 2010 Jan Kratochvil - 7.1-14.fc13 +- Fix crash on C++ types in some debug info files (BZ 575292, Keith Seitz). +- Pretty printers not well documented (BZ 570635, Tom Tromey, Jan Kratochvil). + +* Fri Apr 16 2010 Jan Kratochvil - 7.1-13.fc13 +- archer-jankratochvil-fedora13 commit: 39998c496988faaa1509cc6ab76b5c4777659bf4 +- [vla] Fix boundaries for arrays on -O2 -g (support bound-ref->var->loclist). +- [vla] Fix copy_type_recursive for unavailable variables (Joost van der Sluis). + +* Sun Apr 11 2010 Jan Kratochvil - 7.1-12.fc13 +- Fix crash on trying to load invalid executable (BZ 581215). + +* Thu Apr 8 2010 Jan Kratochvil - 7.1-11.fc13 +- testsuite: Fix gdb.base/gstack.exp also for ppc64 inferiors (for BZ 579793). + +* Thu Apr 8 2010 Jan Kratochvil - 7.1-10.fc13 +- Fix s390 --with testsuite Buildrequiers to be (s390-32) (BZ 580347, Cai Qian). + +* Wed Apr 7 2010 Jan Kratochvil - 7.1-9.fc13 +- Fix gstack to print even the frame #0. New gdb.base/gstack.exp. (BZ 579793) +- Merge gdb-6.3-gstack-without-path-20060414.p* into gdb-6.3-gstack-20050411.p*, + no real code change. + +* Mon Apr 5 2010 Jan Kratochvil - 7.1-8.fc13 +- Fix breakpoint at *_start (BZ 162775, bugreport by John Reiser). + +* Sat Apr 3 2010 Jan Kratochvil - 7.1-7.fc13 +- Fix ppc build of the AVX registers support (for BZ 578250). + +* Sat Apr 3 2010 Jan Kratochvil - 7.1-6.fc13 +- Support AVX registers (BZ 578250). + +* Sat Apr 3 2010 Jan Kratochvil - 7.1-5.fc13 +- Fix dangling displays in separate debuginfo (BZ 574483). + +* Wed Mar 31 2010 Jan Kratochvil - 7.1-4.fc13 +- Remove gdb-readline-6.0-signal.patch with a bug causing crash while no longer + required with F-13 readline-6.1 (BZ 575516) + +* Mon Mar 29 2010 Jan Kratochvil - 7.1-3.fc13 +- [expr-cumulative] using-directive: Fix memory leak (Sami Wagiaalla). + +* Mon Mar 29 2010 Jan Kratochvil - 7.1-2.fc13 +- Drop obsoleted `gdb-archer-pie-0315-breakpoint_address_match.patch'. +- Do not consider memory error on reading _r_debug->r_map as fatal (BZ 576742). + - PIE: Attach binary even after re-prelinked underneath. + - PIE: Attach binary even after ld.so re-prelinked underneath. + - PIE: Fix occasional error attaching i686 binary (BZ 576742). +- testsuite: Fix unstable results of gdb.base/prelink.exp. + +* Thu Mar 25 2010 Jan Kratochvil - 7.1-1.fc13 +- Update to new FSF GDB release. + +* Mon Mar 15 2010 Jan Kratochvil - 7.0.90.20100312-24.fc13 +- Drop gdb-6.5-bz218379-ppc-solib-trampoline-fix.patch having false symbols + resolving (related to BZ 573277). + +* Fri Mar 12 2010 Jan Kratochvil - 7.0.90.20100312-23.fc13 +- Update to new FSF GDB snapshot. +- Fix double-free on std::terminate handler (Tom Tromey, BZ 562975). + +* Wed Mar 10 2010 Jan Kratochvil - 7.0.90.20100306-22.fc13 +- Another License update. + +* Wed Mar 10 2010 Jan Kratochvil - 7.0.90.20100306-21.fc13 +- Update License for all the licenses contained in .src.rpm. + +* Mon Mar 8 2010 Jan Kratochvil - 7.0.90.20100306-20.fc13 +- Remove unapplied: gdb-6.8-inlining-addon.patch gdb-6.8-inlining-by-name.patch + +* Mon Mar 8 2010 Jan Kratochvil - 7.0.90.20100306-19.fc13 +- Include also %%doc COPYING3 (review by Petr Machata). +- Remove URL for Source (review by Matej Cepl). + +* Sun Mar 7 2010 Jan Kratochvil - 7.0.90.20100306-18.fc13 +- archer-jankratochvil-fedora13 commit: 59c35a31f0981a0f0b884b32c91ae6325b2126cd + +* Sun Feb 28 2010 Jan Kratochvil - 7.0.50.20100203-17.fc13 +- Fix false warning: section .gnu.liblist not found in ... +- Fix crash on stale addrinfo->sectindex (more sensitive due to the PIE patch). + +* Fri Feb 26 2010 Jan Kratochvil - 7.0.50.20100203-16.fc13 +- Fix ia64 part of the bt-clone-stop.exp fix. +- Fix gdb.ada/* regressions (Keith Seitz). +- Remove false gdb_assert on $sp underflow. + +* Mon Feb 8 2010 Jan Kratochvil - 7.0.50.20100203-15.fc13 +- Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866). + +* Wed Feb 3 2010 Jan Kratochvil - 7.0.50.20100203-14.fc13 +- Rediff gdb-6.8-bz254229-gcore-prpsinfo.patch for older patch(1) compatibility. + +* Wed Feb 3 2010 Jan Kratochvil - 7.0.50.20100203-13.fc13 +- archer-jankratochvil-fedora13 commit: 59c35a31f0981a0f0b884b32c91ae6325b2126cd +- Fortran: Fix regression on setting breakpoint at toplevel symbols (BZ 559291; + David Moore, Intel). + +* Mon Feb 1 2010 Jan Kratochvil - 7.0.50.20100128-12.fc13 +- archer-jankratochvil-fedora13 commit: 5a573e8b26a2f0a6947d4c0249e43e5456610860 +- Remove ExcludeArch on ia64 as it is now fixed up. + +* Sun Jan 31 2010 Jan Kratochvil - 7.0.50.20100128-11.fc13 +- Fix failed gdb_assert due to the PIE patchset (BZ 559414). + +* Thu Jan 28 2010 Jan Kratochvil - 7.0.50.20100128-10.fc13 +- Upgrade to the FSF GDB snapshot: 7.0.50.20100128 +- archer-jankratochvil-fedora13 commit: 39c5a8b75fad3acd7204903db5dee025055a4594 + - Fix a regression on "AAA::ALPHA" test due to a merge from FSF GDB. +- Fix a regression of previous release due to false identification as core file. +- Move ifunc .patch into the GIT-managed archer-jankratochvil-fedora13 branch. +- Update gdb.pie/corefile.exp from 2007-01-26 FSF GDB commit by Andreas Schwab. + +* Mon Jan 25 2010 Jan Kratochvil - 7.0.50.20100121-9.fc13 +- Enable loading a core file just as a single argument to /usr/bin/gdb. + +* Sun Jan 24 2010 Jan Kratochvil - 7.0.50.20100121-8.fc13 +- testsuite: Fix gdb.arch/i386-bp_permanent.exp regression + +* Sun Jan 24 2010 Jan Kratochvil - 7.0.50.20100121-7.fc13 +- Update gdb.arch/powerpc-power7.exp for current binutils HEAD. + +* Fri Jan 22 2010 Jan Kratochvil - 7.0.50.20100121-6.fc13 +- Disable addon (finish) due to inline-cmds.exp: up from outer_inline2 assert. +- Fix gdb.arch/powerpc-power7.exp compatibility. + +* Fri Jan 22 2010 Jan Kratochvil - 7.0.50.20100121-5.fc13 +- Disable break-by-name on inlined functions due to a regression on parameters + of inlined functions falsely (BZ 556975 Comment 8). + +* Fri Jan 22 2010 Jan Kratochvil - 7.0.50.20100121-4.fc13 +- Adjust BuildRequires for RHELs, add ExcludeArch on ia64. +- Disable one PIE-introduced assertion on RHELs. + +* Thu Jan 21 2010 Jan Kratochvil - 7.0.50.20100121-3.fc13 +- Revert FSF GDB gdbserver tracepoints as incomplete now. + +* Thu Jan 21 2010 Jan Kratochvil - 7.0.50.20100121-2.fc13 +- archer-jankratochvil-fedora13 commit: 21e418c04290aa5d2e75543d31fe3fe5d70d6d41 +- [expr-cumulative] Fix "break expr if (cond)" regression. + +* Thu Jan 21 2010 Jan Kratochvil - 7.0.50.20100121-1.fc13 +- Upgrade to the FSF GDB snapshot: 7.0.50.20100121 +- archer-jankratochvil-fedora13 commit: ccde1530479cc966374351038057b9dda90aa251 +- [expr-cumulative] Archer branch is now included. + +* Tue Jan 19 2010 Jan Kratochvil - 7.0.50.20100118-2.fc13 +- Fix false PASS->FAIL of gdb.arch/i386-biarch-core.exp. + +* Tue Jan 19 2010 Jan Kratochvil - 7.0.50.20100118-1.fc13 +- Upgrade to the FSF GDB snapshot: 7.0.50.20100118 +- Upgrade libstdc++-v3-python to r155978 (Phil Muldoon). + +* Sat Jan 16 2010 Jan Kratochvil - 7.0.50.20100116-1.fc13 +- Upgrade to the FSF GDB snapshot: 7.0.50.20100116 +- archer-jankratochvil-fedora13 commit: 81810a20b2d2c3bf18e151de3cddfc96445b3c46 +- [expr-cumulative] Archer branch is missing in this release. +- Update rpm.org#76 workaround for rpm-4.8 using librpm.so.1. +- Dissect archer-jankratochvil-misc into Patch403...Patch408. +- Some regressions exist in this release. + +* Tue Jan 12 2010 Jan Kratochvil - 7.0.1-25.fc12 +- non-librpm missing debuginfo yumcommand now prints also --disablerepo='*' + to save some bandwidth by yum (Robin Green, BZ 554152). + +* Sun Jan 10 2010 Jan Kratochvil - 7.0.1-24.fc12 +- testsuite: BuildRequires also valgrind. + +* Fri Jan 8 2010 Jan Kratochvil - 7.0.1-23.fc12 +- Workaround missing libstdc++%%{bits_other} in Koji. + +* Fri Jan 8 2010 Jan Kratochvil - 7.0.1-22.fc12 +- Comply with new package review: + - Fix .spec Source as this is not a snapshot now. + - Convert all spaces to tabs. + - Fix missing %%defattr at %%files for gdbserver. + - Replace all hardcoded-library-path by variants of %%{_isa}. +- Include %%{_isa} for appropriate Requires and BuildRequires. + +* Thu Jan 7 2010 Jan Kratochvil - 7.0.1-21.fc12 +- [vla] Fix regression on fields of structs in internal vars (BZ 553338). +- archer-jankratochvil-fedora12 commit: 6e73988f653ba986e8742f208f17ec084292cbd5 + +* Thu Jan 7 2010 Jan Kratochvil - 7.0.1-20.fc12 +- Fix crash reading broken stabs (it377671). + +* Sun Jan 3 2010 Jan Kratochvil - 7.0.1-19.fc12 +- testsuite: Fixup false FAILs for gdb.cp/constructortest.exp. + +* Sat Jan 2 2010 Jan Kratochvil - 7.0.1-18.fc12 +- Fix regression of gdb-7.0 (from 6.8) crashing on typedefed bitfields. +- Fix related_breakpoint stale ref crash. + +* Fri Jan 1 2010 Jan Kratochvil - 7.0.1-17.fc12 +- Formal upgrade to the FSF GDB release gdb-7.0.1. + - Fix regression of gdb-7.0.1 not preserving typedef of a field. + +* Fri Jan 1 2010 Jan Kratochvil - 7.0-16.fc12 +- More RHEL-5 compatibility updates. + - Disable the build-id support by default. + - Bundle back gdbserver to the base gdb package. + - Remove bundled pstack. + - Drop the BuildRequires of rpm-devel. + +* Fri Jan 1 2010 Jan Kratochvil - 7.0-15.fc12 +- Fix error on a sw watchpoint active at function epilogue (hit on s390x). +- testsuite: Fix false MI "unknown output after running" regression. +- testsuite: Update ia64-sigtramp.exp for recent GDB. +- Implement bt-clone-stop.exp fix also for ia64. +- testsuite: Upstream condbreak.exp results stability fix (Daniel Jacobowitz). + +* Thu Dec 24 2009 Jan Kratochvil - 7.0-14.fc12 +- testsuite: Fix constructortest.exp and expand-sals.exp for gcc-4.4.2-20.fc12. + +* Mon Dec 21 2009 Jan Kratochvil - 7.0-13.fc12 +- [pie] Fix a race in testcase gdb.base/valgrind-db-attach.exp. +- Fix regression by python on ia64 due to stale current frame. +- Disable python iff RHEL-5 && (Brew || ppc64). + +* Mon Dec 21 2009 Jan Kratochvil - 7.0-12.fc12 +- Workaround build on native ppc64 host. +- More RHEL-5 compatibility updates. + - Disable warning messages new for gdb-6.8+ for RHEL-5 backward compatibility. + - Workaround RHEL-5 kernels for detaching SIGSTOPped processes (BZ 498595). + - Serialize the testsuite output to keep the order for regression checks. + - Re-enable python for all non-ppc* arches. + - More gcc44 stack exceptions when running the testsuite on RHEL-5. +- Fix backward compatibility with G++ 4.1 namespaces "::". +- Fix regression on re-setting the single ppc watchpoint slot. +- Update snapshot of FSF gdb-7.0.x branch. + - Backport fix of dcache invalidation locking up GDB on ppc64 targets. + +* Fri Dec 18 2009 Jan Kratochvil - 7.0-11.fc12 +- [pie] Fix general ppc64 regression due to a function descriptors bug. +- [pie] Fix also keeping breakpoints disabled in PIE mode. +- Import upstream -completion crash fix. +- Drop some unused patches from the repository. +- More RHEL-5 build compatibility updates. + - Use gfortran44 when running the testsuite on RHEL-5. + - Disable python there due to insufficient ppc multilib. +- Fix orphanripper hangs and thus enable it again. + +* Mon Dec 14 2009 Jan Kratochvil - 7.0-10.fc12 +- Make gdb-6.3-rh-testversion-20041202.patch to accept both RHEL and Fedora GDB. +- Adjust BuildRequires for Fedora-12, RHEL-6 and RHEL-5 builds. +- [vla] Fix compatibility of dynamic arrays with iFort (BZ 514287). +- Fix stepping through OMP parallel Fortran sections (BZ 533176). +- New fix of bp conditionals [bp_location-accel] regression (BZ 538626). + +* Mon Dec 7 2009 Jan Kratochvil - 7.0-9.fc12 +- Replace the PIE (Position Indepdent Executable) support patch by a new one. +- Drop gdb-6.3-nonthreaded-wp-20050117.patch as fuzzy + redundant. +- Fix callback-mode readline-6.0 regression for CTRL-C. +- Fix syscall restarts for amd64->i386 biarch. +- Various testsuite results stability fixes. +- Fix crash on reading stabs on 64bit (BZ 537837). +- archer-jankratochvil-fedora12 commit: 16276c1aad1366b92e687c72cab30192280e1906 +- archer-jankratochvil-pie-fedora12 ct: 2ae60b5156d43aabfe5757940eaf7b4370fb05d2 + +* Thu Dec 3 2009 Jan Kratochvil - 7.0-8.fc12 +- Fix slowness/hang when printing some variables (Sami Wagiaalla, BZ 541093). +- archer-jankratochvil-fedora12 commit: 6817a81cd411acc9579f04dcc105e9bce72859ff + +* Wed Nov 25 2009 Jan Kratochvil - 7.0-7.fc12 +- Support GNU IFUNCs - indirect functions (BZ 539590). +- Fix bp conditionals [bp_location-accel] regression (Phil Muldoon, BZ 538626). +- Fix missed breakpoint location [bp_location-accel] regression (upstream). + +* Fri Oct 30 2009 Jan Kratochvil - 7.0-6 +- Fix missing zlib-devel BuildRequires to support compressed DWARF sections. +- Include post-7.0 FSF GDB fixes. + +* Fri Oct 23 2009 Jan Kratochvil - 7.0-5 +- Make the package buildable on RHEL-5/CentOS-5 (without librpm there). +- archer-jankratochvil-fedora12 commit: 5b73ea6a0f74e63db3b504792fc1d37f548bdf5c + +* Fri Oct 23 2009 Jan Kratochvil - 7.0-4 +- Fix rpm --excludedocs (BZ 515998). + +* Thu Oct 22 2009 Jan Kratochvil - 7.0-3 +- Support multiple directories for `set debug-file-directory' (BZ 528668). + +* Mon Oct 19 2009 Jan Kratochvil - 7.0-2 +- Sync the .spec with RHEL/CentOS without EPEL, do not BuildRequires: fpc there. + +* Wed Oct 7 2009 Jan Kratochvil - 7.0-1 +- Formal upgrade to the final FSF GDB release gdb-7.0. +- Fix GNU/Linux core open: Can't read pathname for load map: Input/output error. +- archer-jankratochvil-fedora12 commit: ce4ead356654b951a49ca78d81ebfff95e758bf5 + +* Wed Sep 30 2009 Jan Kratochvil - 6.8.91.20090930-2 +- Bump release. + +* Wed Sep 30 2009 Jan Kratochvil - 6.8.91.20090930-1 +- Fix broken python "help()" command "modules" (BZ 526552). +- Upgrade to the FSF GDB gdb-7.0 snapshot: 6.8.91.20090930 +- archer-jankratochvil-fedora12 commit: 7cb860f03e2437c97239334ebe240d06f45723e0 + +* Sun Sep 27 2009 Jan Kratochvil - 6.8.91.20090925-3 +- New test for step-resume breakpoint placed in multiple threads at once. + +* Fri Sep 25 2009 Jan Kratochvil - 6.8.91.20090925-2 +- Fix buildid-loading libs w/matching name but different build-id (BZ 524572). + +* Fri Sep 25 2009 Jan Kratochvil - 6.8.91.20090925-1 +- Upgrade to the FSF GDB gdb-7.0 snapshot: 6.8.91.20090925 +- archer-jankratochvil-fedora12 commit: 4338ea85c798007c32594032f602db9fd230eba9 + - [python] Don't directly reference self.frame (Tom Tromey). + - [expr] Updates from branch (Keith Seitz). + +* Mon Sep 21 2009 Jan Kratochvil - 6.8.91.20090921-1 +- Upgrade to the FSF GDB gdb-7.0 snapshot: 6.8.91.20090921 +- archer-jankratochvil-fedora12 commit: 0d5c38dd89050c0ee1cf049656f177c170d675d4 + - [expr] Check has_stack_frames before calling find_pc_line (Sami Wagiaalla). + +* Thu Sep 17 2009 Jan Kratochvil - 6.8.91.20090917-2 +- Include bundled libstdc++ python; it will be in libstdc++-devel since gcc-4.5. + +* Thu Sep 17 2009 Jan Kratochvil - 6.8.91.20090917-1 +- Upgrade to the FSF GDB gdb-7.0 branch and snapshot: 6.8.91.20090917 +- archer-jankratochvil-fedora12 commit: 16f3f01cc2cbc15283462eaabdfcde92cf42cdc6 +- Drop the qsort_cmp workaround as resolved in FSF GDB now (BZ 515434). + +* Thu Sep 10 2009 Jan Kratochvil - 6.8.50.20090910-1 +- Upgrade to the FSF GDB gdb-6.8.50 snapshot: 6.8.50.20090910 +- archer-jankratochvil-fedora12 commit: 941eb487a42933e442cb4d11344cda96ecb8a04d + - [next-over-throw] Fix exceptions thrown during next (Tom Tromey). + - [bp_location-accel] Do not (much) slow down on 500+ breakpoints (me). + +* Thu Sep 3 2009 Jan Kratochvil - 6.8.50.20090818-8 +- archer-jankratochvil-fedora12 commit: a081d2f12945e9468edd5f4341d3e945bd0fefe9 + - [expr] Fix too slow lookups in large C++ programs (Sami Wagiaalla). + - [python] Fix varobj changed values reporting (GDB PR 10584, Tom Tromey). + +* Tue Sep 1 2009 Jan Kratochvil - 6.8.50.20090818-7 +- archer-jankratochvil-fedora12 commit: d25596676e8811b03f8c9aba6bbd04ebaa9ff5db + - [call-frame-cfa] Fix parsing CFA-relative frames (BZ 516627, Tom Tromey). + - [vla] variable length Fortran strings for -O -g code (part of BZ 508406, me). + - [python] varobj + general fixes (Tom Tromey). + +* Fri Aug 28 2009 Jan Kratochvil - 6.8.50.20090818-6 +- Real upstream fixup of qsort_cmp (BZ 515434). +- Revert bitfields regression (BZ 520129). + +* Tue Aug 25 2009 Jan Kratochvil - 6.8.50.20090818-5 +- Temporarily disable assertion checks crashing in qsort_cmp (BZ 515434). + +* Wed Aug 19 2009 Jan Kratochvil - 6.8.50.20090818-4 +- Fixup "bad type" internal error, import from FSF GDB. +- archer-jankratochvil-fedora12 commit: 2ba2bc451eb832182ef84c3934115de7a329da7c + +* Tue Aug 18 2009 Jan Kratochvil - 6.8.50.20090818-3 +- archer-jankratochvil-fedora12 commit: 850e3cb38a25cb7fdfa4cef667626ffbde51bcac +- Fix the hardware watchpoints. + +* Tue Aug 18 2009 Jan Kratochvil - 6.8.50.20090818-2 +- Fix patch fuzz 0. + +* Tue Aug 18 2009 Jan Kratochvil - 6.8.50.20090818-1 +- Upgrade to the FSF GDB gdb-6.8.50 snapshot: 6.8.50.20090818 +- archer-jankratochvil-fedora12 commit: 5e0d1cc74f119391a2c3ae25ef5749fc28674f06 + +* Wed Aug 12 2009 Jan Kratochvil - 6.8.50.20090811-4 +- Fix minor regressions introduced by the rebase from F-11 (6.8.50.20090302). + +* Tue Aug 11 2009 Jan Kratochvil - 6.8.50.20090811-3 +- archer-jankratochvil-fedora12 commit: 2888fafe63889757c6fd27ccc2f25661d43fd1a4 +- Drop archer-jankratochvil-vla VAROBJ invalidate/revalidate split to fix + regressions against FSF GDB HEAD. + +* Tue Aug 11 2009 Jan Kratochvil - 6.8.50.20090811-2 +- archer-jankratochvil-fedora12 commit: 93f5e942bdcdcc376ece452c309bedabae71def9 +- Fix "can't compute CFA for this frame" (by Tom Tromey, BZ 516627). + +* Tue Aug 11 2009 Jan Kratochvil - 6.8.50.20090811-1 +- Support constant DW_AT_data_member_location by GCC PR debug/40659 (BZ 515377). +- Fix .spec URL. +- archer-jankratochvil-fedora12 commit: 81de3c6abae4f7e3738aa9bcc0ab2f8725cce252 + +* Mon Aug 10 2009 Jan Kratochvil - 6.8.50.20090810-2 +- Upgrade to the FSF GDB gdb-6.8.50 snapshot: 6.8.50.20090810 +- archer-jankratochvil-fedora12 commit: 93ec16e6f5000dd64d433d86674e820ed0f35b72 + +* Tue Aug 4 2009 Jan Kratochvil - 6.8.50.20090803-2 +- Drop the bundled libstdc++ python - it should be packaged on its own now. + +* Tue Aug 4 2009 Jan Kratochvil - 6.8.50.20090803-1 +- Upgrade to the FSF GDB gdb-6.8.50 snapshot: 6.8.50.20090803 +- archer-jankratochvil-fedora12 commit: 0222cb1f4ddd1eda32965e464cb60b1e44e110b2 + +* Fri Jul 31 2009 Jan Kratochvil - 6.8.50.20090302-42 +- Release bump only. + +* Fri Jul 31 2009 Jan Kratochvil - 6.8.50.20090302-41 +- Fix compatibility of --with-system-readline and readline-6.0+. +- Temporarily disabled orphanripper on Fedora 12. + +* Fri Jul 24 2009 Fedora Release Engineering - 6.8.50.20090302-40 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Mon Jul 6 2009 Jan Kratochvil - 6.8.50.20090302-39 +- testsuite: Fix multiple runs in parallel on a single host. +- testsuite: Remove the rpmbuild option: --with parallel +- testsuite: Run the testsuite with default rpm _smp_mflags. + +* Mon Jul 6 2009 Jan Kratochvil - 6.8.50.20090302-38 +- Archer update to the snapshot: 17bfc0488f54aeeb7a9e20ef3caa7e31e8e985fb +- Archer backport: de9c5190034b84b0a5fb4b98b05b304cda187700 + - [vla] Fix a crash regression on constant DW_AT_data_member_location. + +* Mon Jun 29 2009 Jan Kratochvil - 6.8.50.20090302-37 +- Replace the fix of cloned-TIDs with no pthread from upstream (BZ 471819). +- Fix a parallel testsuite runs incompatibility in gdb.base/gcore-shmid0.exp. + +* Mon Jun 29 2009 Jan Kratochvil - 6.8.50.20090302-36 +- Fix GDB crash on cloned-TIDs with no associated pthread (BZ 471819). +- Workaround rpm.org#76 rpm-devel requirement for debuginfo names (BZ 508193). + +* Mon Jun 22 2009 Jan Kratochvil - 6.8.50.20090302-35 +- Accelerate sorting blocks on reading a file (found on WebKit) (BZ 507267). + +* Mon Jun 22 2009 Jan Kratochvil - 6.8.50.20090302-34 +- Fix backtraces from core files with the executable found+loaded via build-id. + - Due to F-11 GCC no longer needlessly duplicating .eh_frame as .debug_frame. + +* Tue Jun 16 2009 Jan Kratochvil - 6.8.50.20090302-33 +- Archer update to the snapshot: 05c402a02716177c4ddd272a6e312cbd2908ed68 +- Archer backport: 05c402a02716177c4ddd272a6e312cbd2908ed68 + - Remove the [archer-pmuldoon-exception-rewind-master] branch. + - Include this functionality as a FSF GDB accepted patchset. + +* Mon Jun 15 2009 Jan Kratochvil - 6.8.50.20090302-32 +- Fix crash on pending breakpoints with PIE (position-indep.-exec.) (BZ 505943). + +* Fri Jun 12 2009 Jan Kratochvil - 6.8.50.20090302-31 +- Fix an occasional crash during printing of missing debuginfo rpms (BZ 505401). + +* Fri Jun 12 2009 Jan Kratochvil - 6.8.50.20090302-30 +- Implement DW_OP_call_frame_cfa (for recent GCC). + +* Thu Jun 11 2009 Jan Kratochvil - 6.8.50.20090302-29 +- Archer update to the snapshot: 30c13da4efe18f43ee34aa4b29bc86e1a53de548 +- Archer backport: 30c13da4efe18f43ee34aa4b29bc86e1a53de548 + - Fix dereferencing unbound C arrays (BZ 505163). + +* Wed Jun 10 2009 Jan Kratochvil - 6.8.50.20090302-28 +- Archer update to the snapshot: 000db8b7bfef8581ef099ccca8689cfddfea1be8 +- Archer backport: b8d3bea36b137effc929e02c4dadf73716cb330b + - Ignore explicit die representing global scope '::' (gcc 4.1 bug). +- Archer backport: c2d5c4a39b10994d86d8f2f90dfed769e8f216f3 + - Fix parsing DW_AT_const_value using DW_FORM_string +- Archer backport: 8d9ab68fc0955c9de6320bec2821a21e3244600d + + db41e11ae0a3aec7120ad6ce86450d838af74dd6 + - Fix Fortran modules/namespaces parsing (but no change was visible in F11). +- Archer backport: 000db8b7bfef8581ef099ccca8689cfddfea1be8 + - Fix "some Python error when displaying some C++ objects" (BZ 504356). +- testsuite: Support new rpmbuild option: --with parallel +- testsuite: gdb-orphanripper.c: Fix uninitialized `termios.c_line'. +- Fix crashes due to (missing) varobj revalidation, for VLA (for BZ 377541). +- Archer backport: 58dcda94ac5d6398f47382505e9d3d9d866d79bf + + f3de7bbd655337fe6705aeaafcc970deff3dd5d5 + - Implement Fortran modules namespaces (BZ 466118). +- Fix crash in the charset support. + +* Thu Apr 30 2009 Jan Kratochvil - 6.8.50.20090302-27 +- Fix race in the ia64 testcase `gdb-6.3-rh-testlibunwind-20041202.patch'. + +* Mon Apr 27 2009 Jan Kratochvil - 6.8.50.20090302-26 +- Support a new rpmbuild option: --without python + +* Mon Apr 27 2009 Jan Kratochvil - 6.8.50.20090302-25 +- The Koji build failures may have been by forgotten check-in of the Patch360. + +* Mon Apr 27 2009 Jan Kratochvil - 6.8.50.20090302-24 +- Another new Koji build fix attempt now by: BuildPreReq: python + +* Mon Apr 27 2009 Jan Kratochvil - 6.8.50.20090302-23 +- Fix BuildRequires for new Koji. + +* Mon Apr 27 2009 Jan Kratochvil - 6.8.50.20090302-22 +- Fix pstack/gstack cutting very long lines (BZ 497849). + +* Sun Apr 19 2009 Jan Kratochvil - 6.8.50.20090302-21 +- New test for parsing elf64-i386 files for kdump PAE vmcore dumps (BZ 457187). + +* Thu Apr 16 2009 Jan Kratochvil - 6.8.50.20090302-20 +- Fix crash in the charset support. + +* Wed Apr 15 2009 Jan Kratochvil - 6.8.50.20090302-19 +- Fix crash on pretty-printer reading uninitialized std::string (BZ 495781). + +* Mon Apr 13 2009 Jan Kratochvil - 6.8.50.20090302-18 +- Archer update to the snapshot: d1fee5066408a09423621d1ebc64e6d3e248ed08 +- Archer backport: 4854339f75bdaf4b228fc35579bddbb2a1fecdc1 + - Fix Python FrameIterator. + +* Mon Apr 13 2009 Jan Kratochvil - 6.8.50.20090302-17 +- Archer update to the snapshot: 7c250ce99c90cf6097e2ec55ea0f205830979cee +- Archer backport: c14d9ab7eef43281b2052c885f89d2db96fb5f8e + - Revert a change regressing: gdb.objc/basicclass.exp +- Archer backport: ebd649b96e61a1fb481801b65d827bca998c6633 + + 1f080e897996d60ab7fde20423e2947512115667 + + 1948198702b51b31d79793fc49434b529b4e245f + + e107fb9687bb1e7f74170aa3d19c4a8f6edbb10f + + 1e012c996e121cb35053d239a46bd5dc65b0ce60 + - Update the Python API from upstream. +- Archer backport: d3c83ad5ec9f7672b87af9ad29279f459e53da11 + - Fix a Python branch crash. + +* Mon Apr 13 2009 Dennis Gilmore - 6.8.50.20090302-16 +- enable gdbserver package on sparc64 + +* Sun Apr 5 2009 Jan Kratochvil - 6.8.50.20090302-15 +- Archer update to the snapshot: 7c7c77576669d17ad5072daa47ea3a4fd954483d +- Archer backport: 7c7c77576669d17ad5072daa47ea3a4fd954483d (Peter Bergner) + - Disassemble Power7 instructions right in the default/only -Many GDB mode. + +* Sun Apr 5 2009 Jan Kratochvil - 6.8.50.20090302-14 +- Archer update to the snapshot: f6273d446ff87e50976600ba3f71b88d61043e20 +- Archer backport: f6273d446ff87e50976600ba3f71b88d61043e20 + - Use pretty-printers to print base classes inside a derived class. + +* Mon Mar 30 2009 Jan Kratochvil - 6.8.50.20090302-13 +- Archer update to the snapshot: d144a3633454046aaeae3e2c369c271834431d36 +- Archer backport: a2c49b7640ebe7ce1376902d48d5bbbee600996b + - Fixup compilation older GCCs. +- Archer backport: fe48224ce1bd22f37a7fa6d111d54c1a340392bf + - KFAIL 4 cases of: gdb.arch/powerpc-power7.exp +- Archer backport: d144a3633454046aaeae3e2c369c271834431d36 + - Fix C local extern variables (requires gcc-4.4.0-0.30). + +* Fri Mar 27 2009 Jan Kratochvil - 6.8.50.20090302-12 +- Archer update to the snapshot: 837d9879980148af05eae540d92caeb7200f1813 +- Archer backport: 8340d06295c8db80c544503458305197891e0348 + - Fixes [master] regression for Eclipse CDT testsuite. +- Archer backport: 16328456d5740917ade0a49bcecc14c4564b9a99 + - Fixes #2 [expr] compatibility with gcc-4.4 on gdb.cp/namespace-using.exp. +- Rebase [expr] on the Keith Seitz's sync with FSF GDB fixing the former merge. + +* Sun Mar 22 2009 Jan Kratochvil - 6.8.50.20090302-11 +- Archer update to the snapshot: e734ed95d296a3342d4147873c4641cea6c4d7fe +- Archer backport: 1e1d73cda98b1adda884b80e07c7b4929c175628 + - Fixes [expr] compatibility with gcc-4.4 on gdb.cp/namespace-using.exp. + +* Sun Mar 15 2009 Jan Kratochvil - 6.8.50.20090302-10 +- Archer update to the snapshot: 935f217d3367a642374bc56c6b146d376fc3edab +- Archer backport: 281278326412f9d6a3fabb8adc1d419fd7ddc7d7 + - Fix [expr] crash reading invalid DWARF C++ symbol "" (BZ 490319). + +* Thu Mar 12 2009 Jan Kratochvil - 6.8.50.20090302-9 +- Archer backport: aafe933b497eee8cfab736a10bae1a90d4bceb18 + - [python] Remove duplicate target-wide-charset parameter + +* Mon Mar 9 2009 Jan Kratochvil - 6.8.50.20090302-8 +- Archer update to the snapshot: a99e30d08ade4a2df0f943b036cd653bcd12b04d +- Fixes internal error on breaking at a multi-locations C++ caller (BZ 488572). + +* Mon Mar 9 2009 Jan Kratochvil - 6.8.50.20090302-7 +- Archer update to the snapshot: ec29855686f2a78d90ebcc63765681249bbbe808 +- Temporarily place libstdc++ pretty printers in this gdb.rpm. + +* Sat Mar 7 2009 Jan Kratochvil - 6.8.50.20090302-6 +- Archer update to the snapshot: 543fb2154d3bd551344b990b911be5c6cc703504 + - Fixes [delayed-symfile] excessive `(no debugging symbols found)' messages. + +* Sat Mar 7 2009 Jan Kratochvil - 6.8.50.20090302-5 +- Improve `gdb-6.6-buildid-locate-rpm.patch' by dlopen() (+pkg-config compat.). + +* Sat Mar 7 2009 Jan Kratochvil - 6.8.50.20090302-4 +- Split `gdb-6.6-buildid-locate.patch' to `gdb-6.6-buildid-locate-rpm.patch'. + +* Sat Mar 7 2009 Jan Kratochvil - 6.8.50.20090302-3 +- Archer update to the snapshot: 6cf16c0711e844094ab694b3d929f7bd30b49f61 +- Fix crash on the inlined functions support. +- Fix crash from the PIE support, its varobj_refresh() was called only before + varobj_invalidate() which is sufficient. +- Fix BuildRequires for the `--with testsuite' runs. +- Use the newly introduced `--with-pythondir' option. +- Remove libstdcxx [python] pretty printers (as included in libstdc++ rpm now). + +* Fri Mar 06 2009 Jesse Keating - 6.8.50.20090302-2 +- Rebuild for new rpm libs + +* Mon Mar 2 2009 Jan Kratochvil - 6.8.50.20090302-1 +- Include the Archer Project: http://sourceware.org/gdb/wiki/ProjectArcher + snapshot: 8cc3753a9aad85bf53bef54c04334c60d16cb251 + * [python] Python scripting support: http://sourceware.org/gdb/wiki/PythonGdb + * [catch-syscall] Trap and display syscalls. + * [delayed-symfile] Improve startup performance by lazily read psymtabs. + * [exception-rewind] Fix fatal C++ exceptions in an inferior function call. + * [expr] Expressions, single-quote elimination, C++ input canonicalization. + * [using-directive] C++ namespaces. + * [vla] C variable length arrays / DW_FORM_block / Fortran dynamic arrays. + * [misc] Fix debuginfoless `return' (BZ 365111), fix command-line macros for + expected GCC (BZ 479914), new testcase for valgrind (for BZ 483262), + implement `info common' for Fortran, fix Fortran logical-kind=8 (BZ 465310), + fix static variable in C++ constructors (BZ 445912), fix power7 (BZ 485319). +- Upgrade to the FSF GDB gdb-6.8.50 snapshot. +- Fix parsing elf64-i386 files for kdump PAE vmcore dumps (BZ 457187). + - Turn on 64-bit BFD support, globally enable AC_SYS_LARGEFILE. + +* Tue Feb 24 2009 Fedora Release Engineering - 6.8.50.20090210-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Wed Feb 11 2009 Jan Kratochvil - 6.8.50.20090210-1 +- Upgrade to the FSF GDB gdb-6.8.50 snapshot. + +* Wed Feb 11 2009 Jan Kratochvil - 6.8.50.20090209-1 +- Upgrade to the FSF GDB gdb-6.8.50 snapshot. + +* Mon Feb 9 2009 Jan Kratochvil - 6.8.50.20081214-2 +- Fix crash / implement `finish' into inlined functions (BZ 479781). +- Drop the gdb.threads/attach-into-signal.exp change as obsolete. + +* Sun Dec 14 2008 Jan Kratochvil - 6.8.50.20081214-1 +- Upgrade to the upstream gdb-6.8.50 snapshot. + +* Mon Dec 1 2008 Jan Kratochvil - 6.8-33 +- Make `--with testsuite' BuildRequires properly conditional. + +* Mon Dec 1 2008 Stepan Kasal - 6.8-32 +- Remove trivial BuildRequires, use rpm macros in a few remaining places. + +* Tue Nov 18 2008 Jan Kratochvil - 6.8-31 +- Enable ia64 hardware watchpoints if created before starting inferior. + +* Sun Nov 9 2008 Jan Kratochvil - 6.8-30 +- Fix a race in the testcase `gdb.threads/step-thread-exit.exp'. + +* Sun Nov 9 2008 Jan Kratochvil - 6.8-29 +- Fix more the variable-length-arrays support (BZ 468266, feature BZ 377541). +- Integrate the `bt full' protection (for BZ 466901) into the VLA patch. + +* Thu Nov 6 2008 Jan Kratochvil - 6.8-28 +- Fix the "never terminate `bt full'" patch false GCC warning / build error. + +* Thu Nov 6 2008 Jan Kratochvil - 6.8-27 +- Fix resolving of variables at locations lists in prelinked libs (BZ 466901), + bugreported by Michal Babej. +- Never terminate `bt full' on a problem of variable resolving (for BZ 466901). + +* Thu Nov 6 2008 Jan Kratochvil - 6.8-26 +- Fix more the variable-length-arrays support (BZ 468266, feature BZ 377541). +- Fix the watchpoints conditionals. +- Fix on PPC spurious SIGTRAPs on active watchpoints. +- Fix occasional stepping lockup on many threads, seen on ia64. + +* Mon Nov 3 2008 Jan Kratochvil - 6.8-25 +- Fix the variable-length-arrays support (BZ 468266, feature BZ 377541). +- Fix the debuginfo-install suggestions for missing base packages (BZ 467901), + also update the rpm/yum code to no longer require _RPM_4_4_COMPAT. + +* Tue Sep 2 2008 Jan Kratochvil - 6.8-24 +- Fix PIE patch regression for loading binaries from valgrind (BZ 460319). + +* Thu Aug 28 2008 Jan Kratochvil - 6.8-23 +- Fix attaching to stopped processes, based on the upstream version now. + - Just kernel-2.6.25 neither upstream nor utrace work with it; 2.6.9 works. +- Fix occasional crash on a removed watchpoint. +- Fix false testcase FAILs for `gdb.pie/break.exp'. +- Fix a false warning (+a testcase FAIL) on s390x watchpoints. +- Fix a false FAIL on s390x `gdb.base/dump.exp'. + +* Wed Aug 27 2008 Jan Kratochvil - 6.8-22 +- Remove `gdb-6.3-nonthreaded-wp-20050117.patch' as obsoleted + regressing now. +- Make the GDB quit processing non-abortable to cleanup everything properly. +- Support DW_TAG_constant for Fortran in recent Fedora/RH GCCs. +- Fix crash on DW_TAG_module for Fortran in recent Fedora/RH GCCs. +- Readd resolving of bare names of constructors and destructors. +- Include various vendor testcases: + - Leftover zombie process (BZ 243845). + - Multithreaded watchpoints (`gdb.threads/watchthreads2.exp'). + - PIE testcases (`gdb.pie/*'). + - C++ contructors/destructors (`gdb.cp/constructortest.exp'). + +* Sat Aug 23 2008 Jan Kratochvil - 6.8-21 +- Fix MI debuginfo print on reloaded exec, found by Denys Vlasenko (BZ 459414). +- Extend the Fortran dynamic variables patch also for dynamic Fortran strings. + +* Wed Aug 13 2008 Jan Kratochvil - 6.8-20 +- Temporarily disable attaching to a stopped process (BZ 453688) + - To be reintroduced after a fix of the kernel BZ 454404. + +* Mon Aug 4 2008 Jan Kratochvil - 6.8-19 +- Fix `errno' printing on nonthreaded non-g3 inferiors (TLS minsym is absolute). + +* Fri Aug 1 2008 Jan Kratochvil - 6.8-18 +- Fix powerpc recent secure PLTs handling (shared library calls) (BZ 452960). +- Fix the testsuite .spec runner to run biarch also on ppc. +- Reenable testcases threadcrash.exp, chng-syms.exp, checkpoint.exp (BZ 207002). +- Fix PRPSINFO in the core files dumped by gcore (BZ 254229), reformatted patch + from Denys Vlasenko. +- Fix register assignments with no GDB stack frames, Denys Vlasenko (BZ 436037). + +* Mon Jul 14 2008 Jan Kratochvil - 6.8-17 +- Refresh the patchset with fuzz 0 (for new rpmbuild). + +* Mon Jul 14 2008 Jan Kratochvil - 6.8-16 +- Rebuild with the new rpm-4.5.90 in the buildroot. + +* Sat Jul 12 2008 Jan Kratochvil - 6.8-15 +- Temporary rpm-4.5.90 compatibility workaround by Panu Matilainen. +- Fix a regression in the constant watchpoints fix, found by Daniel Jacobowitz. +- Fix the prelink testcase for false FAILs on i386. + +* Tue Jul 8 2008 Jan Kratochvil - 6.8-14 +- Fix crash due to calling an inferior function right after a watchpoint stop. + +* Thu Jul 3 2008 Jan Kratochvil - 6.8-13 +- Support transparent debugging of inlined functions for an optimized code. + +* Fri Jun 20 2008 Jan Kratochvil - 6.8-12 +- Remove the gdb/gdbtui binaries duplicity. + +* Tue Jun 17 2008 Jan Kratochvil - 6.8-11 +- Fix the testsuite run for ia64 (where no -m64 is present). +- Test a crash on libraries missing the .text section. +- Protect development in the build tree by automatic Makefile dependencies. +- Refuse creating watchpoints of an address value, suggested by Martin Stransky. +- Disable randomization (such as by setarch -R), suggested by Jakub Jelinek. +- Fix compatibility with recent glibc headers. + +* Sun Jun 1 2008 Jan Kratochvil - 6.8-10 +- Fix crash on a watchpoint update on an inferior stop. +- Fix the s390x part of the hardware watchpoints after a fork. + +* Thu May 22 2008 Jan Kratochvil - 6.8-9 +- Fix memory trashing on binaries from GNAT/Ada (workaround GCC PR 35998). + +* Thu May 15 2008 Tom "spot" Callaway - 6.8-8 +- Silence memcpy check which returns false positive (sparc64) + +* Thu May 15 2008 Tom "spot" Callaway - 6.8-7 +- patch from DaveM for sparc/sparc64 +- touch up spec to enable sparcv9/sparc64 + +* Sat May 3 2008 Jan Kratochvil - 6.8-6 +- Fix gdb.base/gcore-shmid0.exp to be unresolved on recent kernels. +- Make the testsuite results of dfp-test.exp more stable. + +* Sun Apr 27 2008 Jan Kratochvil - 6.8-5 +- Remove the kernel VDSO workaround (`no loadable ...') (kernel BZ 312011). + +* Wed Apr 23 2008 Jan Kratochvil - 6.8-4 +- Backport fix on various forms of threads tracking across exec() (BZ 442765). +- Testsuite: Include more biarch libraries on %%{multilib_64_archs}. +- Disable the build-id warnings for the testsuite run as they cause some FAILs. +- Fix PIE support for 32bit inferiors on 64bit debugger. +- Fix trashing memory on one ada/gnat testcase. +- Make the testsuite results on ada more stable. + +* Wed Apr 16 2008 Jan Kratochvil - 6.8-3 +- Fix ia64 compilation errors (Yi Zhan, BZ 442684). +- Fix build on non-standard rpm-devel includes (Robert Scheck, BZ 442449). +- Do not run the PIE mode for the testsuite during `--with upstream'. +- Fix test of the crash on a sw watchpoint condition getting out of the scope. + +* Fri Apr 11 2008 Jan Kratochvil - 6.8-2 +- Fix a regression due to PIE of reloading a changed exec file (BZ 433410). +- Include also biarch libgcc on %%{multilib_64_archs} for the testsuite. +- Cosmetic fix of a testcase sanity breakpoint setting (part of BZ 233852). +- New test of hiding unexpected breakpoints on intentional step commands. +- New test of GCORE for shmid 0 shared memory mappings. +- New test of a crash on `focus cmd', `focus prev' commands. +- Fix a minor test race of the hardware watchpoints after the fork call. +- Test crash on a sw watchpoint condition getting out of the scope. + +* Fri Mar 28 2008 Jan Kratochvil - 6.8-1 +- Upgrade to the latest upstream final release gdb-6.8. + +* Mon Mar 10 2008 Jan Kratochvil - 6.7.50.20080227-3 +- build-id warnings integrated more with rpm and the lists of the warnings got + replaced usually by a single-line `debuginfo-install' advice. + - FIXME: Testsuite needs an update for the new pre-prompt messages. +- Fix the `--with upstream' compilation - gstack/pstack are now omitted. + +* Tue Mar 4 2008 Jan Kratochvil - 6.7.50.20080227-2 +- Drop the unused `ChangeLog.RedHat' file stubs. +- New rpm option `--with upstream' to drop the Fedora patches for testing. +- Drop some no longer valid .spec file comments. +- Include the Fortran dynamic arrays entry for changelog of 6.7.50.20080227-1. + +* Mon Mar 3 2008 Jan Kratochvil - 6.7.50.20080227-1 +- Upgrade to the upstream gdb-6.8 prerelease. +- Cleanup the leftover `.orig' files during %%prep. +- Add expat-devel check by the configure script (for the other-arch builds). +- `--with testsuite' now also BuildRequires: fpc +- Backport fix of a segfault + PIE regression since 6.7.1 on PIE executables. +- Update the printed GDB version string to be Fedora specific. +- Fix/implement the Fortran dynamic arrays support (BZ 377541). + +* Sat Mar 1 2008 Jan Kratochvil - 6.7.1-16 +- Run the full testsuite also in the `-fPIE -pie' mode. + +* Mon Feb 25 2008 Jan Kratochvil - 6.7.1-15 +- New --with parameters `testsuite' and `debug'. + - Testsuite is now run during the build only on explicit `--with testsuite'. +- Testsuite now possibly produces two outputs for the two GDB target arches. + +* Thu Feb 21 2008 Jan Kratochvil - 6.7.1-14 +- Rename `set debug build-id' as `set build-id-verbose', former level 1 moved + to level 2, default value is now 1, use `set build-id-verbose 0' now to + disable the missing separate debug filenames messages (BZ 432164). + +* Wed Feb 20 2008 Jan Kratochvil - 6.7.1-13 +- ia64 build fixes from Doug Chapman (BZ 428882). +- gdbserver separated into an extra package (BZ 405791). +- pstack obsoleted by included gstack (BZ 197020). +- Fix #include on kernel-headers-2.6.25-0.40.rc1.git2.fc9.x86_64. +- Drop the PowerPC simulator as no longer being compatible with Fedora binaries. + +* Thu Feb 7 2008 Jan Kratochvil - 6.7.1-12 +- build-id debug messages print now the library names unconditionally. + +* Thu Jan 24 2008 Jan Kratochvil - 6.7.1-11 +- Improve the text UI messages for the build-id debug files locating. + - Require now the rpm libraries. +- Fix false `(no debugging symbols found)' on `-readnever' runs. +- Extend the testcase `gdb.arch/powerpc-prologue.exp' for ppc64. + +* Sat Jan 12 2008 Jan Kratochvil - 6.7.1-10 +- Compilation fixup (-9 was never released). + +* Sat Jan 12 2008 Jan Kratochvil - 6.7.1-9 +- Fix also threaded inferiors for hardware watchpoints after the fork call. +- Test debugging statically linked threaded inferiors (BZ 239652). + - It requires recent glibc to work in this case properly. +- Testcase cleanup fixup of the gcore memory and time requirements of 6.7.1-8. + +* Thu Jan 10 2008 Jan Kratochvil - 6.7.1-8 +- Fix detaching from a threaded formerly stopped process with non-primary + thread currently active (general BZ 233852). + - Enable back again the testcases named `attachstop.exp' (no such exist now). + - Rename the testcase `gdb.threads/attachstop' to `gdb.threads/attachstop-mt'. +- Test ia64 memory leaks of the code using libunwind. +- Testcase delay increase (for BZ 247354). +- Test gcore memory and time requirements for large inferiors. + +* Mon Jan 7 2008 Jan Kratochvil - 6.7.1-7 +- Backport the gcc-4.3 compatibility -Werror fixes. +- Fix documentation on hardware watchpoints wrt multiple threads. +- Rename the patch file for BZ 235197 from its former name 234468. +- Fix the vendora testcase `attach-32.exp' affecting the other tests results. +- Support DW_TAG_interface_type the same way as DW_TAG_class_type (BZ 426600). + +* Mon Dec 10 2007 Jan Kratochvil - 6.7.1-6 +- Testsuite fixes for more stable/comparable results. + +* Sat Nov 24 2007 Jan Kratochvil - 6.7.1-5 +- Reduce the excessive gcc-* packages dependencies outside of mock/koji. + +* Fri Nov 16 2007 Jan Kratochvil - 6.7.1-4 +- Fix `errno' resolving across separate debuginfo files. +- Fix segfault on no file loaded, `set debug solib 1', `info sharedlibrary'. +- Extend the testsuite run for all the languages if %%{dist} is defined. +- Support gdb.fortran/ tests by substituting the g77 compiler by gfortran. + +* Sun Nov 4 2007 Jan Kratochvil - 6.7.1-3 +- Fix `errno' resolving on recent glibc with broken DW_AT_MIPS_linkage_name. +- Imported new test for 6.7 PPC hiding of call-volatile parameter register. + +* Sat Nov 3 2007 Jan Kratochvil - 6.7.1-2 +- Backport `Breakpoints at multiple locations' patch primarily for C++. + +* Thu Nov 1 2007 Jan Kratochvil - 6.7.1-1 +- Upgrade to GDB 6.7.1. Drop redundant patches, forward-port remaining ones. + +* Thu Nov 1 2007 Jan Kratochvil - 6.7-1 +- Upgrade to GDB 6.7. Drop redundant patches, forward-port remaining ones. +- Fix rereading of the main executable on its change. + +* Fri Oct 19 2007 Jan Kratochvil - 6.6-37 +- Fix hiding unexpected breakpoints on intentional step/next commands. +- Fix s390 compilation warning/failure due to a wrongly sized type-cast. + +* Sun Oct 14 2007 Jan Kratochvil - 6.6-36 +- Fix hardware watchpoints after inferior forks-off some process. + +* Fri Oct 13 2007 Jan Kratochvil - 6.6-35 +- Fix non-threaded watchpoints CTRL-C regression on `set follow child'. + +* Fri Oct 12 2007 Jan Kratochvil - 6.6-34 +- Fix gdbserver for threaded applications and recent glibc (BZ 328021). + +* Tue Oct 9 2007 Jan Kratochvil - 6.6-33 +- Fix debug load for sparse assembler files (such as vDSO32 for i386-on-x86_64). + +* Mon Oct 8 2007 Jan Kratochvil - 6.6-32 +- Set the breakpoints always to all the ctors/dtors variants (BZ 301701). +- Fix a TUI visual corruption due to the build-id warnings (BZ 320061). +- Fixed the kernel i386-on-x86_64 VDSO loading (producing `Lowest section in'). + +* Fri Oct 5 2007 Jan Kratochvil - 6.6-31 +- Fix address changes of the ctors/dtors breakpoints w/multiple PCs (BZ 301701). +- Delete an info doc file on `rpmbuild -bp' later rebuilt during `rpmbuild -bc'. + +* Tue Sep 25 2007 Jan Kratochvil - 6.6-30 +- Fix re-setting of the ctors/dtors breakpoints with multiple PCs (BZ 301701). +- Avoid one useless user question in the core files locator (build-id). + +* Sun Sep 23 2007 Jan Kratochvil - 6.6-29 +- Fixed the kernel VDSO loading (`warning: no loadable sections found in ...'). +- Fix the testcase for pending signals (from BZ 233852). + +* Sat Sep 22 2007 Jan Kratochvil - 6.6-28 +- Support also the `$allocate' and `$delete' ctor/dtor variants (BZ 301701). +- Fix the build compatibility with texinfo >= 4.10. +- Fix the testcase for pending signals (from BZ 233852). + +* Sun Sep 16 2007 Jan Kratochvil - 6.6-27 +- Fix attaching to stopped processes and/or pending signals. + +* Tue Aug 28 2007 Jan Kratochvil - 6.6-26 +- New fast verification whether the .debug file matches its peer (build-id). +- New locating of the matching binaries from the pure core file (build-id). + +* Fri Aug 17 2007 Jan Kratochvil - 6.6-25 +- Fixed excessive RPATH (related to BZ 228891). + +* Wed Aug 8 2007 Jan Kratochvil - 6.6-24 +- Fixed compatibility with the Rawhide glibc open(2) syscall sanity checking. +- Update the core_dump_elf_headers=1 compatibility code to the upstream variant. + +* Mon Aug 6 2007 Jan Kratochvil - 6.6-23 +- Update PPC unwinding patches to their upstream variants (BZ 140532). + +* Wed Jul 25 2007 Jesse Keating - 6.6-22 +- Rebuild for RH #249435 + +* Mon Jul 23 2007 Jan Kratochvil - 6.6-21 +- Fixed compatibility with Rawhide kernel fs.binfmt_elf.core_dump_elf_headers=1. +- .spec file updates to mostly pass RPMLINT - Fedora merge review (BZ 225783). +- Fixed testcase of the exit of a thread group leader (of BZ 247354). +- Cleanup any leftover testsuite processes as it may stuck mock(1) builds. + +* Sun Jul 8 2007 Jan Kratochvil - 6.6-20 +- Do not hang on exit of a thread group leader (BZ 247354). +- New test for upstream fix of VDSO decoding while attaching to an i386 process. +- Fixed BZ # 232014 -> 232015. + +* Thu Jul 5 2007 Jan Kratochvil - 6.6-19 +- Link with libreadline provided by the operating system. + +* Tue Jun 26 2007 Jan Kratochvil - 6.6-18 +- Fix PPC software watchpoints active while stepping atomic instr. (BZ 237572). + +* Thu Jun 21 2007 Jan Kratochvil - 6.6-17 +- Support for stepping over PPC atomic instruction sequences (BZ 237572). +- `set scheduler-locking step' is no longer enforced but it is now default. + +* Wed Jun 20 2007 Jan Kratochvil - 6.6-16 +- Fix attaching a stopped process on expected + upstream kernels (BZ 233852). + - Fix attaching during a pending signal being delivered. + +* Thu Jun 7 2007 Jan Kratochvil - 6.6-15 +- Testcase update to cover PPC Power6/DFP instructions disassembly (BZ 230000). +- Disable some known timeouting/failing testcases to reduce the build time. +- Fix crash on missing filenames debug info (BZ 242155). + +* Sat Apr 28 2007 Jan Kratochvil - 6.6-14 +- Fixup for the PPC Power6/DFP instructions disassembly (BZ 230000). +- New testcase for the GCORE buffer overflow (for BZ 238285, formerly 235753). + +* Wed Apr 25 2007 Jan Kratochvil - 6.6-13 +- Fix `gcore' command for 32bit PPC inferiors on 64bit PPC hosts (BZ 232015). + +* Wed Apr 25 2007 Jan Kratochvil - 6.6-12 +- Enable PowerPC to print 128-bit long double variables (BZ 237872). +- New testcase for gcore of 32bit inferiors on 64bit hosts. + +* Tue Apr 24 2007 Jan Kratochvil - 6.6-11 +- Package review, analysed by Ralf Corsepius (BZ 225783). + - Fix prelink(8) testcase for non-root $PATH missing `/usr/sbin' (BZ 225783). + - Fix debugging GDB itself - the compiled in source files paths (BZ 225783). + - Fix harmless GCORE stack buffer overflow, by _FORTIFY_SOURCE=2 (BZ 238285). + - Fix XML support - the build was missing `expat-devel'. + - Updated the `info' files handling by the spec file. + - Building now with the standard Fedora code protections - _FORTIFY_SOURCE=2. + - Use multiple CPUs for the build (%%{?_smp_mflags}). + - Separate testsuite run to its %%check section. + - Fix (remove) non-ASCII spec file characters. + - Remove system tools versions dumping - already present in mock build logs. + +* Sun Apr 22 2007 Jan Kratochvil - 6.6-10 +- Notify user of a child forked process being detached (BZ 235197). + +* Sun Apr 22 2007 Jan Kratochvil - 6.6-9 +- Allow running `/usr/bin/gcore' with provided but inaccessible tty (BZ 229517). +- Fix testcase for watchpoints in threads (for BZ 237096). +- BuildRequires now `libunwind-devel' instead of the former `libunwind'. +- Use the runtime libunwind .so.7, it requires now >= 0.99-0.1.frysk20070405cvs. + +* Sat Mar 24 2007 Jan Kratochvil - 6.6-8 +- Use definition of an empty structure as it is not an opaque type (BZ 233716). +- Fixed the gdb.base/attachstop.exp testcase false 2 FAILs. + +* Thu Mar 15 2007 Jan Kratochvil - 6.6-7 +- Suggest SELinux permissions problem; no assertion failure anymore (BZ 232371). + +* Wed Mar 14 2007 Jan Kratochvil - 6.6-6 +- Fix occasional dwarf2_read_address: Corrupted DWARF expression (BZ 232353). + +* Mon Mar 12 2007 Jan Kratochvil - 6.6-5 +- Temporary support for shared libraries >2GB on 64bit hosts. (BZ 231832) + +* Sun Feb 25 2007 Jan Kratochvil - 6.6-4 +- Backport + testcase for PPC Power6/DFP instructions disassembly (BZ 230000). + +* Mon Feb 5 2007 Jan Kratochvil - 6.6-3 +- Fix a race during attaching to dying threads; backport (BZ 209445). +- Testcase of unwinding has now marked its unsolvable cases (for BZ 140532). + +* Fri Jan 26 2007 Jan Kratochvil - 6.6-2 +- Backported post gdb-6.6 release PPC `show endian' fixup. +- Fix displaying of numeric char arrays as strings (BZ 224128). +- Simplified patches by merging upstream accepted ones into a single file. + +* Sat Jan 20 2007 Jan Kratochvil - 6.6-1 +- Upgrade to GDB 6.6. Drop redundant patches, forward-port remaining ones. +- Backported post gdb-6.6 release ia64 unwinding fixups. +- Testcase for exec() from threaded program (BZ 202689). + +* Mon Jan 15 2007 Jan Kratochvil - 6.5-27 +- Fix the testsuite results broken in 6.5-26, stop invalid testsuite runs. + +* Fri Jan 13 2007 Jan Kratochvil - 6.5-26 +- Fix unwinding of non-debug (.eh_frame) PPC code, Andreas Schwab (BZ 140532). +- Fix unwinding of debug (.debug_frame) PPC code, workaround GCC (BZ 140532). +- Fix missing testsuite .log output of testcases using get_compiler_info(). + +* Fri Jan 12 2007 Jan Kratochvil - 6.5-25 +- Fix unwinding of non-CFI (w/o debuginfo) PPC code by recent GCC (BZ 140532). + +* Thu Jan 11 2007 Jan Kratochvil - 6.5-24 +- Backport readline history for input mode commands like `command' (BZ 215816). + +* Tue Jan 9 2007 Jan Kratochvil - 6.5-23 +- Find symbols properly at their original (included) file (BZ 109921). +- Remove the stuck mock(1) builds disfunctional workaround (-> mock BZ 221351). + +* Sat Dec 30 2006 Jan Kratochvil - 6.5-22 +- Fix unwinding crash on older gcj(1) code (extended CFI support) (BZ 165025). +- Include testcase for the readline history of input mode commands (BZ 215816). + +* Sat Dec 23 2006 Jan Kratochvil - 6.5-21 +- Try to reduce sideeffects of skipping ppc .so libs trampolines (BZ 218379). +- Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379). + +* Tue Dec 19 2006 Jan Kratochvil - 6.5-20 +- Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711). +- Testcase for readline segfault on excessively long hand-typed lines. + +* Tue Dec 12 2006 Jan Kratochvil - 6.5-19 +- Fix attachment also to a threaded stopped process (BZ 219118). +- Cleanup any leftover testsuite processes as it may stuck mock(1) builds. + +* Sat Nov 25 2006 Jan Kratochvil - 6.5-18 +- Fix readline history for input mode commands like `command' (BZ 215816). + +* Wed Nov 16 2006 Jan Kratochvil - 6.5-17 +- Bugfix testcase typo of gdb-6.5-16. + +* Wed Nov 16 2006 Jan Kratochvil - 6.5-16 +- Provide testcase for accessing the last address space byte. + +* Wed Nov 9 2006 Jan Kratochvil - 6.5-15 +- Fix readline segfault on excessively long hand-typed lines. + +* Sat Nov 2 2006 Jan Kratochvil - 6.5-14 +- Fix "??" resolving of symbols from (non-prelinked) debuginfo packages. +- Fix "??" resolving of symbols from overlapping functions (nanosleep(3)). +- Also disable testcase "checkpoint.exp" for a possible kernel Bug 207002. +- Provided (disabled during build) threading testsuite from BEA. + +* Sat Oct 14 2006 Jan Kratochvil - 6.5-13 +- Fix deadlock accessing last address space byte; for corrupted backtraces. + +* Sun Oct 8 2006 Jan Kratochvil - 6.5-12 +- Disabled IPv6 until its user visible syntax gets stable upstream. + +* Sun Oct 1 2006 Jan Kratochvil - 6.5-11 +- No longer disassemble invalid i386 opcodes of movQ/movA (BZ 172034). +- Simplify the IPv6 patch for gdbserver (BZ 198365). +- Suggest fixing your target architecture for gdbserver(1) (BZ 190810). +- Fix dereferencing registers for 32bit inferiors on 64bit hosts (BZ 181390). +- Fix `gcore' command for 32bit inferiors on 64bit hosts. + +* Wed Sep 27 2006 Jan Kratochvil - 6.5-10 +- Support IPv6 for gdbserver (BZ 198365). +- Temporarily disable testcase "chng-syms.exp" for a possible kernel Bug 207002. + +* Wed Sep 21 2006 Jan Kratochvil - 6.5-9 +- Fix crash on C++ symbol failing to be demangled (BZ 206813). +- Fix attach to stopped process, supersede `gdb-6.3-attach-stop-20051011.patch'. +- Fix TLS symbols resolving for objects with separate .debug file (-debuginfo). +- Fix TLS symbols resolving for shared libraries with a relative pathname. +- Support TLS symbols (+`errno' suggestion if no pthread is found) (BZ 185337). + +* Mon Sep 11 2006 Jan Kratochvil - 6.5-8 +- Fix gdb printf command argument using "%%p" (BZ 205551). + +* Mon Sep 4 2006 Alexandre Oliva - 6.5-7 +- Fix bug in patch for CVE-2006-4146. (BZ 203873, BZ 203880) + +* Thu Aug 24 2006 Alexandre Oliva - 6.5-6 +- Avoid overflows and underflows in dwarf expression computation stack. +(BZ 203873) + +* Thu Aug 24 2006 Alexandre Oliva - 6.5-5 +- Backport support for i386 nop memory instructions. +- Fix debuginfo addresses resolving for --emit-relocs Linux kernels +(BZ 203661, from Jan Kratochvil, like the remaining changes). +- Bugfix segv on the source display by ^X 1 (fixes Patch130, BZ +200048). +- Do not step into the PPC solib trampolines (BZ 200533). +- Fix exec() from threaded program, partial CVS backport (BZ 182116). +- Fix occasional failure to load shared libraries (BZ 146810). +- Bugfix object names completion (fixes Patch116, BZ 193763). +- Avoid crash of 'info threads' if stale threads exist (BZ 195429). +- Handle corrupted or missing location list information (BZ 196439). + +* Thu Jul 13 2006 Alexandre Oliva - 6.5-3 +- Add missing definition of multilib_64_archs for glibc-devel buildreqs. +- Backport support for .gnu.hash sections. + +* Wed Jul 12 2006 Alexandre Oliva - 6.5-2 +- BuildReq sharutils, prelink and, on multilib systems, 32-bit glibc-devel. +- Drop obsolete attach-stop patch. +- Fix testcases in threaded-watchpoints2 and step-thread-exit patches. +- Re-enable attach-pie.exp, asm-source.exp and sigstep.exp tests. + +* Tue Jul 11 2006 Alexandre Oliva - 6.5-1 +- Upgrade to GDB 6.5. Drop redundant patches, forward-port remaining +ones. Re-enable ada and objc testsuites. + +* Thu Jun 15 2006 Alexandre Oliva - 6.3.0.0-1.132 +- Require flex and bison at build time. +- Additional patch for BZ 175083, to cope with waitpid setting status +even when returning zero. + +* Wed May 31 2006 Alexandre Oliva - 6.3.0.0-1.131 +- Require gettext at build time. (BZ193366) + +* Sat May 27 2006 Alexandre Oliva - 6.3.0.0-1.130 +- Rewrite patch for BZ 175270, BZ 175083 so as to catch the exception +earlier. +- Remove too-fragile testcases from patches for CFA value and "S" +augmentation. + +* Wed May 17 2006 Alexandre Oliva - 6.3.0.0-1.129 +- Add not-automatically-generated file to fopen64 patch (BZ 191948). + +* Fri Apr 14 2006 Alexandre Oliva - 6.3.0.0-1.128 +- Avoid race conditions caused by exceptions messing with signal masks. +(BZ 175270, BZ 175083, maybe BZ 172938). +- Hardcode /bin and /usr/bin paths into gstack (BZ 179829, BZ 190548). +- Build in a subdir of the source tree instead of in a sibling directory. +- Switch to versioning scheme that uses the same base revision number +for all OSes, and uses a suffix to tell the builds apart and ensure +upgradability. + +* Thu Apr 13 2006 Stepan Kasal - 6.3.0.0-1.127 +- Bump up release number. + +* Thu Apr 13 2006 Stepan Kasal - 6.3.0.0-1.123 +- Use fopen64 where available. Fixes BZ 178796, BZ 190547. +- Use bigger numbers than int. Fixes BZ 171783, BZ 179096. + +* Wed Mar 8 2006 Alexandre Oliva - 6.3.0.0-1.122 +- Bump up release number. + +* Wed Mar 8 2006 Alexandre Oliva - 6.3.0.0-1.119 +- Fix regression in PIE debugging (BZ 133944) (re?)introduced by the +prelink fix (BZ 175075, BZ 190545). Improve testcase for the prelink +fix. +- Revert dwarf2 frame identifier change. + +* Tue Mar 7 2006 Alexandre Oliva - 6.3.0.0-1.118 +- Bump up release number. + +* Tue Mar 7 2006 Alexandre Oliva - 6.3.0.0-1.115 +- Change dwarf2 frame identifiers to use the actual PC instead of the +function's entry point. +- Fix FSF and GDB contact addresses in new testcases. +- Do not try to compile x86_64-only CFA testcase on 32-bit x86. +- Change prelink test to issue untested instead of warning message if +system libraries are not prelinked. + +* Fri Mar 3 2006 Alexandre Oliva - 6.3.0.0-1.114 +- Bump up release number. + +* Fri Mar 3 2006 Alexandre Oliva - 6.3.0.0-1.111 +- Add support for "S" augmentation for signal stack frames. +- Add support for CFA value expressions and encodings. +- Various improvements to the prelink test. + +* Thu Feb 23 2006 Alexandre Oliva - 6.3.0.0-1.110 +- Bump up release number. + +* Thu Feb 23 2006 Alexandre Oliva - 6.3.0.0-1.107 +- Enable gdb to debug core files and executables with mismatched +prelink base addresses. Fixes BZ 175075, BZ 190545. + +* Tue Feb 14 2006 Alexandre Oliva - 6.3.0.0-1.106 +- Bump up release number. + +* Tue Feb 14 2006 Alexandre Oliva - 6.3.0.0-1.103 +- Adjust type-punning patch to include fix not needed upstream. + +* Tue Feb 14 2006 Alexandre Oliva - 6.3.0.0-1.102 +- Bump up release number. + +* Tue Feb 14 2006 Alexandre Oliva - 6.3.0.0-1.99 +- Use type-punning warning fixes as accepted upstream. + +* Fri Feb 10 2006 Jesse Keating - 6.3.0.0-1.98.2 +- bump again for double-long bug on ppc(64) + +* Tue Feb 07 2006 Jesse Keating - 6.3.0.0-1.98.1 +- rebuilt for new gcc4.1 snapshot and glibc changes + +* Mon Jan 16 2006 Alexandre Oliva - 6.3.0.0-1.98 +- Bump up release number. + +* Mon Dec 19 2005 Alexandre Oliva - 6.3.0.0-1.94 +- Fix type-punning warnings issued by GCC 4.1. + +* Fri Dec 16 2005 Jesse Keating +- rebuilt for new gcj + +* Thu Dec 01 2005 Jeff Johnston - 6.3.0.0-1.93 +- Bump up release number. + +* Thu Dec 01 2005 Jeff Johnston - 6.3.0.0-1.90 +- Add option to allow backtracing past zero pc value. +- Bugzilla 170275 + +* Tue Nov 15 2005 Jeff Johnston - 6.3.0.0-1.89 +- Bump up release number. + +* Tue Nov 15 2005 Jeff Johnston - 6.3.0.0-1.86 +- Fix ia64 user-specified SIGILL handling error. +- Bugzilla 165038. + +* Tue Oct 18 2005 Jeff Johnston - 6.3.0.0-1.85 +- Bump up release number. + +* Tue Oct 18 2005 Jeff Johnston - 6.3.0.0-1.82 +- Modify attach patch to add missing fclose. +- Bugzilla 166712 + +* Tue Oct 11 2005 Jeff Johnston - 6.3.0.0-1.81 +- Bump up release number. + +* Tue Oct 11 2005 Jeff Johnston - 6.3.0.0-1.78 +- Support gdb attaching to a stopped process. + +* Thu Sep 29 2005 Jeff Johnston - 6.3.0.0-1.77 +- Bump up release number. + +* Thu Sep 29 2005 Jeff Johnston - 6.3.0.0-1.74 +- Fix up DSO read logic when process is attached. + +* Mon Sep 26 2005 Jeff Johnston - 6.3.0.0-1.73 +- Bump up release number. + +* Mon Sep 26 2005 Jeff Johnston - 6.3.0.0-1.70 +- Fix frame pointer calculation for ia64 sigtramp frame. + +* Thu Sep 22 2005 Jeff Johnston - 6.3.0.0-1.69 +- Bump up release number. + +* Thu Sep 22 2005 Jeff Johnston - 6.3.0.0-1.66 +- Remove extraneous xfree. + +* Wed Sep 07 2005 Jeff Johnston - 6.3.0.0-1.65 +- Bump up release number. + +* Wed Sep 07 2005 Jeff Johnston - 6.3.0.0-1.62 +- Readd readnever option + +* Wed Jul 27 2005 Jeff Johnston - 6.3.0.0-1.61 +- Bump up release number. + +* Tue Jul 26 2005 Jeff Johnston - 6.3.0.0-1.57 +- Bump up release number. + +* Tue Jul 26 2005 Jeff Johnston - 6.3.0.0-1.54 +- Add testcase to verify printing of inherited members +- Bugzilla 146835 + +* Mon Jul 25 2005 Jeff Johnston - 6.3.0.0-1.53 +- Bump up release number. + +* Mon Jul 25 2005 Jeff Johnston - 6.3.0.0-1.50 +- Fix bug with info frame and cursor address on ia64. +- Add testcase to verify pseudo-registers calculated for ia64 sigtramp. +- Bugzilla 160339 + +* Fri Jul 22 2005 Jeff Johnston - 6.3.0.0-1.49 +- Bump up release number. + +* Fri Jul 22 2005 Jeff Johnston - 6.3.0.0-1.46 +- Fix attaching to 32-bit processes on 64-bit systems. +- Bugzilla 160254 + +* Thu Jul 14 2005 Jeff Johnston - 6.3.0.0-1.45 +- Bump up release number. + +* Thu Jul 14 2005 Jeff Johnston - 6.3.0.0-1.42 +- Add work-around to make ia64 gcore work faster. +- Bugzilla 147436 + +* Thu Jul 14 2005 Jeff Johnston - 6.3.0.0-1.41 +- Bump up release number. + +* Mon Jul 11 2005 Jeff Johnston - 6.3.0.0-1.38 +- Fix backtracing across sigaltstack for ia64 +- Bugzilla 151741 + +* Fri Jul 08 2005 Jeff Johnston - 6.3.0.0-1.37 +- Bump up release number. + +* Fri Jul 08 2005 Jeff Johnston - 6.3.0.0-1.35 +- Build pseudo-registers properly for sigtramp frame. +- Bugzilla 160339 + +* Fri Jul 08 2005 Jeff Johnston - 6.3.0.0-1.34 +- Bump up release number. + +* Thu Jul 07 2005 Jeff Johnston - 6.3.0.0-1.31 +- Modify security errata to include additional bfd robustness updates +- Bugzilla 158680 + +* Fri Jun 10 2005 Jeff Johnston - 6.3.0.0-1.30 +- Bump up release number. + +* Fri Jun 10 2005 Jeff Johnston - 6.3.0.0-1.28 +- Security errata for bfd and .gdbinit file usage +- Bugzilla 158680 + +* Wed May 18 2005 Jeff Johnston - 6.3.0.0-1.24 +- Bump up release number. + +* Wed May 18 2005 Jeff Johnston - 6.3.0.0-1.23 +- Bump up release number. + +* Wed May 18 2005 Jeff Johnston - 6.3.0.0-1.22 +- Specify SA_RESTART for linux-nat.c handlers and use my_waitpid + which handles EINTR. + +* Tue May 03 2005 Jeff Johnston - 6.3.0.0-1.21 +- Bump up release number. + +* Tue May 03 2005 Jeff Johnston - 6.3.0.0-1.20 +- Bump up release number. + +* Tue May 03 2005 Jeff Johnston - 6.3.0.0-1.19 +- Fix for partial die in cache error +- Bugzilla 137904 + +* Wed Apr 27 2005 Jeff Johnston - 6.3.0.0-1.18 +- Bump up release number. + +* Wed Apr 27 2005 Jeff Johnston - 6.3.0.0-1.17 +- Bump up release number. + +* Wed Apr 27 2005 Jeff Johnston - 6.3.0.0-1.16 +- Update ia64 sigtramp support to use libunwind and fix top-level + rse register reads to also use libunwind. +- Bugzilla 151741 + +* Thu Apr 21 2005 Jeff Johnston - 6.3.0.0-1.15 +- Bump up release number. + +* Thu Apr 21 2005 Jeff Johnston - 6.3.0.0-1.14 +- Bump up release number. + +* Thu Apr 21 2005 Jeff Johnston - 6.3.0.0-1.13 +- Do not issue warning message for gcore under ia64 +- Bugzilla 146416 + +* Mon Apr 11 2005 Andrew Cagney - 6.3.0.0-1.12 +- Update gstack patch, handle systems that lack /proc//tasks. + +* Fri Apr 8 2005 Andrew Cagney - 6.3.0.0-1.11 +- Replace patch warning about DW_OP_piece with a patch that implements + the DW_OP_piece read path. + +* Sat Apr 2 2005 Andrew Cagney - 6.3.0.0-1.10 +- Print a warning when the separate debug info's CRC doen't match; + test. + +* Wed Mar 30 2005 Jeff Johnston - 6.3.0.0-1.9 +- Bump up release number. + +* Wed Mar 30 2005 Jeff Johnston - 6.3.0.0-1.7 +- Add proper vsyscall page support for ia64. + +* Thu Mar 24 2005 Jeff Johnston - 6.3.0.0-1.6 +- Bump up release number. + +* Thu Mar 24 2005 Jeff Johnston - 6.3.0.0-1.4 +- Fix printing of inherited members of C++ classes. +- Fix for Bugzilla 146835. + +* Tue Mar 22 2005 Jeff Johnston - 6.3.0.0-1.3 +- Bump up release number. + +* Thu Mar 17 2005 Jeff Johnston - 6.3.0.0-1.1 +- Remove warnings that cause errors when compiled with gcc4 and -Werror. + +* Wed Mar 16 2005 Elliot Lee +- rebuilt + +* Fri Mar 04 2005 Jeff Johnston - 6.3.0.0-0.37 +- Bump up release number. + +* Thu Mar 03 2005 Jeff Johnston - 6.3.0.0-0.35 +- Add follow-fork fix from mainline sources. + +* Thu Mar 03 2005 Jeff Johnston - 6.3.0.0-0.34 +- Bump up release number. + +* Mon Feb 28 2005 Jeff Johnston - 6.3.0.0-0.32 +- Modify debug register handling for x86, x86-64 to be thread-specific. +- Modify threaded watchpoint code for x86, x86-64 to properly insert + and remove watchpoints on all threads. + +* Tue Feb 22 2005 Andrew Cagney - 6.3.0.0-0.31 +- Bump version number. + +* Tue Feb 22 2005 Andrew Cagney - 6.3.0.0-0.30 +- Bump version number. + +* Tue Feb 22 2005 Andrew Cagney - 6.3.0.0-0.29 +- Modify gdb-6.3-dwattype0-20050201.patch to check for a zero address + and not zero unsnd. Fix BE 32- vs 64-bit problem. + +* Mon Feb 21 2005 Andrew Cagney - 6.3.0.0-0.28 +- Back port patch adding symfile-mem.o to all GNU/Linux builds. + Fix BZ 146087. + +* Wed Feb 16 2005 Jeff Johnston - 6.3.0.0-0.27 +- Bump up release number. + +* Wed Feb 16 2005 Jeff Johnston - 6.3.0.0-0.26 +- Fix unload.exp testcase. + +* Mon Feb 14 2005 Jeff Johnston - 6.3.0.0-0.25 +- Bump up release number. + +* Mon Feb 14 2005 Jeff Johnston - 6.3.0.0-0.24 +- Fix gdb to always grab the terminal before a readline call. +- Bugzilla 147880 + +* Fri Feb 11 2005 Jeff Johnston - 6.3.0.0-0.23 +- Bump up release number. + +* Fri Feb 11 2005 Jeff Johnston - 6.3.0.0-0.21 +- Fix gdb to handle stepping over the end of an exiting thread. +- Bugzilla 146848 + +* Thu Feb 10 2005 Jeff Johnston - 6.3.0.0-0.20 +- Bump up release number. + +* Tue Feb 08 2005 Jeff Johnston - 6.3.0.0-0.18 +- Modify previous gcore patch to not use linux_proc_xfer_memory even + for main thread. + +* Mon Feb 07 2005 Jeff Johnston - 6.3.0.0-0.17 +- Modify previous gcore patch to only apply to ia64. + +* Fri Feb 04 2005 Jeff Johnston - 6.3.0.0-0.16 +- Fix gcore to work properly for threaded applications +- Bugzilla 145309, 145092 + +* Fri Feb 04 2005 Jeff Johnston - 6.3.0.0-0.15 +- Tolerate DW_AT_type referencing <0> and instead of generating an + error, treat as unknown type. +- Bugzilla 144852. + +* Thu Feb 3 2005 Andrew Cagney - 6.3.0.0-0.14 +- Separate out test patches. + +* Thu Jan 27 2005 Jeff Johnston - 6.3.0.0-0.13 +- Fix to allow ia64 gdb to backtrace from syscalls in a corefile. +- Bugzilla 145092. + +* Wed Jan 26 2005 Jeff Johnston - 6.3.0.0-0.12 +- Fix to support examining files even when the executable moves +- Bugzilla 142122 + +* Wed Jan 26 2005 Andrew Cagney - 6.3.0.0-0.11 +- gdb-6.3-ppcdotsyms-20050126.patch: Backport BFD changes for reading + synthetic symbols. Rewrite code reading elf minimal symbols so that + it includes synthetics. + +* Fri Jan 21 2005 Jeff Johnston - 6.3.0.0-0.10 +- Fix to prevent resetting unwind kernel table size to invalid value + when debugging a core file +- Bugzilla 145309 + +* Fri Jan 21 2005 Andrew Cagney - 6.3.0.0-0.9 +- When single stepping handle both back-to-back and nested signals. +- Disable .symbol patch, results in BFD errors. + +* Fri Jan 21 2005 Jeff Johnston - 6.3.0.0-0.8 +- Support listing both in-charge and not-in-charge dtors when + just the dtor name is given. +- Add new test case for newly added ctor/dtor functionality. + +* Thu Jan 20 2005 Jeff Johnston - 6.3.0.0-0.7 +- Fix to allow breaking by line in both the in-charge and + not-in-charge ctor/dtor. +- Bugzilla 117826 + +* Thu Jan 20 2005 Andrew Cagney - 6.3.0.0-0.6 +- Rebuild. + +* Thu Jan 20 2005 Andrew Cagney - 6.3.0.0-0.5 +- Use bfd_get_synthetic_symtab to read in any synthetic symbols + such as 64-bit PPC's ".symbol"s. + +* Tue Jan 18 2005 Jeff Johnston - 6.3.0.0-0.4 +- Modify non-threaded watchpoint patch to use new observer. + +* Mon Jan 17 2005 Jeff Johnston - 6.3.0.0-0.3 +- Fix for non-threaded watchpoints. + +* Mon Jan 17 2005 Andrew Cagney - 6.3.0.0-0.2 +- Enable PPC CFI, remove merged ppc patches. + +* Wed Jan 12 2005 Elena Zannoni - 6.3.0.0-0.1 + Andrew Cagney + Jeff Johnston +- Various fixes to complete the import and merge. + +* Wed Dec 01 2004 Andrew Cagney - 6.3.0.0 +- Import GDB 6.3, get building, add all patches. + +* Tue Nov 30 2004 Jeff Johnston - 1.200400607.63 +- When removing breakpoints, continue removing breakpoints even if an + error occurs on the list. + +* Sun Nov 28 2004 Andrew Cagney - 1.200400607.62 +- Bump version for RHEL4 build. + +* Wed Nov 24 2004 Andrew Cagney - 1.200400607.61 +- For PPC-64, fix search for a symbol (wasn't specifying the section). + +* Wed Nov 24 2004 Andrew Cagney - 1.200400607.60 +- For PPC-64, do not set malloc name to ".malloc"; no longer needed. +- For all, only define kfail when not already defined. + +* Wed Nov 24 2004 Andrew Cagney - 1.200400607.59 +- Bump version. + +* Wed Nov 24 2004 Andrew Cagney - 1.200400607.58 +- Add rs6000 reggroups; fixes problem of PS register being trashed + causing mysterious branch breakpoints. + +* Tue Nov 23 2004 Andrew Cagney - 1.200400607.57 +- Backport i386 prolog parser - better backtraces out of semop(). +- Add option --readnever to suppress the reading of symbolic debug + information. +- Add script gstack.sh, installed as gstack. + Bugzilla 136584, 137121 +- Add missing files gdb.pie/attach2.c, gdb.pie/break1.c and + gdb.pie/Makefile.in along with testsuite/configure stuff for pie. + +* Tue Nov 23 2004 Andrew Cagney - 1.200400607.57 +- Backport i386 prolog parser - better backtraces out of semop(). +- Add option --readnever to suppress the reading of symbolic debug + information. +- Add script gstack.sh, installed as gstack. + Bugzilla 136584, 137121 + +* Mon Nov 22 2004 Jeff Johnston - 1.200400607.56 +- Bump up release number. + +* Mon Nov 22 2004 Jeff Johnston - 1.200400607.55 +- Multiple ia64 backtrace fixes. Bugzilla 125157 + +* Thu Nov 11 2004 Elena Zannoni - 1.200400607.54 +- Bump up release number + +* Thu Nov 11 2004 Elena Zannoni - 1.200400607.51 +- Modify configure line to not use absolute paths. This was + creating problems with makeinfo/texinfo. +- Get rid of makeinfo hack. +Bugzilla 135633 + +* Tue Nov 09 2004 Jeff Johnston - 1.200400607.50 +- Bump up release number + +* Tue Nov 09 2004 Jeff Johnston - 1.200400607.49 +- Bump up release number + +* Tue Nov 09 2004 Jeff Johnston - 1.200400607.48 +- Expose $base, $allocate constructors and $delete, $base destructors + for breakpoints. + +* Tue Nov 09 2004 Andrew Cagney - 1.200400607.47 +- Enable PPC CFI. + +* Mon Nov 08 2004 Jeff Johnston - 1.200400607.46 +- Bump up release number + +* Mon Nov 08 2004 Jeff Johnston - 1.200400607.45 +- Bump up release number + +* Fri Nov 05 2004 Jeff Johnston - 1.200400607.44 +- Allow macros to continue past a backtrace error + +* Tue Oct 26 2004 Andrew Cagney - 1.200400607.43 +- Hack around broken PT_FPSCR defined in headers. +- Import latest s390 fixes. +- Disable sigstep.exp - s390 has problems. +- Use PC's symtab when looking for a symbol. +- Work around DW_OP_piece. + +* Fri Oct 22 2004 Andrew Cagney - 1.200400607.42 +- For 64-bit PPC, convert _dl_debug_state descriptor into a code address. +- Fix --ignore option. + +* Mon Oct 10 2004 Andrew Cagney - 1.200400607.40 +- Disable attach-pie.exp test, hangs on amd64 without auxv. +- Move pie tests to pie. + +* Mon Oct 10 2004 Andrew Cagney - 1.200400607.39 +- Fix comment bug in sigstep.exp. + +* Thu Oct 07 2004 Jeff Johnston - 1.200400607.38 +- Do not invalidate cached thread info when resuming threads. +- Bump up release number. + +* Fri Oct 01 2004 Jeff Johnston - 1.200400607.35 +- Fix S/390 watchpoint support to work better under threading. + +* Fri Oct 01 2004 Jeff Johnston - 1.200400607.34 +- Fix thread_db_get_lwp to handle 2nd format ptids. + +* Mon Sep 27 2004 Andrew Cagney - 1.200400607.33 +- Don't unwind past a zero PC (when normal frames). + +* Mon Sep 27 2004 Jeff Johnston - 1.200400607.32 +- Add threaded watchpoint support for x86, x86-64, and ia64. + +* Mon Sep 27 2004 Andrew Cagney - 1.200400607.31 +- Instead of deleting bigcore.exp, use runtest --ignore. + +* Thu Sep 23 2004 Andrew Cagney - 1.200400607.30 +- Merge in mainline testsuite up to 2004-09-23, pick up sig*.exp tests. + Merge in mainline infrun.c, pick up all infrun.c fixes. + Generate bigcore's corefile from the running inferior. + Limit bigcore's corefile to max file-size. + +* Thu Sep 02 2004 Jeff Johnston - 1.200400607.29 +- Fix low-level lin-lwp code to wait specifically for any stepping + LWP (bugzilla 130896) + +* Tue Aug 31 2004 Jeff Johnston - 1.200400607.28 +- Add test case for bugzilla 128618 fix. + +* Mon Aug 30 2004 Jeff Johnston - 1.200400607.27 +- Add support for breakpoints in manually loaded/unloaded shared libs. + (bugzilla 128618) + +* Mon Aug 30 2004 Jeff Johnston - 1.200400607.26 +- Add java inferior call support. + +* Mon Aug 30 2004 Andrew Cagney - 1.200400607.25 +- Convert "main" the function descriptor, into an address. + +* Mon Aug 30 2004 Andrew Cagney - 1.200400607.24 +- Fix single-stepping when a signal is pending, was exiting program. + -- needs kernel fix so that ptrace(PT_STEP,SIG) doesn't do a PT_CONT. + -- sigstep.exp tests pass with this fix applied. + +* Mon Aug 30 2004 Elena Zannoni - 1.200400607.23 +- Delete some part of gdb-6.1post-test-rh.patch, to avoid confusing + gdb when testing itself, and loading separate debug info. + +* Fri Aug 13 2004 Jeff Johnston - 1.200400607.22 +- Check in gdb mainline fix for applications calling clone directly. + +* Tue Aug 10 2004 Jeff Johnston - 1.200400607.21 +- Alter libunwind frame code to allow using libunwind 0.97 and up. + +* Tue Aug 03 2004 Jeff Johnston - 1.200400607.20 +- Fix the ia64 libunwind test to match current output. + +* Fri Jul 30 2004 Elena Zannoni - 1.200400607.19 +- Fix the tests where gdb debugs itself, as to not copy + the executable to xgdb. + +* Mon Jul 26 2004 Elena Zannoni - 1.200400607.18 +- Add Pie patches back in. + +* Fri Jul 16 2004 Andrew Cagney - 1.200400607.17 +- Fix stepping over a no-debug shared-library function. +- Fix patch vsyscall patch name. + +* Thu Jul 8 2004 Jeff Johnston - 1.200400607.16 +- Update thread code with fix from gdb HEAD + +* Wed Jul 7 2004 Andrew Cagney - 1.200400607.15 +- disable vsyscall +- import Bob's crasher fix +- disable bigcore.exp + +* Mon Jul 5 2004 Andrew Cagney - 1.200400607.14 +- Make large corefiles work on systems that require O_LARGEFILE. + +* Tue Jun 29 2004 Elena Zannoni - 1.200400607.13 +- Fix BuildRequires for libunwind on ia64. + +* Mon Jun 28 2004 Andrew Cagney - 1.200400607.12 +- Import wild frame ID patch. Stops GDB incorrectly matching invalid + frame IDs. +- Disable bigcore on ia64 and amd64. + +* Fri Jun 25 2004 Andrew Cagney - 1.200400607.11 +- Fix testsuite to kill attach process (from corrinna/mainline). +- Fix build problems with vsyscall patch. + +* Fri Jun 25 2004 Andrew Cagney - 1.200400607.10 +- Fix annotate test messages. +- Recognize VSYSCALL pages. + +* Thu Jun 24 2004 Jeff Johnston - 1.200400607.9 +- Fix ia64 watchpoint support. + +* Wed Jun 23 2004 Andrew Cagney - 1.200400607.8 +- Do not xfail signals on i387, convert KFAIL to FAIL and not XFAIL. + +* Wed Jun 23 2004 Andrew Cagney - 1.200400607.7 +- Fix to ppc64 unwinder - handle glibcs function within syscall + function hack. +- Update sigbpt.exp, ena-dis-br.exp observer.exp signull.exp, + step-test.exp and sizeof.exp, so that test names are architecture + clean. +- Disable bigcore.exp on PowerPC 64. + +* Tue Jun 22 2004 Andrew Cagney - 1.200400607.6 +- Merge in mainline testsuite changes up to 2004-06-21. +- Re-implement 32 and 64-bit PPC signal trampolines. +- Check i386 and amd64 signal trampolines before dwarf2. +- Allow tramp-frame when there is a symbol. +- Test interaction between single-step, breakpoint and signal. +- ABI: Fix PPC64 function parameters, sizeof long-double, and enum + return values. + +* Mon Jun 21 2004 Elena Zannoni - 1.200400607.5 +- Fix sed line for gz info files. + +* Mon Jun 21 2004 Andrew Cagney - 1.200400607.4 +- Tar/uuencode both the .sum and .log test results. + +* Tue Jun 15 2004 Elena Zannoni - 0.200400607.3 +- Remove installation of mmalloc, and its info files. +- Add hack to deal with differring info files generated by makeinfo. +- Restore release number convention. + +* Tue Jun 15 2004 Elliot Lee +- rebuilt + +* Thu Jun 10 2004 Elena Zannoni - 0.200400607.2 +- Fix Requires and BuildRequires for libunwind dependencies. +- Add patch to silence gcc3.4 warnings. + +* Wed Jun 09 2004 Elena Zannoni - 0.200400607.1 +- New import: revamp everything. Remove all patches for now. +- Update the Requires and BuildRequires sections. +- Removed stupid Ada testcases (there is no ada support in gdb yet). + +* Mon May 10 2004 Elena Zannoni - 0.20040223.20 +- Disable PIE again. +- obsolete gdb64 only if on ppc64. + +* Mon May 03 2004 Jeff Johnston - 0.20040223.19 +- Add -u parameter to build ChangeLog patch. + +* Mon May 03 2004 Jeff Johnston - 0.20040223.18 +- Update thread fix made for .6 release to FSF version. + +* Thu Apr 22 2004 Elena Zannoni - 0.20040223.17 +- Disable PIE again. + +* Thu Apr 22 2004 Jeff Johnston - 0.20040223.16 +- Bump version number. + +* Wed Apr 21 2004 Jeff Johnston - 0.20040223.15 +- fix ia64 info frame command +- also fix ia64 tdep file for which elf header file to include + +* Tue Mar 30 2004 Elena Zannoni - 0.20040223.14 +- re-enable pie. + +* Tue Mar 30 2004 Elena Zannoni - 0.20040223.13 +- Fix testsuite glitches. + +* Thu Mar 24 2004 Elena Zannoni - 0.20040223.12 +- Fix typo. + +* Thu Mar 24 2004 Elena Zannoni - 0.20040223.11 +- Make gdb compile w/o warnings with gcc-3.4. +- Reenable PIE support code. + +* Wed Mar 23 2004 Elena Zannoni - 0.20040223.10 +- Bump version number + +* Wed Mar 23 2004 Elena Zannoni - 0.20040223.9 +- temporarily disable PIE support. +- Add section to obsolete gdb64 package. + +* Sun Mar 21 2004 Elena Zannoni - 0.20040223.8 +- Add support for debugging of PIE executables. + +* Tue Mar 09 2004 Elena Zannoni - 0.20040223.7 +- Bump version number. + +* Mon Mar 08 2004 Jeff Johnston - 0.20040223.6 +- Fix thread support to recognize new threads even when they reuse + tids of expired threads. Also ensure that terminal is held by gdb + while determining if a thread-create event has occurred. + +* Mon Mar 08 2004 Andrew Cagney - 0.20040223.5 +- Sync with 6.1 branch; eliminate all amd64 patches; + add more robust 32x64 PPC64 patches. + +* Tue Mar 02 2004 Elliot Lee +- rebuilt + +* Tue Mar 2 2004 Andrew Cagney - 0.20040223.4 +- 32x64 fixes that work with threads, replaced old + non-thread 32x64 patch, add nat patch. + +* Wed Feb 25 2004 Elena Zannoni - 0.20040223.3 +- Add patch for x86_64 in 32 bit mode. + +* Wed Feb 25 2004 Elena Zannoni - 0.20040223.2 +- Remove ppc64 hacks. +- Refresh some patches. + +* Wed Feb 25 2004 Elena Zannoni - 0.20040223.1 +- Import new gdb snapshot from mainline FSF. +- Update patch list. + +* Tue Feb 17 2004 Jeff Johnston - 1.20031117.8 +- Switch ia64-tdep.c to use new abi used by libunwind-0.95 and up. +- Fix gate area specification for ia64-linux-tdep.c. +- Fix long double support for ia64. + +* Fri Feb 13 2004 Elliot Lee +- rebuilt + +* Thu Jan 08 2004 Elena Zannoni - 0.20031117.7 +- Add fixes for ppc32 support on ppc64 platform, from Andrew Cagney. + +* Tue Jan 06 2004 Elena Zannoni - 0.20031117.6 +- Add patch to have unique binary names in the testsuite. +- Disable s390/s390x pthread.exp test (FIXME) +- Don't install any info files for the ppc platform. Let's take them + from the ppc64 one (or we get install conflicts). +- Remove generated info files from the source tree. They are generated + as part of the FSF snapshot process. + +* Mon Nov 24 2003 Elena Zannoni - 0.20031117.5 +- Add patches from old rpm for i386 support on x86_64. +- Add build dependency on libunwind for ia64. + +* Fri Nov 21 2003 Jeremy Katz - 0.20031117.4 +- more rpm tricks to get the gdb64 package happier + +* Thu Nov 20 2003 Elena Zannoni - 0.20031117.3 +- Add sick and twisted workaround for ppc64 architecture. + +* Wed Nov 19 2003 Elena Zannoni - 0.20031117.2 +- Fix typo in libunwind test. + +* Tue Nov 18 2003 Elena Zannoni - 0.20031117.1 +- Import new gdb snapshot from mainline FSF. +- Fix some testfiles. +- Add fixes for gcore, and patch for libunwind support on ia64. +- Add tests to see what versions of gcc, binutils, glibc and kernel we + are running with. + +* Wed Oct 15 2003 Elena Zannoni - 0.20030710.41 +- Bump up version number. + +* Wed Sep 24 2003 Elena Zannoni - 0.20030710.40 +- Fix problem with gcore and single threaded programs. (bugzilla 103531) + +* Mon Sep 22 2003 Jeff Johnston - 0.20030710.39 +- Fix call to quit_target from quit_force. + +* Sun Sep 21 2003 Andrew Cagney - 0.20030710.38 +- Fix PPC64 push dummy call. +- Re-fix PPC64 return value (had wrong / old patch). + +* Sat Sep 20 2003 Andrew Cagney - 0.20030710.37 +- Fix PPC32 return values. + +* Sat Sep 20 2003 Andrew Cagney - 0.20030710.36 +- Rewrite ppc64 retun value methods so that they (hopefully) +match the SysV spec. +- Enable ppc64 testsuite. + +* Thu Sep 18 2003 Andrew Cagney - 0.20030710.35 +- Hack around problem "break main" vs "break .main" when there is +only a minimal ppc64 symbol table. The former is a function descriptor +and not where you want the breakpoint to go. Only convert descriptors +to pointers when the address is in the ".opd" section. + +* Wed Sep 17 2003 Andrew Cagney - 0.20030710.34 +- Fix ppc32 push_dummy_call. + +* Tue Sep 16 2003 Andrew Cagney - 0.20030710.33 +- Pack gdb.sum and gdb.log using uuencode and bzip. + +* Tue Sep 16 2003 Jeff Johnston - 0.20030710.32 +- Catch errors when quitting so exit of gdb still occurs. + +* Mon Sep 15 2003 Andrew Cagney - 0.20030710.31 +- Fix ppc32 use_struct_convention. + +* Thu Sep 11 2003 Andrew Cagney - 0.20030710.30 +- Mods to dwarf2-frame.c to work around a lack of GCC/CFI info. + +* Thu Sep 11 2003 Elena Zannoni - 0.20030710.29 +- Bump up version number. + +* Wed Sep 10 2003 Elena Zannoni - 0.20030710.28 +- Fix a core dump with MI. +- Add new ChangeLog patch for mi changes. + +* Thu Sep 04 2003 Elena Zannoni - 0.20030710.27 +- Change the name of the package to gdb64 in ppc64 case. + +* Tue Aug 26 2003 Elena Zannoni - 0.20030710.26 +- Add testcase for separate debug info. + +* Tue Aug 26 2003 Andrew Cagney - 0.20030710.25 +- fix i386 on x86-64 TLS +- add "base-aug2003" suffix to older x86i386 patch + +* Tue Aug 26 2003 Andrew Cagney - 0.20030710.24 +- skip the ppc64 and x86-64 frame redzone. + +* Fri Aug 22 2003 Elena Zannoni - 0.20030710.23 +- Relax one testcase in selftest.exp a bit. +- Accept different output as well in thread bt (platform dependent). +- Enable testsuite run for ia64, ppc, s390 and s390x. They are in + reasonably good shape. + +* Thu Aug 21 2003 Jeff Johnston - 0.20030710.22 +- Multiple ia64 fixes. +- Fix ia64 printing of function pointers. +- Fix ia64 prologue examination to ignore predicated insns if we + haven't found the return address yet. +- Skip dump.exp testcase for ia64 + +* Thu Aug 21 2003 Elena Zannoni - 0.20030710.21 +- Bump release number. + +* Wed Aug 20 2003 Elena Zannoni - 0.20030710.20 +- Relax pattern in annota2.exp test. + +* Wed Aug 20 2003 Elena Zannoni - 0.20030710.19 +- rename gdb binary to gdb64 for ppc64 platform. + +* Tue Aug 19 2003 Jeff Johnston - 0.20030710.18 +- Fix ia64 pc unwinding to include psr slot. + +* Mon Aug 18 2003 Elena Zannoni - 0.20030710.17 +- Fix info installation for annotate.texi. (Bugzilla 102521) + +* Fri Aug 15 2003 Elena Zannoni - 0.20030710.16 +- revamp tls tests a bit. +- Handle new output from gdb in relocate.exp + +* Wed Aug 13 2003 Elena Zannoni - 0.20030710.15 +- Fix problem for processing of separate debug info files. + +* Wed Aug 13 2003 Jeff Johnston - 0.20030710.14 +- add ia64.inc file for testing ia64 in gdb.asm testsuite + +* Fri Aug 8 2003 Andrew Cagney - 0.20030710.13 +- print the libthread_db library path, print when threads are enabled + +* Thu Aug 7 2003 Andrew Cagney - 0.20030710.12 +- "cat" the test log into the build log + +* Wed Aug 06 2003 Jeff Johnston - 0.20030710.11 +- modernize ia64 gdb to use new frame model +- remove/replace deprecated interfaces used by ia64 gdb + +* Wed Aug 06 2003 Andrew Cagney - 0.20030710.10 +- Sync to gdb-5.3.90-sync-20030806.patch. + +* Wed Jul 29 2003 Andrew Cagney - 0.20030710.9 +- add x86-64 i386 fixes + +* Tue Jul 29 2003 Elena Zannoni - 0.20030710.8 +- Fix some tests by xfailing the correct target triplet for RedHat. +- Remove include of config.h from pthreads.c testcases. + +* Mon Jul 28 2003 Elena Zannoni - 0.20030710.7 +- Fix some test failures, by escaping correctly. + +* Thu Jul 24 2003 Elena Zannoni - 0.20030710.6 +- Remove one testcase that is redundant. + +* Wed Jul 23 2003 Elena Zannoni - 0.20030710.5 +- Bump up release number. + +* Wed Jul 23 2003 Elena Zannoni - 0.20030710.4 +- Bring in sync with current head of gdb-6 branch. +- Remove linespec patch, because included in the new sync patch. + +* Fri Jul 18 2003 Elena Zannoni - 0.20030710.3 +- Add patch to avoid gdb segfault with bad debug info. +- Change location of build tree to avoid conflicts with older versions + possibly installed. + +* Thu Jul 17 2003 Elena Zannoni - 0.20030710.2 +- Add patch to synchronize the current snapshot with the gdb-6 branch head. +- Remove some patches that are includd in such diff. +- Enable tests on AMD64 as well. + +* Fri Jul 11 2003 Elena Zannoni - 0.20030710.1 +- Import new gdb snapshot. +- Revamp gdb.spec. Get rid of patches that apply to older versions. +- Add patches for ppc64 support, kfail and make gdb more robust in copingi + with bad debug info. + +* Wed Jul 02 2003 Jeff Johnston - 1.20021129.39 +- Fix bug with ia64 checking of hardware breakpoints. + +* Mon Jun 30 2003 Elena Zannoni - 1.20021129.38 +- Add necessary function for NPTL support on x86-64. + +* Wed Jun 04 2003 Elliot Lee +- rebuilt + +* Wed Jun 04 2003 Elena Zannoni - 0.20021129.37 +* Tue Jun 03 2003 Elena Zannoni - 0.20021129.36 +- Enable warnings for x86_64, not x86-64. +- Fix warnings from infptrace.c and dwarfread.c. +- Print error message only when reading separate debug info really + doesn't work (jimb@redhat.com). + +* Fri May 23 2003 Elena Zannoni - 0.20021129.35 +- Fixes for fetching and storing access registers on s390x (jimb@redhat.com). + Bugzilla 91455. + +* Wed May 21 2003 Jeff Johnston - 0.20021129.34 +- Do not generate error on detach failure. Bugzilla 90900. + +* Thu May 8 2003 Elena Zannoni - 0.20021129.33 +- New tests for asm on s390x (jimb@redhat.com). Bugzilla 90503. +- Fixes for prologue analysis on s390x (jimb@redhat.com). Bugzilla 90506. +- bfd fix for 64-bit platforms (jimb@redhat.com). +- Disable ppc64 builds until we have a port. + +* Thu May 1 2003 Jeff Johnston - 0.20021129.32 +- Add ia64 support to the float.exp testcase. + +* Thu May 1 2003 Elena Zannoni - 0.20021129.31 +- Clean up the tls tests some more. +- Fix problem with non US-eng locale. Bugzilla bug 88823. + +* Wed Apr 30 2003 Jeff Johnston - 0.20021129.30 +- Fix ia64 prologue skipping. +- Fix ia64 line table. +- Fix setting of prev_pc in infrun.c. + +* Mon Mar 31 2003 Elena Zannoni - 0.20021129.29 +- Include the gcore script, as gdb_gcore.sh and install it in + /usr/bin as gcore. +- One more disassembly fix for core files. Added to + gdb-5.3post-disasm-mar2003.patch. Bugzilla 87677. +- Enable build warnings for x86-64. + +* Mon Mar 31 2003 Elena Zannoni - 0.20021129.28 +- Fix Java strings printing. +- Fix memory corruption in disassembly code. Bugzilla 85644. +- Testsuite fixes (jimb@redhat.com). Bugzilla 85457. +- Fixes for s390 stack handling (jimb@redhat.com). Bugzilla 85039. +- Fixes for s390 struct return (jimb@redhat.com). + +* Wed Mar 26 2003 Elena Zannoni - 0.20021129.27 +- Fixes for disassembly of code in threaded applications. Bugzilla 87495. +- Fixes for s390 prologue analysis. (jimb@redhat.com). + Bugzilla bugs 85251, 85214. + +* Thu Mar 20 2003 Elena Zannoni - 0.20021129.26 +- Fix inferior function calls with void return on x86-64. Bugzilla bug 83197. +- Fix for upstream PR/699. +- Fix some problems with gdb-5.3post-thrtst-feb2003.patch. + +* Wed Mar 19 2003 Jeff Johnston - 0.20021129.25 +- Fix for thread-db.c: check_event() - Bugzilla bug 86231. + +* Fri Mar 14 2003 Elena Zannoni - 0.20021129.24 +- Fix some problems with inferior function calls on x86-64. + +* Fri Mar 07 2003 Elena Zannoni - 0.20021129.23 +- testsuite patches. Bugzilla 85215 85028 85335. + +* Thu Mar 06 2003 Elena Zannoni - 0.20021129.22 +- Fix testsuite problems related to having '+' in the directory name. + Bugzilla 85031. + +* Mon Mar 03 2003 Elena Zannoni - 0.20021129.21 +- Fix a few inferior function call problems. + +* Mon Mar 03 2003 Elena Zannoni - 0.20021129.20 +- Split the changelog patches in two. Cleanup messy patch section. + +* Thu Feb 27 2003 Jeff Johnston - 0.20021129.19 +- Perform run-time check for tkill syscall in lin-lwp.c. + +* Mon Feb 24 2003 Elena Zannoni - 0.20021129.18 +- Update copyright year printed in version. + +* Mon Feb 24 2003 Elena Zannoni - 0.20021129.17 +- Refresh build. + +* Mon Feb 24 2003 Elena Zannoni - 0.20021129.16 +- Add some testsuite cleanups, to avoid spurious test failures. + +* Fri Feb 21 2003 Jeff Johnston - 0.20021129.15 +- Add patch to handle thread exiting when LD_ASSUME_KERNEL=2.4.1 which + fixes Bugzilla bug 84217. + +* Fri Feb 21 2003 Elena Zannoni - 0.20021129.14 +- New patch to fix disassembly on s390. Bugzilla bug 84286. +- New patch for attach/ptrace fix. Bugzilla bug 84220. +- Reenable tests for x86. + +* Thu Feb 20 2003 Jeff Johnston - 0.20021129.13 +- Add patch for mixed stabs with dwarf2 - bugzilla bug 84253. + +* Wed Feb 12 2003 Elena Zannoni - 0.20021129.12 +- Disable tests also for x86. + +* Tue Feb 11 2003 Elena Zannoni - 0.20021129.11 +- Add patch for mi threads tests. +- Add patch for dwarf2 debug_ranges section. +- Add patch for detach bug. + +* Mon Feb 10 2003 Elena Zannoni - 0.20021129.10 +- Add patch for testsuite auto answering internal error queries. +- Add new TLS tests. +- Add cleanup patches for thread tests. + +* Mon Feb 03 2003 Elena Zannoni - 0.20021129.9 +- Add new patch for thread support. Apply on all arches. +- Do not apply old patches, but leave them around for now. +- Add new patch for dwarf2 debug info reading. +- Add new patch for dwarf2 cfi engine cleanup. +- Add new patch for uiout problems. +- Add new patch for s390 build. +- Disable tests on all platforms but x86. + +* Mon Jan 27 2003 Elena Zannoni - 0.20021129.8 +- Move all the changelog entries to a single patch. +- Add tests to the args patch. +- Add new patch for until command fix (bugzilla Bug 19890). +- s390 and s390x can be built with -Werror. +- Run make check for s390 and s390x too. +- Include an updated version of the thread nptl patch (still WIP). + +* Wed Jan 15 2003 Phil Knirsch - 0.20021129.7 +- Apply the 2nd misc patch for s390 and s390x, too. + +* Tue Jan 14 2003 Elena Zannoni - 0.20021129.6 +- Add patches for NPTL support, to be applied on i386 only. + (this is still WIP) +- Split old misc patch in two parts. +- Temporarily disable testsuite run on alpha. + +* Sun Jan 12 2003 Elena Zannoni - 0.20021129.5 +- Add patch for --args with zero-length arguments. Fix for bug 79833. + +* Tue Dec 17 2002 Elliot Lee - 0.20021129.4 +- The define directive to rpm is significant even if the line it is + in happens to start with a '#' character. Fixed. + +* Fri Dec 13 2002 Elena Zannoni - 0.20021129.3 +- Merge previous patches for warnings into a single one. +- Add changelogs to patches. +- Add, but don't use, a macro to avoid stripping. + +* Fri Dec 6 2002 Elena Zannoni +- Add patch to allow debugging of executables with debug info stored + in separate files. +- Add patch for Makefile dependencies and disable warnings for + building thread-db.c. +- Re-enable building with -Werror for alpha, ia64, ppc. + +* Mon Dec 2 2002 Elena Zannoni +- Don't pass to gdb an empty build warnings flag, or that will disable warnings + completely. We want to build using gdb's standard warnings instead. + +* Mon Dec 2 2002 Elena Zannoni +- Don't do testing for x86_64. + +* Sun Dec 1 2002 Elena Zannoni +- x86_64 doesn't build with Werror yet. +- Add patch for alpha. +- Alpha doesn't build with -Werror either. +- Add patch for ia64. +- Add patch for ppc. +- Drop ia64 from -Werror list. +- Drop ppc from -Werror list. + +* Sun Dec 1 2002 Elena Zannoni +- Add dejagnu to the build requirements. +- Enable make check. +- Add enable-gdb-build-warnings to the configure flags. + +* Fri Nov 29 2002 Elena Zannoni +- Import new upstream sources. +- Change version and release strings. +- Upgrade patches. +- Build gdb/gdbserver as well. +- Define and use 'cvsdate'. +- Do %%setup specifying the source directory name. +- Don't cd up one dir before removing tcl and friends. +- Change the configure command to allow for the new source tree name. +- Ditto for the copy of NEWS. +- Add some comments. + +* Mon Nov 25 2002 Elena Zannoni 5.2.1-5 +General revamp. +- Add patch for gdb/doc/Makefile.in. Part of fix for bug 77615. +- Add patch for mmalloc/Makefile.in. Part of fix for bug 77615. +- Change string printed in version.in to -rh. +- Move the deletion of dejagnu, expect, tcl to the prep section, + from the build section. +- Add build directory housekeeping to build section. +- Use macros for configure parameters. +- Do the build in a separate directory. +- Prepare for testing, but not enable it yet. +- Correctly copy the NEWS file to the top level directory, for the doc + section to find it. +- Cd to build directory before doing install. +- Use makeinstall macro, w/o options. +- Remove workaround for broken gdb info files. Part of fix for bug 77615. +- Remove share/locale directory, it is in binutils. +- Remove info/dir file. +- Clarify meaning of post-install section. +- Add gdbint info files to post-install, pre-uninstall and files sections. + Part of fix for bugs 77615, 76423. +- Add libmmalloc.a to package. + +* Fri Aug 23 2002 Florian La Roche +- added mainframe patch from developerworks + +* Wed Aug 21 2002 Trond Eivind Glomsrod 5.2.1-3 +- Add changelogs to the previous patch + +* Wed Aug 14 2002 Trond Eivind Glomsrod 5.2.1-2 +- Add some patches from Elena Zannoni + +* Tue Jul 23 2002 Trond Eivind Glomsrod 5.2.1-1 +- 5.2.1 + +* Mon Jul 22 2002 Florian La Roche +- compile on mainframe + +* Mon Jul 8 2002 Trond Eivind Glomsrod 5.2-3 +- Rebuild + +* Tue May 7 2002 Trond Eivind Glomsrod 5.2-2 +- Rebuild + +* Mon Apr 29 2002 Trond Eivind Glomsrod 5.2-1 +- 5.2 + +* Mon Apr 29 2002 Trond Eivind Glomsrod 5.1.92-1 +- 5.1.92. Hopefully identical to 5.2 final + +* Mon Apr 22 2002 Trond Eivind Glomsrod 5.1.91-1 +- 5.1.91. 5.2 expected in a week + +* Thu Mar 28 2002 Trond Eivind Glomsrod 5.1.90CVS-5 +- Update to current + +* Thu Mar 28 2002 Trond Eivind Glomsrod 5.1.90CVS-4 +- Update to current + +* Thu Mar 28 2002 Trond Eivind Glomsrod 5.1.90CVS-3 +- Update to current + +* Wed Mar 20 2002 Trond Eivind Glomsrod 5.1.90CVS-2 +- Update to current + +* Wed Mar 13 2002 Trond Eivind Glomsrod 5.1.90CVS-1 +- Update to current 5.2 branch + +* Thu Jan 24 2002 Trond Eivind Glomsrod 5.1.1-1 +- 5.1.1 +- add URL + +* Wed Jan 09 2002 Tim Powers +- automated rebuild + +* Mon Dec 10 2001 Trond Eivind Glomsrod 5.1-2 +- Fix some thread+fpu problems + +* Mon Nov 26 2001 Trond Eivind Glomsrod 5.1-1 +- 5.1 + +* Mon Nov 19 2001 Trond Eivind Glomsrod 5.0.94-0.71 +- 5.0.94. Almost there.... + +* Mon Nov 12 2001 Trond Eivind Glomsrod 5.0.93-2 +- Add patch from jakub@redhat.com to improve handling of DWARF + +* Mon Nov 12 2001 Trond Eivind Glomsrod 5.0.93-1 +- 5.0.93 +- handle missing info pages in post/pre scripts + +* Wed Oct 31 2001 Trond Eivind Glomsrod 5.0.92-1 +- 5.0.92 + +* Fri Oct 26 2001 Trond Eivind Glomsrod 5.0.91rh-1 +- New snapshot +- Use the 5.0.91 versioning from the snapshot + +* Wed Oct 17 2001 Trond Eivind Glomsrod 5.0rh-17 +- New snapshot + +* Thu Sep 27 2001 Trond Eivind Glomsrod +- New snapshot + +* Wed Sep 12 2001 Trond Eivind Glomsrod 5.0rh-16 +- New snapshot + +* Mon Aug 13 2001 Trond Eivind Glomsrod 5.0rh-15 +- Don't buildrequire compat-glibc (#51690) + +* Thu Aug 9 2001 Trond Eivind Glomsrod +- New snapshot, from the stable branch eventually leading to gdb 5.1 + +* Mon Jul 30 2001 Trond Eivind Glomsrod +- s/Copyright/License/ +- Add texinfo to BuildRequires + +* Mon Jun 25 2001 Trond Eivind Glomsrod +- New snapshot + +* Fri Jun 15 2001 Trond Eivind Glomsrod +- New snapshot +- Add ncurses-devel to buildprereq +- Remove perl from buildprereq, as gdb changed the way + version strings are generated + +* Thu Jun 14 2001 Trond Eivind Glomsrod +- New snapshot + +* Wed May 16 2001 Trond Eivind Glomsrod +- New snapshot - this had thread fixes for curing #39070 +- New way of specifying version + +* Tue May 1 2001 Trond Eivind Glomsrod +- New tarball +- Kevin's patch is now part of gdb + +* Mon Apr 9 2001 Trond Eivind Glomsrod +- Add patch from kevinb@redhat.com to fix floating point + thread + problem (#24310) +- remove old workarounds +- new snapshot + +* Thu Apr 5 2001 Trond Eivind Glomsrod +- New snapshot + +* Sat Mar 17 2001 Bill Nottingham +- on ia64, there are no old headers :) + +* Fri Mar 16 2001 Trond Eivind Glomsrod +- build with old headers, new compiler + +* Wed Mar 16 2001 Trond Eivind Glomsrod +- new snapshot + +* Mon Feb 26 2001 Trond Eivind Glomsrod +- new snapshot which should fix some more IA64 problems (#29151) +- remove IA64 patch, it's now integrated + +* Wed Feb 21 2001 Trond Eivind Glomsrod +- add IA64 and Alpha patches from Kevin Buettner +- use perl instead of patch for fixing the version string + +* Tue Feb 20 2001 Trond Eivind Glomsrod +- don't use kgcc anymore +- mark it as our own version +- new snapshot + +* Mon Jan 22 2001 Bernhard Rosenkraenzer +- Link with ncurses 5.x even though we're using kgcc. + No need to drag in requirements on ncurses4 (Bug #24445) + +* Fri Jan 19 2001 Trond Eivind Glomsrod +- new snapshot + +* Thu Dec 20 2000 Trond Eivind Glomsrod +- new snapshot + +* Mon Dec 04 2000 Trond Eivind Glomsrod +- new snapshot +- new alpha patch - it now compiles everywhere. Finally. + +* Fri Dec 01 2000 Trond Eivind Glomsrod +- new snapshot + +* Mon Nov 20 2000 Trond Eivind Glomsrod +- new CVS snapshot +- disable the patches +- don't use %%configure, as it confuses the autoconf script +- enable SPARC, disable Alpha + + +* Wed Aug 09 2000 Trond Eivind Glomsrod +- added patch from GDB team for C++ symbol handling + +* Mon Jul 25 2000 Trond Eivind Glomsrod +- upgrade to CVS snapshot +- excludearch SPARC, build on IA61 + +* Wed Jul 19 2000 Trond Eivind Glomsrod +- rebuild + +* Thu Jul 13 2000 Prospector +- automatic rebuild + +* Sun Jul 02 2000 Trond Eivind Glomsrod +- rebuild + +* Fri Jun 08 2000 Trond Eivind Glomsrod +- use %%configure, %%makeinstall, %%{_infodir}, %%{_mandir}, + and %%{_tmppath} +- the install scripts for info are broken(they don't care about + you specify in the installstep), work around that. +- don't build for IA64 + +* Mon May 22 2000 Trond Eivind Glomsrod +- upgraded to 5.0 - dump all patches. Reapply later if needed. +- added the NEWS file to the %%doc files +- don't delete files which doesn't get installed (readline, texinfo) +- let build system handle stripping and gzipping +- don't delete libmmalloc +- apply patch from jakub@redhat.com to make it build on SPARC + +* Fri Apr 28 2000 Matt Wilson +- rebuilt against new ncurses + +* Tue Mar 7 2000 Jeff Johnson +- rebuild for sparc baud rates > 38400. + +* Tue Feb 8 2000 Jakub Jelinek +- fix core file handling on i386 with glibc 2.1.3 headers + +* Fri Jan 14 2000 Jakub Jelinek +- fix reading registers from core on sparc. +- hack around build problems on i386 with glibc 2.1.3 headers + +* Thu Oct 7 1999 Jim Kingdon +- List files to install in /usr/info specifically (so we don't pick up +things like info.info from GDB snapshots). + +* Thu Oct 7 1999 Jim Kingdon +- Update GDB to 19991004 snapshot. This eliminates the need for the +sigtramp, sparc, xref, and threads patches. Update sparcmin patch. + +* Mon Aug 23 1999 Jim Kingdon +- Omit readline manpage. + +* Tue Aug 7 1999 Jim Kingdon +- Remove H.J. Lu's patches (they had been commented out). +- Add sigtramp patch (from gdb.cygnus.com) and threads patch (adapted +from code fusion CD-ROM). + +* Wed Apr 14 1999 Jeff Johnson +- merge H.J. Lu's patches into 4.18. + +* Mon Apr 05 1999 Cristian Gafton +- updated the kern22 patch with stuff from davem + +* Thu Apr 1 1999 Jeff Johnson +- sparc with 2.2 kernels no longer uses sunos ptrace (davem) + +* Sun Mar 21 1999 Cristian Gafton +- auto rebuild in the new build environment (release 3) + +* Mon Mar 8 1999 Jeff Johnson +- Sparc fiddles for Red Hat 6.0. diff --git a/gdbinit b/gdbinit new file mode 100644 index 0000000..119b387 --- /dev/null +++ b/gdbinit @@ -0,0 +1,4 @@ +# System-wide GDB initialization file. + +# FIXME: provide a wildcard. +source %{_sysconfdir}/gdbinit.d/gdb-heap.py