From 407ebe90639c63dfadaca142688524ed1488ff6d Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Sun, 14 Dec 2008 14:05:20 +0000 Subject: [PATCH] - Upgrade to the upstream gdb-6.8.50 snapshot. --- .cvsignore | 2 +- ...catch-debug-registers-error-20060527.patch | 158 - gdb-6.3-dwattype0-20050201.patch | 24 - gdb-6.3-framepczero-20040927.patch | 13 +- gdb-6.3-gcore-thread-20050204.patch | 14 +- gdb-6.3-gstack-20050411.patch | 18 +- gdb-6.3-ia32el-fix-waitpid-20060615.patch | 33 - gdb-6.3-ia64-gcore-page0-20050421.patch | 8 +- gdb-6.3-ia64-gcore-speedup-20050714.patch | 24 +- gdb-6.3-ia64-sigill-20051115.patch | 24 +- gdb-6.3-ia64-sigtramp-fp-20050926.patch | 65 +- gdb-6.3-ia64-sigtramp-frame-20050708.patch | 104 +- gdb-6.3-inferior-notification-20050721.patch | 20 +- gdb-6.3-inheritance-20050324.patch | 15 +- gdb-6.3-large-core-20051206.patch | 92 +- gdb-6.3-linespec-20041213.patch | 52 +- gdb-6.3-pie-20050110.patch | 388 ++- gdb-6.3-ppc64displaysymbol-20041124.patch | 16 +- gdb-6.3-readnever-20050907.patch | 56 +- gdb-6.3-security-errata-20050610.patch | 76 +- gdb-6.3-sepcrc-20050402.patch | 38 +- gdb-6.3-sigx86-20040621.patch | 52 - gdb-6.3-step-thread-exit-20050211-test.patch | 23 +- gdb-6.3-test-movedir-20050125.patch | 21 +- gdb-6.3-test-pie-20050107.patch | 75 +- gdb-6.3-type-fix-20041213.patch | 29 - gdb-6.3-warnings-20050317.patch | 544 ++-- gdb-6.5-bz181390-memory-address-width.patch | 6 +- ...337-resolve-tls-without-debuginfo-v2.patch | 82 +- gdb-6.5-bz190810-gdbserver-arch-advice.patch | 46 +- gdb-6.5-bz216711-clone-is-outermost.patch | 59 +- ....5-bz218379-ppc-solib-trampoline-fix.patch | 18 +- gdb-6.5-gcore-i386-on-amd64.patch | 165 +- gdb-6.5-sharedlibrary-path.patch | 54 +- gdb-6.6-buildid-locate.patch | 211 +- gdb-6.6-buildid-readnever-silent.patch | 22 +- gdb-6.6-bz225783-gdb-debuginfo-paths.patch | 15 +- ....6-bz237572-ppc-atomic-sequence-test.patch | 16 +- gdb-6.6-bz247354-leader-exit-fix.patch | 24 +- gdb-6.6-multifork-debugreg.patch | 152 +- ....6-scheduler_locking-step-is-default.patch | 36 +- ...heduler_locking-step-sw-watchpoints2.patch | 154 +- gdb-6.6-step-thread-exit.patch | 93 +- gdb-6.6-vdso-i386-on-amd64-warning.patch | 114 - gdb-6.7-reread-exec_bfd.patch | 38 - gdb-6.7-testsuite-stable-results.patch | 33 - gdb-6.8-attach-signalled-detach-stopped.patch | 148 +- gdb-6.8-attach-signalled-upstream.patch | 1260 -------- gdb-6.8-auto-dependencies.patch | 26 - gdb-6.8-breakpoint-gone.patch | 18 - gdb-6.8-bz254229-gcore-prpsinfo.patch | 85 +- gdb-6.8-bz377541-vla-bound-undefined.patch | 545 ---- gdb-6.8-bz377541-vla-loc-kind.patch | 579 ---- gdb-6.8-bz377541-vla.patch | 734 +++-- ....8-bz466901-backtrace-full-prelinked.patch | 46 +- gdb-6.8-constant-watchpoints.patch | 50 +- gdb-6.8-disable-randomization.patch | 544 ---- gdb-6.8-forced-enable-tui.patch | 88 - gdb-6.8-fortran-module-ignore.patch | 14 - gdb-6.8-fortran-tag-constant.patch | 34 +- gdb-6.8-ia64-breakpoint-restoration.patch | 276 -- gdb-6.8-ia64-exec-hw-watchpoint.patch | 119 - gdb-6.8-inlining-addon.patch | 272 ++ gdb-6.8-inlining-by-name.patch | 70 +- gdb-6.8-inlining.patch | 2690 ++++++++-------- gdb-6.8-quit-never-aborts.patch | 40 +- gdb-6.8-sparc-fix.patch | 97 - gdb-6.8-upstream.patch | 2843 ----------------- gdb-6.8-watchpoint-inaccessible-memory.patch | 482 --- gdb-fortran-testsuite-gfortran.patch | 56 + gdb-watchpoint-hw-without-inferior.patch | 136 + gdb.spec | 94 +- sources | 2 +- 73 files changed, 3724 insertions(+), 10946 deletions(-) delete mode 100644 gdb-6.3-catch-debug-registers-error-20060527.patch delete mode 100644 gdb-6.3-dwattype0-20050201.patch delete mode 100644 gdb-6.3-ia32el-fix-waitpid-20060615.patch delete mode 100644 gdb-6.3-sigx86-20040621.patch delete mode 100644 gdb-6.3-type-fix-20041213.patch delete mode 100644 gdb-6.6-vdso-i386-on-amd64-warning.patch delete mode 100644 gdb-6.7-reread-exec_bfd.patch delete mode 100644 gdb-6.8-attach-signalled-upstream.patch delete mode 100644 gdb-6.8-auto-dependencies.patch delete mode 100644 gdb-6.8-breakpoint-gone.patch delete mode 100644 gdb-6.8-bz377541-vla-bound-undefined.patch delete mode 100644 gdb-6.8-bz377541-vla-loc-kind.patch delete mode 100644 gdb-6.8-disable-randomization.patch delete mode 100644 gdb-6.8-forced-enable-tui.patch delete mode 100644 gdb-6.8-fortran-module-ignore.patch delete mode 100644 gdb-6.8-ia64-breakpoint-restoration.patch delete mode 100644 gdb-6.8-ia64-exec-hw-watchpoint.patch create mode 100644 gdb-6.8-inlining-addon.patch delete mode 100644 gdb-6.8-sparc-fix.patch delete mode 100644 gdb-6.8-upstream.patch delete mode 100644 gdb-6.8-watchpoint-inaccessible-memory.patch create mode 100644 gdb-fortran-testsuite-gfortran.patch create mode 100644 gdb-watchpoint-hw-without-inferior.patch diff --git a/.cvsignore b/.cvsignore index b306ec3..0b5440f 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1 +1 @@ -gdb-6.8.tar.bz2 +gdb-6.8.50.20081209.tar.bz2 diff --git a/gdb-6.3-catch-debug-registers-error-20060527.patch b/gdb-6.3-catch-debug-registers-error-20060527.patch deleted file mode 100644 index aa49494..0000000 --- a/gdb-6.3-catch-debug-registers-error-20060527.patch +++ /dev/null @@ -1,158 +0,0 @@ -for gdb-6.3/gdb/ChangeLog -from Alexandre Oliva - - * i386-linux-nat.c (i386_debug_register_for_thread): New struct. - (i386_linux_set_dr_for_thread): Rename from... - (i386_linux_set_debug_regs_for_thread): ... this, and - add new function to catch exceptions in the old one. - -2008-02-24 Jan Kratochvil - - Port to GDB-6.8pre. - -This patch was originally made to workaround a deficiency of ia32el (==ia32 -emulator on ia64) which EIOs on ptrace(2) of the debug registers. - -Currently I can no longer run gdb.i386 on RHEL-5.1.ia64 as it fails on - $ rpm -qv kernel - kernel-2.6.18-53.el5.ia64 - $ file /emul/ia32-linux/usr/bin/gdb ./print-threads - /emul/ia32-linux/usr/bin/gdb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped - ./print-threads: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped - $ /emul/ia32-linux/usr/bin/gdb ./print-threads - (gdb) r - Starting program: /root/jkratoch/redhat/print-threads - Warning: - Cannot insert breakpoint -2. - Error accessing memory address 0x555766fb: Input/output error. - (gdb) maint info breakpoints - Num Type Disp Enb Address What - -1 longjmp resume keep n 0x00000000 - -2 shlib events keep y 0x555766fb - -ia32-on-ia64 run problem info: - -the inconsistency is in function linux_nat_wait - there is a variable called -block_mask, which is assumed to represent the current signal mask. in the -following execution path this assumption does not hold: - -1) block-mask is filled with SIGCHLD and the signal is masked in - lin_lwp_attach_lwp, which is called at the beginning of the procedure - that handles a new thread in the debuggee. -2) further down this procedure gdb tries to set the debug regs of the debuggee. - when trying to set debug regs - gdb fails and calls throw_exception. this - function finishes with siglongjmp, which clears the sigmask (seq. 1). -3) further down, linux_nat_wait is called to wait on the new child. in - linux_nat_wait there is a sequence : - - if ( ! (block_mask & SIGCHLD) ) - mask- SIGCHLD - while () { - wait-no-hang( ) - if no child found then - sigsuspend (SIGCHLD) - -4) the signal that notifies the debugger about the child is received after the - wait and before the sigsuspend. originally, this was not supposed to happen - because SIGCHLD is supposed to be blocked, but because what happens in step - 2, the signal mask is cleared and the signal is received at this point, - which results with a hang - -sequence 1: - -catch_errors (symbol_add_stubs) - symbol_file_add_with_addrs_or_offsets - deprecated_target_new_objfile_hook - tui_new_objfile_hook - attach_thread - observer_notify_linux_new_thread - generic_observer_notify - observer_linux_new_thread_notification_stub - i386_linux_new_thread - i386_linux_set_debug_regs_for_thread - i386_linux_dr_set_addr - i386_linux_dr_set - perror_with_name - . - . - . - throw_exception - siglongjmp - -RHEL Bug 175270 - -Index: gdb-6.8cvs20080219/gdb/i386-linux-nat.c -=================================================================== ---- gdb-6.8cvs20080219.orig/gdb/i386-linux-nat.c 2008-01-10 19:19:02.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/i386-linux-nat.c 2008-02-24 09:23:09.000000000 +0100 -@@ -24,6 +24,7 @@ - #include "regcache.h" - #include "target.h" - #include "linux-nat.h" -+#include "exceptions.h" - - #include "gdb_assert.h" - #include "gdb_string.h" -@@ -611,20 +612,40 @@ i386_linux_dr_get (ptid_t ptid, int regn - return value; - } - --static void --i386_linux_dr_set (ptid_t ptid, int regnum, unsigned long value) --{ -- int tid; -+struct i386_linux_dr_set -+ { -+ int tid; -+ int regnum; -+ unsigned long value; -+ }; - -- tid = TIDGET (ptid); -- if (tid == 0) -- tid = PIDGET (ptid); -+static int -+i386_linux_dr_set_core (void *data_pointer) -+{ -+ struct i386_linux_dr_set *data = data_pointer; - - errno = 0; -- ptrace (PTRACE_POKEUSER, tid, -- offsetof (struct user, u_debugreg[regnum]), value); -+ ptrace (PTRACE_POKEUSER, data->tid, -+ offsetof (struct user, u_debugreg[data->regnum]), data->value); - if (errno != 0) - perror_with_name (_("Couldn't write debug register")); -+ return 1; -+} -+ -+static int -+i386_linux_dr_set (ptid_t ptid, int regnum, unsigned long value) -+{ -+ struct i386_linux_dr_set data; -+ int tid; -+ -+ data.tid = TIDGET (ptid); -+ if (data.tid == 0) -+ data.tid = PIDGET (ptid); -+ -+ data.regnum = regnum; -+ data.value = value; -+ -+ return catch_errors (i386_linux_dr_set_core, &data, "", RETURN_MASK_ALL); - } - - void -Index: gdb-6.8cvs20080219/gdb/Makefile.in -=================================================================== ---- gdb-6.8cvs20080219.orig/gdb/Makefile.in 2008-02-24 09:13:35.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/Makefile.in 2008-02-24 09:14:26.000000000 +0100 -@@ -2252,7 +2252,7 @@ i386gnu-tdep.o: i386gnu-tdep.c $(defs_h) - i386-linux-nat.o: i386-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ - $(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \ - $(gregset_h) $(i387_tdep_h) $(i386_tdep_h) $(i386_linux_tdep_h) \ -- $(gdb_proc_service_h) $(target_h) -+ $(gdb_proc_service_h) $(target_h) $(exceptions_h) - i386-linux-tdep.o: i386-linux-tdep.c $(defs_h) $(gdbcore_h) $(frame_h) \ - $(value_h) $(regcache_h) $(inferior_h) $(osabi_h) $(reggroups_h) \ - $(dwarf2_frame_h) $(gdb_string_h) $(i386_tdep_h) \ diff --git a/gdb-6.3-dwattype0-20050201.patch b/gdb-6.3-dwattype0-20050201.patch deleted file mode 100644 index 20c17a5..0000000 --- a/gdb-6.3-dwattype0-20050201.patch +++ /dev/null @@ -1,24 +0,0 @@ -2005-02-01 Jeff Johnston - - * dwarf2read.c (die_type): Tolerate a type reference to location - <0> and treat as unknown type. - -2008-02-24 Jan Kratochvil - - Port to GDB-6.8pre. - -Index: gdb-6.8cvs20080219/gdb/dwarf2read.c -=================================================================== ---- gdb-6.8cvs20080219.orig/gdb/dwarf2read.c 2008-02-22 08:10:39.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/dwarf2read.c 2008-02-22 08:17:56.000000000 +0100 -@@ -7634,6 +7634,10 @@ die_type (struct die_info *die, struct d - /* A missing DW_AT_type represents a void type. */ - return builtin_type (current_gdbarch)->builtin_void; - } -+ else if (DW_ADDR (type_attr) == 0) -+ /* If we have an invalid reference to 0, ignore it and treat -+ the type as unknown. */ -+ return builtin_type_error; - else - type_die = follow_die_ref (die, type_attr, cu); - diff --git a/gdb-6.3-framepczero-20040927.patch b/gdb-6.3-framepczero-20040927.patch index 2f1869b..a8dae6b 100644 --- a/gdb-6.3-framepczero-20040927.patch +++ b/gdb-6.3-framepczero-20040927.patch @@ -3,14 +3,11 @@ * frame.c (get_prev_frame): Stop backtrace when a zero PC and successive normal frames. -Index: ./gdb/frame.c +Index: gdb-6.8.50.20081128/gdb/frame.c =================================================================== -RCS file: /cvs/src/src/gdb/frame.c,v -retrieving revision 1.191 -diff -p -u -r1.191 frame.c ---- ./gdb/frame.c 1 Sep 2004 14:13:33 -0000 1.191 -+++ ./gdb/frame.c 28 Sep 2004 02:45:58 -0000 -@@ -1235,6 +1235,18 @@ get_prev_frame (struct frame_info *this_ +--- gdb-6.8.50.20081128.orig/gdb/frame.c 2008-12-04 01:34:37.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/frame.c 2008-12-04 01:35:47.000000000 +0100 +@@ -1566,6 +1566,18 @@ get_prev_frame (struct frame_info *this_ return NULL; } @@ -22,7 +19,7 @@ diff -p -u -r1.191 frame.c + && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME + && get_frame_pc (this_frame) == 0) + { -+ frame_debug_got_null_frame (gdb_stdlog, this_frame, "zero PC"); ++ frame_debug_got_null_frame (this_frame, "zero PC"); + return NULL; + } + diff --git a/gdb-6.3-gcore-thread-20050204.patch b/gdb-6.3-gcore-thread-20050204.patch index 8b51aa3..7da5240 100644 --- a/gdb-6.3-gcore-thread-20050204.patch +++ b/gdb-6.3-gcore-thread-20050204.patch @@ -3,17 +3,17 @@ * linux-nat.c (linux_nat_xfer_memory): Don't use linux_proc_xfer_memory for ia64. -Index: gdb-6.5/gdb/linux-nat.c +Index: gdb-6.8.50.20081209/gdb/linux-nat.c =================================================================== ---- gdb-6.5.orig/gdb/linux-nat.c 2006-07-07 00:57:56.000000000 -0300 -+++ gdb-6.5/gdb/linux-nat.c 2006-07-07 02:24:51.000000000 -0300 -@@ -3152,10 +3152,15 @@ linux_xfer_partial (struct target_ops *o - return procfs_xfer_auxv (ops, object, annex, readbuf, writebuf, - offset, len); +--- gdb-6.8.50.20081209.orig/gdb/linux-nat.c 2008-12-10 01:22:23.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/linux-nat.c 2008-12-10 01:25:26.000000000 +0100 +@@ -4123,10 +4123,15 @@ linux_xfer_partial (struct target_ops *o + return linux_nat_xfer_osdata (ops, object, annex, readbuf, writebuf, + offset, len); +#ifndef NATIVE_XFER_UNWIND_TABLE + /* FIXME: For ia64, we cannot currently use linux_proc_xfer_memory -+ for accessing thread storage. Revert when Bugzilla 147436 ++ for accessing thread storage. Revert when Bugzilla 147436 + is fixed. */ xfer = linux_proc_xfer_partial (ops, object, annex, readbuf, writebuf, offset, len); diff --git a/gdb-6.3-gstack-20050411.patch b/gdb-6.3-gstack-20050411.patch index 9911a1c..f772f44 100644 --- a/gdb-6.3-gstack-20050411.patch +++ b/gdb-6.3-gstack-20050411.patch @@ -4,11 +4,11 @@ to install and uninstall. * gstack.sh, gstack.1: New files. -Index: gdb-6.8/gdb/Makefile.in +Index: gdb-6.8.50.20081128/gdb/Makefile.in =================================================================== ---- gdb-6.8.orig/gdb/Makefile.in 2008-03-17 13:15:08.000000000 +0100 -+++ gdb-6.8/gdb/Makefile.in 2008-07-14 10:25:47.000000000 +0200 -@@ -1161,7 +1161,7 @@ gdb.z:gdb.1 +--- gdb-6.8.50.20081128.orig/gdb/Makefile.in 2008-12-01 16:11:48.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/Makefile.in 2008-12-01 16:14:11.000000000 +0100 +@@ -902,7 +902,7 @@ gdb.z:gdb.1 # time it takes for make to check that all is up to date. # install-only is intended to address that need. install: all install-only @@ -17,7 +17,7 @@ Index: gdb-6.8/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e "$$t"` ; \ if test "x$$transformed_name" = x; then \ -@@ -1193,9 +1193,26 @@ install-tui: +@@ -934,9 +934,26 @@ install-tui: $(DESTDIR)$(man1dir) ; \ $(INSTALL_DATA) $(srcdir)/gdb.1 \ $(DESTDIR)$(man1dir)/$$transformed_name.1 @@ -45,7 +45,7 @@ Index: gdb-6.8/gdb/Makefile.in transformed_name=`t='$(program_transform_name)'; \ echo gdb | sed -e $$t` ; \ if test "x$$transformed_name" = x; then \ -@@ -1217,6 +1234,17 @@ uninstall-tui: +@@ -958,6 +975,17 @@ uninstall-tui: fi ; \ rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \ $(DESTDIR)$(man1dir)/$$transformed_name.1 @@ -62,11 +62,11 @@ Index: gdb-6.8/gdb/Makefile.in + $(DESTDIR)$(man1dir)/$$transformed_name.1 # The C++ name parser can be built standalone for testing. - test-cp-name-parser.o: cp-name-parser.c $(safe_ctype_h) $(libiberty_h) \ -Index: gdb-6.8/gdb/gstack.sh + test-cp-name-parser.o: cp-name-parser.c +Index: gdb-6.8.50.20081128/gdb/gstack.sh =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8/gdb/gstack.sh 2008-07-14 10:25:47.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/gstack.sh 2008-12-01 16:13:16.000000000 +0100 @@ -0,0 +1,45 @@ +#!/bin/sh + diff --git a/gdb-6.3-ia32el-fix-waitpid-20060615.patch b/gdb-6.3-ia32el-fix-waitpid-20060615.patch deleted file mode 100644 index dac1703..0000000 --- a/gdb-6.3-ia32el-fix-waitpid-20060615.patch +++ /dev/null @@ -1,33 +0,0 @@ -Index: gdb-6.3/gdb/linux-nat.c -=================================================================== ---- gdb-6.3.orig/gdb/linux-nat.c 2006-06-15 07:27:02.000000000 -0300 -+++ gdb-6.3/gdb/linux-nat.c 2006-06-15 07:27:06.000000000 -0300 -@@ -157,12 +157,28 @@ static int - my_waitpid (int pid, int *status, int flags) - { - int ret; -+ int old_status = status ? *status : 0; -+ - do - { - ret = waitpid (pid, status, flags); - } - while (ret == -1 && errno == EINTR); - -+ if (ret == 0 && status != 0) -+ { -+ /* waitpid() running within ia32el (on multi-threaded processes -+ only?) modifies status even when it returns zero, and this -+ breaks the assumption in linux_nat_wait(), and perhaps -+ elsewhere, that it remains unchanged in this case. We -+ restore the old value before returning zero, such that the -+ assumption holds. */ -+ if (*status != 0 && *status != old_status) -+ warning ("waitpid: non-zero status %x for zero return value", -+ *status); -+ *status = old_status; -+ } -+ - return ret; - } - diff --git a/gdb-6.3-ia64-gcore-page0-20050421.patch b/gdb-6.3-ia64-gcore-page0-20050421.patch index 6fad76a..093d641 100644 --- a/gdb-6.3-ia64-gcore-page0-20050421.patch +++ b/gdb-6.3-ia64-gcore-page0-20050421.patch @@ -1,7 +1,7 @@ -Index: gdb-6.6/gdb/gcore.c +Index: gdb-6.8.50.20081128/gdb/gcore.c =================================================================== ---- gdb-6.6.orig/gdb/gcore.c -+++ gdb-6.6/gdb/gcore.c +--- gdb-6.8.50.20081128.orig/gdb/gcore.c 2008-09-11 16:27:34.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/gcore.c 2008-12-01 16:39:04.000000000 +0100 @@ -475,8 +475,14 @@ gcore_copy_callback (bfd *obfd, asection if (size > total_size) size = total_size; @@ -17,4 +17,4 @@ Index: gdb-6.6/gdb/gcore.c + || bfd_section_vma (obfd, osec) != 0)) { warning (_("Memory read failed for corefile section, %s bytes at 0x%s."), - paddr_d (size), paddr (bfd_section_vma (obfd, osec))); + plongest (size), paddr (bfd_section_vma (obfd, osec))); diff --git a/gdb-6.3-ia64-gcore-speedup-20050714.patch b/gdb-6.3-ia64-gcore-speedup-20050714.patch index 69d1924..2be0934 100644 --- a/gdb-6.3-ia64-gcore-speedup-20050714.patch +++ b/gdb-6.3-ia64-gcore-speedup-20050714.patch @@ -7,11 +7,11 @@ (ia64_rse_skip_regs): Ditto. (ia64_linux_check_stack_region): New function. -Index: gdb-6.5/gdb/linux-nat.c +Index: gdb-6.8.50.20081209/gdb/linux-nat.c =================================================================== ---- gdb-6.5.orig/gdb/linux-nat.c 2006-07-07 02:29:12.000000000 -0300 -+++ gdb-6.5/gdb/linux-nat.c 2006-07-07 03:03:55.000000000 -0300 -@@ -2473,7 +2473,9 @@ linux_nat_xfer_partial (struct target_op +--- gdb-6.8.50.20081209.orig/gdb/linux-nat.c 2008-12-10 01:25:43.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/linux-nat.c 2008-12-10 01:27:09.000000000 +0100 +@@ -3246,7 +3246,9 @@ linux_nat_xfer_partial (struct target_op do_cleanups (old_chain); return xfer; } @@ -22,13 +22,13 @@ Index: gdb-6.5/gdb/linux-nat.c static int linux_nat_thread_alive (ptid_t ptid) { -@@ -3214,15 +3216,34 @@ linux_xfer_partial (struct target_ops *o - return procfs_xfer_auxv (ops, object, annex, readbuf, writebuf, - offset, len); +@@ -4148,15 +4150,34 @@ linux_xfer_partial (struct target_ops *o + return linux_nat_xfer_osdata (ops, object, annex, readbuf, writebuf, + offset, len); -#ifndef NATIVE_XFER_UNWIND_TABLE - /* FIXME: For ia64, we cannot currently use linux_proc_xfer_memory -- for accessing thread storage. Revert when Bugzilla 147436 +- for accessing thread storage. Revert when Bugzilla 147436 - is fixed. */ xfer = linux_proc_xfer_partial (ops, object, annex, readbuf, writebuf, offset, len); @@ -62,11 +62,11 @@ Index: gdb-6.5/gdb/linux-nat.c return super_xfer_partial (ops, object, annex, readbuf, writebuf, offset, len); -Index: gdb-6.5/gdb/ia64-linux-nat.c +Index: gdb-6.8.50.20081209/gdb/ia64-linux-nat.c =================================================================== ---- gdb-6.5.orig/gdb/ia64-linux-nat.c 2006-03-24 20:08:16.000000000 -0300 -+++ gdb-6.5/gdb/ia64-linux-nat.c 2006-07-07 02:52:25.000000000 -0300 -@@ -687,6 +687,64 @@ ia64_linux_xfer_partial (struct target_o +--- gdb-6.8.50.20081209.orig/gdb/ia64-linux-nat.c 2008-08-15 10:08:27.000000000 +0200 ++++ gdb-6.8.50.20081209/gdb/ia64-linux-nat.c 2008-12-10 01:25:53.000000000 +0100 +@@ -807,6 +807,64 @@ ia64_linux_xfer_partial (struct target_o void _initialize_ia64_linux_nat (void); diff --git a/gdb-6.3-ia64-sigill-20051115.patch b/gdb-6.3-ia64-sigill-20051115.patch index d04c684..5c94160 100644 --- a/gdb-6.3-ia64-sigill-20051115.patch +++ b/gdb-6.3-ia64-sigill-20051115.patch @@ -12,10 +12,10 @@ gdb/testsuite: * gdb.arch/ia64-sigill.c: New test. * gdb.arch/ia64-sigill.exp: Ditto. -Index: gdb-6.6/gdb/testsuite/gdb.arch/ia64-sigill.exp +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.arch/ia64-sigill.exp =================================================================== ---- /dev/null -+++ gdb-6.6/gdb/testsuite/gdb.arch/ia64-sigill.exp +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.arch/ia64-sigill.exp 2008-12-02 21:10:57.000000000 +0100 @@ -0,0 +1,59 @@ +# Copyright 2005 Free Software Foundation, Inc. + @@ -76,10 +76,10 @@ Index: gdb-6.6/gdb/testsuite/gdb.arch/ia64-sigill.exp +gdb_test "handle SIGILL nostop noprint" "SIGILL.*No.*No.*Yes.*" "handle sigill" +gdb_test "run" "Starting program.*ia64-sigill.*\[New thread.*\].*hello world.*Program exited normally." "run to exit" + -Index: gdb-6.6/gdb/testsuite/gdb.arch/ia64-sigill.c +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.arch/ia64-sigill.c =================================================================== ---- /dev/null -+++ gdb-6.6/gdb/testsuite/gdb.arch/ia64-sigill.c +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.arch/ia64-sigill.c 2008-12-02 21:10:57.000000000 +0100 @@ -0,0 +1,8 @@ +#include + @@ -89,11 +89,11 @@ Index: gdb-6.6/gdb/testsuite/gdb.arch/ia64-sigill.c + return 0; +} + -Index: gdb-6.6/gdb/linux-nat.c +Index: gdb-6.8.50.20081128/gdb/linux-nat.c =================================================================== ---- gdb-6.6.orig/gdb/linux-nat.c -+++ gdb-6.6/gdb/linux-nat.c -@@ -2241,7 +2241,8 @@ retry: +--- gdb-6.8.50.20081128.orig/gdb/linux-nat.c 2008-12-02 19:04:38.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/linux-nat.c 2008-12-02 21:11:11.000000000 +0100 +@@ -2974,7 +2974,8 @@ retry: threads can be a bit time-consuming so if we want decent performance with heavily multi-threaded programs, especially when they're using a high frequency timer, we'd better avoid it if we @@ -103,8 +103,8 @@ Index: gdb-6.6/gdb/linux-nat.c if (WIFSTOPPED (status)) { -@@ -2252,7 +2253,9 @@ retry: - if (!lp->step +@@ -2992,7 +2993,9 @@ retry: + && inf->stop_soon == NO_STOP_QUIETLY && signal_stop_state (signo) == 0 && signal_print_state (signo) == 0 - && signal_pass_state (signo) == 1) diff --git a/gdb-6.3-ia64-sigtramp-fp-20050926.patch b/gdb-6.3-ia64-sigtramp-fp-20050926.patch index 74770a3..528afbf 100644 --- a/gdb-6.3-ia64-sigtramp-fp-20050926.patch +++ b/gdb-6.3-ia64-sigtramp-fp-20050926.patch @@ -24,10 +24,10 @@ Fix a compilation error on a typo. -Index: gdb-6.8cvs20080219/gdb/libunwind-frame.c +Index: gdb-6.8.50.20081128/gdb/libunwind-frame.c =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/libunwind-frame.c 2008-01-02 00:04:03.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/libunwind-frame.c 2008-02-24 20:25:56.000000000 +0100 +--- gdb-6.8.50.20081128.orig/gdb/libunwind-frame.c 2008-05-06 20:37:46.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/libunwind-frame.c 2008-12-02 19:46:26.000000000 +0100 @@ -61,6 +61,7 @@ static unw_word_t (*unw_find_dyn_list_p) struct libunwind_frame_cache { @@ -44,10 +44,10 @@ Index: gdb-6.8cvs20080219/gdb/libunwind-frame.c unw_regnum_t uw_sp_regnum; struct libunwind_frame_cache *cache; struct libunwind_descr *descr; -@@ -171,14 +173,30 @@ libunwind_frame_cache (struct frame_info +@@ -174,14 +176,30 @@ libunwind_frame_cache (struct frame_info : __LITTLE_ENDIAN); - unw_init_remote_p (&cache->cursor, as, next_frame); + unw_init_remote_p (&cache->cursor, as, this_frame); + + /* For the base address, we have a small problem. The majority + of the time, we can get the stack pointer of the previous @@ -77,7 +77,7 @@ Index: gdb-6.8cvs20080219/gdb/libunwind-frame.c ret = unw_get_reg_p (&cache->cursor, uw_sp_regnum, &fp); if (ret < 0) { -@@ -186,6 +204,7 @@ libunwind_frame_cache (struct frame_info +@@ -189,6 +207,7 @@ libunwind_frame_cache (struct frame_info error (_("Can't get libunwind sp register.")); } @@ -85,17 +85,17 @@ Index: gdb-6.8cvs20080219/gdb/libunwind-frame.c cache->base = (CORE_ADDR)fp; cache->as = as; -@@ -381,6 +400,31 @@ libunwind_search_unwind_table (void *as, +@@ -376,6 +395,31 @@ libunwind_search_unwind_table (void *as, di, pi, need_unwind_info, args); } +void -+libunwind_sigtramp_frame_this_id (struct frame_info *next_frame, ++libunwind_sigtramp_frame_this_id (struct frame_info *this_frame, + void **this_cache, + struct frame_id *this_id) +{ + struct libunwind_frame_cache *cache = -+ libunwind_frame_cache (next_frame, this_cache); ++ libunwind_frame_cache (this_frame, this_cache); + + /* Unlike a regular frame, we can't use the normal frame pointer + mechanism because a sigaltstack may have been used. Instead, @@ -115,46 +115,37 @@ Index: gdb-6.8cvs20080219/gdb/libunwind-frame.c +}; + /* Verify if we are in a sigtramp frame and we can use libunwind to unwind. */ - const struct frame_unwind * - libunwind_sigtramp_frame_sniffer (struct frame_info *next_frame) -@@ -419,7 +463,7 @@ libunwind_sigtramp_frame_sniffer (struct - ret = unw_is_signal_frame_p (&cursor); - unw_destroy_addr_space_p (as); - if (ret > 0) -- return &libunwind_frame_unwind; -+ return &libunwind_sigtramp_frame_unwind; - - return NULL; - } -Index: gdb-6.8cvs20080219/gdb/libunwind-frame.h + int + libunwind_sigtramp_frame_sniffer (const struct frame_unwind *self, +Index: gdb-6.8.50.20081128/gdb/libunwind-frame.h =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/libunwind-frame.h 2008-01-02 00:04:03.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/libunwind-frame.h 2008-02-24 20:23:47.000000000 +0100 -@@ -47,6 +47,9 @@ void libunwind_frame_set_descr (struct g +--- gdb-6.8.50.20081128.orig/gdb/libunwind-frame.h 2008-05-06 20:37:46.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/libunwind-frame.h 2008-12-02 19:38:55.000000000 +0100 +@@ -52,6 +52,9 @@ void libunwind_frame_set_descr (struct g - void libunwind_frame_this_id (struct frame_info *next_frame, void **this_cache, + void libunwind_frame_this_id (struct frame_info *this_frame, void **this_cache, struct frame_id *this_id); -+void libunwind_sigtramp_frame_this_id (struct frame_info *next_frame, ++void libunwind_sigtramp_frame_this_id (struct frame_info *this_frame, + void **this_cache, + struct frame_id *this_id); - void libunwind_frame_prev_register (struct frame_info *next_frame, void **this_cache, - int regnum, int *optimizedp, - enum lval_type *lvalp, CORE_ADDR *addrp, -Index: gdb-6.8cvs20080219/gdb/ia64-tdep.c + struct value *libunwind_frame_prev_register (struct frame_info *this_frame, + void **this_cache, int regnum); + void libunwind_frame_dealloc_cache (struct frame_info *self, void *cache); +Index: gdb-6.8.50.20081128/gdb/ia64-tdep.c =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/ia64-tdep.c 2008-02-24 20:23:40.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/ia64-tdep.c 2008-02-24 20:23:47.000000000 +0100 -@@ -2942,7 +2942,7 @@ ia64_libunwind_sigtramp_frame_this_id (s +--- gdb-6.8.50.20081128.orig/gdb/ia64-tdep.c 2008-12-02 19:04:32.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/ia64-tdep.c 2008-12-02 21:09:46.000000000 +0100 +@@ -2964,7 +2964,7 @@ ia64_libunwind_sigtramp_frame_this_id (s struct frame_id id; CORE_ADDR prev_ip; -- libunwind_frame_this_id (next_frame, this_cache, &id); -+ libunwind_sigtramp_frame_this_id (next_frame, this_cache, &id); +- libunwind_frame_this_id (this_frame, this_cache, &id); ++ libunwind_sigtramp_frame_this_id (this_frame, this_cache, &id); if (frame_id_eq (id, null_frame_id)) { (*this_id) = null_frame_id; -@@ -2954,8 +2954,14 @@ ia64_libunwind_sigtramp_frame_this_id (s - frame_unwind_register (next_frame, IA64_BSP_REGNUM, buf); +@@ -2976,8 +2976,14 @@ ia64_libunwind_sigtramp_frame_this_id (s + get_frame_register (this_frame, IA64_BSP_REGNUM, buf); bsp = extract_unsigned_integer (buf, 8); - /* For a sigtramp frame, we don't make the check for previous ip being 0. */ diff --git a/gdb-6.3-ia64-sigtramp-frame-20050708.patch b/gdb-6.3-ia64-sigtramp-frame-20050708.patch index 7a3493f..1862f97 100644 --- a/gdb-6.3-ia64-sigtramp-frame-20050708.patch +++ b/gdb-6.3-ia64-sigtramp-frame-20050708.patch @@ -8,33 +8,34 @@ * ia64-tdep.c (ia64_sigtramp_frame_prev_register): Fix an ISO C compliance compilation error. -Index: gdb-6.8/gdb/ia64-tdep.c +2008-02-12 Jan Kratochvil + + Port to gdb-6.8.50.20081128, follow the upstream change: + http://sourceware.org/cgi-bin/cvsweb.cgi/src/gdb/ia64-tdep.c.diff?cvsroot=src&r1=1.176&r2=1.177 + +Index: gdb-6.8.50.20081128/gdb/ia64-tdep.c =================================================================== ---- gdb-6.8.orig/gdb/ia64-tdep.c 2008-07-14 10:24:32.000000000 +0200 -+++ gdb-6.8/gdb/ia64-tdep.c 2008-07-14 10:26:46.000000000 +0200 -@@ -2043,7 +2043,100 @@ ia64_sigtramp_frame_prev_register (struc - pc &= ~0xf; - store_unsigned_integer (valuep, 8, pc); +--- gdb-6.8.50.20081128.orig/gdb/ia64-tdep.c 2008-11-26 06:27:48.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/ia64-tdep.c 2008-12-02 19:04:32.000000000 +0100 +@@ -2107,6 +2107,94 @@ ia64_sigtramp_frame_prev_register (struc + return frame_unwind_got_constant (this_frame, regnum, pc); } -- else if ((regnum >= IA64_GR32_REGNUM && regnum <= IA64_GR127_REGNUM) || + ++ /* Red Hat patch begin. */ + else if (IA64_NAT0_REGNUM <= regnum && regnum <= IA64_NAT31_REGNUM) + { -+ /* NAT pseudo registers 0-31: get them from UNAT. ++ /* NAT pseudo registers 0-31: get them from UNAT. + * "copied" from ia64_pseudo_register_read() */ -+ CORE_ADDR addr = 0; + ULONGEST unatN_val; + ULONGEST unat; -+ read_memory (cache->saved_regs[IA64_UNAT_REGNUM], (char *) &unat, ++ read_memory (cache->saved_regs[IA64_UNAT_REGNUM], (char *) &unat, + register_size (current_gdbarch, IA64_UNAT_REGNUM)); + unatN_val = (unat & (1LL << (regnum - IA64_NAT0_REGNUM))) != 0; -+ store_unsigned_integer (valuep, register_size (current_gdbarch, regnum), -+ unatN_val); -+ *lvalp = lval_memory; -+ *addrp = cache->saved_regs[IA64_UNAT_REGNUM]; ++ return frame_unwind_got_constant (this_frame, regnum, unatN_val); + } + else if (IA64_NAT32_REGNUM <= regnum && regnum <= IA64_NAT127_REGNUM) + { -+ /* NAT pseudo registers 32-127. ++ /* NAT pseudo registers 32-127. + * "copied" from ia64_pseudo_register_read() + * FIXME: Not currently tested -- cannot get the frame to include + * NAT32-NAT127. */ @@ -43,18 +44,18 @@ Index: gdb-6.8/gdb/ia64-tdep.c + ULONGEST natN_val = 0; + CORE_ADDR gr_addr = 0, nat_addr = 0; + -+ read_memory (cache->saved_regs[IA64_BSP_REGNUM], (char *) &bsp, ++ read_memory (cache->saved_regs[IA64_BSP_REGNUM], (char *) &bsp, + register_size (current_gdbarch, IA64_BSP_REGNUM)); -+ read_memory (cache->saved_regs[IA64_CFM_REGNUM], (char *) &cfm, ++ read_memory (cache->saved_regs[IA64_CFM_REGNUM], (char *) &cfm, + register_size (current_gdbarch, IA64_CFM_REGNUM)); + + /* The bsp points at the end of the register frame so we + subtract the size of frame from it to get start of register frame. */ + bsp = rse_address_add (bsp, -(cfm & 0x7f)); -+ -+ if ((cfm & 0x7f) > regnum - V32_REGNUM) ++ ++ if ((cfm & 0x7f) > regnum - V32_REGNUM) + gr_addr = rse_address_add (bsp, (regnum - V32_REGNUM)); -+ ++ + if (gr_addr != 0) + { + /* Compute address of nat collection bits */ @@ -65,30 +66,28 @@ Index: gdb-6.8/gdb/ia64-tdep.c + the nat collection from rnat. Otherwise, we fetch the nat + collection from the computed address. FIXME: Do not know if + RNAT can be not stored in the frame--being extra cautious. */ -+ if (nat_addr >= bsp) ++ if (nat_addr >= bsp) + { + nat_addr = cache->saved_regs[IA64_RNAT_REGNUM]; + if (nat_addr != 0) -+ read_memory (nat_addr, (char *) &nat_collection, ++ read_memory (nat_addr, (char *) &nat_collection, + register_size (current_gdbarch, IA64_RNAT_REGNUM)); + } + else + nat_collection = read_memory_integer (nat_addr, 8); -+ if (nat_addr != 0) ++ if (nat_addr != 0) + { + nat_bit = (gr_addr >> 3) & 0x3f; + natN_val = (nat_collection >> nat_bit) & 1; -+ *lvalp = lval_memory; -+ *addrp = nat_addr; -+ store_unsigned_integer (valuep, -+ register_size (current_gdbarch, regnum), -+ natN_val); ++ return frame_unwind_got_constant (this_frame, regnum, natN_val); + } -+ } ++ } ++ warning (_("ia64_sigtramp_frame_prev_register: unhandled register %d"), ++ regnum); + } + else if (regnum == VBOF_REGNUM) + { -+ /* BOF pseudo register. ++ /* BOF pseudo register. + * "copied" from ia64_pseudo_register_read() + * + * A virtual register frame start is provided for user convenience. @@ -97,44 +96,45 @@ Index: gdb-6.8/gdb/ia64-tdep.c + ULONGEST cfm; + ULONGEST bof; + -+ read_memory (cache->saved_regs[IA64_BSP_REGNUM], (char *) &bsp, ++ read_memory (cache->saved_regs[IA64_BSP_REGNUM], (char *) &bsp, + register_size (current_gdbarch, IA64_BSP_REGNUM)); -+ read_memory (cache->saved_regs[IA64_CFM_REGNUM], (char *) &cfm, ++ read_memory (cache->saved_regs[IA64_CFM_REGNUM], (char *) &cfm, + register_size (current_gdbarch, IA64_CFM_REGNUM)); + + /* The bsp points at the end of the register frame so we + subtract the size of frame from it to get beginning of frame. */ + bof = rse_address_add (bsp, -(cfm & 0x7f)); + -+ store_unsigned_integer (valuep, register_size (current_gdbarch, regnum), bof); -+ *lvalp = lval_memory; -+ *addrp = 0; // NOTE: pseudo reg not a anywhere really... ++ return frame_unwind_got_constant (this_frame, regnum, bof); + } -+ else if ((regnum >= IA64_GR32_REGNUM && regnum <= IA64_GR127_REGNUM) || - (regnum >= V32_REGNUM && regnum <= V127_REGNUM)) ++ /* Red Hat patch end. */ ++ + else if ((regnum >= IA64_GR32_REGNUM && regnum <= IA64_GR127_REGNUM) + || (regnum >= V32_REGNUM && regnum <= V127_REGNUM)) { - CORE_ADDR addr = 0; -@@ -2057,6 +2150,39 @@ ia64_sigtramp_frame_prev_register (struc - read_memory (addr, valuep, register_size (gdbarch, regnum)); - } +@@ -2121,7 +2209,42 @@ ia64_sigtramp_frame_prev_register (struc + return frame_unwind_got_constant (this_frame, regnum, 0); } + +- else /* All other registers not listed above. */ ++ /* Red Hat patch begin. */ + else if (VP0_REGNUM <= regnum && regnum <= VP63_REGNUM) + { -+ /* VP 0-63. ++ /* VP 0-63. + * "copied" from ia64_pseudo_register_read() + * + * FIXME: Not currently tested--cannot get the frame to include PR. */ + CORE_ADDR pr_addr = 0; + + pr_addr = cache->saved_regs[IA64_PR_REGNUM]; -+ if (pr_addr != 0) ++ if (pr_addr != 0) + { + ULONGEST pr; + ULONGEST cfm; + ULONGEST prN_val; -+ read_memory (pr_addr, (char *) &pr, ++ read_memory (pr_addr, (char *) &pr, + register_size (current_gdbarch, IA64_PR_REGNUM)); -+ read_memory (cache->saved_regs[IA64_CFM_REGNUM], (char *) &cfm, ++ read_memory (cache->saved_regs[IA64_CFM_REGNUM], (char *) &cfm, + register_size (current_gdbarch, IA64_CFM_REGNUM)); + + /* Get the register rename base for this frame and adjust the @@ -145,12 +145,14 @@ Index: gdb-6.8/gdb/ia64-tdep.c + regnum = VP16_REGNUM + ((regnum - VP16_REGNUM) + rrb_pr) % 48; + } + prN_val = (pr & (1LL << (regnum - VP0_REGNUM))) != 0; -+ store_unsigned_integer (valuep, register_size (current_gdbarch, regnum), -+ prN_val); -+ *lvalp = lval_memory; -+ *addrp = pr_addr; ++ return frame_unwind_got_constant (this_frame, regnum, prN_val); + } ++ warning (_("ia64_sigtramp_frame_prev_register: unhandled register %d"), ++ regnum); + } - else ++ /* Red Hat patch end. */ ++ ++ /* All other registers not listed above. */ { - /* All other registers not listed above. */ + CORE_ADDR addr = cache->saved_regs[regnum]; + diff --git a/gdb-6.3-inferior-notification-20050721.patch b/gdb-6.3-inferior-notification-20050721.patch index 8430958..5a014ff 100644 --- a/gdb-6.3-inferior-notification-20050721.patch +++ b/gdb-6.3-inferior-notification-20050721.patch @@ -9,8 +9,10 @@ * gdb.base/attach-32.exp: Fix forgotten $GDBFLAGS as set. ---- gdb-6.3/gdb/testsuite/gdb.base/attach-32.c.fix3 2005-07-21 14:23:50.000000000 -0400 -+++ gdb-6.3/gdb/testsuite/gdb.base/attach-32.c 2005-07-21 14:05:56.000000000 -0400 +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/attach-32.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/attach-32.c 2008-12-07 10:06:03.000000000 +0100 @@ -0,0 +1,20 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -32,8 +34,10 @@ + } + return 0; +} ---- gdb-6.3/gdb/testsuite/gdb.base/attach-32.exp.fix3 2005-07-21 14:23:45.000000000 -0400 -+++ gdb-6.3/gdb/testsuite/gdb.base/attach-32.exp 2005-07-21 17:58:28.000000000 -0400 +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/attach-32.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/attach-32.exp 2008-12-07 10:08:52.000000000 +0100 @@ -0,0 +1,252 @@ +# Copyright 2005 Free Software Foundation, Inc. + @@ -131,7 +135,7 @@ + + send_gdb "tbreak 19\n" + gdb_expect { -+ -re "Breakpoint .*at.*$srcfile, line 19.*$gdb_prompt $" { ++ -re "reakpoint .*at.*$srcfile, line 19.*$gdb_prompt $" { + pass "after attach-32, set tbreak postloop" + } + -re "$gdb_prompt $" { @@ -287,8 +291,10 @@ +do_call_attach_tests + +return 0 ---- gdb-6.3/gdb/testsuite/gdb.base/attach-32b.c.fix3 2005-07-21 14:23:57.000000000 -0400 -+++ gdb-6.3/gdb/testsuite/gdb.base/attach-32b.c 2005-07-21 14:06:02.000000000 -0400 +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/attach-32b.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/attach-32b.c 2008-12-07 10:06:03.000000000 +0100 @@ -0,0 +1,24 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop diff --git a/gdb-6.3-inheritance-20050324.patch b/gdb-6.3-inheritance-20050324.patch index ba9907c..433b6f7 100644 --- a/gdb-6.3-inheritance-20050324.patch +++ b/gdb-6.3-inheritance-20050324.patch @@ -3,22 +3,23 @@ * valops.c (check_field_in): Use check_typedef for base classes to avoid problems with opaque type references. -Index: gdb-6.5/gdb/valops.c +Index: gdb-6.8.50.20081128/gdb/valops.c =================================================================== ---- gdb-6.5.orig/gdb/valops.c 2005-12-17 20:34:03.000000000 -0200 -+++ gdb-6.5/gdb/valops.c 2006-07-07 02:35:09.000000000 -0300 -@@ -2257,8 +2257,13 @@ check_field_in (struct type *type, const +--- gdb-6.8.50.20081128.orig/gdb/valops.c 2008-12-08 10:56:11.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/valops.c 2008-12-08 10:59:14.000000000 +0100 +@@ -2484,8 +2484,14 @@ check_field (struct type *type, const ch } for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) -- if (check_field_in (TYPE_BASECLASS (type, i), name)) +- if (check_field (TYPE_BASECLASS (type, i), name)) - return 1; + { + /* Check the base classes. Make sure we have the real type for + each base class as opposed to an opaque declaration. */ + struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); -+ if (check_field_in (baseclass, name)) -+ return 1; ++ ++ if (check_field (baseclass, name)) ++ return 1; + } return 0; diff --git a/gdb-6.3-large-core-20051206.patch b/gdb-6.3-large-core-20051206.patch index 66deccd..ee7f4cb 100644 --- a/gdb-6.3-large-core-20051206.patch +++ b/gdb-6.3-large-core-20051206.patch @@ -25,10 +25,10 @@ Port to GDB-6.7. -Index: gdb-6.7/gdb/symfile-mem.c +Index: gdb-6.8.50.20081128/gdb/symfile-mem.c =================================================================== ---- gdb-6.7.orig/gdb/symfile-mem.c 2007-10-13 05:29:58.000000000 +0200 -+++ gdb-6.7/gdb/symfile-mem.c 2007-10-15 21:37:54.000000000 +0200 +--- gdb-6.8.50.20081128.orig/gdb/symfile-mem.c 2008-01-01 23:53:13.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/symfile-mem.c 2008-12-02 22:15:53.000000000 +0100 @@ -56,6 +56,14 @@ #include "elf/common.h" @@ -53,11 +53,11 @@ Index: gdb-6.7/gdb/symfile-mem.c if (nbfd == NULL) error (_("Failed to read a valid object file image from memory.")); -Index: gdb-6.7/gdb/target.c +Index: gdb-6.8.50.20081128/gdb/target.c =================================================================== ---- gdb-6.7.orig/gdb/target.c 2007-10-14 23:42:39.000000000 +0200 -+++ gdb-6.7/gdb/target.c 2007-10-15 21:37:54.000000000 +0200 -@@ -55,7 +55,7 @@ static int nosymbol (char *, CORE_ADDR * +--- gdb-6.8.50.20081128.orig/gdb/target.c 2008-11-09 12:27:18.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/target.c 2008-12-02 22:17:28.000000000 +0100 +@@ -57,7 +57,7 @@ static int nosymbol (char *, CORE_ADDR * static void tcomplain (void) ATTR_NORETURN; @@ -66,16 +66,16 @@ Index: gdb-6.7/gdb/target.c static int return_zero (void); -@@ -275,7 +275,7 @@ target_load (char *arg, int from_tty) - (*current_target.to_load) (arg, from_tty); +@@ -299,7 +299,7 @@ void target_create_inferior (char *exec_ } + -static int +static LONGEST nomemory (CORE_ADDR memaddr, char *myaddr, int len, int write, struct target_ops *t) { -@@ -518,7 +518,7 @@ update_current_target (void) +@@ -530,7 +530,7 @@ update_current_target (void) (void (*) (struct regcache *)) noprocess); de_fault (deprecated_xfer_memory, @@ -84,7 +84,7 @@ Index: gdb-6.7/gdb/target.c nomemory); de_fault (to_files_info, (void (*) (struct target_ops *)) -@@ -1195,7 +1195,7 @@ target_xfer_partial (struct target_ops * +@@ -1250,7 +1250,7 @@ target_xfer_partial (struct target_ops * it makes no progress, and then return how much was transferred). */ int @@ -93,7 +93,7 @@ Index: gdb-6.7/gdb/target.c { if (target_read (¤t_target, TARGET_OBJECT_MEMORY, NULL, myaddr, memaddr, len) == len) -@@ -1205,7 +1205,7 @@ target_read_memory (CORE_ADDR memaddr, g +@@ -1260,7 +1260,7 @@ target_read_memory (CORE_ADDR memaddr, g } int @@ -102,7 +102,7 @@ Index: gdb-6.7/gdb/target.c { if (target_write (¤t_target, TARGET_OBJECT_MEMORY, NULL, myaddr, memaddr, len) == len) -@@ -2228,8 +2228,8 @@ debug_to_prepare_to_store (struct regcac +@@ -2690,8 +2690,8 @@ debug_to_prepare_to_store (struct regcac fprintf_unfiltered (gdb_stdlog, "target_prepare_to_store ()\n"); } @@ -113,7 +113,7 @@ Index: gdb-6.7/gdb/target.c int write, struct mem_attrib *attrib, struct target_ops *target) { -@@ -2239,9 +2239,9 @@ deprecated_debug_xfer_memory (CORE_ADDR +@@ -2701,9 +2701,9 @@ deprecated_debug_xfer_memory (CORE_ADDR attrib, target); fprintf_unfiltered (gdb_stdlog, @@ -125,11 +125,11 @@ Index: gdb-6.7/gdb/target.c if (retval > 0) { -Index: gdb-6.7/gdb/target.h +Index: gdb-6.8.50.20081128/gdb/target.h =================================================================== ---- gdb-6.7.orig/gdb/target.h 2007-10-14 23:24:52.000000000 +0200 -+++ gdb-6.7/gdb/target.h 2007-10-15 21:39:20.000000000 +0200 -@@ -351,10 +351,10 @@ struct target_ops +--- gdb-6.8.50.20081128.orig/gdb/target.h 2008-11-09 12:27:18.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/target.h 2008-12-02 22:15:53.000000000 +0100 +@@ -358,10 +358,10 @@ struct target_ops NOTE: cagney/2004-10-01: This has been entirely superseeded by to_xfer_partial and inferior inheritance. */ @@ -144,7 +144,7 @@ Index: gdb-6.7/gdb/target.h void (*to_files_info) (struct target_ops *); int (*to_insert_breakpoint) (struct bp_target_info *); -@@ -615,13 +615,14 @@ extern DCACHE *target_dcache; +@@ -661,13 +661,14 @@ extern DCACHE *target_dcache; extern int target_read_string (CORE_ADDR, char **, int, int *); @@ -163,11 +163,11 @@ Index: gdb-6.7/gdb/target.h /* Fetches the target's memory map. If one is found it is sorted and returned, after some consistency checking. Otherwise, NULL -Index: gdb-6.7/gdb/dcache.c +Index: gdb-6.8.50.20081128/gdb/dcache.c =================================================================== ---- gdb-6.7.orig/gdb/dcache.c 2007-08-23 20:08:28.000000000 +0200 -+++ gdb-6.7/gdb/dcache.c 2007-10-15 21:37:54.000000000 +0200 -@@ -517,9 +517,9 @@ dcache_free (DCACHE *dcache) +--- gdb-6.8.50.20081128.orig/gdb/dcache.c 2008-09-23 20:35:29.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/dcache.c 2008-12-02 22:15:53.000000000 +0100 +@@ -524,9 +524,9 @@ dcache_free (DCACHE *dcache) This routine is indended to be called by remote_xfer_ functions. */ @@ -179,10 +179,10 @@ Index: gdb-6.7/gdb/dcache.c { int i; int (*xfunc) (DCACHE *dcache, CORE_ADDR addr, gdb_byte *ptr); -Index: gdb-6.7/gdb/dcache.h +Index: gdb-6.8.50.20081128/gdb/dcache.h =================================================================== ---- gdb-6.7.orig/gdb/dcache.h 2007-08-23 20:08:28.000000000 +0200 -+++ gdb-6.7/gdb/dcache.h 2007-10-15 21:37:54.000000000 +0200 +--- gdb-6.8.50.20081128.orig/gdb/dcache.h 2008-01-01 23:53:09.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/dcache.h 2008-12-02 22:15:53.000000000 +0100 @@ -35,7 +35,7 @@ void dcache_free (DCACHE *); /* Simple to call from _xfer_memory */ @@ -193,11 +193,11 @@ Index: gdb-6.7/gdb/dcache.h + LONGEST len, int should_write); #endif /* DCACHE_H */ -Index: gdb-6.7/gdb/exec.c +Index: gdb-6.8.50.20081128/gdb/exec.c =================================================================== ---- gdb-6.7.orig/gdb/exec.c 2007-08-23 20:08:28.000000000 +0200 -+++ gdb-6.7/gdb/exec.c 2007-10-15 21:37:54.000000000 +0200 -@@ -453,8 +453,8 @@ map_vmap (bfd *abfd, bfd *arch) +--- gdb-6.8.50.20081128.orig/gdb/exec.c 2008-10-30 19:42:28.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/exec.c 2008-12-02 22:15:53.000000000 +0100 +@@ -459,8 +459,8 @@ map_vmap (bfd *abfd, bfd *arch) The same routine is used to handle both core and exec files; we just tail-call it with more arguments to select between them. */ @@ -208,11 +208,11 @@ Index: gdb-6.7/gdb/exec.c struct mem_attrib *attrib, struct target_ops *target) { int res; -Index: gdb-6.7/gdb/linux-nat.c +Index: gdb-6.8.50.20081128/gdb/linux-nat.c =================================================================== ---- gdb-6.7.orig/gdb/linux-nat.c 2007-10-15 00:13:52.000000000 +0200 -+++ gdb-6.7/gdb/linux-nat.c 2007-10-15 21:37:54.000000000 +0200 -@@ -3248,7 +3248,7 @@ linux_xfer_partial (struct target_ops *o +--- gdb-6.8.50.20081128.orig/gdb/linux-nat.c 2008-12-02 21:11:11.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/linux-nat.c 2008-12-02 22:15:53.000000000 +0100 +@@ -4053,7 +4053,7 @@ linux_xfer_partial (struct target_ops *o Revert when Bugzilla 147436 is fixed. */ if (iterate_over_lwps (ia64_linux_check_stack_region, &range) != NULL) { /* This region contains ia64 rse registers, we have to re-read. */ @@ -221,10 +221,10 @@ Index: gdb-6.7/gdb/linux-nat.c /* Re-read register stack area. */ xxfer = super_xfer_partial (ops, object, annex, -Index: gdb-6.7/gdb/remote.c +Index: gdb-6.8.50.20081128/gdb/remote.c =================================================================== ---- gdb-6.7.orig/gdb/remote.c 2007-10-14 23:42:39.000000000 +0200 -+++ gdb-6.7/gdb/remote.c 2007-10-15 21:37:54.000000000 +0200 +--- gdb-6.8.50.20081128.orig/gdb/remote.c 2008-11-24 17:53:44.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/remote.c 2008-12-02 22:17:00.000000000 +0100 @@ -25,6 +25,7 @@ #include "gdb_string.h" #include @@ -233,7 +233,7 @@ Index: gdb-6.7/gdb/remote.c #include "inferior.h" #include "bfd.h" #include "symfile.h" -@@ -4484,19 +4485,27 @@ remote_read_bytes (CORE_ADDR memaddr, gd +@@ -5687,12 +5688,19 @@ handle_notification (char *buf, size_t l if SHOULD_WRITE is nonzero. Returns length of data written or read; 0 for error. TARGET is unused. */ @@ -247,15 +247,15 @@ Index: gdb-6.7/gdb/remote.c int res; + int len; + -+ + /* This routine is not set up to handle > INT_MAX bytes. */ + if (mem_len >= (LONGEST)INT_MAX) + return 0; + + len = (int)mem_len; - if (should_write) - res = remote_write_bytes (mem_addr, buffer, mem_len); + set_general_thread (inferior_ptid); + +@@ -5701,7 +5709,7 @@ remote_xfer_memory (CORE_ADDR mem_addr, else res = remote_read_bytes (mem_addr, buffer, mem_len); @@ -264,11 +264,11 @@ Index: gdb-6.7/gdb/remote.c } /* Sends a packet with content determined by the printf format string -Index: gdb-6.7/gdb/remote-sim.c +Index: gdb-6.8.50.20081128/gdb/remote-sim.c =================================================================== ---- gdb-6.7.orig/gdb/remote-sim.c 2007-08-23 20:08:36.000000000 +0200 -+++ gdb-6.7/gdb/remote-sim.c 2007-10-15 21:41:33.000000000 +0200 -@@ -747,11 +747,14 @@ gdbsim_prepare_to_store (struct regcache +--- gdb-6.8.50.20081128.orig/gdb/remote-sim.c 2008-11-13 02:26:43.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/remote-sim.c 2008-12-02 22:15:53.000000000 +0100 +@@ -763,11 +763,14 @@ gdbsim_prepare_to_store (struct regcache Returns the number of bytes transferred. */ @@ -285,7 +285,7 @@ Index: gdb-6.7/gdb/remote-sim.c /* If no program is running yet, then ignore the simulator for memory. Pass the request down to the next target, hopefully an exec file. */ -@@ -767,22 +770,22 @@ gdbsim_xfer_inferior_memory (CORE_ADDR m +@@ -783,22 +786,22 @@ gdbsim_xfer_inferior_memory (CORE_ADDR m printf_filtered ("gdbsim_xfer_inferior_memory: myaddr 0x"); gdb_print_host_address (myaddr, gdb_stdout); printf_filtered (", memaddr 0x%s, len %d, write %d\n", diff --git a/gdb-6.3-linespec-20041213.patch b/gdb-6.3-linespec-20041213.patch index 99624f2..48c8bd7 100644 --- a/gdb-6.3-linespec-20041213.patch +++ b/gdb-6.3-linespec-20041213.patch @@ -21,19 +21,19 @@ [ Remove decode_variable* for GDB-6.8+ as no longer needed. ] -Index: gdb-6.7/gdb/linespec.c +Index: gdb-6.8.50.20081128/gdb/linespec.c =================================================================== ---- gdb-6.7.orig/gdb/linespec.c 2007-08-23 20:08:35.000000000 +0200 -+++ gdb-6.7/gdb/linespec.c 2007-10-13 05:26:33.000000000 +0200 -@@ -36,6 +36,7 @@ - #include "linespec.h" - #include "exceptions.h" - #include "language.h" +--- gdb-6.8.50.20081128.orig/gdb/linespec.c 2008-09-05 13:37:17.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/linespec.c 2008-12-04 01:43:36.000000000 +0100 +@@ -39,6 +39,7 @@ + #include "interps.h" + #include "mi/mi-cmds.h" + #include "target.h" +#include "gdb_assert.h" /* We share this one with symtab.c, but it is not exported widely. */ -@@ -75,7 +76,8 @@ static struct symtabs_and_lines find_met +@@ -78,7 +79,8 @@ static struct symtabs_and_lines find_met static int collect_methods (char *copy, struct type *t, struct symbol *sym_class, @@ -43,7 +43,7 @@ Index: gdb-6.7/gdb/linespec.c static NORETURN void cplusplus_error (const char *name, const char *fmt, ...) -@@ -84,11 +86,13 @@ static NORETURN void cplusplus_error (co +@@ -87,11 +89,13 @@ static NORETURN void cplusplus_error (co static int total_number_of_methods (struct type *type); static int find_methods (struct type *, char *, @@ -59,7 +59,7 @@ Index: gdb-6.7/gdb/linespec.c static int add_constructors (int method_counter, struct type *t, enum language language, -@@ -104,6 +108,9 @@ static int is_objc_method_format (const +@@ -107,6 +111,9 @@ static int is_objc_method_format (const static struct symtabs_and_lines decode_line_2 (struct symbol *[], int, int, char ***); @@ -69,7 +69,7 @@ Index: gdb-6.7/gdb/linespec.c static struct symtab *symtab_from_filename (char **argptr, char *p, int is_quote_enclosed, int *not_found_ptr); -@@ -194,13 +201,18 @@ total_number_of_methods (struct type *ty +@@ -196,13 +203,18 @@ total_number_of_methods (struct type *ty /* Recursive helper function for decode_line_1. Look for methods named NAME in type T. Return number of matches. @@ -90,7 +90,7 @@ Index: gdb-6.7/gdb/linespec.c { int i1 = 0; int ibase; -@@ -243,7 +255,7 @@ find_methods (struct type *t, char *name +@@ -244,7 +256,7 @@ find_methods (struct type *t, char *name if (strcmp_iw (name, method_name) == 0) /* Find all the overloaded methods with that name. */ i1 += add_matching_methods (method_counter, t, language, @@ -99,7 +99,7 @@ Index: gdb-6.7/gdb/linespec.c else if (strncmp (class_name, name, name_len) == 0 && (class_name[name_len] == '\0' || class_name[name_len] == '<')) -@@ -266,21 +278,100 @@ find_methods (struct type *t, char *name +@@ -267,21 +279,100 @@ find_methods (struct type *t, char *name if (i1 == 0) for (ibase = 0; ibase < TYPE_N_BASECLASSES (t); ibase++) i1 += find_methods (TYPE_BASECLASS (t, ibase), name, @@ -202,7 +202,7 @@ Index: gdb-6.7/gdb/linespec.c for (field_counter = TYPE_FN_FIELDLIST_LENGTH (t, method_counter) - 1; field_counter >= 0; -@@ -305,6 +396,16 @@ add_matching_methods (int method_counter +@@ -306,6 +397,16 @@ add_matching_methods (int method_counter else phys_name = TYPE_FN_FIELD_PHYSNAME (f, field_counter); @@ -229,7 +229,7 @@ Index: gdb-6.7/gdb/linespec.c return i1; } -@@ -610,6 +714,146 @@ decode_line_2 (struct symbol *sym_arr[], +@@ -630,6 +734,146 @@ See set/show multiple-symbol.")); discard_cleanups (old_chain); return return_values; } @@ -329,7 +329,7 @@ Index: gdb-6.7/gdb/linespec.c + { + if (canonical_arr[i] == NULL) + { -+ symname = DEPRECATED_SYMBOL_NAME (msym_arr[i]); ++ symname = SYMBOL_LINKAGE_NAME (msym_arr[i]); + canonical_arr[i] = savestring (symname, strlen (symname)); + } + } @@ -352,7 +352,7 @@ Index: gdb-6.7/gdb/linespec.c + { + if (canonical_arr) + { -+ symname = DEPRECATED_SYMBOL_NAME (msym_arr[num]); ++ symname = SYMBOL_LINKAGE_NAME (msym_arr[num]); + make_cleanup (xfree, symname); + canonical_arr[i] = savestring (symname, strlen (symname)); + } @@ -376,7 +376,7 @@ Index: gdb-6.7/gdb/linespec.c /* The parser of linespec itself. */ -@@ -1414,35 +1658,46 @@ find_method (int funfirstline, char ***c +@@ -1438,35 +1682,46 @@ find_method (int funfirstline, char ***c struct symbol **sym_arr = alloca (total_number_of_methods (t) * sizeof (struct symbol *)); @@ -437,7 +437,7 @@ Index: gdb-6.7/gdb/linespec.c return decode_line_2 (sym_arr, i1, funfirstline, canonical); } else -@@ -1469,11 +1722,12 @@ find_method (int funfirstline, char ***c +@@ -1493,11 +1748,12 @@ find_method (int funfirstline, char ***c } /* Find all methods named COPY in the class whose type is T, and put @@ -452,7 +452,7 @@ Index: gdb-6.7/gdb/linespec.c { int i1 = 0; /* Counter for the symbol array. */ -@@ -1495,7 +1749,7 @@ collect_methods (char *copy, struct type +@@ -1518,7 +1774,7 @@ collect_methods (char *copy, struct type } } else @@ -461,15 +461,3 @@ Index: gdb-6.7/gdb/linespec.c return i1; } ---- gdb-6.8/gdb/Makefile.in.orig 2008-08-27 12:59:59.000000000 +0200 -+++ gdb-6.8/gdb/Makefile.in 2008-08-27 13:00:19.000000000 +0200 -@@ -2341,7 +2341,8 @@ libunwind-frame.o: libunwind-frame.c $(d - linespec.o: linespec.c $(defs_h) $(symtab_h) $(frame_h) $(command_h) \ - $(symfile_h) $(objfiles_h) $(source_h) $(demangle_h) $(value_h) \ - $(completer_h) $(cp_abi_h) $(parser_defs_h) $(block_h) \ -- $(objc_lang_h) $(linespec_h) $(exceptions_h) $(language_h) -+ $(objc_lang_h) $(linespec_h) $(exceptions_h) $(language_h) \ -+ $(gdb_assert_h) - linux-fork.o: linux-fork.c $(defs_h) $(inferior_h) $(regcache_h) $(gdbcmd_h) \ - $(infcall_h) $(gdb_assert_h) $(gdb_string_h) $(linux_fork_h) \ - $(linux_nat_h) $(gdb_wait_h) $(gdb_dirent_h) diff --git a/gdb-6.3-pie-20050110.patch b/gdb-6.3-pie-20050110.patch index 28868ea..e18b462 100644 --- a/gdb-6.3-pie-20050110.patch +++ b/gdb-6.3-pie-20050110.patch @@ -26,28 +26,19 @@ Fix scan_dyntag() for binaries provided by valgrind (BZ 460319). ---- ./gdb/Makefile.in 2008-09-01 17:16:38.000000000 +0200 -+++ ./gdb/Makefile.in 2008-08-30 23:40:33.000000000 +0200 -@@ -1928,7 +1928,7 @@ amd64-tdep.o: amd64-tdep.c $(defs_h) $(a - $(dummy_frame_h) $(frame_h) $(frame_base_h) $(frame_unwind_h) \ - $(inferior_h) $(gdbcmd_h) $(gdbcore_h) $(objfiles_h) $(regcache_h) \ - $(regset_h) $(symfile_h) $(gdb_assert_h) $(amd64_tdep_h) \ -- $(i387_tdep_h) -+ $(i387_tdep_h) $(exceptions_h) - annotate.o: annotate.c $(defs_h) $(annotate_h) $(value_h) $(target_h) \ - $(gdbtypes_h) $(breakpoint_h) - arch-utils.o: arch-utils.c $(defs_h) $(arch_utils_h) $(buildsym_h) \ ---- ./gdb/amd64-tdep.c 2008-09-01 17:16:38.000000000 +0200 -+++ ./gdb/amd64-tdep.c 2008-08-30 23:40:33.000000000 +0200 -@@ -36,6 +36,7 @@ +Index: gdb-6.8.50.20081209/gdb/amd64-tdep.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/amd64-tdep.c 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/amd64-tdep.c 2008-12-14 14:56:49.000000000 +0100 +@@ -34,6 +34,7 @@ + #include "regcache.h" + #include "regset.h" #include "symfile.h" - #include "dwarf2-frame.h" - #include "gdb_assert.h" +#include "exceptions.h" - #include "amd64-tdep.h" - #include "i387-tdep.h" -@@ -731,16 +732,28 @@ amd64_alloc_frame_cache (void) + #include "gdb_assert.h" + +@@ -906,16 +907,28 @@ amd64_analyze_stack_align (CORE_ADDR pc, Any function that doesn't start with this sequence will be assumed to have no prologue and thus no valid frame pointer in %rbp. */ @@ -78,9 +69,9 @@ + return 1; + } - op = read_memory_unsigned_integer (pc, 1); + pc = amd64_analyze_stack_align (pc, current_pc, cache); -@@ -753,18 +766,57 @@ amd64_analyze_prologue (CORE_ADDR pc, CO +@@ -930,18 +943,57 @@ amd64_analyze_prologue (CORE_ADDR pc, CO /* If that's all, return now. */ if (current_pc <= pc + 1) @@ -141,18 +132,29 @@ return pc; } ---- ./gdb/auxv.c 2008-01-16 17:27:37.000000000 +0100 -+++ ./gdb/auxv.c 2008-08-30 23:40:33.000000000 +0200 +Index: gdb-6.8.50.20081209/gdb/auxv.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/auxv.c 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/auxv.c 2008-12-14 14:57:58.000000000 +0100 @@ -80,7 +80,7 @@ procfs_xfer_auxv (struct target_ops *ops Return 1 if an entry was read into *TYPEP and *VALP. */ int - target_auxv_parse (struct target_ops *ops, gdb_byte **readptr, + default_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; -@@ -105,9 +105,10 @@ target_auxv_parse (struct target_ops *op + const int sizeof_auxv_field = gdbarch_ptr_bit (target_gdbarch) + / TARGET_CHAR_BIT; +@@ -107,7 +107,7 @@ default_auxv_parse (struct target_ops *o + 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) + { + struct target_ops *t; + for (t = ops; t != NULL; t = t->beneath) +@@ -122,9 +122,10 @@ target_auxv_parse (struct target_ops *op an error getting the information. On success, return 1 after storing the entry's value field in *VALP. */ int @@ -165,7 +167,7 @@ gdb_byte *data; LONGEST n = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL, &data); gdb_byte *ptr = data; -@@ -117,10 +118,10 @@ target_auxv_search (struct target_ops *o +@@ -134,10 +135,10 @@ target_auxv_search (struct target_ops *o return n; while (1) @@ -178,7 +180,7 @@ { xfree (data); *valp = val; -@@ -143,7 +144,8 @@ target_auxv_search (struct target_ops *o +@@ -160,7 +161,8 @@ target_auxv_search (struct target_ops *o int fprint_target_auxv (struct ui_file *file, struct target_ops *ops) { @@ -188,14 +190,13 @@ gdb_byte *data; LONGEST len = target_read_alloc (ops, TARGET_OBJECT_AUXV, NULL, &data); -@@ -153,14 +155,14 @@ fprint_target_auxv (struct ui_file *file +@@ -170,13 +172,13 @@ fprint_target_auxv (struct ui_file *file 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; @@ -205,17 +206,28 @@ { #define TAG(tag, text, kind) \ case tag: name = #tag; description = text; flavor = kind; break -@@ -213,7 +215,7 @@ fprint_target_auxv (struct ui_file *file +@@ -231,7 +233,7 @@ fprint_target_auxv (struct ui_file *file } fprintf_filtered (file, "%-4s %-20s %-30s ", -- paddr_d (type), name, description); -+ paddr_d (at_type), name, description); +- plongest (type), name, description); ++ plongest (at_type), name, description); switch (flavor) { case dec: ---- ./gdb/auxv.h 2008-01-01 23:53:09.000000000 +0100 -+++ ./gdb/auxv.h 2008-08-30 23:40:33.000000000 +0200 +@@ -252,7 +254,7 @@ fprint_target_auxv (struct ui_file *file + break; + } + ++ents; +- if (type == AT_NULL) ++ if (at_type == AT_NULL) + break; + } + +Index: gdb-6.8.50.20081209/gdb/auxv.h +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/auxv.h 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/auxv.h 2008-12-14 14:56:49.000000000 +0100 @@ -35,14 +35,14 @@ struct target_ops; /* Forward declarati Return 1 if an entry was read into *TYPEP and *VALP. */ extern int target_auxv_parse (struct target_ops *ops, @@ -233,9 +245,11 @@ /* 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 2008-09-01 17:16:38.000000000 +0200 -+++ ./gdb/breakpoint.c 2008-08-30 23:40:33.000000000 +0200 -@@ -3971,7 +3971,8 @@ describe_other_breakpoints (CORE_ADDR pc +Index: gdb-6.8.50.20081209/gdb/breakpoint.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/breakpoint.c 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/breakpoint.c 2008-12-14 14:56:49.000000000 +0100 +@@ -3861,7 +3861,8 @@ describe_other_breakpoints (CORE_ADDR pc printf_filtered (" (thread %d)", b->thread); printf_filtered ("%s%s ", ((b->enable_state == bp_disabled || @@ -245,8 +259,8 @@ ? " (disabled)" : b->enable_state == bp_permanent ? " (permanent)" -@@ -4623,6 +4624,62 @@ disable_breakpoints_in_unloaded_shlib (s - } +@@ -4692,6 +4693,61 @@ create_catchpoint (int tempflag, char *c + return b; } +void @@ -303,14 +317,15 @@ + } + } +} -+ + static void create_fork_vfork_event_catchpoint (int tempflag, char *cond_string, - enum bptype bp_kind) ---- ./gdb/breakpoint.h 2008-09-01 17:16:38.000000000 +0200 -+++ ./gdb/breakpoint.h 2008-08-30 23:40:33.000000000 +0200 -@@ -144,6 +144,7 @@ enum enable_state + struct breakpoint_ops *ops) +Index: gdb-6.8.50.20081209/gdb/breakpoint.h +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/breakpoint.h 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/breakpoint.h 2008-12-14 14:56:49.000000000 +0100 +@@ -126,6 +126,7 @@ enum enable_state automatically enabled and reset when the call "lands" (either completes, or stops at another eventpoint). */ @@ -318,7 +333,7 @@ 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 -@@ -828,6 +829,10 @@ extern void remove_thread_event_breakpoi +@@ -818,6 +819,10 @@ extern void remove_thread_event_breakpoi extern void disable_breakpoints_in_shlibs (void); @@ -329,9 +344,11 @@ /* This function returns TRUE if ep is a catchpoint. */ extern int ep_is_catchpoint (struct breakpoint *); ---- ./gdb/dwarf2read.c 2008-09-01 17:16:38.000000000 +0200 -+++ ./gdb/dwarf2read.c 2008-08-30 23:40:33.000000000 +0200 -@@ -1222,7 +1222,7 @@ dwarf2_build_psymtabs (struct objfile *o +Index: gdb-6.8.50.20081209/gdb/dwarf2read.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/dwarf2read.c 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/dwarf2read.c 2008-12-14 14:56:49.000000000 +0100 +@@ -1295,7 +1295,7 @@ dwarf2_build_psymtabs (struct objfile *o else dwarf2_per_objfile->loc_buffer = NULL; @@ -340,9 +357,11 @@ || (objfile->global_psymbols.size == 0 && objfile->static_psymbols.size == 0)) { ---- ./gdb/elfread.c 2008-09-01 17:16:38.000000000 +0200 -+++ ./gdb/elfread.c 2008-08-30 23:40:33.000000000 +0200 -@@ -673,7 +673,7 @@ elf_symfile_read (struct objfile *objfil +Index: gdb-6.8.50.20081209/gdb/elfread.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/elfread.c 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/elfread.c 2008-12-14 14:56:49.000000000 +0100 +@@ -680,7 +680,7 @@ elf_symfile_read (struct objfile *objfil /* 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. */ @@ -351,9 +370,11 @@ { init_psymbol_list (objfile, 0); mainline = 0; ---- ./gdb/infrun.c 2008-09-01 17:16:38.000000000 +0200 -+++ ./gdb/infrun.c 2008-08-30 23:40:33.000000000 +0200 -@@ -2314,6 +2314,11 @@ process_event_stop_test: +Index: gdb-6.8.50.20081209/gdb/infrun.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/infrun.c 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/infrun.c 2008-12-14 14:56:49.000000000 +0100 +@@ -3229,6 +3229,11 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( #endif target_terminal_inferior (); @@ -365,11 +386,13 @@ /* 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 2008-01-01 23:53:12.000000000 +0100 -+++ ./gdb/objfiles.c 2008-08-30 23:40:33.000000000 +0200 -@@ -49,6 +49,9 @@ - #include "source.h" - #include "addrmap.h" +Index: gdb-6.8.50.20081209/gdb/objfiles.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/objfiles.c 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/objfiles.c 2008-12-14 14:56:49.000000000 +0100 +@@ -51,6 +51,9 @@ + #include "arch-utils.h" + #include "exec.h" +#include "auxv.h" +#include "elf/common.h" @@ -377,7 +400,7 @@ /* Prototypes for local functions */ static void objfile_alloc_data (struct objfile *objfile); -@@ -260,7 +263,19 @@ init_entry_point_info (struct objfile *o +@@ -271,7 +274,19 @@ init_entry_point_info (struct objfile *o CORE_ADDR entry_point_address (void) { @@ -398,18 +421,19 @@ } /* Create the terminating entry of OBJFILE's minimal symbol table. ---- ./gdb/solib-svr4.c 2008-09-01 17:16:38.000000000 +0200 -+++ ./gdb/solib-svr4.c 2008-09-01 17:12:31.000000000 +0200 -@@ -31,6 +31,8 @@ - #include "gdbcore.h" - #include "target.h" - #include "inferior.h" -+#include "auxv.h" +Index: gdb-6.8.50.20081209/gdb/solib-svr4.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/solib-svr4.c 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/solib-svr4.c 2008-12-14 14:56:49.000000000 +0100 +@@ -44,6 +44,7 @@ + #include "exec.h" + #include "auxv.h" + #include "exceptions.h" +#include "command.h" - #include "gdb_assert.h" - -@@ -246,7 +248,9 @@ static char *debug_loader_name; + static struct link_map_offsets *svr4_fetch_link_map_offsets (void); + static int svr4_have_link_map_offsets (void); +@@ -286,7 +287,9 @@ static CORE_ADDR main_lm_addr; /* Local function prototypes */ @@ -419,7 +443,7 @@ static CORE_ADDR bfd_lookup_symbol (bfd *, char *); -@@ -349,10 +353,12 @@ scan_dyntag (int dyntag, bfd *abfd, CORE +@@ -520,10 +523,12 @@ scan_dyntag (int dyntag, bfd *abfd, CORE int arch_size, step, sect_size; long dyn_tag; CORE_ADDR dyn_ptr, dyn_addr; @@ -432,7 +456,7 @@ if (abfd == NULL) return 0; -@@ -360,19 +366,81 @@ scan_dyntag (int dyntag, bfd *abfd, CORE +@@ -531,19 +536,81 @@ scan_dyntag (int dyntag, bfd *abfd, CORE if (arch_size == -1) return 0; @@ -516,7 +540,7 @@ /* Iterate over BUF and scan for DYNTAG. If found, set PTR and return. */ step = (arch_size == 32) ? sizeof (Elf32_External_Dyn) -@@ -393,25 +461,103 @@ scan_dyntag (int dyntag, bfd *abfd, CORE +@@ -564,26 +631,105 @@ scan_dyntag (int dyntag, bfd *abfd, CORE dyn_tag = bfd_h_get_64 (abfd, (bfd_byte *) x_dynp_64->d_tag); dyn_ptr = bfd_h_get_64 (abfd, (bfd_byte *) x_dynp_64->d_un.d_ptr); } @@ -562,13 +586,14 @@ - entry. */ - if (ptr) - { +- struct type *ptr_type; - gdb_byte ptr_buf[8]; - CORE_ADDR ptr_addr; - +- ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; - ptr_addr = dyn_addr + (buf - bufstart) + arch_size / 8; - if (target_read_memory (ptr_addr, ptr_buf, arch_size / 8) == 0) -- dyn_ptr = extract_typed_address (ptr_buf, -- builtin_type_void_data_ptr); +- dyn_ptr = extract_typed_address (ptr_buf, ptr_type); - *ptr = dyn_ptr; - } - return 1; @@ -612,8 +637,10 @@ + + if (got == 0) + { -+ dyn_ptr = extract_typed_address (ptr_buf, -+ builtin_type_void_data_ptr); ++ struct type *ptr_type; ++ ++ ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; ++ dyn_ptr = extract_typed_address (ptr_buf, ptr_type); + if (ptr != NULL) + { + if (debug_solib) @@ -638,18 +665,18 @@ } return 0; -@@ -544,6 +690,10 @@ solib_svr4_r_map (void) - { +@@ -773,6 +919,10 @@ solib_svr4_r_map (void) struct link_map_offsets *lmo = svr4_fetch_link_map_offsets (); + struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr; + 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); + return read_memory_typed_address (debug_base + lmo->r_map_offset, ptr_type); } -@@ -713,6 +863,11 @@ svr4_current_sos (void) + +@@ -944,6 +1094,11 @@ svr4_current_sos (void) struct so_list *head = 0; struct so_list **link_ptr = &head; CORE_ADDR ldsomap = 0; @@ -661,7 +688,7 @@ /* Always locate the debug struct, in case it has moved. */ debug_base = 0; -@@ -721,10 +876,19 @@ svr4_current_sos (void) +@@ -952,10 +1107,19 @@ svr4_current_sos (void) /* If we can't find the dynamic linker's base structure, this must not be a dynamically linked executable. Hmm. */ if (! debug_base) @@ -682,7 +709,7 @@ lm = solib_svr4_r_map (); while (lm) -@@ -740,23 +904,103 @@ svr4_current_sos (void) +@@ -972,26 +1136,104 @@ svr4_current_sos (void) new->lm_info->lm = xzalloc (lmo->link_map_size); make_cleanup (xfree, new->lm_info->lm); @@ -704,14 +731,17 @@ 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); + if (exec_bfd != NULL && IGNORE_FIRST_LINK_MAP_ENTRY (new) && ldsomap == 0) -+ { + { +- main_lm_addr = new->lm_info->lm_addr; +- 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. */ ++ /* Non-pie case, main executable has not been relocated. */ ++ main_lm_addr = new->lm_info->lm_addr; + free_so (new); + } + else @@ -788,7 +818,7 @@ target_read_string (LM_NAME (new), &buffer, SO_NAME_MAX_PATH_SIZE - 1, &errcode); if (errcode != 0) -@@ -764,47 +1008,60 @@ svr4_current_sos (void) +@@ -999,47 +1241,60 @@ svr4_current_sos (void) safe_strerror (errcode)); else { @@ -834,15 +864,15 @@ + } + else + debug_print_missing (new->so_name, build_id_filename); ++ ++ xfree (build_id_filename); ++ xfree (build_id); ++ } - /* Missing the build-id matching separate debug info file - would be handled while SO_NAME gets loaded. */ - name = build_id_to_filename (build_id, &build_id_filename, 0); - if (name != NULL) -+ xfree (build_id_filename); -+ xfree (build_id); -+ } -+ + if (debug_solib) { - strncpy (new->so_name, name, SO_NAME_MAX_PATH_SIZE - 1); @@ -882,7 +912,7 @@ } /* On Solaris, the dynamic linker is not in the normal list of -@@ -820,6 +1077,9 @@ svr4_current_sos (void) +@@ -1055,6 +1310,9 @@ svr4_current_sos (void) if (head == NULL) return svr4_default_sos (); @@ -892,7 +922,7 @@ return head; } -@@ -921,7 +1181,7 @@ for (resolve = 0; resolve <= 1; resolve+ +@@ -1086,7 +1344,7 @@ svr4_fetch_objfile_link_map (struct objf /* 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. */ @@ -901,7 +931,7 @@ static int match_main (char *soname) { -@@ -935,6 +1195,7 @@ match_main (char *soname) +@@ -1100,6 +1358,7 @@ match_main (char *soname) return (0); } @@ -909,28 +939,25 @@ /* Return 1 if PC lies in the dynamic symbol resolution code of the SVR4 run time loader. */ -@@ -1086,11 +1347,17 @@ enable_break (void) - /* Find the .interp section; if not found, warn the user and drop +@@ -1250,15 +1509,29 @@ enable_break (void) + /* Find the program interpreter; 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"); + interp_name = find_program_interpreter (); + + if (debug_solib) + fprintf_unfiltered (gdb_stdlog, + "enable_break: search for .interp in %s\n", + exec_bfd->filename); - if (interp_sect) + if (interp_name) { - unsigned int interp_sect_size; - char *buf; CORE_ADDR load_addr = 0; + CORE_ADDR load_addr_mask = -1L; int load_addr_found = 0; int loader_found_in_list = 0; struct so_list *so; -@@ -1098,6 +1365,14 @@ enable_break (void) + bfd *tmp_bfd = NULL; struct target_ops *tmp_bfd_target; - int tmp_fd = -1; - char *tmp_pathname = NULL; + volatile struct gdb_exception ex; + int arch_size; + + /* For 32bit inferiors with 64bit GDB we may get LOAD_ADDR at 0xff...... @@ -940,19 +967,19 @@ + if (arch_size > 0 && arch_size < sizeof (1UL) * 8) + load_addr_mask = (1UL << arch_size) - 1; - /* Read the contents of the .interp section into a local buffer; - the contents specify the dynamic linker this program uses. */ -@@ -1120,6 +1395,9 @@ enable_break (void) - if (tmp_fd >= 0) - tmp_bfd = bfd_fopen (tmp_pathname, gnutarget, FOPEN_RB, tmp_fd); + sym_addr = 0; +@@ -1275,6 +1548,9 @@ enable_break (void) + { + tmp_bfd = solib_bfd_open (interp_name); + } + if (debug_solib) -+ fprintf_unfiltered (gdb_stdlog, -+ "enable_break: opening %s\n", tmp_pathname); ++ fprintf_unfiltered (gdb_stdlog, ++ "enable_break: opening %s\n", interp_name); if (tmp_bfd == NULL) goto bkpt_at_symbol; -@@ -1181,16 +1459,16 @@ enable_break (void) +@@ -1328,16 +1604,16 @@ enable_break (void) interp_sect = bfd_get_section_by_name (tmp_bfd, ".text"); if (interp_sect) { @@ -973,29 +1000,29 @@ interp_plt_sect_high = interp_plt_sect_low + bfd_section_size (tmp_bfd, interp_sect); } -@@ -1225,7 +1503,11 @@ enable_break (void) +@@ -1372,7 +1648,11 @@ enable_break (void) if (sym_addr != 0) { - create_solib_event_breakpoint (load_addr + sym_addr); + create_solib_event_breakpoint ((load_addr + sym_addr) + & load_addr_mask); -+ if (debug_solib) -+ fprintf_unfiltered (gdb_stdlog, -+ "enable_break: solib bp set\n"); ++ if (debug_solib) ++ fprintf_unfiltered (gdb_stdlog, ++ "enable_break: solib bp set\n"); + xfree (interp_name); return 1; } - -@@ -1486,6 +1768,8 @@ svr4_solib_create_inferior_hook (void) - while (stop_signal != TARGET_SIGNAL_TRAP); - stop_soon = NO_STOP_QUIETLY; +@@ -1638,6 +1918,8 @@ svr4_solib_create_inferior_hook (void) + while (tp->stop_signal != TARGET_SIGNAL_TRAP); + inf->stop_soon = NO_STOP_QUIETLY; #endif /* defined(_SCO_DS) */ -+ -+ disable_breakpoints_at_startup (1); ++ ++ disable_breakpoints_at_startup (1); } static void -@@ -1666,6 +1950,75 @@ svr4_lp64_fetch_link_map_offsets (void) +@@ -1819,6 +2101,75 @@ svr4_lp64_fetch_link_map_offsets (void) return lmp; } @@ -1071,7 +1098,7 @@ struct target_so_ops svr4_so_ops; -@@ -1724,4 +2077,7 @@ _initialize_svr4_solib (void) +@@ -1858,4 +2209,7 @@ _initialize_svr4_solib (void) svr4_so_ops.in_dynsym_resolve_code = svr4_in_dynsym_resolve_code; svr4_so_ops.lookup_lib_global_symbol = elf_lookup_lib_symbol; svr4_so_ops.same = svr4_same; @@ -1079,9 +1106,11 @@ + add_info ("linkmap", info_linkmap_command, + "Display the inferior's linkmap."); } ---- ./gdb/solib.c 2008-01-07 16:19:58.000000000 +0100 -+++ ./gdb/solib.c 2008-09-01 17:16:12.000000000 +0200 -@@ -79,6 +79,8 @@ set_solib_ops (struct gdbarch *gdbarch, +Index: gdb-6.8.50.20081209/gdb/solib.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/solib.c 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/solib.c 2008-12-14 14:56:49.000000000 +0100 +@@ -80,6 +80,8 @@ set_solib_ops (struct gdbarch *gdbarch, /* external data declarations */ @@ -1090,7 +1119,7 @@ /* FIXME: gdbarch needs to control this variable, or else every configuration needs to call set_solib_ops. */ struct target_so_ops *current_target_so_ops; -@@ -102,6 +104,8 @@ The search path for loading non-absolute +@@ -103,6 +105,8 @@ The search path for loading non-absolute value); } @@ -1099,7 +1128,7 @@ /* GLOBAL FUNCTION -@@ -391,7 +395,6 @@ free_so (struct so_list *so) +@@ -405,7 +409,6 @@ free_so (struct so_list *so) xfree (so); } @@ -1107,7 +1136,7 @@ /* Return address of first so_list entry in master shared object list. */ struct so_list * master_so_list (void) -@@ -399,7 +402,6 @@ master_so_list (void) +@@ -413,7 +416,6 @@ master_so_list (void) return so_list_head; } @@ -1115,7 +1144,7 @@ /* A small stub to get us past the arg-passing pinhole of catch_errors. */ static int -@@ -411,15 +413,40 @@ symbol_add_stub (void *arg) +@@ -425,15 +427,40 @@ symbol_add_stub (void *arg) /* Have we already loaded this shared object? */ ALL_OBJFILES (so->objfile) { @@ -1159,7 +1188,7 @@ free_section_addr_info (sap); return (1); -@@ -545,6 +572,10 @@ update_solib_list (int from_tty, struct +@@ -565,6 +592,10 @@ update_solib_list (int from_tty, struct } else { @@ -1170,7 +1199,7 @@ if (! strcmp (gdb->so_original_name, i->so_original_name)) break; } -@@ -599,28 +630,7 @@ update_solib_list (int from_tty, struct +@@ -619,28 +650,7 @@ update_solib_list (int from_tty, struct /* Fill in the rest of each of the `struct so_list' nodes. */ for (i = inferior; i; i = i->next) { @@ -1200,7 +1229,7 @@ /* Notify any observer that the shared object has been loaded now that we've added it to GDB's tables. */ -@@ -716,6 +726,41 @@ solib_add (char *pattern, int from_tty, +@@ -736,6 +746,41 @@ solib_add (char *pattern, int from_tty, } } @@ -1242,7 +1271,7 @@ /* -@@ -1035,4 +1080,12 @@ This takes precedence over the environme +@@ -1053,4 +1098,12 @@ This takes precedence over the environme reload_shared_libraries, show_solib_search_path, &setlist, &showlist); @@ -1255,8 +1284,10 @@ + NULL, NULL, + &setdebuglist, &showdebuglist); } ---- ./gdb/solist.h 2008-01-07 16:19:58.000000000 +0100 -+++ ./gdb/solist.h 2008-08-30 23:40:33.000000000 +0200 +Index: gdb-6.8.50.20081209/gdb/solist.h +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/solist.h 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/solist.h 2008-12-14 14:56:49.000000000 +0100 @@ -61,6 +61,8 @@ struct so_list bfd *abfd; char symbols_loaded; /* flag: symbols read in yet? */ @@ -1266,31 +1297,21 @@ struct objfile *objfile; /* objfile for loaded lib */ struct section_table *sections; struct section_table *sections_end; -@@ -127,9 +129,15 @@ void free_so (struct so_list *so); - /* 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); +@@ -138,4 +140,10 @@ struct symbol *solib_global_lookup (cons + const char *linkage_name, + const domain_enum domain); +/* 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; - -@@ -140,4 +148,6 @@ struct symbol *solib_global_lookup (cons - const domain_enum domain, - struct symtab **symtab); - +/* Controls the printing of debugging output. */ +extern int debug_solib; ++ #endif ---- ./gdb/symfile-mem.c 2008-09-01 17:16:38.000000000 +0200 -+++ ./gdb/symfile-mem.c 2008-08-30 23:40:33.000000000 +0200 +Index: gdb-6.8.50.20081209/gdb/symfile-mem.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/symfile-mem.c 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/symfile-mem.c 2008-12-14 14:56:49.000000000 +0100 @@ -116,7 +116,7 @@ symbol_file_add_from_memory (struct bfd } @@ -1300,8 +1321,10 @@ /* This might change our ideas about frames already looked at. */ reinit_frame_cache (); ---- ./gdb/symfile.c 2008-09-01 17:16:38.000000000 +0200 -+++ ./gdb/symfile.c 2008-08-30 23:41:48.000000000 +0200 +Index: gdb-6.8.50.20081209/gdb/symfile.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/symfile.c 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/symfile.c 2008-12-14 14:56:49.000000000 +0100 @@ -47,6 +47,7 @@ #include "readline/readline.h" #include "gdb_assert.h" @@ -1310,7 +1333,7 @@ #include "observer.h" #include "exec.h" #include "parser-defs.h" -@@ -815,7 +816,7 @@ syms_from_objfile (struct objfile *objfi +@@ -787,7 +788,7 @@ syms_from_objfile (struct objfile *objfi /* Now either addrs or offsets is non-zero. */ @@ -1319,16 +1342,16 @@ { /* We will modify the main symbol table, make sure that all its users will be cleaned up if an error occurs during symbol reading. */ -@@ -843,7 +844,7 @@ syms_from_objfile (struct objfile *objfi +@@ -815,7 +816,7 @@ syms_from_objfile (struct objfile *objfi 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; - CORE_ADDR lower_offset = 0; /* Shut up the GCC warning. */ -@@ -1002,17 +1003,21 @@ new_symfile_objfile (struct objfile *obj +@@ -916,17 +917,21 @@ new_symfile_objfile (struct objfile *obj /* 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. */ @@ -1352,7 +1375,7 @@ /* We're done reading the symbol file; finish off complaints. */ clear_complaints (&symfile_complaints, 0, verbo); -@@ -1055,7 +1060,7 @@ symbol_file_add_with_addrs_or_offsets (b +@@ -969,7 +974,7 @@ symbol_file_add_with_addrs_or_offsets (b interactively wiping out any existing symbols. */ if ((have_full_symbols () || have_partial_symbols ()) @@ -1361,7 +1384,7 @@ && from_tty && !query ("Load new symbol table from \"%s\"? ", name)) error (_("Not confirmed.")); -@@ -1242,6 +1247,10 @@ symbol_file_clear (int from_tty) +@@ -1160,6 +1165,10 @@ symbol_file_clear (int from_tty) symfile_objfile->name) : !query (_("Discard symbol table? ")))) error (_("Not confirmed.")); @@ -1372,7 +1395,7 @@ free_all_objfiles (); /* solib descriptors may have handles to objfiles. Since their -@@ -3335,6 +3344,8 @@ reread_symbols (void) +@@ -3259,6 +3268,8 @@ reread_symbols (void) /* Discard cleanups as symbol reading was successful. */ discard_cleanups (old_cleanups); @@ -1381,7 +1404,7 @@ /* 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. */ -@@ -3703,6 +3714,7 @@ clear_symtab_users (void) +@@ -3628,6 +3639,7 @@ clear_symtab_users (void) breakpoint_re_set (); set_default_breakpoint (0, 0, 0, 0); clear_pc_function_cache (); @@ -1389,9 +1412,11 @@ observer_notify_new_objfile (NULL); /* Clear globals which might have pointed into a removed objfile. ---- ./gdb/varobj.c 2008-09-01 17:16:38.000000000 +0200 -+++ ./gdb/varobj.c 2008-08-30 23:40:33.000000000 +0200 -@@ -1075,6 +1075,62 @@ install_new_value (struct varobj *var, s +Index: gdb-6.8.50.20081209/gdb/varobj.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/varobj.c 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/varobj.c 2008-12-14 14:56:49.000000000 +0100 +@@ -1116,6 +1116,62 @@ install_new_value (struct varobj *var, s return changed; } @@ -1454,12 +1479,27 @@ /* 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 2008-01-30 08:17:31.000000000 +0100 -+++ ./gdb/varobj.h 2008-08-30 23:40:33.000000000 +0200 -@@ -122,4 +122,6 @@ extern void varobj_invalidate (void); +Index: gdb-6.8.50.20081209/gdb/varobj.h +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/varobj.h 2008-12-14 14:55:58.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/varobj.h 2008-12-14 14:56:49.000000000 +0100 +@@ -141,4 +141,6 @@ extern int varobj_editable_p (struct var - extern int varobj_editable_p (struct varobj *var); + extern int varobj_floating_p (struct varobj *var); +extern void varobj_refresh(void); + #endif /* VAROBJ_H */ +Index: gdb-6.8.50.20081209/gdb/target.h +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/target.h 2008-12-14 11:52:54.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/target.h 2008-12-14 14:57:21.000000000 +0100 +@@ -524,7 +524,7 @@ struct target_ops + Return -1 if there is insufficient buffer for a whole entry. + Return 1 if an entry was read into *TYPEP and *VALP. */ + int (*to_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); + + /* Search SEARCH_SPACE_LEN bytes beginning at START_ADDR for the + sequence of bytes in PATTERN with length PATTERN_LEN. diff --git a/gdb-6.3-ppc64displaysymbol-20041124.patch b/gdb-6.3-ppc64displaysymbol-20041124.patch index 7af2e73..8e94e00 100644 --- a/gdb-6.3-ppc64displaysymbol-20041124.patch +++ b/gdb-6.3-ppc64displaysymbol-20041124.patch @@ -3,9 +3,11 @@ * printcmd.c (build_address_symbolic): Find a section for the address. ---- ./gdb/printcmd.c.1 2004-11-24 17:54:27.316295608 -0500 -+++ ./gdb/printcmd.c 2004-11-24 17:59:20.069790312 -0500 -@@ -615,6 +615,20 @@ +Index: gdb-6.8.50.20081128/gdb/printcmd.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/printcmd.c 2008-12-04 01:36:05.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/printcmd.c 2008-12-04 01:37:18.000000000 +0100 +@@ -616,6 +616,14 @@ build_address_symbolic (CORE_ADDR addr, addr = overlay_mapped_address (addr, section); } } @@ -16,13 +18,7 @@ + the normal section code (which almost always succeeds). */ + section = find_pc_overlay (addr); + if (section == NULL) -+ { -+ struct obj_section *obj_section = find_pc_section (addr); -+ if (obj_section == NULL) -+ section = NULL; -+ else -+ section = obj_section->the_bfd_section; -+ } ++ section = find_pc_section (addr); /* First try to find the address in the symbol table, then in the minsyms. Take the closest one. */ diff --git a/gdb-6.3-readnever-20050907.patch b/gdb-6.3-readnever-20050907.patch index a320e53..a8b7500 100644 --- a/gdb-6.3-readnever-20050907.patch +++ b/gdb-6.3-readnever-20050907.patch @@ -11,11 +11,11 @@ * gdb.texinfo (File Options): Document --readnever. -Index: gdb-6.8/gdb/doc/gdb.texinfo +Index: gdb-6.8.50.20081128/gdb/doc/gdb.texinfo =================================================================== ---- gdb-6.8.orig/gdb/doc/gdb.texinfo 2008-03-26 19:38:21.000000000 +0100 -+++ gdb-6.8/gdb/doc/gdb.texinfo 2008-07-14 10:27:01.000000000 +0200 -@@ -983,6 +983,12 @@ Read each symbol file's entire symbol ta +--- gdb-6.8.50.20081128.orig/gdb/doc/gdb.texinfo 2008-11-27 10:23:01.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/doc/gdb.texinfo 2008-12-02 19:07:35.000000000 +0100 +@@ -994,6 +994,12 @@ Read each symbol file's entire symbol ta the default, which is to read it incrementally as it is needed. This makes startup slower, but makes future operations faster. @@ -28,11 +28,11 @@ Index: gdb-6.8/gdb/doc/gdb.texinfo @end table @node Mode Options -Index: gdb-6.8/gdb/main.c +Index: gdb-6.8.50.20081128/gdb/main.c =================================================================== ---- gdb-6.8.orig/gdb/main.c 2008-07-14 10:26:39.000000000 +0200 -+++ gdb-6.8/gdb/main.c 2008-07-14 10:27:01.000000000 +0200 -@@ -296,6 +296,7 @@ captured_main (void *data) +--- gdb-6.8.50.20081128.orig/gdb/main.c 2008-12-02 18:07:21.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/main.c 2008-12-02 19:07:35.000000000 +0100 +@@ -295,6 +295,7 @@ captured_main (void *data) {"xdb", no_argument, &xdb_commands, 1}, {"dbx", no_argument, &dbx_commands, 1}, {"readnow", no_argument, &readnow_symbol_files, 1}, @@ -40,7 +40,7 @@ Index: gdb-6.8/gdb/main.c {"r", no_argument, &readnow_symbol_files, 1}, {"quiet", no_argument, &quiet, 1}, {"q", no_argument, &quiet, 1}, -@@ -947,6 +948,7 @@ Options:\n\n\ +@@ -895,6 +896,7 @@ Options:\n\n\ fputs_unfiltered (_(" file.\n\ --quiet Do not print version number on startup.\n\ --readnow Fully read symbol files on first access.\n\ @@ -48,11 +48,11 @@ Index: gdb-6.8/gdb/main.c "), stream); fputs_unfiltered (_("\ --se=FILE Use FILE as symbol file and executable file.\n\ -Index: gdb-6.8/gdb/symfile.c +Index: gdb-6.8.50.20081128/gdb/symfile.c =================================================================== ---- gdb-6.8.orig/gdb/symfile.c 2008-07-14 10:26:30.000000000 +0200 -+++ gdb-6.8/gdb/symfile.c 2008-07-14 10:27:01.000000000 +0200 -@@ -76,6 +76,7 @@ static void clear_symtab_users_cleanup ( +--- gdb-6.8.50.20081128.orig/gdb/symfile.c 2008-12-01 16:34:36.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/symfile.c 2008-12-02 19:07:35.000000000 +0100 +@@ -77,6 +77,7 @@ static void clear_symtab_users_cleanup ( /* Global variables owned by this file */ int readnow_symbol_files; /* Read full symbols immediately */ @@ -60,32 +60,32 @@ Index: gdb-6.8/gdb/symfile.c /* External variables and functions referenced. */ -Index: gdb-6.8/gdb/dwarf2read.c +Index: gdb-6.8.50.20081128/gdb/dwarf2read.c =================================================================== ---- gdb-6.8.orig/gdb/dwarf2read.c 2008-07-14 10:26:09.000000000 +0200 -+++ gdb-6.8/gdb/dwarf2read.c 2008-07-14 10:27:01.000000000 +0200 -@@ -43,6 +43,7 @@ - #include "dwarf2loc.h" - #include "cp-support.h" - #include "hashtab.h" -+#include "top.h" +--- gdb-6.8.50.20081128.orig/gdb/dwarf2read.c 2008-11-15 19:49:50.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/dwarf2read.c 2008-12-02 19:08:53.000000000 +0100 +@@ -46,6 +46,7 @@ #include "command.h" #include "gdbcmd.h" + #include "addrmap.h" ++#include "top.h" -@@ -1106,7 +1107,8 @@ dwarf2_has_info (struct objfile *objfile + #include + #include "gdb_string.h" +@@ -1122,7 +1123,8 @@ dwarf2_has_info (struct objfile *objfile dwarf_loc_section = 0; bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL); - return (dwarf_info_section != NULL && dwarf_abbrev_section != NULL); -+ return (!readnever_symbol_files -+ && dwarf_info_section != NULL && dwarf_abbrev_section != NULL); ++ return !readnever_symbol_files ++ && dwarf_info_section != NULL && dwarf_abbrev_section != NULL; } - /* This function is mapped across the sections and remembers the -Index: gdb-6.8/gdb/top.h + /* When loading sections, we can either look for ".", or for +Index: gdb-6.8.50.20081128/gdb/top.h =================================================================== ---- gdb-6.8.orig/gdb/top.h 2008-01-01 23:53:13.000000000 +0100 -+++ gdb-6.8/gdb/top.h 2008-07-14 10:27:01.000000000 +0200 +--- gdb-6.8.50.20081128.orig/gdb/top.h 2008-01-01 23:53:13.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/top.h 2008-12-02 19:07:35.000000000 +0100 @@ -59,6 +59,7 @@ extern void set_prompt (char *); /* From random places. */ diff --git a/gdb-6.3-security-errata-20050610.patch b/gdb-6.3-security-errata-20050610.patch index 756fbcc..07544ad 100644 --- a/gdb-6.3-security-errata-20050610.patch +++ b/gdb-6.3-security-errata-20050610.patch @@ -1,3 +1,6 @@ +http://sourceware.org/ml/gdb-patches/2005-05/threads.html#00637 +Proposed upstream but never committed upstream. + 2005-06-09 Jeff Johnston * gdb.base/gdbinit.exp: New testcase. @@ -16,11 +19,11 @@ (source_command): Update documentation. Check permissions if FROM_TTY is -1. -Index: gdb-6.6/gdb/cli/cli-cmds.c +Index: gdb-6.8.50.20081128/gdb/cli/cli-cmds.c =================================================================== ---- gdb-6.6.orig/gdb/cli/cli-cmds.c -+++ gdb-6.6/gdb/cli/cli-cmds.c -@@ -38,6 +38,7 @@ +--- gdb-6.8.50.20081128.orig/gdb/cli/cli-cmds.c 2008-12-07 10:12:24.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/cli/cli-cmds.c 2008-12-07 13:04:06.000000000 +0100 +@@ -36,6 +36,7 @@ #include "objfiles.h" #include "source.h" #include "disasm.h" @@ -28,7 +31,7 @@ Index: gdb-6.6/gdb/cli/cli-cmds.c #include "ui-out.h" -@@ -461,12 +462,31 @@ source_script (char *file, int from_tty) +@@ -460,7 +461,7 @@ source_script (char *file, int from_tty) if (fd == -1) { @@ -36,23 +39,29 @@ Index: gdb-6.6/gdb/cli/cli-cmds.c + if (from_tty > 0) perror_with_name (file); else - return; + { +@@ -469,9 +470,33 @@ source_script (char *file, int from_tty) + } } +#ifdef HAVE_GETUID + if (from_tty == -1) + { + struct stat statbuf; ++ + if (fstat (fd, &statbuf) < 0) + { -+ perror_with_name (file); + close (fd); -+ return; ++ /* Do not do_cleanups (old_cleanups) as FILE is allocated there. ++ perror_with_name calls error which should call the cleanups. */ ++ perror_with_name (file); + } + if (statbuf.st_uid != getuid () || (statbuf.st_mode & S_IWOTH)) + { -+ warning (_("not using untrusted file \"%s\""), file); ++ /* FILE gets freed by do_cleanups (old_cleanups). */ ++ warning (_("not using untrusted file \"%s\""), file); + close (fd); ++ do_cleanups (old_cleanups); + return; + } + } @@ -61,10 +70,14 @@ Index: gdb-6.6/gdb/cli/cli-cmds.c stream = fdopen (fd, FOPEN_RT); script_from_file (stream, file); -Index: gdb-6.6/gdb/testsuite/gdb.base/gdbinit.exp ++ /* FILE gets freed by do_cleanups (old_cleanups). */ + do_cleanups (old_cleanups); + } + +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/gdbinit.exp =================================================================== ---- /dev/null -+++ gdb-6.6/gdb/testsuite/gdb.base/gdbinit.exp +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/gdbinit.exp 2008-12-07 10:13:01.000000000 +0100 @@ -0,0 +1,98 @@ +# Copyright 2005 +# Free Software Foundation, Inc. @@ -81,7 +94,7 @@ Index: gdb-6.6/gdb/testsuite/gdb.base/gdbinit.exp +# +# 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. ++# 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 @@ -107,15 +120,15 @@ Index: gdb-6.6/gdb/testsuite/gdb.base/gdbinit.exp +global gdb_prompt +global timeout +global gdb_spawn_id; -+ ++ +gdb_stop_suppressing_tests; -+ ++ +verbose "Spawning $GDB -nw" -+ ++ +if [info exists gdb_spawn_id] { + return 0; +} -+ ++ +if ![is_remote host] { + if { [which $GDB] == 0 } then { + perror "$GDB does not exist." @@ -164,17 +177,17 @@ Index: gdb-6.6/gdb/testsuite/gdb.base/gdbinit.exp +} + +remote_exec build "rm .gdbinit" -Index: gdb-6.6/gdb/testsuite/gdb.base/gdbinit.sample +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/gdbinit.sample =================================================================== ---- /dev/null -+++ gdb-6.6/gdb/testsuite/gdb.base/gdbinit.sample +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/gdbinit.sample 2008-12-07 10:13:01.000000000 +0100 @@ -0,0 +1 @@ +echo "\nin gdbinit" -Index: gdb-6.6/gdb/main.c +Index: gdb-6.8.50.20081128/gdb/main.c =================================================================== ---- gdb-6.6.orig/gdb/main.c -+++ gdb-6.6/gdb/main.c -@@ -644,7 +644,7 @@ extern int gdbtk_test (char *); +--- gdb-6.8.50.20081128.orig/gdb/main.c 2008-12-07 10:12:24.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/main.c 2008-12-07 12:58:37.000000000 +0100 +@@ -690,7 +690,7 @@ Excess command line arguments ignored. ( if (!inhibit_gdbinit) { @@ -183,7 +196,7 @@ Index: gdb-6.6/gdb/main.c } /* Do stats; no need to do them elsewhere since we'll only -@@ -722,7 +722,7 @@ extern int gdbtk_test (char *); +@@ -778,7 +778,7 @@ Can't attach to process and specify a co || memcmp ((char *) &homebuf, (char *) &cwdbuf, sizeof (struct stat))) if (!inhibit_gdbinit) { @@ -192,16 +205,3 @@ Index: gdb-6.6/gdb/main.c } for (i = 0; i < ncmd; i++) -Index: gdb-6.6/gdb/Makefile.in -=================================================================== ---- gdb-6.6.orig/gdb/Makefile.in -+++ gdb-6.6/gdb/Makefile.in -@@ -2927,7 +2927,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) \ diff --git a/gdb-6.3-sepcrc-20050402.patch b/gdb-6.3-sepcrc-20050402.patch index df0a667..330a739 100644 --- a/gdb-6.3-sepcrc-20050402.patch +++ b/gdb-6.3-sepcrc-20050402.patch @@ -4,11 +4,11 @@ print a warning. (find_separate_debug_file): Pass in the objfile's name. -Index: gdb-6.8/gdb/symfile.c +Index: gdb-6.8.50.20081128/gdb/symfile.c =================================================================== ---- gdb-6.8.orig/gdb/symfile.c 2008-01-29 23:47:20.000000000 +0100 -+++ gdb-6.8/gdb/symfile.c 2008-07-14 10:26:30.000000000 +0200 -@@ -1348,7 +1348,8 @@ get_debug_link_info (struct objfile *obj +--- gdb-6.8.50.20081128.orig/gdb/symfile.c 2008-10-03 18:36:10.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/symfile.c 2008-12-01 16:34:36.000000000 +0100 +@@ -1296,7 +1296,8 @@ get_debug_link_info (struct objfile *obj } static int @@ -17,23 +17,10 @@ Index: gdb-6.8/gdb/symfile.c + const char *parent_name) { unsigned long file_crc = 0; - int fd; -@@ -1357,6 +1358,12 @@ separate_debug_file_exists (const char * + bfd *abfd; +@@ -1316,7 +1317,15 @@ separate_debug_file_exists (const char * - fd = open (name, O_RDONLY | O_BINARY); - if (fd < 0) -+ /* Fail silently, this preserves existing behavior. The -+ assumption here is that the file wasn't found because there's -+ no file to find (we shouldn't be printing warnings about -+ missing debug info files when the user hasn't installed them). -+ The alternative is to complain here - that better belongs in a -+ warning. */ - return 0; - - while ((count = read (fd, buffer, sizeof (buffer))) > 0) -@@ -1364,7 +1371,16 @@ separate_debug_file_exists (const char * - - close (fd); + bfd_close (abfd); - return crc == file_crc; + if (crc != file_crc) @@ -44,12 +31,11 @@ Index: gdb-6.8/gdb/symfile.c + return 0; + } + -+ /* No worries! */ + return 1; } char *debug_file_directory = NULL; -@@ -1416,6 +1432,8 @@ find_separate_debug_file (struct objfile +@@ -1368,6 +1377,8 @@ find_separate_debug_file (struct objfile basename = get_debug_link_info (objfile, &crc32); if (basename == NULL) @@ -58,7 +44,7 @@ Index: gdb-6.8/gdb/symfile.c return NULL; dir = xstrdup (objfile->name); -@@ -1443,7 +1461,7 @@ find_separate_debug_file (struct objfile +@@ -1395,7 +1406,7 @@ find_separate_debug_file (struct objfile strcpy (debugfile, dir); strcat (debugfile, basename); @@ -67,7 +53,7 @@ Index: gdb-6.8/gdb/symfile.c { xfree (basename); xfree (dir); -@@ -1456,7 +1474,7 @@ find_separate_debug_file (struct objfile +@@ -1408,7 +1419,7 @@ find_separate_debug_file (struct objfile strcat (debugfile, "/"); strcat (debugfile, basename); @@ -76,7 +62,7 @@ Index: gdb-6.8/gdb/symfile.c { xfree (basename); xfree (dir); -@@ -1469,7 +1487,7 @@ find_separate_debug_file (struct objfile +@@ -1421,7 +1432,7 @@ find_separate_debug_file (struct objfile strcat (debugfile, dir); strcat (debugfile, basename); @@ -85,7 +71,7 @@ Index: gdb-6.8/gdb/symfile.c { xfree (basename); xfree (dir); -@@ -1488,7 +1506,7 @@ find_separate_debug_file (struct objfile +@@ -1440,7 +1451,7 @@ find_separate_debug_file (struct objfile strcat (debugfile, "/"); strcat (debugfile, basename); diff --git a/gdb-6.3-sigx86-20040621.patch b/gdb-6.3-sigx86-20040621.patch deleted file mode 100644 index 6ee56ae..0000000 --- a/gdb-6.3-sigx86-20040621.patch +++ /dev/null @@ -1,52 +0,0 @@ -2004-06-21 Andrew Cagney - - * i386-tdep.c (i386_gdbarch_init): Move the the dwarf2-frame - sniffer registration to after the signal trampoline frame sniffer. - * amd64-tdep.c (amd64_init_abi): Include "dwarf2-frame.h". - Register the dwarf2-frame sniffer, but after the signal trampoline - sniffer. - -Index: gdb-6.8/gdb/amd64-tdep.c -=================================================================== ---- gdb-6.8.orig/gdb/amd64-tdep.c 2008-03-04 20:49:39.000000000 +0100 -+++ gdb-6.8/gdb/amd64-tdep.c 2008-07-14 10:24:54.000000000 +0200 -@@ -34,7 +34,7 @@ - #include "regcache.h" - #include "regset.h" - #include "symfile.h" -- -+#include "dwarf2-frame.h" - #include "gdb_assert.h" - - #include "amd64-tdep.h" -@@ -1167,6 +1167,8 @@ amd64_init_abi (struct gdbarch_info info - set_gdbarch_unwind_dummy_id (gdbarch, amd64_unwind_dummy_id); - - frame_unwind_append_sniffer (gdbarch, amd64_sigtramp_frame_sniffer); -+ /* Hook in the DWARF CFI frame unwinder after sigtramp. */ -+ frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer); - frame_unwind_append_sniffer (gdbarch, amd64_frame_sniffer); - frame_base_set_default (gdbarch, &amd64_frame_base); - -Index: gdb-6.8/gdb/i386-tdep.c -=================================================================== ---- gdb-6.8.orig/gdb/i386-tdep.c 2008-03-04 20:49:39.000000000 +0100 -+++ gdb-6.8/gdb/i386-tdep.c 2008-07-14 10:24:54.000000000 +0200 -@@ -2480,15 +2480,14 @@ i386_gdbarch_init (struct gdbarch_info i - /* Helper for function argument information. */ - set_gdbarch_fetch_pointer_argument (gdbarch, i386_fetch_pointer_argument); - -- /* Hook in the DWARF CFI frame unwinder. */ -- frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer); -- - frame_base_set_default (gdbarch, &i386_frame_base); - - /* Hook in ABI-specific overrides, if they have been registered. */ - gdbarch_init_osabi (info, gdbarch); - - frame_unwind_append_sniffer (gdbarch, i386_sigtramp_frame_sniffer); -+ /* Hook in the DWARF CFI frame unwinder after sigtramp. */ -+ frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer); - frame_unwind_append_sniffer (gdbarch, i386_frame_sniffer); - - /* If we have a register mapping, enable the generic core file diff --git a/gdb-6.3-step-thread-exit-20050211-test.patch b/gdb-6.3-step-thread-exit-20050211-test.patch index 58b0dc5..fc73d9f 100644 --- a/gdb-6.3-step-thread-exit-20050211-test.patch +++ b/gdb-6.3-step-thread-exit-20050211-test.patch @@ -3,10 +3,10 @@ * testsuite/gdb.threads/step-thread-exit.c: New testcase. * testsuite/gdb.threads/step-thread-exit.exp: Ditto. -Index: gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.c +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/step-thread-exit.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.c 2006-07-12 03:18:47.000000000 -0300 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/step-thread-exit.c 2008-12-08 22:21:26.000000000 +0100 @@ -0,0 +1,50 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -58,11 +58,11 @@ Index: gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.c +} + + -Index: gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.exp +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/step-thread-exit.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.exp 2006-07-12 03:22:30.000000000 -0300 -@@ -0,0 +1,123 @@ ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/step-thread-exit.exp 2008-12-08 22:22:14.000000000 +0100 +@@ -0,0 +1,130 @@ +# This testcase is part of GDB, the GNU debugger. + +# Copyright 2005 Free Software Foundation, Inc. @@ -113,6 +113,11 @@ Index: gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.exp + gdb_suppress_tests +} + ++# FIXME: Currently the main thread will escape/exit before our thread finishes ++# without this setting. ++gdb_test "set scheduler-locking step" ++gdb_test "show scheduler-locking" "Mode for locking scheduler during execution is \"step\"." "check scheduler-locking first" ++ +set sleep_line [expr [gdb_get_line_number "sleep"]] +set end_line [expr [gdb_get_line_number "thread_function_end"]] + @@ -128,7 +133,7 @@ Index: gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.exp + send_gdb "next\n" + exp_continue + } -+ -re "Stepped over thread exit.*Program received signal SIGSTOP.*$gdb_prompt $" { ++ -re "\[Thread .* exited\].*Program received signal SIGSTOP.*$gdb_prompt $" { + pass "$test" + } + -re "start_thread.*$gdb_prompt $" { @@ -150,6 +155,8 @@ Index: gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.exp +gdb_test "bt" "main.*$sleep_line.*" "backtrace after step 1" + +runto_main ++gdb_test "show scheduler-locking" "Mode for locking scheduler during execution is \"step\"." "check scheduler-locking second" ++ +gdb_breakpoint "$sleep_line" +gdb_breakpoint "$end_line" +set test "continue to thread_function 2" @@ -174,10 +181,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.threads/step-thread-exit.exp + send_gdb "next\n" + exp_continue + } -+ -re "Stepped over thread exit.*Break.*$sleep_line.*$gdb_prompt $" { ++ -re "\[Thread .* exited\].*Break.*$sleep_line.*$gdb_prompt $" { + pass "$test (breakpoint hit)" + } -+ -re "Stepped over thread exit.*$gdb_prompt $" { ++ -re "\[Thread .* exited\].*$gdb_prompt $" { + pass "$test (breakpoint not hit)" + } + -re "start_thread.*$gdb_prompt $" { diff --git a/gdb-6.3-test-movedir-20050125.patch b/gdb-6.3-test-movedir-20050125.patch index 2337305..eb3cf73 100644 --- a/gdb-6.3-test-movedir-20050125.patch +++ b/gdb-6.3-test-movedir-20050125.patch @@ -4,9 +4,12 @@ * gdb.base/move-dir.c: Ditto. * gdb.base/move-dir.h: Ditto. ---- gdb-6.3/gdb/testsuite/gdb.base/move-dir.c.fix Tue Jan 25 19:13:14 2005 -+++ gdb-6.3/gdb/testsuite/gdb.base/move-dir.c Tue Jan 25 19:12:40 2005 -@@ -0,0 +1,9 @@ +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.c 2008-12-07 23:57:41.000000000 +0100 +@@ -0,0 +1,10 @@ ++#include +#include +#include "move-dir.h" + @@ -16,8 +19,10 @@ + other(); +} + ---- gdb-6.3/gdb/testsuite/gdb.base/move-dir.exp.fix Tue Jan 25 19:13:21 2005 -+++ gdb-6.3/gdb/testsuite/gdb.base/move-dir.exp Tue Jan 25 19:12:40 2005 +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.exp 2008-12-07 10:13:01.000000000 +0100 @@ -0,0 +1,67 @@ +# Copyright 2005 +# Free Software Foundation, Inc. @@ -86,8 +91,10 @@ + +set timeout $oldtimeout +return 0 ---- gdb-6.3/gdb/testsuite/gdb.base/move-dir.h.fix Tue Jan 25 19:17:50 2005 -+++ gdb-6.3/gdb/testsuite/gdb.base/move-dir.h Tue Jan 25 19:19:20 2005 +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/move-dir.h 2008-12-07 10:13:01.000000000 +0100 @@ -0,0 +1,7 @@ +#include + diff --git a/gdb-6.3-test-pie-20050107.patch b/gdb-6.3-test-pie-20050107.patch index a7c90c1..48bb8d9 100644 --- a/gdb-6.3-test-pie-20050107.patch +++ b/gdb-6.3-test-pie-20050107.patch @@ -1,35 +1,40 @@ ---- gdb-6.8/gdb/testsuite/configure.ac.orig 2007-10-25 22:30:26.000000000 +0200 -+++ gdb-6.8/gdb/testsuite/configure.ac 2008-08-26 18:02:17.000000000 +0200 -@@ -116,5 +116,5 @@ AC_OUTPUT([Makefile \ +Index: gdb-6.8.50.20081128/gdb/testsuite/configure.ac +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/configure.ac 2008-12-09 17:02:39.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/configure.ac 2008-12-09 17:02:55.000000000 +0100 +@@ -116,6 +116,6 @@ AC_OUTPUT([Makefile \ gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \ gdb.fortran/Makefile gdb.server/Makefile \ gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile \ - gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile \ + gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \ + gdb.python/Makefile \ gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile]) ---- gdb-6.8/gdb/testsuite/configure.orig 2007-12-29 15:01:30.000000000 +0100 -+++ gdb-6.8/gdb/testsuite/configure 2008-08-26 18:02:02.000000000 +0200 -@@ -3104,7 +3104,7 @@ done +Index: gdb-6.8.50.20081128/gdb/testsuite/configure +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/configure 2008-12-09 17:02:39.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/configure 2008-12-09 17:02:55.000000000 +0100 +@@ -3131,7 +3131,7 @@ done -- ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" -+ ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" +- ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" ++ ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure -@@ -3671,6 +3671,7 @@ do +@@ -3698,6 +3698,7 @@ do "gdb.objc/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.objc/Makefile" ;; "gdb.opt/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;; "gdb.pascal/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;; + "gdb.pie/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.pie/Makefile" ;; + "gdb.python/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;; "gdb.threads/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;; "gdb.trace/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.trace/Makefile" ;; - "gdb.xml/Makefile" ) CONFIG_FILES="$CONFIG_FILES gdb.xml/Makefile" ;; -Index: gdb-6.5/gdb/testsuite/gdb.pie/attach.c +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/attach.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.5/gdb/testsuite/gdb.pie/attach.c 2006-07-07 01:13:23.000000000 -0300 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/attach.c 2008-12-09 17:02:55.000000000 +0100 @@ -0,0 +1,20 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -51,10 +56,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/attach.c + } + return 0; +} -Index: gdb-6.5/gdb/testsuite/gdb.pie/attach2.c +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/attach2.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.5/gdb/testsuite/gdb.pie/attach2.c 2006-07-07 01:13:23.000000000 -0300 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/attach2.c 2008-12-09 17:02:55.000000000 +0100 @@ -0,0 +1,24 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -80,10 +85,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/attach2.c + } + return (0); +} -Index: gdb-6.5/gdb/testsuite/gdb.pie/break.c +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.5/gdb/testsuite/gdb.pie/break.c 2006-07-07 01:13:23.000000000 -0300 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.c 2008-12-09 17:02:55.000000000 +0100 @@ -0,0 +1,146 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -231,10 +236,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/break.c + } + return 0; +} -Index: gdb-6.5/gdb/testsuite/gdb.pie/break1.c +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break1.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.5/gdb/testsuite/gdb.pie/break1.c 2006-07-07 01:13:23.000000000 -0300 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break1.c 2008-12-09 17:02:55.000000000 +0100 @@ -0,0 +1,44 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -280,10 +285,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/break1.c +void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */ +void marker4 (d) long d; {} /* set breakpoint 13 here */ +#endif -Index: gdb-6.5/gdb/testsuite/gdb.pie/coremaker.c +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/coremaker.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.5/gdb/testsuite/gdb.pie/coremaker.c 2006-07-07 01:13:23.000000000 -0300 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/coremaker.c 2008-12-09 17:02:55.000000000 +0100 @@ -0,0 +1,142 @@ +/* Copyright 1992, 1993, 1994, 1995, 1996, 1999 + Free Software Foundation, Inc. @@ -427,10 +432,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/coremaker.c + return 0; +} + -Index: gdb-6.5/gdb/testsuite/gdb.pie/attach.exp +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/attach.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.5/gdb/testsuite/gdb.pie/attach.exp 2006-07-07 01:13:23.000000000 -0300 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/attach.exp 2008-12-09 17:02:55.000000000 +0100 @@ -0,0 +1,432 @@ +# Copyright 1997, 1999, 2002 Free Software Foundation, Inc. + @@ -689,7 +694,7 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/attach.exp + # + send_gdb "tbreak 19\n" + gdb_expect { -+ -re "Breakpoint .*at.*$srcfile, line 19.*$gdb_prompt $"\ ++ -re "reakpoint .*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"} @@ -864,10 +869,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/attach.exp +do_call_attach_tests + +return 0 -Index: gdb-6.5/gdb/testsuite/gdb.pie/break.exp +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.5/gdb/testsuite/gdb.pie/break.exp 2006-07-07 01:13:23.000000000 -0300 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/break.exp 2008-12-09 17:24:34.000000000 +0100 @@ -0,0 +1,973 @@ +# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2002, 2003, 2004 @@ -1144,13 +1149,13 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/break.exp +# test temporary breakpoint at function +# + -+gdb_test "tbreak main" "Breakpoint.*at.* file .*$srcfile, line.*" "Temporary breakpoint function" ++gdb_test "tbreak main" "reakpoint.*at.* file .*$srcfile, line.*" "Temporary breakpoint function" + +# +# test break at function in file +# + -+gdb_test "tbreak $srcfile:factorial" "Breakpoint.*at.* file .*$srcfile, line.*" \ ++gdb_test "tbreak $srcfile:factorial" "reakpoint.*at.* file .*$srcfile, line.*" \ + "Temporary breakpoint function in file" + +# @@ -1158,25 +1163,25 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/break.exp +# +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 "reakpoint.*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" ++gdb_test "tbreak $bp_location6" "reakpoint.*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 "reakpoint.*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" ++gdb_test "tbreak $srcfile:$bp_location11" "reakpoint.*at.* file .*$srcfile, line $bp_location11.*" "Temporary breakpoint line number in file #2" + +# +# check to see what breakpoints are set (temporary this time) @@ -1842,10 +1847,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/break.exp + send_gdb "set args main\n" + gdb_expect -re ".*$gdb_prompt $" {} +} -Index: gdb-6.5/gdb/testsuite/gdb.pie/corefile.exp +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/corefile.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.5/gdb/testsuite/gdb.pie/corefile.exp 2006-07-07 01:13:23.000000000 -0300 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/corefile.exp 2008-12-09 17:02:55.000000000 +0100 @@ -0,0 +1,243 @@ +# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Free Software Foundation, Inc. @@ -2090,10 +2095,10 @@ Index: gdb-6.5/gdb/testsuite/gdb.pie/corefile.exp +gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(\\).*" "up in corefile.exp (reinit)" + +gdb_test "core" "No core file now." -Index: gdb-6.5/gdb/testsuite/gdb.pie/Makefile.in +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/Makefile.in =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.5/gdb/testsuite/gdb.pie/Makefile.in 2006-07-07 01:13:23.000000000 -0300 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.pie/Makefile.in 2008-12-09 17:02:55.000000000 +0100 @@ -0,0 +1,19 @@ +VPATH = @srcdir@ +srcdir = @srcdir@ diff --git a/gdb-6.3-type-fix-20041213.patch b/gdb-6.3-type-fix-20041213.patch deleted file mode 100644 index 62f2a50..0000000 --- a/gdb-6.3-type-fix-20041213.patch +++ /dev/null @@ -1,29 +0,0 @@ -2004-12-13 Jeff Johnston - - * dwarf2read.c (read_type_die): Ensure that structures, unions, - enumerations, and base types create symbols. - -Index: gdb-6.8/gdb/dwarf2read.c -=================================================================== ---- gdb-6.8.orig/gdb/dwarf2read.c 2008-03-10 15:18:10.000000000 +0100 -+++ gdb-6.8/gdb/dwarf2read.c 2008-07-14 10:26:01.000000000 +0200 -@@ -7711,9 +7711,11 @@ read_type_die (struct die_info *die, str - case DW_TAG_structure_type: - case DW_TAG_union_type: - read_structure_type (die, cu); -+ process_structure_scope (die, cu); - break; - case DW_TAG_enumeration_type: - read_enumeration_type (die, cu); -+ process_enumeration_scope (die, cu); - break; - case DW_TAG_subprogram: - case DW_TAG_subroutine_type: -@@ -7751,6 +7753,7 @@ read_type_die (struct die_info *die, str - break; - case DW_TAG_base_type: - read_base_type (die, cu); -+ new_symbol (die, die->type, cu); - break; - case DW_TAG_unspecified_type: - read_unspecified_type (die, cu); diff --git a/gdb-6.3-warnings-20050317.patch b/gdb-6.3-warnings-20050317.patch index 4c11873..13eda16 100644 --- a/gdb-6.3-warnings-20050317.patch +++ b/gdb-6.3-warnings-20050317.patch @@ -1,104 +1,207 @@ -[base] +http://sourceware.org/ml/gdb-patches/2008-12/msg00243.html -2007-10-14 Jan Kratochvil + Check return values of functions declared with warn_unused_result + attribute in GLIBC 2.8. + * cli/cli-cmds.c (pwd_command): Check return value from getcwd. + * inflow.c (check_syscall): New function. + (new_tty): Use check_syscall to check return values from open and dup. + * linux-nat.c (linux_nat_info_proc_cmd): Check return value from fgets. + * main.c (captured_main): Call cwd after setting up gdb_stderr; + check for errors from getcwd. + * mi/mi-cmd-env.c (mi_cmd_env_pwd): Check return value from getcwd. + * ui-file.c (stdio_file_write): Check return value from fwrite. + (stdio_file_fputs): Check return value from fputs. + * utils.c (internal_vproblem): abort if last-ditch error message + write fails. - Port to GDB-6.7. +[ +linespec.c: Fedora patch. ] +[ +top.c: Fedora patch. ] -Index: gdb-6.7/gdb/mi/mi-cmd-env.c -=================================================================== ---- gdb-6.7.orig/gdb/mi/mi-cmd-env.c 2007-10-14 23:42:39.000000000 +0200 -+++ gdb-6.7/gdb/mi/mi-cmd-env.c 2007-10-14 23:42:39.000000000 +0200 -@@ -78,7 +78,8 @@ mi_cmd_env_pwd (char *command, char **ar +--- + gdb/ChangeLog | 14 ++++++++++++++ + gdb/cli/cli-cmds.c | 4 +++- + gdb/inflow.c | 22 ++++++++++++++-------- + gdb/linux-nat.c | 6 ++++-- + gdb/main.c | 12 +++++++++--- + gdb/mi/mi-cmd-env.c | 5 ++++- + gdb/ui-file.c | 6 ++++-- + gdb/utils.c | 8 +++++++- + 8 files changed, 59 insertions(+), 18 deletions(-) + +diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c +index 806a68a..b80bdfc 100644 +--- a/gdb/cli/cli-cmds.c ++++ b/gdb/cli/cli-cmds.c +@@ -323,7 +323,9 @@ pwd_command (char *args, int from_tty) + { + if (args) + error (_("The \"pwd\" command does not take an argument: %s"), args); +- getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); ++ if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf))) ++ error (_("Error finding name of working directory: %s"), ++ safe_strerror (errno)); + + if (strcmp (gdb_dirbuf, current_directory) != 0) + printf_unfiltered (_("Working directory %s\n (canonically %s).\n"), +diff --git a/gdb/inflow.c b/gdb/inflow.c +index e82514e..7ecb5ab 100644 +--- a/gdb/inflow.c ++++ b/gdb/inflow.c +@@ -523,6 +523,16 @@ new_tty_prefork (const char *ttyname) + inferior_thisrun_terminal = ttyname; + } + ++static void ++check_syscall (const char *msg, int result) ++{ ++ if (result < 0) ++ { ++ print_sys_errmsg (msg, errno); ++ _exit (1); ++ } ++} ++ + void + new_tty (void) + { +@@ -549,27 +559,23 @@ new_tty (void) + + /* Now open the specified new terminal. */ + tty = open (inferior_thisrun_terminal, O_RDWR | O_NOCTTY); +- if (tty == -1) +- { +- print_sys_errmsg (inferior_thisrun_terminal, errno); +- _exit (1); +- } ++ check_syscall (inferior_thisrun_terminal, tty); + + /* Avoid use of dup2; doesn't exist on all systems. */ + if (tty != 0) + { + close (0); +- dup (tty); ++ check_syscall ("dup'ing tty into fd 0", dup (tty)); + } + if (tty != 1) + { + close (1); +- dup (tty); ++ check_syscall ("dup'ing tty into fd 1", dup (tty)); + } + if (tty != 2) + { + close (2); +- dup (tty); ++ check_syscall ("dup'ing tty into fd 2", dup (tty)); + } + + #ifdef TIOCSCTTY +diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c +index 913bfec..a829eb8 100644 +--- a/gdb/linux-nat.c ++++ b/gdb/linux-nat.c +@@ -3666,8 +3666,10 @@ linux_nat_info_proc_cmd (char *args, int from_tty) + if ((procfile = fopen (fname1, "r")) != NULL) + { + struct cleanup *cleanup = make_cleanup_fclose (procfile); +- fgets (buffer, sizeof (buffer), procfile); +- printf_filtered ("cmdline = '%s'\n", buffer); ++ if (fgets (buffer, sizeof (buffer), procfile)) ++ printf_filtered ("cmdline = '%s'\n", buffer); ++ else ++ warning (_("unable to read '/proc/%lld/cmdline'"), pid); + do_cleanups (cleanup); + } + else +diff --git a/gdb/main.c b/gdb/main.c +index a53002d..a9fd988 100644 +--- a/gdb/main.c ++++ b/gdb/main.c +@@ -195,9 +195,6 @@ captured_main (void *data) + line[0] = '\0'; /* Terminate saved (now empty) cmd line */ + instream = stdin; + +- getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); +- current_directory = gdb_dirbuf; +- + gdb_stdout = stdio_fileopen (stdout); + gdb_stderr = stdio_fileopen (stderr); + gdb_stdlog = gdb_stderr; /* for moment */ +@@ -206,6 +203,15 @@ captured_main (void *data) + gdb_stdtargerr = gdb_stderr; /* for moment */ + gdb_stdtargin = gdb_stdin; /* for moment */ + ++ if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf))) ++ /* Don't use *_filtered or warning() (which relies on ++ current_target) until after initialize_all_files(). */ ++ fprintf_unfiltered (gdb_stderr, ++ _("%s: warning: error finding working directory: %s\n"), ++ argv[0], safe_strerror (errno)); ++ ++ current_directory = gdb_dirbuf; ++ + /* Set the sysroot path. */ + #ifdef TARGET_SYSTEM_ROOT_RELOCATABLE + gdb_sysroot = make_relative_prefix (argv[0], BINDIR, TARGET_SYSTEM_ROOT); +diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c +index 327ddc5..0103153 100644 +--- a/gdb/mi/mi-cmd-env.c ++++ b/gdb/mi/mi-cmd-env.c +@@ -78,7 +78,10 @@ mi_cmd_env_pwd (char *command, char **argv, int argc) /* Otherwise the mi level is 2 or higher. */ - getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); -+ /* Unused result. */ -+ 1 && getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); ++ if (! getcwd (gdb_dirbuf, sizeof (gdb_dirbuf))) ++ error (_("mi_cmd_env_pwd: error finding name of working directory: %s"), ++ safe_strerror (errno)); ++ ui_out_field_string (uiout, "cwd", gdb_dirbuf); + } - return MI_CMD_DONE; -Index: gdb-6.7/gdb/testsuite/gdb.base/move-dir.h -=================================================================== ---- gdb-6.7.orig/gdb/testsuite/gdb.base/move-dir.h 2007-10-14 23:31:22.000000000 +0200 -+++ gdb-6.7/gdb/testsuite/gdb.base/move-dir.h 2007-10-14 23:42:39.000000000 +0200 -@@ -1,4 +1,4 @@ --#include -+#include +diff --git a/gdb/ui-file.c b/gdb/ui-file.c +index 9a1d892..2ed304f 100644 +--- a/gdb/ui-file.c ++++ b/gdb/ui-file.c +@@ -481,7 +481,8 @@ stdio_file_write (struct ui_file *file, const char *buf, long length_buf) + if (stdio->magic != &stdio_file_magic) + internal_error (__FILE__, __LINE__, + _("stdio_file_write: bad magic number")); +- fwrite (buf, length_buf, 1, stdio->file); ++ if (fwrite (buf, length_buf, 1, stdio->file) != 1) ++ error ("stdio_file_write: %s", safe_strerror (errno)); + } - void other() { - const char* ostring = "other"; -Index: gdb-6.7/gdb/testsuite/gdb.base/sigrepeat.c -=================================================================== ---- gdb-6.7.orig/gdb/testsuite/gdb.base/sigrepeat.c 2007-08-23 20:08:49.000000000 +0200 -+++ gdb-6.7/gdb/testsuite/gdb.base/sigrepeat.c 2007-10-14 23:42:39.000000000 +0200 -@@ -21,6 +21,7 @@ - #include - #include - #include -+#include - #include - - static volatile int done[2]; -Index: gdb-6.7/gdb/s390-tdep.c -=================================================================== ---- gdb-6.7.orig/gdb/s390-tdep.c 2007-10-02 21:26:42.000000000 +0200 -+++ gdb-6.7/gdb/s390-tdep.c 2007-10-14 23:42:39.000000000 +0200 -@@ -2214,6 +2214,9 @@ s390_return_value (struct gdbarch *gdbar - case RETURN_VALUE_STRUCT_CONVENTION: - error (_("Cannot set function return value.")); - break; -+ -+ default: -+ break; - } - } - else if (out) -@@ -2246,6 +2249,9 @@ s390_return_value (struct gdbarch *gdbar - case RETURN_VALUE_STRUCT_CONVENTION: - error (_("Function return value unknown.")); - break; -+ -+ default: -+ break; - } - } - -Index: gdb-6.7/gdb/f-exp.y -=================================================================== ---- gdb-6.7.orig/gdb/f-exp.y 2007-06-12 17:33:03.000000000 +0200 -+++ gdb-6.7/gdb/f-exp.y 2007-10-14 23:42:39.000000000 +0200 -@@ -567,6 +567,8 @@ ptype : typebase - case tp_function: - follow_type = lookup_function_type (follow_type); - break; -+ default: -+ break; - } - $$ = follow_type; - } -Index: gdb-6.7/gdb/source.c -=================================================================== ---- gdb-6.7.orig/gdb/source.c 2007-08-23 20:08:38.000000000 +0200 -+++ gdb-6.7/gdb/source.c 2007-10-14 23:42:39.000000000 +0200 -@@ -170,7 +170,7 @@ get_current_source_symtab_and_line (void - void - set_default_source_symtab_and_line (void) - { -- struct symtab_and_line cursal; -+ struct symtab_and_line cursal = {0}; - - if (!have_full_symbols () && !have_partial_symbols ()) - error (_("No symbol table is loaded. Use the \"file\" command.")); -@@ -1439,7 +1439,7 @@ static void - line_info (char *arg, int from_tty) - { - struct symtabs_and_lines sals; -- struct symtab_and_line sal; -+ struct symtab_and_line sal = {0}; - CORE_ADDR start_pc, end_pc; - int i; + static void +@@ -491,7 +492,8 @@ stdio_file_fputs (const char *linebuffer, struct ui_file *file) + if (stdio->magic != &stdio_file_magic) + internal_error (__FILE__, __LINE__, + _("stdio_file_fputs: bad magic number")); +- fputs (linebuffer, stdio->file); ++ if (fputs (linebuffer, stdio->file) == EOF) ++ error ("stdio_file_fputs: %s", safe_strerror (errno)); + } + static int +diff --git a/gdb/utils.c b/gdb/utils.c +index d14009f..725f00b 100644 +--- a/gdb/utils.c ++++ b/gdb/utils.c +@@ -865,7 +865,13 @@ internal_vproblem (struct internal_problem *problem, + abort (); /* NOTE: GDB has only three calls to abort(). */ + default: + dejavu = 3; +- write (STDERR_FILENO, msg, sizeof (msg)); ++ /* Newer GLIBC versions put the warn_unused_result attribute ++ on write, but this is one of those rare cases where ++ ignoring the return value is correct. Casting to (void) ++ does not fix this problem. This is the solution suggested ++ at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509. */ ++ if (write (STDERR_FILENO, msg, sizeof (msg)) != sizeof (msg)) ++ abort (); + exit (1); + } + } Index: gdb-6.7/gdb/linespec.c =================================================================== --- gdb-6.7.orig/gdb/linespec.c 2007-10-14 23:31:03.000000000 +0200 @@ -112,208 +215,6 @@ Index: gdb-6.7/gdb/linespec.c struct symbol *sym = NULL; int i1; /* Counter for the symbol array. */ struct symbol **sym_arr = alloca (total_number_of_methods (t) -Index: gdb-6.7/gdb/gdb-events.c -=================================================================== ---- gdb-6.7.orig/gdb/gdb-events.c 2007-08-23 20:08:31.000000000 +0200 -+++ gdb-6.7/gdb/gdb-events.c 2007-10-14 23:42:39.000000000 +0200 -@@ -319,6 +319,8 @@ gdb_events_deliver (struct gdb_events *v - case architecture_changed: - vector->architecture_changed (); - break; -+ default: -+ break; - } - delivering_events = event->next; - xfree (event); -Index: gdb-6.7/gdb/dwarf2read.c -=================================================================== ---- gdb-6.7.orig/gdb/dwarf2read.c 2007-10-14 23:31:22.000000000 +0200 -+++ gdb-6.7/gdb/dwarf2read.c 2007-10-14 23:42:39.000000000 +0200 -@@ -9585,6 +9585,7 @@ dwarf_decode_macros (struct line_header - for (;;) - { - enum dwarf_macinfo_record_type macinfo_type; -+ int tmp; - - /* Do we at least have room for a macinfo type byte? */ - if (mac_ptr >= mac_end) -@@ -9596,13 +9597,16 @@ dwarf_decode_macros (struct line_header - macinfo_type = read_1_byte (abfd, mac_ptr); - mac_ptr++; - -+ /* Check for a zero macinfo type which indicates the end of the macro -+ information. We do this as the compiler may warn us if we -+ try and look for 0 in the switch below because 0 is not -+ an enumerated value. */ -+ tmp = (int)macinfo_type; -+ if (tmp == 0) -+ return; -+ - switch (macinfo_type) - { -- /* A zero macinfo type indicates the end of the macro -- information. */ -- case 0: -- return; -- - case DW_MACINFO_define: - case DW_MACINFO_undef: - { -Index: gdb-6.7/gdb/stabsread.c -=================================================================== ---- gdb-6.7.orig/gdb/stabsread.c 2007-10-09 00:44:32.000000000 +0200 -+++ gdb-6.7/gdb/stabsread.c 2007-10-14 23:42:39.000000000 +0200 -@@ -1842,7 +1842,8 @@ again: - struct type *domain = read_type (pp, objfile); - struct type *return_type; - struct field *args; -- int nargs, varargs; -+ int nargs = 0; -+ int varargs = 0; - - if (**pp != ',') - /* Invalid member type data format. */ -Index: gdb-6.7/gdb/dwarf2expr.c -=================================================================== ---- gdb-6.7.orig/gdb/dwarf2expr.c 2007-08-23 20:08:28.000000000 +0200 -+++ gdb-6.7/gdb/dwarf2expr.c 2007-10-14 23:42:39.000000000 +0200 -@@ -594,6 +594,8 @@ execute_stack_op (struct dwarf_expr_cont - op_ptr = read_uleb128 (op_ptr, op_end, ®); - result += reg; - break; -+ default: -+ break; - } - break; - -Index: gdb-6.7/gdb/varobj.c -=================================================================== ---- gdb-6.7.orig/gdb/varobj.c 2007-10-13 05:29:58.000000000 +0200 -+++ gdb-6.7/gdb/varobj.c 2007-10-14 23:42:39.000000000 +0200 -@@ -347,8 +347,7 @@ static struct language_specific language - c_value_of_variable} - , - /* C */ -- { -- vlang_c, -+ {vlang_c, - c_number_of_children, - c_name_of_variable, - c_name_of_child, -@@ -360,8 +359,7 @@ static struct language_specific language - c_value_of_variable} - , - /* C++ */ -- { -- vlang_cplus, -+ {vlang_cplus, - cplus_number_of_children, - cplus_name_of_variable, - cplus_name_of_child, -@@ -373,8 +371,7 @@ static struct language_specific language - cplus_value_of_variable} - , - /* Java */ -- { -- vlang_java, -+ {vlang_java, - java_number_of_children, - java_name_of_variable, - java_name_of_child, -Index: gdb-6.7/gdb/doublest.c -=================================================================== ---- gdb-6.7.orig/gdb/doublest.c 2007-08-23 20:08:28.000000000 +0200 -+++ gdb-6.7/gdb/doublest.c 2007-10-14 23:42:39.000000000 +0200 -@@ -92,15 +92,10 @@ get_field (const bfd_byte *data, enum fl - { - result |= (unsigned long)*(data + cur_byte) << cur_bitshift; - cur_bitshift += FLOATFORMAT_CHAR_BIT; -- switch (order) -- { -- case floatformat_little: -- ++cur_byte; -- break; -- case floatformat_big: -- --cur_byte; -- break; -- } -+ if (order == floatformat_little) -+ ++cur_byte; -+ else -+ --cur_byte; - } - if (len < sizeof(result) * FLOATFORMAT_CHAR_BIT) - /* Mask out bits which are not part of the field */ -Index: gdb-6.7/gdb/cli/cli-cmds.c -=================================================================== ---- gdb-6.7.orig/gdb/cli/cli-cmds.c 2007-08-23 20:08:47.000000000 +0200 -+++ gdb-6.7/gdb/cli/cli-cmds.c 2007-10-14 23:42:39.000000000 +0200 -@@ -320,7 +320,8 @@ pwd_command (char *args, int from_tty) - { - if (args) - error (_("The \"pwd\" command does not take an argument: %s"), args); -- getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); -+ /* Unused result. */ -+ 1 && getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); - - if (strcmp (gdb_dirbuf, current_directory) != 0) - printf_unfiltered (_("Working directory %s\n (canonically %s).\n"), -Index: gdb-6.7/gdb/inflow.c -=================================================================== ---- gdb-6.7.orig/gdb/inflow.c 2007-08-23 20:08:35.000000000 +0200 -+++ gdb-6.7/gdb/inflow.c 2007-10-14 23:42:39.000000000 +0200 -@@ -547,17 +547,20 @@ new_tty (void) - if (tty != 0) - { - close (0); -- dup (tty); -+ /* Unused result. */ -+ 1 && dup (tty); - } - if (tty != 1) - { - close (1); -- dup (tty); -+ /* Unused result. */ -+ 1 && dup (tty); - } - if (tty != 2) - { - close (2); -- dup (tty); -+ /* Unused result. */ -+ 1 && dup (tty); - } - if (tty > 2) - close (tty); -Index: gdb-6.7/gdb/linux-nat.c -=================================================================== ---- gdb-6.7.orig/gdb/linux-nat.c 2007-10-14 23:31:22.000000000 +0200 -+++ gdb-6.7/gdb/linux-nat.c 2007-10-14 23:42:39.000000000 +0200 -@@ -2895,7 +2895,8 @@ linux_nat_info_proc_cmd (char *args, int - sprintf (fname1, "/proc/%lld/cmdline", pid); - if ((procfile = fopen (fname1, "r")) != NULL) - { -- fgets (buffer, sizeof (buffer), procfile); -+ /* Unused result. */ -+ 1 && fgets (buffer, sizeof (buffer), procfile); - printf_filtered ("cmdline = '%s'\n", buffer); - fclose (procfile); - } -Index: gdb-6.7/gdb/main.c -=================================================================== ---- gdb-6.7.orig/gdb/main.c 2007-08-23 20:08:36.000000000 +0200 -+++ gdb-6.7/gdb/main.c 2007-10-14 23:42:39.000000000 +0200 -@@ -193,7 +193,8 @@ captured_main (void *data) - line[0] = '\0'; /* Terminate saved (now empty) cmd line */ - instream = stdin; - -- getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); -+ /* Unused result. */ -+ 1 && getcwd (gdb_dirbuf, sizeof (gdb_dirbuf)); - current_directory = gdb_dirbuf; - - gdb_stdout = stdio_fileopen (stdout); Index: gdb-6.7/gdb/top.c =================================================================== --- gdb-6.7.orig/gdb/top.c 2007-10-14 23:38:27.000000000 +0200 @@ -328,62 +229,3 @@ Index: gdb-6.7/gdb/top.c current_directory = gdb_dirbuf; #ifdef __MSDOS__ -Index: gdb-6.7/gdb/ui-file.c -=================================================================== ---- gdb-6.7.orig/gdb/ui-file.c 2007-08-23 20:08:46.000000000 +0200 -+++ gdb-6.7/gdb/ui-file.c 2007-10-14 23:42:39.000000000 +0200 -@@ -480,7 +480,8 @@ stdio_file_write (struct ui_file *file, - if (stdio->magic != &stdio_file_magic) - internal_error (__FILE__, __LINE__, - _("stdio_file_write: bad magic number")); -- fwrite (buf, length_buf, 1, stdio->file); -+ /* Unused result. */ -+ 1 && fwrite (buf, length_buf, 1, stdio->file); - } - - static void -Index: gdb-6.7/gdb/utils.c -=================================================================== ---- gdb-6.7.orig/gdb/utils.c 2007-08-23 20:08:46.000000000 +0200 -+++ gdb-6.7/gdb/utils.c 2007-10-14 23:42:39.000000000 +0200 -@@ -716,7 +716,8 @@ internal_vproblem (struct internal_probl - abort (); /* NOTE: GDB has only three calls to abort(). */ - default: - dejavu = 3; -- write (STDERR_FILENO, msg, sizeof (msg)); -+ /* Unused result. */ -+ 1 && write (STDERR_FILENO, msg, sizeof (msg)); - exit (1); - } - } -Index: gdb-6.7/gdb/gdbserver/gdbreplay.c -=================================================================== ---- gdb-6.7.orig/gdb/gdbserver/gdbreplay.c 2007-08-23 20:08:48.000000000 +0200 -+++ gdb-6.7/gdb/gdbserver/gdbreplay.c 2007-10-14 23:42:39.000000000 +0200 -@@ -356,7 +356,12 @@ expect (FILE *fp) - { - break; - } -- read (remote_desc, &fromgdb, 1); -+ if (read (remote_desc, &fromgdb, 1) != 1) -+ { -+ /* Error gets reported below. */ -+ fromlog = 0; -+ break; -+ } - } - while (fromlog == fromgdb); - if (fromlog != EOL) -@@ -383,7 +388,11 @@ play (FILE *fp) - while ((fromlog = logchar (fp)) != EOL) - { - ch = fromlog; -- write (remote_desc, &ch, 1); -+ if (write (remote_desc, &ch, 1) != 1) -+ { -+ sync_error (fp, "Sync error during write of gdb packet", ch, 0); -+ break; -+ } - } - } - diff --git a/gdb-6.5-bz181390-memory-address-width.patch b/gdb-6.5-bz181390-memory-address-width.patch index ade16fb..894ca0c 100644 --- a/gdb-6.5-bz181390-memory-address-width.patch +++ b/gdb-6.5-bz181390-memory-address-width.patch @@ -4,7 +4,7 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=181390 * gdb/utils.c (paddress): Disable cutting of the printed addresses to the target's address bit size; user wants to see everything. - * gdb/value.c (value_as_address_core): Original `value_as_address'. + * gdb/value.c (value_as_address1): Original `value_as_address'. (value_as_address): New `value_as_address' wrapper - cut memory address to the target's address bit size, bugreport by John Reiser. @@ -56,7 +56,7 @@ Index: gdb-6.7.50.20080227/gdb/value.c -value_as_address (struct value *val) +/* See `value_as_address' below - core of value to C pointer extraction. */ +static CORE_ADDR -+value_as_address_core (struct value *val) ++value_as_address1 (struct value *val) { /* Assume a CORE_ADDR can fit in a LONGEST (for now). Not sure whether we want this to be true eventually. */ @@ -74,7 +74,7 @@ Index: gdb-6.7.50.20080227/gdb/value.c + CORE_ADDR addr; + int addr_bit; + -+ addr = value_as_address_core (val); ++ addr = value_as_address1 (val); + + /* Truncate address to the size of a target address, avoiding shifts + larger or equal than the width of a CORE_ADDR. The local diff --git a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch index 5ff086a..eeb6b3c 100644 --- a/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +++ b/gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch @@ -30,11 +30,11 @@ glibc-debuginfo-2.7-2.x86_64: /usr/lib/debug/lib64/libc.so.6.debug: <81a2> DW_AT_name : (indirect string, offset: 0x280e): __errno_location <81a8> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x2808): *__GI___errno_location -Index: gdb-6.8cvs20080219/gdb/dwarf2read.c +Index: gdb-6.8.50.20081128/gdb/dwarf2read.c =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/dwarf2read.c 2008-02-19 17:27:21.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/dwarf2read.c 2008-02-20 13:35:19.000000000 +0100 -@@ -5679,8 +5679,8 @@ read_partial_die (struct partial_die_inf +--- gdb-6.8.50.20081128.orig/gdb/dwarf2read.c 2008-12-04 10:26:18.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/dwarf2read.c 2008-12-04 10:26:40.000000000 +0100 +@@ -5886,8 +5886,8 @@ read_partial_die (struct partial_die_inf { case DW_AT_name: @@ -45,7 +45,7 @@ Index: gdb-6.8cvs20080219/gdb/dwarf2read.c part_die->name = DW_STRING (&attr); break; case DW_AT_comp_dir: -@@ -5688,7 +5688,9 @@ read_partial_die (struct partial_die_inf +@@ -5895,7 +5895,9 @@ read_partial_die (struct partial_die_inf part_die->dirname = DW_STRING (&attr); break; case DW_AT_MIPS_linkage_name: @@ -56,7 +56,7 @@ Index: gdb-6.8cvs20080219/gdb/dwarf2read.c break; case DW_AT_low_pc: has_low_pc_attr = 1; -@@ -7936,9 +7938,13 @@ dwarf2_linkage_name (struct die_info *di +@@ -8129,9 +8131,13 @@ dwarf2_linkage_name (struct die_info *di { struct attribute *attr; @@ -73,11 +73,11 @@ Index: gdb-6.8cvs20080219/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_name, cu); if (attr && DW_STRING (attr)) return DW_STRING (attr); -Index: gdb-6.8cvs20080219/gdb/gdbtypes.c +Index: gdb-6.8.50.20081128/gdb/gdbtypes.c =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/gdbtypes.c 2008-02-14 23:03:57.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/gdbtypes.c 2008-02-20 13:35:19.000000000 +0100 -@@ -3106,6 +3106,8 @@ gdbtypes_post_init (struct gdbarch *gdba +--- gdb-6.8.50.20081128.orig/gdb/gdbtypes.c 2008-11-10 21:53:43.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/gdbtypes.c 2008-12-04 10:26:40.000000000 +0100 +@@ -3141,6 +3141,8 @@ gdbtypes_post_init (struct gdbarch *gdba init_type (TYPE_CODE_INT, gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT, 0, "int", (struct objfile *) NULL); @@ -86,7 +86,7 @@ Index: gdb-6.8cvs20080219/gdb/gdbtypes.c builtin_type->builtin_unsigned_int = init_type (TYPE_CODE_INT, gdbarch_int_bit (gdbarch) / TARGET_CHAR_BIT, -@@ -3215,6 +3217,11 @@ gdbtypes_post_init (struct gdbarch *gdba +@@ -3250,6 +3252,11 @@ gdbtypes_post_init (struct gdbarch *gdba "", NULL); TYPE_TARGET_TYPE (builtin_type->nodebug_text_symbol) = builtin_type->builtin_int; @@ -98,11 +98,11 @@ Index: gdb-6.8cvs20080219/gdb/gdbtypes.c builtin_type->nodebug_data_symbol = init_type (TYPE_CODE_INT, gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT, 0, -Index: gdb-6.8cvs20080219/gdb/gdbtypes.h +Index: gdb-6.8.50.20081128/gdb/gdbtypes.h =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/gdbtypes.h 2008-02-14 23:03:57.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/gdbtypes.h 2008-02-20 13:35:19.000000000 +0100 -@@ -942,6 +942,7 @@ struct builtin_type +--- gdb-6.8.50.20081128.orig/gdb/gdbtypes.h 2008-10-28 18:19:56.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/gdbtypes.h 2008-12-04 10:26:40.000000000 +0100 +@@ -975,6 +975,7 @@ struct builtin_type /* Types used for symbols with no debug information. */ struct type *nodebug_text_symbol; @@ -110,7 +110,7 @@ Index: gdb-6.8cvs20080219/gdb/gdbtypes.h struct type *nodebug_data_symbol; struct type *nodebug_unknown_symbol; struct type *nodebug_tls_symbol; -@@ -960,6 +961,7 @@ struct builtin_type +@@ -987,6 +988,7 @@ struct builtin_type struct type *builtin_char; struct type *builtin_short; struct type *builtin_int; @@ -118,11 +118,11 @@ Index: gdb-6.8cvs20080219/gdb/gdbtypes.h struct type *builtin_long; struct type *builtin_signed_char; struct type *builtin_unsigned_char; -Index: gdb-6.8cvs20080219/gdb/parse.c +Index: gdb-6.8.50.20081128/gdb/parse.c =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/parse.c 2008-01-02 00:04:03.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/parse.c 2008-02-20 13:35:19.000000000 +0100 -@@ -437,7 +437,12 @@ write_exp_msymbol (struct minimal_symbol +--- gdb-6.8.50.20081128.orig/gdb/parse.c 2008-11-24 18:05:43.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/parse.c 2008-12-04 10:26:40.000000000 +0100 +@@ -449,7 +449,12 @@ write_exp_msymbol (struct minimal_symbol case mst_text: case mst_file_text: case mst_solib_trampoline: @@ -136,12 +136,12 @@ Index: gdb-6.8cvs20080219/gdb/parse.c break; case mst_data: -Index: gdb-6.8cvs20080219/gdb/target.c +Index: gdb-6.8.50.20081128/gdb/target.c =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/target.c 2008-02-19 17:22:33.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/target.c 2008-02-20 13:36:17.000000000 +0100 -@@ -812,6 +812,25 @@ pop_target (void) - internal_error (__FILE__, __LINE__, _("failed internal consistency check")); +--- gdb-6.8.50.20081128.orig/gdb/target.c 2008-12-04 10:24:58.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/target.c 2008-12-04 10:29:07.000000000 +0100 +@@ -850,6 +850,25 @@ pop_all_targets (int quitting) + pop_all_targets_above (dummy_stratum, quitting); } +static int @@ -166,7 +166,7 @@ Index: gdb-6.8cvs20080219/gdb/target.c /* Using the objfile specified in OBJFILE, find the address for the current thread's thread-local storage with offset OFFSET. */ CORE_ADDR -@@ -893,7 +912,28 @@ target_translate_tls_address (struct obj +@@ -931,7 +950,28 @@ target_translate_tls_address (struct obj /* It wouldn't be wrong here to try a gdbarch method, too; finding TLS is an ABI-specific thing. But we don't do that yet. */ else @@ -177,13 +177,13 @@ Index: gdb-6.8cvs20080219/gdb/target.c + msymbol = lookup_minimal_symbol ("errno", NULL, NULL); + if (msymbol != NULL + && SYMBOL_VALUE_ADDRESS (msymbol) == offset -+ && (SYMBOL_BFD_SECTION (msymbol)->owner == objfile->obfd ++ && (SYMBOL_OBJ_SECTION (msymbol)->objfile == objfile + || (objfile->separate_debug_objfile != NULL -+ && SYMBOL_BFD_SECTION (msymbol)->owner -+ == objfile->separate_debug_objfile->obfd) ++ && SYMBOL_OBJ_SECTION (msymbol)->objfile ++ == objfile->separate_debug_objfile) + || (objfile->separate_debug_objfile_backlink != NULL -+ && SYMBOL_BFD_SECTION (msymbol)->owner -+ == objfile->separate_debug_objfile_backlink->obfd))) ++ && SYMBOL_OBJ_SECTION (msymbol)->objfile ++ == objfile->separate_debug_objfile_backlink))) + { + if (!catch_errors (resolve_errno, (void *) &addr, "", + RETURN_MASK_ALL)) @@ -196,22 +196,10 @@ Index: gdb-6.8cvs20080219/gdb/target.c return addr; } ---- ./gdb/elfread.c 2008-08-03 11:02:10.000000000 +0200 -+++ ./gdb/elfread.c 2008-08-03 11:01:21.000000000 +0200 -@@ -318,7 +318,8 @@ elf_symtab_read (struct objfile *objfile - /* Bfd symbols are section relative. */ - symaddr = sym->value + sym->section->vma; - /* Relocate all non-absolute symbols by the section offset. */ -- if (sym->section != &bfd_abs_section) -+ if (sym->section != &bfd_abs_section -+ && (sym->section->flags & SEC_THREAD_LOCAL) == 0) - { - symaddr += offset; - } -Index: gdb-6.8cvs20080219/gdb/testsuite/gdb.dwarf2/dw2-errno.c +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-errno.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8cvs20080219/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2008-02-20 13:35:19.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-errno.c 2008-12-04 10:26:40.000000000 +0100 @@ -0,0 +1,28 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -241,10 +229,10 @@ Index: gdb-6.8cvs20080219/gdb/testsuite/gdb.dwarf2/dw2-errno.c + + return 0; /* breakpoint */ +} -Index: gdb-6.8cvs20080219/gdb/testsuite/gdb.dwarf2/dw2-errno.exp +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-errno.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8cvs20080219/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2008-02-20 13:35:19.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-errno.exp 2008-12-04 10:26:40.000000000 +0100 @@ -0,0 +1,67 @@ +# Copyright 2007 Free Software Foundation, Inc. + diff --git a/gdb-6.5-bz190810-gdbserver-arch-advice.patch b/gdb-6.5-bz190810-gdbserver-arch-advice.patch index 607b34c..fa3653c 100644 --- a/gdb-6.5-bz190810-gdbserver-arch-advice.patch +++ b/gdb-6.5-bz190810-gdbserver-arch-advice.patch @@ -7,37 +7,23 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=190810 (remote_async_wait): Likewise. -Index: gdb-6.8/gdb/remote.c +Index: gdb-6.8.50.20081128/gdb/remote.c =================================================================== ---- gdb-6.8.orig/gdb/remote.c 2008-07-14 10:27:07.000000000 +0200 -+++ gdb-6.8/gdb/remote.c 2008-07-14 10:27:17.000000000 +0200 -@@ -3509,8 +3509,13 @@ Packet: '%s'\n"), - reg->regnum, regs); - } - -+ /* It may also occur on amd64 which defaults to 32-bit i386 -+ target. gdbserver(1) is not aware of the `set architecture' -+ name itself as it is not using libbfd. */ - if (*p++ != ';') -- error (_("Remote register badly formatted: %s\nhere: %s"), -+ error (_("Remote register badly formatted: %s\nhere: %s" -+ "\nTry to load the executable by `file' first," -+ "\nyou may also check `set/show architecture'."), - buf, p); +--- gdb-6.8.50.20081128.orig/gdb/remote.c 2008-12-09 16:59:51.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/remote.c 2008-12-09 17:00:04.000000000 +0100 +@@ -4329,8 +4329,13 @@ Packet: '%s'\n"), + VEC_safe_push (cached_reg_t, event->regcache, &cached_reg); } - } -@@ -3737,8 +3742,13 @@ Packet: '%s'\n"), - reg->regnum, regs); - } -+ /* It may also occur on amd64 which defaults to 32-bit i386 -+ target. gdbserver(1) is not aware of the `set architecture' -+ name itself as it is not using libbfd. */ - if (*p++ != ';') -- error (_("Remote register badly formatted: %s\nhere: %s"), -+ error (_("Remote register badly formatted: %s\nhere: %s" -+ "\nTry to load the executable by `file' first," -+ "\nyou may also check `set/show architecture'."), - buf, p); - } +- if (*p != ';') +- error (_("Remote register badly formatted: %s\nhere: %s"), ++ /* It may also occur on amd64 which defaults to 32-bit i386 ++ target. gdbserver(1) is not aware of the `set architecture' ++ name itself as it is not using libbfd. */ ++ if (*p != ';') ++ error (_("Remote register badly formatted: %s\nhere: %s" ++ "\nTry to load the executable by `file' first," ++ "\nyou may also check `set/show architecture'."), + buf, p); + ++p; } diff --git a/gdb-6.5-bz216711-clone-is-outermost.patch b/gdb-6.5-bz216711-clone-is-outermost.patch index e410bba..c8c25b5 100644 --- a/gdb-6.5-bz216711-clone-is-outermost.patch +++ b/gdb-6.5-bz216711-clone-is-outermost.patch @@ -1,5 +1,8 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711 +FIXME: This workaround should be dropped and +glibc/sysdeps/unix/sysv/linux/x86_64/clone.S should get CFI for the child +instead. 2006-12-17 Jan Kratochvil @@ -20,10 +23,10 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=216711 Port to GDB-6.7. -Index: gdb-6.7/gdb/amd64-linux-tdep.c +Index: gdb-6.8.50.20081128/gdb/amd64-linux-tdep.c =================================================================== ---- gdb-6.7.orig/gdb/amd64-linux-tdep.c 2007-08-23 20:08:26.000000000 +0200 -+++ gdb-6.7/gdb/amd64-linux-tdep.c 2007-10-16 15:57:03.000000000 +0200 +--- gdb-6.8.50.20081128.orig/gdb/amd64-linux-tdep.c 2008-12-08 10:56:17.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/amd64-linux-tdep.c 2008-12-08 21:11:08.000000000 +0100 @@ -234,6 +234,80 @@ amd64_linux_register_reggroup_p (struct /* Set the program counter for process PTID to PC. */ @@ -65,12 +68,12 @@ Index: gdb-6.7/gdb/amd64-linux-tdep.c +#define LINUX_CLONE_LEN (sizeof linux_clone_code) + +static int -+amd64_linux_clone_running (struct frame_info *next_frame) ++amd64_linux_clone_running (struct frame_info *this_frame) +{ -+ CORE_ADDR pc = frame_pc_unwind (next_frame); ++ CORE_ADDR pc = get_frame_pc (this_frame); + unsigned char buf[LINUX_CLONE_LEN]; + -+ if (!safe_frame_unwind_memory (next_frame, pc - LINUX_CLONE_LEN, buf, ++ if (!safe_frame_unwind_memory (this_frame, pc - LINUX_CLONE_LEN, buf, + LINUX_CLONE_LEN)) + return 0; + @@ -81,9 +84,9 @@ Index: gdb-6.7/gdb/amd64-linux-tdep.c +} + +static int -+amd64_linux_outermost_frame (struct frame_info *next_frame) ++amd64_linux_outermost_frame (struct frame_info *this_frame) +{ -+ CORE_ADDR pc = frame_pc_unwind (next_frame); ++ CORE_ADDR pc = get_frame_pc (this_frame); + char *name; + + find_pc_partial_function (pc, &name, NULL, NULL); @@ -97,7 +100,7 @@ Index: gdb-6.7/gdb/amd64-linux-tdep.c + subtle changes in specific glibc revisions. */ + if (name == NULL || strcmp (name, "clone") == 0 + || strcmp ("__clone", name) == 0) -+ return (amd64_linux_clone_running (next_frame) != 0); ++ return (amd64_linux_clone_running (this_frame) != 0); + + return 0; +} @@ -114,32 +117,32 @@ Index: gdb-6.7/gdb/amd64-linux-tdep.c /* GNU/Linux uses SVR4-style shared libraries. */ set_solib_svr4_fetch_link_map_offsets (gdbarch, svr4_lp64_fetch_link_map_offsets); -Index: gdb-6.7/gdb/amd64-tdep.c +Index: gdb-6.8.50.20081128/gdb/amd64-tdep.c =================================================================== ---- gdb-6.7.orig/gdb/amd64-tdep.c 2007-10-12 17:48:39.000000000 +0200 -+++ gdb-6.7/gdb/amd64-tdep.c 2007-10-16 15:57:03.000000000 +0200 -@@ -849,11 +849,16 @@ amd64_frame_this_id (struct frame_info * +--- gdb-6.8.50.20081128.orig/gdb/amd64-tdep.c 2008-12-08 10:56:17.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/amd64-tdep.c 2008-12-08 21:05:12.000000000 +0100 +@@ -1044,11 +1044,16 @@ amd64_frame_this_id (struct frame_info * { struct amd64_frame_cache *cache = - amd64_frame_cache (next_frame, this_cache); -+ struct gdbarch_tdep *tdep = gdbarch_tdep (current_gdbarch); + amd64_frame_cache (this_frame, this_cache); ++ struct gdbarch_tdep *tdep = gdbarch_tdep (get_frame_arch (this_frame)); /* This marks the outermost frame. */ if (cache->base == 0) return; + /* Detect OS dependent outermost frames; such as `clone'. */ -+ if (tdep->outermost_frame_p && tdep->outermost_frame_p (next_frame)) ++ if (tdep->outermost_frame_p && tdep->outermost_frame_p (this_frame)) + return; + (*this_id) = frame_id_build (cache->base + 16, cache->pc); } -Index: gdb-6.7/gdb/i386-tdep.c +Index: gdb-6.8.50.20081128/gdb/i386-tdep.c =================================================================== ---- gdb-6.7.orig/gdb/i386-tdep.c 2007-10-12 17:48:39.000000000 +0200 -+++ gdb-6.7/gdb/i386-tdep.c 2007-10-16 15:57:03.000000000 +0200 -@@ -2355,6 +2355,9 @@ i386_gdbarch_init (struct gdbarch_info i +--- gdb-6.8.50.20081128.orig/gdb/i386-tdep.c 2008-12-08 10:56:17.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/i386-tdep.c 2008-12-08 11:00:43.000000000 +0100 +@@ -2698,6 +2698,9 @@ i386_gdbarch_init (struct gdbarch_info i tdep->sc_pc_offset = -1; tdep->sc_sp_offset = -1; @@ -149,24 +152,24 @@ Index: gdb-6.7/gdb/i386-tdep.c /* The format used for `long double' on almost all i386 targets is the i387 extended floating-point format. In fact, of all targets in the GCC 2.95 tree, only OSF/1 does it different, and insists -Index: gdb-6.7/gdb/i386-tdep.h +Index: gdb-6.8.50.20081128/gdb/i386-tdep.h =================================================================== ---- gdb-6.7.orig/gdb/i386-tdep.h 2007-08-23 20:08:34.000000000 +0200 -+++ gdb-6.7/gdb/i386-tdep.h 2007-10-16 15:57:32.000000000 +0200 +--- gdb-6.8.50.20081128.orig/gdb/i386-tdep.h 2008-12-08 10:56:17.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/i386-tdep.h 2008-12-08 21:07:47.000000000 +0100 @@ -106,6 +106,9 @@ struct gdbarch_tdep /* ISA-specific data types. */ struct type *i386_mmx_type; struct type *i386_sse_type; + + /* Detect OS dependent outermost frames; such as `clone'. */ -+ int (*outermost_frame_p) (struct frame_info *next_frame); ++ int (*outermost_frame_p) (struct frame_info *this_frame); }; /* Floating-point registers. */ -Index: gdb-6.7/gdb/testsuite/gdb.threads/bt-clone-stop.c +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/bt-clone-stop.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.7/gdb/testsuite/gdb.threads/bt-clone-stop.c 2007-10-16 15:57:03.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/bt-clone-stop.c 2008-12-08 11:00:43.000000000 +0100 @@ -0,0 +1,39 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -207,10 +210,10 @@ Index: gdb-6.7/gdb/testsuite/gdb.threads/bt-clone-stop.c + for (;;) + pause(); +} -Index: gdb-6.7/gdb/testsuite/gdb.threads/bt-clone-stop.exp +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/bt-clone-stop.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.7/gdb/testsuite/gdb.threads/bt-clone-stop.exp 2007-10-16 15:57:03.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/bt-clone-stop.exp 2008-12-08 11:00:43.000000000 +0100 @@ -0,0 +1,61 @@ +# Copyright 2006 Free Software Foundation, Inc. + diff --git a/gdb-6.5-bz218379-ppc-solib-trampoline-fix.patch b/gdb-6.5-bz218379-ppc-solib-trampoline-fix.patch index b757aef..4fb26b0 100644 --- a/gdb-6.5-bz218379-ppc-solib-trampoline-fix.patch +++ b/gdb-6.5-bz218379-ppc-solib-trampoline-fix.patch @@ -1,19 +1,19 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379 -Index: gdb-6.6/gdb/minsyms.c +Index: gdb-6.8.50.20081128/gdb/minsyms.c =================================================================== ---- gdb-6.6.orig/gdb/minsyms.c 2007-01-20 13:53:48.000000000 +0100 -+++ gdb-6.6/gdb/minsyms.c 2007-01-20 13:58:47.000000000 +0100 -@@ -490,6 +490,11 @@ lookup_minimal_symbol_by_pc_section (COR +--- gdb-6.8.50.20081128.orig/gdb/minsyms.c 2008-10-01 18:56:52.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/minsyms.c 2008-12-02 23:24:27.000000000 +0100 +@@ -544,6 +544,11 @@ lookup_minimal_symbol_by_pc_section_1 (C don't fill the bfd_section member, so don't throw away symbols on those platforms. */ - && SYMBOL_BFD_SECTION (&msymbol[hi]) != NULL + && SYMBOL_OBJ_SECTION (&msymbol[hi]) != NULL + /* Don't ignore symbols for solib trampolines. -+ Limit its sideeffects - only for non-0 sized trampolines. -+ Red Hat Bug 200533 with its regression Bug 218379. */ ++ Limit its sideeffects - only for non-0 sized trampolines. ++ Red Hat Bug 200533 with its regression Bug 218379. */ + && (MSYMBOL_TYPE (&msymbol[hi]) != mst_solib_trampoline + || MSYMBOL_SIZE (&msymbol[hi])) - && (!matching_bfd_sections - (SYMBOL_BFD_SECTION (&msymbol[hi]), section))) + && (!matching_obj_sections + (SYMBOL_OBJ_SECTION (&msymbol[hi]), section))) { diff --git a/gdb-6.5-gcore-i386-on-amd64.patch b/gdb-6.5-gcore-i386-on-amd64.patch index 8b00198..90130fc 100644 --- a/gdb-6.5-gcore-i386-on-amd64.patch +++ b/gdb-6.5-gcore-i386-on-amd64.patch @@ -23,40 +23,10 @@ Port to GDB-6.8pre. -Index: gdb-6.8cvs20080219/gdb/Makefile.in +Index: gdb-6.8.50.20081128/gdb/amd64-linux-nat.c =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/Makefile.in 2008-02-19 16:52:21.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/Makefile.in 2008-02-20 13:39:08.000000000 +0100 -@@ -785,6 +785,7 @@ gdb_expat_h = gdb_expat.h - gdb_locale_h = gdb_locale.h - gdb_obstack_h = gdb_obstack.h $(obstack_h) - gdb_proc_service_h = gdb_proc_service.h $(gregset_h) -+gdb_procfs32_h = gdb_procfs32.h $(gdb_user32_h) - gdb_ptrace_h = gdb_ptrace.h - gdb_regex_h = gdb_regex.h $(xregex_h) - gdb_select_h = gdb_select.h -@@ -794,6 +795,7 @@ gdb_string_h = gdb_string.h - gdb_thread_db_h = gdb_thread_db.h - gdbthread_h = gdbthread.h $(breakpoint_h) $(frame_h) - gdbtypes_h = gdbtypes.h $(hashtab_h) -+gdb_user32_h = gdb_user32.h $(gdb_stdint_h) - gdb_vfork_h = gdb_vfork.h - gdb_wait_h = gdb_wait.h - glibc_tdep_h = glibc-tdep.h -@@ -1888,7 +1890,8 @@ amd64fbsd-tdep.o: amd64fbsd-tdep.c $(def - amd64-linux-nat.o: amd64-linux-nat.c $(defs_h) $(inferior_h) $(gdbcore_h) \ - $(regcache_h) $(linux_nat_h) $(gdb_assert_h) $(gdb_string_h) \ - $(gdb_proc_service_h) $(gregset_h) $(amd64_tdep_h) \ -- $(i386_linux_tdep_h) $(amd64_nat_h) $(amd64_linux_tdep_h) -+ $(i386_linux_tdep_h) $(amd64_nat_h) $(amd64_linux_tdep_h) \ -+ $(i387_tdep_h) $(elf_bfd_h) $(gdb_procfs32_h) - amd64-linux-tdep.o: amd64-linux-tdep.c $(defs_h) $(frame_h) $(gdbcore_h) \ - $(regcache_h) $(osabi_h) $(symtab_h) $(gdb_string_h) $(amd64_tdep_h) \ - $(solib_svr4_h) $(gdbtypes_h) $(reggroups_h) $(amd64_linux_tdep_h) -Index: gdb-6.8cvs20080219/gdb/amd64-linux-nat.c -=================================================================== ---- gdb-6.8cvs20080219.orig/gdb/amd64-linux-nat.c 2008-02-16 19:10:27.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/amd64-linux-nat.c 2008-02-20 13:39:08.000000000 +0100 +--- gdb-6.8.50.20081128.orig/gdb/amd64-linux-nat.c 2008-03-01 05:39:36.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/amd64-linux-nat.c 2008-12-02 23:06:16.000000000 +0100 @@ -50,6 +50,9 @@ #include "amd64-tdep.h" #include "i386-linux-tdep.h" @@ -200,7 +170,7 @@ Index: gdb-6.8cvs20080219/gdb/amd64-linux-nat.c /* Transfering the general-purpose registers between GDB, inferiors and core files. */ -@@ -429,6 +551,11 @@ _initialize_amd64_linux_nat (void) +@@ -431,6 +553,11 @@ _initialize_amd64_linux_nat (void) t->to_fetch_registers = amd64_linux_fetch_inferior_registers; t->to_store_registers = amd64_linux_store_inferior_registers; @@ -212,11 +182,11 @@ Index: gdb-6.8cvs20080219/gdb/amd64-linux-nat.c /* Register the target. */ linux_nat_add_target (t); linux_nat_set_new_thread (t, amd64_linux_new_thread); -Index: gdb-6.8cvs20080219/gdb/config.in +Index: gdb-6.8.50.20081128/gdb/config.in =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/config.in 2008-01-10 19:17:06.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/config.in 2008-02-20 13:39:08.000000000 +0100 -@@ -385,6 +385,9 @@ +--- gdb-6.8.50.20081128.orig/gdb/config.in 2008-08-06 21:41:31.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/config.in 2008-12-02 23:06:16.000000000 +0100 +@@ -456,6 +456,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_POLL_H @@ -226,7 +196,7 @@ Index: gdb-6.8cvs20080219/gdb/config.in /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PROCFS_H -@@ -412,6 +415,9 @@ +@@ -483,6 +486,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H @@ -236,14 +206,16 @@ Index: gdb-6.8cvs20080219/gdb/config.in /* Define to 1 if you have the header file. */ #undef HAVE_SYS_USER_H -Index: gdb-6.8cvs20080219/gdb/configure +Index: gdb-6.8.50.20081128/gdb/configure =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/configure 2008-02-14 23:03:56.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/configure 2008-02-20 13:39:08.000000000 +0100 -@@ -11140,6 +11140,157 @@ done - +--- gdb-6.8.50.20081128.orig/gdb/configure 2008-11-21 23:35:57.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/configure 2008-12-02 23:08:29.000000000 +0100 +@@ -12026,6 +12026,157 @@ _ACEOF + fi ++ ++ +for ac_header in sys/user32.h sys/procfs32.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -393,28 +365,26 @@ Index: gdb-6.8cvs20080219/gdb/configure + +done + -+ -+ - for ac_header in sys/wait.h wait.h - do - as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -Index: gdb-6.8cvs20080219/gdb/configure.ac + # elf_hp.h is for HP/UX 64-bit shared library support. + # FIXME: kettenis/20030102: In most cases we include these (ctype.h, time.h) + # unconditionally, so what's the point in checking these? +Index: gdb-6.8.50.20081128/gdb/configure.ac =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/configure.ac 2008-02-14 23:03:56.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/configure.ac 2008-02-20 13:39:08.000000000 +0100 -@@ -523,6 +523,7 @@ AC_CHECK_HEADERS(sys/user.h, [], [], - # include - #endif - ]) -+AC_CHECK_HEADERS(sys/user32.h sys/procfs32.h) - AC_CHECK_HEADERS(sys/wait.h wait.h) - AC_CHECK_HEADERS(termios.h termio.h sgtty.h) - AC_CHECK_HEADERS(unistd.h) -Index: gdb-6.8cvs20080219/gdb/gcore.c +--- gdb-6.8.50.20081128.orig/gdb/configure.ac 2008-11-21 23:35:58.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/configure.ac 2008-12-02 23:07:33.000000000 +0100 +@@ -686,6 +686,7 @@ AC_SUBST(PYTHON_CFLAGS) + AC_HEADER_DIRENT + AC_HEADER_STAT + AC_HEADER_STDC ++AC_CHECK_HEADERS([sys/user32.h sys/procfs32.h]) + # elf_hp.h is for HP/UX 64-bit shared library support. + # FIXME: kettenis/20030102: In most cases we include these (ctype.h, time.h) + # unconditionally, so what's the point in checking these? +Index: gdb-6.8.50.20081128/gdb/gcore.c =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/gcore.c 2008-02-19 16:52:21.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/gcore.c 2008-02-20 13:39:08.000000000 +0100 -@@ -317,6 +317,11 @@ gcore_create_callback (CORE_ADDR vaddr, +--- gdb-6.8.50.20081128.orig/gdb/gcore.c 2008-12-01 16:39:04.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/gcore.c 2008-12-02 23:06:16.000000000 +0100 +@@ -320,6 +320,11 @@ gcore_create_callback (CORE_ADDR vaddr, asection *osec; flagword flags = SEC_ALLOC | SEC_HAS_CONTENTS | SEC_LOAD; @@ -426,10 +396,10 @@ Index: gdb-6.8cvs20080219/gdb/gcore.c /* If the memory segment has no permissions set, ignore it, otherwise when we later try to access it for read/write, we'll get an error or jam the kernel. */ -Index: gdb-6.8cvs20080219/gdb/gdb_procfs32.h +Index: gdb-6.8.50.20081128/gdb/gdb_procfs32.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8cvs20080219/gdb/gdb_procfs32.h 2008-02-20 13:39:08.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/gdb_procfs32.h 2008-12-02 23:06:16.000000000 +0100 @@ -0,0 +1,128 @@ +#ifdef HAVE_SYS_PROCFS32_H +#include @@ -559,10 +529,10 @@ Index: gdb-6.8cvs20080219/gdb/gdb_procfs32.h +#endif /* _SYS_PROCFS32_H */ + +#endif /* HAVE_SYS_PROCFS32_H */ -Index: gdb-6.8cvs20080219/gdb/gdb_user32.h +Index: gdb-6.8.50.20081128/gdb/gdb_user32.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8cvs20080219/gdb/gdb_user32.h 2008-02-20 13:39:08.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/gdb_user32.h 2008-12-02 23:06:16.000000000 +0100 @@ -0,0 +1,108 @@ +#ifdef HAVE_SYS_USER32_H +#include @@ -672,11 +642,11 @@ Index: gdb-6.8cvs20080219/gdb/gdb_user32.h +#endif /* _SYS_USER32_H */ + +#endif /* HAVE_SYS_USER32_H */ -Index: gdb-6.8cvs20080219/gdb/linux-nat.c +Index: gdb-6.8.50.20081128/gdb/linux-nat.c =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/linux-nat.c 2008-02-19 17:27:21.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/linux-nat.c 2008-02-20 13:39:08.000000000 +0100 -@@ -104,6 +104,21 @@ static LONGEST (*super_xfer_partial) (st +--- gdb-6.8.50.20081128.orig/gdb/linux-nat.c 2008-12-02 22:15:53.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/linux-nat.c 2008-12-02 23:13:18.000000000 +0100 +@@ -209,6 +209,21 @@ static LONGEST (*super_xfer_partial) (st const gdb_byte *, ULONGEST, LONGEST); @@ -698,40 +668,29 @@ Index: gdb-6.8cvs20080219/gdb/linux-nat.c static int debug_linux_nat; static void show_debug_linux_nat (struct ui_file *file, int from_tty, -@@ -2716,11 +2731,11 @@ linux_nat_do_thread_registers (bfd *obfd +@@ -3470,7 +3485,7 @@ linux_nat_do_thread_registers (bfd *obfd else fill_gregset (regcache, &gregs, -1); - note_data = (char *) elfcore_write_prstatus (obfd, -- note_data, -- note_size, -- lwp, -- stop_signal, &gregs); + note_data = (char *) linux_elfcore_write_prstatus (obfd, -+ note_data, -+ note_size, -+ lwp, -+ stop_signal, &gregs); + note_data, + note_size, + lwp, +@@ -3520,10 +3535,10 @@ linux_nat_do_thread_registers (bfd *obfd + else + fill_fpregset (regcache, &fpregs, -1); - if (core_regset_p - && (regset = gdbarch_regset_from_core_section (gdbarch, ".reg2", -@@ -2731,10 +2746,11 @@ linux_nat_do_thread_registers (bfd *obfd - else - fill_fpregset (regcache, &fpregs, -1); +- note_data = (char *) elfcore_write_prfpreg (obfd, ++ note_data = (char *) linux_elfcore_write_prfpreg (obfd, + note_data, + note_size, +- &fpregs, sizeof (fpregs)); ++ &fpregs, sizeof (fpregs), regcache); + } -- note_data = (char *) elfcore_write_prfpreg (obfd, -- note_data, -- note_size, -- &fpregs, sizeof (fpregs)); -+ note_data = (char *) linux_elfcore_write_prfpreg (obfd, -+ note_data, -+ note_size, -+ &fpregs, sizeof (fpregs), -+ regcache); - - #ifdef FILL_FPXREGSET - if (core_regset_p -@@ -2828,9 +2844,9 @@ linux_nat_make_corefile_notes (bfd *obfd + return note_data; +@@ -3592,9 +3607,9 @@ linux_nat_make_corefile_notes (bfd *obfd psargs_end - string_end); } } @@ -744,11 +703,11 @@ Index: gdb-6.8cvs20080219/gdb/linux-nat.c } /* Dump information for threads. */ -Index: gdb-6.8cvs20080219/gdb/linux-nat.h +Index: gdb-6.8.50.20081128/gdb/linux-nat.h =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/linux-nat.h 2008-02-19 14:26:32.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/linux-nat.h 2008-02-20 13:39:37.000000000 +0100 -@@ -124,3 +124,12 @@ void linux_nat_switch_fork (ptid_t new_p +--- gdb-6.8.50.20081128.orig/gdb/linux-nat.h 2008-12-01 15:58:23.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/linux-nat.h 2008-12-02 23:06:16.000000000 +0100 +@@ -134,3 +134,12 @@ void linux_nat_switch_fork (ptid_t new_p /* Return the saved siginfo associated with PTID. */ struct siginfo *linux_nat_get_siginfo (ptid_t ptid); diff --git a/gdb-6.5-sharedlibrary-path.patch b/gdb-6.5-sharedlibrary-path.patch index b9afbd9..1fa213b 100644 --- a/gdb-6.5-sharedlibrary-path.patch +++ b/gdb-6.5-sharedlibrary-path.patch @@ -3,6 +3,9 @@ If you provided some relative path to the shared library, such as with then gdb would fail to match the shared library name during the TLS lookup. +Dropped the workaround/fix for gdb-6.8.50.20081128 - is it still needed? + + The testsuite needs `gdb-6.3-bz146810-solib_absolute_prefix_is_empty.patch'. The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'. @@ -20,57 +23,6 @@ The testsuite needs `gdb-6.5-tls-of-separate-debuginfo.patch'. Port to gdb-6.7.50.20080227. -Index: gdb-6.7.50.20080227/gdb/solib-svr4.c -=================================================================== ---- gdb-6.7.50.20080227.orig/gdb/solib-svr4.c 2008-02-27 08:59:06.000000000 +0100 -+++ gdb-6.7.50.20080227/gdb/solib-svr4.c 2008-02-27 09:00:44.000000000 +0100 -@@ -1017,10 +1017,14 @@ CORE_ADDR - svr4_fetch_objfile_link_map (struct objfile *objfile) - { - CORE_ADDR lm; -+ int resolve; - - if (locate_base () == 0) - return 0; /* failed somehow... */ - -+for (resolve = 0; resolve <= 1; resolve++) -+{ -+ - /* Position ourselves on the first link map. */ - lm = solib_svr4_r_map (); - while (lm) -@@ -1059,6 +1063,21 @@ svr4_fetch_objfile_link_map (struct objf - safe_strerror (errcode)); - else - { -+ /* solib_svr4_r_map() may contain relative pathnames while -+ `objfile->name' is absolute. */ -+ if (resolve && buffer && buffer[0] != '/') -+ { -+ char *absolute; -+ int fd; -+ -+ fd = solib_open (buffer, &absolute); -+ if (fd != -1) -+ { -+ make_cleanup (xfree, absolute); -+ buffer = absolute; -+ close (fd); -+ } -+ } - /* Is this the linkmap for the file we want? */ - /* If the file is not a shared library and has no name, - we are sure it is the main executable, so we return that. */ -@@ -1077,6 +1096,9 @@ svr4_fetch_objfile_link_map (struct objf - builtin_type_void_data_ptr); - do_cleanups (old_chain); - } -+ -+} /* resolve */ -+ - return 0; - } - Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/tls-sepdebug-main.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 5486277..a807fc4 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -47,9 +47,11 @@ Fix found by Denys Vlasenko . Fixes Red Hat Bug 459414. ---- ./gdb/Makefile.in 2008-08-21 00:29:46.000000000 +0200 -+++ ./gdb/Makefile.in 2008-08-21 00:28:43.000000000 +0200 -@@ -340,7 +340,7 @@ CONFIG_UNINSTALL = @CONFIG_UNINSTALL@ +Index: gdb-6.8.50.20081128/gdb/Makefile.in +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/Makefile.in 2008-12-04 10:33:25.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/Makefile.in 2008-12-04 10:34:31.000000000 +0100 +@@ -363,7 +363,7 @@ CONFIG_UNINSTALL = @CONFIG_UNINSTALL@ # your system doesn't have fcntl.h in /usr/include (which is where it # should be according to Posix). DEFS = @DEFS@ @@ -58,55 +60,19 @@ # MH_CFLAGS, if defined, has host-dependent CFLAGS from the config directory. GLOBAL_CFLAGS = $(MH_CFLAGS) -@@ -392,7 +392,7 @@ INSTALLED_LIBS=-lbfd -lreadline -lopcode +@@ -415,7 +415,7 @@ INSTALLED_LIBS=-lbfd -lreadline -lopcode CLIBS = $(SIM) $(READLINE) $(OPCODES) $(BFD) $(INTL) $(LIBIBERTY) $(LIBDECNUMBER) \ - $(XM_CLIBS) $(TM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \ + $(XM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \ $(LIBICONV) $(LIBEXPAT) \ -- $(LIBIBERTY) $(WIN32LIBS) -+ $(LIBIBERTY) $(WIN32LIBS) -lrpm - CDEPS = $(XM_CDEPS) $(TM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \ - $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) +- $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) ++ $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) -lrpm + CDEPS = $(XM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \ + $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU) -@@ -2029,7 +2029,8 @@ corelow.o: corelow.c $(defs_h) $(arch_ut - $(inferior_h) $(symtab_h) $(command_h) $(bfd_h) $(target_h) \ - $(gdbcore_h) $(gdbthread_h) $(regcache_h) $(regset_h) $(symfile_h) \ - $(exec_h) $(readline_h) $(gdb_assert_h) \ -- $(exceptions_h) $(solib_h) $(filenames_h) -+ $(exceptions_h) $(solib_h) $(filenames_h) $(auxv_h) $(elf_common_h) \ -+ $(objfiles_h) $(gdbcmd_h) - core-regset.o: core-regset.c $(defs_h) $(command_h) $(gdbcore_h) \ - $(inferior_h) $(target_h) $(regcache_h) $(gdb_string_h) $(gregset_h) - cp-abi.o: cp-abi.c $(defs_h) $(value_h) $(cp_abi_h) $(command_h) $(gdbcmd_h) \ -@@ -2117,7 +2118,7 @@ event-loop.o: event-loop.c $(defs_h) $(e - event-top.o: event-top.c $(defs_h) $(top_h) $(inferior_h) $(target_h) \ - $(terminal_h) $(event_loop_h) $(event_top_h) $(interps_h) \ - $(exceptions_h) $(cli_script_h) $(gdbcmd_h) $(readline_h) \ -- $(readline_history_h) -+ $(readline_history_h) $(symfile_h) - exceptions.o: exceptions.c $(defs_h) $(exceptions_h) $(breakpoint_h) \ - $(target_h) $(inferior_h) $(annotate_h) $(ui_out_h) $(gdb_assert_h) \ - $(gdb_string_h) $(serial_h) -@@ -2884,7 +2885,8 @@ symfile.o: symfile.c $(defs_h) $(bfdlink - $(gdb_stabs_h) $(gdb_obstack_h) $(completer_h) $(bcache_h) \ - $(hashtab_h) $(readline_h) $(gdb_assert_h) $(block_h) \ - $(gdb_string_h) $(gdb_stat_h) $(observer_h) $(exec_h) \ -- $(parser_defs_h) $(varobj_h) $(elf_bfd_h) $(solib_h) -+ $(parser_defs_h) $(varobj_h) $(elf_bfd_h) $(solib_h) $(gdb_stdint_h) \ -+ $(libbfd_h) $(elf_bfd_h) $(elf_external_h) - symfile-mem.o: symfile-mem.c $(defs_h) $(symtab_h) $(gdbcore_h) \ - $(objfiles_h) $(exceptions_h) $(gdbcmd_h) $(target_h) $(value_h) \ - $(symfile_h) $(observer_h) $(auxv_h) $(elf_common_h) -@@ -3325,7 +3327,7 @@ tui-hooks.o: $(srcdir)/tui/tui-hooks.c $ - tui-interp.o: $(srcdir)/tui/tui-interp.c $(defs_h) $(interps_h) $(top_h) \ - $(event_top_h) $(event_loop_h) $(ui_out_h) $(cli_out_h) \ - $(tui_data_h) $(readline_h) $(tui_win_h) $(tui_h) $(tui_io_h) \ -- $(exceptions_h) -+ $(exceptions_h) $(symfile_h) - $(CC) -c $(INTERNAL_CFLAGS) $(srcdir)/tui/tui-interp.c - tui-io.o: $(srcdir)/tui/tui-io.c $(defs_h) $(target_h) \ - $(event_loop_h) $(event_top_h) $(command_h) $(top_h) $(tui_h) \ ---- ./gdb/corelow.c 2008-02-09 14:45:33.000000000 +0100 -+++ ./gdb/corelow.c 2008-08-21 00:28:43.000000000 +0200 +Index: gdb-6.8.50.20081128/gdb/corelow.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/corelow.c 2008-11-09 12:27:17.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/corelow.c 2008-12-04 10:34:31.000000000 +0100 @@ -45,6 +45,10 @@ #include "exceptions.h" #include "solib.h" @@ -118,8 +84,8 @@ #ifndef O_LARGEFILE -@@ -248,6 +252,56 @@ add_to_thread_list (bfd *abfd, asection - inferior_ptid = pid_to_ptid (thread_id); /* Yes, make it current */ +@@ -262,6 +266,56 @@ add_to_thread_list (bfd *abfd, asection + inferior_ptid = ptid; /* Yes, make it current */ } +static int build_id_core_loads = 1; @@ -175,23 +141,20 @@ /* This routine opens and sets up the core file bfd. */ static void -@@ -344,6 +398,15 @@ core_open (char *filename, int from_tty) - ontop = !push_target (&core_ops); +@@ -358,6 +412,12 @@ core_open (char *filename, int from_tty) + push_target (&core_ops); discard_cleanups (old_chain); -+ if (ontop) -+ { -+ /* Find the build_id identifiers. If it gets executed after -+ POST_CREATE_INFERIOR we would clash with asking to discard the already -+ loaded VDSO symbols. */ -+ if (build_id_core_loads != 0) -+ build_id_locate_exec (from_tty); -+ } ++ /* Find the build_id identifiers. If it gets executed after ++ POST_CREATE_INFERIOR we would clash with asking to discard the already ++ loaded VDSO symbols. */ ++ if (build_id_core_loads != 0) ++ build_id_locate_exec (from_tty); + - /* This is done first, before anything has a chance to query the - inferior for information such as symbols. */ - post_create_inferior (&core_ops, from_tty); -@@ -692,4 +755,11 @@ _initialize_corelow (void) + add_inferior_silent (corelow_pid); + + /* Do this before acknowledging the inferior, so if +@@ -737,4 +797,11 @@ _initialize_corelow (void) if (!coreops_suppress_target) add_target (&core_ops); @@ -203,9 +166,11 @@ + NULL, NULL, NULL, + &setlist, &showlist); } ---- ./gdb/doc/gdb.texinfo 2008-08-21 00:29:46.000000000 +0200 -+++ ./gdb/doc/gdb.texinfo 2008-08-21 00:28:43.000000000 +0200 -@@ -12195,6 +12195,27 @@ information files. +Index: gdb-6.8.50.20081128/gdb/doc/gdb.texinfo +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/doc/gdb.texinfo 2008-12-04 10:34:04.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/doc/gdb.texinfo 2008-12-04 10:34:31.000000000 +0100 +@@ -13138,6 +13138,27 @@ information files. @end table @@ -233,17 +198,19 @@ @cindex @code{.gnu_debuglink} sections @cindex debug link sections A debug link is a special section of the executable file named ---- ./gdb/event-top.c 2008-01-01 23:53:09.000000000 +0100 -+++ ./gdb/event-top.c 2008-08-21 00:28:43.000000000 +0200 -@@ -31,6 +31,7 @@ - #include - #include "exceptions.h" +Index: gdb-6.8.50.20081128/gdb/event-top.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/event-top.c 2008-09-08 23:46:21.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/event-top.c 2008-12-04 10:34:31.000000000 +0100 +@@ -33,6 +33,7 @@ #include "cli/cli-script.h" /* for reset_command_nest_depth */ + #include "main.h" + #include "gdbthread.h" +#include "symfile.h" /* For dont_repeat() */ #include "gdbcmd.h" -@@ -192,6 +193,8 @@ cli_command_loop (void) +@@ -193,6 +194,8 @@ cli_command_loop (void) char *a_prompt; char *gdb_prompt = get_prompt (); @@ -252,7 +219,7 @@ /* Tell readline what the prompt to display is and what function it will need to call after a whole line is read. This also displays the first prompt. */ -@@ -263,6 +266,8 @@ display_gdb_prompt (char *new_prompt) +@@ -264,6 +267,8 @@ display_gdb_prompt (char *new_prompt) /* Reset the nesting depth used when trace-commands is set. */ reset_command_nest_depth (); @@ -261,9 +228,11 @@ /* Each interpreter has its own rules on displaying the command prompt. */ if (!current_interp_display_prompt_p ()) ---- ./gdb/solib-svr4.c 2008-08-21 00:29:46.000000000 +0200 -+++ ./gdb/solib-svr4.c 2008-08-21 00:28:43.000000000 +0200 -@@ -764,9 +764,33 @@ svr4_current_sos (void) +Index: gdb-6.8.50.20081128/gdb/solib-svr4.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/solib-svr4.c 2008-12-04 01:34:17.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/solib-svr4.c 2008-12-04 10:34:31.000000000 +0100 +@@ -999,9 +999,33 @@ svr4_current_sos (void) safe_strerror (errcode)); else { @@ -300,19 +269,20 @@ } xfree (buffer); ---- ./gdb/symfile.c 2008-08-21 00:29:46.000000000 +0200 -+++ ./gdb/symfile.c 2008-08-21 00:29:18.000000000 +0200 -@@ -53,6 +53,9 @@ - #include "varobj.h" +Index: gdb-6.8.50.20081128/gdb/symfile.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/symfile.c 2008-12-04 10:26:12.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/symfile.c 2008-12-04 10:36:18.000000000 +0100 +@@ -54,6 +54,8 @@ #include "elf-bfd.h" #include "solib.h" -+#include "gdb_stdint.h" + #include "remote.h" +#include "libbfd.h" +#include "elf/external.h" #include #include -@@ -61,6 +64,7 @@ +@@ -62,6 +64,7 @@ #include #include #include @@ -320,7 +290,7 @@ int (*deprecated_ui_load_progress_hook) (const char *section, unsigned long num); -@@ -1226,16 +1230,65 @@ symbol_file_clear (int from_tty) +@@ -1168,16 +1171,65 @@ symbol_file_clear (int from_tty) printf_unfiltered (_("No symbol file now.\n")); } @@ -388,7 +358,7 @@ { struct build_id *retval; -@@ -1251,6 +1304,348 @@ build_id_bfd_get (bfd *abfd) +@@ -1193,6 +1245,348 @@ build_id_bfd_get (bfd *abfd) return retval; } @@ -737,7 +707,7 @@ /* Return if FILENAME has NT_GNU_BUILD_ID matching the CHECK value. */ static int -@@ -1265,7 +1660,7 @@ build_id_verify (const char *filename, s +@@ -1210,7 +1604,7 @@ build_id_verify (const char *filename, s if (abfd == NULL) return 0; @@ -746,7 +716,7 @@ if (found == NULL) warning (_("File \"%s\" has no build-id, file skipped"), filename); -@@ -1281,8 +1676,9 @@ build_id_verify (const char *filename, s +@@ -1229,8 +1623,9 @@ build_id_verify (const char *filename, s return retval; } @@ -758,7 +728,7 @@ { char *link, *s, *retval = NULL; gdb_byte *data = build_id->data; -@@ -1290,7 +1686,9 @@ build_id_to_debug_filename (struct build +@@ -1238,7 +1633,9 @@ build_id_to_debug_filename (struct build /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */ link = xmalloc (strlen (debug_file_directory) + (sizeof "/.build-id/" - 1) + 1 @@ -769,7 +739,7 @@ s = link + sprintf (link, "%s/.build-id/", debug_file_directory); if (size > 0) { -@@ -1301,12 +1699,14 @@ build_id_to_debug_filename (struct build +@@ -1249,12 +1646,14 @@ build_id_to_debug_filename (struct build *s++ = '/'; while (size-- > 0) s += sprintf (s, "%02x", (unsigned) *data++); @@ -786,7 +756,7 @@ if (retval != NULL && !build_id_verify (retval, build_id)) { -@@ -1314,9 +1714,424 @@ build_id_to_debug_filename (struct build +@@ -1262,9 +1661,424 @@ build_id_to_debug_filename (struct build retval = NULL; } @@ -795,9 +765,9 @@ + else + xfree (link); + - return retval; - } - ++ return retval; ++} ++ +#include +#include +#include @@ -1083,9 +1053,9 @@ + + retval = obstack_alloc (&missing_filepair_obstack, size); + memset (retval, 0, size); -+ return retval; -+} -+ + return retval; + } + +static hashval_t +missing_filepair_hash_func (const struct missing_filepair *elem) +{ @@ -1120,7 +1090,7 @@ +} + +static void -+debug_print_executable_changed (void *unused) ++debug_print_executable_changed (void) +{ + missing_rpm_change (); + missing_filepair_change (); @@ -1211,7 +1181,7 @@ static char * get_debug_link_info (struct objfile *objfile, unsigned long *crc32_out) { -@@ -1402,32 +2231,36 @@ static char * +@@ -1347,32 +2161,36 @@ static char * find_separate_debug_file (struct objfile *objfile) { asection *sect; @@ -1237,9 +1207,8 @@ char *build_id_name; - build_id_name = build_id_to_debug_filename (build_id); -- free (build_id); + build_id_name = build_id_to_filename (build_id, &build_id_filename, 1); -+ xfree (build_id); + xfree (build_id); /* Prevent looping on a stripped .debug file. */ if (build_id_name != NULL && strcmp (build_id_name, objfile->name) == 0) { @@ -1257,7 +1226,7 @@ } basename = get_debug_link_info (objfile, &crc32); -@@ -1435,7 +2268,7 @@ find_separate_debug_file (struct objfile +@@ -1380,7 +2198,7 @@ find_separate_debug_file (struct objfile if (basename == NULL) /* There's no separate debug info, hence there's no way we could load it => no warning. */ @@ -1266,7 +1235,7 @@ dir = xstrdup (objfile->name); -@@ -1451,23 +2284,19 @@ find_separate_debug_file (struct objfile +@@ -1396,23 +2214,19 @@ find_separate_debug_file (struct objfile gdb_assert (i >= 0 && IS_DIR_SEPARATOR (dir[i])); dir[i+1] = '\0'; @@ -1297,7 +1266,7 @@ /* Then try in the subdirectory named DEBUG_SUBDIRECTORY. */ strcpy (debugfile, dir); -@@ -1476,11 +2305,7 @@ find_separate_debug_file (struct objfile +@@ -1421,11 +2235,7 @@ find_separate_debug_file (struct objfile strcat (debugfile, basename); if (separate_debug_file_exists (debugfile, crc32, objfile->name)) @@ -1310,7 +1279,7 @@ /* Then try in the global debugfile directory. */ strcpy (debugfile, debug_file_directory); -@@ -1489,11 +2314,7 @@ find_separate_debug_file (struct objfile +@@ -1434,11 +2244,7 @@ find_separate_debug_file (struct objfile strcat (debugfile, basename); if (separate_debug_file_exists (debugfile, crc32, objfile->name)) @@ -1323,7 +1292,7 @@ /* If the file is in the sysroot, try using its base path in the global debugfile directory. */ -@@ -1508,20 +2329,18 @@ find_separate_debug_file (struct objfile +@@ -1453,20 +2259,18 @@ find_separate_debug_file (struct objfile strcat (debugfile, basename); if (separate_debug_file_exists (debugfile, crc32, objfile->name)) @@ -1352,10 +1321,10 @@ } -@@ -4208,4 +5027,16 @@ the global debug-file directory prepende - NULL, - show_debug_file_directory, - &setlist, &showlist); +@@ -4196,4 +5000,16 @@ Show printing of symbol loading messages + NULL, + NULL, + &setprintlist, &showprintlist); + + add_setshow_zinteger_cmd ("build-id-verbose", no_class, &build_id_verbose, + _("\ @@ -1369,9 +1338,11 @@ + + observer_attach_executable_changed (debug_print_executable_changed); } ---- ./gdb/symfile.h 2008-02-03 23:13:29.000000000 +0100 -+++ ./gdb/symfile.h 2008-08-21 00:28:43.000000000 +0200 -@@ -358,6 +358,14 @@ extern int symfile_map_offsets_to_segmen +Index: gdb-6.8.50.20081128/gdb/symfile.h +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/symfile.h 2008-09-05 13:37:17.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/symfile.h 2008-12-04 10:34:31.000000000 +0100 +@@ -365,6 +365,14 @@ extern int symfile_map_offsets_to_segmen struct symfile_segment_data *get_symfile_segment_data (bfd *abfd); void free_symfile_segment_data (struct symfile_segment_data *data); @@ -1386,9 +1357,11 @@ /* From dwarf2read.c */ extern int dwarf2_has_info (struct objfile *); ---- ./gdb/testsuite/lib/gdb.exp 2008-08-21 00:29:46.000000000 +0200 -+++ ./gdb/testsuite/lib/gdb.exp 2008-08-21 00:28:43.000000000 +0200 -@@ -1199,6 +1199,16 @@ proc default_gdb_start { } { +Index: gdb-6.8.50.20081128/gdb/testsuite/lib/gdb.exp +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/lib/gdb.exp 2008-12-04 01:33:56.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/lib/gdb.exp 2008-12-04 10:34:31.000000000 +0100 +@@ -1227,6 +1227,16 @@ proc default_gdb_start { } { warning "Couldn't set the width to 0." } } @@ -1405,8 +1378,10 @@ return 0; } ---- ./gdb/tui/tui-interp.c 2008-01-01 23:53:22.000000000 +0100 -+++ ./gdb/tui/tui-interp.c 2008-08-21 00:28:43.000000000 +0200 +Index: gdb-6.8.50.20081128/gdb/tui/tui-interp.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/tui/tui-interp.c 2008-03-14 20:55:51.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/tui/tui-interp.c 2008-12-04 10:34:31.000000000 +0100 @@ -30,6 +30,7 @@ #include "tui/tui.h" #include "tui/tui-io.h" diff --git a/gdb-6.6-buildid-readnever-silent.patch b/gdb-6.6-buildid-readnever-silent.patch index 7f58c79..7197293 100644 --- a/gdb-6.6-buildid-readnever-silent.patch +++ b/gdb-6.6-buildid-readnever-silent.patch @@ -3,10 +3,11 @@ Suppress messages `(no debugging symbols found)' on the commandline option -readnever. -diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gdb/symfile.c ---- gdb-6.6-orig/gdb/symfile.c 2008-01-12 22:10:40.000000000 +0100 -+++ gdb-6.6/gdb/symfile.c 2008-01-22 02:15:46.000000000 +0100 -@@ -996,8 +996,10 @@ symbol_file_add_with_addrs_or_offsets (b +Index: gdb-6.8.50.20081128/gdb/symfile.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/symfile.c 2008-12-02 23:39:09.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/symfile.c 2008-12-02 23:52:23.000000000 +0100 +@@ -1028,8 +1028,10 @@ symbol_file_add_with_addrs_or_offsets (b /* If the file has its own symbol tables it has no separate debug info. `.dynsym'/`.symtab' go to MSYMBOLS, `.debug_info' goes to SYMTABS/PSYMTABS. @@ -19,17 +20,16 @@ diff -u -X /home/jkratoch/.diffi.list -rup gdb-6.6-orig/gdb/symfile.c gdb-6.6/gd debugfile = find_separate_debug_file (objfile); if (debugfile) { -@@ -1021,7 +1023,8 @@ symbol_file_add_with_addrs_or_offsets (b - xfree (debugfile); +@@ -1054,7 +1056,7 @@ symbol_file_add_with_addrs_or_offsets (b } -- if (!have_partial_symbols () && !have_full_symbols ()) -+ if (!readnever_symbol_files && !have_partial_symbols () -+ && !have_full_symbols ()) + if (!have_partial_symbols () && !have_full_symbols () +- && print_symbol_loading) ++ && print_symbol_loading && !readnever_symbol_files) { wrap_here (""); - printf_filtered (_("(no debugging symbols found)")); -@@ -2770,7 +2959,8 @@ reread_symbols (void) + printf_unfiltered (_("(no debugging symbols found)")); +@@ -3239,7 +3241,8 @@ reread_symbols (void) zero is OK since dbxread.c also does what it needs to do if objfile->global_psymbols.size is 0. */ (*objfile->sf->sym_read) (objfile, 0); diff --git a/gdb-6.6-bz225783-gdb-debuginfo-paths.patch b/gdb-6.6-bz225783-gdb-debuginfo-paths.patch index e39bb37..639bbcd 100644 --- a/gdb-6.6-bz225783-gdb-debuginfo-paths.patch +++ b/gdb-6.6-bz225783-gdb-debuginfo-paths.patch @@ -1,12 +1,14 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=225783 ---- gdb-6.6-orig/gdb/Makefile.in 2007-04-08 20:49:10.000000000 +0200 -+++ gdb-6.6/gdb/Makefile.in 2007-04-08 23:22:40.000000000 +0200 -@@ -1672,17 +1672,19 @@ po/$(PACKAGE).pot: force +Index: gdb-6.8.50.20081128/gdb/Makefile.in +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/Makefile.in 2008-12-02 23:06:16.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/Makefile.in 2008-12-02 23:28:02.000000000 +0100 +@@ -1490,8 +1490,10 @@ po/$(PACKAGE).pot: force .SUFFIXES: .y .l - .y.c: + .y.c: - $(SHELL) $(YLWRAP) $< y.tab.c $@.tmp -- $(YACC) $(YFLAGS) - -sed -e '/extern.*malloc/d' \ + rm -f $@ $@.tmp @@ -16,8 +18,9 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=225783 -e '/extern.*realloc/d' \ -e '/extern.*free/d' \ -e '/include.*malloc.h/d' \ - -e 's/\([^x]\)malloc/\1xmalloc/g' \ - -e 's/\([^x]\)realloc/\1xrealloc/g' \ +@@ -1500,9 +1502,9 @@ po/$(PACKAGE).pot: force + -e 's/\([ \t;,(]\)free\([ \t]*[&(),]\)/\1xfree\2/g' \ + -e 's/\([ \t;,(]\)free$$/\1xfree/g' \ -e '/^#line.*y.tab.c/d' \ - < $@.tmp > $@.new - -rm $@.tmp diff --git a/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch b/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch index a0c953e..928c7fb 100644 --- a/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +++ b/gdb-6.6-bz237572-ppc-atomic-sequence-test.patch @@ -3,8 +3,10 @@ * gdb.threads/atomic-seq-threaded.c, gdb.threads/atomic-seq-threaded.exp: New files. ---- /dev/null 1 Jan 1970 00:00:00 -0000 -+++ ./gdb/testsuite/gdb.threads/atomic-seq-threaded.c 25 Jun 2007 20:38:21 -0000 +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.c 2008-12-08 22:27:01.000000000 +0100 @@ -0,0 +1,171 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -177,8 +179,10 @@ + + return 0; /* _exit_ */ +} ---- /dev/null 1 Jan 1970 00:00:00 -0000 -+++ ./gdb/testsuite/gdb.threads/atomic-seq-threaded.exp 25 Jun 2007 20:38:21 -0000 +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/atomic-seq-threaded.exp 2008-12-08 22:31:01.000000000 +0100 @@ -0,0 +1,84 @@ +# atomic-seq-threaded.exp -- Test case for stepping over RISC atomic code seqs. +# This variant testcases the code for stepping another thread while skipping @@ -230,7 +234,7 @@ +# Pass after pthread_create () without any watchpoint active. +set line [gdb_get_line_number "_create_after_"] +gdb_test "tbreak $line" \ -+ "Breakpoint (\[0-9\]+) at .*$srcfile, line $line\..*" \ ++ "reakpoint (\[0-9\]+) at .*$srcfile, line $line\..*" \ + "set breakpoint after pthread_create ()" +gdb_test "c" \ + ".*/\\* _create_after_ \\*/.*" \ @@ -254,7 +258,7 @@ +# Critical code path is stepped through at this point. +set line [gdb_get_line_number "_exit_"] +gdb_test "tbreak $line" \ -+ "Breakpoint \[0-9\]+ at .*$srcfile, line $line\..*" \ ++ "reakpoint \[0-9\]+ at .*$srcfile, line $line\..*" \ + "set breakpoint at _exit_" +gdb_test "c" \ + ".*/\\* _exit_ \\*/.*" \ diff --git a/gdb-6.6-bz247354-leader-exit-fix.patch b/gdb-6.6-bz247354-leader-exit-fix.patch index 5d7c3af..37c61dd 100644 --- a/gdb-6.6-bz247354-leader-exit-fix.patch +++ b/gdb-6.6-bz247354-leader-exit-fix.patch @@ -10,11 +10,11 @@ Port to GDB-6.8pre. -Index: gdb-6.8cvs20080219/gdb/linux-nat.c +Index: gdb-6.8.50.20081209/gdb/linux-nat.c =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/linux-nat.c 2008-02-21 12:03:38.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/linux-nat.c 2008-02-21 12:05:01.000000000 +0100 -@@ -1570,6 +1570,31 @@ linux_handle_extended_wait (struct lwp_i +--- gdb-6.8.50.20081209.orig/gdb/linux-nat.c 2008-12-10 01:27:34.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/linux-nat.c 2008-12-10 01:28:14.000000000 +0100 +@@ -1981,6 +1981,31 @@ linux_handle_extended_wait (struct lwp_i _("unknown ptrace event %d"), event); } @@ -46,7 +46,7 @@ Index: gdb-6.8cvs20080219/gdb/linux-nat.c /* Wait for LP to stop. Returns the wait status, or 0 if the LWP has exited. */ -@@ -1577,16 +1602,31 @@ static int +@@ -1988,16 +2013,31 @@ static int wait_lwp (struct lwp_info *lp) { pid_t pid; @@ -82,23 +82,19 @@ Index: gdb-6.8cvs20080219/gdb/linux-nat.c if (pid == -1 && errno == ECHILD) { /* The thread has previously exited. We need to delete it -@@ -3451,10 +3491,12 @@ linux_proc_pending_signals (int pid, sig - fclose (procfile); +@@ -4153,8 +4193,10 @@ linux_nat_xfer_osdata (struct target_ops + return len; } +/* Transfer from the specific LWP currently set by PID of INFERIOR_PTID. */ + static LONGEST -linux_xfer_partial (struct target_ops *ops, enum target_object object, -- const char *annex, gdb_byte *readbuf, -- const gdb_byte *writebuf, ULONGEST offset, LONGEST len) +linux_xfer_partial_lwp (struct target_ops *ops, enum target_object object, -+ const char *annex, gdb_byte *readbuf, -+ const gdb_byte *writebuf, ULONGEST offset, LONGEST len) + const char *annex, gdb_byte *readbuf, + const gdb_byte *writebuf, ULONGEST offset, LONGEST len) { - LONGEST xfer; - -@@ -3495,6 +3537,45 @@ linux_xfer_partial (struct target_ops *o +@@ -4201,6 +4243,45 @@ linux_xfer_partial (struct target_ops *o offset, len); } diff --git a/gdb-6.6-multifork-debugreg.patch b/gdb-6.6-multifork-debugreg.patch index 16d80b1..d5914ca 100644 --- a/gdb-6.6-multifork-debugreg.patch +++ b/gdb-6.6-multifork-debugreg.patch @@ -28,10 +28,10 @@ http://sourceware.org/ml/gdb-patches/2008-01/msg00042.html * s390-nat.c (s390_fix_watch_points): Fix its compilation failure - rename it to S390_FIX_WATCH_POINTS_LIST. -Index: gdb-6.7.50.20080227/gdb/amd64-linux-nat.c +Index: gdb-6.8.50.20081128/gdb/amd64-linux-nat.c =================================================================== ---- gdb-6.7.50.20080227.orig/gdb/amd64-linux-nat.c 2008-03-01 10:38:02.000000000 +0100 -+++ gdb-6.7.50.20080227/gdb/amd64-linux-nat.c 2008-03-01 16:33:40.000000000 +0100 +--- gdb-6.8.50.20081128.orig/gdb/amd64-linux-nat.c 2008-12-07 10:09:19.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/amd64-linux-nat.c 2008-12-07 10:10:20.000000000 +0100 @@ -408,25 +408,43 @@ amd64_linux_dr_set (ptid_t ptid, int reg void amd64_linux_dr_set_control (unsigned long control) @@ -128,7 +128,7 @@ Index: gdb-6.7.50.20080227/gdb/amd64-linux-nat.c /* This function is called by libthread_db as part of its handling of -@@ -520,6 +573,41 @@ amd64_linux_child_post_startup_inferior +@@ -520,6 +573,43 @@ amd64_linux_child_post_startup_inferior i386_cleanup_dregs (); super_post_startup_inferior (ptid); } @@ -152,7 +152,9 @@ Index: gdb-6.7.50.20080227/gdb/amd64-linux-nat.c + parent_pid = ptid_get_lwp (last_ptid); + if (parent_pid == 0) + parent_pid = ptid_get_pid (last_ptid); -+ child_pid = last_status.value.related_pid; ++ child_pid = ptid_get_lwp (last_status.value.related_pid); ++ if (child_pid == 0) ++ child_pid = ptid_get_pid (last_status.value.related_pid); + + if (! follow_child) + { @@ -170,7 +172,7 @@ Index: gdb-6.7.50.20080227/gdb/amd64-linux-nat.c /* Provide a prototype to silence -Wmissing-prototypes. */ -@@ -556,6 +644,9 @@ _initialize_amd64_linux_nat (void) +@@ -558,6 +648,9 @@ _initialize_amd64_linux_nat (void) linux_elfcore_write_prstatus = amd64_linux_elfcore_write_prstatus; linux_elfcore_write_prfpreg = amd64_linux_elfcore_write_prfpreg; @@ -180,24 +182,24 @@ Index: gdb-6.7.50.20080227/gdb/amd64-linux-nat.c /* Register the target. */ linux_nat_add_target (t); linux_nat_set_new_thread (t, amd64_linux_new_thread); -Index: gdb-6.7.50.20080227/gdb/config/i386/nm-i386.h +Index: gdb-6.8.50.20081128/gdb/config/i386/nm-i386.h =================================================================== ---- gdb-6.7.50.20080227.orig/gdb/config/i386/nm-i386.h 2008-03-01 10:38:02.000000000 +0100 -+++ gdb-6.7.50.20080227/gdb/config/i386/nm-i386.h 2008-03-01 10:50:39.000000000 +0100 -@@ -110,6 +110,8 @@ extern int i386_stopped_by_watchpoint (v - #define target_remove_hw_breakpoint(bp_tgt) \ - i386_remove_hw_breakpoint (bp_tgt) +--- gdb-6.8.50.20081128.orig/gdb/config/i386/nm-i386.h 2008-03-01 05:39:36.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/config/i386/nm-i386.h 2008-12-07 10:09:20.000000000 +0100 +@@ -120,6 +120,8 @@ extern int i386_stopped_by_watchpoint (v + + #endif /* I386_WATCHPOINTS_IN_TARGET_VECTOR */ +extern void i386_detach_breakpoints (int detached_pid); + #endif /* I386_USE_GENERIC_WATCHPOINTS */ #endif /* NM_I386_H */ -Index: gdb-6.7.50.20080227/gdb/i386-linux-nat.c +Index: gdb-6.8.50.20081128/gdb/i386-linux-nat.c =================================================================== ---- gdb-6.7.50.20080227.orig/gdb/i386-linux-nat.c 2008-03-01 10:38:02.000000000 +0100 -+++ gdb-6.7.50.20080227/gdb/i386-linux-nat.c 2008-03-01 16:33:40.000000000 +0100 -@@ -655,21 +655,42 @@ i386_linux_dr_set_control (unsigned long +--- gdb-6.8.50.20081128.orig/gdb/i386-linux-nat.c 2008-03-13 13:22:13.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/i386-linux-nat.c 2008-12-07 10:09:20.000000000 +0100 +@@ -634,21 +634,42 @@ i386_linux_dr_set_control (unsigned long ptid_t ptid; i386_linux_dr[DR_CONTROL] = control; @@ -247,7 +249,7 @@ Index: gdb-6.7.50.20080227/gdb/i386-linux-nat.c } void -@@ -694,6 +715,41 @@ i386_linux_new_thread (ptid_t ptid) +@@ -673,6 +694,41 @@ i386_linux_new_thread (ptid_t ptid) i386_linux_dr_set (ptid, DR_CONTROL, i386_linux_dr[DR_CONTROL]); } @@ -289,7 +291,7 @@ Index: gdb-6.7.50.20080227/gdb/i386-linux-nat.c /* Called by libthread_db. Returns a pointer to the thread local -@@ -833,6 +889,40 @@ i386_linux_child_post_startup_inferior ( +@@ -812,6 +868,40 @@ i386_linux_child_post_startup_inferior ( super_post_startup_inferior (ptid); } @@ -312,7 +314,7 @@ Index: gdb-6.7.50.20080227/gdb/i386-linux-nat.c + parent_pid = ptid_get_lwp (last_ptid); + if (parent_pid == 0) + parent_pid = ptid_get_pid (last_ptid); -+ child_pid = last_status.value.related_pid; ++ child_pid = ptid_get_pid (last_status.value.related_pid); + + if (! follow_child) + { @@ -330,7 +332,7 @@ Index: gdb-6.7.50.20080227/gdb/i386-linux-nat.c void _initialize_i386_linux_nat (void) { -@@ -852,6 +942,9 @@ _initialize_i386_linux_nat (void) +@@ -833,6 +923,9 @@ _initialize_i386_linux_nat (void) t->to_fetch_registers = i386_linux_fetch_inferior_registers; t->to_store_registers = i386_linux_store_inferior_registers; @@ -340,11 +342,11 @@ Index: gdb-6.7.50.20080227/gdb/i386-linux-nat.c /* Register the target. */ linux_nat_add_target (t); linux_nat_set_new_thread (t, i386_linux_new_thread); -Index: gdb-6.7.50.20080227/gdb/i386-nat.c +Index: gdb-6.8.50.20081128/gdb/i386-nat.c =================================================================== ---- gdb-6.7.50.20080227.orig/gdb/i386-nat.c 2008-03-01 10:38:02.000000000 +0100 -+++ gdb-6.7.50.20080227/gdb/i386-nat.c 2008-03-01 10:50:39.000000000 +0100 -@@ -544,6 +544,17 @@ i386_remove_watchpoint (CORE_ADDR addr, +--- gdb-6.8.50.20081128.orig/gdb/i386-nat.c 2008-03-01 05:39:36.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/i386-nat.c 2008-12-07 10:09:20.000000000 +0100 +@@ -545,6 +545,17 @@ i386_remove_watchpoint (CORE_ADDR addr, return retval; } @@ -362,10 +364,10 @@ Index: gdb-6.7.50.20080227/gdb/i386-nat.c /* Return non-zero if we can watch a memory region that starts at address ADDR and whose length is LEN bytes. */ -Index: gdb-6.7.50.20080227/gdb/ia64-linux-nat.c +Index: gdb-6.8.50.20081128/gdb/ia64-linux-nat.c =================================================================== ---- gdb-6.7.50.20080227.orig/gdb/ia64-linux-nat.c 2008-03-01 10:38:02.000000000 +0100 -+++ gdb-6.7.50.20080227/gdb/ia64-linux-nat.c 2008-03-01 10:50:39.000000000 +0100 +--- gdb-6.8.50.20081128.orig/gdb/ia64-linux-nat.c 2008-12-07 10:06:03.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/ia64-linux-nat.c 2008-12-07 10:09:20.000000000 +0100 @@ -583,6 +583,12 @@ ia64_linux_insert_watchpoint (CORE_ADDR return 0; } @@ -437,7 +439,7 @@ Index: gdb-6.7.50.20080227/gdb/ia64-linux-nat.c + parent_pid = ptid_get_lwp (last_ptid); + if (parent_pid == 0) + parent_pid = ptid_get_pid (last_ptid); -+ child_pid = last_status.value.related_pid; ++ child_pid = ptid_get_pid (last_status.value.related_pid); + + if (! follow_child) + { @@ -465,11 +467,11 @@ Index: gdb-6.7.50.20080227/gdb/ia64-linux-nat.c /* Register the target. */ linux_nat_add_target (t); linux_nat_set_new_thread (t, ia64_linux_new_thread); -Index: gdb-6.7.50.20080227/gdb/ppc-linux-nat.c +Index: gdb-6.8.50.20081128/gdb/ppc-linux-nat.c =================================================================== ---- gdb-6.7.50.20080227.orig/gdb/ppc-linux-nat.c 2008-03-01 10:38:02.000000000 +0100 -+++ gdb-6.7.50.20080227/gdb/ppc-linux-nat.c 2008-03-01 10:50:39.000000000 +0100 -@@ -847,6 +847,12 @@ ppc_linux_insert_watchpoint (CORE_ADDR a +--- gdb-6.8.50.20081128.orig/gdb/ppc-linux-nat.c 2008-11-18 22:39:47.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/ppc-linux-nat.c 2008-12-07 10:09:20.000000000 +0100 +@@ -1118,6 +1118,12 @@ ppc_linux_insert_watchpoint (CORE_ADDR a return 0; } @@ -482,7 +484,7 @@ Index: gdb-6.7.50.20080227/gdb/ppc-linux-nat.c static int ppc_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw) { -@@ -854,6 +860,11 @@ ppc_linux_remove_watchpoint (CORE_ADDR a +@@ -1125,6 +1131,11 @@ ppc_linux_remove_watchpoint (CORE_ADDR a ptid_t ptid; long dabr_value = 0; @@ -494,7 +496,7 @@ Index: gdb-6.7.50.20080227/gdb/ppc-linux-nat.c saved_dabr_value = 0; ALL_LWPS (lp, ptid) if (ptrace (PTRACE_SET_DEBUGREG, TIDGET (ptid), 0, saved_dabr_value) < 0) -@@ -867,6 +878,15 @@ ppc_linux_new_thread (ptid_t ptid) +@@ -1138,6 +1149,15 @@ ppc_linux_new_thread (ptid_t ptid) ptrace (PTRACE_SET_DEBUGREG, TIDGET (ptid), 0, saved_dabr_value); } @@ -510,8 +512,8 @@ Index: gdb-6.7.50.20080227/gdb/ppc-linux-nat.c static int ppc_linux_stopped_data_address (struct target_ops *target, CORE_ADDR *addr_p) { -@@ -976,6 +996,40 @@ ppc_linux_read_description (struct targe - return NULL; +@@ -1318,6 +1338,40 @@ ppc_linux_read_description (struct targe + return isa205? tdesc_powerpc_isa205_32l : tdesc_powerpc_32l; } +static int (*ppc_linux_super_follow_fork) (struct target_ops *ops, @@ -533,7 +535,7 @@ Index: gdb-6.7.50.20080227/gdb/ppc-linux-nat.c + parent_pid = ptid_get_lwp (last_ptid); + if (parent_pid == 0) + parent_pid = ptid_get_pid (last_ptid); -+ child_pid = last_status.value.related_pid; ++ child_pid = ptid_get_pid (last_status.value.related_pid); + + if (! follow_child) + { @@ -551,7 +553,7 @@ Index: gdb-6.7.50.20080227/gdb/ppc-linux-nat.c void _initialize_ppc_linux_nat (void); void -@@ -1000,6 +1054,9 @@ _initialize_ppc_linux_nat (void) +@@ -1343,6 +1397,9 @@ _initialize_ppc_linux_nat (void) t->to_read_description = ppc_linux_read_description; @@ -561,10 +563,10 @@ Index: gdb-6.7.50.20080227/gdb/ppc-linux-nat.c /* Register the target. */ linux_nat_add_target (t); linux_nat_set_new_thread (t, ppc_linux_new_thread); -Index: gdb-6.7.50.20080227/gdb/s390-nat.c +Index: gdb-6.8.50.20081128/gdb/s390-nat.c =================================================================== ---- gdb-6.7.50.20080227.orig/gdb/s390-nat.c 2008-03-01 10:38:02.000000000 +0100 -+++ gdb-6.7.50.20080227/gdb/s390-nat.c 2008-03-01 10:50:39.000000000 +0100 +--- gdb-6.8.50.20081128.orig/gdb/s390-nat.c 2007-11-07 07:36:57.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/s390-nat.c 2008-12-07 10:09:20.000000000 +0100 @@ -283,21 +283,15 @@ s390_stopped_by_watchpoint (void) } @@ -642,7 +644,7 @@ Index: gdb-6.7.50.20080227/gdb/s390-nat.c for (parea = &watch_base; *parea; parea = &(*parea)->next) if ((*parea)->lo_addr == addr && (*parea)->hi_addr == addr + len - 1) -@@ -378,8 +378,10 @@ s390_remove_watchpoint (CORE_ADDR addr, +@@ -361,8 +378,10 @@ s390_remove_watchpoint (CORE_ADDR addr, if (!*parea) { @@ -653,7 +655,7 @@ Index: gdb-6.7.50.20080227/gdb/s390-nat.c return -1; } -@@ -375,6 +392,15 @@ s390_remove_watchpoint (CORE_ADDR addr, +@@ -375,6 +394,15 @@ s390_remove_watchpoint (CORE_ADDR addr, return 0; } @@ -669,7 +671,7 @@ Index: gdb-6.7.50.20080227/gdb/s390-nat.c static int s390_can_use_hw_breakpoint (int type, int cnt, int othertype) { -@@ -387,6 +413,39 @@ s390_region_ok_for_hw_watchpoint (CORE_A +@@ -387,6 +415,39 @@ s390_region_ok_for_hw_watchpoint (CORE_A return 1; } @@ -691,7 +693,7 @@ Index: gdb-6.7.50.20080227/gdb/s390-nat.c + parent_pid = ptid_get_lwp (last_ptid); + if (parent_pid == 0) + parent_pid = ptid_get_pid (last_ptid); -+ child_pid = last_status.value.related_pid; ++ child_pid = ptid_get_pid (last_status.value.related_pid); + + if (! follow_child) + { @@ -709,7 +711,7 @@ Index: gdb-6.7.50.20080227/gdb/s390-nat.c void _initialize_s390_nat (void); -@@ -410,6 +469,9 @@ _initialize_s390_nat (void) +@@ -410,6 +471,9 @@ _initialize_s390_nat (void) t->to_insert_watchpoint = s390_insert_watchpoint; t->to_remove_watchpoint = s390_remove_watchpoint; @@ -719,8 +721,10 @@ Index: gdb-6.7.50.20080227/gdb/s390-nat.c /* Register the target. */ linux_nat_add_target (t); linux_nat_set_new_thread (t, s390_fix_watch_points); ---- /dev/null 2008-03-30 17:41:11.547000906 -0400 -+++ gdb-6.8-patched/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c 2008-03-30 18:09:25.000000000 -0400 +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork-forkoff.c 2008-12-07 10:09:20.000000000 +0100 @@ -0,0 +1,172 @@ +/* Test case for forgotten hw-watchpoints after fork()-off of a process. + @@ -894,10 +898,10 @@ Index: gdb-6.7.50.20080227/gdb/s390-nat.c +#else +# error "!FOLLOW_PARENT && !FOLLOW_CHILD" +#endif -Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c 2008-03-01 10:50:39.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c 2008-12-07 10:09:20.000000000 +0100 @@ -0,0 +1,154 @@ +/* Test case for forgotten hw-watchpoints after fork()-off of a process. + @@ -1053,10 +1057,10 @@ Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork-mt.c + + return 0; +} -Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork.c +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork.c 2008-03-01 10:50:39.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork.c 2008-12-07 10:09:20.000000000 +0100 @@ -0,0 +1,56 @@ +/* Test case for forgotten hw-watchpoints after fork()-off of a process. + @@ -1114,10 +1118,10 @@ Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork.c + + return 0; +} -Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork.exp +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork.exp 2008-03-01 10:50:39.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/watchpoint-fork.exp 2008-12-07 10:09:20.000000000 +0100 @@ -0,0 +1,140 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -1259,11 +1263,11 @@ Index: gdb-6.7.50.20080227/gdb/testsuite/gdb.threads/watchpoint-fork.exp +if {[istarget "*-*-linux*"]} { + test child FOLLOW_CHILD +} -Index: gdb-6.7.50.20080227/gdb/doc/gdb.texinfo +Index: gdb-6.8.50.20081128/gdb/doc/gdb.texinfo =================================================================== ---- gdb-6.7.50.20080227.orig/gdb/doc/gdb.texinfo 2008-03-01 10:50:39.000000000 +0100 -+++ gdb-6.7.50.20080227/gdb/doc/gdb.texinfo 2008-03-01 10:50:39.000000000 +0100 -@@ -3386,6 +3386,14 @@ confident that no other thread can becom +--- gdb-6.8.50.20081128.orig/gdb/doc/gdb.texinfo 2008-12-07 10:09:20.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/doc/gdb.texinfo 2008-12-07 10:10:20.000000000 +0100 +@@ -3587,6 +3587,14 @@ confident that no other thread can becom software watchpoints as usual. However, @value{GDBN} may not notice when a non-current thread's activity changes the expression. (Hardware watchpoints, in contrast, watch an expression in all threads.) @@ -1278,11 +1282,11 @@ Index: gdb-6.7.50.20080227/gdb/doc/gdb.texinfo @end quotation @xref{set remote hardware-watchpoint-limit}. -Index: gdb-6.7.50.20080227/gdb/config/i386/nm-linux.h +Index: gdb-6.8.50.20081128/gdb/config/i386/nm-linux.h =================================================================== ---- gdb-6.7.50.20080227.orig/gdb/config/i386/nm-linux.h 2008-03-01 10:38:02.000000000 +0100 -+++ gdb-6.7.50.20080227/gdb/config/i386/nm-linux.h 2008-03-01 10:50:39.000000000 +0100 -@@ -44,6 +44,17 @@ extern void i386_linux_dr_reset_addr (in +--- gdb-6.8.50.20081128.orig/gdb/config/i386/nm-linux.h 2008-03-01 05:39:36.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/config/i386/nm-linux.h 2008-12-07 10:09:20.000000000 +0100 +@@ -45,6 +45,16 @@ extern void i386_linux_dr_reset_addr (in extern unsigned long i386_linux_dr_get_status (void); #define I386_DR_LOW_GET_STATUS() \ i386_linux_dr_get_status () @@ -1294,17 +1298,16 @@ Index: gdb-6.7.50.20080227/gdb/config/i386/nm-linux.h + +/* Override basic i386 macros for watchpoint and hardware breakpoint + insertion/removal to support threads. */ -+#undef target_remove_watchpoint +#define target_remove_watchpoint(addr, len, type) \ + i386_linux_remove_watchpoint (addr, len, type) #ifdef HAVE_PTRACE_GETFPXREGS -Index: gdb-6.7.50.20080227/gdb/config/i386/nm-linux64.h +Index: gdb-6.8.50.20081128/gdb/config/i386/nm-linux64.h =================================================================== ---- gdb-6.7.50.20080227.orig/gdb/config/i386/nm-linux64.h 2008-03-01 10:38:02.000000000 +0100 -+++ gdb-6.7.50.20080227/gdb/config/i386/nm-linux64.h 2008-03-01 10:50:39.000000000 +0100 -@@ -50,4 +50,15 @@ extern unsigned long amd64_linux_dr_get_ +--- gdb-6.8.50.20081128.orig/gdb/config/i386/nm-linux64.h 2008-03-01 05:39:36.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/config/i386/nm-linux64.h 2008-12-07 10:09:20.000000000 +0100 +@@ -51,4 +51,14 @@ extern unsigned long amd64_linux_dr_get_ #define I386_DR_LOW_GET_STATUS() \ amd64_linux_dr_get_status () @@ -1315,8 +1318,21 @@ Index: gdb-6.7.50.20080227/gdb/config/i386/nm-linux64.h + +/* Override basic amd64 macros for watchpoint and hardware breakpoint + insertion/removal to support threads. */ -+#undef target_remove_watchpoint +#define target_remove_watchpoint(addr, len, type) \ + amd64_linux_remove_watchpoint (addr, len, type) + #endif /* nm-linux64.h */ +Index: gdb-6.8.50.20081128/gdb/target.h +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/target.h 2008-12-07 10:09:19.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/target.h 2008-12-07 10:10:38.000000000 +0100 +@@ -1123,7 +1123,9 @@ extern char *normal_pid_to_str (ptid_t p + #ifndef target_insert_watchpoint + #define target_insert_watchpoint(addr, len, type) \ + (*current_target.to_insert_watchpoint) (addr, len, type) ++#endif + ++#ifndef target_remove_watchpoint + #define target_remove_watchpoint(addr, len, type) \ + (*current_target.to_remove_watchpoint) (addr, len, type) + #endif diff --git a/gdb-6.6-scheduler_locking-step-is-default.patch b/gdb-6.6-scheduler_locking-step-is-default.patch index 9637c7a..f1053e6 100644 --- a/gdb-6.6-scheduler_locking-step-is-default.patch +++ b/gdb-6.6-scheduler_locking-step-is-default.patch @@ -1,6 +1,8 @@ ---- ./gdb/infrun.c 22 Jun 2007 12:47:48 -0000 1.243 -+++ ./gdb/infrun.c 25 Jun 2007 20:43:18 -0000 -@@ -466,7 +467,7 @@ static const char *scheduler_enums[] = { +Index: gdb-6.8.50.20081128/gdb/infrun.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/infrun.c 2008-12-09 15:56:16.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/infrun.c 2008-12-09 15:56:59.000000000 +0100 +@@ -931,7 +931,7 @@ static const char *scheduler_enums[] = { schedlock_step, NULL }; @@ -9,3 +11,31 @@ static void show_scheduler_mode (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.mi/mi-console.exp +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.mi/mi-console.exp 2008-08-06 14:52:08.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.mi/mi-console.exp 2008-12-09 15:59:34.000000000 +0100 +@@ -47,6 +47,9 @@ if { [gdb_compile "${srcdir}/${subdir}/ + + mi_run_to_main + ++# thread-id=\"all\" vs. thread-id=\"1\" below: ++mi_gdb_test "210-gdb-set scheduler-locking off" "210\\^done" "set scheduler-locking off" ++ + # Next over the hello() call which will produce lots of output + mi_gdb_test "220-exec-next" \ + "220\\^running(\r\n\\*running,thread-id=\"all\")?" \ +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.mi/mi2-console.exp +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.mi/mi2-console.exp 2008-08-06 14:52:08.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.mi/mi2-console.exp 2008-12-09 16:00:33.000000000 +0100 +@@ -47,6 +47,9 @@ if { [gdb_compile "${srcdir}/${subdir}/ + + mi_run_to_main + ++# thread-id=\"all\" vs. thread-id=\"1\" below: ++mi_gdb_test "210-gdb-set scheduler-locking off" "210\\^done" "set scheduler-locking off" ++ + # Next over the hello() call which will produce lots of output + send_gdb "220-exec-next\n" + gdb_expect { diff --git a/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch b/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch index 090d38f..cdf9225 100644 --- a/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch +++ b/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch @@ -21,11 +21,11 @@ Port to GDB-6.8pre. -Index: gdb-6.8cvs20080219/gdb/inferior.h +Index: gdb-6.8.50.20081209/gdb/inferior.h =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/inferior.h 2008-02-14 23:03:57.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/inferior.h 2008-02-19 14:15:01.000000000 +0100 -@@ -179,7 +179,15 @@ extern void reopen_exec_file (void); +--- gdb-6.8.50.20081209.orig/gdb/inferior.h 2008-11-20 01:35:23.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/inferior.h 2008-12-10 01:22:23.000000000 +0100 +@@ -168,7 +168,15 @@ extern void reopen_exec_file (void); /* The `resume' routine should only be called in special circumstances. Normally, use `proceed', which handles a lot of bookkeeping. */ @@ -42,21 +42,20 @@ Index: gdb-6.8cvs20080219/gdb/inferior.h /* From misc files */ -Index: gdb-6.8cvs20080219/gdb/infrun.c +Index: gdb-6.8.50.20081209/gdb/infrun.c =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/infrun.c 2008-02-14 23:03:57.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/infrun.c 2008-02-19 14:24:37.000000000 +0100 -@@ -74,7 +74,8 @@ static void set_schedlock_func (char *ar +--- gdb-6.8.50.20081209.orig/gdb/infrun.c 2008-12-02 20:20:23.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/infrun.c 2008-12-10 01:23:46.000000000 +0100 +@@ -73,7 +73,7 @@ static int follow_fork (void); + static void set_schedlock_func (char *args, int from_tty, + struct cmd_list_element *c); - struct execution_control_state; +-static int currently_stepping (struct thread_info *tp); ++static enum resume_step currently_stepping (struct thread_info *tp); --static int currently_stepping (struct execution_control_state *ecs); -+static enum resume_step currently_stepping (struct execution_control_state -+ *ecs); + static int currently_stepping_callback (struct thread_info *tp, void *data); - static void xdb_handle_command (char *args, int from_tty); - -@@ -508,15 +509,18 @@ set_schedlock_func (char *args, int from +@@ -961,7 +961,7 @@ set_schedlock_func (char *args, int from STEP nonzero if we should step (zero to continue instead). SIG is the signal to give the inferior (zero for none). */ void @@ -65,50 +64,54 @@ Index: gdb-6.8cvs20080219/gdb/infrun.c { int should_resume = 1; struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0); +@@ -975,10 +975,12 @@ resume (int step, enum target_signal sig QUIT; if (debug_infrun) -- fprintf_unfiltered (gdb_stdlog, "infrun: resume (step=%d, signal=%d)\n", -- step, sig); -+ fprintf_unfiltered (gdb_stdlog, "infrun: resume (step=%s, signal=%d)\n", +- fprintf_unfiltered (gdb_stdlog, +- "infrun: resume (step=%d, signal=%d), " +- "trap_expected=%d\n", +- step, sig, tp->trap_expected); ++ fprintf_unfiltered (gdb_stdlog, "infrun: resume (step=%s, signal=%d), " ++ "trap_expected=%d\n", + (step == RESUME_STEP_CONTINUE ? "RESUME_STEP_CONTINUE" + : (step == RESUME_STEP_USER ? "RESUME_STEP_USER" + : "RESUME_STEP_NEEDED")), -+ sig); ++ sig, tp->trap_expected); - /* FIXME: calling breakpoint_here_p (read_pc ()) three times! */ - -@@ -632,9 +636,10 @@ a command like `return' or `jump' to con + /* Some targets (e.g. Solaris x86) have a kernel bug when stepping + over an instruction that causes a page fault without triggering +@@ -1127,9 +1129,10 @@ a command like `return' or `jump' to con + individually. */ resume_ptid = inferior_ptid; } - -- if ((scheduler_mode == schedlock_on) -+ if (scheduler_mode == schedlock_on - || (scheduler_mode == schedlock_step -- && (step || singlestep_breakpoints_inserted_p))) -+ && (step == RESUME_STEP_USER -+ || singlestep_breakpoints_inserted_p))) +- else if ((scheduler_mode == schedlock_on) ++ else if (scheduler_mode == schedlock_on + || (scheduler_mode == schedlock_step +- && (step || singlestep_breakpoints_inserted_p))) ++ && (step == RESUME_STEP_USER ++ || singlestep_breakpoints_inserted_p))) { /* User-settable 'scheduler' mode requires solo thread resume. */ resume_ptid = inferior_ptid; -@@ -742,7 +747,7 @@ static CORE_ADDR prev_pc; - void - proceed (CORE_ADDR addr, enum target_signal siggnal, int step) - { +@@ -1302,7 +1305,7 @@ proceed (CORE_ADDR addr, enum target_sig + struct gdbarch *gdbarch = get_regcache_arch (regcache); + struct thread_info *tp; + CORE_ADDR pc = regcache_read_pc (regcache); - int oneproc = 0; + enum resume_step resume_step = RESUME_STEP_CONTINUE; if (step > 0) - step_start_function = find_pc_function (read_pc ()); -@@ -756,13 +761,13 @@ proceed (CORE_ADDR addr, enum target_sig - step one instruction before inserting breakpoints so that - we do not stop right away (and report a second hit at this - breakpoint). */ + step_start_function = find_pc_function (pc); +@@ -1322,13 +1325,13 @@ proceed (CORE_ADDR addr, enum target_sig + actually be executing the breakpoint insn anyway. + We'll be (un-)executing the previous instruction. */ + - oneproc = 1; + resume_step = RESUME_STEP_USER; - else if (gdbarch_single_step_through_delay_p (current_gdbarch) - && gdbarch_single_step_through_delay (current_gdbarch, - get_current_frame ())) + else if (gdbarch_single_step_through_delay_p (gdbarch) + && gdbarch_single_step_through_delay (gdbarch, + get_current_frame ())) /* We stepped onto an instruction that needs to be stepped again before re-inserting the breakpoint, do so. */ - oneproc = 1; @@ -116,21 +119,25 @@ Index: gdb-6.8cvs20080219/gdb/infrun.c } else { -@@ -786,9 +791,9 @@ proceed (CORE_ADDR addr, enum target_sig - that reported the most recent event. If a step-over is required - it returns TRUE and sets the current thread to the old thread. */ - if (prepare_to_proceed (step)) -- oneproc = 1; -+ resume_step = RESUME_STEP_USER; +@@ -1359,13 +1362,13 @@ proceed (CORE_ADDR addr, enum target_sig + is required it returns TRUE and sets the current thread to + the old thread. */ + if (prepare_to_proceed (step)) +- oneproc = 1; ++ resume_step = RESUME_STEP_USER; + } + + /* prepare_to_proceed may change the current thread. */ + tp = inferior_thread (); - if (oneproc) + if (resume_step == RESUME_STEP_USER) - /* We will get a trace trap after one instruction. - Continue it automatically and insert breakpoints then. */ - stepping_over_breakpoint = 1; -@@ -832,8 +837,13 @@ proceed (CORE_ADDR addr, enum target_sig - updated correctly when the inferior is stopped. */ - prev_pc = read_pc (); + { + tp->trap_expected = 1; + /* If displaced stepping is enabled, we can step over the +@@ -1451,8 +1454,13 @@ proceed (CORE_ADDR addr, enum target_sig + /* Reset to normal state. */ + init_infwait_state (); + if (step) + resume_step = RESUME_STEP_USER; @@ -138,30 +145,21 @@ Index: gdb-6.8cvs20080219/gdb/infrun.c + resume_step = RESUME_STEP_NEEDED; + /* Resume inferior. */ -- resume (oneproc || step || bpstat_should_step (), stop_signal); -+ resume (resume_step, stop_signal); +- resume (oneproc || step || bpstat_should_step (), tp->stop_signal); ++ resume (resume_step, tp->stop_signal); /* Wait for it to stop (if not standalone) and in any case decode why it stopped, and act accordingly. */ -@@ -2723,14 +2733,21 @@ process_event_stop_test: - - /* Are we in the middle of stepping? */ +@@ -3690,10 +3698,16 @@ currently_stepping_callback (struct thre + return tp != data && currently_stepping_thread (tp); + } -static int +static enum resume_step - currently_stepping (struct execution_control_state *ecs) + currently_stepping (struct thread_info *tp) { -- return ((!ecs->handling_longjmp -- && ((step_range_end && step_resume_breakpoint == NULL) -- || stepping_over_breakpoint)) -- || ecs->stepping_through_solib_after_catch -- || bpstat_should_step ()); -+ if (!ecs->handling_longjmp -+ && ((step_range_end && step_resume_breakpoint == NULL) -+ || stepping_over_breakpoint)) -+ return RESUME_STEP_USER; -+ -+ if (ecs->stepping_through_solib_after_catch) +- return currently_stepping_thread (tp) || bpstat_should_step (); ++ if (currently_stepping_thread (tp)) + return RESUME_STEP_USER; + + if (bpstat_should_step ()) @@ -170,12 +168,12 @@ Index: gdb-6.8cvs20080219/gdb/infrun.c + return RESUME_STEP_CONTINUE; } - /* Subroutine call with source code we should not step over. Do step -Index: gdb-6.8cvs20080219/gdb/linux-nat.c + /* Inferior has stepped into a subroutine call with source code that +Index: gdb-6.8.50.20081209/gdb/linux-nat.c =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/linux-nat.c 2008-02-14 23:03:57.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/linux-nat.c 2008-02-19 14:15:01.000000000 +0100 -@@ -1751,7 +1751,10 @@ count_events_callback (struct lwp_info * +--- gdb-6.8.50.20081209.orig/gdb/linux-nat.c 2008-12-02 08:57:36.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/linux-nat.c 2008-12-10 01:22:23.000000000 +0100 +@@ -2343,7 +2343,10 @@ count_events_callback (struct lwp_info * static int select_singlestep_lwp_callback (struct lwp_info *lp, void *data) { @@ -187,10 +185,10 @@ Index: gdb-6.8cvs20080219/gdb/linux-nat.c return 1; else return 0; -Index: gdb-6.8cvs20080219/gdb/linux-nat.h +Index: gdb-6.8.50.20081209/gdb/linux-nat.h =================================================================== ---- gdb-6.8cvs20080219.orig/gdb/linux-nat.h 2008-02-14 23:03:58.000000000 +0100 -+++ gdb-6.8cvs20080219/gdb/linux-nat.h 2008-02-19 14:15:01.000000000 +0100 +--- gdb-6.8.50.20081209.orig/gdb/linux-nat.h 2008-07-27 23:12:40.000000000 +0200 ++++ gdb-6.8.50.20081209/gdb/linux-nat.h 2008-12-10 01:22:23.000000000 +0100 @@ -55,8 +55,8 @@ struct lwp_info /* If non-zero, a pending wait status. */ int status; diff --git a/gdb-6.6-step-thread-exit.patch b/gdb-6.6-step-thread-exit.patch index 7943daa..1953254 100644 --- a/gdb-6.6-step-thread-exit.patch +++ b/gdb-6.6-step-thread-exit.patch @@ -1,7 +1,8 @@ -diff -up -rup gdb-6.8-clean/gdb/linux-nat.c gdb-6.8-new/gdb/linux-nat.c ---- gdb-6.8-clean/gdb/linux-nat.c 2008-08-26 00:04:08.000000000 +0200 -+++ gdb-6.8-new/gdb/linux-nat.c 2008-08-26 00:04:50.000000000 +0200 -@@ -1083,15 +1083,17 @@ resume_set_callback (struct lwp_info *lp +Index: gdb-6.8.50.20081128/gdb/linux-nat.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/linux-nat.c 2008-12-04 01:44:26.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/linux-nat.c 2008-12-04 10:21:32.000000000 +0100 +@@ -1661,15 +1661,17 @@ resume_set_callback (struct lwp_info *lp } static void @@ -21,56 +22,40 @@ diff -up -rup gdb-6.8-clean/gdb/linux-nat.c gdb-6.8-new/gdb/linux-nat.c target_pid_to_str (ptid), signo ? strsignal (signo) : "0", target_pid_to_str (inferior_ptid)); -@@ -2076,6 +2078,9 @@ retry: - /* Check if the thread has exited. */ - if ((WIFEXITED (status) || WIFSIGNALED (status)) && num_lwps > 1) - { -+ enum resume_step step = lp->step; -+ pid_t pid = GET_PID (lp->ptid); +@@ -2586,6 +2588,9 @@ linux_nat_filter_event (int lwpid, int s + /* Check if the thread has exited. */ + if ((WIFEXITED (status) || WIFSIGNALED (status)) && num_lwps > 1) + { ++ enum resume_step step = lp->step; ++ pid_t pid = GET_PID (lp->ptid); + - /* If this is the main thread, we must stop all threads and - verify if they are still alive. This is because in the nptl - thread model, there is no signal issued for exiting LWPs -@@ -2096,6 +2101,10 @@ retry: - fprintf_unfiltered (gdb_stdlog, - "LLW: %s exited.\n", - target_pid_to_str (lp->ptid)); -+ /* Backward compatibility with: -+ gdb-6.3-step-thread-exit-20050211.patch */ -+ if (step == RESUME_STEP_USER) -+ printf_unfiltered ("[Stepped over thread exit]\n"); + /* If this is the main thread, we must stop all threads and + verify if they are still alive. This is because in the nptl + thread model, there is no signal issued for exiting LWPs +@@ -2609,6 +2614,26 @@ linux_nat_filter_event (int lwpid, int s - exit_lwp (lp); + exit_lwp (lp); -@@ -2104,8 +2113,29 @@ retry: - ignored. */ - if (num_lwps > 0) - { -- /* Make sure there is at least one thread running. */ -- gdb_assert (iterate_over_lwps (running_callback, NULL)); -+ if (step == RESUME_STEP_USER) -+ { -+ /* Now stop the closest LWP's ... */ -+ lp = find_lwp_pid (pid_to_ptid (pid)); -+ if (!lp) -+ lp = lwp_list; -+ errno = 0; -+ ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, -+ (void *) (unsigned long) SIGSTOP); -+ if (debug_linux_nat) -+ fprintf_unfiltered (gdb_stdlog, -+ "PTRACE_CONT %s, 0, 0 (%s)\n", -+ target_pid_to_str (lp->ptid), -+ errno ? safe_strerror (errno) -+ : "OK"); -+ /* Avoid the silent `delayed SIGSTOP' handling. */ -+ lp->signalled = 0; -+ } -+ else -+ { -+ /* Make sure there is at least one thread running. */ -+ gdb_assert (iterate_over_lwps (running_callback, NULL)); -+ } - - /* Discard the event. */ - status = 0; ++ if (step == RESUME_STEP_USER) ++ { ++ /* Now stop the closest LWP's ... */ ++ lp = find_lwp_pid (pid_to_ptid (pid)); ++ if (!lp) ++ lp = lwp_list; ++ gdb_assert (lp != NULL); ++ errno = 0; ++ ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, ++ (void *) (unsigned long) SIGSTOP); ++ if (debug_linux_nat) ++ fprintf_unfiltered (gdb_stdlog, ++ "PTRACE_CONT %s, 0, 0 (%s)\n", ++ target_pid_to_str (lp->ptid), ++ errno ? safe_strerror (errno) ++ : "OK"); ++ /* Avoid the silent `delayed SIGSTOP' handling. */ ++ lp->signalled = 0; ++ } ++ + /* If there is at least one more LWP, then the exit signal was + not the end of the debugged application and should be + ignored. */ diff --git a/gdb-6.6-vdso-i386-on-amd64-warning.patch b/gdb-6.6-vdso-i386-on-amd64-warning.patch deleted file mode 100644 index 47ac154..0000000 --- a/gdb-6.6-vdso-i386-on-amd64-warning.patch +++ /dev/null @@ -1,114 +0,0 @@ -Fix i386-on-x86_64 debugging giving the warning: - warning: Lowest section in system-supplied DSO at 0xffffe000 is .hash at ffffe0b4 - -[base] - -2007-10-16 Jan Kratochvil - - Port to GDB-6.7. - -Index: gdb-6.8/gdb/symfile.c -=================================================================== ---- gdb-6.8.orig/gdb/symfile.c 2008-07-14 10:28:15.000000000 +0200 -+++ gdb-6.8/gdb/symfile.c 2008-07-14 10:28:21.000000000 +0200 -@@ -715,6 +715,38 @@ default_symfile_segments (bfd *abfd) - return data; - } - -+/* Find lowest loadable section to be used as starting point for continguous -+ sections. FIXME!! won't work without call to find .text first, but this -+ assumes text is lowest section. vDSO was seen for i386-on-amd64 processes -+ to have no `.text' as it has `.text.vsyscall', `.text.sigreturn' etc. -+ instead. Execution of this function has been delayed till it is really -+ needed as it is broken for vDSOs, fortunately it is never needed on -+ GNU/Linux. */ -+ -+static CORE_ADDR -+find_lower_offset (struct objfile *objfile) -+{ -+ asection *lower_sect; -+ -+ lower_sect = bfd_get_section_by_name (objfile->obfd, ".text"); -+ if (lower_sect == NULL) -+ bfd_map_over_sections (objfile->obfd, find_lowest_section, -+ &lower_sect); -+ if (lower_sect == NULL) -+ warning (_("no loadable sections found in added symbol-file %s"), -+ objfile->name); -+ else -+ if ((bfd_get_section_flags (objfile->obfd, lower_sect) & SEC_CODE) == 0) -+ warning (_("Lowest section in %s is %s at %s"), -+ objfile->name, -+ bfd_section_name (objfile->obfd, lower_sect), -+ paddr (bfd_section_vma (objfile->obfd, lower_sect))); -+ if (lower_sect != NULL) -+ return bfd_section_vma (objfile->obfd, lower_sect); -+ else -+ return 0; -+} -+ - /* Process a symbol file, as either the main file or as a dynamically - loaded file. - -@@ -813,32 +845,11 @@ syms_from_objfile (struct objfile *objfi - happens for the PA64 port. */ - if (!mainline && addrs && addrs->other[0].name) - { -- asection *lower_sect; - asection *sect; -- CORE_ADDR lower_offset; -+ CORE_ADDR lower_offset = 0; /* Shut up the GCC warning. */ -+ int lower_offset_set = 0; - int i; - -- /* Find lowest loadable section to be used as starting point for -- continguous sections. FIXME!! won't work without call to find -- .text first, but this assumes text is lowest section. */ -- lower_sect = bfd_get_section_by_name (objfile->obfd, ".text"); -- if (lower_sect == NULL) -- bfd_map_over_sections (objfile->obfd, find_lowest_section, -- &lower_sect); -- if (lower_sect == NULL) -- warning (_("no loadable sections found in added symbol-file %s"), -- objfile->name); -- else -- if ((bfd_get_section_flags (objfile->obfd, lower_sect) & SEC_CODE) == 0) -- warning (_("Lowest section in %s is %s at %s"), -- objfile->name, -- bfd_section_name (objfile->obfd, lower_sect), -- paddr (bfd_section_vma (objfile->obfd, lower_sect))); -- if (lower_sect != NULL) -- lower_offset = bfd_section_vma (objfile->obfd, lower_sect); -- else -- lower_offset = 0; -- - /* Calculate offsets for the loadable sections. - FIXME! Sections must be in order of increasing loadable section - so that contiguous sections can use the lower-offset!!! -@@ -860,6 +871,7 @@ syms_from_objfile (struct objfile *objfi - addrs->other[i].addr - -= bfd_section_vma (objfile->obfd, sect); - lower_offset = addrs->other[i].addr; -+ lower_offset_set = 1; - /* This is the index used by BFD. */ - addrs->other[i].sectindex = sect->index ; - } -@@ -872,7 +884,17 @@ syms_from_objfile (struct objfile *objfi - } - } - else -- addrs->other[i].addr = lower_offset; -+ { -+ /* Delay finding LOWER_OFFSET only if it is needed. Otherwise -+ we would print a warning to detect a values never used. */ -+ if (!lower_offset_set) -+ { -+ lower_offset = find_lower_offset (objfile); -+ lower_offset_set = 1; -+ } -+ -+ addrs->other[i].addr = lower_offset; -+ } - } - } - diff --git a/gdb-6.7-reread-exec_bfd.patch b/gdb-6.7-reread-exec_bfd.patch deleted file mode 100644 index 99832b9..0000000 --- a/gdb-6.7-reread-exec_bfd.patch +++ /dev/null @@ -1,38 +0,0 @@ -2007-10-29 Jan Kratochvil - - * symfile.c (reread_symbols): Reread also EXEC_BFD if changed. - -2008-04-11 Jan Kratochvil - - * symfile.c (reread_symbols): Reload whole EXEC_BFD by the EXEC module - as its in-place patching did cause regressions. - -Testcase: Regressed by the gdb-6.7 version of `gdb-6.3-pie-20050110.patch': - Running ../../../gdb/testsuite/gdb.base/reread.exp ... - PASS: gdb.base/reread.exp: breakpoint foo in first file (PRMS 13484) - PASS: gdb.base/reread.exp: run to foo() (PRMS 13484) --PASS: gdb.base/reread.exp: run to foo() second time -+FAIL: gdb.base/reread.exp: run to foo() second time - PASS: gdb.base/reread.exp: second pass: breakpoint foo in first file --PASS: gdb.base/reread.exp: second pass: run to foo() --PASS: gdb.base/reread.exp: second pass: continue to completion --PASS: gdb.base/reread.exp: second pass: run to foo() second time -+FAIL: gdb.base/reread.exp: second pass: run to foo() -+FAIL: gdb.base/reread.exp: second pass: continue to completion -+FAIL: gdb.base/reread.exp: second pass: run to foo() second time - ---- gdb-6.7-orig/gdb/symfile.c 2007-10-29 01:04:35.000000000 +0100 -+++ gdb-6.7-patched/gdb/symfile.c 2007-10-29 01:03:13.000000000 +0100 -@@ -2810,6 +2810,12 @@ reread_symbols (void) - /* We need to do this whenever any symbols go away. */ - make_cleanup (clear_symtab_users_cleanup, 0 /*ignore*/); - -+ if (exec_bfd != NULL && strcmp (bfd_get_filename (objfile->obfd), -+ bfd_get_filename (exec_bfd)) == 0) -+ { -+ exec_ops.to_open (bfd_get_filename (objfile->obfd), 0); -+ } -+ - /* Clean up any state BFD has sitting around. We don't need - to close the descriptor but BFD lacks a way of closing the - BFD without closing the descriptor. */ diff --git a/gdb-6.7-testsuite-stable-results.patch b/gdb-6.7-testsuite-stable-results.patch index 43cd1ba..2952d78 100644 --- a/gdb-6.7-testsuite-stable-results.patch +++ b/gdb-6.7-testsuite-stable-results.patch @@ -91,39 +91,6 @@ -2008-04-21 Jan Kratochvil - - * ada-lang.c (get_selections): Variable PROMPT made non-const and - initialized with a trailing space now. Use PROMPT_ARG of - COMMAND_LINE_INPUT instead of printing it ourselves. - ---- ./gdb/ada-lang.c 6 Apr 2008 08:56:36 -0000 1.137 -+++ ./gdb/ada-lang.c 21 Apr 2008 13:33:42 -0000 -@@ -3424,18 +3424,15 @@ get_selections (int *choices, int n_choi - int is_all_choice, char *annotation_suffix) - { - char *args; -- const char *prompt; -+ char *prompt; - int n_chosen; - int first_choice = is_all_choice ? 2 : 1; - - prompt = getenv ("PS2"); - if (prompt == NULL) -- prompt = ">"; -+ prompt = "> "; - -- printf_unfiltered (("%s "), prompt); -- gdb_flush (gdb_stdout); -- -- args = command_line_input ((char *) NULL, 0, annotation_suffix); -+ args = command_line_input (prompt, 0, annotation_suffix); - - if (args == NULL) - error_no_arg (_("one or more choice numbers")); - - - Found on RHEL-5.s390x. --- sources/gdb/testsuite/gdb.base/dump.exp-orig 2008-08-28 11:44:40.000000000 +0200 diff --git a/gdb-6.8-attach-signalled-detach-stopped.patch b/gdb-6.8-attach-signalled-detach-stopped.patch index 2781a65..44728d6 100644 --- a/gdb-6.8-attach-signalled-detach-stopped.patch +++ b/gdb-6.8-attach-signalled-detach-stopped.patch @@ -1,7 +1,8 @@ -diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/linux-nat.c gdb-6.8/gdb/linux-nat.c ---- gdb-6.8-base/gdb/linux-nat.c 2008-08-27 18:09:35.000000000 +0200 -+++ gdb-6.8/gdb/linux-nat.c 2008-08-27 18:48:40.000000000 +0200 -@@ -117,6 +117,9 @@ +Index: gdb-6.8.50.20081128/gdb/linux-nat.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/linux-nat.c 2008-12-06 21:48:18.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/linux-nat.c 2008-12-06 22:00:42.000000000 +0100 +@@ -199,6 +199,9 @@ blocked. */ static struct target_ops *linux_ops; static struct target_ops linux_ops_saved; @@ -11,19 +12,23 @@ diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/linux-nat.c gdb /* The method to call, if any, when a new thread is attached. */ static void (*linux_nat_new_thread) (ptid_t); -@@ -531,6 +534,11 @@ linux_child_follow_fork (struct target_o +@@ -871,7 +874,14 @@ linux_child_follow_fork (struct target_o + fork_save_infrun_state (fp, 0); } else - { -+ /* We should check PID_WAS_STOPPED and detach it stopped accordingly. -+ In this point of code it cannot be 1 as we would not get FORK -+ executed without CONTINUE first which resets PID_WAS_STOPPED. -+ We would have to first TARGET_STOP and WAITPID it as with running -+ inferior PTRACE_DETACH, SIGSTOP will ignore the signal. */ - target_detach (NULL, 0); - } +- target_detach (NULL, 0); ++ { ++ /* We should check PID_WAS_STOPPED and detach it stopped accordingly. ++ In this point of code it cannot be 1 as we would not get FORK ++ executed without CONTINUE first which resets PID_WAS_STOPPED. ++ We would have to first TARGET_STOP and WAITPID it as with running ++ inferior PTRACE_DETACH, SIGSTOP will ignore the signal. */ ++ target_detach (NULL, 0); ++ } -@@ -936,6 +944,7 @@ linux_nat_post_attach_wait (ptid_t ptid, + inferior_ptid = ptid_build (child_pid, child_pid, 0); + add_inferior (child_pid); +@@ -1203,6 +1213,7 @@ linux_nat_post_attach_wait (ptid_t ptid, if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, "LNPAW: Attaching to a stopped process\n"); @@ -31,9 +36,9 @@ diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/linux-nat.c gdb /* The process is definitely stopped. It is in a job control stop, unless the kernel predates the TASK_STOPPED / -@@ -1128,6 +1137,9 @@ get_pending_status (struct lwp_info *lp, - else - *status = lp->status; +@@ -1535,6 +1546,9 @@ GPT: lwp %s had signal %s, but it is in + *status = lp->status; + } + if (*status == 0 && GET_PID (lp->ptid) == pid_was_stopped) + *status = W_STOPCODE (SIGSTOP); @@ -41,16 +46,16 @@ diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/linux-nat.c gdb return 0; } -@@ -1207,6 +1219,8 @@ linux_nat_detach (char *args, int from_t - - trap_ptid = null_ptid; +@@ -1631,6 +1645,8 @@ linux_nat_detach (struct target_ops *ops + inferior_ptid = pid_to_ptid (pid); + linux_ops->to_detach (ops, args, from_tty); + pid_was_stopped = 0; + - /* Destroy LWP info; it's no longer valid. */ - init_lwp_list (); - -@@ -1340,6 +1354,14 @@ linux_nat_resume (ptid_t ptid, int step, + if (target_can_async_p ()) + drain_queued_events (pid); + } +@@ -1787,6 +1803,14 @@ linux_nat_resume (ptid_t ptid, int step_ resume_callback. */ lp->stopped = 0; @@ -65,9 +70,19 @@ diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/linux-nat.c gdb if (resume_all) iterate_over_lwps (resume_callback, NULL); -diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.threads/attach-into-signal.c gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.c ---- gdb-6.8-base/gdb/testsuite/gdb.threads/attach-into-signal.c 2008-08-27 17:44:23.000000000 +0200 -+++ gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.c 2008-08-27 18:13:41.000000000 +0200 +@@ -3281,6 +3305,8 @@ linux_nat_mourn_inferior (struct target_ + there are other viable forks to debug. Delete the exiting + one and context-switch to the first available. */ + linux_fork_mourn_inferior (); ++ ++ pid_was_stopped = 0; + } + + static LONGEST +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attach-into-signal.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.threads/attach-into-signal.c 2008-05-01 20:50:14.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attach-into-signal.c 2008-12-06 21:57:23.000000000 +0100 @@ -1,19 +1,20 @@ /* This testcase is part of GDB, the GNU debugger. @@ -106,9 +121,10 @@ diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.t abort (); /* NOTREACHED */ -diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.threads/attach-into-signal.exp gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.exp ---- gdb-6.8-base/gdb/testsuite/gdb.threads/attach-into-signal.exp 2008-08-27 17:44:23.000000000 +0200 -+++ gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.exp 2008-08-27 18:13:41.000000000 +0200 +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attach-into-signal.exp +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.threads/attach-into-signal.exp 2008-05-01 20:50:14.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attach-into-signal.exp 2008-12-06 21:57:23.000000000 +0100 @@ -1,27 +1,29 @@ -# Copyright 2008 -# Free Software Foundation, Inc. @@ -240,9 +256,10 @@ diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.t -gdb_test "set debug lin-lwp 1" "" "" - corefunc threaded -diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.threads/attach-stopped.c gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.c ---- gdb-6.8-base/gdb/testsuite/gdb.threads/attach-stopped.c 2008-08-27 17:44:23.000000000 +0200 -+++ gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.c 2008-08-27 18:13:41.000000000 +0200 +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attach-stopped.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.threads/attach-stopped.c 2008-05-01 20:50:14.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attach-stopped.c 2008-12-06 21:57:23.000000000 +0100 @@ -1,19 +1,20 @@ /* This testcase is part of GDB, the GNU debugger. @@ -268,9 +285,10 @@ diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.t /* This program is intended to be started outside of gdb, then manually stopped via a signal. */ -diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.threads/attach-stopped.exp gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.exp ---- gdb-6.8-base/gdb/testsuite/gdb.threads/attach-stopped.exp 2008-08-27 17:44:23.000000000 +0200 -+++ gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.exp 2008-08-27 18:13:41.000000000 +0200 +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attach-stopped.exp +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2008-05-01 20:50:14.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attach-stopped.exp 2008-12-06 21:57:23.000000000 +0100 @@ -1,26 +1,33 @@ -# Copyright 2008 -# Free Software Foundation, Inc. @@ -380,9 +398,10 @@ diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.t set test "$threadtype: attach2 to stopped, after setting file" gdb_test_multiple "attach $testpid" "$test" { -diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.threads/attachstop-mt.c gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.c ---- gdb-6.8-base/gdb/testsuite/gdb.threads/attachstop-mt.c 2008-08-27 17:44:23.000000000 +0200 -+++ gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.c 2008-08-27 18:13:41.000000000 +0200 +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attachstop-mt.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.threads/attachstop-mt.c 2008-05-01 20:50:14.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attachstop-mt.c 2008-12-06 21:57:23.000000000 +0100 @@ -1,19 +1,20 @@ /* This testcase is part of GDB, the GNU debugger. @@ -408,52 +427,11 @@ diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.t /* This program is intended to be started outside of gdb, then manually stopped via a signal. */ -diff -up -u -X /home/jkratoch2/.diffi.list -rup gdb-6.8-base/gdb/testsuite/gdb.threads/attachstop-mt.exp gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.exp ---- gdb-6.8-base/gdb/testsuite/gdb.threads/attachstop-mt.exp 2008-08-27 17:44:23.000000000 +0200 -+++ gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.exp 2008-08-27 18:13:41.000000000 +0200 -@@ -1,26 +1,33 @@ --# Copyright 2008 --# Free Software Foundation, Inc. -+# Copyright 2006 - - # 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 -+# 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, see . -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - # This test was created by modifying gdb.threads/attachstop. - # This file was created by Jan Kratochvil . - # Regression for: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=197584 - -+if $tracelevel then { -+ strace $tracelevel -+} -+ -+set prms_id 0 -+set bug_id 0 -+ - # This test only works on Linux --if { ![isnative] || [is_remote host] || ![istarget *-linux*] } { -- continue -+if { ![istarget "*-*-linux-gnu*"] } { -+ return 0 - } - - set testfile "attachstop-mt" -@@ -169,12 +176,23 @@ gdb_test "bt" ".*sleep.*(func|main).*" " +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attachstop-mt.exp +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.threads/attachstop-mt.exp 2008-09-28 13:39:45.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.threads/attachstop-mt.exp 2008-12-06 21:57:23.000000000 +0100 +@@ -176,12 +176,23 @@ gdb_test "bt" ".*sleep.*(func|main).*" " # Exit and detach the process. gdb_exit diff --git a/gdb-6.8-attach-signalled-upstream.patch b/gdb-6.8-attach-signalled-upstream.patch deleted file mode 100644 index 3b6327d..0000000 --- a/gdb-6.8-attach-signalled-upstream.patch +++ /dev/null @@ -1,1260 +0,0 @@ -diff -up -ruNp gdb-6.8-orig/gdb/NEWS gdb-6.8/gdb/NEWS ---- gdb-6.8-orig/gdb/NEWS 2008-03-27 19:14:10.000000000 +0100 -+++ gdb-6.8/gdb/NEWS 2008-08-27 17:45:03.000000000 +0200 -@@ -1,6 +1,12 @@ - What has changed in GDB? - (Organized release by release) - -+*** Changes since GDB 6.8 -+ -+* On GNU/Linux, GDB can now attach to stopped processes. Several race -+conditions handling signals delivered during attach or thread creation -+have also been fixed. -+ - * Watchpoints can now be set on unreadable memory locations, e.g. addresses - which will be allocated using malloc later in program execution. - -diff -up -ruNp gdb-6.8-orig/gdb/infcmd.c gdb-6.8/gdb/infcmd.c ---- gdb-6.8-orig/gdb/infcmd.c 2008-01-31 14:37:21.000000000 +0100 -+++ gdb-6.8/gdb/infcmd.c 2008-08-27 17:45:31.000000000 +0200 -@@ -1972,36 +1971,38 @@ attach_command (char *args, int from_tty - * started via the normal ptrace (PTRACE_TRACEME). - */ - - static void - detach_command (char *args, int from_tty) - { - dont_repeat (); /* Not for the faint of heart. */ - target_detach (args, from_tty); - no_shared_libraries (NULL, from_tty); -+ init_thread_list (); - if (deprecated_detach_hook) - deprecated_detach_hook (); - } - - /* Disconnect from the current target without resuming it (leaving it - waiting for a debugger). - - We'd better not have left any breakpoints in the program or the - next debugger will get confused. Currently only supported for some - remote targets, since the normal attach mechanisms don't work on - stopped processes on some native platforms (e.g. GNU/Linux). */ - - static void - disconnect_command (char *args, int from_tty) - { - dont_repeat (); /* Not for the faint of heart */ - target_disconnect (args, from_tty); - no_shared_libraries (NULL, from_tty); -+ init_thread_list (); - if (deprecated_detach_hook) - deprecated_detach_hook (); - } - - /* Stop the execution of the target while running in async mode, in - the backgound. */ - void - interrupt_target_command (char *args, int from_tty) - { -diff -up -ruNp gdb-6.8-orig/gdb/infrun.c gdb-6.8/gdb/infrun.c ---- gdb-6.8-orig/gdb/infrun.c 2008-01-29 23:47:19.000000000 +0100 -+++ gdb-6.8/gdb/infrun.c 2008-08-27 17:44:23.000000000 +0200 -@@ -1966,13 +1966,15 @@ handle_inferior_event (struct execution_ - - /* This originates from attach_command(). We need to overwrite - the stop_signal here, because some kernels don't ignore a -- SIGSTOP in a subsequent ptrace(PTRACE_SONT,SOGSTOP) call. -- See more comments in inferior.h. */ -- if (stop_soon == STOP_QUIETLY_NO_SIGSTOP) -+ SIGSTOP in a subsequent ptrace(PTRACE_CONT,SIGSTOP) call. -+ See more comments in inferior.h. On the other hand, if we -+ get a non-SIGSTOP, report it to the user - assume the backend -+ will handle the SIGSTOP if it should show up later. */ -+ if (stop_soon == STOP_QUIETLY_NO_SIGSTOP -+ && stop_signal == TARGET_SIGNAL_STOP) - { - stop_stepping (ecs); -- if (stop_signal == TARGET_SIGNAL_STOP) -- stop_signal = TARGET_SIGNAL_0; -+ stop_signal = TARGET_SIGNAL_0; - return; - } - -@@ -2043,7 +2045,7 @@ process_event_stop_test: - target_terminal_ours_for_output (); - print_stop_reason (SIGNAL_RECEIVED, stop_signal); - } -- if (signal_stop[stop_signal]) -+ if (signal_stop_state (stop_signal)) - { - stop_stepping (ecs); - return; -@@ -3306,7 +3308,9 @@ hook_stop_stub (void *cmd) - int - signal_stop_state (int signo) - { -- return signal_stop[signo]; -+ /* Always stop on signals if we're just gaining control of the -+ program. */ -+ return signal_stop[signo] || stop_soon != NO_STOP_QUIETLY; - } - - int -diff -up -ruNp gdb-6.8-orig/gdb/linux-nat.c gdb-6.8/gdb/linux-nat.c ---- gdb-6.8-orig/gdb/linux-nat.c 2008-01-29 23:47:20.000000000 +0100 -+++ gdb-6.8/gdb/linux-nat.c 2008-08-27 18:00:22.000000000 +0200 -@@ -48,6 +48,30 @@ - #include /* for O_RDONLY */ - #include "gdb_procfs32.h" /* for struct elf_prpsinfo32 */ - -+/* Note on this file's use of signals: -+ -+ We stop threads by sending a SIGSTOP. The use of SIGSTOP instead -+ of another signal is not entirely significant; we just need for a -+ signal to be delivered, so that we can intercept it. SIGSTOP's -+ advantage is that it can not be blocked. A disadvantage is that it -+ is not a real-time signal, so it can only be queued once; we do not -+ keep track of other sources of SIGSTOP. -+ -+ Two other signals that can't be blocked are SIGCONT and SIGKILL. -+ But we can't use them, because they have special behavior when the -+ signal is generated - not when it is delivered. SIGCONT resumes -+ the entire thread group and SIGKILL kills the entire thread group. -+ -+ A delivered SIGSTOP would stop the entire thread group, not just the -+ thread we tkill'd. But we never let the SIGSTOP deliver; we always -+ intercept and cancel it (by PTRACE_CONT without passing SIGSTOP). -+ -+ We could use a real-time signal instead. This would solve those -+ problems; we could use PTRACE_GETSIGINFO to locate the specific -+ stop signals sent by GDB. But we would still have to have some -+ support for SIGSTOP, since PTRACE_ATTACH generates it, and there -+ are races with trying to find a signal that is not blocked. */ -+ - #ifndef O_LARGEFILE - #define O_LARGEFILE 0 - #endif -@@ -624,6 +648,7 @@ static sigset_t blocked_mask; - static int stop_wait_callback (struct lwp_info *lp, void *data); - static int linux_nat_thread_alive (ptid_t ptid); - static char *linux_child_pid_to_exec_file (int pid); -+static int kill_lwp (int lwpid, int signo); - - /* Convert wait status STATUS to a string. Used for printing debug - messages only. */ -@@ -865,10 +890,103 @@ exit_lwp (struct lwp_info *lp) - delete_lwp (lp->ptid); - } - --/* Attach to the LWP specified by PID. If VERBOSE is non-zero, print -- a message telling the user that a new LWP has been added to the -- process. Return 0 if successful or -1 if the new LWP could not -- be attached. */ -+/* Detect `T (stopped)' in `/proc/PID/status'. -+ Other states including `T (tracing stop)' are reported as false. */ -+ -+static int -+pid_is_stopped (pid_t pid) -+{ -+ FILE *status_file; -+ char buf[100]; -+ int retval = 0; -+ -+ snprintf (buf, sizeof (buf), "/proc/%d/status", (int) pid); -+ status_file = fopen (buf, "r"); -+ if (status_file != NULL) -+ { -+ int have_state = 0; -+ -+ while (fgets (buf, sizeof (buf), status_file)) -+ { -+ if (strncmp (buf, "State:", 6) == 0) -+ { -+ have_state = 1; -+ break; -+ } -+ } -+ if (have_state && strstr (buf, "T (stopped)") != NULL) -+ retval = 1; -+ fclose (status_file); -+ } -+ return retval; -+} -+ -+/* Wait for the LWP specified by LP, which we have just attached to. -+ Returns a wait status for that LWP, to cache. */ -+ -+static int -+linux_nat_post_attach_wait (ptid_t ptid, int first, int *cloned, -+ int *signalled) -+{ -+ pid_t new_pid, pid = GET_LWP (ptid); -+ int status; -+ -+ if (pid_is_stopped (pid)) -+ { -+ if (debug_linux_nat) -+ fprintf_unfiltered (gdb_stdlog, -+ "LNPAW: Attaching to a stopped process\n"); -+ -+ /* The process is definitely stopped. It is in a job control -+ stop, unless the kernel predates the TASK_STOPPED / -+ TASK_TRACED distinction, in which case it might be in a -+ ptrace stop. Make sure it is in a ptrace stop; from there we -+ can kill it, signal it, et cetera. -+ -+ First make sure there is a pending SIGSTOP. Since we are -+ already attached, the process can not transition from stopped -+ to running without a PTRACE_CONT; so we know this signal will -+ go into the queue. The SIGSTOP generated by PTRACE_ATTACH is -+ probably already in the queue (unless this kernel is old -+ enough to use TASK_STOPPED for ptrace stops); but since SIGSTOP -+ is not an RT signal, it can only be queued once. */ -+ kill_lwp (pid, SIGSTOP); -+ -+ /* Finally, resume the stopped process. This will deliver the SIGSTOP -+ (or a higher priority signal, just like normal PTRACE_ATTACH). */ -+ ptrace (PTRACE_CONT, pid, 0, 0); -+ } -+ -+ /* Make sure the initial process is stopped. The user-level threads -+ layer might want to poke around in the inferior, and that won't -+ work if things haven't stabilized yet. */ -+ new_pid = my_waitpid (pid, &status, 0); -+ if (new_pid == -1 && errno == ECHILD) -+ { -+ if (first) -+ warning (_("%s is a cloned process"), target_pid_to_str (ptid)); -+ -+ /* Try again with __WCLONE to check cloned processes. */ -+ new_pid = my_waitpid (pid, &status, __WCLONE); -+ *cloned = 1; -+ } -+ -+ gdb_assert (pid == new_pid && WIFSTOPPED (status)); -+ -+ if (WSTOPSIG (status) != SIGSTOP) -+ { -+ *signalled = 1; -+ if (debug_linux_nat) -+ fprintf_unfiltered (gdb_stdlog, -+ "LNPAW: Received %s after attaching\n", -+ status_to_str (status)); -+ } -+ -+ return status; -+} -+ -+/* Attach to the LWP specified by PID. Return 0 if successful or -1 -+ if the new LWP could not be attached. */ - - int - lin_lwp_attach_lwp (ptid_t ptid) -@@ -895,9 +1013,7 @@ lin_lwp_attach_lwp (ptid_t ptid) - to happen. */ - if (GET_LWP (ptid) != GET_PID (ptid) && lp == NULL) - { -- pid_t pid; -- int status; -- int cloned = 0; -+ int status, cloned = 0, signalled = 0; - - if (ptrace (PTRACE_ATTACH, GET_LWP (ptid), 0, 0) < 0) - { -@@ -916,24 +1032,18 @@ lin_lwp_attach_lwp (ptid_t ptid) - "LLAL: PTRACE_ATTACH %s, 0, 0 (OK)\n", - target_pid_to_str (ptid)); - -- pid = my_waitpid (GET_LWP (ptid), &status, 0); -- if (pid == -1 && errno == ECHILD) -+ status = linux_nat_post_attach_wait (ptid, 0, &cloned, &signalled); -+ lp = add_lwp (ptid); -+ lp->stopped = 1; -+ lp->cloned = cloned; -+ lp->signalled = signalled; -+ if (WSTOPSIG (status) != SIGSTOP) - { -- /* Try again with __WCLONE to check cloned processes. */ -- pid = my_waitpid (GET_LWP (ptid), &status, __WCLONE); -- cloned = 1; -+ lp->resumed = 1; -+ lp->status = status; - } - -- gdb_assert (pid == GET_LWP (ptid) -- && WIFSTOPPED (status) && WSTOPSIG (status)); -- -- if (lp == NULL) -- lp = add_lwp (ptid); -- lp->cloned = cloned; -- -- target_post_attach (pid); -- -- lp->stopped = 1; -+ target_post_attach (GET_LWP (lp->ptid)); - - if (debug_linux_nat) - { -@@ -963,45 +1073,62 @@ static void - linux_nat_attach (char *args, int from_tty) - { - struct lwp_info *lp; -- pid_t pid; - int status; -- int cloned = 0; - - /* FIXME: We should probably accept a list of process id's, and - attach all of them. */ - linux_ops->to_attach (args, from_tty); - -- /* Make sure the initial process is stopped. The user-level threads -- layer might want to poke around in the inferior, and that won't -- work if things haven't stabilized yet. */ -- pid = my_waitpid (GET_PID (inferior_ptid), &status, 0); -- if (pid == -1 && errno == ECHILD) -- { -- warning (_("%s is a cloned process"), target_pid_to_str (inferior_ptid)); -- -- /* Try again with __WCLONE to check cloned processes. */ -- pid = my_waitpid (GET_PID (inferior_ptid), &status, __WCLONE); -- cloned = 1; -- } -- -- gdb_assert (pid == GET_PID (inferior_ptid) -- && WIFSTOPPED (status) && WSTOPSIG (status) == SIGSTOP); -- - /* Add the initial process as the first LWP to the list. */ - inferior_ptid = BUILD_LWP (GET_PID (inferior_ptid), GET_PID (inferior_ptid)); - lp = add_lwp (inferior_ptid); -- lp->cloned = cloned; - -+ status = linux_nat_post_attach_wait (lp->ptid, 1, &lp->cloned, -+ &lp->signalled); - lp->stopped = 1; - -- /* Fake the SIGSTOP that core GDB expects. */ -- lp->status = W_STOPCODE (SIGSTOP); -+ /* Save the wait status to report later. */ - lp->resumed = 1; - if (debug_linux_nat) -+ fprintf_unfiltered (gdb_stdlog, -+ "LNA: waitpid %ld, saving status %s\n", -+ (long) GET_PID (lp->ptid), status_to_str (status)); -+ -+ lp->status = status; -+ if (debug_linux_nat) - { - fprintf_unfiltered (gdb_stdlog, -- "LLA: waitpid %ld, faking SIGSTOP\n", (long) pid); -+ "LLA: waitpid %ld, faking SIGSTOP\n", -+ (long) GET_PID (lp->ptid)); -+ } -+} -+ -+/* Get pending status of LP. */ -+static int -+get_pending_status (struct lwp_info *lp, int *status) -+{ -+ struct target_waitstatus last; -+ ptid_t last_ptid; -+ -+ get_last_target_status (&last_ptid, &last); -+ -+ /* If this lwp is the ptid that GDB is processing an event from, the -+ signal will be in stop_signal. Otherwise, in all-stop + sync -+ mode, we may cache pending events in lp->status while trying to -+ stop all threads (see stop_wait_callback). In async mode, the -+ events are always cached in waitpid_queue. */ -+ -+ *status = 0; -+ if (GET_LWP (lp->ptid) == GET_LWP (last_ptid)) -+ { -+ if (stop_signal != TARGET_SIGNAL_0 -+ && signal_pass_state (stop_signal)) -+ *status = W_STOPCODE (target_signal_to_host (stop_signal)); - } -+ else -+ *status = lp->status; -+ -+ return 0; - } - - static int -@@ -1014,40 +1141,30 @@ detach_callback (struct lwp_info *lp, vo - strsignal (WSTOPSIG (lp->status)), - target_pid_to_str (lp->ptid)); - -- while (lp->signalled && lp->stopped) -+ /* If there is a pending SIGSTOP, get rid of it. */ -+ if (lp->signalled) - { -- errno = 0; -- if (ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0, -- WSTOPSIG (lp->status)) < 0) -- error (_("Can't continue %s: %s"), target_pid_to_str (lp->ptid), -- safe_strerror (errno)); -- - if (debug_linux_nat) - fprintf_unfiltered (gdb_stdlog, -- "DC: PTRACE_CONTINUE (%s, 0, %s) (OK)\n", -- target_pid_to_str (lp->ptid), -- status_to_str (lp->status)); -+ "DC: Sending SIGCONT to %s\n", -+ target_pid_to_str (lp->ptid)); - -- lp->stopped = 0; -+ kill_lwp (GET_LWP (lp->ptid), SIGCONT); - lp->signalled = 0; -- lp->status = 0; -- /* FIXME drow/2003-08-26: There was a call to stop_wait_callback -- here. But since lp->signalled was cleared above, -- stop_wait_callback didn't do anything; the process was left -- running. Shouldn't we be waiting for it to stop? -- I've removed the call, since stop_wait_callback now does do -- something when called with lp->signalled == 0. */ -- -- gdb_assert (lp->status == 0 || WIFSTOPPED (lp->status)); - } - - /* We don't actually detach from the LWP that has an id equal to the - overall process id just yet. */ - if (GET_LWP (lp->ptid) != GET_PID (lp->ptid)) - { -+ int status = 0; -+ -+ /* Pass on any pending signal for this LWP. */ -+ get_pending_status (lp, &status); -+ - errno = 0; - if (ptrace (PTRACE_DETACH, GET_LWP (lp->ptid), 0, -- WSTOPSIG (lp->status)) < 0) -+ WSTOPSIG (status)) < 0) - error (_("Can't detach %s: %s"), target_pid_to_str (lp->ptid), - safe_strerror (errno)); - -@@ -1066,11 +1183,28 @@ detach_callback (struct lwp_info *lp, vo - static void - linux_nat_detach (char *args, int from_tty) - { -+ int status; -+ - iterate_over_lwps (detach_callback, NULL); - - /* Only the initial process should be left right now. */ - gdb_assert (num_lwps == 1); - -+ /* Pass on any pending signal for the last LWP. */ -+ if ((args == NULL || *args == '\0') -+ && get_pending_status (lwp_list, &status) != -1 -+ && WIFSTOPPED (status)) -+ { -+ /* Put the signal number in ARGS so that inf_ptrace_detach will -+ pass it along with PTRACE_DETACH. */ -+ args = alloca (8); -+ sprintf (args, "%d", (int) WSTOPSIG (status)); -+ fprintf_unfiltered (gdb_stdlog, -+ "LND: Sending signal %s to %s\n", -+ args, -+ target_pid_to_str (lwp_list->ptid)); -+ } -+ - trap_ptid = null_ptid; - - /* Destroy LWP info; it's no longer valid. */ -@@ -2490,7 +2624,9 @@ linux_nat_pid_to_str (ptid_t ptid) - { - static char buf[64]; - -- if (lwp_list && lwp_list->next && is_lwp (ptid)) -+ if (is_lwp (ptid) -+ && ((lwp_list && lwp_list->next) -+ || GET_PID (ptid) != GET_LWP (ptid))) - { - snprintf (buf, sizeof (buf), "LWP %ld", GET_LWP (ptid)); - return buf; -@@ -3424,4 +3560,3 @@ lin_thread_get_thread_signals (sigset_t - /* ... except during a sigsuspend. */ - sigdelset (&suspend_mask, cancel); - } -- -diff -up -ruNp gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-into-signal.c gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.c ---- gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-into-signal.c 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.c 2008-08-27 17:44:23.000000000 +0200 -@@ -0,0 +1,67 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+#include -+#include -+#include -+#include -+#include -+#ifdef USE_THREADS -+#include -+#endif -+ -+void action(int sig, siginfo_t * info, void *uc) -+{ -+ raise (SIGALRM); -+} -+ -+static void *func (void *arg) -+{ -+ struct sigaction act; -+ -+ memset (&act, 0, sizeof(struct sigaction)); -+ act.sa_sigaction = action; -+ act.sa_flags = SA_RESTART; -+ sigaction (SIGALRM, &act, 0); -+ -+ raise (SIGALRM); -+ -+ /* We must not get past this point, either in a free standing or debugged -+ state. */ -+ -+ abort (); -+ /* NOTREACHED */ -+ return NULL; -+} -+ -+int main () -+{ -+ -+#ifndef USE_THREADS -+ -+ func (NULL); -+ -+#else -+ -+ pthread_t th; -+ pthread_create (&th, NULL, func, NULL); -+ pthread_join (th, NULL); -+ -+#endif -+ -+ return 0; -+} -diff -up -ruNp gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-into-signal.exp gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.exp ---- gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-into-signal.exp 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.8/gdb/testsuite/gdb.threads/attach-into-signal.exp 2008-08-27 17:44:23.000000000 +0200 -@@ -0,0 +1,168 @@ -+# Copyright 2008 -+# Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# This test was created by modifying attach-stopped.exp. -+# This file was created by Jan Kratochvil . -+ -+# This test only works on Linux -+if { ![isnative] || [is_remote host] || ![istarget *-linux*] } { -+ continue -+} -+ -+set testfile "attach-into-signal" -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}] -+ -+remote_exec build "rm -f ${binfile}" -+# For debugging this test -+# -+#log_user 1 -+ -+proc corefunc { threadtype } { -+ global srcfile -+ global binfile -+ global escapedbinfile -+ global srcdir -+ global subdir -+ global gdb_prompt -+ -+ if [get_compiler_info ${binfile}] { -+ return -1 -+ } -+ -+ # Start the program running and then wait for a bit, to be sure -+ # that it can be attached to. -+ # Statistically there is a better chance without giving process a nice. -+ -+ set testpid [eval exec $binfile &] -+ exec sleep 2 -+ -+ # Run 2 passes of the test. -+ # The C file inferior stops pending its signals if a single one is lost, -+ # we test successful redelivery of the caught signal by the 2nd pass. -+ -+ # linux-2.6.20.4.x86_64 had maximal attempt # 20 in 4 test runs. -+ set attempts 100 -+ set attempt 1 -+ set passes 1 -+ while { $passes < 3 && $attempt <= $attempts } { -+ set stoppedtry 0 -+ while { $stoppedtry < 10 } { -+ if [catch {open /proc/${testpid}/status r} fileid] { -+ set stoppedtry 10 -+ break -+ } -+ gets $fileid line1; -+ gets $fileid line2; -+ close $fileid; -+ -+ if {![string match "*(stopped)*" $line2]} { -+ # No PASS message as we may be looping in multiple attempts. -+ break -+ } -+ sleep 1 -+ set stoppedtry [expr $stoppedtry + 1] -+ } -+ if { $stoppedtry >= 10 } { -+ verbose -log $line2 -+ set test "$threadtype: process is still running on the attempt # $attempt of $attempts" -+ break -+ } -+ -+ # Main test: -+ set test "$threadtype: attach (pass $passes), pending signal catch" -+ if {[gdb_test_multiple "attach $testpid" $test { -+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*Received Alarm clock.*$gdb_prompt $" { -+ # nonthreaded: -+ pass $test -+ verbose -log "$test succeeded on the attempt # $attempt of $attempts" -+ set passes [expr $passes + 1] -+ } -+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { -+ # nonthreaded: -+ # We just lack the luck, we should try it again. -+ set attempt [expr $attempt + 1] -+ } -+ -re "Attaching to process $testpid.*Received Alarm clock.*$gdb_prompt $" { -+ # threaded: -+ pass $test -+ verbose -log "$test succeeded on the attempt # $attempt of $attempts" -+ set passes [expr $passes + 1] -+ } -+ -re "Attaching to process $testpid.*$gdb_prompt $" { -+ # threaded: -+ # We just lack the luck, we should try it again. -+ set attempt [expr $attempt - 1] -+ } -+ }] != 0 } { -+ break -+ } -+ -+ gdb_test "detach" "Detaching from.*" "" -+ } -+ if {$passes < 3} { -+ if {$attempt > $attempts} { -+ unresolved $test -+ } else { -+ fail $test -+ } -+ } -+ -+ # Exit and detach the process. -+ -+ gdb_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. -+ -+ # Continue the program - some Linux kernels need it before -9 if the -+ # process is stopped. -+ remote_exec build "kill -s CONT ${testpid}" -+ -+ remote_exec build "kill -9 ${testpid}" -+} -+ -+# Start with clean gdb -+gdb_exit -+ -+# build the test case first without threads -+# -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail." -+} -+ -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+gdb_test "set debug lin-lwp 1" "" "" -+ -+corefunc nonthreaded -+ -+# build the test case also with threads -+# -+if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DUSE_THREADS}] != "" } { -+ gdb_suppress_entire_file "Testcase threaded compile failed, so all tests in this file will automatically fail." -+} -+ -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+gdb_test "set debug lin-lwp 1" "" "" -+ -+corefunc threaded -diff -up -ruNp gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-stopped.c gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.c ---- gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-stopped.c 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.c 2008-08-27 17:44:23.000000000 +0200 -@@ -0,0 +1,50 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+/* This program is intended to be started outside of gdb, then -+ manually stopped via a signal. */ -+ -+#include -+#include -+#ifdef USE_THREADS -+#include -+#endif -+ -+static void *func (void *arg) -+{ -+ sleep (10000); /* Ridiculous time, but we will eventually kill it. */ -+ sleep (10000); /* Second sleep. */ -+ return NULL; -+} -+ -+int main () -+{ -+ -+#ifndef USE_THREADS -+ -+ func (NULL); -+ -+#else -+ -+ pthread_t th; -+ pthread_create (&th, NULL, func, NULL); -+ pthread_join (th, NULL); -+ -+#endif -+ -+ return 0; -+} -diff -up -ruNp gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-stopped.exp gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.exp ---- gdb-6.8-orig/gdb/testsuite/gdb.threads/attach-stopped.exp 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.8/gdb/testsuite/gdb.threads/attach-stopped.exp 2008-08-27 17:44:23.000000000 +0200 -@@ -0,0 +1,157 @@ -+# Copyright 2008 -+# Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# This test was created by modifying attach.exp. -+# This file was created by Jeff Johnston . -+# This file was updated by Jan Kratochvil . -+ -+# This test only works on Linux -+if { ![isnative] || [is_remote host] || ![istarget *-linux*] } { -+ continue -+} -+ -+set testfile "attach-stopped" -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}] -+ -+#execute_anywhere "rm -f ${binfile}" -+remote_exec build "rm -f ${binfile}" -+# For debugging this test -+# -+#log_user 1 -+ -+proc corefunc { threadtype } { -+ global srcfile -+ global binfile -+ global escapedbinfile -+ global srcdir -+ global subdir -+ global gdb_prompt -+ -+ if [get_compiler_info ${binfile}] { -+ return -1 -+ } -+ -+ # Start the program running and then wait for a bit, to be sure -+ # that it can be attached to. -+ -+ set testpid [eval exec $binfile &] -+ -+ # Avoid some race: -+ sleep 2 -+ -+ # Stop the program -+ remote_exec build "kill -s STOP ${testpid}" -+ -+ # Start with clean gdb -+ gdb_exit -+ gdb_start -+ gdb_reinitialize_dir $srcdir/$subdir -+ gdb_load ${binfile} -+ -+ # Verify that we can attach to the stopped process. -+ -+ set test "$threadtype: attach2 to stopped, after setting file" -+ gdb_test_multiple "attach $testpid" "$test" { -+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { -+ pass "$test" -+ } -+ } -+ -+ # ".*sleep.*clone.*" would fail on s390x as bt stops at START_THREAD there. -+ if {[string equal $threadtype threaded]} { -+ gdb_test "thread apply all bt" ".*sleep.*start_thread.*" "$threadtype: attach2 to stopped bt" -+ } else { -+ gdb_test "bt" ".*sleep.*main.*" "$threadtype: attach2 to stopped bt" -+ } -+ # This breakpoint is there for old/non-x86 kernels not restarting syscalls. -+ gdb_breakpoint [gdb_get_line_number "Second sleep"] -+ set test "$threadtype: attach2 continue" -+ send_gdb "continue\n" -+ gdb_expect { -+ -re "Continuing" -+ { pass "continue ($test)" } -+ timeout -+ { fail "continue ($test) (timeout)" } -+ } -+ -+ # For this to work we must be sure to consume the "Continuing." -+ # message first, or GDB's signal handler may not be in place. -+ after 1000 {send_gdb "\003"} -+ set test "$threadtype: attach2 stop interrupt" -+ gdb_expect 10 { -+ -re "Program received signal SIGINT.*$gdb_prompt $" -+ { -+ pass $test -+ } -+ -re "Breakpoint \[0-9\].*$srcfile.*$gdb_prompt $" -+ { -+ pass $test -+ } -+ timeout -+ { -+ fail $test -+ } -+ } -+ -+ gdb_exit -+ -+ # Avoid some race: -+ sleep 2 -+ -+ # At this point, the process should be sleeping -+ -+ if [catch {open /proc/${testpid}/status r} fileid2] { -+ set line2 "NOTFOUND" -+ } else { -+ gets $fileid2 line1; -+ gets $fileid2 line2; -+ close $fileid2; -+ } -+ -+ set test "$threadtype: attach2, exit leaves process sleeping" -+ if {[string match "*(sleeping)*" $line2]} { -+ pass $test -+ } else { -+ fail $test -+ } -+ -+ # 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}" -+} -+ -+# build the test case first without threads -+# -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ gdb_suppress_entire_file "Testcase nonthraded compile failed, so all tests in this file will automatically fail." -+} -+ -+corefunc nonthreaded -+ -+# build the test case first without threads -+# -+if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-DUSE_THREADS}] != "" } { -+ gdb_suppress_entire_file "Testcase threaded compile failed, so all tests in this file will automatically fail." -+} -+ -+corefunc threaded -+ -+return 0 -diff -up -ruNp gdb-6.8-orig/gdb/testsuite/gdb.threads/attachstop-mt.c gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.c ---- gdb-6.8-orig/gdb/testsuite/gdb.threads/attachstop-mt.c 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.c 2008-08-27 17:44:23.000000000 +0200 -@@ -0,0 +1,55 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+/* This program is intended to be started outside of gdb, then -+ manually stopped via a signal. */ -+ -+#include -+#include -+#include -+ -+/* Red Hat BZ PR 197584.c */ -+ -+void *func (void *arg) -+{ -+ sleep (10000); /* Ridiculous time, but we will eventually kill it. */ -+ sleep (10000); /* RHEL3U8 kernel-2.4.21-47.EL will cut the sleep time. */ -+ -+ return NULL; /* thread-sleep */ -+} -+ -+int main () -+{ -+ pthread_t t1,t2; -+ int ret; -+ -+ ret = pthread_create (&t1, NULL, func, NULL); -+ if (ret) -+ fprintf(stderr, "pthread_create(): %s", strerror (ret)); -+ ret = pthread_create (&t2, NULL, func, NULL); -+ if (ret) -+ fprintf(stderr, "pthread_create(): %s", strerror (ret)); -+ -+ ret = pthread_join (t1, NULL); -+ if (ret) /* first-join */ -+ fprintf(stderr, "pthread_join(): %s", strerror (ret)); -+ ret = pthread_join (t2, NULL); -+ if (ret) -+ fprintf(stderr, "pthread_join(): %s", strerror (ret)); -+ -+ return 0; -+} -diff -up -ruNp gdb-6.8-orig/gdb/testsuite/gdb.threads/attachstop-mt.exp gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.exp ---- gdb-6.8-orig/gdb/testsuite/gdb.threads/attachstop-mt.exp 1970-01-01 01:00:00.000000000 +0100 -+++ gdb-6.8/gdb/testsuite/gdb.threads/attachstop-mt.exp 2008-08-27 17:44:23.000000000 +0200 -@@ -0,0 +1,260 @@ -+# Copyright 2008 -+# Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# This test was created by modifying gdb.threads/attachstop. -+# This file was created by Jan Kratochvil . -+# Regression for: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=197584 -+ -+# This test only works on Linux -+if { ![isnative] || [is_remote host] || ![istarget *-linux*] } { -+ continue -+} -+ -+set testfile "attachstop-mt" -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+set escapedbinfile [string_to_regexp ${objdir}/${subdir}/${testfile}] -+ -+#execute_anywhere "rm -f ${binfile}" -+remote_exec build "rm -f ${binfile}" -+# For debugging this test -+# -+#log_user 1 -+ -+# build the test case -+# -+if { [gdb_compile_pthreads "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail." -+} -+ -+if [get_compiler_info ${binfile}] { -+ return -1 -+} -+ -+# Start the program running and then wait for a bit, to be sure -+# that it can be attached to. -+ -+set testpid [eval exec $binfile &] -+ -+# No race -+sleep 2 -+ -+# Do not: set testpid2 [expr $testpid + 1] -+# as it will not exist on Red Hat 2.6.9-34.0.2.ELsmp -+set testpid2 [expr $testpid + 2] -+ -+set status2 /proc/${testpid}/task/${testpid2}/status -+if {[expr ! [file exists $status2]]} { -+ # kernel-2.4 -+ set status2 /proc/${testpid2}/status -+} -+ -+# Initial sanity test it is normally sleeping -+set fileid0 [open $status2 r]; -+gets $fileid0 line1; -+gets $fileid0 line2; -+close $fileid0; -+ -+set test "attach0, initial sanity check of the sleeping state" -+if {[string match "*(sleeping)*" $line2]} { -+ pass $test -+} else { -+ fail $test -+} -+ -+# Sttach and detach to test it will not become stopped -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+set test "attach0 to sleeping" -+gdb_test_multiple "attach $testpid" "$test" { -+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { -+ pass "$test" -+ } -+} -+ -+gdb_test "gcore /dev/null" ".*aved corefile.*" "attach0 to sleeping gcore invocation" -+ -+gdb_test "thread 2" ".*witching to thread 2 .*" "attach0 to sleeping switch thread" -+ -+gdb_test "bt" ".*sleep.*func.*" "attach0 to sleeping bt" -+ -+# Exit and detach the process. -+ -+gdb_exit -+ -+# No race -+sleep 2 -+ -+# Check it did not get stopped by our gdb -+set fileid1 [open $status2 r]; -+gets $fileid1 line1; -+gets $fileid1 line2; -+close $fileid1; -+ -+set test "attach1, post-gdb sanity check of the sleeping state - Red Hat BZ 197584" -+if {[string match "*(sleeping)*" $line2]} { -+ pass $test -+} else { -+ fail $test -+} -+ -+# Stop the program -+remote_exec build "kill -s STOP ${testpid}" -+ -+# No race -+sleep 2 -+ -+# Check it really got stopped by kill(1) -+set fileid2 [open $status2 r]; -+gets $fileid2 line1; -+gets $fileid2 line2; -+close $fileid2; -+ -+set test "attach2, initial sanity check of the stopped state" -+if {[string match "*(stopped)*" $line2]} { -+ pass $test -+} else { -+ fail $test -+} -+ -+# Start with clean gdb -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+# 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. -+ -+set test "set file, before attach3 to stopped process" -+gdb_test_multiple "file $binfile" "$test" { -+ -re "Load new symbol table from.*y or n. $" { -+ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \ -+ "$test (re-read)" -+ } -+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" { -+ pass "$test" -+ } -+} -+ -+set test "attach3 to stopped, after setting file" -+gdb_test_multiple "attach $testpid" "$test" { -+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { -+ pass "$test" -+ } -+} -+ -+# We may be already after the threads phase. -+# `thread 2' command is important for the test to switch the current thread to -+# a non-primary one for the detach process. -+ -+gdb_test "thread 2" ".*(witching to thread 2 |hread ID 2 not known).*" "attach3 to stopped switch thread" -+gdb_test "bt" ".*sleep.*(func|main).*" "attach3 to stopped bt" -+ -+# Exit and detach the process. -+gdb_exit -+ -+# Stop the program -+remote_exec build "kill -s STOP ${testpid}" -+ -+# No race -+sleep 2 -+ -+# Continue the test as we would hit another expected bug regarding -+# Program received signal SIGSTOP, Stopped (signal). -+# across NPTL threads. -+ -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+# Verify that we can attach to the process just by giving the -+# process ID. -+ -+set test "attach4 to stopped, after setting file" -+gdb_test_multiple "attach $testpid" "$test" { -+ -re "Attaching to program.*`?$escapedbinfile'?, process $testpid.*$gdb_prompt $" { -+ pass "$test" -+ } -+} -+ -+# We may be already after the threads phase. -+# `thread 2' command is important for the test to switch the current thread to -+# a non-primary one for the detach process. -+ -+gdb_test "thread 2" ".*(witching to thread 2 |hread ID 2 not known).*" "attach4 to stopped switch thread" -+gdb_test "bt" ".*sleep.*(func|main).*" "attach4 to stopped bt" -+ -+# RHEL3U8 kernel-2.4.21-47.EL will not return SIGINT but only shorten the sleep. -+gdb_breakpoint [gdb_get_line_number "Ridiculous time"] -+gdb_breakpoint [gdb_get_line_number "cut the sleep time"] -+set test "attach4 continue" -+send_gdb "continue\n" -+gdb_expect { -+ -re "Continuing" -+ { pass "continue ($test)" } -+ timeout -+ { fail "continue ($test) (timeout)" } -+} -+ -+# For this to work we must be sure to consume the "Continuing." -+# message first, or GDB's signal handler may not be in place. -+after 1000 {send_gdb "\003"} -+set test "attach4 stop by interrupt" -+gdb_expect { -+ -re "Program received signal SIGINT.*$gdb_prompt $" -+ { -+ pass $test -+ } -+ -re "Breakpoint \[0-9\].*$srcfile.*$gdb_prompt $" -+ { -+ pass $test -+ } -+ timeout -+ { -+ fail "$test (timeout)" -+ } -+} -+ -+gdb_exit -+ -+# No race -+sleep 2 -+ -+# At this point, the process should be sleeping -+ -+set fileid4 [open $status2 r]; -+gets $fileid4 line1; -+gets $fileid4 line2; -+close $fileid4; -+ -+set test "attach4, exit leaves process sleeping" -+if {[string match "*(sleeping)*" $line2]} { -+ pass $test -+} else { -+ fail $test -+} -+ -+# 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}" -+ -+return 0 diff --git a/gdb-6.8-auto-dependencies.patch b/gdb-6.8-auto-dependencies.patch deleted file mode 100644 index 03e79b2..0000000 --- a/gdb-6.8-auto-dependencies.patch +++ /dev/null @@ -1,26 +0,0 @@ ---- gdb-6.8/gdb/Makefile.in-orig 2008-06-17 15:16:20.000000000 +0200 -+++ gdb-6.8/gdb/Makefile.in 2008-06-17 15:17:01.000000000 +0200 -@@ -1100,16 +1100,22 @@ YYOBJ = c-exp.o \ - - DISTSTUFF = $(YYFILES) - -+DEPDIR = .deps -+ - # Prevent Sun make from putting in the machine type. Setting - # TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1. - .c.o: -- $(CC) -c $(INTERNAL_CFLAGS) $< -+ @mkdir -p $(DEPDIR) -+ $(CC) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c $(INTERNAL_CFLAGS) $< -+ @mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po - - all: gdb$(EXEEXT) $(CONFIG_ALL) - @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do - .PHONY: all-tui - all-tui: $(TUI)$(EXEEXT) - -+-include $(DEPDIR)/*.Po -+ - installcheck: - - # The check target can not use subdir_do, because subdir_do does not diff --git a/gdb-6.8-breakpoint-gone.patch b/gdb-6.8-breakpoint-gone.patch deleted file mode 100644 index 509aa36..0000000 --- a/gdb-6.8-breakpoint-gone.patch +++ /dev/null @@ -1,18 +0,0 @@ -A part of: - http://sourceware.org/ml/gdb-cvs/2008-06/msg00160.html - -It was crashing the RH testcase `gdb.threads/watchthreads2.exp'. - -diff -up -u -X /root/jkratoch/.diffi.list -rup gdb-6.8/gdb/breakpoint.c gdb-6.8-patched/gdb/breakpoint.c ---- gdb-6.8/gdb/breakpoint.c 2008-08-28 11:56:56.000000000 +0200 -+++ gdb-6.8-patched/gdb/breakpoint.c 2008-08-28 11:53:43.000000000 +0200 -@@ -3173,6 +3173,9 @@ bpstat_what (bpstat bs) - /* I suspect this can happen if it was a momentary breakpoint - which has since been deleted. */ - continue; -+ if (bs->breakpoint_at->owner == NULL) -+ bs_class = bp_nostop; -+ else - switch (bs->breakpoint_at->owner->type) - { - case bp_none: diff --git a/gdb-6.8-bz254229-gcore-prpsinfo.patch b/gdb-6.8-bz254229-gcore-prpsinfo.patch index 3456dba..c2d79be 100644 --- a/gdb-6.8-bz254229-gcore-prpsinfo.patch +++ b/gdb-6.8-bz254229-gcore-prpsinfo.patch @@ -1,7 +1,8 @@ -diff -d -urpN gdb-6.8.4/bfd/elf-bfd.h gdb-6.8.7/bfd/elf-bfd.h ---- gdb-6.8.4/bfd/elf-bfd.h 2008-07-25 16:16:15.000000000 +0200 -+++ gdb-6.8.7/bfd/elf-bfd.h 2008-07-29 12:29:20.000000000 +0200 -@@ -2125,7 +2125,7 @@ extern Elf_Internal_Phdr * _bfd_elf_find +Index: gdb-6.8.50.20081209/bfd/elf-bfd.h +=================================================================== +--- gdb-6.8.50.20081209.orig/bfd/elf-bfd.h 2008-12-03 15:50:57.000000000 +0100 ++++ gdb-6.8.50.20081209/bfd/elf-bfd.h 2008-12-10 01:35:08.000000000 +0100 +@@ -2154,7 +2154,7 @@ extern Elf_Internal_Phdr * _bfd_elf_find extern char *elfcore_write_note (bfd *, char *, int *, const char *, int, const void *, int); extern char *elfcore_write_prpsinfo @@ -10,10 +11,11 @@ diff -d -urpN gdb-6.8.4/bfd/elf-bfd.h gdb-6.8.7/bfd/elf-bfd.h extern char *elfcore_write_prstatus (bfd *, char *, int *, long, int, const void *); extern char * elfcore_write_pstatus -diff -d -urpN gdb-6.8.4/bfd/elf.c gdb-6.8.7/bfd/elf.c ---- gdb-6.8.4/bfd/elf.c 2008-07-25 16:16:15.000000000 +0200 -+++ gdb-6.8.7/bfd/elf.c 2008-07-29 12:45:52.000000000 +0200 -@@ -8256,6 +8256,7 @@ char * +Index: gdb-6.8.50.20081209/bfd/elf.c +=================================================================== +--- gdb-6.8.50.20081209.orig/bfd/elf.c 2008-12-03 15:50:57.000000000 +0100 ++++ gdb-6.8.50.20081209/bfd/elf.c 2008-12-10 01:35:08.000000000 +0100 +@@ -8345,6 +8345,7 @@ char * elfcore_write_prpsinfo (bfd *abfd, char *buf, int *bufsiz, @@ -21,7 +23,7 @@ diff -d -urpN gdb-6.8.4/bfd/elf.c gdb-6.8.7/bfd/elf.c const char *fname, const char *psargs) { -@@ -8282,9 +8283,15 @@ elfcore_write_prpsinfo (bfd *abfd, +@@ -8371,9 +8372,15 @@ elfcore_write_prpsinfo (bfd *abfd, int note_type = NT_PRPSINFO; #endif @@ -40,7 +42,7 @@ diff -d -urpN gdb-6.8.4/bfd/elf.c gdb-6.8.7/bfd/elf.c return elfcore_write_note (abfd, buf, bufsiz, note_name, note_type, &data, sizeof (data)); } -@@ -8299,9 +8306,15 @@ elfcore_write_prpsinfo (bfd *abfd, +@@ -8388,9 +8395,15 @@ elfcore_write_prpsinfo (bfd *abfd, int note_type = NT_PRPSINFO; #endif @@ -59,9 +61,10 @@ diff -d -urpN gdb-6.8.4/bfd/elf.c gdb-6.8.7/bfd/elf.c return elfcore_write_note (abfd, buf, bufsiz, note_name, note_type, &data, sizeof (data)); } -diff -d -urpN gdb-6.8.4/gdb/amd64-linux-nat.c gdb-6.8.7/gdb/amd64-linux-nat.c ---- gdb-6.8.4/gdb/amd64-linux-nat.c 2008-07-25 16:16:15.000000000 +0200 -+++ gdb-6.8.7/gdb/amd64-linux-nat.c 2008-07-29 12:46:02.000000000 +0200 +Index: gdb-6.8.50.20081209/gdb/amd64-linux-nat.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/amd64-linux-nat.c 2008-12-10 01:28:28.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/amd64-linux-nat.c 2008-12-10 01:35:08.000000000 +0100 @@ -139,6 +139,7 @@ static int amd64_linux_gregset32_reg_off static char * @@ -95,10 +98,11 @@ diff -d -urpN gdb-6.8.4/gdb/amd64-linux-nat.c gdb-6.8.7/gdb/amd64-linux-nat.c } static void -diff -d -urpN gdb-6.8.4/gdb/fbsd-nat.c gdb-6.8.7/gdb/fbsd-nat.c ---- gdb-6.8.4/gdb/fbsd-nat.c 2008-07-25 16:16:15.000000000 +0200 -+++ gdb-6.8.7/gdb/fbsd-nat.c 2008-07-29 12:29:20.000000000 +0200 -@@ -184,6 +184,7 @@ fbsd_make_corefile_notes (bfd *obfd, int +Index: gdb-6.8.50.20081209/gdb/fbsd-nat.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/fbsd-nat.c 2008-10-28 16:22:12.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/fbsd-nat.c 2008-12-10 01:35:08.000000000 +0100 +@@ -210,6 +210,7 @@ fbsd_make_corefile_notes (bfd *obfd, int psargs = reconcat (psargs, psargs, " ", get_inferior_args (), NULL); note_data = elfcore_write_prpsinfo (obfd, note_data, note_size, @@ -106,18 +110,19 @@ diff -d -urpN gdb-6.8.4/gdb/fbsd-nat.c gdb-6.8.7/gdb/fbsd-nat.c fname, psargs); } -diff -d -urpN gdb-6.8.4/gdb/linux-nat.c gdb-6.8.7/gdb/linux-nat.c ---- gdb-6.8.4/gdb/linux-nat.c 2008-07-25 16:16:15.000000000 +0200 -+++ gdb-6.8.7/gdb/linux-nat.c 2008-07-29 13:50:52.000000000 +0200 -@@ -47,6 +47,7 @@ - #include "gdbthread.h" /* for struct thread_info etc. */ - #include "gdb_stat.h" /* for struct stat */ - #include /* for O_RDONLY */ +Index: gdb-6.8.50.20081209/gdb/linux-nat.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/linux-nat.c 2008-12-10 01:28:14.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/linux-nat.c 2008-12-10 01:35:25.000000000 +0100 +@@ -53,6 +53,7 @@ + #include + #include "gdb_dirent.h" + #include "xml-support.h" +#include "gdb_procfs32.h" /* for struct elf_prpsinfo32 */ - #ifndef O_LARGEFILE - #define O_LARGEFILE 0 -@@ -108,7 +109,7 @@ static LONGEST (*super_xfer_partial) (st + #ifdef HAVE_PERSONALITY + # include +@@ -216,7 +217,7 @@ static LONGEST (*super_xfer_partial) (st /* This functions make elfcore note sections. They may get overriden by code adjusting data for multi-target builds. */ char *(*linux_elfcore_write_prpsinfo) @@ -126,8 +131,8 @@ diff -d -urpN gdb-6.8.4/gdb/linux-nat.c gdb-6.8.7/gdb/linux-nat.c char *(*linux_elfcore_write_prstatus) (bfd *, char *, int *, long, int, const void *) = elfcore_write_prstatus; static char * -@@ -2812,6 +2813,159 @@ linux_nat_do_registers (bfd *obfd, ptid_ - note_data, note_size); +@@ -3614,6 +3615,159 @@ linux_nat_corefile_thread_callback (stru + return 0; } +/* Should be always true for Linux */ @@ -286,7 +291,7 @@ diff -d -urpN gdb-6.8.4/gdb/linux-nat.c gdb-6.8.7/gdb/linux-nat.c /* Fills the "to_make_corefile_note" target vector. Builds the note section for a corefile, and returns it in a malloc buffer. */ -@@ -2831,8 +2985,14 @@ linux_nat_make_corefile_notes (bfd *obfd +@@ -3633,8 +3787,14 @@ linux_nat_make_corefile_notes (bfd *obfd if (get_exec_file (0)) { @@ -301,7 +306,7 @@ diff -d -urpN gdb-6.8.4/gdb/linux-nat.c gdb-6.8.7/gdb/linux-nat.c if (get_inferior_args ()) { char *string_end; -@@ -2848,9 +3008,15 @@ linux_nat_make_corefile_notes (bfd *obfd +@@ -3650,9 +3810,15 @@ linux_nat_make_corefile_notes (bfd *obfd psargs_end - string_end); } } @@ -319,10 +324,11 @@ diff -d -urpN gdb-6.8.4/gdb/linux-nat.c gdb-6.8.7/gdb/linux-nat.c } /* Dump information for threads. */ -diff -d -urpN gdb-6.8.4/gdb/linux-nat.h gdb-6.8.7/gdb/linux-nat.h ---- gdb-6.8.4/gdb/linux-nat.h 2008-07-25 16:16:15.000000000 +0200 -+++ gdb-6.8.7/gdb/linux-nat.h 2008-07-29 12:29:20.000000000 +0200 -@@ -133,7 +133,7 @@ struct siginfo *linux_nat_get_siginfo (p +Index: gdb-6.8.50.20081209/gdb/linux-nat.h +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/linux-nat.h 2008-12-10 01:27:33.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/linux-nat.h 2008-12-10 01:35:08.000000000 +0100 +@@ -138,7 +138,7 @@ struct siginfo *linux_nat_get_siginfo (p /* These functions make elfcore note sections. They may get overriden by code adjusting data for multi-target builds. */ extern char *(*linux_elfcore_write_prpsinfo) @@ -331,10 +337,11 @@ diff -d -urpN gdb-6.8.4/gdb/linux-nat.h gdb-6.8.7/gdb/linux-nat.h extern char *(*linux_elfcore_write_prstatus) (bfd *, char *, int *, long, int, const void *); extern char *(*linux_elfcore_write_prfpreg) -diff -d -urpN gdb-6.8.4/gdb/procfs.c gdb-6.8.7/gdb/procfs.c ---- gdb-6.8.4/gdb/procfs.c 2008-07-25 16:16:15.000000000 +0200 -+++ gdb-6.8.7/gdb/procfs.c 2008-07-29 12:29:20.000000000 +0200 -@@ -6118,6 +6118,7 @@ procfs_make_note_section (bfd *obfd, int +Index: gdb-6.8.50.20081209/gdb/procfs.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/procfs.c 2008-11-09 12:27:17.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/procfs.c 2008-12-10 01:35:08.000000000 +0100 +@@ -6181,6 +6181,7 @@ procfs_make_note_section (bfd *obfd, int note_data = (char *) elfcore_write_prpsinfo (obfd, note_data, note_size, diff --git a/gdb-6.8-bz377541-vla-bound-undefined.patch b/gdb-6.8-bz377541-vla-bound-undefined.patch deleted file mode 100644 index 3e521a8..0000000 --- a/gdb-6.8-bz377541-vla-bound-undefined.patch +++ /dev/null @@ -1,545 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2008-10/msg00019.html - -gdb/ -2008-10-02 Jan Kratochvil - - Replace TYPE_ARRAY_{UPPER,LOWER}_BOUND_TYPE by a bit if {un,}defined. - * c-typeprint.c (c_type_print_varspec_suffix), m2-typeprint.c - (m2_array), p-typeprint.c (pascal_type_print_varspec_prefix), - valops.c (value_cast), varobj.c (c_number_of_children): Replace - TYPE_ARRAY_UPPER_BOUND_TYPE compared to BOUND_CANNOT_BE_DETERMINED by - TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED. - * parse.c (follow_types): Use TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED. - * f-valprint.c (f77_get_dynamic_upperbound): Replace with ... - (f77_get_upperbound): ... this function handling now only - TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED. - (f77_get_dynamic_lowerbound): Replace with ... - (f77_get_lowerbound): ... this function handling now only - TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED. - (f77_get_dynamic_length_of_aggregate, f77_create_arrayprint_offset_tbl): - Update their callers. - * eval.c (evaluate_subexp_standard): Update their callers. - * f-lang.h (f77_get_dynamic_upperbound, f77_get_upperbound) - (f77_get_dynamic_lowerbound, f77_get_lowerbound): Update their - prototypes. - (BOUND_FETCH_OK, BOUND_FETCH_ERROR): Remove. - * f-typeprint.c (f_type_print_varspec_suffix, f_type_print_base): Remove - the lower_bound_was_default variable. Update the - f77_get_dynamic_upperbound, f77_get_upperbound and - TYPE_ARRAY_UPPER_BOUND_TYPE calls. - * gdbtypes.c (print_bound_type): Remove the function. - (recursive_dump_type): Remove its calls printing UPPER_BOUND_TYPE and - LOWER_BOUND_TYPE. - * gdbtypes.h (enum array_bound_type): Remove. - (struct main_type): Remove the fields upper_bound_type and - lower_bound_type. Comment the new overload of the field artificial. - (TYPE_ARRAY_UPPER_BOUND_TYPE): Replace by ... - (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED): ... this macro. - (TYPE_ARRAY_LOWER_BOUND_TYPE): Replace by ... - (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED): ... this macro. - -gdb/testsuite/ -2008-10-02 Jan Kratochvil - - * gdb.base/maint.exp (maint print type): Remove printing - UPPER_BOUND_TYPE and LOWER_BOUND_TYPE. - -[ Ported to gdb-6.8fedora. ] - ---- ./gdb/c-typeprint.c 2008-01-01 23:53:09.000000000 +0100 -+++ ./gdb/c-typeprint.c 2008-10-29 10:55:07.000000000 +0100 -@@ -542,7 +542,7 @@ c_type_print_varspec_suffix (struct type - - fprintf_filtered (stream, "["); - if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0 -- && TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED) -+ && !TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) - fprintf_filtered (stream, "%d", - (TYPE_LENGTH (type) - / TYPE_LENGTH (TYPE_TARGET_TYPE (type)))); ---- ./gdb/eval.c 2008-10-29 10:50:23.000000000 +0100 -+++ ./gdb/eval.c 2008-10-29 10:55:07.000000000 +0100 -@@ -1674,13 +1674,8 @@ evaluate_subexp_standard (struct type *e - /* Internal type of array is arranged right to left */ - for (i = 0; i < nargs; i++) - { -- retcode = f77_get_dynamic_upperbound (tmp_type, &upper); -- if (retcode == BOUND_FETCH_ERROR) -- error (_("Cannot obtain dynamic upper bound")); -- -- retcode = f77_get_dynamic_lowerbound (tmp_type, &lower); -- if (retcode == BOUND_FETCH_ERROR) -- error (_("Cannot obtain dynamic lower bound")); -+ upper = f77_get_upperbound (tmp_type); -+ lower = f77_get_lowerbound (tmp_type); - - array_size_array[nargs - i - 1] = upper - lower + 1; - ---- ./gdb/f-lang.h 2008-10-29 10:50:23.000000000 +0100 -+++ ./gdb/f-lang.h 2008-10-29 10:55:07.000000000 +0100 -@@ -83,9 +83,6 @@ extern SAVED_F77_COMMON_PTR find_common_ - #define BLANK_COMMON_NAME_MF77 "__BLNK__" /* MF77 assigned */ - #define BLANK_COMMON_NAME_LOCAL "__BLANK" /* Local GDB */ - --#define BOUND_FETCH_OK 1 --#define BOUND_FETCH_ERROR -999 -- - /* When reasonable array bounds cannot be fetched, such as when - you ask to 'mt print symbols' and there is no stack frame and - therefore no way of knowing the bounds of stack-based arrays, -@@ -97,9 +94,9 @@ extern SAVED_F77_COMMON_PTR find_common_ - extern char *real_main_name; /* Name of main function */ - extern int real_main_c_value; /* C_value field of main function */ - --extern int f77_get_dynamic_upperbound (struct type *, int *); -+extern int f77_get_upperbound (struct type *); - --extern int f77_get_dynamic_lowerbound (struct type *, int *); -+extern int f77_get_lowerbound (struct type *); - - extern void f77_get_dynamic_array_length (struct type *); - ---- ./gdb/f-typeprint.c 2008-10-29 10:50:23.000000000 +0100 -+++ ./gdb/f-typeprint.c 2008-10-29 10:55:07.000000000 +0100 -@@ -150,7 +150,6 @@ f_type_print_varspec_suffix (struct type - int show, int passed_a_ptr, int demangled_args) - { - int upper_bound, lower_bound; -- int lower_bound_was_default = 0; - static int arrayprint_recurse_level = 0; - int retcode; - -@@ -173,35 +172,19 @@ f_type_print_varspec_suffix (struct type - if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY) - f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0); - -- retcode = f77_get_dynamic_lowerbound (type, &lower_bound); -- -- lower_bound_was_default = 0; -- -- if (retcode == BOUND_FETCH_ERROR) -- fprintf_filtered (stream, "???"); -- else if (lower_bound == 1) /* The default */ -- lower_bound_was_default = 1; -- else -- fprintf_filtered (stream, "%d", lower_bound); -- -- if (lower_bound_was_default) -- lower_bound_was_default = 0; -- else -- fprintf_filtered (stream, ":"); -+ lower_bound = f77_get_lowerbound (type); -+ if (lower_bound != 1) /* Not the default. */ -+ fprintf_filtered (stream, "%d:", lower_bound); - - /* Make sure that, if we have an assumed size array, we - print out a warning and print the upperbound as '*' */ - -- if (TYPE_ARRAY_UPPER_BOUND_TYPE (type) == BOUND_CANNOT_BE_DETERMINED) -+ if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) - fprintf_filtered (stream, "*"); - else - { -- retcode = f77_get_dynamic_upperbound (type, &upper_bound); -- -- if (retcode == BOUND_FETCH_ERROR) -- fprintf_filtered (stream, "???"); -- else -- fprintf_filtered (stream, "%d", upper_bound); -+ upper_bound = f77_get_upperbound (type); -+ fprintf_filtered (stream, "%d", upper_bound); - } - - if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY) -@@ -351,16 +334,12 @@ f_type_print_base (struct type *type, st - case TYPE_CODE_STRING: - /* Strings may have dynamic upperbounds (lengths) like arrays. */ - -- if (TYPE_ARRAY_UPPER_BOUND_TYPE (type) == BOUND_CANNOT_BE_DETERMINED) -+ if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) - fprintfi_filtered (level, stream, "character*(*)"); - else - { -- retcode = f77_get_dynamic_upperbound (type, &upper_bound); -- -- if (retcode == BOUND_FETCH_ERROR) -- fprintf_filtered (stream, "character*???"); -- else -- fprintf_filtered (stream, "character*%d", upper_bound); -+ upper_bound = f77_get_upperbound (type); -+ fprintf_filtered (stream, "character*%d", upper_bound); - } - break; - ---- ./gdb/f-valprint.c 2008-10-29 10:50:23.000000000 +0100 -+++ ./gdb/f-valprint.c 2008-10-29 20:48:30.000000000 +0100 -@@ -61,130 +61,28 @@ int f77_array_offset_tbl[MAX_FORTRAN_DIM - #define F77_DIM_OFFSET(n) (f77_array_offset_tbl[n][0]) - - int --f77_get_dynamic_lowerbound (struct type *type, int *lower_bound) -+f77_get_lowerbound (struct type *type) - { -- struct frame_info *frame; -- CORE_ADDR current_frame_addr; -- CORE_ADDR ptr_to_lower_bound; -- -- switch (TYPE_ARRAY_LOWER_BOUND_TYPE (type)) -- { -- case BOUND_BY_VALUE_ON_STACK: -- frame = deprecated_safe_get_selected_frame (); -- current_frame_addr = get_frame_base (frame); -- if (current_frame_addr > 0) -- { -- *lower_bound = -- read_memory_integer (current_frame_addr + -- TYPE_ARRAY_LOWER_BOUND_VALUE (type), -- 4); -- } -- else -- { -- *lower_bound = DEFAULT_LOWER_BOUND; -- return BOUND_FETCH_ERROR; -- } -- break; -- -- case BOUND_SIMPLE: -- *lower_bound = TYPE_ARRAY_LOWER_BOUND_VALUE (type); -- break; -- -- case BOUND_CANNOT_BE_DETERMINED: -- error (_("Lower bound may not be '*' in F77")); -- break; -- -- case BOUND_BY_REF_ON_STACK: -- frame = deprecated_safe_get_selected_frame (); -- current_frame_addr = get_frame_base (frame); -- if (current_frame_addr > 0) -- { -- ptr_to_lower_bound = -- read_memory_typed_address (current_frame_addr + -- TYPE_ARRAY_LOWER_BOUND_VALUE (type), -- builtin_type_void_data_ptr); -- *lower_bound = read_memory_integer (ptr_to_lower_bound, 4); -- } -- else -- { -- *lower_bound = DEFAULT_LOWER_BOUND; -- return BOUND_FETCH_ERROR; -- } -- break; -+ if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type)) -+ error (_("Lower bound may not be '*' in F77")); - -- case BOUND_BY_REF_IN_REG: -- case BOUND_BY_VALUE_IN_REG: -- default: -- error (_("??? unhandled dynamic array bound type ???")); -- break; -- } -- return BOUND_FETCH_OK; -+ return TYPE_ARRAY_LOWER_BOUND_VALUE (type); - } - - int --f77_get_dynamic_upperbound (struct type *type, int *upper_bound) -+f77_get_upperbound (struct type *type) - { -- struct frame_info *frame; -- CORE_ADDR current_frame_addr = 0; -- CORE_ADDR ptr_to_upper_bound; -- -- switch (TYPE_ARRAY_UPPER_BOUND_TYPE (type)) -- { -- case BOUND_BY_VALUE_ON_STACK: -- frame = deprecated_safe_get_selected_frame (); -- current_frame_addr = get_frame_base (frame); -- if (current_frame_addr > 0) -- { -- *upper_bound = -- read_memory_integer (current_frame_addr + -- TYPE_ARRAY_UPPER_BOUND_VALUE (type), -- 4); -- } -- else -- { -- *upper_bound = DEFAULT_UPPER_BOUND; -- return BOUND_FETCH_ERROR; -- } -- break; -- -- case BOUND_SIMPLE: -- *upper_bound = TYPE_ARRAY_UPPER_BOUND_VALUE (type); -- break; -- -- case BOUND_CANNOT_BE_DETERMINED: -- /* we have an assumed size array on our hands. Assume that -- upper_bound == lower_bound so that we show at least -- 1 element.If the user wants to see more elements, let -- him manually ask for 'em and we'll subscript the -- array and show him */ -- f77_get_dynamic_lowerbound (type, upper_bound); -- break; -- -- case BOUND_BY_REF_ON_STACK: -- frame = deprecated_safe_get_selected_frame (); -- current_frame_addr = get_frame_base (frame); -- if (current_frame_addr > 0) -- { -- ptr_to_upper_bound = -- read_memory_typed_address (current_frame_addr + -- TYPE_ARRAY_UPPER_BOUND_VALUE (type), -- builtin_type_void_data_ptr); -- *upper_bound = read_memory_integer (ptr_to_upper_bound, 4); -- } -- else -- { -- *upper_bound = DEFAULT_UPPER_BOUND; -- return BOUND_FETCH_ERROR; -- } -- break; -+ if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) -+ { -+ /* We have an assumed size array on our hands. Assume that -+ upper_bound == lower_bound so that we show at least 1 element. -+ If the user wants to see more elements, let him manually ask for 'em -+ and we'll subscript the array and show him. */ - -- case BOUND_BY_REF_IN_REG: -- case BOUND_BY_VALUE_IN_REG: -- default: -- error (_("??? unhandled dynamic array bound type ???")); -- break; -+ return f77_get_lowerbound (type); - } -- return BOUND_FETCH_OK; -+ -+ return TYPE_ARRAY_UPPER_BOUND_VALUE (type); - } - - /* Obtain F77 adjustable array dimensions */ -@@ -210,13 +108,8 @@ f77_get_dynamic_length_of_aggregate (str - f77_get_dynamic_length_of_aggregate (TYPE_TARGET_TYPE (type)); - - /* Recursion ends here, start setting up lengths. */ -- retcode = f77_get_dynamic_lowerbound (type, &lower_bound); -- if (retcode == BOUND_FETCH_ERROR) -- error (_("Cannot obtain valid array lower bound")); -- -- retcode = f77_get_dynamic_upperbound (type, &upper_bound); -- if (retcode == BOUND_FETCH_ERROR) -- error (_("Cannot obtain valid array upper bound")); -+ lower_bound = f77_get_lowerbound (type); -+ upper_bound = f77_get_upperbound (type); - - /* Patch in a valid length value. */ - -@@ -239,16 +132,8 @@ f77_create_arrayprint_offset_tbl (struct - - while ((TYPE_CODE (tmp_type) == TYPE_CODE_ARRAY)) - { -- if (TYPE_ARRAY_UPPER_BOUND_TYPE (tmp_type) == BOUND_CANNOT_BE_DETERMINED) -- fprintf_filtered (stream, " "); -- -- retcode = f77_get_dynamic_upperbound (tmp_type, &upper); -- if (retcode == BOUND_FETCH_ERROR) -- error (_("Cannot obtain dynamic upper bound")); -- -- retcode = f77_get_dynamic_lowerbound (tmp_type, &lower); -- if (retcode == BOUND_FETCH_ERROR) -- error (_("Cannot obtain dynamic lower bound")); -+ upper = f77_get_upperbound (tmp_type); -+ lower = f77_get_lowerbound (tmp_type); - - F77_DIM_SIZE (ndimen) = upper - lower + 1; - ---- ./gdb/gdbtypes.c 2008-10-29 10:50:23.000000000 +0100 -+++ ./gdb/gdbtypes.c 2008-10-29 10:55:07.000000000 +0100 -@@ -2529,35 +2529,6 @@ print_cplus_stuff (struct type *type, in - } - } - --static void --print_bound_type (int bt) --{ -- switch (bt) -- { -- case BOUND_CANNOT_BE_DETERMINED: -- printf_filtered ("(BOUND_CANNOT_BE_DETERMINED)"); -- break; -- case BOUND_BY_REF_ON_STACK: -- printf_filtered ("(BOUND_BY_REF_ON_STACK)"); -- break; -- case BOUND_BY_VALUE_ON_STACK: -- printf_filtered ("(BOUND_BY_VALUE_ON_STACK)"); -- break; -- case BOUND_BY_REF_IN_REG: -- printf_filtered ("(BOUND_BY_REF_IN_REG)"); -- break; -- case BOUND_BY_VALUE_IN_REG: -- printf_filtered ("(BOUND_BY_VALUE_IN_REG)"); -- break; -- case BOUND_SIMPLE: -- printf_filtered ("(BOUND_SIMPLE)"); -- break; -- default: -- printf_filtered (_("(unknown bound type)")); -- break; -- } --} -- - static struct obstack dont_print_type_obstack; - - void -@@ -2692,14 +2663,6 @@ recursive_dump_type (struct type *type, - } - puts_filtered ("\n"); - printfi_filtered (spaces, "length %d\n", TYPE_LENGTH (type)); -- printfi_filtered (spaces, "upper_bound_type 0x%x ", -- TYPE_ARRAY_UPPER_BOUND_TYPE (type)); -- print_bound_type (TYPE_ARRAY_UPPER_BOUND_TYPE (type)); -- puts_filtered ("\n"); -- printfi_filtered (spaces, "lower_bound_type 0x%x ", -- TYPE_ARRAY_LOWER_BOUND_TYPE (type)); -- print_bound_type (TYPE_ARRAY_LOWER_BOUND_TYPE (type)); -- puts_filtered ("\n"); - printfi_filtered (spaces, "objfile "); - gdb_print_host_address (TYPE_OBJFILE (type), gdb_stdout); - printf_filtered ("\n"); -@@ -2942,10 +2942,6 @@ copy_type_recursive (struct objfile *obj - - /* Copy the common fields of types. */ - TYPE_CODE (new_type) = TYPE_CODE (type); -- TYPE_ARRAY_UPPER_BOUND_TYPE (new_type) = -- TYPE_ARRAY_UPPER_BOUND_TYPE (type); -- TYPE_ARRAY_LOWER_BOUND_TYPE (new_type) = -- TYPE_ARRAY_LOWER_BOUND_TYPE (type); - if (TYPE_NAME (type)) - TYPE_NAME (new_type) = xstrdup (TYPE_NAME (type)); - if (TYPE_TAG_NAME (type)) ---- ./gdb/gdbtypes.h 2008-10-29 10:50:23.000000000 +0100 -+++ ./gdb/gdbtypes.h 2008-10-29 10:56:05.000000000 +0100 -@@ -310,17 +310,6 @@ enum type_code - #define TYPE_FLAG_NOTTEXT (1 << 17) - #define TYPE_NOTTEXT(t) (TYPE_FLAGS (t) & TYPE_FLAG_NOTTEXT) - --/* Array bound type. */ --enum array_bound_type --{ -- BOUND_SIMPLE = 0, -- BOUND_BY_VALUE_IN_REG, -- BOUND_BY_REF_IN_REG, -- BOUND_BY_VALUE_ON_STACK, -- BOUND_BY_REF_ON_STACK, -- BOUND_CANNOT_BE_DETERMINED --}; -- - /* This structure is space-critical. - Its layout has been tweaked to reduce the space used. */ - -@@ -330,12 +319,6 @@ struct main_type - - ENUM_BITFIELD(type_code) code : 8; - -- /* Array bounds. These fields appear at this location because -- they pack nicely here. */ -- -- ENUM_BITFIELD(array_bound_type) upper_bound_type : 4; -- ENUM_BITFIELD(array_bound_type) lower_bound_type : 4; -- - /* Name of this type, or NULL if none. - - This is used for printing only, except by poorly designed C++ code. -@@ -437,7 +420,8 @@ struct main_type - - /* For a function or member type, this is 1 if the argument is marked - artificial. Artificial arguments should not be shown to the -- user. */ -+ user. For TYPE_CODE_RANGE it is set if the specific bound is not -+ defined. */ - unsigned int artificial : 1; - - /* This flag is zero for non-static fields, 1 for fields whose location -@@ -802,10 +786,10 @@ extern void allocate_cplus_struct_type ( - - /* Moto-specific stuff for FORTRAN arrays */ - --#define TYPE_ARRAY_UPPER_BOUND_TYPE(thistype) \ -- TYPE_MAIN_TYPE(thistype)->upper_bound_type --#define TYPE_ARRAY_LOWER_BOUND_TYPE(thistype) \ -- TYPE_MAIN_TYPE(thistype)->lower_bound_type -+#define TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED(arraytype) \ -+ (TYPE_FIELD_ARTIFICIAL((TYPE_FIELD_TYPE((arraytype),0)),1)) -+#define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \ -+ (TYPE_FIELD_ARTIFICIAL((TYPE_FIELD_TYPE((arraytype),0)),0)) - - #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \ - (TYPE_FIELD_BITPOS((TYPE_FIELD_TYPE((arraytype),0)),1)) ---- ./gdb/m2-typeprint.c 2008-01-01 23:53:11.000000000 +0100 -+++ ./gdb/m2-typeprint.c 2008-10-29 10:55:12.000000000 +0100 -@@ -202,7 +202,7 @@ static void m2_array (struct type *type, - { - fprintf_filtered (stream, "ARRAY ["); - if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0 -- && TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED) -+ && !TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) - { - if (TYPE_INDEX_TYPE (type) != 0) - { ---- ./gdb/p-typeprint.c 2008-01-01 23:53:12.000000000 +0100 -+++ ./gdb/p-typeprint.c 2008-10-29 10:55:12.000000000 +0100 -@@ -251,7 +251,7 @@ pascal_type_print_varspec_prefix (struct - fprintf_filtered (stream, "("); - fprintf_filtered (stream, "array "); - if (TYPE_LENGTH (TYPE_TARGET_TYPE (type)) > 0 -- && TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED) -+ && !TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) - fprintf_filtered (stream, "[%d..%d] ", - TYPE_ARRAY_LOWER_BOUND_VALUE (type), - TYPE_ARRAY_UPPER_BOUND_VALUE (type) ---- ./gdb/parse.c 2008-10-29 10:47:18.000000000 +0100 -+++ ./gdb/parse.c 2008-10-29 10:55:12.000000000 +0100 -@@ -1175,8 +1175,7 @@ follow_types (struct type *follow_type) - create_array_type ((struct type *) NULL, - follow_type, range_type); - if (array_size < 0) -- TYPE_ARRAY_UPPER_BOUND_TYPE (follow_type) -- = BOUND_CANNOT_BE_DETERMINED; -+ TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (follow_type) = 1; - break; - case tp_function: - /* FIXME-type-allocation: need a way to free this type when we are ---- ./gdb/testsuite/gdb.base/maint.exp 2008-01-28 19:06:59.000000000 +0100 -+++ ./gdb/testsuite/gdb.base/maint.exp 2008-10-29 20:50:33.000000000 +0100 -@@ -404,7 +404,7 @@ gdb_expect { - - send_gdb "maint print type argc\n" - gdb_expect { -- -re "type node $hex\r\nname .int. \\($hex\\)\r\ntagname .. \\($hex\\)\r\ncode $hex \\(TYPE_CODE_INT\\)\r\nlength \[24\]\r\nupper_bound_type $hex \\(BOUND_SIMPLE\\)\r\nlower_bound_type $hex \\(BOUND_SIMPLE\\)\r\nobjfile $hex\r\ntarget_type $hex\r\npointer_type $hex\r\nreference_type $hex\r\ntype_chain $hex\r\ninstance_flags $hex\r\nflags $hex\r\nnfields 0 $hex\r\nvptr_basetype $hex\r\nvptr_fieldno -1\r\ntype_specific $hex\r\n$gdb_prompt $"\ -+ -re "type node $hex\r\nname .int. \\($hex\\)\r\ntagname .. \\($hex\\)\r\ncode $hex \\(TYPE_CODE_INT\\)\r\nlength \[24\]\r\nobjfile $hex\r\ntarget_type $hex\r\npointer_type $hex\r\nreference_type $hex\r\ntype_chain $hex\r\ninstance_flags $hex\r\nflags $hex\r\nnfields 0 $hex\r\nvptr_basetype $hex\r\nvptr_fieldno -1\r\ntype_specific $hex\r\n$gdb_prompt $"\ - { pass "maint print type" } - -re ".*$gdb_prompt $" { fail "maint print type" } - timeout { fail "(timeout) maint print type" } ---- ./gdb/valops.c 2008-10-29 10:50:23.000000000 +0100 -+++ ./gdb/valops.c 2008-10-29 10:55:12.000000000 +0100 -@@ -291,8 +291,7 @@ value_cast (struct type *type, struct va - { - struct type *element_type = TYPE_TARGET_TYPE (type); - unsigned element_length = TYPE_LENGTH (check_typedef (element_type)); -- if (element_length > 0 -- && TYPE_ARRAY_UPPER_BOUND_TYPE (type) == BOUND_CANNOT_BE_DETERMINED) -+ if (element_length > 0 && TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) - { - struct type *range_type = TYPE_INDEX_TYPE (type); - int val_length = TYPE_LENGTH (type2); ---- ./gdb/varobj.c 2008-10-29 10:47:21.000000000 +0100 -+++ ./gdb/varobj.c 2008-10-29 10:55:12.000000000 +0100 -@@ -1988,7 +1988,7 @@ c_number_of_children (struct varobj *var - { - case TYPE_CODE_ARRAY: - if (TYPE_LENGTH (type) > 0 && TYPE_LENGTH (target) > 0 -- && TYPE_ARRAY_UPPER_BOUND_TYPE (type) != BOUND_CANNOT_BE_DETERMINED) -+ && !TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) - children = TYPE_LENGTH (type) / TYPE_LENGTH (target); - else - /* If we don't know how many elements there are, don't display diff --git a/gdb-6.8-bz377541-vla-loc-kind.patch b/gdb-6.8-bz377541-vla-loc-kind.patch deleted file mode 100644 index 357b08e..0000000 --- a/gdb-6.8-bz377541-vla-loc-kind.patch +++ /dev/null @@ -1,579 +0,0 @@ -http://sourceware.org/ml/gdb-cvs/2008-10/msg00099.html - -2008-10-08 Jan Kratochvil - - Convert static_kind into loc_kind enum. - * gdbtypes.h (enum field_loc_kind): New. - (union field_location): New field dwarf_block. - (struct field): Rename static_kind as loc_kind. - (FIELD_STATIC_KIND): Rename to ... - (FIELD_LOC_KIND): ... here. - (TYPE_FIELD_STATIC_KIND): Rename to ... - (TYPE_FIELD_LOC_KIND): ... here and use there now new FIELD_LOC_KIND. - (TYPE_FIELD_STATIC_HAS_ADDR): Remove. - (TYPE_FIELD_STATIC): Remove. - (TYPE_FIELD_BITPOS): Reformat. - (SET_FIELD_BITPOS): New. - (FIELD_PHYSADDR): Rename to ... - (FIELD_STATIC_PHYSADDR): ... here. - (TYPE_FIELD_STATIC_PHYSADDR): Follow the FIELD_PHYSADDR rename. - (SET_FIELD_PHYSADDR): Use new FIELD_LOC_KIND. - (FIELD_PHYSNAME): Rename to ... - (FIELD_STATIC_PHYSNAME): ... here. - (TYPE_FIELD_STATIC_PHYSNAME): Follow the FIELD_PHYSNAME rename. - (SET_FIELD_PHYSNAME): Use new FIELD_LOC_KIND. - (FIELD_DWARF_BLOCK, TYPE_FIELD_DWARF_BLOCK, SET_FIELD_DWARF_BLOCK): New. - (field_is_static): New declaration. - * gdbtypes.c (field_is_static): New function. - (copy_type_recursive): Update throughout. - * amd64-tdep.c, c-typeprint.c, coffread.c, cp-valprint.c, dwarf2read.c, - eval.c, jv-typeprint.c, jv-valprint.c, mdebugread.c, p-typeprint.c, - p-valprint.c, valops.c, value.c, varobj.c: Update throughout. - -[ Ported to gdb-6.8fedora. ] - ---- ./gdb/amd64-tdep.c 2008-10-29 10:47:21.000000000 +0100 -+++ ./gdb/amd64-tdep.c 2008-10-29 20:56:57.000000000 +0100 -@@ -317,7 +317,7 @@ amd64_classify_aggregate (struct type *t - enum amd64_reg_class subclass[2]; - - /* Ignore static fields. */ -- if (TYPE_FIELD_STATIC (type, i)) -+ if (field_is_static (&TYPE_FIELD (type, i))) - continue; - - gdb_assert (pos == 0 || pos == 1); ---- ./gdb/c-typeprint.c 2008-10-29 10:55:07.000000000 +0100 -+++ ./gdb/c-typeprint.c 2008-10-29 20:56:57.000000000 +0100 -@@ -872,14 +872,12 @@ c_type_print_base (struct type *type, st - } - - print_spaces_filtered (level + 4, stream); -- if (TYPE_FIELD_STATIC (type, i)) -- { -- fprintf_filtered (stream, "static "); -- } -+ if (field_is_static (&TYPE_FIELD (type, i))) -+ fprintf_filtered (stream, "static "); - c_print_type (TYPE_FIELD_TYPE (type, i), - TYPE_FIELD_NAME (type, i), - stream, show - 1, level + 4); -- if (!TYPE_FIELD_STATIC (type, i) -+ if (!field_is_static (&TYPE_FIELD (type, i)) - && TYPE_FIELD_PACKED (type, i)) - { - /* It is a bitfield. This code does not attempt ---- ./gdb/coffread.c 2008-01-16 12:21:42.000000000 +0100 -+++ ./gdb/coffread.c 2008-10-29 20:58:56.000000000 +0100 -@@ -1946,9 +1946,8 @@ coff_read_struct_type (int index, int le - strlen (name), - ¤t_objfile->objfile_obstack); - FIELD_TYPE (list->field) = decode_type (ms, ms->c_type, &sub_aux); -- FIELD_BITPOS (list->field) = 8 * ms->c_value; -+ SET_FIELD_BITPOS (list->field, 8 * ms->c_value); - FIELD_BITSIZE (list->field) = 0; -- FIELD_STATIC_KIND (list->field) = 0; - nfields++; - break; - -@@ -1965,9 +1964,8 @@ coff_read_struct_type (int index, int le - strlen (name), - ¤t_objfile->objfile_obstack); - FIELD_TYPE (list->field) = decode_type (ms, ms->c_type, &sub_aux); -- FIELD_BITPOS (list->field) = ms->c_value; -+ SET_FIELD_BITPOS (list->field, ms->c_value); - FIELD_BITSIZE (list->field) = sub_aux.x_sym.x_misc.x_lnsz.x_size; -- FIELD_STATIC_KIND (list->field) = 0; - nfields++; - break; - -@@ -2083,11 +2081,10 @@ coff_read_enum_type (int index, int leng - struct symbol *xsym = syms->symbol[j]; - SYMBOL_TYPE (xsym) = type; - TYPE_FIELD_NAME (type, n) = DEPRECATED_SYMBOL_NAME (xsym); -- TYPE_FIELD_BITPOS (type, n) = SYMBOL_VALUE (xsym); -+ SET_FIELD_BITPOS (TYPE_FIELD (type, n), SYMBOL_VALUE (xsym)); - if (SYMBOL_VALUE (xsym) < 0) - unsigned_enum = 0; - TYPE_FIELD_BITSIZE (type, n) = 0; -- TYPE_FIELD_STATIC_KIND (type, n) = 0; - } - if (syms == osyms) - break; ---- ./gdb/cp-valprint.c 2008-01-01 23:53:09.000000000 +0100 -+++ ./gdb/cp-valprint.c 2008-10-29 20:56:57.000000000 +0100 -@@ -192,7 +192,8 @@ cp_print_value_fields (struct type *type - for (i = n_baseclasses; i < len; i++) - { - /* If requested, skip printing of static fields. */ -- if (!static_field_print && TYPE_FIELD_STATIC (type, i)) -+ if (!static_field_print -+ && field_is_static (&TYPE_FIELD (type, i))) - continue; - - if (fields_seen) -@@ -225,7 +226,7 @@ cp_print_value_fields (struct type *type - fputs_filtered ("\"( ptr \"", stream); - else - fputs_filtered ("\"( nodef \"", stream); -- if (TYPE_FIELD_STATIC (type, i)) -+ if (field_is_static (&TYPE_FIELD (type, i))) - fputs_filtered ("static ", stream); - fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), - current_language->la_language, -@@ -240,7 +241,7 @@ cp_print_value_fields (struct type *type - { - annotate_field_begin (TYPE_FIELD_TYPE (type, i)); - -- if (TYPE_FIELD_STATIC (type, i)) -+ if (field_is_static (&TYPE_FIELD (type, i))) - fputs_filtered ("static ", stream); - fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), - current_language->la_language, -@@ -252,7 +253,8 @@ cp_print_value_fields (struct type *type - annotate_field_value (); - } - -- if (!TYPE_FIELD_STATIC (type, i) && TYPE_FIELD_PACKED (type, i)) -+ if (!field_is_static (&TYPE_FIELD (type, i)) -+ && TYPE_FIELD_PACKED (type, i)) - { - struct value *v; - -@@ -277,7 +279,7 @@ cp_print_value_fields (struct type *type - { - fputs_filtered ("", stream); - } -- else if (TYPE_FIELD_STATIC (type, i)) -+ else if (field_is_static (&TYPE_FIELD (type, i))) - { - struct value *v = value_static_field (type, i); - if (v == NULL) ---- ./gdb/dwarf2read.c 2008-10-29 10:50:56.000000000 +0100 -+++ ./gdb/dwarf2read.c 2008-10-29 20:56:57.000000000 +0100 -@@ -3492,7 +3492,7 @@ dwarf2_add_field (struct field_info *fip - /* Get type of field. */ - fp->type = die_type (die, cu); - -- FIELD_STATIC_KIND (*fp) = 0; -+ SET_FIELD_BITPOS (*fp, 0); - - /* Get bit size of field (zero if none). */ - attr = dwarf2_attr (die, DW_AT_bit_size, cu); -@@ -3521,10 +3521,8 @@ dwarf2_add_field (struct field_info *fip - else - byte_offset = decode_locdesc (DW_BLOCK (attr), cu); - -- FIELD_BITPOS (*fp) = byte_offset * bits_per_byte; -+ SET_FIELD_BITPOS (*fp, byte_offset * bits_per_byte); - } -- else -- FIELD_BITPOS (*fp) = 0; - attr = dwarf2_attr (die, DW_AT_bit_offset, cu); - if (attr) - { -@@ -3617,10 +3615,9 @@ dwarf2_add_field (struct field_info *fip - /* C++ base class field. */ - attr = dwarf2_attr (die, DW_AT_data_member_location, cu); - if (attr) -- FIELD_BITPOS (*fp) = (decode_locdesc (DW_BLOCK (attr), cu) -- * bits_per_byte); -+ SET_FIELD_BITPOS (*fp, decode_locdesc (DW_BLOCK (attr), cu) -+ * bits_per_byte); - FIELD_BITSIZE (*fp) = 0; -- FIELD_STATIC_KIND (*fp) = 0; - FIELD_TYPE (*fp) = die_type (die, cu); - FIELD_NAME (*fp) = type_name_no_tag (fp->type); - fip->nbaseclasses++; -@@ -4379,9 +4376,8 @@ process_enumeration_scope (struct die_in - - FIELD_NAME (fields[num_fields]) = DEPRECATED_SYMBOL_NAME (sym); - FIELD_TYPE (fields[num_fields]) = NULL; -- FIELD_BITPOS (fields[num_fields]) = SYMBOL_VALUE (sym); -+ SET_FIELD_BITPOS (fields[num_fields], SYMBOL_VALUE (sym)); - FIELD_BITSIZE (fields[num_fields]) = 0; -- FIELD_STATIC_KIND (fields[num_fields]) = 0; - - num_fields++; - } ---- ./gdb/eval.c 2008-10-29 10:55:07.000000000 +0100 -+++ ./gdb/eval.c 2008-10-29 20:56:57.000000000 +0100 -@@ -288,7 +288,8 @@ evaluate_struct_tuple (struct value *str - fieldno++; - /* Skip static fields. */ - while (fieldno < TYPE_NFIELDS (struct_type) -- && TYPE_FIELD_STATIC_KIND (struct_type, fieldno)) -+ && field_is_static (&TYPE_FIELD (struct_type, -+ fieldno))) - fieldno++; - subfieldno = fieldno; - if (fieldno >= TYPE_NFIELDS (struct_type)) ---- ./gdb/gdbtypes.c 2008-10-29 10:55:07.000000000 +0100 -+++ ./gdb/gdbtypes.c 2008-10-29 20:56:57.000000000 +0100 -@@ -2407,6 +2407,20 @@ print_arg_types (struct field *args, int - } - } - -+int -+field_is_static (struct field *f) -+{ -+ /* "static" fields are the fields whose location is not relative -+ to the address of the enclosing struct. It would be nice to -+ have a dedicated flag that would be set for static fields when -+ the type is being created. But in practice, checking the field -+ loc_kind should give us an accurate answer (at least as long as -+ we assume that DWARF block locations are not going to be used -+ for static fields). FIXME? */ -+ return (FIELD_LOC_KIND (*f) == FIELD_LOC_KIND_PHYSNAME -+ || FIELD_LOC_KIND (*f) == FIELD_LOC_KIND_PHYSADDR); -+} -+ - static void - dump_fn_fieldlists (struct type *type, int spaces) - { -@@ -2939,18 +2953,25 @@ copy_type_recursive (struct objfile *obj - if (TYPE_FIELD_NAME (type, i)) - TYPE_FIELD_NAME (new_type, i) = - xstrdup (TYPE_FIELD_NAME (type, i)); -- if (TYPE_FIELD_STATIC_HAS_ADDR (type, i)) -- SET_FIELD_PHYSADDR (TYPE_FIELD (new_type, i), -- TYPE_FIELD_STATIC_PHYSADDR (type, i)); -- else if (TYPE_FIELD_STATIC (type, i)) -- SET_FIELD_PHYSNAME (TYPE_FIELD (new_type, i), -- xstrdup (TYPE_FIELD_STATIC_PHYSNAME (type, -- i))); -- else -+ switch (TYPE_FIELD_LOC_KIND (type, i)) - { -- TYPE_FIELD_BITPOS (new_type, i) = -- TYPE_FIELD_BITPOS (type, i); -- TYPE_FIELD_STATIC_KIND (new_type, i) = 0; -+ case FIELD_LOC_KIND_BITPOS: -+ SET_FIELD_BITPOS (TYPE_FIELD (new_type, i), -+ TYPE_FIELD_BITPOS (type, i)); -+ break; -+ case FIELD_LOC_KIND_PHYSADDR: -+ SET_FIELD_PHYSADDR (TYPE_FIELD (new_type, i), -+ TYPE_FIELD_STATIC_PHYSADDR (type, i)); -+ break; -+ case FIELD_LOC_KIND_PHYSNAME: -+ SET_FIELD_PHYSNAME (TYPE_FIELD (new_type, i), -+ xstrdup (TYPE_FIELD_STATIC_PHYSNAME (type, -+ i))); -+ break; -+ default: -+ internal_error (__FILE__, __LINE__, -+ _("Unexpected type field location kind: %d"), -+ TYPE_FIELD_LOC_KIND (type, i)); - } - } - } ---- ./gdb/gdbtypes.h 2008-10-29 10:56:05.000000000 +0100 -+++ ./gdb/gdbtypes.h 2008-10-29 20:56:57.000000000 +0100 -@@ -310,6 +310,16 @@ enum type_code - #define TYPE_FLAG_NOTTEXT (1 << 17) - #define TYPE_NOTTEXT(t) (TYPE_FLAGS (t) & TYPE_FLAG_NOTTEXT) - -+/* Determine which field of the union main_type.fields[x].loc is used. */ -+ -+enum field_loc_kind -+ { -+ FIELD_LOC_KIND_BITPOS, /* bitpos */ -+ FIELD_LOC_KIND_PHYSADDR, /* physaddr */ -+ FIELD_LOC_KIND_PHYSNAME, /* physname */ -+ FIELD_LOC_KIND_DWARF_BLOCK /* dwarf_block */ -+ }; -+ - /* This structure is space-critical. - Its layout has been tweaked to reduce the space used. */ - -@@ -415,6 +425,12 @@ struct main_type - - CORE_ADDR physaddr; - char *physname; -+ -+ /* The field location can be computed by evaluating the following DWARF -+ block. This can be used in Fortran variable-length arrays, for -+ instance. */ -+ -+ struct dwarf2_locexpr_baton *dwarf_block; - } - loc; - -@@ -424,11 +440,8 @@ struct main_type - defined. */ - unsigned int artificial : 1; - -- /* This flag is zero for non-static fields, 1 for fields whose location -- is specified by the label loc.physname, and 2 for fields whose location -- is specified by loc.physaddr. */ -- -- unsigned int static_kind : 2; -+ /* Discriminant for union field_location. */ -+ ENUM_BITFIELD(field_loc_kind) loc_kind : 2; - - /* Size of this field, in bits, or zero if not packed. - For an unpacked field, the field's type's length -@@ -824,20 +837,34 @@ extern void allocate_cplus_struct_type ( - - #define FIELD_TYPE(thisfld) ((thisfld).type) - #define FIELD_NAME(thisfld) ((thisfld).name) -+#define FIELD_LOC_KIND(thisfld) ((thisfld).loc_kind) - #define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos) -+#define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname) -+#define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr) -+#define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block) -+#define SET_FIELD_BITPOS(thisfld, bitpos) \ -+ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_BITPOS, \ -+ FIELD_BITPOS (thisfld) = (bitpos)) -+#define SET_FIELD_PHYSNAME(thisfld, name) \ -+ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \ -+ FIELD_STATIC_PHYSNAME (thisfld) = (name)) -+#define SET_FIELD_PHYSADDR(thisfld, addr) \ -+ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \ -+ FIELD_STATIC_PHYSADDR (thisfld) = (addr)) -+#define SET_FIELD_DWARF_BLOCK(thisfld, addr) \ -+ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_DWARF_BLOCK, \ -+ FIELD_DWARF_BLOCK (thisfld) = (addr)) - #define FIELD_ARTIFICIAL(thisfld) ((thisfld).artificial) - #define FIELD_BITSIZE(thisfld) ((thisfld).bitsize) --#define FIELD_STATIC_KIND(thisfld) ((thisfld).static_kind) --#define FIELD_PHYSNAME(thisfld) ((thisfld).loc.physname) --#define FIELD_PHYSADDR(thisfld) ((thisfld).loc.physaddr) --#define SET_FIELD_PHYSNAME(thisfld, name) \ -- ((thisfld).static_kind = 1, FIELD_PHYSNAME(thisfld) = (name)) --#define SET_FIELD_PHYSADDR(thisfld, name) \ -- ((thisfld).static_kind = 2, FIELD_PHYSADDR(thisfld) = (name)) -+ - #define TYPE_FIELD(thistype, n) TYPE_MAIN_TYPE(thistype)->fields[n] - #define TYPE_FIELD_TYPE(thistype, n) FIELD_TYPE(TYPE_FIELD(thistype, n)) - #define TYPE_FIELD_NAME(thistype, n) FIELD_NAME(TYPE_FIELD(thistype, n)) --#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS(TYPE_FIELD(thistype,n)) -+#define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND (TYPE_FIELD (thistype, n)) -+#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n)) -+#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n)) -+#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n)) -+#define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n)) - #define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n)) - #define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n)) - #define TYPE_FIELD_PACKED(thistype, n) (FIELD_BITSIZE(TYPE_FIELD(thistype,n))!=0) -@@ -873,12 +900,6 @@ extern void allocate_cplus_struct_type ( - (TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits == NULL ? 0 \ - : B_TST(TYPE_CPLUS_SPECIFIC(thistype)->virtual_field_bits, (n))) - --#define TYPE_FIELD_STATIC(thistype, n) (TYPE_MAIN_TYPE (thistype)->fields[n].static_kind != 0) --#define TYPE_FIELD_STATIC_KIND(thistype, n) TYPE_MAIN_TYPE (thistype)->fields[n].static_kind --#define TYPE_FIELD_STATIC_HAS_ADDR(thistype, n) (TYPE_MAIN_TYPE (thistype)->fields[n].static_kind == 2) --#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_PHYSNAME(TYPE_FIELD(thistype, n)) --#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_PHYSADDR(TYPE_FIELD(thistype, n)) -- - #define TYPE_FN_FIELDLISTS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->fn_fieldlists - #define TYPE_FN_FIELDLIST(thistype, n) TYPE_CPLUS_SPECIFIC(thistype)->fn_fieldlists[n] - #define TYPE_FN_FIELDLIST1(thistype, n) TYPE_CPLUS_SPECIFIC(thistype)->fn_fieldlists[n].fn_fields -@@ -1331,6 +1352,8 @@ extern int rank_one_type (struct type *, - - extern void recursive_dump_type (struct type *, int); - -+extern int field_is_static (struct field *); -+ - /* printcmd.c */ - - extern void print_scalar_formatted (const void *, struct type *, int, int, ---- ./gdb/jv-typeprint.c 2008-01-01 23:53:11.000000000 +0100 -+++ ./gdb/jv-typeprint.c 2008-10-29 20:56:57.000000000 +0100 -@@ -185,7 +185,7 @@ java_type_print_base (struct type *type, - fprintf_filtered (stream, "public "); - } - -- if (TYPE_FIELD_STATIC (type, i)) -+ if (field_is_static (&TYPE_FIELD (type, i))) - fprintf_filtered (stream, "static "); - - java_print_type (TYPE_FIELD_TYPE (type, i), ---- ./gdb/jv-valprint.c 2008-01-01 23:53:11.000000000 +0100 -+++ ./gdb/jv-valprint.c 2008-10-29 20:56:57.000000000 +0100 -@@ -302,7 +302,7 @@ java_print_value_fields (struct type *ty - for (i = n_baseclasses; i < len; i++) - { - /* If requested, skip printing of static fields. */ -- if (TYPE_FIELD_STATIC (type, i)) -+ if (field_is_static (&TYPE_FIELD (type, i))) - { - char *name = TYPE_FIELD_NAME (type, i); - if (!static_field_print) -@@ -340,7 +340,7 @@ java_print_value_fields (struct type *ty - fputs_filtered ("\"( ptr \"", stream); - else - fputs_filtered ("\"( nodef \"", stream); -- if (TYPE_FIELD_STATIC (type, i)) -+ if (field_is_static (&TYPE_FIELD (type, i))) - fputs_filtered ("static ", stream); - fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), - language_cplus, -@@ -355,7 +355,7 @@ java_print_value_fields (struct type *ty - { - annotate_field_begin (TYPE_FIELD_TYPE (type, i)); - -- if (TYPE_FIELD_STATIC (type, i)) -+ if (field_is_static (&TYPE_FIELD (type, i))) - fputs_filtered ("static ", stream); - fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), - language_cplus, -@@ -365,7 +365,8 @@ java_print_value_fields (struct type *ty - annotate_field_value (); - } - -- if (!TYPE_FIELD_STATIC (type, i) && TYPE_FIELD_PACKED (type, i)) -+ if (!field_is_static (&TYPE_FIELD (type, i)) -+ && TYPE_FIELD_PACKED (type, i)) - { - struct value *v; - -@@ -389,7 +390,7 @@ java_print_value_fields (struct type *ty - { - fputs_filtered ("", stream); - } -- else if (TYPE_FIELD_STATIC (type, i)) -+ else if (field_is_static (&TYPE_FIELD (type, i))) - { - struct value *v = value_static_field (type, i); - if (v == NULL) ---- ./gdb/mdebugread.c 2008-01-01 23:53:12.000000000 +0100 -+++ ./gdb/mdebugread.c 2008-10-29 20:56:57.000000000 +0100 -@@ -1053,11 +1053,10 @@ parse_symbol (SYMR *sh, union aux_ext *a - if (tsym.st != stMember) - break; - -- FIELD_BITPOS (*f) = tsym.value; -+ SET_FIELD_BITPOS (*f, tsym.value); - FIELD_TYPE (*f) = t; - FIELD_NAME (*f) = debug_info->ss + cur_fdr->issBase + tsym.iss; - FIELD_BITSIZE (*f) = 0; -- FIELD_STATIC_KIND (*f) = 0; - - enum_sym = ((struct symbol *) - obstack_alloc (¤t_objfile->objfile_obstack, -@@ -1247,11 +1246,10 @@ parse_symbol (SYMR *sh, union aux_ext *a - case stMember: /* member of struct or union */ - f = &TYPE_FIELDS (top_stack->cur_type)[top_stack->cur_field++]; - FIELD_NAME (*f) = name; -- FIELD_BITPOS (*f) = sh->value; -+ SET_FIELD_BITPOS (*f, sh->value); - bitsize = 0; - FIELD_TYPE (*f) = parse_type (cur_fd, ax, sh->index, &bitsize, bigend, name); - FIELD_BITSIZE (*f) = bitsize; -- FIELD_STATIC_KIND (*f) = 0; - break; - - case stIndirect: /* forward declaration on Irix5 */ ---- ./gdb/p-typeprint.c 2008-10-29 10:55:12.000000000 +0100 -+++ ./gdb/p-typeprint.c 2008-10-29 20:56:57.000000000 +0100 -@@ -575,14 +575,12 @@ pascal_type_print_base (struct type *typ - } - - print_spaces_filtered (level + 4, stream); -- if (TYPE_FIELD_STATIC (type, i)) -- { -- fprintf_filtered (stream, "static "); -- } -+ if (field_is_static (&TYPE_FIELD (type, i))) -+ fprintf_filtered (stream, "static "); - pascal_print_type (TYPE_FIELD_TYPE (type, i), - TYPE_FIELD_NAME (type, i), - stream, show - 1, level + 4); -- if (!TYPE_FIELD_STATIC (type, i) -+ if (!field_is_static (&TYPE_FIELD (type, i)) - && TYPE_FIELD_PACKED (type, i)) - { - /* It is a bitfield. This code does not attempt ---- ./gdb/p-valprint.c 2008-01-01 23:53:12.000000000 +0100 -+++ ./gdb/p-valprint.c 2008-10-29 20:56:57.000000000 +0100 -@@ -671,7 +671,8 @@ pascal_object_print_value_fields (struct - for (i = n_baseclasses; i < len; i++) - { - /* If requested, skip printing of static fields. */ -- if (!pascal_static_field_print && TYPE_FIELD_STATIC (type, i)) -+ if (!pascal_static_field_print -+ && field_is_static (&TYPE_FIELD (type, i))) - continue; - if (fields_seen) - fprintf_filtered (stream, ", "); -@@ -703,7 +704,7 @@ pascal_object_print_value_fields (struct - fputs_filtered ("\"( ptr \"", stream); - else - fputs_filtered ("\"( nodef \"", stream); -- if (TYPE_FIELD_STATIC (type, i)) -+ if (field_is_static (&TYPE_FIELD (type, i))) - fputs_filtered ("static ", stream); - fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), - language_cplus, -@@ -718,7 +719,7 @@ pascal_object_print_value_fields (struct - { - annotate_field_begin (TYPE_FIELD_TYPE (type, i)); - -- if (TYPE_FIELD_STATIC (type, i)) -+ if (field_is_static (&TYPE_FIELD (type, i))) - fputs_filtered ("static ", stream); - fprintf_symbol_filtered (stream, TYPE_FIELD_NAME (type, i), - language_cplus, -@@ -728,7 +729,8 @@ pascal_object_print_value_fields (struct - annotate_field_value (); - } - -- if (!TYPE_FIELD_STATIC (type, i) && TYPE_FIELD_PACKED (type, i)) -+ if (!field_is_static (&TYPE_FIELD (type, i)) -+ && TYPE_FIELD_PACKED (type, i)) - { - struct value *v; - -@@ -752,7 +754,7 @@ pascal_object_print_value_fields (struct - { - fputs_filtered ("", stream); - } -- else if (TYPE_FIELD_STATIC (type, i)) -+ else if (field_is_static (&TYPE_FIELD (type, i))) - { - /* struct value *v = value_static_field (type, i); v4.17 specific */ - struct value *v; ---- ./gdb/valops.c 2008-10-29 10:55:12.000000000 +0100 -+++ ./gdb/valops.c 2008-10-29 20:56:57.000000000 +0100 -@@ -1269,7 +1269,7 @@ search_struct_field (char *name, struct - if (t_field_name && (strcmp_iw (t_field_name, name) == 0)) - { - struct value *v; -- if (TYPE_FIELD_STATIC (type, i)) -+ if (field_is_static (&TYPE_FIELD (type, i))) - { - v = value_static_field (type, i); - if (v == 0) -@@ -2382,7 +2382,7 @@ value_struct_elt_for_reference (struct t - - if (t_field_name && strcmp (t_field_name, name) == 0) - { -- if (TYPE_FIELD_STATIC (t, i)) -+ if (field_is_static (&TYPE_FIELD (t, i))) - { - v = value_static_field (t, i); - if (v == NULL) ---- ./gdb/value.c 2008-10-29 10:47:18.000000000 +0100 -+++ ./gdb/value.c 2008-10-29 20:56:57.000000000 +0100 -@@ -1261,7 +1261,7 @@ value_static_field (struct type *type, i - { - struct value *retval; - -- if (TYPE_FIELD_STATIC_HAS_ADDR (type, fieldno)) -+ if (TYPE_FIELD_LOC_KIND (type, fieldno) == FIELD_LOC_KIND_PHYSADDR) - { - retval = value_at (TYPE_FIELD_TYPE (type, fieldno), - TYPE_FIELD_STATIC_PHYSADDR (type, fieldno)); ---- ./gdb/varobj.c 2008-10-29 10:55:12.000000000 +0100 -+++ ./gdb/varobj.c 2008-10-29 20:56:57.000000000 +0100 -@@ -2050,7 +2050,7 @@ value_struct_element_index (struct value - - TRY_CATCH (e, RETURN_MASK_ERROR) - { -- if (TYPE_FIELD_STATIC (type, type_index)) -+ if (field_is_static (&TYPE_FIELD (type, type_index))) - result = value_static_field (type, type_index); - else - result = value_primitive_field (value, 0, type_index, type); diff --git a/gdb-6.8-bz377541-vla.patch b/gdb-6.8-bz377541-vla.patch index b05cc52..8b36d50 100644 --- a/gdb-6.8-bz377541-vla.patch +++ b/gdb-6.8-bz377541-vla.patch @@ -1,10 +1,8 @@ -Based on: -http://people.redhat.com/jkratoch/vla/ -fortran-dynamic-arrays-HEAD-l.patch - ---- ./gdb/c-typeprint.c 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/c-typeprint.c 2008-11-08 22:39:57.000000000 +0100 -@@ -541,7 +541,12 @@ c_type_print_varspec_suffix (struct type +diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c +index b18e437..7095e46 100644 +--- a/gdb/c-typeprint.c ++++ b/gdb/c-typeprint.c +@@ -559,7 +559,12 @@ c_type_print_varspec_suffix (struct type *type, struct ui_file *stream, fprintf_filtered (stream, ")"); fprintf_filtered (stream, "["); @@ -18,9 +16,11 @@ fortran-dynamic-arrays-HEAD-l.patch && !TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) fprintf_filtered (stream, "%d", (TYPE_LENGTH (type) ---- ./gdb/dwarf2expr.c 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/dwarf2expr.c 2008-11-08 22:39:57.000000000 +0100 -@@ -750,6 +750,13 @@ execute_stack_op (struct dwarf_expr_cont +diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c +index 707c0de..9b4c726 100644 +--- a/gdb/dwarf2expr.c ++++ b/gdb/dwarf2expr.c +@@ -738,6 +738,13 @@ execute_stack_op (struct dwarf_expr_context *ctx, ctx->initialized = 0; goto no_push; @@ -34,9 +34,11 @@ fortran-dynamic-arrays-HEAD-l.patch default: error (_("Unhandled dwarf expression opcode 0x%x"), op); } ---- ./gdb/dwarf2expr.h 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/dwarf2expr.h 2008-11-08 22:39:57.000000000 +0100 -@@ -61,10 +61,10 @@ struct dwarf_expr_context +diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h +index 5d9581c..b79f811 100644 +--- a/gdb/dwarf2expr.h ++++ b/gdb/dwarf2expr.h +@@ -67,10 +67,10 @@ struct dwarf_expr_context The result must be live until the current expression evaluation is complete. */ unsigned char *(*get_subr) (void *baton, off_t offset, size_t *length); @@ -48,9 +50,11 @@ fortran-dynamic-arrays-HEAD-l.patch /* The current depth of dwarf expression recursion, via DW_OP_call*, DW_OP_fbreg, DW_OP_push_object_address, etc., and the maximum ---- ./gdb/dwarf2loc.c 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/dwarf2loc.c 2008-11-08 22:39:57.000000000 +0100 -@@ -105,6 +105,9 @@ struct dwarf_expr_baton +diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c +index 080cd06..a70b2fc 100644 +--- a/gdb/dwarf2loc.c ++++ b/gdb/dwarf2loc.c +@@ -107,6 +107,9 @@ struct dwarf_expr_baton { struct frame_info *frame; struct objfile *objfile; @@ -60,7 +64,7 @@ fortran-dynamic-arrays-HEAD-l.patch }; /* Helper functions for dwarf2_evaluate_loc_desc. */ -@@ -160,22 +163,32 @@ dwarf_expr_frame_base (void *baton, gdb_ +@@ -163,22 +166,32 @@ dwarf_expr_frame_base (void *baton, gdb_byte **start, size_t * length) *start = find_location_expression (symbaton, length, get_frame_address_in_block (frame)); } @@ -80,7 +84,7 @@ fortran-dynamic-arrays-HEAD-l.patch + gdb_assert (symbaton != NULL); + *start = symbaton->data; + *length = symbaton->size; - } ++ } + else if (SYMBOL_OPS (framefunc) == &dwarf2_missing_funcs) + { + struct dwarf2_locexpr_baton *symbaton; @@ -89,7 +93,7 @@ fortran-dynamic-arrays-HEAD-l.patch + gdb_assert (symbaton == NULL); + *start = NULL; + *length = 0; /* unused */ -+ } + } + else + internal_error (__FILE__, __LINE__, + _("Unsupported SYMBOL_OPS %p for \"%s\""), @@ -102,7 +106,7 @@ fortran-dynamic-arrays-HEAD-l.patch } /* Using the objfile specified in BATON, find the address for the -@@ -188,6 +201,117 @@ dwarf_expr_tls_address (void *baton, COR +@@ -191,6 +204,119 @@ dwarf_expr_tls_address (void *baton, CORE_ADDR offset) return target_translate_tls_address (debaton->objfile, offset); } @@ -163,7 +167,7 @@ fortran-dynamic-arrays-HEAD-l.patch + +static struct dwarf_expr_context * +dwarf_expr_prep_ctx (struct frame_info *frame, gdb_byte *data, -+ unsigned short size, struct objfile *objfile) ++ unsigned short size, struct dwarf2_per_cu_data *per_cu) +{ + struct dwarf_expr_context *ctx; + struct dwarf_expr_baton baton; @@ -172,10 +176,12 @@ fortran-dynamic-arrays-HEAD-l.patch + frame = get_selected_frame (NULL); + + baton.frame = frame; -+ baton.objfile = objfile; ++ baton.objfile = dwarf2_per_cu_objfile (per_cu); + baton.object_address = object_address; + + ctx = new_dwarf_expr_context (); ++ ctx->gdbarch = get_objfile_arch (baton.objfile); ++ ctx->addr_size = dwarf2_per_cu_addr_size (per_cu); + ctx->baton = &baton; + ctx->read_reg = dwarf_expr_read_reg; + ctx->read_mem = dwarf_expr_read_mem; @@ -204,7 +210,7 @@ fortran-dynamic-arrays-HEAD-l.patch + struct cleanup *back_to = make_cleanup (null_cleanup, 0); + + ctx = dwarf_expr_prep_ctx (NULL, dlbaton->data, dlbaton->size, -+ dlbaton->objfile); ++ dlbaton->per_cu); + if (ctx->num_pieces > 0) + error (_("DW_OP_*piece is unsupported for DW_FORM_block")); + else if (ctx->in_reg) @@ -220,7 +226,7 @@ fortran-dynamic-arrays-HEAD-l.patch /* Evaluate a location description, starting at DATA and with length SIZE, to find the current location of variable VAR in the context of FRAME. */ -@@ -198,8 +322,8 @@ dwarf2_evaluate_loc_desc (struct symbol +@@ -201,8 +327,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, { struct gdbarch *arch = get_frame_arch (frame); struct value *retval; @@ -230,15 +236,17 @@ fortran-dynamic-arrays-HEAD-l.patch if (size == 0) { -@@ -209,17 +333,8 @@ dwarf2_evaluate_loc_desc (struct symbol +@@ -212,19 +338,8 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, return retval; } - baton.frame = frame; -- baton.objfile = objfile; -+ ctx = dwarf_expr_prep_ctx (frame, data, size, objfile); +- baton.objfile = dwarf2_per_cu_objfile (per_cu); ++ ctx = dwarf_expr_prep_ctx (frame, data, size, per_cu); - ctx = new_dwarf_expr_context (); +- ctx->gdbarch = get_objfile_arch (baton.objfile); +- ctx->addr_size = dwarf2_per_cu_addr_size (per_cu); - ctx->baton = &baton; - ctx->read_reg = dwarf_expr_read_reg; - ctx->read_mem = dwarf_expr_read_mem; @@ -249,7 +257,7 @@ fortran-dynamic-arrays-HEAD-l.patch if (ctx->num_pieces > 0) { int i; -@@ -257,6 +372,10 @@ dwarf2_evaluate_loc_desc (struct symbol +@@ -262,6 +377,10 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, { CORE_ADDR address = dwarf_expr_fetch (ctx, 0); @@ -260,7 +268,7 @@ fortran-dynamic-arrays-HEAD-l.patch retval = allocate_value (SYMBOL_TYPE (var)); VALUE_LVAL (retval) = lval_memory; set_value_lazy (retval, 1); -@@ -265,7 +384,7 @@ dwarf2_evaluate_loc_desc (struct symbol +@@ -270,7 +389,7 @@ dwarf2_evaluate_loc_desc (struct symbol *var, struct frame_info *frame, set_value_initialized (retval, ctx->initialized); @@ -269,7 +277,7 @@ fortran-dynamic-arrays-HEAD-l.patch return retval; } -@@ -574,7 +693,7 @@ static int +@@ -588,7 +707,7 @@ static int loclist_describe_location (struct symbol *symbol, struct ui_file *stream) { /* FIXME: Could print the entire list of locations. */ @@ -278,7 +286,7 @@ fortran-dynamic-arrays-HEAD-l.patch return 1; } -@@ -590,16 +709,56 @@ loclist_tracepoint_var_ref (struct symbo +@@ -604,16 +723,56 @@ loclist_tracepoint_var_ref (struct symbol * symbol, struct agent_expr * ax, data = find_location_expression (dlbaton, &size, ax->scope); if (data == NULL) @@ -338,9 +346,11 @@ fortran-dynamic-arrays-HEAD-l.patch + missing_describe_location, + missing_tracepoint_var_ref +}; ---- ./gdb/dwarf2loc.h 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/dwarf2loc.h 2008-11-08 22:39:57.000000000 +0100 -@@ -65,5 +65,11 @@ struct dwarf2_loclist_baton +diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h +index 632568e..a2e5abf 100644 +--- a/gdb/dwarf2loc.h ++++ b/gdb/dwarf2loc.h +@@ -71,5 +71,11 @@ struct dwarf2_loclist_baton extern const struct symbol_ops dwarf2_locexpr_funcs; extern const struct symbol_ops dwarf2_loclist_funcs; @@ -352,11 +362,13 @@ fortran-dynamic-arrays-HEAD-l.patch + (struct dwarf2_locexpr_baton *dlbaton); #endif /* dwarf2loc.h */ ---- ./gdb/dwarf2read.c 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/dwarf2read.c 2008-11-08 22:47:45.000000000 +0100 -@@ -1004,7 +1004,14 @@ static void store_in_ref_table (unsigned - static unsigned int dwarf2_get_ref_die_offset (struct attribute *, - struct dwarf2_cu *); +diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c +index a6584c4..829fa4e 100644 +--- a/gdb/dwarf2read.c ++++ b/gdb/dwarf2read.c +@@ -1023,7 +1023,14 @@ static void store_in_ref_table (struct die_info *, + + static unsigned int dwarf2_get_ref_die_offset (struct attribute *); -static int dwarf2_get_attr_constant_value (struct attribute *, int); +enum dwarf2_get_attr_constant_value @@ -370,19 +382,19 @@ fortran-dynamic-arrays-HEAD-l.patch static struct die_info *follow_die_ref (struct die_info *, struct attribute *, -@@ -1059,6 +1066,9 @@ static void age_cached_comp_units (void) +@@ -1078,6 +1085,9 @@ static void age_cached_comp_units (void); static void free_one_cached_comp_unit (void *); +static void fetch_die_type_attrs (struct die_info *die, struct type *type, + struct dwarf2_cu *cu); + - static void set_die_type (struct die_info *, struct type *, - struct dwarf2_cu *); + static struct type *set_die_type (struct die_info *, struct type *, + struct dwarf2_cu *); -@@ -1082,6 +1092,9 @@ static void dwarf2_clear_marks (struct d - static void read_set_type (struct die_info *, struct dwarf2_cu *); +@@ -1097,6 +1107,9 @@ static void dwarf2_clear_marks (struct dwarf2_per_cu_data *); + static struct type *get_die_type (struct die_info *die, struct dwarf2_cu *cu); +static struct dwarf2_locexpr_baton *dwarf2_attr_to_locexpr_baton + (struct attribute *attr, struct dwarf2_cu *cu); @@ -390,8 +402,8 @@ fortran-dynamic-arrays-HEAD-l.patch /* Try to locate the sections we need for DWARF 2 debugging information and return true if we have enough to do something. */ -@@ -4387,6 +4400,26 @@ process_enumeration_scope (struct die_in - new_symbol (die, die->type, cu); +@@ -4466,6 +4479,26 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) + new_symbol (die, this_type, cu); } +/* Create a new array dimension referencing its target type TYPE. @@ -417,7 +429,7 @@ fortran-dynamic-arrays-HEAD-l.patch /* Extract all information from a DW_TAG_array_type DIE and put it in the DIE's type field. For now, this only handles one dimensional arrays. */ -@@ -4400,7 +4433,7 @@ read_array_type (struct die_info *die, s +@@ -4479,7 +4512,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) struct type *element_type, *range_type, *index_type; struct type **range_types = NULL; struct attribute *attr; @@ -426,7 +438,7 @@ fortran-dynamic-arrays-HEAD-l.patch struct cleanup *back_to; char *name; -@@ -4455,16 +4488,11 @@ read_array_type (struct die_info *die, s +@@ -4526,16 +4559,11 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) type = element_type; if (read_array_order (die, cu) == DW_ORD_col_major) @@ -448,35 +460,31 @@ fortran-dynamic-arrays-HEAD-l.patch /* Understand Dwarf2 support for vector types (like they occur on the PowerPC w/ AltiVec). Gcc just adds another attribute to the -@@ -4826,34 +4854,98 @@ read_tag_string_type (struct die_info *d +@@ -4891,29 +4919,93 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) struct objfile *objfile = cu->objfile; struct type *type, *range_type, *index_type, *char_type; struct attribute *attr; - unsigned int length; + int length; - - if (die->type) - { - return; - } - ++ + index_type = builtin_type_int32; + range_type = create_range_type_nfields (NULL, index_type, 2); -+ TYPE_FLAGS (range_type) |= TYPE_FLAG_UNSIGNED; ++ TYPE_UNSIGNED (range_type) = 1; + + /* C/C++ should probably have the low bound 0 but C/C++ does not use + DW_TAG_string_type. */ + TYPE_LOW_BOUND (range_type) = 1; -+ + attr = dwarf2_attr (die, DW_AT_string_length, cu); - if (attr) - { - length = DW_UNSND (attr); - } - else -+ switch (dwarf2_get_attr_constant_value (attr, &length)) - { +- { - /* check for the DW_AT_byte_size attribute */ ++ switch (dwarf2_get_attr_constant_value (attr, &length)) ++ { + case dwarf2_attr_const: + /* We currently do not support a constant address where the location + should be read from - DWARF2_ATTR_BLOCK is expected instead. See @@ -504,7 +512,7 @@ fortran-dynamic-arrays-HEAD-l.patch + TYPE_RANGE_BOUND_SET_DWARF_BLOCK (range_type, 1); + TYPE_FIELD_DWARF_BLOCK (range_type, 1) = + dwarf2_attr_to_locexpr_baton (attr, cu); -+ TYPE_FLAGS (range_type) |= TYPE_FLAG_DYNAMIC; ++ TYPE_DYNAMIC (range_type) = 1; + break; + } + break; @@ -524,7 +532,7 @@ fortran-dynamic-arrays-HEAD-l.patch + + length_baton = obstack_alloc (&cu->comp_unit_obstack, + sizeof (*length_baton)); -+ length_baton->objfile = cu->objfile; ++ length_baton->per_cu = cu->per_cu; + length_baton->data = obstack_alloc (&cu->comp_unit_obstack, + DW_BLOCK (attr)->size + 2); + memcpy (length_baton->data, DW_BLOCK (attr)->data, @@ -554,7 +562,7 @@ fortran-dynamic-arrays-HEAD-l.patch + + TYPE_RANGE_BOUND_SET_DWARF_BLOCK (range_type, 1); + TYPE_FIELD_DWARF_BLOCK (range_type, 1) = length_baton; -+ TYPE_FLAGS (range_type) |= TYPE_FLAG_DYNAMIC; ++ TYPE_DYNAMIC (range_type) = 1; + } + break; } @@ -563,17 +571,17 @@ fortran-dynamic-arrays-HEAD-l.patch - range_type = create_range_type (NULL, index_type, 1, length); type = create_string_type (NULL, range_type); - set_die_type (die, type, cu); -@@ -4946,7 +5038,6 @@ static void + return set_die_type (die, type, cu); +@@ -5007,7 +5099,6 @@ static struct type * read_typedef (struct die_info *die, struct dwarf2_cu *cu) { struct objfile *objfile = cu->objfile; - struct attribute *attr; - char *name = NULL; + const char *name = NULL; + struct type *this_type; - if (!die->type) -@@ -5052,9 +5143,9 @@ read_subrange_type (struct die_info *die - { +@@ -5112,9 +5203,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) + struct gdbarch *gdbarch = get_objfile_arch (cu->objfile); struct type *base_type; struct type *range_type; - struct attribute *attr; @@ -584,8 +592,8 @@ fortran-dynamic-arrays-HEAD-l.patch + enum dwarf2_get_attr_constant_value high_type, byte_stride_type; char *name; - /* If we have already decoded this die, then nothing more to do. */ -@@ -5071,42 +5162,89 @@ read_subrange_type (struct die_info *die + base_type = die_type (die, cu); +@@ -5127,42 +5218,89 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) 0, NULL, cu->objfile); } @@ -626,13 +634,13 @@ fortran-dynamic-arrays-HEAD-l.patch + case dwarf2_attr_const: + TYPE_LOW_BOUND (range_type) = low; + if (low >= 0) -+ TYPE_FLAGS (range_type) |= TYPE_FLAG_UNSIGNED; ++ TYPE_UNSIGNED (range_type) = 1; + break; + case dwarf2_attr_block: + TYPE_RANGE_BOUND_SET_DWARF_BLOCK (range_type, 0); + TYPE_FIELD_DWARF_BLOCK (range_type, 0) = dwarf2_attr_to_locexpr_baton + (attr, cu); -+ TYPE_FLAGS (range_type) |= TYPE_FLAG_DYNAMIC; ++ TYPE_DYNAMIC (range_type) = 1; + /* For setting a default if DW_AT_UPPER_BOUND would be missing. */ + low = 0; + break; @@ -665,7 +673,7 @@ fortran-dynamic-arrays-HEAD-l.patch + high_type = dwarf2_get_attr_constant_value (attr, &high); + /* It does not hurt but it is needlessly ineffective in check_typedef. */ + if (high_type != dwarf2_attr_unknown) -+ TYPE_FLAGS (range_type) |= TYPE_FLAG_RANGE_HIGH_BOUND_IS_COUNT; ++ TYPE_RANGE_HIGH_BOUND_IS_COUNT (range_type) = 1; + /* Pass it now as the regular DW_AT_upper_bound. */ + } + switch (high_type) @@ -681,7 +689,7 @@ fortran-dynamic-arrays-HEAD-l.patch + TYPE_RANGE_BOUND_SET_DWARF_BLOCK (range_type, 1); + TYPE_FIELD_DWARF_BLOCK (range_type, 1) = dwarf2_attr_to_locexpr_baton + (attr, cu); -+ TYPE_FLAGS (range_type) |= TYPE_FLAG_DYNAMIC; ++ TYPE_DYNAMIC (range_type) = 1; + break; } @@ -699,13 +707,13 @@ fortran-dynamic-arrays-HEAD-l.patch + TYPE_RANGE_BOUND_SET_DWARF_BLOCK (range_type, 2); + TYPE_FIELD_DWARF_BLOCK (range_type, 2) = dwarf2_attr_to_locexpr_baton + (byte_stride_attr, cu); -+ TYPE_FLAGS (range_type) |= TYPE_FLAG_DYNAMIC; ++ TYPE_DYNAMIC (range_type) = 1; + break; + } name = dwarf2_name (die, cu); if (name) -@@ -7237,10 +7375,12 @@ var_decode_location (struct attribute *a +@@ -7450,10 +7588,12 @@ var_decode_location (struct attribute *attr, struct symbol *sym, (i.e. when the value of a register or memory location is referenced, or a thread-local block, etc.). Then again, it might not be worthwhile. I'm assuming that it isn't unless performance @@ -720,7 +728,7 @@ fortran-dynamic-arrays-HEAD-l.patch } /* Given a pointer to a DWARF information entry, figure out if we need -@@ -7272,6 +7412,8 @@ new_symbol (struct die_info *die, struct +@@ -7486,6 +7626,8 @@ new_symbol (struct die_info *die, struct type *type, struct dwarf2_cu *cu) sizeof (struct symbol)); OBJSTAT (objfile, n_syms++); memset (sym, 0, sizeof (struct symbol)); @@ -729,7 +737,7 @@ fortran-dynamic-arrays-HEAD-l.patch /* Cache this symbol's name and the name's demangled form (if any). */ SYMBOL_LANGUAGE (sym) = cu->language; -@@ -9079,26 +9221,35 @@ dwarf2_get_ref_die_offset (struct attrib +@@ -9291,26 +9433,35 @@ dwarf2_get_ref_die_offset (struct attribute *attr) return result; } @@ -779,8 +787,8 @@ fortran-dynamic-arrays-HEAD-l.patch + return dwarf2_attr_unknown; } - static struct die_info * -@@ -9862,6 +10013,34 @@ attr_form_is_constant (struct attribute + /* THIS_CU has a reference to PER_CU. If necessary, load the new compilation +@@ -10088,6 +10239,34 @@ attr_form_is_constant (struct attribute *attr) } } @@ -795,8 +803,8 @@ fortran-dynamic-arrays-HEAD-l.patch + gdb_assert (attr_form_is_block (attr)); + + baton = obstack_alloc (&cu->objfile->objfile_obstack, sizeof (*baton)); -+ baton->objfile = cu->objfile; -+ gdb_assert (baton->objfile); ++ baton->per_cu = cu->per_cu; ++ gdb_assert (baton->per_cu); + + /* Note that we're just copying the block's data pointer + here, not the actual data. We're still pointing into the @@ -815,7 +823,7 @@ fortran-dynamic-arrays-HEAD-l.patch static void dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, struct dwarf2_cu *cu) -@@ -9897,34 +10076,24 @@ dwarf2_symbol_mark_computed (struct attr +@@ -10117,35 +10296,24 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym, SYMBOL_OPS (sym) = &dwarf2_loclist_funcs; SYMBOL_LOCATION_BATON (sym) = baton; } @@ -832,7 +840,8 @@ fortran-dynamic-arrays-HEAD-l.patch - baton = obstack_alloc (&cu->objfile->objfile_obstack, - sizeof (struct dwarf2_locexpr_baton)); -- baton->objfile = objfile; +- baton->per_cu = cu->per_cu; +- gdb_assert (baton->per_cu); + /* Some methods are called without checking SYMBOL_OPS validity. */ + SYMBOL_OPS (sym) = &dwarf2_missing_funcs; + SYMBOL_LOCATION_BATON (sym) = NULL; @@ -864,7 +873,7 @@ fortran-dynamic-arrays-HEAD-l.patch } } -@@ -10164,6 +10333,27 @@ offset_and_type_eq (const void *item_lhs +@@ -10420,6 +10588,27 @@ offset_and_type_eq (const void *item_lhs, const void *item_rhs) return ofs_lhs->offset == ofs_rhs->offset; } @@ -890,28 +899,30 @@ fortran-dynamic-arrays-HEAD-l.patch +} + /* Set the type associated with DIE to TYPE. Save it in CU's hash - table if necessary. */ + table if necessary. For convenience, return TYPE. */ -@@ -10174,6 +10364,8 @@ set_die_type (struct die_info *die, stru - - die->type = type; +@@ -10428,6 +10617,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) + { + struct dwarf2_offset_and_type **slot, ofs; + fetch_die_type_attrs (die, type, cu); + - if (cu->per_cu == NULL) - return; - ---- ./gdb/eval.c 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/eval.c 2008-11-08 22:39:57.000000000 +0100 -@@ -38,6 +38,7 @@ - #include "ui-out.h" - #include "exceptions.h" + if (cu->type_hash == NULL) + { + gdb_assert (cu->per_cu != NULL); +diff --git a/gdb/eval.c b/gdb/eval.c +index ccb6b74..e3221ef 100644 +--- a/gdb/eval.c ++++ b/gdb/eval.c +@@ -40,6 +40,7 @@ #include "regcache.h" + #include "user-regs.h" + #include "valprint.h" +#include "dwarf2loc.h" #include "gdb_assert.h" -@@ -429,6 +430,7 @@ evaluate_subexp_standard (struct type *e +@@ -671,6 +672,7 @@ evaluate_subexp_standard (struct type *expect_type, long mem_offset; struct type **arg_types; int save_pos1; @@ -919,7 +930,7 @@ fortran-dynamic-arrays-HEAD-l.patch pc = (*pos)++; op = exp->elts[pc].opcode; -@@ -1280,7 +1282,10 @@ evaluate_subexp_standard (struct type *e +@@ -1529,7 +1531,10 @@ evaluate_subexp_standard (struct type *expect_type, /* First determine the type code we are dealing with. */ arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); @@ -930,7 +941,7 @@ fortran-dynamic-arrays-HEAD-l.patch code = TYPE_CODE (type); if (code == TYPE_CODE_PTR) -@@ -1644,13 +1649,19 @@ evaluate_subexp_standard (struct type *e +@@ -1963,13 +1968,19 @@ evaluate_subexp_standard (struct type *expect_type, { int subscript_array[MAX_FORTRAN_DIMS]; int array_size_array[MAX_FORTRAN_DIMS]; @@ -950,7 +961,7 @@ fortran-dynamic-arrays-HEAD-l.patch tmp_type = check_typedef (value_type (arg1)); ndimensions = calc_f77_array_dims (type); -@@ -1678,6 +1689,9 @@ evaluate_subexp_standard (struct type *e +@@ -1999,6 +2010,9 @@ evaluate_subexp_standard (struct type *expect_type, upper = f77_get_upperbound (tmp_type); lower = f77_get_lowerbound (tmp_type); @@ -960,7 +971,7 @@ fortran-dynamic-arrays-HEAD-l.patch array_size_array[nargs - i - 1] = upper - lower + 1; /* Zero-normalize subscripts so that offsetting will work. */ -@@ -1696,17 +1710,25 @@ evaluate_subexp_standard (struct type *e +@@ -2017,17 +2031,25 @@ evaluate_subexp_standard (struct type *expect_type, tmp_type = check_typedef (TYPE_TARGET_TYPE (tmp_type)); } @@ -987,40 +998,42 @@ fortran-dynamic-arrays-HEAD-l.patch + offset_byte += subscript_array[i] * byte_stride_array[i]; + } -- arg2 = value_from_longest (builtin_type_f_integer, offset_item); +- arg2 = value_from_longest (builtin_type_int32, offset_item); + element_size = TYPE_LENGTH (TYPE_TARGET_TYPE (tmp_type)); + offset_byte += offset_item * element_size; /* Let us now play a dirty trick: we will take arg1 which is a value node pointing to the topmost level -@@ -1716,7 +1738,7 @@ evaluate_subexp_standard (struct type *e +@@ -2037,7 +2059,7 @@ evaluate_subexp_standard (struct type *expect_type, returns the correct type value */ deprecated_set_value_type (arg1, tmp_type); -- return value_ind (value_add (value_coerce_array (arg1), arg2)); +- return value_subscripted_rvalue (arg1, arg2, 0); + return value_subscripted_rvalue (arg1, offset_byte); } case BINOP_LOGICAL_AND: -@@ -2300,9 +2322,12 @@ evaluate_subexp_for_sizeof (struct expre +@@ -2686,9 +2708,12 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) case OP_VAR_VALUE: (*pos) += 4; - type = check_typedef (SYMBOL_TYPE (exp->elts[pc + 2].symbol)); - return -- value_from_longest (builtin_type_int, (LONGEST) TYPE_LENGTH (type)); +- value_from_longest (size_type, (LONGEST) TYPE_LENGTH (type)); + /* We do not need to call read_var_value but the object evaluation may + need to have executed object_address_set which needs valid + SYMBOL_VALUE_ADDRESS of the symbol. Still VALUE returned by + read_var_value we left as lazy. */ + type = value_type (read_var_value (exp->elts[pc + 2].symbol, NULL)); -+ return value_from_longest (builtin_type_int, (LONGEST) TYPE_LENGTH (type)); ++ return value_from_longest (size_type, (LONGEST) TYPE_LENGTH (type)); default: val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); ---- ./gdb/f-lang.h 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/f-lang.h 2008-11-08 22:39:57.000000000 +0100 -@@ -28,6 +28,10 @@ extern void f_error (char *); /* Defined +diff --git a/gdb/f-lang.h b/gdb/f-lang.h +index 3b3487e..4707603 100644 +--- a/gdb/f-lang.h ++++ b/gdb/f-lang.h +@@ -28,6 +28,10 @@ extern void f_error (char *); /* Defined in f-exp.y */ extern void f_print_type (struct type *, char *, struct ui_file *, int, int); @@ -1029,10 +1042,12 @@ fortran-dynamic-arrays-HEAD-l.patch +extern void f_object_address_data_valid_or_error (struct type *type); + extern int f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, - struct ui_file *, int, int, int, - enum val_prettyprint); ---- ./gdb/f-typeprint.c 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/f-typeprint.c 2008-11-08 22:39:57.000000000 +0100 + struct ui_file *, int, + const struct value_print_options *); +diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c +index 081d24a..47ad0f3 100644 +--- a/gdb/f-typeprint.c ++++ b/gdb/f-typeprint.c @@ -31,7 +31,7 @@ #include "gdbcore.h" #include "target.h" @@ -1051,7 +1066,7 @@ fortran-dynamic-arrays-HEAD-l.patch int, int, int); void f_type_print_varspec_prefix (struct type *, struct ui_file *, -@@ -48,6 +48,34 @@ void f_type_print_varspec_prefix (struct +@@ -48,6 +48,34 @@ void f_type_print_varspec_prefix (struct type *, struct ui_file *, void f_type_print_base (struct type *, struct ui_file *, int, int); @@ -1086,7 +1101,7 @@ fortran-dynamic-arrays-HEAD-l.patch /* LEVEL is the depth to indent lines by. */ void -@@ -57,6 +85,9 @@ f_print_type (struct type *type, char *v +@@ -57,6 +85,9 @@ f_print_type (struct type *type, char *varstring, struct ui_file *stream, enum type_code code; int demangled_args; @@ -1096,16 +1111,16 @@ fortran-dynamic-arrays-HEAD-l.patch f_type_print_base (type, stream, show, level); code = TYPE_CODE (type); if ((varstring != NULL && *varstring != '\0') -@@ -78,7 +109,7 @@ f_print_type (struct type *type, char *v - so don't print an additional pair of ()'s */ +@@ -80,7 +111,7 @@ f_print_type (struct type *type, char *varstring, struct ui_file *stream, + so don't print an additional pair of ()'s */ - demangled_args = varstring[strlen (varstring) - 1] == ')'; -- f_type_print_varspec_suffix (type, stream, show, 0, demangled_args); -+ f_type_print_varspec_suffix (type, stream, show, 0, demangled_args, 0); + demangled_args = varstring[strlen (varstring) - 1] == ')'; +- f_type_print_varspec_suffix (type, stream, show, 0, demangled_args); ++ f_type_print_varspec_suffix (type, stream, show, 0, demangled_args, 0); + } } - /* Print any asterisks or open-parentheses needed before the -@@ -147,11 +178,13 @@ f_type_print_varspec_prefix (struct type +@@ -150,11 +181,13 @@ f_type_print_varspec_prefix (struct type *type, struct ui_file *stream, static void f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, @@ -1121,7 +1136,7 @@ fortran-dynamic-arrays-HEAD-l.patch if (type == 0) return; -@@ -161,6 +194,9 @@ f_type_print_varspec_suffix (struct type +@@ -164,6 +197,9 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, QUIT; @@ -1131,7 +1146,7 @@ fortran-dynamic-arrays-HEAD-l.patch switch (TYPE_CODE (type)) { case TYPE_CODE_ARRAY: -@@ -170,7 +206,8 @@ f_type_print_varspec_suffix (struct type +@@ -173,7 +209,8 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, fprintf_filtered (stream, "("); if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY) @@ -1141,7 +1156,7 @@ fortran-dynamic-arrays-HEAD-l.patch lower_bound = f77_get_lowerbound (type); if (lower_bound != 1) /* Not the default. */ -@@ -188,7 +225,8 @@ f_type_print_varspec_suffix (struct type +@@ -191,7 +228,8 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, } if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY) @@ -1151,7 +1166,7 @@ fortran-dynamic-arrays-HEAD-l.patch if (arrayprint_recurse_level == 1) fprintf_filtered (stream, ")"); else -@@ -198,13 +236,14 @@ f_type_print_varspec_suffix (struct type +@@ -201,13 +239,14 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, case TYPE_CODE_PTR: case TYPE_CODE_REF: @@ -1168,9 +1183,20 @@ fortran-dynamic-arrays-HEAD-l.patch if (passed_a_ptr) fprintf_filtered (stream, ")"); ---- ./gdb/f-valprint.c 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/f-valprint.c 2008-11-08 22:48:10.000000000 +0100 -@@ -54,15 +54,17 @@ int f77_array_offset_tbl[MAX_FORTRAN_DIM +@@ -362,7 +401,7 @@ f_type_print_base (struct type *type, struct ui_file *stream, int show, + fprintfi_filtered (level, stream, "%s", + TYPE_FIELD_NAME (type, index)); + f_type_print_varspec_suffix (TYPE_FIELD_TYPE (type, index), +- stream, 0, 0, 0); ++ stream, 0, 0, 0, 0); + fputs_filtered ("\n", stream); + } + fprintfi_filtered (level, stream, "End Type "); +diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c +index f893b49..3c15edb 100644 +--- a/gdb/f-valprint.c ++++ b/gdb/f-valprint.c +@@ -54,15 +54,17 @@ int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; /* The following macro gives us the size of the nth dimension, Where n is 1 based. */ @@ -1200,7 +1226,7 @@ fortran-dynamic-arrays-HEAD-l.patch if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) { /* We have an assumed size array on our hands. Assume that -@@ -135,24 +139,29 @@ f77_create_arrayprint_offset_tbl (struct +@@ -135,24 +139,29 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) upper = f77_get_upperbound (tmp_type); lower = f77_get_lowerbound (tmp_type); @@ -1236,12 +1262,12 @@ fortran-dynamic-arrays-HEAD-l.patch } } -@@ -172,33 +181,33 @@ f77_print_array_1 (int nss, int ndimensi +@@ -172,34 +181,34 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, if (nss != ndimensions) { -- for (i = 0; (i < F77_DIM_SIZE (nss) && (*elts) < print_max); i++) -+ for (i = 0; (i < F77_DIM_COUNT (nss) && (*elts) < print_max); i++) +- for (i = 0; (i < F77_DIM_SIZE (nss) && (*elts) < options->print_max); i++) ++ for (i = 0; (i < F77_DIM_COUNT (nss) && (*elts) < options->print_max); i++) { fprintf_filtered (stream, "( "); f77_print_array_1 (nss + 1, ndimensions, TYPE_TARGET_TYPE (type), @@ -1249,17 +1275,17 @@ fortran-dynamic-arrays-HEAD-l.patch - address + i * F77_DIM_OFFSET (nss), + valaddr + i * F77_DIM_BYTE_STRIDE (nss), + address + i * F77_DIM_BYTE_STRIDE (nss), - stream, format, deref_ref, recurse, pretty, elts); + stream, recurse, options, elts); fprintf_filtered (stream, ") "); } -- if (*elts >= print_max && i < F77_DIM_SIZE (nss)) -+ if (*elts >= print_max && i < F77_DIM_COUNT (nss)) +- if (*elts >= options->print_max && i < F77_DIM_SIZE (nss)) ++ if (*elts >= options->print_max && i < F77_DIM_COUNT (nss)) fprintf_filtered (stream, "..."); } else { -- for (i = 0; i < F77_DIM_SIZE (nss) && (*elts) < print_max; -+ for (i = 0; i < F77_DIM_COUNT (nss) && (*elts) < print_max; +- for (i = 0; i < F77_DIM_SIZE (nss) && (*elts) < options->print_max; ++ for (i = 0; i < F77_DIM_COUNT (nss) && (*elts) < options->print_max; i++, (*elts)++) { val_print (TYPE_TARGET_TYPE (type), @@ -1268,18 +1294,19 @@ fortran-dynamic-arrays-HEAD-l.patch 0, - address + i * F77_DIM_OFFSET (ndimensions), + address + i * F77_DIM_BYTE_STRIDE (ndimensions), - stream, format, deref_ref, recurse, pretty); + stream, recurse, options, current_language); - if (i != (F77_DIM_SIZE (nss) - 1)) + if (i != (F77_DIM_COUNT (nss) - 1)) fprintf_filtered (stream, ", "); -- if ((*elts == print_max - 1) && (i != (F77_DIM_SIZE (nss) - 1))) -+ if ((*elts == print_max - 1) && (i != (F77_DIM_COUNT (nss) - 1))) + if ((*elts == options->print_max - 1) +- && (i != (F77_DIM_SIZE (nss) - 1))) ++ && (i != (F77_DIM_COUNT (nss) - 1))) fprintf_filtered (stream, "..."); } } -@@ -257,6 +266,9 @@ f_val_print (struct type *type, const gd +@@ -251,6 +260,9 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, CORE_ADDR addr; int index; @@ -1289,27 +1316,29 @@ fortran-dynamic-arrays-HEAD-l.patch CHECK_TYPEDEF (type); switch (TYPE_CODE (type)) { -@@ -599,8 +611,7 @@ info_common_command (char *comname, int +@@ -567,8 +579,7 @@ info_common_command (char *comname, int from_tty) while (entry != NULL) { - printf_filtered ("%s = ", DEPRECATED_SYMBOL_NAME (entry->symbol)); + printf_filtered ("%s = ", SYMBOL_PRINT_NAME (entry->symbol)); - print_variable_value (entry->symbol, fi, gdb_stdout); - printf_filtered ("\n"); + print_variable_value_nl (entry->symbol, fi, gdb_stdout); entry = entry->next; } } ---- ./gdb/findvar.c 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/findvar.c 2008-11-08 22:39:57.000000000 +0100 -@@ -34,6 +34,7 @@ - #include "regcache.h" +diff --git a/gdb/findvar.c b/gdb/findvar.c +index f7b6e63..3989957 100644 +--- a/gdb/findvar.c ++++ b/gdb/findvar.c +@@ -35,6 +35,7 @@ #include "user-regs.h" #include "block.h" + #include "objfiles.h" +#include "dwarf2loc.h" /* Basic byte-swapping routines. GDB has needed these for a long time... All extract a target-format integer at ADDR which is LEN bytes long. */ -@@ -365,29 +366,16 @@ symbol_read_needs_frame (struct symbol * +@@ -383,27 +384,16 @@ symbol_read_needs_frame (struct symbol *sym) and a stack frame id, read the value of the variable and return a (pointer to a) struct value containing the value. If the variable cannot be found, return a zero pointer. @@ -1328,9 +1357,7 @@ fortran-dynamic-arrays-HEAD-l.patch - int len; - - if (SYMBOL_CLASS (var) == LOC_COMPUTED -- || SYMBOL_CLASS (var) == LOC_COMPUTED_ARG -- || SYMBOL_CLASS (var) == LOC_REGISTER -- || SYMBOL_CLASS (var) == LOC_REGPARM) +- || SYMBOL_CLASS (var) == LOC_REGISTER) - /* These cases do not use V. */ - v = NULL; - else @@ -1343,7 +1370,7 @@ fortran-dynamic-arrays-HEAD-l.patch /* FIXME drow/2003-09-06: this call to the selected frame should be pushed upwards to the callers. */ -@@ -397,31 +385,39 @@ read_var_value (struct symbol *var, stru +@@ -413,31 +403,39 @@ read_var_value (struct symbol *var, struct frame_info *frame) switch (SYMBOL_CLASS (var)) { case LOC_CONST: @@ -1367,7 +1394,7 @@ fortran-dynamic-arrays-HEAD-l.patch - { - CORE_ADDR addr - = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var), -- SYMBOL_BFD_SECTION (var)); +- SYMBOL_OBJ_SECTION (var)); - store_typed_address (value_contents_raw (v), type, addr); - } - else @@ -1383,7 +1410,7 @@ fortran-dynamic-arrays-HEAD-l.patch + { + CORE_ADDR addr + = symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var), -+ SYMBOL_BFD_SECTION (var)); ++ SYMBOL_OBJ_SECTION (var)); + store_typed_address (value_contents_raw (v), type, addr); + } + else @@ -1402,13 +1429,13 @@ fortran-dynamic-arrays-HEAD-l.patch return v; } -@@ -503,12 +499,23 @@ addresses have not been bound by the dyn +@@ -485,12 +483,23 @@ read_var_value (struct symbol *var, struct frame_info *frame) break; case LOC_BLOCK: - if (overlay_debugging) - VALUE_ADDRESS (v) = symbol_overlayed_address -- (BLOCK_START (SYMBOL_BLOCK_VALUE (var)), SYMBOL_BFD_SECTION (var)); +- (BLOCK_START (SYMBOL_BLOCK_VALUE (var)), SYMBOL_OBJ_SECTION (var)); - else - VALUE_ADDRESS (v) = BLOCK_START (SYMBOL_BLOCK_VALUE (var)); - return v; @@ -1418,7 +1445,7 @@ fortran-dynamic-arrays-HEAD-l.patch + + if (overlay_debugging) + addr = symbol_overlayed_address -+ (BLOCK_START (SYMBOL_BLOCK_VALUE (var)), SYMBOL_BFD_SECTION (var)); ++ (BLOCK_START (SYMBOL_BLOCK_VALUE (var)), SYMBOL_OBJ_SECTION (var)); + else + addr = BLOCK_START (SYMBOL_BLOCK_VALUE (var)); + /* ADDR is set here for ALLOCATE_VALUE's CHECK_TYPEDEF for @@ -1431,8 +1458,8 @@ fortran-dynamic-arrays-HEAD-l.patch + } case LOC_REGISTER: - case LOC_REGPARM: -@@ -532,7 +539,6 @@ addresses have not been bound by the dyn + case LOC_REGPARM_ADDR: +@@ -511,7 +520,6 @@ read_var_value (struct symbol *var, struct frame_info *frame) error (_("Value of register variable not available.")); addr = value_as_address (regval); @@ -1440,7 +1467,7 @@ fortran-dynamic-arrays-HEAD-l.patch } else { -@@ -572,18 +578,33 @@ addresses have not been bound by the dyn +@@ -556,18 +564,33 @@ read_var_value (struct symbol *var, struct frame_info *frame) break; case LOC_OPTIMIZED_OUT: @@ -1480,7 +1507,7 @@ fortran-dynamic-arrays-HEAD-l.patch } /* Install default attributes for register values. */ -@@ -620,10 +641,11 @@ struct value * +@@ -604,10 +627,11 @@ struct value * value_from_register (struct type *type, int regnum, struct frame_info *frame) { struct gdbarch *gdbarch = get_frame_arch (frame); @@ -1494,7 +1521,7 @@ fortran-dynamic-arrays-HEAD-l.patch { /* The ISA/ABI need to something weird when obtaining the specified value from this register. It might need to -@@ -637,7 +659,7 @@ value_from_register (struct type *type, +@@ -621,7 +645,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) VALUE_FRAME_ID (v) = get_frame_id (frame); VALUE_REGNUM (v) = regnum; gdbarch_register_to_value (gdbarch, @@ -1503,8 +1530,10 @@ fortran-dynamic-arrays-HEAD-l.patch } else { ---- ./gdb/gdbtypes.c 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/gdbtypes.c 2008-11-08 22:46:45.000000000 +0100 +diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c +index 5b9d0e8..f814ce3 100644 +--- a/gdb/gdbtypes.c ++++ b/gdb/gdbtypes.c @@ -38,6 +38,8 @@ #include "cp-abi.h" #include "gdb_assert.h" @@ -1514,7 +1543,7 @@ fortran-dynamic-arrays-HEAD-l.patch /* These variables point to the objects representing the predefined C data types. */ -@@ -471,11 +473,13 @@ make_qualified_type (struct type *type, +@@ -478,11 +480,13 @@ make_qualified_type (struct type *type, int new_flags, struct type *ntype; ntype = type; @@ -1533,7 +1562,7 @@ fortran-dynamic-arrays-HEAD-l.patch /* Create a new type instance. */ if (storage == NULL) -@@ -682,16 +686,21 @@ allocate_stub_method (struct type *type) +@@ -690,16 +694,21 @@ allocate_stub_method (struct type *type) RESULT_TYPE, or creating a new type, inheriting the objfile from INDEX_TYPE. @@ -1559,8 +1588,8 @@ fortran-dynamic-arrays-HEAD-l.patch if (result_type == NULL) { result_type = alloc_type (TYPE_OBJFILE (index_type)); -@@ -702,17 +711,33 @@ create_range_type (struct type *result_t - TYPE_FLAGS (result_type) |= TYPE_FLAG_TARGET_STUB; +@@ -710,17 +719,33 @@ create_range_type (struct type *result_type, struct type *index_type, + TYPE_TARGET_STUB (result_type) = 1; else TYPE_LENGTH (result_type) = TYPE_LENGTH (check_typedef (index_type)); - TYPE_NFIELDS (result_type) = 2; @@ -1592,14 +1621,14 @@ fortran-dynamic-arrays-HEAD-l.patch + TYPE_HIGH_BOUND (result_type) = high_bound; if (low_bound >= 0) - TYPE_FLAGS (result_type) |= TYPE_FLAG_UNSIGNED; + TYPE_UNSIGNED (result_type) = 1; - return (result_type); + return result_type; } /* Set *LOWP and *HIGHP to the lower and upper bounds of discrete type -@@ -726,6 +751,9 @@ get_discrete_bounds (struct type *type, +@@ -734,6 +759,9 @@ get_discrete_bounds (struct type *type, LONGEST *lowp, LONGEST *highp) switch (TYPE_CODE (type)) { case TYPE_CODE_RANGE: @@ -1609,7 +1638,7 @@ fortran-dynamic-arrays-HEAD-l.patch *lowp = TYPE_LOW_BOUND (type); *highp = TYPE_HIGH_BOUND (type); return 1; -@@ -808,17 +836,6 @@ create_array_type (struct type *result_t +@@ -816,17 +844,6 @@ create_array_type (struct type *result_type, } TYPE_CODE (result_type) = TYPE_CODE_ARRAY; TYPE_TARGET_TYPE (result_type) = element_type; @@ -1627,7 +1656,7 @@ fortran-dynamic-arrays-HEAD-l.patch TYPE_NFIELDS (result_type) = 1; TYPE_FIELDS (result_type) = (struct field *) TYPE_ALLOC (result_type, sizeof (struct field)); -@@ -826,9 +843,48 @@ create_array_type (struct type *result_t +@@ -834,9 +851,48 @@ create_array_type (struct type *result_type, TYPE_FIELD_TYPE (result_type, 0) = range_type; TYPE_VPTR_FIELDNO (result_type) = -1; @@ -1660,25 +1689,25 @@ fortran-dynamic-arrays-HEAD-l.patch + } + + if (TYPE_DYNAMIC (range_type)) -+ TYPE_FLAGS (result_type) |= TYPE_FLAG_DYNAMIC; ++ TYPE_DYNAMIC (result_type) = 1; + + /* Multidimensional dynamic arrays need to have all the outer dimensions + dynamic to update the outer TYPE_TARGET_TYPE pointer with the new type + with statically evaluated dimensions. */ + if (TYPE_DYNAMIC (element_type)) -+ TYPE_FLAGS (result_type) |= TYPE_FLAG_DYNAMIC; ++ TYPE_DYNAMIC (result_type) = 1; + if (TYPE_LENGTH (result_type) == 0) -- TYPE_FLAGS (result_type) |= TYPE_FLAG_TARGET_STUB; +- TYPE_TARGET_STUB (result_type) = 1; + { + /* The real size will be computed for specific instances by + CHECK_TYPEDEF. */ -+ TYPE_FLAGS (result_type) |= TYPE_FLAG_TARGET_STUB; ++ TYPE_TARGET_STUB (result_type) = 1; + } return (result_type); } -@@ -1377,6 +1433,65 @@ stub_noname_complaint (void) +@@ -1380,6 +1436,65 @@ stub_noname_complaint (void) complaint (&symfile_complaints, _("stub type has NULL name")); } @@ -1744,7 +1773,7 @@ fortran-dynamic-arrays-HEAD-l.patch /* Added by Bryan Boreham, Kewill, Sun Sep 17 18:07:17 1989. If this is a stubbed struct (i.e. declared as struct foo *), see if -@@ -1393,7 +1508,8 @@ stub_noname_complaint (void) +@@ -1396,7 +1511,8 @@ stub_noname_complaint (void) /* Find the real type of TYPE. This function returns the real type, after removing all layers of typedefs and completing opaque or stub types. Completion changes the TYPE argument, but stripping of @@ -1754,7 +1783,7 @@ fortran-dynamic-arrays-HEAD-l.patch struct type * check_typedef (struct type *type) -@@ -1505,34 +1621,87 @@ check_typedef (struct type *type) +@@ -1506,34 +1622,87 @@ check_typedef (struct type *type) } } @@ -1816,7 +1845,7 @@ fortran-dynamic-arrays-HEAD-l.patch + meanint the count (not the high bound) into a regular bound. */ + if (TYPE_RANGE_HIGH_BOUND_IS_COUNT (type)) + { -+ TYPE_FLAGS (type) &= ~TYPE_FLAG_RANGE_HIGH_BOUND_IS_COUNT; ++ TYPE_RANGE_HIGH_BOUND_IS_COUNT (type) = 0; + TYPE_HIGH_BOUND (type) = TYPE_LOW_BOUND (type) + + TYPE_HIGH_BOUND (type) - 1; + } @@ -1857,14 +1886,14 @@ fortran-dynamic-arrays-HEAD-l.patch - TYPE_LENGTH (type) = nb_elements * TYPE_LENGTH (target_type); + number of elements and the target type's length. */ + TYPE_LENGTH (type) = type_length_get (type, target_type, 0); - TYPE_FLAGS (type) &= ~TYPE_FLAG_TARGET_STUB; + TYPE_TARGET_STUB (type) = 0; } else if (TYPE_CODE (type) == TYPE_CODE_RANGE) -@@ -1540,9 +1709,12 @@ check_typedef (struct type *type) +@@ -1541,9 +1710,12 @@ check_typedef (struct type *type) TYPE_LENGTH (type) = TYPE_LENGTH (target_type); - TYPE_FLAGS (type) &= ~TYPE_FLAG_TARGET_STUB; + TYPE_TARGET_STUB (type) = 0; } -+ TYPE_FLAGS (type) &= ~TYPE_FLAG_DYNAMIC; ++ TYPE_DYNAMIC (type) = 0; } + /* Cache TYPE_LENGTH for future use. */ @@ -1873,28 +1902,34 @@ fortran-dynamic-arrays-HEAD-l.patch return type; } ---- ./gdb/gdbtypes.h 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/gdbtypes.h 2008-11-08 22:39:57.000000000 +0100 -@@ -295,6 +295,16 @@ enum type_code - #define TYPE_FLAG_NOTTEXT (1 << 17) - #define TYPE_NOTTEXT(t) (TYPE_FLAGS (t) & TYPE_FLAG_NOTTEXT) +diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h +index 333eb31..a925dac 100644 +--- a/gdb/gdbtypes.h ++++ b/gdb/gdbtypes.h +@@ -209,6 +209,11 @@ enum type_instance_flag_value + + #define TYPE_TARGET_STUB(t) (TYPE_MAIN_TYPE (t)->flag_target_stub) +/* Type needs to be evaluated on each CHECK_TYPEDEF and its results must not be + sticky. Used for TYPE_RANGE_BOUND_IS_DWARF_BLOCK. */ + -+#define TYPE_FLAG_DYNAMIC (1 << 18) -+#define TYPE_DYNAMIC(t) (TYPE_FLAGS (t) & TYPE_FLAG_DYNAMIC) ++#define TYPE_DYNAMIC(t) (TYPE_MAIN_TYPE (t)->flag_dynamic) + -+/* Is HIGH_BOUND a low-bound relative count (1) or the high bound itself (0)? */ -+#define TYPE_FLAG_RANGE_HIGH_BOUND_IS_COUNT (1 << 19) -+#define TYPE_RANGE_HIGH_BOUND_IS_COUNT(t) (TYPE_FLAGS (t) & TYPE_FLAG_RANGE_HIGH_BOUND_IS_COUNT) -+ - /* Determine which field of the union main_type.fields[x].loc is used. */ + /* Static type. If this is set, the corresponding type had + * a static modifier. + * Note: This may be unnecessary, since static data members +@@ -352,6 +357,8 @@ struct main_type + unsigned int flag_stub_supported : 1; + unsigned int flag_nottext : 1; + unsigned int flag_fixed_instance : 1; ++ unsigned int flag_dynamic : 1; ++ unsigned int flag_range_high_bound_is_count : 1; - enum field_loc_kind -@@ -376,6 +386,15 @@ struct main_type + /* Number of fields described for this type. This field appears at + this location because it packs nicely here. */ +@@ -414,6 +421,15 @@ struct main_type - short vptr_fieldno; + struct type *target_type; + /* For DW_AT_data_location. FIXME: Support also its constant form. */ + struct dwarf2_locexpr_baton *data_location; @@ -1908,7 +1943,7 @@ fortran-dynamic-arrays-HEAD-l.patch /* For structure and union types, a description of each field. For set and pascal array types, there is one "field", whose type is the domain type of the set or array. -@@ -763,9 +782,9 @@ extern void allocate_cplus_struct_type ( +@@ -795,9 +811,9 @@ extern void allocate_cplus_struct_type (struct type *); #define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type #define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type #define TYPE_CHAIN(thistype) (thistype)->chain @@ -1921,10 +1956,10 @@ fortran-dynamic-arrays-HEAD-l.patch calls check_typedef, TYPE_LENGTH (VALUE_TYPE (X)) is safe. */ #define TYPE_LENGTH(thistype) (thistype)->length #define TYPE_OBJFILE(thistype) TYPE_MAIN_TYPE(thistype)->objfile -@@ -777,23 +796,49 @@ extern void allocate_cplus_struct_type ( +@@ -807,23 +823,53 @@ extern void allocate_cplus_struct_type (struct type *); + #define TYPE_NFIELDS(thistype) TYPE_MAIN_TYPE(thistype)->nfields #define TYPE_FIELDS(thistype) TYPE_MAIN_TYPE(thistype)->fields #define TYPE_TEMPLATE_ARGS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->template_args - #define TYPE_INSTANTIATIONS(thistype) TYPE_CPLUS_SPECIFIC(thistype)->instantiations +#define TYPE_DATA_LOCATION(thistype) TYPE_MAIN_TYPE (thistype)->data_location +#define TYPE_ALLOCATED(thistype) TYPE_MAIN_TYPE (thistype)->allocated +#define TYPE_ASSOCIATED(thistype) TYPE_MAIN_TYPE (thistype)->associated @@ -1935,13 +1970,14 @@ fortran-dynamic-arrays-HEAD-l.patch + (TYPE_FIELD_BITPOS (range_type, 2) = (n)) #define TYPE_LOW_BOUND(range_type) TYPE_FIELD_BITPOS (range_type, 0) #define TYPE_HIGH_BOUND(range_type) TYPE_FIELD_BITPOS (range_type, 1) -+#define TYPE_BYTE_STRIDE(range_type) \ -+ (TYPE_NFIELDS (range_type) < 3 ? 0 : TYPE_FIELD_BITPOS (range_type, 2)) - +- -/* Moto-specific stuff for FORTRAN arrays */ - -#define TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED(arraytype) \ - (TYPE_FIELD_ARTIFICIAL((TYPE_FIELD_TYPE((arraytype),0)),1)) ++#define TYPE_BYTE_STRIDE(range_type) \ ++ (TYPE_NFIELDS (range_type) < 3 ? 0 : TYPE_FIELD_BITPOS (range_type, 2)) ++ +/* Whether we should use TYPE_FIELD_DWARF_BLOCK (and not TYPE_FIELD_BITPOS). */ +#define TYPE_RANGE_BOUND_IS_DWARF_BLOCK(range_type, fieldno) \ + (TYPE_FIELD_LOC_KIND (range_type, fieldno) == FIELD_LOC_KIND_DWARF_BLOCK) @@ -1952,6 +1988,10 @@ fortran-dynamic-arrays-HEAD-l.patch +#define TYPE_ARRAY_BOUND_IS_DWARF_BLOCK(array_type, fieldno) \ + TYPE_RANGE_BOUND_IS_DWARF_BLOCK (TYPE_INDEX_TYPE (array_type), fieldno) + ++/* Is HIGH_BOUND a low-bound relative count (1) or the high bound itself (0)? */ ++#define TYPE_RANGE_HIGH_BOUND_IS_COUNT(range_type) \ ++ (TYPE_MAIN_TYPE (range_type)->flag_range_high_bound_is_count) ++ +/* Unbound arrays, such as GCC array[]; at end of struct. */ +#define TYPE_RANGE_LOWER_BOUND_IS_UNDEFINED(rangetype) \ + TYPE_FIELD_ARTIFICIAL((rangetype),0) @@ -1980,7 +2020,7 @@ fortran-dynamic-arrays-HEAD-l.patch /* C++ */ -@@ -1256,12 +1301,26 @@ extern struct type *make_function_type ( +@@ -1162,12 +1208,26 @@ extern struct type *make_function_type (struct type *, struct type **); extern struct type *lookup_function_type (struct type *); @@ -2007,17 +2047,19 @@ fortran-dynamic-arrays-HEAD-l.patch extern struct type *create_string_type (struct type *, struct type *); extern struct type *create_set_type (struct type *, struct type *); ---- ./gdb/printcmd.c 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/printcmd.c 2008-11-08 22:49:51.000000000 +0100 -@@ -42,6 +42,7 @@ - #include "block.h" +diff --git a/gdb/printcmd.c b/gdb/printcmd.c +index 6d6b915..2ab5a56 100644 +--- a/gdb/printcmd.c ++++ b/gdb/printcmd.c +@@ -43,6 +43,7 @@ #include "disasm.h" #include "dfp.h" + #include "valprint.h" +#include "exceptions.h" #ifdef TUI #include "tui/tui.h" /* For tui_active et.al. */ -@@ -888,6 +889,11 @@ print_command_1 (char *exp, int inspect, +@@ -876,6 +877,11 @@ print_command_1 (char *exp, int inspect, int voidprint) else val = access_value_history (0); @@ -2029,7 +2071,7 @@ fortran-dynamic-arrays-HEAD-l.patch if (voidprint || (val && value_type (val) && TYPE_CODE (value_type (val)) != TYPE_CODE_VOID)) { -@@ -1716,15 +1722,26 @@ disable_display_command (char *args, int +@@ -1731,17 +1737,30 @@ disable_display_command (char *args, int from_tty) /* Print the value in stack frame FRAME of a variable specified by a @@ -2043,10 +2085,12 @@ fortran-dynamic-arrays-HEAD-l.patch + struct ui_file *stream) { - struct value *val = read_var_value (var, frame); +- struct value_print_options opts; + struct value *val = NULL; /* A false GCC warning. */ + struct gdb_exception e; -- value_print (val, stream, 0, Val_pretty_default); +- get_user_print_options (&opts); +- value_print (val, stream, &opts); + TRY_CATCH (e, RETURN_MASK_ERROR) + { + val = read_var_value (var, frame); @@ -2055,15 +2099,21 @@ fortran-dynamic-arrays-HEAD-l.patch + exception_print (stream, e); + else + { -+ value_print (val, stream, 0, Val_pretty_default); ++ struct value_print_options opts; ++ ++ get_user_print_options (&opts); ++ value_print (val, stream, &opts); ++ + fputc_filtered ('\n', stream); + } } static void ---- ./gdb/stack.c 2008-03-17 16:06:24.000000000 +0100 -+++ ./gdb/stack.c 2008-11-08 22:48:28.000000000 +0100 -@@ -1381,8 +1381,7 @@ print_block_frame_locals (struct block * +diff --git a/gdb/stack.c b/gdb/stack.c +index 3c1019b..79afba4 100644 +--- a/gdb/stack.c ++++ b/gdb/stack.c +@@ -1378,8 +1378,7 @@ print_block_frame_locals (struct block *b, struct frame_info *frame, fputs_filtered ("\t", stream); fputs_filtered (SYMBOL_PRINT_NAME (sym), stream); fputs_filtered (" = ", stream); @@ -2073,18 +2123,21 @@ fortran-dynamic-arrays-HEAD-l.patch break; default: -@@ -1598,8 +1597,7 @@ print_frame_arg_vars (struct frame_info +@@ -1591,8 +1590,7 @@ print_frame_arg_vars (struct frame_info *frame, struct ui_file *stream) - sym2 = lookup_symbol (DEPRECATED_SYMBOL_NAME (sym), - b, VAR_DOMAIN, NULL, NULL); + sym2 = lookup_symbol (SYMBOL_LINKAGE_NAME (sym), + b, VAR_DOMAIN, NULL); - print_variable_value (sym2, frame, stream); - fprintf_filtered (stream, "\n"); + print_variable_value_nl (sym2, frame, stream); - break; + } + } - default: ---- ./gdb/testsuite/gdb.base/vla-overflow.c 1970-01-01 01:00:00.000000000 +0100 -+++ ./gdb/testsuite/gdb.base/vla-overflow.c 2008-11-08 22:39:57.000000000 +0100 +diff --git a/gdb/testsuite/gdb.base/vla-overflow.c b/gdb/testsuite/gdb.base/vla-overflow.c +new file mode 100644 +index 0000000..c5d5ee0 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/vla-overflow.c @@ -0,0 +1,30 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -2116,8 +2169,11 @@ fortran-dynamic-arrays-HEAD-l.patch + + return 0; +} ---- ./gdb/testsuite/gdb.base/vla-overflow.exp 1970-01-01 01:00:00.000000000 +0100 -+++ ./gdb/testsuite/gdb.base/vla-overflow.exp 2008-11-08 22:39:57.000000000 +0100 +diff --git a/gdb/testsuite/gdb.base/vla-overflow.exp b/gdb/testsuite/gdb.base/vla-overflow.exp +new file mode 100644 +index 0000000..7203a48 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/vla-overflow.exp @@ -0,0 +1,108 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -2227,8 +2283,11 @@ fortran-dynamic-arrays-HEAD-l.patch +gdb_test "bt" "in \[^ \]*abort \\(.* in main \\(.*" "Backtrace after abort()" + +verbose -log "kb_found in bt after abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" ---- ./gdb/testsuite/gdb.base/vla.c 1970-01-01 01:00:00.000000000 +0100 -+++ ./gdb/testsuite/gdb.base/vla.c 2008-11-08 22:39:57.000000000 +0100 +diff --git a/gdb/testsuite/gdb.base/vla.c b/gdb/testsuite/gdb.base/vla.c +new file mode 100644 +index 0000000..e1f3ed1 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/vla.c @@ -0,0 +1,55 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -2285,8 +2344,11 @@ fortran-dynamic-arrays-HEAD-l.patch + foo (78); + return 0; +} ---- ./gdb/testsuite/gdb.base/vla.exp 1970-01-01 01:00:00.000000000 +0100 -+++ ./gdb/testsuite/gdb.base/vla.exp 2008-11-08 22:39:57.000000000 +0100 +diff --git a/gdb/testsuite/gdb.base/vla.exp b/gdb/testsuite/gdb.base/vla.exp +new file mode 100644 +index 0000000..5da7378 +--- /dev/null ++++ b/gdb/testsuite/gdb.base/vla.exp @@ -0,0 +1,62 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -2350,8 +2412,11 @@ fortran-dynamic-arrays-HEAD-l.patch +gdb_test "p temp1" " = '1' " "second: print temp1" +gdb_test "p temp2" " = '2' " "second: print temp2" +gdb_test "p temp3" " = '3' " "second: print temp3" ---- ./gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-func.S 1970-01-01 01:00:00.000000000 +0100 -+++ ./gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-func.S 2008-11-08 22:46:45.000000000 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-func.S b/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-func.S +new file mode 100644 +index 0000000..aae5b56 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-func.S @@ -0,0 +1,336 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -2689,8 +2754,11 @@ fortran-dynamic-arrays-HEAD-l.patch + .string "short int" + .ident "GCC: (GNU) 4.3.2 20081007 (Red Hat 4.3.2-6)" + .section .note.GNU-stack,"",@progbits ---- ./gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-main.c 1970-01-01 01:00:00.000000000 +0100 -+++ ./gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-main.c 2008-11-08 22:46:45.000000000 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-main.c b/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-main.c +new file mode 100644 +index 0000000..d4ad8eb +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing-main.c @@ -0,0 +1,26 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -2718,8 +2786,11 @@ fortran-dynamic-arrays-HEAD-l.patch + func (); + return 0; +} ---- ./gdb/testsuite/gdb.dwarf2/dw2-framebase-missing.exp 1970-01-01 01:00:00.000000000 +0100 -+++ ./gdb/testsuite/gdb.dwarf2/dw2-framebase-missing.exp 2008-11-08 22:46:45.000000000 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing.exp b/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing.exp +new file mode 100644 +index 0000000..8d047bb +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-framebase-missing.exp @@ -0,0 +1,83 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -2804,8 +2875,11 @@ fortran-dynamic-arrays-HEAD-l.patch + +# `abort' can get expressed as `*__GI_abort'. +gdb_test "bt full" "in \[^ \]*abort \\(.*in func \\(.*\ti = Could not find the frame base for \"func\".\r\n.*in main \\(.*" "Backtrace after abort()" ---- ./gdb/testsuite/gdb.dwarf2/dw2-stripped.c 1970-01-01 01:00:00.000000000 +0100 -+++ ./gdb/testsuite/gdb.dwarf2/dw2-stripped.c 2008-11-08 22:39:57.000000000 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.c b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c +new file mode 100644 +index 0000000..1f02d90 +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c @@ -0,0 +1,42 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -2849,8 +2923,11 @@ fortran-dynamic-arrays-HEAD-l.patch + func1 (1, 2); + return 0; +} ---- ./gdb/testsuite/gdb.dwarf2/dw2-stripped.exp 1970-01-01 01:00:00.000000000 +0100 -+++ ./gdb/testsuite/gdb.dwarf2/dw2-stripped.exp 2008-11-08 22:39:57.000000000 +0100 +diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp b/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp +new file mode 100644 +index 0000000..1c6e84a +--- /dev/null ++++ b/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp @@ -0,0 +1,79 @@ +# Copyright 2006 Free Software Foundation, Inc. + @@ -2931,8 +3008,11 @@ fortran-dynamic-arrays-HEAD-l.patch +gdb_test "step" \ + "func.* \\(.*\\) at .*" \ + "step" ---- ./gdb/testsuite/gdb.fortran/dynamic.exp 1970-01-01 01:00:00.000000000 +0100 -+++ ./gdb/testsuite/gdb.fortran/dynamic.exp 2008-11-08 22:39:57.000000000 +0100 +diff --git a/gdb/testsuite/gdb.fortran/dynamic.exp b/gdb/testsuite/gdb.fortran/dynamic.exp +new file mode 100644 +index 0000000..91f47d7 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/dynamic.exp @@ -0,0 +1,141 @@ +# Copyright 2007 Free Software Foundation, Inc. + @@ -3075,8 +3155,11 @@ fortran-dynamic-arrays-HEAD-l.patch +gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9" +# maps to foo::vary(1,3) +gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10" ---- ./gdb/testsuite/gdb.fortran/dynamic.f90 1970-01-01 01:00:00.000000000 +0100 -+++ ./gdb/testsuite/gdb.fortran/dynamic.f90 2008-11-08 22:39:57.000000000 +0100 +diff --git a/gdb/testsuite/gdb.fortran/dynamic.f90 b/gdb/testsuite/gdb.fortran/dynamic.f90 +new file mode 100644 +index 0000000..9dd7ce0 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/dynamic.f90 @@ -0,0 +1,97 @@ +! Copyright 2007 Free Software Foundation, Inc. +! @@ -3175,8 +3258,11 @@ fortran-dynamic-arrays-HEAD-l.patch + if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort + if (x (3, 1) .ne. 10) call abort +end ---- ./gdb/testsuite/gdb.fortran/string.exp 1970-01-01 01:00:00.000000000 +0100 -+++ ./gdb/testsuite/gdb.fortran/string.exp 2008-11-08 22:39:57.000000000 +0100 +diff --git a/gdb/testsuite/gdb.fortran/string.exp b/gdb/testsuite/gdb.fortran/string.exp +new file mode 100644 +index 0000000..b1120c3 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/string.exp @@ -0,0 +1,59 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -3237,8 +3323,11 @@ fortran-dynamic-arrays-HEAD-l.patch +gdb_continue_to_breakpoint "var-finish" +gdb_test "p e" "\\$\[0-9\]* = 'e '" "p e re-set" +gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f2 ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\)" "p *f re-set" ---- ./gdb/testsuite/gdb.fortran/string.f90 1970-01-01 01:00:00.000000000 +0100 -+++ ./gdb/testsuite/gdb.fortran/string.f90 2008-11-08 22:39:57.000000000 +0100 +diff --git a/gdb/testsuite/gdb.fortran/string.f90 b/gdb/testsuite/gdb.fortran/string.f90 +new file mode 100644 +index 0000000..66cd98f +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/string.f90 @@ -0,0 +1,37 @@ +! Copyright 2008 Free Software Foundation, Inc. +! @@ -3277,17 +3366,19 @@ fortran-dynamic-arrays-HEAD-l.patch + h = 'h' + call foo (g, h) +end ---- ./gdb/typeprint.c 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/typeprint.c 2008-11-08 22:39:57.000000000 +0100 -@@ -33,6 +33,7 @@ - #include "cp-abi.h" +diff --git a/gdb/typeprint.c b/gdb/typeprint.c +index edf87cd..174fb58 100644 +--- a/gdb/typeprint.c ++++ b/gdb/typeprint.c +@@ -34,6 +34,7 @@ #include "typeprint.h" #include "gdb_string.h" + #include "valprint.h" +#include "dwarf2loc.h" #include - /* For real-type printing in whatis_exp() */ -@@ -102,6 +103,9 @@ void + extern void _initialize_typeprint (void); +@@ -75,6 +76,9 @@ void type_print (struct type *type, char *varstring, struct ui_file *stream, int show) { @@ -3297,7 +3388,7 @@ fortran-dynamic-arrays-HEAD-l.patch LA_PRINT_TYPE (type, varstring, stream, show, 0); } -@@ -113,7 +117,8 @@ whatis_exp (char *exp, int show) +@@ -86,7 +90,8 @@ whatis_exp (char *exp, int show) { struct expression *expr; struct value *val; @@ -3307,7 +3398,7 @@ fortran-dynamic-arrays-HEAD-l.patch struct type *real_type = NULL; struct type *type; int full = 0; -@@ -123,12 +128,13 @@ whatis_exp (char *exp, int show) +@@ -97,12 +102,13 @@ whatis_exp (char *exp, int show) if (exp) { expr = parse_expression (exp); @@ -3321,8 +3412,8 @@ fortran-dynamic-arrays-HEAD-l.patch + object_address_set (VALUE_ADDRESS (val)); type = value_type (val); - if (objectprint) -@@ -164,8 +170,7 @@ whatis_exp (char *exp, int show) + get_user_print_options (&opts); +@@ -139,8 +145,7 @@ whatis_exp (char *exp, int show) type_print (type, "", gdb_stdout, show); printf_filtered ("\n"); @@ -3332,17 +3423,11 @@ fortran-dynamic-arrays-HEAD-l.patch } static void ---- ./gdb/valarith.c 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/valarith.c 2008-11-08 22:39:57.000000000 +0100 -@@ -39,7 +39,6 @@ - #define TRUNCATION_TOWARDS_ZERO ((-5 / 2) == -2) - #endif - --static struct value *value_subscripted_rvalue (struct value *, struct value *, int); - static struct type *unop_result_type (enum exp_opcode op, struct type *type1); - static struct type *binop_result_type (enum exp_opcode op, struct type *type1, - struct type *type2); -@@ -180,9 +179,9 @@ an integer nor a pointer of the same typ +diff --git a/gdb/valarith.c b/gdb/valarith.c +index 59f67d3..f5517ae 100644 +--- a/gdb/valarith.c ++++ b/gdb/valarith.c +@@ -164,9 +164,9 @@ an integer nor a pointer of the same type.")); struct value * value_subscript (struct value *array, struct value *idx) { @@ -3353,7 +3438,7 @@ fortran-dynamic-arrays-HEAD-l.patch array = coerce_ref (array); tarray = check_typedef (value_type (array)); -@@ -195,13 +194,26 @@ value_subscript (struct value *array, st +@@ -179,13 +179,26 @@ value_subscript (struct value *array, struct value *idx) get_discrete_bounds (range_type, &lowerbound, &upperbound); if (VALUE_LVAL (array) != lval_memory) @@ -3383,30 +3468,27 @@ fortran-dynamic-arrays-HEAD-l.patch /* Emit warning unless we have an array of unknown size. An array of unknown size has lowerbound 0 and upperbound -1. */ if (upperbound > -1) -@@ -210,12 +222,7 @@ value_subscript (struct value *array, st +@@ -194,53 +207,62 @@ value_subscript (struct value *array, struct value *idx) c_style = 1; } - if (lowerbound != 0) - { -- bound = value_from_longest (builtin_type_int, (LONGEST) lowerbound); -- idx = value_sub (idx, bound); +- bound = value_from_longest (value_type (idx), (LONGEST) lowerbound); +- idx = value_binop (idx, bound, BINOP_SUB); - } - + index -= lowerbound; array = value_coerce_array (array); } -@@ -248,43 +255,57 @@ value_subscript (struct value *array, st - } - if (c_style) -- return value_ind (value_add (array, idx)); +- return value_ind (value_ptradd (array, idx)); + { + struct value *idx; + + idx = value_from_longest (builtin_type_int32, index); -+ return value_ind (value_add (array, idx)); ++ return value_ind (value_ptradd (array, idx)); + } else error (_("not an array or string")); @@ -3421,9 +3503,8 @@ fortran-dynamic-arrays-HEAD-l.patch + element, it must be expressed in bytes (therefore multiplied by + check_typedef (TYPE_TARGET_TYPE (array_type)). */ --static struct value * + struct value * -value_subscripted_rvalue (struct value *array, struct value *idx, int lowerbound) -+struct value * +value_subscripted_rvalue (struct value *array, CORE_ADDR offset) { struct type *array_type = check_typedef (value_type (array)); @@ -3440,7 +3521,7 @@ fortran-dynamic-arrays-HEAD-l.patch + is shorter than the possibly accessed element offset. */ v = allocate_value (elt_type); - if (value_lazy (array)) + if (VALUE_LVAL (array) == lval_memory && value_lazy (array)) set_value_lazy (v, 1); else - memcpy (value_contents_writeable (v), @@ -3468,18 +3549,20 @@ fortran-dynamic-arrays-HEAD-l.patch + set_value_offset (v, value_offset (array) + offset); return v; } - ---- ./gdb/valops.c 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/valops.c 2008-11-08 22:39:57.000000000 +0100 -@@ -37,6 +37,7 @@ - #include "dictionary.h" + +diff --git a/gdb/valops.c b/gdb/valops.c +index 05e5351..83f15a8 100644 +--- a/gdb/valops.c ++++ b/gdb/valops.c +@@ -38,6 +38,7 @@ #include "cp-support.h" #include "dfp.h" + #include "user-regs.h" +#include "dwarf2loc.h" #include #include "gdb_string.h" -@@ -504,6 +505,49 @@ value_one (struct type *type, enum lval_ +@@ -568,6 +569,49 @@ value_one (struct type *type, enum lval_type lv) return val; } @@ -3529,39 +3612,41 @@ fortran-dynamic-arrays-HEAD-l.patch /* Return a value with type TYPE located at ADDR. Call value_at only if the data needs to be fetched immediately; -@@ -570,12 +614,21 @@ value_at_lazy (struct type *type, CORE_A - int - value_fetch_lazy (struct value *val) - { -- CORE_ADDR addr = VALUE_ADDRESS (val) + value_offset (val); -- int length = TYPE_LENGTH (value_enclosing_type (val)); -+ CORE_ADDR addr; -+ int length; +@@ -637,11 +681,21 @@ value_fetch_lazy (struct value *val) + allocate_value_contents (val); + if (VALUE_LVAL (val) == lval_memory) + { +- CORE_ADDR addr = VALUE_ADDRESS (val) + value_offset (val); +- int length = TYPE_LENGTH (check_typedef (value_enclosing_type (val))); ++ CORE_ADDR addr; ++ int length; -- struct type *type = value_type (val); -- if (length) -- read_memory (addr, value_contents_all_raw (val), length); -+ addr = VALUE_ADDRESS (val); -+ if (object_address_get_data (value_type (val), &addr)) -+ { -+ struct type *type = value_enclosing_type (val); -+ int length = TYPE_LENGTH (check_typedef (type)); -+ -+ if (length) +- if (length) +- read_memory (addr, value_contents_all_raw (val), length); ++ addr = VALUE_ADDRESS (val); ++ if (object_address_get_data (value_type (val), &addr)) + { -+ addr += value_offset (val); -+ read_memory (addr, value_contents_all_raw (val), length); ++ struct type *type = value_enclosing_type (val); ++ int length = TYPE_LENGTH (check_typedef (type)); ++ ++ if (length) ++ { ++ addr += value_offset (val); ++ read_memory (addr, value_contents_all_raw (val), length); ++ } + } -+ } - - set_value_lazy (val, 0); - return 0; -@@ -887,12 +940,17 @@ struct value * + } + else if (VALUE_LVAL (val) == lval_register) + { +@@ -1085,6 +1139,7 @@ struct value * value_coerce_array (struct value *arg1) { struct type *type = check_typedef (value_type (arg1)); + CORE_ADDR address; + /* If the user tries to do something requiring a pointer with an + array that has not yet been pushed to the target, then this would +@@ -1094,8 +1149,12 @@ value_coerce_array (struct value *arg1) if (VALUE_LVAL (arg1) != lval_memory) error (_("Attempt to take address of value not located in memory.")); @@ -3575,9 +3660,11 @@ fortran-dynamic-arrays-HEAD-l.patch } /* Given a value which is a function, return a value which is a pointer ---- ./gdb/value.h 2008-11-08 22:46:06.000000000 +0100 -+++ ./gdb/value.h 2008-11-08 22:46:45.000000000 +0100 -@@ -284,6 +284,10 @@ extern struct value *value_from_decfloat +diff --git a/gdb/value.h b/gdb/value.h +index a882004..f6aece1 100644 +--- a/gdb/value.h ++++ b/gdb/value.h +@@ -286,6 +286,10 @@ extern struct value *value_from_decfloat (struct type *type, const gdb_byte *decbytes); extern struct value *value_from_string (char *string); @@ -3588,9 +3675,9 @@ fortran-dynamic-arrays-HEAD-l.patch extern struct value *value_at (struct type *type, CORE_ADDR addr); extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr); -@@ -522,9 +526,9 @@ extern int common_val_print (struct valu - extern int val_print_string (CORE_ADDR addr, int len, int width, - struct ui_file *stream); +@@ -557,9 +561,9 @@ extern int val_print_string (CORE_ADDR addr, int len, int width, + struct ui_file *stream, + const struct value_print_options *options); -extern void print_variable_value (struct symbol *var, - struct frame_info *frame, @@ -3599,12 +3686,13 @@ fortran-dynamic-arrays-HEAD-l.patch + struct frame_info *frame, + struct ui_file *stream); - extern int check_field (struct value *, const char *); + extern int check_field (struct type *, const char *); -@@ -554,4 +558,7 @@ extern struct value *value_allocate_spac +@@ -590,5 +594,7 @@ extern struct value *value_allocate_space_in_inferior (int); extern struct value *value_of_local (const char *name, int complain); +-extern struct value * value_subscripted_rvalue (struct value *array, struct value *idx, int lowerbound); +extern struct value *value_subscripted_rvalue (struct value *array, + CORE_ADDR offset); + diff --git a/gdb-6.8-bz466901-backtrace-full-prelinked.patch b/gdb-6.8-bz466901-backtrace-full-prelinked.patch index de008a7..62cf021 100644 --- a/gdb-6.8-bz466901-backtrace-full-prelinked.patch +++ b/gdb-6.8-bz466901-backtrace-full-prelinked.patch @@ -1,24 +1,24 @@ Fix resolving of variables at locations lists in prelinked libs (BZ 466901). ---- ./gdb/dwarf2loc.c-orig 2008-11-06 22:17:45.000000000 +0100 -+++ ./gdb/dwarf2loc.c 2008-11-06 22:18:01.000000000 +0100 -@@ -57,9 +57,12 @@ find_location_expression (struct dwarf2_ +Index: gdb-6.8.50.20081128/gdb/dwarf2loc.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/dwarf2loc.c 2008-12-08 11:00:45.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/dwarf2loc.c 2008-12-08 18:02:49.000000000 +0100 +@@ -55,7 +55,9 @@ find_location_expression (struct dwarf2_ + CORE_ADDR low, high; + gdb_byte *loc_ptr, *buf_end; int length; - unsigned int addr_size = gdbarch_addr_bit (current_gdbarch) / TARGET_CHAR_BIT; +- struct objfile *objfile = dwarf2_per_cu_objfile (baton->per_cu); ++ struct objfile *objfile1 = dwarf2_per_cu_objfile (baton->per_cu); ++ struct objfile *objfile = objfile1->separate_debug_objfile ++ ? objfile1->separate_debug_objfile : objfile1; + struct gdbarch *gdbarch = get_objfile_arch (objfile); + unsigned int addr_size = dwarf2_per_cu_addr_size (baton->per_cu); CORE_ADDR base_mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1)); -+ struct objfile *objfile = (baton->objfile->separate_debug_objfile -+ ? baton->objfile->separate_debug_objfile -+ : baton->objfile); - /* Adjust base_address for relocatable objects. */ -- CORE_ADDR base_offset = ANOFFSET (baton->objfile->section_offsets, -- SECT_OFF_TEXT (baton->objfile)); -+ CORE_ADDR base_offset = ANOFFSET (objfile->section_offsets, -+ SECT_OFF_TEXT (objfile)); - CORE_ADDR base_address = baton->base_address + base_offset; - - loc_ptr = baton->data; ---- /dev/null 2008-11-06 15:02:28.406299691 +0100 -+++ gdb-6.8/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp 2008-11-06 23:11:02.000000000 +0100 +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked.exp 2008-12-08 18:00:43.000000000 +0100 @@ -0,0 +1,102 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -122,8 +122,10 @@ Fix resolving of variables at locations lists in prelinked libs (BZ 466901). + +# `abort' can get expressed as `*__GI_abort'. +gdb_test "bt full" "in \[^ \]*abort \\(.*in func \\(.*\ti = -?\[0-9\].*in main \\(.*" "Backtrace after abort()" ---- /dev/null 2008-11-06 15:02:28.406299691 +0100 -+++ gdb-6.8/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c 2008-11-06 22:59:05.000000000 +0100 +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-main.c 2008-12-08 18:00:43.000000000 +0100 @@ -0,0 +1,26 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -151,8 +153,10 @@ Fix resolving of variables at locations lists in prelinked libs (BZ 466901). + func (); + return 0; +} ---- /dev/null 2008-11-06 15:02:28.406299691 +0100 -+++ gdb-6.8/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S 2008-11-06 22:49:50.000000000 +0100 +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.dwarf2/dw2-loclist-prelinked-func.S 2008-12-08 18:00:43.000000000 +0100 @@ -0,0 +1,328 @@ +/* This testcase is part of GDB, the GNU debugger. + diff --git a/gdb-6.8-constant-watchpoints.patch b/gdb-6.8-constant-watchpoints.patch index cdf1f68..c3962ae 100644 --- a/gdb-6.8-constant-watchpoints.patch +++ b/gdb-6.8-constant-watchpoints.patch @@ -18,11 +18,11 @@ gdb.base/watchpoint.c (global_ptr_ptr): New variable. (func4): New testing code for GLOBAL_PTR_PTR. -Index: gdb-6.8/gdb/breakpoint.c +Index: gdb-6.8.50.20081128/gdb/breakpoint.c =================================================================== ---- gdb-6.8.orig/gdb/breakpoint.c 2008-07-14 10:28:30.000000000 +0200 -+++ gdb-6.8/gdb/breakpoint.c 2008-07-14 10:28:36.000000000 +0200 -@@ -846,7 +846,15 @@ is_hardware_watchpoint (struct breakpoin +--- gdb-6.8.50.20081128.orig/gdb/breakpoint.c 2008-12-01 16:13:12.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/breakpoint.c 2008-12-03 00:00:08.000000000 +0100 +@@ -770,7 +770,15 @@ is_hardware_watchpoint (struct breakpoin If VAL_CHAIN is non-NULL, *VAL_CHAIN will be released from the value chain. The caller must free the values individually. If VAL_CHAIN is NULL, all generated values will be left on the value @@ -39,7 +39,7 @@ Index: gdb-6.8/gdb/breakpoint.c static void fetch_watchpoint_value (struct expression *exp, struct value **valp, -@@ -5705,7 +5713,7 @@ watch_command_1 (char *arg, int accessfl +@@ -5824,7 +5832,7 @@ watch_command_1 (char *arg, int accessfl struct symtab_and_line sal; struct expression *exp; struct block *exp_valid_block; @@ -48,7 +48,7 @@ Index: gdb-6.8/gdb/breakpoint.c struct frame_info *frame; struct frame_info *prev_frame = NULL; char *exp_start = NULL; -@@ -5791,6 +5799,27 @@ watch_command_1 (char *arg, int accessfl +@@ -5910,6 +5918,27 @@ watch_command_1 (char *arg, int accessfl exp_valid_block = innermost_block; mark = value_mark (); fetch_watchpoint_value (exp, &val, NULL, NULL); @@ -76,11 +76,11 @@ Index: gdb-6.8/gdb/breakpoint.c if (val != NULL) release_value (val); -Index: gdb-6.8/gdb/gdbtypes.h +Index: gdb-6.8.50.20081128/gdb/gdbtypes.h =================================================================== ---- gdb-6.8.orig/gdb/gdbtypes.h 2008-07-14 10:28:30.000000000 +0200 -+++ gdb-6.8/gdb/gdbtypes.h 2008-07-14 10:28:36.000000000 +0200 -@@ -69,7 +69,22 @@ enum type_code +--- gdb-6.8.50.20081128.orig/gdb/gdbtypes.h 2008-12-02 22:53:14.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/gdbtypes.h 2008-12-03 00:00:08.000000000 +0100 +@@ -70,7 +70,22 @@ enum type_code TYPE_CODE_UNION, /* C union or Pascal variant part */ TYPE_CODE_ENUM, /* Enumeration type */ TYPE_CODE_FLAGS, /* Bit flags type */ @@ -104,11 +104,11 @@ Index: gdb-6.8/gdb/gdbtypes.h TYPE_CODE_INT, /* Integer type */ /* Floating type. This is *NOT* a complex type. Beware, there are parts -Index: gdb-6.8/gdb/doc/gdb.texinfo +Index: gdb-6.8.50.20081128/gdb/doc/gdb.texinfo =================================================================== ---- gdb-6.8.orig/gdb/doc/gdb.texinfo 2008-07-14 10:28:29.000000000 +0200 -+++ gdb-6.8/gdb/doc/gdb.texinfo 2008-07-14 10:28:36.000000000 +0200 -@@ -3267,6 +3267,18 @@ This command prints a list of watchpoint +--- gdb-6.8.50.20081128.orig/gdb/doc/gdb.texinfo 2008-12-02 23:43:49.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/doc/gdb.texinfo 2008-12-03 00:00:08.000000000 +0100 +@@ -3479,6 +3479,18 @@ This command prints a list of watchpoint it is the same as @code{info break} (@pxref{Set Breaks}). @end table @@ -127,10 +127,10 @@ Index: gdb-6.8/gdb/doc/gdb.texinfo @value{GDBN} sets a @dfn{hardware watchpoint} if possible. Hardware watchpoints execute very quickly, and the debugger reports a change in value at the exact instruction where the change occurs. If @value{GDBN} -Index: gdb-6.8/gdb/testsuite/gdb.base/watchpoint.c +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/watchpoint.c =================================================================== ---- gdb-6.8.orig/gdb/testsuite/gdb.base/watchpoint.c 2008-07-14 10:28:30.000000000 +0200 -+++ gdb-6.8/gdb/testsuite/gdb.base/watchpoint.c 2008-07-14 10:28:36.000000000 +0200 +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.base/watchpoint.c 2008-03-03 14:24:12.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/watchpoint.c 2008-12-03 00:00:08.000000000 +0100 @@ -40,6 +40,7 @@ struct foo struct1, struct2, *ptr1, *ptr int doread = 0; @@ -150,11 +150,11 @@ Index: gdb-6.8/gdb/testsuite/gdb.base/watchpoint.c } int main () -Index: gdb-6.8/gdb/testsuite/gdb.base/watchpoint.exp +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.base/watchpoint.exp =================================================================== ---- gdb-6.8.orig/gdb/testsuite/gdb.base/watchpoint.exp 2008-07-14 10:28:30.000000000 +0200 -+++ gdb-6.8/gdb/testsuite/gdb.base/watchpoint.exp 2008-07-14 10:28:36.000000000 +0200 -@@ -644,7 +644,21 @@ proc test_watchpoint_and_breakpoint {} { +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.base/watchpoint.exp 2008-08-06 14:52:07.000000000 +0200 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.base/watchpoint.exp 2008-12-03 00:01:07.000000000 +0100 +@@ -641,7 +641,21 @@ proc test_watchpoint_and_breakpoint {} { } } } @@ -177,7 +177,7 @@ Index: gdb-6.8/gdb/testsuite/gdb.base/watchpoint.exp proc test_inaccessible_watchpoint {} { global gdb_prompt -@@ -653,7 +667,8 @@ proc test_inaccessible_watchpoint {} { +@@ -650,7 +664,8 @@ proc test_inaccessible_watchpoint {} { if [runto func4] then { gdb_test "watch *global_ptr" ".*atchpoint \[0-9\]+: \\*global_ptr" @@ -187,7 +187,7 @@ Index: gdb-6.8/gdb/testsuite/gdb.base/watchpoint.exp gdb_test_multiple "next" "next over ptr init" { -re ".*atchpoint \[0-9\]+: \\*global_ptr\r\n\r\nOld value = .*\r\nNew value = 3 .*\r\n.*$gdb_prompt $" { # We can not test for here because NULL may be readable. -@@ -666,6 +681,28 @@ proc test_inaccessible_watchpoint {} { +@@ -663,6 +678,28 @@ proc test_inaccessible_watchpoint {} { pass "next over buffer set" } } @@ -215,8 +215,8 @@ Index: gdb-6.8/gdb/testsuite/gdb.base/watchpoint.exp + gdb_test "delete \$global_ptr_ptr_breakpoint_number" "" } } - -@@ -834,6 +871,17 @@ if [initialize] then { + +@@ -830,6 +867,17 @@ if [initialize] then { } test_watchpoint_and_breakpoint diff --git a/gdb-6.8-disable-randomization.patch b/gdb-6.8-disable-randomization.patch deleted file mode 100644 index 2f9e925..0000000 --- a/gdb-6.8-disable-randomization.patch +++ /dev/null @@ -1,544 +0,0 @@ -2008-06-08 Jan Kratochvil - - * configure.ac: Add check for HAVE_PERSONALITY and - HAVE_DECL_ADDR_NO_RANDOMIZE. - * configure, config.in: Regenerate. - * fork-child.c: New include . - [HAVE_PERSONALITY]: New include . - [HAVE_PERSONALITY] (set_disable_randomization): New function. - (disable_randomization, show_disable_randomization): New. - (fork_inferior) [HAVE_PERSONALITY] [!HAVE_DECL_ADDR_NO_RANDOMIZE]: Set - ADDR_NO_RANDOMIZE. - (fork_inferior) [HAVE_PERSONALITY]: Disable randomization upon the - variable DISABLE_RANDOMIZATION. - (_initialize_fork_child): Call ADD_SETSHOW_BOOLEAN_CMD for the variable - DISABLE_RANDOMIZATION. - -2008-06-08 Jan Kratochvil - - * gdb.texinfo (Starting): Document "set disable-randomization". - -2008-06-08 Jan Kratochvil - - * gdb.base/randomize.exp, gdb.base/randomize.c: New files. - -[ Ported for Fedora GDB. ] - -Index: gdb-6.8/gdb/config.in -=================================================================== ---- gdb-6.8.orig/gdb/config.in 2008-07-14 10:27:27.000000000 +0200 -+++ gdb-6.8/gdb/config.in 2008-07-14 10:28:50.000000000 +0200 -@@ -64,6 +64,10 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_CURSES_H - -+/* Define to 1 if you have the declaration of `ADDR_NO_RANDOMIZE', and to 0 if -+ you don't. */ -+#undef HAVE_DECL_ADDR_NO_RANDOMIZE -+ - /* Define to 1 if you have the declaration of `free', and to 0 if you don't. - */ - #undef HAVE_DECL_FREE -@@ -203,6 +207,9 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_NLIST_H - -+/* Define if you support the personality syscall. */ -+#undef HAVE_PERSONALITY -+ - /* Define to 1 if you have the `poll' function. */ - #undef HAVE_POLL - -Index: gdb-6.8/gdb/configure -=================================================================== ---- gdb-6.8.orig/gdb/configure 2008-07-14 10:27:27.000000000 +0200 -+++ gdb-6.8/gdb/configure 2008-07-14 10:28:50.000000000 +0200 -@@ -22911,6 +22911,188 @@ _ACEOF - - fi - -+echo "$as_me:$LINENO: checking whether ADDR_NO_RANDOMIZE is declared" >&5 -+echo $ECHO_N "checking whether ADDR_NO_RANDOMIZE is declared... $ECHO_C" >&6 -+if test "${ac_cv_have_decl_ADDR_NO_RANDOMIZE+set}" = set; then -+ echo $ECHO_N "(cached) $ECHO_C" >&6 -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+ -+int -+main () -+{ -+#ifndef ADDR_NO_RANDOMIZE -+ char *p = (char *) ADDR_NO_RANDOMIZE; -+#endif -+ -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext -+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 -+ (eval $ac_compile) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest.$ac_objext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ ac_cv_have_decl_ADDR_NO_RANDOMIZE=yes -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+ac_cv_have_decl_ADDR_NO_RANDOMIZE=no -+fi -+rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -+fi -+echo "$as_me:$LINENO: result: $ac_cv_have_decl_ADDR_NO_RANDOMIZE" >&5 -+echo "${ECHO_T}$ac_cv_have_decl_ADDR_NO_RANDOMIZE" >&6 -+if test $ac_cv_have_decl_ADDR_NO_RANDOMIZE = yes; then -+ -+cat >>confdefs.h <<_ACEOF -+#define HAVE_DECL_ADDR_NO_RANDOMIZE 1 -+_ACEOF -+ -+ -+else -+ cat >>confdefs.h <<_ACEOF -+#define HAVE_DECL_ADDR_NO_RANDOMIZE 0 -+_ACEOF -+ -+ -+fi -+ -+ -+ -+if test "$cross_compiling" = yes; then -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+ -+# if !HAVE_DECL_ADDR_NO_RANDOMIZE -+# define ADDR_NO_RANDOMIZE 0x0040000 -+# endif -+ /* Test the flag could be set and stays set. */ -+ personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE); -+ if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE)) -+ return 1 -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest.$ac_objext conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>conftest.er1 -+ ac_status=$? -+ grep -v '^ *+' conftest.er1 >conftest.err -+ rm -f conftest.er1 -+ cat conftest.err >&5 -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && -+ { ac_try='test -z "$ac_c_werror_flag" -+ || test ! -s conftest.err' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; } && -+ { ac_try='test -s conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ have_personality=true -+else -+ echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+have_personality=false -+fi -+rm -f conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+else -+ cat >conftest.$ac_ext <<_ACEOF -+/* confdefs.h. */ -+_ACEOF -+cat confdefs.h >>conftest.$ac_ext -+cat >>conftest.$ac_ext <<_ACEOF -+/* end confdefs.h. */ -+#include -+int -+main () -+{ -+ -+# if !HAVE_DECL_ADDR_NO_RANDOMIZE -+# define ADDR_NO_RANDOMIZE 0x0040000 -+# endif -+ /* Test the flag could be set and stays set. */ -+ personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE); -+ if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE)) -+ return 1 -+ ; -+ return 0; -+} -+_ACEOF -+rm -f conftest$ac_exeext -+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 -+ (eval $ac_link) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext' -+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 -+ (eval $ac_try) 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; }; then -+ have_personality=true -+else -+ echo "$as_me: program exited with status $ac_status" >&5 -+echo "$as_me: failed program was:" >&5 -+sed 's/^/| /' conftest.$ac_ext >&5 -+ -+( exit $ac_status ) -+have_personality=false -+fi -+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -+fi -+if $have_personality -+then -+ -+cat >>confdefs.h <<\_ACEOF -+#define HAVE_PERSONALITY 1 -+_ACEOF -+ -+fi -+ - - - # Check whether --with-sysroot or --without-sysroot was given. -Index: gdb-6.8/gdb/configure.ac -=================================================================== ---- gdb-6.8.orig/gdb/configure.ac 2008-07-14 10:27:27.000000000 +0200 -+++ gdb-6.8/gdb/configure.ac 2008-07-14 10:28:50.000000000 +0200 -@@ -1254,6 +1254,29 @@ if test "x$gdb_cv_sys_syscall_h_has_tkil - AC_DEFINE(HAVE_TKILL_SYSCALL, 1, [Define if you support the tkill syscall.]) - fi - -+dnl Check if we can disable the virtual address space randomization. -+dnl The functionality of setarch -R. -+AC_CHECK_DECLS([ADDR_NO_RANDOMIZE],,, [#include ]) -+define([PERSONALITY_TEST], [AC_LANG_PROGRAM([#include ], [ -+# if !HAVE_DECL_ADDR_NO_RANDOMIZE -+# define ADDR_NO_RANDOMIZE 0x0040000 -+# endif -+ /* Test the flag could be set and stays set. */ -+ personality (personality (0xffffffff) | ADDR_NO_RANDOMIZE); -+ if (!(personality (personality (0xffffffff)) & ADDR_NO_RANDOMIZE)) -+ return 1])]) -+AC_RUN_IFELSE([PERSONALITY_TEST], -+ [have_personality=true], -+ [have_personality=false], -+ [AC_LINK_IFELSE([PERSONALITY_TEST], -+ [have_personality=true], -+ [have_personality=false])]) -+if $have_personality -+then -+ AC_DEFINE([HAVE_PERSONALITY], 1, -+ [Define if you support the personality syscall.]) -+fi -+ - dnl Handle optional features that can be enabled. - - AC_ARG_WITH(sysroot, -Index: gdb-6.8/gdb/fork-child.c -=================================================================== ---- gdb-6.8.orig/gdb/fork-child.c 2008-01-29 22:11:24.000000000 +0100 -+++ gdb-6.8/gdb/fork-child.c 2008-07-14 10:28:50.000000000 +0200 -@@ -32,12 +32,45 @@ - #include "gdbthread.h" - #include "command.h" /* for dont_repeat () */ - #include "solib.h" -+#include "gdbcmd.h" - - #include -+#include -+#ifdef HAVE_PERSONALITY -+# include -+#endif - - /* This just gets used as a default if we can't find SHELL. */ - #define SHELL_FILE "/bin/sh" - -+static int disable_randomization = -+#ifdef HAVE_PERSONALITY -+ 1; -+#else -+ 0; -+#endif -+ -+#ifndef HAVE_PERSONALITY -+static void -+set_disable_randomization (char *args, int from_tty, struct cmd_list_element *c) -+{ -+ if (disable_randomization) -+ { -+ disable_randomization = 0; -+ error (_("Unsupported on this platform.")); -+ } -+} -+#endif -+ -+static void -+show_disable_randomization (struct ui_file *file, int from_tty, -+ struct cmd_list_element *c, const char *value) -+{ -+ fprintf_filtered (file, _("\ -+Disabling randomization of debuggee's virtual address space is %s.\n"), -+ value); -+} -+ - extern char **environ; - - /* Break up SCRATCH into an argument vector suitable for passing to -@@ -289,6 +322,24 @@ fork_inferior (char *exec_file_arg, char - if (debug_fork) - sleep (debug_fork); - -+#ifdef HAVE_PERSONALITY -+# if !HAVE_DECL_ADDR_NO_RANDOMIZE -+# define ADDR_NO_RANDOMIZE 0x0040000 -+# endif -+ if (disable_randomization) -+ { -+ int val; -+ -+ errno = 0; -+ val = personality (0xffffffff); -+ if (errno == 0) -+ personality (val | ADDR_NO_RANDOMIZE); -+ if (errno != 0 || !(personality (0xffffffff) & ADDR_NO_RANDOMIZE)) -+ warning (_("Currently enabled disable-randomization is unsupported " -+ "on this platform.")); -+ } -+#endif /* HAVE_PERSONALITY */ -+ - /* Run inferior in a separate process group. */ - debug_setpgrp = gdb_setpgid (); - if (debug_setpgrp == -1) -@@ -446,3 +497,23 @@ startup_inferior (int ntraps) - } - stop_soon = NO_STOP_QUIETLY; - } -+ -+void -+_initialize_fork_child (void) -+{ -+ -+ add_setshow_boolean_cmd ("disable-randomization", class_support, -+ &disable_randomization, _("\ -+Set disabling of debuggee's virtual address space randomization."), _("\ -+Show disabling of debuggee's virtual address space randomization."), _("\ -+When this mode is on (which is the default), the randomization of\n\ -+the virtual address space is disabled. Standalone programs run with the\n\ -+randomization enabled by default on some platforms."), -+#ifdef HAVE_PERSONALITY -+ NULL, -+#else -+ &set_disable_randomization, -+#endif -+ &show_disable_randomization, -+ &setlist, &showlist); -+} -Index: gdb-6.8/gdb/doc/gdb.texinfo -=================================================================== ---- gdb-6.8.orig/gdb/doc/gdb.texinfo 2008-07-14 10:28:36.000000000 +0200 -+++ gdb-6.8/gdb/doc/gdb.texinfo 2008-07-14 10:28:50.000000000 +0200 -@@ -1820,6 +1820,57 @@ argument to @value{GDBN} (@pxref{Invocat - @value{GDBN}}), or by using the @code{file} or @code{exec-file} command - (@pxref{Files, ,Commands to Specify Files}). - -+@kindex set disable-randomization -+@item set disable-randomization -+@itemx set disable-randomization on -+This option (enabled by default in @value{GDBN}) will turn off the native -+randomization of the virtual address space of the started program. This option -+is useful for multiple debugging sessions to make the execution better -+reproducible and memory addresses reusable across debugging sessions. -+ -+This feature is implemented at least on @sc{gnu}/Linux and OpenBSD. You can -+get the same behavior using -+ -+@smallexample -+(@value{GDBP}) set exec-wrapper setarch `uname -m` -R -+@end smallexample -+ -+@item set disable-randomization off -+Leave the behavior of the started executable unchanged. Some bugs rear their -+ugly heads only when the program is loaded at certain addresses. If your bug -+disappears when you run the program under @value{GDBN}, that might be because -+@value{GDBN} by default disables the address randomization on platforms, such -+as @sc{gnu}/Linux, which do that for stand-alone programs. Use @kbd{set -+disable-randomization off} to try to reproduce such elusive bugs. -+ -+The virtual address space randomization is implemented at least on -+@sc{gnu}/Linux and OpenBSD. It protects the programs against some kinds of -+security attacks. In these cases the attacker needs to know the exact location -+of a concrete executable code. Randomizing its location makes it impossible to -+inject jumps misusing a code at its expected addresses. -+ -+Prelinking shared libraries provides a startup performance advantage but it -+makes addresses in these libraries predictable for privileged processes by -+having just unprivileged access at the target system. Reading the shared -+library binary gives enough information for assembling the malicious code -+misusing it. Still even a prelinked shared library can get loaded a a new -+random address just requiring the regular relocation process during the -+startup. Shared libraries not already prelinked are always loaded at -+a randomly chosen address. -+ -+Position independent executables (PIE) contain position independent code -+similar to the shared libraries and therefore such executables get loaded at -+a randomly chosen address upon startup. PIE executables always load even -+already prelinked shared libraries at a random address. You can build such -+executable using @command{gcc -fPIE -pie}. -+ -+Heap (malloc storage), stack and custom mmap areas are always placed randomly -+(as long as the randomization is enabled). -+ -+@item show disable-randomization -+Show the current setting of the explicit disable of the native randomization of -+the virtual address space of the started program. -+ - @end table - - If you are running your program in an execution environment that -Index: gdb-6.8/gdb/testsuite/gdb.base/randomize.c -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8/gdb/testsuite/gdb.base/randomize.c 2008-07-14 10:28:50.000000000 +0200 -@@ -0,0 +1,32 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@prep.ai.mit.edu */ -+ -+#include -+#include -+ -+int main() -+{ -+ void *p; -+ -+ p = malloc (1); -+ printf ("address = %p\n", p); -+ -+ return 0; -+} -Index: gdb-6.8/gdb/testsuite/gdb.base/randomize.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8/gdb/testsuite/gdb.base/randomize.exp 2008-07-14 10:28:50.000000000 +0200 -@@ -0,0 +1,63 @@ -+# Copyright 2008 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+set testfile randomize -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+# Get things started. -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+proc address_get { testname } { -+ global gdb_prompt -+ -+ if {![runto_main]} { -+ return -1 -+ } -+ gdb_test_multiple "continue" $testname { -+ -re "address = (0x\[0-9a-f\]*).*Program exited normally..*$gdb_prompt $" { -+ pass $testname -+ return $expect_out(1,string) -+ } -+ } -+} -+ -+gdb_test "set disable-randomization off" -+set addr1 [address_get "randomized first address"] -+set addr2 [address_get "randomized second address"] -+set test "randomized addresses should not match" -+if {$addr1 eq $addr2} { -+ fail $test -+} else { -+ pass $test -+} -+ -+gdb_test "set disable-randomization on" -+set addr1 [address_get "fixed first address"] -+set addr2 [address_get "fixed second address"] -+set test "fixed addresses should match" -+if {$addr1 eq $addr2} { -+ pass $test -+} else { -+ fail $test -+} diff --git a/gdb-6.8-forced-enable-tui.patch b/gdb-6.8-forced-enable-tui.patch deleted file mode 100644 index 9e6777e..0000000 --- a/gdb-6.8-forced-enable-tui.patch +++ /dev/null @@ -1,88 +0,0 @@ -2008-06-18 Jan Kratochvil - - * configure.ac (--enable-tui): AC_MSG_ERROR for explicit --enable-tui. - * configure: Regenerated. - ---- ./gdb/configure.ac 9 Jun 2008 15:03:59 -0000 1.70 -+++ ./gdb/configure.ac 18 Jun 2008 17:14:21 -0000 -@@ -260,11 +260,11 @@ fi - AC_ARG_ENABLE(tui, - [ --enable-tui enable full-screen terminal user interface (TUI)], - [case $enableval in -- yes | no) -+ yes | no | auto) - ;; - *) - AC_MSG_ERROR([bad value $enableval for --enable-tui]) ;; -- esac],enable_tui=yes) -+ esac],enable_tui=auto) - - # Enable gdbtk. - AC_ARG_ENABLE(gdbtk, -@@ -1576,7 +1576,7 @@ AC_PATH_X - - # Check whether we should enable the TUI, but only do so if we really - # can. --if test x"$enable_tui" = xyes; then -+if test x"$enable_tui" != xno; then - if test -d $srcdir/tui; then - if test "$ac_cv_search_waddstr" != no; then - CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)" -@@ -1589,7 +1589,11 @@ if test x"$enable_tui" = xyes; then - CONFIG_INSTALL="${CONFIG_INSTALL} install-tui" - CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui" - else -- AC_MSG_WARN([no enhanced curses library found; disabling TUI]) -+ if test x"$enable_tui" = xyes; then -+ AC_MSG_ERROR([no enhanced curses library found; disable TUI]) -+ else -+ AC_MSG_WARN([no enhanced curses library found; disabling TUI]) -+ fi - fi - fi - fi ---- ./gdb/configure 9 Jun 2008 15:03:58 -0000 1.250 -+++ ./gdb/configure 18 Jun 2008 17:14:12 -0000 -@@ -7540,7 +7540,7 @@ fi - if test "${enable_tui+set}" = set; then - enableval="$enable_tui" - case $enableval in -- yes | no) -+ yes | no | auto) - ;; - *) - { { echo "$as_me:$LINENO: error: bad value $enableval for --enable-tui" >&5 -@@ -7548,7 +7548,7 @@ echo "$as_me: error: bad value $enableva - { (exit 1); exit 1; }; } ;; - esac - else -- enable_tui=yes -+ enable_tui=auto - fi; - - # Enable gdbtk. -@@ -28324,7 +28324,7 @@ fi - - # Check whether we should enable the TUI, but only do so if we really - # can. --if test x"$enable_tui" = xyes; then -+if test x"$enable_tui" != xno; then - if test -d $srcdir/tui; then - if test "$ac_cv_search_waddstr" != no; then - CONFIG_OBS="$CONFIG_OBS \$(SUBDIR_TUI_OBS)" -@@ -28337,8 +28337,14 @@ if test x"$enable_tui" = xyes; then - CONFIG_INSTALL="${CONFIG_INSTALL} install-tui" - CONFIG_UNINSTALL="${CONFIG_UNINSTALL} uninstall-tui" - else -- { echo "$as_me:$LINENO: WARNING: no enhanced curses library found; disabling TUI" >&5 -+ if test x"$enable_tui" = xyes; then -+ { { echo "$as_me:$LINENO: error: no enhanced curses library found; disable TUI" >&5 -+echo "$as_me: error: no enhanced curses library found; disable TUI" >&2;} -+ { (exit 1); exit 1; }; } -+ else -+ { echo "$as_me:$LINENO: WARNING: no enhanced curses library found; disabling TUI" >&5 - echo "$as_me: WARNING: no enhanced curses library found; disabling TUI" >&2;} -+ fi - fi - fi - fi diff --git a/gdb-6.8-fortran-module-ignore.patch b/gdb-6.8-fortran-module-ignore.patch deleted file mode 100644 index 81e1fc4..0000000 --- a/gdb-6.8-fortran-module-ignore.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ./gdb/dwarf2read.c 24 Aug 2008 16:39:56 -0000 1.277 -+++ ./gdb/dwarf2read.c 26 Aug 2008 18:51:28 -0000 -@@ -2761,7 +2769,10 @@ process_die (struct die_info *die, struc - Fortran case, so we'll have to replace this gdb_assert if - Fortran compilers start generating that info. */ - processing_has_namespace_info = 1; -- gdb_assert (die->child == NULL); -+ if (cu->language != language_fortran && die->child == NULL) -+ complaint (&symfile_complaints, -+ _("%s at offset %d has unexpected children"), -+ dwarf_tag_name (die->tag), die->offset); - break; - default: - new_symbol (die, NULL, cu); diff --git a/gdb-6.8-fortran-tag-constant.patch b/gdb-6.8-fortran-tag-constant.patch index b09bc36..42d0ab5 100644 --- a/gdb-6.8-fortran-tag-constant.patch +++ b/gdb-6.8-fortran-tag-constant.patch @@ -1,14 +1,16 @@ ---- ./gdb/dwarf2read.c 21 Aug 2008 18:57:34 -0000 1.276 -+++ ./gdb/dwarf2read.c 26 Aug 2008 17:54:37 -0000 -@@ -1798,6 +1798,7 @@ scan_partial_symbols (struct partial_die - } +Index: gdb-6.8.50.20081128/gdb/dwarf2read.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/dwarf2read.c 2008-12-06 14:06:17.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/dwarf2read.c 2008-12-06 21:53:09.000000000 +0100 +@@ -1825,6 +1825,7 @@ scan_partial_symbols (struct partial_die + add_partial_subprogram (pdi, lowpc, highpc, cu); break; case DW_TAG_variable: + case DW_TAG_constant: case DW_TAG_typedef: case DW_TAG_union_type: if (!pdi->is_declaration) -@@ -1983,6 +1984,7 @@ add_partial_symbol (struct partial_die_i +@@ -2010,6 +2011,7 @@ add_partial_symbol (struct partial_die_i } break; case DW_TAG_variable: @@ -16,7 +18,15 @@ if (pdi->is_external) { /* Global Variable. -@@ -3590,7 +3593,8 @@ dwarf2_add_field (struct field_info *fip +@@ -2864,6 +2866,7 @@ dwarf2_full_name (struct die_info *die, + if (!pdi_needs_namespace (die->tag) + && die->tag != DW_TAG_subprogram + && die->tag != DW_TAG_variable ++ && die->tag != DW_TAG_constant + && die->tag != DW_TAG_member) + return name; + +@@ -3704,7 +3707,8 @@ dwarf2_add_field (struct field_info *fip fip->non_public_fields = 1; } } @@ -26,7 +36,7 @@ { /* C++ static member. */ -@@ -4069,7 +4073,8 @@ read_structure_type (struct die_info *di +@@ -4182,7 +4186,8 @@ read_structure_type (struct die_info *di while (child_die && child_die->tag) { if (child_die->tag == DW_TAG_member @@ -36,7 +46,7 @@ { /* NOTE: carlton/2002-11-05: A C++ static data member should be a DW_TAG_member that is a declaration, but -@@ -4188,6 +4193,7 @@ process_structure_scope (struct die_info +@@ -4301,6 +4306,7 @@ process_structure_scope (struct die_info { if (child_die->tag == DW_TAG_member || child_die->tag == DW_TAG_variable @@ -44,15 +54,15 @@ || child_die->tag == DW_TAG_inheritance) { /* Do nothing. */ -@@ -5565,6 +5571,7 @@ load_partial_dies (bfd *abfd, gdb_byte * - && abbrev->tag != DW_TAG_enumerator +@@ -5700,6 +5706,7 @@ load_partial_dies (bfd *abfd, gdb_byte * && abbrev->tag != DW_TAG_subprogram + && abbrev->tag != DW_TAG_lexical_block && abbrev->tag != DW_TAG_variable + && abbrev->tag != DW_TAG_constant && abbrev->tag != DW_TAG_namespace && abbrev->tag != DW_TAG_member) { -@@ -5672,6 +5679,7 @@ load_partial_dies (bfd *abfd, gdb_byte * +@@ -5807,6 +5814,7 @@ load_partial_dies (bfd *abfd, gdb_byte * if (load_all || abbrev->tag == DW_TAG_subprogram || abbrev->tag == DW_TAG_variable @@ -60,7 +70,7 @@ || abbrev->tag == DW_TAG_namespace || part_die->is_declaration) { -@@ -7579,6 +7579,11 @@ new_symbol (struct die_info *die, struct +@@ -7593,6 +7601,11 @@ new_symbol (struct die_info *die, struct /* Do not add the symbol to any lists. It will be found via BLOCK_FUNCTION from the blockvector. */ break; diff --git a/gdb-6.8-ia64-breakpoint-restoration.patch b/gdb-6.8-ia64-breakpoint-restoration.patch deleted file mode 100644 index 93fca71..0000000 --- a/gdb-6.8-ia64-breakpoint-restoration.patch +++ /dev/null @@ -1,276 +0,0 @@ -gdb/ -2008-10-28 Jan Kratochvil - - Fix automatic restoration of breakpoints memory for ia64. - * ia64-tdep.c (ia64_memory_insert_breakpoint): New comment part for - SHADOW_CONTENTS content. Remova variable instr. New variable cleanup. - Force automatic breakpoints restoration. PLACED_SIZE and SHADOW_LEN - are now set larger, to BUNDLE_LEN - 2. - (ia64_memory_remove_breakpoint): Rename variables bundle to bundle_mem - and instr to instr_saved. New variables bundle_saved and - instr_breakpoint. Comment new reasons why we need to disable automatic - restoration of breakpoints. Assert PLACED_SIZE and SHADOW_LEN. New - check of the original memory content. - (ia64_breakpoint_from_pc): Array breakpoint extended to BUNDLE_LEN. - Sanity check the PCPTR parameter SLOTNUM value. New #if check on - BREAKPOINT_MAX vs. BUNDLE_LEN. Increase LENPTR to BUNDLE_LEN - 2. - -gdb/testsuite/ -2008-10-28 Jan Kratochvil - - * gdb.base/breakpoint-shadow.exp, gdb.base/breakpoint-shadow.c: New. - -[ RHEL-5 disable of `set breakpoint always-inserted'. ] - ---- ./gdb/ia64-tdep.c 11 Sep 2008 14:23:15 -0000 1.184 -+++ ./gdb/ia64-tdep.c 28 Oct 2008 10:28:41 -0000 -@@ -545,7 +545,21 @@ fetch_instruction (CORE_ADDR addr, instr - simulators. So I changed the pattern slightly to do "break.i 0x080001" - instead. But that didn't work either (I later found out that this - pattern was used by the simulator that I was using.) So I ended up -- using the pattern seen below. */ -+ using the pattern seen below. -+ -+ SHADOW_CONTENTS has byte-based addressing (PLACED_ADDRESS and SHADOW_LEN) -+ while we need bit-based addressing as the instructions length is 41 bits and -+ we must not modify/corrupt the adjacent ones in the same bundle. -+ Fortunately we may store larger memory incl. the adjacent bits with the -+ original memory content (not the possibly already stored breakpoints there). -+ We need to be careful in ia64_memory_remove_breakpoint to always restore -+ only the specific bits of this instruction ignoring any adjacent stored -+ bits. -+ -+ We use the original addressing with the low nibble 0..2 which gets -+ incorrectly interpreted by the generic GDB code as the byte offset of -+ SHADOW_CONTENTS. We store whole BUNDLE_LEN bytes just without these two -+ possibly skipped bytes. */ - - #if 0 - #define IA64_BREAKPOINT 0x00002000040LL -@@ -559,15 +573,21 @@ ia64_memory_insert_breakpoint (struct gd - CORE_ADDR addr = bp_tgt->placed_address; - char bundle[BUNDLE_LEN]; - int slotnum = (int) (addr & 0x0f) / SLOT_MULTIPLIER; -- long long instr; - int val; - int template; -+ struct cleanup *cleanup; - - if (slotnum > 2) - error (_("Can't insert breakpoint for slot numbers greater than 2.")); - - addr &= ~0x0f; - -+ /* Enable the automatic memory restoration from breakpoints while -+ we read our instruction bundle. Otherwise, we could store into -+ SHADOW_CONTENTS an already stored breakpoint at the same location. -+ In practice it is already being prevented by the DUPLICATE field and -+ update_global_location_list. */ -+ cleanup = make_show_memory_breakpoints_cleanup (0); - val = target_read_memory (addr, bundle, BUNDLE_LEN); - - /* Check for L type instruction in 2nd slot, if present then -@@ -578,13 +598,18 @@ ia64_memory_insert_breakpoint (struct gd - slotnum = 2; - } - -- instr = slotN_contents (bundle, slotnum); -- memcpy (bp_tgt->shadow_contents, &instr, sizeof (instr)); -- bp_tgt->placed_size = bp_tgt->shadow_len = sizeof (instr); -+ /* Slot number 2 may skip at most 2 bytes at the beginning. */ -+ bp_tgt->placed_size = bp_tgt->shadow_len = BUNDLE_LEN - 2; -+ -+ /* Store the whole bundle, except for the initial skipped bytes by the slot -+ number interpreted as bytes offset in PLACED_ADDRESS. */ -+ memcpy (bp_tgt->shadow_contents, bundle + slotnum, bp_tgt->shadow_len); -+ - replace_slotN_contents (bundle, IA64_BREAKPOINT, slotnum); - if (val == 0) -- target_write_memory (addr, bundle, BUNDLE_LEN); -+ target_write_memory (addr + slotnum, bundle + slotnum, bp_tgt->shadow_len); - -+ do_cleanups (cleanup); - return val; - } - -@@ -593,9 +618,9 @@ ia64_memory_remove_breakpoint (struct gd - struct bp_target_info *bp_tgt) - { - CORE_ADDR addr = bp_tgt->placed_address; -- char bundle[BUNDLE_LEN]; -+ char bundle_mem[BUNDLE_LEN], bundle_saved[BUNDLE_LEN]; - int slotnum = (addr & 0x0f) / SLOT_MULTIPLIER; -- long long instr; -+ long long instr_breakpoint, instr_saved; - int val; - int template; - struct cleanup *cleanup; -@@ -604,23 +629,39 @@ ia64_memory_remove_breakpoint (struct gd - - /* Disable the automatic memory restoration from breakpoints while - we read our instruction bundle. Otherwise, the general restoration -- mechanism kicks in and ends up corrupting our bundle, because it -- is not aware of the concept of instruction bundles. */ -+ mechanism kicks in and we would possibly remove parts of the adjacent -+ placed breakpoints. It is due to our SHADOW_CONTENTS overlapping the real -+ breakpoint instruction bits region. */ - cleanup = make_show_memory_breakpoints_cleanup (1); -- val = target_read_memory (addr, bundle, BUNDLE_LEN); -+ val = target_read_memory (addr, bundle_mem, BUNDLE_LEN); - - /* Check for L type instruction in 2nd slot, if present then - bump up the slot number to the 3rd slot */ -- template = extract_bit_field (bundle, 0, 5); -+ template = extract_bit_field (bundle_mem, 0, 5); - if (slotnum == 1 && template_encoding_table[template][1] == L) - { - slotnum = 2; - } - -- memcpy (&instr, bp_tgt->shadow_contents, sizeof instr); -- replace_slotN_contents (bundle, instr, slotnum); -+ gdb_assert (bp_tgt->placed_size == BUNDLE_LEN - 2); -+ gdb_assert (bp_tgt->placed_size == bp_tgt->shadow_len); -+ -+ instr_breakpoint = slotN_contents (bundle_mem, slotnum); -+ if (instr_breakpoint != IA64_BREAKPOINT) -+ warning (_("Breakpoint removal cannot find the placed breakpoint at %s"), -+ paddr_nz (bp_tgt->placed_address)); -+ -+ /* Extract the original saved instruction from SLOTNUM normalizing its -+ bit-shift for INSTR_SAVED. */ -+ memcpy (bundle_saved, bundle_mem, BUNDLE_LEN); -+ memcpy (bundle_saved + slotnum, bp_tgt->shadow_contents, bp_tgt->shadow_len); -+ instr_saved = slotN_contents (bundle_saved, slotnum); -+ -+ /* In BUNDLE_MEM be careful to modify only the bits belonging to SLOTNUM and -+ never any other possibly also stored in SHADOW_CONTENTS. */ -+ replace_slotN_contents (bundle_mem, instr_saved, slotnum); - if (val == 0) -- target_write_memory (addr, bundle, BUNDLE_LEN); -+ target_write_memory (addr, bundle_mem, BUNDLE_LEN); - - do_cleanups (cleanup); - return val; -@@ -631,12 +672,18 @@ ia64_memory_remove_breakpoint (struct gd - const unsigned char * - ia64_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr, int *lenptr) - { -- static unsigned char breakpoint[] = -- { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; -- *lenptr = sizeof (breakpoint); --#if 0 -- *pcptr &= ~0x0f; -+ static unsigned char breakpoint[BUNDLE_LEN]; -+ int slotnum = (int) (*pcptr & 0x0f) / SLOT_MULTIPLIER; -+ -+ if (slotnum > 2) -+ error (_("Can't insert breakpoint for slot numbers greater than 2.")); -+ -+#if BREAKPOINT_MAX < BUNDLE_LEN -+# error "BREAKPOINT_MAX < BUNDLE_LEN" - #endif -+ -+ *lenptr = BUNDLE_LEN - 2; -+ - return breakpoint; - } - ---- /dev/null 1 Jan 1970 00:00:00 -0000 -+++ ./gdb/testsuite/gdb.base/breakpoint-shadow.c 28 Oct 2008 10:28:41 -0000 -@@ -0,0 +1,27 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . */ -+ -+int -+main (void) -+{ -+ volatile int i; -+ -+ i = 1; /* break-first */ -+ i = 2; /* break-second */ -+ -+ return 0; -+} ---- /dev/null 1 Jan 1970 00:00:00 -0000 -+++ ./gdb/testsuite/gdb.base/breakpoint-shadow.exp 28 Oct 2008 10:28:41 -0000 -@@ -0,0 +1,65 @@ -+# Copyright 2008 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+set testfile breakpoint-shadow -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+# We need to start the inferior to place the breakpoints in the memory at all. -+if { [gdb_start_cmd] < 0 } { -+ untested start -+ return -1 -+} -+gdb_test "" "main \\(\\) at .*" "start" -+ -+# The default "auto" mode removes all the breakpoints when we stop (and not -+# running the nonstop mode). We would not be able to test the shadow. -+#RHEL-5: -+#gdb_test "set breakpoint always-inserted on" -+#gdb_test "show breakpoint always-inserted" "Always inserted breakpoint mode is on." -+ -+set match "\nDump of assembler code for function main:\r\n(.*)End of assembler dump.\r\n$gdb_prompt $" -+ -+set test "disassembly without breakpoints" -+gdb_test_multiple "disass main" $test { -+ -re $match { -+ set orig $expect_out(1,string) -+ pass $test -+ } -+} -+ -+gdb_test "b [gdb_get_line_number "break-first"]" "Breakpoint \[0-9\] at .*" "First breakpoint placed" -+gdb_test "b [gdb_get_line_number "break-second"]" "Breakpoint \[0-9\] at .*" "Second breakpoint placed" -+ -+set test "disassembly with breakpoints" -+gdb_test_multiple "disass main" $test { -+ -re $match { -+ set got $expect_out(1,string) -+ if [string equal -nocase $orig $got] { -+ pass $test -+ } else { -+ fail $test -+ } -+ } -+} diff --git a/gdb-6.8-ia64-exec-hw-watchpoint.patch b/gdb-6.8-ia64-exec-hw-watchpoint.patch deleted file mode 100644 index f71ef59..0000000 --- a/gdb-6.8-ia64-exec-hw-watchpoint.patch +++ /dev/null @@ -1,119 +0,0 @@ -It is a regression from: -http://sourceware.org/ml/gdb-patches/2007-03/msg00290.html -http://sourceware.org/ml/gdb-cvs/2007-03/msg00114.html - -Without started inferior the only target in the stack is `exec' which has no -hardware-watchpoints support for sure. - ---- /dev/null 2008-11-16 09:11:50.595000000 +0100 -+++ gdb-6.8/gdb/config/ia64/nm-linux.h 2008-11-18 11:00:34.000000000 +0100 -@@ -0,0 +1,31 @@ -+/* Native support for GNU/Linux, for GDB, the GNU debugger. -+ -+ Copyright 1999, 2000, 2001, 2004, 2005, 2007, 2008 Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 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. */ -+ -+#ifndef NM_LINUX_H -+#define NM_LINUX_H -+ -+#include "config/nm-linux.h" -+ -+/* Hardware watchpoints */ -+ -+#define TARGET_CAN_USE_HARDWARE_WATCHPOINT(type, cnt, ot) 1 -+ -+#endif /* #ifndef NM_LINUX_H */ ---- gdb-6.8/gdb/config/ia64/linux.mh-orig 2007-04-26 00:17:48.000000000 +0200 -+++ gdb-6.8/gdb/config/ia64/linux.mh 2008-11-18 11:09:33.000000000 +0100 -@@ -1,6 +1,6 @@ - # Host: Intel IA-64 running GNU/Linux - --NAT_FILE= config/nm-linux.h -+NAT_FILE= nm-linux.h - NATDEPFILES= inf-ptrace.o fork-child.o corelow.o gcore.o \ - core-regset.o ia64-linux-nat.o \ - proc-service.o linux-thread-db.o linux-nat.o linux-fork.o ---- /dev/null 2008-11-16 09:11:50.595000000 +0100 -+++ gdb-6.8/gdb/testsuite/gdb.base/hw-watchpoint-available.exp 2008-11-18 11:28:40.000000000 +0100 -@@ -0,0 +1,35 @@ -+# Copyright 2008 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] && ![istarget "ia64-*-*"] -+ && ![istarget "s390*-*-*"]} then { -+ verbose "Skipping hw-watchpoint-available test." -+ return -+} -+ -+set testfile hw-watchpoint-available -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+gdb_test "watch watchee" "Hardware watchpoint 1: watchee" ---- /dev/null 2008-11-16 09:11:50.595000000 +0100 -+++ gdb-6.8/gdb/testsuite/gdb.base/hw-watchpoint-available.c 2008-11-18 11:24:38.000000000 +0100 -@@ -0,0 +1,27 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@prep.ai.mit.edu */ -+ -+int watchee; -+ -+int -+main (void) -+{ -+ return 0; -+} diff --git a/gdb-6.8-inlining-addon.patch b/gdb-6.8-inlining-addon.patch new file mode 100644 index 0000000..e1fc741 --- /dev/null +++ b/gdb-6.8-inlining-addon.patch @@ -0,0 +1,272 @@ +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-bt.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.opt/inline-bt.c 2008-12-10 00:25:31.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-bt.c 2008-12-10 00:37:26.000000000 +0100 +@@ -13,10 +13,16 @@ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +-int x, y; ++/* VOLATILE forces all the inlining to happen as otherwise the whole program ++ gets optimized by CSE to just simple assignments of the results. */ ++volatile int x, y; + volatile int result; + +-void bar(void); ++inline void bar(void) ++{ ++ x += y; /* set breakpoint 1 here */ ++} ++ + + inline int func1(void) + { +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-bt.exp +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.opt/inline-bt.exp 2008-12-10 00:25:31.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-bt.exp 2008-12-10 00:37:26.000000000 +0100 +@@ -41,18 +41,19 @@ if { [skip_inline_frame_tests] } { + return + } + +-set line1 [gdb_get_line_number "set breakpoint 1 here" ${fullsrcfile2}] +-gdb_breakpoint $srcfile2:$line1 ++set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile}] ++gdb_breakpoint $srcfile:$line1 + + gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (1)" + gdb_test "backtrace" "#0 bar.*#1 .*main.*" "backtrace from bar (1)" +-gdb_test "info frame" ".*called by frame.*" "bar not inlined" ++gdb_test "info frame" ".*inlined into frame.*" "bar inlined" + +-gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (2)" +-gdb_test "backtrace" "#0 bar.*#1 .*func1.*#2 .*main.*" \ +- "backtrace from bar (2)" +-gdb_test "up" "#1 .*func1.*" "up from bar (2)" +-gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (2)" ++# gcc-4.3.1 omits the line number information for (2). ++#gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (2)" ++#gdb_test "backtrace" "#0 bar.*#1 .*func1.*#2 .*main.*" \ ++# "backtrace from bar (2)" ++#gdb_test "up" "#1 .*func1.*" "up from bar (2)" ++#gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (2)" + + gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (3)" + gdb_test "backtrace" "#0 bar.*#1 .*func1.*#2 .*func2.*#3 .*main.*" \ +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-cmds.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.opt/inline-cmds.c 2008-12-10 00:25:31.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-cmds.c 2008-12-10 00:37:26.000000000 +0100 +@@ -13,13 +13,19 @@ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +-int x, y; ++/* VOLATILE forces all the inlining to happen as otherwise the whole program ++ gets optimized by CSE to just simple assignments of the results. */ ++volatile int x, y; + volatile int result; + +-void bar(void); + void marker(void); + void noinline(void); + ++inline void bar(void) ++{ ++ x += y; /* set breakpoint 1 here */ ++} ++ + inline int func1(void) + { + bar (); +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-cmds.exp +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2008-12-10 00:25:31.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-cmds.exp 2008-12-10 00:36:27.000000000 +0100 +@@ -45,9 +45,9 @@ if { [skip_inline_frame_tests] } { + + # First, check that the things we expected to be inlined really were, + # and those that shouldn't be weren't. +-set line1 [gdb_get_line_number "set breakpoint 1 here" ${fullsrcfile2}] ++set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile2}] + gdb_breakpoint $srcfile2:$line1 +-set line2 [gdb_get_line_number "set breakpoint 2 here" ${fullsrcfile2}] ++set line2 [gdb_get_line_number "set breakpoint 2 here" ${srcfile2}] + gdb_breakpoint $srcfile2:$line2 + + gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (1)" +@@ -66,7 +66,7 @@ gdb_test "info frame" ".*inlined into fr + + gdb_test "continue" ".*set breakpoint 2 here.*" "continue to marker" + gdb_test "backtrace" "#0 marker.*#1 .*main.*" "backtrace from marker" +-gdb_test "info frame" ".*called by frame.*" "marker not inlined" ++gdb_test "info frame" ".*\n called by frame.*" "marker not inlined" + + # Next, check that we can next over inlined functions. We should not end up + # inside any of them. +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-locals.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.opt/inline-locals.c 2008-12-10 00:25:31.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-locals.c 2008-12-10 00:37:26.000000000 +0100 +@@ -13,11 +13,16 @@ + You should have received a copy of the GNU General Public License + along with this program. If not, see . */ + +-int x, y; ++/* VOLATILE forces all the inlining to happen as otherwise the whole program ++ gets optimized by CSE to just simple assignments of the results. */ ++volatile int x, y; + volatile int result; + volatile int *array_p; + +-void bar(void); ++inline void bar(void) ++{ ++ x += y; /* set breakpoint 1 here */ ++} + + inline int func1(int arg1) + { +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-locals.exp +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.opt/inline-locals.exp 2008-12-10 00:25:31.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-locals.exp 2008-12-10 00:37:26.000000000 +0100 +@@ -43,8 +43,8 @@ if { [skip_inline_var_tests] } { + + set no_frames [skip_inline_frame_tests] + +-set line1 [gdb_get_line_number "set breakpoint 1 here" ${fullsrcfile2}] +-gdb_breakpoint $srcfile2:$line1 ++set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile}] ++gdb_breakpoint $srcfile:$line1 + + gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (1)" + +@@ -77,6 +77,9 @@ if { ! $no_frames } { + + # Make sure that locals on the stack are found. This is an array to + # prevent it from living in a register. ++if [test_compiler_info "gcc-4-3-*"] { ++ setup_kfail *-*-* "gcc/debug.optimization" ++} + gdb_test "print array\[0\]" "\\\$$decimal = 0" "print local (2)" + + if { ! $no_frames } { +@@ -115,4 +118,7 @@ if { ! $no_frames } { + gdb_test "info locals" ".*arg2 = 184.*" "info locals above bar (3b)" + } + ++if [test_compiler_info "gcc-4-3-*"] { ++ setup_kfail *-*-* "gcc/debug.optimization" ++} + gdb_test "print array\[0\]" "\\\$$decimal = 184" "print local (3)" +Index: gdb-6.8.50.20081128/gdb/frame.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/frame.c 2008-12-10 00:25:31.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/frame.c 2008-12-10 00:25:31.000000000 +0100 +@@ -269,7 +269,7 @@ fprint_frame (struct ui_file *file, stru + static struct frame_info * + skip_inlined_frames (struct frame_info *frame) + { +- while (get_frame_type (frame) == INLINE_FRAME) ++ while (frame && get_frame_type (frame) == INLINE_FRAME) + frame = get_prev_frame (frame); + + return frame; +Index: gdb-6.8.50.20081128/gdb/breakpoint.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/breakpoint.c 2008-12-10 00:25:31.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/breakpoint.c 2008-12-10 00:36:27.000000000 +0100 +@@ -57,6 +57,7 @@ + #include "top.h" + #include "wrapper.h" + #include "valprint.h" ++#include "inline-frame.h" + + #include "mi/mi-common.h" + +@@ -2976,6 +2977,12 @@ bpstat_stop_status (CORE_ADDR bp_addr, p + bs->print = 0; + } + bs->commands = copy_command_lines (bs->commands); ++ ++ /* Display the innermost inlined frame at a breakpont as it gives to ++ most of the available information. */ ++ if (b->type != bp_until && b->type != bp_finish) ++ while (inline_skipped_frames (ptid)) ++ step_into_inline_frame (ptid); + } + + /* Print nothing for this entry if we dont stop or if we dont print. */ +Index: gdb-6.8.50.20081128/gdb/inline-frame.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/inline-frame.c 2008-12-10 00:25:31.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/inline-frame.c 2008-12-10 00:40:49.000000000 +0100 +@@ -183,6 +183,12 @@ inline_frame_sniffer (const struct frame + if (frame_block == NULL) + return 0; + ++ /* For >=2 inlined functions SKIPPED_SYMBOL needs to be different after each ++ step_into_inline_frame call. But skip_inline_frames is called only once ++ and thus SKIPPED_SYMBOL needs to be calculated by INLINE_FRAME_SNIFFER. */ ++ if (state) ++ state->skipped_symbol = NULL; ++ + /* Calculate DEPTH, the number of inlined functions at this + location. */ + depth = 0; +@@ -192,6 +198,10 @@ inline_frame_sniffer (const struct frame + if (block_inlined_p (cur_block)) + depth++; + ++ if (state && depth == state->skipped_frames ++ && state->skipped_symbol == NULL) ++ state->skipped_symbol = BLOCK_FUNCTION (cur_block); ++ + cur_block = BLOCK_SUPERBLOCK (cur_block); + } + +@@ -275,7 +285,6 @@ skip_inline_frames (ptid_t ptid) + { + CORE_ADDR this_pc; + struct block *frame_block, *cur_block; +- struct symbol *last_sym = NULL; + int skip_count = 0; + struct inline_state *state; + +@@ -296,10 +305,7 @@ skip_inline_frames (ptid_t ptid) + of BLOCK_START. */ + if (BLOCK_START (cur_block) == this_pc + || block_starting_point_at (this_pc, cur_block)) +- { +- skip_count++; +- last_sym = BLOCK_FUNCTION (cur_block); +- } ++ skip_count++; + else + break; + } +@@ -311,7 +317,6 @@ skip_inline_frames (ptid_t ptid) + state = allocate_inline_frame_state (ptid); + state->skipped_frames = skip_count; + state->saved_pc = this_pc; +- state->skipped_symbol = last_sym; + + if (skip_count != 0) + reinit_frame_cache (); +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-markers.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.opt/inline-markers.c 2008-12-10 00:25:31.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-markers.c 2008-12-10 00:37:26.000000000 +0100 +@@ -15,11 +15,6 @@ + + extern int x, y; + +-void bar(void) +-{ +- x += y; /* set breakpoint 1 here */ +-} +- + void marker(void) + { + x += y; /* set breakpoint 2 here */ diff --git a/gdb-6.8-inlining-by-name.patch b/gdb-6.8-inlining-by-name.patch index 2f7a74f..6096247 100644 --- a/gdb-6.8-inlining-by-name.patch +++ b/gdb-6.8-inlining-by-name.patch @@ -1,10 +1,11 @@ Implement `b ' for with concete inlined instances by a multiple-PC breakpoint. -diff -up -u -X /home/jkratoch/.diffi.list -rup sources-inline-works3-orig/gdb/ada-lang.c sources-inline-works3/gdb/ada-lang.c ---- sources-inline-works3-orig/gdb/ada-lang.c 2008-06-24 20:58:11.000000000 +0200 -+++ sources-inline-works3/gdb/ada-lang.c 2008-06-26 15:29:33.000000000 +0200 -@@ -4625,7 +4625,7 @@ remove_irrelevant_renamings (struct ada_ +Index: gdb-6.8.50.20081128/gdb/ada-lang.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/ada-lang.c 2008-11-25 00:21:15.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/ada-lang.c 2008-12-06 21:39:56.000000000 +0100 +@@ -4614,7 +4614,7 @@ remove_irrelevant_renamings (struct ada_ if (current_block == NULL) return nsyms; @@ -13,7 +14,7 @@ diff -up -u -X /home/jkratoch/.diffi.list -rup sources-inline-works3-orig/gdb/ad if (current_function == NULL) return nsyms; -@@ -6721,7 +6721,7 @@ ada_find_renaming_symbol (const char *na +@@ -6625,7 +6625,7 @@ ada_find_renaming_symbol (const char *na static struct symbol * find_old_style_renaming_symbol (const char *name, struct block *block) { @@ -22,10 +23,11 @@ diff -up -u -X /home/jkratoch/.diffi.list -rup sources-inline-works3-orig/gdb/ad char *rename; if (function_sym != NULL) -diff -up -u -X /home/jkratoch/.diffi.list -rup sources-inline-works3-orig/gdb/block.c sources-inline-works3/gdb/block.c ---- sources-inline-works3-orig/gdb/block.c 2008-06-24 20:58:11.000000000 +0200 -+++ sources-inline-works3/gdb/block.c 2008-06-26 15:29:09.000000000 +0200 -@@ -73,6 +73,19 @@ block_linkage_function (const struct blo +Index: gdb-6.8.50.20081128/gdb/block.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/block.c 2008-12-06 14:06:16.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/block.c 2008-12-06 21:40:29.000000000 +0100 +@@ -75,6 +75,19 @@ block_linkage_function (const struct blo return BLOCK_FUNCTION (bl); } @@ -42,13 +44,14 @@ diff -up -u -X /home/jkratoch/.diffi.list -rup sources-inline-works3-orig/gdb/bl + return BLOCK_FUNCTION (bl); +} + - /* Return one if BLOCK represents an inlined function. */ + /* Return one if BL represents an inlined function. */ int -diff -up -u -X /home/jkratoch/.diffi.list -rup sources-inline-works3-orig/gdb/block.h sources-inline-works3/gdb/block.h ---- sources-inline-works3-orig/gdb/block.h 2008-06-24 20:58:11.000000000 +0200 -+++ sources-inline-works3/gdb/block.h 2008-06-26 15:29:20.000000000 +0200 -@@ -137,6 +137,7 @@ struct blockvector +Index: gdb-6.8.50.20081128/gdb/block.h +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/block.h 2008-12-06 14:06:16.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/block.h 2008-12-06 21:39:56.000000000 +0100 +@@ -133,6 +133,7 @@ struct blockvector enum { GLOBAL_BLOCK = 0, STATIC_BLOCK = 1, FIRST_LOCAL_BLOCK = 2 }; extern struct symbol *block_linkage_function (const struct block *); @@ -56,10 +59,11 @@ diff -up -u -X /home/jkratoch/.diffi.list -rup sources-inline-works3-orig/gdb/bl extern int block_inlined_p (const struct block *block); -diff -up -u -X /home/jkratoch/.diffi.list -rup sources-inline-works3-orig/gdb/blockframe.c sources-inline-works3/gdb/blockframe.c ---- sources-inline-works3-orig/gdb/blockframe.c 2008-06-24 20:58:25.000000000 +0200 -+++ sources-inline-works3/gdb/blockframe.c 2008-06-26 15:34:44.000000000 +0200 -@@ -157,7 +157,7 @@ find_pc_sect_function (CORE_ADDR pc, str +Index: gdb-6.8.50.20081128/gdb/blockframe.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/blockframe.c 2008-12-06 14:06:16.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/blockframe.c 2008-12-06 21:39:56.000000000 +0100 +@@ -143,7 +143,7 @@ find_pc_sect_function (CORE_ADDR pc, str struct block *b = block_for_pc_sect (pc, section); if (b == 0) return 0; @@ -68,10 +72,11 @@ diff -up -u -X /home/jkratoch/.diffi.list -rup sources-inline-works3-orig/gdb/bl } /* Return the function containing pc value PC. -diff -up -u -X /home/jkratoch/.diffi.list -rup sources-inline-works3-orig/gdb/breakpoint.c sources-inline-works3/gdb/breakpoint.c ---- sources-inline-works3-orig/gdb/breakpoint.c 2008-06-24 20:58:25.000000000 +0200 -+++ sources-inline-works3/gdb/breakpoint.c 2008-06-26 15:28:35.000000000 +0200 -@@ -5692,7 +5692,7 @@ resolve_sal_pc (struct symtab_and_line * +Index: gdb-6.8.50.20081128/gdb/breakpoint.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/breakpoint.c 2008-12-06 14:06:17.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/breakpoint.c 2008-12-06 21:39:56.000000000 +0100 +@@ -5712,7 +5712,7 @@ resolve_sal_pc (struct symtab_and_line * bv = blockvector_for_pc_sect (sal->pc, 0, &b, sal->symtab); if (bv != NULL) { @@ -80,19 +85,20 @@ diff -up -u -X /home/jkratoch/.diffi.list -rup sources-inline-works3-orig/gdb/br if (sym != NULL) { fixup_symbol_section (sym, sal->symtab->objfile); -diff -up -u -X /home/jkratoch/.diffi.list -rup sources-inline-works3-orig/gdb/testsuite/gdb.opt/inline-cmds.exp sources-inline-works3/gdb/testsuite/gdb.opt/inline-cmds.exp ---- sources-inline-works3-orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2008-06-24 20:58:25.000000000 +0200 -+++ sources-inline-works3/gdb/testsuite/gdb.opt/inline-cmds.exp 2008-06-26 15:49:12.000000000 +0200 -@@ -42,8 +42,10 @@ if { [skip_inline_frame_tests] } { +Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-cmds.exp +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2008-12-06 21:37:27.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-cmds.exp 2008-12-06 21:41:37.000000000 +0100 +@@ -45,8 +45,10 @@ if { [skip_inline_frame_tests] } { # First, check that the things we expected to be inlined really were, # and those that shouldn't be weren't. --set line1 [gdb_get_line_number "set breakpoint 1 here"] --gdb_breakpoint $line1 +-set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile2}] +-gdb_breakpoint $srcfile2:$line1 +# We test also inlining by the function name, otherwise we would use: -+# set line1 [gdb_get_line_number "set breakpoint 1 here"] -+# gdb_breakpoint $line1 ++# set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile2}] ++# gdb_breakpoint $srcfile2:$line1 +gdb_breakpoint "bar" - set line2 [gdb_get_line_number "set breakpoint 2 here"] - gdb_breakpoint $line2 + set line2 [gdb_get_line_number "set breakpoint 2 here" ${srcfile2}] + gdb_breakpoint $srcfile2:$line2 diff --git a/gdb-6.8-inlining.patch b/gdb-6.8-inlining.patch index a72950e..4b71b49 100644 --- a/gdb-6.8-inlining.patch +++ b/gdb-6.8-inlining.patch @@ -1,81 +1,35 @@ -http://sourceware.org/ml/gdb-patches/2008-06/msg00239.html +http://sourceware.org/ml/gdb-patches/2008-07/msg00442.html +with pre-applied and post-unapplied (the patch is currently 2008-12-06 not +applied upstream) +http://sourceware.org/ml/gdb-patches/2008-07/msg00317.html + +Removed dwarf_expr_frame_base NULL check duplicity with *-vla.patch. + +Index: gdb-6.8.50.20081209/gdb/NEWS +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/NEWS 2008-12-02 08:57:36.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/NEWS 2008-12-10 01:28:37.000000000 +0100 +@@ -26,6 +26,9 @@ completions will be "f1" and "f2". + operators when expanding macros. It also supports variable-arity + macros. + ++* Inlined functions are now supported. They show up in backtraces, and ++the "step", "next", and "finish" commands handle them automatically. + -http://sourceware.org/ml/gdb-patches/2008-06/msg00379.html - -[ Backported for gdb-6.8fedora. ] - -Index: gdb-6.8/gdb/Makefile.in + * New remote packets + + qSearch:memory: +Index: gdb-6.8.50.20081209/gdb/block.c =================================================================== ---- gdb-6.8.orig/gdb/Makefile.in 2008-07-14 10:28:30.000000000 +0200 -+++ gdb-6.8/gdb/Makefile.in 2008-07-14 10:29:07.000000000 +0200 -@@ -607,6 +607,7 @@ SFILES = ada-exp.y ada-lang.c ada-typepr - inf-loop.c \ - infcall.c \ - infcmd.c inflow.c infrun.c \ -+ inline-frame.c \ - interps.c \ - jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \ - language.c linespec.c \ -@@ -1068,6 +1069,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $ - user-regs.o \ - frame.o frame-unwind.o doublest.o \ - frame-base.o \ -+ inline-frame.o \ - gnu-v2-abi.o gnu-v3-abi.o cp-abi.o cp-support.o \ - cp-namespace.o \ - reggroups.o regset.o \ -Index: gdb-6.8/gdb/ada-lang.c -=================================================================== ---- gdb-6.8.orig/gdb/ada-lang.c 2008-07-14 10:28:30.000000000 +0200 -+++ gdb-6.8/gdb/ada-lang.c 2008-07-14 10:29:07.000000000 +0200 -@@ -4624,7 +4624,7 @@ remove_irrelevant_renamings (struct ada_ - if (current_block == NULL) - return nsyms; - -- current_function = block_function (current_block); -+ current_function = block_linkage_function (current_block); - if (current_function == NULL) - return nsyms; - -@@ -6778,7 +6778,7 @@ ada_find_renaming_symbol (const char *na - static struct symbol * - find_old_style_renaming_symbol (const char *name, struct block *block) - { -- const struct symbol *function_sym = block_function (block); -+ const struct symbol *function_sym = block_linkage_function (block); - char *rename; - - if (function_sym != NULL) -@@ -9946,7 +9946,7 @@ ada_unhandled_exception_name_addr_from_r - the frame corresponding to RAISE_SYM_NAME. This frame is - at least 3 levels up, so we simply skip the first 3 frames - without checking the name of their associated function. */ -- fi = get_current_frame (); -+ fi = get_current_user_frame (); - for (frame_level = 0; frame_level < 3; frame_level += 1) - if (fi != NULL) - fi = get_prev_frame (fi); -@@ -10041,7 +10041,7 @@ print_it_exception (enum exception_catch - exception_name [sizeof (exception_name) - 1] = '\0'; - } - -- ada_find_printable_frame (get_current_frame ()); -+ ada_find_printable_frame (get_current_user_frame ()); - - annotate_catchpoint (b->number); - switch (ex) -Index: gdb-6.8/gdb/block.c -=================================================================== ---- gdb-6.8.orig/gdb/block.c 2008-01-01 23:53:09.000000000 +0100 -+++ gdb-6.8/gdb/block.c 2008-07-14 10:29:07.000000000 +0200 -@@ -47,23 +47,40 @@ contained_in (const struct block *a, con +--- gdb-6.8.50.20081209.orig/gdb/block.c 2008-09-05 13:37:16.000000000 +0200 ++++ gdb-6.8.50.20081209/gdb/block.c 2008-12-10 01:28:37.000000000 +0100 +@@ -47,8 +47,16 @@ contained_in (const struct block *a, con { if (!a || !b) return 0; - return BLOCK_START (a) >= BLOCK_START (b) - && BLOCK_END (a) <= BLOCK_END (b); --} - ++ + do + { + if (a == b) @@ -85,16 +39,12 @@ Index: gdb-6.8/gdb/block.c + while (a != NULL); + + return 0; -+} + } - /* Return the symbol for the function which contains a specified -- lexical block, described by a struct block BL. */ -+ lexical block, described by a struct block BL. Inlined functions -+ are never returned. */ +@@ -60,12 +68,21 @@ contained_in (const struct block *a, con struct symbol * --block_function (const struct block *bl) -+block_linkage_function (const struct block *bl) + block_linkage_function (const struct block *bl) { - while (BLOCK_FUNCTION (bl) == 0 && BLOCK_SUPERBLOCK (bl) != 0) + while ((BLOCK_FUNCTION (bl) == NULL || block_inlined_p (bl)) @@ -104,29 +54,21 @@ Index: gdb-6.8/gdb/block.c return BLOCK_FUNCTION (bl); } -+/* Return one if BLOCK represents an inlined function. */ ++/* Return one if BL represents an inlined function. */ + +int -+block_inlined_p (const struct block *block) ++block_inlined_p (const struct block *bl) +{ -+ return BLOCK_INLINED (block); ++ return BLOCK_FUNCTION (bl) != NULL && SYMBOL_INLINED (BLOCK_FUNCTION (bl)); +} + /* Return the blockvector immediately containing the innermost lexical block containing the specified pc value and section, or 0 if there is none. PBLOCK is a pointer to the block. If PBLOCK is NULL, we -@@ -304,6 +321,7 @@ allocate_block (struct obstack *obstack) - BLOCK_SUPERBLOCK (bl) = NULL; - BLOCK_DICT (bl) = NULL; - BLOCK_NAMESPACE (bl) = NULL; -+ BLOCK_INLINED (bl) = 0; - - return bl; - } -Index: gdb-6.8/gdb/block.h +Index: gdb-6.8.50.20081209/gdb/block.h =================================================================== ---- gdb-6.8.orig/gdb/block.h 2008-01-01 23:53:09.000000000 +0100 -+++ gdb-6.8/gdb/block.h 2008-07-14 10:29:07.000000000 +0200 +--- gdb-6.8.50.20081209.orig/gdb/block.h 2008-09-05 13:37:16.000000000 +0200 ++++ gdb-6.8.50.20081209/gdb/block.h 2008-12-10 01:28:37.000000000 +0100 @@ -65,7 +65,7 @@ struct block CORE_ADDR endaddr; @@ -136,45 +78,33 @@ Index: gdb-6.8/gdb/block.h struct symbol *function; -@@ -96,6 +96,9 @@ struct block - cplus_specific; - } - language_specific; -+ -+ /* Set if this block corresponds to an inlined function. */ -+ unsigned char inlined; - }; +@@ -134,6 +134,8 @@ enum { GLOBAL_BLOCK = 0, STATIC_BLOCK = - #define BLOCK_START(bl) (bl)->startaddr -@@ -104,6 +107,7 @@ struct block - #define BLOCK_SUPERBLOCK(bl) (bl)->superblock - #define BLOCK_DICT(bl) (bl)->dict - #define BLOCK_NAMESPACE(bl) (bl)->language_specific.cplus_specific.namespace -+#define BLOCK_INLINED(bl) (bl)->inlined + extern struct symbol *block_linkage_function (const struct block *); - /* Macro to loop through all symbols in a block BL, in no particular - order. ITER helps keep track of the iteration, and should be a -@@ -132,7 +136,9 @@ struct blockvector - - enum { GLOBAL_BLOCK = 0, STATIC_BLOCK = 1, FIRST_LOCAL_BLOCK = 2 }; - --extern struct symbol *block_function (const struct block *); -+extern struct symbol *block_linkage_function (const struct block *); -+ +extern int block_inlined_p (const struct block *block); - ++ extern int contained_in (const struct block *, const struct block *); -Index: gdb-6.8/gdb/blockframe.c + extern struct blockvector *blockvector_for_pc (CORE_ADDR, struct block **); +Index: gdb-6.8.50.20081209/gdb/blockframe.c =================================================================== ---- gdb-6.8.orig/gdb/blockframe.c 2008-01-01 23:53:09.000000000 +0100 -+++ gdb-6.8/gdb/blockframe.c 2008-07-14 10:29:07.000000000 +0200 -@@ -61,11 +61,44 @@ struct block * +--- gdb-6.8.50.20081209.orig/gdb/blockframe.c 2008-09-05 13:37:16.000000000 +0200 ++++ gdb-6.8.50.20081209/gdb/blockframe.c 2008-12-10 01:28:37.000000000 +0100 +@@ -36,6 +36,7 @@ + #include "command.h" + #include "gdbcmd.h" + #include "block.h" ++#include "inline-frame.h" + + /* Prototypes for exported functions. */ + +@@ -61,11 +62,29 @@ struct block * get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block) { const CORE_ADDR pc = get_frame_address_in_block (frame); + struct frame_info *next_frame; -+ struct block *bl, *cur_bl; ++ struct block *bl; + int inline_count; if (addr_in_block) @@ -185,22 +115,7 @@ Index: gdb-6.8/gdb/blockframe.c + if (bl == NULL) + return NULL; + -+ inline_count = 0; -+ -+ /* Any possibly inlined frames (inlined functions) behind NORMAL_FRAME -+ (non-inlined function) will already be at a different code location and -+ not found by BLOCK_FOR_PC at this PC moment. */ -+ for (next_frame = get_next_frame (frame); -+ next_frame && get_frame_type (next_frame) == INLINE_FRAME; -+ next_frame = get_next_frame (next_frame)) -+ inline_count++; -+ -+ /* Simulate some most-inner inlined frames which were suppressed. -+ INLINE_SKIPPED_FRAMES will never exceed the number of the most-inner -+ frames. But if we are unwinding already outer frames from some -+ non-inlined frame this frames skipping cannot apply. */ -+ if (next_frame == NULL) -+ inline_count += inline_skipped_frames (); ++ inline_count = frame_inlined_callees (frame); + + while (inline_count > 0) + { @@ -215,22 +130,13 @@ Index: gdb-6.8/gdb/blockframe.c } CORE_ADDR -@@ -77,7 +110,7 @@ get_pc_function_start (CORE_ADDR pc) - bl = block_for_pc (pc); - if (bl) - { -- struct symbol *symbol = block_function (bl); -+ struct symbol *symbol = block_linkage_function (bl); - - if (symbol) - { -@@ -104,9 +137,14 @@ struct symbol * +@@ -104,9 +123,14 @@ struct symbol * get_frame_function (struct frame_info *frame) { struct block *bl = get_frame_block (frame, 0); - if (bl == 0) - return 0; -- return block_function (bl); +- return block_linkage_function (bl); + + if (bl == NULL) + return NULL; @@ -242,21 +148,8 @@ Index: gdb-6.8/gdb/blockframe.c } -@@ -119,7 +157,7 @@ find_pc_sect_function (CORE_ADDR pc, str - struct block *b = block_for_pc_sect (pc, section); - if (b == 0) - return 0; -- return block_function (b); -+ return block_linkage_function (b); - } - - /* Return the function containing pc value PC. -@@ -356,11 +394,11 @@ block_innermost_frame (struct block *blo - start = BLOCK_START (block); - end = BLOCK_END (block); - -- frame = get_current_frame (); -+ frame = get_current_user_frame (); +@@ -350,8 +374,8 @@ block_innermost_frame (struct block *blo + frame = get_current_frame (); while (frame != NULL) { - calling_pc = get_frame_address_in_block (frame); @@ -266,11 +159,11 @@ Index: gdb-6.8/gdb/blockframe.c return frame; frame = get_prev_frame (frame); -Index: gdb-6.8/gdb/breakpoint.c +Index: gdb-6.8.50.20081209/gdb/breakpoint.c =================================================================== ---- gdb-6.8.orig/gdb/breakpoint.c 2008-07-14 10:28:36.000000000 +0200 -+++ gdb-6.8/gdb/breakpoint.c 2008-07-14 10:29:07.000000000 +0200 -@@ -2602,18 +2602,21 @@ watchpoint_check (void *p) +--- gdb-6.8.50.20081209.orig/gdb/breakpoint.c 2008-12-10 01:28:28.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/breakpoint.c 2008-12-10 01:28:37.000000000 +0100 +@@ -2572,19 +2572,21 @@ watchpoint_check (void *p) within_current_scope = 1; else { @@ -284,7 +177,8 @@ Index: gdb-6.8/gdb/breakpoint.c /* If we've gotten confused in the unwinder, we might have returned a frame that can't describe this variable. */ - if (within_current_scope -- && block_function (b->exp_valid_block) != get_frame_function (fr)) +- && (block_linkage_function (b->exp_valid_block) +- != get_frame_function (fr))) - within_current_scope = 0; + if (within_current_scope) + { @@ -299,7 +193,7 @@ Index: gdb-6.8/gdb/breakpoint.c /* in_function_epilogue_p() returns a non-zero value if we're still in the function but the stack frame has already been invalidated. -@@ -2625,10 +2628,9 @@ watchpoint_check (void *p) +@@ -2596,10 +2598,9 @@ watchpoint_check (void *p) that the watchpoint frame couldn't be found by frame_find_by_id() because the current PC is currently in an epilogue. Calling gdbarch_in_function_epilogue_p() also when fr == NULL fixes that. */ @@ -312,54 +206,43 @@ Index: gdb-6.8/gdb/breakpoint.c /* If we end up stopping, the current frame will get selected in normal_stop. So this call to select_frame won't affect the user. */ -@@ -2929,7 +2931,7 @@ bpstat_stop_status (CORE_ADDR bp_addr, p - } +@@ -2833,7 +2834,7 @@ bpstat_check_breakpoint_conditions (bpst + struct breakpoint *b = bl->owner; - if (frame_id_p (b->frame_id) -- && !frame_id_eq (b->frame_id, get_frame_id (get_current_frame ()))) -+ && !frame_id_stack_eq (b->frame_id, get_frame_id (get_current_frame ()))) - bs->stop = 0; - else - { -@@ -2944,9 +2946,13 @@ bpstat_stop_status (CORE_ADDR bp_addr, p - - if (bl->cond && bl->owner->disposition != disp_del_at_next_stop) - { -- /* Need to select the frame, with all that implies -- so that the conditions will have the right context. */ -- select_frame (get_current_frame ()); -+ /* Need to select the frame, with all that implies so that -+ the conditions will have the right context. Because we -+ use the frame, we will not see an inlined function's -+ variables when we arrive at a breakpoint at the start -+ of the inlined function; the current frame will be the -+ call site. */ -+ select_frame (get_current_user_frame ()); - value_is_zero - = catch_errors (breakpoint_cond_eval, (bl->cond), - "Error in testing breakpoint condition:\n", -@@ -2991,6 +2997,11 @@ bpstat_stop_status (CORE_ADDR bp_addr, p - bs->print = 0; - } - bs->commands = copy_command_lines (bs->commands); -+ -+ /* We display the innermost inlined frame at a breakpont as it gives to -+ most of the available information. */ -+ if (b->type != bp_until && b->type != bp_finish) -+ set_skipped_inline_frames (0); - } - } - /* Print nothing for this entry if we dont stop or if we dont print. */ -@@ -5583,7 +5594,7 @@ resolve_sal_pc (struct symtab_and_line * - bv = blockvector_for_pc_sect (sal->pc, 0, &b, sal->symtab); - if (bv != NULL) + if (frame_id_p (b->frame_id) +- && !frame_id_eq (b->frame_id, get_frame_id (get_current_frame ()))) ++ && !frame_id_eq (b->frame_id, get_stack_frame_id (get_current_frame ()))) + bs->stop = 0; + else if (bs->stop) + { +@@ -2848,8 +2849,12 @@ bpstat_check_breakpoint_conditions (bpst + + if (bl->cond && bl->owner->disposition != disp_del_at_next_stop) { -- sym = block_function (b); -+ sym = block_linkage_function (b); - if (sym != NULL) - { - fixup_symbol_section (sym, sal->symtab->objfile); -@@ -5715,7 +5726,6 @@ watch_command_1 (char *arg, int accessfl +- /* Need to select the frame, with all that implies +- so that the conditions will have the right context. */ ++ /* Need to select the frame, with all that implies so that ++ the conditions will have the right context. Because we ++ use the frame, we will not see an inlined function's ++ variables when we arrive at a breakpoint at the start ++ of the inlined function; the current frame will be the ++ call site. */ + select_frame (get_current_frame ()); + value_is_zero + = catch_errors (breakpoint_cond_eval, (bl->cond), +@@ -4820,6 +4825,11 @@ set_momentary_breakpoint (struct symtab_ + enum bptype type) + { + struct breakpoint *b; ++ ++ /* If FRAME_ID is valid, it should be a real frame, not an inlined ++ one. */ ++ gdb_assert (!frame_id_inlined_p (frame_id)); ++ + b = set_raw_breakpoint (sal, type); + b->enable_state = bp_enabled; + b->disposition = disp_donttouch; +@@ -5832,7 +5842,6 @@ watch_command_1 (char *arg, int accessfl struct block *exp_valid_block; struct value *val, *mark, *val_chain; struct frame_info *frame; @@ -367,7 +250,7 @@ Index: gdb-6.8/gdb/breakpoint.c char *exp_start = NULL; char *exp_end = NULL; char *tok, *id_tok_start, *end_tok; -@@ -5870,34 +5880,36 @@ watch_command_1 (char *arg, int accessfl +@@ -5987,34 +5996,34 @@ watch_command_1 (char *arg, int accessfl bp_type = bp_watchpoint; frame = block_innermost_frame (exp_valid_block); @@ -385,13 +268,11 @@ Index: gdb-6.8/gdb/breakpoint.c { - scope_breakpoint = create_internal_breakpoint (get_frame_pc (prev_frame), - bp_watchpoint_scope); -+ while (get_frame_type (frame) == INLINE_FRAME) -+ frame = get_prev_frame (frame); -+ + if (frame_id_p (frame_unwind_id (frame))) + { -+ scope_breakpoint = create_internal_breakpoint (frame_pc_unwind (frame), -+ bp_watchpoint_scope); ++ scope_breakpoint ++ = create_internal_breakpoint (frame_pc_unwind (frame), ++ bp_watchpoint_scope); - scope_breakpoint->enable_state = bp_enabled; + scope_breakpoint->enable_state = bp_enabled; @@ -422,38 +303,48 @@ Index: gdb-6.8/gdb/breakpoint.c } /* Now set up the breakpoint. */ -@@ -6070,7 +6082,6 @@ until_break_command (char *arg, int from +@@ -6195,7 +6204,6 @@ until_break_command (char *arg, int from struct symtabs_and_lines sals; struct symtab_and_line sal; struct frame_info *frame = get_selected_frame (NULL); - struct frame_info *prev_frame = get_prev_frame (frame); struct breakpoint *breakpoint; + struct breakpoint *breakpoint2 = NULL; struct cleanup *old_chain; - struct continuation_arg *arg1; -@@ -6137,11 +6148,14 @@ until_break_command (char *arg, int from +@@ -6228,20 +6236,22 @@ until_break_command (char *arg, int from + we don't specify a frame at which we need to stop. */ + breakpoint = set_momentary_breakpoint (sal, null_frame_id, bp_until); + else +- /* Otherwise, specify the current frame, because we want to stop only ++ /* Otherwise, specify the selected frame, because we want to stop only + at the very same frame. */ +- breakpoint = set_momentary_breakpoint (sal, get_frame_id (frame), ++ breakpoint = set_momentary_breakpoint (sal, get_stack_frame_id (frame), + bp_until); + + old_chain = make_cleanup_delete_breakpoint (breakpoint); /* Keep within the current frame, or in frames called by the current one. */ - if (prev_frame) -+ while (get_frame_type (frame) == INLINE_FRAME) -+ frame = get_prev_frame (frame); + + if (frame_id_p (frame_unwind_id (frame))) { - sal = find_pc_line (get_frame_pc (prev_frame), 0); - sal.pc = get_frame_pc (prev_frame); -- breakpoint = set_momentary_breakpoint (sal, get_frame_id (prev_frame), +- breakpoint2 = set_momentary_breakpoint (sal, get_frame_id (prev_frame), + sal = find_pc_line (frame_pc_unwind (frame), 0); + sal.pc = frame_pc_unwind (frame); -+ breakpoint = set_momentary_breakpoint (sal, frame_unwind_id (frame), - bp_until); - if (!target_can_async_p ()) - make_cleanup_delete_breakpoint (breakpoint); -Index: gdb-6.8/gdb/buildsym.c ++ breakpoint2 = set_momentary_breakpoint (sal, ++ frame_unwind_id (frame), + bp_until); + make_cleanup_delete_breakpoint (breakpoint2); + } +Index: gdb-6.8.50.20081209/gdb/buildsym.c =================================================================== ---- gdb-6.8.orig/gdb/buildsym.c 2008-01-01 23:53:09.000000000 +0100 -+++ gdb-6.8/gdb/buildsym.c 2008-07-14 10:29:07.000000000 +0200 -@@ -1141,6 +1141,12 @@ end_symtab (CORE_ADDR end_addr, struct o +--- gdb-6.8.50.20081209.orig/gdb/buildsym.c 2008-08-21 20:40:34.000000000 +0200 ++++ gdb-6.8.50.20081209/gdb/buildsym.c 2008-12-10 01:28:37.000000000 +0100 +@@ -1159,6 +1159,12 @@ end_symtab (CORE_ADDR end_addr, struct o struct symbol *sym; struct dict_iterator iter; @@ -466,11 +357,11 @@ Index: gdb-6.8/gdb/buildsym.c for (sym = dict_iterator_first (BLOCK_DICT (block), &iter); sym != NULL; sym = dict_iterator_next (&iter)) -Index: gdb-6.8/gdb/doc/gdb.texinfo +Index: gdb-6.8.50.20081209/gdb/doc/gdb.texinfo =================================================================== ---- gdb-6.8.orig/gdb/doc/gdb.texinfo 2008-07-14 10:28:50.000000000 +0200 -+++ gdb-6.8/gdb/doc/gdb.texinfo 2008-07-14 10:29:07.000000000 +0200 -@@ -136,6 +136,7 @@ software in general. We will miss him. +--- gdb-6.8.50.20081209.orig/gdb/doc/gdb.texinfo 2008-12-10 01:28:28.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/doc/gdb.texinfo 2008-12-10 01:28:37.000000000 +0100 +@@ -147,6 +147,7 @@ software in general. We will miss him. * Stack:: Examining the stack * Source:: Examining source files * Data:: Examining data @@ -478,7 +369,7 @@ Index: gdb-6.8/gdb/doc/gdb.texinfo * Macros:: Preprocessor Macros * Tracepoints:: Debugging remote targets non-intrusively * Overlays:: Debugging programs that use overlays -@@ -1761,7 +1762,7 @@ To request debugging information, specif +@@ -1813,7 +1814,7 @@ To request debugging information, specif the compiler. Programs that are to be shipped to your customers are compiled with @@ -487,7 +378,7 @@ Index: gdb-6.8/gdb/doc/gdb.texinfo compilers are unable to handle the @samp{-g} and @samp{-O} options together. Using those compilers, you cannot generate optimized executables containing debugging information. -@@ -1770,22 +1771,7 @@ executables containing debugging informa +@@ -1822,22 +1823,7 @@ executables containing debugging informa without @samp{-O}, making it possible to debug optimized code. We recommend that you @emph{always} use @samp{-g} whenever you compile a program. You may think your program is correct, but there is no sense @@ -511,9 +402,9 @@ Index: gdb-6.8/gdb/doc/gdb.texinfo Older versions of the @sc{gnu} C compiler permitted a variant option @w{@samp{-gg}} for debugging information. @value{GDBN} no longer supports this -@@ -7609,6 +7595,100 @@ the data cache operation. - @end table - +@@ -8271,6 +8257,107 @@ $1 = 1 + $2 = (void *) 0x8049560 + @end smallexample +@node Optimized Code +@chapter Debugging Optimized Code @@ -587,24 +478,31 @@ Index: gdb-6.8/gdb/doc/gdb.texinfo +a single instruction using @code{stepi} or @code{nexti} does not do +this; single instruction steps always show the inlined body. + -+There are some ways that @value{GDBN} cannot pretend that inlined ++There are some ways that @value{GDBN} does not pretend that inlined +function calls are the same as normal calls: + +@itemize @bullet +@item +You cannot set breakpoints on inlined functions. @value{GDBN} +either reports that there is no symbol with that name, or else sets the -+breakpoint on the non-inlined copy of the function. ++breakpoint only on non-inlined copies of the function. This limitation ++will be removed in a future version of @value{GDBN}; until then, ++set a breakpoint by line number on the first line of the inlined ++function instead. + +@item +Setting breakpoints at the call site of an inlined function may not +work, because the call site does not contain any code. @value{GDBN} +may incorrectly move the breakpoint to the next line of the enclosing -+function, after the call. ++function, after the call. This limitation will be removed in a future ++version of @value{GDBN}; until then, set a breakpoint on an earlier line ++or inside the inlined function instead. + +@item +@value{GDBN} cannot locate the return value of inlined calls after -+using the @code{finish} command. ++using the @code{finish} command. This is a limitation of compiler-generated ++debugging information; after @code{finish}, you can step to the next line ++and print a variable where your program stored the return value. + +@end itemize + @@ -612,10 +510,10 @@ Index: gdb-6.8/gdb/doc/gdb.texinfo @node Macros @chapter C Preprocessor Macros -Index: gdb-6.8/gdb/dwarf2loc.c +Index: gdb-6.8.50.20081209/gdb/dwarf2loc.c =================================================================== ---- gdb-6.8.orig/gdb/dwarf2loc.c 2008-07-14 10:28:30.000000000 +0200 -+++ gdb-6.8/gdb/dwarf2loc.c 2008-07-14 10:29:07.000000000 +0200 +--- gdb-6.8.50.20081209.orig/gdb/dwarf2loc.c 2008-12-10 01:22:11.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/dwarf2loc.c 2008-12-10 01:28:37.000000000 +0100 @@ -31,6 +31,7 @@ #include "regcache.h" #include "objfiles.h" @@ -624,7 +522,7 @@ Index: gdb-6.8/gdb/dwarf2loc.c #include "elf/dwarf2.h" #include "dwarf2expr.h" -@@ -145,7 +146,10 @@ dwarf_expr_frame_base (void *baton, gdb_ +@@ -150,7 +151,10 @@ dwarf_expr_frame_base (void *baton, gdb_ struct symbol *framefunc; struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton; @@ -636,43 +534,39 @@ Index: gdb-6.8/gdb/dwarf2loc.c /* If we found a frame-relative symbol then it was certainly within some function associated with a frame. If we can't find the frame, -Index: gdb-6.8/gdb/dwarf2read.c +Index: gdb-6.8.50.20081209/gdb/dwarf2read.c =================================================================== ---- gdb-6.8.orig/gdb/dwarf2read.c 2008-07-14 10:28:30.000000000 +0200 -+++ gdb-6.8/gdb/dwarf2read.c 2008-07-14 10:29:07.000000000 +0200 -@@ -46,6 +46,7 @@ - #include "top.h" +--- gdb-6.8.50.20081209.orig/gdb/dwarf2read.c 2008-12-10 01:28:28.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/dwarf2read.c 2008-12-10 01:28:37.000000000 +0100 +@@ -45,6 +45,7 @@ + #include "hashtab.h" #include "command.h" #include "gdbcmd.h" +#include "block.h" + #include "addrmap.h" + #include "top.h" - #include - #include "gdb_string.h" -@@ -2674,14 +2675,10 @@ process_die (struct die_info *die, struc +@@ -2787,12 +2788,8 @@ process_die (struct die_info *die, struc read_file_scope (die, cu); break; case DW_TAG_subprogram: -+ case DW_TAG_inlined_subroutine: - read_subroutine_type (die, cu); - read_func_scope (die, cu); - break; -- case DW_TAG_inlined_subroutine: +- read_func_scope (die, cu); +- break; + case DW_TAG_inlined_subroutine: - /* FIXME: These are ignored for now. - They could be used to set breakpoints on all inlined instances - of a function and make GDB `next' properly over inlined functions. */ -- break; ++ read_func_scope (die, cu); + break; case DW_TAG_lexical_block: case DW_TAG_try_block: - case DW_TAG_catch_block: -@@ -2925,12 +2922,27 @@ read_func_scope (struct die_info *die, s +@@ -3055,10 +3052,25 @@ read_func_scope (struct die_info *die, s CORE_ADDR lowpc; CORE_ADDR highpc; struct die_info *child_die; - struct attribute *attr; + struct attribute *attr, *call_line, *call_file; char *name; - const char *previous_prefix = processing_current_prefix; - struct cleanup *back_to = NULL; CORE_ADDR baseaddr; struct block *block; + int inlined_func = (die->tag == DW_TAG_inlined_subroutine); @@ -693,39 +587,17 @@ Index: gdb-6.8/gdb/dwarf2read.c baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); -@@ -3017,6 +3029,9 @@ read_func_scope (struct die_info *die, s - block = finish_block (new->name, &local_symbols, new->old_blocks, - lowpc, highpc, objfile); - -+ if (inlined_func) -+ BLOCK_INLINED (block) = 1; -+ - /* If we have address ranges, record them. */ - dwarf2_record_block_ranges (die, block, baseaddr, cu); - -@@ -6717,8 +6732,9 @@ die_is_declaration (struct die_info *die - && dwarf2_attr (die, DW_AT_specification, cu) == NULL); - } - --/* Return the die giving the specification for DIE, if there is -- one. */ -+/* Return the die giving the specification for DIE, if there is one. -+ If there is no specification, but there is an abstract origin, that -+ is returned. */ - - static struct die_info * - die_specification (struct die_info *die, struct dwarf2_cu *cu) -@@ -6726,6 +6742,9 @@ die_specification (struct die_info *die, - struct attribute *spec_attr = dwarf2_attr (die, DW_AT_specification, cu); +@@ -6942,6 +6954,9 @@ die_specification (struct die_info *die, + *spec_cu); if (spec_attr == NULL) -+ spec_attr = dwarf2_attr (die, DW_AT_abstract_origin, cu); ++ spec_attr = dwarf2_attr (die, DW_AT_abstract_origin, *spec_cu); + + if (spec_attr == NULL) return NULL; else - return follow_die_ref (die, spec_attr, cu); -@@ -7401,6 +7420,7 @@ new_symbol (struct die_info *die, struct + return follow_die_ref (die, spec_attr, spec_cu); +@@ -7625,6 +7640,7 @@ new_symbol (struct die_info *die, struct struct attribute *attr = NULL; struct attribute *attr2 = NULL; CORE_ADDR baseaddr; @@ -733,7 +605,7 @@ Index: gdb-6.8/gdb/dwarf2read.c baseaddr = ANOFFSET (objfile->section_offsets, SECT_OFF_TEXT (objfile)); -@@ -7428,13 +7448,17 @@ new_symbol (struct die_info *die, struct +@@ -7654,13 +7670,17 @@ new_symbol (struct die_info *die, struct SYMBOL_TYPE (sym) = type; else SYMBOL_TYPE (sym) = die_type (die, cu); @@ -753,7 +625,7 @@ Index: gdb-6.8/gdb/dwarf2read.c if (attr) { int file_index = DW_UNSND (attr); -@@ -7481,6 +7505,13 @@ new_symbol (struct die_info *die, struct +@@ -7707,6 +7727,14 @@ new_symbol (struct die_info *die, struct add_symbol_to_list (sym, cu->list_in_scope); } break; @@ -761,58 +633,42 @@ Index: gdb-6.8/gdb/dwarf2read.c + /* SYMBOL_BLOCK_VALUE (sym) will be filled in later by + finish_block. */ + SYMBOL_CLASS (sym) = LOC_BLOCK; ++ SYMBOL_INLINED (sym) = 1; + /* Do not add the symbol to any lists. It will be found via + BLOCK_FUNCTION from the blockvector. */ + break; case DW_TAG_variable: /* Compilation with minimal debug info may result in variables with missing type entries. Change the misleading `void' type -@@ -7532,9 +7563,19 @@ new_symbol (struct die_info *die, struct +@@ -7754,7 +7782,14 @@ new_symbol (struct die_info *die, struct + } + break; + case DW_TAG_formal_parameter: +- SYMBOL_IS_ARGUMENT (sym) = 1; ++ /* If we are inside a function, mark this as an argument. If ++ not, we might be looking at an argument to an inlined function ++ when we do not have enough information to show inlined frames; ++ pretend it's a local variable in that case so that the user can ++ still see it. */ ++ if (context_stack_depth > 0 ++ && context_stack[context_stack_depth - 1].name != NULL) ++ SYMBOL_IS_ARGUMENT (sym) = 1; + attr = dwarf2_attr (die, DW_AT_location, cu); if (attr) { - var_decode_location (attr, sym, cu); -- /* FIXME drow/2003-07-31: Is LOC_COMPUTED_ARG necessary? */ -- if (SYMBOL_CLASS (sym) == LOC_COMPUTED) -- SYMBOL_CLASS (sym) = LOC_COMPUTED_ARG; -+ -+ /* If we are inside a function, mark this as an argument. If -+ not, we might be looking at an argument to an inlined function -+ when we do not have enough information to show inlined frames; -+ pretend it's a local variable in that case so that the user can -+ still see it. */ -+ if (context_stack_depth > 0 -+ && context_stack[context_stack_depth - 1].name != NULL) -+ { -+ /* FIXME drow/2003-07-31: Is LOC_COMPUTED_ARG necessary? */ -+ if (SYMBOL_CLASS (sym) == LOC_COMPUTED) -+ SYMBOL_CLASS (sym) = LOC_COMPUTED_ARG; -+ } - } - attr = dwarf2_attr (die, DW_AT_const_value, cu); - if (attr) -Index: gdb-6.8/gdb/findvar.c +Index: gdb-6.8.50.20081209/gdb/frame-unwind.c =================================================================== ---- gdb-6.8.orig/gdb/findvar.c 2008-07-14 10:28:30.000000000 +0200 -+++ gdb-6.8/gdb/findvar.c 2008-07-14 10:29:07.000000000 +0200 -@@ -518,13 +518,11 @@ addresses have not been bound by the dyn - case LOC_REGPARM: - case LOC_REGPARM_ADDR: - { -- struct block *b; - int regno = SYMBOL_VALUE (var); - struct value *regval; +--- gdb-6.8.50.20081209.orig/gdb/frame-unwind.c 2008-05-06 20:37:46.000000000 +0200 ++++ gdb-6.8.50.20081209/gdb/frame-unwind.c 2008-12-10 01:28:37.000000000 +0100 +@@ -21,6 +21,7 @@ + #include "frame.h" + #include "frame-unwind.h" + #include "dummy-frame.h" ++#include "inline-frame.h" + #include "value.h" + #include "regcache.h" - if (frame == NULL) - return 0; -- b = get_frame_block (frame, 0); - - if (SYMBOL_CLASS (var) == LOC_REGPARM_ADDR) - { -Index: gdb-6.8/gdb/frame-unwind.c -=================================================================== ---- gdb-6.8.orig/gdb/frame-unwind.c 2008-01-01 23:53:09.000000000 +0100 -+++ gdb-6.8/gdb/frame-unwind.c 2008-07-14 10:29:07.000000000 +0200 -@@ -49,8 +49,10 @@ frame_unwind_init (struct obstack *obsta +@@ -51,8 +52,10 @@ frame_unwind_init (struct obstack *obsta can't override this. */ table->list = OBSTACK_ZALLOC (obstack, struct frame_unwind_table_entry); table->list->unwinder = dummy_frame_unwind; @@ -824,86 +680,16 @@ Index: gdb-6.8/gdb/frame-unwind.c return table; } -@@ -88,20 +90,55 @@ frame_unwind_find_by_frame (struct frame - struct gdbarch *gdbarch = get_frame_arch (next_frame); - struct frame_unwind_table *table = gdbarch_data (gdbarch, frame_unwind_data); - struct frame_unwind_table_entry *entry; -+ const struct frame_unwind *inline_unwinder = NULL; -+ - for (entry = table->list; entry != NULL; entry = entry->next) - { -+ /* We delay the INLINE_FRAME unwinders as last as they need to base their -+ decisions on their outer frames. The inline unwinding sniffer cannot -+ access its outer frames as any frame must be free to fully access its -+ inner frames which leads to deadlocks. Therefore we first do -+ a regular unwind first and then override (nullify the unwinding -+ operations) by setting it to the inlining unwinder (if it was detected -+ for such frame). */ -+ if (entry->unwinder && entry->unwinder->type == INLINE_FRAME) -+ { -+ gdb_assert (inline_unwinder == NULL); -+ gdb_assert (entry->sniffer == NULL); -+ inline_unwinder = entry->unwinder; -+ continue; -+ } - if (entry->sniffer != NULL) - { - const struct frame_unwind *desc = NULL; - desc = entry->sniffer (next_frame); - if (desc != NULL) -- return desc; -+ { -+ if (inline_unwinder) -+ { -+ /* Pass the complete information about the regular unwinder. */ -+ if (inline_unwinder->sniffer (desc, next_frame, this_cache)) -+ -+ return inline_unwinder; -+ } -+ return desc; -+ } - } - if (entry->unwinder != NULL) - { - if (entry->unwinder->sniffer (entry->unwinder, next_frame, - this_cache)) -- return entry->unwinder; -+ { -+ if (inline_unwinder) -+ { -+ /* Pass the complete information about the regular unwinder. */ -+ if (inline_unwinder->sniffer (entry->unwinder, next_frame, -+ this_cache)) -+ -+ return inline_unwinder; -+ } -+ return entry->unwinder; -+ } - } - } - internal_error (__FILE__, __LINE__, _("frame_unwind_find_by_frame failed")); -Index: gdb-6.8/gdb/frame-unwind.h +Index: gdb-6.8.50.20081209/gdb/frame.c =================================================================== ---- gdb-6.8.orig/gdb/frame-unwind.h 2008-01-01 23:53:09.000000000 +0100 -+++ gdb-6.8/gdb/frame-unwind.h 2008-07-14 10:29:07.000000000 +0200 -@@ -143,6 +143,8 @@ struct frame_unwind - frame_dealloc_cache_ftype *dealloc_cache; - }; - -+extern const struct frame_unwind *const inline_frame_unwind; -+ - /* Register a frame unwinder, _prepending_ it to the front of the - search list (so it is sniffed before previously registered - unwinders). By using a prepend, later calls can install unwinders -Index: gdb-6.8/gdb/frame.c -=================================================================== ---- gdb-6.8.orig/gdb/frame.c 2008-07-14 10:27:07.000000000 +0200 -+++ gdb-6.8/gdb/frame.c 2008-07-14 10:29:07.000000000 +0200 -@@ -40,8 +40,13 @@ - #include "observer.h" +--- gdb-6.8.50.20081209.orig/gdb/frame.c 2008-12-10 01:27:33.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/frame.c 2008-12-10 01:28:37.000000000 +0100 +@@ -41,8 +41,14 @@ #include "objfiles.h" #include "exceptions.h" + #include "gdbthread.h" +#include "block.h" ++#include "inline-frame.h" static struct frame_info *get_prev_frame_1 (struct frame_info *this_frame); +static struct frame_info *get_prev_frame_raw (struct frame_info *this_frame); @@ -913,19 +699,16 @@ Index: gdb-6.8/gdb/frame.c /* We keep a cache of stack frames, each of which is a "struct frame_info". The innermost one gets allocated (in -@@ -182,6 +187,11 @@ fprint_frame_id (struct ui_file *file, s +@@ -183,6 +189,8 @@ fprint_frame_id (struct ui_file *file, s fprint_field (file, "code", id.code_addr_p, id.code_addr); fprintf_unfiltered (file, ","); fprint_field (file, "special", id.special_addr_p, id.special_addr); + if (id.inline_depth) -+ { -+ fprintf_unfiltered (file, ",inlined=%d", id.inline_depth); -+ fprintf_unfiltered (file, ",block=0x%s", paddr_nz (id.block_addr)); -+ } ++ fprintf_unfiltered (file, ",inlined=%d", id.inline_depth); fprintf_unfiltered (file, "}"); } -@@ -196,6 +206,12 @@ fprint_frame_type (struct ui_file *file, +@@ -197,6 +205,12 @@ fprint_frame_type (struct ui_file *file, case DUMMY_FRAME: fprintf_unfiltered (file, "DUMMY_FRAME"); return; @@ -938,18 +721,65 @@ Index: gdb-6.8/gdb/frame.c case SIGTRAMP_FRAME: fprintf_unfiltered (file, "SIGTRAMP_FRAME"); return; -@@ -341,8 +357,8 @@ frame_id_p (struct frame_id l) - return p; +@@ -249,6 +263,18 @@ fprint_frame (struct ui_file *file, stru + fprintf_unfiltered (file, "}"); } --int --frame_id_eq (struct frame_id l, struct frame_id r) -+static int -+frame_id_eq_1 (struct frame_id l, struct frame_id r) ++/* Given FRAME, return the enclosing normal frame for inlined ++ function frames. Otherwise return the original frame. */ ++ ++static struct frame_info * ++skip_inlined_frames (struct frame_info *frame) ++{ ++ while (get_frame_type (frame) == INLINE_FRAME) ++ frame = get_prev_frame (frame); ++ ++ return frame; ++} ++ + /* Return a frame uniq ID that can be used to, later, re-find the + frame. */ + +@@ -281,13 +307,21 @@ get_frame_id (struct frame_info *fi) + } + + struct frame_id ++get_stack_frame_id (struct frame_info *next_frame) ++{ ++ return get_frame_id (skip_inlined_frames (next_frame)); ++} ++ ++struct frame_id + frame_unwind_id (struct frame_info *next_frame) + { + /* Use prev_frame, and not get_prev_frame. The latter will truncate + the frame chain, leading to this function unintentionally + returning a null_frame_id (e.g., when a caller requests the frame + ID of "main()"s caller. */ +- return get_frame_id (get_prev_frame_1 (next_frame)); ++ ++ next_frame = skip_inlined_frames (next_frame); ++ return get_frame_id (skip_inlined_frames (get_prev_frame_1 (next_frame))); + } + + const struct frame_id null_frame_id; /* All zeros. */ +@@ -342,6 +376,15 @@ frame_id_p (struct frame_id l) + } + + int ++frame_id_inlined_p (struct frame_id l) ++{ ++ if (!frame_id_p (l)) ++ return 0; ++ ++ return (l.inline_depth != 0); ++} ++ ++int + frame_id_eq (struct frame_id l, struct frame_id r) { int eq; - if (!l.stack_addr_p || !r.stack_addr_p) -@@ -352,21 +368,52 @@ frame_id_eq (struct frame_id l, struct f +@@ -352,21 +395,22 @@ frame_id_eq (struct frame_id l, struct f else if (l.stack_addr != r.stack_addr) /* If .stack addresses are different, the frames are different. */ eq = 0; @@ -971,72 +801,36 @@ Index: gdb-6.8/gdb/frame.c + /* An invalid special addr is a wild card (or unused). Otherwise + if special addresses are different, the frames are different. */ + eq = 0; ++ else if (l.inline_depth != r.inline_depth) ++ /* If inline depths are different, the frames must be different. */ ++ eq = 0; + else /* Frames are equal. */ eq = 1; - else - /* No luck. */ -+ -+ return eq; -+} -+ -+int -+frame_id_stack_eq (struct frame_id l, struct frame_id r) -+{ -+ int eq = frame_id_eq_1 (l, r); -+ -+ if (frame_debug) -+ { -+ fprintf_unfiltered (gdb_stdlog, "{ frame_id_stack_eq (l="); -+ fprint_frame_id (gdb_stdlog, l); -+ fprintf_unfiltered (gdb_stdlog, ",r="); -+ fprint_frame_id (gdb_stdlog, r); -+ fprintf_unfiltered (gdb_stdlog, ") -> %d }\n", eq); -+ } -+ -+ return eq; -+} -+ -+int -+frame_id_eq (struct frame_id l, struct frame_id r) -+{ -+ int eq = frame_id_eq_1 (l, r); -+ -+ if (l.inline_depth != r.inline_depth) -+ /* If inline depths are different, the frames must be different. */ - eq = 0; -+ else if (l.block_addr != r.block_addr) -+ /* If the inlined block has a different start address, the frames -+ must be different. */ -+ eq = 0; +- eq = 0; + if (frame_debug) { fprintf_unfiltered (gdb_stdlog, "{ frame_id_eq (l="); -@@ -375,6 +422,7 @@ frame_id_eq (struct frame_id l, struct f - fprint_frame_id (gdb_stdlog, r); - fprintf_unfiltered (gdb_stdlog, ") -> %d }\n", eq); - } -+ - return eq; - } - -@@ -385,6 +433,28 @@ frame_id_inner (struct gdbarch *gdbarch, +@@ -411,6 +455,29 @@ frame_id_inner (struct gdbarch *gdbarch, if (!l.stack_addr_p || !r.stack_addr_p) /* Like NaN, any operation involving an invalid ID always fails. */ inner = 0; -+ else if (l.inline_depth < r.inline_depth ++ else if (l.inline_depth > r.inline_depth + && l.stack_addr == r.stack_addr + && l.code_addr_p == r.code_addr_p -+ && (!l.code_addr_p || l.code_addr == r.code_addr) + && l.special_addr_p == r.special_addr_p -+ && (!l.special_addr_p || l.special_addr == r.special_addr)) ++ && l.special_addr == r.special_addr) + { + /* Same function, different inlined functions. */ + struct block *lb, *rb; + -+ lb = block_for_pc (l.block_addr); -+ rb = block_for_pc (r.block_addr); ++ gdb_assert (l.code_addr_p && r.code_addr_p); ++ ++ lb = block_for_pc (l.code_addr); ++ rb = block_for_pc (r.code_addr); + + if (lb == NULL || rb == NULL) + /* Something's gone wrong. */ @@ -1050,59 +844,31 @@ Index: gdb-6.8/gdb/frame.c else /* Only return non-zero when strictly inner than. Note that, per comment in "frame.h", there is some fuzz here. Frameless -@@ -412,7 +482,7 @@ frame_find_by_id (struct frame_id id) - if (!frame_id_p (id)) - return NULL; - -- for (frame = get_current_frame (); -+ for (frame = get_current_user_frame (); - frame != NULL; - frame = get_prev_frame (frame)) - { -@@ -900,7 +970,7 @@ unwind_to_current_frame (struct ui_out * +@@ -463,8 +530,8 @@ frame_find_by_id (struct frame_id id) + return NULL; } - struct frame_info * --get_current_frame (void) -+get_current_user_frame (void) +-CORE_ADDR +-frame_pc_unwind (struct frame_info *this_frame) ++static CORE_ADDR ++frame_unwind_pc (struct frame_info *this_frame) { - /* First check, and report, the lack of registers. Having GDB - report "No stack!" or "No memory" when the target doesn't even -@@ -928,6 +998,24 @@ get_current_frame (void) - return current_frame; + if (!this_frame->prev_pc.p) + { +@@ -503,6 +570,12 @@ frame_pc_unwind (struct frame_info *this } -+/* Given FRAME, return the enclosing normal frame for inlined -+ function frames. Otherwise return the original frame. */ -+ -+static struct frame_info * -+get_real_frame (struct frame_info *frame) + CORE_ADDR ++frame_pc_unwind (struct frame_info *this_frame) +{ -+ while (get_frame_type (frame) == INLINE_FRAME) -+ frame = get_prev_frame (frame); -+ -+ return frame; ++ return frame_unwind_pc (skip_inlined_frames (this_frame)); +} + -+struct frame_info * -+get_current_frame (void) -+{ -+ return get_real_frame (get_current_user_frame ()); -+} -+ - /* The "selected" stack frame is used by default for local and arg - access. May be zero, for no selected frame. */ - -@@ -949,7 +1037,7 @@ get_selected_frame (const char *message) - /* Hey! Don't trust this. It should really be re-finding the - last selected frame of the currently selected thread. This, - though, is better than nothing. */ -- select_frame (get_current_frame ()); -+ select_frame (get_current_user_frame ()); - } - /* There is always a frame. */ - gdb_assert (selected_frame != NULL); -@@ -1134,7 +1222,6 @@ frame_register_unwind_location (struct f ++CORE_ADDR + get_frame_func (struct frame_info *this_frame) + { + struct frame_info *next_frame = this_frame->next; +@@ -1217,7 +1290,6 @@ frame_register_unwind_location (struct f static struct frame_info * get_prev_frame_1 (struct frame_info *this_frame) { @@ -1110,7 +876,7 @@ Index: gdb-6.8/gdb/frame.c struct frame_id this_id; struct gdbarch *gdbarch; -@@ -1165,6 +1252,14 @@ get_prev_frame_1 (struct frame_info *thi +@@ -1257,6 +1329,14 @@ get_prev_frame_1 (struct frame_info *thi this_frame->prev_p = 1; this_frame->stop_reason = UNWIND_NO_REASON; @@ -1125,7 +891,7 @@ Index: gdb-6.8/gdb/frame.c /* Check that this frame's ID was valid. If it wasn't, don't try to unwind to the prev frame. Be careful to not apply this test to the sentinel frame. */ -@@ -1233,7 +1328,8 @@ get_prev_frame_1 (struct frame_info *thi +@@ -1324,7 +1404,8 @@ get_prev_frame_1 (struct frame_info *thi if (this_frame->level > 0 && gdbarch_pc_regnum (gdbarch) >= 0 && get_frame_type (this_frame) == NORMAL_FRAME @@ -1135,7 +901,7 @@ Index: gdb-6.8/gdb/frame.c { int optimized, realnum, nrealnum; enum lval_type lval, nlval; -@@ -1262,6 +1358,17 @@ get_prev_frame_1 (struct frame_info *thi +@@ -1353,6 +1434,17 @@ get_prev_frame_1 (struct frame_info *thi } } @@ -1153,7 +919,7 @@ Index: gdb-6.8/gdb/frame.c /* Allocate the new frame but do not wire it in to the frame chain. Some (bad) code in INIT_FRAME_EXTRA_INFO tries to look along frame->next to pull some fancy tricks (of course such code is, by -@@ -1421,7 +1528,7 @@ get_prev_frame (struct frame_info *this_ +@@ -1511,7 +1603,7 @@ get_prev_frame (struct frame_info *this_ the main function when we created the dummy frame, the dummy frame will point inside the main function. */ if (this_frame->level >= 0 @@ -1162,7 +928,7 @@ Index: gdb-6.8/gdb/frame.c && !backtrace_past_main && inside_main_func (this_frame)) /* Don't unwind past main(). Note, this is done _before_ the -@@ -1467,8 +1574,9 @@ get_prev_frame (struct frame_info *this_ +@@ -1556,8 +1648,9 @@ get_prev_frame (struct frame_info *this_ from main returns directly to the caller of main. Since we don't stop at main, we should at least stop at the entry point of the application. */ @@ -1173,8 +939,8 @@ Index: gdb-6.8/gdb/frame.c + && !backtrace_past_entry && inside_entry_func (this_frame)) { - frame_debug_got_null_frame (gdb_stdlog, this_frame, "inside entry func"); -@@ -1479,7 +1587,8 @@ get_prev_frame (struct frame_info *this_ + frame_debug_got_null_frame (this_frame, "inside entry func"); +@@ -1568,7 +1661,8 @@ get_prev_frame (struct frame_info *this_ like a SIGSEGV or a dummy frame, and hence that NORMAL frames will never unwind a zero PC. */ if (this_frame->level > 0 @@ -1184,43 +950,37 @@ Index: gdb-6.8/gdb/frame.c && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME && get_frame_pc (this_frame) == 0) { -@@ -1518,21 +1627,31 @@ frame_unwind_address_in_block (struct fr - CORE_ADDR pc = frame_pc_unwind (next_frame); +@@ -1593,7 +1687,7 @@ CORE_ADDR + get_frame_pc (struct frame_info *frame) + { + gdb_assert (frame->next != NULL); +- return frame_pc_unwind (frame->next); ++ return frame_unwind_pc (frame->next); + } - /* If NEXT_FRAME was called by a signal frame or dummy frame, then -- we shold not adjust the unwound PC. These frames may not call -+ we should not adjust the unwound PC. These frames may not call - their next frame in the normal way; the operating system or GDB - may have pushed their resume address manually onto the stack, so - it may be the very first instruction. Even if the resume address - was not manually pushed, they expect to be returned to. */ -- if (this_type != NORMAL_FRAME) -+ if (this_type != NORMAL_FRAME && this_type != INLINE_FRAME) - return pc; - -+ /* If NEXT_FRAME was inlined into the current frame, we are really -+ interested in an even younger (newer) frame - the point where -+ execution left THIS function. */ + /* Return an address that falls within THIS_FRAME's code block. */ +@@ -1638,17 +1732,58 @@ get_frame_address_in_block (struct frame + We check the type of NEXT_FRAME first, since it is already + known; frame type is determined by the unwinder, and since + we have THIS_FRAME we've already selected an unwinder for +- NEXT_FRAME. */ ++ NEXT_FRAME. ++ ++ If the next frame is inlined, we need to keep going until we find ++ the real function - for instance, if a signal handler is invoked ++ while in an inlined function, then the code address of the ++ "calling" normal function should not be adjusted either. */ ++ + while (get_frame_type (next_frame) == INLINE_FRAME) + next_frame = next_frame->next; + - /* If THIS frame is not inner most (i.e., NEXT isn't the sentinel), - and NEXT is `normal' (i.e., not a sigtramp, dummy, ....) THIS - frame's PC ends up pointing at the instruction fallowing the - "call". Adjust that PC value so that it falls on the call - instruction (which, hopefully, falls within THIS frame's code - block). So far it's proved to be a very good approximation. See -- get_frame_type() for why ->type can't be used. */ -+ get_frame_type() for why ->type can't be used. -+ -+ This is correct even if NEXT_FRAME describes an inlined function. -+ Inlined functions always live between two normal frames, and are -+ themselves normal. */ - if (next_frame->level >= 0 - && get_frame_type (next_frame) == NORMAL_FRAME) - --pc; -@@ -1546,9 +1665,41 @@ get_frame_address_in_block (struct frame - get_frame_type (this_frame)); + if (get_frame_type (next_frame) == NORMAL_FRAME +- && get_frame_type (this_frame) == NORMAL_FRAME) ++ && (get_frame_type (this_frame) == NORMAL_FRAME ++ || get_frame_type (this_frame) == INLINE_FRAME)) + return pc - 1; + + return pc; } -static int @@ -1235,18 +995,17 @@ Index: gdb-6.8/gdb/frame.c + sal is the "call site" of that inlined function, which can not + be inferred from get_frame_pc. */ + next_frame = get_next_frame (frame); -+ if ((next_frame != NULL && get_frame_type (next_frame) == INLINE_FRAME) -+ || (next_frame == NULL && inline_skipped_frames () > 0)) ++ if (frame_inlined_callees (frame) > 0) + { + struct symbol *sym; + + if (next_frame) + sym = get_frame_function (next_frame); + else -+ sym = inline_skipped_symbol (); ++ sym = inline_skipped_symbol (inferior_ptid); + + init_sal (sal); -+ if (sym && SYMBOL_LINE (sym) != 0) ++ if (SYMBOL_LINE (sym) != 0) + { + sal->symtab = SYMBOL_SYMTAB (sym); + sal->line = SYMBOL_LINE (sym); @@ -1263,7 +1022,7 @@ Index: gdb-6.8/gdb/frame.c /* If FRAME is not the innermost frame, that normally means that FRAME->pc points at the return instruction (which is *after* the call instruction), and we want to get the line containing the -@@ -1558,15 +1709,8 @@ pc_notcurrent (struct frame_info *frame) +@@ -1658,15 +1793,8 @@ pc_notcurrent (struct frame_info *frame) PC and such a PC indicates the current (rather than next) instruction/line, consequently, for such cases, want to get the line containing fi->pc. */ @@ -1281,7 +1040,7 @@ Index: gdb-6.8/gdb/frame.c } /* Per "frame.h", return the ``address'' of the frame. Code should -@@ -1652,7 +1796,7 @@ get_frame_type (struct frame_info *frame +@@ -1747,7 +1875,7 @@ get_frame_type (struct frame_info *frame return frame->unwind->type; } @@ -1290,11 +1049,32 @@ Index: gdb-6.8/gdb/frame.c deprecated_update_frame_pc_hack (struct frame_info *frame, CORE_ADDR pc) { if (frame_debug) -Index: gdb-6.8/gdb/frame.h +Index: gdb-6.8.50.20081209/gdb/frame.h =================================================================== ---- gdb-6.8.orig/gdb/frame.h 2008-01-01 23:53:09.000000000 +0100 -+++ gdb-6.8/gdb/frame.h 2008-07-14 10:29:07.000000000 +0200 -@@ -122,6 +122,17 @@ struct frame_id +--- gdb-6.8.50.20081209.orig/gdb/frame.h 2008-08-26 19:40:24.000000000 +0200 ++++ gdb-6.8.50.20081209/gdb/frame.h 2008-12-10 01:28:37.000000000 +0100 +@@ -34,6 +34,9 @@ + frame_unwind_WHAT...(): Unwind THIS frame's WHAT from the NEXT + frame. + ++ get_stack_frame_WHAT...(): Get WHAT for THIS frame, but if THIS is ++ inlined, skip to the containing stack frame. ++ + put_frame_WHAT...(): Put a value into this frame (unsafe, need to + invalidate the frame / regcache afterwards) (better name more + strongly hinting at its unsafeness) +@@ -101,6 +104,10 @@ struct frame_id + Typically, it is set to the address of the entry point of the + frame's function (as returned by get_frame_func). + ++ For inlined functions (INLINE_DEPTH != 0), this is the address of ++ the first executed instruction in the block corresponding to the ++ inlined function. ++ + This field is valid only if code_addr_p is true. Otherwise, this + frame is considered to have a wildcard code address, i.e. one that + matches every address value in frame comparisons. */ +@@ -122,6 +129,10 @@ struct frame_id unsigned int stack_addr_p : 1; unsigned int code_addr_p : 1; unsigned int special_addr_p : 1; @@ -1302,54 +1082,39 @@ Index: gdb-6.8/gdb/frame.h + /* The inline depth of this frame. A frame representing a "called" + inlined function will have this set to a nonzero value. */ + int inline_depth; -+ -+ /* A second code address, considered only if inline_depth != 0. The -+ block address lets GDB distinguish multiple functions inlined -+ into the same caller. This should be the first executed -+ instruction in the block corresponding to the inlined -+ function. */ -+ CORE_ADDR block_addr; }; - /* Methods for constructing and comparing Frame IDs. -@@ -168,6 +179,11 @@ extern struct frame_id frame_id_build_wi + /* Methods for constructing and comparing Frame IDs. */ +@@ -157,6 +168,10 @@ extern struct frame_id frame_id_build_wi non-zero .base). */ extern int frame_id_p (struct frame_id l); -+/* Returns non-zero when L and R identify frames associated with -+ the same underlying stack frame, although they may refer to -+ different inlined functions within the stack frame. */ -+extern int frame_id_stack_eq (struct frame_id l, struct frame_id r); ++/* Returns non-zero when L is a valid frame representing an inlined ++ function. */ ++extern int frame_id_inlined_p (struct frame_id l); + /* Returns non-zero when L and R identify the same frame, or, if either L or R have a zero .func, then the same frame base. */ extern int frame_id_eq (struct frame_id l, struct frame_id r); -@@ -194,6 +210,12 @@ enum frame_type +@@ -177,6 +192,9 @@ enum frame_type /* A fake frame, created by GDB when performing an inferior function call. */ DUMMY_FRAME, -+ /* A frame representing an inlined function, associated with an upcoming -+ (next, inner, younger) NORMAL_FRAME. Its unwinder execution is delayed -+ behind the other unwinders (see FRAME_UNWIND_FIND_BY_FRAME). This -+ unwinder expects the regular unwinder and its existing cache to be passed -+ as the parameters. */ ++ /* A frame representing an inlined function, associated with an ++ upcoming (next, inner, younger) NORMAL_FRAME. */ + INLINE_FRAME, /* In a signal handler, various OSs handle this in various ways. The main thing is that the frame may be far from normal. */ SIGTRAMP_FRAME, -@@ -218,7 +240,10 @@ enum frame_type +@@ -340,6 +358,7 @@ extern CORE_ADDR get_frame_base (struct - /* On demand, create the inner most frame using information found in - the inferior. If the inner most frame can't be created, throw an -- error. */ -+ error. get_current_user_frame returns the frame we should display -+ to the user, which may be an inlined function; get_current_frame -+ returns the innermost non-inlined frame. */ -+extern struct frame_info *get_current_user_frame (void); - extern struct frame_info *get_current_frame (void); + instead, since that avoids the bug. */ + extern struct frame_id get_frame_id (struct frame_info *fi); ++extern struct frame_id get_stack_frame_id (struct frame_info *fi); + extern struct frame_id frame_unwind_id (struct frame_info *next_frame); - /* Invalidates the frame cache (this function should have been called -@@ -703,14 +728,6 @@ extern struct frame_info *deprecated_saf + /* Assuming that a frame is `normal', return its base-address, or 0 if +@@ -660,14 +679,6 @@ extern struct frame_info *deprecated_saf extern struct frame_info *create_new_frame (CORE_ADDR base, CORE_ADDR pc); @@ -1364,21 +1129,29 @@ Index: gdb-6.8/gdb/frame.h /* FIXME: cagney/2002-12-18: Has the frame's base changed? Or to be more exact, was that initial guess at the frame's base as returned by the deleted read_fp() wrong? If it was, fix it. This shouldn't -@@ -721,4 +738,9 @@ extern void deprecated_update_frame_pc_h - extern void deprecated_update_frame_base_hack (struct frame_info *frame, - CORE_ADDR base); - -+extern void set_skipped_inline_frames (int skip_ok); -+extern void step_into_inline_frame (void); -+extern int inline_skipped_frames (void); -+extern struct symbol *inline_skipped_symbol (void); -+ - #endif /* !defined (FRAME_H) */ -Index: gdb-6.8/gdb/infcall.c +Index: gdb-6.8.50.20081209/gdb/gdbthread.h =================================================================== ---- gdb-6.8.orig/gdb/infcall.c 2008-01-08 20:28:08.000000000 +0100 -+++ gdb-6.8/gdb/infcall.c 2008-07-14 10:29:07.000000000 +0200 -@@ -757,11 +757,8 @@ call_function_by_hand (struct value *fun +--- gdb-6.8.50.20081209.orig/gdb/gdbthread.h 2008-11-17 13:13:49.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/gdbthread.h 2008-12-10 01:28:37.000000000 +0100 +@@ -83,6 +83,13 @@ struct thread_info + This is how we know when we step into a subroutine call, and how + to set the frame for the breakpoint used to step out. */ + struct frame_id step_frame_id; ++ ++ /* Similarly, the frame ID of the underlying stack frame (skipping any ++ inlined frames). */ ++ struct frame_id step_stack_frame_id; ++ ++ /* The source file and line at the beginning of the current step ++ operation. Only valid when step_frame_id is set. */ + int current_line; + struct symtab *current_symtab; + +Index: gdb-6.8.50.20081209/gdb/infcall.c +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/infcall.c 2008-12-04 22:41:00.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/infcall.c 2008-12-10 01:28:37.000000000 +0100 +@@ -734,11 +734,8 @@ The program being debugged exited while if (unwind_on_signal_p) { @@ -1392,63 +1165,68 @@ Index: gdb-6.8/gdb/infcall.c /* FIXME: Insert a bunch of wrap_here; name can be very long if it's a C++ name with arguments and stuff. */ -Index: gdb-6.8/gdb/infcmd.c +Index: gdb-6.8.50.20081209/gdb/infcmd.c =================================================================== ---- gdb-6.8.orig/gdb/infcmd.c 2008-01-31 14:37:21.000000000 +0100 -+++ gdb-6.8/gdb/infcmd.c 2008-07-14 10:29:07.000000000 +0200 -@@ -48,6 +48,7 @@ - #include "observer.h" - #include "target-descriptions.h" - #include "user-regs.h" -+#include "gdbthread.h" +--- gdb-6.8.50.20081209.orig/gdb/infcmd.c 2008-12-05 23:38:10.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/infcmd.c 2008-12-10 01:34:41.000000000 +0100 +@@ -52,6 +52,7 @@ + #include "cli/cli-decode.h" + #include "gdbthread.h" + #include "valprint.h" ++#include "inline-frame.h" /* Functions exported for general use, in inferior.h: */ -@@ -653,6 +654,17 @@ continue_command (char *proc_count_exp, - proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 0); +@@ -722,6 +723,17 @@ Can't resume all threads and specify pro + continue_1 (all_threads); } +/* Record the starting point of a "step" or "next" command. */ + +static void -+set_step_frame (void) ++set_step_frame (struct thread_info *tp) +{ + struct symtab_and_line sal; + -+ find_frame_sal (get_current_user_frame (), &sal); -+ set_step_info (get_frame_id (get_current_user_frame ()), sal); ++ find_frame_sal (get_current_frame (), &sal); ++ set_step_info (tp, get_current_frame (), sal); +} + /* Step until outside of current statement. */ static void -@@ -726,51 +738,14 @@ step_1 (int skip_subroutines, int single - make_exec_cleanup (disable_longjmp_breakpoint_cleanup, 0 /*ignore*/); +@@ -799,73 +811,39 @@ step_1 (int skip_subroutines, int single + make_cleanup (delete_longjmp_breakpoint_cleanup, &thread); } - /* In synchronous case, all is well, just use the regular for loop. */ -+ /* In synchronous case, all is well, just use the regular for loop. */ ++ /* In synchronous case, all is well; each step_once call will step once. */ if (!target_can_async_p ()) { for (; count > 0; count--) { + struct thread_info *tp = inferior_thread (); - clear_proceed_status (); - - frame = get_current_frame (); -- if (!frame) /* Avoid coredump here. Why tho? */ -- error (_("No current frame")); -- step_frame_id = get_frame_id (frame); -- +- tp->step_frame_id = get_frame_id (frame); + - if (!single_inst) - { -- find_pc_line_pc_range (stop_pc, &step_range_start, &step_range_end); -- if (step_range_end == 0) +- CORE_ADDR pc; +- +- pc = get_frame_pc (frame); +- find_pc_line_pc_range (pc, +- &tp->step_range_start, &tp->step_range_end); +- if (tp->step_range_end == 0) - { - char *name; -- if (find_pc_partial_function (stop_pc, &name, &step_range_start, -- &step_range_end) == 0) +- if (find_pc_partial_function (pc, &name, +- &tp->step_range_start, +- &tp->step_range_end) == 0) - error (_("Cannot find bounds of current function")); -- ++ step_once (skip_subroutines, single_inst, count, thread); + - target_terminal_ours (); - printf_filtered (_("\ -Single stepping until exit from function %s, \n\ @@ -1456,30 +1234,35 @@ Index: gdb-6.8/gdb/infcmd.c - } - } - else -- { ++ if (!tp->step_multi || (!target_has_execution ++ || !inferior_thread ()->stop_step)) + { - /* Say we are stepping, but stop after one insn whatever it does. */ -- step_range_start = step_range_end = 1; +- tp->step_range_start = tp->step_range_end = 1; - if (!skip_subroutines) - /* It is stepi. - Don't step over function calls, not even to functions lacking - line numbers. */ -- step_over_calls = STEP_OVER_NONE; -- } +- tp->step_over_calls = STEP_OVER_NONE; ++ /* If we stopped for some reason that is not stepping ++ there are no further steps to make. */ ++ tp->step_multi = 0; ++ break; + } - - if (skip_subroutines) -- step_over_calls = STEP_OVER_ALL; +- tp->step_over_calls = STEP_OVER_ALL; - -- step_multi = (count > 1); +- tp->step_multi = (count > 1); - proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1); -+ step_once (skip_subroutines, single_inst, count); - -+ /* Unexpected breakpoint terminates our multistepping. */ - if (!stop_step) - break; +- +- if (!target_has_execution +- || !inferior_thread ()->stop_step) +- break; } -@@ -779,12 +754,12 @@ which has no line number information.\n" - do_cleanups (cleanups); - return; + + do_cleanups (cleanups); +- return; } - /* In case of asynchronous target things get complicated, do only - one step for now, before returning control to the event loop. Let @@ -1487,51 +1270,78 @@ Index: gdb-6.8/gdb/infcmd.c - and handle them one at the time, through step_once(). */ else { -+ /* In case of asynchronous target things get complicated, do only -+ one step for now, before returning control to the event loop. Let -+ the continuation figure out how many other steps we need to do, -+ and handle them one at the time, through step_once(). */ - if (target_can_async_p ()) - step_once (skip_subroutines, single_inst, count); ++ /* In the case of an asynchronous target things get complicated; ++ do only one step for now, before returning control to the ++ event loop. Let the continuation figure out how many other ++ steps we need to do, and handle them one at the time, through ++ step_once. */ + step_once (skip_subroutines, single_inst, count, thread); ++ + /* We are running, and the continuation is installed. It will + disable the longjmp breakpoint as appropriate. */ +- discard_cleanups (cleanups); ++ discard_cleanups (cleanups); } -@@ -831,22 +806,25 @@ step_once (int skip_subroutines, int sin + } + +@@ -919,7 +897,6 @@ static void + step_once (int skip_subroutines, int single_inst, int count, int thread) + { + struct frame_info *frame; +- struct step_1_continuation_args *args; + if (count > 0) { +@@ -929,6 +906,20 @@ step_once (int skip_subroutines, int sin + THREAD is set. */ + struct thread_info *tp = inferior_thread (); clear_proceed_status (); -- -- frame = get_current_frame (); -- if (!frame) /* Avoid coredump here. Why tho? */ -- error (_("No current frame")); -- step_frame_id = get_frame_id (frame); -+ set_step_frame (); - - if (!single_inst) - { -- find_pc_line_pc_range (stop_pc, &step_range_start, &step_range_end); -- -- /* If we have no line info, switch to stepi mode. */ -- if (step_range_end == 0 && step_stop_if_no_debug) -+ /* Step at an inlined function behaves like "down". */ -+ if (!skip_subroutines && !single_inst && inline_skipped_frames ()) - { -- step_range_start = step_range_end = 1; -+ step_into_inline_frame (); -+ if (count > 1) -+ step_once (skip_subroutines, single_inst, count - 1); -+ else -+ /* Pretend that we've stopped. */ -+ normal_stop (); -+ return; - } -- else if (step_range_end == 0) -+ -+ find_pc_line_pc_range (stop_pc, &step_range_start, &step_range_end); ++ set_step_frame (tp); + -+ if (step_range_end == 0) - { - char *name; - if (find_pc_partial_function (stop_pc, &name, &step_range_start, -@@ -1052,14 +1030,12 @@ signal_command (char *signum_exp, int fr ++ /* Step at an inlined function behaves like "down". */ ++ if (!skip_subroutines && !single_inst ++ && inline_skipped_frames (inferior_ptid)) ++ { ++ step_into_inline_frame (inferior_ptid); ++ if (count > 1) ++ step_once (skip_subroutines, single_inst, count - 1, thread); ++ else ++ /* Pretend that we've stopped. */ ++ normal_stop (); ++ return; ++ } + + frame = get_current_frame (); + tp->step_frame_id = get_frame_id (frame); +@@ -977,12 +968,21 @@ which has no line number information.\n" + tp->step_multi = (count > 1); + proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1); + +- args = xmalloc (sizeof (*args)); +- args->skip_subroutines = skip_subroutines; +- args->single_inst = single_inst; +- args->count = count; +- args->thread = thread; +- add_intermediate_continuation (tp, step_1_continuation, args, xfree); ++ /* For async targets, register a continuation to do any ++ additional steps. For sync targets, the caller will handle ++ further stepping. */ ++ if (target_can_async_p ()) ++ { ++ struct step_1_continuation_args *args; ++ ++ args = xmalloc (sizeof (*args)); ++ args->skip_subroutines = skip_subroutines; ++ args->single_inst = single_inst; ++ args->count = count; ++ args->thread = thread; ++ ++ add_intermediate_continuation (tp, step_1_continuation, args, xfree); ++ } + } + } + +@@ -1167,15 +1167,13 @@ signal_command (char *signum_exp, int fr static void until_next_command (int from_tty) { @@ -1539,23 +1349,24 @@ Index: gdb-6.8/gdb/infcmd.c CORE_ADDR pc; struct symbol *func; struct symtab_and_line sal; + struct thread_info *tp = inferior_thread (); clear_proceed_status (); - - frame = get_current_frame (); -+ set_step_frame (); ++ set_step_frame (tp); /* Step until either exited from this function or greater than the current line (if in symbolic section) or pc (if -@@ -1087,7 +1063,6 @@ until_next_command (int from_tty) +@@ -1203,7 +1201,6 @@ until_next_command (int from_tty) } - step_over_calls = STEP_OVER_ALL; -- step_frame_id = get_frame_id (frame); + tp->step_over_calls = STEP_OVER_ALL; +- tp->step_frame_id = get_frame_id (frame); - step_multi = 0; /* Only one call to proceed */ + tp->step_multi = 0; /* Only one call to proceed */ -@@ -1295,6 +1270,35 @@ finish_command (char *arg, int from_tty) +@@ -1534,6 +1531,37 @@ finish_command (char *arg, int from_tty) clear_proceed_status (); @@ -1565,6 +1376,8 @@ Index: gdb-6.8/gdb/infcmd.c + if (get_frame_type (get_selected_frame (_("No selected frame."))) + == INLINE_FRAME) + { ++ struct thread_info *tp = inferior_thread (); ++ + /* Claim we are stepping in the calling frame. An empty step + range means that we will stop once we aren't in a function + called by that frame. We don't use the magic "1" value for @@ -1572,9 +1385,9 @@ Index: gdb-6.8/gdb/infcmd.c + and not step over the rest of this inlined function call. */ + struct symtab_and_line empty_sal; + init_sal (&empty_sal); -+ set_step_info (get_frame_id (frame), empty_sal); -+ step_range_start = step_range_end = get_frame_pc (frame); -+ step_over_calls = STEP_OVER_ALL; ++ set_step_info (tp, frame, empty_sal); ++ tp->step_range_start = tp->step_range_end = get_frame_pc (frame); ++ tp->step_over_calls = STEP_OVER_ALL; + + /* Print info on the selected frame, including level number but not + source. */ @@ -1588,39 +1401,72 @@ Index: gdb-6.8/gdb/infcmd.c + return; + } + - sal = find_pc_line (get_frame_pc (frame), 0); - sal.pc = get_frame_pc (frame); + /* Find the function we will return from. */ -Index: gdb-6.8/gdb/inferior.h + function = find_pc_function (get_frame_pc (get_selected_frame (NULL))); +Index: gdb-6.8.50.20081209/gdb/inferior.h =================================================================== ---- gdb-6.8.orig/gdb/inferior.h 2008-07-14 10:25:43.000000000 +0200 -+++ gdb-6.8/gdb/inferior.h 2008-07-14 10:29:07.000000000 +0200 -@@ -254,6 +254,8 @@ extern void get_last_target_status(ptid_ +--- gdb-6.8.50.20081209.orig/gdb/inferior.h 2008-12-10 01:22:23.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/inferior.h 2008-12-10 01:28:37.000000000 +0100 +@@ -249,6 +249,9 @@ extern void error_is_running (void); + /* Calls error_is_running if the current thread is running. */ + extern void ensure_not_running (void); - extern void follow_inferior_reset_breakpoints (void); - -+void set_step_info (struct frame_id id, struct symtab_and_line sal); ++void set_step_info (struct thread_info *tp, struct frame_info *frame, ++ struct symtab_and_line sal); + /* From infcmd.c */ extern void tty_command (char *, int); -Index: gdb-6.8/gdb/infrun.c +Index: gdb-6.8.50.20081209/gdb/infrun.c =================================================================== ---- gdb-6.8.orig/gdb/infrun.c 2008-07-14 10:28:15.000000000 +0200 -+++ gdb-6.8/gdb/infrun.c 2008-07-14 10:29:07.000000000 +0200 -@@ -276,6 +276,11 @@ static int stop_print_frame; +--- gdb-6.8.50.20081209.orig/gdb/infrun.c 2008-12-10 01:27:34.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/infrun.c 2008-12-10 01:28:37.000000000 +0100 +@@ -45,6 +45,7 @@ + #include "language.h" + #include "solib.h" + #include "main.h" ++#include "inline-frame.h" - static struct breakpoint *step_resume_breakpoint = NULL; + #include "gdb_assert.h" + #include "mi/mi-common.h" +@@ -206,7 +207,7 @@ static unsigned char *signal_program; -+/* The source file and line at the beginning of the current step -+ operation. Only valid when step_frame_id is set. */ -+static struct symtab *step_current_symtab; -+static int step_current_line; + /* Value to pass to target_resume() to cause all threads to resume */ + +-#define RESUME_ALL (pid_to_ptid (-1)) ++#define RESUME_ALL minus_one_ptid + + /* Command list pointer for the "stop" placeholder. */ + +@@ -1147,6 +1148,8 @@ a command like `return' or `jump' to con + step = 0; + } + ++ clear_inline_frame_state (resume_ptid); + - /* This is a cached copy of the pid/waitstatus of the last event - returned by target_wait()/deprecated_target_wait_hook(). This - information is returned by get_last_target_status(). */ -@@ -972,7 +977,7 @@ struct execution_control_state + if (debug_displaced + && use_displaced_stepping (gdbarch) + && tp->trap_expected) +@@ -1188,6 +1191,7 @@ clear_proceed_status_thread (struct thre + tp->step_range_start = 0; + tp->step_range_end = 0; + tp->step_frame_id = null_frame_id; ++ tp->step_stack_frame_id = null_frame_id; + tp->step_over_calls = STEP_OVER_UNDEBUGGABLE; + tp->stop_requested = 0; + +@@ -1532,6 +1536,9 @@ init_wait_for_inferior (void) + init_infwait_state (); + + displaced_step_clear (); ++ ++ /* Discard any skipped inlined frames. */ ++ clear_inline_frame_state (minus_one_ptid); + } + + +@@ -1587,7 +1594,7 @@ struct execution_control_state int wait_some_more; }; @@ -1629,17 +1475,19 @@ Index: gdb-6.8/gdb/infrun.c void handle_inferior_event (struct execution_control_state *ecs); -@@ -1121,10 +1126,19 @@ fetch_inferior_event (void *client_data) - } +@@ -1903,10 +1910,21 @@ fetch_inferior_event (void *client_data) + display_gdb_prompt (0); } +/* Record the frame and location we're currently stepping through. */ +void -+set_step_info (struct frame_id id, struct symtab_and_line sal) ++set_step_info (struct thread_info *tp, struct frame_info *frame, ++ struct symtab_and_line sal) +{ -+ step_frame_id = id; -+ step_current_symtab = sal.symtab; -+ step_current_line = sal.line; ++ tp->step_frame_id = get_frame_id (frame); ++ tp->step_stack_frame_id = get_stack_frame_id (frame); ++ tp->current_symtab = sal.symtab; ++ tp->current_line = sal.line; +} + /* Prepare an execution control state for looping through a @@ -1649,36 +1497,26 @@ Index: gdb-6.8/gdb/infrun.c +static void init_execution_control_state (struct execution_control_state *ecs) { - ecs->stepping_over_breakpoint = 0; -@@ -1134,8 +1148,6 @@ init_execution_control_state (struct exe - ecs->stepping_through_solib_after_catch = 0; - ecs->stepping_through_solib_catchpoints = NULL; - ecs->sal = find_pc_line (prev_pc, 0); -- ecs->current_line = ecs->sal.line; -- ecs->current_symtab = ecs->sal.symtab; - ecs->infwait_state = infwait_normal_state; - ecs->waiton_ptid = pid_to_ptid (-1); - ecs->wp = &(ecs->ws); -@@ -1188,7 +1200,7 @@ context_switch (struct execution_control - ecs->handling_longjmp, ecs->stepping_over_breakpoint, - ecs->stepping_through_solib_after_catch, - ecs->stepping_through_solib_catchpoints, -- ecs->current_line, ecs->current_symtab); -+ step_current_line, step_current_symtab); + ecs->random_signal = 0; +@@ -1917,16 +1935,10 @@ init_execution_control_state (struct exe + void + init_thread_stepping_state (struct thread_info *tss) + { +- struct symtab_and_line sal; +- + tss->stepping_over_breakpoint = 0; + tss->step_after_step_resume_breakpoint = 0; + tss->stepping_through_solib_after_catch = 0; + tss->stepping_through_solib_catchpoints = NULL; +- +- sal = find_pc_line (tss->prev_pc, 0); +- tss->current_line = sal.line; +- tss->current_symtab = sal.symtab; + } - /* Load infrun state for the new thread. */ - load_infrun_state (ecs->ptid, &prev_pc, -@@ -1198,7 +1210,7 @@ context_switch (struct execution_control - &ecs->handling_longjmp, &ecs->stepping_over_breakpoint, - &ecs->stepping_through_solib_after_catch, - &ecs->stepping_through_solib_catchpoints, -- &ecs->current_line, &ecs->current_symtab); -+ &step_current_line, &step_current_symtab); - } - - switch_to_thread (ecs->ptid); -@@ -1276,6 +1288,22 @@ adjust_pc_after_break (struct execution_ - } + /* Return the cached copy of the last pid/waitstatus returned by +@@ -2096,6 +2108,22 @@ ensure_not_running (void) + error_is_running (); } +static int @@ -1700,84 +1538,45 @@ Index: gdb-6.8/gdb/infrun.c /* Given an execution control state that has been freshly filled in by an event from the inferior, figure out what it means and take appropriate action. */ -@@ -1336,6 +1364,7 @@ handle_inferior_event (struct execution_ - ecs->infwait_state = infwait_normal_state; - - reinit_frame_cache (); -+ set_skipped_inline_frames (0); - - /* If it's a new process, add it to the thread database */ - -@@ -1893,6 +1922,12 @@ handle_inferior_event (struct execution_ +@@ -2781,6 +2809,12 @@ targets should add new threads to the th ecs->random_signal = 0; stopped_by_random_signal = 0; + /* Hide inlined functions starting here, unless we just performed stepi or + nexti. After stepi and nexti, always show the innermost frame (not any + inline function call sites). */ -+ if (step_range_end != 1) -+ set_skipped_inline_frames (1); ++ if (ecs->event_thread->step_range_end != 1) ++ skip_inline_frames (ecs->ptid); + - if (stop_signal == TARGET_SIGNAL_TRAP - && stepping_over_breakpoint + if (ecs->event_thread->stop_signal == TARGET_SIGNAL_TRAP + && ecs->event_thread->trap_expected && gdbarch_single_step_through_delay_p (current_gdbarch) -@@ -2092,8 +2127,8 @@ process_event_stop_test: - if (step_range_end != 0 - && stop_signal != TARGET_SIGNAL_0 - && stop_pc >= step_range_start && stop_pc < step_range_end +@@ -3013,8 +3047,8 @@ process_event_stop_test: + && ecs->event_thread->stop_signal != TARGET_SIGNAL_0 + && (ecs->event_thread->step_range_start <= stop_pc + && stop_pc < ecs->event_thread->step_range_end) - && frame_id_eq (get_frame_id (get_current_frame ()), -- step_frame_id) -+ && frame_id_stack_eq (get_frame_id (get_current_frame ()), -+ step_frame_id) - && step_resume_breakpoint == NULL) +- ecs->event_thread->step_frame_id) ++ && frame_id_eq (get_stack_frame_id (get_current_frame ()), ++ ecs->event_thread->step_stack_frame_id) + && ecs->event_thread->step_resume_breakpoint == NULL) { /* The inferior is about to take a signal that will take it -@@ -2418,12 +2453,7 @@ process_event_stop_test: - until we exit the run time loader code and reach the callee's - address. */ - if (step_over_calls == STEP_OVER_UNDEBUGGABLE --#ifdef IN_SOLIB_DYNSYM_RESOLVE_CODE -- && IN_SOLIB_DYNSYM_RESOLVE_CODE (stop_pc) --#else -- && in_solib_dynsym_resolve_code (stop_pc) --#endif -- ) -+ && in_solib_dynsym_resolve_code (stop_pc)) - { - CORE_ADDR pc_after_resolver = - gdbarch_skip_solib_resolver (current_gdbarch, stop_pc); -@@ -2467,11 +2497,12 @@ process_event_stop_test: - previous frame's ID is sufficient - but it is a common case and - cheaper than checking the previous frame's ID. - -- NOTE: frame_id_eq will never report two invalid frame IDs as -+ NOTE: frame_id_stack_eq will never report two invalid frame IDs as +@@ -3400,10 +3434,10 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( + NOTE: frame_id_eq will never report two invalid frame IDs as being equal, so to get into this block, both the current and previous frame must have valid frame IDs. */ -- if (!frame_id_eq (get_frame_id (get_current_frame ()), step_frame_id) -- && frame_id_eq (frame_unwind_id (get_current_frame ()), step_frame_id)) -+ if (!frame_id_stack_eq (get_frame_id (get_current_frame ()), step_frame_id) -+ && frame_id_stack_eq (frame_unwind_id (get_current_frame ()), -+ step_frame_id)) +- if (!frame_id_eq (get_frame_id (get_current_frame ()), +- ecs->event_thread->step_frame_id) ++ if (!frame_id_eq (get_stack_frame_id (get_current_frame ()), ++ ecs->event_thread->step_stack_frame_id) + && (frame_id_eq (frame_unwind_id (get_current_frame ()), +- ecs->event_thread->step_frame_id) ++ ecs->event_thread->step_stack_frame_id) + || execution_direction == EXEC_REVERSE)) { CORE_ADDR real_stop_pc; - -@@ -2516,13 +2547,7 @@ process_event_stop_test: - if (real_stop_pc != 0) - ecs->stop_func_start = real_stop_pc; - -- if ( --#ifdef IN_SOLIB_DYNSYM_RESOLVE_CODE -- IN_SOLIB_DYNSYM_RESOLVE_CODE (ecs->stop_func_start) --#else -- in_solib_dynsym_resolve_code (ecs->stop_func_start) --#endif --) -+ if (real_stop_pc != 0 && in_solib_dynsym_resolve_code (real_stop_pc)) - { - struct symtab_and_line sr_sal; - init_sal (&sr_sal); -@@ -2670,9 +2695,82 @@ process_event_stop_test: +@@ -3646,6 +3680,82 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( return; } @@ -1785,8 +1584,9 @@ Index: gdb-6.8/gdb/infrun.c + frame machinery detected some skipped call sites, we have entered + a new inline function. */ + -+ if (frame_id_eq (get_frame_id (get_current_user_frame ()), step_frame_id) -+ && inline_skipped_frames ()) ++ if (frame_id_eq (get_frame_id (get_current_frame ()), ++ ecs->event_thread->step_frame_id) ++ && inline_skipped_frames (ecs->ptid)) + { + struct symtab_and_line call_sal; + @@ -1794,20 +1594,20 @@ Index: gdb-6.8/gdb/infrun.c + fprintf_unfiltered (gdb_stdlog, + "infrun: stepped into inlined function\n"); + -+ find_frame_sal (get_current_user_frame (), &call_sal); ++ find_frame_sal (get_current_frame (), &call_sal); + -+ if (step_over_calls != STEP_OVER_ALL) ++ if (ecs->event_thread->step_over_calls != STEP_OVER_ALL) + { + /* For "step", we're going to stop. But if the call site + for this inlined function is on the same source line as + we were previously stepping, go down into the function + first. Otherwise stop at the call site. */ + -+ if (call_sal.line == step_current_line -+ && call_sal.symtab == step_current_symtab) -+ step_into_inline_frame (); ++ if (call_sal.line == ecs->event_thread->current_line ++ && call_sal.symtab == ecs->event_thread->current_symtab) ++ step_into_inline_frame (ecs->ptid); + -+ stop_step = 1; ++ ecs->event_thread->stop_step = 1; + print_stop_reason (END_STEPPING_RANGE, 0); + stop_stepping (ecs); + return; @@ -1817,12 +1617,12 @@ Index: gdb-6.8/gdb/infrun.c + /* For "next", we should stop at the call site if it is on a + different source line. Otherwise continue through the + inlined function. */ -+ if (call_sal.line == step_current_line -+ && call_sal.symtab == step_current_symtab) ++ if (call_sal.line == ecs->event_thread->current_line ++ && call_sal.symtab == ecs->event_thread->current_symtab) + keep_going (ecs); + else + { -+ stop_step = 1; ++ ecs->event_thread->stop_step = 1; + print_stop_reason (END_STEPPING_RANGE, 0); + stop_stepping (ecs); + } @@ -1835,64 +1635,42 @@ Index: gdb-6.8/gdb/infrun.c + to go further up to find the exact frame ID, we are stepping + through a more inlined call beyond its call site. */ + -+ if (get_frame_type (get_current_user_frame ()) == INLINE_FRAME -+ && !frame_id_eq (get_frame_id (get_current_user_frame ()), step_frame_id) -+ && stepped_in_from (get_current_user_frame (), step_frame_id)) ++ if (get_frame_type (get_current_frame ()) == INLINE_FRAME ++ && !frame_id_eq (get_frame_id (get_current_frame ()), ++ ecs->event_thread->step_frame_id) ++ && stepped_in_from (get_current_frame (), ++ ecs->event_thread->step_frame_id)) + { + if (debug_infrun) + fprintf_unfiltered (gdb_stdlog, + "infrun: stepping through inlined function\n"); + -+ if (step_over_calls == STEP_OVER_ALL) ++ if (ecs->event_thread->step_over_calls == STEP_OVER_ALL) + keep_going (ecs); + else + { -+ stop_step = 1; ++ ecs->event_thread->stop_step = 1; + print_stop_reason (END_STEPPING_RANGE, 0); + stop_stepping (ecs); + } + return; + } + - if ((stop_pc == ecs->sal.pc) -- && (ecs->current_line != ecs->sal.line -- || ecs->current_symtab != ecs->sal.symtab)) -+ && (step_current_line != ecs->sal.line -+ || step_current_symtab != ecs->sal.symtab)) - { - /* We are at the start of a different line. So stop. Note that - we don't stop if we step into the middle of a different line. -@@ -2695,13 +2793,11 @@ process_event_stop_test: + if ((stop_pc == stop_pc_sal.pc) + && (ecs->event_thread->current_line != stop_pc_sal.line + || ecs->event_thread->current_symtab != stop_pc_sal.symtab)) +@@ -3671,9 +3781,7 @@ infrun: BPSTAT_WHAT_SET_LONGJMP_RESUME ( - step_range_start = ecs->sal.pc; - step_range_end = ecs->sal.end; -- step_frame_id = get_frame_id (get_current_frame ()); -- ecs->current_line = ecs->sal.line; -- ecs->current_symtab = ecs->sal.symtab; -+ set_step_info (get_frame_id (get_current_user_frame ()), ecs->sal); - - /* In the case where we just stepped out of a function into the - middle of a line of the caller, continue stepping, but -- step_frame_id must be modified to current frame */ -+ step_frame_id must be modified to current frame (above). */ - #if 0 - /* NOTE: cagney/2003-10-16: I think this frame ID inner test is too - generous. It will trigger on things like a step into a frameless -@@ -2718,13 +2814,6 @@ process_event_stop_test: - and we're willing to introduce frame unwind logic into this - function. Fortunately, those days are nearly upon us. */ - #endif -- { -- struct frame_info *frame = get_current_frame (); -- struct frame_id current_frame = get_frame_id (frame); -- if (!(frame_id_inner (get_frame_arch (frame), current_frame, -- step_frame_id))) -- step_frame_id = current_frame; -- } + ecs->event_thread->step_range_start = stop_pc_sal.pc; + ecs->event_thread->step_range_end = stop_pc_sal.end; +- ecs->event_thread->step_frame_id = get_frame_id (get_current_frame ()); +- ecs->event_thread->current_line = stop_pc_sal.line; +- ecs->event_thread->current_symtab = stop_pc_sal.symtab; ++ set_step_info (ecs->event_thread, get_current_frame (), stop_pc_sal); if (debug_infrun) fprintf_unfiltered (gdb_stdlog, "infrun: keep going\n"); -@@ -3145,17 +3234,6 @@ normal_stop (void) +@@ -4197,17 +4305,6 @@ normal_stop (void) previous_inferior_ptid = inferior_ptid; } @@ -1907,76 +1685,47 @@ Index: gdb-6.8/gdb/infrun.c - gdbarch_decr_pc_after_break needs to just go away. */ - deprecated_update_frame_pc_hack (get_current_frame (), read_pc ()); - - if (target_has_execution) + if (!breakpoints_always_inserted_mode () && target_has_execution) { if (remove_breakpoints ()) -@@ -3190,7 +3268,7 @@ Further execution is probably impossible - display the frame below, but the current SAL will be incorrect - during a user hook-stop function. */ - if (target_has_stack && !stop_stack_dummy) -- set_current_sal_from_frame (get_current_frame (), 1); -+ set_current_sal_from_frame (get_current_user_frame (), 1); - - /* Look up the hook_stop and run it (CLI internally handles problem - of stop_command's pre-hook not existing). */ -@@ -3200,7 +3278,6 @@ Further execution is probably impossible - - if (!target_has_stack) - { -- - goto done; - } - -@@ -3211,7 +3288,7 @@ Further execution is probably impossible - - if (!stop_stack_dummy) - { -- select_frame (get_current_frame ()); -+ select_frame (get_current_user_frame ()); - - /* Print current location without a level number, if - we have changed functions or hit a breakpoint. -@@ -3246,7 +3323,7 @@ Further execution is probably impossible - should) use that when doing a frame comparison. */ - if (stop_step - && frame_id_eq (step_frame_id, -- get_frame_id (get_current_frame ())) -+ get_frame_id (get_selected_frame (NULL))) - && step_start_function == find_pc_function (stop_pc)) - source_flag = SRC_LINE; /* finished step, just print source line */ - else -@@ -3305,7 +3382,7 @@ Further execution is probably impossible - Can't rely on restore_inferior_status because that only gets - called if we don't stop in the called function. */ - stop_pc = read_pc (); -- select_frame (get_current_frame ()); -+ select_frame (get_current_user_frame ()); - } - - done: -@@ -3819,7 +3896,7 @@ restore_inferior_status (struct inferior - RETURN_MASK_ERROR) == 0) - /* Error in restoring the selected frame. Select the innermost - frame. */ -- select_frame (get_current_frame ()); -+ select_frame (get_current_user_frame ()); - - } - -Index: gdb-6.8/gdb/inline-frame.c +@@ -4776,6 +4873,7 @@ struct inferior_status + CORE_ADDR step_range_start; + CORE_ADDR step_range_end; + struct frame_id step_frame_id; ++ struct frame_id step_stack_frame_id; + enum step_over_calls_kind step_over_calls; + CORE_ADDR step_resume_break_address; + int stop_after_trap; +@@ -4814,6 +4912,7 @@ save_inferior_status (int restore_stack_ + inf_status->step_range_start = tp->step_range_start; + inf_status->step_range_end = tp->step_range_end; + inf_status->step_frame_id = tp->step_frame_id; ++ inf_status->step_stack_frame_id = tp->step_stack_frame_id; + inf_status->step_over_calls = tp->step_over_calls; + inf_status->stop_after_trap = stop_after_trap; + inf_status->stop_soon = inf->stop_soon; +@@ -4869,6 +4968,7 @@ restore_inferior_status (struct inferior + tp->step_range_start = inf_status->step_range_start; + tp->step_range_end = inf_status->step_range_end; + tp->step_frame_id = inf_status->step_frame_id; ++ tp->step_stack_frame_id = inf_status->step_stack_frame_id; + tp->step_over_calls = inf_status->step_over_calls; + stop_after_trap = inf_status->stop_after_trap; + inf->stop_soon = inf_status->stop_soon; +Index: gdb-6.8.50.20081209/gdb/inline-frame.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8/gdb/inline-frame.c 2008-07-14 10:29:07.000000000 +0200 -@@ -0,0 +1,353 @@ ++++ gdb-6.8.50.20081209/gdb/inline-frame.c 2008-12-10 01:28:37.000000000 +0100 +@@ -0,0 +1,382 @@ +/* Inline frame unwinder for GDB. + -+ Copyright (C) 2007 Free Software Foundation, Inc. ++ Copyright (C) 2008 Free Software Foundation, Inc. + + This file is part of GDB. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or ++ 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, @@ -1985,66 +1734,103 @@ Index: gdb-6.8/gdb/inline-frame.c + 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. */ ++ along with this program. If not, see . */ + +#include "defs.h" +#include "addrmap.h" +#include "block.h" +#include "frame-unwind.h" ++#include "inferior.h" +#include "symtab.h" ++#include "vec.h" + +#include "gdb_assert.h" + -+static int inline_skip_frames; -+ -+/* Only valid if INLINE_SKIP_FRAMES is non-zero. This is the PC used -+ when calculating INLINE_SKIP_FRAMES; used to check whether we have -+ moved to a new location by user request. */ -+static CORE_ADDR inline_skip_pc; -+ -+/* Only valid if INLINE_SKIP_FRAMES is non-zero. This is the symbol -+ of the outermost skipped inline function. It's used to find the -+ call site of the current frame. */ -+static struct symbol *inline_skip_symbol; -+ -+/* Transparently wrap the former regular unwinder. Allocated by -+ FRAME_OBSTACK_ZALLOC. */ -+struct inline_cache -+ { -+ const struct frame_unwind *unwind_regular; -+ void *cache_regular; -+ }; -+ -+/* We just must remap wrapped THIS_CACHE. */ -+ -+static void -+inline_frame_dealloc (struct frame_info *self, void *this_cache) ++/* We need to save a few variables for every thread stopped at the ++ virtual call site of an inlined function. If there was always a ++ "struct thread_info", we could hang it off that; in the mean time, ++ keep our own list. */ ++struct inline_state +{ -+ struct inline_cache *inline_cache = this_cache; ++ /* The thread this data relates to. It should be a currently ++ stopped thread; we assume thread IDs never change while the ++ thread is stopped. */ ++ ptid_t ptid; + -+ /* The same condition as in REINIT_FRAME_CACHE. */ -+ if (inline_cache->unwind_regular->dealloc_cache -+ && inline_cache->cache_regular) -+ inline_cache->unwind_regular->dealloc_cache (self, -+ inline_cache->cache_regular); ++ /* The number of inlined functions we are skipping. Each of these ++ functions can be stepped in to. */ ++ int skipped_frames; ++ ++ /* Only valid if SKIPPED_FRAMES is non-zero. This is the PC used ++ when calculating SKIPPED_FRAMES; used to check whether we have ++ moved to a new location by user request. If so, we invalidate ++ any skipped frames. */ ++ CORE_ADDR saved_pc; ++ ++ /* Only valid if SKIPPED_FRAMES is non-zero. This is the symbol ++ of the outermost skipped inline function. It's used to find the ++ call site of the current frame. */ ++ struct symbol *skipped_symbol; ++}; ++ ++typedef struct inline_state inline_state_s; ++DEF_VEC_O(inline_state_s); ++ ++static VEC(inline_state_s) *inline_states; ++ ++/* Locate saved inlined frame state for PTID, if it exists. */ ++ ++static struct inline_state * ++find_inline_frame_state (ptid_t ptid) ++{ ++ struct inline_state *state; ++ int ix; ++ ++ for (ix = 0; VEC_iterate (inline_state_s, inline_states, ix, state); ix++) ++ { ++ if (ptid_equal (state->ptid, ptid)) ++ return state; ++ } ++ ++ return NULL; +} + -+static CORE_ADDR -+inline_frame_prev_pc (struct frame_info *next_frame, void **this_prologue_cache) -+{ -+ struct inline_cache *inline_cache = *this_prologue_cache; -+ struct frame_info *this_frame; ++/* Allocate saved inlined frame state for PTID. */ + -+ if (inline_cache->unwind_regular->prev_pc) -+ return inline_cache->unwind_regular->prev_pc (next_frame, -+ &inline_cache->cache_regular); -+ gdb_assert (gdbarch_unwind_pc_p (get_frame_arch (next_frame))); -+ this_frame = get_prev_frame (next_frame); -+ gdb_assert (this_frame); -+ gdb_assert (get_frame_arch (next_frame) == get_frame_arch (this_frame)); -+ return gdbarch_unwind_pc (get_frame_arch (this_frame), this_frame); ++static struct inline_state * ++allocate_inline_frame_state (ptid_t ptid) ++{ ++ struct inline_state *state; ++ ++ state = VEC_safe_push (inline_state_s, inline_states, NULL); ++ memset (state, 0, sizeof (*state)); ++ state->ptid = ptid; ++ ++ return state; ++} ++ ++/* Forget about any hidden inlined functions in PTID, which is new or ++ about to be resumed. If PTID is minus_one_ptid, forget about all ++ hidden inlined functions. */ ++ ++void ++clear_inline_frame_state (ptid_t ptid) ++{ ++ struct inline_state *state; ++ int ix; ++ ++ if (ptid_equal (ptid, minus_one_ptid)) ++ { ++ VEC_free (inline_state_s, inline_states); ++ return; ++ } ++ ++ for (ix = 0; VEC_iterate (inline_state_s, inline_states, ix, state); ix++) ++ if (ptid_equal (state->ptid, ptid)) ++ { ++ VEC_unordered_remove (inline_state_s, inline_states, ix); ++ return; ++ } +} + +static void @@ -2053,19 +1839,14 @@ Index: gdb-6.8/gdb/inline-frame.c + struct frame_id *this_id) +{ + struct symbol *func; -+ struct frame_info *next_frame; -+ struct inline_cache *inline_cache = *this_cache; + -+ this_frame = get_prev_frame (this_frame); -+ gdb_assert (get_frame_type (this_frame) == INLINE_FRAME); -+ -+ /* In order to have a stable frame ID for a given inline function, we must -+ get the stack / special addresses from the underlying real frame's this_id -+ method. We must not call get_prev_frame as each frame expects its inner -+ frames to be already fully accessible. This would open a can of worms -+ with unwinding deadlocks. */ -+ inline_cache->unwind_regular->this_id (this_frame, -+ &inline_cache->cache_regular, this_id); ++ /* In order to have a stable frame ID for a given inline function, ++ we must get the stack / special addresses from the underlying ++ real frame's this_id method. So we must call get_prev_frame. ++ Because we are inlined into some function, there must be previous ++ frames, so this is safe - as long as we're careful not to ++ create any cycles. */ ++ *this_id = get_frame_id (get_prev_frame (this_frame)); + + /* We need a valid frame ID, so we need to be based on a valid + frame. FSF submission NOTE: this would be a good assertion to @@ -2080,39 +1861,26 @@ Index: gdb-6.8/gdb/inline-frame.c + in the frame ID (and eventually, to set breakpoints). */ + func = get_frame_function (this_frame); + gdb_assert (func != NULL); -+ (*this_id).block_addr = BLOCK_START (SYMBOL_BLOCK_VALUE (func)); -+ -+ /* The regular unwinder knows no INLINE_DEPTH. */ -+ gdb_assert ((*this_id).inline_depth == 0); -+ -+ /* Inlined frames (inlined functions) can never exist behind a normal frame -+ (non-inlined function). Any possible inlined frames (inlined functions) -+ behind such frame will already be at a different code location and not -+ found by BLOCK_FOR_PC at this PC moment. */ -+ for (next_frame = this_frame; -+ next_frame && get_frame_type (next_frame) == INLINE_FRAME; -+ next_frame = get_next_frame (next_frame)) -+ (*this_id).inline_depth++; -+ -+ gdb_assert ((*this_id).inline_depth > 0); ++ (*this_id).code_addr = BLOCK_START (SYMBOL_BLOCK_VALUE (func)); ++ (*this_id).inline_depth++; +} + -+static void -+inline_frame_prev_register (struct frame_info *next_frame, -+ void **this_prologue_cache, -+ int prev_regnum, -+ int *optimized, -+ enum lval_type * lvalp, -+ CORE_ADDR *addrp, -+ int *realnump, gdb_byte *valuep) ++static struct value * ++inline_frame_prev_register (struct frame_info *this_frame, void **this_cache, ++ int regnum) +{ -+ /* Copy all the registers unchanged. */ -+ *optimized = 0; -+ *lvalp = lval_register; -+ *addrp = 0; -+ *realnump = prev_regnum; -+ if (valuep) -+ frame_unwind_register (next_frame, (*realnump), valuep); ++ /* Use get_frame_register_value instead of ++ frame_unwind_got_register, to avoid requiring this frame's ID. ++ This frame's ID depends on the previous frame's ID (unusual), and ++ the previous frame's ID depends on this frame's unwound ++ registers. If unwinding registers from this frame called ++ get_frame_id, there would be a loop. ++ ++ Do not copy this code into any other unwinder! Inlined functions ++ are special; other unwinders must not have a dependency on the ++ previous frame's ID, and therefore can and should use ++ frame_unwind_got_register instead. */ ++ return get_frame_register_value (this_frame, regnum); +} + +/* Check whether we are at an inlining site that does not already @@ -2127,23 +1895,13 @@ Index: gdb-6.8/gdb/inline-frame.c + struct block *frame_block, *cur_block; + int depth; + struct frame_info *next_frame; -+ struct inline_cache *inline_cache; ++ struct inline_state *state = find_inline_frame_state (inferior_ptid); + -+ /* INLINE_FRAME unwinder is an exception, it is passed the regular unwinder -+ detected for this frame. */ -+ gdb_assert (self != inline_frame_unwind); -+ -+ this_pc = frame_unwind_address_in_block (this_frame, -+ get_frame_type (this_frame)); ++ this_pc = get_frame_address_in_block (this_frame); + frame_block = block_for_pc (this_pc); + if (frame_block == NULL) + return 0; + -+ /* INLINE_SKIP_SYMBOL does not need to be set for each specific frame. But -+ * it needs to be recalculated after STEP_INTO_INLINE_FRAME according to new -+ * INLINE_SKIP_FRAMES - therefore SET_SKIPPED_INLINE_FRAMES is too early. */ -+ inline_skip_symbol = NULL; -+ + /* Calculate DEPTH, the number of inlined functions at this + location. */ + depth = 0; @@ -2152,19 +1910,12 @@ Index: gdb-6.8/gdb/inline-frame.c + { + if (block_inlined_p (cur_block)) + depth++; -+ if (depth == inline_skip_frames && inline_skip_symbol == NULL) -+ inline_skip_symbol = BLOCK_FUNCTION (cur_block); + + cur_block = BLOCK_SUPERBLOCK (cur_block); + } + -+ /* There are inlined functions here. Check how many of them already have -+ frames. Any possibly inlined frames (inlined functions) behind -+ NORMAL_FRAME (non-inlined function) will already be at a different code -+ location and not found by BLOCK_FOR_PC at this PC moment. */ -+ if (get_frame_type (this_frame) == SENTINEL_FRAME) -+ this_frame = NULL; -+ for (next_frame = this_frame; ++ /* Check how many inlined functions already have frames. */ ++ for (next_frame = get_next_frame (this_frame); + next_frame && get_frame_type (next_frame) == INLINE_FRAME; + next_frame = get_next_frame (next_frame)) + { @@ -2172,49 +1923,40 @@ Index: gdb-6.8/gdb/inline-frame.c + depth--; + } + -+ /* Check whether we were requested to skip some frames, so they -+ can be stepped into later. */ -+ if (inline_skip_frames > 0 && next_frame == NULL) ++ /* If this is the topmost frame, or all frames above us are inlined, ++ then check whether we were requested to skip some frames (so they ++ can be stepped into later). */ ++ if (state != NULL && state->skipped_frames > 0 && next_frame == NULL) + { -+ if (this_pc != inline_skip_pc) -+ inline_skip_frames = 0; ++ if (this_pc != state->saved_pc) ++ state->skipped_frames = 0; + else + { -+ gdb_assert (depth >= inline_skip_frames); -+ depth -= inline_skip_frames; ++ gdb_assert (depth >= state->skipped_frames); ++ depth -= state->skipped_frames; + } + } + -+ /* If all the inlined functions already have frames, then pass to the -+ normal unwinder for this PC. */ ++ /* If all the inlined functions here already have frames, then pass ++ to the normal unwinder for this PC. */ + if (depth == 0) + return 0; + -+ /* Transparently wrap the former regular unwinder. */ -+ inline_cache = frame_obstack_zalloc (sizeof (*inline_cache)); -+ inline_cache->unwind_regular = self; -+ inline_cache->cache_regular = *this_cache; -+ *this_cache = inline_cache; -+ + /* If the next frame is an inlined function, but not the outermost, then + we are the next outer. If it is not an inlined function, then we + are the innermost inlined function of a different real frame. */ + return 1; +} + -+static const struct frame_unwind inline_frame_unwinder = { ++const struct frame_unwind inline_frame_unwinder = { + INLINE_FRAME, + inline_frame_this_id, + inline_frame_prev_register, + NULL, -+ inline_frame_sniffer, -+ inline_frame_prev_pc, -+ inline_frame_dealloc ++ inline_frame_sniffer +}; + -+const struct frame_unwind *const inline_frame_unwind = { -+ &inline_frame_unwinder -+}; ++const struct frame_unwind *const inline_frame_unwind = &inline_frame_unwinder; + +/* Return non-zero if BLOCK, an inlined function block containing PC, + has a group of contiguous instructions starting at PC (but not @@ -2243,27 +1985,23 @@ Index: gdb-6.8/gdb/inline-frame.c + return 1; +} + ++/* Skip all inlined functions whose call sites are at the current PC. ++ Frames for the hidden functions will not appear in the backtrace until the ++ user steps into them. */ ++ +void -+set_skipped_inline_frames (int skip_ok) ++skip_inline_frames (ptid_t ptid) +{ + CORE_ADDR this_pc; + struct block *frame_block, *cur_block; ++ struct symbol *last_sym = NULL; + int skip_count = 0; -+ -+ if (!skip_ok) -+ { -+ if (inline_skip_frames != 0) -+ { -+ inline_skip_frames = 0; -+ reinit_frame_cache (); -+ } -+ return; -+ } ++ struct inline_state *state; + + /* This function is called right after reinitializing the frame + cache. We try not to do more unwinding than absolutely + necessary, for performance. */ -+ this_pc = get_frame_pc (get_current_user_frame ()); ++ this_pc = get_frame_pc (get_current_frame ()); + frame_block = block_for_pc (this_pc); + + if (frame_block != NULL) @@ -2277,86 +2015,162 @@ Index: gdb-6.8/gdb/inline-frame.c + of BLOCK_START. */ + if (BLOCK_START (cur_block) == this_pc + || block_starting_point_at (this_pc, cur_block)) -+ skip_count++; -+ else + { -+ /* Here we will stop at any possible inlining after we -+ already crossed any first non-inlined function. We could -+ possibly detected such functions generating NORMAL_FRAME -+ by `!block_inlined_p && BLOCK_FUNCTION' (as -+ `!block_inlined_p && !BLOCK_FUNCTION' are just anonymous -+ local { ... } blocks). */ -+ break; ++ skip_count++; ++ last_sym = BLOCK_FUNCTION (cur_block); + } ++ else ++ break; + } + cur_block = BLOCK_SUPERBLOCK (cur_block); + } + } + -+ inline_skip_pc = this_pc; ++ gdb_assert (find_inline_frame_state (ptid) == NULL); ++ state = allocate_inline_frame_state (ptid); ++ state->skipped_frames = skip_count; ++ state->saved_pc = this_pc; ++ state->skipped_symbol = last_sym; + -+ if (inline_skip_frames != skip_count) -+ { -+ inline_skip_frames = skip_count; -+ reinit_frame_cache (); -+ } ++ if (skip_count != 0) ++ reinit_frame_cache (); +} + ++/* Step into an inlined function by unhiding it. */ ++ +void -+step_into_inline_frame (void) ++step_into_inline_frame (ptid_t ptid) +{ -+ gdb_assert (inline_skip_frames > 0); -+ inline_skip_frames--; ++ struct inline_state *state = find_inline_frame_state (ptid); ++ ++ gdb_assert (state != NULL && state->skipped_frames > 0); ++ state->skipped_frames--; + reinit_frame_cache (); +} + ++/* Return the number of hidden functions inlined into the current ++ frame. */ ++ +int -+inline_skipped_frames (void) ++inline_skipped_frames (ptid_t ptid) +{ -+ return inline_skip_frames; ++ struct inline_state *state = find_inline_frame_state (ptid); ++ ++ if (state == NULL) ++ return 0; ++ else ++ return state->skipped_frames; +} + ++/* If one or more inlined functions are hidden, return the symbol for ++ the function inlined into the current frame. */ ++ +struct symbol * -+inline_skipped_symbol (void) ++inline_skipped_symbol (ptid_t ptid) +{ -+ return inline_skip_symbol; ++ struct inline_state *state = find_inline_frame_state (ptid); ++ ++ gdb_assert (state != NULL); ++ return state->skipped_symbol; +} -Index: gdb-6.8/gdb/mi/mi-cmd-stack.c ++ ++/* Return the number of functions inlined into THIS_FRAME. Some of ++ the callees may not have associated frames (see ++ skip_inline_frames). */ ++ ++int ++frame_inlined_callees (struct frame_info *this_frame) ++{ ++ struct frame_info *next_frame; ++ int inline_count = 0; ++ ++ /* First count how many inlined functions at this PC have frames ++ above FRAME (are inlined into FRAME). */ ++ for (next_frame = get_next_frame (this_frame); ++ next_frame && get_frame_type (next_frame) == INLINE_FRAME; ++ next_frame = get_next_frame (next_frame)) ++ inline_count++; ++ ++ /* Simulate some most-inner inlined frames which were suppressed, so ++ they can be stepped into later. If we are unwinding already ++ outer frames from some non-inlined frame this does not apply. */ ++ if (next_frame == NULL) ++ inline_count += inline_skipped_frames (inferior_ptid); ++ ++ return inline_count; ++} +Index: gdb-6.8.50.20081209/gdb/inline-frame.h =================================================================== ---- gdb-6.8.orig/gdb/mi/mi-cmd-stack.c 2008-01-01 23:53:14.000000000 +0100 -+++ gdb-6.8/gdb/mi/mi-cmd-stack.c 2008-07-14 10:29:07.000000000 +0200 -@@ -65,7 +65,7 @@ mi_cmd_stack_list_frames (char *command, - /* Let's position fi on the frame at which to start the - display. Could be the innermost frame if the whole stack needs - displaying, or if frame_low is 0. */ -- for (i = 0, fi = get_current_frame (); -+ for (i = 0, fi = get_current_user_frame (); - fi && i < frame_low; - i++, fi = get_prev_frame (fi)); - -@@ -108,7 +108,7 @@ mi_cmd_stack_info_depth (char *command, - the stack. */ - frame_high = -1; - -- for (i = 0, fi = get_current_frame (); -+ for (i = 0, fi = get_current_user_frame (); - fi && (i < frame_high || frame_high == -1); - i++, fi = get_prev_frame (fi)) - QUIT; -@@ -180,7 +180,7 @@ mi_cmd_stack_list_args (char *command, c - /* Let's position fi on the frame at which to start the - display. Could be the innermost frame if the whole stack needs - displaying, or if frame_low is 0. */ -- for (i = 0, fi = get_current_frame (); -+ for (i = 0, fi = get_current_user_frame (); - fi && i < frame_low; - i++, fi = get_prev_frame (fi)); - -Index: gdb-6.8/gdb/minsyms.c +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081209/gdb/inline-frame.h 2008-12-10 01:28:37.000000000 +0100 +@@ -0,0 +1,62 @@ ++/* Definitions for inline frame support. ++ ++ Copyright (C) 2008 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++#if !defined (INLINE_FRAME_H) ++#define INLINE_FRAME_H 1 ++ ++struct frame_info; ++struct frame_unwind; ++ ++/* The inline frame unwinder. */ ++ ++extern const struct frame_unwind *const inline_frame_unwind; ++ ++/* Skip all inlined functions whose call sites are at the current PC. ++ Frames for the hidden functions will not appear in the backtrace until the ++ user steps into them. */ ++ ++void skip_inline_frames (ptid_t ptid); ++ ++/* Forget about any hidden inlined functions in PTID, which is new or ++ about to be resumed. If PTID is minus_one_ptid, forget about all ++ hidden inlined functions. */ ++ ++void clear_inline_frame_state (ptid_t ptid); ++ ++/* Step into an inlined function by unhiding it. */ ++ ++void step_into_inline_frame (ptid_t ptid); ++ ++/* Return the number of hidden functions inlined into the current ++ frame. */ ++ ++int inline_skipped_frames (ptid_t ptid); ++ ++/* If one or more inlined functions are hidden, return the symbol for ++ the function inlined into the current frame. */ ++ ++struct symbol *inline_skipped_symbol (ptid_t ptid); ++ ++/* Return the number of functions inlined into THIS_FRAME. Some of ++ the callees may not have associated frames (see ++ skip_inline_frames). */ ++ ++int frame_inlined_callees (struct frame_info *this_frame); ++ ++#endif /* !defined (INLINE_FRAME_H) */ +Index: gdb-6.8.50.20081209/gdb/minsyms.c =================================================================== ---- gdb-6.8.orig/gdb/minsyms.c 2008-07-14 10:27:27.000000000 +0200 -+++ gdb-6.8/gdb/minsyms.c 2008-07-14 10:29:07.000000000 +0200 -@@ -677,7 +677,7 @@ prim_record_minimal_symbol_and_info (con +--- gdb-6.8.50.20081209.orig/gdb/minsyms.c 2008-12-10 01:27:33.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/minsyms.c 2008-12-10 01:28:37.000000000 +0100 +@@ -767,7 +767,7 @@ prim_record_minimal_symbol_and_info (con if (msym_bunch_index == BUNCH_SIZE) { @@ -2365,31 +2179,56 @@ Index: gdb-6.8/gdb/minsyms.c msym_bunch_index = 0; new->next = msym_bunch; msym_bunch = new; -Index: gdb-6.8/gdb/s390-tdep.c +Index: gdb-6.8.50.20081209/gdb/s390-tdep.c =================================================================== ---- gdb-6.8.orig/gdb/s390-tdep.c 2008-07-14 10:26:09.000000000 +0200 -+++ gdb-6.8/gdb/s390-tdep.c 2008-07-14 10:29:07.000000000 +0200 -@@ -1216,6 +1216,7 @@ s390_prologue_frame_unwind_cache (struct +--- gdb-6.8.50.20081209.orig/gdb/s390-tdep.c 2008-09-11 16:23:15.000000000 +0200 ++++ gdb-6.8.50.20081209/gdb/s390-tdep.c 2008-12-10 01:28:37.000000000 +0100 +@@ -1182,6 +1182,7 @@ s390_prologue_frame_unwind_cache (struct + CORE_ADDR prev_sp; + int frame_pointer; + int size; ++ struct frame_info *next_frame; + + /* Try to find the function start address. If we can't find it, we don't + bother searching for it -- with modern compilers this would be mostly +@@ -1215,7 +1216,10 @@ s390_prologue_frame_unwind_cache (struct + /* FIXME: cagney/2004-05-01: This sanity check shouldn't be needed, instead the code should simpliy rely on its analysis. */ - if (get_frame_type (next_frame) == NORMAL_FRAME) -+ || get_frame_type (next_frame) == INLINE_FRAME) +- if (get_next_frame (this_frame) ++ next_frame = get_next_frame (this_frame); ++ while (next_frame && get_frame_type (next_frame) == INLINE_FRAME) ++ next_frame = get_next_frame (next_frame); ++ if (next_frame + && get_frame_type (get_next_frame (this_frame)) == NORMAL_FRAME) return 0; - /* If we really have a frameless function, %r14 must be valid -@@ -1261,6 +1262,7 @@ s390_prologue_frame_unwind_cache (struct +@@ -1261,8 +1265,11 @@ s390_prologue_frame_unwind_cache (struct + This can only happen in an innermost frame. */ /* FIXME: cagney/2004-05-01: This sanity check shouldn't be needed, instead the code should simpliy rely on its analysis. */ - if (size > 0 && get_frame_type (next_frame) != NORMAL_FRAME) -+ && get_frame_type (next_frame) != INLINE_FRAME) ++ next_frame = get_next_frame (this_frame); ++ while (next_frame && get_frame_type (next_frame) == INLINE_FRAME) ++ next_frame = get_next_frame (next_frame); + if (size > 0 +- && (!get_next_frame (this_frame) ++ && (next_frame == NULL + || get_frame_type (get_next_frame (this_frame)) != NORMAL_FRAME)) { /* See the comment in s390_in_function_epilogue_p on why this is - not completely reliable ... */ -Index: gdb-6.8/gdb/stack.c +Index: gdb-6.8.50.20081209/gdb/stack.c =================================================================== ---- gdb-6.8.orig/gdb/stack.c 2008-03-17 16:06:24.000000000 +0100 -+++ gdb-6.8/gdb/stack.c 2008-07-14 10:29:07.000000000 +0200 -@@ -96,6 +96,30 @@ print_stack_frame_stub (void *args) +--- gdb-6.8.50.20081209.orig/gdb/stack.c 2008-12-10 01:22:11.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/stack.c 2008-12-10 01:28:37.000000000 +0100 +@@ -45,6 +45,7 @@ + #include "valprint.h" + #include "gdbthread.h" + #include "cp-support.h" ++#include "inline-frame.h" + + #include "gdb_assert.h" + #include +@@ -98,6 +99,30 @@ print_stack_frame_stub (void *args) return 0; } @@ -2408,7 +2247,7 @@ Index: gdb-6.8/gdb/stack.c + if (sal.line != 0 && sal.pc == 0 && sal.end == 0) + { + if (get_next_frame (frame) == NULL) -+ gdb_assert (inline_skipped_frames () > 0); ++ gdb_assert (inline_skipped_frames (inferior_ptid) > 0); + else + gdb_assert (get_frame_type (get_next_frame (frame)) == INLINE_FRAME); + return 0; @@ -2420,7 +2259,7 @@ Index: gdb-6.8/gdb/stack.c /* Show or print a stack frame FRAME briefly. The output is format according to PRINT_LEVEL and PRINT_WHAT printing the frame's relative level, function name, argument list, and file name and -@@ -522,7 +546,7 @@ print_frame_info (struct frame_info *fra +@@ -537,7 +562,7 @@ print_frame_info (struct frame_info *fra { int done = 0; int mid_statement = ((print_what == SRC_LINE) @@ -2429,7 +2268,7 @@ Index: gdb-6.8/gdb/stack.c if (annotation_level) done = identify_source_line (sal.symtab, sal.line, mid_statement, -@@ -576,7 +600,7 @@ print_frame (struct frame_info *frame, i +@@ -594,7 +619,7 @@ print_frame (struct frame_info *frame, i stb = ui_out_stream_new (uiout); old_chain = make_cleanup_ui_out_stream_delete (stb); @@ -2438,7 +2277,7 @@ Index: gdb-6.8/gdb/stack.c if (func) { /* In certain pathological cases, the symtabs give the wrong -@@ -597,8 +621,13 @@ print_frame (struct frame_info *frame, i +@@ -615,8 +640,13 @@ print_frame (struct frame_info *frame, i changed (and we'll create a find_pc_minimal_function or some such). */ @@ -2454,34 +2293,35 @@ Index: gdb-6.8/gdb/stack.c if (msymbol != NULL && (SYMBOL_VALUE_ADDRESS (msymbol) -@@ -664,7 +693,7 @@ print_frame (struct frame_info *frame, i - frame_relative_level (frame)); +@@ -673,7 +703,7 @@ print_frame (struct frame_info *frame, i } - if (addressprint) + get_user_print_options (&opts); + if (opts.addressprint) - if (get_frame_pc (frame) != sal.pc || !sal.symtab + if (frame_show_address (frame, sal) || !sal.symtab || print_what == LOC_AND_ADDRESS) { annotate_frame_address (); -@@ -821,7 +850,7 @@ parse_frame_specification_1 (const char - { - struct frame_info *fid; - int level = value_as_long (args[0]); -- fid = find_relative_frame (get_current_frame (), &level); -+ fid = find_relative_frame (get_current_user_frame (), &level); - if (level == 0) - /* find_relative_frame was successful */ - return fid; -@@ -846,7 +875,7 @@ parse_frame_specification_1 (const char - what (s)he gets. Still, give the highest one that matches. - (NOTE: cagney/2004-10-29: Why highest, or outer-most, I don't - know). */ -- for (fid = get_current_frame (); -+ for (fid = get_current_user_frame (); - fid != NULL; - fid = get_prev_frame (fid)) +@@ -853,8 +883,16 @@ parse_frame_specification_1 (const char { -@@ -994,8 +1023,10 @@ frame_info (char *addr_exp, int from_tty + if (frame_id_eq (id, get_frame_id (fid))) + { +- while (frame_id_eq (id, frame_unwind_id (fid))) +- fid = get_prev_frame (fid); ++ struct frame_info *prev_frame; ++ ++ while (1) ++ { ++ prev_frame = get_prev_frame (fid); ++ if (!prev_frame ++ || !frame_id_eq (id, get_frame_id (prev_frame))) ++ break; ++ fid = prev_frame; ++ } + return fid; + } + } +@@ -988,8 +1026,10 @@ frame_info (char *addr_exp, int from_tty printf_filtered (_(" Outermost frame: %s\n"), frame_stop_reason_string (reason)); } @@ -2494,16 +2334,7 @@ Index: gdb-6.8/gdb/stack.c { printf_filtered (" called by frame at "); fputs_filtered (paddress (get_frame_base (calling_frame_info)), -@@ -1172,7 +1203,7 @@ backtrace_command_1 (char *count_exp, in - variable TRAILING to the frame from which we should start - printing. Second, it must set the variable count to the number - of frames which we should print, or -1 if all of them. */ -- trailing = get_current_frame (); -+ trailing = get_current_user_frame (); - - /* The target can be in a state where there is no valid frames - (e.g., just connected). */ -@@ -1455,7 +1486,9 @@ print_frame_local_vars (struct frame_inf +@@ -1453,7 +1493,9 @@ print_frame_local_vars (struct frame_inf if (print_block_frame_locals (block, frame, num_tabs, stream)) values_printed = 1; /* After handling the function's top-level block, stop. Don't @@ -2514,7 +2345,7 @@ Index: gdb-6.8/gdb/stack.c if (BLOCK_FUNCTION (block)) break; block = BLOCK_SUPERBLOCK (block); -@@ -1526,7 +1559,9 @@ print_frame_label_vars (struct frame_inf +@@ -1524,7 +1566,9 @@ print_frame_label_vars (struct frame_inf return; /* After handling the function's top-level block, stop. Don't @@ -2525,22 +2356,22 @@ Index: gdb-6.8/gdb/stack.c if (BLOCK_FUNCTION (block)) break; block = BLOCK_SUPERBLOCK (block); -@@ -1801,6 +1836,9 @@ return_command (char *retval_exp, int fr +@@ -1795,6 +1839,9 @@ return_command (char *retval_exp, int fr + thisframe = get_selected_frame ("No selected frame."); + thisfun = get_frame_function (thisframe); - thisfun = get_frame_function (get_selected_frame ("No selected frame.")); - -+ if (get_frame_type (get_current_user_frame ()) == INLINE_FRAME) ++ if (get_frame_type (get_current_frame ()) == INLINE_FRAME) + error (_("Can not force return from an inlined function.")); + /* Compute the return value. If the computation triggers an error, let it bail. If the return type can't be handled, set RETURN_VALUE to NULL, and QUERY_PREFIX to an informational -Index: gdb-6.8/gdb/symtab.c +Index: gdb-6.8.50.20081209/gdb/symtab.c =================================================================== ---- gdb-6.8.orig/gdb/symtab.c 2008-07-14 10:27:32.000000000 +0200 -+++ gdb-6.8/gdb/symtab.c 2008-07-14 10:29:07.000000000 +0200 -@@ -1264,10 +1264,13 @@ lookup_symbol_aux_local (const char *nam - symtab); +--- gdb-6.8.50.20081209.orig/gdb/symtab.c 2008-12-10 01:27:33.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/symtab.c 2008-12-10 01:28:37.000000000 +0100 +@@ -1373,10 +1373,13 @@ lookup_symbol_aux_local (const char *nam + sym = lookup_symbol_aux_block (name, linkage_name, block, domain); if (sym != NULL) return sym; + @@ -2554,21 +2385,21 @@ Index: gdb-6.8/gdb/symtab.c return NULL; } -@@ -2499,6 +2502,7 @@ find_function_start_sal (struct symbol * - { +@@ -2609,6 +2612,7 @@ find_function_start_sal (struct symbol * + CORE_ADDR pc; struct symtab_and_line sal; + struct block *b, *function_block; - pc = BLOCK_START (SYMBOL_BLOCK_VALUE (sym)); - fixup_symbol_section (sym, NULL); -@@ -2533,6 +2537,25 @@ find_function_start_sal (struct symbol * - } + pc = BLOCK_START (block); + fixup_symbol_section (sym, objfile); +@@ -2647,6 +2651,25 @@ find_function_start_sal (struct symbol * + sal.pc = pc; + /* Check if we are now inside an inlined function. If we can, + use the call site of the function instead. */ -+ b = block_for_pc_sect (sal.pc, SYMBOL_BFD_SECTION (sym)); ++ b = block_for_pc_sect (sal.pc, SYMBOL_OBJ_SECTION (sym)); + function_block = NULL; + while (b != NULL) + { @@ -2588,8 +2419,8 @@ Index: gdb-6.8/gdb/symtab.c return sal; } -@@ -3530,6 +3553,24 @@ language_search_unquoted_string (char *t - return p; +@@ -3669,6 +3692,24 @@ add_macro_name (const char *name, const + datum->text, datum->word); } +static void @@ -2613,7 +2444,7 @@ Index: gdb-6.8/gdb/symtab.c char ** default_make_symbol_completion_list (char *text, char *word) { -@@ -3542,9 +3583,9 @@ default_make_symbol_completion_list (cha +@@ -3681,9 +3722,9 @@ default_make_symbol_completion_list (cha struct partial_symtab *ps; struct minimal_symbol *msymbol; struct objfile *objfile; @@ -2625,7 +2456,7 @@ Index: gdb-6.8/gdb/symtab.c struct partial_symbol **psym; /* The symbol we are completing on. Points in same buffer as text. */ char *sym_text; -@@ -3654,41 +3695,43 @@ default_make_symbol_completion_list (cha +@@ -3793,41 +3834,43 @@ default_make_symbol_completion_list (cha } /* Search upwards from currently selected frame (so that we can @@ -2700,7 +2531,7 @@ Index: gdb-6.8/gdb/symtab.c /* Go through the symtabs and check the externs and statics for symbols which match. */ -@@ -3707,9 +3750,6 @@ default_make_symbol_completion_list (cha +@@ -3846,9 +3889,6 @@ default_make_symbol_completion_list (cha { QUIT; b = BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), STATIC_BLOCK); @@ -2710,15 +2541,7 @@ Index: gdb-6.8/gdb/symtab.c ALL_BLOCK_SYMBOLS (b, iter, sym) { COMPLETION_LIST_ADD_SYMBOL (sym, sym_text, sym_text_len, text, word); -@@ -4088,6 +4128,7 @@ skip_prologue_using_sal (CORE_ADDR func_ - struct symtab_and_line prologue_sal; - CORE_ADDR start_pc; - CORE_ADDR end_pc; -+ struct block *bl; - - /* Get an initial range for the function. */ - find_pc_partial_function (func_addr, NULL, &start_pc, &end_pc); -@@ -4112,6 +4153,25 @@ skip_prologue_using_sal (CORE_ADDR func_ +@@ -4305,6 +4345,25 @@ skip_prologue_using_sal (CORE_ADDR func_ line mark the prologue -> body transition. */ if (sal.line >= prologue_sal.line) break; @@ -2744,20 +2567,23 @@ Index: gdb-6.8/gdb/symtab.c /* The case in which compiler's optimizer/scheduler has moved instructions into the prologue. We look ahead in the function looking for address ranges whose -Index: gdb-6.8/gdb/symtab.h +Index: gdb-6.8.50.20081209/gdb/symtab.h =================================================================== ---- gdb-6.8.orig/gdb/symtab.h 2008-02-05 23:17:40.000000000 +0100 -+++ gdb-6.8/gdb/symtab.h 2008-07-14 10:29:07.000000000 +0200 -@@ -623,9 +623,15 @@ struct symbol +--- gdb-6.8.50.20081209.orig/gdb/symtab.h 2008-10-01 19:25:22.000000000 +0200 ++++ gdb-6.8.50.20081209/gdb/symtab.h 2008-12-10 01:28:37.000000000 +0100 +@@ -556,9 +556,18 @@ struct symbol - ENUM_BITFIELD(address_class) aclass : 6; + unsigned is_argument : 1; - /* Line number of definition. FIXME: Should we really make the assumption - that nobody will try to debug files longer than 64K lines? What about - machine generated programs? */ ++ /* Whether this is an inlined function (class LOC_BLOCK only). */ ++ unsigned is_inlined : 1; ++ + /* Line number of this symbol's definition, except for inlined + functions. For an inlined function (class LOC_BLOCK and -+ BLOCK_INLINE set) this is the line number of the function's call ++ SYMBOL_INLINED set) this is the line number of the function's call + site. Inlined function symbols are not definitions, and they are + never found by symbol table lookup. + @@ -2767,11 +2593,37 @@ Index: gdb-6.8/gdb/symtab.h unsigned short line; -Index: gdb-6.8/gdb/testsuite/gdb.cp/annota2.exp +@@ -589,6 +598,7 @@ struct symbol + #define SYMBOL_DOMAIN(symbol) (symbol)->domain + #define SYMBOL_CLASS(symbol) (symbol)->aclass + #define SYMBOL_IS_ARGUMENT(symbol) (symbol)->is_argument ++#define SYMBOL_INLINED(symbol) (symbol)->is_inlined + #define SYMBOL_TYPE(symbol) (symbol)->type + #define SYMBOL_LINE(symbol) (symbol)->line + #define SYMBOL_SYMTAB(symbol) (symbol)->symtab +Index: gdb-6.8.50.20081209/gdb/testsuite/gdb.base/break.exp =================================================================== ---- gdb-6.8.orig/gdb/testsuite/gdb.cp/annota2.exp 2008-03-04 21:06:22.000000000 +0100 -+++ gdb-6.8/gdb/testsuite/gdb.cp/annota2.exp 2008-07-14 10:29:07.000000000 +0200 -@@ -119,13 +119,14 @@ gdb_expect { +--- gdb-6.8.50.20081209.orig/gdb/testsuite/gdb.base/break.exp 2008-08-06 14:52:07.000000000 +0200 ++++ gdb-6.8.50.20081209/gdb/testsuite/gdb.base/break.exp 2008-12-10 01:28:37.000000000 +0100 +@@ -880,6 +880,13 @@ gdb_expect { + # marker4() is defined at line 46 when compiled with -DPROTOTYPES + pass "run until breakpoint set at small function, optimized file (line bp_location14)" + } ++ -re "Breakpoint $decimal, factorial \\(.*\\) .*\{\r\n$gdb_prompt" { ++ # GCC 4.3 emits bad line number information - see gcc/36748. ++ if { [test_compiler_info "gcc-4-3-*"] } { ++ setup_xfail *-*-* ++ } ++ fail "run until breakpoint set at small function, optimized file" ++ } + -re ".*$gdb_prompt " { + fail "run until breakpoint set at small function, optimized file" + } +Index: gdb-6.8.50.20081209/gdb/testsuite/gdb.cp/annota2.exp +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/testsuite/gdb.cp/annota2.exp 2008-05-04 21:39:00.000000000 +0200 ++++ gdb-6.8.50.20081209/gdb/testsuite/gdb.cp/annota2.exp 2008-12-10 01:28:37.000000000 +0100 +@@ -119,10 +119,11 @@ gdb_expect { # continue until exit # this will test: # annotate-exited @@ -2782,36 +2634,18 @@ Index: gdb-6.8/gdb/testsuite/gdb.cp/annota2.exp - -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\r\n\r\n\032\032frames-invalid\r\na.x is 1\r\n\r\n\032\032exited 0\r\n\r\nProgram exited normally.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ + -re "\r\n\032\032post-prompt\r\nContinuing.\r\n\r\n\032\032starting\r\n(\r\n\032\032frames-invalid\r\n)*a.x is 1\r\n(\r\n\032\032frames-invalid\r\n)*\r\n\032\032exited 0\r\n\r\nProgram exited normally.\r\n\r\n\032\032stopped\r\n$gdb_prompt$" \ { pass "continue until exit" } -- -re ".*$gdb_prompt$" { fail "continue to exit" } -- timeout { fail "continue to exit (timeout)" } -+ -re ".*$gdb_prompt$" { fail "continue until exit" } -+ timeout { fail "continue until exit (timeout)" } - } - - # -Index: gdb-6.8/gdb/testsuite/gdb.opt/Makefile.in -=================================================================== ---- gdb-6.8.orig/gdb/testsuite/gdb.opt/Makefile.in 2007-10-25 22:30:26.000000000 +0200 -+++ gdb-6.8/gdb/testsuite/gdb.opt/Makefile.in 2008-07-14 10:29:07.000000000 +0200 -@@ -1,7 +1,7 @@ - VPATH = @srcdir@ - srcdir = @srcdir@ - --EXECUTABLES = hello/hello -+EXECUTABLES = hello/hello inline-bt - - MISCELLANEOUS = - -Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-bt.c + -re ".*$gdb_prompt$" { fail "continue to exit" } + timeout { fail "continue to exit (timeout)" } +Index: gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/inline-bt.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8/gdb/testsuite/gdb.opt/inline-bt.c 2008-07-14 10:29:07.000000000 +0200 -@@ -0,0 +1,54 @@ -+/* Copyright (C) 2007 Free Software Foundation, Inc. ++++ gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/inline-bt.c 2008-12-10 01:28:37.000000000 +0100 +@@ -0,0 +1,47 @@ ++/* Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or ++ 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, @@ -2820,19 +2654,12 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-bt.c + 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. */ ++ along with this program. If not, see . */ + -+/* VOLATILE forces all the inlining to happen as otherwise the whole program -+ gets optimized by CSE to just simple assignments of the results. */ -+volatile int x, y; ++int x, y; +volatile int result; + -+void bar(void) -+{ -+ x += y; /* set breakpoint 1 here */ -+} ++void bar(void); + +inline int func1(void) +{ @@ -2861,16 +2688,16 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-bt.c + + return 0; +} -Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-bt.exp +Index: gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/inline-bt.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8/gdb/testsuite/gdb.opt/inline-bt.exp 2008-07-14 10:29:07.000000000 +0200 -@@ -0,0 +1,61 @@ -+# Copyright 2007 Free Software Foundation, Inc. ++++ gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/inline-bt.exp 2008-12-10 01:28:37.000000000 +0100 +@@ -0,0 +1,63 @@ ++# Copyright 2008 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or ++# 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, @@ -2879,14 +2706,17 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-bt.exp +# 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. ++# along with this program. If not, see . + +set testfile "inline-bt" +set srcfile ${testfile}.c ++set srcfile2 "inline-markers.c" ++set fullsrcfile "${srcdir}/${subdir}/${srcfile}" ++set fullsrcfile2 "${srcdir}/${subdir}/${srcfile2}" ++set sources [list ${fullsrcfile} ${fullsrcfile2}] +set binfile ${objdir}/${subdir}/${testfile} + -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ ++if { [gdb_compile ${sources} ${binfile} \ + executable {debug optimize=-O2}] != "" } { + untested inline-bt.exp + return -1 @@ -2906,19 +2736,18 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-bt.exp + return +} + -+set line1 [gdb_get_line_number "set breakpoint 1 here"] -+gdb_breakpoint $line1 ++set line1 [gdb_get_line_number "set breakpoint 1 here" ${fullsrcfile2}] ++gdb_breakpoint $srcfile2:$line1 + +gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (1)" +gdb_test "backtrace" "#0 bar.*#1 .*main.*" "backtrace from bar (1)" -+gdb_test "info frame" ".*inlined into frame.*" "bar inlined" ++gdb_test "info frame" ".*called by frame.*" "bar not inlined" + -+# gcc-4.3.1 omits the line number information for (2). -+#gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (2)" -+#gdb_test "backtrace" "#0 bar.*#1 .*func1.*#2 .*main.*" \ -+# "backtrace from bar (2)" -+#gdb_test "up" "#1 .*func1.*" "up from bar (2)" -+#gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (2)" ++gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (2)" ++gdb_test "backtrace" "#0 bar.*#1 .*func1.*#2 .*main.*" \ ++ "backtrace from bar (2)" ++gdb_test "up" "#1 .*func1.*" "up from bar (2)" ++gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (2)" + +gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (3)" +gdb_test "backtrace" "#0 bar.*#1 .*func1.*#2 .*func2.*#3 .*main.*" \ @@ -2927,16 +2756,16 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-bt.exp +gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (3)" +gdb_test "up" "#2 .*func2.*" "up from func1 (3)" +gdb_test "info frame" ".*inlined into frame.*" "func2 inlined (3)" -Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-cmds.c +Index: gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/inline-cmds.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8/gdb/testsuite/gdb.opt/inline-cmds.c 2008-07-14 10:29:07.000000000 +0200 -@@ -0,0 +1,107 @@ -+/* Copyright (C) 2007 Free Software Foundation, Inc. ++++ gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/inline-cmds.c 2008-12-10 01:28:37.000000000 +0100 +@@ -0,0 +1,85 @@ ++/* Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or ++ 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, @@ -2945,27 +2774,14 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-cmds.c + 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. */ ++ along with this program. If not, see . */ + -+/* VOLATILE forces all the inlining to happen as otherwise the whole program -+ gets optimized by CSE to just simple assignments of the results. */ -+volatile int x, y; ++int x, y; +volatile int result; + -+void bar(void) -+{ -+ x += y; /* set breakpoint 1 here */ -+} -+ -+#ifdef __GNUC__ -+__attribute__((__noinline__)) -+#endif -+void marker(void) -+{ -+ x += y; /* set breakpoint 2 here */ -+} ++void bar(void); ++void marker(void); ++void noinline(void); + +inline int func1(void) +{ @@ -2983,15 +2799,6 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-cmds.c + bar (); +} + -+#ifdef __GNUC__ -+__attribute__((__noinline__)) -+#endif -+void noinline(void) -+{ -+ bar (); /* inlined */ -+} -+ -+ +inline void outer_inline1(void) +{ + noinline (); @@ -3039,16 +2846,16 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-cmds.c + + return 0; +} -Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-cmds.exp +Index: gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/inline-cmds.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8/gdb/testsuite/gdb.opt/inline-cmds.exp 2008-07-14 10:29:07.000000000 +0200 -@@ -0,0 +1,261 @@ -+# Copyright 2007 Free Software Foundation, Inc. ++++ gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/inline-cmds.exp 2008-12-10 01:28:37.000000000 +0100 +@@ -0,0 +1,279 @@ ++# Copyright 2008 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or ++# 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, @@ -3057,14 +2864,17 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-cmds.exp +# 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. ++# along with this program. If not, see . + +set testfile "inline-cmds" -+set srcfile ${testfile}.c ++set srcfile "${testfile}.c" ++set srcfile2 "inline-markers.c" ++set fullsrcfile "${srcdir}/${subdir}/${srcfile}" ++set fullsrcfile2 "${srcdir}/${subdir}/${srcfile2}" ++set sources [list ${fullsrcfile} ${fullsrcfile2}] +set binfile ${objdir}/${subdir}/${testfile} + -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ ++if { [gdb_compile $sources ${binfile} \ + executable {debug optimize=-O2}] != "" } { + untested inline-cmds.exp + return -1 @@ -3082,16 +2892,16 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-cmds.exp +get_compiler_info $binfile +get_debug_format +if { [skip_inline_frame_tests] } { -+ untested inline-bt.exp ++ untested inline-cmds.exp + return +} + +# First, check that the things we expected to be inlined really were, +# and those that shouldn't be weren't. -+set line1 [gdb_get_line_number "set breakpoint 1 here"] -+gdb_breakpoint $line1 -+set line2 [gdb_get_line_number "set breakpoint 2 here"] -+gdb_breakpoint $line2 ++set line1 [gdb_get_line_number "set breakpoint 1 here" ${fullsrcfile2}] ++gdb_breakpoint $srcfile2:$line1 ++set line2 [gdb_get_line_number "set breakpoint 2 here" ${fullsrcfile2}] ++gdb_breakpoint $srcfile2:$line2 + +gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (1)" +gdb_test "backtrace" "#0 bar.*#1 .*func1.*#2 .*main.*" \ @@ -3109,7 +2919,7 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-cmds.exp + +gdb_test "continue" ".*set breakpoint 2 here.*" "continue to marker" +gdb_test "backtrace" "#0 marker.*#1 .*main.*" "backtrace from marker" -+gdb_test "info frame" ".*\n called by frame.*" "marker not inlined" ++gdb_test "info frame" ".*called by frame.*" "marker not inlined" + +# Next, check that we can next over inlined functions. We should not end up +# inside any of them. @@ -3282,6 +3092,7 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-cmds.exp +gdb_test "step" "bar \\\(\\\);" "step into func1 for finish" +gdb_test "finish" "func3 \\\(\\\);" "finish from func1 to func3" + ++# Test a deeper call stack. +set line6 [gdb_get_line_number "set breakpoint 6 here"] +gdb_breakpoint $line6 +gdb_continue_to_breakpoint "before the outer_inline call" @@ -3291,12 +3102,26 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-cmds.exp +gdb_test "step" "outer_inline2 \\\(\\\) at .*" "enter outer_inline2" +gdb_test "bt" "#0 outer_inline2.*#1 main.*" "backtrace at outer_inline2" +gdb_test "step" "outer_inline1 \\\(\\\) at .*" "enter outer_inline1 from outer_inline2" -+gdb_test "bt" "#0 outer_inline1.*#1 outer_inline2.*#2 main.*" "backtrace at outer_inline1" ++ ++set msg "backtrace at outer_inline1" ++gdb_test_multiple "bt" $msg { ++ -re "#0 outer_inline1.*#1 outer_inline2.*#2 main.*$gdb_prompt $" { ++ pass $msg ++ } ++ -re "#0 $hex in outer_inline1.*#1 outer_inline2.*#2 main.*$gdb_prompt $" { ++ # Binutils PR gas/6717. Gas moves .loc past .p2align and the ++ # leading nop of the inlined call appears to be on the same line ++ # as main's call to marker. ++ xfail $msg ++ gdb_test "step" "noinline \\\(\\\);" "step to call of noinline" ++ } ++} ++ +gdb_test "step" "noinline \\\(\\\) at .*" "enter noinline from outer_inline1" +gdb_test "bt" "#0 noinline.*#1 .*outer_inline1.*#2 .*outer_inline2.*#3 main.*" "backtrace at noinline from outer_inline1" -+gdb_test "step" "bar \\\(\\\) at .*" "enter bar from noinline" -+gdb_test "bt" "#0 bar.*#1 noinline.*#2 .*outer_inline1.*#3 .*outer_inline2.*#4 main.*" "backtrace at bar from noinline" -+gdb_test "info frame" ".*inlined into frame.*" "bar from noinline inlined" ++gdb_test "step" "inlined_fn \\\(\\\) at .*" "enter inlined_fn from noinline" ++gdb_test "bt" "#0 inlined_fn.*#1 noinline.*#2 .*outer_inline1.*#3 .*outer_inline2.*#4 main.*" "backtrace at inlined_fn from noinline" ++gdb_test "info frame" ".*inlined into frame.*" "inlined_fn from noinline inlined" +gdb_test "up" "#1 noinline.*" "up to noinline" +gdb_test "info frame" ".*\n called by frame.*" "noinline from outer_inline1 not inlined" +gdb_test "up" "#2 .*outer_inline1.*" "up to outer_inline1" @@ -3305,16 +3130,16 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-cmds.exp +gdb_test "info frame" ".*inlined into frame.*" "outer_inline2 inlined" +gdb_test "up" "#4 main.*" "up from outer_inline2" +gdb_test "info frame" ".*\n caller of frame.*" "main not inlined" -Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-locals.c +Index: gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/inline-locals.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8/gdb/testsuite/gdb.opt/inline-locals.c 2008-07-14 10:29:07.000000000 +0200 -@@ -0,0 +1,59 @@ -+/* Copyright (C) 2007 Free Software Foundation, Inc. ++++ gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/inline-locals.c 2008-12-10 01:28:37.000000000 +0100 +@@ -0,0 +1,52 @@ ++/* Copyright (C) 2008 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or ++ 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, @@ -3323,20 +3148,13 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-locals.c + 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. */ ++ along with this program. If not, see . */ + -+/* VOLATILE forces all the inlining to happen as otherwise the whole program -+ gets optimized by CSE to just simple assignments of the results. */ -+volatile int x, y; ++int x, y; +volatile int result; +volatile int *array_p; + -+void bar(void) -+{ -+ x += y; /* set breakpoint 1 here */ -+} ++void bar(void); + +inline int func1(int arg1) +{ @@ -3369,16 +3187,16 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-locals.c + + return 0; +} -Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-locals.exp +Index: gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/inline-locals.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-6.8/gdb/testsuite/gdb.opt/inline-locals.exp 2008-07-14 10:29:07.000000000 +0200 -@@ -0,0 +1,95 @@ -+# Copyright 2007 Free Software Foundation, Inc. ++++ gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/inline-locals.exp 2008-12-10 01:28:37.000000000 +0100 +@@ -0,0 +1,118 @@ ++# Copyright 2008 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 2 of the License, or ++# 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, @@ -3387,14 +3205,17 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-locals.exp +# 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. ++# along with this program. If not, see . + +set testfile "inline-locals" +set srcfile ${testfile}.c ++set srcfile2 "inline-markers.c" ++set fullsrcfile "${srcdir}/${subdir}/${srcfile}" ++set fullsrcfile2 "${srcdir}/${subdir}/${srcfile2}" ++set sources [list ${fullsrcfile} ${fullsrcfile2}] +set binfile ${objdir}/${subdir}/${testfile} + -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" \ ++if { [gdb_compile ${sources} ${binfile} \ + executable {debug optimize=-O2}] != "" } { + untested inline-locals.exp + return -1 @@ -3416,8 +3237,8 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-locals.exp + +set no_frames [skip_inline_frame_tests] + -+set line1 [gdb_get_line_number "set breakpoint 1 here"] -+gdb_breakpoint $line1 ++set line1 [gdb_get_line_number "set breakpoint 1 here" ${fullsrcfile2}] ++gdb_breakpoint $srcfile2:$line1 + +gdb_test "continue" ".*set breakpoint 1 here.*" "continue to bar (1)" + @@ -3429,7 +3250,20 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-locals.exp + gdb_test "up" "#1 .*func1 .* at .*" "up from bar (2)" + gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (2)" + gdb_test "info locals" "array = {.*}" "info locals above bar (2)" -+ gdb_test "info args" "arg1 = .*" "info args above bar (2)" ++ ++ set msg "info args above bar (2)" ++ gdb_test_multiple "info args" $msg { ++ -re "arg1 = $decimal\r\n$gdb_prompt $" { ++ pass $msg ++ } ++ -re "arg1 = \r\n$gdb_prompt $" { ++ # GCC 4.3 loses location information for arg1. GCC 4.2 is OK. ++ if { [test_compiler_info "gcc-4-3-*"] } { ++ setup_xfail *-*-* ++ } ++ fail $msg ++ } ++ } +} else { + gdb_test "up" "#1 .*main .* at .*" "up from bar (2)" + gdb_test "info locals" ".*arg1 = 0.*" "info locals above bar (2)" @@ -3437,9 +3271,6 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-locals.exp + +# Make sure that locals on the stack are found. This is an array to +# prevent it from living in a register. -+if [test_compiler_info "gcc-4-3-*"] { -+ setup_kfail *-*-* "gcc/debug.optimization" -+} +gdb_test "print array\[0\]" "\\\$$decimal = 0" "print local (2)" + +if { ! $no_frames } { @@ -3458,22 +3289,73 @@ Index: gdb-6.8/gdb/testsuite/gdb.opt/inline-locals.exp + gdb_test "up" "#1 .*func1 .* at .*" "up from bar (3)" + gdb_test "info frame" ".*inlined into frame.*" "func1 inlined (3)" + gdb_test "info locals" "array = {.*}" "info locals above bar (3)" -+ gdb_test "info args" "arg1 = .*" "info args above bar (3)" ++ ++ set msg "info args above bar (3)" ++ gdb_test_multiple "info args" $msg { ++ -re "arg1 = $decimal\r\n$gdb_prompt $" { ++ pass $msg ++ } ++ -re "arg1 = \r\n$gdb_prompt $" { ++ # GCC 4.3 loses location information for arg1. GCC 4.2 is OK. ++ if { [test_compiler_info "gcc-4-3-*"] } { ++ setup_xfail *-*-* ++ } ++ fail $msg ++ } ++ } +} else { + gdb_test "up" "#1 .*main .* at .*" "up from bar (3)" + gdb_test "info locals" ".*arg1 = 1.*" "info locals above bar (3a)" + gdb_test "info locals" ".*arg2 = 184.*" "info locals above bar (3b)" +} + -+if [test_compiler_info "gcc-4-3-*"] { -+ setup_kfail *-*-* "gcc/debug.optimization" -+} +gdb_test "print array\[0\]" "\\\$$decimal = 184" "print local (3)" -Index: gdb-6.8/gdb/testsuite/lib/gdb.exp +Index: gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/inline-markers.c =================================================================== ---- gdb-6.8.orig/gdb/testsuite/lib/gdb.exp 2008-07-14 10:28:15.000000000 +0200 -+++ gdb-6.8/gdb/testsuite/lib/gdb.exp 2008-07-14 10:29:07.000000000 +0200 -@@ -1357,6 +1357,37 @@ proc skip_hp_tests {} { +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/inline-markers.c 2008-12-10 01:28:37.000000000 +0100 +@@ -0,0 +1,36 @@ ++/* Copyright (C) 2008 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . */ ++ ++extern int x, y; ++ ++void bar(void) ++{ ++ x += y; /* set breakpoint 1 here */ ++} ++ ++void marker(void) ++{ ++ x += y; /* set breakpoint 2 here */ ++} ++ ++inline void inlined_fn(void) ++{ ++ x += y; ++} ++ ++void noinline(void) ++{ ++ inlined_fn (); /* inlined */ ++} +Index: gdb-6.8.50.20081209/gdb/testsuite/lib/gdb.exp +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/testsuite/lib/gdb.exp 2008-12-10 01:28:27.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/testsuite/lib/gdb.exp 2008-12-10 01:28:37.000000000 +0100 +@@ -1471,6 +1471,37 @@ proc skip_hp_tests {} { return $skip_hp } @@ -3489,7 +3371,7 @@ Index: gdb-6.8/gdb/testsuite/lib/gdb.exp + # GCC before 4.1 does not emit DW_AT_call_file / DW_AT_call_line. + if { ([test_compiler_info "gcc-2-*"] + || [test_compiler_info "gcc-3-*"] -+ || [test_compiler_info "gcc-4-0"]) } { ++ || [test_compiler_info "gcc-4-0-*"]) } { + return 1 + } + @@ -3511,46 +3393,11 @@ Index: gdb-6.8/gdb/testsuite/lib/gdb.exp set compiler_info "unknown" set gcc_compiled 0 set hp_cc_compiler 0 -Index: gdb-6.8/gdb/thread.c +Index: gdb-6.8.50.20081209/gdb/valops.c =================================================================== ---- gdb-6.8.orig/gdb/thread.c 2008-07-14 10:24:32.000000000 +0200 -+++ gdb-6.8/gdb/thread.c 2008-07-14 10:29:07.000000000 +0200 -@@ -582,7 +582,7 @@ thread_apply_all_command (char *cmd, int - do_cleanups (old_chain); - /* Print stack frame only if we changed thread. */ - if (thread_has_changed) -- print_stack_frame (get_current_frame (), 1, SRC_LINE); -+ print_stack_frame (get_selected_frame (NULL), 1, SRC_LINE); - - } - -@@ -667,7 +667,7 @@ thread_apply_command (char *tidlist, int - do_cleanups (old_chain); - /* Print stack frame only if we changed thread. */ - if (thread_has_changed) -- print_stack_frame (get_current_frame (), 1, SRC_LINE); -+ print_stack_frame (get_selected_frame (NULL), 1, SRC_LINE); - } - - /* Switch to the specified thread. Will dispatch off to thread_apply_command -Index: gdb-6.8/gdb/tracepoint.c -=================================================================== ---- gdb-6.8.orig/gdb/tracepoint.c 2008-02-05 17:05:56.000000000 +0100 -+++ gdb-6.8/gdb/tracepoint.c 2008-07-14 10:29:07.000000000 +0200 -@@ -2165,7 +2165,7 @@ trace_find_line_command (char *args, int - { - if (args == 0 || *args == 0) - { -- sal = find_pc_line (get_frame_pc (get_current_frame ()), 0); -+ sal = find_pc_line (get_frame_pc (get_selected_frame (NULL)), 0); - sals.nelts = 1; - sals.sals = (struct symtab_and_line *) - xmalloc (sizeof (struct symtab_and_line)); -Index: gdb-6.8/gdb/valops.c -=================================================================== ---- gdb-6.8.orig/gdb/valops.c 2008-07-14 10:28:30.000000000 +0200 -+++ gdb-6.8/gdb/valops.c 2008-07-14 10:29:07.000000000 +0200 -@@ -845,7 +845,7 @@ value_of_variable (struct symbol *var, s +--- gdb-6.8.50.20081209.orig/gdb/valops.c 2008-12-10 01:25:43.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/valops.c 2008-12-10 01:28:37.000000000 +0100 +@@ -1051,7 +1051,7 @@ value_of_variable (struct symbol *var, s frame = block_innermost_frame (b); if (!frame) { @@ -3559,3 +3406,36 @@ Index: gdb-6.8/gdb/valops.c && SYMBOL_PRINT_NAME (BLOCK_FUNCTION (b))) error (_("No frame is currently executing in block %s."), SYMBOL_PRINT_NAME (BLOCK_FUNCTION (b))); +Index: gdb-6.8.50.20081209/gdb/Makefile.in +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/Makefile.in 2008-12-10 01:28:27.000000000 +0100 ++++ gdb-6.8.50.20081209/gdb/Makefile.in 2008-12-10 01:28:37.000000000 +0100 +@@ -630,6 +630,7 @@ SFILES = ada-exp.y ada-lang.c ada-typepr + inf-loop.c \ + infcall.c \ + infcmd.c inflow.c infrun.c \ ++ inline-frame.c \ + interps.c \ + jv-exp.y jv-lang.c jv-valprint.c jv-typeprint.c \ + language.c linespec.c \ +@@ -800,6 +801,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $ + user-regs.o \ + frame.o frame-unwind.o doublest.o \ + frame-base.o \ ++ inline-frame.o \ + gnu-v2-abi.o gnu-v3-abi.o cp-abi.o cp-support.o \ + cp-namespace.o \ + reggroups.o regset.o \ +Index: gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/Makefile.in +=================================================================== +--- gdb-6.8.50.20081209.orig/gdb/testsuite/gdb.opt/Makefile.in 2008-04-18 01:06:54.000000000 +0200 ++++ gdb-6.8.50.20081209/gdb/testsuite/gdb.opt/Makefile.in 2008-12-10 01:28:37.000000000 +0100 +@@ -1,7 +1,7 @@ + VPATH = @srcdir@ + srcdir = @srcdir@ + +-EXECUTABLES = hello/hello ++EXECUTABLES = clobbered-registers-O2 inline-bt inline-cmds inline-locals + + MISCELLANEOUS = + diff --git a/gdb-6.8-quit-never-aborts.patch b/gdb-6.8-quit-never-aborts.patch index 70d794d..ed22d6b 100644 --- a/gdb-6.8-quit-never-aborts.patch +++ b/gdb-6.8-quit-never-aborts.patch @@ -5,9 +5,11 @@ Some of the threads may not be properly PTRACE_DETACHed which hurts if they should have been detached with SIGSTOP (as they are accidentally left running on the debugger termination). ---- ./gdb/defs.h 26 Jun 2008 15:51:28 -0000 1.227 -+++ ./gdb/defs.h 10 Jul 2008 10:37:32 -0000 -@@ -141,6 +141,7 @@ extern char *gdb_sysroot; +Index: gdb-6.8.50.20081128/gdb/defs.h +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/defs.h 2008-11-27 10:23:01.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/defs.h 2008-12-06 21:49:32.000000000 +0100 +@@ -155,6 +155,7 @@ extern char *gdb_sysroot; extern char *debug_file_directory; extern int quit_flag; @@ -15,18 +17,20 @@ on the debugger termination). extern int immediate_quit; extern int sevenbit_strings; -@@ -159,7 +159,7 @@ extern void quit (void); - #define QUIT_FIXME "ignoring redefinition of QUIT" - #else +@@ -168,7 +169,7 @@ extern void quit (void); + needed. */ + #define QUIT { \ - if (quit_flag) quit (); \ + if (quit_flag && !quit_flag_cleanup) quit (); \ if (deprecated_interactive_hook) deprecated_interactive_hook (); \ } - #endif ---- ./gdb/event-top.c 9 Jul 2008 22:16:14 -0000 1.61 -+++ ./gdb/event-top.c 10 Jul 2008 10:37:33 -0000 -@@ -941,7 +941,7 @@ async_request_quit (gdb_client_data arg) + +Index: gdb-6.8.50.20081128/gdb/event-top.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/event-top.c 2008-12-04 10:34:31.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/event-top.c 2008-12-06 21:49:07.000000000 +0100 +@@ -939,7 +939,7 @@ async_request_quit (gdb_client_data arg) is no reason to call quit again here, unless immediate_quit is set.*/ @@ -35,9 +39,11 @@ on the debugger termination). quit (); } ---- ./gdb/top.c 9 Jul 2008 22:30:46 -0000 1.145 -+++ ./gdb/top.c 10 Jul 2008 10:37:37 -0000 -@@ -1263,7 +1263,9 @@ quit_force (char *args, int from_tty) +Index: gdb-6.8.50.20081128/gdb/top.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/top.c 2008-12-04 10:23:12.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/top.c 2008-12-06 21:49:07.000000000 +0100 +@@ -1299,7 +1299,9 @@ quit_force (char *args, int from_tty) qt.args = args; qt.from_tty = from_tty; @@ -48,9 +54,11 @@ on the debugger termination). catch_errors (quit_target, &qt, "Quitting: ", RETURN_MASK_ALL); ---- ./gdb/utils.c 10 Jun 2008 09:29:15 -0000 1.189 -+++ ./gdb/utils.c 10 Jul 2008 10:37:38 -0000 -@@ -120,6 +120,11 @@ int job_control; +Index: gdb-6.8.50.20081128/gdb/utils.c +=================================================================== +--- gdb-6.8.50.20081128.orig/gdb/utils.c 2008-12-04 10:31:00.000000000 +0100 ++++ gdb-6.8.50.20081128/gdb/utils.c 2008-12-06 21:49:07.000000000 +0100 +@@ -114,6 +114,11 @@ int job_control; int quit_flag; diff --git a/gdb-6.8-sparc-fix.patch b/gdb-6.8-sparc-fix.patch deleted file mode 100644 index ed6ec0e..0000000 --- a/gdb-6.8-sparc-fix.patch +++ /dev/null @@ -1,97 +0,0 @@ -diff -up gdb-6.8/gdb/sparc64-linux-tdep.c.sparc gdb-6.8/gdb/sparc64-linux-tdep.c ---- gdb-6.8/gdb/sparc64-linux-tdep.c.sparc 2008-01-01 16:53:13.000000000 -0600 -+++ gdb-6.8/gdb/sparc64-linux-tdep.c 2008-05-15 14:08:57.000000000 -0500 -@@ -174,6 +174,30 @@ sparc64_linux_collect_core_fpregset (con - sparc64_collect_fpregset (regcache, regnum, fpregs); - } - -+/* Set the program counter for process PTID to PC. */ -+ -+static void -+sparc64_linux_write_pc (struct regcache *regcache, CORE_ADDR pc) -+{ -+ struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache)); -+ ULONGEST state; -+ -+ regcache_cooked_write_unsigned (regcache, tdep->pc_regnum, pc); -+ regcache_cooked_write_unsigned (regcache, tdep->npc_regnum, pc + 4); -+ -+ /* Clear the "in syscall" bit to prevent the kernel from -+ messing with the PCs we just installed, if we happen to be -+ within an interrupted system call that the kernel wants to -+ restart. -+ -+ Note that after we return from the dummy call, the TSTATE et al. -+ registers will be automatically restored, and the kernel -+ continues to restart the system call at this point. */ -+ regcache_cooked_read_unsigned (regcache, SPARC64_STATE_REGNUM, &state); -+ state &= ~((ULONGEST)0x20); -+ regcache_cooked_write_unsigned (regcache, SPARC64_STATE_REGNUM, state); -+} -+ - - - static void -@@ -211,6 +235,8 @@ sparc64_linux_init_abi (struct gdbarch_i - - /* Make sure we can single-step over signal return system calls. */ - tdep->step_trap = sparc64_linux_step_trap; -+ -+ set_gdbarch_write_pc (gdbarch, sparc64_linux_write_pc); - } - - -diff -up gdb-6.8/gdb/sparc-linux-tdep.c.sparc gdb-6.8/gdb/sparc-linux-tdep.c ---- gdb-6.8/gdb/sparc-linux-tdep.c.sparc 2008-01-01 16:53:13.000000000 -0600 -+++ gdb-6.8/gdb/sparc-linux-tdep.c 2008-05-15 14:08:12.000000000 -0500 -@@ -211,6 +211,30 @@ sparc32_linux_collect_core_fpregset (con - sparc32_collect_fpregset (regcache, regnum, fpregs); - } - -+/* Set the program counter for process PTID to PC. */ -+ -+static void -+sparc_linux_write_pc (struct regcache *regcache, CORE_ADDR pc) -+{ -+ struct gdbarch_tdep *tdep = gdbarch_tdep (get_regcache_arch (regcache)); -+ ULONGEST psr; -+ -+ regcache_cooked_write_unsigned (regcache, tdep->pc_regnum, pc); -+ regcache_cooked_write_unsigned (regcache, tdep->npc_regnum, pc + 4); -+ -+ /* Clear the "in syscall" bit to prevent the kernel from -+ messing with the PCs we just installed, if we happen to be -+ within an interrupted system call that the kernel wants to -+ restart. -+ -+ Note that after we return from the dummy call, the PSR et al. -+ registers will be automatically restored, and the kernel -+ continues to restart the system call at this point. */ -+ regcache_cooked_read_unsigned (regcache, SPARC32_PSR_REGNUM, &psr); -+ psr &= ~0x000004000; -+ regcache_cooked_write_unsigned (regcache, SPARC32_PSR_REGNUM, psr); -+} -+ - - - static void -@@ -238,10 +262,6 @@ sparc32_linux_init_abi (struct gdbarch_i - prologue analysis. */ - tdep->plt_entry_size = 12; - -- /* GNU/Linux doesn't support the 128-bit `long double' from the psABI. */ -- set_gdbarch_long_double_bit (gdbarch, 64); -- set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double); -- - /* Enable TLS support. */ - set_gdbarch_fetch_tls_load_module_address (gdbarch, - svr4_fetch_objfile_link_map); -@@ -251,6 +271,8 @@ sparc32_linux_init_abi (struct gdbarch_i - - /* Hook in the DWARF CFI frame unwinder. */ - frame_unwind_append_sniffer (gdbarch, dwarf2_frame_sniffer); -+ -+ set_gdbarch_write_pc (gdbarch, sparc_linux_write_pc); - } - - /* Provide a prototype to silence -Wmissing-prototypes. */ diff --git a/gdb-6.8-upstream.patch b/gdb-6.8-upstream.patch deleted file mode 100644 index e58054b..0000000 --- a/gdb-6.8-upstream.patch +++ /dev/null @@ -1,2843 +0,0 @@ -2008-03-30 Daniel Jacobowitz - - * ia64-tdep.c (examine_prologue): Correct array access. - -=================================================================== -RCS file: /cvs/src/src/gdb/ia64-tdep.c,v -retrieving revision 1.172 -retrieving revision 1.173 -diff -u -r1.172 -r1.173 ---- src/gdb/ia64-tdep.c 2008/02/20 14:31:40 1.172 -+++ src/gdb/ia64-tdep.c 2008/03/31 03:38:48 1.173 -@@ -1234,7 +1234,7 @@ - spill_reg = rN; - last_prologue_pc = next_pc; - } -- else if (qp == 0 && rM >= 32 && rM < 40 && !instores[rM] && -+ else if (qp == 0 && rM >= 32 && rM < 40 && !instores[rM-32] && - rN < 256 && imm == 0) - { - /* mov rN, rM where rM is an input register */ - - - -https://bugzilla.redhat.com/show_bug.cgi?id=442765 - -http://sourceware.org/ml/gdb-patches/2008-03/msg00281.html -http://sourceware.org/ml/gdb-cvs/2008-03/msg00114.html - -2008-03-21 Daniel Jacobowitz - - * gdbthread.h (add_thread_with_info): New. - * linux-thread-db.c: Add some documentation. - (GET_LWP, GET_PID, GET_THREAD, is_lwp, is_thread, BUILD_LWP): Delete. - (struct private_thread_info): Remove th_valid and ti_valid. - Replace ti with tid. - (thread_get_info_callback): Do not add TID to the new ptid. Do - not cache th or ti. - (thread_db_map_id2thr, lwp_from_thread): Delete functions. - (thread_from_lwp): Assert that the LWP is set. Do not add TID to the - new PTID. - (attach_thread): Handle an already-existing thread. Use - add_thread_with_info. Cache the th and tid. - (detach_thread): Verify that private was set. Remove verbose - argument and printing. Update caller. - (thread_db_detach): Do not adjust inferior_ptid. - (clear_lwpid_callback, thread_db_resume, thread_db_kill): Delete. - (check_event, find_new_threads_callback): Do not add TID to the new PTID. - (thread_db_wait): Do not use lwp_from_thread. - (thread_db_pid_to_str): Use the cached TID. - (thread_db_extra_thread_info): Check that private is set. - (same_ptid_callback): Delete. - (thread_db_get_thread_local_address): Do not use it or check - is_thread. Check that private is set. Assume that the thread - handle is already cached. - (init_thread_db_ops): Remove to_resume and to_kill. - * thread.c (add_thread_with_info): New. - (add_thread): Use it. - * linux-nat.c (find_thread_from_lwp): Delete. - (exit_lwp): Do not use it. Check print_thread_events. Print before - deleting the thread. - (GET_PID, GET_LWP, BUILD_LWP, is_lwp): Move to... - * linux-nat.h (GET_PID, GET_LWP, BUILD_LWP, is_lwp): ...here. - * inf-ttrace.c (inf_ttrace_wait): Use print_thread_events and - printf_unfiltered for thread exits. - * procfs.c (procfs_wait): Likewise. - -2008-03-21 Pedro Alves - - * gdb.threads/fork-child-threads.exp: Test next over fork. - -=================================================================== -RCS file: /cvs/src/src/gdb/gdbthread.h,v -retrieving revision 1.20 -retrieving revision 1.21 -diff -u -r1.20 -r1.21 ---- src/gdb/gdbthread.h 2008/03/15 13:53:25 1.20 -+++ src/gdb/gdbthread.h 2008/03/21 15:44:53 1.21 -@@ -81,6 +81,10 @@ - about new thread. */ - extern struct thread_info *add_thread_silent (ptid_t ptid); - -+/* Same as add_thread, and sets the private info. */ -+extern struct thread_info *add_thread_with_info (ptid_t ptid, -+ struct private_thread_info *); -+ - /* Delete an existing thread list entry. */ - extern void delete_thread (ptid_t); - -=================================================================== -RCS file: /cvs/src/src/gdb/inf-ttrace.c,v -retrieving revision 1.27 -retrieving revision 1.28 -diff -u -r1.27 -r1.28 ---- src/gdb/inf-ttrace.c 2008/01/29 21:11:24 1.27 -+++ src/gdb/inf-ttrace.c 2008/03/21 15:44:53 1.28 -@@ -964,7 +964,8 @@ - break; - - case TTEVT_LWP_EXIT: -- printf_filtered(_("[%s exited]\n"), target_pid_to_str (ptid)); -+ if (print_thread_events) -+ printf_unfiltered (_("[%s exited]\n"), target_pid_to_str (ptid)); - ti = find_thread_pid (ptid); - gdb_assert (ti != NULL); - ((struct inf_ttrace_private_thread_info *)ti->private)->dying = 1; -=================================================================== -RCS file: /cvs/src/src/gdb/linux-nat.c,v -retrieving revision 1.76 -retrieving revision 1.77 -diff -u -r1.76 -r1.77 ---- src/gdb/linux-nat.c 2008/03/17 14:54:07 1.76 -+++ src/gdb/linux-nat.c 2008/03/21 15:44:53 1.77 -@@ -588,11 +588,6 @@ - static int num_lwps; - - --#define GET_LWP(ptid) ptid_get_lwp (ptid) --#define GET_PID(ptid) ptid_get_pid (ptid) --#define is_lwp(ptid) (GET_LWP (ptid) != 0) --#define BUILD_LWP(lwp, pid) ptid_build (pid, lwp, 0) -- - /* If the last reported event was a SIGTRAP, this variable is set to - the process id of the LWP/thread that got it. */ - ptid_t trap_ptid; -@@ -813,20 +808,6 @@ - p = &(*p)->next; - } - --/* Callback for iterate_over_threads that finds a thread corresponding -- to the given LWP. */ -- --static int --find_thread_from_lwp (struct thread_info *thr, void *dummy) --{ -- ptid_t *ptid_p = dummy; -- -- if (GET_LWP (thr->ptid) && GET_LWP (thr->ptid) == GET_LWP (*ptid_p)) -- return 1; -- else -- return 0; --} -- - /* Handle the exit of a single thread LP. */ - - static void -@@ -834,32 +815,14 @@ - { - if (in_thread_list (lp->ptid)) - { -+ if (print_thread_events) -+ printf_unfiltered (_("[%s exited]\n"), target_pid_to_str (lp->ptid)); -+ - /* Core GDB cannot deal with us deleting the current thread. */ - if (!ptid_equal (lp->ptid, inferior_ptid)) - delete_thread (lp->ptid); - else - record_dead_thread (lp->ptid); -- printf_unfiltered (_("[%s exited]\n"), -- target_pid_to_str (lp->ptid)); -- } -- else -- { -- /* Even if LP->PTID is not in the global GDB thread list, the -- LWP may be - with an additional thread ID. We don't need -- to print anything in this case; thread_db is in use and -- already took care of that. But it didn't delete the thread -- in order to handle zombies correctly. */ -- -- struct thread_info *thr; -- -- thr = iterate_over_threads (find_thread_from_lwp, &lp->ptid); -- if (thr) -- { -- if (!ptid_equal (thr->ptid, inferior_ptid)) -- delete_thread (thr->ptid); -- else -- record_dead_thread (thr->ptid); -- } - } - - delete_lwp (lp->ptid); -=================================================================== -RCS file: /cvs/src/src/gdb/linux-nat.h,v -retrieving revision 1.22 -retrieving revision 1.23 -diff -u -r1.22 -r1.23 ---- src/gdb/linux-nat.h 2008/01/23 11:26:28 1.22 -+++ src/gdb/linux-nat.h 2008/03/21 15:44:53 1.23 -@@ -83,6 +83,11 @@ - (LP) != NULL; \ - (LP) = (LP)->next, (PTID) = (LP) ? (LP)->ptid : (PTID)) - -+#define GET_LWP(ptid) ptid_get_lwp (ptid) -+#define GET_PID(ptid) ptid_get_pid (ptid) -+#define is_lwp(ptid) (GET_LWP (ptid) != 0) -+#define BUILD_LWP(lwp, pid) ptid_build (pid, lwp, 0) -+ - /* Attempt to initialize libthread_db. */ - void check_for_thread_db (void); - -=================================================================== -RCS file: /cvs/src/src/gdb/linux-thread-db.c,v -retrieving revision 1.37 -retrieving revision 1.38 -diff -u -r1.37 -r1.38 ---- src/gdb/linux-thread-db.c 2008/01/23 11:26:28 1.37 -+++ src/gdb/linux-thread-db.c 2008/03/21 15:44:53 1.38 -@@ -48,6 +48,32 @@ - #define LIBTHREAD_DB_SO "libthread_db.so.1" - #endif - -+/* GNU/Linux libthread_db support. -+ -+ libthread_db is a library, provided along with libpthread.so, which -+ exposes the internals of the thread library to a debugger. It -+ allows GDB to find existing threads, new threads as they are -+ created, thread IDs (usually, the result of pthread_self), and -+ thread-local variables. -+ -+ The libthread_db interface originates on Solaris, where it is -+ both more powerful and more complicated. This implementation -+ only works for LinuxThreads and NPTL, the two glibc threading -+ libraries. It assumes that each thread is permanently assigned -+ to a single light-weight process (LWP). -+ -+ libthread_db-specific information is stored in the "private" field -+ of struct thread_info. When the field is NULL we do not yet have -+ information about the new thread; this could be temporary (created, -+ but the thread library's data structures do not reflect it yet) -+ or permanent (created using clone instead of pthread_create). -+ -+ Process IDs managed by linux-thread-db.c match those used by -+ linux-nat.c: a common PID for all processes, an LWP ID for each -+ thread, and no TID. We save the TID in private. Keeping it out -+ of the ptid_t prevents thread IDs changing when libpthread is -+ loaded or unloaded. */ -+ - /* If we're running on GNU/Linux, we must explicitly attach to any new - threads. */ - -@@ -119,19 +145,7 @@ - static void thread_db_find_new_threads (void); - static void attach_thread (ptid_t ptid, const td_thrhandle_t *th_p, - const td_thrinfo_t *ti_p); --static void detach_thread (ptid_t ptid, int verbose); -- -- --/* Building process ids. */ -- --#define GET_PID(ptid) ptid_get_pid (ptid) --#define GET_LWP(ptid) ptid_get_lwp (ptid) --#define GET_THREAD(ptid) ptid_get_tid (ptid) -- --#define is_lwp(ptid) (GET_LWP (ptid) != 0) --#define is_thread(ptid) (GET_THREAD (ptid) != 0) -- --#define BUILD_LWP(lwp, pid) ptid_build (pid, lwp, 0) -+static void detach_thread (ptid_t ptid); - - - /* Use "struct private_thread_info" to cache thread state. This is -@@ -143,11 +157,8 @@ - unsigned int dying:1; - - /* Cached thread state. */ -- unsigned int th_valid:1; -- unsigned int ti_valid:1; -- - td_thrhandle_t th; -- td_thrinfo_t ti; -+ thread_t tid; - }; - - -@@ -257,7 +268,7 @@ - thread_db_err_str (err)); - - /* Fill the cache. */ -- thread_ptid = ptid_build (GET_PID (inferior_ptid), ti.ti_lid, ti.ti_tid); -+ thread_ptid = ptid_build (GET_PID (inferior_ptid), ti.ti_lid, 0); - thread_info = find_thread_pid (thread_ptid); - - /* In the case of a zombie thread, don't continue. We don't want to -@@ -266,13 +277,6 @@ - { - if (infop != NULL) - *(struct thread_info **) infop = thread_info; -- if (thread_info != NULL) -- { -- memcpy (&thread_info->private->th, thp, sizeof (*thp)); -- thread_info->private->th_valid = 1; -- memcpy (&thread_info->private->ti, &ti, sizeof (ti)); -- thread_info->private->ti_valid = 1; -- } - return TD_THR_ZOMBIE; - } - -@@ -284,39 +288,11 @@ - gdb_assert (thread_info != NULL); - } - -- memcpy (&thread_info->private->th, thp, sizeof (*thp)); -- thread_info->private->th_valid = 1; -- memcpy (&thread_info->private->ti, &ti, sizeof (ti)); -- thread_info->private->ti_valid = 1; -- - if (infop != NULL) - *(struct thread_info **) infop = thread_info; - - return 0; - } -- --/* Accessor functions for the thread_db information, with caching. */ -- --static void --thread_db_map_id2thr (struct thread_info *thread_info, int fatal) --{ -- td_err_e err; -- -- if (thread_info->private->th_valid) -- return; -- -- err = td_ta_map_id2thr_p (thread_agent, GET_THREAD (thread_info->ptid), -- &thread_info->private->th); -- if (err != TD_OK) -- { -- if (fatal) -- error (_("Cannot find thread %ld: %s"), -- (long) GET_THREAD (thread_info->ptid), -- thread_db_err_str (err)); -- } -- else -- thread_info->private->th_valid = 1; --} - - /* Convert between user-level thread ids and LWP ids. */ - -@@ -328,10 +304,9 @@ - struct thread_info *thread_info; - ptid_t thread_ptid; - -- if (GET_LWP (ptid) == 0) -- ptid = BUILD_LWP (GET_PID (ptid), GET_PID (ptid)); -- -- gdb_assert (is_lwp (ptid)); -+ /* This ptid comes from linux-nat.c, which should always fill in the -+ LWP. */ -+ gdb_assert (GET_LWP (ptid) != 0); - - err = td_ta_map_lwp2thr_p (thread_agent, GET_LWP (ptid), &th); - if (err != TD_OK) -@@ -352,16 +327,8 @@ - && thread_info == NULL) - return pid_to_ptid (-1); - -- gdb_assert (thread_info && thread_info->private->ti_valid); -- -- return ptid_build (GET_PID (ptid), GET_LWP (ptid), -- thread_info->private->ti.ti_tid); --} -- --static ptid_t --lwp_from_thread (ptid_t ptid) --{ -- return BUILD_LWP (GET_LWP (ptid), GET_PID (ptid)); -+ gdb_assert (ptid_get_tid (ptid) == 0); -+ return ptid; - } - - -@@ -672,7 +639,8 @@ - attach_thread (ptid_t ptid, const td_thrhandle_t *th_p, - const td_thrinfo_t *ti_p) - { -- struct thread_info *tp; -+ struct private_thread_info *private; -+ struct thread_info *tp = NULL; - td_err_e err; - - /* If we're being called after a TD_CREATE event, we may already -@@ -690,10 +658,21 @@ - tp = find_thread_pid (ptid); - gdb_assert (tp != NULL); - -- if (!tp->private->dying) -- return; -+ /* If tp->private is NULL, then GDB is already attached to this -+ thread, but we do not know anything about it. We can learn -+ about it here. This can only happen if we have some other -+ way besides libthread_db to notice new threads (i.e. -+ PTRACE_EVENT_CLONE); assume the same mechanism notices thread -+ exit, so this can not be a stale thread recreated with the -+ same ID. */ -+ if (tp->private != NULL) -+ { -+ if (!tp->private->dying) -+ return; - -- delete_thread (ptid); -+ delete_thread (ptid); -+ tp = NULL; -+ } - } - - check_thread_signals (); -@@ -702,13 +681,28 @@ - return; /* A zombie thread -- do not attach. */ - - /* Under GNU/Linux, we have to attach to each and every thread. */ -- if (lin_lwp_attach_lwp (BUILD_LWP (ti_p->ti_lid, GET_PID (ptid))) < 0) -+ if (tp == NULL -+ && lin_lwp_attach_lwp (BUILD_LWP (ti_p->ti_lid, GET_PID (ptid))) < 0) - return; - -+ /* Construct the thread's private data. */ -+ private = xmalloc (sizeof (struct private_thread_info)); -+ memset (private, 0, sizeof (struct private_thread_info)); -+ -+ /* A thread ID of zero may mean the thread library has not initialized -+ yet. But we shouldn't even get here if that's the case. FIXME: -+ if we change GDB to always have at least one thread in the thread -+ list this will have to go somewhere else; maybe private == NULL -+ until the thread_db target claims it. */ -+ gdb_assert (ti_p->ti_tid != 0); -+ private->th = *th_p; -+ private->tid = ti_p->ti_tid; -+ - /* Add the thread to GDB's thread list. */ -- tp = add_thread (ptid); -- tp->private = xmalloc (sizeof (struct private_thread_info)); -- memset (tp->private, 0, sizeof (struct private_thread_info)); -+ if (tp == NULL) -+ tp = add_thread_with_info (ptid, private); -+ else -+ tp->private = private; - - /* Enable thread event reporting for this thread. */ - err = td_thr_event_enable_p (th_p, 1); -@@ -718,22 +712,20 @@ - } - - static void --detach_thread (ptid_t ptid, int verbose) -+detach_thread (ptid_t ptid) - { - struct thread_info *thread_info; - -- if (verbose) -- printf_unfiltered (_("[%s exited]\n"), target_pid_to_str (ptid)); -- - /* Don't delete the thread now, because it still reports as active - until it has executed a few instructions after the event - breakpoint - if we deleted it now, "info threads" would cause us - to re-attach to it. Just mark it as having had a TD_DEATH - event. This means that we won't delete it from our thread list - until we notice that it's dead (via prune_threads), or until -- something re-uses its thread ID. */ -+ something re-uses its thread ID. We'll report the thread exit -+ when the underlying LWP dies. */ - thread_info = find_thread_pid (ptid); -- gdb_assert (thread_info != NULL); -+ gdb_assert (thread_info != NULL && thread_info->private != NULL); - thread_info->private->dying = 1; - } - -@@ -742,47 +734,12 @@ - { - disable_thread_event_reporting (); - -- /* There's no need to save & restore inferior_ptid here, since the -- inferior is not supposed to survive this function call. */ -- inferior_ptid = lwp_from_thread (inferior_ptid); -- - target_beneath->to_detach (args, from_tty); - - /* Should this be done by detach_command? */ - target_mourn_inferior (); - } - --static int --clear_lwpid_callback (struct thread_info *thread, void *dummy) --{ -- /* If we know that our thread implementation is 1-to-1, we could save -- a certain amount of information; it's not clear how much, so we -- are always conservative. */ -- -- thread->private->th_valid = 0; -- thread->private->ti_valid = 0; -- -- return 0; --} -- --static void --thread_db_resume (ptid_t ptid, int step, enum target_signal signo) --{ -- struct cleanup *old_chain = save_inferior_ptid (); -- -- if (GET_PID (ptid) == -1) -- inferior_ptid = lwp_from_thread (inferior_ptid); -- else if (is_thread (ptid)) -- ptid = lwp_from_thread (ptid); -- -- /* Clear cached data which may not be valid after the resume. */ -- iterate_over_threads (clear_lwpid_callback, NULL); -- -- target_beneath->to_resume (ptid, step, signo); -- -- do_cleanups (old_chain); --} -- - /* Check if PID is currently stopped at the location of a thread event - breakpoint location. If it is, read the event message and act upon - the event. */ -@@ -833,7 +790,7 @@ - if (err != TD_OK) - error (_("Cannot get thread info: %s"), thread_db_err_str (err)); - -- ptid = ptid_build (GET_PID (ptid), ti.ti_lid, ti.ti_tid); -+ ptid = ptid_build (GET_PID (ptid), ti.ti_lid, 0); - - switch (msg.event) - { -@@ -849,7 +806,7 @@ - if (!in_thread_list (ptid)) - error (_("Spurious thread death event.")); - -- detach_thread (ptid, print_thread_events); -+ detach_thread (ptid); - - break; - -@@ -865,9 +822,6 @@ - { - extern ptid_t trap_ptid; - -- if (GET_PID (ptid) != -1 && is_thread (ptid)) -- ptid = lwp_from_thread (ptid); -- - ptid = target_beneath->to_wait (ptid, ourstatus); - - if (ourstatus->kind == TARGET_WAITKIND_EXITED -@@ -913,15 +867,6 @@ - } - - static void --thread_db_kill (void) --{ -- /* There's no need to save & restore inferior_ptid here, since the -- inferior isn't supposed to survive this function call. */ -- inferior_ptid = lwp_from_thread (inferior_ptid); -- target_beneath->to_kill (); --} -- --static void - thread_db_mourn_inferior (void) - { - /* Forget about the child's process ID. We shouldn't need it -@@ -954,7 +899,7 @@ - if (ti.ti_state == TD_THR_UNKNOWN || ti.ti_state == TD_THR_ZOMBIE) - return 0; /* A zombie -- ignore. */ - -- ptid = ptid_build (GET_PID (inferior_ptid), ti.ti_lid, ti.ti_tid); -+ ptid = ptid_build (GET_PID (inferior_ptid), ti.ti_lid, 0); - - if (ti.ti_tid == 0) - { -@@ -994,18 +939,17 @@ - static char * - thread_db_pid_to_str (ptid_t ptid) - { -- if (is_thread (ptid)) -+ struct thread_info *thread_info = find_thread_pid (ptid); -+ -+ if (thread_info != NULL && thread_info->private != NULL) - { - static char buf[64]; -- struct thread_info *thread_info; -+ thread_t tid; - -+ tid = thread_info->private->tid; - thread_info = find_thread_pid (ptid); -- if (thread_info == NULL) -- snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld) (Missing)", -- GET_THREAD (ptid), GET_LWP (ptid)); -- else -- snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)", -- GET_THREAD (ptid), GET_LWP (ptid)); -+ snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)", -+ tid, GET_LWP (ptid)); - - return buf; - } -@@ -1022,22 +966,15 @@ - static char * - thread_db_extra_thread_info (struct thread_info *info) - { -+ if (info->private == NULL) -+ return NULL; -+ - if (info->private->dying) - return "Exiting"; - - return NULL; - } - --/* Return 1 if this thread has the same LWP as the passed PTID. */ -- --static int --same_ptid_callback (struct thread_info *thread, void *arg) --{ -- ptid_t *ptid_p = arg; -- -- return GET_LWP (thread->ptid) == GET_LWP (*ptid_p); --} -- - /* Get the address of the thread local variable in load module LM which - is stored at OFFSET within the thread local storage for thread PTID. */ - -@@ -1046,26 +983,19 @@ - CORE_ADDR lm, - CORE_ADDR offset) - { -+ struct thread_info *thread_info; -+ - /* If we have not discovered any threads yet, check now. */ -- if (!is_thread (ptid) && !have_threads ()) -+ if (!have_threads ()) - thread_db_find_new_threads (); - -- /* Try to find a matching thread if we still have the LWP ID instead -- of the thread ID. */ -- if (!is_thread (ptid)) -- { -- struct thread_info *thread; -- -- thread = iterate_over_threads (same_ptid_callback, &ptid); -- if (thread != NULL) -- ptid = thread->ptid; -- } -+ /* Find the matching thread. */ -+ thread_info = find_thread_pid (ptid); - -- if (is_thread (ptid)) -+ if (thread_info != NULL && thread_info->private != NULL) - { - td_err_e err; - void *address; -- struct thread_info *thread_info; - - /* glibc doesn't provide the needed interface. */ - if (!td_thr_tls_get_addr_p) -@@ -1075,11 +1005,6 @@ - /* Caller should have verified that lm != 0. */ - gdb_assert (lm != 0); - -- /* Get info about the thread. */ -- thread_info = find_thread_pid (ptid); -- gdb_assert (thread_info); -- 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, -@@ -1122,9 +1047,7 @@ - thread_db_ops.to_longname = "multi-threaded child process."; - thread_db_ops.to_doc = "Threads and pthreads support."; - thread_db_ops.to_detach = thread_db_detach; -- thread_db_ops.to_resume = thread_db_resume; - thread_db_ops.to_wait = thread_db_wait; -- thread_db_ops.to_kill = thread_db_kill; - thread_db_ops.to_mourn_inferior = thread_db_mourn_inferior; - thread_db_ops.to_find_new_threads = thread_db_find_new_threads; - thread_db_ops.to_pid_to_str = thread_db_pid_to_str; -=================================================================== -RCS file: /cvs/src/src/gdb/procfs.c,v -retrieving revision 1.86 -retrieving revision 1.87 -diff -u -r1.86 -r1.87 ---- src/gdb/procfs.c 2008/03/12 20:00:21 1.86 -+++ src/gdb/procfs.c 2008/03/21 15:44:53 1.87 -@@ -4034,8 +4034,9 @@ - case PR_SYSENTRY: - if (syscall_is_lwp_exit (pi, what)) - { -- printf_filtered (_("[%s exited]\n"), -- target_pid_to_str (retval)); -+ if (print_thread_events) -+ printf_unfiltered (_("[%s exited]\n"), -+ target_pid_to_str (retval)); - delete_thread (retval); - status->kind = TARGET_WAITKIND_SPURIOUS; - return retval; -@@ -4165,8 +4166,9 @@ - } - else if (syscall_is_lwp_exit (pi, what)) - { -- printf_filtered (_("[%s exited]\n"), -- target_pid_to_str (retval)); -+ if (print_thread_events) -+ printf_unfiltered (_("[%s exited]\n"), -+ target_pid_to_str (retval)); - delete_thread (retval); - status->kind = TARGET_WAITKIND_SPURIOUS; - return retval; -Index: gdb-6.8/gdb/thread.c -=================================================================== ---- gdb-6.8.orig/gdb/thread.c 2008-03-12 23:22:06.000000000 +0100 -+++ gdb-6.8/gdb/thread.c 2008-07-14 10:24:32.000000000 +0200 -@@ -131,16 +131,24 @@ add_thread_silent (ptid_t ptid) - } - - struct thread_info * --add_thread (ptid_t ptid) -+add_thread_with_info (ptid_t ptid, struct private_thread_info *private) - { - struct thread_info *result = add_thread_silent (ptid); - -+ result->private = private; -+ - if (print_thread_events) - printf_unfiltered (_("[New %s]\n"), target_pid_to_str (ptid)); - - return result; - } - -+struct thread_info * -+add_thread (ptid_t ptid) -+{ -+ return add_thread_with_info (ptid, NULL); -+} -+ - void - delete_thread (ptid_t ptid) - { -=================================================================== -RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/fork-child-threads.exp,v -retrieving revision 1.1 -retrieving revision 1.2 -diff -u -r1.1 -r1.2 ---- src/gdb/testsuite/gdb.threads/fork-child-threads.exp 2008/01/02 13:36:38 1.1 -+++ src/gdb/testsuite/gdb.threads/fork-child-threads.exp 2008/03/21 15:44:53 1.2 -@@ -38,6 +38,10 @@ - - gdb_test "set follow-fork-mode child" - gdb_breakpoint "start" -+ -+# Make sure we can step over fork without losing our breakpoint. -+gdb_test "next" ".*pthread_create \\(&thread, NULL, start, NULL\\);.*" "next over fork" -+ - gdb_test "continue" "Breakpoint 2, start.*" "get to the spawned thread" - - # Wrong: - -http://sourceware.org/ml/gdb-patches/2008-04/msg00238.html -http://sourceware.org/ml/gdb-cvs/2008-04/msg00068.html - -2008-04-14 Daniel Jacobowitz - - * linux-thread-db.c (have_threads_callback): Check thread->private. - -=================================================================== -RCS file: /cvs/src/src/gdb/linux-thread-db.c,v -retrieving revision 1.40 -retrieving revision 1.41 -diff -u -r1.40 -r1.41 ---- src/gdb/linux-thread-db.c 2008/03/25 12:26:21 1.40 -+++ src/gdb/linux-thread-db.c 2008/04/14 14:02:23 1.41 -@@ -235,7 +235,7 @@ - static int - have_threads_callback (struct thread_info *thread, void *dummy) - { -- return 1; -+ return thread->private != NULL; - } - - static int - - - -2008-05-03 Jan Kratochvil - - * gdb.base/dfp-test.exp: Fix random FAIL risk on calling functions. - -=================================================================== -RCS file: /cvs/src/src/gdb/testsuite/gdb.base/dfp-test.exp,v -retrieving revision 1.5 -retrieving revision 1.6 -diff -u -r1.5 -r1.6 ---- src/gdb/testsuite/gdb.base/dfp-test.exp 2008/01/30 03:19:26 1.5 -+++ src/gdb/testsuite/gdb.base/dfp-test.exp 2008/05/03 21:56:38 1.6 -@@ -252,16 +252,16 @@ - - # Test calling inferior function with DFP arguments or return value. - --send_gdb "call arg0_32 (1.2df, 2.2df, 3.2df, 4.2df, 5.2df, 6.2df)\n" --gdb_test "backtrace 1" "\n#\[0-9\]+ arg0_32 \\(arg0=1.2, arg1=2.2, arg2=3.2, arg3=4.2, arg4=5.2, arg5=6.2\\).*" "Call function with correct _Decimal32 arguments." -+gdb_test "call arg0_32 (1.2df, 2.2df, 3.2df, 4.2df, 5.2df, 6.2df)" "Breakpoint.*arg0_32.*" "Call function with correct _Decimal32 arguments." -+gdb_test "backtrace 1" "\n#\[0-9\]+ arg0_32 \\(arg0=1.2, arg1=2.2, arg2=3.2, arg3=4.2, arg4=5.2, arg5=6.2\\).*" "Backtrace function with correct _Decimal32 arguments." - gdb_test "finish" " = 1.2" "Correct _Decimal32 return value from called function." - --send_gdb "call arg0_64 (1.2dd, 2.2dd, 3.2dd, 4.2dd, 5.2dd, 6.2dd)\n" --gdb_test "backtrace 1" "\n#\[0-9\]+ arg0_64 \\(arg0=1.2, arg1=2.2, arg2=3.2, arg3=4.2, arg4=5.2, arg5=6.2\\).*" "Call function with correct _Decimal64 arguments." -+gdb_test "call arg0_64 (1.2dd, 2.2dd, 3.2dd, 4.2dd, 5.2dd, 6.2dd)" "Breakpoint.*arg0_64.*" "Call function with correct _Decimal64 arguments." -+gdb_test "backtrace 1" "\n#\[0-9\]+ arg0_64 \\(arg0=1.2, arg1=2.2, arg2=3.2, arg3=4.2, arg4=5.2, arg5=6.2\\).*" "Backtrace function with correct _Decimal64 arguments." - gdb_test "finish" " = 1.2" "Correct _Decimal64 return value from called function." - --send_gdb "call arg0_128 (1.2dl, 2.2dl, 3.2dl, 4.2dl, 5.2dl, 6.2dl)\n" --gdb_test "backtrace 1" "\n#\[0-9\]+ arg0_128 \\(arg0=1.2, arg1=2.2, arg2=3.2, arg3=4.2, arg4=5.2, arg5=6.2\\).*" "Call function with correct _Decimal128 arguments." -+gdb_test "call arg0_128 (1.2dl, 2.2dl, 3.2dl, 4.2dl, 5.2dl, 6.2dl)" "Breakpoint.*arg0_128.*" "Call function with correct _Decimal128 arguments." -+gdb_test "backtrace 1" "\n#\[0-9\]+ arg0_128 \\(arg0=1.2, arg1=2.2, arg2=3.2, arg3=4.2, arg4=5.2, arg5=6.2\\).*" "Backtrace function with correct _Decimal128 arguments." - gdb_test "finish" " = 1.2" "Correct _Decimal128 return value from called function." - - gdb_test "call decimal_dec128_align (double_val1, dec128_val2, double_val3, double_val4, double_val5, double_val6, double_val7, double_val8, double_val9, double_val10, double_val11, double_val12, double_val13, double_val14)" " = 1" \ - - - -gdb/ -2008-07-07 Jan Kratochvil - - * breakpoint.c (bpstat_copy): Call RELEASE_VALUE on the new OLD_VAL. - -gdb/testsuite/ -2008-07-07 Jan Kratochvil - - * gdb.base/value-double-free.exp, gdb.base/value-double-free.c: New. - -=================================================================== -RCS file: /cvs/src/src/gdb/breakpoint.c,v -retrieving revision 1.327 -retrieving revision 1.328 -diff -u -r1.327 -r1.328 ---- src/gdb/breakpoint.c 2008/06/28 09:42:15 1.327 -+++ src/gdb/breakpoint.c 2008/07/07 22:39:58 1.328 -@@ -1996,7 +1996,10 @@ - if (bs->commands != NULL) - tmp->commands = copy_command_lines (bs->commands); - if (bs->old_val != NULL) -- tmp->old_val = value_copy (bs->old_val); -+ { -+ tmp->old_val = value_copy (bs->old_val); -+ release_value (tmp->old_val); -+ } - - if (p == NULL) - /* This is the first thing in the chain. */ -/cvs/src/src/gdb/testsuite/gdb.base/value-double-free.c,v --> standard output -revision 1.1 ---- src/gdb/testsuite/gdb.base/value-double-free.c -+++ src/gdb/testsuite/gdb.base/value-double-free.c 2008-07-07 22:40:47.485459000 +0000 -@@ -0,0 +1,36 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 Free Software Foundation, Inc. -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 3 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program. If not, see . -+ -+ Please email any bugs, comments, and/or additions to this file to: -+ bug-gdb@prep.ai.mit.edu */ -+ -+volatile int var; -+ -+void -+empty (void) -+{ -+} -+ -+int -+main (void) -+{ -+ var = 1; -+ /* Workaround PR 38: We may miss the first watchpoint hit as we stop on the -+ exact instruction which would cause the watchpoint hit. */ -+ var = 2; -+ return 0; -+} -/cvs/src/src/gdb/testsuite/gdb.base/value-double-free.exp,v --> standard output -revision 1.1 ---- src/gdb/testsuite/gdb.base/value-double-free.exp -+++ src/gdb/testsuite/gdb.base/value-double-free.exp 2008-07-07 22:40:48.139680000 +0000 -@@ -0,0 +1,38 @@ -+# Copyright 2008 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+set testfile value-double-free -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+# Get things started. -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+if ![runto_main] { -+ return -1 -+} -+gdb_test "watch var" "atchpoint \[0-9\]+: var" -+gdb_test "continue" "atchpoint \[0-9\]+: var.*Old value = 0.*New value = \[12\].*" -+gdb_test "print empty()" " = void" -+# We did segfault here. -+gdb_test "help help" - - - -http://sourceware.org/ml/gdb-patches/2008-03/msg00356.html -http://sourceware.org/ml/gdb-cvs/2008-03/msg00130.html - -2008-03-24 Jan Kratochvil - - Fix random false FAILs on i386. - * gdb.base/prelink.exp: Use `--no-exec-shield' for prelink. - -=================================================================== -RCS file: /cvs/src/src/gdb/testsuite/gdb.base/prelink.exp,v -retrieving revision 1.7 -retrieving revision 1.8 -diff -u -r1.7 -r1.8 ---- src/gdb/testsuite/gdb.base/prelink.exp 2008/01/01 22:53:19 1.7 -+++ src/gdb/testsuite/gdb.base/prelink.exp 2008/03/24 15:16:12 1.8 -@@ -47,7 +47,15 @@ - return -1 - } - --if {[catch "system \"prelink -qNR ${libfile}\""] != 0} { -+# `--no-exec-shield' is for i386 where prelink in the exec-shield mode is -+# forced to push all the libraries tight together to fit into the first two -+# memory areas (either the ASCII Shield area or at least below the executable). -+# In this case its -R option cannot be applied and we falsely FAIL here as if -+# the system is already prelinked prelink has no choice how to randomize the -+# single new unprelinked library address without wasting the first one/two -+# memory areas. We do not care of the efficiency of loading such resulting -+# exec-shield unfriendly prelinked library. -+if {[catch "system \"prelink -qNR --no-exec-shield ${libfile}\""] != 0} { - # Maybe we don't have prelink. - return -1 - } -@@ -92,7 +100,7 @@ - untested "${testfile}.so was not prelinked, maybe system libraries are not prelinked?" - return 0 - } --catch "system \"prelink -qNR ${libfile}\"" -+catch "system \"prelink -qNR --no-exec-shield ${libfile}\"" - - # Start with a fresh gdb - - - - -https://bugzilla.redhat.com/show_bug.cgi?id=452960 - -bfd/ -2008-05-14 Ulrich Weigand - - * elf32-ppc.c (ppc_elf_get_synthetic_symtab): Fix memset calls. - * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Likewise. - -bfd/ -2008-05-14 Ulrich Weigand - Alan Modra - - * elf32-ppc.c (section_covers_vma): New function. - (ppc_elf_get_synthetic_symtab): New function. - (bfd_elf32_get_synthetic_symtab): Define. - * elf64-ppc.c (section_covers_vma): New function. - (ppc64_elf_get_synthetic_symtab): Generate sym@plt on glink branch - table entries, and __glink_PLTresolve on resolver stub. - (ppc64_elf_build_stubs): Rename __glink sym to __glink_PLTresolve. - -gdb/ -2008-05-14 Ulrich Weigand - - * ppc-linux-tdep.c (ppc_linux_convert_from_func_ptr_addr): Rename ... - (ppc64_linux_convert_from_func_ptr_addr): ... to this. No longer try - to handle ppc32 PLT entries. - (ppc_linux_init_abi): Install ppc64_linux_convert_from_func_ptr_addr - only on ppc64. - -gdb/ -2008-05-14 Daniel Jacobowitz - - * elfread.c (elf_symtab_read): Create trampolines for @plt symbols. - * minsyms.c (lookup_minimal_symbol_by_pc_section_1): Renamed from - lookup_minimal_symbol_by_pc_section. Prefer trampolines if requested. - (lookup_minimal_symbol_by_pc_section): Use - lookup_minimal_symbol_by_pc_section_1. - (lookup_solib_trampoline_symbol_by_pc): Likewise. - -[ Backported for GDB-6.8f. ] - ---- ./bfd/elf32-ppc.c 2008-02-26 09:36:03.000000000 +0100 -+++ ./bfd/elf32-ppc.c 2008-07-24 15:42:47.000000000 +0200 -@@ -2291,6 +2291,208 @@ ppc_elf_final_write_processing (bfd *abf - apuinfo_list_finish (); - } - -+static bfd_boolean -+section_covers_vma (bfd *abfd ATTRIBUTE_UNUSED, asection *section, void *ptr) -+{ -+ bfd_vma vma = *(bfd_vma *) ptr; -+ return ((section->flags & SEC_ALLOC) != 0 -+ && section->vma <= vma -+ && vma < section->vma + section->size); -+} -+ -+static long -+ppc_elf_get_synthetic_symtab (bfd *abfd, long symcount, asymbol **syms, -+ long dynsymcount, asymbol **dynsyms, -+ asymbol **ret) -+{ -+ bfd_boolean (*slurp_relocs) (bfd *, asection *, asymbol **, bfd_boolean); -+ asection *plt, *relplt, *dynamic, *glink; -+ bfd_vma glink_vma = 0; -+ bfd_vma resolv_vma = 0; -+ bfd_vma stub_vma; -+ asymbol *s; -+ arelent *p; -+ long count, i; -+ size_t size; -+ char *names; -+ bfd_byte buf[4]; -+ -+ *ret = NULL; -+ -+ if ((abfd->flags & (DYNAMIC | EXEC_P)) == 0) -+ return 0; -+ -+ if (dynsymcount <= 0) -+ return 0; -+ -+ relplt = bfd_get_section_by_name (abfd, ".rela.plt"); -+ if (relplt == NULL) -+ return 0; -+ -+ plt = bfd_get_section_by_name (abfd, ".plt"); -+ if (plt == NULL) -+ return 0; -+ -+ /* Call common code to handle old-style executable PLTs. */ -+ if (elf_section_flags (plt) & SHF_EXECINSTR) -+ return _bfd_elf_get_synthetic_symtab (abfd, symcount, syms, -+ dynsymcount, dynsyms, ret); -+ -+ /* If this object was prelinked, the prelinker stored the address -+ of .glink at got[1]. If it wasn't prelinked, got[1] will be zero. */ -+ dynamic = bfd_get_section_by_name (abfd, ".dynamic"); -+ if (dynamic != NULL) -+ { -+ bfd_byte *dynbuf, *extdyn, *extdynend; -+ size_t extdynsize; -+ void (*swap_dyn_in) (bfd *, const void *, Elf_Internal_Dyn *); -+ -+ if (!bfd_malloc_and_get_section (abfd, dynamic, &dynbuf)) -+ return -1; -+ -+ extdynsize = get_elf_backend_data (abfd)->s->sizeof_dyn; -+ swap_dyn_in = get_elf_backend_data (abfd)->s->swap_dyn_in; -+ -+ extdyn = dynbuf; -+ extdynend = extdyn + dynamic->size; -+ for (; extdyn < extdynend; extdyn += extdynsize) -+ { -+ Elf_Internal_Dyn dyn; -+ (*swap_dyn_in) (abfd, extdyn, &dyn); -+ -+ if (dyn.d_tag == DT_NULL) -+ break; -+ -+ if (dyn.d_tag == DT_PPC_GOT) -+ { -+ unsigned int g_o_t = dyn.d_un.d_val; -+ asection *got = bfd_get_section_by_name (abfd, ".got"); -+ if (got != NULL -+ && bfd_get_section_contents (abfd, got, buf, -+ g_o_t - got->vma + 4, 4)) -+ glink_vma = bfd_get_32 (abfd, buf); -+ break; -+ } -+ } -+ free (dynbuf); -+ } -+ -+ /* Otherwise we read the first plt entry. */ -+ if (glink_vma == 0) -+ { -+ if (bfd_get_section_contents (abfd, plt, buf, 0, 4)) -+ glink_vma = bfd_get_32 (abfd, buf); -+ } -+ -+ if (glink_vma == 0) -+ return 0; -+ -+ /* The .glink section usually does not survive the final -+ link; search for the section (usually .text) where the -+ glink stubs now reside. */ -+ glink = bfd_sections_find_if (abfd, section_covers_vma, &glink_vma); -+ if (glink == NULL) -+ return 0; -+ -+ /* Determine glink PLT resolver by reading the relative branch -+ from the first glink stub. */ -+ if (bfd_get_section_contents (abfd, glink, buf, -+ glink_vma - glink->vma, 4)) -+ { -+ unsigned int insn = bfd_get_32 (abfd, buf); -+ -+ /* The first glink stub may either branch to the resolver ... */ -+ insn ^= B; -+ if ((insn & ~0x3fffffc) == 0) -+ resolv_vma = glink_vma + (insn ^ 0x2000000) - 0x2000000; -+ -+ /* ... or fall through a bunch of NOPs. */ -+ else if ((insn ^ B ^ NOP) == 0) -+ for (i = 4; -+ bfd_get_section_contents (abfd, glink, buf, -+ glink_vma - glink->vma + i, 4); -+ i += 4) -+ if (bfd_get_32 (abfd, buf) != NOP) -+ { -+ resolv_vma = glink_vma + i; -+ break; -+ } -+ } -+ -+ slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table; -+ if (! (*slurp_relocs) (abfd, relplt, dynsyms, TRUE)) -+ return -1; -+ -+ count = relplt->size / sizeof (Elf32_External_Rela); -+ stub_vma = glink_vma - (bfd_vma) count * 16; -+ size = count * sizeof (asymbol); -+ p = relplt->relocation; -+ for (i = 0; i < count; i++, p++) -+ size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt"); -+ -+ size += sizeof (asymbol) + sizeof ("__glink"); -+ -+ if (resolv_vma) -+ size += sizeof (asymbol) + sizeof ("__glink_PLTresolve"); -+ -+ s = *ret = bfd_malloc (size); -+ if (s == NULL) -+ return -1; -+ -+ names = (char *) (s + count + 1 + (resolv_vma != 0)); -+ p = relplt->relocation; -+ for (i = 0; i < count; i++, p++) -+ { -+ size_t len; -+ -+ *s = **p->sym_ptr_ptr; -+ /* Undefined syms won't have BSF_LOCAL or BSF_GLOBAL set. Since -+ we are defining a symbol, ensure one of them is set. */ -+ if ((s->flags & BSF_LOCAL) == 0) -+ s->flags |= BSF_GLOBAL; -+ s->section = glink; -+ s->value = stub_vma - glink->vma; -+ s->name = names; -+ s->udata.p = NULL; -+ len = strlen ((*p->sym_ptr_ptr)->name); -+ memcpy (names, (*p->sym_ptr_ptr)->name, len); -+ names += len; -+ memcpy (names, "@plt", sizeof ("@plt")); -+ names += sizeof ("@plt"); -+ ++s; -+ stub_vma += 16; -+ } -+ -+ /* Add a symbol at the start of the glink branch table. */ -+ memset (s, 0, sizeof *s); -+ s->the_bfd = abfd; -+ s->flags = BSF_GLOBAL; -+ s->section = glink; -+ s->value = glink_vma - glink->vma; -+ s->name = names; -+ memcpy (names, "__glink", sizeof ("__glink")); -+ names += sizeof ("__glink"); -+ s++; -+ count++; -+ -+ if (resolv_vma) -+ { -+ /* Add a symbol for the glink PLT resolver. */ -+ memset (s, 0, sizeof *s); -+ s->the_bfd = abfd; -+ s->flags = BSF_GLOBAL; -+ s->section = glink; -+ s->value = resolv_vma - glink->vma; -+ s->name = names; -+ memcpy (names, "__glink_PLTresolve", sizeof ("__glink_PLTresolve")); -+ names += sizeof ("__glink_PLTresolve"); -+ s++; -+ count++; -+ } -+ -+ return count; -+} -+ - /* The following functions are specific to the ELF linker, while - functions above are used generally. They appear in this file more - or less in the order in which they are called. eg. -@@ -7733,6 +7935,7 @@ ppc_elf_finish_dynamic_sections (bfd *ou - #define bfd_elf32_bfd_reloc_name_lookup ppc_elf_reloc_name_lookup - #define bfd_elf32_bfd_set_private_flags ppc_elf_set_private_flags - #define bfd_elf32_bfd_link_hash_table_create ppc_elf_link_hash_table_create -+#define bfd_elf32_get_synthetic_symtab ppc_elf_get_synthetic_symtab - - #define elf_backend_object_p ppc_elf_object_p - #define elf_backend_gc_mark_hook ppc_elf_gc_mark_hook -@@ -7847,6 +8050,8 @@ ppc_elf_vxworks_final_write_processing ( - #undef elf_backend_got_header_size - #define elf_backend_got_header_size 12 - -+#undef bfd_elf32_get_synthetic_symtab -+ - #undef bfd_elf32_bfd_link_hash_table_create - #define bfd_elf32_bfd_link_hash_table_create \ - ppc_elf_vxworks_link_hash_table_create ---- ./bfd/elf64-ppc.c 2008-02-15 09:27:19.000000000 +0100 -+++ ./bfd/elf64-ppc.c 2008-07-24 15:42:47.000000000 +0200 -@@ -2771,8 +2771,17 @@ sym_exists_at (asymbol **syms, long lo, - return NULL; - } - -+static bfd_boolean -+section_covers_vma (bfd *abfd ATTRIBUTE_UNUSED, asection *section, void *ptr) -+{ -+ bfd_vma vma = *(bfd_vma *) ptr; -+ return ((section->flags & SEC_ALLOC) != 0 -+ && section->vma <= vma -+ && vma < section->vma + section->size); -+} -+ - /* Create synthetic symbols, effectively restoring "dot-symbol" function -- entry syms. */ -+ entry syms. Also generate @plt symbols for the glink branch table. */ - - static long - ppc64_elf_get_synthetic_symtab (bfd *abfd, -@@ -2862,8 +2871,6 @@ ppc64_elf_get_synthetic_symtab (bfd *abf - symcount = i; - - count = 0; -- if (opdsymend == secsymend) -- goto done; - - if (relocatable) - { -@@ -2872,6 +2879,9 @@ ppc64_elf_get_synthetic_symtab (bfd *abf - size_t size; - long relcount; - -+ if (opdsymend == secsymend) -+ goto done; -+ - slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table; - relcount = (opd->flags & SEC_RELOC) ? opd->reloc_count : 0; - if (relcount == 0) -@@ -2960,8 +2970,13 @@ ppc64_elf_get_synthetic_symtab (bfd *abf - } - else - { -+ bfd_boolean (*slurp_relocs) (bfd *, asection *, asymbol **, bfd_boolean); - bfd_byte *contents; - size_t size; -+ long plt_count = 0; -+ bfd_vma glink_vma = 0, resolv_vma = 0; -+ asection *dynamic, *glink = NULL, *relplt = NULL; -+ arelent *p; - - if (!bfd_malloc_and_get_section (abfd, opd, &contents)) - { -@@ -2988,11 +3003,85 @@ ppc64_elf_get_synthetic_symtab (bfd *abf - } - } - -+ /* Get start of .glink stubs from DT_PPC64_GLINK. */ -+ dynamic = bfd_get_section_by_name (abfd, ".dynamic"); -+ if (dynamic != NULL) -+ { -+ bfd_byte *dynbuf, *extdyn, *extdynend; -+ size_t extdynsize; -+ void (*swap_dyn_in) (bfd *, const void *, Elf_Internal_Dyn *); -+ -+ if (!bfd_malloc_and_get_section (abfd, dynamic, &dynbuf)) -+ goto free_contents_and_exit; -+ -+ extdynsize = get_elf_backend_data (abfd)->s->sizeof_dyn; -+ swap_dyn_in = get_elf_backend_data (abfd)->s->swap_dyn_in; -+ -+ extdyn = dynbuf; -+ extdynend = extdyn + dynamic->size; -+ for (; extdyn < extdynend; extdyn += extdynsize) -+ { -+ Elf_Internal_Dyn dyn; -+ (*swap_dyn_in) (abfd, extdyn, &dyn); -+ -+ if (dyn.d_tag == DT_NULL) -+ break; -+ -+ if (dyn.d_tag == DT_PPC64_GLINK) -+ { -+ /* The first glink stub starts at offset 32; see comment in -+ ppc64_elf_finish_dynamic_sections. */ -+ glink_vma = dyn.d_un.d_val + 32; -+ /* The .glink section usually does not survive the final -+ link; search for the section (usually .text) where the -+ glink stubs now reside. */ -+ glink = bfd_sections_find_if (abfd, section_covers_vma, -+ &glink_vma); -+ break; -+ } -+ } -+ -+ free (dynbuf); -+ } -+ -+ if (glink != NULL) -+ { -+ /* Determine __glink trampoline by reading the relative branch -+ from the first glink stub. */ -+ bfd_byte buf[4]; -+ if (bfd_get_section_contents (abfd, glink, buf, -+ glink_vma + 4 - glink->vma, 4)) -+ { -+ unsigned int insn = bfd_get_32 (abfd, buf); -+ insn ^= B_DOT; -+ if ((insn & ~0x3fffffc) == 0) -+ resolv_vma = glink_vma + 4 + (insn ^ 0x2000000) - 0x2000000; -+ } -+ -+ if (resolv_vma) -+ size += sizeof (asymbol) + sizeof ("__glink_PLTresolve"); -+ } -+ -+ relplt = bfd_get_section_by_name (abfd, ".rela.plt"); -+ if (glink != NULL && relplt != NULL) -+ { -+ slurp_relocs = get_elf_backend_data (abfd)->s->slurp_reloc_table; -+ if (! (*slurp_relocs) (abfd, relplt, dyn_syms, TRUE)) -+ goto free_contents_and_exit; -+ -+ plt_count = relplt->size / sizeof (Elf64_External_Rela); -+ size += plt_count * sizeof (asymbol); -+ -+ p = relplt->relocation; -+ for (i = 0; i < plt_count; i++, p++) -+ size += strlen ((*p->sym_ptr_ptr)->name) + sizeof ("@plt"); -+ } -+ - s = *ret = bfd_malloc (size); - if (s == NULL) - goto free_contents_and_exit; - -- names = (char *) (s + count); -+ names = (char *) (s + count + plt_count + (resolv_vma != 0)); - - for (i = secsymend; i < opdsymend; ++i) - { -@@ -3048,6 +3137,66 @@ ppc64_elf_get_synthetic_symtab (bfd *abf - } - } - free (contents); -+ -+ if (glink != NULL && relplt != NULL) -+ { -+ if (resolv_vma) -+ { -+ /* Add a symbol for the main glink trampoline. */ -+ memset (s, 0, sizeof *s); -+ s->the_bfd = abfd; -+ s->flags = BSF_GLOBAL; -+ s->section = glink; -+ s->value = resolv_vma - glink->vma; -+ s->name = names; -+ memcpy (names, "__glink_PLTresolve", sizeof ("__glink_PLTresolve")); -+ names += sizeof ("__glink_PLTresolve"); -+ s++; -+ count++; -+ } -+ -+ /* FIXME: It would be very much nicer to put sym@plt on the -+ stub rather than on the glink branch table entry. The -+ objdump disassembler would then use a sensible symbol -+ name on plt calls. The difficulty in doing so is -+ a) finding the stubs, and, -+ b) matching stubs against plt entries, and, -+ c) there can be multiple stubs for a given plt entry. -+ -+ Solving (a) could be done by code scanning, but older -+ ppc64 binaries used different stubs to current code. -+ (b) is the tricky one since you need to known the toc -+ pointer for at least one function that uses a pic stub to -+ be able to calculate the plt address referenced. -+ (c) means gdb would need to set multiple breakpoints (or -+ find the glink branch itself) when setting breakpoints -+ for pending shared library loads. */ -+ p = relplt->relocation; -+ for (i = 0; i < plt_count; i++, p++) -+ { -+ size_t len; -+ -+ *s = **p->sym_ptr_ptr; -+ /* Undefined syms won't have BSF_LOCAL or BSF_GLOBAL set. Since -+ we are defining a symbol, ensure one of them is set. */ -+ if ((s->flags & BSF_LOCAL) == 0) -+ s->flags |= BSF_GLOBAL; -+ s->section = glink; -+ s->value = glink_vma - glink->vma; -+ s->name = names; -+ s->udata.p = NULL; -+ len = strlen ((*p->sym_ptr_ptr)->name); -+ memcpy (names, (*p->sym_ptr_ptr)->name, len); -+ names += len; -+ memcpy (names, "@plt", sizeof ("@plt")); -+ names += sizeof ("@plt"); -+ s++; -+ glink_vma += 8; -+ if (i >= 0x8000) -+ glink_vma += 4; -+ } -+ count += plt_count; -+ } - } - - done: -@@ -9705,7 +9854,8 @@ ppc64_elf_build_stubs (bfd_boolean emit_ - if (htab->emit_stub_syms) - { - struct elf_link_hash_entry *h; -- h = elf_link_hash_lookup (&htab->elf, "__glink", TRUE, FALSE, FALSE); -+ h = elf_link_hash_lookup (&htab->elf, "__glink_PLTresolve", -+ TRUE, FALSE, FALSE); - if (h == NULL) - return FALSE; - if (h->root.type == bfd_link_hash_new) ---- ./gdb/elfread.c 2008-07-24 15:41:07.000000000 +0200 -+++ ./gdb/elfread.c 2008-07-24 15:42:48.000000000 +0200 -@@ -514,6 +514,34 @@ elf_symtab_read (struct objfile *objfile - if (msym != NULL) - msym->filename = filesymname; - gdbarch_elf_make_msymbol_special (current_gdbarch, sym, msym); -+ -+ /* For @plt symbols, also record a trampoline to the -+ destination symbol. The @plt symbol will be used in -+ disassembly, and the trampoline will be used when we are -+ trying to find the target. */ -+ if (msym && ms_type == mst_text && type == ST_SYNTHETIC) -+ { -+ int len = strlen (sym->name); -+ -+ if (len > 4 && strcmp (sym->name + len - 4, "@plt") == 0) -+ { -+ char *base_name = alloca (len - 4 + 1); -+ struct minimal_symbol *mtramp; -+ -+ memcpy (base_name, sym->name, len - 4); -+ base_name[len - 4] = '\0'; -+ mtramp = record_minimal_symbol (base_name, symaddr, -+ mst_solib_trampoline, -+ sym->section, objfile); -+ if (mtramp) -+ { -+ MSYMBOL_SIZE (mtramp) = MSYMBOL_SIZE (msym); -+ mtramp->filename = filesymname; -+ gdbarch_elf_make_msymbol_special (current_gdbarch, sym, -+ mtramp); -+ } -+ } -+ } - } - } - } ---- ./gdb/minsyms.c 2008-07-24 15:41:07.000000000 +0200 -+++ ./gdb/minsyms.c 2008-07-24 15:42:48.000000000 +0200 -@@ -357,10 +357,15 @@ lookup_minimal_symbol_solib_trampoline ( - ALL the minimal symbol tables before deciding on the symbol that - comes closest to the specified PC. This is because objfiles can - overlap, for example objfile A has .text at 0x100 and .data at -- 0x40000 and objfile B has .text at 0x234 and .data at 0x40048. */ -+ 0x40000 and objfile B has .text at 0x234 and .data at 0x40048. - --struct minimal_symbol * --lookup_minimal_symbol_by_pc_section (CORE_ADDR pc, asection *section) -+ If WANT_TRAMPOLINE is set, prefer mst_solib_trampoline symbols when -+ there are text and trampoline symbols at the same address. -+ Otherwise prefer mst_text symbols. */ -+ -+static struct minimal_symbol * -+lookup_minimal_symbol_by_pc_section_1 (CORE_ADDR pc, asection *section, -+ int want_trampoline) - { - int lo; - int hi; -@@ -369,7 +374,11 @@ lookup_minimal_symbol_by_pc_section (COR - struct minimal_symbol *msymbol; - struct minimal_symbol *best_symbol = NULL; - struct obj_section *pc_section; -+ enum minimal_symbol_type want_type, other_type; - -+ want_type = want_trampoline ? mst_solib_trampoline : mst_text; -+ other_type = want_trampoline ? mst_text : mst_solib_trampoline; -+ - /* PC has to be in a known section. This ensures that anything - beyond the end of the last segment doesn't appear to be part of - the last function in the last segment. */ -@@ -491,6 +500,24 @@ lookup_minimal_symbol_by_pc_section (COR - continue; - } - -+ /* If we are looking for a trampoline and this is a -+ text symbol, or the other way around, check the -+ preceeding symbol too. If they are otherwise -+ identical prefer that one. */ -+ if (hi > 0 -+ && MSYMBOL_TYPE (&msymbol[hi]) == other_type -+ && MSYMBOL_TYPE (&msymbol[hi - 1]) == want_type -+ && (MSYMBOL_SIZE (&msymbol[hi]) -+ == MSYMBOL_SIZE (&msymbol[hi - 1])) -+ && (SYMBOL_VALUE_ADDRESS (&msymbol[hi]) -+ == SYMBOL_VALUE_ADDRESS (&msymbol[hi - 1])) -+ && (SYMBOL_BFD_SECTION (&msymbol[hi]) -+ == SYMBOL_BFD_SECTION (&msymbol[hi - 1]))) -+ { -+ hi--; -+ continue; -+ } -+ - /* If the minimal symbol has a zero size, save it - but keep scanning backwards looking for one with - a non-zero size. A zero size may mean that the -@@ -571,6 +598,12 @@ lookup_minimal_symbol_by_pc_section (COR - return (best_symbol); - } - -+struct minimal_symbol * -+lookup_minimal_symbol_by_pc_section (CORE_ADDR pc, asection *section) -+{ -+ return lookup_minimal_symbol_by_pc_section_1 (pc, section, 0); -+} -+ - /* Backward compatibility: search through the minimal symbol table - for a matching PC (no section given) */ - -@@ -1024,7 +1057,13 @@ msymbols_sort (struct objfile *objfile) - struct minimal_symbol * - lookup_solib_trampoline_symbol_by_pc (CORE_ADDR pc) - { -- struct minimal_symbol *msymbol = lookup_minimal_symbol_by_pc (pc); -+ struct obj_section *section = find_pc_section (pc); -+ struct minimal_symbol *msymbol; -+ -+ if (section == NULL) -+ return NULL; -+ msymbol = lookup_minimal_symbol_by_pc_section_1 (pc, section->the_bfd_section, -+ 1); - - if (msymbol != NULL && MSYMBOL_TYPE (msymbol) == mst_solib_trampoline) - return msymbol; ---- ./gdb/ppc-linux-tdep.c 2008-02-20 15:31:40.000000000 +0100 -+++ ./gdb/ppc-linux-tdep.c 2008-07-24 15:43:24.000000000 +0200 -@@ -545,7 +545,7 @@ ppc64_skip_trampoline_code (struct frame - } - - --/* Support for convert_from_func_ptr_addr (ARCH, ADDR, TARG) on PPC -+/* Support for convert_from_func_ptr_addr (ARCH, ADDR, TARG) on PPC64 - GNU/Linux. - - Usually a function pointer's representation is simply the address -@@ -557,12 +557,6 @@ ppc64_skip_trampoline_code (struct frame - function, the second word is the TOC pointer (r2), and the third word - is the static chain value. - -- For PPC32, there are two kinds of function pointers: non-secure and -- secure. Non-secure function pointers point directly to the -- function in a code section and thus need no translation. Secure -- ones (from GCC's -msecure-plt option) are in a data section and -- contain one word: the address of the function. -- - Throughout GDB it is currently assumed that a function pointer contains - the address of the function, which is not easy to fix. In addition, the - conversion of a function address to a function pointer would -@@ -578,40 +572,15 @@ ppc64_skip_trampoline_code (struct frame - random addresses such as occur when there is no symbol table. */ - - static CORE_ADDR --ppc_linux_convert_from_func_ptr_addr (struct gdbarch *gdbarch, -- CORE_ADDR addr, -- struct target_ops *targ) -+ppc64_linux_convert_from_func_ptr_addr (struct gdbarch *gdbarch, -+ CORE_ADDR addr, -+ struct target_ops *targ) - { -- struct gdbarch_tdep *tdep; - struct section_table *s = target_section_by_addr (targ, addr); -- char *sect_name = NULL; -- -- if (!s) -- return addr; -- -- tdep = gdbarch_tdep (gdbarch); -- -- switch (tdep->wordsize) -- { -- case 4: -- sect_name = ".plt"; -- break; -- case 8: -- sect_name = ".opd"; -- break; -- default: -- internal_error (__FILE__, __LINE__, -- _("failed internal consistency check")); -- } - - /* Check if ADDR points to a function descriptor. */ -- -- /* NOTE: this depends on the coincidence that the address of a functions -- entry point is contained in the first word of its function descriptor -- for both PPC-64 and for PPC-32 with secure PLTs. */ -- if ((strcmp (s->the_bfd_section->name, sect_name) == 0) -- && s->the_bfd_section->flags & SEC_DATA) -- return get_target_memory_unsigned (targ, addr, tdep->wordsize); -+ if (s && strcmp (s->the_bfd_section->name, ".opd") == 0) -+ return get_target_memory_unsigned (targ, addr, 8); - - return addr; - } -@@ -905,11 +874,6 @@ ppc_linux_init_abi (struct gdbarch_info - set_gdbarch_long_double_bit (gdbarch, 16 * TARGET_CHAR_BIT); - set_gdbarch_long_double_format (gdbarch, floatformats_ibm_long_double); - -- /* Handle PPC GNU/Linux 64-bit function pointers (which are really -- function descriptors) and 32-bit secure PLT entries. */ -- set_gdbarch_convert_from_func_ptr_addr -- (gdbarch, ppc_linux_convert_from_func_ptr_addr); -- - if (tdep->wordsize == 4) - { - /* Until November 2001, gcc did not comply with the 32 bit SysV -@@ -937,6 +901,11 @@ ppc_linux_init_abi (struct gdbarch_info - - if (tdep->wordsize == 8) - { -+ /* Handle PPC GNU/Linux 64-bit function pointers (which are really -+ function descriptors). */ -+ set_gdbarch_convert_from_func_ptr_addr -+ (gdbarch, ppc64_linux_convert_from_func_ptr_addr); -+ - /* Shared library handling. */ - set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code); - set_solib_svr4_fetch_link_map_offsets - - - -http://sourceware.org/ml/gdb-patches/2008-04/msg00379.html -http://sourceware.org/ml/gdb-cvs/2008-04/msg00104.html - -2008-04-17 Marc Khouzam - - * breakpoint.c (update_watchpoint): Always reparse - condition. - -=================================================================== -RCS file: /cvs/src/src/gdb/breakpoint.c,v -retrieving revision 1.309 -retrieving revision 1.310 -diff -u -r1.309 -r1.310 ---- src/gdb/breakpoint.c 2008/04/17 22:43:17 1.309 -+++ src/gdb/breakpoint.c 2008/04/18 00:41:28 1.310 -@@ -994,14 +994,13 @@ - value_free (v); - } - -- if (reparse && b->cond_string != NULL) -+ /* We just regenerated the list of breakpoint locations. -+ The new location does not have its condition field set to anything -+ and therefore, we must always reparse the cond_string, independently -+ of the value of the reparse flag. */ -+ if (b->cond_string != NULL) - { - char *s = b->cond_string; -- if (b->loc->cond) -- { -- xfree (b->loc->cond); -- b->loc->cond = NULL; -- } - b->loc->cond = parse_exp_1 (&s, b->exp_valid_block, 0); - } - } - - - -https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=196439 -http://sourceware.org/ml/gdb-patches/2008-04/msg00628.html -http://sourceware.org/ml/gdb-cvs/2008-05/msg00051.html - -Testcase: -gdb-6.5-bz196439-valgrind-memcheck-compat-test.patch - -2008-05-04 Jan Kratochvil - - * dwarf2loc.c (dwarf_expr_frame_base): Error out on missing - SYMBOL_LOCATION_BATON. - -=================================================================== -RCS file: /cvs/src/src/gdb/dwarf2loc.c,v -retrieving revision 1.50 -retrieving revision 1.51 -diff -u -r1.50 -r1.51 ---- src/gdb/dwarf2loc.c 2008/03/26 14:53:28 1.50 -+++ src/gdb/dwarf2loc.c 2008/05/04 12:44:16 1.51 -@@ -166,8 +166,13 @@ - { - struct dwarf2_locexpr_baton *symbaton; - symbaton = SYMBOL_LOCATION_BATON (framefunc); -- *length = symbaton->size; -- *start = symbaton->data; -+ if (symbaton != NULL) -+ { -+ *length = symbaton->size; -+ *start = symbaton->data; -+ } -+ else -+ *start = NULL; - } - - if (*start == NULL) - - - -http://sourceware.org/ml/gdb-patches/2008-04/msg00508.html -http://sourceware.org/ml/gdb-cvs/2008-05/msg00017.html - -Test applicable from: -gdb-6.8-watchpoint-conditionals-test.patch - -gdb/ -2008-05-02 Andreas Schwab - - * target.h (struct target_ops): Add - to_watchpoint_addr_within_range. - (target_watchpoint_addr_within_range): New function. - * target.c (update_current_target): Inherit - to_watchpoint_addr_within_range, defaulting to - default_watchpoint_addr_within_range. - (default_watchpoint_addr_within_range): New function. - (debug_to_watchpoint_addr_within_range): New function. - (setup_target_debug): Set to_watchpoint_addr_within_range. - * ppc-linux-nat.c (ppc_linux_watchpoint_addr_within_range): - New function. - (_initialize_ppc_linux_nat): Set to_watchpoint_addr_within_range. - * breakpoint.c (watchpoints_triggered): Use - target_watchpoint_addr_within_range. - -gdb/doc/ -2008-05-02 Andreas Schwab - - * gdbint.texinfo (Algorithms): Describe - target_watchpoint_addr_within_range. - -=================================================================== -RCS file: /cvs/src/src/gdb/target.h,v -retrieving revision 1.117 -retrieving revision 1.118 -diff -u -r1.117 -r1.118 ---- src/gdb/target.h 2008/05/01 19:31:51 1.117 -+++ src/gdb/target.h 2008/05/02 11:07:25 1.118 -@@ -367,6 +367,8 @@ - int to_have_steppable_watchpoint; - int to_have_continuable_watchpoint; - int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *); -+ int (*to_watchpoint_addr_within_range) (struct target_ops *, -+ CORE_ADDR, CORE_ADDR, int); - int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, int); - void (*to_terminal_init) (void); - void (*to_terminal_inferior) (void); -@@ -1093,6 +1095,9 @@ - #define target_stopped_data_address_p(CURRENT_TARGET) (1) - #endif - -+#define target_watchpoint_addr_within_range(target, addr, start, length) \ -+ (*target.to_watchpoint_addr_within_range) (target, addr, start, length) -+ - extern const struct target_desc *target_read_description (struct target_ops *); - - /* Command logging facility. */ -=================================================================== -RCS file: /cvs/src/src/gdb/target.c,v -retrieving revision 1.160 -retrieving revision 1.161 -diff -u -r1.160 -r1.161 ---- src/gdb/target.c 2008/04/24 10:21:44 1.160 -+++ src/gdb/target.c 2008/05/02 11:07:25 1.161 -@@ -49,6 +49,9 @@ - - static void default_terminal_info (char *, int); - -+static int default_watchpoint_addr_within_range (struct target_ops *, -+ CORE_ADDR, CORE_ADDR, int); -+ - static int default_region_ok_for_hw_watchpoint (CORE_ADDR, int); - - static int nosymbol (char *, CORE_ADDR *); -@@ -131,6 +134,9 @@ - - static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *); - -+static int debug_to_watchpoint_addr_within_range (struct target_ops *, -+ CORE_ADDR, CORE_ADDR, int); -+ - static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, int); - - static void debug_to_terminal_init (void); -@@ -416,9 +422,10 @@ - INHERIT (to_insert_watchpoint, t); - INHERIT (to_remove_watchpoint, t); - INHERIT (to_stopped_data_address, t); -- INHERIT (to_stopped_by_watchpoint, t); - INHERIT (to_have_steppable_watchpoint, t); - INHERIT (to_have_continuable_watchpoint, t); -+ INHERIT (to_stopped_by_watchpoint, t); -+ INHERIT (to_watchpoint_addr_within_range, t); - INHERIT (to_region_ok_for_hw_watchpoint, t); - INHERIT (to_terminal_init, t); - INHERIT (to_terminal_inferior, t); -@@ -544,6 +551,8 @@ - de_fault (to_stopped_data_address, - (int (*) (struct target_ops *, CORE_ADDR *)) - return_zero); -+ de_fault (to_watchpoint_addr_within_range, -+ default_watchpoint_addr_within_range); - de_fault (to_region_ok_for_hw_watchpoint, - default_region_ok_for_hw_watchpoint); - de_fault (to_terminal_init, -@@ -1881,6 +1890,14 @@ - } - - static int -+default_watchpoint_addr_within_range (struct target_ops *target, -+ CORE_ADDR addr, -+ CORE_ADDR start, int length) -+{ -+ return addr >= start && addr < start + length; -+} -+ -+static int - return_zero (void) - { - return 0; -@@ -2448,6 +2465,23 @@ - } - - static int -+debug_to_watchpoint_addr_within_range (struct target_ops *target, -+ CORE_ADDR addr, -+ CORE_ADDR start, int length) -+{ -+ int retval; -+ -+ retval = debug_target.to_watchpoint_addr_within_range (target, addr, -+ start, length); -+ -+ fprintf_filtered (gdb_stdlog, -+ "target_watchpoint_addr_within_range (0x%lx, 0x%lx, %d) = %d\n", -+ (unsigned long) addr, (unsigned long) start, length, -+ retval); -+ return retval; -+} -+ -+static int - debug_to_insert_hw_breakpoint (struct bp_target_info *bp_tgt) - { - int retval; -@@ -2790,6 +2824,7 @@ - current_target.to_remove_watchpoint = debug_to_remove_watchpoint; - current_target.to_stopped_by_watchpoint = debug_to_stopped_by_watchpoint; - current_target.to_stopped_data_address = debug_to_stopped_data_address; -+ current_target.to_watchpoint_addr_within_range = debug_to_watchpoint_addr_within_range; - current_target.to_region_ok_for_hw_watchpoint = debug_to_region_ok_for_hw_watchpoint; - current_target.to_terminal_init = debug_to_terminal_init; - current_target.to_terminal_inferior = debug_to_terminal_inferior; -=================================================================== -RCS file: /cvs/src/src/gdb/ppc-linux-nat.c,v -retrieving revision 1.78 -retrieving revision 1.79 -diff -u -r1.78 -r1.79 ---- src/gdb/ppc-linux-nat.c 2008/01/16 04:48:55 1.78 -+++ src/gdb/ppc-linux-nat.c 2008/05/02 11:07:25 1.79 -@@ -889,6 +889,16 @@ - return ppc_linux_stopped_data_address (¤t_target, &addr); - } - -+static int -+ppc_linux_watchpoint_addr_within_range (struct target_ops *target, -+ CORE_ADDR addr, -+ CORE_ADDR start, int length) -+{ -+ addr &= ~7; -+ /* Check whether [start, start+length-1] intersects [addr, addr+7]. */ -+ return start <= addr + 7 && start + length - 1 >= addr; -+} -+ - static void - ppc_linux_store_inferior_registers (struct regcache *regcache, int regno) - { -@@ -997,6 +1007,7 @@ - t->to_remove_watchpoint = ppc_linux_remove_watchpoint; - t->to_stopped_by_watchpoint = ppc_linux_stopped_by_watchpoint; - t->to_stopped_data_address = ppc_linux_stopped_data_address; -+ t->to_watchpoint_addr_within_range = ppc_linux_watchpoint_addr_within_range; - - t->to_read_description = ppc_linux_read_description; - -=================================================================== -RCS file: /cvs/src/src/gdb/breakpoint.c,v -retrieving revision 1.317 -retrieving revision 1.318 -diff -u -r1.317 -r1.318 ---- src/gdb/breakpoint.c 2008/05/01 20:35:33 1.317 -+++ src/gdb/breakpoint.c 2008/05/02 11:07:25 1.318 -@@ -2616,8 +2616,9 @@ - for (loc = b->loc; loc; loc = loc->next) - /* Exact match not required. Within range is - sufficient. */ -- if (addr >= loc->address -- && addr < loc->address + loc->length) -+ if (target_watchpoint_addr_within_range (¤t_target, -+ addr, loc->address, -+ loc->length)) - { - b->watchpoint_triggered = watch_triggered_yes; - break; -=================================================================== -RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v -retrieving revision 1.282 -retrieving revision 1.283 -diff -u -r1.282 -r1.283 ---- src/gdb/doc/gdbint.texinfo 2008/04/30 21:16:46 1.282 -+++ src/gdb/doc/gdbint.texinfo 2008/05/02 11:07:25 1.283 -@@ -9,7 +9,7 @@ - @ifinfo - This file documents the internals of the GNU debugger @value{GDBN}. - Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1998, 1999, 2000, 2001, -- 2002, 2003, 2004, 2005, 2006 -+ 2002, 2003, 2004, 2005, 2006, 2008 - Free Software Foundation, Inc. - Contributed by Cygnus Solutions. Written by John Gilmore. - Second Edition by Stan Shebs. -@@ -711,10 +711,19 @@ - resuming, this method should clear it. For instance, the x86 debug - control register has sticky triggered flags. - -+@findex target_watchpoint_addr_within_range -+@item target_watchpoint_addr_within_range (@var{target}, @var{addr}, @var{start}, @var{length}) -+Check whether @var{addr} (as returned by @code{target_stopped_data_address}) -+lies within the hardware-defined watchpoint region described by -+@var{start} and @var{length}. This only needs to be provided if the -+granularity of a watchpoint is greater than one byte, i.e., if the -+watchpoint can also trigger on nearby addresses outside of the watched -+region. -+ - @findex HAVE_STEPPABLE_WATCHPOINT - @item HAVE_STEPPABLE_WATCHPOINT - If defined to a non-zero value, it is not necessary to disable a --watchpoint to step over it. Like @code{gdbarch_have_nonsteppable_watchpoint}, -+watchpoint to step over it. Like @code{gdbarch_have_nonsteppable_watchpoint}, - this is usually set when watchpoints trigger at the instruction - which will perform an interesting read or write. It should be - set if there is a temporary disable bit which allows the processor - - - -[RFA] Try2: Ignore breakpoints when reading memory. -http://sourceware.org/ml/gdb-patches/2008-03/msg00106.html -http://sourceware.org/ml/gdb-cvs/2008-03/msg00058.html - -2008-03-13 Vladimir Prus - Daniel Jacobowitz - - * breakpoint.h (breakpoint_restore_shadows): New - declaration. - * breakpoint.c (breakpoint_restore_shadows): New. - (read_memory_nobpt): Delete. - * gdbcore.h (read_memory_nobpt): Delete declaration. - * target.c (memory_xfer_partial): Call - breakpoint_restore_shadows. - (restore_show_memory_breakpoints) - (make_show_memory_beakpoints_cleanup): New. - (show_memory_breakpoints): New. - * target.h (make_show_memory_beakpoints_cleanup): Declare. - * ppc-linux-tdep.c (ppc_linux_memory_remove_breakpoint): - Make sure we see memory breakpoints when checking if - breakpoint is still there. - * alpha-tdep.c, alphanbsd-tdep.c, frame.c, frv-tdep.c, - hppa-linux-tdep.c, hppa-tdep.c, i386-linux-nat.c, i386-tdep.c, - m68klinux-tdep.c, mips-tdep.c, mn10300-tdep.c, s390-tdep.c, - sparc-tdep.c: Use target_read_memory instead of read_memory_nobpt. - -=================================================================== -RCS file: /cvs/src/src/gdb/Makefile.in,v -retrieving revision 1.988 -retrieving revision 1.989 -diff -u -r1.988 -r1.989 ---- src/gdb/Makefile.in 2008/03/10 23:14:05 1.988 -+++ src/gdb/Makefile.in 2008/03/13 12:22:08 1.989 -@@ -2873,7 +2873,7 @@ - target.o: target.c $(defs_h) $(gdb_string_h) $(target_h) $(gdbcmd_h) \ - $(symtab_h) $(inferior_h) $(bfd_h) $(symfile_h) $(objfiles_h) \ - $(gdb_wait_h) $(dcache_h) $(regcache_h) $(gdb_assert_h) $(gdbcore_h) \ -- $(exceptions_h) $(target_descriptions_h) -+ $(exceptions_h) $(target_descriptions_h) $(gdb_stdint_h) - target-descriptions.o: target-descriptions.c $(defs_h) $(arch_utils_h) \ - $(target_h) $(target_descriptions_h) $(vec_h) $(xml_tdesc_h) \ - $(gdbcmd_h) $(gdb_assert_h) $(gdbtypes_h) $(reggroups_h) \ -=================================================================== -RCS file: /cvs/src/src/gdb/alpha-tdep.c,v -retrieving revision 1.182 -retrieving revision 1.183 -diff -u -r1.182 -r1.183 ---- src/gdb/alpha-tdep.c 2008/02/20 15:45:20 1.182 -+++ src/gdb/alpha-tdep.c 2008/03/13 12:22:11 1.183 -@@ -638,7 +638,7 @@ - gdb_byte buf[ALPHA_INSN_SIZE]; - int status; - -- status = read_memory_nobpt (pc, buf, sizeof (buf)); -+ status = target_read_memory (pc, buf, sizeof (buf)); - if (status) - memory_error (status, pc); - return extract_unsigned_integer (buf, sizeof (buf)); -=================================================================== -RCS file: /cvs/src/src/gdb/alphanbsd-tdep.c,v -retrieving revision 1.36 -retrieving revision 1.37 -diff -u -r1.36 -r1.37 ---- src/gdb/alphanbsd-tdep.c 2008/01/01 22:53:09 1.36 -+++ src/gdb/alphanbsd-tdep.c 2008/03/13 12:22:11 1.37 -@@ -216,7 +216,7 @@ - LONGEST off; - int i; - -- if (read_memory_nobpt (pc, (char *) w, 4) != 0) -+ if (target_read_memory (pc, (char *) w, 4) != 0) - return -1; - - for (i = 0; i < RETCODE_NWORDS; i++) -@@ -230,7 +230,7 @@ - off = i * 4; - pc -= off; - -- if (read_memory_nobpt (pc, (char *) ret, sizeof (ret)) != 0) -+ if (target_read_memory (pc, (char *) ret, sizeof (ret)) != 0) - return -1; - - if (memcmp (ret, sigtramp_retcode, RETCODE_SIZE) == 0) -=================================================================== -RCS file: /cvs/src/src/gdb/breakpoint.c,v -retrieving revision 1.305 -retrieving revision 1.306 -diff -u -r1.305 -r1.306 ---- src/gdb/breakpoint.c 2008/03/03 13:24:12 1.305 -+++ src/gdb/breakpoint.c 2008/03/13 12:22:11 1.306 -@@ -702,25 +702,16 @@ - error (_("No breakpoint number %d."), bnum); - } - --/* Like target_read_memory() but if breakpoints are inserted, return -- the shadow contents instead of the breakpoints themselves. -+/* Update BUF, which is LEN bytes read from the target address MEMADDR, -+ by replacing any memory breakpoints with their shadowed contents. */ - -- Read "memory data" from whatever target or inferior we have. -- Returns zero if successful, errno value if not. EIO is used -- for address out of bounds. If breakpoints are inserted, returns -- shadow contents, not the breakpoints themselves. From breakpoint.c. */ -- --int --read_memory_nobpt (CORE_ADDR memaddr, gdb_byte *myaddr, unsigned len) -+void -+breakpoint_restore_shadows (gdb_byte *buf, ULONGEST memaddr, LONGEST len) - { -- int status; -- const struct bp_location *b; -+ struct bp_location *b; - CORE_ADDR bp_addr = 0; - int bp_size = 0; -- -- if (gdbarch_breakpoint_from_pc (current_gdbarch, &bp_addr, &bp_size) == NULL) -- /* No breakpoints on this machine. */ -- return target_read_memory (memaddr, myaddr, len); -+ int bptoffset = 0; - - ALL_BP_LOCATIONS (b) - { -@@ -739,59 +730,35 @@ - if (bp_size == 0) - /* bp isn't valid, or doesn't shadow memory. */ - continue; -+ - if (bp_addr + bp_size <= memaddr) - /* The breakpoint is entirely before the chunk of memory we - are reading. */ - continue; -+ - if (bp_addr >= memaddr + len) - /* The breakpoint is entirely after the chunk of memory we are - reading. */ - continue; -- /* Copy the breakpoint from the shadow contents, and recurse for -- the things before and after. */ -- { -- /* Offset within shadow_contents. */ -- int bptoffset = 0; -- -- if (bp_addr < memaddr) -- { -- /* Only copy the second part of the breakpoint. */ -- bp_size -= memaddr - bp_addr; -- bptoffset = memaddr - bp_addr; -- bp_addr = memaddr; -- } -- -- if (bp_addr + bp_size > memaddr + len) -- { -- /* Only copy the first part of the breakpoint. */ -- bp_size -= (bp_addr + bp_size) - (memaddr + len); -- } - -- memcpy (myaddr + bp_addr - memaddr, -- b->target_info.shadow_contents + bptoffset, bp_size); -+ /* Offset within shadow_contents. */ -+ if (bp_addr < memaddr) -+ { -+ /* Only copy the second part of the breakpoint. */ -+ bp_size -= memaddr - bp_addr; -+ bptoffset = memaddr - bp_addr; -+ bp_addr = memaddr; -+ } - -- if (bp_addr > memaddr) -- { -- /* Copy the section of memory before the breakpoint. */ -- status = read_memory_nobpt (memaddr, myaddr, bp_addr - memaddr); -- if (status != 0) -- return status; -- } -+ if (bp_addr + bp_size > memaddr + len) -+ { -+ /* Only copy the first part of the breakpoint. */ -+ bp_size -= (bp_addr + bp_size) - (memaddr + len); -+ } - -- if (bp_addr + bp_size < memaddr + len) -- { -- /* Copy the section of memory after the breakpoint. */ -- status = read_memory_nobpt (bp_addr + bp_size, -- myaddr + bp_addr + bp_size - memaddr, -- memaddr + len - (bp_addr + bp_size)); -- if (status != 0) -- return status; -- } -- return 0; -- } -+ memcpy (buf + bp_addr - memaddr, -+ b->target_info.shadow_contents + bptoffset, bp_size); - } -- /* Nothing overlaps. Just call read_memory_noerr. */ -- return target_read_memory (memaddr, myaddr, len); - } - - -@@ -4299,7 +4266,7 @@ - /* Adjust the breakpoint's address prior to allocating a location. - Once we call allocate_bp_location(), that mostly uninitialized - location will be placed on the location chain. Adjustment of the -- breakpoint may cause read_memory_nobpt() to be called and we do -+ breakpoint may cause target_read_memory() to be called and we do - not want its scan of the location chain to find a breakpoint and - location that's only been partially initialized. */ - adjusted_address = adjust_breakpoint_address (sal.pc, bptype); -=================================================================== -RCS file: /cvs/src/src/gdb/breakpoint.h,v -retrieving revision 1.66 -retrieving revision 1.67 -diff -u -r1.66 -r1.67 ---- src/gdb/breakpoint.h 2008/03/03 13:24:12 1.66 -+++ src/gdb/breakpoint.h 2008/03/13 12:22:12 1.67 -@@ -859,4 +859,9 @@ - target. */ - int watchpoints_triggered (struct target_waitstatus *); - -+/* Update BUF, which is LEN bytes read from the target address MEMADDR, -+ by replacing any memory breakpoints with their shadowed contents. */ -+void breakpoint_restore_shadows (gdb_byte *buf, ULONGEST memaddr, -+ LONGEST len); -+ - #endif /* !defined (BREAKPOINT_H) */ -=================================================================== -RCS file: /cvs/src/src/gdb/frame.c,v -retrieving revision 1.237 -retrieving revision 1.238 -diff -u -r1.237 -r1.238 ---- src/gdb/frame.c 2008/02/28 16:24:24 1.237 -+++ src/gdb/frame.c 2008/03/13 12:22:12 1.238 -@@ -1691,8 +1691,8 @@ - safe_frame_unwind_memory (struct frame_info *this_frame, - CORE_ADDR addr, gdb_byte *buf, int len) - { -- /* NOTE: read_memory_nobpt returns zero on success! */ -- return !read_memory_nobpt (addr, buf, len); -+ /* NOTE: target_read_memory returns zero on success! */ -+ return !target_read_memory (addr, buf, len); - } - - /* Architecture method. */ -=================================================================== -RCS file: /cvs/src/src/gdb/frv-tdep.c,v -retrieving revision 1.118 -retrieving revision 1.119 -diff -u -r1.118 -r1.119 ---- src/gdb/frv-tdep.c 2008/01/11 13:19:59 1.118 -+++ src/gdb/frv-tdep.c 2008/03/13 12:22:12 1.119 -@@ -449,7 +449,7 @@ - char instr[frv_instr_size]; - int status; - -- status = read_memory_nobpt (addr, instr, sizeof instr); -+ status = target_read_memory (addr, instr, sizeof instr); - - if (status != 0) - break; -=================================================================== -RCS file: /cvs/src/src/gdb/gdbcore.h,v -retrieving revision 1.28 -retrieving revision 1.29 -diff -u -r1.28 -r1.29 ---- src/gdb/gdbcore.h 2008/01/01 22:53:10 1.28 -+++ src/gdb/gdbcore.h 2008/03/13 12:22:12 1.29 -@@ -39,18 +39,6 @@ - - extern int have_core_file_p (void); - --/* Read "memory data" from whatever target or inferior we have. -- Returns zero if successful, errno value if not. EIO is used for -- address out of bounds. If breakpoints are inserted, returns shadow -- contents, not the breakpoints themselves. From breakpoint.c. */ -- --/* NOTE: cagney/2004-06-10: Code reading from a live inferior can use -- the get_frame_memory methods, code reading from an exec can use the -- target methods. */ -- --extern int read_memory_nobpt (CORE_ADDR memaddr, gdb_byte *myaddr, -- unsigned len); -- - /* Report a memory error with error(). */ - - extern void memory_error (int status, CORE_ADDR memaddr); -=================================================================== -RCS file: /cvs/src/src/gdb/hppa-linux-tdep.c,v -retrieving revision 1.27 -retrieving revision 1.28 -diff -u -r1.27 -r1.28 ---- src/gdb/hppa-linux-tdep.c 2008/02/18 16:11:21 1.27 -+++ src/gdb/hppa-linux-tdep.c 2008/03/13 12:22:12 1.28 -@@ -101,7 +101,7 @@ - { - char buf[4]; - -- read_memory_nobpt (npc, buf, 4); -+ target_read_memory (npc, buf, 4); - insn[i] = extract_unsigned_integer (buf, 4); - if ((insn[i] & pattern[i].mask) == pattern[i].data) - npc += 4; -=================================================================== -RCS file: /cvs/src/src/gdb/hppa-tdep.c,v -retrieving revision 1.247 -retrieving revision 1.248 -diff -u -r1.247 -r1.248 ---- src/gdb/hppa-tdep.c 2008/02/18 16:11:21 1.247 -+++ src/gdb/hppa-tdep.c 2008/03/13 12:22:12 1.248 -@@ -545,7 +545,7 @@ - char buf[4]; - int off; - -- status = read_memory_nobpt (pc, buf, 4); -+ status = target_read_memory (pc, buf, 4); - if (status != 0) - return 0; - -@@ -1552,7 +1552,7 @@ - old_save_sp = save_sp; - old_stack_remaining = stack_remaining; - -- status = read_memory_nobpt (pc, buf, 4); -+ status = target_read_memory (pc, buf, 4); - inst = extract_unsigned_integer (buf, 4); - - /* Yow! */ -@@ -1603,7 +1603,7 @@ - && reg_num <= 26) - { - pc += 4; -- status = read_memory_nobpt (pc, buf, 4); -+ status = target_read_memory (pc, buf, 4); - inst = extract_unsigned_integer (buf, 4); - if (status != 0) - return pc; -@@ -1616,7 +1616,7 @@ - reg_num = inst_saves_fr (inst); - save_fr &= ~(1 << reg_num); - -- status = read_memory_nobpt (pc + 4, buf, 4); -+ status = target_read_memory (pc + 4, buf, 4); - next_inst = extract_unsigned_integer (buf, 4); - - /* Yow! */ -@@ -1647,13 +1647,13 @@ - <= (gdbarch_ptr_bit (gdbarch) == 64 ? 11 : 7)) - { - pc += 8; -- status = read_memory_nobpt (pc, buf, 4); -+ status = target_read_memory (pc, buf, 4); - inst = extract_unsigned_integer (buf, 4); - if (status != 0) - return pc; - if ((inst & 0xfc000000) != 0x34000000) - break; -- status = read_memory_nobpt (pc + 4, buf, 4); -+ status = target_read_memory (pc + 4, buf, 4); - next_inst = extract_unsigned_integer (buf, 4); - if (status != 0) - return pc; -@@ -2857,7 +2857,7 @@ - { - gdb_byte buf[HPPA_INSN_SIZE]; - -- read_memory_nobpt (npc, buf, HPPA_INSN_SIZE); -+ target_read_memory (npc, buf, HPPA_INSN_SIZE); - insn[i] = extract_unsigned_integer (buf, HPPA_INSN_SIZE); - if ((insn[i] & pattern[i].mask) == pattern[i].data) - npc += 4; -=================================================================== -RCS file: /cvs/src/src/gdb/i386-linux-nat.c,v -retrieving revision 1.86 -retrieving revision 1.87 -diff -u -r1.86 -r1.87 ---- src/gdb/i386-linux-nat.c 2008/03/01 04:39:36 1.86 -+++ src/gdb/i386-linux-nat.c 2008/03/13 12:22:13 1.87 -@@ -770,7 +770,7 @@ - that's about to be restored, and set the trace flag there. */ - - /* First check if PC is at a system call. */ -- if (read_memory_nobpt (pc, buf, LINUX_SYSCALL_LEN) == 0 -+ if (target_read_memory (pc, buf, LINUX_SYSCALL_LEN) == 0 - && memcmp (buf, linux_syscall, LINUX_SYSCALL_LEN) == 0) - { - ULONGEST syscall; -=================================================================== -RCS file: /cvs/src/src/gdb/i386-tdep.c,v -retrieving revision 1.251 -retrieving revision 1.252 -diff -u -r1.251 -r1.252 ---- src/gdb/i386-tdep.c 2008/03/11 05:21:38 1.251 -+++ src/gdb/i386-tdep.c 2008/03/13 12:22:13 1.252 -@@ -344,7 +344,7 @@ - long delta = 0; - int data16 = 0; - -- read_memory_nobpt (pc, &op, 1); -+ target_read_memory (pc, &op, 1); - if (op == 0x66) - { - data16 = 1; -@@ -410,12 +410,12 @@ - if (current_pc <= pc) - return pc; - -- read_memory_nobpt (pc, &op, 1); -+ target_read_memory (pc, &op, 1); - - if (op != 0x58) /* popl %eax */ - return pc; - -- read_memory_nobpt (pc + 1, buf, 4); -+ target_read_memory (pc + 1, buf, 4); - if (memcmp (buf, proto1, 3) != 0 && memcmp (buf, proto2, 4) != 0) - return pc; - -@@ -454,7 +454,7 @@ - gdb_byte buf[8]; - gdb_byte op; - -- read_memory_nobpt (pc, &op, 1); -+ target_read_memory (pc, &op, 1); - - if (op == 0x68 || op == 0x6a) - { -@@ -541,7 +541,7 @@ - struct i386_insn *insn; - gdb_byte op; - -- read_memory_nobpt (pc, &op, 1); -+ target_read_memory (pc, &op, 1); - - for (insn = skip_insns; insn->len > 0; insn++) - { -@@ -554,7 +554,7 @@ - gdb_assert (insn->len > 1); - gdb_assert (insn->len <= I386_MAX_INSN_LEN); - -- read_memory_nobpt (pc + 1, buf, insn->len - 1); -+ target_read_memory (pc + 1, buf, insn->len - 1); - for (i = 1; i < insn->len; i++) - { - if ((buf[i - 1] & insn->mask[i]) != insn->insn[i]) -@@ -632,7 +632,7 @@ - gdb_byte op; - int check = 1; - -- read_memory_nobpt (pc, &op, 1); -+ target_read_memory (pc, &op, 1); - - while (check) - { -@@ -641,7 +641,7 @@ - if (op == 0x90) - { - pc += 1; -- read_memory_nobpt (pc, &op, 1); -+ target_read_memory (pc, &op, 1); - check = 1; - } - /* Ignore no-op instruction `mov %edi, %edi'. -@@ -657,11 +657,11 @@ - - else if (op == 0x8b) - { -- read_memory_nobpt (pc + 1, &op, 1); -+ target_read_memory (pc + 1, &op, 1); - if (op == 0xff) - { - pc += 2; -- read_memory_nobpt (pc, &op, 1); -+ target_read_memory (pc, &op, 1); - check = 1; - } - } -@@ -685,7 +685,7 @@ - if (limit <= pc) - return limit; - -- read_memory_nobpt (pc, &op, 1); -+ target_read_memory (pc, &op, 1); - - if (op == 0x55) /* pushl %ebp */ - { -@@ -720,7 +720,7 @@ - if (limit <= pc + skip) - return limit; - -- read_memory_nobpt (pc + skip, &op, 1); -+ target_read_memory (pc + skip, &op, 1); - - /* Check for `movl %esp, %ebp' -- can be written in two ways. */ - switch (op) -@@ -754,7 +754,7 @@ - - NOTE: You can't subtract a 16-bit immediate from a 32-bit - reg, so we don't have to worry about a data16 prefix. */ -- read_memory_nobpt (pc, &op, 1); -+ target_read_memory (pc, &op, 1); - if (op == 0x83) - { - /* `subl' with 8-bit immediate. */ -@@ -810,7 +810,7 @@ - offset -= cache->locals; - for (i = 0; i < 8 && pc < current_pc; i++) - { -- read_memory_nobpt (pc, &op, 1); -+ target_read_memory (pc, &op, 1); - if (op < 0x50 || op > 0x57) - break; - -@@ -900,7 +900,7 @@ - - for (i = 0; i < 6; i++) - { -- read_memory_nobpt (pc + i, &op, 1); -+ target_read_memory (pc + i, &op, 1); - if (pic_pat[i] != op) - break; - } -@@ -908,7 +908,7 @@ - { - int delta = 6; - -- read_memory_nobpt (pc + delta, &op, 1); -+ target_read_memory (pc + delta, &op, 1); - - if (op == 0x89) /* movl %ebx, x(%ebp) */ - { -@@ -921,7 +921,7 @@ - else /* Unexpected instruction. */ - delta = 0; - -- read_memory_nobpt (pc + delta, &op, 1); -+ target_read_memory (pc + delta, &op, 1); - } - - /* addl y,%ebx */ -=================================================================== -RCS file: /cvs/src/src/gdb/m68klinux-tdep.c,v -retrieving revision 1.27 -retrieving revision 1.28 -diff -u -r1.27 -r1.28 ---- src/gdb/m68klinux-tdep.c 2008/01/01 22:53:12 1.27 -+++ src/gdb/m68klinux-tdep.c 2008/03/13 12:22:13 1.28 -@@ -69,7 +69,7 @@ - char buf[12]; - unsigned long insn0, insn1, insn2; - -- if (read_memory_nobpt (pc - 4, buf, sizeof (buf))) -+ if (target_read_memory (pc - 4, buf, sizeof (buf))) - return 0; - insn1 = extract_unsigned_integer (buf + 4, 4); - insn2 = extract_unsigned_integer (buf + 8, 4); -=================================================================== -RCS file: /cvs/src/src/gdb/mips-tdep.c,v -retrieving revision 1.469 -retrieving revision 1.470 -diff -u -r1.469 -r1.470 ---- src/gdb/mips-tdep.c 2008/02/20 14:34:43 1.469 -+++ src/gdb/mips-tdep.c 2008/03/13 12:22:13 1.470 -@@ -926,7 +926,7 @@ - } - else - instlen = MIPS_INSN32_SIZE; -- status = read_memory_nobpt (addr, buf, instlen); -+ status = target_read_memory (addr, buf, instlen); - if (status) - memory_error (status, addr); - return extract_unsigned_integer (buf, instlen); -=================================================================== -RCS file: /cvs/src/src/gdb/mn10300-tdep.c,v -retrieving revision 1.154 -retrieving revision 1.155 -diff -u -r1.154 -r1.155 ---- src/gdb/mn10300-tdep.c 2008/02/05 16:20:20 1.154 -+++ src/gdb/mn10300-tdep.c 2008/03/13 12:22:13 1.155 -@@ -620,7 +620,7 @@ - goto finish_prologue; - - /* Get the next two bytes so the prologue scan can continue. */ -- status = read_memory_nobpt (addr, buf, 2); -+ status = target_read_memory (addr, buf, 2); - if (status != 0) - goto finish_prologue; - } -@@ -761,7 +761,7 @@ - if (!fmov_found) - { - addr = restore_addr; -- status = read_memory_nobpt (addr, buf, 2); -+ status = target_read_memory (addr, buf, 2); - if (status != 0) - goto finish_prologue; - stack_extra_size = 0; -=================================================================== -RCS file: /cvs/src/src/gdb/ppc-linux-tdep.c,v -retrieving revision 1.94 -retrieving revision 1.95 -diff -u -r1.94 -r1.95 ---- src/gdb/ppc-linux-tdep.c 2008/02/20 14:31:40 1.94 -+++ src/gdb/ppc-linux-tdep.c 2008/03/13 12:22:13 1.95 -@@ -281,12 +281,15 @@ - int val; - int bplen; - gdb_byte old_contents[BREAKPOINT_MAX]; -+ struct cleanup *cleanup; - - /* Determine appropriate breakpoint contents and size for this address. */ - bp = gdbarch_breakpoint_from_pc (gdbarch, &addr, &bplen); - if (bp == NULL) - error (_("Software breakpoints not implemented for this target.")); - -+ /* Make sure we see the memory breakpoints. */ -+ cleanup = make_show_memory_breakpoints_cleanup (1); - val = target_read_memory (addr, old_contents, bplen); - - /* If our breakpoint is no longer at the address, this means that the -@@ -295,6 +298,7 @@ - if (val == 0 && memcmp (bp, old_contents, bplen) == 0) - val = target_write_memory (addr, bp_tgt->shadow_contents, bplen); - -+ do_cleanups (cleanup); - return val; - } - -=================================================================== -RCS file: /cvs/src/src/gdb/s390-tdep.c,v -retrieving revision 1.170 -retrieving revision 1.171 -diff -u -r1.170 -r1.171 ---- src/gdb/s390-tdep.c 2008/01/31 15:43:32 1.170 -+++ src/gdb/s390-tdep.c 2008/03/13 12:22:13 1.171 -@@ -503,12 +503,12 @@ - static int s390_instrlen[] = { 2, 4, 4, 6 }; - int instrlen; - -- if (read_memory_nobpt (at, &instr[0], 2)) -+ if (target_read_memory (at, &instr[0], 2)) - return -1; - instrlen = s390_instrlen[instr[0] >> 6]; - if (instrlen > 2) - { -- if (read_memory_nobpt (at + 2, &instr[2], instrlen - 2)) -+ if (target_read_memory (at + 2, &instr[2], instrlen - 2)) - return -1; - } - return instrlen; -@@ -1132,19 +1132,19 @@ - int d2; - - if (word_size == 4 -- && !read_memory_nobpt (pc - 4, insn, 4) -+ && !target_read_memory (pc - 4, insn, 4) - && is_rs (insn, op_lm, &r1, &r3, &d2, &b2) - && r3 == S390_SP_REGNUM - S390_R0_REGNUM) - return 1; - - if (word_size == 4 -- && !read_memory_nobpt (pc - 6, insn, 6) -+ && !target_read_memory (pc - 6, insn, 6) - && is_rsy (insn, op1_lmy, op2_lmy, &r1, &r3, &d2, &b2) - && r3 == S390_SP_REGNUM - S390_R0_REGNUM) - return 1; - - if (word_size == 8 -- && !read_memory_nobpt (pc - 6, insn, 6) -+ && !target_read_memory (pc - 6, insn, 6) - && is_rsy (insn, op1_lmg, op2_lmg, &r1, &r3, &d2, &b2) - && r3 == S390_SP_REGNUM - S390_R0_REGNUM) - return 1; -@@ -1658,7 +1658,7 @@ - CORE_ADDR pc = frame_pc_unwind (next_frame); - bfd_byte sigreturn[2]; - -- if (read_memory_nobpt (pc, sigreturn, 2)) -+ if (target_read_memory (pc, sigreturn, 2)) - return NULL; - - if (sigreturn[0] != 0x0a /* svc */) -=================================================================== -RCS file: /cvs/src/src/gdb/sparc-tdep.c,v -retrieving revision 1.193 -retrieving revision 1.194 -diff -u -r1.193 -r1.194 ---- src/gdb/sparc-tdep.c 2008/01/11 14:43:15 1.193 -+++ src/gdb/sparc-tdep.c 2008/03/13 12:22:13 1.194 -@@ -99,7 +99,7 @@ - int i; - - /* If we can't read the instruction at PC, return zero. */ -- if (read_memory_nobpt (pc, buf, sizeof (buf))) -+ if (target_read_memory (pc, buf, sizeof (buf))) - return 0; - - insn = 0; -=================================================================== -RCS file: /cvs/src/src/gdb/target.c,v -retrieving revision 1.155 -retrieving revision 1.156 -diff -u -r1.155 -r1.156 ---- src/gdb/target.c 2008/02/28 16:26:17 1.155 -+++ src/gdb/target.c 2008/03/13 12:22:13 1.156 -@@ -39,6 +39,7 @@ - #include "gdbcore.h" - #include "exceptions.h" - #include "target-descriptions.h" -+#include "gdb_stdint.h" - - static void target_info (char *, int); - -@@ -203,6 +204,11 @@ - - static int trust_readonly = 0; - -+/* Nonzero if we should show true memory content including -+ memory breakpoint inserted by gdb. */ -+ -+static int show_memory_breakpoints = 0; -+ - /* Non-zero if we want to see trace of target level stuff. */ - - static int targetdebug = 0; -@@ -1064,7 +1070,11 @@ - if (res <= 0) - return -1; - else -- return res; -+ { -+ if (readbuf && !show_memory_breakpoints) -+ breakpoint_restore_shadows (readbuf, memaddr, reg_len); -+ return res; -+ } - } - - /* If none of those methods found the memory we wanted, fall back -@@ -1082,22 +1092,41 @@ - res = ops->to_xfer_partial (ops, TARGET_OBJECT_MEMORY, NULL, - readbuf, writebuf, memaddr, reg_len); - if (res > 0) -- return res; -+ break; - - /* We want to continue past core files to executables, but not - past a running target's memory. */ - if (ops->to_has_all_memory) -- return res; -+ break; - - ops = ops->beneath; - } - while (ops != NULL); - -+ if (readbuf && !show_memory_breakpoints) -+ breakpoint_restore_shadows (readbuf, memaddr, reg_len); -+ - /* If we still haven't got anything, return the last error. We - give up. */ - return res; - } - -+static void -+restore_show_memory_breakpoints (void *arg) -+{ -+ show_memory_breakpoints = (uintptr_t) arg; -+} -+ -+struct cleanup * -+make_show_memory_breakpoints_cleanup (int show) -+{ -+ int current = show_memory_breakpoints; -+ show_memory_breakpoints = show; -+ -+ return make_cleanup (restore_show_memory_breakpoints, -+ (void *) (uintptr_t) current); -+} -+ - static LONGEST - target_xfer_partial (struct target_ops *ops, - enum target_object object, const char *annex, -=================================================================== -RCS file: /cvs/src/src/gdb/target.h,v -retrieving revision 1.111 -retrieving revision 1.112 -diff -u -r1.111 -r1.112 ---- src/gdb/target.h 2008/02/28 16:26:17 1.111 -+++ src/gdb/target.h 2008/03/13 12:22:14 1.112 -@@ -1250,6 +1250,11 @@ - - /* Any target can call this to switch to remote protocol (in remote.c). */ - extern void push_remote_target (char *name, int from_tty); -+ -+/* Set the show memory breakpoints mode to show, and installs a cleanup -+ to restore it back to the current value. */ -+extern struct cleanup *make_show_memory_breakpoints_cleanup (int show); -+ - - /* Imported from machine dependent code */ - - - - -[commit] SIGILL in ld.so when running program from GDB on ia64-linux -http://sourceware.org/ml/gdb-patches/2008-04/msg00674.html -http://sourceware.org/ml/gdb-cvs/2008-04/msg00173.html - -2008-04-29 Joel Brobecker - - * ia64-tdep.c (ia64_memory_remove_breakpoint): Set - show_memory_breakpoints to 1 while reading the instruction bundle. - -=================================================================== -RCS file: /cvs/src/src/gdb/ia64-tdep.c,v -retrieving revision 1.174 -retrieving revision 1.175 -diff -u -r1.174 -r1.175 ---- src/gdb/ia64-tdep.c 2008/04/22 11:03:41 1.174 -+++ src/gdb/ia64-tdep.c 2008/04/29 21:14:06 1.175 -@@ -598,9 +598,15 @@ - long long instr; - int val; - int template; -+ struct cleanup *cleanup; - - addr &= ~0x0f; - -+ /* Disable the automatic memory restoration from breakpoints while -+ we read our instruction bundle. Otherwise, the general restoration -+ mechanism kicks in and ends up corrupting our bundle, because it -+ is not aware of the concept of instruction bundles. */ -+ cleanup = make_show_memory_breakpoints_cleanup (1); - val = target_read_memory (addr, bundle, BUNDLE_LEN); - - /* Check for L type instruction in 2nd slot, if present then -@@ -616,6 +622,7 @@ - if (val == 0) - target_write_memory (addr, bundle, BUNDLE_LEN); - -+ do_cleanups (cleanup); - return val; - } - diff --git a/gdb-6.8-watchpoint-inaccessible-memory.patch b/gdb-6.8-watchpoint-inaccessible-memory.patch deleted file mode 100644 index b7a154c..0000000 --- a/gdb-6.8-watchpoint-inaccessible-memory.patch +++ /dev/null @@ -1,482 +0,0 @@ -http://sourceware.org/ml/gdb-patches/2008-02/msg00472.html - -2008-02-28 Daniel Jacobowitz - - * breakpoint.c (fetch_watchpoint_value): New function. - (update_watchpoint): Set and clear val_valid. Use - fetch_watchpoint_value. Handle unreadable values on the - value chain. Correct check for user-requested array watchpoints. - (breakpoint_init_inferior): Clear val_valid. - (watchpoint_value_print): New function. - (print_it_typical): Use it. Do not free or clear old_val. Print - watchpoints even if old_val == NULL. - (watchpoint_check): Use fetch_watchpoint_value. Check for values - becoming readable or unreadable. - (watch_command_1): Use fetch_watchpoint_value. Set val_valid. - (do_enable_watchpoint): Likewise. - * breakpoint.h (struct breakpoint): Update comment for val. Add - val_valid. - * NEWS: Mention watchpoints on inaccessible memory. - -2008-02-28 Daniel Jacobowitz - - * gdb.base/watchpoint.c (global_ptr, func4): New. - (main): Call func4. - * gdb.base/watchpoint.exp: Call test_inaccessible_watchpoint. - (test_inaccessible_watchpoint): New. - -[ Backported for GDB-6.8. ] - -It fixes the regression since GDB-6.7.1rh on x86_64 -m64 -fPIE/-pie: - -PASS: gdb.base/watchpoint.exp: run to marker1 in test_simple_watchpoint - +FAIL: gdb.base/watchpoint.exp: run to marker1 in test_simple_watchpoint - -Index: gdb-6.8/gdb/NEWS -=================================================================== ---- gdb-6.8.orig/gdb/NEWS 2008-04-19 20:48:13.000000000 +0200 -+++ gdb-6.8/gdb/NEWS 2008-04-19 20:50:24.000000000 +0200 -@@ -1,6 +1,9 @@ - What has changed in GDB? - (Organized release by release) - -+* Watchpoints can now be set on unreadable memory locations, e.g. addresses -+which will be allocated using malloc later in program execution. -+ - *** Changes in GDB 6.8 - - * New native configurations -Index: gdb-6.8/gdb/breakpoint.c -=================================================================== ---- gdb-6.8.orig/gdb/breakpoint.c 2008-04-19 20:48:11.000000000 +0200 -+++ gdb-6.8/gdb/breakpoint.c 2008-04-19 20:51:49.000000000 +0200 -@@ -55,6 +55,7 @@ - #include "memattr.h" - #include "ada-lang.h" - #include "top.h" -+#include "wrapper.h" - - #include "gdb-events.h" - #include "mi/mi-common.h" -@@ -826,7 +827,65 @@ is_hardware_watchpoint (struct breakpoin - || bpt->type == bp_access_watchpoint); - } - --/* Assuming that B is a hardware breakpoint: -+/* Find the current value of a watchpoint on EXP. Return the value in -+ *VALP and *RESULTP and the chain of intermediate and final values -+ in *VAL_CHAIN. RESULTP and VAL_CHAIN may be NULL if the caller does -+ not need them. -+ -+ If an error occurs while evaluating the expression, *RESULTP will -+ be set to NULL. *RESULTP may be a lazy value, if the result could -+ not be read from memory. It is used to determine whether a value -+ is user-specified (we should watch the whole value) or intermediate -+ (we should watch only the bit used to locate the final value). -+ -+ If the final value, or any intermediate value, could not be read -+ from memory, *VALP will be set to NULL. *VAL_CHAIN will still be -+ set to any referenced values. *VALP will never be a lazy value. -+ This is the value which we store in struct breakpoint. -+ -+ If VAL_CHAIN is non-NULL, *VAL_CHAIN will be released from the -+ value chain. The caller must free the values individually. If -+ VAL_CHAIN is NULL, all generated values will be left on the value -+ chain. */ -+ -+static void -+fetch_watchpoint_value (struct expression *exp, struct value **valp, -+ struct value **resultp, struct value **val_chain) -+{ -+ struct value *mark, *new_mark, *result; -+ -+ *valp = NULL; -+ if (resultp) -+ *resultp = NULL; -+ if (val_chain) -+ *val_chain = NULL; -+ -+ /* Evaluate the expression. */ -+ mark = value_mark (); -+ result = NULL; -+ gdb_evaluate_expression (exp, &result); -+ new_mark = value_mark (); -+ if (mark == new_mark) -+ return; -+ if (resultp) -+ *resultp = result; -+ -+ /* Make sure it's not lazy, so that after the target stops again we -+ have a non-lazy previous value to compare with. */ -+ if (result != NULL -+ && (!value_lazy (result) || gdb_value_fetch_lazy (result))) -+ *valp = result; -+ -+ if (val_chain) -+ { -+ /* Return the chain of intermediate values. We use this to -+ decide which addresses to watch. */ -+ *val_chain = new_mark; -+ value_release_to_mark (mark); -+ } -+} -+ -+/* Assuming that B is a hardware watchpoint: - - Reparse watchpoint expression, is REPARSE is non-zero - - Evaluate expression and store the result in B->val - - Update the list of values that must be watched in B->loc. -@@ -837,7 +896,6 @@ static void - update_watchpoint (struct breakpoint *b, int reparse) - { - int within_current_scope; -- struct value *mark = value_mark (); - struct frame_id saved_frame_id; - struct bp_location *loc; - bpstat bs; -@@ -889,9 +947,9 @@ update_watchpoint (struct breakpoint *b, - to the user when the old value and the new value may actually - be completely different objects. */ - value_free (b->val); -- b->val = NULL; -+ b->val = NULL; -+ b->val_valid = 0; - } -- - - /* If we failed to parse the expression, for example because - it refers to a global variable in a not-yet-loaded shared library, -@@ -900,43 +958,37 @@ update_watchpoint (struct breakpoint *b, - is different from out-of-scope watchpoint. */ - if (within_current_scope && b->exp) - { -- struct value *v, *next; -+ struct value *val_chain, *v, *result, *next; -+ -+ fetch_watchpoint_value (b->exp, &v, &result, &val_chain); - -- /* Evaluate the expression and make sure it's not lazy, so that -- after target stops again, we have a non-lazy previous value -- to compare with. Also, making the value non-lazy will fetch -- intermediate values as needed, which we use to decide which -- addresses to watch. -- -- The value returned by evaluate_expression is stored in b->val. -- In addition, we look at all values which were created -- during evaluation, and set watchoints at addresses as needed. -- Those values are explicitly deleted here. */ -- v = evaluate_expression (b->exp); - /* Avoid setting b->val if it's already set. The meaning of - b->val is 'the last value' user saw, and we should update - it only if we reported that last value to user. As it - happens, the code that reports it updates b->val directly. */ -- if (b->val == NULL) -- b->val = v; -- value_contents (v); -- value_release_to_mark (mark); -+ if (!b->val_valid) -+ { -+ b->val = v; -+ b->val_valid = 1; -+ } - - /* Look at each value on the value chain. */ -- for (; v; v = next) -+ for (v = val_chain; v; v = next) - { - /* If it's a memory location, and GDB actually needed - its contents to evaluate the expression, then we -- must watch it. */ -+ must watch it. If the first value returned is -+ still lazy, that means an error occurred reading it; -+ watch it anyway in case it becomes readable. */ - if (VALUE_LVAL (v) == lval_memory -- && ! value_lazy (v)) -+ && (v == val_chain || ! value_lazy (v))) - { - struct type *vtype = check_typedef (value_type (v)); - - /* We only watch structs and arrays if user asked - for it explicitly, never if they just happen to - appear in the middle of some value chain. */ -- if (v == b->val -+ if (v == result - || (TYPE_CODE (vtype) != TYPE_CODE_STRUCT - && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) - { -@@ -1682,6 +1734,7 @@ breakpoint_init_inferior (enum inf_conte - if (b->val) - value_free (b->val); - b->val = NULL; -+ b->val_valid = 0; - } - break; - default: -@@ -2104,6 +2157,17 @@ top: - do_cleanups (old_chain); - } - -+/* Print out the (old or new) value associated with a watchpoint. */ -+ -+static void -+watchpoint_value_print (struct value *val, struct ui_file *stream) -+{ -+ if (val == NULL) -+ fprintf_unfiltered (stream, _("")); -+ else -+ value_print (val, stream, 0, Val_pretty_default); -+} -+ - /* This is the normal print function for a bpstat. In the future, - much of this logic could (should?) be moved to bpstat_stop_status, - by having it set different print_it values. -@@ -2222,26 +2286,21 @@ print_it_typical (bpstat bs) - - case bp_watchpoint: - case bp_hardware_watchpoint: -- if (bs->old_val != NULL) -- { -- annotate_watchpoint (b->number); -- if (ui_out_is_mi_like_p (uiout)) -- ui_out_field_string -- (uiout, "reason", -- async_reason_lookup (EXEC_ASYNC_WATCHPOINT_TRIGGER)); -- mention (b); -- ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value"); -- ui_out_text (uiout, "\nOld value = "); -- value_print (bs->old_val, stb->stream, 0, Val_pretty_default); -- ui_out_field_stream (uiout, "old", stb); -- ui_out_text (uiout, "\nNew value = "); -- value_print (b->val, stb->stream, 0, Val_pretty_default); -- ui_out_field_stream (uiout, "new", stb); -- do_cleanups (ui_out_chain); -- ui_out_text (uiout, "\n"); -- value_free (bs->old_val); -- bs->old_val = NULL; -- } -+ annotate_watchpoint (b->number); -+ if (ui_out_is_mi_like_p (uiout)) -+ ui_out_field_string -+ (uiout, "reason", -+ async_reason_lookup (EXEC_ASYNC_WATCHPOINT_TRIGGER)); -+ mention (b); -+ ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value"); -+ ui_out_text (uiout, "\nOld value = "); -+ watchpoint_value_print (bs->old_val, stb->stream); -+ ui_out_field_stream (uiout, "old", stb); -+ ui_out_text (uiout, "\nNew value = "); -+ watchpoint_value_print (b->val, stb->stream); -+ ui_out_field_stream (uiout, "new", stb); -+ do_cleanups (ui_out_chain); -+ ui_out_text (uiout, "\n"); - /* More than one watchpoint may have been triggered. */ - return PRINT_UNKNOWN; - break; -@@ -2254,7 +2313,7 @@ print_it_typical (bpstat bs) - mention (b); - ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value"); - ui_out_text (uiout, "\nValue = "); -- value_print (b->val, stb->stream, 0, Val_pretty_default); -+ watchpoint_value_print (b->val, stb->stream); - ui_out_field_stream (uiout, "value", stb); - do_cleanups (ui_out_chain); - ui_out_text (uiout, "\n"); -@@ -2262,7 +2321,7 @@ print_it_typical (bpstat bs) - break; - - case bp_access_watchpoint: -- if (bs->old_val != NULL) -+ if (bs->old_val != NULL) - { - annotate_watchpoint (b->number); - if (ui_out_is_mi_like_p (uiout)) -@@ -2272,10 +2331,8 @@ print_it_typical (bpstat bs) - mention (b); - ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value"); - ui_out_text (uiout, "\nOld value = "); -- value_print (bs->old_val, stb->stream, 0, Val_pretty_default); -+ watchpoint_value_print (bs->old_val, stb->stream); - ui_out_field_stream (uiout, "old", stb); -- value_free (bs->old_val); -- bs->old_val = NULL; - ui_out_text (uiout, "\nNew value = "); - } - else -@@ -2288,7 +2345,7 @@ print_it_typical (bpstat bs) - ui_out_chain = make_cleanup_ui_out_tuple_begin_end (uiout, "value"); - ui_out_text (uiout, "\nValue = "); - } -- value_print (b->val, stb->stream, 0,Val_pretty_default); -+ watchpoint_value_print (b->val, stb->stream); - ui_out_field_stream (uiout, "new", stb); - do_cleanups (ui_out_chain); - ui_out_text (uiout, "\n"); -@@ -2575,13 +2632,20 @@ watchpoint_check (void *p) - we might be in the middle of evaluating a function call. */ - - struct value *mark = value_mark (); -- struct value *new_val = evaluate_expression (b->exp); -- if (!value_equal (b->val, new_val)) -+ struct value *new_val; -+ -+ fetch_watchpoint_value (b->exp, &new_val, NULL, NULL); -+ if ((b->val != NULL) != (new_val != NULL) -+ || (b->val != NULL && !value_equal (b->val, new_val))) - { -- release_value (new_val); -- value_free_to_mark (mark); -+ if (new_val != NULL) -+ { -+ release_value (new_val); -+ value_free_to_mark (mark); -+ } - bs->old_val = b->val; - b->val = new_val; -+ b->val_valid = 1; - /* We will stop here */ - return WP_VALUE_CHANGED; - } -@@ -5723,10 +5787,9 @@ watch_command_1 (char *arg, int accessfl - exp_end = arg; - exp_valid_block = innermost_block; - mark = value_mark (); -- val = evaluate_expression (exp); -- release_value (val); -- if (value_lazy (val)) -- value_fetch_lazy (val); -+ fetch_watchpoint_value (exp, &val, NULL, NULL); -+ if (val != NULL) -+ release_value (val); - - tok = arg; - while (*tok == ' ' || *tok == '\t') -@@ -5815,6 +5878,7 @@ watch_command_1 (char *arg, int accessfl - b->exp_valid_block = exp_valid_block; - b->exp_string = savestring (exp_start, exp_end - exp_start); - b->val = val; -+ b->val_valid = 1; - b->loc->cond = cond; - if (cond_start) - b->cond_string = savestring (cond_start, cond_end - cond_start); -@@ -7698,11 +7762,11 @@ is valid is not currently in scope.\n"), - if (bpt->val) - value_free (bpt->val); - mark = value_mark (); -- bpt->val = evaluate_expression (bpt->exp); -- release_value (bpt->val); -- if (value_lazy (bpt->val)) -- value_fetch_lazy (bpt->val); -- -+ fetch_watchpoint_value (bpt->exp, &bpt->val, NULL, NULL); -+ if (bpt->val) -+ release_value (bpt->val); -+ bpt->val_valid = 1; -+ - if (bpt->type == bp_hardware_watchpoint || - bpt->type == bp_read_watchpoint || - bpt->type == bp_access_watchpoint) -Index: gdb-6.8/gdb/breakpoint.h -=================================================================== ---- gdb-6.8.orig/gdb/breakpoint.h 2008-04-19 20:47:23.000000000 +0200 -+++ gdb-6.8/gdb/breakpoint.h 2008-04-19 20:50:24.000000000 +0200 -@@ -391,8 +391,13 @@ struct breakpoint - /* The largest block within which it is valid, or NULL if it is - valid anywhere (e.g. consists just of global symbols). */ - struct block *exp_valid_block; -- /* Value of the watchpoint the last time we checked it. */ -+ /* Value of the watchpoint the last time we checked it, or NULL -+ when we do not know the value yet or the value was not -+ readable. VAL is never lazy. */ - struct value *val; -+ /* Nonzero if VAL is valid. If VAL_VALID is set but VAL is NULL, -+ then an error occurred reading the value. */ -+ int val_valid; - - /* Holds the address of the related watchpoint_scope breakpoint - when using watchpoints on local variables (might the concept -Index: gdb-6.8/gdb/testsuite/gdb.base/watchpoint.c -=================================================================== ---- gdb-6.8.orig/gdb/testsuite/gdb.base/watchpoint.c 2008-04-19 20:47:16.000000000 +0200 -+++ gdb-6.8/gdb/testsuite/gdb.base/watchpoint.c 2008-04-19 20:50:24.000000000 +0200 -@@ -39,6 +39,8 @@ struct foo struct1, struct2, *ptr1, *ptr - - int doread = 0; - -+char *global_ptr; -+ - void marker1 () - { - } -@@ -110,6 +112,14 @@ func1 () - return 73; - } - -+void -+func4 () -+{ -+ buf[0] = 3; -+ global_ptr = buf; -+ buf[0] = 7; -+} -+ - int main () - { - #ifdef usestubs -@@ -185,5 +195,7 @@ int main () - - func3 (); - -+ func4 (); -+ - return 0; - } -Index: gdb-6.8/gdb/testsuite/gdb.base/watchpoint.exp -=================================================================== ---- gdb-6.8.orig/gdb/testsuite/gdb.base/watchpoint.exp 2008-04-19 20:47:16.000000000 +0200 -+++ gdb-6.8/gdb/testsuite/gdb.base/watchpoint.exp 2008-04-19 20:52:11.000000000 +0200 -@@ -645,6 +645,30 @@ proc test_watchpoint_and_breakpoint {} { - } - } - -+proc test_inaccessible_watchpoint {} { -+ global gdb_prompt -+ -+ # This is a test for watchpoints on currently inaccessible (but later -+ # valid) memory. -+ -+ if [runto func4] then { -+ gdb_test "watch *global_ptr" ".*atchpoint \[0-9\]+: \\*global_ptr" -+ gdb_test "next" ".*global_ptr = buf.*" -+ gdb_test_multiple "next" "next over ptr init" { -+ -re ".*atchpoint \[0-9\]+: \\*global_ptr\r\n\r\nOld value = .*\r\nNew value = 3 .*\r\n.*$gdb_prompt $" { -+ # We can not test for here because NULL may be readable. -+ # This test does rely on *NULL != 3. -+ pass "next over ptr init" -+ } -+ } -+ gdb_test_multiple "next" "next over buffer set" { -+ -re ".*atchpoint \[0-9\]+: \\*global_ptr\r\n\r\nOld value = 3 .*\r\nNew value = 7 .*\r\n.*$gdb_prompt $" { -+ pass "next over buffer set" -+ } -+ } -+ } -+} -+ - # Start with a fresh gdb. - - gdb_exit -@@ -655,6 +679,7 @@ set prev_timeout $timeout - set timeout 600 - verbose "Timeout now 600 sec.\n" - -+gdb_test "set debug solib 1" - if [initialize] then { - - test_simple_watchpoint -@@ -797,6 +822,8 @@ if [initialize] then { - } - } - -+ test_inaccessible_watchpoint -+ - # See above. - if [istarget "mips-idt-*"] then { - gdb_exit diff --git a/gdb-fortran-testsuite-gfortran.patch b/gdb-fortran-testsuite-gfortran.patch new file mode 100644 index 0000000..3a54e44 --- /dev/null +++ b/gdb-fortran-testsuite-gfortran.patch @@ -0,0 +1,56 @@ +http://sourceware.org/ml/gdb-patches/2008-12/msg00155.html + +2008-12-08 Jan Kratochvil + + * gdb.fortran/subarray.exp: Expect also the strings type output. + * gdb.fortran/derived-type.exp: Likewise. Expect also the kind=X types. + Update for the f-valprint.c modification from 2008-04-22. + +--- ./gdb/testsuite/gdb.fortran/derived-type.exp 1 Jan 2008 22:53:19 -0000 1.6 ++++ ./gdb/testsuite/gdb.fortran/derived-type.exp 8 Dec 2008 18:04:34 -0000 +@@ -42,23 +42,22 @@ if ![runto MAIN__] then { + } + + gdb_test "ptype p" \ +- "type = Type bar.*int4.*\:\: c.*real.*\:\: d.*End Type bar" \ ++ "type = Type bar.*int.*\:\: c.*real.*\:\: d.*End Type bar" \ + "ptype p" + gdb_test "ptype q" \ +- "type = Type foo.*real.*\:\: a.*Type bar.*int4.*\:\: c.*real.*\:\: d.*End Type bar \:\: x.*character.*\\(7\\) \:\: b.*End Type foo" \ ++ "type = Type foo.*real.*\:\: *a.*Type bar.*int.*\:\: *c.*real.*\:\: *d.*End Type bar \:\: *x.*character.*7.* \:\: *b.*End Type foo" \ + "type-printing for derived type" + + gdb_breakpoint [gdb_get_line_number "print"] + gdb_continue_to_breakpoint "print" + +-gdb_test "print p" "\\$\[0-9\]+ = \\{ 1, 2.375\\}" ++gdb_test "print p" "\\$\[0-9\]+ = \\( 1, 2.375 \\)" + gdb_test "print p%c" "\\$\[0-9\]+ = 1" + gdb_test "print p%d" "\\$\[0-9\]+ = 2.375" + gdb_test "print q%a" "\\$\[0-9\]+ = 3.125" +-gdb_test "print q%b" "\\$\[0-9\]+ = \\(.*a.*b.*c.*d.*e.*f.*g.*\\)" ++gdb_test "print q%b" "\\$\[0-9\]+ = (\\(.*a.*b.*c.*d.*e.*f.*g.*\\)|'abcdefg')" + gdb_test "print q%x%c" "\\$\[0-9\]+ = 1" + gdb_test "print q%x%d" "\\$\[0-9\]+ = 2.375" + gdb_test "print q" \ +- "\\$\[0-9\]+ = \\{ 3.125, \\{ 1, 2.375\\}, \\(.*a.*b.*c.*d.*e.*f.*g.*\\)\\}" \ ++ "\\$\[0-9\]+ = \\( 3.125, \\( 1, 2.375 \\), (\\(.*a.*b.*c.*d.*e.*f.*g.*\\)|'abcdefg') \\)" \ + "print q" +- +--- ./gdb/testsuite/gdb.fortran/subarray.exp 1 Jan 2008 22:53:19 -0000 1.6 ++++ ./gdb/testsuite/gdb.fortran/subarray.exp 8 Dec 2008 18:04:34 -0000 +@@ -53,10 +53,10 @@ gdb_test "continue" \ + + # Test four different kinds of subarray expression evaluation. + +-gdb_test "print str(2:4)" ".*1 = \\(98 'b', 99 'c', 100 'd'\\).*" "print str(2:4)" +-gdb_test "print str(:3)" ".*2 = \\(97 'a', 98 'b', 99 'c'\\).*" "print str(:3)" +-gdb_test "print str(5:)" ".*3 = \\(101 'e', 102 'f', 103 'g'\\).*" "print str(5:)" +-gdb_test "print str(:)" ".*4 = \\(97 'a', 98 'b', 99 'c', 100 'd', 101 'e', 102 'f', 103 'g'\\).*" "print str(:)" ++gdb_test "print str(2:4)" ".*1 = (\\(98 'b', 99 'c', 100 'd'\\)|'bcd').*" "print str(2:4)" ++gdb_test "print str(:3)" ".*2 = (\\(97 'a', 98 'b', 99 'c'\\)|'abc').*" "print str(:3)" ++gdb_test "print str(5:)" ".*3 = (\\(101 'e', 102 'f', 103 'g'\\)|'efg').*" "print str(5:)" ++gdb_test "print str(:)" ".*4 = (\\(97 'a', 98 'b', 99 'c', 100 'd', 101 'e', 102 'f', 103 'g'\\)|'abcdefg').*" "print str(:)" + + gdb_test "print array(2:4)" ".*5 = \\(2, 3, 4\\).*" "print array(2:4)" + gdb_test "print array(:3)" ".*6 = \\(1, 2, 3\\).*" "print array(:3)" diff --git a/gdb-watchpoint-hw-without-inferior.patch b/gdb-watchpoint-hw-without-inferior.patch new file mode 100644 index 0000000..27c6060 --- /dev/null +++ b/gdb-watchpoint-hw-without-inferior.patch @@ -0,0 +1,136 @@ +2008-12-07 Jan Kratochvil + + Fix hw watchpoints created before the inferior was started. + * breakpoint.c (update_watchpoint): Convert the bp_watchpoint and + bp_hardware_watchpoint types according to the current runtime state. + (insert_breakpoints): Call update_watchpoint even for `bp_watchpoint's. + +2008-12-07 Jan Kratochvil + + * gdb.base/watchpoint-hw.exp, gdb.base/watchpoint-hw.c: New. + +--- ./gdb/breakpoint.c 7 Dec 2008 15:59:51 -0000 1.364 ++++ ./gdb/breakpoint.c 7 Dec 2008 21:20:54 -0000 +@@ -892,6 +892,28 @@ update_watchpoint (struct breakpoint *b, + b->val_valid = 1; + } + ++ /* Change the type of breakpoint between hardware assisted or an ++ ordinary watchpoint depending on the hardware support and free ++ hardware slots. */ ++ if (b->type == bp_watchpoint || b->type == bp_hardware_watchpoint) ++ { ++ int i, mem_cnt, target_resources_ok, other_type_used; ++ ++ i = hw_watchpoint_used_count (bp_hardware_watchpoint, ++ &other_type_used); ++ mem_cnt = can_use_hardware_watchpoint (val_chain); ++ ++ /* Hack around 'unused var' error for some targets here. */ ++ (void) i; ++ if (mem_cnt) ++ target_resources_ok = TARGET_CAN_USE_HARDWARE_WATCHPOINT ++ (bp_hardware_watchpoint, i + mem_cnt, other_type_used); ++ if (!mem_cnt || target_resources_ok <= 0) ++ b->type = bp_watchpoint; ++ else ++ b->type = bp_hardware_watchpoint; ++ } ++ + /* Look at each value on the value chain. */ + for (v = val_chain; v; v = next) + { +@@ -1204,8 +1226,9 @@ insert_breakpoints (void) + { + struct breakpoint *bpt; + ++ /* Software watchpoint may get converted to hardware ones. */ + ALL_BREAKPOINTS (bpt) +- if (is_hardware_watchpoint (bpt)) ++ if (is_hardware_watchpoint (bpt) || bpt->type == bp_watchpoint) + update_watchpoint (bpt, 0 /* don't reparse. */); + + update_global_location_list (1); +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ ./gdb/testsuite/gdb.base/watchpoint-hw.c 7 Dec 2008 21:20:56 -0000 +@@ -0,0 +1,27 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008 Free Software Foundation, Inc. ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 3 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with this program. If not, see . ++ ++ Please email any bugs, comments, and/or additions to this file to: ++ bug-gdb@prep.ai.mit.edu */ ++ ++int watchee; ++ ++int ++main (void) ++{ ++ return 0; ++} +--- /dev/null 1 Jan 1970 00:00:00 -0000 ++++ ./gdb/testsuite/gdb.base/watchpoint-hw.exp 7 Dec 2008 21:20:56 -0000 +@@ -0,0 +1,50 @@ ++# Copyright 2008 Free Software Foundation, Inc. ++ ++# This program is free software; you can redistribute it and/or modify ++# it under the terms of the GNU General Public License as published by ++# the Free Software Foundation; either version 3 of the License, or ++# (at your option) any later version. ++# ++# This program is distributed in the hope that it will be useful, ++# but WITHOUT ANY WARRANTY; without even the implied warranty of ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++# GNU General Public License for more details. ++# ++# You should have received a copy of the GNU General Public License ++# along with this program. If not, see . ++ ++if {![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"] && ![istarget "ia64-*-*"] ++ && ![istarget "s390*-*-*"]} then { ++ verbose "Skipping watchpoint-hw test." ++ return ++} ++ ++set testfile watchpoint-hw ++set srcfile ${testfile}.c ++set binfile ${objdir}/${subdir}/${testfile} ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++# Create the watchpoint before the inferior gets started. Now the native CPU ++# target is still not active and its `to_can_use_hw_breakpoint' is not ++# installed, therefore only a software watchpoint gets created. ++ ++gdb_test "watch watchee" "atchpoint 1: watchee" ++ ++# `runto_main' or `runto main' would delete the watchpoint created above. ++ ++if { [gdb_start_cmd] < 0 } { ++ untested start ++ return -1 ++} ++gdb_test "" "main .* at .*" "start" ++ ++# Check it is really a `hw'-watchpoint. ++gdb_test "info watchpoints" "1 *hw watchpoint .* watchee" diff --git a/gdb.spec b/gdb.spec index e14a53c..d08eb68 100644 --- a/gdb.spec +++ b/gdb.spec @@ -9,11 +9,11 @@ Name: gdb%{?_with_debug:-debug} # Set version to contents of gdb/version.in. # NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3 # and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch). -Version: 6.8 +Version: 6.8.50.20081209 # The release always contains a leading reserved number, start it at 1. # `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing. -Release: 33%{?_with_upstream:.upstream}%{?dist} +Release: 1%{?_with_upstream:.upstream}%{?dist} License: GPLv3+ Group: Development/Debuggers @@ -63,10 +63,6 @@ Patch2: gdb-6.3-rh-testversion-20041202.patch Patch3: gdb-6.3-rh-testlibunwind-20041202.patch Patch4: gdb-6.3-rh-testlibunwind1fix-20041202.patch -# Recognize i386 signal trampolines before CFI. Ensures that signal -# frames are identified as signal frames. -Patch101: gdb-6.3-sigx86-20040621.patch - # Use convert_from_func_ptr_addr on the solib breakpoint address; # simplifies and makes more consistent the logic. Patch104: gdb-6.3-ppcdotsolib-20041022.patch @@ -96,9 +92,6 @@ Patch117: gdb-6.3-removebp-20041130.patch # --readnever option. Patch118: gdb-6.3-gstack-20050411.patch -# Fix to ensure types are visible -Patch120: gdb-6.3-type-fix-20041213.patch - # VSYSCALL and PIE Patch122: gdb-6.3-test-pie-20050107.patch Patch124: gdb-6.3-pie-20050110.patch @@ -119,9 +112,6 @@ Patch136: gdb-6.3-test-movedir-20050125.patch # Fix to support unwinding syscalls in ia64 corefiles # Patch138: gdb-6.3-ia64-corefile-fix-20050127.patch -# Tolerate DW_AT_type referencing <0>. -Patch139: gdb-6.3-dwattype0-20050201.patch - # Fix gcore for threads Patch140: gdb-6.3-gcore-thread-20050204.patch @@ -185,13 +175,6 @@ Patch176: gdb-6.3-large-core-20051206.patch # corrupted or missing PATH. Patch177: gdb-6.3-gstack-without-path-20060414.patch -# Do not let errors related with debug registers break thread debugging. -Patch178: gdb-6.3-catch-debug-registers-error-20060527.patch - -# Cope with waitpid modifying status even when returning zero, as on -# ia32el. -Patch179: gdb-6.3-ia32el-fix-waitpid-20060615.patch - # Fix debuginfo addresses resolving for --emit-relocs Linux kernels (BZ 203661). Patch188: gdb-6.5-bz203661-emit-relocs.patch @@ -211,7 +194,7 @@ Patch196: gdb-6.5-sharedlibrary-path.patch # Suggest fixing your target architecture for gdbserver(1) (BZ 190810). # FIXME: It could be autodetected. -Patch199: gdb-6.5-bz190810-gdbserver-arch-advice.patch +Patch199: gdb-6.5-bz190810-gdbserver-arch-advice.patch # Fix dereferencing registers for 32bit inferiors on 64bit hosts (BZ 181390). Patch200: gdb-6.5-bz181390-memory-address-width.patch @@ -234,7 +217,7 @@ Patch214: gdb-6.5-bz216711-clone-is-outermost.patch # Try to reduce sideeffects of skipping ppc .so libs trampolines (BZ 218379). Patch215: gdb-6.5-bz218379-ppc-solib-trampoline-fix.patch -Patch216: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch +Patch216: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch # Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379). Patch217: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch @@ -249,7 +232,7 @@ Patch229: gdb-6.3-bz140532-ppc-unwinding-test.patch Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch # Backported post gdb-6.8 release fixups. -Patch232: gdb-6.8-upstream.patch +###Patch232: gdb-6.8-upstream.patch # Testcase for PPC Power6/DFP instructions disassembly (BZ 230000). Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch @@ -294,9 +277,6 @@ Patch271: gdb-6.5-bz243845-stale-testing-zombie-test.patch # New locating of the matching binaries from the pure core file (build-id). Patch274: gdb-6.6-buildid-locate.patch -# Fixed the kernel i386-on-x86_64 VDSO loading (producing `Lowest section in'). -Patch277: gdb-6.6-vdso-i386-on-amd64-warning.patch - # Fix hardware watchpoints after inferior forks-off some process. # Threaded `set follow-fork-mode child' still not fixed there, glibc fixes reqd. # `set detach-on-fork off' not fixed there in general - it already assert-fails. @@ -305,9 +285,6 @@ Patch280: gdb-6.6-multifork-debugreg.patch # Fix displaying of numeric char arrays as strings (BZ 224128). Patch282: gdb-6.7-charsign-test.patch -# Fix rereading of the main executable on its change. -Patch283: gdb-6.7-reread-exec_bfd.patch - # Test PPC hiding of call-volatile parameter register. Patch284: gdb-6.7-ppc-clobbered-registers-O2-test.patch @@ -339,13 +316,8 @@ Patch304: gdb-6.7-kernel-headers-compat.patch # Fix/implement the Fortran dynamic arrays support (BZ 377541). # Fix the variable-length-arrays support (BZ 468266, feature BZ 377541). -Patch345: gdb-6.8-bz377541-vla-bound-undefined.patch -Patch346: gdb-6.8-bz377541-vla-loc-kind.patch Patch305: gdb-6.8-bz377541-vla.patch -# Backport fix of a segfault + PIE regression since 6.7.1 on PIE executables. -Patch306: gdb-6.8-watchpoint-inaccessible-memory.patch - # Test GCORE for shmid 0 shared memory mappings. Patch309: gdb-6.3-mapping-zero-inode-test.patch @@ -358,9 +330,6 @@ Patch314: gdb-6.3-watchpoint-cond-gone-test.patch # Test various forms of threads tracking across exec() (BZ 442765). Patch315: gdb-6.8-bz442765-threaded-exec-test.patch -# Enable program counter for processing PTID to PC (sparc/sparc64) -Patch316: gdb-6.8-sparc-fix.patch - # Silence memcpy check which returns false positive (sparc64) Patch317: gdb-6.8-sparc64-silence-memcpy-check.patch @@ -370,25 +339,18 @@ Patch318: gdb-6.8-gcc35998-ada-memory-trash.patch # Test a crash on libraries missing the .text section. Patch320: gdb-6.5-section-num-fixup-test.patch -# Protect development in the build tree by automatic Makefile dependencies. -Patch321: gdb-6.8-auto-dependencies.patch - # Refuse creating watchpoints of an address value, suggested by Martin Stransky. Patch322: gdb-6.8-constant-watchpoints.patch -# Disable randomization (such as by setarch -R), suggested by Jakub Jelinek. -Patch323: gdb-6.8-disable-randomization.patch - # Fix compatibility with recent glibc headers. Patch324: gdb-6.8-glibc-headers-compat.patch -# Force build failure for missing libraries for --enable-tui. # Create a single binary `gdb' autodetecting --tui by its argv[0]. -Patch325: gdb-6.8-forced-enable-tui.patch Patch326: gdb-6.8-tui-singlebinary.patch # Support transparent debugging of inlined functions for an optimized code. Patch327: gdb-6.8-inlining.patch +Patch350: gdb-6.8-inlining-addon.patch Patch328: gdb-6.8-inlining-by-name.patch # Fix PRPSINFO in the core files dumped by gcore (BZ 254229). @@ -403,30 +365,23 @@ Patch331: gdb-6.8-quit-never-aborts.patch # Support DW_TAG_constant for Fortran in recent Fedora/RH GCCs. Patch332: gdb-6.8-fortran-tag-constant.patch -# Fix crash on DW_TAG_module for Fortran in recent Fedora/RH GCCs. -Patch333: gdb-6.8-fortran-module-ignore.patch - # bare names of constructors and destructors should be unique for GDB-6.8+. Patch334: gdb-6.8-ctors-dtors-unique.patch # Fix attaching to stopped processes and/or pending signals. -Patch336: gdb-6.8-attach-signalled-upstream.patch Patch337: gdb-6.8-attach-signalled-detach-stopped.patch -# Fix occasional crash on a removed watchpoint. -Patch338: gdb-6.8-breakpoint-gone.patch - -# Fix occasional stepping lockup on many threads, seen on ia64. -Patch342: gdb-6.8-ia64-breakpoint-restoration.patch - # Test the watchpoints conditionals works. Patch343: gdb-6.8-watchpoint-conditionals-test.patch # Fix resolving of variables at locations lists in prelinked libs (BZ 466901). Patch348: gdb-6.8-bz466901-backtrace-full-prelinked.patch -# Enable ia64 hardware watchpoints if created before starting inferior. -Patch349: gdb-6.8-ia64-exec-hw-watchpoint.patch +# Enable hardware watchpoints if created before starting inferior. +Patch349: gdb-watchpoint-hw-without-inferior.patch + +# Fix upstream testsuite regression + make Fortran tests gfortran compatible. +Patch351: gdb-fortran-testsuite-gfortran.patch BuildRequires: ncurses-devel texinfo gettext flex bison expat-devel Requires: readline @@ -504,12 +459,12 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %if 0%{!?_with_upstream:1} -%patch232 -p1 +###patch232 -p1 +%patch305 -p1 %patch1 -p1 %patch3 -p1 %patch4 -p1 -%patch101 -p1 %patch104 -p1 %patch105 -p1 %patch106 -p1 @@ -518,14 +473,12 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch116 -p1 %patch117 -p1 %patch118 -p1 -%patch120 -p1 %patch122 -p1 %patch125 -p1 %patch128 -p1 %patch133 -p1 %patch134 -p1 %patch136 -p1 -%patch139 -p1 %patch140 -p1 %patch141 -p1 %patch259 -p1 @@ -548,8 +501,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch170 -p1 %patch176 -p1 %patch177 -p1 -%patch178 -p1 -%patch179 -p1 %patch188 -p1 %patch190 -p1 %patch194 -p1 @@ -585,10 +536,8 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch266 -p1 %patch271 -p1 %patch274 -p1 -%patch277 -p1 %patch280 -p1 %patch282 -p1 -%patch283 -p1 %patch284 -p1 %patch287 -p1 %patch289 -p1 @@ -599,39 +548,29 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c %patch298 -p1 %patch301 -p1 %patch304 -p1 -%patch345 -p1 -%patch346 -p1 -%patch305 -p1 -%patch306 -p1 %patch309 -p1 %patch311 -p1 %patch314 -p1 %patch315 -p1 -%patch316 -p1 %patch317 -p1 %patch318 -p1 %patch320 -p1 -%patch321 -p1 %patch322 -p1 -%patch323 -p1 %patch324 -p1 -%patch325 -p1 %patch326 -p1 %patch327 -p1 +%patch350 -p1 %patch328 -p1 %patch329 -p1 %patch330 -p1 %patch331 -p1 %patch332 -p1 -%patch333 -p1 %patch334 -p1 -%patch336 -p1 %patch337 -p1 -%patch338 -p1 -%patch342 -p1 %patch343 -p1 %patch348 -p1 %patch349 -p1 +%patch351 -p1 %patch124 -p1 find -name "*.orig" | xargs rm -f @@ -895,6 +834,9 @@ fi %endif %changelog +* Sun Dec 14 2008 Jan Kratochvil - 6.8.50.20081209-1 +- Upgrade to the upstream gdb-6.8.50 snapshot. + * Mon Dec 1 2008 Jan Kratochvil - 6.8-33 - Make `--with testsuite' BuildRequires properly conditional. diff --git a/sources b/sources index afeb7aa..0de4b5d 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -c9da266b884fb8fa54df786dfaadbc7a gdb-6.8.tar.bz2 +508fc616b9481c29f4d4eb44d518deb6 gdb-6.8.50.20081209.tar.bz2