--- gdb-6.4.orig/debian/control.in +++ gdb-6.4/debian/control.in @@ -0,0 +1,19 @@ +Source: gdb +Maintainer: Daniel Jacobowitz +Section: devel +Priority: standard +Standards-Version: 3.5.3 +Build-Depends: autoconf, libtool, texinfo (>= 4.7-2.2), tetex-bin, libncurses5-dev, libreadline4-dev (>= 4.2a-1), bison, gettext, debhelper (>= 4.9.0), dejagnu, gcj [!mips !mipsel !hurd-i386], gobjc, mig [@gnu@], cdbs (>= 0.4.17), quilt (>= 0.30-1), libkvm-dev [@kfreebsd@], type-handling (>= 0.2.1), libunwind7-dev [ia64], flex | flex-old + +Package: gdb +Architecture: any +Section: devel +Depends: ${shlibs:Depends} +Conflicts: gdb-arm +Replaces: gdb-arm, insight (<< 6.1+cvs.2004.04.07-1) +Description: The GNU Debugger + GDB is a source-level debugger, capable of breaking programs at + any specific line, displaying variable values, and determining + where errors occurred. Currently, it works for C, C++, Fortran + Modula 2 and Java programs. A must-have for any serious + programmer. --- gdb-6.4.orig/debian/gdb.menu +++ gdb-6.4/debian/gdb.menu @@ -0,0 +1,3 @@ +?package(gdb):needs="text" title="GDB" section="Apps/Programming"\ + hints="Debuggers" command="/usr/bin/gdb" + --- gdb-6.4.orig/debian/control +++ gdb-6.4/debian/control @@ -0,0 +1,19 @@ +Source: gdb +Maintainer: Daniel Jacobowitz +Section: devel +Priority: standard +Standards-Version: 3.5.3 +Build-Depends: autoconf, libtool, texinfo (>= 4.7-2.2), tetex-bin, libncurses5-dev, libreadline5-dev, bison, gettext, debhelper (>= 4.9.0), dejagnu, gcj [!mips !mipsel !hurd-i386], gobjc, cdbs (>= 0.4.17), quilt (>= 0.30-1), libunwind7-dev [ia64], flex | flex-old + +Package: gdb +Architecture: any +Section: devel +Depends: ${shlibs:Depends} +Conflicts: gdb-arm +Replaces: gdb-arm, insight (<< 6.1+cvs.2004.04.07-1) +Description: The GNU Debugger + GDB is a source-level debugger, capable of breaking programs at + any specific line, displaying variable values, and determining + where errors occurred. Currently, it works for C, C++, Fortran + Modula 2 and Java programs. A must-have for any serious + programmer. --- gdb-6.4.orig/debian/compat +++ gdb-6.4/debian/compat @@ -0,0 +1 @@ +4 --- gdb-6.4.orig/debian/patches/series +++ gdb-6.4/debian/patches/series @@ -0,0 +1,18 @@ +10.selected-frame.patch +13.use-dynamic-readline.patch +static-thread-db.patch +34.info-section.patch +sim-destdir.patch +member-field-symtab.patch +cp-pass-by-reference.patch +thread-db-multiple-libraries.patch +static-threads-test.patch +dwarf2-cfi-warning.patch +gdbinit-ownership.patch +pending-breakpoints-and-sigttou.patch +gdb-pascal-support.patch +gdb-nptl-cancellation.patch +gdb-fortran-main.patch -p0 +gdb-powerpc-pic-prologue.patch +linux-clear-thread-list.patch +fix-attach-inferior-notification.patch --- gdb-6.4.orig/debian/patches/13.use-dynamic-readline.patch +++ gdb-6.4/debian/patches/13.use-dynamic-readline.patch @@ -0,0 +1,29 @@ +Debian local - Use system readline to build. + +It would be nice to add a configure argument for this upstream. + +Index: gdb-6.3/gdb/Makefile.in +=================================================================== +--- gdb-6.3.orig/gdb/Makefile.in 2004-11-03 21:18:49.000000000 -0500 ++++ gdb-6.3/gdb/Makefile.in 2004-11-09 23:04:57.204160812 -0500 +@@ -121,10 +121,16 @@ BFD_SRC = $(srcdir)/$(BFD_DIR) + BFD_CFLAGS = -I$(BFD_DIR) -I$(BFD_SRC) + + # Where is the READLINE library? Typically in ../readline. +-READLINE_DIR = ../readline +-READLINE = $(READLINE_DIR)/libreadline.a +-READLINE_SRC = $(srcdir)/$(READLINE_DIR) +-READLINE_CFLAGS = -I$(READLINE_SRC)/.. ++#READLINE_DIR = ../readline ++#READLINE = $(READLINE_DIR)/libreadline.a ++#READLINE_SRC = $(srcdir)/$(READLINE_DIR) ++#READLINE_CFLAGS = -I$(READLINE_SRC)/.. ++# ++# Debian has a perfectly fine readline - use it. ++READLINE_SRC=/usr/include/readline ++READLINE=-lreadline ++READLINE_CFLAGS= ++READLINE_DIR= + + WARN_CFLAGS = @WARN_CFLAGS@ + WERROR_CFLAGS = @WERROR_CFLAGS@ --- gdb-6.4.orig/debian/patches/34.info-section.patch +++ gdb-6.4/debian/patches/34.info-section.patch @@ -0,0 +1,42 @@ +Debian-local: + Use the Development section, for consistency with other Debian packages. + +Index: gdb-6.3/gdb/doc/gdb.texinfo +=================================================================== +--- gdb-6.3.orig/gdb/doc/gdb.texinfo 2004-10-08 15:19:03.000000000 -0400 ++++ gdb-6.3/gdb/doc/gdb.texinfo 2004-11-10 00:38:00.343924014 -0500 +@@ -38,7 +38,7 @@ + + @c This is a dir.info fragment to support semi-automated addition of + @c manuals to an info tree. +-@dircategory Software development ++@dircategory Development + @direntry + * Gdb: (gdb). The GNU debugger. + @end direntry +Index: gdb-6.3/gdb/doc/gdbint.texinfo +=================================================================== +--- gdb-6.3.orig/gdb/doc/gdbint.texinfo 2004-10-12 15:14:31.000000000 -0400 ++++ gdb-6.3/gdb/doc/gdbint.texinfo 2004-11-10 00:37:59.165154226 -0500 +@@ -1,7 +1,7 @@ + \input texinfo @c -*- texinfo -*- + @setfilename gdbint.info + @include gdb-cfg.texi +-@dircategory Software development ++@dircategory Development + @direntry + * Gdb-Internals: (gdbint). The GNU debugger's internals. + @end direntry +Index: gdb-6.3/gdb/doc/stabs.texinfo +=================================================================== +--- gdb-6.3.orig/gdb/doc/stabs.texinfo 2004-09-21 17:06:37.000000000 -0400 ++++ gdb-6.3/gdb/doc/stabs.texinfo 2004-11-10 00:37:59.874015787 -0500 +@@ -5,7 +5,7 @@ + + @c This is a dir.info fragment to support semi-automated addition of + @c manuals to an info tree. +-@dircategory Software development ++@dircategory Development + @direntry + * Stabs: (stabs). The "stabs" debugging information format. + @end direntry --- gdb-6.4.orig/debian/patches/sim-destdir.patch +++ gdb-6.4/debian/patches/sim-destdir.patch @@ -0,0 +1,29 @@ +Fix some missing uses of DESTDIR in the sim/ directories. The Debian +packages use DESTDIR to build. + +%patch +Index: gdb-6.3/sim/Makefile.in +=================================================================== +--- gdb-6.3.orig/sim/Makefile.in 2003-09-03 14:46:52.000000000 -0400 ++++ gdb-6.3/sim/Makefile.in 2004-11-10 00:39:25.381315738 -0500 +@@ -93,6 +93,7 @@ FLAGS_TO_PASS = \ + "CC=$(CC)" \ + "CC_FOR_BUILD=$(CC_FOR_BUILD)" \ + "CFLAGS=$(CFLAGS)" \ ++ "DESTDIR=$(DESTDIR)" \ + "RANLIB=$(RANLIB)" \ + "MAKEINFO=$(MAKEINFO)" \ + "INSTALL=$(INSTALL)" \ +Index: gdb-6.3/sim/erc32/Makefile.in +=================================================================== +--- gdb-6.3.orig/sim/erc32/Makefile.in 2000-03-07 10:32:49.000000000 -0500 ++++ gdb-6.3/sim/erc32/Makefile.in 2004-11-10 00:39:25.385314957 -0500 +@@ -53,7 +53,7 @@ end.h: end + # Copy the files into directories where they will be run. + install-sis: installdirs + n=`echo sis | sed '$(program_transform_name)'`; \ +- $(INSTALL_PROGRAM) sis$(EXEEXT) $(bindir)/$$n$(EXEEXT) ++ $(INSTALL_PROGRAM) sis$(EXEEXT) $(DESTDIR)$(bindir)/$$n$(EXEEXT) + + clean-sis: + rm -f sis end end.h --- gdb-6.4.orig/debian/patches/member-field-symtab.patch +++ gdb-6.4/debian/patches/member-field-symtab.patch @@ -0,0 +1,35 @@ +Status: unsubmitted + +This patch was for Debian bug #239535. It needs to be tested, and +submitted. + +Index: gdb-6.3.90.20051119/gdb/valops.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/valops.c 2005-11-19 22:42:02.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/valops.c 2005-11-19 22:42:40.000000000 -0500 +@@ -2256,8 +2256,10 @@ check_field_in (struct type *type, const + return 1; + } + ++ /* Check each baseclass. Call check_typedef, which will follow typedefs ++ and do opaque/stub type resolution. */ + for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) +- if (check_field_in (TYPE_BASECLASS (type, i), name)) ++ if (check_field_in (check_typedef (TYPE_BASECLASS (type, i)), name)) + return 1; + + return 0; +Index: gdb-6.3.90.20051119/gdb/dwarf2read.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/dwarf2read.c 2005-11-19 22:38:17.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/dwarf2read.c 2005-11-19 22:42:40.000000000 -0500 +@@ -2098,8 +2098,8 @@ guess_structure_name (struct partial_die + strlen (actual_class_name), + &cu->comp_unit_obstack); + xfree (actual_class_name); ++ break; + } +- break; + } + + child_pdi = child_pdi->die_sibling; --- gdb-6.4.orig/debian/patches/dwarf2-cfi-warning.patch +++ gdb-6.4/debian/patches/dwarf2-cfi-warning.patch @@ -0,0 +1,32 @@ +Status: Unsuitable for upstream (at least, without a lot of arguing). + +GCC does not specify the state of every last register in the CIE. Since +GCC's focus is on correctness of runtime unwinding, any registers which +have to be unwound will be specified; but unmodified registers will not +be explicitly marked. (How about modified, call-clobbered registers? +I'm not sure if they are marked as unavailable.) + +GDB issues a noisy warning about this. The warning is generally not useful, +and we can get it extremely frequently (any time we load a new CIE). + +This patch disables the warning. Alternately we could set the complaints +threshold to zero, or implement a default frame init-register method for +every architecture. But someday the compiler will support using different +calling conventions for internal functions, so that's not much of a stopgap. +ARM has a complex algorithm for handling this, involving scanning all CIEs - +benefit not completely clear outside of the ARM context of flexible register +sets. + +Index: gdb-6.3.90.20051119/gdb/dwarf2-frame.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/dwarf2-frame.c 2005-08-01 00:06:27.000000000 -0400 ++++ gdb-6.3.90.20051119/gdb/dwarf2-frame.c 2005-11-20 00:11:37.000000000 -0500 +@@ -738,7 +738,7 @@ dwarf2_frame_cache (struct frame_info *n + DWARF2 register numbers. */ + if (fs->regs.reg[column].how == DWARF2_FRAME_REG_UNSPECIFIED) + { +- if (cache->reg[regnum].how == DWARF2_FRAME_REG_UNSPECIFIED) ++ if (0 && cache->reg[regnum].how == DWARF2_FRAME_REG_UNSPECIFIED) + complaint (&symfile_complaints, _("\ + incomplete CFI data; unspecified registers (e.g., %s) at 0x%s"), + gdbarch_register_name (gdbarch, regnum), --- gdb-6.4.orig/debian/patches/fix-attach-inferior-notification.patch +++ gdb-6.4/debian/patches/fix-attach-inferior-notification.patch @@ -0,0 +1,60 @@ +Index: gdb-6.4/gdb/inf-ptrace.c +=================================================================== +--- gdb-6.4.orig/gdb/inf-ptrace.c 2005-11-21 04:16:07.000000000 -0500 ++++ gdb-6.4/gdb/inf-ptrace.c 2005-12-11 13:08:51.000000000 -0500 +@@ -228,10 +228,6 @@ inf_ptrace_attach (char *args, int from_ + + inferior_ptid = pid_to_ptid (pid); + push_target (ptrace_ops_hack); +- +- /* Do this first, before anything has had a chance to query the +- inferior's symbol table or similar. */ +- observer_notify_inferior_created (¤t_target, from_tty); + } + + #ifdef PT_GET_PROCESS_STATE +Index: gdb-6.4/gdb/inf-ttrace.c +=================================================================== +--- gdb-6.4.orig/gdb/inf-ttrace.c 2005-10-29 17:22:39.000000000 -0400 ++++ gdb-6.4/gdb/inf-ttrace.c 2005-12-11 13:10:29.000000000 -0500 +@@ -727,10 +727,6 @@ inf_ttrace_attach (char *args, int from_ + + inferior_ptid = pid_to_ptid (pid); + push_target (ttrace_ops_hack); +- +- /* Do this first, before anything has had a chance to query the +- inferior's symbol table or similar. */ +- observer_notify_inferior_created (¤t_target, from_tty); + } + + static void +Index: gdb-6.4/gdb/infcmd.c +=================================================================== +--- gdb-6.4.orig/gdb/infcmd.c 2005-12-07 20:37:42.000000000 -0500 ++++ gdb-6.4/gdb/infcmd.c 2005-12-11 13:09:33.000000000 -0500 +@@ -1878,6 +1878,10 @@ attach_command (char *args, int from_tty + reread_symbols (); + } + ++ /* Do this first, before anything has had a chance to query the ++ inferior's symbol table or similar. */ ++ observer_notify_inferior_created (¤t_target, from_tty); ++ + #ifdef SOLIB_ADD + /* Add shared library symbols from the newly attached process, if any. */ + SOLIB_ADD ((char *) 0, from_tty, ¤t_target, auto_solib_add); +Index: gdb-6.4/gdb/inftarg.c +=================================================================== +--- gdb-6.4.orig/gdb/inftarg.c 2005-09-04 12:18:19.000000000 -0400 ++++ gdb-6.4/gdb/inftarg.c 2005-12-11 13:10:37.000000000 -0500 +@@ -211,10 +211,6 @@ child_attach (char *args, int from_tty) + + inferior_ptid = pid_to_ptid (pid); + push_target (&deprecated_child_ops); +- +- /* Do this first, before anything has had a chance to query the +- inferior's symbol table or similar. */ +- observer_notify_inferior_created (¤t_target, from_tty); + } + + #if !defined(CHILD_POST_ATTACH) --- gdb-6.4.orig/debian/patches/gdb-fortran-main.patch +++ gdb-6.4/debian/patches/gdb-fortran-main.patch @@ -0,0 +1,100 @@ +Daniel, + +Although the proper way of adding case insensitivity to symbol lookup is +still under discussion, I think it might be desirable to set the main +function of Fortran programs to "MAIN__" first. Because it can at least +let GDB recognize that the language is Fortran after loading a Fortran +executable only. What is your idea on this? Please comments. TIA! + +Here is the patch to set the main function in Fortran programs to +"MAIN__". And followed is a patch to verify this. Tested with g77 and +gfortran on x86, and g77 on ppc64. With the first patch, it reported +PASS; without, report FAIL. No regression is found in gdb.fortran +testcases. + +P.S: if there is a symbol named "MAIN__" in sources of other languages, it +might disturb the debugging. But I am not sure how much it is. + +Index: gdb/symtab.c +=================================================================== +RCS file: /cvs/src/src/gdb/symtab.c,v +retrieving revision 1.145 +diff -c -p -r1.145 symtab.c +*** gdb/symtab.c 8 Mar 2005 04:34:44 -0000 1.145 +--- gdb/symtab.c 28 Jul 2005 03:16:48 -0000 +*************** find_main_name (void) +*** 4125,4132 **** + } + + /* The languages above didn't identify the name of the main procedure. +! Fallback to "main". */ +! set_main_name ("main"); + } + + char * +--- 4125,4136 ---- + } + + /* The languages above didn't identify the name of the main procedure. +! Fallback to "MAIN__" (g77 and gfortran) if we can find it in the +! minimal symtab, to "main" otherwise. */ +! if (lookup_minimal_symbol ("MAIN__", NULL, NULL)) +! set_main_name ("MAIN__"); +! else +! set_main_name ("main"); + } + + char * + +Testcase lang.exp to verify the above patch: +=========================================================== +*** /dev/null Mon Jul 25 13:51:17 2005 +--- gdb/testsuite/gdb.fortran/lang.exp Mon Jul 25 06:50:20 2005 +*************** +*** 0 **** +--- 1,40 ---- ++ # Copyright 2005 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 Wu Zhou. (woodzltc@cn.ibm.com) ++ ++ # This file is part of the gdb testsuite. It is intended to test that gdb ++ # could recognize the Fortran language after loading the binary ++ ++ if $tracelevel then { ++ strace $tracelevel ++ } ++ ++ set testfile "array-element" ++ set srcfile ${srcdir}/${subdir}/${testfile}.f ++ set binfile ${objdir}/${subdir}/${testfile} ++ ++ if { [gdb_compile "${srcfile}" "${binfile}" executable {debug f77}] != "" } { ++ untested "Couldn't compile ${srcfile}" ++ return -1 ++ } ++ ++ gdb_exit ++ gdb_start ++ gdb_reinitialize_dir $srcdir/$subdir ++ gdb_load ${binfile} ++ ++ gdb_test "show language" ".*currently fortran.*" "show language(fortran)" + + +Regards +- Wu Zhou + --- gdb-6.4.orig/debian/patches/gdbinit-ownership.patch +++ gdb-6.4/debian/patches/gdbinit-ownership.patch @@ -0,0 +1,121 @@ +This patch was not popular upstream; there was no fundamental objection, but +several problems with the implementation. It needs to be revisited. + +Index: gdb-6.3.90.20051119/gdb/cli/cli-cmds.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/cli/cli-cmds.c 2005-11-19 22:56:43.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/cli/cli-cmds.c 2005-11-20 00:17:15.000000000 -0500 +@@ -37,6 +37,7 @@ + #include "objfiles.h" + #include "source.h" + #include "disasm.h" ++#include "gdb_stat.h" + + #include "ui-out.h" + +@@ -50,6 +51,8 @@ + #include "tui/tui.h" /* For tui_active et.al. */ + #endif + ++#include ++ + /* Prototypes for local command functions */ + + static void complete_command (char *, int); +@@ -420,30 +423,54 @@ cd_command (char *dir, int from_tty) + pwd_command ((char *) 0, 1); + } + ++/* Load a GDB command file whose name is given in ARGS. FROM_TTY may ++ be -1, in which case we are loading a gdbinit file; in that case, ++ be paranoid about unsafe files. */ ++ + void + source_command (char *args, int from_tty) + { +- FILE *stream; ++ FILE *stream = NULL; ++ int fd; + struct cleanup *old_cleanups; + char *file = args; + + if (file == NULL) +- { +- error (_("source command requires pathname of file to source.")); +- } ++ error (_("source command requires pathname of file to source.")); + + file = tilde_expand (file); + old_cleanups = make_cleanup (xfree, file); + +- stream = fopen (file, FOPEN_RT); +- if (!stream) ++ fd = open (file, O_RDONLY); ++ if (fd != -1) ++ stream = fdopen (fd, FOPEN_RT); ++ if (stream == NULL) + { +- if (from_tty) ++ if (from_tty > 0) + perror_with_name (file); + else + return; + } + ++#ifdef HAVE_GETUID ++ if (from_tty == -1) ++ { ++ struct stat statbuf; ++ if (fstat (fd, &statbuf) < 0) ++ { ++ perror_with_name (file); ++ fclose (stream); ++ return; ++ } ++ if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH)) ++ { ++ warning ("not using untrusted file \"%s\"", file); ++ fclose (stream); ++ return; ++ } ++ } ++#endif ++ + script_from_file (stream, file); + + do_cleanups (old_cleanups); +Index: gdb-6.3.90.20051119/gdb/main.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/main.c 2005-11-14 10:53:06.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/main.c 2005-11-20 00:14:13.000000000 -0500 +@@ -638,7 +638,7 @@ extern int gdbtk_test (char *); + + if (!inhibit_gdbinit) + { +- catch_command_errors (source_command, homeinit, 0, RETURN_MASK_ALL); ++ catch_command_errors (source_command, homeinit, -1, RETURN_MASK_ALL); + } + + /* Do stats; no need to do them elsewhere since we'll only +@@ -725,7 +725,7 @@ extern int gdbtk_test (char *); + || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat))) + if (!inhibit_gdbinit) + { +- catch_command_errors (source_command, gdbinit, 0, RETURN_MASK_ALL); ++ catch_command_errors (source_command, gdbinit, -1, RETURN_MASK_ALL); + } + + for (i = 0; i < ncmd; i++) +Index: gdb-6.3.90.20051119/gdb/Makefile.in +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/Makefile.in 2005-11-19 22:56:43.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/Makefile.in 2005-11-20 00:14:13.000000000 -0500 +@@ -2794,7 +2794,7 @@ cli-cmds.o: $(srcdir)/cli/cli-cmds.c $(d + $(expression_h) $(frame_h) $(value_h) $(language_h) $(filenames_h) \ + $(objfiles_h) $(source_h) $(disasm_h) $(ui_out_h) $(top_h) \ + $(cli_decode_h) $(cli_script_h) $(cli_setshow_h) $(cli_cmds_h) \ +- $(tui_h) ++ $(tui_h) $(gdb_stat_h) + $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/cli/cli-cmds.c + cli-decode.o: $(srcdir)/cli/cli-decode.c $(defs_h) $(symtab_h) \ + $(gdb_regex_h) $(gdb_string_h) $(ui_out_h) $(cli_cmds_h) \ --- gdb-6.4.orig/debian/patches/linux-clear-thread-list.patch +++ gdb-6.4/debian/patches/linux-clear-thread-list.patch @@ -0,0 +1,24 @@ +Index: gdb-6.4/gdb/linux-thread-db.c +=================================================================== +--- gdb-6.4.orig/gdb/linux-thread-db.c 2005-12-07 20:37:42.000000000 -0500 ++++ gdb-6.4/gdb/linux-thread-db.c 2005-12-11 12:33:04.000000000 -0500 +@@ -842,6 +842,9 @@ thread_db_detach (char *args, int from_t + inferior is supposed to be survive this function call. */ + inferior_ptid = lwp_from_thread (inferior_ptid); + ++ /* Destroy thread info; it's no longer valid. */ ++ init_thread_list (); ++ + /* Forget about the child's process ID. We shouldn't need it + anymore. */ + proc_handle.pid = 0; +@@ -1138,6 +1141,9 @@ thread_db_mourn_inferior (void) + { + remove_thread_event_breakpoints (); + ++ /* Destroy thread info; it's no longer valid. */ ++ init_thread_list (); ++ + /* Forget about the child's process ID. We shouldn't need it + anymore. */ + proc_handle.pid = 0; --- gdb-6.4.orig/debian/patches/static-threads-test.patch +++ gdb-6.4/debian/patches/static-threads-test.patch @@ -0,0 +1,17 @@ +Update staticthreads.exp to handle debugging info in libpthread.a. + +Index: gdb-6.3.90.20051119/gdb/testsuite/gdb.threads/staticthreads.exp +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/testsuite/gdb.threads/staticthreads.exp 2005-11-19 22:56:59.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/testsuite/gdb.threads/staticthreads.exp 2005-11-20 00:01:11.000000000 -0500 +@@ -53,6 +53,10 @@ gdb_test_multiple "continue" "$test" { + -re " sem_post .*$gdb_prompt " { + pass "$test" + } ++ -re " (.*_)sem_post .*$gdb_prompt " { ++ # Glibc uses aliases for internal symbols; match __new_sem_post. ++ pass "$test" ++ } + -re "Program received signal .*$gdb_prompt " { + kfail gdb/1328 "$test" + } --- gdb-6.4.orig/debian/patches/10.selected-frame.patch +++ gdb-6.4/debian/patches/10.selected-frame.patch @@ -0,0 +1,437 @@ +2004-10-11 + +This patch is not submitted. Many of these functions should be passing +a frame around rather than calling get_selected_frame, but at least it +is an improvement over deprecated_selected_frame. + +2005-11-20 + +Patch updated, but still not submitted. + +Index: gdb-6.3.90.20051119/gdb/breakpoint.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/breakpoint.c 2005-11-20 11:39:21.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/breakpoint.c 2005-11-20 11:39:22.000000000 -0500 +@@ -932,7 +932,7 @@ insert_bp_location (struct bp_location * + /* FIXME drow/2003-09-09: It would be nice if evaluate_expression + took a frame parameter, so that we didn't have to change the + selected frame. */ +- saved_frame_id = get_frame_id (deprecated_selected_frame); ++ saved_frame_id = get_frame_id (get_selected_frame (NULL)); + + /* Determine if the watchpoint is within scope. */ + if (bpt->owner->exp_valid_block == NULL) +@@ -5927,7 +5927,7 @@ until_break_command (char *arg, int from + { + struct symtabs_and_lines sals; + struct symtab_and_line sal; +- struct frame_info *prev_frame = get_prev_frame (deprecated_selected_frame); ++ struct frame_info *prev_frame = get_prev_frame (get_selected_frame (NULL)); + struct breakpoint *breakpoint; + struct cleanup *old_chain; + struct continuation_arg *arg1; +@@ -5964,7 +5964,7 @@ until_break_command (char *arg, int from + /* Otherwise, specify the current frame, because we want to stop only + at the very same frame. */ + breakpoint = set_momentary_breakpoint (sal, +- get_frame_id (deprecated_selected_frame), ++ get_frame_id (get_selected_frame (NULL)), + bp_until); + + if (!target_can_async_p ()) +Index: gdb-6.3.90.20051119/gdb/cli/cli-cmds.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/cli/cli-cmds.c 2005-11-20 11:39:21.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/cli/cli-cmds.c 2005-11-20 11:39:22.000000000 -0500 +@@ -846,10 +846,7 @@ disassemble_command (char *arg, int from + name = NULL; + if (!arg) + { +- if (!deprecated_selected_frame) +- error (_("No frame selected.")); +- +- pc = get_frame_pc (deprecated_selected_frame); ++ pc = get_frame_pc (get_selected_frame (_("No frame selected."))); + if (find_pc_partial_function (pc, &name, &low, &high) == 0) + error (_("No function contains program counter for selected frame.")); + #if defined(TUI) +Index: gdb-6.3.90.20051119/gdb/f-valprint.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/f-valprint.c 2005-11-20 11:39:21.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/f-valprint.c 2005-11-20 11:39:22.000000000 -0500 +@@ -71,7 +71,7 @@ f77_get_dynamic_lowerbound (struct type + switch (TYPE_ARRAY_LOWER_BOUND_TYPE (type)) + { + case BOUND_BY_VALUE_ON_STACK: +- current_frame_addr = get_frame_base (deprecated_selected_frame); ++ current_frame_addr = get_frame_base (get_selected_frame (NULL)); + if (current_frame_addr > 0) + { + *lower_bound = +@@ -95,7 +95,7 @@ f77_get_dynamic_lowerbound (struct type + break; + + case BOUND_BY_REF_ON_STACK: +- current_frame_addr = get_frame_base (deprecated_selected_frame); ++ current_frame_addr = get_frame_base (get_selected_frame (NULL)); + if (current_frame_addr > 0) + { + ptr_to_lower_bound = +@@ -129,7 +129,7 @@ f77_get_dynamic_upperbound (struct type + switch (TYPE_ARRAY_UPPER_BOUND_TYPE (type)) + { + case BOUND_BY_VALUE_ON_STACK: +- current_frame_addr = get_frame_base (deprecated_selected_frame); ++ current_frame_addr = get_frame_base (get_selected_frame (NULL)); + if (current_frame_addr > 0) + { + *upper_bound = +@@ -158,7 +158,7 @@ f77_get_dynamic_upperbound (struct type + break; + + case BOUND_BY_REF_ON_STACK: +- current_frame_addr = get_frame_base (deprecated_selected_frame); ++ current_frame_addr = get_frame_base (get_selected_frame (NULL)); + if (current_frame_addr > 0) + { + ptr_to_upper_bound = +@@ -619,10 +619,7 @@ info_common_command (char *comname, int + first make sure that it is visible and if so, let + us display its contents */ + +- fi = deprecated_selected_frame; +- +- if (fi == NULL) +- error (_("No frame selected")); ++ fi = get_selected_frame (_("No frame selected")); + + /* The following is generally ripped off from stack.c's routine + print_frame_info() */ +@@ -711,10 +708,7 @@ there_is_a_visible_common_named (char *c + if (comname == NULL) + error (_("Cannot deal with NULL common name!")); + +- fi = deprecated_selected_frame; +- +- if (fi == NULL) +- error (_("No frame selected")); ++ fi = get_selected_frame (_("No frame selected")); + + /* The following is generally ripped off from stack.c's routine + print_frame_info() */ +Index: gdb-6.3.90.20051119/gdb/infcmd.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/infcmd.c 2005-11-20 11:39:21.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/infcmd.c 2005-11-20 11:39:22.000000000 -0500 +@@ -1244,10 +1244,8 @@ finish_command (char *arg, int from_tty) + error (_("The \"finish\" command does not take any arguments.")); + if (!target_has_execution) + error (_("The program is not running.")); +- if (deprecated_selected_frame == NULL) +- error (_("No selected frame.")); + +- frame = get_prev_frame (deprecated_selected_frame); ++ frame = get_prev_frame (get_selected_frame (_("No selected frame."))); + if (frame == 0) + error (_("\"finish\" not meaningful in the outermost frame.")); + +@@ -1265,7 +1263,7 @@ finish_command (char *arg, int from_tty) + + /* Find the function we will return from. */ + +- function = find_pc_function (get_frame_pc (deprecated_selected_frame)); ++ function = find_pc_function (get_frame_pc (get_selected_frame (NULL))); + + /* Print info on the selected frame, including level number but not + source. */ +@@ -1631,13 +1629,12 @@ registers_info (char *addr_exp, int fpre + + if (!target_has_registers) + error (_("The program has no registers now.")); +- if (deprecated_selected_frame == NULL) +- error (_("No selected frame.")); + + if (!addr_exp) + { + gdbarch_print_registers_info (current_gdbarch, gdb_stdout, +- deprecated_selected_frame, -1, fpregs); ++ get_selected_frame (_("No selected frame.")), ++ -1, fpregs); + return; + } + +@@ -1670,12 +1667,12 @@ registers_info (char *addr_exp, int fpre + + /* A register name? */ + { +- int regnum = frame_map_name_to_regnum (deprecated_selected_frame, ++ int regnum = frame_map_name_to_regnum (get_selected_frame (_("No selected frame.")), + start, end - start); + if (regnum >= 0) + { + gdbarch_print_registers_info (current_gdbarch, gdb_stdout, +- deprecated_selected_frame, regnum, fpregs); ++ get_selected_frame (NULL), regnum, fpregs); + continue; + } + } +@@ -1689,7 +1686,7 @@ registers_info (char *addr_exp, int fpre + && regnum < NUM_REGS + NUM_PSEUDO_REGS) + { + gdbarch_print_registers_info (current_gdbarch, gdb_stdout, +- deprecated_selected_frame, regnum, fpregs); ++ get_selected_frame (NULL), regnum, fpregs); + continue; + } + } +@@ -1715,7 +1712,7 @@ registers_info (char *addr_exp, int fpre + if (gdbarch_register_reggroup_p (current_gdbarch, regnum, + group)) + gdbarch_print_registers_info (current_gdbarch, +- gdb_stdout, deprecated_selected_frame, ++ gdb_stdout, get_selected_frame (NULL), + regnum, fpregs); + } + continue; +@@ -1745,8 +1742,6 @@ print_vector_info (struct gdbarch *gdbar + { + if (!target_has_registers) + error (_("The program has no registers now.")); +- if (deprecated_selected_frame == NULL) +- error (_("No selected frame.")); + + if (gdbarch_print_vector_info_p (gdbarch)) + gdbarch_print_vector_info (gdbarch, file, frame, args); +@@ -1771,7 +1766,7 @@ print_vector_info (struct gdbarch *gdbar + static void + vector_info (char *args, int from_tty) + { +- print_vector_info (current_gdbarch, gdb_stdout, deprecated_selected_frame, args); ++ print_vector_info (current_gdbarch, gdb_stdout, get_selected_frame (NULL), args); + } + + +@@ -1965,8 +1960,6 @@ print_float_info (struct gdbarch *gdbarc + { + if (!target_has_registers) + error (_("The program has no registers now.")); +- if (deprecated_selected_frame == NULL) +- error (_("No selected frame.")); + + if (gdbarch_print_float_info_p (gdbarch)) + gdbarch_print_float_info (gdbarch, file, frame, args); +@@ -1993,7 +1986,7 @@ static void + float_info (char *args, int from_tty) + { + print_float_info (current_gdbarch, gdb_stdout, +- deprecated_selected_frame, args); ++ get_selected_frame (NULL), args); + } + + static void +Index: gdb-6.3.90.20051119/gdb/inflow.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/inflow.c 2005-11-20 11:39:21.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/inflow.c 2005-11-20 11:45:45.000000000 -0500 +@@ -591,7 +591,7 @@ kill_command (char *arg, int from_tty) + if (target_has_stack) + { + printf_filtered (_("In %s,\n"), target_longname); +- if (deprecated_selected_frame == NULL) ++ if (deprecated_safe_get_selected_frame () == NULL) + fputs_filtered ("No selected stack frame.\n", gdb_stdout); + else + print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC); +Index: gdb-6.3.90.20051119/gdb/infrun.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/infrun.c 2005-11-20 11:39:21.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/infrun.c 2005-11-20 11:39:22.000000000 -0500 +@@ -3584,7 +3584,7 @@ save_inferior_status (int restore_stack_ + + inf_status->registers = regcache_dup (current_regcache); + +- inf_status->selected_frame_id = get_frame_id (deprecated_selected_frame); ++ inf_status->selected_frame_id = get_frame_id (get_selected_frame (NULL)); + return inf_status; + } + +Index: gdb-6.3.90.20051119/gdb/stack.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/stack.c 2005-11-20 11:39:21.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/stack.c 2005-11-20 11:39:22.000000000 -0500 +@@ -1909,7 +1909,7 @@ func_command (char *arg, int from_tty) + + if (!found) + printf_filtered (_("'%s' not within current stack frame.\n"), arg); +- else if (frame != deprecated_selected_frame) ++ else if (frame != get_selected_frame (NULL)) + select_and_print_frame (frame); + } + +@@ -1918,7 +1918,7 @@ func_command (char *arg, int from_tty) + enum language + get_frame_language (void) + { +- struct frame_info *frame = deprecated_selected_frame; ++ struct frame_info *frame = deprecated_safe_get_selected_frame (); + + if (frame) + { +Index: gdb-6.3.90.20051119/gdb/tui/tui-disasm.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/tui/tui-disasm.c 2005-11-20 11:39:21.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/tui/tui-disasm.c 2005-11-20 11:39:22.000000000 -0500 +@@ -386,7 +386,7 @@ tui_vertical_disassem_scroll (enum tui_s + + content = (tui_win_content) TUI_DISASM_WIN->generic.content; + if (cursal.symtab == (struct symtab *) NULL) +- s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); ++ s = find_pc_symtab (get_frame_pc (get_selected_frame (NULL))); + else + s = cursal.symtab; + +Index: gdb-6.3.90.20051119/gdb/tui/tui-source.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/tui/tui-source.c 2005-11-20 11:39:21.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/tui/tui-source.c 2005-11-20 11:39:22.000000000 -0500 +@@ -330,7 +330,7 @@ tui_vertical_source_scroll (enum tui_scr + struct symtab_and_line cursal = get_current_source_symtab_and_line (); + + if (cursal.symtab == (struct symtab *) NULL) +- s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); ++ s = find_pc_symtab (get_frame_pc (get_selected_frame (NULL))); + else + s = cursal.symtab; + +Index: gdb-6.3.90.20051119/gdb/tui/tui-winsource.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/tui/tui-winsource.c 2005-11-20 11:39:21.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/tui/tui-winsource.c 2005-11-20 11:39:22.000000000 -0500 +@@ -314,7 +314,7 @@ tui_horizontal_source_scroll (struct tui + struct symtab_and_line cursal = get_current_source_symtab_and_line (); + + if (cursal.symtab == (struct symtab *) NULL) +- s = find_pc_symtab (get_frame_pc (deprecated_selected_frame)); ++ s = find_pc_symtab (get_frame_pc (get_selected_frame (NULL))); + else + s = cursal.symtab; + +Index: gdb-6.3.90.20051119/gdb/valops.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/valops.c 2005-11-20 11:39:21.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/valops.c 2005-11-20 11:49:37.000000000 -0500 +@@ -544,7 +544,7 @@ value_assign (struct value *toval, struc + /* Since modifying a register can trash the frame chain, and modifying memory + can trash the frame cache, we save the old frame and then restore the new + frame afterwards. */ +- old_frame = get_frame_id (deprecated_selected_frame); ++ old_frame = get_frame_id (deprecated_safe_get_selected_frame ()); + + switch (VALUE_LVAL (toval)) + { +@@ -2605,16 +2605,18 @@ value_of_local (const char *name, int co + struct symbol *func, *sym; + struct block *b; + struct value * ret; ++ struct frame_info *frame; + +- if (deprecated_selected_frame == 0) ++ if (complain) ++ frame = get_selected_frame (_("no frame selected")); ++ else + { +- if (complain) +- error (_("no frame selected")); +- else ++ frame = deprecated_safe_get_selected_frame (); ++ if (frame == 0) + return 0; + } + +- func = get_frame_function (deprecated_selected_frame); ++ func = get_frame_function (frame); + if (!func) + { + if (complain) +@@ -2643,7 +2645,7 @@ value_of_local (const char *name, int co + return NULL; + } + +- ret = read_var_value (sym, deprecated_selected_frame); ++ ret = read_var_value (sym, frame); + if (ret == 0 && complain) + error (_("`%s' argument unreadable"), name); + return ret; +Index: gdb-6.3.90.20051119/gdb/varobj.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/varobj.c 2005-11-20 11:39:21.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/varobj.c 2005-11-20 11:39:22.000000000 -0500 +@@ -498,7 +498,7 @@ varobj_create (char *objname, + if (fi != NULL) + { + var->root->frame = get_frame_id (fi); +- old_fi = deprecated_selected_frame; ++ old_fi = get_selected_frame (NULL); + select_frame (fi); + } + +Index: gdb-6.3.90.20051119/gdb/testsuite/gdb.base/default.exp +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/testsuite/gdb.base/default.exp 2005-11-20 11:39:21.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/testsuite/gdb.base/default.exp 2005-11-20 11:39:22.000000000 -0500 +@@ -167,7 +167,7 @@ gdb_test "disable breakpoints" "" "disab + #test disable display + gdb_test "disable display" "" "disable display" + #test disassemble +-gdb_test "disassemble" "No frame selected." "disassemble" ++gdb_test "disassemble" "No (frame selected|registers)." "disassemble" + #test display + gdb_test "display" "" "display" + #test do +@@ -229,9 +229,9 @@ gdb_expect { + } + + #test frame "f" abbreviation +-gdb_test "f" "No stack." "frame \"f\" abbreviation" ++gdb_test "f" "No (stack|registers)." "frame \"f\" abbreviation" + #test frame +-gdb_test "frame" "No stack." "frame" ++gdb_test "frame" "No (stack|registers)." "frame" + #test fg + gdb_test "fg" "The program is not being run." "fg" + # FIXME: fg kills the udi connection +@@ -294,9 +294,9 @@ gdb_test "ignore" "Argument required .a + #test info address + gdb_test "info address" "Argument required." "info address" + #test info all-registers +-gdb_test "info all-registers" "The program has no registers now." "info all-registers" ++gdb_test "info all-registers" "(The program has no registers now|No registers)." "info all-registers" + #test info args +-gdb_test "info args" "No frame selected." "info args" ++gdb_test "info args" "No (frame selected|registers)." "info args" + #test info bogus-gdb-command + gdb_test "info bogus-gdb-command" "Undefined info command: \"bogus-gdb-command\". Try \"help info\".*" "info bogus-gdb-command" + #test info breakpoints +@@ -320,11 +320,11 @@ gdb_test "info frame" "No stack.|No sele + #test info files + gdb_test "info files" "" "info files" + #test info float +-gdb_test "info float" "The program has no registers now." "info float" ++gdb_test "info float" "(The program has no registers now|No registers)." "info float" + #test info functions + gdb_test "info functions" "All defined functions:" "info functions" + #test info locals +-gdb_test "info locals" "No frame selected." "info locals" ++gdb_test "info locals" "(No frame selected|No registers)." "info locals" + #test info program + gdb_test "info program" "The program being debugged is not being run." "info program" + #test info registers +@@ -352,7 +352,7 @@ gdb_test "info types" "All defined types + #test info variables + gdb_test "info variables" "All defined variables:" "info variables" + #test info vector +-gdb_test "info vector" "The program has no registers now." "info vector" ++gdb_test "info vector" "(The program has no registers now|No registers)." "info vector" + #test info warranty + gdb_test "info warranty" "NO WARRANTY(\[^\r\n\]*\[\r\n\])+ *11. *BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY(\[^\r\n\]*\[\r\n\])+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN(\[^\r\n\]*\[\r\n\])+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES(\[^\r\n\]*\[\r\n\])+PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED(\[^\r\n\]*\[\r\n\])+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF(\[^\r\n\]*\[\r\n\])+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS(\[^\r\n\]*\[\r\n\])+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE(\[^\r\n\]*\[\r\n\])+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,(\[^\r\n\]*\[\r\n\])+REPAIR OR CORRECTION.(\[^\r\n\]*\[\r\n\])+ *12. *IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING(\[^\r\n\]*\[\r\n\])+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR(\[^\r\n\]*\[\r\n\])+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,(\[^\r\n\]*\[\r\n\])+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING(\[^\r\n\]*\[\r\n\])+OUT OF THE USE OR INABILITY TO USE THE PROGRAM .INCLUDING BUT NOT LIMITED(\[^\r\n\]*\[\r\n\])+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY(\[^\r\n\]*\[\r\n\])+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER(\[^\r\n\]*\[\r\n\])+PROGRAMS., EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE(\[^\r\n\]*\[\r\n\])+POSSIBILITY OF SUCH DAMAGES.*" "info warranty" + #test info watchpoints --- gdb-6.4.orig/debian/patches/thread-db-multiple-libraries.patch +++ gdb-6.4/debian/patches/thread-db-multiple-libraries.patch @@ -0,0 +1,593 @@ +Support loading two libthread_db DSOs. In this case, the LinuxThreads +and NPTL ones. + +Index: gdb-6.3.90.20051119/gdb/linux-thread-db.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/linux-thread-db.c 2005-11-19 22:42:24.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/linux-thread-db.c 2005-11-19 22:53:02.000000000 -0500 +@@ -82,53 +82,63 @@ static td_thragent_t *thread_agent; + + /* Pointers to the libthread_db functions. */ + +-static td_err_e (*td_init_p) (void); ++struct thread_db_pointers ++{ ++ const char *filename; ++ ++ td_err_e (*td_init_p) (void); + +-static td_err_e (*td_ta_new_p) (struct ps_prochandle * ps, +- td_thragent_t **ta); +-static td_err_e (*td_ta_map_id2thr_p) (const td_thragent_t *ta, thread_t pt, +- td_thrhandle_t *__th); +-static td_err_e (*td_ta_map_lwp2thr_p) (const td_thragent_t *ta, +- lwpid_t lwpid, td_thrhandle_t *th); +-static td_err_e (*td_ta_thr_iter_p) (const td_thragent_t *ta, +- td_thr_iter_f *callback, void *cbdata_p, +- td_thr_state_e state, int ti_pri, +- sigset_t *ti_sigmask_p, +- unsigned int ti_user_flags); +-static td_err_e (*td_ta_event_addr_p) (const td_thragent_t *ta, +- td_event_e event, td_notify_t *ptr); +-static td_err_e (*td_ta_set_event_p) (const td_thragent_t *ta, +- td_thr_events_t *event); +-static td_err_e (*td_ta_event_getmsg_p) (const td_thragent_t *ta, +- td_event_msg_t *msg); +- +-static td_err_e (*td_thr_validate_p) (const td_thrhandle_t *th); +-static td_err_e (*td_thr_get_info_p) (const td_thrhandle_t *th, +- td_thrinfo_t *infop); +-static td_err_e (*td_thr_getfpregs_p) (const td_thrhandle_t *th, +- gdb_prfpregset_t *regset); +-static td_err_e (*td_thr_getgregs_p) (const td_thrhandle_t *th, +- prgregset_t gregs); +-static td_err_e (*td_thr_setfpregs_p) (const td_thrhandle_t *th, +- const gdb_prfpregset_t *fpregs); +-static td_err_e (*td_thr_setgregs_p) (const td_thrhandle_t *th, +- prgregset_t gregs); +-static td_err_e (*td_thr_event_enable_p) (const td_thrhandle_t *th, +- int event); +- +-static td_err_e (*td_thr_tls_get_addr_p) (const td_thrhandle_t *th, +- void *map_address, +- size_t offset, void **address); ++ td_err_e (*td_ta_new_p) (struct ps_prochandle * ps, ++ td_thragent_t **ta); ++ td_err_e (*td_ta_map_id2thr_p) (const td_thragent_t *ta, thread_t pt, ++ td_thrhandle_t *__th); ++ td_err_e (*td_ta_map_lwp2thr_p) (const td_thragent_t *ta, ++ lwpid_t lwpid, td_thrhandle_t *th); ++ ++ td_err_e (*td_ta_thr_iter_p) (const td_thragent_t *ta, ++ td_thr_iter_f *callback, void *cbdata_p, ++ td_thr_state_e state, int ti_pri, ++ sigset_t *ti_sigmask_p, ++ unsigned int ti_user_flags); ++ td_err_e (*td_ta_event_addr_p) (const td_thragent_t *ta, ++ td_event_e event, td_notify_t *ptr); ++ td_err_e (*td_ta_set_event_p) (const td_thragent_t *ta, ++ td_thr_events_t *event); ++ td_err_e (*td_ta_event_getmsg_p) (const td_thragent_t *ta, ++ td_event_msg_t *msg); ++ ++ td_err_e (*td_thr_validate_p) (const td_thrhandle_t *th); ++ td_err_e (*td_thr_get_info_p) (const td_thrhandle_t *th, ++ td_thrinfo_t *infop); ++ td_err_e (*td_thr_getfpregs_p) (const td_thrhandle_t *th, ++ gdb_prfpregset_t *regset); ++ td_err_e (*td_thr_getgregs_p) (const td_thrhandle_t *th, ++ prgregset_t gregs); ++ td_err_e (*td_thr_setfpregs_p) (const td_thrhandle_t *th, ++ const gdb_prfpregset_t *fpregs); ++ td_err_e (*td_thr_setgregs_p) (const td_thrhandle_t *th, ++ prgregset_t gregs); ++ td_err_e (*td_thr_event_enable_p) (const td_thrhandle_t *th, ++ int event); ++ ++ td_err_e (*td_thr_tls_get_addr_p) (const td_thrhandle_t *th, ++ void *map_address, ++ size_t offset, void **address); ++ ++ struct thread_db_pointers *next; ++}; + + /* Location of the thread creation event breakpoint. The code at this + location in the child process will be called by the pthread library + whenever a new thread is created. By setting a special breakpoint + at this location, GDB can detect when a new thread is created. We + obtain this location via the td_ta_event_addr call. */ +-static CORE_ADDR td_create_bp_addr; ++CORE_ADDR td_create_bp_addr; + + /* Location of the thread death event breakpoint. */ +-static CORE_ADDR td_death_bp_addr; ++CORE_ADDR td_death_bp_addr; ++ ++static struct thread_db_pointers *current_pointers, *all_pointers; + + /* Prototypes for local functions. */ + static void thread_db_find_new_threads (void); +@@ -264,7 +274,7 @@ thread_get_info_callback (const td_thrha + struct thread_info *thread_info; + ptid_t thread_ptid; + +- err = td_thr_get_info_p (thp, &ti); ++ err = current_pointers->td_thr_get_info_p (thp, &ti); + if (err != TD_OK) + error (_("thread_get_info_callback: cannot get thread info: %s"), + thread_db_err_str (err)); +@@ -318,8 +328,9 @@ thread_db_map_id2thr (struct thread_info + if (thread_info->private->th_valid) + return; + +- err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (thread_info->ptid), +- &thread_info->private->th); ++ err = current_pointers->td_ta_map_id2thr_p (thread_agent, ++ GET_THREAD (thread_info->ptid), ++ &thread_info->private->th); + if (err != TD_OK) + { + if (fatal) +@@ -342,8 +353,8 @@ thread_db_get_info (struct thread_info * + if (!thread_info->private->th_valid) + thread_db_map_id2thr (thread_info, 1); + +- err = +- td_thr_get_info_p (&thread_info->private->th, &thread_info->private->ti); ++ err = current_pointers->td_thr_get_info_p (&thread_info->private->th, ++ &thread_info->private->ti); + if (err != TD_OK) + error (_("thread_db_get_info: cannot get thread info: %s"), + thread_db_err_str (err)); +@@ -367,7 +378,8 @@ thread_from_lwp (ptid_t ptid) + + gdb_assert (is_lwp (ptid)); + +- err = td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), &th); ++ err = current_pointers->td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), ++ &th); + if (err != TD_OK) + error (_("Cannot find user-level thread for LWP %ld: %s"), + GET_LWP (ptid), thread_db_err_str (err)); +@@ -414,85 +426,102 @@ verbose_dlsym (void *handle, const char + return sym; + } + +-static int +-thread_db_load (void) ++static struct thread_db_pointers * ++thread_db_load (const char *name) + { ++ struct thread_db_pointers *ptrs; ++ Dl_info info; + void *handle; + td_err_e err; + +- handle = dlopen (LIBTHREAD_DB_SO, RTLD_NOW); ++ ptrs = xcalloc (1, sizeof (struct thread_db_pointers)); ++ ++ handle = dlopen (name, RTLD_NOW); + if (handle == NULL) + { +- fprintf_filtered (gdb_stderr, "\n\ndlopen failed on '%s' - %s\n", +- LIBTHREAD_DB_SO, dlerror ()); +- fprintf_filtered (gdb_stderr, +- "GDB will not be able to debug pthreads.\n\n"); ++ if (all_pointers == NULL) ++ { ++ fprintf_filtered (gdb_stderr, "\n\ndlopen failed on '%s' - %s\n", ++ name, dlerror ()); ++ fprintf_filtered (gdb_stderr, ++ "GDB will not be able to debug pthreads.\n\n"); ++ } + return 0; + } + + /* Initialize pointers to the dynamic library functions we will use. + Essential functions first. */ + +- td_init_p = verbose_dlsym (handle, "td_init"); +- if (td_init_p == NULL) ++ ptrs->td_init_p = verbose_dlsym (handle, "td_init"); ++ if (ptrs->td_init_p == NULL) + return 0; + +- td_ta_new_p = verbose_dlsym (handle, "td_ta_new"); +- if (td_ta_new_p == NULL) ++ ptrs->td_ta_new_p = verbose_dlsym (handle, "td_ta_new"); ++ if (ptrs->td_ta_new_p == NULL) + return 0; + +- td_ta_map_id2thr_p = verbose_dlsym (handle, "td_ta_map_id2thr"); +- if (td_ta_map_id2thr_p == NULL) ++ ptrs->td_ta_map_id2thr_p = verbose_dlsym (handle, "td_ta_map_id2thr"); ++ if (ptrs->td_ta_map_id2thr_p == NULL) + return 0; + +- td_ta_map_lwp2thr_p = verbose_dlsym (handle, "td_ta_map_lwp2thr"); +- if (td_ta_map_lwp2thr_p == NULL) ++ ptrs->td_ta_map_lwp2thr_p = verbose_dlsym (handle, "td_ta_map_lwp2thr"); ++ if (ptrs->td_ta_map_lwp2thr_p == NULL) + return 0; + +- td_ta_thr_iter_p = verbose_dlsym (handle, "td_ta_thr_iter"); +- if (td_ta_thr_iter_p == NULL) ++ ptrs->td_ta_thr_iter_p = verbose_dlsym (handle, "td_ta_thr_iter"); ++ if (ptrs->td_ta_thr_iter_p == NULL) + return 0; + +- td_thr_validate_p = verbose_dlsym (handle, "td_thr_validate"); +- if (td_thr_validate_p == NULL) ++ ptrs->td_thr_validate_p = verbose_dlsym (handle, "td_thr_validate"); ++ if (ptrs->td_thr_validate_p == NULL) + return 0; + +- td_thr_get_info_p = verbose_dlsym (handle, "td_thr_get_info"); +- if (td_thr_get_info_p == NULL) ++ ptrs->td_thr_get_info_p = verbose_dlsym (handle, "td_thr_get_info"); ++ if (ptrs->td_thr_get_info_p == NULL) + return 0; + +- td_thr_getfpregs_p = verbose_dlsym (handle, "td_thr_getfpregs"); +- if (td_thr_getfpregs_p == NULL) ++ ptrs->td_thr_getfpregs_p = verbose_dlsym (handle, "td_thr_getfpregs"); ++ if (ptrs->td_thr_getfpregs_p == NULL) + return 0; + +- td_thr_getgregs_p = verbose_dlsym (handle, "td_thr_getgregs"); +- if (td_thr_getgregs_p == NULL) ++ ptrs->td_thr_getgregs_p = verbose_dlsym (handle, "td_thr_getgregs"); ++ if (ptrs->td_thr_getgregs_p == NULL) + return 0; + +- td_thr_setfpregs_p = verbose_dlsym (handle, "td_thr_setfpregs"); +- if (td_thr_setfpregs_p == NULL) ++ ptrs->td_thr_setfpregs_p = verbose_dlsym (handle, "td_thr_setfpregs"); ++ if (ptrs->td_thr_setfpregs_p == NULL) + return 0; + +- td_thr_setgregs_p = verbose_dlsym (handle, "td_thr_setgregs"); +- if (td_thr_setgregs_p == NULL) ++ ptrs->td_thr_setgregs_p = verbose_dlsym (handle, "td_thr_setgregs"); ++ if (ptrs->td_thr_setgregs_p == NULL) + return 0; + + /* Initialize the library. */ +- err = td_init_p (); ++ err = ptrs->td_init_p (); + if (err != TD_OK) + { + warning (_("Cannot initialize libthread_db: %s"), thread_db_err_str (err)); ++ xfree (ptrs); + return 0; + } + + /* These are not essential. */ +- td_ta_event_addr_p = dlsym (handle, "td_ta_event_addr"); +- td_ta_set_event_p = dlsym (handle, "td_ta_set_event"); +- td_ta_event_getmsg_p = dlsym (handle, "td_ta_event_getmsg"); +- td_thr_event_enable_p = dlsym (handle, "td_thr_event_enable"); +- td_thr_tls_get_addr_p = dlsym (handle, "td_thr_tls_get_addr"); ++ ptrs->td_ta_event_addr_p = dlsym (handle, "td_ta_event_addr"); ++ ptrs->td_ta_set_event_p = dlsym (handle, "td_ta_set_event"); ++ ptrs->td_ta_event_getmsg_p = dlsym (handle, "td_ta_event_getmsg"); ++ ptrs->td_thr_event_enable_p = dlsym (handle, "td_thr_event_enable"); ++ ptrs->td_thr_tls_get_addr_p = dlsym (handle, "td_thr_tls_get_addr"); ++ ++ if (dladdr (ptrs->td_ta_new_p, &info) != 0) ++ ptrs->filename = info.dli_fname; ++ ++ /* Try dlinfo? */ ++ ++ if (ptrs->filename == NULL) ++ /* Paranoid - don't let a NULL path slip through. */ ++ ptrs->filename = name; + +- return 1; ++ return ptrs; + } + + static td_err_e +@@ -502,7 +531,7 @@ enable_thread_event (td_thragent_t *thre + td_err_e err; + + /* Get the breakpoint address for thread EVENT. */ +- err = td_ta_event_addr_p (thread_agent, event, ¬ify); ++ err = current_pointers->td_ta_event_addr_p (thread_agent, event, ¬ify); + if (err != TD_OK) + return err; + +@@ -533,8 +562,10 @@ enable_thread_event_reporting (void) + + /* We cannot use the thread event reporting facility if these + functions aren't available. */ +- if (td_ta_event_addr_p == NULL || td_ta_set_event_p == NULL +- || td_ta_event_getmsg_p == NULL || td_thr_event_enable_p == NULL) ++ if (current_pointers->td_ta_event_addr_p == NULL ++ || current_pointers->td_ta_set_event_p == NULL ++ || current_pointers->td_ta_event_getmsg_p == NULL ++ || current_pointers->td_thr_event_enable_p == NULL) + return; + + /* Set the process wide mask saying which events we're interested in. */ +@@ -551,7 +582,7 @@ enable_thread_event_reporting (void) + #endif + td_event_addset (&events, TD_DEATH); + +- err = td_ta_set_event_p (thread_agent, &events); ++ err = current_pointers->td_ta_set_event_p (thread_agent, &events); + if (err != TD_OK) + { + warning (_("Unable to set global thread event mask: %s"), +@@ -591,7 +622,7 @@ disable_thread_event_reporting (void) + /* Set the process wide mask saying we aren't interested in any + events anymore. */ + td_event_emptyset (&events); +- td_ta_set_event_p (thread_agent, &events); ++ current_pointers->td_ta_set_event_p (thread_agent, &events); + + /* Delete thread event breakpoints, if any. */ + remove_thread_event_breakpoints (); +@@ -634,7 +665,6 @@ check_thread_signals (void) + static void + check_for_thread_db (void) + { +- td_err_e err; + static int already_loaded; + + /* First time through, report that libthread_db was successfuly +@@ -643,19 +673,8 @@ check_for_thread_db (void) + + if (!already_loaded) + { +- Dl_info info; +- const char *library = NULL; +- if (dladdr ((*td_ta_new_p), &info) != 0) +- library = info.dli_fname; +- +- /* Try dlinfo? */ +- +- if (library == NULL) +- /* Paranoid - don't let a NULL path slip through. */ +- library = LIBTHREAD_DB_SO; +- + printf_unfiltered (_("Using host libthread_db library \"%s\".\n"), +- library); ++ all_pointers->filename); + already_loaded = 1; + } + +@@ -673,28 +692,34 @@ check_for_thread_db (void) + proc_handle.pid = GET_PID (inferior_ptid); + + /* Now attempt to open a connection to the thread library. */ +- err = td_ta_new_p (&proc_handle, &thread_agent); +- switch (err) ++ for (current_pointers = all_pointers; ++ current_pointers != NULL; ++ current_pointers = current_pointers->next) + { +- case TD_NOLIBTHREAD: +- /* No thread library was detected. */ +- break; +- +- case TD_OK: +- printf_unfiltered (_("[Thread debugging using libthread_db enabled]\n")); ++ td_err_e err; ++ err = current_pointers->td_ta_new_p (&proc_handle, &thread_agent); ++ switch (err) ++ { ++ case TD_NOLIBTHREAD: ++ /* No thread library was detected. */ ++ break; + +- /* The thread library was detected. Activate the thread_db target. */ +- push_target (&thread_db_ops); +- using_thread_db = 1; ++ case TD_OK: ++ printf_unfiltered (_("[Thread debugging using libthread_db enabled]\n")); + +- enable_thread_event_reporting (); +- thread_db_find_new_threads (); +- break; ++ /* The thread library was detected. Activate the thread_db target. */ ++ push_target (&thread_db_ops); ++ using_thread_db = 1; ++ ++ enable_thread_event_reporting (); ++ thread_db_find_new_threads (); ++ return; + +- default: +- warning (_("Cannot initialize thread debugging library: %s"), +- thread_db_err_str (err)); +- break; ++ default: ++ warning (_("Cannot initialize thread debugging library: %s"), ++ thread_db_err_str (err)); ++ break; ++ } + } + } + +@@ -765,7 +790,7 @@ attach_thread (ptid_t ptid, const td_thr + #endif + + /* Enable thread event reporting for this thread. */ +- err = td_thr_event_enable_p (th_p, 1); ++ err = current_pointers->td_thr_event_enable_p (th_p, 1); + if (err != TD_OK) + error (_("Cannot enable thread event reporting for %s: %s"), + target_pid_to_str (ptid), thread_db_err_str (err)); +@@ -891,7 +916,7 @@ check_event (ptid_t ptid) + + do + { +- err = td_ta_event_getmsg_p (thread_agent, &msg); ++ err = current_pointers->td_ta_event_getmsg_p (thread_agent, &msg); + if (err != TD_OK) + { + if (err == TD_NOMSG) +@@ -901,7 +926,7 @@ check_event (ptid_t ptid) + thread_db_err_str (err)); + } + +- err = td_thr_get_info_p (msg.th_p, &ti); ++ err = current_pointers->td_thr_get_info_p (msg.th_p, &ti); + if (err != TD_OK) + error (_("Cannot get thread info: %s"), thread_db_err_str (err)); + +@@ -1014,12 +1039,14 @@ thread_db_fetch_registers (int regno) + thread_info = find_thread_pid (inferior_ptid); + thread_db_map_id2thr (thread_info, 1); + +- err = td_thr_getgregs_p (&thread_info->private->th, gregset); ++ err = current_pointers->td_thr_getgregs_p (&thread_info->private->th, ++ gregset); + if (err != TD_OK) + error (_("Cannot fetch general-purpose registers for thread %ld: %s"), + (long) GET_THREAD (inferior_ptid), thread_db_err_str (err)); + +- err = td_thr_getfpregs_p (&thread_info->private->th, &fpregset); ++ err = current_pointers->td_thr_getfpregs_p (&thread_info->private->th, ++ &fpregset); + if (err != TD_OK) + error (_("Cannot get floating-point registers for thread %ld: %s"), + (long) GET_THREAD (inferior_ptid), thread_db_err_str (err)); +@@ -1061,11 +1088,13 @@ thread_db_store_registers (int regno) + fill_gregset ((gdb_gregset_t *) gregset, -1); + fill_fpregset (&fpregset, -1); + +- err = td_thr_setgregs_p (&thread_info->private->th, gregset); ++ err = current_pointers->td_thr_setgregs_p (&thread_info->private->th, ++ gregset); + if (err != TD_OK) + error (_("Cannot store general-purpose registers for thread %ld: %s"), + (long) GET_THREAD (inferior_ptid), thread_db_err_str (err)); +- err = td_thr_setfpregs_p (&thread_info->private->th, &fpregset); ++ err = current_pointers->td_thr_setfpregs_p (&thread_info->private->th, ++ &fpregset); + if (err != TD_OK) + error (_("Cannot store floating-point registers for thread %ld: %s"), + (long) GET_THREAD (inferior_ptid), thread_db_err_str (err)); +@@ -1135,15 +1164,14 @@ thread_db_thread_alive (ptid_t ptid) + if (!thread_info->private->th_valid) + return 0; + +- err = td_thr_validate_p (&thread_info->private->th); ++ err = current_pointers->td_thr_validate_p (&thread_info->private->th); + if (err != TD_OK) + return 0; + + if (!thread_info->private->ti_valid) + { +- err = +- td_thr_get_info_p (&thread_info->private->th, +- &thread_info->private->ti); ++ err = current_pointers->td_thr_get_info_p ++ (&thread_info->private->th, &thread_info->private->ti); + if (err != TD_OK) + return 0; + thread_info->private->ti_valid = 1; +@@ -1169,7 +1197,7 @@ find_new_threads_callback (const td_thrh + td_err_e err; + ptid_t ptid; + +- err = td_thr_get_info_p (th_p, &ti); ++ err = current_pointers->td_thr_get_info_p (th_p, &ti); + if (err != TD_OK) + error (_("find_new_threads_callback: cannot get thread info: %s"), + thread_db_err_str (err)); +@@ -1191,9 +1219,10 @@ thread_db_find_new_threads (void) + td_err_e err; + + /* Iterate over all user-space threads to discover new threads. */ +- err = td_ta_thr_iter_p (thread_agent, find_new_threads_callback, NULL, +- TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY, +- TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS); ++ err = current_pointers->td_ta_thr_iter_p ++ (thread_agent, find_new_threads_callback, NULL, ++ TD_THR_ANY_STATE, TD_THR_LOWEST_PRIORITY, ++ TD_SIGNO_MASK, TD_THR_ANY_USER_FLAGS); + if (err != TD_OK) + error (_("Cannot find new threads: %s"), thread_db_err_str (err)); + } +@@ -1255,7 +1284,7 @@ thread_db_get_thread_local_address (ptid + struct thread_info *thread_info; + + /* glibc doesn't provide the needed interface. */ +- if (!td_thr_tls_get_addr_p) ++ if (!current_pointers->td_thr_tls_get_addr_p) + throw_error (TLS_NO_LIBRARY_SUPPORT_ERROR, + _("No TLS library support")); + +@@ -1267,8 +1296,8 @@ thread_db_get_thread_local_address (ptid + thread_db_map_id2thr (thread_info, 1); + + /* Finally, get the address of the variable. */ +- err = td_thr_tls_get_addr_p (&thread_info->private->th, (void *) lm, +- offset, &address); ++ err = current_pointers->td_thr_tls_get_addr_p ++ (&thread_info->private->th, (void *) lm, offset, &address); + + #ifdef THREAD_DB_HAS_TD_NOTALLOC + /* The memory hasn't been allocated, yet. */ +@@ -1330,17 +1359,49 @@ init_thread_db_ops (void) + void + _initialize_thread_db (void) + { ++ struct thread_db_pointers *ptrs; ++ const char *p; ++ + /* Only initialize the module if we can load libthread_db. */ +- if (thread_db_load ()) +- { +- init_thread_db_ops (); +- add_target (&thread_db_ops); ++ ptrs = thread_db_load (LIBTHREAD_DB_SO); ++ if (ptrs == NULL) ++ return; ++ ++ all_pointers = ptrs; + +- /* Add ourselves to objfile event chain. */ +- target_new_objfile_chain = deprecated_target_new_objfile_hook; +- deprecated_target_new_objfile_hook = thread_db_new_objfile; ++ /* Some GNU/Linux systems have more than one binary-compatible copy ++ of libthread_db. If we can find a second one, load that too. ++ The inferior may force the use of a different threading package ++ than we expect. Our guess for the location is somewhat hokey: ++ strip out anything between /lib (or /lib64) and LIBTHREAD_DB_SO. ++ If we loaded the NPTL libthread_db by default, this may find us ++ the LinuxThreads copy. */ ++ p = strrchr (ptrs->filename, '/'); ++ while (p != NULL && p > ptrs->filename) ++ { ++ const char *component; + +- /* Register ourselves for the new inferior observer. */ +- observer_attach_inferior_created (check_for_thread_db_observer); ++ component = memrchr (ptrs->filename, '/', p - ptrs->filename); ++ if (component != NULL && strncmp (component, "/lib", 4) == 0) ++ { ++ char *new_name = xmalloc (p - ptrs->filename + 2 ++ + strlen (LIBTHREAD_DB_SO)); ++ memcpy (new_name, ptrs->filename, p - ptrs->filename + 1); ++ strcpy (new_name + (p - ptrs->filename) + 1, LIBTHREAD_DB_SO); ++ ptrs->next = thread_db_load (new_name); ++ xfree (new_name); ++ break; ++ } ++ p = component; + } ++ ++ init_thread_db_ops (); ++ add_target (&thread_db_ops); ++ ++ /* Add ourselves to objfile event chain. */ ++ target_new_objfile_chain = deprecated_target_new_objfile_hook; ++ deprecated_target_new_objfile_hook = thread_db_new_objfile; ++ ++ /* Register ourselves for the new inferior observer. */ ++ observer_attach_inferior_created (check_for_thread_db_observer); + } --- gdb-6.4.orig/debian/patches/gdb-nptl-cancellation.patch +++ gdb-6.4/debian/patches/gdb-nptl-cancellation.patch @@ -0,0 +1,31 @@ +2005-12-07 Daniel Jacobowitz + + * linux-nat.c (lin_thread_get_thread_signals): Default to __SIGRTMIN + and __SIGRTMIN + 1. + +Index: gdb-6.4/gdb/linux-nat.c +=================================================================== +--- gdb-6.4.orig/gdb/linux-nat.c 2005-11-03 14:51:40.000000000 -0500 ++++ gdb-6.4/gdb/linux-nat.c 2005-12-07 21:44:12.000000000 -0500 +@@ -3284,12 +3284,18 @@ lin_thread_get_thread_signals (sigset_t + sigemptyset (set); + + restart = get_signo ("__pthread_sig_restart"); ++ cancel = get_signo ("__pthread_sig_cancel"); ++ ++ /* LinuxThreads normally uses the first two RT signals, but in some legacy ++ cases may use SIGUSR1/SIGUSR2. NPTL always uses RT signals, but does ++ not provide any way for the debugger to query the signal numbers - ++ fortunately they don't change! */ ++ + if (restart == 0) +- return; ++ restart = __SIGRTMIN; + +- cancel = get_signo ("__pthread_sig_cancel"); + if (cancel == 0) +- return; ++ cancel = __SIGRTMIN + 1; + + sigaddset (set, restart); + sigaddset (set, cancel); --- gdb-6.4.orig/debian/patches/pending-breakpoints-and-sigttou.patch +++ gdb-6.4/debian/patches/pending-breakpoints-and-sigttou.patch @@ -0,0 +1,21 @@ +Don't generate SIGTTOU when resolving a pending breakpoint. + +Index: gdb-6.3.90.20051119/gdb/infrun.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/infrun.c 2005-11-19 22:56:43.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/infrun.c 2005-11-20 00:19:55.000000000 -0500 +@@ -2171,12 +2171,13 @@ process_event_stop_test: + #else + solib_add (NULL, 0, ¤t_target, auto_solib_add); + #endif +- target_terminal_inferior (); + + /* Try to reenable shared library breakpoints, additional + code segments in shared libraries might be mapped in now. */ + re_enable_breakpoints_in_shlibs (); + ++ target_terminal_inferior (); ++ + /* If requested, stop when the dynamic linker notifies + gdb of events. This allows the user to get control + and place breakpoints in initializer routines for --- gdb-6.4.orig/debian/patches/cp-pass-by-reference.patch +++ gdb-6.4/debian/patches/cp-pass-by-reference.patch @@ -0,0 +1,426 @@ +This patch needs to be submitted for the FSF. Also, there may be testcases +already in the GDB testsuite (currently disabled) that it would probably fix. + +2005-11-20 + +Patch updated, but still not submitted. + +Index: gdb-6.3.90.20051119/gdb/infcall.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/infcall.c 2005-11-20 11:39:20.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/infcall.c 2005-11-20 12:42:22.000000000 -0500 +@@ -36,6 +36,7 @@ + #include "gdb_string.h" + #include "infcall.h" + #include "dummy-frame.h" ++#include "cp-abi.h" + + /* NOTE: cagney/2003-04-16: What's the future of this code? + +@@ -314,8 +315,8 @@ call_function_by_hand (struct value *fun + { + CORE_ADDR sp; + CORE_ADDR dummy_addr; +- struct type *values_type; +- unsigned char struct_return; ++ struct type *values_type, *target_values_type; ++ unsigned char struct_return = 0, cp_struct_return = 0; + CORE_ADDR struct_addr = 0; + struct regcache *retbuf; + struct cleanup *retbuf_cleanup; +@@ -329,6 +330,7 @@ call_function_by_hand (struct value *fun + struct regcache *caller_regcache; + struct cleanup *caller_regcache_cleanup; + struct frame_id dummy_id; ++ struct cleanup *args_cleanup; + + if (!target_has_execution) + noprocess (); +@@ -430,10 +432,31 @@ call_function_by_hand (struct value *fun + using_gcc = (b == NULL ? 2 : BLOCK_GCC_COMPILED (b)); + } + +- /* Are we returning a value using a structure return or a normal +- value return? */ ++ /* Are we returning a value using a structure return (passing a ++ hidden argument pointing to storage) or a normal value return? ++ There are two cases: C++ ABI mandated structure return and ++ target ABI structure return. The variable STRUCT_RETURN only ++ describes the latter. The C++ version is handled by passing ++ the return location as the first parameter to the function, ++ even preceding "this". This is different from the target ++ ABI version, which is target-specific; for instance, on ia64 ++ the first argument is passed in out0 but the hidden structure ++ return pointer would normally be passed in r8. */ + +- struct_return = using_struct_return (values_type, using_gcc); ++ if (current_language->la_language == language_cplus ++ && cp_pass_by_reference (values_type)) ++ { ++ cp_struct_return = 1; ++ ++ /* Tell the target specific argument pushing routine not to ++ expect a value. */ ++ target_values_type = builtin_type_void; ++ } ++ else ++ { ++ struct_return = using_struct_return (values_type, using_gcc); ++ target_values_type = values_type; ++ } + + /* Determine the location of the breakpoint (and possibly other + stuff) that the called function will return to. The SPARC, for a +@@ -452,7 +475,7 @@ call_function_by_hand (struct value *fun + if (INNER_THAN (1, 2)) + { + sp = push_dummy_code (current_gdbarch, sp, funaddr, +- using_gcc, args, nargs, values_type, ++ using_gcc, args, nargs, target_values_type, + &real_pc, &bp_addr); + dummy_addr = sp; + } +@@ -460,7 +483,7 @@ call_function_by_hand (struct value *fun + { + dummy_addr = sp; + sp = push_dummy_code (current_gdbarch, sp, funaddr, +- using_gcc, args, nargs, values_type, ++ using_gcc, args, nargs, target_values_type, + &real_pc, &bp_addr); + } + break; +@@ -527,9 +550,15 @@ call_function_by_hand (struct value *fun + param_type = TYPE_FIELD_TYPE (ftype, i); + else + param_type = NULL; +- ++ + args[i] = value_arg_coerce (args[i], param_type, prototyped); + ++ /* FIXME: Is current_language the right language? */ ++ if (current_language->la_language == language_cplus ++ && param_type != NULL ++ && cp_pass_by_reference (param_type)) ++ args[i] = value_addr (args[i]); ++ + /* elz: this code is to handle the case in which the function + to be called has a pointer to function as parameter and the + corresponding actual argument is the address of a function +@@ -628,7 +657,7 @@ You must use a pointer to function type + stack, if necessary. Make certain that the value is correctly + aligned. */ + +- if (struct_return) ++ if (struct_return || cp_struct_return) + { + int len = TYPE_LENGTH (values_type); + if (INNER_THAN (1, 2)) +@@ -653,6 +682,22 @@ You must use a pointer to function type + } + } + ++ if (cp_struct_return) ++ { ++ struct value **new_args; ++ ++ /* Add the new argument to the front of the argument list. */ ++ new_args = xmalloc (sizeof (struct value *) * (nargs + 1)); ++ new_args[0] = value_from_pointer (lookup_pointer_type (values_type), ++ struct_addr); ++ memcpy (&new_args[1], &args[0], sizeof (struct value *) * nargs); ++ args = new_args; ++ nargs++; ++ args_cleanup = make_cleanup (xfree, args); ++ } ++ else ++ args_cleanup = make_cleanup (null_cleanup, NULL); ++ + /* Create the dummy stack frame. Pass in the call dummy address as, + presumably, the ABI code knows where, in the call dummy, the + return address should be pointed. */ +@@ -660,6 +705,8 @@ You must use a pointer to function type + bp_addr, nargs, args, sp, struct_return, + struct_addr); + ++ do_cleanups (args_cleanup); ++ + /* Set up a frame ID for the dummy frame so we can pass it to + set_momentary_breakpoint. We need to give the breakpoint a frame + ID so that the breakpoint code can correctly re-identify the +@@ -851,7 +898,9 @@ the function call)."), name); + { + struct value *retval = NULL; + +- if (TYPE_CODE (values_type) == TYPE_CODE_VOID) ++ if (cp_struct_return) ++ retval = value_at (values_type, struct_addr); ++ else if (TYPE_CODE (target_values_type) == TYPE_CODE_VOID) + { + /* If the function returns void, don't bother fetching the + return value. */ +@@ -861,7 +910,7 @@ the function call)."), name); + { + struct gdbarch *arch = current_gdbarch; + +- switch (gdbarch_return_value (arch, values_type, NULL, NULL, NULL)) ++ switch (gdbarch_return_value (arch, target_values_type, NULL, NULL, NULL)) + { + case RETURN_VALUE_REGISTER_CONVENTION: + case RETURN_VALUE_ABI_RETURNS_ADDRESS: +Index: gdb-6.3.90.20051119/gdb/cp-abi.h +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/cp-abi.h 2005-11-20 11:39:20.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/cp-abi.h 2005-11-20 11:50:11.000000000 -0500 +@@ -147,6 +147,10 @@ extern struct type *value_rtti_type (str + extern int baseclass_offset (struct type *type, int index, + const bfd_byte *valaddr, CORE_ADDR address); + ++/* Return non-zero if an argument of type TYPE should be passed by reference ++ instead of value. */ ++extern int cp_pass_by_reference (struct type *type); ++ + struct cp_abi_ops + { + const char *shortname; +@@ -164,6 +168,7 @@ struct cp_abi_ops + int *using_enc); + int (*baseclass_offset) (struct type *type, int index, + const bfd_byte *valaddr, CORE_ADDR address); ++ int (*pass_by_reference) (struct type *type); + }; + + +Index: gdb-6.3.90.20051119/gdb/cp-abi.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/cp-abi.c 2005-11-20 11:39:20.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/cp-abi.c 2005-11-20 11:50:11.000000000 -0500 +@@ -95,6 +95,14 @@ value_rtti_type (struct value *v, int *f + return (*current_cp_abi.rtti_type) (v, full, top, using_enc); + } + ++int ++cp_pass_by_reference (struct type *type) ++{ ++ if ((current_cp_abi.pass_by_reference) == NULL) ++ return 0; ++ return (*current_cp_abi.pass_by_reference) (type); ++} ++ + /* Set the current C++ ABI to SHORT_NAME. */ + + static int +Index: gdb-6.3.90.20051119/gdb/gnu-v3-abi.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/gnu-v3-abi.c 2005-11-20 11:39:20.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/gnu-v3-abi.c 2005-11-20 11:50:11.000000000 -0500 +@@ -416,6 +416,84 @@ gnuv3_baseclass_offset (struct type *typ + return base_offset; + } + ++/* Return nonzero if a type should be passed by reference. ++ ++ The rule in the v3 ABI document comes from section 3.1.1. If the ++ type has a non-trivial copy constructor or destructor, then the ++ caller must make a copy (by calling the copy constructor if there ++ is one or perform the copy itself otherwise), pass the address of ++ the copy, and then destroy the temporary (if necessary). ++ ++ For return values with non-trivial copy constructors or ++ destructors, space will be allocated in the caller, and a pointer ++ will be passed as the first argument (preceding "this"). ++ ++ We don't have a bulletproof mechanism for determining whether a ++ constructor or destructor is trivial. For GCC and DWARF2 debug ++ information, we can check the artificial flag. ++ ++ We don't do anything with the constructors or destructors yet, ++ but we have to get the argument passing right anyway. */ ++static int ++gnuv3_pass_by_reference (struct type *type) ++{ ++ int fieldnum, fieldelem, basenum; ++ ++ CHECK_TYPEDEF (type); ++ ++ /* We're only interested in things that can have methods. */ ++ if (TYPE_CODE (type) != TYPE_CODE_STRUCT ++ && TYPE_CODE (type) != TYPE_CODE_CLASS ++ && TYPE_CODE (type) != TYPE_CODE_UNION) ++ return 0; ++ ++ for (fieldnum = 0; fieldnum < TYPE_NFN_FIELDS (type); fieldnum++) ++ for (fieldelem = 0; fieldelem < TYPE_FN_FIELDLIST_LENGTH (type, fieldnum); ++ fieldelem++) ++ { ++ struct fn_field *fn = TYPE_FN_FIELDLIST1 (type, fieldnum); ++ char *name = TYPE_FN_FIELDLIST_NAME (type, fieldnum); ++ struct type *fieldtype = TYPE_FN_FIELD_TYPE (fn, fieldelem); ++ ++ /* If this function is marked as artificial, it is compiler-generated, ++ and we assume it is trivial. */ ++ if (TYPE_FN_FIELD_ARTIFICIAL (fn, fieldelem)) ++ continue; ++ ++ /* If we've found a destructor, we must pass this by reference. */ ++ if (name[0] == '~') ++ return 1; ++ ++ /* If the mangled name of this method doesn't indicate that it ++ is a constructor, we're not interested. ++ ++ FIXME drow/2004-05-27: We could do this using the name of ++ the method and the name of the class instead of dealing ++ with the mangled name. We don't have a convenient function ++ to strip off both leading scope qualifiers and trailing ++ template arguments yet. */ ++ if (!is_constructor_name (TYPE_FN_FIELD_PHYSNAME (fn, fieldelem))) ++ continue; ++ ++ /* If this method takes two arguments, and the second argument is ++ a reference to this class, then it is a copy constructor. */ ++ if (TYPE_NFIELDS (fieldtype) == 2 ++ && TYPE_CODE (TYPE_FIELD_TYPE (fieldtype, 1)) == TYPE_CODE_REF ++ && check_typedef (TYPE_TARGET_TYPE (TYPE_FIELD_TYPE (fieldtype, 1))) == type) ++ return 1; ++ } ++ ++ /* Even if all the constructors and destructors were artificial, one ++ of them may have invoked a non-artificial constructor or ++ destructor in a base class. If any base class needs to be passed ++ by reference, so does this class. */ ++ for (basenum = 0; basenum < TYPE_N_BASECLASSES (type); basenum++) ++ if (gnuv3_pass_by_reference (TYPE_BASECLASS (type, basenum))) ++ return 1; ++ ++ return 0; ++} ++ + static void + init_gnuv3_ops (void) + { +@@ -433,6 +511,7 @@ init_gnuv3_ops (void) + gnu_v3_abi_ops.rtti_type = gnuv3_rtti_type; + gnu_v3_abi_ops.virtual_fn_field = gnuv3_virtual_fn_field; + gnu_v3_abi_ops.baseclass_offset = gnuv3_baseclass_offset; ++ gnu_v3_abi_ops.pass_by_reference = gnuv3_pass_by_reference; + } + + extern initialize_file_ftype _initialize_gnu_v3_abi; /* -Wmissing-prototypes */ +Index: gdb-6.3.90.20051119/gdb/Makefile.in +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/Makefile.in 2005-11-20 11:50:11.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/Makefile.in 2005-11-20 12:41:06.000000000 -0500 +@@ -2114,7 +2114,7 @@ ia64-tdep.o: ia64-tdep.c $(defs_h) $(inf + infcall.o: infcall.c $(defs_h) $(breakpoint_h) $(target_h) $(regcache_h) \ + $(inferior_h) $(gdb_assert_h) $(block_h) $(gdbcore_h) $(language_h) \ + $(objfiles_h) $(gdbcmd_h) $(command_h) $(gdb_string_h) $(infcall_h) \ +- $(dummy_frame_h) ++ $(dummy_frame_h) $(cp_abi_h) + inf-child.o: inf-child.c $(defs_h) $(regcache_h) $(memattr_h) $(symtab_h) \ + $(target_h) $(inferior_h) $(gdb_string_h) + infcmd.o: infcmd.c $(defs_h) $(gdb_string_h) $(symtab_h) $(gdbtypes_h) \ +Index: gdb-6.3.90.20051119/gdb/testsuite/gdb.cp/pass-by-ref.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.3.90.20051119/gdb/testsuite/gdb.cp/pass-by-ref.exp 2005-11-20 12:29:39.000000000 -0500 +@@ -0,0 +1,38 @@ ++# This testcase is part of GDB, the GNU debugger. ++ ++# Copyright 2004 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. ++ ++# Check that GDB can call C++ functions whose parameters have ++# object type, but are passed by reference. ++ ++set testfile "pass-by-ref" ++set srcfile ${testfile}.cc ++set binfile ${objdir}/${subdir}/${testfile} ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug c++}] != "" } { ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++if ![runto_main] then { ++ return -1 ++} ++ ++gdb_test "print foo (global_obj)" " = 3" "call function" +Index: gdb-6.3.90.20051119/gdb/testsuite/gdb.cp/pass-by-ref.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.3.90.20051119/gdb/testsuite/gdb.cp/pass-by-ref.cc 2005-11-20 11:50:11.000000000 -0500 +@@ -0,0 +1,57 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2004 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. */ ++ ++class Obj { ++public: ++ Obj (); ++ Obj (const Obj &); ++ ~Obj (); ++ int var[2]; ++}; ++ ++int foo (Obj arg) ++{ ++ return arg.var[0] + arg.var[1]; ++} ++ ++Obj::Obj () ++{ ++ var[0] = 1; ++ var[1] = 2; ++} ++ ++Obj::Obj (const Obj &obj) ++{ ++ var[0] = obj.var[0]; ++ var[1] = obj.var[1]; ++} ++ ++Obj::~Obj () ++{ ++ ++} ++ ++Obj global_obj; ++ ++int ++main () ++{ ++ int bar = foo (global_obj); ++ return bar; ++} --- gdb-6.4.orig/debian/patches/gdb-pascal-support.patch +++ gdb-6.4/debian/patches/gdb-pascal-support.patch @@ -0,0 +1,94 @@ +From: + http://www.math.uni.wroc.pl/~hebisch/gpc/ + +I believe this patch was posted to gdb-patches and never reviewed. + +Index: gdb-6.3.90.20051119/gdb/dwarf2read.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/dwarf2read.c 2005-11-20 13:15:44.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/dwarf2read.c 2005-11-20 13:36:49.000000000 -0500 +@@ -911,6 +911,8 @@ static const char *namespace_name (struc + + static void read_enumeration_type (struct die_info *, struct dwarf2_cu *); + ++static void read_set_type (struct die_info *, struct dwarf2_cu *); ++ + static void process_enumeration_scope (struct die_info *, struct dwarf2_cu *); + + static struct type *dwarf_base_type (int, int, struct dwarf2_cu *); +@@ -2648,6 +2650,9 @@ process_die (struct die_info *die, struc + read_enumeration_type (die, cu); + process_enumeration_scope (die, cu); + break; ++ case DW_TAG_set_type: ++ read_set_type (die, cu); ++ break; + + /* FIXME drow/2004-03-14: These initialize die->type, but do not create + a symbol or process any children. Therefore it doesn't do anything +@@ -4031,6 +4036,24 @@ determine_class_name (struct die_info *d + return new_prefix; + } + ++static void ++read_set_type (struct die_info * die, struct dwarf2_cu *cu) ++{ ++ struct type *domain_type; ++ ++ /* Return if we've already decoded this type. */ ++ if (die->type) ++ { ++ return; ++ } ++ ++ domain_type = die_type (die, cu); ++ ++ die->type = create_set_type (NULL, domain_type); ++ ++} ++ ++ + /* Given a pointer to a die which begins an enumeration, process all + the dies that define the members of the enumeration, and create the + symbol for the enumeration type. +@@ -6113,9 +6136,11 @@ set_cu_language (unsigned int lang, stru + case DW_LANG_Ada95: + cu->language = language_ada; + break; ++ case DW_LANG_Pascal83: ++ cu->language = language_pascal; ++ break; + case DW_LANG_Cobol74: + case DW_LANG_Cobol85: +- case DW_LANG_Pascal83: + case DW_LANG_Modula2: + default: + cu->language = language_minimal; +@@ -6904,6 +6929,7 @@ new_symbol (struct die_info *die, struct + case DW_TAG_structure_type: + case DW_TAG_union_type: + case DW_TAG_enumeration_type: ++ case DW_TAG_set_type: + SYMBOL_CLASS (sym) = LOC_TYPEDEF; + SYMBOL_DOMAIN (sym) = STRUCT_DOMAIN; + +@@ -7225,6 +7251,9 @@ read_type_die (struct die_info *die, str + case DW_TAG_enumeration_type: + read_enumeration_type (die, cu); + break; ++ case DW_TAG_set_type: ++ read_set_type (die, cu); ++ break; + case DW_TAG_subprogram: + case DW_TAG_subroutine_type: + read_subroutine_type (die, cu); +@@ -7282,7 +7311,8 @@ determine_prefix (struct die_info *die, + struct die_info *parent; + + if (cu->language != language_cplus +- && cu->language != language_java) ++ && cu->language != language_java ++ && cu->language != language_pascal) + return NULL; + + parent = die->parent; --- gdb-6.4.orig/debian/patches/gdb-powerpc-pic-prologue.patch +++ gdb-6.4/debian/patches/gdb-powerpc-pic-prologue.patch @@ -0,0 +1,34 @@ +2005-12-10 Daniel Jacobowitz + + PR tdep/2029 + Suggested by Till Straumann : + * rs6000-tdep.c (skip_prologue): Update check for later mtlr + instructions. Handle PIC bcl. + +Index: gdb-6.4/gdb/rs6000-tdep.c +=================================================================== +--- gdb-6.4.orig/gdb/rs6000-tdep.c 2005-11-01 14:32:36.000000000 -0500 ++++ gdb-6.4/gdb/rs6000-tdep.c 2005-12-10 00:22:15.000000000 -0500 +@@ -911,7 +911,7 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l + + remember just the first one, but skip over additional + ones. */ +- if (lr_reg < 0) ++ if (lr_reg == -1) + lr_reg = (op & 0x03e00000); + if (lr_reg == 0) + r0_contains_arg = 0; +@@ -1024,6 +1024,13 @@ skip_prologue (CORE_ADDR pc, CORE_ADDR l + continue; + + } ++ else if ((op & 0xfe80ffff) == 0x42800005 && lr_reg != -1) ++ { ++ /* bcl 20,xx,.+4 is used to get the current PC, with or without ++ prediction bits. If the LR has already been saved, we can ++ skip it. */ ++ continue; ++ } + else if (op == 0x48000005) + { /* bl .+4 used in + -mrelocatable */ --- gdb-6.4.orig/debian/patches/static-thread-db.patch +++ gdb-6.4/debian/patches/static-thread-db.patch @@ -0,0 +1,155 @@ +Status: submitted similar patch 2004-12-08 + +This patch cleans up the initialization of thread_db. It works for static +binaries now. The vsyscall patches hide this problem, since new static +binaries will load the vsyscall DSO and then trigger thread_db; but +this is still a good cleanup. + +Index: gdb-6.3.90.20051119/gdb/linux-thread-db.c +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/linux-thread-db.c 2005-10-13 05:31:59.000000000 -0400 ++++ gdb-6.3.90.20051119/gdb/linux-thread-db.c 2005-11-19 15:15:55.000000000 -0500 +@@ -37,6 +37,7 @@ + #include "regcache.h" + #include "solib-svr4.h" + #include "gdbcore.h" ++#include "observer.h" + + #ifdef HAVE_GNU_LIBC_VERSION_H + #include +@@ -626,59 +627,49 @@ check_thread_signals (void) + #endif + } + ++/* Check whether thread_db is usable. This function is called when ++ an inferior is created (or otherwise acquired, e.g. attached to) ++ and when new shared libraries are loaded into a running process. */ ++ + static void +-thread_db_new_objfile (struct objfile *objfile) ++check_for_thread_db (void) + { + td_err_e err; ++ static int already_loaded; + + /* First time through, report that libthread_db was successfuly + loaded. Can't print this in in thread_db_load as, at that stage, +- the interpreter and it's console haven't started. The real +- problem here is that libthread_db is loaded too early - it should +- only be loaded when there is a program to debug. */ +- { +- static int dejavu; +- if (!dejavu) +- { +- Dl_info info; +- const char *library = NULL; +- /* Try dladdr. */ +- if (dladdr ((*td_ta_new_p), &info) != 0) +- library = info.dli_fname; +- /* Try dlinfo? */ +- if (library == NULL) +- /* Paranoid - don't let a NULL path slip through. */ +- library = LIBTHREAD_DB_SO; +- printf_unfiltered (_("Using host libthread_db library \"%s\".\n"), +- library); +- dejavu = 1; +- } +- } ++ the interpreter and it's console haven't started. */ + +- /* Don't attempt to use thread_db on targets which can not run +- (core files). */ +- if (objfile == NULL || !target_has_execution) ++ if (!already_loaded) + { +- /* All symbols have been discarded. If the thread_db target is +- active, deactivate it now. */ +- if (using_thread_db) +- { +- gdb_assert (proc_handle.pid == 0); +- unpush_target (&thread_db_ops); +- using_thread_db = 0; +- } ++ Dl_info info; ++ const char *library = NULL; ++ if (dladdr ((*td_ta_new_p), &info) != 0) ++ library = info.dli_fname; ++ ++ /* Try dlinfo? */ + +- goto quit; ++ if (library == NULL) ++ /* Paranoid - don't let a NULL path slip through. */ ++ library = LIBTHREAD_DB_SO; ++ ++ printf_unfiltered (_("Using host libthread_db library \"%s\".\n"), ++ library); ++ already_loaded = 1; + } + + if (using_thread_db) + /* Nothing to do. The thread library was already detected and the + target vector was already activated. */ +- goto quit; ++ return; ++ ++ /* Don't attempt to use thread_db on targets which can not run ++ (executables not running yet, core files) for now. */ ++ if (!target_has_execution) ++ return; + +- /* Initialize the structure that identifies the child process. Note +- that at this point there is no guarantee that we actually have a +- child process. */ ++ /* Initialize the structure that identifies the child process. */ + proc_handle.pid = GET_PID (inferior_ptid); + + /* Now attempt to open a connection to the thread library. */ +@@ -705,12 +696,24 @@ thread_db_new_objfile (struct objfile *o + thread_db_err_str (err)); + break; + } ++} ++ ++static void ++thread_db_new_objfile (struct objfile *objfile) ++{ ++ if (objfile != NULL) ++ check_for_thread_db (); + +-quit: + if (target_new_objfile_chain) + target_new_objfile_chain (objfile); + } + ++static void ++check_for_thread_db_observer (struct target_ops *target, int from_tty) ++{ ++ check_for_thread_db (); ++} ++ + /* Attach to a new thread. This function is called when we receive a + TD_CREATE event or when we iterate over all threads and find one + that wasn't already in our list. */ +@@ -1336,5 +1339,8 @@ _initialize_thread_db (void) + /* Add ourselves to objfile event chain. */ + target_new_objfile_chain = deprecated_target_new_objfile_hook; + deprecated_target_new_objfile_hook = thread_db_new_objfile; ++ ++ /* Register ourselves for the new inferior observer. */ ++ observer_attach_inferior_created (check_for_thread_db_observer); + } + } +Index: gdb-6.3.90.20051119/gdb/Makefile.in +=================================================================== +--- gdb-6.3.90.20051119.orig/gdb/Makefile.in 2005-11-19 15:11:23.000000000 -0500 ++++ gdb-6.3.90.20051119/gdb/Makefile.in 2005-11-19 15:13:21.000000000 -0500 +@@ -2189,7 +2189,7 @@ linux-nat.o: linux-nat.c $(defs_h) $(inf + linux-thread-db.o: linux-thread-db.c $(defs_h) $(gdb_assert_h) \ + $(gdb_proc_service_h) $(gdb_thread_db_h) $(bfd_h) $(exceptions_h) \ + $(gdbthread_h) $(inferior_h) $(symfile_h) $(objfiles_h) $(target_h) \ +- $(regcache_h) $(solib_svr4_h) $(gdbcore_h) ++ $(regcache_h) $(solib_svr4_h) $(gdbcore_h) $(observer_h) + lynx-nat.o: lynx-nat.c $(defs_h) $(frame_h) $(inferior_h) $(target_h) \ + $(gdbcore_h) $(regcache_h) + m2-exp.o: m2-exp.c $(defs_h) $(gdb_string_h) $(expression_h) $(language_h) \ --- gdb-6.4.orig/debian/gdb.info +++ gdb-6.4/debian/gdb.info @@ -0,0 +1,3 @@ +objdir/gdb/doc/gdb.info* +objdir/gdb/doc/gdbint.info* +objdir/gdb/doc/stabs.info* --- gdb-6.4.orig/debian/README.Debian +++ gdb-6.4/debian/README.Debian @@ -0,0 +1,6 @@ +GDB is a complex program. It comes with an Info manual (`info gdb' or your +favorite other info browser), which serves as a good command reference. + +There are also a number of books and tutorials devoted to GDB. One +particularly useful guide is Peter Jay Salzman's, at: + http://www.dirac.org/linux/gdb/ --- gdb-6.4.orig/debian/changelog +++ gdb-6.4/debian/changelog @@ -0,0 +1,845 @@ +gdb (6.4-1ubuntu1) dapper; urgency=low + + * merged with debian, + * debian/control, debian/rules: Remove type-handling. + + -- Michael Vogt Wed, 28 Dec 2005 11:19:23 +0100 + +gdb (6.4-1) unstable; urgency=low + + * New upstream release. + * Reset core ulimit before running the testsuite (Closes: #342343). + * Ignore cancellation signal for NPTL by default (Closes: #324683). + * Include a description of the front cover texts, et cetera for the + manual in the copyright file (Closes: #321803). + * Set the default name of main to MAIN__ for Fortran programs + (Closes: #319520). + * Handle PowerPC PIC prologues a little better (Closes: #312059). + * Cope with attaching to threaded programs after the exit of a threaded + program (Closes: #303736). + + -- Daniel Jacobowitz Sun, 11 Dec 2005 13:14:04 -0500 + +gdb (6.3.90.20051119-1ubuntu1) dapper; urgency=low + + * debian/control, debian/rules: Remove type-handling. + + -- Martin Pitt Mon, 21 Nov 2005 19:50:49 +0000 + +gdb (6.3.90.20051119-1) unstable; urgency=low + + * New upstream snapshot (6.4 branch prerelease). + - Many Debian patches merged. + - Selected frame and C++ pass-by-reference patches updated. + - Fixes segfault when executing malformed TUI window commands + (Closes: #317317). + - Behaves more gracefully when the executable disappears, et cetera + (Closes: #293637, #323217, #332184). + - Handle vfork from threaded programs using NPTL (Closes: #320391). + * Do not rebuild bfd.info. + * Build depend on a version of debhelper which will put menu fils + in /usr/share. + * Don't build depend on gcj on the Hurd (Closes: #298088). + * Prevent unnecessary SIGTTOU when resolving pending breakpoints + (Closes: #306267). + * Enable the testsuite on amd64. + * Use libreadline5 instead of libreadline4 (Closes: #309538, #326358). + * Install gdb_gcore.sh as gcore (Closes: #328580). + * Add GPC support (Closes: #261330). + + -- Daniel Jacobowitz Sun, 20 Nov 2005 13:40:44 -0500 + +gdb (6.3-6) unstable; urgency=high + + * Do not crash on certain malformed input files [CAN-2005-1704] + (Closes: #308624, #310972). + * Do not load untrusted .gdbinit files [CAN-2005-1705] (Closes: #310728). + + -- Daniel Jacobowitz Sun, 29 May 2005 18:55:44 -0400 + +gdb (6.3-5) unstable; urgency=low + + * Fix NPTL debugging using gdbserver. + * Disable the "Incomplete CFI data" warning. + * Really include the menu file this time (Closes: #80010). + * Include a patch to handle strange binaries produced by Kylix + (Closes: #249008). + * Fix printing of fork status messages, and disable them by default + (Closes: #254039). + + -- Daniel Jacobowitz Wed, 8 Dec 2004 18:35:02 -0500 + +gdb (6.3-4) unstable; urgency=low + + * Backport a patch for a warning about the vsyscall DSO. + * Backport a spelling fix for PTRACE_EVENT_VFORK_DONE to fix S/390 + build failure. + + -- Daniel Jacobowitz Mon, 15 Nov 2004 11:52:13 -0500 + +gdb (6.3-3) unstable; urgency=low + + * Add flex to build dependencies for ada-lex.l. + + -- Daniel Jacobowitz Sun, 14 Nov 2004 00:28:18 -0500 + +gdb (6.3-2) unstable; urgency=low + + * Backport a patch for a C++ / stabs debug info crash (Closes: #251322). + * Correct build dependency for gcj (missed a !). + * Correct build dependency for libunwind (it's libunwind7-dev now). + * Update fix for fork tracing. This removes a warning on 2.4 kernels, + and fixes UML debugging (Closes: #271069). + * Fix single-stepping through a call to NULL on SPARC (Closes: #256012). + + -- Daniel Jacobowitz Sat, 13 Nov 2004 16:50:55 -0500 + +gdb (6.3-1) unstable; urgency=low + + * New upstream release (Closes: #259219). + - Give an error for division by 0 (Closes: #280051). + - Includes support for -feliminate-dwarf2-dups. + - Limited support for Ada is included; more to come + (Closes: #39516, #46470, #57876, #85947). + * Update build dependency on texinfo; 4.7-1 could not build GDB. + * Build depend on gcj on all architectures other than mips and mipsel + (Closes: #272327). + * Build depend on libkvm-dev for kfreebsd-gnu (Closes: #264103). + * Add libunwind support on ia64 (Closes: #279596). + * Make the fork tracing checks more robust. Prevents stray processes + on 2.6.10-rc1. + * Add a Debian menu entry for GDB (Closes: #80010). + + -- Daniel Jacobowitz Fri, 12 Nov 2004 18:45:46 -0500 + +gdb (6.1-3) unstable; urgency=low + + * Fix passing and returning of non-trivial C++ objects (Closes: #160459). + * Update hppa patches (Closes: #247948). + * Add a patch for finding C++ member variables in base classes + (Closes: #239535). + * Replace versions of insight which contain gdbtui. Partial fix for + #242498. + + -- Daniel Jacobowitz Thu, 27 May 2004 11:30:23 -0400 + +gdb (6.1-2) unstable; urgency=low + + * Add an NPTL thread-exit patch. Short-lived threads could cause GDB + to leave unattached threads, which would crash as soon as they hit + a breakpoint. + * Testsuite patches - no unexpected FAILs on i386-linux. + + -- Daniel Jacobowitz Mon, 19 Apr 2004 11:43:07 -0400 + +gdb (6.1-1) unstable; urgency=low + + * New upstream version. + * Re-add the -debian suffix to GDB's version number. This got lost in the + transition to CDBS. + * Revised HPPA port. Thanks to Randolph Chung, as usual. + * Run the testsuite on SPARC again. The SPARC port is much improved + (it has been basically rewritten from scratch). + + -- Daniel Jacobowitz Tue, 6 Apr 2004 00:13:00 -0400 + +gdb (6.0-6) unstable; urgency=low + + * Also add DESTDIR to the ranlib invocation. + * Fix typo in moving run.1 manpage. + * Link linux-nat.o on HPPA. + + -- Daniel Jacobowitz Tue, 3 Feb 2004 11:07:27 -0500 + +gdb (6.0-5) unstable; urgency=low + + * Add DESTDIR support to sim/, to fix build failures on targets with a + simulator. + + -- Daniel Jacobowitz Mon, 2 Feb 2004 15:32:23 -0500 + +gdb (6.0-4) unstable; urgency=low + + * Switch to CDBS and quilt. + * Suppress warning about "" on re-run with a vsyscall DSO. + * Import gdb 6.0 CVS branch; fixes a segfault with development GCC + and frequent segfaults when rereading changed binaries + (Closes: #230550). + + -- Daniel Jacobowitz Mon, 2 Feb 2004 10:03:19 -0500 + +gdb (6.0-3) unstable; urgency=low + + * Include instead of on HPPA + (Closes: #208928). + * Support backtraces through the vsyscall DSO on i386. + * Do not run testsuite on hurd-i386 (Closes: #221956). + * Fix up texinfo files so that dh_installinfo puts them in the right + section. + * Update build dependency on texinfo (Closes: #219337). + + -- Daniel Jacobowitz Sun, 25 Jan 2004 18:04:24 -0500 + +gdb (6.0-2) unstable; urgency=low + + * Add build dependency on mig for hurd-i386 (Closes: #216428). + * Don't paginate symbol file progress messages. In combination + with recent changes to dwarf2-frame.c this fixes some potential + internal errors (Closes: #199889). + - 28.symfile-unfiltered.patch + + -- Daniel Jacobowitz Mon, 27 Oct 2003 23:32:39 -0500 + +gdb (6.0-1) unstable; urgency=low + + * New upstream release + - 11.read-var-value.patch merged upstream. + - 12.dwarf-loc-register.patch merged upstream. + - -data-list-changed-registers no longer segfaults (Closes: #204561). + * Include the text of the GFDL in the copyright file (Closes: #212890). + * Include a threading patch which may fix #212949. + - 26.lin-lwp-assert.patch + * Include a patch which should improve Control-C handling for LinuxThreads + on 2.6 kernels. + - 27.lin-lwp-2.6.patch + + -- Daniel Jacobowitz Sat, 4 Oct 2003 17:47:35 -0400 + +gdb (5.3.20030824-1) unstable; urgency=low + + * New upstream CVS snapshot, from the GDB 6.0 branch. + - 27.tui-paginate-backtrace.patch merged upstream. + - 28.minsym-section.patch merged upstream. + - Watchpoint handling bug for ia64 fixed (Closes: #205241). + * Squash some warnings for HPPA. + + -- Daniel Jacobowitz Sun, 24 Aug 2003 14:26:52 -0400 + +gdb (5.3.20030801-1) unstable; urgency=low + + * New upstream CVS snapshot, from the GDB 6.0 branch. + - 26.fix-sparc-build-two.patch merged upstream. + - Includes a fix for backtracing from noreturn functions like abort (). + - Insert a space between the address and code when disassembling, + even if we don't have a function name (Closes: #199672). + * Update HPPA patch again; is anyone ever going to submit this + upstream? Better do it soon. (Closes: #200980). + * Make filtered output paginate correctly again. + - 27.tui-paginate-backtrace.patch + * Fix an internal error on -data-list-changed-registers, and possibly + many others (Closes: #203553). + - 10.selected-frame.patch + * Add two patches for watchpoints in optimized programs (Closes: #203000). + - 11.read-var-value.patch + - 12.dwarf-loc-register.patch + * Add a patch for several shared library single-stepping bugs. + - 28.minsym-section.patch + + -- Daniel Jacobowitz Sun, 3 Aug 2003 23:09:56 -0400 + +gdb (5.3.20030629-2) unstable; urgency=low + + * Yet another sparc build fix. + - 26.fix-sparc-build-two.patch + + -- Daniel Jacobowitz Sun, 29 Jun 2003 17:11:12 -0400 + +gdb (5.3.20030629-1) unstable; urgency=low + + * New upstream CVS snapshot, from the GDB 6.0 branch. + - Remote debugging isn't totally broken any more. + * Remove merge or obsoleted patches. + - Parts of 23.static-thread-apps.patch + - 26.fix-tui-build.patch + - 27.fix-sparc-build-two.patch + - 28.dwarf2-reread-segv.patch + + -- Daniel Jacobowitz Sat, 28 Jun 2003 21:17:13 -0400 + +gdb (5.3.20030606-3) unstable; urgency=low + + * Fix build failure on HPPA. + * Fix a segfault when reread applications (Closes: #197226). + - 28.dwarf2-reread-segv.patch + + -- Daniel Jacobowitz Sun, 22 Jun 2003 14:30:49 -0400 + +gdb (5.3.20030606-2) unstable; urgency=low + + * Add 27.fix-sparc-build-two.patch to fix build failure on sparc. + * Disable the testsuite on sparc, since it's completely broken. + * Conditionalize gcj build dependency for architectures which both + have gcj and run the testsuite. + + -- Daniel Jacobowitz Sat, 14 Jun 2003 12:30:33 -0400 + +gdb (5.3.20030606-1) unstable; urgency=low + + * New upstream snapshot, with lots of nice features. + - Improved prologue analyzer and DWARF-2 frame unwind support for i386. + - Overhauled Alpha support. + - More C++ namespace support (still not complete). + - DW_AT_ranges support - if you've noticed local variables in your code + being missing in GDB, this is the most likely cause. + - Integrated Objective C support, finally! It's got some rough edges + but it works (Closes: #62081, #24598, #57824, #86506). + - "set cp-abi" command for debugging combined v2 and v3 C++ code. + - Some bug fixes in the parsing for gdb --args (Closes: #33361, #193413). + - Support for debug info in separate files, coming soon to a Debian + near you. + * Removed integrated or obsoleted patches: + - 01.const-tilde_expand.patch + - 05.i386-backtrace-to-main.patch + - 08.max-ui-out.patch + - 12.tui-readline.patch + - 15.m68k-build.patch + - 16.use-rl-prefixed-function.patch + - 19.alpha-doublest-correction.patch + - 21.lin-lwp-schedlock.patch + * Disabled some patches which I hope are no longer needed: + - 06.java-testsuite-jmisc.patch + - 11.thread-confused-exit.patch + - 20.alpha-testsuite.patch + - 22.alpha-proc-desc-stack.patch + * Updated HPPA patches for this snapshot. + - 02.gdb-hppa.patch + - 03.hppa-core.patch + - 04.hppa-func-returns.patch + * Add some build fixes for TUI. + - 26.fix-tui-build.patch + * Build with an absolute path to configure, to work around three failing + MI tests. + * Don't bother running the testsuite for two debug formats any more. + * Add build-dependencies for gcj and gobjc, for the testsuite. + * Adjust configure --mandir argument to match more stupid quoting. + * Re-enable thread testsuite on Alpha. + * Enable the testsuite on ia64, hppa, and s390. + + -- Daniel Jacobowitz Sun, 8 Jun 2003 20:15:55 -0400 + +gdb (5.3-2) unstable; urgency=low + + * Fix build on SPARC. + * Fix buid on HPPA. + + -- Daniel Jacobowitz Sat, 4 Jan 2003 01:02:36 -0500 + +gdb (5.3-1) unstable; urgency=low + + * New upstream release. + * Patches updated for new release. + - Patch 14.gdb-maint-its-typo.patch included. + - Patch 17.tui-fixes.patch included. + - Patch 18.threads-much-faster.patch included. + + -- Daniel Jacobowitz Mon, 16 Dec 2002 14:43:03 -0500 + +gdb (5.2.debian90.cvs20021120-4) unstable; urgency=low + + * Fix thread debugging for statically linked applications + (Closes: #170107). + * Prevent a segfault when entering tracepoint actions if you hit EOF + (Closes: #167997). + + -- Daniel Jacobowitz Tue, 3 Dec 2002 14:46:07 -0500 + +gdb (5.2.debian90.cvs20021120-3) unstable; urgency=low + + * Add another Alpha patch for setting breakpoints after the process exits. + * Disable running the thread tests on Alpha (ew). It hangs the build + daemon; the problem appears to be in glibc. It returns nonexistant + and duplicate threads. + + -- Daniel Jacobowitz Sun, 24 Nov 2002 23:16:36 -0500 + +gdb (5.2.debian90.cvs20021120-2) unstable; urgency=low + + * Add patch for testsuite false failures on Alpha. + * Add patch for floating point support on Alpha. + * Add a patch from the CVS HEAD for schedule-lock mode and for software + single step platforms. + * Correct the testsuite to match "help maint dump-me". + + -- Daniel Jacobowitz Sun, 24 Nov 2002 18:11:26 -0500 + +gdb (5.2.debian90.cvs20021120-1) unstable; urgency=low + + * New upstream CVS snapshot from 5.3 CVS branch. + - Builds with new bison (Closes: #169656). + - Fixes crashes without SSE support or when loading core files without + applications. + - TUI no longer crashes if there is no debugging information for main + (Closes: #141491). + - GDB no longer crashes on "info win" if there are no windows + (Closes: #158186). + - Setting some C++ breakpoints works the first time instead of having + to do it twice (Closes: #110684). + * Patches updated for new release. + - Patch 07.manual-vector.dpatch included in CVS. + - Patch 09.mips-linux-buildfixes-aug02.patch included in CVS. + - Patch 10.no-readline-docs.patch removed - we still use readline, + I believe that leaving it as an appendix to the GDB manual is + appropriate. + - Patch 12.tui-readline.patch updated. + - Patch 17.tui-fixes.patch added to fix a TUI problem with -i=mi. + * Remove useless --enable-shared. + * Fix a typo in "help maint dump-me" (Closes: #168495). + * Add a patch to fix build on m68k, from Michael Fedrowitz + (Closes: #163543). + * Added a patch to call rl_filename_completion_function instead of + filename_completion_function, from Matt Chapman + (Closes: #165366). + * Tag GDB version with "-debian" because we apply patches. + * Add a patch which makes debugging threaded applications drastically + (5x - 10x) faster. Whee! + + -- Daniel Jacobowitz Fri, 22 Nov 2002 17:30:26 -0500 + +gdb (5.2.cvs20020818-3) unstable; urgency=low + + * HPPA fix from Randolph Chung (Closes: #158055). + + -- Daniel Jacobowitz Sun, 25 Aug 2002 00:37:34 -0400 + +gdb (5.2.cvs20020818-2) unstable; urgency=low + + * MIPS and MIPSel build fixes. + * Apply and remove patches in numbered order. + * HPPA build fixes. + + -- Daniel Jacobowitz Mon, 19 Aug 2002 10:49:40 -0400 + +gdb (5.2.cvs20020818-1) unstable; urgency=low + + * New upstream CVS snapshot. + - Don't include in TUI (Closes: #145040). + - Don't use libthread_db with core files (Closes: #133778). + * Recompile against current readline package (Closes: #153972). + * Reduce some thread-db errors to warnings + (Closes: #123675, #126614, #134693). + * Bump MAX_UI_OUT_LEVELS for the Hurd (Closes: #145630). + * Include patch from Richard Hirst to improve function return printing + on HPPA. It looks like there's finally a little progress on getting + the HPPA code in upstream... (Closes: #148672). + * Mention Peter Jay Salzman's GDB tutorial in the documentation + (Closes: #151128). + + -- Daniel Jacobowitz Sun, 18 Aug 2002 23:09:46 -0400 + +gdb (5.2.cvs20020401-6) unstable; urgency=medium + + * More HPPA build fixes - I forgot linux-proc.o again + (Closes: #143707). + * Add support for HPPA core files, patch from Randolph Chung + (Closes: #137316). + + -- Daniel Jacobowitz Sun, 21 Apr 2002 10:29:40 -0400 + +gdb (5.2.cvs20020401-5) unstable; urgency=low + + * More HPPA build fixes. + + -- Daniel Jacobowitz Fri, 19 Apr 2002 12:43:56 -0400 + +gdb (5.2.cvs20020401-4) unstable; urgency=medium + + * Add linux-proc.o to NATDEPFILES for S/390; should fix S/390 build. + * Change `value_ptr' to `struct value *' in HPPA patch. Should fix + HPPA build in combination with libc6 2.2.5-4.0.2. + + -- Daniel Jacobowitz Wed, 17 Apr 2002 00:43:32 -0400 + +gdb (5.2.cvs20020401-3) unstable; urgency=low + + * Add a patch to fix initialization on non-multi-arch targets + (particularly Alpha and Sparc). + * Enable testsuite on Alpha and Sparc. + + -- Daniel Jacobowitz Thu, 4 Apr 2002 21:49:24 -0500 + +gdb (5.2.cvs20020401-2) unstable; urgency=low + + * My apologies to all you autobuilders out there. Results were worse than + I feared. Testsuite is now run only on PowerPC and i386 until I can + clean up the results everywhere else. + + -- Daniel Jacobowitz Wed, 3 Apr 2002 17:24:17 -0500 + +gdb (5.2.cvs20020401-1) unstable; urgency=low + + * The "Ahhhhhhhhhhhhhhhhhh!" Release. + * New snapshot from CVS (post-5.2) (yes, I know 5.2 isn't out yet). + - Fixes crash on printing large types + (Closes: #111017, #130592, #131033). + - In one upstream patch and one pending patch, greatly improve + debugging with GCC 2.95. If you've ever breakpointed the + beginning of a function and been frustrated when arguments + printed incorrectly, this release is for you! It should fix most + occurances of that problem. + * Patches from J.H.M. Dassen to use system readline. Slightly tweaked. + - [debian/rules] Build the refcard; figure out patches automatically. + - [debian/use-dynamic-readline.patch] Link against dynamic readline again. + - [debian/no-readline-docs.patch] Remove readline documentation. + - [debian/const-tilde_expand.patch] Bring extern declaration of tilde_expand + in sync with current readline headers. + - [debian/rules] Ensure we don't build against the local readline copy by + mistake; remove generated config.status files. + * Include gdbserver if it is built. + * Include a version of GDB with the TUI interface enabled + (Closes: #137503). + * Run 'make check' during build, for stabs and DWARF-2. + * Add --disable-gdbtk (Closes: #115429). + * Add a patch to prevent a hang while running the Java testsuite if + gcj-3.0 is installed. + * Include simulator in the binary package if one is built (PPC, ARM, + MIPS) (Closes: #123185). + + -- Daniel Jacobowitz Mon, 1 Apr 2002 17:17:30 -0500 + +gdb (5.1.1-1) unstable; urgency=low + + * New upstream release (Closes: #132314). + - Corrected manual licenses (Closes: #129311). + * Apply HPPA patch (Closes: #127301). + * Add patch to fix conflict with new ncurses. + + -- Daniel Jacobowitz Wed, 13 Feb 2002 16:39:32 -0500 + +gdb (5.1-1) unstable; urgency=low + + * New upstream release. + * All patches merged upstream, including (hopefully) everything needed + for S/390. + + -- Daniel Jacobowitz Fri, 7 Dec 2001 13:04:15 -0500 + +gdb (5.0.cvs20011007-3) unstable; urgency=low + + * Add ARM patch (committed to upstream CVS). + + -- Daniel Jacobowitz Wed, 31 Oct 2001 10:59:21 -0500 + +gdb (5.0.cvs20011007-2) unstable; urgency=low + + * Updated S/390 patch from Gerhard Tonn. + + -- Daniel Jacobowitz Mon, 8 Oct 2001 13:55:06 -0400 + +gdb (5.0.cvs20011007-1) unstable; urgency=low + + * New upstream release. + * Remove obsolete patches (gdb-docs, gdb-ppc-core). + * Add S/390 support patch. + * Configure for $(DEB_HOST_GNU_TYPE) (Closes: #109715). + + -- Daniel Jacobowitz Sun, 7 Oct 2001 14:06:20 -0400 + +gdb (5.0.cvs20010729-2) unstable; urgency=low + + * Fix m68k build. Again. (Closes: #107807). + + -- Daniel Jacobowitz Sat, 25 Aug 2001 15:32:16 -0700 + +gdb (5.0.cvs20010729-1) unstable; urgency=low + + * Call dh_installinfo from rules file (Closes: #107119). + * Put info files in "Development" to match other Debian development tools. + * Fix malformed gdbint.info file. + * Use DH_COMPAT=3 to make dh_installinfo work better with wildcards, + and bump debhelper build dependency. + * Update to 5.1 release branch (Closes: #103992). + * Fix PowerPC core files (Re: bug #107072). + * Fix up patch handling in rules file a little bit. + + -- Daniel Jacobowitz Mon, 30 Jul 2001 13:48:27 -0700 + +gdb (5.0.cvs20010704-1) unstable; urgency=low + + * The "Independence Day" release - CVS snapshot from July 4th. + * New maintainer. + * Update build-depends (Closes: #96835, #96897). + * New version includes thread support - for some platforms. I'm not going + to close the related bugs until I've verified it on a few more targets. + * Debhelperize (Closes: #97715, #97593). + * Add Replaces: gdb-arm for upgrades (Closes: #79992). + + -- Daniel Jacobowitz Thu, 5 Jul 2001 12:46:06 -0700 + +gdb (5.0-4) unstable; urgency=low + + * Made almost lintian clean: + - added Section: and Priority: fields in gdb binary package + - info files are now installed in /usr/share/info + - binaries get now stripped + - debian/copyright now refers to '/usr/share/common-licenses' for + full GPL license text + (patch by Domenico Andreoli ) + * added texinfo & tetex-bin to the build-dependencies. + + -- Vincent Renardias Sun, 6 May 2001 21:19:16 +0200 + +gdb (5.0-3) unstable; urgency=low + + * Include upstream README & NEWS files. + closes: #37978 gdb documentation. + * s|usr/doc|usr/share/doc|g. + closes: #69272: gdb: docs should be in /usr/share/doc according policy. + * Fix description. + + -- Vincent Renardias Wed, 16 Aug 2000 21:58:45 +0200 + +gdb (5.0-2) unstable; urgency=low + + * Include patch to get it to work on m68k. + closes: #69185: gdb doesn't build on m68k. + + -- Vincent Renardias Wed, 16 Aug 2000 19:33:16 +0200 + +gdb (5.0-1) unstable; urgency=low + + * New upstream code. + (Foreign patches not re-applied for now. Will see if they + are necessary) + closes: #66221 New major upstream version (5.0) out. + closes: #63337 gdb: Recompilation with libncurse5 needed. + closes: #58450 gdb: Won't compile on PowerPC. + closes: #54738 gdb does not compile on i386 under current glibc. + + -- Vincent Renardias Sun, 13 Aug 2000 01:27:40 +0200 + +gdb (4.18.19990928-1) unstable; urgency=low + + * New upstream code. + Fixes some problems related to the C++ code: + closes: #46125: gdb seg faults calling C++ functions. + closes: #46195: gdb is broken for C++ + closes: #43955: gdb can't resolve virtual methods with new g++ + closes: #36341: gdb: Gives a parse error when casting an expression + * Include patch from David N. Welton : + closes: #45308: gdb: Patch for gdb debian/rules + * ACK NMU: + closes: #39661: gdb is broken on ppc arch. + * Now compiles on non-i386 archs: + closes: #32267 + * Updated my email address. + + -- Vincent Renardias Wed, 29 Sep 1999 17:39:17 +0200 + +gdb (4.18-1.1) unstable; urgency=low + + * Applied some ppc patch i got from the linuxppc gdb. + + -- Sven LUTHER Mon, 14 Jun 1999 19:54:49 +0200 + +gdb (4.18-1) unstable; urgency=low + + * New upstream version! + + -- Vincent Renardias Thu, 22 Apr 1999 17:35:41 +0200 + +gdb (4.17.19981224-3.m68k.objc.threads.hwwp.fpu.gnat) unstable; urgency=low + + * Upgrade to new code. + * Apply HJL's 4.17.0.4 -> 4.17.0.8 patch. + * Fix #30463. + + -- Vincent Renardias Mon, 18 Jan 1999 23:38:36 +0100 + +gdb (4.17-4.m68k.objc.threads.hwwp.fpu.gnat.3) frozen unstable; urgency=low + + * Non-maintainer upload. + * Apply threads patch (dynamically) only if building on i386; the patch + works currently only correct on i386 and breaks compilation at least + on m68k and sparc. + + -- Roman Hodek Fri, 11 Dec 1998 13:56:00 +0100 + +gdb (4.17-4.m68k.objc.threads.hwwp.fpu.gnat.2) unstable; urgency=low + + * Non-maintainer upload. + * debian/rules (checkroot): use tab not spaces, thanks to Roman Hodek + . [#26798] + + -- James Troup Tue, 20 Oct 1998 02:41:26 +0100 + +gdb (4.17-4.m68k.objc.threads.hwwp.fpu.gnat.1) unstable; urgency=low + + * NMU with yet more hideous revision. + * PowerPC support via Matt McLean. + * Clean up corrupted m68k files a little bit - move config/m68k/* to + gdb/config/m68k/* and remove literal ^L's. + + -- Daniel Jacobowitz Fri, 11 Sep 1998 22:40:22 -0400 + +gdb (4.17-4.m68k.objc.threads.hwwp.fpu.gnat) unstable; urgency=low + + * Apply yet another patch to improve Objective-C support (Fix #24599). + + -- Vincent Renardias Wed, 15 Jul 1998 12:34:47 +0200 + +gdb (4.17-3.m68k.objc.threads.hwwp.fpu.gnat) unstable; urgency=low + + * re-integrated gnat support. + (Was repported as a bug against 4.16, patch had been integrated then, + but dropped while switching to version 4.17). + (NB: Not being an ADA expert, I'd appreciate if s/o could confirm + it now works properly, thanx) + + -- Vincent Renardias Fri, 3 Jul 1998 18:46:28 +0200 + +gdb (4.17-2.m68k.objc.threads.hwwp.fpu) unstable; urgency=low + + * Include patch to support debugging of multithreaded programs + (Bug #23823) + Note: Needs a patch to libc6 to work (submitted as #24213). + * Include JH Lu patch to have hardware watchpoint and FPU support + (Fix bug #660!! (40 months old!!!) & bug #16435) + * Bug #8861 also appears to be fixed... Isn't that great? :) + * Now provide the reference card (Bug #20772). + + -- Vincent Renardias Fri, 3 Jul 1998 18:46:28 +0200 + +gdb (4.17-1) unstable; urgency=low + + * Fix #22555 (enable building on sparc) + * Fix #21932 (acknowledge NMU) + + -- Vincent Renardias Mon, 18 May 1998 17:56:10 +0200 + +gdb (4.17-0.1) frozen unstable; urgency=low + + * New upstream release (differences with upstream 4.16.98 are negligable). + * Non-maintainer upload. + * Disabled linking -rpath: + * bfd/configure.in, opcodes/configure.in: applied libtool-rpath-workaround + * gdb/configure.in, gdb/configure: don't use -rpath on Linux. + * regenerate "configure" scripts involved. + + -- J.H.M. Dassen (Ray) Thu, 30 Apr 1998 19:47:34 +0200 + +gdb (4.16.98-1) frozen unstable; urgency=low + + * New upstream code. Only change relevant on Linux: Patch by + H.J. Lu so debugging of shared library works properly (That was + the important patch motivating this upload). + This release _is_ supposed to be the final gdb-4.17 (from the announce: + 'I wanted to make a "this is the release unless something is + very wrong" release and then kick 4.17 out'). + + -- Vincent Renardias Thu, 23 Apr 1998 20:44:36 +0200 + +gdb (4.16.86-1) unstable; urgency=low + + * New upstream code. (still unreleased). + * Re-added the m68k stuff that didn't make it upstream (Bug #19539, #19635). + * Re-added the Objective-C stuff (Bug #19630) + + -- Vincent Renardias Sat, 14 Mar 1998 23:40:06 +0100 + +gdb (4.16.85-2) unstable; urgency=low + + * debian/rules: Also remove gdb/doc/GDBvn.texi and config.log when cleaning up. + * The following has been done by : + * TODO: this version of gdb uses an evil new version of libtool which + forces -rpath. With lesstif, I got around this by replacing the libtool + scripts with those from the Debian libtool package. + * Use dynamic readline library. + * Install with preserved timestamps. + * Clean out .tab.c files missed by "make distclean", so the .diff.gz is + smaller. + * Clean out symlinks, so dpkg-source works after debian/rules build clean. + * Several other minor clean-ups of the rules file. + * Updated FSF address (lintian). + * Bumped Standards-Version. + + -- Vincent Renardias Fri, 6 Mar 1998 20:49:54 +0100 + +gdb (4.16.85-1) unstable; urgency=low + + * New upstream code (Although not released yet). + + -- Vincent Renardias Thu, 5 Mar 1998 20:19:14 +0100 + +gdb (4.16-12) unstable; urgency=low + + * Applied alpha patches (#11841). + + -- Vincent Renardias Mon, 4 Aug 1997 22:28:54 +0200 + +gdb (4.16-11) unstable; urgency=low + + * Included patch to fix bugs (#11552,#11324). + + -- Vincent Renardias Wed, 30 Jul 1997 20:40:01 +0200 + +gdb (4.16-10) unstable; urgency=low + + * Fixed #11136 (support for Ada; + Thanx to Marc Eichin for pointing this patch). + + -- Vincent Renardias Thu, 10 Jul 1997 19:38:07 +0200 + +gdb (4.16-9) unstable; urgency=low + + * Fixed #11037 (compilation on m68k). + + -- Vincent Renardias Sat, 5 Jul 1997 16:14:39 +0200 + +gdb (4.16-8) unstable; urgency=low + + * Compiled with libc6/ncurses3.4/libreadline2.1. + * Fixed #9654 (cosmetic fix). + * Updated debian/control file (now supports Objective-C). + + -- Vincent Renardias Sat, 21 Jun 1997 15:15:13 +0200 + +gdb (4.16-7) unstable; urgency=low + + * Fixed typo. in documentation (Fixes bug #5477). + + -- Vincent Renardias Mon, 7 Apr 1997 16:35:53 +0200 + +gdb (4.16-6) unstable; urgency=low + + * Corrected texinfo documentation (Fixes bug #3823). + * Added upstream ChangeLog file. + + -- Vincent Renardias Sun, 16 Mar 1997 18:32:23 +0100 + +gdb (4.16-5) unstable; urgency=low + + * Included patch for glibc-2.0 support. + + -- Vincent Renardias Sun, 16 Mar 1997 07:46:29 +0100 + +gdb (4.16-4) unstable; urgency=low + + * Included patch for Objective-C support (Fixes bug #7063). + + -- Vincent Renardias Sun, 16 Mar 1997 03:12:13 +0100 + +gdb (4.16-3) unstable; urgency=low + + * New maintainer. + * Included patches for m68k support. + + -- Vincent Renardias Fri, 14 Mar 1997 22:07:58 +0100 + +gdb (4.16-2) unstable; urgency=MEDIUM + + * New caretaker: Stuart Lamble (note: this package is still up + for adoption, as I would prefer not to be maintaining it + full-time.) + * Upgraded to the 2.1.1.0 source format. + * Recompiled, with a corrected procfs.h, to correct problems with + ELF coredumps. + * Reformatted the changelog :-) + + -- Stuart Lamble Sun, 20 Oct 1996 18:48:40 +1000 + +gdb (4.16-1) unstable; urgency=low + + * Updated to new upstream version (Bug#4373) + * Added a simple extended description (Bug#3599) + + -- David Engel --- gdb-6.4.orig/debian/copyright +++ gdb-6.4/debian/copyright @@ -0,0 +1,414 @@ +This is the Debian GNU/Linux packaged version of the GNU debugger, GDB. + +Earlier versions of this package were assembled by David Engel +, Stuart Lamble , and others. + +GDB is Copyright (C) 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 + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses'. + +=== + +The GDB manual and associated documentation are also Copyright (C) Free +Software Foundation, Inc. They are distributed under the GNU Free +Documentation License, shown below, with these terms: + + + Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.1 or +any later version published by the Free Software Foundation; with the +Invariant Sections being "Free Software" and "Free Software Needs Free +Documentation", with the Front-Cover Texts being "A GNU Manual," and +with the Back-Cover Texts as in (a) below. + + (a) The Free Software Foundation's Back-Cover Text is: "You have +freedom to copy and modify this GNU Manual, like GNU software. Copies +published by the Free Software Foundation raise funds for GNU +development." + + +GNU Free Documentation License +****************************** + + Version 1.1, March 2000 + Copyright (C) 2000 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + 0. PREAMBLE + + The purpose of this License is to make a manual, textbook, or other + written document "free" in the sense of freedom: to assure everyone + the effective freedom to copy and redistribute it, with or without + modifying it, either commercially or noncommercially. Secondarily, + this License preserves for the author and publisher a way to get + credit for their work, while not being considered responsible for + modifications made by others. + + This License is a kind of "copyleft", which means that derivative + works of the document must themselves be free in the same sense. + It complements the GNU General Public License, which is a copyleft + license designed for free software. + + We have designed this License in order to use it for manuals for + free software, because free software needs free documentation: a + free program should come with manuals providing the same freedoms + that the software does. But this License is not limited to + software manuals; it can be used for any textual work, regardless + of subject matter or whether it is published as a printed book. + We recommend this License principally for works whose purpose is + instruction or reference. + + + 1. APPLICABILITY AND DEFINITIONS + + This License applies to any manual or other work that contains a + notice placed by the copyright holder saying it can be distributed + under the terms of this License. The "Document", below, refers to + any such manual or work. Any member of the public is a licensee, + and is addressed as "you." + + A "Modified Version" of the Document means any work containing the + Document or a portion of it, either copied verbatim, or with + modifications and/or translated into another language. + + A "Secondary Section" is a named appendix or a front-matter + section of the Document that deals exclusively with the + relationship of the publishers or authors of the Document to the + Document's overall subject (or to related matters) and contains + nothing that could fall directly within that overall subject. + (For example, if the Document is in part a textbook of + mathematics, a Secondary Section may not explain any mathematics.) + The relationship could be a matter of historical connection with + the subject or with related matters, or of legal, commercial, + philosophical, ethical or political position regarding them. + + The "Invariant Sections" are certain Secondary Sections whose + titles are designated, as being those of Invariant Sections, in + the notice that says that the Document is released under this + License. + + The "Cover Texts" are certain short passages of text that are + listed, as Front-Cover Texts or Back-Cover Texts, in the notice + that says that the Document is released under this License. + + A "Transparent" copy of the Document means a machine-readable copy, + represented in a format whose specification is available to the + general public, whose contents can be viewed and edited directly + and straightforwardly with generic text editors or (for images + composed of pixels) generic paint programs or (for drawings) some + widely available drawing editor, and that is suitable for input to + text formatters or for automatic translation to a variety of + formats suitable for input to text formatters. A copy made in an + otherwise Transparent file format whose markup has been designed + to thwart or discourage subsequent modification by readers is not + Transparent. A copy that is not "Transparent" is called "Opaque." + + Examples of suitable formats for Transparent copies include plain + ASCII without markup, Texinfo input format, LaTeX input format, + SGML or XML using a publicly available DTD, and + standard-conforming simple HTML designed for human modification. + Opaque formats include PostScript, PDF, proprietary formats that + can be read and edited only by proprietary word processors, SGML + or XML for which the DTD and/or processing tools are not generally + available, and the machine-generated HTML produced by some word + processors for output purposes only. + + The "Title Page" means, for a printed book, the title page itself, + plus such following pages as are needed to hold, legibly, the + material this License requires to appear in the title page. For + works in formats which do not have any title page as such, "Title + Page" means the text near the most prominent appearance of the + work's title, preceding the beginning of the body of the text. + + 2. VERBATIM COPYING + + You may copy and distribute the Document in any medium, either + commercially or noncommercially, provided that this License, the + copyright notices, and the license notice saying this License + applies to the Document are reproduced in all copies, and that you + add no other conditions whatsoever to those of this License. You + may not use technical measures to obstruct or control the reading + or further copying of the copies you make or distribute. However, + you may accept compensation in exchange for copies. If you + distribute a large enough number of copies you must also follow + the conditions in section 3. + + You may also lend copies, under the same conditions stated above, + and you may publicly display copies. + + 3. COPYING IN QUANTITY + + If you publish printed copies of the Document numbering more than + 100, and the Document's license notice requires Cover Texts, you + must enclose the copies in covers that carry, clearly and legibly, + all these Cover Texts: Front-Cover Texts on the front cover, and + Back-Cover Texts on the back cover. Both covers must also clearly + and legibly identify you as the publisher of these copies. The + front cover must present the full title with all words of the + title equally prominent and visible. You may add other material + on the covers in addition. Copying with changes limited to the + covers, as long as they preserve the title of the Document and + satisfy these conditions, can be treated as verbatim copying in + other respects. + + If the required texts for either cover are too voluminous to fit + legibly, you should put the first ones listed (as many as fit + reasonably) on the actual cover, and continue the rest onto + adjacent pages. + + If you publish or distribute Opaque copies of the Document + numbering more than 100, you must either include a + machine-readable Transparent copy along with each Opaque copy, or + state in or with each Opaque copy a publicly-accessible + computer-network location containing a complete Transparent copy + of the Document, free of added material, which the general + network-using public has access to download anonymously at no + charge using public-standard network protocols. If you use the + latter option, you must take reasonably prudent steps, when you + begin distribution of Opaque copies in quantity, to ensure that + this Transparent copy will remain thus accessible at the stated + location until at least one year after the last time you + distribute an Opaque copy (directly or through your agents or + retailers) of that edition to the public. + + It is requested, but not required, that you contact the authors of + the Document well before redistributing any large number of + copies, to give them a chance to provide you with an updated + version of the Document. + + 4. MODIFICATIONS + + You may copy and distribute a Modified Version of the Document + under the conditions of sections 2 and 3 above, provided that you + release the Modified Version under precisely this License, with + the Modified Version filling the role of the Document, thus + licensing distribution and modification of the Modified Version to + whoever possesses a copy of it. In addition, you must do these + things in the Modified Version: + + A. Use in the Title Page (and on the covers, if any) a title + distinct from that of the Document, and from those of previous + versions (which should, if there were any, be listed in the + History section of the Document). You may use the same title + as a previous version if the original publisher of that version + gives permission. + B. List on the Title Page, as authors, one or more persons or + entities responsible for authorship of the modifications in the + Modified Version, together with at least five of the principal + authors of the Document (all of its principal authors, if it + has less than five). + C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. + D. Preserve all the copyright notices of the Document. + E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. + F. Include, immediately after the copyright notices, a license + notice giving the public permission to use the Modified Version + under the terms of this License, in the form shown in the + Addendum below. + G. Preserve in that license notice the full lists of Invariant + Sections and required Cover Texts given in the Document's + license notice. + H. Include an unaltered copy of this License. + I. Preserve the section entitled "History", and its title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. + If there is no section entitled "History" in the Document, + create one stating the title, year, authors, and publisher of + the Document as given on its Title Page, then add an item + describing the Modified Version as stated in the previous + sentence. + J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and + likewise the network locations given in the Document for + previous versions it was based on. These may be placed in the + "History" section. You may omit a network location for a work + that was published at least four years before the Document + itself, or if the original publisher of the version it refers + to gives permission. + K. In any section entitled "Acknowledgements" or "Dedications", + preserve the section's title, and preserve in the section all the + substance and tone of each of the contributor acknowledgements + and/or dedications given therein. + L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. + M. Delete any section entitled "Endorsements." Such a section + may not be included in the Modified Version. + N. Do not retitle any existing section as "Endorsements" or to + conflict in title with any Invariant Section. + + If the Modified Version includes new front-matter sections or + appendices that qualify as Secondary Sections and contain no + material copied from the Document, you may at your option + designate some or all of these sections as invariant. To do this, + add their titles to the list of Invariant Sections in the Modified + Version's license notice. These titles must be distinct from any + other section titles. + + You may add a section entitled "Endorsements", provided it contains + nothing but endorsements of your Modified Version by various + parties-for example, statements of peer review or that the text has + been approved by an organization as the authoritative definition + of a standard. + + You may add a passage of up to five words as a Front-Cover Text, + and a passage of up to 25 words as a Back-Cover Text, to the end + of the list of Cover Texts in the Modified Version. Only one + passage of Front-Cover Text and one of Back-Cover Text may be + added by (or through arrangements made by) any one entity. If the + Document already includes a cover text for the same cover, + previously added by you or by arrangement made by the same entity + you are acting on behalf of, you may not add another; but you may + replace the old one, on explicit permission from the previous + publisher that added the old one. + + The author(s) and publisher(s) of the Document do not by this + License give permission to use their names for publicity for or to + assert or imply endorsement of any Modified Version. + + 5. COMBINING DOCUMENTS + + You may combine the Document with other documents released under + this License, under the terms defined in section 4 above for + modified versions, provided that you include in the combination + all of the Invariant Sections of all of the original documents, + unmodified, and list them all as Invariant Sections of your + combined work in its license notice. + + The combined work need only contain one copy of this License, and + multiple identical Invariant Sections may be replaced with a single + copy. If there are multiple Invariant Sections with the same name + but different contents, make the title of each such section unique + by adding at the end of it, in parentheses, the name of the + original author or publisher of that section if known, or else a + unique number. Make the same adjustment to the section titles in + the list of Invariant Sections in the license notice of the + combined work. + + In the combination, you must combine any sections entitled + "History" in the various original documents, forming one section + entitled "History"; likewise combine any sections entitled + "Acknowledgements", and any sections entitled "Dedications." You + must delete all sections entitled "Endorsements." + + 6. COLLECTIONS OF DOCUMENTS + + You may make a collection consisting of the Document and other + documents released under this License, and replace the individual + copies of this License in the various documents with a single copy + that is included in the collection, provided that you follow the + rules of this License for verbatim copying of each of the + documents in all other respects. + + You may extract a single document from such a collection, and + distribute it individually under this License, provided you insert + a copy of this License into the extracted document, and follow + this License in all other respects regarding verbatim copying of + that document. + + 7. AGGREGATION WITH INDEPENDENT WORKS + + A compilation of the Document or its derivatives with other + separate and independent documents or works, in or on a volume of + a storage or distribution medium, does not as a whole count as a + Modified Version of the Document, provided no compilation + copyright is claimed for the compilation. Such a compilation is + called an "aggregate", and this License does not apply to the + other self-contained works thus compiled with the Document, on + account of their being thus compiled, if they are not themselves + derivative works of the Document. + + If the Cover Text requirement of section 3 is applicable to these + copies of the Document, then if the Document is less than one + quarter of the entire aggregate, the Document's Cover Texts may be + placed on covers that surround only the Document within the + aggregate. Otherwise they must appear on covers around the whole + aggregate. + + 8. TRANSLATION + + Translation is considered a kind of modification, so you may + distribute translations of the Document under the terms of section + 4. Replacing Invariant Sections with translations requires special + permission from their copyright holders, but you may include + translations of some or all Invariant Sections in addition to the + original versions of these Invariant Sections. You may include a + translation of this License provided that you also include the + original English version of this License. In case of a + disagreement between the translation and the original English + version of this License, the original English version will prevail. + + 9. TERMINATION + + You may not copy, modify, sublicense, or distribute the Document + except as expressly provided for under this License. Any other + attempt to copy, modify, sublicense or distribute the Document is + void, and will automatically terminate your rights under this + License. However, parties who have received copies, or rights, + from you under this License will not have their licenses + terminated so long as such parties remain in full compliance. + + 10. FUTURE REVISIONS OF THIS LICENSE + + The Free Software Foundation may publish new, revised versions of + the GNU Free Documentation License from time to time. Such new + versions will be similar in spirit to the present version, but may + differ in detail to address new problems or concerns. See + http://www.gnu.org/copyleft/. + + Each version of the License is given a distinguishing version + number. If the Document specifies that a particular numbered + version of this License "or any later version" applies to it, you + have the option of following the terms and conditions either of + that specified version or of any later version that has been + published (not as a draft) by the Free Software Foundation. If + the Document does not specify a version number of this License, + you may choose any version ever published (not as a draft) by the + Free Software Foundation. + + +ADDENDUM: How to use this License for your documents +==================================================== + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and license +notices just after the title page: + + Copyright (C) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.1 + or any later version published by the Free Software Foundation; + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + A copy of the license is included in the section entitled "GNU + Free Documentation License." + + If you have no Invariant Sections, write "with no Invariant Sections" +instead of saying which ones are invariant. If you have no Front-Cover +Texts, write "no Front-Cover Texts" instead of "Front-Cover Texts being +LIST"; likewise for Back-Cover Texts. + + If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, to +permit their use in free software. --- gdb-6.4.orig/debian/rules +++ gdb-6.4/debian/rules @@ -0,0 +1,128 @@ +#!/usr/bin/make -f + +DEB_BUILDDIR := $(shell pwd)/objdir + +# This implements the .deb package creation using debhelper. +include /usr/share/cdbs/1/rules/debhelper.mk + +# This implements building using a configure script and Makefile. +include /usr/share/cdbs/1/class/autotools.mk + +# Quilt-based patches in debian/patches. +include /usr/share/cdbs/1/rules/patchsys-quilt.mk + + +install = /usr/bin/install -p + +# Rather paranoid than sorry. Make the shell exit with an error if an +# untested command fails. +SHELL += -e + +DEB_HOST_GNU_SYSTEM := $(shell dpkg-architecture -qDEB_HOST_GNU_SYSTEM) +DEB_HOST_GNU_CPU := $(shell dpkg-architecture -qDEB_HOST_GNU_CPU) +DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) + +run_tests := yes +run_thread_tests := yes + +ifneq ($(DEB_HOST_GNU_SYSTEM),linux-gnu) + run_tests := no +endif + +ifeq ($(filter $(DEB_HOST_GNU_CPU),alpha i486 hppa ia64 powerpc s390 sparc x86_64),) + run_tests := no +endif + +ifeq ($(DEB_HOST_GNU_CPU),ia64) + arch_config_args := --with-libunwind +endif + +INSTALL = $(install) +export INSTALL + +# We pass srcdir explicitly to avoid an extra '/.' at the end of it. That +# causes a harmless, but ugly, testsuite failure in maint.exp. +DEB_CONFIGURE_EXTRA_FLAGS := $(DEB_HOST_GNU_TYPE) --disable-gdbtk \ + --disable-shared --enable-tui --srcdir=$(shell pwd) \ + $(arch_config_args) + +DEB_MAKE_BUILD_TARGET = all info + +post-patches:: + if ! test -f gdb/version.in.backup; then \ + mv -f gdb/version.in gdb/version.in.backup; \ + sed -e 's/$$/-debian/' < gdb/version.in.backup > gdb/version.in; \ + fi + +# This should probably be common-post-build-arch, but that runs during +# install, under fakeroot, in CDBS 0.4.21. +build/gdb:: check-stamp + $(MAKE) -C objdir/gdb/doc refcard.dvi refcard.ps + +check-stamp: +ifeq ($(run_tests),yes) +ifeq ($(run_thread_tests),no) + echo " $(foreach exp,$(wildcard gdb/testsuite/gdb.threads/*.exp),mv $(exp) $(exp).disabled;)" + $(foreach exp,$(wildcard gdb/testsuite/gdb.threads/*.exp),mv $(exp) $(exp).disabled;) +endif + -ulimit -c unlimited; \ + $(MAKE) -C objdir/gdb check \ + 2>&1 | tee objdir/check.log +ifeq ($(run_thread_tests),no) + $(foreach exp,$(wildcard gdb/testsuite/gdb.threads/*.exp.disabled),mv $(exp) $(subst .disabled,,$(exp);)) +endif +endif + touch $@ + +clean:: + rm -rf objdir + + if test -f gdb/version.in.backup; then \ + mv -f gdb/version.in.backup gdb/version.in; \ + fi + +# # For snapshots this is appropriate; careful of release tarballs +# # which include .gmo files. +# find -type f -name '*.gmo' | xargs rm -f + + # Prevent gratuitous rebuilds of the BFD documentation, since it + # updates the copy in the source directory. + find bfd -name bfd.info\* | xargs --no-run-if-empty touch + + rm -f check-stamp + +binary-post-install/gdb :: + if [ -x debian/gdb/usr/bin/run ]; then \ + mv debian/gdb/usr/bin/run \ + debian/gdb/usr/bin/$(DEB_HOST_GNU_TYPE)-run; \ + mv debian/gdb/usr/share/man/man1/run.1 \ + debian/gdb/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-run.1; \ + fi +ifeq ($(run_tests),yes) + install -d debian/gdb/usr/share/doc/gdb + install -m 644 objdir/check.log \ + debian/gdb/usr/share/doc/gdb/check.log +endif + + $(INSTALL) -m 755 -o root -g root \ + gdb/gdb_gcore.sh debian/gdb/usr/bin/gcore + + rm -rf debian/gdb/usr/include \ + debian/gdb/usr/lib/lib*.* \ + debian/gdb/usr/share/info/annotate.info* \ + debian/gdb/usr/share/info/bfd.info* \ + debian/gdb/usr/share/info/configure.info* \ + debian/gdb/usr/share/info/mmalloc.info* \ + debian/gdb/usr/share/info/standards.info* \ + debian/gdb/usr/share/locale + +#debian/control:: debian/control.in +# cat debian/control.in \ +# | sed "s/@kfreebsd@/`type-handling any kfreebsd-gnu`/g" \ +# | sed "s/@gnu@/`type-handling any gnu`/g" \ +# > debian/control + +DEB_INSTALL_DOCS_gdb = gdb/NEWS gdb/README gdb/doc/refcard.tex \ + objdir/gdb/doc/refcard.dvi objdir/gdb/doc/refcard.ps + +DEB_INSTALL_CHANGELOGS_gdb = gdb/ChangeLog