- Upgrade to the FSF GDB snapshot: 7.0.50.20100121

- archer-jankratochvil-fedora13 commit:
    ccde1530479cc966374351038057b9dda90aa251
- [expr-cumulative] Archer branch is now included.
This commit is contained in:
Jan Kratochvil 2010-01-21 16:09:11 +00:00
parent a7d6efc17b
commit 79563d6f81
14 changed files with 7746 additions and 2354 deletions

View File

@ -1,2 +1,2 @@
gdb-7.0.50.20100118.tar.bz2
gdb-7.0.50.20100121.tar.bz2
libstdc++-v3-python-r155978.tar.bz2

View File

@ -11,11 +11,11 @@
* gdb.texinfo (File Options): Document --readnever.
Index: gdb-7.0.50.20100115/gdb/doc/gdb.texinfo
Index: gdb-7.0.50.20100121/gdb/doc/gdb.texinfo
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/doc/gdb.texinfo 2010-01-15 03:16:43.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/doc/gdb.texinfo 2010-01-15 03:20:04.000000000 +0100
@@ -995,6 +995,12 @@ Read each symbol file's entire symbol ta
--- gdb-7.0.50.20100121.orig/gdb/doc/gdb.texinfo 2010-01-21 15:11:09.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/doc/gdb.texinfo 2010-01-21 15:13:02.000000000 +0100
@@ -997,6 +997,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,10 +28,10 @@ Index: gdb-7.0.50.20100115/gdb/doc/gdb.texinfo
@end table
@node Mode Options
Index: gdb-7.0.50.20100115/gdb/main.c
Index: gdb-7.0.50.20100121/gdb/main.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/main.c 2010-01-15 03:18:23.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/main.c 2010-01-15 03:20:04.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/main.c 2010-01-21 15:11:18.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/main.c 2010-01-21 15:13:02.000000000 +0100
@@ -382,6 +382,7 @@ captured_main (void *data)
{"xdb", no_argument, &xdb_commands, 1},
{"dbx", no_argument, &dbx_commands, 1},
@ -40,7 +40,7 @@ Index: gdb-7.0.50.20100115/gdb/main.c
{"r", no_argument, &readnow_symbol_files, 1},
{"quiet", no_argument, &quiet, 1},
{"q", no_argument, &quiet, 1},
@@ -1030,6 +1031,7 @@ Options:\n\n\
@@ -1033,6 +1034,7 @@ Options:\n\n\
fputs_unfiltered (_("\
--quiet Do not print version number on startup.\n\
--readnow Fully read symbol files on first access.\n\
@ -48,10 +48,10 @@ Index: gdb-7.0.50.20100115/gdb/main.c
"), stream);
fputs_unfiltered (_("\
--se=FILE Use FILE as symbol file and executable file.\n\
Index: gdb-7.0.50.20100115/gdb/symfile.c
Index: gdb-7.0.50.20100121/gdb/symfile.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/symfile.c 2010-01-15 03:16:43.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/symfile.c 2010-01-15 03:20:04.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/symfile.c 2010-01-21 15:11:09.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/symfile.c 2010-01-21 15:13:02.000000000 +0100
@@ -79,6 +79,7 @@ static void clear_symtab_users_cleanup (
/* Global variables owned by this file */
@ -60,19 +60,19 @@ Index: gdb-7.0.50.20100115/gdb/symfile.c
/* External variables and functions referenced. */
Index: gdb-7.0.50.20100115/gdb/dwarf2read.c
Index: gdb-7.0.50.20100121/gdb/dwarf2read.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/dwarf2read.c 2010-01-15 03:16:43.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/dwarf2read.c 2010-01-15 03:20:18.000000000 +0100
@@ -50,6 +50,7 @@
#include "addrmap.h"
#include "block.h"
#include "f-lang.h"
--- gdb-7.0.50.20100121.orig/gdb/dwarf2read.c 2010-01-21 15:11:09.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/dwarf2read.c 2010-01-21 15:13:15.000000000 +0100
@@ -53,6 +53,7 @@
#include "typeprint.h"
#include "jv-lang.h"
#include "vec.h"
+#include "top.h"
#include <fcntl.h>
#include "gdb_string.h"
@@ -1226,7 +1227,8 @@ dwarf2_has_info (struct objfile *objfile
@@ -1237,7 +1238,8 @@ dwarf2_has_info (struct objfile *objfile
bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL);
}
@ -82,10 +82,10 @@ Index: gdb-7.0.50.20100115/gdb/dwarf2read.c
&& dwarf2_per_objfile->abbrev.asection != NULL);
}
Index: gdb-7.0.50.20100115/gdb/top.h
Index: gdb-7.0.50.20100121/gdb/top.h
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/top.h 2010-01-01 08:31:42.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/top.h 2010-01-15 03:20:04.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/top.h 2010-01-01 08:31:42.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/top.h 2010-01-21 15:13:02.000000000 +0100
@@ -63,6 +63,7 @@ extern void set_prompt (char *);
/* From random places. */

View File

@ -19,11 +19,11 @@ Proposed upstream but never committed upstream.
(source_command): Update documentation. Check permissions if
FROM_TTY is -1.
Index: gdb-7.0.50.20100115/gdb/cli/cli-cmds.c
Index: gdb-7.0.50.20100121/gdb/cli/cli-cmds.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/cli/cli-cmds.c 2010-01-15 03:16:43.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/cli/cli-cmds.c 2010-01-15 03:19:13.000000000 +0100
@@ -37,6 +37,7 @@
--- gdb-7.0.50.20100121.orig/gdb/cli/cli-cmds.c 2010-01-18 07:25:22.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/cli/cli-cmds.c 2010-01-21 15:12:28.000000000 +0100
@@ -38,6 +38,7 @@
#include "objfiles.h"
#include "source.h"
#include "disasm.h"
@ -31,18 +31,9 @@ Index: gdb-7.0.50.20100115/gdb/cli/cli-cmds.c
extern void disconnect_or_stop_tracing (int from_tty);
#include "ui-out.h"
@@ -475,7 +476,7 @@ source_script (char *file, int from_tty)
if (fd == -1)
{
- if (from_tty)
+ if (from_tty > 0)
perror_with_name (file);
else
{
@@ -484,6 +485,29 @@ source_script (char *file, int from_tty)
}
}
@@ -488,6 +489,29 @@ find_and_open_script (int from_tty, char
file, O_RDONLY, &full_pathname);
make_cleanup (xfree, full_pathname);
+#ifdef HAVE_GETUID
+ if (from_tty == -1)
@ -62,15 +53,24 @@ Index: gdb-7.0.50.20100115/gdb/cli/cli-cmds.c
+ warning (_("not using untrusted file \"%s\""), file);
+ close (fd);
+ do_cleanups (old_cleanups);
+ return;
+ return 0;
+ }
+ }
+#endif
+
is_python = source_python;
if (strlen (file) > 3 && !strcmp (&file[strlen (file) - 3], ".py"))
is_python = 1;
@@ -495,6 +519,7 @@ source_script (char *file, int from_tty)
/* Use the full path name, if it is found. */
if (full_pathname != NULL && fd != -1)
{
@@ -496,7 +520,7 @@ find_and_open_script (int from_tty, char
if (fd == -1)
{
- if (from_tty)
+ if (from_tty > 0)
perror_with_name (file);
else
{
@@ -554,6 +578,7 @@ source_script (char *file, int from_tty)
else
script_from_file (stream, file);
@ -78,10 +78,10 @@ Index: gdb-7.0.50.20100115/gdb/cli/cli-cmds.c
do_cleanups (old_cleanups);
}
Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gdbinit.exp
Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.base/gdbinit.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gdbinit.exp 2010-01-15 03:18:23.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/testsuite/gdb.base/gdbinit.exp 2010-01-21 15:11:18.000000000 +0100
@@ -0,0 +1,98 @@
+# Copyright 2005
+# Free Software Foundation, Inc.
@ -181,17 +181,17 @@ Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gdbinit.exp
+}
+
+remote_exec build "rm .gdbinit"
Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gdbinit.sample
Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.base/gdbinit.sample
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gdbinit.sample 2010-01-15 03:18:23.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/testsuite/gdb.base/gdbinit.sample 2010-01-21 15:11:18.000000000 +0100
@@ -0,0 +1 @@
+echo "\nin gdbinit"
Index: gdb-7.0.50.20100115/gdb/main.c
Index: gdb-7.0.50.20100121/gdb/main.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/main.c 2010-01-15 03:16:43.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/main.c 2010-01-15 03:18:23.000000000 +0100
@@ -815,7 +815,7 @@ Excess command line arguments ignored. (
--- gdb-7.0.50.20100121.orig/gdb/main.c 2010-01-21 15:11:09.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/main.c 2010-01-21 15:11:18.000000000 +0100
@@ -818,7 +818,7 @@ Excess command line arguments ignored. (
debugging or what directory you are in. */
if (home_gdbinit && !inhibit_gdbinit)
@ -200,7 +200,7 @@ Index: gdb-7.0.50.20100115/gdb/main.c
/* Now perform all the actions indicated by the arguments. */
if (cdarg != NULL)
@@ -884,7 +884,7 @@ Can't attach to process and specify a co
@@ -887,7 +887,7 @@ Can't attach to process and specify a co
/* Read the .gdbinit file in the current directory, *if* it isn't
the same as the $HOME/.gdbinit file (it should exist, also). */
if (local_gdbinit && !inhibit_gdbinit)

View File

@ -102,154 +102,3 @@ frames-invalid can happen asynchronously.
set timeout $oldtimeout
return 0
http://sourceware.org/ml/gdb-patches/2009-12/msg00234.html
Subject: [patch] testsuite: Fix a race by me - watchthreads-reorder.exp
Hi,
there is a bug explainable by man pthread_cond_signal:
The [...] pthread_cond_signal() functions shall have no effect if
there are no threads currently blocked on cond.
meaning a race for the testcase.
+FAIL: gdb.threads/watchthreads-reorder.exp: reorder1: continue a (timeout)
One can reproduce the race on CVS HEAD by:
# --- a/gdb/testsuite/gdb.threads/watchthreads-reorder.c
# +++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.c
# @@ -89,6 +89,7 @@ thread1_func (void *unused)
# int i;
# volatile int rwatch_store;
#
# +sleep(1);
# thread1_tid = gettid ();
# i = pthread_cond_signal (&thread1_tid_cond);
# assert (i == 0);
# @@ -317,6 +318,7 @@ main (int argc, char **argv)
#
# if (thread1_tid == 0)
# {
# +sleep(2);
# i = pthread_cond_wait (&thread1_tid_cond, &thread1_tid_mutex);
# assert (i == 0);
#
Fixed; gdbstop_mutex got removed as it became redundant there.
Going to check it in as obvious in several days (code is by me + it is just
a testcase).
Sorry,
Jan
gdb/testsuite/
2009-12-17 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.threads/watchthreads-reorder.c (gdbstop_mutex): Remove.
(thread1_func): Protect thread1_tid_cond by thread1_tid_mutex. Remove
gdbstop_mutex handling.
(thread2_func): Protect thread2_tid_cond by thread2_tid_mutex. Remove
gdbstop_mutex handling.
(main): Move thread1_tid_mutex and thread2_tid_mutex locks before
pthread_create. Remove gdbstop_mutex handling. New comment. Remove
pthread_cond_wait conditionalizations.
--- a/gdb/testsuite/gdb.threads/watchthreads-reorder.c
+++ b/gdb/testsuite/gdb.threads/watchthreads-reorder.c
@@ -34,8 +34,6 @@
otherwise. */
#define TIMEOUT (gettid () == getpid() ? 10 : 15)
-static pthread_mutex_t gdbstop_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
-
static pid_t thread1_tid;
static pthread_cond_t thread1_tid_cond = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t thread1_tid_mutex = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP;
@@ -90,12 +88,11 @@ thread1_func (void *unused)
volatile int rwatch_store;
thread1_tid = gettid ();
+
+ timed_mutex_lock (&thread1_tid_mutex);
i = pthread_cond_signal (&thread1_tid_cond);
assert (i == 0);
-
- /* Be sure GDB is already stopped before continuing. */
- timed_mutex_lock (&gdbstop_mutex);
- i = pthread_mutex_unlock (&gdbstop_mutex);
+ i = pthread_mutex_unlock (&thread1_tid_mutex);
assert (i == 0);
rwatch_store = thread1_rwatch;
@@ -115,12 +112,11 @@ thread2_func (void *unused)
volatile int rwatch_store;
thread2_tid = gettid ();
+
+ timed_mutex_lock (&thread2_tid_mutex);
i = pthread_cond_signal (&thread2_tid_cond);
assert (i == 0);
-
- /* Be sure GDB is already stopped before continuing. */
- timed_mutex_lock (&gdbstop_mutex);
- i = pthread_mutex_unlock (&gdbstop_mutex);
+ i = pthread_mutex_unlock (&thread2_tid_mutex);
assert (i == 0);
rwatch_store = thread2_rwatch;
@@ -267,7 +263,8 @@ main (int argc, char **argv)
setbuf (stdout, NULL);
- timed_mutex_lock (&gdbstop_mutex);
+ timed_mutex_lock (&thread1_tid_mutex);
+ timed_mutex_lock (&thread2_tid_mutex);
timed_mutex_lock (&terminate_mutex);
@@ -306,30 +303,21 @@ main (int argc, char **argv)
state_wait (tracer, "T (stopped)");
}
- timed_mutex_lock (&thread1_tid_mutex);
- timed_mutex_lock (&thread2_tid_mutex);
-
- /* Let the threads start. */
- i = pthread_mutex_unlock (&gdbstop_mutex);
- assert (i == 0);
+ /* Threads are now waiting at timed_mutex_lock (thread1_tid_mutex) and so
+ they could not trigger the watchpoints before GDB gets unstopped later.
+ Threads get resumed at pthread_cond_wait below. */
printf ("Waiting till the threads initialize their TIDs.\n");
- if (thread1_tid == 0)
- {
- i = pthread_cond_wait (&thread1_tid_cond, &thread1_tid_mutex);
- assert (i == 0);
+ i = pthread_cond_wait (&thread1_tid_cond, &thread1_tid_mutex);
+ assert (i == 0);
- assert (thread1_tid > 0);
- }
+ assert (thread1_tid > 0);
- if (thread2_tid == 0)
- {
- i = pthread_cond_wait (&thread2_tid_cond, &thread2_tid_mutex);
- assert (i == 0);
+ i = pthread_cond_wait (&thread2_tid_cond, &thread2_tid_mutex);
+ assert (i == 0);
- assert (thread2_tid > 0);
- }
+ assert (thread2_tid > 0);
printf ("Thread 1 TID = %lu, thread 2 TID = %lu, PID = %lu.\n",
(unsigned long) thread1_tid, (unsigned long) thread2_tid,

View File

@ -5,10 +5,10 @@ causing: FAIL: gdb.base/unwindonsignal.exp: unwindonsignal, stack unwound
resume() -> target_resume() move of clear_inline_frame_state() is for:
gdb.mi/mi-nsmoribund.exp
Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-bt.c
Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-bt.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.opt/inline-bt.c 2010-01-01 08:32:04.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-bt.c 2010-01-15 11:50:59.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/testsuite/gdb.opt/inline-bt.c 2010-01-01 08:32:04.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-bt.c 2010-01-21 15:14:47.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 <http://www.gnu.org/licenses/>. */
@ -28,10 +28,10 @@ Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-bt.c
inline int func1(void)
{
Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-cmds.c
Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-cmds.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.opt/inline-cmds.c 2010-01-01 08:32:04.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-cmds.c 2010-01-15 11:50:59.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/testsuite/gdb.opt/inline-cmds.c 2010-01-01 08:32:04.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-cmds.c 2010-01-21 15:14:47.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 <http://www.gnu.org/licenses/>. */
@ -54,10 +54,10 @@ Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-cmds.c
inline int func1(void)
{
bar ();
Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-cmds.exp
Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-cmds.exp
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2010-01-01 08:32:04.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-cmds.exp 2010-01-15 11:50:59.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2010-01-01 08:32:04.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-cmds.exp 2010-01-21 15:14:47.000000000 +0100
@@ -230,7 +230,7 @@ set line3 [gdb_get_line_number "set brea
gdb_breakpoint $line3
gdb_continue_to_breakpoint "consecutive func1"
@ -110,10 +110,10 @@ Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-cmds.exp
+gdb_test "info frame" "inlined into frame.*" "outer_inline2 inlined"
+gdb_test "fini" "" "up from outer_inline2"
+gdb_test "info frame" " in main \[^\n\]*\n source language.*" "main not inlined"
Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-locals.c
Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-locals.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.opt/inline-locals.c 2010-01-01 08:32:04.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-locals.c 2010-01-15 11:50:59.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/testsuite/gdb.opt/inline-locals.c 2010-01-01 08:32:04.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-locals.c 2010-01-21 15:14:47.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 <http://www.gnu.org/licenses/>. */
@ -133,10 +133,10 @@ Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-locals.c
inline int func1(int arg1)
{
Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-locals.exp
Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-locals.exp
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.opt/inline-locals.exp 2010-01-01 08:32:04.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-locals.exp 2010-01-15 11:50:59.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/testsuite/gdb.opt/inline-locals.exp 2010-01-01 08:32:04.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-locals.exp 2010-01-21 15:14:47.000000000 +0100
@@ -77,6 +77,9 @@ if { ! $no_frames } {
# Make sure that locals on the stack are found. This is an array to
@ -155,10 +155,10 @@ Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-locals.exp
+ setup_kfail *-*-* "gcc/debug.optimization"
+}
gdb_test "print array\[0\]" "\\\$$decimal = 184" "print local (3)"
Index: gdb-7.0.50.20100115/gdb/frame.c
Index: gdb-7.0.50.20100121/gdb/frame.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/frame.c 2010-01-15 03:22:14.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/frame.c 2010-01-15 11:50:59.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/frame.c 2010-01-21 15:13:26.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/frame.c 2010-01-21 15:14:47.000000000 +0100
@@ -316,7 +316,7 @@ fprint_frame (struct ui_file *file, stru
static struct frame_info *
skip_inlined_frames (struct frame_info *frame)
@ -195,10 +195,10 @@ Index: gdb-7.0.50.20100115/gdb/frame.c
{
sal->symtab = SYMBOL_SYMTAB (sym);
sal->line = SYMBOL_LINE (sym);
Index: gdb-7.0.50.20100115/gdb/breakpoint.c
Index: gdb-7.0.50.20100121/gdb/breakpoint.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/breakpoint.c 2010-01-15 11:49:49.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/breakpoint.c 2010-01-15 11:52:20.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/breakpoint.c 2010-01-21 15:14:41.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/breakpoint.c 2010-01-21 15:14:47.000000000 +0100
@@ -62,6 +62,7 @@
#include "jit.h"
#include "xml-syscall.h"
@ -207,7 +207,7 @@ Index: gdb-7.0.50.20100115/gdb/breakpoint.c
/* readline include files */
#include "readline/readline.h"
@@ -3560,10 +3561,24 @@ bpstat_check_breakpoint_conditions (bpst
@@ -3558,10 +3559,24 @@ bpstat_check_breakpoint_conditions (bpst
const struct bp_location *bl = bs->breakpoint_at;
struct breakpoint *b = bl->owner;
@ -236,7 +236,7 @@ Index: gdb-7.0.50.20100115/gdb/breakpoint.c
{
int value_is_zero = 0;
@@ -3731,6 +3746,12 @@ bpstat_stop_status (struct address_space
@@ -3729,6 +3744,12 @@ bpstat_stop_status (struct address_space
bs->print = 0;
}
bs->commands = copy_command_lines (bs->commands);
@ -249,7 +249,7 @@ Index: gdb-7.0.50.20100115/gdb/breakpoint.c
}
/* Print nothing for this entry if we dont stop or dont print. */
@@ -6039,9 +6060,9 @@ set_momentary_breakpoint (struct gdbarch
@@ -6043,9 +6064,9 @@ set_momentary_breakpoint (struct gdbarch
{
struct breakpoint *b;
@ -262,10 +262,10 @@ Index: gdb-7.0.50.20100115/gdb/breakpoint.c
b = set_raw_breakpoint (gdbarch, sal, type);
b->enable_state = bp_enabled;
Index: gdb-7.0.50.20100115/gdb/inline-frame.c
Index: gdb-7.0.50.20100121/gdb/inline-frame.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/inline-frame.c 2010-01-01 08:31:36.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/inline-frame.c 2010-01-15 11:50:59.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/inline-frame.c 2010-01-01 08:31:36.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/inline-frame.c 2010-01-21 15:14:47.000000000 +0100
@@ -213,6 +213,12 @@ inline_frame_sniffer (const struct frame
if (frame_block == NULL)
return 0;
@ -342,10 +342,10 @@ Index: gdb-7.0.50.20100115/gdb/inline-frame.c
/* Return the number of hidden functions inlined into the current
frame. */
Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-markers.c
Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-markers.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.opt/inline-markers.c 2010-01-01 08:32:04.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-markers.c 2010-01-15 11:50:59.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/testsuite/gdb.opt/inline-markers.c 2010-01-01 08:32:04.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-markers.c 2010-01-21 15:14:47.000000000 +0100
@@ -15,11 +15,6 @@
extern int x, y;
@ -358,10 +358,10 @@ Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.opt/inline-markers.c
void marker(void)
{
x += y; /* set breakpoint 2 here */
Index: gdb-7.0.50.20100115/gdb/gdbthread.h
Index: gdb-7.0.50.20100121/gdb/gdbthread.h
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/gdbthread.h 2010-01-15 03:22:13.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/gdbthread.h 2010-01-15 11:51:19.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/gdbthread.h 2010-01-21 15:11:09.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/gdbthread.h 2010-01-21 15:14:47.000000000 +0100
@@ -195,6 +195,12 @@ struct thread_info
/* Function that is called to free PRIVATE. If this is NULL, then
xfree will be called on PRIVATE. */
@ -375,11 +375,11 @@ Index: gdb-7.0.50.20100115/gdb/gdbthread.h
};
/* Create an empty thread list, or empty the existing one. */
Index: gdb-7.0.50.20100115/gdb/infcmd.c
Index: gdb-7.0.50.20100121/gdb/infcmd.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/infcmd.c 2010-01-15 03:22:13.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/infcmd.c 2010-01-15 11:51:53.000000000 +0100
@@ -1438,11 +1438,11 @@ finish_command_continuation (void *arg)
--- gdb-7.0.50.20100121.orig/gdb/infcmd.c 2010-01-21 15:11:09.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/infcmd.c 2010-01-21 15:14:47.000000000 +0100
@@ -1439,11 +1439,11 @@ finish_command_continuation (void *arg)
struct type *value_type;
value_type = TYPE_TARGET_TYPE (SYMBOL_TYPE (a->function));
@ -393,7 +393,7 @@ Index: gdb-7.0.50.20100115/gdb/infcmd.c
print_return_value (SYMBOL_TYPE (a->function), value_type);
}
@@ -1550,6 +1550,16 @@ finish_forward (struct symbol *function,
@@ -1551,6 +1551,16 @@ finish_forward (struct symbol *function,
tp->initiating_frame = get_frame_id (frame);
make_cleanup (delete_longjmp_breakpoint_cleanup, &thread);
@ -410,7 +410,7 @@ Index: gdb-7.0.50.20100115/gdb/infcmd.c
tp->proceed_to_finish = 1; /* We want stop_registers, please... */
cargs = xmalloc (sizeof (*cargs));
@@ -1570,7 +1580,9 @@ finish_forward (struct symbol *function,
@@ -1571,7 +1581,9 @@ finish_forward (struct symbol *function,
static void
finish_command (char *arg, int from_tty)
{
@ -421,7 +421,7 @@ Index: gdb-7.0.50.20100115/gdb/infcmd.c
struct symbol *function;
int async_exec = 0;
@@ -1601,45 +1613,63 @@ finish_command (char *arg, int from_tty)
@@ -1602,45 +1614,63 @@ finish_command (char *arg, int from_tty)
if (!target_has_execution)
error (_("The program is not running."));
@ -502,7 +502,7 @@ Index: gdb-7.0.50.20100115/gdb/infcmd.c
/* Print info on the selected frame, including level number but not
source. */
@@ -1653,10 +1683,14 @@ finish_command (char *arg, int from_tty)
@@ -1654,10 +1684,14 @@ finish_command (char *arg, int from_tty)
print_stack_frame (get_selected_frame (NULL), 1, LOCATION);
}
@ -518,11 +518,11 @@ Index: gdb-7.0.50.20100115/gdb/infcmd.c
}
Index: gdb-7.0.50.20100115/gdb/target.c
Index: gdb-7.0.50.20100121/gdb/target.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/target.c 2010-01-15 03:22:31.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/target.c 2010-01-15 11:50:59.000000000 +0100
@@ -2241,6 +2241,7 @@ target_resume (ptid_t ptid, int step, en
--- gdb-7.0.50.20100121.orig/gdb/target.c 2010-01-21 15:13:26.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/target.c 2010-01-21 15:14:47.000000000 +0100
@@ -2216,6 +2216,7 @@ target_resume (ptid_t ptid, int step, en
{
struct target_ops *t;
@ -530,10 +530,10 @@ Index: gdb-7.0.50.20100115/gdb/target.c
target_dcache_invalidate ();
for (t = current_target.beneath; t != NULL; t = t->beneath)
Index: gdb-7.0.50.20100115/gdb/inline-frame.h
Index: gdb-7.0.50.20100121/gdb/inline-frame.h
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/inline-frame.h 2010-01-01 08:31:36.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/inline-frame.h 2010-01-15 11:50:59.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/inline-frame.h 2010-01-01 08:31:36.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/inline-frame.h 2010-01-21 15:14:47.000000000 +0100
@@ -43,6 +43,10 @@ void clear_inline_frame_state (ptid_t pt
void step_into_inline_frame (ptid_t ptid);
@ -545,19 +545,19 @@ Index: gdb-7.0.50.20100115/gdb/inline-frame.h
/* Return the number of hidden functions inlined into the current
frame. */
Index: gdb-7.0.50.20100115/gdb/dwarf2read.c
Index: gdb-7.0.50.20100121/gdb/dwarf2read.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/dwarf2read.c 2010-01-15 11:46:29.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/dwarf2read.c 2010-01-15 11:52:59.000000000 +0100
@@ -4078,6 +4078,7 @@ read_func_scope (struct die_info *die, s
CORE_ADDR baseaddr;
--- gdb-7.0.50.20100121.orig/gdb/dwarf2read.c 2010-01-21 15:14:41.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/dwarf2read.c 2010-01-21 15:15:09.000000000 +0100
@@ -4137,6 +4137,7 @@ read_func_scope (struct die_info *die, s
struct block *block;
unsigned die_children = 0;
int inlined_func = (die->tag == DW_TAG_inlined_subroutine);
+ struct type *type;
if (inlined_func)
{
@@ -4109,7 +4110,10 @@ read_func_scope (struct die_info *die, s
@@ -4178,7 +4179,10 @@ read_func_scope (struct die_info *die, s
add_to_cu_func_list (name, lowpc, highpc, cu);
new = push_context (0, lowpc);

File diff suppressed because it is too large Load Diff

View File

@ -1,41 +1,65 @@
gdb/
2009-11-24 Jan Kratochvil <jan.kratochvil@redhat.com>
http://sourceware.org/gdb/wiki/ProjectArcher
http://sourceware.org/gdb/wiki/ArcherBranchManagement
Transparent GNU-IFUNCs support.
* elfread.c (record_minimal_symbol): Apply also for mst_text_gnu_ifunc.
(elf_symtab_read): Set also mst_text_gnu_ifunc.
* gdbtypes.c (init_type): Support TYPE_FLAG_GNU_IFUNC.
(gdbtypes_post_init): Initialize builtin_func_func_ptr.
(objfile_type): Initialize nodebug_text_gnu_ifunc_symbol.
* gdbtypes.h (enum type_flag_value <TYPE_FLAG_GNU_IFUNC>)
(TYPE_GNU_IFUNC, struct main_type <flag_gnu_ifunc>)
(struct builtin_type <builtin_func_func_ptr>)
(struct objfile_type <nodebug_text_gnu_ifunc_symbol>): New.
* infcall.c (find_function_addr <TYPE_GNU_IFUNC (ftype)>): New.
* minsyms.c (lookup_minimal_symbol_text, prim_record_minimal_symbol)
(find_solib_trampoline_target): Support also mst_text_gnu_ifunc.
(in_gnu_ifunc_stub): New.
* parse.c (write_exp_msymbol <mst_text_gnu_ifunc>): New.
* solib-svr4.c (svr4_in_dynsym_resolve_code): Call also
in_gnu_ifunc_stub.
* symmisc.c (dump_msymbols <mst_text_gnu_ifunc>): New.
* symtab.c (search_symbols): Support also mst_text_gnu_ifunc.
* symtab.h (enum minimal_symbol_type <mst_text_gnu_ifunc>)
(in_gnu_ifunc_stub): New.
* linespec.c: Include infcall.h.
(minsym_found <MSYMBOL_TYPE (msymbol) == mst_text_gnu_ifunc>): New.
GIT snapshot:
commit 791165df07fd22d381def1318954c389a606f81a
gdb/testsuite/
2009-11-24 Jan Kratochvil <jan.kratochvil@redhat.com>
archer-jankratochvil-ifunc
Transparent GNU-IFUNCs support.
* gdb.base/gnu-ifunc-lib.c, gdb.base/gnu-ifunc.c,
gdb.base/gnu-ifunc.exp: New.
Index: gdb-7.0.50.20100115/gdb/elfread.c
Index: gdb-7.0.50.20100121/gdb/alpha-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/elfread.c 2010-01-15 11:45:34.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/elfread.c 2010-01-15 12:17:16.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/alpha-linux-tdep.c 2010-01-01 08:31:29.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/alpha-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -26,6 +26,7 @@
#include "symtab.h"
#include "regset.h"
#include "regcache.h"
+#include "linux-tdep.h"
#include "alpha-tdep.h"
@@ -236,6 +237,9 @@ alpha_linux_init_abi (struct gdbarch_inf
set_gdbarch_regset_from_core_section
(gdbarch, alpha_linux_regset_from_core_section);
+
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ linux_convert_from_func_ptr_addr);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
Index: gdb-7.0.50.20100121/gdb/amd64-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/amd64-linux-tdep.c 2010-01-21 15:13:26.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/amd64-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -1557,6 +1557,9 @@ amd64_linux_init_abi (struct gdbarch_inf
amd64_linux_record_tdep.arg6 = AMD64_R9_REGNUM;
tdep->i386_syscall_record = amd64_linux_syscall_record;
+
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ linux_convert_from_func_ptr_addr);
}
Index: gdb-7.0.50.20100121/gdb/arm-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/arm-linux-tdep.c 2010-01-01 08:31:29.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/arm-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -907,6 +907,9 @@ arm_linux_init_abi (struct gdbarch_info
set_gdbarch_displaced_step_free_closure (gdbarch,
simple_displaced_step_free_closure);
set_gdbarch_displaced_step_location (gdbarch, displaced_step_at_entry_point);
+
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ linux_convert_from_func_ptr_addr);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
Index: gdb-7.0.50.20100121/gdb/elfread.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/elfread.c 2010-01-21 15:13:27.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/elfread.c 2010-01-21 15:15:41.000000000 +0100
@@ -184,7 +184,8 @@ record_minimal_symbol (const char *name,
{
struct gdbarch *gdbarch = get_objfile_arch (objfile);
@ -58,10 +82,80 @@ Index: gdb-7.0.50.20100115/gdb/elfread.c
}
else if ((sym->name[0] == '.' && sym->name[1] == 'L')
|| ((sym->flags & BSF_LOCAL)
Index: gdb-7.0.50.20100115/gdb/gdbtypes.c
Index: gdb-7.0.50.20100121/gdb/frv-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/gdbtypes.c 2010-01-15 03:22:31.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/gdbtypes.c 2010-01-15 12:16:49.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/frv-linux-tdep.c 2010-01-01 08:31:32.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/frv-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -32,6 +32,7 @@
#include "frame-unwind.h"
#include "regset.h"
#include "gdb_string.h"
+#include "linux-tdep.h"
/* Define the size (in bytes) of an FR-V instruction. */
static const int frv_instr_size = 4;
@@ -486,7 +487,21 @@ frv_linux_regset_from_core_section (stru
return NULL;
}
-
+static CORE_ADDR
+frv_linux_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
+ CORE_ADDR addr,
+ struct target_ops *targ)
+{
+ CORE_ADDR pc = frv_convert_from_func_ptr_addr (gdbarch, addr, targ);
+ CORE_ADDR resolved;
+
+ resolved = linux_convert_from_func_and_ptr (gdbarch, addr, pc);
+ if (resolved != pc)
+ pc = frv_convert_from_func_ptr_addr (gdbarch, resolved, targ);
+
+ return pc;
+}
+
static void
frv_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
{
@@ -494,6 +509,10 @@ frv_linux_init_abi (struct gdbarch_info
frame_unwind_append_unwinder (gdbarch, &frv_linux_sigtramp_frame_unwind);
set_gdbarch_regset_from_core_section (gdbarch,
frv_linux_regset_from_core_section);
+
+ if (frv_abi (gdbarch) == FRV_ABI_FDPIC)
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ frv_linux_convert_from_func_ptr_addr);
}
static enum gdb_osabi
Index: gdb-7.0.50.20100121/gdb/frv-tdep.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/frv-tdep.c 2010-01-01 08:31:32.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/frv-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -1169,7 +1169,7 @@ find_func_descr (struct gdbarch *gdbarch
return descr;
}
-static CORE_ADDR
+CORE_ADDR
frv_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr,
struct target_ops *targ)
{
Index: gdb-7.0.50.20100121/gdb/frv-tdep.h
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/frv-tdep.h 2010-01-01 08:31:32.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/frv-tdep.h 2010-01-21 15:15:41.000000000 +0100
@@ -118,3 +118,6 @@ CORE_ADDR frv_fetch_objfile_link_map (st
struct target_so_ops;
extern struct target_so_ops frv_so_ops;
+CORE_ADDR frv_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
+ CORE_ADDR addr,
+ struct target_ops *targ);
Index: gdb-7.0.50.20100121/gdb/gdbtypes.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/gdbtypes.c 2010-01-21 15:13:26.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/gdbtypes.c 2010-01-21 15:15:41.000000000 +0100
@@ -1946,6 +1946,8 @@ init_type (enum type_code code, int leng
TYPE_NOTTEXT (type) = 1;
if (flags & TYPE_FLAG_FIXED_INSTANCE)
@ -71,16 +165,16 @@ Index: gdb-7.0.50.20100115/gdb/gdbtypes.c
if (name)
TYPE_NAME (type) = obsavestring (name, strlen (name),
@@ -3846,6 +3848,8 @@ gdbtypes_post_init (struct gdbarch *gdba
@@ -3955,6 +3957,8 @@ gdbtypes_post_init (struct gdbarch *gdba
= lookup_pointer_type (builtin_type->builtin_void);
builtin_type->builtin_func_ptr
= lookup_pointer_type (lookup_function_type (builtin_type->builtin_void));
+ builtin_type->builtin_func_func_ptr
+ = lookup_pointer_type (lookup_function_type (builtin_type->builtin_func_ptr));
+ builtin_type->builtin_func_func
+ = lookup_function_type (builtin_type->builtin_func_ptr);
/* This type represents a GDB internal function. */
builtin_type->internal_fn
@@ -3962,6 +3966,11 @@ objfile_type (struct objfile *objfile)
@@ -4071,6 +4075,11 @@ objfile_type (struct objfile *objfile)
"<text variable, no debug info>", objfile);
TYPE_TARGET_TYPE (objfile_type->nodebug_text_symbol)
= objfile_type->builtin_int;
@ -92,10 +186,10 @@ Index: gdb-7.0.50.20100115/gdb/gdbtypes.c
objfile_type->nodebug_data_symbol
= init_type (TYPE_CODE_INT,
gdbarch_int_bit (gdbarch) / HOST_CHAR_BIT, 0,
Index: gdb-7.0.50.20100115/gdb/gdbtypes.h
Index: gdb-7.0.50.20100121/gdb/gdbtypes.h
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/gdbtypes.h 2010-01-15 11:49:26.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/gdbtypes.h 2010-01-15 12:16:49.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/gdbtypes.h 2010-01-21 15:14:41.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/gdbtypes.h 2010-01-21 15:16:39.000000000 +0100
@@ -188,6 +188,7 @@ enum type_flag_value
TYPE_FLAG_FIXED_INSTANCE = (1 << 15),
TYPE_FLAG_STUB_SUPPORTED = (1 << 16),
@ -125,18 +219,18 @@ Index: gdb-7.0.50.20100115/gdb/gdbtypes.h
unsigned int flag_fixed_instance : 1;
unsigned int flag_objfile_owned : 1;
unsigned int flag_discardable : 1;
@@ -1250,6 +1258,10 @@ struct builtin_type
@@ -1243,6 +1251,10 @@ struct builtin_type
(*) () can server as a generic function pointer. */
struct type *builtin_func_ptr;
+ /* `pointer to function returning pointer to function (returning void)' type.
+ /* `function returning pointer to function (returning void)' type.
+ The final void return type is not significant for it. */
+ struct type *builtin_func_func_ptr;
+ struct type *builtin_func_func;
+
/* Special-purpose types. */
@@ -1292,6 +1304,7 @@ struct objfile_type
@@ -1285,6 +1297,7 @@ struct objfile_type
/* Types used for symbols with no debug information. */
struct type *nodebug_text_symbol;
@ -144,77 +238,260 @@ Index: gdb-7.0.50.20100115/gdb/gdbtypes.h
struct type *nodebug_data_symbol;
struct type *nodebug_unknown_symbol;
struct type *nodebug_tls_symbol;
Index: gdb-7.0.50.20100115/gdb/infcall.c
Index: gdb-7.0.50.20100121/gdb/hppa-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/infcall.c 2010-01-01 08:31:36.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/infcall.c 2010-01-15 12:16:49.000000000 +0100
@@ -286,6 +286,27 @@ find_function_addr (struct value *functi
else
error (_("Invalid data type for function to be called."));
--- gdb-7.0.50.20100121.orig/gdb/hppa-linux-tdep.c 2010-01-01 08:31:33.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/hppa-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -32,6 +32,7 @@
#include "regset.h"
#include "regcache.h"
#include "hppa-tdep.h"
+#include "linux-tdep.h"
+ if (TYPE_GNU_IFUNC (ftype))
+ {
+ struct type *func_func_ptr;
#include "elf/common.h"
@@ -513,7 +514,21 @@ hppa_linux_regset_from_core_section (str
return NULL;
}
-
+
+ funaddr += gdbarch_deprecated_function_start_offset (gdbarch);
+static CORE_ADDR
+hppa32_linux_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
+ CORE_ADDR addr,
+ struct target_ops *targ)
+{
+ CORE_ADDR pc = hppa32_convert_from_func_ptr_addr (gdbarch, addr, targ);
+ CORE_ADDR resolved;
+
+ /* Cast FUNADDR to drop TYPE_GNU_IFUNC and being able to call gnu-ifunc
+ FUNADDR without causing deadlock by this block of code. */
+ resolved = linux_convert_from_func_and_ptr (gdbarch, addr, pc);
+ if (resolved != pc)
+ pc = hppa32_convert_from_func_ptr_addr (gdbarch, resolved, targ);
+
+ func_func_ptr = builtin_type (gdbarch)->builtin_func_func_ptr;
+ function = value_from_pointer (func_func_ptr, funaddr);
+ return pc;
+}
/* Forward declarations. */
extern initialize_file_ftype _initialize_hppa_linux_tdep;
@@ -555,6 +570,10 @@ hppa_linux_init_abi (struct gdbarch_info
/* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map);
+
+ /* gnu-ifuncs have no arguments. */
+ function = call_function_by_hand (function, 0, NULL);
+
+ funaddr = value_as_address (function);
+
+ /* This is `int' as the return type of the final function. */
+ value_type = TYPE_TARGET_TYPE (value_type);
+ }
+
if (retval_type != NULL)
*retval_type = value_type;
return funaddr + gdbarch_deprecated_function_start_offset (gdbarch);
Index: gdb-7.0.50.20100115/gdb/linespec.c
+ if (tdep->bytes_per_address == 4)
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ hppa32_linux_convert_from_func_ptr_addr);
}
void
Index: gdb-7.0.50.20100121/gdb/hppa-tdep.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/linespec.c 2010-01-12 06:48:56.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/linespec.c 2010-01-15 12:16:49.000000000 +0100
@@ -40,6 +40,7 @@
#include "interps.h"
#include "mi/mi-cmds.h"
--- gdb-7.0.50.20100121.orig/gdb/hppa-tdep.c 2010-01-19 10:39:12.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/hppa-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -1247,7 +1247,7 @@ hppa64_return_value (struct gdbarch *gdb
}
-static CORE_ADDR
+CORE_ADDR
hppa32_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr,
struct target_ops *targ)
{
Index: gdb-7.0.50.20100121/gdb/hppa-tdep.h
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/hppa-tdep.h 2010-01-01 08:31:33.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/hppa-tdep.h 2010-01-21 15:15:41.000000000 +0100
@@ -246,4 +246,8 @@ extern int hppa_in_solib_call_trampoline
CORE_ADDR pc, char *name);
extern CORE_ADDR hppa_skip_trampoline_code (struct frame_info *, CORE_ADDR pc);
+extern CORE_ADDR hppa32_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
+ CORE_ADDR addr,
+ struct target_ops *targ);
+
#endif /* hppa-tdep.h */
Index: gdb-7.0.50.20100121/gdb/i386-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/i386-linux-tdep.c 2010-01-04 15:57:43.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/i386-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -798,6 +798,9 @@ i386_linux_init_abi (struct gdbarch_info
i386_linux_get_syscall_number);
set_gdbarch_get_siginfo_type (gdbarch, linux_get_siginfo_type);
+
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ linux_convert_from_func_ptr_addr);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
Index: gdb-7.0.50.20100121/gdb/ia64-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/ia64-linux-tdep.c 2010-01-01 08:31:36.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/ia64-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -26,6 +26,7 @@
#include "osabi.h"
#include "solib-svr4.h"
#include "symtab.h"
+#include "linux-tdep.h"
/* The sigtramp code is in a non-readable (executable-only) region
of memory called the ``gate page''. The addresses in question
@@ -139,6 +140,9 @@ ia64_linux_init_abi (struct gdbarch_info
/* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map);
+
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ linux_convert_from_func_ptr_addr);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
Index: gdb-7.0.50.20100121/gdb/infcall.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/infcall.c 2010-01-01 08:31:36.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/infcall.c 2010-01-21 15:15:41.000000000 +0100
@@ -252,9 +252,17 @@ find_function_addr (struct value *functi
if (TYPE_CODE (ftype) == TYPE_CODE_FUNC
|| TYPE_CODE (ftype) == TYPE_CODE_METHOD)
{
- funaddr = gdbarch_convert_from_func_ptr_addr (gdbarch, funaddr,
- &current_target);
- value_type = TYPE_TARGET_TYPE (ftype);
+ CORE_ADDR funaddr2;
+
+ funaddr2 = gdbarch_convert_from_func_ptr_addr (gdbarch, funaddr,
+ &current_target);
+
+ /* If TYPE_GNU_IFUNC is currently not resolvable keep its type. */
+ if (funaddr2 != funaddr || !TYPE_GNU_IFUNC (ftype))
+ {
+ funaddr = funaddr2;
+ value_type = TYPE_TARGET_TYPE (ftype);
+ }
}
}
else if (code == TYPE_CODE_INT)
Index: gdb-7.0.50.20100121/gdb/linux-tdep.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/linux-tdep.c 2010-01-14 22:20:11.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -23,6 +23,8 @@
#include "auxv.h"
#include "target.h"
#include "elf/common.h"
+#include "value.h"
+#include "infcall.h"
/* We share this one with symtab.c, but it is not exported widely. */
/* This function is suitable for architectures that don't
extend/override the standard siginfo structure. */
@@ -152,3 +154,43 @@ linux_has_shared_address_space (void)
@@ -1867,6 +1868,22 @@ minsym_found (int funfirstline, struct m
pc = gdbarch_convert_from_func_ptr_addr (gdbarch,
values.sals[0].pc,
&current_target);
return target_is_uclinux;
}
+
+ /* Call gnu-ifunc to resolve breakpoint at its returned function. */
+ if (MSYMBOL_TYPE (msymbol) == mst_text_gnu_ifunc)
+ {
+ struct type *func_func_ptr;
+ struct value *function;
+/* Call gnu-ifunc to resolve breakpoint at its returned function. */
+
+ func_func_ptr = builtin_type (gdbarch)->builtin_func_func_ptr;
+ function = value_from_pointer (func_func_ptr, pc);
+CORE_ADDR
+linux_convert_from_func_and_ptr (struct gdbarch *gdbarch, CORE_ADDR func_ptr,
+ CORE_ADDR pc)
+{
+ struct type *func_func_type = builtin_type (gdbarch)->builtin_func_func;
+ struct minimal_symbol *msymbol;
+ struct value *function, *address;
+
+ /* gnu-ifuncs have no arguments. */
+ function = call_function_by_hand (function, 0, NULL);
+ if (!target_has_execution)
+ return pc;
+
+ pc = value_as_address (function);
+ }
+ msymbol = lookup_minimal_symbol_by_pc (func_ptr);
+ if (msymbol == NULL)
+ return pc;
+ if (MSYMBOL_TYPE (msymbol) != mst_text_gnu_ifunc)
+ return pc;
+
if (pc != values.sals[0].pc)
values.sals[0] = find_pc_sect_line (pc, NULL, 0);
Index: gdb-7.0.50.20100115/gdb/minsyms.c
+ /* Not at the gnu-ifunc entry point? */
+ if (SYMBOL_VALUE_ADDRESS (msymbol) != func_ptr)
+ return pc;
+
+ function = allocate_value (func_func_type);
+ set_value_address (function, pc);
+
+ /* gnu-ifuncs have no arguments. FUNCTION is the code instruction address
+ while ADDRESS is a function descriptor. */
+ address = call_function_by_hand (function, 0, NULL);
+
+ return value_as_address (address);
+}
+
+CORE_ADDR
+linux_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr,
+ struct target_ops *targ)
+{
+ return linux_convert_from_func_and_ptr (gdbarch, addr, addr);
+}
Index: gdb-7.0.50.20100121/gdb/linux-tdep.h
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/minsyms.c 2010-01-15 03:22:31.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/minsyms.c 2010-01-15 12:16:49.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/linux-tdep.h 2010-01-01 08:31:37.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/linux-tdep.h 2010-01-21 15:15:41.000000000 +0100
@@ -22,4 +22,11 @@
struct type *linux_get_siginfo_type (struct gdbarch *);
+CORE_ADDR linux_convert_from_func_and_ptr (struct gdbarch *gdbarch,
+ CORE_ADDR func_ptr, CORE_ADDR pc);
+
+CORE_ADDR linux_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
+ CORE_ADDR addr,
+ struct target_ops *targ);
+
#endif /* linux-tdep.h */
Index: gdb-7.0.50.20100121/gdb/m32r-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/m32r-linux-tdep.c 2010-01-01 08:31:37.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/m32r-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -30,6 +30,7 @@
#include "gdb_string.h"
#include "glibc-tdep.h"
+#include "linux-tdep.h"
#include "solib-svr4.h"
#include "symtab.h"
@@ -422,6 +423,9 @@ m32r_linux_init_abi (struct gdbarch_info
/* Enable TLS support. */
set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map);
+
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ linux_convert_from_func_ptr_addr);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
Index: gdb-7.0.50.20100121/gdb/microblaze-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/microblaze-linux-tdep.c 2010-01-01 08:31:37.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/microblaze-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -35,6 +35,7 @@
#include "trad-frame.h"
#include "frame-unwind.h"
#include "tramp-frame.h"
+#include "linux-tdep.h"
static int
@@ -133,6 +134,9 @@ microblaze_linux_init_abi (struct gdbarc
/* Trampolines. */
tramp_frame_prepend_unwinder (gdbarch,
&microblaze_linux_sighandler_tramp_frame);
+
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ linux_convert_from_func_ptr_addr);
}
void
Index: gdb-7.0.50.20100121/gdb/minsyms.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/minsyms.c 2010-01-21 15:13:26.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/minsyms.c 2010-01-21 15:15:41.000000000 +0100
@@ -331,8 +331,9 @@ lookup_minimal_symbol_text (const char *
msymbol = msymbol->hash_next)
{
@ -262,10 +539,93 @@ Index: gdb-7.0.50.20100115/gdb/minsyms.c
&& strcmp (SYMBOL_LINKAGE_NAME (msymbol),
SYMBOL_LINKAGE_NAME (tsymbol)) == 0)
return SYMBOL_VALUE_ADDRESS (msymbol);
Index: gdb-7.0.50.20100115/gdb/parse.c
Index: gdb-7.0.50.20100121/gdb/mips-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/parse.c 2010-01-15 03:22:31.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/parse.c 2010-01-15 12:16:49.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/mips-linux-tdep.c 2010-01-01 08:31:37.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/mips-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -38,6 +38,7 @@
#include "target-descriptions.h"
#include "mips-linux-tdep.h"
#include "glibc-tdep.h"
+#include "linux-tdep.h"
static struct target_so_ops mips_svr4_so_ops;
@@ -1225,6 +1226,9 @@ mips_linux_init_abi (struct gdbarch_info
tdesc_numbered_register (feature, tdesc_data, MIPS_RESTART_REGNUM,
"restart");
}
+
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ linux_convert_from_func_ptr_addr);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
Index: gdb-7.0.50.20100121/gdb/mn10300-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/mn10300-linux-tdep.c 2010-01-01 08:31:37.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/mn10300-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -32,6 +32,7 @@
#include "frame.h"
#include "trad-frame.h"
#include "tramp-frame.h"
+#include "linux-tdep.h"
#include <stdlib.h>
@@ -718,6 +719,9 @@ am33_linux_init_osabi (struct gdbarch_in
tramp_frame_prepend_unwinder (gdbarch, &am33_linux_sigframe);
tramp_frame_prepend_unwinder (gdbarch, &am33_linux_rt_sigframe);
+
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ linux_convert_from_func_ptr_addr);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
Index: gdb-7.0.50.20100121/gdb/objc-lang.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/objc-lang.c 2010-01-14 09:03:36.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/objc-lang.c 2010-01-21 15:15:41.000000000 +0100
@@ -1178,16 +1178,6 @@ find_methods (struct symtab *symtab, cha
QUIT;
- /* The minimal symbol might point to a function descriptor;
- resolve it to the actual code address instead. */
- pc = gdbarch_convert_from_func_ptr_addr (gdbarch, pc,
- &current_target);
-
- if (symtab)
- if (pc < BLOCK_START (block) || pc >= BLOCK_END (block))
- /* Not in the specified symtab. */
- continue;
-
symname = SYMBOL_NATURAL_NAME (msymbol);
if (symname == NULL)
continue;
@@ -1223,6 +1213,17 @@ find_methods (struct symtab *symtab, cha
((nselector == NULL) || (strcmp (selector, nselector) != 0)))
continue;
+ /* The minimal symbol might point to a function descriptor;
+ resolve it to the actual code address instead. Delay the call as
+ its resolution may be expensive. */
+ pc = gdbarch_convert_from_func_ptr_addr (gdbarch, pc,
+ &current_target);
+
+ if (symtab)
+ if (pc < BLOCK_START (block) || pc >= BLOCK_END (block))
+ /* Not in the specified symtab. */
+ continue;
+
sym = find_pc_function (pc);
if (sym != NULL)
{
Index: gdb-7.0.50.20100121/gdb/parse.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/parse.c 2010-01-21 15:13:26.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/parse.c 2010-01-21 15:16:15.000000000 +0100
@@ -516,6 +516,11 @@ write_exp_msymbol (struct minimal_symbol
write_exp_elt_type (objfile_type (objfile)->nodebug_text_symbol);
break;
@ -278,10 +638,66 @@ Index: gdb-7.0.50.20100115/gdb/parse.c
case mst_data:
case mst_file_data:
case mst_bss:
Index: gdb-7.0.50.20100115/gdb/solib-svr4.c
Index: gdb-7.0.50.20100121/gdb/ppc-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/solib-svr4.c 2010-01-15 12:16:41.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/solib-svr4.c 2010-01-15 12:17:40.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/ppc-linux-tdep.c 2010-01-04 15:57:44.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/ppc-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -48,6 +48,7 @@
#include "arch-utils.h"
#include "spu-tdep.h"
#include "xml-syscall.h"
+#include "linux-tdep.h"
#include "features/rs6000/powerpc-32l.c"
#include "features/rs6000/powerpc-altivec32l.c"
@@ -672,8 +673,19 @@ ppc64_linux_convert_from_func_ptr_addr (
res = bfd_get_section_contents (s->bfd, s->the_bfd_section,
&buf, addr - s->addr, 8);
if (res != 0)
- return extract_unsigned_integer (buf, 8, byte_order)
- - bfd_section_vma (s->bfd, s->the_bfd_section) + s->addr;
+ {
+ CORE_ADDR pc, resolved;
+
+ pc = extract_unsigned_integer (buf, 8, byte_order)
+ - bfd_section_vma (s->bfd, s->the_bfd_section) + s->addr;
+
+ resolved = linux_convert_from_func_and_ptr (gdbarch, addr, pc);
+ if (resolved != pc)
+ pc = ppc64_linux_convert_from_func_ptr_addr (gdbarch, resolved,
+ targ);
+
+ return pc;
+ }
}
return addr;
Index: gdb-7.0.50.20100121/gdb/sh-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/sh-linux-tdep.c 2010-01-01 08:31:41.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/sh-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -25,6 +25,7 @@
#include "glibc-tdep.h"
#include "sh-tdep.h"
+#include "linux-tdep.h"
#define REGSx16(base) \
{(base), 0}, \
@@ -89,6 +90,9 @@ sh_linux_init_abi (struct gdbarch_info i
tdep->core_gregmap = (struct sh_corefile_regmap *)gregs_table;
tdep->core_fpregmap = (struct sh_corefile_regmap *)fpregs_table;
}
+
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ linux_convert_from_func_ptr_addr);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
Index: gdb-7.0.50.20100121/gdb/solib-svr4.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/solib-svr4.c 2010-01-21 15:15:22.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/solib-svr4.c 2010-01-21 15:15:41.000000000 +0100
@@ -1257,7 +1257,8 @@ svr4_in_dynsym_resolve_code (CORE_ADDR p
&& pc < info->interp_text_sect_high)
|| (pc >= info->interp_plt_sect_low
@ -292,10 +708,54 @@ Index: gdb-7.0.50.20100115/gdb/solib-svr4.c
}
/* Given an executable's ABFD and target, compute the entry-point
Index: gdb-7.0.50.20100115/gdb/symmisc.c
Index: gdb-7.0.50.20100121/gdb/sparc-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/symmisc.c 2010-01-15 03:22:32.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/symmisc.c 2010-01-15 12:16:49.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/sparc-linux-tdep.c 2010-01-01 08:31:42.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/sparc-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -32,6 +32,7 @@
#include "symtab.h"
#include "trad-frame.h"
#include "tramp-frame.h"
+#include "linux-tdep.h"
#include "sparc-tdep.h"
@@ -279,6 +280,9 @@ sparc32_linux_init_abi (struct gdbarch_i
dwarf2_append_unwinders (gdbarch);
set_gdbarch_write_pc (gdbarch, sparc_linux_write_pc);
+
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ linux_convert_from_func_ptr_addr);
}
/* Provide a prototype to silence -Wmissing-prototypes. */
Index: gdb-7.0.50.20100121/gdb/sparc64-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/sparc64-linux-tdep.c 2010-01-01 08:31:42.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/sparc64-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -31,6 +31,7 @@
#include "symtab.h"
#include "trad-frame.h"
#include "tramp-frame.h"
+#include "linux-tdep.h"
#include "sparc64-tdep.h"
@@ -244,6 +245,9 @@ sparc64_linux_init_abi (struct gdbarch_i
tdep->step_trap = sparc64_linux_step_trap;
set_gdbarch_write_pc (gdbarch, sparc64_linux_write_pc);
+
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ linux_convert_from_func_ptr_addr);
}
Index: gdb-7.0.50.20100121/gdb/symmisc.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/symmisc.c 2010-01-21 15:13:27.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/symmisc.c 2010-01-21 15:15:41.000000000 +0100
@@ -294,6 +294,9 @@ dump_msymbols (struct objfile *objfile,
case mst_text:
ms_type = 'T';
@ -306,11 +766,11 @@ Index: gdb-7.0.50.20100115/gdb/symmisc.c
case mst_solib_trampoline:
ms_type = 'S';
break;
Index: gdb-7.0.50.20100115/gdb/symtab.c
Index: gdb-7.0.50.20100121/gdb/symtab.c
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/symtab.c 2010-01-15 03:22:31.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/symtab.c 2010-01-15 12:16:49.000000000 +0100
@@ -3257,7 +3257,7 @@ search_symbols (char *regexp, domain_enu
--- gdb-7.0.50.20100121.orig/gdb/symtab.c 2010-01-21 15:13:27.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/symtab.c 2010-01-21 15:15:41.000000000 +0100
@@ -3244,7 +3244,7 @@ search_symbols (char *regexp, domain_enu
{mst_file_data, mst_solib_trampoline, mst_abs, mst_unknown};
static enum minimal_symbol_type types4[]
=
@ -319,10 +779,10 @@ Index: gdb-7.0.50.20100115/gdb/symtab.c
enum minimal_symbol_type ourtype;
enum minimal_symbol_type ourtype2;
enum minimal_symbol_type ourtype3;
Index: gdb-7.0.50.20100115/gdb/symtab.h
Index: gdb-7.0.50.20100121/gdb/symtab.h
===================================================================
--- gdb-7.0.50.20100115.orig/gdb/symtab.h 2010-01-15 03:22:13.000000000 +0100
+++ gdb-7.0.50.20100115/gdb/symtab.h 2010-01-15 12:16:49.000000000 +0100
--- gdb-7.0.50.20100121.orig/gdb/symtab.h 2010-01-21 15:11:09.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/symtab.h 2010-01-21 15:15:41.000000000 +0100
@@ -280,6 +280,8 @@ enum minimal_symbol_type
{
mst_unknown = 0, /* Unknown type, the default */
@ -332,7 +792,7 @@ Index: gdb-7.0.50.20100115/gdb/symtab.h
mst_data, /* Generally initialized data */
mst_bss, /* Generally uninitialized data */
mst_abs, /* Generally absolute (nonrelocatable) */
@@ -1163,6 +1165,8 @@ extern struct minimal_symbol *lookup_min
@@ -1157,6 +1159,8 @@ extern struct minimal_symbol *lookup_min
extern struct minimal_symbol *lookup_minimal_symbol_by_pc (CORE_ADDR);
@ -341,11 +801,11 @@ Index: gdb-7.0.50.20100115/gdb/symtab.h
extern struct minimal_symbol
*lookup_minimal_symbol_by_pc_section (CORE_ADDR, struct obj_section *);
Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gnu-ifunc-lib.c
Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.base/gnu-ifunc-lib.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gnu-ifunc-lib.c 2010-01-15 12:16:49.000000000 +0100
@@ -0,0 +1,45 @@
+++ gdb-7.0.50.20100121/gdb/testsuite/gdb.base/gnu-ifunc-lib.c 2010-01-21 15:15:41.000000000 +0100
@@ -0,0 +1,54 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2009 Free Software Foundation, Inc.
@ -368,6 +828,12 @@ Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gnu-ifunc-lib.c
+typedef int (*final_t) (int arg);
+
+static int
+init_stub (int arg)
+{
+ return 0;
+}
+
+static int
+final (int arg)
+{
+ return arg + 1;
@ -379,6 +845,8 @@ Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gnu-ifunc-lib.c
+gnu_ifunc_pre (void)
+{
+ assert (!gnu_ifunc_initialized);
+
+ gnu_ifunc_initialized = 1;
+}
+
+final_t gnu_ifuncX (void) asm ("gnu_ifunc");
@ -387,14 +855,15 @@ Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gnu-ifunc-lib.c
+final_t
+gnu_ifuncX (void)
+{
+ gnu_ifunc_initialized = 1;
+
+ return final;
+ if (!gnu_ifunc_initialized)
+ return init_stub;
+ else
+ return final;
+}
Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gnu-ifunc.c
Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.base/gnu-ifunc.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gnu-ifunc.c 2010-01-15 12:16:49.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/testsuite/gdb.base/gnu-ifunc.c 2010-01-21 15:15:41.000000000 +0100
@@ -0,0 +1,36 @@
+/* This testcase is part of GDB, the GNU debugger.
+
@ -432,11 +901,11 @@ Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gnu-ifunc.c
+
+ return 0; /* break-at-exit */
+}
Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gnu-ifunc.exp
Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.base/gnu-ifunc.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gnu-ifunc.exp 2010-01-15 12:16:49.000000000 +0100
@@ -0,0 +1,72 @@
+++ gdb-7.0.50.20100121/gdb/testsuite/gdb.base/gnu-ifunc.exp 2010-01-21 15:15:41.000000000 +0100
@@ -0,0 +1,115 @@
+# Copyright (C) 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
@ -464,7 +933,14 @@ Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gnu-ifunc.exp
+set libsrc ${libfile}.c
+set lib_so ${objdir}/${subdir}/${libfile}.so
+
+set lib_nodebug_so_base ${libfile}-nodebug.so
+set lib_nodebug_so ${objdir}/${subdir}/${lib_nodebug_so_base}
+
+# {debug} provides DWARF symbol gnu_ifuncX confusing the ELF symbol
+# gnu_ifunc during address->symbol resolution for printing the symbol.
+# Still we need it here for "step"ping into the function.
+set lib_opts [list debug]
+set lib_nodebug_opts [list]
+set exec_opts [list debug shlib=$lib_so]
+
+if [get_compiler_info ${binfile}] {
@ -487,7 +963,8 @@ Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gnu-ifunc.exp
+ return 1;
+}
+
+gdb_breakpoint [gdb_get_line_number "break-at-nextcall"]
+# The "if" condition is artifical to test regression of a format patch.
+gdb_breakpoint "[gdb_get_line_number "break-at-nextcall"] if i && gnu_ifunc (i) != 42"
+
+gdb_breakpoint [gdb_get_line_number "break-at-call"]
+gdb_continue_to_breakpoint "break-at-call" ".*break-at-call.*"
@ -502,10 +979,67 @@ Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/gnu-ifunc.exp
+
+# Test GDB will not break before the final chosen implementation.
+
+gdb_continue_to_breakpoint "break-at-nextcall" ".*break-at-nextcall.*"
+# Also test a format patch regression:
+# Continuing.
+# Error in testing breakpoint condition:
+# Attempt to take address of value not located in memory.
+#
+# Breakpoint 2, main () at ./gdb.base/gnu-ifunc.c:33
+
+gdb_test "continue" "Continuing.\r\n\r\nBreakpoint .* (at|in) .*break-at-nextcall.*" \
+ "continue to break-at-nextcall"
+
+gdb_breakpoint "gnu_ifunc"
+
+gdb_continue_to_breakpoint "nextcall gnu_ifunc"
+
+gdb_test "frame" "#0 +final \\(.*" "nextcall gnu_ifunc skipped"
+gdb_test "frame" "#0 +(0x\[0-9a-f\]+ in +)?final \\(.*" "nextcall gnu_ifunc skipped"
+
+
+# Compare the two different addresses:
+
+gdb_test "p gnu_ifunc" " = {<text variable, no debug info>} 0x\[0-9a-f\]+ <final>" "p gnu_ifunc executing"
+gdb_test "info sym gnu_ifunc" "final in section .*" "info sym gnu_ifunc executing"
+
+set test "info addr gnu_ifunc"
+gdb_test_multiple $test $test {
+ -re "Symbol \"gnu_ifunc\" is at (0x\[0-9a-f\]+) in .*$gdb_prompt $" {
+ pass $test
+ }
+}
+gdb_test "info sym $expect_out(1,string)" "gnu_ifunc in section .*" "info sym <gnu_ifunc-address>"
+
+# <*gnu_ifunc> would be an incorrect resolution from DW_AT_MIPS_linkage_name.
+# We do not use {debug} build option for this purpose.
+
+if { [gdb_compile_shlib ${srcdir}/${subdir}/$libsrc $lib_nodebug_so $lib_nodebug_opts] != ""} {
+ untested "Could not compile either $libsrc."
+ return -1
+}
+
+clean_restart $lib_nodebug_so_base
+
+gdb_test "p gnu_ifunc" " = {<text gnu-ifunc variable, no debug info>} 0x\[0-9a-f\]+ <gnu_ifunc>" "p gnu_ifunc not executing without debug"
+gdb_test "info sym gnu_ifunc" "gnu_ifunc in section .*" "info sym gnu_ifunc not executing without debug"
Index: gdb-7.0.50.20100121/gdb/xtensa-linux-tdep.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/xtensa-linux-tdep.c 2010-01-01 08:31:46.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/xtensa-linux-tdep.c 2010-01-21 15:15:41.000000000 +0100
@@ -22,6 +22,7 @@
#include "solib-svr4.h"
#include "symtab.h"
+#include "linux-tdep.h"
/* OS specific initialization of gdbarch. */
@@ -30,6 +31,9 @@ xtensa_linux_init_abi (struct gdbarch_in
{
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
+
+ set_gdbarch_convert_from_func_ptr_addr (gdbarch,
+ linux_convert_from_func_ptr_addr);
}
/* Provide a prototype to silence -Wmissing-prototypes. */

View File

@ -1,204 +0,0 @@
###gdb/
###2009-12-20 Jan Kratochvil <jan.kratochvil@redhat.com>
###
### Fix compatibility with G++-4.1.
### * dwarf2read.c (partial_die_parent_scope): New variable PARENT_NAME.
### Ignore parent namespaces with name "::".
### (physname_prefix_1): Ignore namespaces with name "::".
gdb/testsuite/
2009-12-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.dwarf2/dw2-empty-namespace.exp, gdb.dwarf2/dw2-empty-namespace.S:
New.
###--- a/gdb/dwarf2read.c
###+++ b/gdb/dwarf2read.c
###@@ -2355,11 +2355,18 @@ partial_die_parent_scope (struct partial_die_info *pdi,
### || parent->tag == DW_TAG_interface_type
### || parent->tag == DW_TAG_union_type)
### {
###+ char *parent_name = parent->name;
###+
###+ /* G++ 4.1 produced DW_TAG_namespace with DW_AT_name "::". */
###+ if (parent->tag == DW_TAG_namespace && parent_name != NULL
###+ && strcmp (parent_name, "::") == 0)
###+ parent_name = NULL;
###+
### if (grandparent_scope == NULL)
###- parent->scope = parent->name;
###+ parent->scope = parent_name;
### else
### parent->scope = typename_concat (&cu->comp_unit_obstack, grandparent_scope,
###- parent->name, cu);
###+ parent_name, cu);
### }
### else if (parent->tag == DW_TAG_enumeration_type)
### /* Enumerators should not get the name of the enumeration as a prefix. */
###@@ -9008,6 +9015,9 @@ physname_prefix_1 (struct ui_file *buf, struct die_info *die,
### name = dwarf2_name (die, cu);
### if (name == NULL)
### name = "(anonymous namespace)";
###+ /* G++ 4.1 produced DW_TAG_namespace with DW_AT_name "::". */
###+ else if (strcmp (name, "::") == 0)
###+ name = NULL;
### break;
###
### case DW_TAG_class_type:
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.S
@@ -0,0 +1,108 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2009 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* Test G++ 4.1 producing DW_TAG_namespace with DW_AT_name "::". */
+
+ .data
+var: .4byte 1
+
+ .section .debug_info
+.Lcu1_begin:
+ /* CU header */
+ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */
+.Lcu1_start:
+ .2byte 2 /* DWARF Version */
+ .4byte .Labbrev1_begin /* Offset into abbrev section */
+ .byte 4 /* Pointer size */
+
+ /* CU die */
+ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */
+ .ascii "file1.txt\0" /* DW_AT_name */
+ .ascii "GNU C 3.3.3\0" /* DW_AT_producer */
+ .byte 4 /* DW_LANG_C_plus_plus (C++) */
+
+.Ltype_int:
+ .uleb128 2 /* Abbrev: DW_TAG_base_type */
+ .ascii "int\0" /* DW_AT_name */
+ .byte 4 /* DW_AT_byte_size */
+ .byte 5 /* DW_AT_encoding */
+
+ .uleb128 3 /* Abbrev: DW_TAG_namespace */
+ .ascii "::\0" /* DW_AT_name */
+
+ .uleb128 7 /* Abbrev: DW_TAG_variable (location) */
+ .ascii "var\0" /* DW_AT_name */
+ .byte 2f - 1f /* DW_AT_location */
+1: .byte 3 /* DW_OP_addr */
+ .4byte var /* <addr> */
+2: .4byte .Ltype_int-.Lcu1_begin /* DW_AT_type */
+
+ .byte 0 /* End of children of DW_TAG_namespace */
+
+ .byte 0 /* End of children of CU */
+
+.Lcu1_end:
+
+/* Abbrev table */
+ .section .debug_abbrev
+.Labbrev1_begin:
+ .uleb128 1 /* Abbrev code */
+ .uleb128 0x11 /* DW_TAG_compile_unit */
+ .byte 1 /* has_children */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0x25 /* DW_AT_producer */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0x13 /* DW_AT_language */
+ .uleb128 0xb /* DW_FORM_data1 */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+
+ .uleb128 2 /* Abbrev code */
+ .uleb128 0x24 /* DW_TAG_base_type */
+ .byte 0 /* has_children */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0xb /* DW_AT_byte_size */
+ .uleb128 0xb /* DW_FORM_data1 */
+ .uleb128 0x3e /* DW_AT_encoding */
+ .uleb128 0xb /* DW_FORM_data1 */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+
+ .uleb128 3 /* Abbrev code */
+ .uleb128 0x39 /* DW_TAG_namespace */
+ .byte 1 /* has_children */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+
+ .uleb128 7 /* Abbrev code (location) */
+ .uleb128 0x34 /* DW_TAG_variable */
+ .byte 0 /* has_children */
+ .uleb128 0x3 /* DW_AT_name */
+ .uleb128 0x8 /* DW_FORM_string */
+ .uleb128 0x2 /* DW_AT_location */
+ .uleb128 0xa /* DW_FORM_block1 */
+ .uleb128 0x49 /* DW_AT_type */
+ .uleb128 0x13 /* DW_FORM_ref4 */
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
+
+ .byte 0x0 /* Terminator */
+ .byte 0x0 /* Terminator */
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-empty-namespace.exp
@@ -0,0 +1,43 @@
+# Copyright 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Test G++ 4.1 producing DW_TAG_namespace with DW_AT_name "::".
+
+# This test can only be run on targets which support DWARF-2 and use gas.
+# For now pick a sampling of likely targets.
+if {![istarget *-*-linux*]
+ && ![istarget *-*-gnu*]
+ && ![istarget *-*-elf*]
+ && ![istarget *-*-openbsd*]
+ && ![istarget arm-*-eabi*]
+ && ![istarget powerpc-*-eabi*]} {
+ return 0
+}
+
+set testfile "dw2-empty-namespace"
+set srcfile ${testfile}.S
+set executable ${testfile}.x
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objdir}/${subdir}/${executable}" object {nodebug}] != "" } {
+ return -1
+}
+
+clean_restart $executable
+
+# `p var' below can work without identified DWARF DIE just based on its ELF symbol.
+# Catch it here as `type = <data variable, no debug info>'.
+gdb_test "ptype var" "type = int"
+
+gdb_test "p var" " = 1"

58
gdb-solib-display.patch Normal file
View File

@ -0,0 +1,58 @@
http://sourceware.org/ml/gdb-patches/2010-01/msg00485.html
Subject: [patch] Fix solib-display.exp crash
[ Made more safe for downstream patch + ported for VLA. ]
Hi,
it is a testsuite regression against gdb-7.0 although the bug was probably
present even in gdb-7.0 (it started to reproduce since one completely
unrelated Daniel J.'s patch). This patch fixes (-lmcheck may be required):
PASS: gdb.base/solib-display.exp: display a_global
PASS: gdb.base/solib-display.exp: display b_global
PASS: gdb.base/solib-display.exp: display c_global
-ERROR: Process no longer exists
-UNRESOLVED: gdb.base/solib-display.exp: after rerun
-WARNING: remote_expect statement without a default case?!
-FAIL: gdb.base/solib-display.exp: Can't run to main (3)
+PASS: gdb.base/solib-display.exp: after rerun
+PASS: gdb.base/solib-display.exp: after rerun
+PASS: gdb.base/solib-display.exp: break 25
+PASS: gdb.base/solib-display.exp: continue
+PASS: gdb.base/solib-display.exp: display main_global
+PASS: gdb.base/solib-display.exp: display a_local
+PASS: gdb.base/solib-display.exp: display a_static
+PASS: gdb.base/solib-display.exp: break 25
+PASS: gdb.base/solib-display.exp: continue
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
The question is whether SYMBOL_SYMTAB (symbol) can be ever NULL at this point.
IMO not, it can be NULL only temporarily during reading symbols.
Thanks,
Jan
2010-01-20 Jan Kratochvil <jan.kratochvil@redhat.com>
* printcmd.c (display_uses_solib_p): Remove variable section. Access
objfile via SYMBOL_SYMTAB.
Index: gdb-7.0.50.20100121/gdb/parse.c
===================================================================
--- gdb-7.0.50.20100121.orig/gdb/parse.c 2010-01-21 15:16:15.000000000 +0100
+++ gdb-7.0.50.20100121/gdb/parse.c 2010-01-21 15:21:45.000000000 +0100
@@ -1425,6 +1425,10 @@ operator_check_standard (struct expressi
if (section && objfile_func && (*objfile_func) (section->objfile, data))
return 1;
+ /* SYMBOL_OBJ_SECTION (symbol) may be NULL. */
+ if (SYMBOL_SYMTAB (symbol) && objfile_func && (*objfile_func) (SYMBOL_SYMTAB (symbol)->objfile, data))
+ return 1;
+
/* Check objfile where is placed the code touching the variable. */
objfile = block_objfile (block);

View File

@ -1,152 +0,0 @@
http://sourceware.org/ml/gdb-patches/2010-01/msg00461.html
Subject: [patch] testsuite: Fix misplaced line numbers
Hi,
commit 7a82dfb2a9be66f0230229642cbee54ebda3b0da
Author: Joel Brobecker <brobecker@gnat.com>
Date: Fri Jan 1 07:31:28 2010 +0000
Update copyright year in most headers.
Automatic update by copyright.sh.
regressed:
-PASS: gdb.mi/mi-break.exp: run to breakpoint with ignore count
+FAIL: gdb.mi/mi-break.exp: run to breakpoint with ignore count (stopped at wrong place)
-PASS: gdb.mi/mi-cli.exp: continue to callee4
+FAIL: gdb.mi/mi-cli.exp: continue to callee4 (stopped at wrong place)
-PASS: gdb.mi/mi-cli.exp: check *stopped from CLI command
+FAIL: gdb.mi/mi-cli.exp: check *stopped from CLI command (stopped at wrong place)
-PASS: gdb.mi/mi2-cli.exp: continue to callee4
+FAIL: gdb.mi/mi2-cli.exp: continue to callee4 (stopped at wrong place)
due to:
#--- a/gdb/testsuite/gdb.mi/basics.c
#+++ b/gdb/testsuite/gdb.mi/basics.c
#@@ -1,4 +1,5 @@
#-/* Copyright 1999, 2000, 2004, 2007, 2008, 2009 Free Software Foundation, Inc.
#+/* Copyright 1999, 2000, 2004, 2007, 2008, 2009, 2010
#+Free Software Foundation, Inc.
Tested on x86_64-fedora12-linux-gnu.
Thanks,
Jan
2010-01-18 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.mi/mi-break.exp (set line_callme_head, set line_callme_body): New.
(test_ignore_count): Declare line_callme_body global.
(run to breakpoint with ignore count): Use line_callme_body.
* gdb.mi/mi-cli.exp (set line_main_head, set line_main_body)
(set line_main_hello, set line_main_return): Reindent.
(set line_callee4_head, set line_callee4_body, set line_callee4_next):
New.
(continue to callee4): Use line_callee4_body.
(check *stopped from CLI command): Use line_callee4_next.
* gdb.mi/mi2-cli.exp (set line_main_head, set line_main_body)
(set line_main_hello, set line_main_return): Reindent.
(set line_callee4_head, set line_callee4_body): New.
(continue to callee4): Use line_callee4_body.
--- a/gdb/testsuite/gdb.mi/mi-break.exp
+++ b/gdb/testsuite/gdb.mi/mi-break.exp
@@ -56,6 +56,8 @@ set line_callee1_head [gdb_get_line_number "callee1 ("]
set line_callee1_body [expr $line_callee1_head + 2]
set line_main_head [gdb_get_line_number "main ("]
set line_main_body [expr $line_main_head + 2]
+set line_callme_head [gdb_get_line_number "callme ("]
+set line_callme_body [expr $line_callme_head + 2]
set fullname "fullname=\"${fullname_syntax}${srcfile}\""
@@ -152,6 +154,7 @@ proc test_rbreak_creation_and_listing {} {
proc test_ignore_count {} {
global mi_gdb_prompt
+ global line_callme_body
mi_gdb_test "-break-insert -i 1 callme" \
"\\^done.*ignore=\"1\".*" \
@@ -159,7 +162,7 @@ proc test_ignore_count {} {
mi_run_cmd
- mi_expect_stop "breakpoint-hit" "callme" "\{name=\"i\",value=\"2\"\}" ".*basics.c" "52" \
+ mi_expect_stop "breakpoint-hit" "callme" "\{name=\"i\",value=\"2\"\}" ".*basics.c" $line_callme_body \
{"" "disp=\"keep\"" } "run to breakpoint with ignore count"
}
--- a/gdb/testsuite/gdb.mi/mi-cli.exp
+++ b/gdb/testsuite/gdb.mi/mi-cli.exp
@@ -63,10 +63,13 @@ mi_gdb_test "-interpreter-exec console \"file $binfile\"" \
mi_run_to_main
-set line_main_head [gdb_get_line_number "main ("]
-set line_main_body [expr $line_main_head + 2]
-set line_main_hello [gdb_get_line_number "Hello, World!"]
-set line_main_return [expr $line_main_hello + 2]
+set line_main_head [gdb_get_line_number "main ("]
+set line_main_body [expr $line_main_head + 2]
+set line_main_hello [gdb_get_line_number "Hello, World!"]
+set line_main_return [expr $line_main_hello + 2]
+set line_callee4_head [gdb_get_line_number "callee4 ("]
+set line_callee4_body [expr $line_callee4_head + 2]
+set line_callee4_next [expr $line_callee4_body + 1]
mi_gdb_test "-interpreter-exec console \"set args foobar\"" \
{\^done} \
@@ -97,7 +100,7 @@ mi_gdb_test "-interpreter-exec console \"list\"" \
".*\~\"$line_main_body\[\\\\t \]*callee1.*;\\\\n\".*\\^done" \
"-interpreter-exec console \"list\""
-mi_execute_to "exec-continue" "breakpoint-hit" "callee4" "" ".*basics.c" "28" \
+mi_execute_to "exec-continue" "breakpoint-hit" "callee4" "" ".*basics.c" $line_callee4_body \
{ "" "disp=\"keep\"" } "continue to callee4"
# NOTE: cagney/2003-02-03: Not yet.
@@ -155,7 +158,7 @@ if {$async} {
set reason ""
}
-mi_execute_to "interpreter-exec console step" $reason "callee4" "" ".*basics.c" "29" \
+mi_execute_to "interpreter-exec console step" $reason "callee4" "" ".*basics.c" $line_callee4_next \
"" "check *stopped from CLI command"
# NOTE: cagney/2003-02-03: Not yet.
--- a/gdb/testsuite/gdb.mi/mi2-cli.exp
+++ b/gdb/testsuite/gdb.mi/mi2-cli.exp
@@ -63,10 +63,12 @@ mi_gdb_test "-interpreter-exec console \"file $binfile\"" \
mi_run_to_main
-set line_main_head [gdb_get_line_number "main ("]
-set line_main_body [expr $line_main_head + 2]
-set line_main_hello [gdb_get_line_number "Hello, World!"]
-set line_main_return [expr $line_main_hello + 2]
+set line_main_head [gdb_get_line_number "main ("]
+set line_main_body [expr $line_main_head + 2]
+set line_main_hello [gdb_get_line_number "Hello, World!"]
+set line_main_return [expr $line_main_hello + 2]
+set line_callee4_head [gdb_get_line_number "callee4 ("]
+set line_callee4_body [expr $line_callee4_head + 2]
mi_gdb_test "-interpreter-exec console \"set args foobar\"" \
{\^done} \
@@ -97,7 +100,7 @@ mi_gdb_test "-interpreter-exec console \"list\"" \
".*\~\"$line_main_body\[\\\\t \]*callee1.*;\\\\n\".*\\^done" \
"-interpreter-exec console \"list\""
-mi_execute_to "exec-continue" "breakpoint-hit" "callee4" "" ".*basics.c" "28" \
+mi_execute_to "exec-continue" "breakpoint-hit" "callee4" "" ".*basics.c" $line_callee4_body \
{ "" "disp=\"keep\"" } \
"continue to callee4"

44
gdb-unused-revert.patch Normal file
View File

@ -0,0 +1,44 @@
[RFA/commit 5/5] Add -Wunused-function to compile flags.
http://sourceware.org/ml/gdb-patches/2010-01/msg00371.html
http://sourceware.org/ml/gdb-cvs/2010-01/msg00163.html
REVERTED
--- src/gdb/configure.ac 2010/01/15 00:34:37 1.112
+++ src/gdb/configure.ac 2010/01/19 09:52:31 1.113
@@ -1544,8 +1544,7 @@
# gdb/doc/gdbint.texinfo.
build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
-Wformat-nonliteral -Wno-pointer-sign \
--Wno-unused -Wunused-value -Wunused-function \
--Wno-switch -Wno-char-subscripts"
+-Wno-unused -Wunused-value -Wno-switch -Wno-char-subscripts"
# Enable -Wno-format by default when using gcc on mingw since many
# GCC versions complain about %I64.
--- src/gdb/configure 2010/01/15 00:34:37 1.297
+++ src/gdb/configure 2010/01/19 09:52:32 1.298
@@ -13435,8 +13435,7 @@
# gdb/doc/gdbint.texinfo.
build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
-Wformat-nonliteral -Wno-pointer-sign \
--Wno-unused -Wunused-value -Wunused-function \
--Wno-switch -Wno-char-subscripts"
+-Wno-unused -Wunused-value -Wno-switch -Wno-char-subscripts"
# Enable -Wno-format by default when using gcc on mingw since many
# GCC versions complain about %I64.
### src/gdb/ChangeLog 2010/01/19 09:50:48 1.11271
### src/gdb/ChangeLog 2010/01/19 09:52:33 1.11272
## -1,11 +1,5 @@
2010-01-19 Joel Brobecker <brobecker@adacore.com>
- Add -Wunused-function to compile flags.
- * configure.ac: Add -Wunused-function to build_warnings.
- * configure: Regenerate.
-
-2010-01-19 Joel Brobecker <brobecker@adacore.com>
-
"delete" ada-lex.c:input function, not used.
* ada-lex.l: #define YY_NO_INPUT.

View File

@ -1,231 +0,0 @@
http://sourceware.org/ml/gdb-patches/2009-12/msg00394.html
Subject: [patch] Fix watchpoint-at-epilogue 7.0 regression (s390x)
Hi,
attached testcase regressed 6.8->7.0 on some s390x systems.
At the moment PC is at epilogue (after frame pointer got destroyed and PC is
still in the calleed function) we must not try any unwinding as it can try to
unwind a garbage.
Correct way would be to implement epilogue unwinder (such as
amd64_epilogue_frame_unwind or i386_epilogue_frame_unwind ones) but it would
not be so easy on s390x as it would need full prologue-analyzer: After SP gets
restored there can be various instructions before the last jump - GDB needs to
interpret the jump to find the register value where it is going to jump to.
00000048279aa09c <round_and_return>:
[...]
48279aa1b8: eb 6f f0 d0 00 04 lmg %r6,%r15,208(%r15)
48279aa1be: 50 32 10 00 st %r3,0(%r2,%r1) # SP (%r15) is gone hone
48279aa1c2: b3 74 00 00 lzer %r0
48279aa1c6: 07 f4 br %r4 # %r4 is the target
[...]
Just an easy fix is to be more careful and do not try any unwinding if we find
PC is in the epilogue (previous instruction modifies SP=%r15).
It is even a performance optimization and I see no regression risk there.
The specific s390x error is:
#0 throw_error (error=MEMORY_ERROR, fmt=0x8042676a "Cannot access memory at address %s") at exceptions.c:415
#1 in memory_error (status=5, memaddr=0) at corefile.c:220
#2 in read_memory (memaddr=0, myaddr=0x3ffffc7f7f0 "", len=8) at corefile.c:238
#3 in read_memory_unsigned_integer (memaddr=0, len=8, byte_order=BFD_ENDIAN_BIG) at corefile.c:321
#4 in s390_backchain_frame_unwind_cache (this_frame=0x80608958, info=0x80608a08) at s390-tdep.c:1525
#5 in s390_frame_unwind_cache (this_frame=0x80608958, this_prologue_cache=0x80608970) at s390-tdep.c:1572
#6 in s390_frame_this_id (this_frame=0x80608958, this_prologue_cache=0x80608970, this_id=0x806089b8) at s390-tdep.c:1583
#7 in get_frame_id (fi=0x80608958) at frame.c:335
#8 in frame_find_by_id (id={stack_addr = 4398044824952, code_addr = 2147484952, special_addr = 0, stack_addr_p = 1, code_addr_p = 1, special_addr_p = 0, inline_depth = 0}) at frame.c:587
#9 in watchpoint_check (p=0x8095bbc0) at breakpoint.c:3203
#10 in catch_errors (func=0x801262c0 <watchpoint_check>, func_args=0x8095bbc0, errstring=0x80a26410 "Error evaluating expression for watchpoint 3\n", mask=6) at exceptions.c:510
#11 in bpstat_check_watchpoint (bs=0x8095bbc0) at breakpoint.c:3404
#12 in bpstat_stop_status (aspace=0x8061fcb0, bp_addr=2147485040, ptid={pid = 17372, lwp = 17372, tid = 0}) at breakpoint.c:3594
#13 in handle_inferior_event (ecs=0x3ffffc80520) at infrun.c:3588
I did not analyze why 6.8 did not error out, the GDB code is similar there.
No regressions on:
{x86_64,x86_64-m32,i686}-fedora12-linux-gnu (CVS HEAD GDB)
s390x-rhel48-linux-gnu (CVS HEAD GDB)
s390-rhel48-linux-gnu (CVS HEAD GDB)
s390x-rhel54-linux-gnu (Fedora 12 GDB)
s390-rhel54-linux-gnu (Fedora 12 GDB)
Thanks,
Jan
gdb/
2009-12-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* breakpoint.c (watchpoint_check): Check the call
gdbarch_in_function_epilogue_p before calling frame_find_by_id.
Extend the comment.
gdb/testsuite/
2009-12-25 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/watchpoint-cond-gone.exp, gdb.base/watchpoint-cond-gone.c,
gdb.base/watchpoint-cond-gone-stripped.c: New.
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -3200,6 +3200,17 @@ watchpoint_check (void *p)
struct gdbarch *frame_arch = get_frame_arch (frame);
CORE_ADDR frame_pc = get_frame_pc (frame);
+ /* in_function_epilogue_p() returns a non-zero value if we're still
+ in the function but the stack frame has already been invalidated.
+ Since we can't rely on the values of local variables after the
+ stack has been destroyed, we are treating the watchpoint in that
+ state as `not changed' without further checking. Don't mark
+ watchpoints as changed if the current frame is in an epilogue -
+ even if they are in some other frame, our view of the stack
+ is likely to be wrong and frame_find_by_id could error out. */
+ if (gdbarch_in_function_epilogue_p (frame_arch, frame_pc))
+ return WP_VALUE_NOT_CHANGED;
+
fr = frame_find_by_id (b->watchpoint_frame);
within_current_scope = (fr != NULL);
@@ -3216,17 +3227,6 @@ watchpoint_check (void *p)
within_current_scope = 0;
}
- /* in_function_epilogue_p() returns a non-zero value if we're still
- in the function but the stack frame has already been invalidated.
- Since we can't rely on the values of local variables after the
- stack has been destroyed, we are treating the watchpoint in that
- state as `not changed' without further checking. Don't mark
- watchpoints as changed if the current frame is in an epilogue -
- even if they are in some other frame, our view of the stack
- is likely to be wrong. */
- if (gdbarch_in_function_epilogue_p (frame_arch, frame_pc))
- return WP_VALUE_NOT_CHANGED;
-
if (within_current_scope)
/* If we end up stopping, the current frame will get selected
in normal_stop. So this call to select_frame won't affect
--- /dev/null
+++ b/gdb/testsuite/gdb.base/watchpoint-cond-gone-stripped.c
@@ -0,0 +1,23 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2009 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+void
+jumper (void (*jumpto) (void))
+{
+ (*jumpto) ();
+}
--- /dev/null
+++ b/gdb/testsuite/gdb.base/watchpoint-cond-gone.c
@@ -0,0 +1,37 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2009 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
+
+extern void jumper (void (*jumpto) (void));
+
+static void
+func (void)
+{
+ volatile int c;
+
+ c = 5;
+ c = 10; /* watchpoint-here */
+ c = 20;
+}
+
+int
+main (void)
+{
+ jumper (func);
+
+ return 0;
+}
--- /dev/null
+++ b/gdb/testsuite/gdb.base/watchpoint-cond-gone.exp
@@ -0,0 +1,51 @@
+# Copyright 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+set testfile "watchpoint-cond-gone"
+set srcfile ${testfile}.c
+set srcfilestripped ${testfile}-stripped.c
+set objfilestripped ${objdir}/${subdir}/${testfile}-stripped.o
+set binfile ${objdir}/${subdir}/${testfile}
+
+# We need to generate a function without DWARF to crash older GDB.
+# Stepping into a dynamic function trampoline or stepping out of MAIN may work
+# but it is not a reliable FAIL case.
+
+if { [gdb_compile "${srcdir}/${subdir}/${srcfilestripped}" "${objfilestripped}" object {}] != ""
+ || [gdb_compile "${srcdir}/${subdir}/${srcfile} ${objfilestripped}" "${binfile}" executable {debug}] != "" } {
+ gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
+}
+
+clean_restart ${testfile}
+
+# Problem does not occur otherwise.
+gdb_test "set can-use-hw-watchpoints 0"
+
+if ![runto_main] {
+ return -1
+}
+
+gdb_breakpoint [gdb_get_line_number "watchpoint-here"]
+gdb_continue_to_breakpoint "Place to set the watchpoint"
+
+# The condition `c == 30' is the subject being tested.
+gdb_test "watch c if c == 30" "" "Place the watchpoint"
+
+# We may stay either in the function itself or only at the first instruction of
+# its caller depending on the epilogue unwinder (or valid epilogue CFI) presence.
+gdb_test "finish" \
+ "Watchpoint .* deleted because the program has left the block in.*which its expression is valid..*in (jumper|func).*" \
+ "Catch the no longer valid watchpoint"

View File

@ -32,11 +32,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: 7.0.50.20100118
Version: 7.0.50.20100121
# 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: 2%{?_with_upstream:.upstream}%{dist}
Release: 1%{?_with_upstream:.upstream}%{dist}
License: GPLv3+
Group: Development/Debuggers
@ -322,9 +322,6 @@ Patch309: gdb-6.3-mapping-zero-inode-test.patch
# Test a crash on `focus cmd', `focus prev' commands.
Patch311: gdb-6.3-focus-cmd-prev-test.patch
# Fix error on a sw watchpoint active at function epilogue (hit on s390x).
Patch314: gdb-watchpoint-cond-gone.patch
# Test various forms of threads tracking across exec() (BZ 442765).
Patch315: gdb-6.8-bz442765-threaded-exec-test.patch
@ -403,9 +400,6 @@ Patch393: gdb-rhel5-gcc44.patch
# Workaround RHEL-5 kernels for detaching SIGSTOPped processes (BZ 498595).
Patch335: gdb-rhel5-compat.patch
# Fix backward compatibility with G++ 4.1 namespaces "::".
Patch395: gdb-empty-namespace.patch
# Fix regression by python on ia64 due to stale current frame.
Patch397: gdb-follow-child-stale-parent.patch
@ -428,8 +422,11 @@ Patch407: gdb-lineno-makeup-test.patch
# Test power7 ppc disassembly.
Patch408: gdb-ppc-power7-test.patch
# [patch] testsuite: Fix misplaced line numbers
Patch410: gdb-testsuite-lineno.patch
# Fix solib-display.exp crash
Patch411: gdb-solib-display.patch
# Revert: Add -Wunused-function to compile flags.
Patch412: gdb-unused-revert.patch
BuildRequires: ncurses-devel%{?_isa} texinfo gettext flex bison expat-devel%{?_isa}
Requires: readline%{?_isa}
@ -641,7 +638,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch304 -p1
%patch309 -p1
%patch311 -p1
%patch314 -p1
%patch315 -p1
%patch317 -p1
%patch318 -p1
@ -665,7 +661,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch390 -p1
%patch391 -p1
%patch392 -p1
%patch395 -p1
%patch397 -p1
%patch400 -p1
%patch403 -p1
@ -676,7 +671,8 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
%patch406 -p1
%patch407 -p1
%patch408 -p1
%patch410 -p1
%patch411 -p1
%patch412 -p1
# Always verify its applicability.
%patch393 -p1
%patch335 -p1
@ -1002,6 +998,11 @@ fi
%endif
%changelog
* Thu Jan 21 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.50.20100121-1.fc13
- Upgrade to the FSF GDB snapshot: 7.0.50.20100121
- archer-jankratochvil-fedora13 commit: ccde1530479cc966374351038057b9dda90aa251
- [expr-cumulative] Archer branch is now included.
* Tue Jan 19 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.50.20100118-2.fc13
- Fix false PASS->FAIL of gdb.arch/i386-biarch-core.exp.

View File

@ -1,2 +1,2 @@
2fb1a2ac78b3bdc495bbabd85e310a5d gdb-7.0.50.20100118.tar.bz2
fcfbe6ccb36d86bc06891fbd70f1664d gdb-7.0.50.20100121.tar.bz2
04e5c4b1b9e633422cc48990fe61958d libstdc++-v3-python-r155978.tar.bz2