--- gdb-6.7.1.orig/debian/patches/member-field-symtab.patch +++ gdb-6.7.1/debian/patches/member-field-symtab.patch @@ -0,0 +1,40 @@ +Status: unsubmitted + +This patch was for Debian bug #239535. It needs to be tested, and +submitted. + +--- + gdb/dwarf2read.c | 2 +- + gdb/valops.c | 4 +++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +Index: gdb-6.7.1/gdb/valops.c +=================================================================== +--- gdb-6.7.1.orig/gdb/valops.c 2007-12-03 09:37:24.000000000 -0500 ++++ gdb-6.7.1/gdb/valops.c 2007-12-03 09:37:26.000000000 -0500 +@@ -2352,8 +2352,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.7.1/gdb/dwarf2read.c +=================================================================== +--- gdb-6.7.1.orig/gdb/dwarf2read.c 2007-12-03 09:37:24.000000000 -0500 ++++ gdb-6.7.1/gdb/dwarf2read.c 2007-12-03 09:37:26.000000000 -0500 +@@ -2144,8 +2144,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.7.1.orig/debian/patches/series +++ gdb-6.7.1/debian/patches/series @@ -0,0 +1,19 @@ +member-field-symtab.patch +cp-pass-by-reference.patch +thread-db-multiple-libraries.patch +dwarf2-cfi-warning.patch +gdbinit-ownership.patch +pending-breakpoints-and-sigttou.patch +gdb-pascal-support.patch +gdb-fortran-main.patch -p0 +linux-clear-thread-list.patch +man-page-args.patch +bfd-get-mtime-less.patch +hppa-linux-build.patch +division-by-zero-u.patch +gdb-mi-varobj-crash.patch +powerpc-plt-stubs.patch +gcc43-werror.patch +#pie-support-tests.patch +#pie-support.patch +gdb-strings.patch --- gdb-6.7.1.orig/debian/patches/gcc43-werror.patch +++ gdb-6.7.1/debian/patches/gcc43-werror.patch @@ -0,0 +1,40 @@ +--- + gdb/remote.c | 2 +- + gdb/symtab.c | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +Index: gdb-6.7.1/gdb/remote.c +=================================================================== +--- gdb-6.7.1.orig/gdb/remote.c 2007-12-31 13:23:10.000000000 -0500 ++++ gdb-6.7.1/gdb/remote.c 2007-12-31 13:27:07.000000000 -0500 +@@ -1343,7 +1343,7 @@ unpack_varlen_hex (char *buff, /* packet + static char * + unpack_nibble (char *buf, int *val) + { +- ishex (*buf++, val); ++ *val = fromhex (*buf++); + return buf; + } + +Index: gdb-6.7.1/gdb/symtab.c +=================================================================== +--- gdb-6.7.1.orig/gdb/symtab.c 2007-12-31 13:23:10.000000000 -0500 ++++ gdb-6.7.1/gdb/symtab.c 2007-12-31 13:29:57.000000000 -0500 +@@ -2408,6 +2408,8 @@ find_line_common (struct linetable *l, i + int best_index = -1; + int best = 0; + ++ *exact_match = 0; ++ + if (lineno <= 0) + return -1; + if (l == 0) +@@ -2433,8 +2435,6 @@ find_line_common (struct linetable *l, i + } + + /* If we got here, we didn't get an exact match. */ +- +- *exact_match = 0; + return best_index; + } + --- gdb-6.7.1.orig/debian/patches/powerpc-plt-stubs.patch +++ gdb-6.7.1/debian/patches/powerpc-plt-stubs.patch @@ -0,0 +1,153 @@ +Debian bug #432461. + +From gdb-patches-return-51861-listarch-gdb-patches=sources.redhat.com@sourceware.org Wed Oct 31 01:36:47 2007 +Return-Path: +Delivered-To: listarch-gdb-patches@sources.redhat.com +Received: (qmail 24242 invoked by alias); 31 Oct 2007 01:36:47 -0000 +Received: (qmail 24233 invoked by uid 22791); 31 Oct 2007 01:36:46 -0000 +X-Spam-Check-By: sourceware.org +Received: from mtagate3.de.ibm.com (HELO mtagate3.de.ibm.com) (195.212.29.152) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 31 Oct 2007 01:36:42 +0000 +Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate3.de.ibm.com (8.13.8/8.13.8) with ESMTP id l9V1aeTA168668 for ; Wed, 31 Oct 2007 01:36:40 GMT +Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.5) with ESMTP id l9V1adpS1749070 for ; Wed, 31 Oct 2007 02:36:39 +0100 +Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l9V1adsH000918 for ; Wed, 31 Oct 2007 02:36:39 +0100 +Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id l9V1adrr000915 for ; Wed, 31 Oct 2007 02:36:39 +0100 +Message-Id: <200710310136.l9V1adrr000915@d12av02.megacenter.de.ibm.com> +Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Wed, 31 Oct 2007 02:36:39 +0100 +Subject: [rfc] Fix mst_solib_trampoline symbol sections for PLT stubs +To: gdb-patches@sourceware.org +Date: Wed, 31 Oct 2007 02:36:39 +0100 (CET) +From: "Ulrich Weigand" +X-Mailer: ELM [version 2.5 PL2] +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Transfer-Encoding: 7bit +Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm +Precedence: bulk +List-Id: +List-Subscribe: +List-Archive: +List-Post: +List-Help: , +Sender: gdb-patches-owner@sourceware.org +Delivered-To: mailing list gdb-patches@sourceware.org + +Hello, + +we're still seeing problems on ppc when stepping over shared library +function calls, due to the issue previously discussed e.g. in: +http://sourceware.org/ml/gdb-patches/2006-06/msg00368.html + +Now, at the time the discussion primarily focussed on ways how to +identify PLT stubs via e.g. code reading or BFD synthetic symbols. + +However, looking at the existing code, it occurs to me that the +current method seems to be a valid approach, it's just that the +implementation is not quite correct. + +The basic idea is to make use of a hint the linker adds to +undefined dynamic symbols. When the main executable imports +a function from a shared library, it will have an undefined +symbol refering to that function in its dynamic symbol table. + +Now, for undefined symbols, the "value" is generally meaningless. +However, in this specific case, the linker actually may place a +significant piece of information into the value field: the address +of the PLT stub used to call the imported function. + +It is my understanding that this information is generally reliable, +as it is implemented e.g. to determine the value of a function +pointer constant refering to that symbol (due to the special ABI +rule that the "address" of a function imported into the main +executable, for function pointer comparison purpuses, is the +address of the PLT stub in the main executable). + +Thus, the current elf_symtab_read code attempts to use that hint +to construct a minimal symbol associating that address with the +name of the function. This is generally the correct thing to do, +as the code found at that address really is the stub used to call +that function. + +However, this place in elf_symtab_read uses the section information +from the original undefined symbol as the section that synthetic +minimal symbol resides in . This seems not particularly useful to me, +as that section is of course always the "undefined" section. + +This causes the minimal symbol to be defined in the "undefined" +section, which later on leads to it being ignored ... + + +Note that this is not a problem with minimal symbols in general, +nor even with mst_solib_trampoline symbols in general, only those +generated using this particular sort of hints in elf_symtab_read. + +Thus my suggestion would be to fix this problem by creating those +symbols with a proper section in the first place. The patch I'm +proposing below attempts to do that by searching for the section +covering the VMA identified as PLT stub address. If it cannot +find any, the hint is ignored. + + +This patch fixes the ppc32 step-over-shared-library-call problem, +fixing about two dozen FAILs in the test suite. + + +Any comments on that approach? Am I missing something here? + +Bye, +Ulrich + + +ChangeLog: + + * elfread.c (elf_symtab_read): When constructing a solib trampoline + minimal symbol from an undefined dynamic symbol, use proper section. + +--- + gdb/elfread.c | 26 +++++++++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +Index: gdb-6.7.1/gdb/elfread.c +=================================================================== +--- gdb-6.7.1.orig/gdb/elfread.c 2007-08-23 14:08:28.000000000 -0400 ++++ gdb-6.7.1/gdb/elfread.c 2007-12-31 11:02:10.000000000 -0500 +@@ -242,6 +242,8 @@ elf_symtab_read (struct objfile *objfile + && (sym->flags & BSF_FUNCTION)) + { + struct minimal_symbol *msym; ++ bfd *abfd = objfile->obfd; ++ asection *sect; + + /* Symbol is a reference to a function defined in + a shared library. +@@ -254,10 +256,28 @@ elf_symtab_read (struct objfile *objfile + symaddr = sym->value; + if (symaddr == 0) + continue; +- symaddr += offset; ++ ++ /* sym->section is the undefined section. However, we want to ++ record the section where the PLT stub resides with the ++ minimal symbol. Search the section table for the one that ++ covers the stub's address. */ ++ for (sect = abfd->sections; sect != NULL; sect = sect->next) ++ { ++ if ((bfd_get_section_flags (abfd, sect) & SEC_ALLOC) == 0) ++ continue; ++ ++ if (symaddr >= bfd_get_section_vma (abfd, sect) ++ && symaddr < bfd_get_section_vma (abfd, sect) ++ + bfd_get_section_size (sect)) ++ break; ++ } ++ if (!sect) ++ continue; ++ ++ symaddr += ANOFFSET (objfile->section_offsets, sect->index); ++ + msym = record_minimal_symbol +- ((char *) sym->name, symaddr, +- mst_solib_trampoline, sym->section, objfile); ++ ((char *) sym->name, symaddr, mst_solib_trampoline, sect, objfile); + #ifdef SOFUN_ADDRESS_MAYBE_MISSING + if (msym != NULL) + msym->filename = filesymname; --- gdb-6.7.1.orig/debian/patches/hppa-linux-build.patch +++ gdb-6.7.1/debian/patches/hppa-linux-build.patch @@ -0,0 +1,131 @@ +--- + gdb/hppa-linux-nat.c | 7 --- + gdb/hppa-linux-offsets.h | 103 +++++++++++++++++++++++++++++++++++++++++++++++ + 2 files changed, 105 insertions(+), 5 deletions(-) + +Index: gdb-6.7.1/gdb/hppa-linux-nat.c +=================================================================== +--- gdb-6.7.1.orig/gdb/hppa-linux-nat.c 2007-12-03 09:37:02.000000000 -0500 ++++ gdb-6.7.1/gdb/hppa-linux-nat.c 2007-12-03 09:45:59.000000000 -0500 +@@ -29,11 +29,8 @@ + #include + #include + +-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,43) +-#include +-#else +-#include +-#endif ++#include ++#include "hppa-linux-offsets.h" + + #include "hppa-tdep.h" + +Index: gdb-6.7.1/gdb/hppa-linux-offsets.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.7.1/gdb/hppa-linux-offsets.h 2007-12-03 09:47:08.000000000 -0500 +@@ -0,0 +1,103 @@ ++/* Register offsets for HPPA running GNU/Linux. ++ ++ Copyright (C) 2007 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#define PT_PSW offsetof(struct pt_regs, gr[ 0]) ++#define PT_GR1 offsetof(struct pt_regs, gr[ 1]) ++#define PT_GR2 offsetof(struct pt_regs, gr[ 2]) ++#define PT_GR3 offsetof(struct pt_regs, gr[ 3]) ++#define PT_GR4 offsetof(struct pt_regs, gr[ 4]) ++#define PT_GR5 offsetof(struct pt_regs, gr[ 5]) ++#define PT_GR6 offsetof(struct pt_regs, gr[ 6]) ++#define PT_GR7 offsetof(struct pt_regs, gr[ 7]) ++#define PT_GR8 offsetof(struct pt_regs, gr[ 8]) ++#define PT_GR9 offsetof(struct pt_regs, gr[ 9]) ++#define PT_GR10 offsetof(struct pt_regs, gr[10]) ++#define PT_GR11 offsetof(struct pt_regs, gr[11]) ++#define PT_GR12 offsetof(struct pt_regs, gr[12]) ++#define PT_GR13 offsetof(struct pt_regs, gr[13]) ++#define PT_GR14 offsetof(struct pt_regs, gr[14]) ++#define PT_GR15 offsetof(struct pt_regs, gr[15]) ++#define PT_GR16 offsetof(struct pt_regs, gr[16]) ++#define PT_GR17 offsetof(struct pt_regs, gr[17]) ++#define PT_GR18 offsetof(struct pt_regs, gr[18]) ++#define PT_GR19 offsetof(struct pt_regs, gr[19]) ++#define PT_GR20 offsetof(struct pt_regs, gr[20]) ++#define PT_GR21 offsetof(struct pt_regs, gr[21]) ++#define PT_GR22 offsetof(struct pt_regs, gr[22]) ++#define PT_GR23 offsetof(struct pt_regs, gr[23]) ++#define PT_GR24 offsetof(struct pt_regs, gr[24]) ++#define PT_GR25 offsetof(struct pt_regs, gr[25]) ++#define PT_GR26 offsetof(struct pt_regs, gr[26]) ++#define PT_GR27 offsetof(struct pt_regs, gr[27]) ++#define PT_GR28 offsetof(struct pt_regs, gr[28]) ++#define PT_GR29 offsetof(struct pt_regs, gr[29]) ++#define PT_GR30 offsetof(struct pt_regs, gr[30]) ++#define PT_GR31 offsetof(struct pt_regs, gr[31]) ++#define PT_FR0 offsetof(struct pt_regs, fr[ 0]) ++#define PT_FR1 offsetof(struct pt_regs, fr[ 1]) ++#define PT_FR2 offsetof(struct pt_regs, fr[ 2]) ++#define PT_FR3 offsetof(struct pt_regs, fr[ 3]) ++#define PT_FR4 offsetof(struct pt_regs, fr[ 4]) ++#define PT_FR5 offsetof(struct pt_regs, fr[ 5]) ++#define PT_FR6 offsetof(struct pt_regs, fr[ 6]) ++#define PT_FR7 offsetof(struct pt_regs, fr[ 7]) ++#define PT_FR8 offsetof(struct pt_regs, fr[ 8]) ++#define PT_FR9 offsetof(struct pt_regs, fr[ 9]) ++#define PT_FR10 offsetof(struct pt_regs, fr[10]) ++#define PT_FR11 offsetof(struct pt_regs, fr[11]) ++#define PT_FR12 offsetof(struct pt_regs, fr[12]) ++#define PT_FR13 offsetof(struct pt_regs, fr[13]) ++#define PT_FR14 offsetof(struct pt_regs, fr[14]) ++#define PT_FR15 offsetof(struct pt_regs, fr[15]) ++#define PT_FR16 offsetof(struct pt_regs, fr[16]) ++#define PT_FR17 offsetof(struct pt_regs, fr[17]) ++#define PT_FR18 offsetof(struct pt_regs, fr[18]) ++#define PT_FR19 offsetof(struct pt_regs, fr[19]) ++#define PT_FR20 offsetof(struct pt_regs, fr[20]) ++#define PT_FR21 offsetof(struct pt_regs, fr[21]) ++#define PT_FR22 offsetof(struct pt_regs, fr[22]) ++#define PT_FR23 offsetof(struct pt_regs, fr[23]) ++#define PT_FR24 offsetof(struct pt_regs, fr[24]) ++#define PT_FR25 offsetof(struct pt_regs, fr[25]) ++#define PT_FR26 offsetof(struct pt_regs, fr[26]) ++#define PT_FR27 offsetof(struct pt_regs, fr[27]) ++#define PT_FR28 offsetof(struct pt_regs, fr[28]) ++#define PT_FR29 offsetof(struct pt_regs, fr[29]) ++#define PT_FR30 offsetof(struct pt_regs, fr[30]) ++#define PT_FR31 offsetof(struct pt_regs, fr[31]) ++#define PT_SR0 offsetof(struct pt_regs, sr[ 0]) ++#define PT_SR1 offsetof(struct pt_regs, sr[ 1]) ++#define PT_SR2 offsetof(struct pt_regs, sr[ 2]) ++#define PT_SR3 offsetof(struct pt_regs, sr[ 3]) ++#define PT_SR4 offsetof(struct pt_regs, sr[ 4]) ++#define PT_SR5 offsetof(struct pt_regs, sr[ 5]) ++#define PT_SR6 offsetof(struct pt_regs, sr[ 6]) ++#define PT_SR7 offsetof(struct pt_regs, sr[ 7]) ++#define PT_IASQ0 offsetof(struct pt_regs, iasq[0]) ++#define PT_IASQ1 offsetof(struct pt_regs, iasq[1]) ++#define PT_IAOQ0 offsetof(struct pt_regs, iaoq[0]) ++#define PT_IAOQ1 offsetof(struct pt_regs, iaoq[1]) ++#define PT_CR27 offsetof(struct pt_regs, cr27) ++#define PT_ORIG_R28 offsetof(struct pt_regs, orig_r28) ++#define PT_KSP offsetof(struct pt_regs, ksp) ++#define PT_KPC offsetof(struct pt_regs, kpc) ++#define PT_SAR offsetof(struct pt_regs, sar) ++#define PT_IIR offsetof(struct pt_regs, iir) ++#define PT_ISR offsetof(struct pt_regs, isr) ++#define PT_IOR offsetof(struct pt_regs, ior) --- gdb-6.7.1.orig/debian/patches/bfd-get-mtime-less.patch +++ gdb-6.7.1/debian/patches/bfd-get-mtime-less.patch @@ -0,0 +1,82 @@ +--- + gdb/corefile.c | 3 +-- + gdb/exec.c | 4 ++++ + gdb/gdbcore.h | 3 +++ + gdb/source.c | 4 ++-- + 4 files changed, 10 insertions(+), 4 deletions(-) + +Index: gdb-6.6.dfsg.90.20070912/gdb/corefile.c +=================================================================== +--- gdb-6.6.dfsg.90.20070912.orig/gdb/corefile.c 2007-08-23 14:08:27.000000000 -0400 ++++ gdb-6.6.dfsg.90.20070912/gdb/corefile.c 2007-09-15 10:21:19.000000000 -0400 +@@ -160,10 +160,9 @@ reopen_exec_file (void) + /* If the timestamp of the exec file has changed, reopen it. */ + filename = xstrdup (bfd_get_filename (exec_bfd)); + make_cleanup (xfree, filename); +- mtime = bfd_get_mtime (exec_bfd); + res = stat (filename, &st); + +- if (mtime && mtime != st.st_mtime) ++ if (exec_bfd_mtime && exec_bfd_mtime != st.st_mtime) + exec_file_attach (filename, 0); + #endif + } +Index: gdb-6.6.dfsg.90.20070912/gdb/exec.c +=================================================================== +--- gdb-6.6.dfsg.90.20070912.orig/gdb/exec.c 2007-08-23 14:08:28.000000000 -0400 ++++ gdb-6.6.dfsg.90.20070912/gdb/exec.c 2007-09-15 10:21:19.000000000 -0400 +@@ -67,6 +67,7 @@ struct target_ops exec_ops; + /* The Binary File Descriptor handle for the executable file. */ + + bfd *exec_bfd = NULL; ++long exec_bfd_mtime = 0; + + /* Whether to open exec and core files read-only or read-write. */ + +@@ -134,6 +135,7 @@ exec_close (int quitting) + name, bfd_errmsg (bfd_get_error ())); + xfree (name); + exec_bfd = NULL; ++ exec_bfd_mtime = 0; + } + + if (exec_ops.to_sections) +@@ -258,6 +260,8 @@ exec_file_attach (char *filename, int fr + scratch_pathname, bfd_errmsg (bfd_get_error ())); + } + ++ exec_bfd_mtime = bfd_get_mtime (exec_bfd); ++ + validate_files (); + + set_gdbarch_from_file (exec_bfd); +Index: gdb-6.6.dfsg.90.20070912/gdb/gdbcore.h +=================================================================== +--- gdb-6.6.dfsg.90.20070912.orig/gdb/gdbcore.h 2007-08-23 14:08:33.000000000 -0400 ++++ gdb-6.6.dfsg.90.20070912/gdb/gdbcore.h 2007-09-15 10:21:19.000000000 -0400 +@@ -115,6 +115,9 @@ extern void specify_exec_file_hook (void + extern bfd *core_bfd; + extern bfd *exec_bfd; + ++/* The mtime when we last opened exec_bfd. */ ++extern long exec_bfd_mtime; ++ + /* Whether to open exec and core files read-only or read-write. */ + + extern int write_files; +Index: gdb-6.6.dfsg.90.20070912/gdb/source.c +=================================================================== +--- gdb-6.6.dfsg.90.20070912.orig/gdb/source.c 2007-08-23 14:08:38.000000000 -0400 ++++ gdb-6.6.dfsg.90.20070912/gdb/source.c 2007-09-15 10:22:11.000000000 -0400 +@@ -1126,9 +1126,9 @@ find_source_lines (struct symtab *s, int + perror_with_name (s->filename); + + if (s->objfile && s->objfile->obfd) +- mtime = bfd_get_mtime (s->objfile->obfd); ++ mtime = s->objfile->mtime; + else if (exec_bfd) +- mtime = bfd_get_mtime (exec_bfd); ++ mtime = exec_bfd_mtime; + + if (mtime && mtime < st.st_mtime) + warning (_("Source file is more recent than executable.")); --- gdb-6.7.1.orig/debian/patches/gdb-strings.patch +++ gdb-6.7.1/debian/patches/gdb-strings.patch @@ -0,0 +1,32 @@ +diff -Nur gdb-6.4.90.dfsg.orig/gdb/maint.c gdb-6.4.90.dfsg/gdb/maint.c +--- gdb-6.4.90.dfsg.orig/gdb/maint.c 2006-02-23 18:33:43.000000000 +0000 ++++ gdb-6.4.90.dfsg/gdb/maint.c 2006-09-30 16:42:40.000000000 +0100 +@@ -851,14 +851,14 @@ + + add_cmd ("deprecate", class_maintenance, maintenance_deprecate, _("\ + Deprecate a command. Note that this is just in here so the \n\ +-testsuite can check the comamnd deprecator. You probably shouldn't use this,\n\ ++testsuite can check the command deprecator. You probably shouldn't use this,\n\ + rather you should use the C function deprecate_cmd(). If you decide you \n\ + want to use it: maintenance deprecate 'commandname' \"replacement\". The \n\ + replacement is optional."), &maintenancelist); + + add_cmd ("undeprecate", class_maintenance, maintenance_undeprecate, _("\ + Undeprecate a command. Note that this is just in here so the \n\ +-testsuite can check the comamnd deprecator. You probably shouldn't use this,\n\ ++testsuite can check the command deprecator. You probably shouldn't use this,\n\ + If you decide you want to use it: maintenance undeprecate 'commandname'"), + &maintenancelist); + +diff -Nur gdb-6.4.90.dfsg.orig/gdb/remote.c gdb-6.4.90.dfsg/gdb/remote.c +--- gdb-6.4.90.dfsg.orig/gdb/remote.c 2006-05-05 21:08:45.000000000 +0100 ++++ gdb-6.4.90.dfsg/gdb/remote.c 2006-09-30 16:43:32.000000000 +0100 +@@ -4795,7 +4795,7 @@ + do_cleanups (old_chain); + } + if (mismatched > 0) +- warning (_("One or more sections of the remote executable does not match\n\ ++ warning (_("One or more sections of the remote executable do not match\n\ + the loaded file\n")); + if (args && !matched) + printf_filtered (_("No loaded section named '%s'.\n"), args); --- gdb-6.7.1.orig/debian/patches/gdb-fortran-main.patch +++ gdb-6.7.1/debian/patches/gdb-fortran-main.patch @@ -0,0 +1,86 @@ +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. + +--- + gdb/symtab.c | 8 +++++-- + gdb/testsuite/gdb.fortran/lang.exp | 40 +++++++++++++++++++++++++++++++++++++ + 2 files changed, 46 insertions(+), 2 deletions(-) + +Index: gdb/symtab.c +=================================================================== +--- gdb/symtab.c.orig 2007-12-03 09:37:59.000000000 -0500 ++++ gdb/symtab.c 2007-12-03 09:38:06.000000000 -0500 +@@ -4150,8 +4150,12 @@ find_main_name (void) + } + + /* The languages above didn't identify the name of the main procedure. +- Fallback to "main". */ +- set_main_name ("main"); ++ 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 * +Index: gdb/testsuite/gdb.fortran/lang.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb/testsuite/gdb.fortran/lang.exp 2007-12-03 09:38:06.000000000 -0500 +@@ -0,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)" --- gdb-6.7.1.orig/debian/patches/pie-support.patch +++ gdb-6.7.1/debian/patches/pie-support.patch @@ -0,0 +1,1123 @@ +--- ./gdb/auxv.c.orig 2006-07-12 20:13:45.000000000 +0200 ++++ ./gdb/auxv.c 2007-01-04 13:07:44.000000000 +0100 +@@ -82,7 +82,7 @@ + Return 1 if an entry was read into *TYPEP and *VALP. */ + int + target_auxv_parse (struct target_ops *ops, gdb_byte **readptr, +- gdb_byte *endptr, CORE_ADDR *typep, CORE_ADDR *valp) ++ gdb_byte *endptr, ULONGEST *typep, CORE_ADDR *valp) + { + const int sizeof_auxv_field = TYPE_LENGTH (builtin_type_void_data_ptr); + gdb_byte *ptr = *readptr; +@@ -107,9 +107,10 @@ + an error getting the information. On success, return 1 after + storing the entry's value field in *VALP. */ + int +-target_auxv_search (struct target_ops *ops, CORE_ADDR match, CORE_ADDR *valp) ++target_auxv_search (struct target_ops *ops, ULONGEST match, CORE_ADDR *valp) + { +- CORE_ADDR type, val; ++ CORE_ADDR val; ++ ULONGEST at_type; + gdb_byte *data; + LONGEST n = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL, &data); + gdb_byte *ptr = data; +@@ -119,10 +120,10 @@ + return n; + + while (1) +- switch (target_auxv_parse (ops, &ptr, data + n, &type, &val)) ++ switch (target_auxv_parse (ops, &ptr, data + n, &at_type, &val)) + { + case 1: /* Here's an entry, check it. */ +- if (type == match) ++ if (at_type == match) + { + xfree (data); + *valp = val; +@@ -145,7 +146,8 @@ + int + fprint_target_auxv (struct ui_file *file, struct target_ops *ops) + { +- CORE_ADDR type, val; ++ CORE_ADDR val; ++ ULONGEST at_type; + gdb_byte *data; + LONGEST len = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL, + &data); +@@ -155,14 +157,14 @@ + if (len <= 0) + return len; + +- while (target_auxv_parse (ops, &ptr, data + len, &type, &val) > 0) ++ while (target_auxv_parse (ops, &ptr, data + len, &at_type, &val) > 0) + { + extern int addressprint; + const char *name = "???"; + const char *description = ""; + enum { dec, hex, str } flavor = hex; + +- switch (type) ++ switch (at_type) + { + #define TAG(tag, text, kind) \ + case tag: name = #tag; description = text; flavor = kind; break +@@ -213,7 +215,7 @@ + } + + fprintf_filtered (file, "%-4s %-20s %-30s ", +- paddr_d (type), name, description); ++ paddr_d (at_type), name, description); + switch (flavor) + { + case dec: +--- ./gdb/auxv.h.orig 2006-07-12 20:13:45.000000000 +0200 ++++ ./gdb/auxv.h 2007-01-04 13:07:44.000000000 +0100 +@@ -37,14 +37,14 @@ + Return 1 if an entry was read into *TYPEP and *VALP. */ + extern int target_auxv_parse (struct target_ops *ops, + gdb_byte **readptr, gdb_byte *endptr, +- CORE_ADDR *typep, CORE_ADDR *valp); ++ ULONGEST *typep, CORE_ADDR *valp); + + /* Extract the auxiliary vector entry with a_type matching MATCH. + Return zero if no such entry was found, or -1 if there was + an error getting the information. On success, return 1 after + storing the entry's value field in *VALP. */ + extern int target_auxv_search (struct target_ops *ops, +- CORE_ADDR match, CORE_ADDR *valp); ++ ULONGEST match, CORE_ADDR *valp); + + /* Print the contents of the target's AUXV on the specified file. */ + extern int fprint_target_auxv (struct ui_file *file, struct target_ops *ops); +--- ./gdb/breakpoint.c.orig 2006-10-19 17:58:25.000000000 +0200 ++++ ./gdb/breakpoint.c 2007-01-04 13:07:44.000000000 +0100 +@@ -3810,6 +3810,7 @@ + printf_filtered ("%s%s ", + ((b->enable_state == bp_disabled || + b->enable_state == bp_shlib_disabled || ++ b->enable_state == bp_startup_disabled || + b->enable_state == bp_call_disabled) + ? " (disabled)" + : b->enable_state == bp_permanent +@@ -4487,6 +4488,62 @@ + } + } + ++void ++disable_breakpoints_at_startup (int silent) ++{ ++ struct breakpoint *b; ++ int disabled_startup_breaks = 0; ++ ++ if (bfd_get_start_address (exec_bfd) != entry_point_address ()) ++ { ++ ALL_BREAKPOINTS (b) ++ { ++ if (((b->type == bp_breakpoint) || ++ (b->type == bp_hardware_breakpoint)) && ++ b->enable_state == bp_enabled && ++ !b->loc->duplicate) ++ { ++ b->enable_state = bp_startup_disabled; ++ if (!silent) ++ { ++ if (!disabled_startup_breaks) ++ { ++ target_terminal_ours_for_output (); ++ warning ("Temporarily disabling breakpoints:"); ++ } ++ disabled_startup_breaks = 1; ++ warning ("breakpoint #%d addr 0x%s", b->number, paddr_nz(b->loc->address)); ++ } ++ } ++ } ++ } ++} ++ ++/* Try to reenable any breakpoints after startup. */ ++void ++re_enable_breakpoints_at_startup (void) ++{ ++ struct breakpoint *b; ++ ++ if (bfd_get_start_address (exec_bfd) != entry_point_address ()) ++ { ++ ALL_BREAKPOINTS (b) ++ if (b->enable_state == bp_startup_disabled) ++ { ++ char buf[1]; ++ ++ /* Do not reenable the breakpoint if the shared library ++ is still not mapped in. */ ++ if (target_read_memory (b->loc->address, buf, 1) == 0) ++ { ++ /*printf ("enabling breakpoint at 0x%s\n", paddr_nz(b->loc->address));*/ ++ b->enable_state = bp_enabled; ++ } ++ } ++ } ++} ++ ++ + static void + solib_load_unload_1 (char *hookname, int tempflag, char *dll_pathname, + char *cond_string, enum bptype bp_kind) +@@ -6833,6 +6890,7 @@ + && !b->loc->duplicate + && b->enable_state != bp_disabled + && b->enable_state != bp_shlib_disabled ++ && b->enable_state != bp_startup_disabled + && !b->pending + && b->enable_state != bp_call_disabled) + { +@@ -7048,7 +7106,8 @@ + break; + + save_enable = b->enable_state; +- if (b->enable_state != bp_shlib_disabled) ++ if (b->enable_state != bp_shlib_disabled ++ || b->enable_state != bp_shlib_disabled) + b->enable_state = bp_disabled; + else + /* If resetting a shlib-disabled breakpoint, we don't want to +--- ./gdb/breakpoint.h.orig 2006-04-18 21:20:06.000000000 +0200 ++++ ./gdb/breakpoint.h 2007-01-04 13:07:44.000000000 +0100 +@@ -159,6 +159,7 @@ + automatically enabled and reset when the call + "lands" (either completes, or stops at another + eventpoint). */ ++ bp_startup_disabled, + bp_permanent /* There is a breakpoint instruction hard-wired into + the target's code. Don't try to write another + breakpoint instruction on top of it, or restore +@@ -794,8 +795,12 @@ + + extern void disable_breakpoints_in_shlibs (int silent); + ++extern void disable_breakpoints_at_startup (int silent); ++ + extern void re_enable_breakpoints_in_shlibs (void); + ++void re_enable_breakpoints_at_startup (void); ++ + extern void create_solib_load_event_breakpoint (char *, int, char *, char *); + + extern void create_solib_unload_event_breakpoint (char *, int, +--- ./gdb/dwarf2read.c.orig 2006-11-02 22:34:07.000000000 +0100 ++++ ./gdb/dwarf2read.c 2007-01-04 13:07:44.000000000 +0100 +@@ -1219,7 +1219,7 @@ + else + dwarf2_per_objfile->loc_buffer = NULL; + +- if (mainline ++ if ((mainline == 1) + || (objfile->global_psymbols.size == 0 + && objfile->static_psymbols.size == 0)) + { +--- ./gdb/elfread.c.orig 2006-02-21 21:38:48.000000000 +0100 ++++ ./gdb/elfread.c 2007-01-04 13:07:44.000000000 +0100 +@@ -556,7 +556,7 @@ + /* If we are reinitializing, or if we have never loaded syms yet, + set table to empty. MAINLINE is cleared so that *_read_psymtab + functions do not all also re-initialize the psymbol table. */ +- if (mainline) ++ if (mainline == 1) + { + init_psymbol_list (objfile, 0); + mainline = 0; +--- ./gdb/infrun.c.orig 2006-10-18 18:56:13.000000000 +0200 ++++ ./gdb/infrun.c 2007-01-04 13:07:44.000000000 +0100 +@@ -2203,6 +2203,11 @@ + code segments in shared libraries might be mapped in now. */ + re_enable_breakpoints_in_shlibs (); + ++ /* For PIE executables, we dont really know where the ++ breakpoints are going to be until we start up the ++ inferior. */ ++ re_enable_breakpoints_at_startup (); ++ + /* 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/objfiles.c.orig 2006-08-08 19:39:10.000000000 +0200 ++++ ./gdb/objfiles.c 2007-01-04 13:07:44.000000000 +0100 +@@ -50,6 +50,9 @@ + #include "dictionary.h" + #include "source.h" + ++#include "auxv.h" ++#include "elf/common.h" ++ + /* Prototypes for local functions */ + + static void objfile_alloc_data (struct objfile *objfile); +@@ -261,7 +264,19 @@ + CORE_ADDR + entry_point_address (void) + { +- return symfile_objfile ? symfile_objfile->ei.entry_point : 0; ++ int ret; ++ CORE_ADDR entry_addr; ++ ++ /* Find the address of the entry point of the program from the ++ auxv vector. */ ++ ret = target_auxv_search (¤t_target, AT_ENTRY, &entry_addr); ++ if (ret == 1) ++ return entry_addr; ++ /*if (ret == 0 || ret == -1)*/ ++ else ++ { ++ return symfile_objfile ? symfile_objfile->ei.entry_point : 0; ++ } + } + + /* Create the terminating entry of OBJFILE's minimal symbol table. +--- ./gdb/solib-svr4.c.orig 2006-10-18 17:34:39.000000000 +0200 ++++ ./gdb/solib-svr4.c 2007-01-04 13:11:34.000000000 +0100 +@@ -34,6 +34,8 @@ + #include "gdbcore.h" + #include "target.h" + #include "inferior.h" ++#include "auxv.h" ++#include "command.h" + + #include "gdb_assert.h" + +@@ -278,7 +280,9 @@ + + /* Local function prototypes */ + ++#if 0 + static int match_main (char *); ++#endif + + static CORE_ADDR bfd_lookup_symbol (bfd *, char *, flagword); + +@@ -400,22 +404,79 @@ + { + struct bfd_section *dyninfo_sect; + int dyninfo_sect_size; +- CORE_ADDR dyninfo_addr; ++ CORE_ADDR dyninfo_addr, relocated_dyninfo_addr, entry_addr; + gdb_byte *buf; + gdb_byte *bufend; + int arch_size; ++ int ret; ++ ++ /* Find the address of the entry point of the program from the ++ auxv vector. */ ++ ret = target_auxv_search (¤t_target, AT_ENTRY, &entry_addr); ++ ++ if (ret == 0 || ret == -1) ++ { ++ /* No auxv info, maybe an older kernel. Fake our way through. */ ++ entry_addr = bfd_get_start_address (exec_bfd); ++ ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "elf_locate_base: program entry address not found. Using bfd's 0x%s for %s\n", ++ paddr_nz (entry_addr), exec_bfd->filename); ++ } ++ else ++ { ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "elf_locate_base: found program entry address 0x%s for %s\n", ++ paddr_nz (entry_addr), exec_bfd->filename); ++ } + + /* Find the start address of the .dynamic section. */ + dyninfo_sect = bfd_get_section_by_name (exec_bfd, ".dynamic"); + if (dyninfo_sect == NULL) +- return 0; ++ { ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "elf_locate_base: .dynamic section not found in %s -- return now\n", ++ exec_bfd->filename); ++ return 0; ++ } ++ else ++ { ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "elf_locate_base: .dynamic section found in %s\n", ++ exec_bfd->filename); ++ } ++ + dyninfo_addr = bfd_section_vma (exec_bfd, dyninfo_sect); ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "elf_locate_base: unrelocated .dynamic addr 0x%s\n", ++ paddr_nz (dyninfo_addr)); ++ ++ relocated_dyninfo_addr = dyninfo_addr ++ + entry_addr - bfd_get_start_address(exec_bfd); ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "elf_locate_base: relocated .dyn addr 0x%s for %s\n", ++ paddr_nz(relocated_dyninfo_addr), exec_bfd->filename); + + /* Read in .dynamic section, silently ignore errors. */ + dyninfo_sect_size = bfd_section_size (exec_bfd, dyninfo_sect); + buf = alloca (dyninfo_sect_size); +- if (target_read_memory (dyninfo_addr, buf, dyninfo_sect_size)) +- return 0; ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "elf_locate_base: read in .dynamic section\n"); ++ if (target_read_memory (relocated_dyninfo_addr, buf, dyninfo_sect_size)) ++ { ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "elf_locate_base: couldn't read .dynamic section at 0x%s -- return now\n", ++ paddr_nz (relocated_dyninfo_addr)); ++ return 0; ++ } + + /* Find the DT_DEBUG entry in the the .dynamic section. + For mips elf we look for DT_MIPS_RLD_MAP, mips elf apparently has +@@ -442,6 +503,10 @@ + { + dyn_ptr = bfd_h_get_32 (exec_bfd, + (bfd_byte *) x_dynp->d_un.d_ptr); ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "elf_locate_base: DT_DEBUG entry has value 0x%s -- return now\n", ++ paddr_nz (dyn_ptr)); + return dyn_ptr; + } + else if (dyn_tag == DT_MIPS_RLD_MAP) +@@ -567,6 +632,10 @@ + { + struct link_map_offsets *lmo = svr4_fetch_link_map_offsets (); + ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "solib_svr4_r_map: read at 0x%s\n", ++ paddr_nz (debug_base + lmo->r_map_offset)); + return read_memory_typed_address (debug_base + lmo->r_map_offset, + builtin_type_void_data_ptr); + } +@@ -724,6 +793,11 @@ + struct so_list **link_ptr = &head; + CORE_ADDR ldsomap = 0; + ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_current_sos: exec_bfd %s\n", ++ exec_bfd->filename); ++ + /* Make sure we've looked up the inferior's dynamic linker's base + structure. */ + if (! debug_base) +@@ -738,6 +812,10 @@ + + /* Walk the inferior's link map list, and build our list of + `struct so_list' nodes. */ ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_current_sos: walk link map in %s\n", ++ exec_bfd->filename); + lm = solib_svr4_r_map (); + + while (lm) +@@ -753,23 +831,103 @@ + new->lm_info->lm = xzalloc (lmo->link_map_size); + make_cleanup (xfree, new->lm_info->lm); + ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_current_sos: read lm at 0x%s\n", paddr_nz(lm)); + read_memory (lm, new->lm_info->lm, lmo->link_map_size); + + lm = LM_NEXT (new); + ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_current_sos: is first link entry? %d\n", ++ IGNORE_FIRST_LINK_MAP_ENTRY (new)); ++ + /* For SVR4 versions, the first entry in the link map is for the + inferior executable, so we must ignore it. For some versions of + SVR4, it has no name. For others (Solaris 2.3 for example), it + does have a name, so we can no longer use a missing name to + decide when to ignore it. */ + if (IGNORE_FIRST_LINK_MAP_ENTRY (new) && ldsomap == 0) +- free_so (new); ++ { ++ /* It is the first link map entry, i.e. it is the main executable. */ ++ ++ if (bfd_get_start_address (exec_bfd) == entry_point_address ()) ++ { ++ /* Non-pie case, main executable has not been relocated. */ ++ free_so (new); ++ } ++ else ++ { ++ /* Pie case, main executable has been relocated. */ ++ struct so_list *gdb_solib; ++ ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_current_sos: Processing first link map entry\n"); ++ strncpy (new->so_name, exec_bfd->filename, ++ SO_NAME_MAX_PATH_SIZE - 1); ++ new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; ++ strcpy (new->so_original_name, new->so_name); ++ /*new->main = 1;*/ ++ new->main_relocated = 0; ++ ++ if (debug_solib) ++ { ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_current_sos: Processing nameless DSO\n"); ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_current_sos: adding name %s\n", ++ new->so_name); ++ } ++ ++ for (gdb_solib = master_so_list (); ++ gdb_solib; ++ gdb_solib = gdb_solib->next) ++ { ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_current_sos: compare gdb %s and new %s\n", ++ gdb_solib->so_name, new->so_name); ++ if (strcmp (gdb_solib->so_name, new->so_name) == 0) ++ if (gdb_solib->main_relocated) ++ { ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_current_sos: found main relocated\n"); ++ break; ++ } ++ } ++ ++ if ((gdb_solib && !gdb_solib->main_relocated) || (!gdb_solib)) ++ { ++ add_to_target_sections (0 /*from_tty*/, ¤t_target, new); ++ new->main = 1; ++ } ++ ++ /* We need this in the list of shared libs we return because ++ solib_add_stub will loop through it and add the symbol file. */ ++ new->next = 0; ++ *link_ptr = new; ++ link_ptr = &new->next; ++ } ++ } /* End of IGNORE_FIRST_LINK_MAP_ENTRY */ + else + { ++ /* This is not the first link map entry, i.e. is not the main ++ executable. Note however that it could be the DSO supplied on ++ certain systems (i.e. Linux 2.6) containing information about ++ the vsyscall page. We must ignore such entry. This entry is ++ nameless (just like the one for the main executable, sigh). */ ++ + int errcode; + char *buffer; + + /* Extract this shared object's name. */ ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_current_sos: read LM_NAME\n"); ++ + target_read_string (LM_NAME (new), &buffer, + SO_NAME_MAX_PATH_SIZE - 1, &errcode); + if (errcode != 0) +@@ -777,22 +935,37 @@ + safe_strerror (errcode)); + else + { +- strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); +- new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; +- xfree (buffer); +- strcpy (new->so_original_name, new->so_name); +- } +- +- /* If this entry has no name, or its name matches the name +- for the main executable, don't include it in the list. */ +- if (! new->so_name[0] +- || match_main (new->so_name)) +- free_so (new); +- else +- { +- new->next = 0; +- *link_ptr = new; +- link_ptr = &new->next; ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_current_sos: LM_NAME is <%s>\n", ++ buffer); ++ /* The name could be empty, in which case it is the ++ system supplied DSO. */ ++ if (strcmp (buffer, "") == 0) ++ { ++ xfree (buffer); ++ free_so (new); ++ } ++ else ++ { ++ strncpy (new->so_name, buffer, SO_NAME_MAX_PATH_SIZE - 1); ++ new->so_name[SO_NAME_MAX_PATH_SIZE - 1] = '\0'; ++ xfree (buffer); ++ strcpy (new->so_original_name, new->so_name); ++ if (debug_solib) ++ { ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_current_sos: Processing DSO: %s\n", ++ new->so_name); ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_current_sos: first link entry %d\n", ++ IGNORE_FIRST_LINK_MAP_ENTRY (new)); ++ } ++ ++ new->next = 0; ++ *link_ptr = new; ++ link_ptr = &new->next; ++ } + } + } + +@@ -809,6 +982,11 @@ + if (head == NULL) + return svr4_default_sos (); + ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_current_sos: ENDS %s\n", ++ exec_bfd->filename); ++ + return head; + } + +@@ -885,7 +1063,7 @@ + /* On some systems, the only way to recognize the link map entry for + the main executable file is by looking at its name. Return + non-zero iff SONAME matches one of the known main executable names. */ +- ++#if 0 + static int + match_main (char *soname) + { +@@ -899,6 +1077,7 @@ + + return (0); + } ++#endif + + /* Return 1 if PC lies in the dynamic symbol resolution code of the + SVR4 run time loader. */ +@@ -998,6 +1177,11 @@ + /* Find the .interp section; if not found, warn the user and drop + into the old breakpoint at symbol code. */ + interp_sect = bfd_get_section_by_name (exec_bfd, ".interp"); ++ ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "enable_break: search for .interp in %s\n", ++ exec_bfd->filename); + if (interp_sect) + { + unsigned int interp_sect_size; +@@ -1036,6 +1220,9 @@ + if (tmp_fd >= 0) + tmp_bfd = bfd_fopen (tmp_pathname, gnutarget, FOPEN_RB, tmp_fd); + ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "enable_break: opening %s\n", tmp_pathname); + if (tmp_bfd == NULL) + goto bkpt_at_symbol; + +@@ -1123,6 +1310,9 @@ + if (sym_addr != 0) + { + create_solib_event_breakpoint (load_addr + sym_addr); ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "enable_break: solib bp set\n"); + return 1; + } + +@@ -1384,6 +1574,8 @@ + while (stop_signal != TARGET_SIGNAL_TRAP); + stop_soon = NO_STOP_QUIETLY; + #endif /* defined(_SCO_DS) */ ++ ++ disable_breakpoints_at_startup (1); + } + + static void +@@ -1570,6 +1762,75 @@ + + return lmp; + } ++void ++info_linkmap_command (char *cmd, int from_tty) ++{ ++ CORE_ADDR lm; ++ ++ /* Make sure we've looked up the inferior's dynamic linker's base ++ structure. */ ++ if (! debug_base) ++ { ++ debug_base = locate_base (); ++ ++ /* If we can't find the dynamic linker's base structure, this ++ must not be a dynamically linked executable. Hmm. */ ++ if (! debug_base) ++ { ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_print_linkmap: no DT_DEBUG found in %s -- return now\n", ++ exec_bfd->filename); ++ return; ++ } ++ } ++ ++ /* Walk the inferior's link map list, and print the info. */ ++ ++ lm = solib_svr4_r_map (); ++ while (lm) ++ { ++ int errcode; ++ char *buffer; ++ CORE_ADDR load_addr; ++ ++ struct link_map_offsets *lmo = svr4_fetch_link_map_offsets (); ++ struct so_list *new ++ = (struct so_list *) xmalloc (sizeof (struct so_list)); ++ struct cleanup *old_chain = make_cleanup (xfree, new); ++ ++ memset (new, 0, sizeof (*new)); ++ ++ new->lm_info = xmalloc (sizeof (struct lm_info)); ++ make_cleanup (xfree, new->lm_info); ++ ++ new->lm_info->lm = xmalloc (lmo->link_map_size); ++ make_cleanup (xfree, new->lm_info->lm); ++ memset (new->lm_info->lm, 0, lmo->link_map_size); ++ ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "svr4_print_linkmap: read lm at 0x%s\n", paddr_nz(lm)); ++ read_memory (lm, new->lm_info->lm, lmo->link_map_size); ++ ++ lm = LM_NEXT (new); ++ ++ /* Load address. */ ++ load_addr = LM_ADDR_CHECK (new, NULL); ++ /* Shared object's name. */ ++ target_read_string (LM_NAME (new), &buffer, ++ SO_NAME_MAX_PATH_SIZE - 1, &errcode); ++ make_cleanup (xfree, buffer); ++ if (errcode != 0) ++ { ++ warning ("svr4_print_linkmap: Can't read pathname for load map: %s\n", ++ safe_strerror (errcode)); ++ } ++ fprintf_filtered (gdb_stdout, "%-8s %-30s\n", paddr(load_addr), buffer); ++ do_cleanups (old_chain); ++ } ++} ++ + + + static struct target_so_ops svr4_so_ops; +@@ -1592,4 +1853,8 @@ + + /* FIXME: Don't do this here. *_gdbarch_init() should set so_ops. */ + current_target_so_ops = &svr4_so_ops; ++ ++ add_info ("linkmap", info_linkmap_command, ++ "Display the inferior's linkmap."); ++ + } +--- ./gdb/solib.c.orig 2006-10-19 21:58:23.000000000 +0200 ++++ ./gdb/solib.c 2007-01-04 13:07:44.000000000 +0100 +@@ -72,6 +72,8 @@ + + /* external data declarations */ + ++int debug_solib; ++ + /* FIXME: gdbarch needs to control this variable */ + struct target_so_ops *current_target_so_ops; + +@@ -102,6 +104,8 @@ + value); + } + ++void add_to_target_sections (int, struct target_ops *, struct so_list *); ++ + /* + + GLOBAL FUNCTION +@@ -376,7 +380,6 @@ + xfree (so); + } + +- + /* Return address of first so_list entry in master shared object list. */ + struct so_list * + master_so_list (void) +@@ -384,7 +387,6 @@ + return so_list_head; + } + +- + /* A small stub to get us past the arg-passing pinhole of catch_errors. */ + + static int +@@ -396,15 +398,40 @@ + /* Have we already loaded this shared object? */ + ALL_OBJFILES (so->objfile) + { +- if (strcmp (so->objfile->name, so->so_name) == 0) ++ /* Found an already loaded shared library. */ ++ if (strcmp (so->objfile->name, so->so_name) == 0 ++ && !so->main) + return 1; ++ /* Found an already loaded main executable. This could happen in ++ two circumstances. ++ First case: the main file has already been read in ++ as the first thing that gdb does at startup, and the file ++ hasn't been relocated properly yet. Therefor we need to read ++ it in with the proper section info. ++ Second case: it has been read in with the correct relocation, ++ and therefore we need to skip it. */ ++ if (strcmp (so->objfile->name, so->so_name) == 0 ++ && so->main ++ && so->main_relocated) ++ return 1; + } + + sap = build_section_addr_info_from_section_table (so->sections, + so->sections_end); + +- so->objfile = symbol_file_add (so->so_name, so->from_tty, +- sap, 0, OBJF_SHARED); ++ if (so->main) ++ { ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "symbol_add_stub: adding symbols for main\n"); ++ so->objfile = symbol_file_add (so->so_name, /*so->from_tty*/ 0, ++ sap, 1, 0); ++ so->main_relocated = 1; ++ } ++ else ++ so->objfile = symbol_file_add (so->so_name, so->from_tty, ++ sap, 0, OBJF_SHARED); ++ + free_section_addr_info (sap); + + return (1); +@@ -532,6 +559,10 @@ + the inferior's current list. */ + while (i) + { ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "update_solib_list: compare gdb:%s and inferior:%s\n", ++ gdb->so_original_name, i->so_original_name); + if (! strcmp (gdb->so_original_name, i->so_original_name)) + break; + +@@ -585,28 +616,7 @@ + /* Fill in the rest of each of the `struct so_list' nodes. */ + for (i = inferior; i; i = i->next) + { +- i->from_tty = from_tty; +- +- /* Fill in the rest of the `struct so_list' node. */ +- catch_errors (solib_map_sections, i, +- "Error while mapping shared library sections:\n", +- RETURN_MASK_ALL); +- +- /* If requested, add the shared object's sections to the TARGET's +- section table. Do this immediately after mapping the object so +- that later nodes in the list can query this object, as is needed +- in solib-osf.c. */ +- if (target) +- { +- int count = (i->sections_end - i->sections); +- if (count > 0) +- { +- int space = target_resize_to_sections (target, count); +- memcpy (target->to_sections + space, +- i->sections, +- count * sizeof (i->sections[0])); +- } +- } ++ add_to_target_sections (from_tty, target, i); + + /* Notify any observer that the shared object has been + loaded now that we've added it to GDB's tables. */ +@@ -702,6 +712,41 @@ + } + } + ++void ++add_to_target_sections (int from_tty, struct target_ops *target, struct so_list *solib) ++{ ++ /* If this is set, then the sections have been already added to the ++ target list. */ ++ if (solib->main) ++ return; ++ ++ solib->from_tty = from_tty; ++ ++ /* Fill in the rest of the `struct so_list' node. */ ++ catch_errors (solib_map_sections, solib, ++ "Error while mapping shared library sections:\n", ++ RETURN_MASK_ALL); ++ ++ /* If requested, add the shared object's sections to the TARGET's ++ section table. Do this immediately after mapping the object so ++ that later nodes in the list can query this object, as is needed ++ in solib-osf.c. */ ++ if (target) ++ { ++ int count = (solib->sections_end - solib->sections); ++ if (count > 0) ++ { ++ int space = target_resize_to_sections (target, count); ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "add_to_target_sections: add %s to to_sections\n", ++ solib->so_original_name); ++ memcpy (target->to_sections + space, ++ solib->sections, ++ count * sizeof (solib->sections[0])); ++ } ++ } ++} + + /* + +@@ -1006,4 +1051,12 @@ + reload_shared_libraries, + show_solib_search_path, + &setlist, &showlist); ++ ++ add_setshow_boolean_cmd ("solib", no_class, &debug_solib, ++ _("\ ++Set debugging of GNU/Linux shlib module.\n"), _("\ ++Show debugging status of GNU/Linux shlib module.\n"), _("\ ++Enables printf debugging output of GNU/Linux shlib module.\n"), ++ NULL, NULL, ++ &setdebuglist, &showdebuglist); + } +--- ./gdb/solist.h.orig 2005-12-17 23:34:02.000000000 +0100 ++++ ./gdb/solist.h 2007-01-04 13:07:44.000000000 +0100 +@@ -62,6 +62,8 @@ + bfd *abfd; + char symbols_loaded; /* flag: symbols read in yet? */ + char from_tty; /* flag: print msgs? */ ++ char main; /* flag: is this the main executable? */ ++ char main_relocated; /* flag: has it been relocated yet? */ + struct objfile *objfile; /* objfile for loaded lib */ + struct section_table *sections; + struct section_table *sections_end; +@@ -113,9 +115,15 @@ + /* Return address of first so_list entry in master shared object list. */ + struct so_list *master_so_list (void); + ++/* Return address of first so_list entry in master shared object list. */ ++struct so_list *master_so_list (void); ++ + /* Find solib binary file and open it. */ + extern int solib_open (char *in_pathname, char **found_pathname); + ++/* Add the list of sections in so_list to the target to_sections. */ ++extern void add_to_target_sections (int, struct target_ops *, struct so_list *); ++ + /* FIXME: gdbarch needs to control this variable */ + extern struct target_so_ops *current_target_so_ops; + +@@ -126,4 +134,6 @@ + #define TARGET_SO_IN_DYNSYM_RESOLVE_CODE \ + (current_target_so_ops->in_dynsym_resolve_code) + ++/* Controls the printing of debugging output. */ ++extern int debug_solib; + #endif +--- ./gdb/symfile-mem.c.orig 2005-12-17 23:34:03.000000000 +0100 ++++ ./gdb/symfile-mem.c 2007-01-04 13:07:44.000000000 +0100 +@@ -110,7 +110,7 @@ + } + + objf = symbol_file_add_from_bfd (nbfd, from_tty, +- sai, 0, OBJF_SHARED); ++ sai, 2, OBJF_SHARED); + + /* This might change our ideas about frames already looked at. */ + reinit_frame_cache (); +--- ./gdb/symfile.c.orig 2006-09-21 16:00:53.000000000 +0200 ++++ ./gdb/symfile.c 2007-01-04 13:12:36.000000000 +0100 +@@ -49,6 +49,7 @@ + #include "readline/readline.h" + #include "gdb_assert.h" + #include "block.h" ++#include "varobj.h" + #include "observer.h" + #include "exec.h" + #include "parser-defs.h" +@@ -659,7 +660,7 @@ + + /* Now either addrs or offsets is non-zero. */ + +- if (mainline) ++ if (mainline == 1) + { + /* We will modify the main symbol table, make sure that all its users + will be cleaned up if an error occurs during symbol reading. */ +@@ -687,7 +688,7 @@ + + We no longer warn if the lowest section is not a text segment (as + happens for the PA64 port. */ +- if (!mainline && addrs && addrs->other[0].name) ++ if (/*!mainline &&*/ addrs && addrs->other[0].name) + { + asection *lower_sect; + asection *sect; +@@ -856,17 +857,21 @@ + /* If this is the main symbol file we have to clean up all users of the + old main symbol file. Otherwise it is sufficient to fixup all the + breakpoints that may have been redefined by this symbol file. */ +- if (mainline) ++ if (mainline == 1) + { + /* OK, make it the "real" symbol file. */ + symfile_objfile = objfile; + + clear_symtab_users (); + } +- else ++ else if (mainline == 0) + { + breakpoint_re_set (); + } ++ else ++ { ++ /* Don't reset breakpoints or it will screw up PIE. */ ++ } + + /* We're done reading the symbol file; finish off complaints. */ + clear_complaints (&symfile_complaints, 0, verbo); +@@ -909,7 +914,7 @@ + interactively wiping out any existing symbols. */ + + if ((have_full_symbols () || have_partial_symbols ()) +- && mainline ++ && (mainline == 1) + && from_tty + && !query ("Load new symbol table from \"%s\"? ", name)) + error (_("Not confirmed.")); +@@ -1090,6 +1095,10 @@ + symfile_objfile->name) + : !query (_("Discard symbol table? ")))) + error (_("Not confirmed.")); ++#ifdef CLEAR_SOLIB ++ CLEAR_SOLIB (); ++#endif ++ + free_all_objfiles (); + + /* solib descriptors may have handles to objfiles. Since their +@@ -2204,6 +2213,8 @@ + /* Discard cleanups as symbol reading was successful. */ + discard_cleanups (old_cleanups); + ++ init_entry_point_info (objfile); ++ + /* If the mtime has changed between the time we set new_modtime + and now, we *want* this to be out of date, so don't call stat + again now. */ +@@ -2579,6 +2590,7 @@ + clear_pc_function_cache (); + if (deprecated_target_new_objfile_hook) + deprecated_target_new_objfile_hook (NULL); ++ varobj_refresh (); + + /* Clear globals which might have pointed into a removed objfile. + FIXME: It's not clear which of these are supposed to persist +--- ./gdb/varobj.c.orig 2006-12-08 14:10:38.000000000 +0100 ++++ ./gdb/varobj.c 2007-01-04 13:07:44.000000000 +0100 +@@ -870,6 +870,62 @@ + return rootcount; + } + ++void ++varobj_refresh (void) ++{ ++ struct varobj *var; ++ struct varobj_root *croot; ++ int mycount = rootcount; ++ char * name; ++ ++ croot = rootlist; ++ while ((croot != NULL) && (mycount > 0)) ++ { ++ var = croot->rootvar; ++ ++ /* Get rid of the memory for the old expression. This also ++ leaves var->root->exp == NULL, which is ok for the parsing ++ below. */ ++ free_current_contents (&var->root->exp); ++ ++ value_free (var->value); ++ var->type = NULL; ++ ++ name = xstrdup (var->name); ++ ++ /* Reparse the expression. Wrap the call to parse expression, ++ so we can return a sensible error. */ ++ if (!gdb_parse_exp_1 (&name, var->root->valid_block, 0, &var->root->exp)) ++ { ++ return; ++ } ++ ++ /* We definitively need to catch errors here. ++ If evaluate_expression succeeds we got the value we wanted. ++ But if it fails, we still go on with a call to evaluate_type() */ ++ if (gdb_evaluate_expression (var->root->exp, &var->value)) ++ { ++ /* no error */ ++ release_value (var->value); ++ if (value_lazy (var->value)) ++ gdb_value_fetch_lazy (var->value); ++ } ++ else ++ var->value = evaluate_type (var->root->exp); ++ ++ var->type = value_type (var->value); ++ ++ mycount--; ++ croot = croot->next; ++ } ++ ++ if (mycount || (croot != NULL)) ++ warning ++ ("varobj_refresh: assertion failed - wrong tally of root vars (%d:%d)", ++ rootcount, mycount); ++} ++ ++ + /* Update the values for a variable and its children. This is a + two-pronged attack. First, re-parse the value for the root's + expression to see if it's changed. Then go all the way +--- ./gdb/varobj.h.orig 2005-12-17 23:34:03.000000000 +0100 ++++ ./gdb/varobj.h 2007-01-04 13:07:44.000000000 +0100 +@@ -99,4 +99,6 @@ + + extern int varobj_update (struct varobj **varp, struct varobj ***changelist); + ++extern void varobj_refresh(void); ++ + #endif /* VAROBJ_H */ --- gdb-6.7.1.orig/debian/patches/dwarf2-cfi-warning.patch +++ gdb-6.7.1/debian/patches/dwarf2-cfi-warning.patch @@ -0,0 +1,36 @@ +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. + +--- + gdb/dwarf2-frame.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: gdb-6.7.1/gdb/dwarf2-frame.c +=================================================================== +--- gdb-6.7.1.orig/gdb/dwarf2-frame.c 2007-12-03 09:37:03.000000000 -0500 ++++ gdb-6.7.1/gdb/dwarf2-frame.c 2007-12-03 09:37:39.000000000 -0500 +@@ -928,7 +928,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.7.1.orig/debian/patches/pie-support-tests.patch +++ gdb-6.7.1/debian/patches/pie-support-tests.patch @@ -0,0 +1,2119 @@ +Index: gdb-6.5.dfsg/gdb/testsuite/configure +=================================================================== +--- gdb-6.5.dfsg.orig/gdb/testsuite/configure 2006-12-14 15:02:15.000000000 -0800 ++++ gdb-6.5.dfsg/gdb/testsuite/configure 2006-12-14 15:02:33.000000000 -0800 +@@ -3075,7 +3075,7 @@ + + + +- ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile" ++ ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.objc/Makefile gdb.pie/Makefile gdb.threads/Makefile gdb.trace/Makefile" + cat >confcache <<\_ACEOF + # This file is a shell script that caches the results of configure + # tests run on this system so they can be shared between configure +@@ -3639,6 +3639,7 @@ + "gdb.java/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.java/Makefile" ;; + "gdb.mi/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.mi/Makefile" ;; + "gdb.objc/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.objc/Makefile" ;; ++ "gdb.pie/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.pie/Makefile" ;; + "gdb.threads/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;; + "gdb.trace/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.trace/Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +Index: gdb-6.5.dfsg/gdb/testsuite/configure.ac +=================================================================== +--- gdb-6.5.dfsg.orig/gdb/testsuite/configure.ac 2006-12-14 15:02:14.000000000 -0800 ++++ gdb-6.5.dfsg/gdb/testsuite/configure.ac 2006-12-14 15:02:33.000000000 -0800 +@@ -114,4 +114,4 @@ + gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \ + gdb.fortran/Makefile gdb.server/Makefile \ + gdb.java/Makefile gdb.mi/Makefile \ +- gdb.objc/Makefile gdb.threads/Makefile gdb.trace/Makefile]) ++ gdb.objc/Makefile gdb.pie/Makefile gdb.threads/Makefile gdb.trace/Makefile]) +Index: gdb-6.5.dfsg/gdb/testsuite/gdb.pie/Makefile.in +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.5.dfsg/gdb/testsuite/gdb.pie/Makefile.in 2006-12-14 15:02:34.000000000 -0800 +@@ -0,0 +1,19 @@ ++VPATH = @srcdir@ ++srcdir = @srcdir@ ++ ++EXECUTABLES = ++MISCELLANEOUS = arch.inc ++ ++all info install-info dvi install uninstall installcheck check: ++ @echo "Nothing to be done for $@..." ++ ++clean mostlyclean: ++ -rm -f *~ *.o a.out *.x *.ci *.tmp ++ -rm -f core core.coremaker coremaker.core corefile $(EXECUTABLES) ++ -rm -f $(MISCELLANEOUS) ++ ++distclean maintainer-clean realclean: clean ++ -rm -f *~ core ++ -rm -f Makefile config.status config.log ++ -rm -f *-init.exp ++ -rm -fr *.log summary detail *.plog *.sum *.psum site.* +Index: gdb-6.5.dfsg/gdb/testsuite/gdb.pie/attach.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.5.dfsg/gdb/testsuite/gdb.pie/attach.c 2006-12-14 15:02:33.000000000 -0800 +@@ -0,0 +1,20 @@ ++/* This program is intended to be started outside of gdb, and then ++ attached to by gdb. Thus, it simply spins in a loop. The loop ++ is exited when & if the variable 'should_exit' is non-zero. (It ++ is initialized to zero in this program, so the loop will never ++ exit unless/until gdb sets the variable to non-zero.) ++ */ ++#include ++ ++int should_exit = 0; ++ ++int main () ++{ ++ int local_i = 0; ++ ++ while (! should_exit) ++ { ++ local_i++; ++ } ++ return 0; ++} +Index: gdb-6.5.dfsg/gdb/testsuite/gdb.pie/attach.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.5.dfsg/gdb/testsuite/gdb.pie/attach.exp 2006-12-14 15:02:34.000000000 -0800 +@@ -0,0 +1,432 @@ ++# Copyright 1997, 1999, 2002 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. */ ++ ++# Please email any bugs, comments, and/or additions to this file to: ++# bug-gdb@prep.ai.mit.edu ++ ++if $tracelevel then { ++ strace $tracelevel ++ } ++ ++set prms_id 0 ++set bug_id 0 ++ ++# On HP-UX 11.0, this test is causing a process running the program ++# "attach" to be left around spinning. Until we figure out why, I am ++# commenting out the test to avoid polluting tiamat (our 11.0 nightly ++# test machine) with these processes. RT ++# ++# Setting the magic bit in the target app should work. I added a ++# "kill", and also a test for the R3 register warning. JB ++if { [istarget "hppa*-*-hpux*"] } { ++ return 0 ++} ++ ++# are we on a target board ++if [is_remote target] then { ++ return 0 ++} ++ ++set testfile "attach" ++set srcfile ${testfile}.c ++set srcfile2 ${testfile}2.c ++set binfile ${objdir}/${subdir}/${testfile} ++set binfile2 ${objdir}/${subdir}/${testfile}2 ++set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}] ++set cleanupfile ${objdir}/${subdir}/${testfile}.awk ++ ++#execute_anywhere "rm -f ${binfile} ${binfile2}" ++remote_exec build "rm -f ${binfile} ${binfile2}" ++# For debugging this test ++# ++#log_user 1 ++ ++# Clean out any old files from past runs. ++# ++remote_exec build "${cleanupfile}" ++ ++# build the first test case ++# ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug "additional_flags= -fpie -pie"}] != "" } { ++ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." ++} ++ ++# Build the in-system-call test ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${binfile2}" executable {debug "additional_flags= -fpie -pie"}] != "" } { ++ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." ++} ++ ++if [get_compiler_info ${binfile}] { ++ return -1 ++} ++ ++proc do_attach_tests {} { ++ global gdb_prompt ++ global binfile ++ global escapedbinfile ++ global srcfile ++ global testfile ++ global objdir ++ global subdir ++ global timeout ++ ++ # Start the program running and then wait for a bit, to be sure ++ # that it can be attached to. ++ # ++ set testpid [eval exec $binfile &] ++ exec sleep 2 ++ ++ # Verify that we cannot attach to nonsense. ++ # ++ send_gdb "attach abc\n" ++ gdb_expect { ++ -re ".*Illegal process-id: abc.*$gdb_prompt $"\ ++ {pass "attach to nonsense is prohibited"} ++ -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $"\ ++ { ++ # Response expected from /proc-based systems. ++ pass "attach to nonsense is prohibited" ++ } ++ -re "Attaching to.*$gdb_prompt $"\ ++ {fail "attach to nonsense is prohibited (bogus pid allowed)"} ++ -re "$gdb_prompt $" {fail "attach to nonsense is prohibited"} ++ timeout {fail "(timeout) attach to nonsense is prohibited"} ++ } ++ ++ # Verify that we cannot attach to what appears to be a valid ++ # process ID, but is a process that doesn't exist. Traditionally, ++ # most systems didn't have a process with ID 0, so we take that as ++ # the default. However, there are a few exceptions. ++ # ++ set boguspid 0 ++ if { [istarget "*-*-*bsd*"] } { ++ # In FreeBSD 5.0, PID 0 is used for "swapper". Use -1 instead ++ # (which should have the desired effect on any version of ++ # FreeBSD, and probably other *BSD's too). ++ set boguspid -1 ++ } ++ send_gdb "attach $boguspid\n" ++ gdb_expect { ++ -re "Attaching to.*, process $boguspid.*No such process.*$gdb_prompt $"\ ++ { ++ # Response expected on ptrace-based systems (i.e. HP-UX 10.20). ++ pass "attach to nonexistent process is prohibited" ++ } ++ -re "Attaching to.*, process $boguspid failed.*Hint.*$gdb_prompt $"\ ++ { ++ # Response expected on ttrace-based systems (i.e. HP-UX 11.0). ++ pass "attach to nonexistent process is prohibited" ++ } ++ -re "Attaching to.*, process $boguspid.*denied.*$gdb_prompt $"\ ++ {pass "attach to nonexistent process is prohibited"} ++ -re "Attaching to.*, process $boguspid.*not permitted.*$gdb_prompt $"\ ++ {pass "attach to nonexistent process is prohibited"} ++ -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $"\ ++ { ++ # Response expected from /proc-based systems. ++ pass "attach to nonexistent process is prohibited" ++ } ++ -re "$gdb_prompt $" {fail "attach to nonexistent process is prohibited"} ++ timeout { ++ fail "(timeout) attach to nonexistent process is prohibited" ++ } ++ } ++ ++ # Verify that we can attach to the process by first giving its ++ # executable name via the file command, and using attach with ++ # the process ID. ++ # ++ # (Actually, the test system appears to do this automatically ++ # for us. So, we must also be prepared to be asked if we want ++ # to discard an existing set of symbols.) ++ # ++ send_gdb "file $binfile\n" ++ gdb_expect { ++ -re "Load new symbol table from.*y or n.*$" { ++ send_gdb "y\n" ++ gdb_expect { ++ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $"\ ++ {pass "(re)set file, before attach1"} ++ -re "$gdb_prompt $" {fail "(re)set file, before attach1"} ++ timeout {fail "(timeout) (re)set file, before attach1"} ++ } ++ } ++ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $"\ ++ {pass "set file, before attach1"} ++ -re "$gdb_prompt $" {fail "set file, before attach1"} ++ timeout {fail "(timeout) set file, before attach1"} ++ } ++ ++ send_gdb "attach $testpid\n" ++ gdb_expect { ++ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*main.*at .*$srcfile:.*$gdb_prompt $"\ ++ {pass "attach1, after setting file"} ++ -re "$gdb_prompt $" {fail "attach1, after setting file"} ++ timeout {fail "(timeout) attach1, after setting file"} ++ } ++ ++ # Verify that we can "see" the variable "should_exit" in the ++ # program, and that it is zero. ++ # ++ send_gdb "print should_exit\n" ++ gdb_expect { ++ -re ".* = 0.*$gdb_prompt $"\ ++ {pass "after attach1, print should_exit"} ++ -re "$gdb_prompt $" {fail "after attach1, print should_exit"} ++ timeout {fail "(timeout) after attach1, print should_exit"} ++ } ++ ++ # Detach the process. ++ # ++ send_gdb "detach\n" ++ gdb_expect { ++ -re "Detaching from program: .*$escapedbinfile.*$gdb_prompt $"\ ++ {pass "attach1 detach"} ++ -re "$gdb_prompt $" {fail "attach1 detach"} ++ timeout {fail "(timeout) attach1 detach"} ++ } ++ ++ # Wait a bit for gdb to finish detaching ++ # ++ exec sleep 5 ++ ++ # Purge the symbols from gdb's brain. (We want to be certain ++ # the next attach, which won't be preceded by a "file" command, ++ # is really getting the executable file without our help.) ++ # ++ set old_timeout $timeout ++ set timeout 15 ++ send_gdb "file\n" ++ gdb_expect { ++ -re ".*gdb internal error.*$" { ++ fail "Internal error, prob. Memory corruption" ++ } ++ -re "No executable file now.*Discard symbol table.*y or n.*$" { ++ send_gdb "y\n" ++ gdb_expect { ++ -re "No symbol file now.*$gdb_prompt $"\ ++ {pass "attach1, purging symbols after detach"} ++ -re "$gdb_prompt $" {fail "attach1, purging symbols after detach"} ++ timeout {fail "(timeout) attach1, purging symbols after detach"} ++ } ++ } ++ -re "$gdb_prompt $" {fail "attach1, purging file after detach"} ++ timeout { ++ fail "(timeout) attach1, purging file after detach" ++ } ++ } ++ set timeout $old_timeout ++ ++ # Verify that we can attach to the process just by giving the ++ # process ID. ++ # ++ send_gdb "attach $testpid\n" ++ gdb_expect { ++ -re "Attaching to process $testpid.*Reading symbols from $escapedbinfile.*main.*at .*$gdb_prompt $"\ ++ {pass "attach2"} ++ -re "$gdb_prompt $" {fail "attach2"} ++ timeout {fail "(timeout) attach2"} ++ } ++ ++ # Verify that we can modify the variable "should_exit" in the ++ # program. ++ # ++ send_gdb "set should_exit=1\n" ++ gdb_expect { ++ -re "$gdb_prompt $" {pass "after attach2, set should_exit"} ++ timeout {fail "(timeout) after attach2, set should_exit"} ++ } ++ ++ # Verify that the modification really happened. ++ # ++ send_gdb "tbreak 19\n" ++ gdb_expect { ++ -re "Breakpoint .*at.*$srcfile, line 19.*$gdb_prompt $"\ ++ {pass "after attach2, set tbreak postloop"} ++ -re "$gdb_prompt $" {fail "after attach2, set tbreak postloop"} ++ timeout {fail "(timeout) after attach2, set tbreak postloop"} ++ } ++ send_gdb "continue\n" ++ gdb_expect { ++ -re "main.*at.*$srcfile:19.*$gdb_prompt $"\ ++ {pass "after attach2, reach tbreak postloop"} ++ -re "$gdb_prompt $" {fail "after attach2, reach tbreak postloop"} ++ timeout {fail "(timeout) after attach2, reach tbreak postloop"} ++ } ++ ++ # Allow the test process to exit, to cleanup after ourselves. ++ # ++ send_gdb "continue\n" ++ gdb_expect { ++ -re "Program exited normally.*$gdb_prompt $"\ ++ {pass "after attach2, exit"} ++ -re "$gdb_prompt $" {fail "after attach2, exit"} ++ timeout {fail "(timeout) after attach2, exit"} ++ } ++ ++ # Make sure we don't leave a process around to confuse ++ # the next test run (and prevent the compile by keeping ++ # the text file busy), in case the "set should_exit" didn't ++ # work. ++ # ++ remote_exec build "kill -9 ${testpid}" ++ # Start the program running and then wait for a bit, to be sure ++ # that it can be attached to. ++ # ++ set testpid [eval exec $binfile &] ++ exec sleep 2 ++ ++ # Verify that we can attach to the process, and find its a.out ++ # when we're cd'd to some directory that doesn't contain the ++ # a.out. (We use the source path set by the "dir" command.) ++ # ++ send_gdb "dir ${objdir}/${subdir}\n" ++ gdb_expect { ++ -re ".*Source directories searched: .*$gdb_prompt $"\ ++ {pass "set source path"} ++ -re "$gdb_prompt $" {fail "set source path"} ++ timeout {fail "(timeout) set source path"} ++ } ++ ++ send_gdb "cd /tmp\n" ++ gdb_expect { ++ -re ".*Working directory /tmp.*$gdb_prompt $"\ ++ {pass "cd away from process' a.out"} ++ -re "$gdb_prompt $" {fail "cd away from process' a.out"} ++ timeout {fail "(timeout) cd away from process' a.out"} ++ } ++ ++ # Explicitly flush out any knowledge of the previous attachment. ++ send_gdb "symbol\n" ++ gdb_expect { ++ -re ".*Discard symbol table from.*y or n. $"\ ++ {send_gdb "y\n" ++ gdb_expect { ++ -re ".*No symbol file now.*$gdb_prompt $"\ ++ {pass "before attach3, flush symbols"} ++ -re "$gdb_prompt $" {fail "before attach3, flush symbols"} ++ timeout {fail "(timeout) before attach3, flush symbols"} ++ } ++ } ++ -re ".*No symbol file now.*$gdb_prompt $"\ ++ {pass "before attach3, flush symbols"} ++ -re "$gdb_prompt $" {fail "before attach3, flush symbols"} ++ timeout {fail "(timeout) before attach3, flush symbols"} ++ } ++ send_gdb "exec\n" ++ gdb_expect { ++ -re ".*No executable file now.*$gdb_prompt $"\ ++ {pass "before attach3, flush exec"} ++ -re "$gdb_prompt $" {fail "before attach3, flush exec"} ++ timeout {fail "(timeout) before attach3, flush exec"} ++ } ++ ++ send_gdb "attach $testpid\n" ++ gdb_expect { ++ -re "Attaching to process $testpid.*Reading symbols from $escapedbinfile.*main.*at .*$gdb_prompt $"\ ++ {pass "attach when process' a.out not in cwd"} ++ -re "$gdb_prompt $" {fail "attach when process' a.out not in cwd"} ++ timeout {fail "(timeout) attach when process' a.out not in cwd"} ++ } ++ ++ send_gdb "kill\n" ++ gdb_expect { ++ -re ".*Kill the program being debugged.*y or n. $"\ ++ {send_gdb "y\n" ++ gdb_expect { ++ -re "$gdb_prompt $" {pass "after attach3, exit"} ++ timeout {fail "(timeout) after attach3, exit"} ++ } ++ } ++ -re "$gdb_prompt $" {fail "after attach3, exit"} ++ timeout {fail "(timeout) after attach3, exit"} ++ } ++ ++ # Another "don't leave a process around" ++ remote_exec build "kill -9 ${testpid}" ++} ++ ++proc do_call_attach_tests {} { ++ global gdb_prompt ++ global binfile2 ++ ++ # Start the program running and then wait for a bit, to be sure ++ # that it can be attached to. ++ # ++ set testpid [eval exec $binfile2 &] ++ exec sleep 2 ++ ++ # Attach ++ # ++ gdb_test "file $binfile2" ".*" "force switch to gdb64, if necessary" ++ send_gdb "attach $testpid\n" ++ gdb_expect { ++ -re ".*warning: reading register.*I.*O error.*$gdb_prompt $" { ++ fail "attach call, read register 3 error" ++ } ++ -re "Attaching to.*process $testpid.*libc.*$gdb_prompt $" { ++ pass "attach call" ++ } ++ -re "$gdb_prompt $" {fail "attach call"} ++ timeout {fail "(timeout) attach call"} ++ } ++ ++ # See if other registers are problems ++ # ++ send_gdb "i r r3\n" ++ gdb_expect { ++ -re ".*warning: reading register.*$gdb_prompt $" { ++ pass "CHFts23490: known bug" ++ } ++ -re ".*r3.*$gdb_prompt $" { ++ pass "Bug fixed, Yayyy!" ++ } ++ timeout { fail "timeout on info reg" } ++ } ++ ++ # Get rid of the process ++ # ++ gdb_test "p should_exit = 1" ".*" ++ gdb_test "c" ".*Program exited normally.*" ++ ++ # Be paranoid ++ # ++ remote_exec build "kill -9 ${testpid}" ++ ++} ++ ++ ++# Start with a fresh gdb ++# ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++# This is a test of gdb's ability to attach to a running process. ++# ++do_attach_tests ++ ++# Test attaching when the target is inside a system call ++# ++gdb_exit ++gdb_start ++ ++gdb_reinitialize_dir $srcdir/$subdir ++do_call_attach_tests ++ ++return 0 +Index: gdb-6.5.dfsg/gdb/testsuite/gdb.pie/attach2.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.5.dfsg/gdb/testsuite/gdb.pie/attach2.c 2006-12-14 15:02:33.000000000 -0800 +@@ -0,0 +1,24 @@ ++/* This program is intended to be started outside of gdb, and then ++ attached to by gdb. Thus, it simply spins in a loop. The loop ++ is exited when & if the variable 'should_exit' is non-zero. (It ++ is initialized to zero in this program, so the loop will never ++ exit unless/until gdb sets the variable to non-zero.) ++ */ ++#include ++#include ++#include ++ ++int should_exit = 0; ++ ++int main () ++{ ++ int local_i = 0; ++ ++ sleep( 10 ); /* System call causes register fetch to fail */ ++ /* This is a known HPUX "feature" */ ++ while (! should_exit) ++ { ++ local_i++; ++ } ++ return (0); ++} +Index: gdb-6.5.dfsg/gdb/testsuite/gdb.pie/break.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.5.dfsg/gdb/testsuite/gdb.pie/break.c 2006-12-14 15:02:34.000000000 -0800 +@@ -0,0 +1,146 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 1992, 1993, 1994, 1995, 1999, 2002, 2003 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. ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@prep.ai.mit.edu */ ++ ++#ifdef vxworks ++ ++# include ++ ++/* VxWorks does not supply atoi. */ ++static int ++atoi (z) ++ char *z; ++{ ++ int i = 0; ++ ++ while (*z >= '0' && *z <= '9') ++ i = i * 10 + (*z++ - '0'); ++ return i; ++} ++ ++/* I don't know of any way to pass an array to VxWorks. This function ++ can be called directly from gdb. */ ++ ++vxmain (arg) ++char *arg; ++{ ++ char *argv[2]; ++ ++ argv[0] = ""; ++ argv[1] = arg; ++ main (2, argv, (char **) 0); ++} ++ ++#else /* ! vxworks */ ++# include ++# include ++#endif /* ! vxworks */ ++ ++#ifdef PROTOTYPES ++extern int marker1 (void); ++extern int marker2 (int a); ++extern void marker3 (char *a, char *b); ++extern void marker4 (long d); ++#else ++extern int marker1 (); ++extern int marker2 (); ++extern void marker3 (); ++extern void marker4 (); ++#endif ++ ++/* ++ * This simple classical example of recursion is useful for ++ * testing stack backtraces and such. ++ */ ++ ++#ifdef PROTOTYPES ++int factorial(int); ++ ++int ++main (int argc, char **argv, char **envp) ++#else ++int ++main (argc, argv, envp) ++int argc; ++char *argv[], **envp; ++#endif ++{ ++#ifdef usestubs ++ set_debug_traps(); /* set breakpoint 5 here */ ++ breakpoint(); ++#endif ++ if (argc == 12345) { /* an unlikely value < 2^16, in case uninited */ /* set breakpoint 6 here */ ++ fprintf (stderr, "usage: factorial \n"); ++ return 1; ++ } ++ printf ("%d\n", factorial (atoi ("6"))); /* set breakpoint 1 here */ ++ /* set breakpoint 12 here */ ++ marker1 (); /* set breakpoint 11 here */ ++ marker2 (43); /* set breakpoint 20 here */ ++ marker3 ("stack", "trace"); /* set breakpoint 21 here */ ++ marker4 (177601976L); ++ argc = (argc == 12345); /* This is silly, but we can step off of it */ /* set breakpoint 2 here */ ++ return argc; /* set breakpoint 10 here */ ++} ++ ++#ifdef PROTOTYPES ++int factorial (int value) ++#else ++int factorial (value) ++int value; ++#endif ++{ ++ if (value > 1) { /* set breakpoint 7 here */ ++ value *= factorial (value - 1); ++ } ++ return (value); /* set breakpoint 19 here */ ++} ++ ++#ifdef PROTOTYPES ++int multi_line_if_conditional (int a, int b, int c) ++#else ++int multi_line_if_conditional (a, b, c) ++ int a, b, c; ++#endif ++{ ++ if (a /* set breakpoint 3 here */ ++ && b ++ && c) ++ return 0; ++ else ++ return 1; ++} ++ ++#ifdef PROTOTYPES ++int multi_line_while_conditional (int a, int b, int c) ++#else ++int multi_line_while_conditional (a, b, c) ++ int a, b, c; ++#endif ++{ ++ while (a /* set breakpoint 4 here */ ++ && b ++ && c) ++ { ++ a--, b--, c--; ++ } ++ return 0; ++} +Index: gdb-6.5.dfsg/gdb/testsuite/gdb.pie/break.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.5.dfsg/gdb/testsuite/gdb.pie/break.exp 2006-12-14 15:02:34.000000000 -0800 +@@ -0,0 +1,973 @@ ++# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, ++# 2000, 2002, 2003, 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. ++ ++# Please email any bugs, comments, and/or additions to this file to: ++# bug-gdb@prep.ai.mit.edu ++ ++# This file was written by Rob Savoye. (rob@cygnus.com) ++ ++# Test the same stuff but with PIE executables ++ ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++ ++# ++# test running programs ++# ++set prms_id 0 ++set bug_id 0 ++ ++set testfile "break" ++set srcfile ${testfile}.c ++set srcfile1 ${testfile}1.c ++set binfile ${objdir}/${subdir}/${testfile} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}0.o" object {debug "additional_flags=-w -fpie -pie"}] != "" } { ++ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." ++} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}1.o" object {debug "additional_flags=-w -fpie -pie"}] != "" } { ++ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." ++} ++ ++if { [gdb_compile "${binfile}0.o ${binfile}1.o" "${binfile}" executable {debug "additional_flags=-w -fpie -pie"}] != "" } { ++ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." ++} ++ ++if [get_compiler_info ${binfile}] { ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++if [target_info exists gdb_stub] { ++ gdb_step_for_stub; ++} ++# ++# test simple breakpoint setting commands ++# ++ ++# Test deleting all breakpoints when there are none installed, ++# GDB should not prompt for confirmation. ++# Note that gdb-init.exp provides a "delete_breakpoints" proc ++# for general use elsewhere. ++ ++send_gdb "delete breakpoints\n" ++gdb_expect { ++ -re "Delete all breakpoints.*$" { ++ send_gdb "y\n" ++ gdb_expect { ++ -re "$gdb_prompt $" { ++ fail "Delete all breakpoints when none (unexpected prompt)" ++ } ++ timeout { fail "Delete all breakpoints when none (timeout after unexpected prompt)" } ++ } ++ } ++ -re ".*$gdb_prompt $" { pass "Delete all breakpoints when none" } ++ timeout { fail "Delete all breakpoints when none (timeout)" } ++} ++ ++# ++# test break at function ++# ++gdb_test "break main" \ ++ "Breakpoint.*at.* file .*$srcfile, line.*" \ ++ "breakpoint function" ++ ++# ++# test break at quoted function ++# ++gdb_test "break \"marker2\"" \ ++ "Breakpoint.*at.* file .*$srcfile1, line.*" \ ++ "breakpoint quoted function" ++ ++# ++# test break at function in file ++# ++gdb_test "break $srcfile:factorial" \ ++ "Breakpoint.*at.* file .*$srcfile, line.*" \ ++ "breakpoint function in file" ++ ++set bp_location1 [gdb_get_line_number "set breakpoint 1 here"] ++ ++# ++# test break at line number ++# ++# Note that the default source file is the last one whose source text ++# was printed. For native debugging, before we've executed the ++# program, this is the file containing main, but for remote debugging, ++# it's wherever the processor was stopped when we connected to the ++# board. So, to be sure, we do a list command. ++# ++gdb_test "list main" \ ++ ".*main \\(argc, argv, envp\\).*" \ ++ "use `list' to establish default source file" ++gdb_test "break $bp_location1" \ ++ "Breakpoint.*at.* file .*$srcfile, line $bp_location1\\." \ ++ "breakpoint line number" ++ ++# ++# test duplicate breakpoint ++# ++gdb_test "break $bp_location1" \ ++ "Note: breakpoint \[0-9\]+ also set at pc.*Breakpoint \[0-9\]+ at.* file .*$srcfile, line $bp_location1\\." \ ++ "breakpoint duplicate" ++ ++set bp_location2 [gdb_get_line_number "set breakpoint 2 here"] ++ ++# ++# test break at line number in file ++# ++gdb_test "break $srcfile:$bp_location2" \ ++ "Breakpoint.*at.* file .*$srcfile, line $bp_location2\\." \ ++ "breakpoint line number in file" ++ ++set bp_location3 [gdb_get_line_number "set breakpoint 3 here"] ++set bp_location4 [gdb_get_line_number "set breakpoint 4 here"] ++ ++# ++# Test putting a break at the start of a multi-line if conditional. ++# Verify the breakpoint was put at the start of the conditional. ++# ++gdb_test "break multi_line_if_conditional" \ ++ "Breakpoint.*at.* file .*$srcfile, line $bp_location3\\." \ ++ "breakpoint at start of multi line if conditional" ++ ++gdb_test "break multi_line_while_conditional" \ ++ "Breakpoint.*at.* file .*$srcfile, line $bp_location4\\." \ ++ "breakpoint at start of multi line while conditional" ++ ++set bp_location5 [gdb_get_line_number "set breakpoint 5 here"] ++set bp_location6 [gdb_get_line_number "set breakpoint 6 here"] ++ ++# ++# check to see what breakpoints are set ++# ++if [target_info exists gdb_stub] { ++ set main_line $bp_location5 ++} else { ++ set main_line $bp_location6 ++} ++ ++if {$hp_aCC_compiler} { ++ set proto "\\(int\\)" ++} else { ++ set proto "" ++} ++ ++set bp_location7 [gdb_get_line_number "set breakpoint 7 here"] ++set bp_location8 [gdb_get_line_number "set breakpoint 8 here" $srcfile1] ++set bp_location9 [gdb_get_line_number "set breakpoint 9 here" $srcfile1] ++ ++gdb_test "info break" \ ++ "Num Type\[ \]+Disp Enb Address\[ \]+What.* ++\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$main_line.* ++\[0-9\]+\[\t \]+breakpoint keep y.* in marker2 at .*$srcfile1:($bp_location8|$bp_location9).* ++\[0-9\]+\[\t \]+breakpoint keep y.* in factorial$proto at .*$srcfile:$bp_location7.* ++\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.* ++\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location1.* ++\[0-9\]+\[\t \]+breakpoint keep y.* in main at .*$srcfile:$bp_location2.* ++\[0-9\]+\[\t \]+breakpoint keep y.* in multi_line_if_conditional at .*$srcfile:$bp_location3.* ++\[0-9\]+\[\t \]+breakpoint keep y.* in multi_line_while_conditional at .*$srcfile:$bp_location4" \ ++ "breakpoint info" ++ ++# FIXME: The rest of this test doesn't work with anything that can't ++# handle arguments. ++# Huh? There doesn't *appear* to be anything that passes arguments ++# below. ++if [istarget "mips-idt-*"] then { ++ return ++} ++ ++# ++# run until the breakpoint at main is hit. For non-stubs-using targets. ++# ++if ![target_info exists use_gdb_stub] { ++ if [istarget "*-*-vxworks*"] then { ++ send_gdb "run vxmain \"2\"\n" ++ set timeout 120 ++ verbose "Timeout is now $timeout seconds" 2 ++ } else { ++ send_gdb "run\n" ++ } ++ gdb_expect { ++ -re "The program .* has been started already.*y or n. $" { ++ send_gdb "y\n" ++ exp_continue ++ } ++ -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.* \{.*$gdb_prompt $"\ ++ { pass "run until function breakpoint" } ++ -re ".*$gdb_prompt $" { fail "run until function breakpoint" } ++ timeout { fail "run until function breakpoint (timeout)" } ++ } ++} else { ++ if ![target_info exists gdb_stub] { ++ gdb_test continue ".*Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.*\{.*" "stub continue" ++ } ++} ++ ++# ++# run until the breakpoint at a line number ++# ++gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location1.*$bp_location1\[\t \]+printf.*factorial.*" \ ++ "run until breakpoint set at a line number" ++ ++# ++# Run until the breakpoint set in a function in a file ++# ++for {set i 6} {$i >= 1} {incr i -1} { ++ gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, factorial \\(value=$i\\) at .*$srcfile:$bp_location7.*$bp_location7\[\t \]+.*if .value > 1. \{.*" \ ++ "run until file:function($i) breakpoint" ++} ++ ++# ++# Run until the breakpoint set at a quoted function ++# ++gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, (0x\[0-9a-f\]+ in )?marker2 \\(a=43\\) at .*$srcfile1:($bp_location8|$bp_location9).*" \ ++ "run until quoted breakpoint" ++# ++# run until the file:function breakpoint at a line number in a file ++# ++gdb_test continue "Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location2.*$bp_location2\[\t \]+argc = \\(argc == 12345\\);.*" \ ++ "run until file:linenum breakpoint" ++ ++# Test break at offset +1 ++set bp_location10 [gdb_get_line_number "set breakpoint 10 here"] ++ ++gdb_test "break +1" \ ++ "Breakpoint.*at.* file .*$srcfile, line $bp_location10\\." \ ++ "breakpoint offset +1" ++ ++# Check to see if breakpoint is hit when stepped onto ++ ++gdb_test "step" \ ++ ".*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location10.*$bp_location10\[\t \]+return argc;.*breakpoint 10 here.*" \ ++ "step onto breakpoint" ++ ++# ++# delete all breakpoints so we can start over, course this can be a test too ++# ++delete_breakpoints ++ ++# ++# test temporary breakpoint at function ++# ++ ++gdb_test "tbreak main" "Breakpoint.*at.* file .*$srcfile, line.*" "Temporary breakpoint function" ++ ++# ++# test break at function in file ++# ++ ++gdb_test "tbreak $srcfile:factorial" "Breakpoint.*at.* file .*$srcfile, line.*" \ ++ "Temporary breakpoint function in file" ++ ++# ++# test break at line number ++# ++send_gdb "tbreak $bp_location1\n" ++gdb_expect { ++ -re "Breakpoint.*at.* file .*$srcfile, line $bp_location1.*$gdb_prompt $" { pass "Temporary breakpoint line number #1" } ++ -re ".*$gdb_prompt $" { pass "Temporary breakpoint line number #1" } ++ timeout { fail "breakpoint line number #1 (timeout)" } ++} ++ ++gdb_test "tbreak $bp_location6" "Breakpoint.*at.* file .*$srcfile, line $bp_location6.*" "Temporary breakpoint line number #2" ++ ++# ++# test break at line number in file ++# ++send_gdb "tbreak $srcfile:$bp_location2\n" ++gdb_expect { ++ -re "Breakpoint.*at.* file .*$srcfile, line $bp_location2.*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" } ++ -re ".*$gdb_prompt $" { pass "Temporary breakpoint line number in file #1" } ++ timeout { fail "Temporary breakpoint line number in file #1 (timeout)" } ++} ++ ++set bp_location11 [gdb_get_line_number "set breakpoint 11 here"] ++gdb_test "tbreak $srcfile:$bp_location11" "Breakpoint.*at.* file .*$srcfile, line $bp_location11.*" "Temporary breakpoint line number in file #2" ++ ++# ++# check to see what breakpoints are set (temporary this time) ++# ++gdb_test "info break" "Num Type.*Disp Enb Address.*What.*\[\r\n\] ++\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:$main_line.*\[\r\n\] ++\[0-9\]+\[\t \]+breakpoint del.*y.*in factorial$proto at .*$srcfile:$bp_location7.*\[\r\n\] ++\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:$bp_location1.*\[\r\n\] ++\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:$bp_location6.*\[\r\n\] ++\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:$bp_location2.*\[\r\n\] ++\[0-9\]+\[\t \]+breakpoint del.*y.*in main at .*$srcfile:$bp_location11.*" \ ++ "Temporary breakpoint info" ++ ++ ++#*********** ++ ++# Verify that catchpoints for fork, vfork and exec don't trigger ++# inappropriately. (There are no calls to those system functions ++# in this test program.) ++# ++if ![runto_main] then { fail "break tests suppressed" } ++ ++send_gdb "catch\n" ++gdb_expect { ++ -re "Catch requires an event name.*$gdb_prompt $"\ ++ {pass "catch requires an event name"} ++ -re "$gdb_prompt $"\ ++ {fail "catch requires an event name"} ++ timeout {fail "(timeout) catch requires an event name"} ++} ++ ++ ++set name "set catch fork, never expected to trigger" ++send_gdb "catch fork\n" ++gdb_expect { ++ -re "Catchpoint \[0-9\]* .fork..*$gdb_prompt $" ++ {pass $name} ++ -re "Catch of fork not yet implemented.*$gdb_prompt $" ++ {pass $name} ++ -re "$gdb_prompt $" ++ {fail $name} ++ timeout {fail "(timeout) $name"} ++} ++ ++ ++set name "set catch vfork, never expected to trigger" ++send_gdb "catch vfork\n" ++ ++# If we are on HP-UX 10.20, we expect an error message to be ++# printed if we type "catch vfork" at the gdb gdb_prompt. This is ++# because on HP-UX 10.20, we cannot catch vfork events. ++ ++if [istarget "hppa*-hp-hpux10.20"] then { ++ gdb_expect { ++ -re "Catch of vfork events not supported on HP-UX 10.20..*$gdb_prompt $" ++ {pass $name} ++ -re "$gdb_prompt $" ++ {fail $name} ++ timeout {fail "(timeout) $name"} ++ } ++} else { ++ gdb_expect { ++ -re "Catchpoint \[0-9\]* .vfork..*$gdb_prompt $" ++ {pass $name} ++ -re "Catch of vfork not yet implemented.*$gdb_prompt $" ++ {pass $name} ++ -re "$gdb_prompt $" ++ {fail $name} ++ timeout {fail "(timeout) $name"} ++ } ++} ++ ++set name "set catch exec, never expected to trigger" ++send_gdb "catch exec\n" ++gdb_expect { ++ -re "Catchpoint \[0-9\]* .exec..*$gdb_prompt $" ++ {pass $name} ++ -re "Catch of exec not yet implemented.*$gdb_prompt $" ++ {pass $name} ++ -re "$gdb_prompt $" {fail $name} ++ timeout {fail "(timeout) $name"} ++} ++ ++# Verify that GDB responds gracefully when asked to set a breakpoint ++# on a nonexistent source line. ++# ++send_gdb "break 999\n" ++gdb_expect { ++ -re "No line 999 in file .*$gdb_prompt $"\ ++ {pass "break on non-existent source line"} ++ -re "$gdb_prompt $"\ ++ {fail "break on non-existent source line"} ++ timeout {fail "(timeout) break on non-existent source line"} ++} ++ ++# Run to the desired default location. If not positioned here, the ++# tests below don't work. ++# ++gdb_test "until $bp_location1" "main .* at .*:$bp_location1.*" "until bp_location1" ++ ++ ++# Verify that GDB allows one to just say "break", which is treated ++# as the "default" breakpoint. Note that GDB gets cute when printing ++# the informational message about other breakpoints at the same ++# location. We'll hit that bird with this stone too. ++# ++send_gdb "break\n" ++gdb_expect { ++ -re "Breakpoint \[0-9\]*.*$gdb_prompt $"\ ++ {pass "break on default location, 1st time"} ++ -re "$gdb_prompt $"\ ++ {fail "break on default location, 1st time"} ++ timeout {fail "(timeout) break on default location, 1st time"} ++} ++ ++send_gdb "break\n" ++gdb_expect { ++ -re "Note: breakpoint \[0-9\]* also set at .*Breakpoint \[0-9\]*.*$gdb_prompt $"\ ++ {pass "break on default location, 2nd time"} ++ -re "$gdb_prompt $"\ ++ {fail "break on default location, 2nd time"} ++ timeout {fail "(timeout) break on default location, 2nd time"} ++} ++ ++send_gdb "break\n" ++gdb_expect { ++ -re "Note: breakpoints \[0-9\]* and \[0-9\]* also set at .*Breakpoint \[0-9\]*.*$gdb_prompt $"\ ++ {pass "break on default location, 3rd time"} ++ -re "$gdb_prompt $"\ ++ {fail "break on default location, 3rd time"} ++ timeout {fail "(timeout) break on default location, 3rd time"} ++} ++ ++send_gdb "break\n" ++gdb_expect { ++ -re "Note: breakpoints \[0-9\]*, \[0-9\]* and \[0-9\]* also set at .*Breakpoint \[0-9\]*.*$gdb_prompt $"\ ++ {pass "break on default location, 4th time"} ++ -re "$gdb_prompt $"\ ++ {fail "break on default location, 4th time"} ++ timeout {fail "(timeout) break on default location, 4th time"} ++} ++ ++# Verify that a "silent" breakpoint can be set, and that GDB is indeed ++# "silent" about its triggering. ++# ++if ![runto_main] then { fail "break tests suppressed" } ++ ++send_gdb "break $bp_location1\n" ++gdb_expect { ++ -re "Breakpoint (\[0-9\]*) at .*, line $bp_location1.*$gdb_prompt $"\ ++ {pass "set to-be-silent break bp_location1"} ++ -re "$gdb_prompt $"\ ++ {fail "set to-be-silent break bp_location1"} ++ timeout {fail "(timeout) set to-be-silent break bp_location1"} ++} ++ ++send_gdb "commands $expect_out(1,string)\n" ++send_gdb "silent\n" ++send_gdb "end\n" ++gdb_expect { ++ -re ".*$gdb_prompt $"\ ++ {pass "set silent break bp_location1"} ++ timeout {fail "(timeout) set silent break bp_location1"} ++} ++ ++send_gdb "info break $expect_out(1,string)\n" ++gdb_expect { ++ -re "\[0-9\]*\[ \t\]*breakpoint.*:$bp_location1\r\n\[ \t\]*silent.*$gdb_prompt $"\ ++ {pass "info silent break bp_location1"} ++ -re "$gdb_prompt $"\ ++ {fail "info silent break bp_location1"} ++ timeout {fail "(timeout) info silent break bp_location1"} ++} ++send_gdb "continue\n" ++gdb_expect { ++ -re "Continuing.\r\n$gdb_prompt $"\ ++ {pass "hit silent break bp_location1"} ++ -re "$gdb_prompt $"\ ++ {fail "hit silent break bp_location1"} ++ timeout {fail "(timeout) hit silent break bp_location1"} ++} ++send_gdb "bt\n" ++gdb_expect { ++ -re "#0 main .* at .*:$bp_location1.*$gdb_prompt $"\ ++ {pass "stopped for silent break bp_location1"} ++ -re "$gdb_prompt $"\ ++ {fail "stopped for silent break bp_location1"} ++ timeout {fail "(timeout) stopped for silent break bp_location1"} ++} ++ ++# Verify that GDB can at least parse a breakpoint with the ++# "thread" keyword. (We won't attempt to test here that a ++# thread-specific breakpoint really triggers appropriately. ++# The gdb.threads subdirectory contains tests for that.) ++# ++set bp_location12 [gdb_get_line_number "set breakpoint 12 here"] ++send_gdb "break $bp_location12 thread 999\n" ++gdb_expect { ++ -re "Unknown thread 999.*$gdb_prompt $"\ ++ {pass "thread-specific breakpoint on non-existent thread disallowed"} ++ -re "$gdb_prompt $"\ ++ {fail "thread-specific breakpoint on non-existent thread disallowed"} ++ timeout {fail "(timeout) thread-specific breakpoint on non-existent thread disallowed"} ++} ++send_gdb "break $bp_location12 thread foo\n" ++gdb_expect { ++ -re "Junk after thread keyword..*$gdb_prompt $"\ ++ {pass "thread-specific breakpoint on bogus thread ID disallowed"} ++ -re "$gdb_prompt $"\ ++ {fail "thread-specific breakpoint on bogus thread ID disallowed"} ++ timeout {fail "(timeout) thread-specific breakpoint on bogus thread ID disallowed"} ++} ++ ++# Verify that GDB responds gracefully to a breakpoint command with ++# trailing garbage. ++# ++send_gdb "break $bp_location12 foo\n" ++gdb_expect { ++ -re "Junk at end of arguments..*$gdb_prompt $"\ ++ {pass "breakpoint with trailing garbage disallowed"} ++ -re "$gdb_prompt $"\ ++ {fail "breakpoint with trailing garbage disallowed"} ++ timeout {fail "(timeout) breakpoint with trailing garbage disallowed"} ++} ++ ++# Verify that GDB responds gracefully to a "clear" command that has ++# no matching breakpoint. (First, get us off the current source line, ++# which we know has a breakpoint.) ++# ++send_gdb "next\n" ++gdb_expect { ++ -re ".*$gdb_prompt $"\ ++ {pass "step over breakpoint"} ++ timeout {fail "(timeout) step over breakpoint"} ++} ++send_gdb "clear 81\n" ++gdb_expect { ++ -re "No breakpoint at 81..*$gdb_prompt $"\ ++ {pass "clear line has no breakpoint disallowed"} ++ -re "$gdb_prompt $"\ ++ {fail "clear line has no breakpoint disallowed"} ++ timeout {fail "(timeout) clear line has no breakpoint disallowed"} ++} ++send_gdb "clear\n" ++gdb_expect { ++ -re "No breakpoint at this line..*$gdb_prompt $"\ ++ {pass "clear current line has no breakpoint disallowed"} ++ -re "$gdb_prompt $"\ ++ {fail "clear current line has no breakpoint disallowed"} ++ timeout {fail "(timeout) clear current line has no breakpoint disallowed"} ++} ++ ++# Verify that we can set and clear multiple breakpoints. ++# ++# We don't test that it deletes the correct breakpoints. We do at ++# least test that it deletes more than one breakpoint. ++# ++gdb_test "break marker3" "Breakpoint.*at.*" "break marker3 #1" ++gdb_test "break marker3" "Breakpoint.*at.*" "break marker3 #2" ++gdb_test "clear marker3" {Deleted breakpoints [0-9]+ [0-9]+.*} ++ ++# Verify that a breakpoint can be set via a convenience variable. ++# ++send_gdb "set \$foo=$bp_location11\n" ++gdb_expect { ++ -re "$gdb_prompt $"\ ++ {pass "set convenience variable \$foo to bp_location11"} ++ timeout {fail "(timeout) set convenience variable \$foo to bp_location11"} ++} ++send_gdb "break \$foo\n" ++gdb_expect { ++ -re "Breakpoint (\[0-9\]*) at .*, line $bp_location11.*$gdb_prompt $"\ ++ {pass "set breakpoint via convenience variable"} ++ -re "$gdb_prompt $"\ ++ {fail "set breakpoint via convenience variable"} ++ timeout {fail "(timeout) set breakpoint via convenience variable"} ++} ++ ++# Verify that GDB responds gracefully to an attempt to set a ++# breakpoint via a convenience variable whose type is not integer. ++# ++send_gdb "set \$foo=81.5\n" ++gdb_expect { ++ -re "$gdb_prompt $"\ ++ {pass "set convenience variable \$foo to 81.5"} ++ timeout {fail "(timeout) set convenience variable \$foo to 81.5"} ++} ++send_gdb "break \$foo\n" ++gdb_expect { ++ -re "Convenience variables used in line specs must have integer values..*$gdb_prompt $"\ ++ {pass "set breakpoint via non-integer convenience variable disallowed"} ++ -re "$gdb_prompt $"\ ++ {fail "set breakpoint via non-integer convenience variable disallowed"} ++ timeout {fail "(timeout) set breakpoint via non-integer convenience variable disallowed"} ++} ++ ++# Verify that we can set and trigger a breakpoint in a user-called function. ++# ++send_gdb "break marker2\n" ++gdb_expect { ++ -re "Breakpoint (\[0-9\]*) at .*, line ($bp_location8|$bp_location9).*$gdb_prompt $"\ ++ {pass "set breakpoint on to-be-called function"} ++ -re "$gdb_prompt $"\ ++ {fail "set breakpoint on to-be-called function"} ++ timeout {fail "(timeout) set breakpoint on to-be-called function"} ++} ++send_gdb "print marker2(99)\n" ++gdb_expect { ++ -re "The program being debugged stopped while in a function called from GDB.\r\nWhen the function .marker2$proto. is done executing, GDB will silently\r\nstop .instead of continuing to evaluate the expression containing\r\nthe function call...*$gdb_prompt $"\ ++ {pass "hit breakpoint on called function"} ++ -re "$gdb_prompt $"\ ++ {fail "hit breakpoint on called function"} ++ timeout {fail "(timeout) hit breakpoint on called function"} ++} ++ ++# As long as we're stopped (breakpointed) in a called function, ++# verify that we can successfully backtrace & such from here. ++# ++# In this and the following test, the _sr4export check apparently is needed ++# for hppa*-*-hpux. ++# ++send_gdb "bt\n" ++gdb_expect { ++ -re "#0\[ \t\]*($hex in )?marker2.*:($bp_location8|$bp_location9)\r\n#1.*_sr4export.*$gdb_prompt $"\ ++ {pass "backtrace while in called function"} ++ -re "#0\[ \t\]*($hex in )?marker2.*:($bp_location8|$bp_location9)\r\n#1.*function called from gdb.*$gdb_prompt $"\ ++ {pass "backtrace while in called function"} ++ -re "$gdb_prompt $"\ ++ {fail "backtrace while in called function"} ++ timeout {fail "(timeout) backtrace while in called function"} ++} ++ ++# Return from the called function. For remote targets, it's important to do ++# this before runto_main, which otherwise may silently stop on the dummy ++# breakpoint inserted by GDB at the program's entry point. ++# ++send_gdb "finish\n" ++gdb_expect { ++ -re "Run till exit from .*marker2.* at .*($bp_location8|$bp_location9)\r\n.* in _sr4export.*$gdb_prompt $"\ ++ {pass "finish from called function"} ++ -re "Run till exit from .*marker2.* at .*($bp_location8|$bp_location9)\r\n.*function called from gdb.*$gdb_prompt $"\ ++ {pass "finish from called function"} ++ -re "Run till exit from .*marker2.* at .*($bp_location8|$bp_location9)\r\n.*Value returned.*$gdb_prompt $"\ ++ {pass "finish from called function"} ++ -re "$gdb_prompt $"\ ++ {fail "finish from called function"} ++ timeout {fail "(timeout) finish from called function"} ++} ++ ++# Verify that GDB responds gracefully to a "finish" command with ++# arguments. ++# ++if ![runto_main] then { fail "break tests suppressed" } ++ ++send_gdb "finish 123\n" ++gdb_expect { ++ -re "The \"finish\" command does not take any arguments.\r\n$gdb_prompt $"\ ++ {pass "finish with arguments disallowed"} ++ -re "$gdb_prompt $"\ ++ {fail "finish with arguments disallowed"} ++ timeout {fail "(timeout) finish with arguments disallowed"} ++} ++ ++# Verify that GDB responds gracefully to a request to "finish" from ++# the outermost frame. On a stub that never exits, this will just ++# run to the stubs routine, so we don't get this error... Thus the ++# second condition. ++# ++ ++send_gdb "finish\n" ++gdb_expect { ++ -re "\"finish\" not meaningful in the outermost frame.\r\n$gdb_prompt $"\ ++ {pass "finish from outermost frame disallowed"} ++ -re "Run till exit from.*\r\n$gdb_prompt $" { ++ pass "finish from outermost frame disallowed" ++ } ++ -re "$gdb_prompt $"\ ++ {fail "finish from outermost frame disallowed"} ++ timeout {fail "(timeout) finish from outermost frame disallowed"} ++} ++ ++# Verify that we can explicitly ask GDB to stop on all shared library ++# events, and that it does so. ++# ++if [istarget "hppa*-*-hpux*"] then { ++ if ![runto_main] then { fail "break tests suppressed" } ++ ++ send_gdb "set stop-on-solib-events 1\n" ++ gdb_expect { ++ -re "$gdb_prompt $"\ ++ {pass "set stop-on-solib-events"} ++ timeout {fail "(timeout) set stop-on-solib-events"} ++ } ++ ++ send_gdb "run\n" ++ gdb_expect { ++ -re ".*Start it from the beginning.*y or n. $"\ ++ {send_gdb "y\n" ++ gdb_expect { ++ -re ".*Stopped due to shared library event.*$gdb_prompt $"\ ++ {pass "triggered stop-on-solib-events"} ++ -re "$gdb_prompt $"\ ++ {fail "triggered stop-on-solib-events"} ++ timeout {fail "(timeout) triggered stop-on-solib-events"} ++ } ++ } ++ -re "$gdb_prompt $"\ ++ {fail "rerun for stop-on-solib-events"} ++ timeout {fail "(timeout) rerun for stop-on-solib-events"} ++ } ++ ++ send_gdb "set stop-on-solib-events 0\n" ++ gdb_expect { ++ -re "$gdb_prompt $"\ ++ {pass "reset stop-on-solib-events"} ++ timeout {fail "(timeout) reset stop-on-solib-events"} ++ } ++} ++ ++# Hardware breakpoints are unsupported on HP-UX. Verify that GDB ++# gracefully responds to requests to create them. ++# ++if [istarget "hppa*-*-hpux*"] then { ++ if ![runto_main] then { fail "break tests suppressed" } ++ ++ send_gdb "hbreak\n" ++ gdb_expect { ++ -re "No hardware breakpoint support in the target.*$gdb_prompt $"\ ++ {pass "hw breaks disallowed"} ++ -re "$gdb_prompt $"\ ++ {fail "hw breaks disallowed"} ++ timeout {fail "(timeout) hw breaks disallowed"} ++ } ++ ++ send_gdb "thbreak\n" ++ gdb_expect { ++ -re "No hardware breakpoint support in the target.*$gdb_prompt $"\ ++ {pass "temporary hw breaks disallowed"} ++ -re "$gdb_prompt $"\ ++ {fail "temporary hw breaks disallowed"} ++ timeout {fail "(timeout) temporary hw breaks disallowed"} ++ } ++} ++ ++#******** ++ ++ ++# ++# Test "next" over recursive function call. ++# ++ ++proc test_next_with_recursion {} { ++ global gdb_prompt ++ global decimal ++ global binfile ++ ++ if [target_info exists use_gdb_stub] { ++ # Reload the program. ++ delete_breakpoints ++ gdb_load ${binfile}; ++ } else { ++ # FIXME: should be using runto ++ gdb_test "kill" "" "kill program" "Kill the program being debugged.*y or n. $" "y" ++ ++ delete_breakpoints ++ } ++ ++ gdb_test "break factorial" "Breakpoint $decimal at .*" "break at factorial" ++ ++ # Run until we call factorial with 6 ++ ++ if [istarget "*-*-vxworks*"] then { ++ send_gdb "run vxmain \"6\"\n" ++ } else { ++ gdb_run_cmd ++ } ++ gdb_expect { ++ -re "Break.* factorial .value=6. .*$gdb_prompt $" {} ++ -re ".*$gdb_prompt $" { ++ fail "run to factorial(6)"; ++ gdb_suppress_tests; ++ } ++ timeout { fail "run to factorial(6) (timeout)" ; gdb_suppress_tests } ++ } ++ ++ # Continue until we call factorial recursively with 5. ++ ++ if [gdb_test "continue" \ ++ "Continuing.*Break.* factorial .value=5. .*" \ ++ "continue to factorial(5)"] then { gdb_suppress_tests } ++ ++ # Do a backtrace just to confirm how many levels deep we are. ++ ++ if [gdb_test "backtrace" \ ++ "#0\[ \t\]+ factorial .value=5..*" \ ++ "backtrace from factorial(5)"] then { gdb_suppress_tests } ++ ++ # Now a "next" should position us at the recursive call, which ++ # we will be performing with 4. ++ ++ if [gdb_test "next" \ ++ ".* factorial .value - 1.;.*" \ ++ "next to recursive call"] then { gdb_suppress_tests } ++ ++ # Disable the breakpoint at the entry to factorial by deleting them all. ++ # The "next" should run until we return to the next line from this ++ # recursive call to factorial with 4. ++ # Buggy versions of gdb will stop instead at the innermost frame on ++ # the line where we are trying to "next" to. ++ ++ delete_breakpoints ++ ++ if [istarget "mips*tx39-*"] { ++ set timeout 60 ++ } ++ # We used to set timeout here for all other targets as well. This ++ # is almost certainly wrong. The proper timeout depends on the ++ # target system in use, and how we communicate with it, so there ++ # is no single value appropriate for all targets. The timeout ++ # should be established by the Dejagnu config file(s) for the ++ # board, and respected by the test suite. ++ # ++ # For example, if I'm running GDB over an SSH tunnel talking to a ++ # portmaster in California talking to an ancient 68k board running ++ # a crummy ROM monitor (a situation I can only wish were ++ # hypothetical), then I need a large timeout. But that's not the ++ # kind of knowledge that belongs in this file. ++ ++ gdb_test next "\[0-9\]*\[\t \]+return \\(value\\);.*" \ ++ "next over recursive call" ++ ++ # OK, we should be back in the same stack frame we started from. ++ # Do a backtrace just to confirm. ++ ++ set result [gdb_test "backtrace" \ ++ "#0\[ \t\]+ factorial .value=120.*\r\n#1\[ \t\]+ \[0-9a-fx\]+ in factorial .value=6..*" \ ++ "backtrace from factorial(5.1)"] ++ if { $result != 0 } { gdb_suppress_tests } ++ ++ if [target_info exists gdb,noresults] { gdb_suppress_tests } ++ gdb_continue_to_end "recursive next test" ++ gdb_stop_suppressing_tests; ++} ++ ++test_next_with_recursion ++ ++ ++#******** ++ ++# build a new file with optimization enabled so that we can try breakpoints ++# on targets with optimized prologues ++ ++set binfileo2 ${objdir}/${subdir}/${testfile}o2 ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}O0.o" object {debug "additional_flags=-w -O2 -fpie -pie"}] != "" } { ++ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." ++} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile1}" "${binfile}O1.o" object {debug "additional_flags=-w -O2 -fpie -pie"}] != "" } { ++ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." ++} ++ ++if { [gdb_compile "${binfile}O0.o ${binfile}O1.o" "${binfileo2}" executable {debug "additional_flags=-w -fpie -pie"}] != "" } { ++ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." ++} ++ ++if [get_compiler_info ${binfileo2}] { ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfileo2} ++ ++if [target_info exists gdb_stub] { ++ gdb_step_for_stub; ++} ++ ++# ++# test break at function ++# ++gdb_test "break main" \ ++ "Breakpoint.*at.* file .*$srcfile, line.*" \ ++ "breakpoint function, optimized file" ++ ++# ++# test break at function ++# ++gdb_test "break marker4" \ ++ "Breakpoint.*at.* file .*$srcfile1, line.*" \ ++ "breakpoint small function, optimized file" ++ ++# ++# run until the breakpoint at main is hit. For non-stubs-using targets. ++# ++if ![target_info exists use_gdb_stub] { ++ if [istarget "*-*-vxworks*"] then { ++ send_gdb "run vxmain \"2\"\n" ++ set timeout 120 ++ verbose "Timeout is now $timeout seconds" 2 ++ } else { ++ send_gdb "run\n" ++ } ++ gdb_expect { ++ -re "The program .* has been started already.*y or n. $" { ++ send_gdb "y\n" ++ exp_continue ++ } ++ -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.* \{.*$gdb_prompt $"\ ++ { pass "run until function breakpoint, optimized file" } ++ -re "Starting program.*Breakpoint \[0-9\]+,.*main .*argc.*argv.* at .*$gdb_prompt $"\ ++ { pass "run until function breakpoint, optimized file (code motion)" } ++ -re ".*$gdb_prompt $" { fail "run until function breakpoint, optimized file" } ++ timeout { fail "run until function breakpoint, optimized file (timeout)" } ++ } ++} else { ++ if ![target_info exists gdb_stub] { ++ gdb_test continue ".*Continuing\\..*Breakpoint \[0-9\]+, main \\(argc=.*, argv=.*, envp=.*\\) at .*$srcfile:$bp_location6.*$bp_location6\[\t \]+if .argc.*\{.*" "stub continue, optimized file" ++ } ++} ++ ++# ++# run until the breakpoint at a small function ++# ++ ++# ++# Add a second pass pattern. The behavior differs here between stabs ++# and dwarf for one-line functions. Stabs preserves two line symbols ++# (one before the prologue and one after) with the same line number, ++# but dwarf regards these as duplicates and discards one of them. ++# Therefore the address after the prologue (where the breakpoint is) ++# has no exactly matching line symbol, and GDB reports the breakpoint ++# as if it were in the middle of a line rather than at the beginning. ++ ++set bp_location13 [gdb_get_line_number "set breakpoint 13 here" $srcfile1] ++set bp_location14 [gdb_get_line_number "set breakpoint 14 here" $srcfile1] ++send_gdb "continue\n" ++gdb_expect { ++ -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile1:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" { ++ pass "run until breakpoint set at small function, optimized file" ++ } ++ -re "Breakpoint $decimal, $hex in marker4 \\(d=177601976\\) at .*$srcfile1:$bp_location13\[\r\n\]+$bp_location13\[\t \]+void marker4.*" { ++ pass "run until breakpoint set at small function, optimized file" ++ } ++ -re "Breakpoint $decimal, marker4 \\(d=177601976\\) at .*$srcfile1:$bp_location14\[\r\n\]+$bp_location14\[\t \]+void marker4.*" { ++ # marker4() is defined at line 46 when compiled with -DPROTOTYPES ++ pass "run until breakpoint set at small function, optimized file (line bp_location14)" ++ } ++ -re ".*$gdb_prompt " { ++ fail "run until breakpoint set at small function, optimized file" ++ } ++ timeout { ++ fail "run until breakpoint set at small function, optimized file (timeout)" ++ } ++} ++ ++ ++# Reset the default arguments for VxWorks ++if [istarget "*-*-vxworks*"] { ++ set timeout 10 ++ verbose "Timeout is now $timeout seconds" 2 ++ send_gdb "set args main\n" ++ gdb_expect -re ".*$gdb_prompt $" {} ++} +Index: gdb-6.5.dfsg/gdb/testsuite/gdb.pie/break1.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.5.dfsg/gdb/testsuite/gdb.pie/break1.c 2006-12-14 15:02:34.000000000 -0800 +@@ -0,0 +1,44 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 1992, 1993, 1994, 1995, 1999, 2002, 2003 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. ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@prep.ai.mit.edu */ ++ ++/* The code for this file was extracted from the gdb testsuite ++ testcase "break.c". */ ++ ++/* The following functions do nothing useful. They are included ++ simply as places to try setting breakpoints at. They are ++ explicitly "one-line functions" to verify that this case works ++ (some versions of gcc have or have had problems with this). ++ ++ These functions are in a separate source file to prevent an ++ optimizing compiler from inlining them and optimizing them away. */ ++ ++#ifdef PROTOTYPES ++int marker1 (void) { return (0); } /* set breakpoint 15 here */ ++int marker2 (int a) { return (1); } /* set breakpoint 8 here */ ++void marker3 (char *a, char *b) {} /* set breakpoint 17 here */ ++void marker4 (long d) {} /* set breakpoint 14 here */ ++#else ++int marker1 () { return (0); } /* set breakpoint 16 here */ ++int marker2 (a) int a; { return (1); } /* set breakpoint 9 here */ ++void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */ ++void marker4 (d) long d; {} /* set breakpoint 13 here */ ++#endif +Index: gdb-6.5.dfsg/gdb/testsuite/gdb.pie/corefile.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.5.dfsg/gdb/testsuite/gdb.pie/corefile.exp 2006-12-14 15:02:34.000000000 -0800 +@@ -0,0 +1,243 @@ ++# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 ++# 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. ++ ++# Please email any bugs, comments, and/or additions to this file to: ++# bug-gdb@prep.ai.mit.edu ++ ++# This file was written by Fred Fish. (fnf@cygnus.com) ++ ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++set prms_id 0 ++set bug_id 0 ++ ++# are we on a target board ++if ![isnative] then { ++ return ++} ++ ++set testfile "coremaker" ++set srcfile ${testfile}.c ++set binfile ${objdir}/${subdir}/${testfile} ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug "additional_flags=-fpie -pie"}] != "" } { ++ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." ++} ++ ++# Create and source the file that provides information about the compiler ++# used to compile the test case. ++if [get_compiler_info ${binfile}] { ++ return -1; ++} ++ ++# Create a core file named "corefile" rather than just "core", to ++# avoid problems with sys admin types that like to regularly prune all ++# files named "core" from the system. ++# ++# Arbitrarily try setting the core size limit to "unlimited" since ++# this does not hurt on systems where the command does not work and ++# allows us to generate a core on systems where it does. ++# ++# Some systems append "core" to the name of the program; others append ++# the name of the program to "core"; still others (like Linux, as of ++# May 2003) create cores named "core.PID". In the latter case, we ++# could have many core files lying around, and it may be difficult to ++# tell which one is ours, so let's run the program in a subdirectory. ++set found 0 ++set coredir "${objdir}/${subdir}/coredir.[getpid]" ++file mkdir $coredir ++catch "system \"(cd ${coredir}; ulimit -c unlimited; ${binfile}; true) >/dev/null 2>&1\"" ++# remote_exec host "${binfile}" ++foreach i "${coredir}/core ${coredir}/core.coremaker.c ${binfile}.core" { ++ if [remote_file build exists $i] { ++ remote_exec build "mv $i ${objdir}/${subdir}/corefile" ++ set found 1 ++ } ++} ++# Check for "core.PID". ++if { $found == 0 } { ++ set names [glob -nocomplain -directory $coredir core.*] ++ if {[llength $names] == 1} { ++ set corefile [file join $coredir [lindex $names 0]] ++ remote_exec build "mv $corefile ${objdir}/${subdir}/corefile" ++ set found 1 ++ } ++} ++if { $found == 0 } { ++ # The braindamaged HPUX shell quits after the ulimit -c above ++ # without executing ${binfile}. So we try again without the ++ # ulimit here if we didn't find a core file above. ++ # Oh, I should mention that any "braindamaged" non-Unix system has ++ # the same problem. I like the cd bit too, it's really neat'n stuff. ++ catch "system \"(cd ${objdir}/${subdir}; ${binfile}; true) >/dev/null 2>&1\"" ++ foreach i "${objdir}/${subdir}/core ${objdir}/${subdir}/core.coremaker.c ${binfile}.core" { ++ if [remote_file build exists $i] { ++ remote_exec build "mv $i ${objdir}/${subdir}/corefile" ++ set found 1 ++ } ++ } ++} ++ ++# Try to clean up after ourselves. ++remote_file build delete [file join $coredir coremmap.data] ++remote_exec build "rmdir $coredir" ++ ++if { $found == 0 } { ++ warning "can't generate a core file - core tests suppressed - check ulimit -c" ++ return 0 ++} ++ ++# ++# Test that we can simply startup with a "-core=corefile" command line arg ++# and recognize that the core file is a valid, usable core file. ++# To do this, we must shutdown the currently running gdb and restart ++# with the -core args. We can't use gdb_start because it looks for ++# the first gdb prompt, and the message we are looking for occurs ++# before the first prompt. Also, we can't include GDBFLAGS because ++# if it is empty, this confuses gdb with an empty argument that it ++# grumbles about (said grumbling currently being ignored in gdb_start). ++# **FIXME** ++# ++# Another problem is that on some systems (solaris for example), there ++# is apparently a limit on the length of a fully specified path to ++# the coremaker executable, at about 80 chars. For this case, consider ++# it a pass, but note that the program name is bad. ++ ++gdb_exit ++if $verbose>1 then { ++ send_user "Spawning $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile\n" ++} ++ ++set oldtimeout $timeout ++set timeout [expr "$timeout + 60"] ++verbose "Timeout is now $timeout seconds" 2 ++eval "spawn $GDB -nw $GDBFLAGS -core=$objdir/$subdir/corefile" ++expect { ++ -re "Couldn't find .* registers in core file.*$gdb_prompt $" { ++ fail "args: -core=corefile (couldn't find regs)" ++ } ++ -re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" { ++ pass "args: -core=corefile" ++ } ++ -re "Core was generated by .*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" { ++ pass "args: -core=corefile (with bad program name)" ++ } ++ -re ".*registers from core file: File in wrong format.* $" { ++ fail "args: -core=corefile (could not read registers from core file)" ++ } ++ -re ".*$gdb_prompt $" { fail "args: -core=corefile" } ++ timeout { fail "(timeout) starting with -core" } ++} ++ ++ ++# ++# Test that startup with both an executable file and -core argument. ++# See previous comments above, they are still applicable. ++# ++ ++close; ++ ++if $verbose>1 then { ++ send_user "Spawning $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile\n" ++} ++ ++ ++eval "spawn $GDB -nw $GDBFLAGS $binfile -core=$objdir/$subdir/corefile"; ++expect { ++ -re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" { ++ pass "args: execfile -core=corefile" ++ } ++ -re "Core was generated by .*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" { ++ pass "args: execfile -core=corefile (with bad program name)" ++ } ++ -re ".*registers from core file: File in wrong format.* $" { ++ fail "args: execfile -core=corefile (could not read registers from core file)" ++ } ++ -re ".*$gdb_prompt $" { fail "args: execfile -core=corefile" } ++ timeout { fail "(timeout) starting with -core" } ++} ++set timeout $oldtimeout ++verbose "Timeout is now $timeout seconds" 2 ++ ++close; ++ ++# Now restart normally. ++ ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++# Test basic corefile recognition via core-file command. ++ ++send_gdb "core-file $objdir/$subdir/corefile\n" ++gdb_expect { ++ -re ".* program is being debugged already.*y or n. $" { ++ # gdb_load may connect us to a gdbserver. ++ send_gdb "y\n" ++ exp_continue; ++ } ++ -re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" { ++ pass "core-file command" ++ } ++ -re "Core was generated by .*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" { ++ pass "core-file command (with bad program name)" ++ } ++ -re ".*registers from core file: File in wrong format.* $" { ++ fail "core-file command (could not read registers from core file)" ++ } ++ -re ".*$gdb_prompt $" { fail "core-file command" } ++ timeout { fail "(timeout) core-file command" } ++} ++ ++# Test correct mapping of corefile sections by printing some variables. ++ ++gdb_test "print coremaker_data" "\\\$$decimal = 202" ++gdb_test "print coremaker_bss" "\\\$$decimal = 10" ++gdb_test "print coremaker_ro" "\\\$$decimal = 201" ++ ++gdb_test "print func2::coremaker_local" "\\\$$decimal = \\{0, 1, 2, 3, 4\\}" ++ ++# Somehow we better test the ability to read the registers out of the core ++# file correctly. I don't think the other tests do this. ++ ++gdb_test "bt" "abort.*func2.*func1.*main.*" "backtrace in corefile.exp" ++gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp" ++ ++# Test ability to read mmap'd data ++ ++gdb_test "x/8bd buf1" ".*:.*0.*1.*2.*3.*4.*5.*6.*7" "accessing original mmap data in core file" ++setup_xfail "*-*-sunos*" "*-*-ultrix*" "*-*-aix*" ++set test "accessing mmapped data in core file" ++gdb_test_multiple "x/8bd buf2" "$test" { ++ -re ".*:.*0.*1.*2.*3.*4.*5.*6.*7.*$gdb_prompt $" { ++ pass "$test" ++ } ++ -re "0x\[f\]*:.*Cannot access memory at address 0x\[f\]*.*$gdb_prompt $" { ++ fail "$test (mapping failed at runtime)" ++ } ++ -re "0x.*:.*Cannot access memory at address 0x.*$gdb_prompt $" { ++ fail "$test (mapping address not found in core file)" ++ } ++} ++ ++# test reinit_frame_cache ++ ++gdb_load ${binfile} ++gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\).*" "up in corefile.exp (reinit)" ++ ++gdb_test "core" "No core file now." +Index: gdb-6.5.dfsg/gdb/testsuite/gdb.pie/coremaker.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.5.dfsg/gdb/testsuite/gdb.pie/coremaker.c 2006-12-14 15:02:34.000000000 -0800 +@@ -0,0 +1,142 @@ ++/* Copyright 1992, 1993, 1994, 1995, 1996, 1999 ++ Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or (at ++ your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, but ++ WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 59 Temple Place - Suite 330, ++ Boston, MA 02111-1307, USA. */ ++ ++/* Simple little program that just generates a core dump from inside some ++ nested function calls. */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#ifndef __STDC__ ++#define const /**/ ++#endif ++ ++#define MAPSIZE (8 * 1024) ++ ++/* Don't make these automatic vars or we will have to walk back up the ++ stack to access them. */ ++ ++char *buf1; ++char *buf2; ++ ++int coremaker_data = 1; /* In Data section */ ++int coremaker_bss; /* In BSS section */ ++ ++const int coremaker_ro = 201; /* In Read-Only Data section */ ++ ++/* Note that if the mapping fails for any reason, we set buf2 ++ to -1 and the testsuite notices this and reports it as ++ a failure due to a mapping error. This way we don't have ++ to test for specific errors when running the core maker. */ ++ ++void ++mmapdata () ++{ ++ int j, fd; ++ ++ /* Allocate and initialize a buffer that will be used to write ++ the file that is later mapped in. */ ++ ++ buf1 = (char *) malloc (MAPSIZE); ++ for (j = 0; j < MAPSIZE; ++j) ++ { ++ buf1[j] = j; ++ } ++ ++ /* Write the file to map in */ ++ ++ fd = open ("coremmap.data", O_CREAT | O_RDWR, 0666); ++ if (fd == -1) ++ { ++ perror ("coremmap.data open failed"); ++ buf2 = (char *) -1; ++ return; ++ } ++ write (fd, buf1, MAPSIZE); ++ ++ /* Now map the file into our address space as buf2 */ ++ ++ buf2 = (char *) mmap (0, MAPSIZE, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0); ++ if (buf2 == (char *) -1) ++ { ++ perror ("mmap failed"); ++ return; ++ } ++ ++ /* Verify that the original data and the mapped data are identical. ++ If not, we'd rather fail now than when trying to access the mapped ++ data from the core file. */ ++ ++ for (j = 0; j < MAPSIZE; ++j) ++ { ++ if (buf1[j] != buf2[j]) ++ { ++ fprintf (stderr, "mapped data is incorrect"); ++ buf2 = (char *) -1; ++ return; ++ } ++ } ++} ++ ++void ++func2 () ++{ ++ int coremaker_local[5]; ++ int i; ++ ++#ifdef SA_FULLDUMP ++ /* Force a corefile that includes the data section for AIX. */ ++ { ++ struct sigaction sa; ++ ++ sigaction (SIGABRT, (struct sigaction *)0, &sa); ++ sa.sa_flags |= SA_FULLDUMP; ++ sigaction (SIGABRT, &sa, (struct sigaction *)0); ++ } ++#endif ++ ++ /* Make sure that coremaker_local doesn't get optimized away. */ ++ for (i = 0; i < 5; i++) ++ coremaker_local[i] = i; ++ coremaker_bss = 0; ++ for (i = 0; i < 5; i++) ++ coremaker_bss += coremaker_local[i]; ++ coremaker_data = coremaker_ro + 1; ++ abort (); ++} ++ ++void ++func1 () ++{ ++ func2 (); ++} ++ ++int main () ++{ ++ mmapdata (); ++ func1 (); ++ return 0; ++} ++ --- gdb-6.7.1.orig/debian/patches/cp-pass-by-reference.patch +++ gdb-6.7.1/debian/patches/cp-pass-by-reference.patch @@ -0,0 +1,431 @@ +A version of this patch was committed to GDB HEAD after 6.7 branched. + +--- + gdb/Makefile.in | 2 + gdb/cp-abi.c | 8 +++ + gdb/cp-abi.h | 5 ++ + gdb/gnu-v3-abi.c | 79 +++++++++++++++++++++++++++++++++++ + gdb/infcall.c | 71 ++++++++++++++++++++++++++----- + gdb/testsuite/gdb.cp/pass-by-ref.cc | 57 +++++++++++++++++++++++++ + gdb/testsuite/gdb.cp/pass-by-ref.exp | 38 ++++++++++++++++ + 7 files changed, 248 insertions(+), 12 deletions(-) + +Index: gdb-6.6.dfsg.90.20070912/gdb/infcall.c +=================================================================== +--- gdb-6.6.dfsg.90.20070912.orig/gdb/infcall.c 2007-08-23 14:08:35.000000000 -0400 ++++ gdb-6.6.dfsg.90.20070912/gdb/infcall.c 2007-09-15 10:13:26.000000000 -0400 +@@ -34,6 +34,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? + +@@ -339,8 +340,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; +@@ -354,6 +355,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 (TYPE_CODE (ftype) == TYPE_CODE_PTR) + ftype = check_typedef (TYPE_TARGET_TYPE (ftype)); +@@ -460,10 +462,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 +@@ -482,7 +505,7 @@ call_function_by_hand (struct value *fun + if (gdbarch_inner_than (current_gdbarch, 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, get_current_regcache ()); + dummy_addr = sp; + } +@@ -490,7 +513,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, get_current_regcache ()); + } + break; +@@ -557,9 +580,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 +@@ -659,7 +688,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 (gdbarch_inner_than (current_gdbarch, 1, 2)) +@@ -684,6 +713,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. */ +@@ -691,6 +736,8 @@ You must use a pointer to function type + get_current_regcache (), 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 +@@ -882,7 +929,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. */ +@@ -892,7 +941,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.6.dfsg.90.20070912/gdb/cp-abi.h +=================================================================== +--- gdb-6.6.dfsg.90.20070912.orig/gdb/cp-abi.h 2007-08-23 14:08:27.000000000 -0400 ++++ gdb-6.6.dfsg.90.20070912/gdb/cp-abi.h 2007-09-15 10:12:50.000000000 -0400 +@@ -172,6 +172,10 @@ void cplus_make_method_ptr (gdb_byte *CO + + CORE_ADDR cplus_skip_trampoline (struct frame_info *frame, CORE_ADDR stop_pc); + ++/* 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; +@@ -195,6 +199,7 @@ struct cp_abi_ops + void (*make_method_ptr) (gdb_byte *, CORE_ADDR, int); + struct value * (*method_ptr_to_value) (struct value **, struct value *); + CORE_ADDR (*skip_trampoline) (struct frame_info *, CORE_ADDR); ++ int (*pass_by_reference) (struct type *type); + }; + + +Index: gdb-6.6.dfsg.90.20070912/gdb/cp-abi.c +=================================================================== +--- gdb-6.6.dfsg.90.20070912.orig/gdb/cp-abi.c 2007-08-23 14:08:27.000000000 -0400 ++++ gdb-6.6.dfsg.90.20070912/gdb/cp-abi.c 2007-09-15 10:12:17.000000000 -0400 +@@ -135,6 +135,14 @@ cplus_method_ptr_to_value (struct value + return (*current_cp_abi.method_ptr_to_value) (this_p, method_ptr); + } + ++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.6.dfsg.90.20070912/gdb/gnu-v3-abi.c +=================================================================== +--- gdb-6.6.dfsg.90.20070912.orig/gdb/gnu-v3-abi.c 2007-08-23 14:08:33.000000000 -0400 ++++ gdb-6.6.dfsg.90.20070912/gdb/gnu-v3-abi.c 2007-09-15 10:14:09.000000000 -0400 +@@ -716,6 +716,84 @@ gnuv3_skip_trampoline (struct frame_info + return real_stop_pc; + } + ++/* 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) + { +@@ -738,6 +816,7 @@ init_gnuv3_ops (void) + gnu_v3_abi_ops.make_method_ptr = gnuv3_make_method_ptr; + gnu_v3_abi_ops.method_ptr_to_value = gnuv3_method_ptr_to_value; + gnu_v3_abi_ops.skip_trampoline = gnuv3_skip_trampoline; ++ gnu_v3_abi_ops.pass_by_reference = gnuv3_pass_by_reference; + } + + extern initialize_file_ftype _initialize_gnu_v3_abi; /* -Wmissing-prototypes */ +Index: gdb-6.6.dfsg.90.20070912/gdb/Makefile.in +=================================================================== +--- gdb-6.6.dfsg.90.20070912.orig/gdb/Makefile.in 2007-09-04 20:14:02.000000000 -0400 ++++ gdb-6.6.dfsg.90.20070912/gdb/Makefile.in 2007-09-15 10:12:17.000000000 -0400 +@@ -2174,7 +2174,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.6.dfsg.90.20070912/gdb/testsuite/gdb.cp/pass-by-ref.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.6.dfsg.90.20070912/gdb/testsuite/gdb.cp/pass-by-ref.exp 2007-09-15 10:12:17.000000000 -0400 +@@ -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.6.dfsg.90.20070912/gdb/testsuite/gdb.cp/pass-by-ref.cc +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.6.dfsg.90.20070912/gdb/testsuite/gdb.cp/pass-by-ref.cc 2007-09-15 10:12:17.000000000 -0400 +@@ -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.7.1.orig/debian/patches/gdbinit-ownership.patch +++ gdb-6.7.1/debian/patches/gdbinit-ownership.patch @@ -0,0 +1,130 @@ +This patch was not popular upstream; there was no fundamental objection, but +several problems with the implementation. It needs to be revisited. + +--- + gdb/Makefile.in | 2 +- + gdb/cli/cli-cmds.c | 41 +++++++++++++++++++++++++++++++++++++---- + gdb/main.c | 4 ++-- + 3 files changed, 40 insertions(+), 7 deletions(-) + +Index: gdb-6.7.1/gdb/cli/cli-cmds.c +=================================================================== +--- gdb-6.7.1.orig/gdb/cli/cli-cmds.c 2007-12-03 09:37:03.000000000 -0500 ++++ gdb-6.7.1/gdb/cli/cli-cmds.c 2007-12-03 09:37:44.000000000 -0500 +@@ -36,6 +36,7 @@ + #include "objfiles.h" + #include "source.h" + #include "disasm.h" ++#include "gdb_stat.h" + + #include "ui-out.h" + +@@ -51,6 +52,8 @@ + + #include + ++#include ++ + /* Prototypes for local command functions */ + + static void complete_command (char *, int); +@@ -430,6 +433,10 @@ 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_script (char *file, int from_tty) + { +@@ -439,9 +446,7 @@ source_script (char *file, int from_tty) + int fd; + + if (file == NULL || *file == 0) +- { +- error (_("source command requires file name of file to source.")); +- } ++ error (_("source command requires file name of file to source.")); + + file = tilde_expand (file); + old_cleanups = make_cleanup (xfree, file); +@@ -459,13 +464,41 @@ source_script (char *file, int from_tty) + + if (fd == -1) + { +- if (from_tty) ++ if (from_tty > 0) + perror_with_name (file); + else + return; + } + + stream = fdopen (fd, FOPEN_RT); ++ ++ if (stream == NULL) ++ { ++ if (from_tty) ++ 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.7.1/gdb/main.c +=================================================================== +--- gdb-6.7.1.orig/gdb/main.c 2007-12-03 09:37:03.000000000 -0500 ++++ gdb-6.7.1/gdb/main.c 2007-12-03 09:37:44.000000000 -0500 +@@ -688,7 +688,7 @@ extern int gdbtk_test (char *); + + if (!inhibit_gdbinit) + { +- catch_command_errors (source_script, homeinit, 0, RETURN_MASK_ALL); ++ catch_command_errors (source_script, homeinit, -1, RETURN_MASK_ALL); + } + + /* Do stats; no need to do them elsewhere since we'll only +@@ -766,7 +766,7 @@ extern int gdbtk_test (char *); + || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat))) + if (!inhibit_gdbinit) + { +- catch_command_errors (source_script, gdbinit, 0, RETURN_MASK_ALL); ++ catch_command_errors (source_script, gdbinit, -1, RETURN_MASK_ALL); + } + + for (i = 0; i < ncmd; i++) +Index: gdb-6.7.1/gdb/Makefile.in +=================================================================== +--- gdb-6.7.1.orig/gdb/Makefile.in 2007-12-03 09:37:37.000000000 -0500 ++++ gdb-6.7.1/gdb/Makefile.in 2007-12-03 09:37:44.000000000 -0500 +@@ -2882,7 +2882,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) $(completer_h) $(ui_out_h) \ --- gdb-6.7.1.orig/debian/patches/pending-breakpoints-and-sigttou.patch +++ gdb-6.7.1/debian/patches/pending-breakpoints-and-sigttou.patch @@ -0,0 +1,25 @@ +Don't generate SIGTTOU when resolving a pending breakpoint. + +--- + gdb/infrun.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +Index: gdb-6.7.1/gdb/infrun.c +=================================================================== +--- gdb-6.7.1.orig/gdb/infrun.c 2007-12-03 09:37:03.000000000 -0500 ++++ gdb-6.7.1/gdb/infrun.c 2007-12-03 09:37:47.000000000 -0500 +@@ -2244,12 +2244,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.7.1.orig/debian/patches/thread-db-multiple-libraries.patch +++ gdb-6.7.1/debian/patches/thread-db-multiple-libraries.patch @@ -0,0 +1,509 @@ +Support loading two libthread_db DSOs. In this case, the LinuxThreads +and NPTL ones. + +--- + gdb/linux-thread-db.c | 297 ++++++++++++++++++++++++++++++-------------------- + 1 file changed, 181 insertions(+), 116 deletions(-) + +Index: gdb-6.6.dfsg.90.20070912/gdb/linux-thread-db.c +=================================================================== +--- gdb-6.6.dfsg.90.20070912.orig/gdb/linux-thread-db.c 2007-09-15 10:26:37.000000000 -0400 ++++ gdb-6.6.dfsg.90.20070912/gdb/linux-thread-db.c 2007-09-15 11:14:04.000000000 -0400 +@@ -75,45 +75,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_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); +@@ -251,7 +269,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)); +@@ -305,8 +323,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) +@@ -333,7 +352,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)); +@@ -380,69 +400,86 @@ 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; + + /* 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 +@@ -452,7 +489,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; + +@@ -483,8 +520,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. */ +@@ -501,7 +540,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"), +@@ -541,7 +580,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 (); +@@ -584,11 +623,10 @@ check_thread_signals (void) + void + check_for_thread_db (void) + { +- td_err_e err; + static int already_loaded; + + /* Do nothing if we couldn't load libthread_db.so.1. */ +- if (td_ta_new_p == NULL) ++ if (all_pointers == NULL) + return; + + /* First time through, report that libthread_db was successfuly +@@ -597,19 +635,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; + } + +@@ -631,28 +658,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; ++ 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; + +- case TD_OK: +- printf_unfiltered (_("[Thread debugging using libthread_db enabled]\n")); ++ case TD_OK: ++ printf_unfiltered (_("[Thread debugging using libthread_db enabled]\n")); + +- /* 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 (); +- 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; ++ } + } + } + +@@ -713,7 +746,7 @@ attach_thread (ptid_t ptid, const td_thr + printf_unfiltered (_("[New %s]\n"), target_pid_to_str (ptid)); + + /* 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)); +@@ -821,7 +854,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) +@@ -831,7 +864,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)); + +@@ -948,7 +981,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)); +@@ -966,7 +999,7 @@ find_new_threads_callback (const td_thrh + be yet. Just enable event reporting and otherwise ignore + it. */ + +- 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)); +@@ -986,9 +1019,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)); + } +@@ -1070,7 +1104,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")); + +@@ -1083,9 +1117,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 *)(size_t) lm, +- offset, &address); ++ err = current_pointers->td_thr_tls_get_addr_p ++ (&thread_info->private->th, (void *)(size_t) lm, offset, &address); + + #ifdef THREAD_DB_HAS_TD_NOTALLOC + /* The memory hasn't been allocated, yet. */ +@@ -1141,13 +1174,45 @@ 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 ()) ++ ptrs = thread_db_load (LIBTHREAD_DB_SO); ++ if (ptrs == NULL) ++ return; ++ ++ all_pointers = ptrs; ++ ++ /* 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) + { +- init_thread_db_ops (); +- add_target (&thread_db_ops); ++ const char *component; + +- /* Add ourselves to objfile event chain. */ +- observer_attach_new_objfile (thread_db_new_objfile); ++ 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. */ ++ observer_attach_new_objfile (thread_db_new_objfile); + } --- gdb-6.7.1.orig/debian/patches/gdb-pascal-support.patch +++ gdb-6.7.1/debian/patches/gdb-pascal-support.patch @@ -0,0 +1,25 @@ +Originally from: + http://www.math.uni.wroc.pl/~hebisch/gpc/ + +I believe this patch was posted to gdb-patches and never reviewed. +But M2 support added set types just before GDB 6.5, and now there's +not much left of this. + +--- + gdb/dwarf2read.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +Index: gdb-6.6.dfsg.90.20070912/gdb/dwarf2read.c +=================================================================== +--- gdb-6.6.dfsg.90.20070912.orig/gdb/dwarf2read.c 2007-09-15 10:18:23.000000000 -0400 ++++ gdb-6.6.dfsg.90.20070912/gdb/dwarf2read.c 2007-09-15 10:19:20.000000000 -0400 +@@ -7616,7 +7616,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.7.1.orig/debian/patches/linux-clear-thread-list.patch +++ gdb-6.7.1/debian/patches/linux-clear-thread-list.patch @@ -0,0 +1,23 @@ +Status: unsubmitted + +This patch was for Debian bug #303736. I now believe it's in the wrong +place; the generic mourn inferior should do this, perhaps. + +--- + gdb/linux-thread-db.c | 3 +++ + 1 file changed, 3 insertions(+) + +Index: gdb-6.7.1/gdb/linux-thread-db.c +=================================================================== +--- gdb-6.7.1.orig/gdb/linux-thread-db.c 2007-12-03 09:38:14.000000000 -0500 ++++ gdb-6.7.1/gdb/linux-thread-db.c 2007-12-03 09:38:18.000000000 -0500 +@@ -965,6 +965,9 @@ thread_db_mourn_inferior (void) + + target_beneath->to_mourn_inferior (); + ++ /* Destroy thread info; it's no longer valid. */ ++ init_thread_list (); ++ + /* Delete the old thread event breakpoints. Do this after mourning + the inferior, so that we don't try to uninsert them. */ + remove_thread_event_breakpoints (); --- gdb-6.7.1.orig/debian/patches/gdb-mi-varobj-crash.patch +++ gdb-6.7.1/debian/patches/gdb-mi-varobj-crash.patch @@ -0,0 +1,88 @@ +2007-11-08 Vladimir Prus + + Fix crash when a variable object being deleted + has any of its children deleted previously. + + * varobj.c (delete_variable_1): Don't recurse + into deleted children. + +2007-11-08 Vladimir Prus + + * gdb.mi/mi-var-child.c (do_child_deletion): New. + * gdb.mi/mi-var-child.exp: Run child_deletion tests. + +--- + gdb/testsuite/gdb.mi/mi-var-child.c | 24 ++++++++++++++++++++++++ + gdb/testsuite/gdb.mi/mi-var-child.exp | 2 ++ + gdb/varobj.c | 2 ++ + 3 files changed, 28 insertions(+) + +Index: gdb-6.7.1/gdb/testsuite/gdb.mi/mi-var-child.c +=================================================================== +--- gdb-6.7.1.orig/gdb/testsuite/gdb.mi/mi-var-child.c 2007-08-23 14:08:49.000000000 -0400 ++++ gdb-6.7.1/gdb/testsuite/gdb.mi/mi-var-child.c 2007-12-03 10:11:56.000000000 -0500 +@@ -306,6 +306,29 @@ do_special_tests (void) + incr_a(2); + } + ++struct very_simple_struct ++{ ++ int a; ++ int b; ++}; ++ ++int ++do_child_deletion (void) ++{ ++ /*: BEGIN: child_deletion :*/ ++ struct very_simple_struct s = {1, 2}; ++ /*: ++ mi_create_varobj S s "create varobj for s" ++ mi_list_varobj_children S {{S.a a 0 int} {S.b b 0 int}} \ ++ "list children of S" ++ mi_delete_varobj S.a "delete S.a" ++ mi_delete_varobj S.b "delete S.b" ++ mi_delete_varobj S "delete S" ++ :*/ ++ return 99; ++ /*: END: child_deletion :*/ ++} ++ + int + main (int argc, char *argv []) + { +@@ -313,6 +336,7 @@ main (int argc, char *argv []) + do_block_tests (); + do_children_tests (); + do_special_tests (); ++ do_child_deletion (); + exit (0); + } + +Index: gdb-6.7.1/gdb/testsuite/gdb.mi/mi-var-child.exp +=================================================================== +--- gdb-6.7.1.orig/gdb/testsuite/gdb.mi/mi-var-child.exp 2007-08-23 14:14:19.000000000 -0400 ++++ gdb-6.7.1/gdb/testsuite/gdb.mi/mi-var-child.exp 2007-12-03 10:11:56.000000000 -0500 +@@ -1227,7 +1227,9 @@ mi_gdb_test "-var-update *" \ + "\\^done,changelist=\\\[\{name=\"psnp->ptrs.0.next.next.long_ptr\",in_scope=\"true\",type_changed=\"false\"\}\\\]" \ + "update all vars psnp->next->next->long_ptr (and 2.long_ptr) changed" + ++mi_prepare_inline_tests $srcfile + ++mi_run_inline_test child_deletion + + + mi_gdb_exit +Index: gdb-6.7.1/gdb/varobj.c +=================================================================== +--- gdb-6.7.1.orig/gdb/varobj.c 2007-08-31 15:01:17.000000000 -0400 ++++ gdb-6.7.1/gdb/varobj.c 2007-12-03 10:11:56.000000000 -0500 +@@ -1295,6 +1295,8 @@ delete_variable_1 (struct cpstack **resu + for (i = 0; i < VEC_length (varobj_p, var->children); ++i) + { + varobj_p child = VEC_index (varobj_p, var->children, i); ++ if (!child) ++ continue; + if (!remove_from_parent_p) + child->parent = NULL; + delete_variable_1 (resultp, delcountp, child, 0, only_children_p); --- gdb-6.7.1.orig/debian/patches/division-by-zero-u.patch +++ gdb-6.7.1/debian/patches/division-by-zero-u.patch @@ -0,0 +1,32 @@ +--- + gdb/valarith.c | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +Index: gdb-6.7/gdb/valarith.c +=================================================================== +--- gdb-6.7.orig/gdb/valarith.c 2007-10-16 10:37:36.000000000 -0400 ++++ gdb-6.7/gdb/valarith.c 2007-10-16 10:38:40.000000000 -0400 +@@ -935,7 +935,10 @@ value_binop (struct value *arg1, struct + break; + + case BINOP_DIV: +- v = v1 / v2; ++ if (v2 != 0) ++ v = v1 / v2; ++ else ++ error (_("Division by zero")); + break; + + case BINOP_EXP: +@@ -946,7 +949,10 @@ value_binop (struct value *arg1, struct + break; + + case BINOP_REM: +- v = v1 % v2; ++ if (v2 != 0) ++ v = v1 % v2; ++ else ++ error (_("Division by zero")); + break; + + case BINOP_MOD: --- gdb-6.7.1.orig/debian/patches/man-page-args.patch +++ gdb-6.7.1/debian/patches/man-page-args.patch @@ -0,0 +1,52 @@ +--- + gdb/gdb.1 | 27 ++++++++++++++++++++++++++- + 1 file changed, 26 insertions(+), 1 deletion(-) + +Index: gdb-6.6.dfsg/gdb/gdb.1 +=================================================================== +--- gdb-6.6.dfsg.orig/gdb/gdb.1 2007-01-27 20:35:18.000000000 -0500 ++++ gdb-6.6.dfsg/gdb/gdb.1 2007-01-27 20:35:35.000000000 -0500 +@@ -39,10 +39,25 @@ gdb \- The GNU Debugger + .I dir\c + \&\|] + .RB "[\|" \c +-.I prog\c ++.I prog + .RB "[\|" \c + .IR core \||\| procID\c + \&\|]\&\|] ++.TP ++.B gdb ++.RB "[\|" \c ++.I options\c ++.RB "\|]" ++.RB "--args" ++.I prog ++.RB "[\|" \c ++.I arguments\c ++.RB "\|]" ++.TP ++.B gdbtui ++.RB "[\|" \c ++.I options\c ++.RB "\|]" + .ad b + .SH DESCRIPTION + The purpose of a debugger such as GDB is to allow you to see what is +@@ -352,6 +367,16 @@ interface used by GDB for remote debuggi + Run using \c + .I device\c + \& for your program's standard input and output. ++ ++.TP ++.BI "\-\-args"\c ++Pass \c ++.I arguments\c ++\& after the program name to the program when it is run. ++ ++.TP ++.BI "\-tui"\c ++Run GDB using a text (console) user interface. + .PP + + .SH "SEE ALSO" --- gdb-6.7.1.orig/debian/gdb.install +++ gdb-6.7.1/debian/gdb.install @@ -0,0 +1,2 @@ +usr/bin/gdb* +usr/share/man/man1/gdb*.1 --- gdb-6.7.1.orig/debian/gdb.menu +++ gdb-6.7.1/debian/gdb.menu @@ -0,0 +1,3 @@ +?package(gdb):needs="text" title="GDB" section="Applications/Programming"\ + hints="Debuggers" command="/usr/bin/gdb" + --- gdb-6.7.1.orig/debian/changelog +++ gdb-6.7.1/debian/changelog @@ -0,0 +1,1133 @@ +gdb (6.7.1-2ubuntu1) hardy; urgency=low + + * Merge with Debian; remaining changes: + - Do not depend on type-handling. + - PIE support. + - dwarf2-stack-boundry.diff - security fix for CVE-2006-4146. + * Add patch from Ulrich Weigand to fix stepping over shared library + functions on PowerPC (Closes: #432461). LP: #137312. + + -- Matthias Klose Mon, 14 Jan 2008 17:32:12 +0100 + +gdb (6.7.1-2) unstable; urgency=low + + * Add patch from Ulrich Weigand to fix stepping over shared library + functions on PowerPC (Closes: #432461). + * Add libgdb-dev package for fp-ide (Closes: #458250). + * Avoid gcc-4.3 uninitialized warnings (Closes: #455669). + * Updated Standards-Version to 3.7.3 + - Correct Apps -> Applications in gdb.menu. + + -- Daniel Jacobowitz Wed, 02 Jan 2008 08:49:43 -0500 + +gdb (6.7.1-1ubuntu1) hardy; urgency=low + + * Merge with Debian; remaining changes: + - Do not depend on type-handling. + - PIE support. + - dwarf2-stack-boundry.diff - security fix for CVE-2006-4146. + * Add build-dependency on lib64expat1-dev. + + -- Matthias Klose Tue, 04 Dec 2007 09:13:57 +0100 + +gdb (6.7.1-1) unstable; urgency=low + + * New upstream release. + - Correct makeinfo version check (Closes: #453202). + * Merge Ubuntu support for a gdb64 package (Closes: #254270). + * Run the testsuite on all GNU/Linux platforms. + * Remove old support for skipping thread tests. + * Add an expat build dependency and add --with-expat. + * Update copyright notice. + * Do not freeze on division by zero (Closes: #414887). + * Rewrite HPPA kernel offsets patch to support HPPA64. + * Include Vladimir Prus's varobj fix for kdevelop (Closes: #443080). + + -- Daniel Jacobowitz Mon, 03 Dec 2007 10:12:27 -0500 + +gdb (6.6.dfsg.90.20070912-1) unstable; urgency=low + + * New upstream snapshot (pre-release for GDB 6.7). + - Patches 10.selected-frame.patch, dwarf2-long-size.patch merged upstream. + - Backports unwind-check-pc-regnum.patch, ia64-unwind-signedness.patch + removed. + - Patch 13.use-dynamic-readline.patch replaced by + --with-system-readline. + - Patch sim-destdir.patch unnecessary. + * Disable gcj and gobjc build dependencies for armel (Closes: #441741). + * Replace tetex-bin build dependency with texlive-base. + * Include kernel offsets for HPPA. + + -- Daniel Jacobowitz Sat, 15 Sep 2007 13:40:34 -0400 + +gdb (6.6.dfsg-3) unstable; urgency=low + + * Correct signedness error in ia64-tdep.c (Closes: #423631) (again). + + -- Daniel Jacobowitz Fri, 24 Aug 2007 15:48:11 -0400 + +gdb (6.6.dfsg-2) unstable; urgency=low + + * Check PC_REGNUM before using it (Closes: #423631). + + -- Daniel Jacobowitz Thu, 23 Aug 2007 22:26:20 -0400 + +gdb (6.6.dfsg-1ubuntu7) gutsy; urgency=low + + * Cross-compile gdb64. + * Don't try to install gdbserver on architectures where it doesn't exist. + + -- Matthias Klose Mon, 10 Sep 2007 21:28:07 +0200 + +gdb (6.6.dfsg-1ubuntu6) gutsy; urgency=low + + * Fix build failures on targets only building gdb. + * Remove the gdb32 package. + * Fix typos in message strings (LP: #63200). + + -- Matthias Klose Fri, 07 Sep 2007 18:06:20 +0000 + +gdb (6.6.dfsg-1ubuntu5) gutsy; urgency=low + + * Build a gdb64/gdb32 package on biarch architectures. LP: #25559. + * Set Ubuntu maintainer address. + + -- Matthias Klose Wed, 15 Aug 2007 19:01:05 +0000 + +gdb (6.6.dfsg-1ubuntu4) gutsy; urgency=low + + * Fix register definitions for hppa (Randolph Chung). + + -- Matthias Klose Fri, 03 Aug 2007 17:11:20 +0000 + +gdb (6.6.dfsg-1ubuntu3) gutsy; urgency=low + + * Run the testsuite on lpia. + + -- Matthias Klose Sat, 28 Jul 2007 18:32:30 +0200 + +gdb (6.6.dfsg-1ubuntu2) feisty; urgency=low + + * Reenable the workaround for a build failure on the ia64 buildd. + + -- Matthias Klose Sun, 11 Feb 2007 23:34:47 +0100 + +gdb (6.6.dfsg-1ubuntu1) feisty; urgency=low + + * Merge with Debian unstable; remaining changes: + - Do not depend on type-handling. + - PIE support. + - dwarf2-stack-boundry.diff - security fix for CVE-2006-4146. + + -- Matthias Klose Sun, 11 Feb 2007 14:54:38 +0100 + +gdb (6.6.dfsg-1) unstable; urgency=low + + [ Matthias Klose ] + * New upstream version. + - Prints a newline after EOF (Closes: #233467). + * sim-destdir.patch, gdbinit-ownership.patch, bfd-get-mtime-less.patch, + pie-support.patch, thread-db-multiple-libraries.patch: Update. + * thread-db-live-threads.patch, fork-context-switch.patch: Remove, + applied upstream. + + [ Daniel Jacobowitz ] + * Merge changes from Matthias Klose (thanks). + * Refresh all patches. + * Fix "corrupted DWARF expression" error (Closes: #405116). + * Do not crash if loading libthread_db failed (Closes: #408402). + * Initial support for building cross-GDB packages, based on the work of + Raphael Bossek and Kazuhiro Inaoka (Closes: #313340, #343419, #373927). + * Change priority to optional (since ftpmaster did). + + -- Daniel Jacobowitz Sat, 27 Jan 2007 21:59:06 -0500 + +gdb (6.6-0ubuntu1) feisty; urgency=low + + * New upstream version. + * sim-destdir.patch, gdbinit-ownership.patch, bfd-get-mtime-less.patch, + pie-support.patch, thread-db-multiple-libraries.patch: Update. + * thread-db-live-threads.patch, fork-context-switch.patch, + glibc2.5-gnu-hash.patch: Remove, applied upstream. + + -- Matthias Klose Thu, 4 Jan 2007 15:11:39 +0100 + +gdb (6.5.dfsg-2ubuntu3) feisty; urgency=low + + * Add PIE support, taken from Fedora patch bundle: + - debian/patches/pie-support.patch: core PIE support. + - debian/patches/pie-support-tests.patch: PIE operational tests. + * debian/rules: drop use of "tee" to solve strange hangs on i386/amd64. + + -- Kees Cook Thu, 14 Dec 2006 15:05:33 -0800 + +gdb (6.5.dfsg-2ubuntu2) feisty; urgency=low + + * Add debian/patches/glibc2.5-gnu-hash.patch: + - Teach gdb how to deal with glibc 2.5's .gnu.hash sections, so that gdb + works on feisty at all. + - Patch taken from upstream CVS head. + - Closes: LP#73724 + + -- Martin Pitt Thu, 14 Dec 2006 09:17:51 +0100 + +gdb (6.5.dfsg-2ubuntu1) feisty; urgency=low + + * Merge from debian unstable. Changes left: + - type-handling + - 'dwarf2-stack-boundry.diff' - security fix for CVE-2006-4146 + + -- Michael Vogt Thu, 23 Nov 2006 06:56:42 +0100 + +gdb (6.5.dfsg-2) unstable; urgency=low + + * Backport a patch to fix GDB segfaults on threaded programs. + * Backport a patch to fix errors on fork/vfork in threaded programs. + + -- Daniel Jacobowitz Thu, 16 Nov 2006 11:06:50 -0500 + +gdb (6.5.dfsg-1) unstable; urgency=low + + * New upstream release (Closes: #386586). + * Update Standards-Version to 3.7.2 (no changes required). + * Mention --args in the man page (Closes: #394150). + * Mention gdbtui and -tui (Closes: #362795). + * Correctly detect changed executables when rerunning. + + -- Daniel Jacobowitz Sun, 5 Nov 2006 18:33:48 -0500 + +gdb (6.4.90.dfsg-1ubuntu3) edgy; urgency=low + + * SECURITY UPDATE: fix local arbitrary code execution in DWARF processing. + * Add 'dwarf2-stack-boundry.diff': limits the DWARF operation stack. + Without this, arbitrary code execution would be possible if a user + were tricked into debugging an executable with malicious DWARF headers. + * References: + CVE-2006-4146 + https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=204845 + + -- Kees Cook Thu, 28 Sep 2006 11:13:50 -0700 + +gdb (6.4.90.dfsg-1ubuntu2) edgy; urgency=low + + * debian/patches/from_upstream_fix_context_switch.patch: + - upstream patch (http://sourceware.org/ml/gdb-cvs/2006-09/msg00053.html), + should fix a multi-threading issue (Ubuntu: #56391) + + -- Sebastien Bacher Fri, 29 Sep 2006 17:42:43 +0200 + +gdb (6.4.90.dfsg-1ubuntu1) edgy; urgency=low + + * Merge from debian unstable: + - left only type-handling bit. + + -- Fabio M. Di Nitto Tue, 04 Jul 2006 07:46:08 +0200 + +gdb (6.4.90.dfsg-1) unstable; urgency=low + + * New upstream snapshot (GDB 6.5 prerelease). + - BFD build fix for GCC 4.2 (Closes: #364124). + - xstrvprintf error message corrected (Closes: #296483). + - Rewritten printf command (Closes: #186037, #231162). + - Build fix for hurd-i386 (Closes: #345108). + * Split the GDB package into DFSG and non-DFSG portions (Closes: #212522). + The documentation has been moved to the new gdb-doc package, which + this one Suggests. + - Remove packaging for info files. + - Remove GFDL section from debian/copyright. + - Update README.Debian. + * Correct control.in to also use libreadline5-dev. + * Update type-handling usage. + * Update copyright file with the new FSF address. + * Update gcj build dependency (allow mips and mipsel, skip kfreebsd) + (Closes: #343199). + + -- Daniel Jacobowitz Tue, 6 Jun 2006 09:23:45 -0400 + +gdb (6.4-1ubuntu5) dapper; urgency=low + + Changes by David S. Miller: + + * Fix linux_nat regression introduced with the last upload. + + -- Fabio M. Di Nitto Tue, 09 May 2006 07:48:51 +0200 + +gdb (6.4-1ubuntu4) dapper; urgency=low + + Changes by David S. Miller: + + * Fix core file generation on sparc. + + * sparc patches split and clean up as applied upstream. + + -- Fabio M. Di Nitto Sat, 06 May 2006 06:44:31 +0200 + +gdb (6.4-1ubuntu3) dapper; urgency=low + + Changes by David S. Miller: + + * Fix signal frame handling on sparc and use dwarf2 frame unwinding on + sparc/linux: + - Add patch sparc-dwarf2-and-sigframe.patch. + - Update debian/patches/series. + + -- Fabio M. Di Nitto Thu, 06 Apr 2006 07:16:23 +0200 + +gdb (6.4-1ubuntu2) dapper; urgency=low + + Changes by David S. Miller: + + * Fix sparc threads support: + - Add patch gdb-sparclinux-threads.patch. + - Update debian/patches/series. + + NOTE: the patch will work only with properly patched kernel. + The patch should be in 2.6.15-20 kernel serie. + + -- Fabio M. Di Nitto Sun, 02 Apr 2006 09:42:13 +0200 + +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.7.1.orig/debian/control.in +++ gdb-6.7.1/debian/control.in @@ -0,0 +1,47 @@ +Source: gdb +Maintainer: Ubuntu Core developers +XSBC-Original-Maintainer: Daniel Jacobowitz +Section: devel +Priority: optional +Standards-Version: 3.7.3 +Build-Depends: autoconf, libtool, texinfo (>= 4.7-2.2), texlive-base, libncurses5-dev, libreadline5-dev, bison, gettext, debhelper (>= 4.9.0), dejagnu, gcj [!kfreebsd-amd64 !kfreebsd-i386 !hurd-i386 !armel], gobjc [!armel], mig [@gnu@], cdbs (>= 0.4.17), quilt (>= 0.30-1), libkvm-dev [@kfreebsd@], libunwind7-dev [ia64], flex | flex-old, libexpat1-dev, g++-multilib [i386 powerpc s390 sparc], lib64readline5-dev [i386 powerpc s390 sparc], lib64expat1-dev [i386 powerpc s390 sparc] + +Package: gdb@TS@ +Architecture: any +Section: devel +Depends: ${shlibs:Depends} +Conflicts: gdb-arm +Replaces: gdb-arm, insight (<< 6.1+cvs.2004.04.07-1) +Suggests: gdb-doc +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. + +Package: gdb64 +Architecture: i386 powerpc s390 sparc +Section: devel +Depends: ${shlibs:Depends}, gdb +Description: The GNU Debugger (64-bit) + 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. + +Package: libgdb-dev +Architecture: any +Section: libdevel +Priority: extra +Description: The GNU Debugger (libgdb.a) + 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. + . + This package contains libgdb.a, the bulk of GDB as a linkable + library. It is provided for an IDE which links to libgdb.a. Please + do not use libgdb.a for new projects. --- gdb-6.7.1.orig/debian/rules +++ gdb-6.7.1/debian/rules @@ -0,0 +1,217 @@ +#!/usr/bin/make -f + +DEB_BUILDDIR := $(shell pwd)/objdir +DEB_DH_INSTALL_SOURCEDIR := $(shell pwd)/debian/tmp + +# 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 + +# Override CDBS's default CFLAGS, which also includes -Wall; gdb +# does not handle -Wunused well with -Werror, but defaults to +# -Werror. +CFLAGS = -g $(DEB_OPT_FLAG) + +# Always install into debian/tmp, even if we are only building one package. +DEB_DESTDIR := $(shell pwd)/debian/tmp + +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) + +# Cross configuration support. Check for an environment variable +# $GDB_TARGET, or a file debian/target. +ifndef GDB_TARGET +DEBIAN_TARGET_FILE := $(strip $(shell cat debian/target 2>/dev/null)) +ifneq ($(DEBIAN_TARGET_FILE),) +GDB_TARGET := $(DEBIAN_TARGET_FILE) +endif +endif + +DEB_TARGET_ARCH := $(shell dpkg-architecture -f \ + -a$(GDB_TARGET) -qDEB_HOST_ARCH 2>/dev/null) +DEB_TARGET_GNU_TYPE := $(shell dpkg-architecture -f \ + -a$(DEB_TARGET_ARCH) -qDEB_HOST_GNU_TYPE 2>/dev/null) +DEB_TARGET_ALIAS ?= $(DEB_TARGET_GNU_TYPE) + +ifeq ($(DEB_TARGET_ARCH),) +$(error GDB_TARGET value "$(GDB_TARGET)" is not a valid Debian architecture) +endif + +ifdef GDB_TARGET + DEB_CROSS = yes + # TP: Target Prefix. Used primarily as a prefix for cross tool + # names (e.g. powerpc-linux-gcc). + # TS: Target Suffix. Used primarily at the end of cross compiler + # package names (e.g. gcc-powerpc). + TP = $(DEB_TARGET_ALIAS)- + TS = -$(DEB_TARGET_ALIAS) + CROSS_FORCE = FORCE +else +ifneq (,$(filter $(DEB_HOST_ARCH),i386 powerpc sparc s390)) + build64 = yes + CC64 = gcc -m64 + CFLAGS64 = $(CFLAGS) + BUILDDIR64 = objdir64 + ifeq ($(DEB_HOST_ARCH),i386) + HOST64 = x86_64-linux-gnu + endif + ifeq ($(DEB_HOST_ARCH),powerpc) + HOST64 = powerpc64-linux-gnu + endif + ifeq ($(DEB_HOST_ARCH),sparc) + HOST64 = sparc64-linux-gnu + endif + ifeq ($(DEB_HOST_ARCH),s390) + HOST64 = s390x-linux-gnu + endif +endif +endif + +run_tests := yes + +ifneq (,$(findstring linux, $(DEB_HOST_GNU_SYSTEM))) + run_tests := no +endif + +ifeq ($(DEB_HOST_GNU_CPU),ia64) + arch_config_args := --with-libunwind +endif + +ifdef GDB_TARGET + run_tests := no + + arch_config_args += --program-prefix=$(TP) \ + --target=$(DEB_TARGET_ALIAS) --with-sysroot=/usr/$(DEB_TARGET_ALIAS) +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. +EXTRA_FLAGS := --disable-gdbtk --disable-shared --enable-tui \ + --srcdir=$(shell pwd) --with-system-readline \ + $(arch_config_args) --build=$(DEB_HOST_GNU_TYPE) + +# Debian does not include 64-bit expat packages yet, so --with-expat +# is here rather than in EXTRA_FLAGS. +DEB_CONFIGURE_EXTRA_FLAGS := --host=$(DEB_HOST_GNU_TYPE) $(EXTRA_FLAGS) \ + --with-expat + +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$(TS):: check-stamp + $(MAKE) -C objdir/gdb/doc refcard.dvi refcard.ps + +build/gdb64:: build64-stamp + +build64-stamp: + mkdir -p $(BUILDDIR64) + cd $(BUILDDIR64) && CC="$(CC64)" CFLAGS="$(CFLAGS64)" AR=ar \ + ../configure $(EXTRA_FLAGS) --host=$(HOST64) + cd $(BUILDDIR64) && $(MAKE) + touch $@ + +check-stamp: +ifeq ($(run_tests),yes) +ifeq ($(DEB_HOST_GNU_CPU),ia64) +# work around a build failure on the ia64 buildd + -ulimit -c unlimited; \ + $(MAKE) -C objdir/gdb check > objdir/check.log 2>&1 + cat objdir/check.log +else + -ulimit -c unlimited; \ + $(MAKE) -C objdir/gdb check \ + 2>&1 | tee objdir/check.log +endif +endif + touch $@ + +clean:: + rm -rf objdir $(BUILDDIR64) + + 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 build64-stamp + +binary-post-install/gdb$(TS) :: + if [ -x debian/tmp/usr/bin/run ]; then \ + mv debian/tmp/usr/bin/run \ + debian/gdb$(TS)/usr/bin/$(DEB_TARGET_ALIAS)-run; \ + mv debian/tmp/usr/share/man/man1/run.1 \ + debian/gdb$(TS)/usr/share/man/man1/$(DEB_TARGET_ALIAS)-run.1; \ + fi +ifeq ($(run_tests),yes) + install -d debian/gdb$(TS)/usr/share/doc/gdb + install -m 644 objdir/check.log \ + debian/gdb$(TS)/usr/share/doc/gdb/check.log +endif + + $(INSTALL) -m 755 -o root -g root \ + gdb/gdb_gcore.sh debian/gdb$(TS)/usr/bin/$(TP)gcore + +ifeq ($(build64),yes) + install -d debian/gdb64/usr/bin + install -s -m 755 $(BUILDDIR64)/gdb/gdb debian/gdb64/usr/bin/gdb64 + dh_link -pgdb64 usr/share/man/man1/gdb.1 usr/share/man/man1/gdb64.1 +endif + + rm -rf debian/tmp/usr/include \ + debian/tmp/usr/lib/lib*.* \ + debian/tmp/usr/share/locale + + # Remove the entire info directory; it only contains dummy files, + # not the real manuals. + rm -rf debian/tmp/usr/share/info + + install -d debian/tmp/usr/lib + install -m 644 $(DEB_BUILDDIR)/gdb/libgdb.a debian/tmp/usr/lib/ + +debian/control:: debian/control.in $(CROSS_FORCE) + test -x /usr/bin/type-handling + cat debian/control.in \ + | sed "s/@kfreebsd@/`type-handling any kfreebsd`/g" \ + | sed "s/@gnu@/`type-handling any gnu`/g" \ + | sed "s/@TS@/$(TS)/g" \ + > debian/control + +DEB_INSTALL_DOCS_gdb$(TS) = gdb/NEWS gdb/README gdb/doc/refcard.tex \ + objdir/gdb/doc/refcard.dvi objdir/gdb/doc/refcard.ps +DEB_INSTALL_CHANGELOGS_gdb$(TS) = gdb/ChangeLog +DEB_INSTALL_MANPAGES_gdb$(TS) = gdb/gdb.1 + +DEB_INSTALL_DOCS_libgdb-dev = gdb/NEWS gdb/README +DEB_INSTALL_CHANGELOGS_libgdb-dev = gdb/ChangeLog + +.PHONY: FORCE +FORCE: --- gdb-6.7.1.orig/debian/control +++ gdb-6.7.1/debian/control @@ -0,0 +1,47 @@ +Source: gdb +Maintainer: Ubuntu Core developers +XSBC-Original-Maintainer: Daniel Jacobowitz +Section: devel +Priority: optional +Standards-Version: 3.7.3 +Build-Depends: autoconf, libtool, texinfo (>= 4.7-2.2), texlive-base, libncurses5-dev, libreadline5-dev, bison, gettext, debhelper (>= 4.9.0), dejagnu, gcj [!kfreebsd-amd64 !kfreebsd-i386 !hurd-i386 !armel], gobjc [!armel], mig [hurd-alpha hurd-amd64 hurd-arm hurd-armeb hurd-hppa hurd-i386 hurd-i686 hurd-ia64 hurd-m32r hurd-m68k hurd-mips hurd-mipsel hurd-powerpc hurd-ppc64 hurd-s390 hurd-s390x hurd-sh3 hurd-sh3eb hurd-sh4 hurd-sh4eb hurd-sparc], cdbs (>= 0.4.17), quilt (>= 0.30-1), libkvm-dev [kfreebsd-alpha kfreebsd-amd64 kfreebsd-arm kfreebsd-armeb kfreebsd-hppa kfreebsd-i386 kfreebsd-i686 kfreebsd-ia64 kfreebsd-m32r kfreebsd-m68k kfreebsd-mips kfreebsd-mipsel kfreebsd-powerpc kfreebsd-ppc64 kfreebsd-s390 kfreebsd-s390x kfreebsd-sh3 kfreebsd-sh3eb kfreebsd-sh4 kfreebsd-sh4eb kfreebsd-sparc], libunwind7-dev [ia64], flex | flex-old, libexpat1-dev, g++-multilib [i386 powerpc s390 sparc], lib64readline5-dev [i386 powerpc s390 sparc], lib64expat1-dev [i386 powerpc s390 sparc] + +Package: gdb +Architecture: any +Section: devel +Depends: ${shlibs:Depends} +Conflicts: gdb-arm +Replaces: gdb-arm, insight (<< 6.1+cvs.2004.04.07-1) +Suggests: gdb-doc +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. + +Package: gdb64 +Architecture: i386 powerpc s390 sparc +Section: devel +Depends: ${shlibs:Depends}, gdb +Description: The GNU Debugger (64-bit) + 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. + +Package: libgdb-dev +Architecture: any +Section: libdevel +Priority: extra +Description: The GNU Debugger (libgdb.a) + 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. + . + This package contains libgdb.a, the bulk of GDB as a linkable + library. It is provided for an IDE which links to libgdb.a. Please + do not use libgdb.a for new projects. --- gdb-6.7.1.orig/debian/libgdb-dev.install +++ gdb-6.7.1/debian/libgdb-dev.install @@ -0,0 +1 @@ +usr/lib/libgdb.a --- gdb-6.7.1.orig/debian/compat +++ gdb-6.7.1/debian/compat @@ -0,0 +1 @@ +4 --- gdb-6.7.1.orig/debian/README.Debian +++ gdb-6.7.1/debian/README.Debian @@ -0,0 +1,8 @@ +GDB is a complex program. There is an excellent Info manual (`info gdb'), +which is available in the separate gdb-doc package. gdb-doc is not part of +Debian main; it is available in the non-free distribution (because it is +covered by the GNU Free Documentation License). + +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.7.1.orig/debian/copyright +++ gdb-6.7.1/debian/copyright @@ -0,0 +1,27 @@ +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 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses'. + +The file `gdb/doc/observer.texi' is normally distributed under the +GNU Free Documentation License, but certain lines from it are also +permitted to be distributed under the GPL. Only those lines are included in +this package.