Compare commits
21 Commits
master
...
gdb-7_1-11
Author | SHA1 | Date | |
---|---|---|---|
|
e5a09646a4 | ||
|
b6c87f7508 | ||
|
5a2bd3eb0c | ||
|
e8eaf64065 | ||
|
08d0039c69 | ||
|
cb6c86a414 | ||
|
78b04abd3b | ||
|
4d8484913a | ||
|
862a58ce4d | ||
|
7b8bd72d9a | ||
|
2770a5f431 | ||
|
37c8c133f1 | ||
|
00f225b5de | ||
|
c395942bc7 | ||
|
3fe05e2e87 | ||
|
8150eb3b6a | ||
|
0b181c5698 | ||
|
03de7209a3 | ||
|
991247c843 | ||
|
7d64017236 | ||
|
c448a64ed8 |
@ -1,2 +1,2 @@
|
|||||||
gdb-7.0.50.20100203.tar.bz2
|
gdb-7.1.tar.bz2
|
||||||
libstdc++-v3-python-r155978.tar.bz2
|
libstdc++-v3-python-r155978.tar.bz2
|
||||||
|
@ -4,10 +4,9 @@
|
|||||||
to install and uninstall.
|
to install and uninstall.
|
||||||
* gstack.sh, gstack.1: New files.
|
* gstack.sh, gstack.1: New files.
|
||||||
|
|
||||||
Index: gdb-6.8.91.20090917/gdb/Makefile.in
|
diff -up -ruNp gdb-7.0.1-empty/gdb/Makefile.in gdb-7.0.1/gdb/Makefile.in
|
||||||
===================================================================
|
--- gdb-7.0.1-empty/gdb/Makefile.in 2010-04-07 20:36:04.000000000 +0200
|
||||||
--- gdb-6.8.91.20090917.orig/gdb/Makefile.in 2009-09-17 12:47:07.000000000 +0200
|
+++ gdb-7.0.1/gdb/Makefile.in 2010-04-07 20:36:42.000000000 +0200
|
||||||
+++ gdb-6.8.91.20090917/gdb/Makefile.in 2009-09-17 12:47:38.000000000 +0200
|
|
||||||
@@ -989,7 +989,7 @@ install: all install-only
|
@@ -989,7 +989,7 @@ install: all install-only
|
||||||
|
|
||||||
# The "install-only" target also installs the syscalls' XML files in
|
# The "install-only" target also installs the syscalls' XML files in
|
||||||
@ -63,10 +62,9 @@ Index: gdb-6.8.91.20090917/gdb/Makefile.in
|
|||||||
|
|
||||||
# The C++ name parser can be built standalone for testing.
|
# The C++ name parser can be built standalone for testing.
|
||||||
test-cp-name-parser.o: cp-name-parser.c
|
test-cp-name-parser.o: cp-name-parser.c
|
||||||
Index: gdb-6.8.91.20090917/gdb/gstack.sh
|
diff -up -ruNp gdb-7.0.1-empty/gdb/gstack.sh gdb-7.0.1/gdb/gstack.sh
|
||||||
===================================================================
|
--- gdb-7.0.1-empty/gdb/gstack.sh 1970-01-01 01:00:00.000000000 +0100
|
||||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
+++ gdb-7.0.1/gdb/gstack.sh 2010-04-07 20:36:47.000000000 +0200
|
||||||
+++ gdb-6.8.91.20090917/gdb/gstack.sh 2009-09-17 12:47:14.000000000 +0200
|
|
||||||
@@ -0,0 +1,48 @@
|
@@ -0,0 +1,48 @@
|
||||||
+#!/bin/sh
|
+#!/bin/sh
|
||||||
+
|
+
|
||||||
@ -87,17 +85,17 @@ Index: gdb-6.8.91.20090917/gdb/gstack.sh
|
|||||||
+backtrace="bt"
|
+backtrace="bt"
|
||||||
+if test -d /proc/$1/task ; then
|
+if test -d /proc/$1/task ; then
|
||||||
+ # Newer kernel; has a task/ directory.
|
+ # Newer kernel; has a task/ directory.
|
||||||
+ if test `ls /proc/$1/task | wc -l` -gt 1 2>/dev/null ; then
|
+ if test `/bin/ls /proc/$1/task | /usr/bin/wc -l` -gt 1 2>/dev/null ; then
|
||||||
+ backtrace="thread apply all bt"
|
+ backtrace="thread apply all bt"
|
||||||
+ fi
|
+ fi
|
||||||
+elif test -f /proc/$1/maps ; then
|
+elif test -f /proc/$1/maps ; then
|
||||||
+ # Older kernel; go by it loading libpthread.
|
+ # Older kernel; go by it loading libpthread.
|
||||||
+ if grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
|
+ if /bin/grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
|
||||||
+ backtrace="thread apply all bt"
|
+ backtrace="thread apply all bt"
|
||||||
+ fi
|
+ fi
|
||||||
+fi
|
+fi
|
||||||
+
|
+
|
||||||
+GDB=${GDB:-gdb}
|
+GDB=${GDB:-/usr/bin/gdb}
|
||||||
+
|
+
|
||||||
+if $GDB -nx --quiet --batch --readnever > /dev/null 2>&1; then
|
+if $GDB -nx --quiet --batch --readnever > /dev/null 2>&1; then
|
||||||
+ readnever=--readnever
|
+ readnever=--readnever
|
||||||
@ -112,7 +110,127 @@ Index: gdb-6.8.91.20090917/gdb/gstack.sh
|
|||||||
+set pagination no
|
+set pagination no
|
||||||
+$backtrace
|
+$backtrace
|
||||||
+EOF
|
+EOF
|
||||||
+sed -n \
|
+/bin/sed -n \
|
||||||
+ -e 's/^(gdb) //' \
|
+ -e 's/^\((gdb) \)*//' \
|
||||||
+ -e '/^#/p' \
|
+ -e '/^#/p' \
|
||||||
+ -e '/^Thread/p'
|
+ -e '/^Thread/p'
|
||||||
|
--- /dev/null 2010-04-07 06:20:52.289994508 +0200
|
||||||
|
+++ gdb-7.0.1/gdb/testsuite/gdb.base/gstack.exp 2010-04-07 21:53:57.000000000 +0200
|
||||||
|
@@ -0,0 +1,71 @@
|
||||||
|
+# Copyright (C) 2010 Free Software Foundation, Inc.
|
||||||
|
+
|
||||||
|
+# This program is free software; you can redistribute it and/or modify
|
||||||
|
+# it under the terms of the GNU General Public License as published by
|
||||||
|
+# the Free Software Foundation; either version 3 of the License, or
|
||||||
|
+# (at your option) any later version.
|
||||||
|
+#
|
||||||
|
+# This program is distributed in the hope that it will be useful,
|
||||||
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
+# GNU General Public License for more details.
|
||||||
|
+#
|
||||||
|
+# You should have received a copy of the GNU General Public License
|
||||||
|
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
+
|
||||||
|
+set testfile gstack
|
||||||
|
+set executable ${testfile}
|
||||||
|
+set binfile ${objdir}/${subdir}/$executable
|
||||||
|
+if {[build_executable ${testfile} ${executable} "" {debug}] == -1} {
|
||||||
|
+ return -1
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+set test "spawn inferior"
|
||||||
|
+set command "${binfile}"
|
||||||
|
+set res [remote_spawn host $command];
|
||||||
|
+if { $res < 0 || $res == "" } {
|
||||||
|
+ perror "Spawning $command failed."
|
||||||
|
+ fail $test
|
||||||
|
+ return
|
||||||
|
+}
|
||||||
|
+set pid [exp_pid -i $res]
|
||||||
|
+gdb_expect {
|
||||||
|
+ -re "looping\r\n" {
|
||||||
|
+ pass $test
|
||||||
|
+ }
|
||||||
|
+ eof {
|
||||||
|
+ fail "$test (eof)"
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
+ timeout {
|
||||||
|
+ fail "$test (timeout)"
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+gdb_exit
|
||||||
|
+
|
||||||
|
+# Testcase uses the most simple notification not to get caught by attach on
|
||||||
|
+# exiting the function. Still we could retry the gstack command if we fail.
|
||||||
|
+
|
||||||
|
+set test "spawn gstack"
|
||||||
|
+set command "sh -c GDB=$GDB\\ sh\\ ${srcdir}/../gstack.sh\\ $pid\\;echo\\ GSTACK-END"
|
||||||
|
+set res [remote_spawn host $command];
|
||||||
|
+if { $res < 0 || $res == "" } {
|
||||||
|
+ perror "Spawning $command failed."
|
||||||
|
+ fail $test
|
||||||
|
+}
|
||||||
|
+set pid [exp_pid -i $res]
|
||||||
|
+gdb_expect {
|
||||||
|
+ -re {^#0 +0x[0-9a-f]+ in \.?func \(\)\r\n#1 +0x[0-9a-f]+ in \.?main \(\)\r\nGSTACK-END\r\n$} {
|
||||||
|
+ pass $test
|
||||||
|
+ }
|
||||||
|
+ eof {
|
||||||
|
+ fail "$test (eof)"
|
||||||
|
+ }
|
||||||
|
+ timeout {
|
||||||
|
+ fail "$test (timeout)"
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+gdb_exit
|
||||||
|
+
|
||||||
|
+remote_exec host "kill -9 $pid"
|
||||||
|
--- /dev/null 2010-04-07 06:20:52.289994508 +0200
|
||||||
|
+++ gdb-7.0.1/gdb/testsuite/gdb.base/gstack.c 2010-04-07 21:46:52.000000000 +0200
|
||||||
|
@@ -0,0 +1,43 @@
|
||||||
|
+/* This testcase is part of GDB, the GNU debugger.
|
||||||
|
+
|
||||||
|
+ Copyright 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||||
|
+
|
||||||
|
+ This program is free software; you can redistribute it and/or modify
|
||||||
|
+ it under the terms of the GNU General Public License as published by
|
||||||
|
+ the Free Software Foundation; either version 3 of the License, or
|
||||||
|
+ (at your option) any later version.
|
||||||
|
+
|
||||||
|
+ This program is distributed in the hope that it will be useful,
|
||||||
|
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
+ GNU General Public License for more details.
|
||||||
|
+
|
||||||
|
+ You should have received a copy of the GNU General Public License
|
||||||
|
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
+
|
||||||
|
+#include <stdio.h>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+#include <string.h>
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+func (void)
|
||||||
|
+{
|
||||||
|
+ const char msg[] = "looping\n";
|
||||||
|
+
|
||||||
|
+ /* Use the most simple notification not to get caught by attach on exiting
|
||||||
|
+ the function. */
|
||||||
|
+ write (1, msg, strlen (msg));
|
||||||
|
+
|
||||||
|
+ for (;;);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+int
|
||||||
|
+main (void)
|
||||||
|
+{
|
||||||
|
+ alarm (60);
|
||||||
|
+ nice (100);
|
||||||
|
+
|
||||||
|
+ func ();
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
Index: gdb-6.3/gdb/gstack.sh
|
|
||||||
===================================================================
|
|
||||||
--- gdb-6.3.orig/gdb/gstack.sh 2006-02-14 17:21:05.000000000 -0200
|
|
||||||
+++ gdb-6.3/gdb/gstack.sh 2006-04-14 03:17:12.000000000 -0300
|
|
||||||
@@ -17,17 +17,17 @@ fi
|
|
||||||
backtrace="bt"
|
|
||||||
if test -d /proc/$1/task ; then
|
|
||||||
# Newer kernel; has a task/ directory.
|
|
||||||
- if test `ls /proc/$1/task | wc -l` -gt 1 2>/dev/null ; then
|
|
||||||
+ if test `/bin/ls /proc/$1/task | /usr/bin/wc -l` -gt 1 2>/dev/null ; then
|
|
||||||
backtrace="thread apply all bt"
|
|
||||||
fi
|
|
||||||
elif test -f /proc/$1/maps ; then
|
|
||||||
# Older kernel; go by it loading libpthread.
|
|
||||||
- if grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
|
|
||||||
+ if /bin/grep -e libpthread /proc/$1/maps > /dev/null 2>&1 ; then
|
|
||||||
backtrace="thread apply all bt"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
-GDB=${GDB:-gdb}
|
|
||||||
+GDB=${GDB:-/usr/bin/gdb}
|
|
||||||
|
|
||||||
if $GDB -nx --quiet --batch --readnever > /dev/null 2>&1; then
|
|
||||||
readnever=--readnever
|
|
||||||
@@ -39,7 +39,7 @@ fi
|
|
||||||
set pagination no
|
|
||||||
$backtrace
|
|
||||||
EOF
|
|
||||||
-sed -n \
|
|
||||||
+/bin/sed -n \
|
|
||||||
-e 's/^(gdb) //' \
|
|
||||||
-e '/^#/p' \
|
|
||||||
-e '/^Thread/p'
|
|
@ -11,11 +11,11 @@
|
|||||||
|
|
||||||
* gdb.texinfo (File Options): Document --readnever.
|
* gdb.texinfo (File Options): Document --readnever.
|
||||||
|
|
||||||
Index: gdb-7.0.50.20100121/gdb/doc/gdb.texinfo
|
Index: gdb-7.0.90.20100306/gdb/doc/gdb.texinfo
|
||||||
===================================================================
|
===================================================================
|
||||||
--- gdb-7.0.50.20100121.orig/gdb/doc/gdb.texinfo 2010-01-21 15:11:09.000000000 +0100
|
--- gdb-7.0.90.20100306.orig/gdb/doc/gdb.texinfo 2010-03-06 23:19:13.000000000 +0100
|
||||||
+++ gdb-7.0.50.20100121/gdb/doc/gdb.texinfo 2010-01-21 15:13:02.000000000 +0100
|
+++ gdb-7.0.90.20100306/gdb/doc/gdb.texinfo 2010-03-06 23:20:35.000000000 +0100
|
||||||
@@ -997,6 +997,12 @@ Read each symbol file's entire symbol ta
|
@@ -995,6 +995,12 @@ Read each symbol file's entire symbol ta
|
||||||
the default, which is to read it incrementally as it is needed.
|
the default, which is to read it incrementally as it is needed.
|
||||||
This makes startup slower, but makes future operations faster.
|
This makes startup slower, but makes future operations faster.
|
||||||
|
|
||||||
@ -28,10 +28,10 @@ Index: gdb-7.0.50.20100121/gdb/doc/gdb.texinfo
|
|||||||
@end table
|
@end table
|
||||||
|
|
||||||
@node Mode Options
|
@node Mode Options
|
||||||
Index: gdb-7.0.50.20100121/gdb/main.c
|
Index: gdb-7.0.90.20100306/gdb/main.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- gdb-7.0.50.20100121.orig/gdb/main.c 2010-01-21 15:11:18.000000000 +0100
|
--- gdb-7.0.90.20100306.orig/gdb/main.c 2010-03-06 23:20:23.000000000 +0100
|
||||||
+++ gdb-7.0.50.20100121/gdb/main.c 2010-01-21 15:13:02.000000000 +0100
|
+++ gdb-7.0.90.20100306/gdb/main.c 2010-03-06 23:20:35.000000000 +0100
|
||||||
@@ -382,6 +382,7 @@ captured_main (void *data)
|
@@ -382,6 +382,7 @@ captured_main (void *data)
|
||||||
{"xdb", no_argument, &xdb_commands, 1},
|
{"xdb", no_argument, &xdb_commands, 1},
|
||||||
{"dbx", no_argument, &dbx_commands, 1},
|
{"dbx", no_argument, &dbx_commands, 1},
|
||||||
@ -48,10 +48,10 @@ Index: gdb-7.0.50.20100121/gdb/main.c
|
|||||||
"), stream);
|
"), stream);
|
||||||
fputs_unfiltered (_("\
|
fputs_unfiltered (_("\
|
||||||
--se=FILE Use FILE as symbol file and executable file.\n\
|
--se=FILE Use FILE as symbol file and executable file.\n\
|
||||||
Index: gdb-7.0.50.20100121/gdb/symfile.c
|
Index: gdb-7.0.90.20100306/gdb/symfile.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- gdb-7.0.50.20100121.orig/gdb/symfile.c 2010-01-21 15:11:09.000000000 +0100
|
--- gdb-7.0.90.20100306.orig/gdb/symfile.c 2010-03-06 23:19:13.000000000 +0100
|
||||||
+++ gdb-7.0.50.20100121/gdb/symfile.c 2010-01-21 15:13:02.000000000 +0100
|
+++ gdb-7.0.90.20100306/gdb/symfile.c 2010-03-06 23:20:35.000000000 +0100
|
||||||
@@ -79,6 +79,7 @@ static void clear_symtab_users_cleanup (
|
@@ -79,6 +79,7 @@ static void clear_symtab_users_cleanup (
|
||||||
|
|
||||||
/* Global variables owned by this file */
|
/* Global variables owned by this file */
|
||||||
@ -60,19 +60,19 @@ Index: gdb-7.0.50.20100121/gdb/symfile.c
|
|||||||
|
|
||||||
/* External variables and functions referenced. */
|
/* External variables and functions referenced. */
|
||||||
|
|
||||||
Index: gdb-7.0.50.20100121/gdb/dwarf2read.c
|
Index: gdb-7.0.90.20100306/gdb/dwarf2read.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- gdb-7.0.50.20100121.orig/gdb/dwarf2read.c 2010-01-21 15:11:09.000000000 +0100
|
--- gdb-7.0.90.20100306.orig/gdb/dwarf2read.c 2010-03-06 23:19:13.000000000 +0100
|
||||||
+++ gdb-7.0.50.20100121/gdb/dwarf2read.c 2010-01-21 15:13:15.000000000 +0100
|
+++ gdb-7.0.90.20100306/gdb/dwarf2read.c 2010-03-06 23:20:54.000000000 +0100
|
||||||
@@ -53,6 +53,7 @@
|
@@ -52,6 +52,7 @@
|
||||||
|
#include "f-lang.h"
|
||||||
#include "typeprint.h"
|
#include "typeprint.h"
|
||||||
#include "jv-lang.h"
|
#include "jv-lang.h"
|
||||||
#include "vec.h"
|
|
||||||
+#include "top.h"
|
+#include "top.h"
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include "gdb_string.h"
|
#include "gdb_string.h"
|
||||||
@@ -1237,7 +1238,8 @@ dwarf2_has_info (struct objfile *objfile
|
@@ -1222,7 +1223,8 @@ dwarf2_has_info (struct objfile *objfile
|
||||||
|
|
||||||
bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL);
|
bfd_map_over_sections (objfile->obfd, dwarf2_locate_sections, NULL);
|
||||||
}
|
}
|
||||||
@ -82,10 +82,10 @@ Index: gdb-7.0.50.20100121/gdb/dwarf2read.c
|
|||||||
&& dwarf2_per_objfile->abbrev.asection != NULL);
|
&& dwarf2_per_objfile->abbrev.asection != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
Index: gdb-7.0.50.20100121/gdb/top.h
|
Index: gdb-7.0.90.20100306/gdb/top.h
|
||||||
===================================================================
|
===================================================================
|
||||||
--- gdb-7.0.50.20100121.orig/gdb/top.h 2010-01-01 08:31:42.000000000 +0100
|
--- gdb-7.0.90.20100306.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
|
+++ gdb-7.0.90.20100306/gdb/top.h 2010-03-06 23:20:35.000000000 +0100
|
||||||
@@ -63,6 +63,7 @@ extern void set_prompt (char *);
|
@@ -63,6 +63,7 @@ extern void set_prompt (char *);
|
||||||
|
|
||||||
/* From random places. */
|
/* From random places. */
|
||||||
|
@ -1,29 +1,29 @@
|
|||||||
Index: gdb-6.8.50.20090909/gdb/testsuite/configure.ac
|
Index: gdb-7.0.90.20100306/gdb/testsuite/configure.ac
|
||||||
===================================================================
|
===================================================================
|
||||||
--- gdb-6.8.50.20090909.orig/gdb/testsuite/configure.ac 2009-07-31 17:38:16.000000000 +0200
|
--- gdb-7.0.90.20100306.orig/gdb/testsuite/configure.ac 2010-02-19 20:16:36.000000000 +0100
|
||||||
+++ gdb-6.8.50.20090909/gdb/testsuite/configure.ac 2009-09-09 19:06:01.000000000 +0200
|
+++ gdb-7.0.90.20100306/gdb/testsuite/configure.ac 2010-03-06 23:19:56.000000000 +0100
|
||||||
@@ -144,6 +144,6 @@ AC_OUTPUT([Makefile \
|
@@ -144,6 +144,6 @@ AC_OUTPUT([Makefile \
|
||||||
gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \
|
gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile \
|
||||||
gdb.fortran/Makefile gdb.server/Makefile \
|
gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile \
|
||||||
gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile \
|
gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile \
|
||||||
- gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile \
|
- gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile \
|
||||||
+ gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \
|
+ gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \
|
||||||
gdb.python/Makefile gdb.reverse/Makefile \
|
gdb.python/Makefile gdb.reverse/Makefile \
|
||||||
gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile])
|
gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile])
|
||||||
Index: gdb-6.8.50.20090909/gdb/testsuite/configure
|
Index: gdb-7.0.90.20100306/gdb/testsuite/configure
|
||||||
===================================================================
|
===================================================================
|
||||||
--- gdb-6.8.50.20090909.orig/gdb/testsuite/configure 2009-08-22 18:56:43.000000000 +0200
|
--- gdb-7.0.90.20100306.orig/gdb/testsuite/configure 2010-02-19 20:16:36.000000000 +0100
|
||||||
+++ gdb-6.8.50.20090909/gdb/testsuite/configure 2009-09-09 19:06:27.000000000 +0200
|
+++ gdb-7.0.90.20100306/gdb/testsuite/configure 2010-03-06 23:20:12.000000000 +0100
|
||||||
@@ -3515,7 +3515,7 @@ done
|
@@ -3515,7 +3515,7 @@ done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
|
-ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
|
||||||
+ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
|
+ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.server/Makefile gdb.java/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile"
|
||||||
|
|
||||||
cat >confcache <<\_ACEOF
|
cat >confcache <<\_ACEOF
|
||||||
# This file is a shell script that caches the results of configure
|
# This file is a shell script that caches the results of configure
|
||||||
@@ -4231,6 +4231,7 @@ do
|
@@ -4232,6 +4232,7 @@ do
|
||||||
"gdb.objc/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.objc/Makefile" ;;
|
"gdb.objc/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.objc/Makefile" ;;
|
||||||
"gdb.opt/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;;
|
"gdb.opt/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;;
|
||||||
"gdb.pascal/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;;
|
"gdb.pascal/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;;
|
||||||
@ -31,10 +31,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/configure
|
|||||||
"gdb.python/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;;
|
"gdb.python/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;;
|
||||||
"gdb.reverse/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.reverse/Makefile" ;;
|
"gdb.reverse/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.reverse/Makefile" ;;
|
||||||
"gdb.threads/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;;
|
"gdb.threads/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.threads/Makefile" ;;
|
||||||
Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.c
|
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||||
+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.c 2009-09-09 19:06:01.000000000 +0200
|
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.c 2010-03-06 23:19:31.000000000 +0100
|
||||||
@@ -0,0 +1,20 @@
|
@@ -0,0 +1,20 @@
|
||||||
+/* This program is intended to be started outside of gdb, and then
|
+/* This program is intended to be started outside of gdb, and then
|
||||||
+ attached to by gdb. Thus, it simply spins in a loop. The loop
|
+ attached to by gdb. Thus, it simply spins in a loop. The loop
|
||||||
@ -56,10 +56,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.c
|
|||||||
+ }
|
+ }
|
||||||
+ return 0;
|
+ return 0;
|
||||||
+}
|
+}
|
||||||
Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach2.c
|
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach2.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||||
+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach2.c 2009-09-09 19:06:01.000000000 +0200
|
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach2.c 2010-03-06 23:19:31.000000000 +0100
|
||||||
@@ -0,0 +1,24 @@
|
@@ -0,0 +1,24 @@
|
||||||
+/* This program is intended to be started outside of gdb, and then
|
+/* This program is intended to be started outside of gdb, and then
|
||||||
+ attached to by gdb. Thus, it simply spins in a loop. The loop
|
+ attached to by gdb. Thus, it simply spins in a loop. The loop
|
||||||
@ -85,10 +85,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach2.c
|
|||||||
+ }
|
+ }
|
||||||
+ return (0);
|
+ return (0);
|
||||||
+}
|
+}
|
||||||
Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.c
|
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||||
+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.c 2009-09-09 19:06:01.000000000 +0200
|
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.c 2010-03-06 23:19:31.000000000 +0100
|
||||||
@@ -0,0 +1,146 @@
|
@@ -0,0 +1,146 @@
|
||||||
+/* This testcase is part of GDB, the GNU debugger.
|
+/* This testcase is part of GDB, the GNU debugger.
|
||||||
+
|
+
|
||||||
@ -236,10 +236,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.c
|
|||||||
+ }
|
+ }
|
||||||
+ return 0;
|
+ return 0;
|
||||||
+}
|
+}
|
||||||
Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break1.c
|
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break1.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||||
+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break1.c 2009-09-09 19:06:01.000000000 +0200
|
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break1.c 2010-03-06 23:19:31.000000000 +0100
|
||||||
@@ -0,0 +1,44 @@
|
@@ -0,0 +1,44 @@
|
||||||
+/* This testcase is part of GDB, the GNU debugger.
|
+/* This testcase is part of GDB, the GNU debugger.
|
||||||
+
|
+
|
||||||
@ -285,10 +285,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break1.c
|
|||||||
+void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */
|
+void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */
|
||||||
+void marker4 (d) long d; {} /* set breakpoint 13 here */
|
+void marker4 (d) long d; {} /* set breakpoint 13 here */
|
||||||
+#endif
|
+#endif
|
||||||
Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/coremaker.c
|
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/coremaker.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||||
+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/coremaker.c 2009-09-09 19:06:01.000000000 +0200
|
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/coremaker.c 2010-03-06 23:19:31.000000000 +0100
|
||||||
@@ -0,0 +1,142 @@
|
@@ -0,0 +1,142 @@
|
||||||
+/* Copyright 1992, 1993, 1994, 1995, 1996, 1999
|
+/* Copyright 1992, 1993, 1994, 1995, 1996, 1999
|
||||||
+ Free Software Foundation, Inc.
|
+ Free Software Foundation, Inc.
|
||||||
@ -432,10 +432,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/coremaker.c
|
|||||||
+ return 0;
|
+ return 0;
|
||||||
+}
|
+}
|
||||||
+
|
+
|
||||||
Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.exp
|
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.exp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||||
+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.exp 2009-09-09 19:06:01.000000000 +0200
|
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/attach.exp 2010-03-06 23:19:31.000000000 +0100
|
||||||
@@ -0,0 +1,433 @@
|
@@ -0,0 +1,433 @@
|
||||||
+# Copyright 1997, 1999, 2002 Free Software Foundation, Inc.
|
+# Copyright 1997, 1999, 2002 Free Software Foundation, Inc.
|
||||||
+
|
+
|
||||||
@ -870,10 +870,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/attach.exp
|
|||||||
+do_call_attach_tests
|
+do_call_attach_tests
|
||||||
+
|
+
|
||||||
+return 0
|
+return 0
|
||||||
Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.exp
|
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.exp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||||
+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.exp 2009-09-09 19:06:01.000000000 +0200
|
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/break.exp 2010-03-06 23:19:31.000000000 +0100
|
||||||
@@ -0,0 +1,977 @@
|
@@ -0,0 +1,977 @@
|
||||||
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
|
+# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999,
|
||||||
+# 2000, 2002, 2003, 2004
|
+# 2000, 2002, 2003, 2004
|
||||||
@ -1852,10 +1852,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/break.exp
|
|||||||
+ send_gdb "set args main\n"
|
+ send_gdb "set args main\n"
|
||||||
+ gdb_expect -re ".*$gdb_prompt $" {}
|
+ gdb_expect -re ".*$gdb_prompt $" {}
|
||||||
+}
|
+}
|
||||||
Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/corefile.exp
|
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/corefile.exp
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||||
+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/corefile.exp 2009-09-09 19:06:01.000000000 +0200
|
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/corefile.exp 2010-03-06 23:19:31.000000000 +0100
|
||||||
@@ -0,0 +1,243 @@
|
@@ -0,0 +1,243 @@
|
||||||
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
|
||||||
+# Free Software Foundation, Inc.
|
+# Free Software Foundation, Inc.
|
||||||
@ -2100,10 +2100,10 @@ Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/corefile.exp
|
|||||||
+gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp (reinit)"
|
+gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp (reinit)"
|
||||||
+
|
+
|
||||||
+gdb_test "core" "No core file now."
|
+gdb_test "core" "No core file now."
|
||||||
Index: gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/Makefile.in
|
Index: gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/Makefile.in
|
||||||
===================================================================
|
===================================================================
|
||||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||||
+++ gdb-6.8.50.20090909/gdb/testsuite/gdb.pie/Makefile.in 2009-09-09 19:06:01.000000000 +0200
|
+++ gdb-7.0.90.20100306/gdb/testsuite/gdb.pie/Makefile.in 2010-03-06 23:19:31.000000000 +0100
|
||||||
@@ -0,0 +1,19 @@
|
@@ -0,0 +1,19 @@
|
||||||
+VPATH = @srcdir@
|
+VPATH = @srcdir@
|
||||||
+srcdir = @srcdir@
|
+srcdir = @srcdir@
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
Index: gdb-6.8.50.20090802/gdb/symfile.c
|
Index: gdb-7.0.90.20100306/gdb/symfile.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- gdb-6.8.50.20090802.orig/gdb/symfile.c 2009-08-03 12:29:58.000000000 +0200
|
--- gdb-7.0.90.20100306.orig/gdb/symfile.c 2010-03-06 23:20:35.000000000 +0100
|
||||||
+++ gdb-6.8.50.20090802/gdb/symfile.c 2009-08-03 12:40:58.000000000 +0200
|
+++ gdb-7.0.90.20100306/gdb/symfile.c 2010-03-06 23:26:25.000000000 +0100
|
||||||
@@ -4012,6 +4012,12 @@ symfile_dummy_outputs (bfd *abfd, asecti
|
@@ -3642,6 +3642,12 @@ default_symfile_relocate (struct objfile
|
||||||
bfd_byte *
|
|
||||||
symfile_relocate_debug_section (bfd *abfd, asection *sectp, bfd_byte *buf)
|
|
||||||
{
|
{
|
||||||
|
bfd *abfd = objfile->obfd;
|
||||||
|
|
||||||
+ /* Executable files have all the relocations already resolved.
|
+ /* Executable files have all the relocations already resolved.
|
||||||
+ * Handle files linked with --emit-relocs.
|
+ * Handle files linked with --emit-relocs.
|
||||||
+ * http://sources.redhat.com/ml/gdb/2006-08/msg00137.html */
|
+ * http://sources.redhat.com/ml/gdb/2006-08/msg00137.html */
|
||||||
|
@ -164,7 +164,7 @@ Index: gdb-6.8.50.20090802/gdb/amd64-tdep.c
|
|||||||
/* Floating-point registers. */
|
/* Floating-point registers. */
|
||||||
--- a/gdb/ia64-tdep.c
|
--- a/gdb/ia64-tdep.c
|
||||||
+++ b/gdb/ia64-tdep.c
|
+++ b/gdb/ia64-tdep.c
|
||||||
@@ -2122,6 +2122,137 @@ static const struct frame_unwind ia64_frame_unwind =
|
@@ -2122,6 +2122,138 @@ static const struct frame_unwind ia64_frame_unwind =
|
||||||
default_frame_sniffer
|
default_frame_sniffer
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -228,12 +228,13 @@ Index: gdb-6.8.50.20090802/gdb/amd64-tdep.c
|
|||||||
+ if (minsym == NULL)
|
+ if (minsym == NULL)
|
||||||
+ return 0;
|
+ return 0;
|
||||||
+
|
+
|
||||||
+ instr = slotN_contents (&buf[LINUX_CLONE_PRE_SLOTS * 16], 2);
|
+ instr = slotN_contents (&linux_clone2_code[LINUX_CLONE_PRE_SLOTS * 16], 2);
|
||||||
+ instr &= ~(((1L << 20) - 1) << 13);
|
+ instr &= ~(((1L << 20) - 1) << 13);
|
||||||
+ /* Address is relative to the jump instruction slot, not the next one. */
|
+ /* Address is relative to the jump instruction slot, not the next one. */
|
||||||
+ instr |= (((SYMBOL_VALUE_ADDRESS (minsym) - (pc & ~0xfL)) >> 4)
|
+ instr |= (((SYMBOL_VALUE_ADDRESS (minsym) - (pc & ~0xfL)) >> 4)
|
||||||
+ & ((1L << 20) - 1)) << 13;
|
+ & ((1L << 20) - 1)) << 13;
|
||||||
+ replace_slotN_contents (&buf[LINUX_CLONE_PRE_SLOTS * 16], instr, 2);
|
+ replace_slotN_contents (&linux_clone2_code[LINUX_CLONE_PRE_SLOTS * 16], instr,
|
||||||
|
+ 2);
|
||||||
+
|
+
|
||||||
+ if (memcmp (&buf[LINUX_CLONE_PRE_SLOTS * 16],
|
+ if (memcmp (&buf[LINUX_CLONE_PRE_SLOTS * 16],
|
||||||
+ &linux_clone2_code[LINUX_CLONE_PRE_SLOTS * 16],
|
+ &linux_clone2_code[LINUX_CLONE_PRE_SLOTS * 16],
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379
|
|
||||||
|
|
||||||
|
|
||||||
Index: gdb-6.8.50.20081128/gdb/minsyms.c
|
|
||||||
===================================================================
|
|
||||||
--- gdb-6.8.50.20081128.orig/gdb/minsyms.c 2008-10-01 18:56:52.000000000 +0200
|
|
||||||
+++ gdb-6.8.50.20081128/gdb/minsyms.c 2008-12-02 23:24:27.000000000 +0100
|
|
||||||
@@ -544,6 +544,11 @@ lookup_minimal_symbol_by_pc_section_1 (C
|
|
||||||
don't fill the bfd_section member, so don't
|
|
||||||
throw away symbols on those platforms. */
|
|
||||||
&& SYMBOL_OBJ_SECTION (&msymbol[hi]) != NULL
|
|
||||||
+ /* Don't ignore symbols for solib trampolines.
|
|
||||||
+ Limit its sideeffects - only for non-0 sized trampolines.
|
|
||||||
+ Red Hat Bug 200533 with its regression Bug 218379. */
|
|
||||||
+ && (MSYMBOL_TYPE (&msymbol[hi]) != mst_solib_trampoline
|
|
||||||
+ || MSYMBOL_SIZE (&msymbol[hi]))
|
|
||||||
&& (!matching_obj_sections
|
|
||||||
(SYMBOL_OBJ_SECTION (&msymbol[hi]), section)))
|
|
||||||
{
|
|
@ -58,10 +58,10 @@ Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html
|
|||||||
* exec.c (exec_file_attach): Print a more useful error message if the
|
* exec.c (exec_file_attach): Print a more useful error message if the
|
||||||
user did "gdb core".
|
user did "gdb core".
|
||||||
|
|
||||||
Index: gdb-7.0.50.20100128/gdb/exceptions.h
|
Index: gdb-7.1/gdb/exceptions.h
|
||||||
===================================================================
|
===================================================================
|
||||||
--- gdb-7.0.50.20100128.orig/gdb/exceptions.h 2010-01-18 07:25:22.000000000 +0100
|
--- gdb-7.1.orig/gdb/exceptions.h 2010-01-18 07:25:22.000000000 +0100
|
||||||
+++ gdb-7.0.50.20100128/gdb/exceptions.h 2010-01-28 22:49:00.000000000 +0100
|
+++ gdb-7.1/gdb/exceptions.h 2010-03-25 18:40:49.000000000 +0100
|
||||||
@@ -78,6 +78,9 @@ enum errors {
|
@@ -78,6 +78,9 @@ enum errors {
|
||||||
/* Feature is not supported in this copy of GDB. */
|
/* Feature is not supported in this copy of GDB. */
|
||||||
UNSUPPORTED_ERROR,
|
UNSUPPORTED_ERROR,
|
||||||
@ -72,19 +72,19 @@ Index: gdb-7.0.50.20100128/gdb/exceptions.h
|
|||||||
/* Add more errors here. */
|
/* Add more errors here. */
|
||||||
NR_ERRORS
|
NR_ERRORS
|
||||||
};
|
};
|
||||||
Index: gdb-7.0.50.20100128/gdb/exec.c
|
Index: gdb-7.1/gdb/exec.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- gdb-7.0.50.20100128.orig/gdb/exec.c 2010-01-28 22:48:59.000000000 +0100
|
--- gdb-7.1.orig/gdb/exec.c 2010-03-25 17:46:11.000000000 +0100
|
||||||
+++ gdb-7.0.50.20100128/gdb/exec.c 2010-01-28 22:58:45.000000000 +0100
|
+++ gdb-7.1/gdb/exec.c 2010-03-25 18:41:09.000000000 +0100
|
||||||
@@ -34,6 +34,7 @@
|
@@ -34,6 +34,7 @@
|
||||||
|
#include "arch-utils.h"
|
||||||
#include "gdbthread.h"
|
#include "gdbthread.h"
|
||||||
#include "progspace.h"
|
#include "progspace.h"
|
||||||
#include "solib.h"
|
|
||||||
+#include "exceptions.h"
|
+#include "exceptions.h"
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include "readline/readline.h"
|
#include "readline/readline.h"
|
||||||
@@ -258,6 +259,17 @@ exec_file_attach (char *filename, int fr
|
@@ -259,6 +260,17 @@ exec_file_attach (char *filename, int fr
|
||||||
/* Make sure to close exec_bfd, or else "run" might try to use
|
/* Make sure to close exec_bfd, or else "run" might try to use
|
||||||
it. */
|
it. */
|
||||||
exec_close ();
|
exec_close ();
|
||||||
@ -100,12 +100,12 @@ Index: gdb-7.0.50.20100128/gdb/exec.c
|
|||||||
+ scratch_pathname);
|
+ scratch_pathname);
|
||||||
+
|
+
|
||||||
error (_("\"%s\": not in executable format: %s"),
|
error (_("\"%s\": not in executable format: %s"),
|
||||||
scratch_pathname, bfd_errmsg (bfd_get_error ()));
|
scratch_pathname,
|
||||||
}
|
gdb_bfd_errmsg (bfd_get_error (), matching));
|
||||||
Index: gdb-7.0.50.20100128/gdb/main.c
|
Index: gdb-7.1/gdb/main.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- gdb-7.0.50.20100128.orig/gdb/main.c 2010-01-28 22:48:59.000000000 +0100
|
--- gdb-7.1.orig/gdb/main.c 2010-03-25 17:46:11.000000000 +0100
|
||||||
+++ gdb-7.0.50.20100128/gdb/main.c 2010-01-28 22:49:00.000000000 +0100
|
+++ gdb-7.1/gdb/main.c 2010-03-25 18:40:49.000000000 +0100
|
||||||
@@ -241,6 +241,36 @@ captured_command_loop (void *data)
|
@@ -241,6 +241,36 @@ captured_command_loop (void *data)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
68
gdb-6.7-testsuite-stable-results-prelink.patch
Normal file
68
gdb-6.7-testsuite-stable-results-prelink.patch
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
http://sourceware.org/ml/gdb-patches/2010-03/msg01006.html
|
||||||
|
Subject: [patch or FYI] testsuite: Fix prelink.exp on system w/unprelinked system libs
|
||||||
|
|
||||||
|
Hi,
|
||||||
|
|
||||||
|
this is a more conservative variant superseded by:
|
||||||
|
[patch 4/6] testsuite: Unify to lib/prelink-support.exp
|
||||||
|
http://sourceware.org/ml/gdb-patches/2010-03/msg01002.html
|
||||||
|
where gdb.base/prelink.exp is reworked on generic lib/prelink-support.exp.
|
||||||
|
|
||||||
|
I prefer the [patch 4/6] over this patch but this mail can serve also as an
|
||||||
|
illustration of the current problem.
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
If your system for some reason currently does not have all the libraries
|
||||||
|
prelinked gdb.base/prelink.exp will get UNRESOLVED randomly also affecting
|
||||||
|
testsuite results diff.
|
||||||
|
|
||||||
|
Apparently the testcase already tried to avoid any system libraries
|
||||||
|
dependencies by "-nodefaultlibs". But currently it does has not worked that
|
||||||
|
way.
|
||||||
|
|
||||||
|
"-lm" is contained already even in dejagnu's default_target_compile (not just
|
||||||
|
in gdb/testsuite/lib/ada.exp). But I do not know why it is there and which
|
||||||
|
systems would get broken by some global gdb/testsuite/ "-lm" removal.
|
||||||
|
|
||||||
|
|
||||||
|
Thanks,
|
||||||
|
Jan
|
||||||
|
|
||||||
|
|
||||||
|
2010-03-29 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
Fix testcase false UNRESOLVED if system libraries are not prelinked.
|
||||||
|
* gdb.base/prelink.exp: New variables compile, board, err and mathlib.
|
||||||
|
Set clear board mathlib for ${libfile} compilation.
|
||||||
|
|
||||||
|
--- a/gdb/testsuite/gdb.base/prelink.exp
|
||||||
|
+++ b/gdb/testsuite/gdb.base/prelink.exp
|
||||||
|
@@ -42,7 +42,25 @@ set testfile "prelink"
|
||||||
|
|
||||||
|
set libsrcfile ${testfile}-lib.c
|
||||||
|
set libfile ${objdir}/${subdir}/${testfile}.so
|
||||||
|
-if { [gdb_compile "${srcdir}/${subdir}/${libsrcfile}" "${libfile}" executable [list debug "additional_flags=-fpic -shared -nodefaultlibs"]] != ""} {
|
||||||
|
+
|
||||||
|
+# default_target_compile would otherwise add "-lm" making the testcase
|
||||||
|
+# dependent on whether the system libraries are already prelinked.
|
||||||
|
+# prelink: Could not set /lib64/libm-2.11.1.so owner or mode: Operation not permitted
|
||||||
|
+set compile {
|
||||||
|
+ gdb_compile "${srcdir}/${subdir}/${libsrcfile}" "${libfile}" executable [list debug "additional_flags=-fpic -shared -nodefaultlibs"]
|
||||||
|
+}
|
||||||
|
+set board [target_info name]
|
||||||
|
+if [board_info $board exists mathlib] {
|
||||||
|
+ set mathlib [board_info $dest mathlib]
|
||||||
|
+ set_board_info mathlib ""
|
||||||
|
+ set err [eval $compile]
|
||||||
|
+ set_board_info mathlib $mathlib
|
||||||
|
+} else {
|
||||||
|
+ set_board_info mathlib ""
|
||||||
|
+ set err [eval $compile]
|
||||||
|
+ unset_board_info mathlib
|
||||||
|
+}
|
||||||
|
+if {$err != ""} {
|
||||||
|
# If creating the shared library fails, maybe we don't have the right tools
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
@ -1,571 +0,0 @@
|
|||||||
infcall.c <unwind_on_signal_p>:
|
|
||||||
Revert the change of: gdb-6.8-inlining.patch
|
|
||||||
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.20100121/gdb/testsuite/gdb.opt/inline-bt.c
|
|
||||||
===================================================================
|
|
||||||
--- 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/>. */
|
|
||||||
|
|
||||||
-int x, y;
|
|
||||||
+/* VOLATILE forces all the inlining to happen as otherwise the whole program
|
|
||||||
+ gets optimized by CSE to just simple assignments of the results. */
|
|
||||||
+volatile int x, y;
|
|
||||||
volatile int result;
|
|
||||||
|
|
||||||
-void bar(void);
|
|
||||||
+inline void bar(void)
|
|
||||||
+{
|
|
||||||
+ x += y; /* set breakpoint 1 here */
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
|
|
||||||
inline int func1(void)
|
|
||||||
{
|
|
||||||
Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-cmds.c
|
|
||||||
===================================================================
|
|
||||||
--- 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/>. */
|
|
||||||
|
|
||||||
-int x, y;
|
|
||||||
+/* VOLATILE forces all the inlining to happen as otherwise the whole program
|
|
||||||
+ gets optimized by CSE to just simple assignments of the results. */
|
|
||||||
+volatile int x, y;
|
|
||||||
volatile int result;
|
|
||||||
|
|
||||||
-void bar(void);
|
|
||||||
void marker(void);
|
|
||||||
void noinline(void);
|
|
||||||
|
|
||||||
+inline void bar(void)
|
|
||||||
+{
|
|
||||||
+ x += y; /* set breakpoint 1 here */
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
inline int func1(void)
|
|
||||||
{
|
|
||||||
bar ();
|
|
||||||
Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-cmds.exp
|
|
||||||
===================================================================
|
|
||||||
--- 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"
|
|
||||||
|
|
||||||
-gdb_test "next" ".*func1 .*first call.*" "next to first func1"
|
|
||||||
+gdb_test "next" "func1 .*first call.*" "next to first func1"
|
|
||||||
set msg "next to second func1"
|
|
||||||
gdb_test_multiple "next" $msg {
|
|
||||||
-re ".*func1 .*second call.*$gdb_prompt $" {
|
|
||||||
@@ -253,16 +253,16 @@ set line4 [gdb_get_line_number "set brea
|
|
||||||
gdb_breakpoint $line4
|
|
||||||
gdb_continue_to_breakpoint "func1 then func3"
|
|
||||||
|
|
||||||
-gdb_test "next" ".*func1 \\\(\\\);" "next to func1 before func3"
|
|
||||||
-gdb_test "next" ".*func3 \\\(\\\);" "next to func3"
|
|
||||||
+gdb_test "next" "func1 \\\(\\\);" "next to func1 before func3"
|
|
||||||
+gdb_test "next" "func3 \\\(\\\);" "next to func3"
|
|
||||||
|
|
||||||
# Test finishing out of one thing and into another.
|
|
||||||
set line5 [gdb_get_line_number "set breakpoint 5 here"]
|
|
||||||
gdb_breakpoint $line5
|
|
||||||
gdb_continue_to_breakpoint "finish into func1"
|
|
||||||
|
|
||||||
-gdb_test "next" ".*marker \\\(\\\);" "next to finish marker"
|
|
||||||
-gdb_test "step" ".*set breakpoint 2 here.*" "step into finish marker"
|
|
||||||
+gdb_test "next" "marker \\\(\\\);" "next to finish marker"
|
|
||||||
+gdb_test "step" "set breakpoint 2 here.*" "step into finish marker"
|
|
||||||
gdb_test "finish" "func1 \\\(\\\);" "finish from marker to func1"
|
|
||||||
|
|
||||||
gdb_test "step" "bar \\\(\\\);" "step into func1 for finish"
|
|
||||||
@@ -297,12 +297,12 @@ gdb_test "step" "noinline \\\(\\\) at .*
|
|
||||||
gdb_test "bt" "#0 noinline.*#1 .*outer_inline1.*#2 .*outer_inline2.*#3 main.*" "backtrace at noinline from outer_inline1"
|
|
||||||
gdb_test "step" "inlined_fn \\\(\\\) at .*" "enter inlined_fn from noinline"
|
|
||||||
gdb_test "bt" "#0 inlined_fn.*#1 noinline.*#2 .*outer_inline1.*#3 .*outer_inline2.*#4 main.*" "backtrace at inlined_fn from noinline"
|
|
||||||
-gdb_test "info frame" ".*inlined into frame.*" "inlined_fn from noinline inlined"
|
|
||||||
-gdb_test "up" "#1 noinline.*" "up to noinline"
|
|
||||||
-gdb_test "info frame" ".*\n called by frame.*" "noinline from outer_inline1 not inlined"
|
|
||||||
-gdb_test "up" "#2 .*outer_inline1.*" "up to outer_inline1"
|
|
||||||
-gdb_test "info frame" ".*inlined into frame.*" "outer_inline1 inlined"
|
|
||||||
-gdb_test "up" "#3 .*outer_inline2.*" "up to outer_inline2"
|
|
||||||
-gdb_test "info frame" ".*inlined into frame.*" "outer_inline2 inlined"
|
|
||||||
-gdb_test "up" "#4 main.*" "up from outer_inline2"
|
|
||||||
-gdb_test "info frame" ".*\n caller of frame.*" "main not inlined"
|
|
||||||
+gdb_test "info frame" "inlined into frame.*" "inlined_fn from noinline inlined"
|
|
||||||
+gdb_test "fini" "" "up to noinline"
|
|
||||||
+gdb_test "info frame" "\n called by frame.*" "noinline from outer_inline1 not inlined"
|
|
||||||
+gdb_test "fini" "" "up to outer_inline1"
|
|
||||||
+gdb_test "info frame" "inlined into frame.*" "outer_inline1 inlined"
|
|
||||||
+gdb_test "fini" "" "up to outer_inline2"
|
|
||||||
+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.20100121/gdb/testsuite/gdb.opt/inline-locals.c
|
|
||||||
===================================================================
|
|
||||||
--- 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/>. */
|
|
||||||
|
|
||||||
-int x, y;
|
|
||||||
+/* VOLATILE forces all the inlining to happen as otherwise the whole program
|
|
||||||
+ gets optimized by CSE to just simple assignments of the results. */
|
|
||||||
+volatile int x, y;
|
|
||||||
volatile int result;
|
|
||||||
volatile int *array_p;
|
|
||||||
|
|
||||||
-void bar(void);
|
|
||||||
+inline void bar(void)
|
|
||||||
+{
|
|
||||||
+ x += y; /* set breakpoint 1 here */
|
|
||||||
+}
|
|
||||||
|
|
||||||
inline int func1(int arg1)
|
|
||||||
{
|
|
||||||
Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-locals.exp
|
|
||||||
===================================================================
|
|
||||||
--- 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
|
|
||||||
# prevent it from living in a register.
|
|
||||||
+if [test_compiler_info "gcc-4-3-*"] {
|
|
||||||
+ setup_kfail *-*-* "gcc/debug.optimization"
|
|
||||||
+}
|
|
||||||
gdb_test "print array\[0\]" "\\\$$decimal = 0" "print local (2)"
|
|
||||||
|
|
||||||
if { ! $no_frames } {
|
|
||||||
@@ -115,4 +118,7 @@ if { ! $no_frames } {
|
|
||||||
gdb_test "info locals" ".*arg2 = 184.*" "info locals above bar (3b)"
|
|
||||||
}
|
|
||||||
|
|
||||||
+if [test_compiler_info "gcc-4-3-*"] {
|
|
||||||
+ setup_kfail *-*-* "gcc/debug.optimization"
|
|
||||||
+}
|
|
||||||
gdb_test "print array\[0\]" "\\\$$decimal = 184" "print local (3)"
|
|
||||||
Index: gdb-7.0.50.20100121/gdb/frame.c
|
|
||||||
===================================================================
|
|
||||||
--- 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)
|
|
||||||
{
|
|
||||||
- while (get_frame_type (frame) == INLINE_FRAME)
|
|
||||||
+ while (frame && get_frame_type (frame) == INLINE_FRAME)
|
|
||||||
frame = get_prev_frame (frame);
|
|
||||||
|
|
||||||
return frame;
|
|
||||||
@@ -1792,6 +1792,7 @@ get_frame_address_in_block (struct frame
|
|
||||||
{
|
|
||||||
/* A draft address. */
|
|
||||||
CORE_ADDR pc = get_frame_pc (this_frame);
|
|
||||||
+ struct thread_info *tp = inferior_thread ();
|
|
||||||
|
|
||||||
struct frame_info *next_frame = this_frame->next;
|
|
||||||
|
|
||||||
@@ -1834,6 +1835,9 @@ get_frame_address_in_block (struct frame
|
|
||||||
while in an inlined function, then the code address of the
|
|
||||||
"calling" normal function should not be adjusted either. */
|
|
||||||
|
|
||||||
+ if (tp->current_pc_is_notcurrent)
|
|
||||||
+ return pc - 1;
|
|
||||||
+
|
|
||||||
while (get_frame_type (next_frame) == INLINE_FRAME)
|
|
||||||
next_frame = next_frame->next;
|
|
||||||
|
|
||||||
@@ -1865,7 +1869,7 @@ find_frame_sal (struct frame_info *frame
|
|
||||||
sym = inline_skipped_symbol (inferior_ptid);
|
|
||||||
|
|
||||||
init_sal (sal);
|
|
||||||
- if (SYMBOL_LINE (sym) != 0)
|
|
||||||
+ if (sym != NULL && SYMBOL_LINE (sym) != 0)
|
|
||||||
{
|
|
||||||
sal->symtab = SYMBOL_SYMTAB (sym);
|
|
||||||
sal->line = SYMBOL_LINE (sym);
|
|
||||||
Index: gdb-7.0.50.20100121/gdb/breakpoint.c
|
|
||||||
===================================================================
|
|
||||||
--- 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"
|
|
||||||
#include "parser-defs.h"
|
|
||||||
+#include "inline-frame.h"
|
|
||||||
|
|
||||||
/* readline include files */
|
|
||||||
#include "readline/readline.h"
|
|
||||||
@@ -3558,10 +3559,24 @@ bpstat_check_breakpoint_conditions (bpst
|
|
||||||
const struct bp_location *bl = bs->breakpoint_at;
|
|
||||||
struct breakpoint *b = bl->owner;
|
|
||||||
|
|
||||||
- if (frame_id_p (b->frame_id)
|
|
||||||
- && !frame_id_eq (b->frame_id, get_stack_frame_id (get_current_frame ())))
|
|
||||||
- bs->stop = 0;
|
|
||||||
- else if (bs->stop)
|
|
||||||
+ if (frame_id_p (b->frame_id))
|
|
||||||
+ {
|
|
||||||
+ struct frame_info *b_frame, *frame;
|
|
||||||
+ struct frame_id b_frame_id, current_frame_id;
|
|
||||||
+
|
|
||||||
+ b_frame = frame_find_by_id (b->frame_id);
|
|
||||||
+
|
|
||||||
+ /* get_stack_frame_id normalizes the id to the real non-inlined function
|
|
||||||
+ by skip_inlined_frames. */
|
|
||||||
+ b_frame_id = get_stack_frame_id (b_frame);
|
|
||||||
+ current_frame_id = get_stack_frame_id (get_current_frame ());
|
|
||||||
+
|
|
||||||
+ /* Completely different (inlining notwithstanding) frames? */
|
|
||||||
+ if (!frame_id_eq (b_frame_id, current_frame_id))
|
|
||||||
+ bs->stop = 0;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (bs->stop)
|
|
||||||
{
|
|
||||||
int value_is_zero = 0;
|
|
||||||
|
|
||||||
@@ -3729,6 +3744,12 @@ bpstat_stop_status (struct address_space
|
|
||||||
bs->print = 0;
|
|
||||||
}
|
|
||||||
bs->commands = copy_command_lines (bs->commands);
|
|
||||||
+
|
|
||||||
+ /* Display the innermost inlined frame at a breakpont as it gives to
|
|
||||||
+ most of the available information. */
|
|
||||||
+ if (b->type != bp_until && b->type != bp_finish)
|
|
||||||
+ while (inline_skipped_frames (ptid))
|
|
||||||
+ step_into_inline_frame (ptid);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Print nothing for this entry if we dont stop or dont print. */
|
|
||||||
@@ -6043,9 +6064,9 @@ set_momentary_breakpoint (struct gdbarch
|
|
||||||
{
|
|
||||||
struct breakpoint *b;
|
|
||||||
|
|
||||||
- /* If FRAME_ID is valid, it should be a real frame, not an inlined
|
|
||||||
- one. */
|
|
||||||
- gdb_assert (!frame_id_inlined_p (frame_id));
|
|
||||||
+ /* We can be returning even into an inline frame. While finish_command will
|
|
||||||
+ shortcut the case of returning _from_ an inline frame we still may be
|
|
||||||
+ returning from non-inlined frame _to_ an inlined frame. */
|
|
||||||
|
|
||||||
b = set_raw_breakpoint (gdbarch, sal, type);
|
|
||||||
b->enable_state = bp_enabled;
|
|
||||||
Index: gdb-7.0.50.20100121/gdb/inline-frame.c
|
|
||||||
===================================================================
|
|
||||||
--- 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;
|
|
||||||
|
|
||||||
+ /* For >=2 inlined functions SKIPPED_SYMBOL needs to be different after each
|
|
||||||
+ step_into_inline_frame call. But skip_inline_frames is called only once
|
|
||||||
+ and thus SKIPPED_SYMBOL needs to be calculated by INLINE_FRAME_SNIFFER. */
|
|
||||||
+ if (state)
|
|
||||||
+ state->skipped_symbol = NULL;
|
|
||||||
+
|
|
||||||
/* Calculate DEPTH, the number of inlined functions at this
|
|
||||||
location. */
|
|
||||||
depth = 0;
|
|
||||||
@@ -222,6 +228,10 @@ inline_frame_sniffer (const struct frame
|
|
||||||
if (block_inlined_p (cur_block))
|
|
||||||
depth++;
|
|
||||||
|
|
||||||
+ if (state && depth == state->skipped_frames
|
|
||||||
+ && state->skipped_symbol == NULL)
|
|
||||||
+ state->skipped_symbol = BLOCK_FUNCTION (cur_block);
|
|
||||||
+
|
|
||||||
cur_block = BLOCK_SUPERBLOCK (cur_block);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -300,7 +310,6 @@ skip_inline_frames (ptid_t ptid)
|
|
||||||
{
|
|
||||||
CORE_ADDR this_pc;
|
|
||||||
struct block *frame_block, *cur_block;
|
|
||||||
- struct symbol *last_sym = NULL;
|
|
||||||
int skip_count = 0;
|
|
||||||
struct inline_state *state;
|
|
||||||
|
|
||||||
@@ -321,10 +330,7 @@ skip_inline_frames (ptid_t ptid)
|
|
||||||
of BLOCK_START. */
|
|
||||||
if (BLOCK_START (cur_block) == this_pc
|
|
||||||
|| block_starting_point_at (this_pc, cur_block))
|
|
||||||
- {
|
|
||||||
- skip_count++;
|
|
||||||
- last_sym = BLOCK_FUNCTION (cur_block);
|
|
||||||
- }
|
|
||||||
+ skip_count++;
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
@@ -336,7 +342,6 @@ skip_inline_frames (ptid_t ptid)
|
|
||||||
state = allocate_inline_frame_state (ptid);
|
|
||||||
state->skipped_frames = skip_count;
|
|
||||||
state->saved_pc = this_pc;
|
|
||||||
- state->skipped_symbol = last_sym;
|
|
||||||
|
|
||||||
if (skip_count != 0)
|
|
||||||
reinit_frame_cache ();
|
|
||||||
@@ -354,6 +359,23 @@ step_into_inline_frame (ptid_t ptid)
|
|
||||||
reinit_frame_cache ();
|
|
||||||
}
|
|
||||||
|
|
||||||
+/* Step out of an inlined function by hiding it. */
|
|
||||||
+
|
|
||||||
+void
|
|
||||||
+step_out_of_inline_frame (ptid_t ptid)
|
|
||||||
+{
|
|
||||||
+ struct inline_state *state = find_inline_frame_state (ptid);
|
|
||||||
+
|
|
||||||
+ gdb_assert (state != NULL);
|
|
||||||
+
|
|
||||||
+ /* Simulate the caller adjustment. */
|
|
||||||
+ if (state->skipped_frames == 0)
|
|
||||||
+ state->saved_pc--;
|
|
||||||
+
|
|
||||||
+ state->skipped_frames++;
|
|
||||||
+ reinit_frame_cache ();
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
/* Return the number of hidden functions inlined into the current
|
|
||||||
frame. */
|
|
||||||
|
|
||||||
Index: gdb-7.0.50.20100121/gdb/testsuite/gdb.opt/inline-markers.c
|
|
||||||
===================================================================
|
|
||||||
--- 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;
|
|
||||||
|
|
||||||
-void bar(void)
|
|
||||||
-{
|
|
||||||
- x += y; /* set breakpoint 1 here */
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
void marker(void)
|
|
||||||
{
|
|
||||||
x += y; /* set breakpoint 2 here */
|
|
||||||
Index: gdb-7.0.50.20100121/gdb/gdbthread.h
|
|
||||||
===================================================================
|
|
||||||
--- 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. */
|
|
||||||
void (*private_dtor) (struct private_thread_info *);
|
|
||||||
+
|
|
||||||
+ /* Nonzero if the current frame PC should be unwound as the caller. It is
|
|
||||||
+ used to keep the backtrace upper levels existing after finish_command into
|
|
||||||
+ an inlined frame if the current inlined function/block was ending at the
|
|
||||||
+ current PC. */
|
|
||||||
+ int current_pc_is_notcurrent;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* Create an empty thread list, or empty the existing one. */
|
|
||||||
Index: gdb-7.0.50.20100121/gdb/infcmd.c
|
|
||||||
===================================================================
|
|
||||||
--- 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));
|
|
||||||
- if (!value_type)
|
|
||||||
+ if (!SYMBOL_INLINED (a->function) && !value_type)
|
|
||||||
internal_error (__FILE__, __LINE__,
|
|
||||||
_("finish_command: function has no target type"));
|
|
||||||
|
|
||||||
- if (TYPE_CODE (value_type) != TYPE_CODE_VOID)
|
|
||||||
+ if (value_type && TYPE_CODE (value_type) != TYPE_CODE_VOID)
|
|
||||||
print_return_value (SYMBOL_TYPE (a->function), value_type);
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1551,6 +1551,16 @@ finish_forward (struct symbol *function,
|
|
||||||
tp->initiating_frame = get_frame_id (frame);
|
|
||||||
make_cleanup (delete_longjmp_breakpoint_cleanup, &thread);
|
|
||||||
|
|
||||||
+ /* We should _always_ set CURRENT_PC_IS_NOTCURRENT here to always see the
|
|
||||||
+ calling line with the message `Value returned is ...'. Currently it is
|
|
||||||
+ seen only if at least one instruction is on that source line after the
|
|
||||||
+ call instruction. We would also need to hook step_once and only clear
|
|
||||||
+ CURRENT_PC_IS_NOTCURRENT on the first step. But it would be a change of
|
|
||||||
+ general non-inlining behavior against upstream. */
|
|
||||||
+
|
|
||||||
+ if (get_frame_type (frame) == INLINE_FRAME)
|
|
||||||
+ tp->current_pc_is_notcurrent = 1;
|
|
||||||
+
|
|
||||||
tp->proceed_to_finish = 1; /* We want stop_registers, please... */
|
|
||||||
cargs = xmalloc (sizeof (*cargs));
|
|
||||||
|
|
||||||
@@ -1571,7 +1581,9 @@ finish_forward (struct symbol *function,
|
|
||||||
static void
|
|
||||||
finish_command (char *arg, int from_tty)
|
|
||||||
{
|
|
||||||
- struct frame_info *frame;
|
|
||||||
+ /* FIXME: Rename `current_frame' to `frame' upon a merge. */
|
|
||||||
+ struct frame_info *current_frame, *prev_frame;
|
|
||||||
+ CORE_ADDR frame_pc;
|
|
||||||
struct symbol *function;
|
|
||||||
|
|
||||||
int async_exec = 0;
|
|
||||||
@@ -1602,45 +1614,63 @@ finish_command (char *arg, int from_tty)
|
|
||||||
if (!target_has_execution)
|
|
||||||
error (_("The program is not running."));
|
|
||||||
|
|
||||||
- frame = get_prev_frame (get_selected_frame (_("No selected frame.")));
|
|
||||||
- if (frame == 0)
|
|
||||||
+ current_frame = get_selected_frame (_("No selected frame."));
|
|
||||||
+ frame_pc = get_frame_pc (current_frame);
|
|
||||||
+ prev_frame = get_prev_frame (current_frame);
|
|
||||||
+ if (prev_frame == 0)
|
|
||||||
error (_("\"finish\" not meaningful in the outermost frame."));
|
|
||||||
|
|
||||||
- clear_proceed_status ();
|
|
||||||
-
|
|
||||||
/* Finishing from an inline frame is completely different. We don't
|
|
||||||
try to show the "return value" - no way to locate it. So we do
|
|
||||||
not need a completion. */
|
|
||||||
- if (get_frame_type (get_selected_frame (_("No selected frame.")))
|
|
||||||
- == INLINE_FRAME)
|
|
||||||
+ if (get_frame_type (current_frame) == INLINE_FRAME)
|
|
||||||
{
|
|
||||||
- /* Claim we are stepping in the calling frame. An empty step
|
|
||||||
- range means that we will stop once we aren't in a function
|
|
||||||
- called by that frame. We don't use the magic "1" value for
|
|
||||||
- step_range_end, because then infrun will think this is nexti,
|
|
||||||
- and not step over the rest of this inlined function call. */
|
|
||||||
struct thread_info *tp = inferior_thread ();
|
|
||||||
struct symtab_and_line empty_sal;
|
|
||||||
- init_sal (&empty_sal);
|
|
||||||
- set_step_info (frame, empty_sal);
|
|
||||||
- tp->step_range_start = tp->step_range_end = get_frame_pc (frame);
|
|
||||||
- tp->step_over_calls = STEP_OVER_ALL;
|
|
||||||
+ struct block *frame_block;
|
|
||||||
|
|
||||||
/* Print info on the selected frame, including level number but not
|
|
||||||
source. */
|
|
||||||
if (from_tty)
|
|
||||||
{
|
|
||||||
printf_filtered (_("Run till exit from "));
|
|
||||||
- print_stack_frame (get_selected_frame (NULL), 1, LOCATION);
|
|
||||||
+ print_stack_frame (current_frame, 1, LOCATION);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ /* Even just a single stepi would get us out of the caller function PC
|
|
||||||
+ range. */
|
|
||||||
+
|
|
||||||
+ frame_block = get_frame_block (current_frame, NULL);
|
|
||||||
+
|
|
||||||
+ /* FRAME_BLOCK must be initialized and also the frame printing above must
|
|
||||||
+ be done still with the original CURRENT_PC_IS_NOTCURRENT setting. */
|
|
||||||
+ clear_proceed_status ();
|
|
||||||
+
|
|
||||||
+ if (frame_block && BLOCK_END (frame_block) == frame_pc)
|
|
||||||
+ {
|
|
||||||
+ step_out_of_inline_frame (tp->ptid);
|
|
||||||
+ tp->current_pc_is_notcurrent = 1;
|
|
||||||
+ normal_stop ();
|
|
||||||
+ return;
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* Claim we are stepping in the calling frame. An empty step
|
|
||||||
+ range means that we will stop once we aren't in a function
|
|
||||||
+ called by that frame. We don't use the magic "1" value for
|
|
||||||
+ step_range_end, because then infrun will think this is nexti,
|
|
||||||
+ and not step over the rest of this inlined function call. */
|
|
||||||
+ init_sal (&empty_sal);
|
|
||||||
+ set_step_info (prev_frame, empty_sal);
|
|
||||||
+ tp->step_range_start = tp->step_range_end = get_frame_pc (prev_frame);
|
|
||||||
+ tp->step_over_calls = STEP_OVER_ALL;
|
|
||||||
+
|
|
||||||
proceed ((CORE_ADDR) -1, TARGET_SIGNAL_DEFAULT, 1);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Find the function we will return from. */
|
|
||||||
|
|
||||||
- function = find_pc_function (get_frame_pc (get_selected_frame (NULL)));
|
|
||||||
+ function = find_pc_function (frame_pc);
|
|
||||||
|
|
||||||
/* Print info on the selected frame, including level number but not
|
|
||||||
source. */
|
|
||||||
@@ -1654,10 +1684,14 @@ finish_command (char *arg, int from_tty)
|
|
||||||
print_stack_frame (get_selected_frame (NULL), 1, LOCATION);
|
|
||||||
}
|
|
||||||
|
|
||||||
+ /* Frames printing above must be done still with the original
|
|
||||||
+ CURRENT_PC_IS_NOTCURRENT setting. */
|
|
||||||
+ clear_proceed_status ();
|
|
||||||
+
|
|
||||||
if (execution_direction == EXEC_REVERSE)
|
|
||||||
finish_backward (function);
|
|
||||||
else
|
|
||||||
- finish_forward (function, frame);
|
|
||||||
+ finish_forward (function, prev_frame);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Index: gdb-7.0.50.20100121/gdb/target.c
|
|
||||||
===================================================================
|
|
||||||
--- 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;
|
|
||||||
|
|
||||||
+ clear_inline_frame_state (ptid);
|
|
||||||
target_dcache_invalidate ();
|
|
||||||
|
|
||||||
for (t = current_target.beneath; t != NULL; t = t->beneath)
|
|
||||||
Index: gdb-7.0.50.20100121/gdb/inline-frame.h
|
|
||||||
===================================================================
|
|
||||||
--- 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);
|
|
||||||
|
|
||||||
+/* Step out of an inlined function by hiding it. */
|
|
||||||
+
|
|
||||||
+void step_out_of_inline_frame (ptid_t ptid);
|
|
||||||
+
|
|
||||||
/* Return the number of hidden functions inlined into the current
|
|
||||||
frame. */
|
|
||||||
|
|
||||||
Index: gdb-7.0.50.20100121/gdb/dwarf2read.c
|
|
||||||
===================================================================
|
|
||||||
--- 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)
|
|
||||||
{
|
|
||||||
@@ -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);
|
|
||||||
- new->name = new_symbol (die, read_type_die (die, cu), cu);
|
|
||||||
+ type = read_type_die (die, cu);
|
|
||||||
+ gdb_assert (type != NULL);
|
|
||||||
+ new->name = new_symbol (die, type, cu);
|
|
||||||
+ gdb_assert (TYPE_CODE (SYMBOL_TYPE (new->name)) == TYPE_CODE_FUNC);
|
|
||||||
|
|
||||||
/* If there is a location expression for DW_AT_frame_base, record
|
|
||||||
it. */
|
|
@ -1,104 +0,0 @@
|
|||||||
Implement `b <funcname>' for <funcname> with concete inlined instances by
|
|
||||||
a multiple-PC breakpoint.
|
|
||||||
|
|
||||||
Index: gdb-6.8.50.20081128/gdb/ada-lang.c
|
|
||||||
===================================================================
|
|
||||||
--- gdb-6.8.50.20081128.orig/gdb/ada-lang.c 2008-11-25 00:21:15.000000000 +0100
|
|
||||||
+++ gdb-6.8.50.20081128/gdb/ada-lang.c 2008-12-06 21:39:56.000000000 +0100
|
|
||||||
@@ -4614,7 +4614,7 @@ remove_irrelevant_renamings (struct ada_
|
|
||||||
if (current_block == NULL)
|
|
||||||
return nsyms;
|
|
||||||
|
|
||||||
- current_function = block_linkage_function (current_block);
|
|
||||||
+ current_function = block_function (current_block);
|
|
||||||
if (current_function == NULL)
|
|
||||||
return nsyms;
|
|
||||||
|
|
||||||
@@ -6625,7 +6625,7 @@ ada_find_renaming_symbol (const char *na
|
|
||||||
static struct symbol *
|
|
||||||
find_old_style_renaming_symbol (const char *name, struct block *block)
|
|
||||||
{
|
|
||||||
- const struct symbol *function_sym = block_linkage_function (block);
|
|
||||||
+ const struct symbol *function_sym = block_function (block);
|
|
||||||
char *rename;
|
|
||||||
|
|
||||||
if (function_sym != NULL)
|
|
||||||
Index: gdb-6.8.50.20081128/gdb/block.c
|
|
||||||
===================================================================
|
|
||||||
--- gdb-6.8.50.20081128.orig/gdb/block.c 2008-12-06 14:06:16.000000000 +0100
|
|
||||||
+++ gdb-6.8.50.20081128/gdb/block.c 2008-12-06 21:40:29.000000000 +0100
|
|
||||||
@@ -75,6 +75,19 @@ block_linkage_function (const struct blo
|
|
||||||
return BLOCK_FUNCTION (bl);
|
|
||||||
}
|
|
||||||
|
|
||||||
+/* Return the symbol for the function which contains a specified
|
|
||||||
+ lexical block, described by a struct block BL. Inlined functions
|
|
||||||
+ can be returned. */
|
|
||||||
+
|
|
||||||
+struct symbol *
|
|
||||||
+block_function (const struct block *bl)
|
|
||||||
+{
|
|
||||||
+ while (BLOCK_FUNCTION (bl) == NULL && BLOCK_SUPERBLOCK (bl) != NULL)
|
|
||||||
+ bl = BLOCK_SUPERBLOCK (bl);
|
|
||||||
+
|
|
||||||
+ return BLOCK_FUNCTION (bl);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
/* Return one if BL represents an inlined function. */
|
|
||||||
|
|
||||||
int
|
|
||||||
Index: gdb-6.8.50.20081128/gdb/block.h
|
|
||||||
===================================================================
|
|
||||||
--- gdb-6.8.50.20081128.orig/gdb/block.h 2008-12-06 14:06:16.000000000 +0100
|
|
||||||
+++ gdb-6.8.50.20081128/gdb/block.h 2008-12-06 21:39:56.000000000 +0100
|
|
||||||
@@ -133,6 +133,7 @@ struct blockvector
|
|
||||||
enum { GLOBAL_BLOCK = 0, STATIC_BLOCK = 1, FIRST_LOCAL_BLOCK = 2 };
|
|
||||||
|
|
||||||
extern struct symbol *block_linkage_function (const struct block *);
|
|
||||||
+extern struct symbol *block_function (const struct block *bl);
|
|
||||||
|
|
||||||
extern int block_inlined_p (const struct block *block);
|
|
||||||
|
|
||||||
Index: gdb-6.8.50.20081128/gdb/blockframe.c
|
|
||||||
===================================================================
|
|
||||||
--- gdb-6.8.50.20081128.orig/gdb/blockframe.c 2008-12-06 14:06:16.000000000 +0100
|
|
||||||
+++ gdb-6.8.50.20081128/gdb/blockframe.c 2008-12-06 21:39:56.000000000 +0100
|
|
||||||
@@ -143,7 +143,7 @@ find_pc_sect_function (CORE_ADDR pc, str
|
|
||||||
struct block *b = block_for_pc_sect (pc, section);
|
|
||||||
if (b == 0)
|
|
||||||
return 0;
|
|
||||||
- return block_linkage_function (b);
|
|
||||||
+ return block_function (b);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Return the function containing pc value PC.
|
|
||||||
Index: gdb-6.8.50.20081128/gdb/breakpoint.c
|
|
||||||
===================================================================
|
|
||||||
--- gdb-6.8.50.20081128.orig/gdb/breakpoint.c 2008-12-06 14:06:17.000000000 +0100
|
|
||||||
+++ gdb-6.8.50.20081128/gdb/breakpoint.c 2008-12-06 21:39:56.000000000 +0100
|
|
||||||
@@ -5712,7 +5712,7 @@ resolve_sal_pc (struct symtab_and_line *
|
|
||||||
bv = blockvector_for_pc_sect (sal->pc, 0, &b, sal->symtab);
|
|
||||||
if (bv != NULL)
|
|
||||||
{
|
|
||||||
- sym = block_linkage_function (b);
|
|
||||||
+ sym = block_function (b);
|
|
||||||
if (sym != NULL)
|
|
||||||
{
|
|
||||||
fixup_symbol_section (sym, sal->symtab->objfile);
|
|
||||||
Index: gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-cmds.exp
|
|
||||||
===================================================================
|
|
||||||
--- gdb-6.8.50.20081128.orig/gdb/testsuite/gdb.opt/inline-cmds.exp 2008-12-06 21:37:27.000000000 +0100
|
|
||||||
+++ gdb-6.8.50.20081128/gdb/testsuite/gdb.opt/inline-cmds.exp 2008-12-06 21:41:37.000000000 +0100
|
|
||||||
@@ -45,8 +45,10 @@ if { [skip_inline_frame_tests] } {
|
|
||||||
|
|
||||||
# First, check that the things we expected to be inlined really were,
|
|
||||||
# and those that shouldn't be weren't.
|
|
||||||
-set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile2}]
|
|
||||||
-gdb_breakpoint $srcfile2:$line1
|
|
||||||
+# We test also inlining by the function name, otherwise we would use:
|
|
||||||
+# set line1 [gdb_get_line_number "set breakpoint 1 here" ${srcfile2}]
|
|
||||||
+# gdb_breakpoint $srcfile2:$line1
|
|
||||||
+gdb_breakpoint "bar"
|
|
||||||
set line2 [gdb_get_line_number "set breakpoint 2 here" ${srcfile2}]
|
|
||||||
gdb_breakpoint $srcfile2:$line2
|
|
||||||
|
|
23
gdb-archer-ada.patch
Normal file
23
gdb-archer-ada.patch
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
From: Keith Seitz <keiths@redhat.com>
|
||||||
|
Message-ID: <4B7F207A.7020102@redhat.com>
|
||||||
|
|
||||||
|
[ read_partial_die part dropped in the port to Rawhide ]
|
||||||
|
|
||||||
|
--- gdb-7.0.1-orig/gdb/dwarf2read.c 2010-02-20 01:06:44.000000000 +0100
|
||||||
|
+++ gdb-7.0.1/gdb/dwarf2read.c 2010-02-20 01:08:28.000000000 +0100
|
||||||
|
@@ -9924,9 +9928,13 @@ dwarf2_canonicalize_name (char *name, st
|
||||||
|
static char *
|
||||||
|
dwarf2_name (struct die_info *die, struct dwarf2_cu *cu)
|
||||||
|
{
|
||||||
|
- struct attribute *attr;
|
||||||
|
+ struct attribute *attr = NULL;
|
||||||
|
+
|
||||||
|
+ if (cu->language == language_ada)
|
||||||
|
+ attr = dwarf2_attr (die, DW_AT_MIPS_linkage_name, cu);
|
||||||
|
|
||||||
|
- attr = dwarf2_attr (die, DW_AT_name, cu);
|
||||||
|
+ if (!attr)
|
||||||
|
+ attr = dwarf2_attr (die, DW_AT_name, cu);
|
||||||
|
if (!attr || !DW_STRING (attr))
|
||||||
|
return NULL;
|
||||||
|
|
@ -1,77 +0,0 @@
|
|||||||
[ Forward-ported context. ]
|
|
||||||
|
|
||||||
http://sourceware.org/ml/gdb-patches/2009-11/msg00170.html
|
|
||||||
Subject: [patch 03/15] PIE: breakpoint_address_match gdbarch_addr_bit workaround
|
|
||||||
|
|
||||||
Hi,
|
|
||||||
|
|
||||||
there are already multiple cases of CORE_ADDR being masked by the width of
|
|
||||||
gdbarch_addr_bit. This specific new case was required the PIE support.
|
|
||||||
|
|
||||||
Please read the C comment in attached patch.
|
|
||||||
|
|
||||||
Checked that CORE_ADDR math operations are present on 6000+ lines of code of
|
|
||||||
GDB sources which makes it impossible to do some general fix by replacing all
|
|
||||||
a->addr < b->addr
|
|
||||||
by
|
|
||||||
addr_less_than (a->addr, b->addr)
|
|
||||||
etc.
|
|
||||||
|
|
||||||
Even with this patch I think there are still many bugs left in the operation
|
|
||||||
of x86_64 gdb debugging i386 targets. Do you find the C++ way as a viable
|
|
||||||
one?
|
|
||||||
|
|
||||||
|
|
||||||
Thanks,
|
|
||||||
Jan
|
|
||||||
|
|
||||||
|
|
||||||
gdb/
|
|
||||||
* breakpoint.c (breakpoint_address_match): New variables addr_bit and
|
|
||||||
addr_mask, initialize it. Mask addresses by ADDR_MASK.
|
|
||||||
* defs.h (CORE_ADDR): Extend the comment.
|
|
||||||
|
|
||||||
--- a/gdb/breakpoint.c
|
|
||||||
+++ b/gdb/breakpoint.c
|
|
||||||
@@ -4559,9 +4559,15 @@ static int
|
|
||||||
breakpoint_address_match (struct address_space *aspace1, CORE_ADDR addr1,
|
|
||||||
struct address_space *aspace2, CORE_ADDR addr2)
|
|
||||||
{
|
|
||||||
+ int addr_bit = gdbarch_addr_bit (target_gdbarch);
|
|
||||||
+ CORE_ADDR addr_mask = CORE_ADDR_MAX;
|
|
||||||
+
|
|
||||||
+ if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
|
|
||||||
+ addr_mask = ((CORE_ADDR) 1 << addr_bit) - 1;
|
|
||||||
+
|
|
||||||
return ((gdbarch_has_global_breakpoints (target_gdbarch)
|
|
||||||
|| aspace1 == aspace2)
|
|
||||||
- && addr1 == addr2);
|
|
||||||
+ && (addr1 & addr_mask) == (addr2 & addr_mask));
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Assuming LOC1 and LOC2's types' have meaningful target addresses
|
|
||||||
--- a/gdb/defs.h
|
|
||||||
+++ b/gdb/defs.h
|
|
||||||
@@ -98,7 +98,20 @@
|
|
||||||
/* A byte from the program being debugged. */
|
|
||||||
typedef bfd_byte gdb_byte;
|
|
||||||
|
|
||||||
-/* An address in the program being debugged. Host byte order. */
|
|
||||||
+/* An address in the program being debugged. Host byte order.
|
|
||||||
+
|
|
||||||
+ Its width is the maximum width of all the supported targets. That means
|
|
||||||
+ 32-bit target will run on such GDB using 64-bit CORE_ADDR cluttering the
|
|
||||||
+ bits 32...63 with random data from internal GDB calculations. GDB currently
|
|
||||||
+ in general truncates the address width only when it is being presented/used
|
|
||||||
+ externally (such as by the paddress function).
|
|
||||||
+
|
|
||||||
+ FIXME: This is still not right as any GDB internal comparisons (such as >=)
|
|
||||||
+ of CORE_ADDR do not use the properly truncated width. As converting all the
|
|
||||||
+ CORE_ADDR operations to width-aware functions is not feasible the way out
|
|
||||||
+ could be a width-aware C++ class CORE_ADDR referencing gdbarch as its
|
|
||||||
+ constructor parameter. */
|
|
||||||
+
|
|
||||||
typedef bfd_vma CORE_ADDR;
|
|
||||||
|
|
||||||
/* The largest CORE_ADDR value. */
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
Index: gdb-7.0.50.20100115/gdb/dwarf2read.c
|
Index: gdb-7.0.90.20100306/gdb/dwarf2read.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- gdb-7.0.50.20100115.orig/gdb/dwarf2read.c 2010-01-15 21:41:32.000000000 +0100
|
--- gdb-7.0.90.20100306.orig/gdb/dwarf2read.c 2010-03-06 23:27:30.000000000 +0100
|
||||||
+++ gdb-7.0.50.20100115/gdb/dwarf2read.c 2010-01-15 21:42:19.000000000 +0100
|
+++ gdb-7.0.90.20100306/gdb/dwarf2read.c 2010-03-06 23:28:43.000000000 +0100
|
||||||
@@ -5821,7 +5821,12 @@ read_common_block (struct die_info *die,
|
@@ -5910,7 +5910,12 @@ read_common_block (struct die_info *die,
|
||||||
{
|
{
|
||||||
struct attribute *attr;
|
struct attribute *attr;
|
||||||
struct symbol *sym;
|
struct symbol *sym;
|
||||||
@ -16,7 +16,7 @@ Index: gdb-7.0.50.20100115/gdb/dwarf2read.c
|
|||||||
|
|
||||||
attr = dwarf2_attr (die, DW_AT_location, cu);
|
attr = dwarf2_attr (die, DW_AT_location, cu);
|
||||||
if (attr)
|
if (attr)
|
||||||
@@ -5830,6 +5835,7 @@ read_common_block (struct die_info *die,
|
@@ -5919,6 +5924,7 @@ read_common_block (struct die_info *die,
|
||||||
if (attr_form_is_block (attr))
|
if (attr_form_is_block (attr))
|
||||||
{
|
{
|
||||||
base = decode_locdesc (DW_BLOCK (attr), cu);
|
base = decode_locdesc (DW_BLOCK (attr), cu);
|
||||||
@ -24,7 +24,7 @@ Index: gdb-7.0.50.20100115/gdb/dwarf2read.c
|
|||||||
}
|
}
|
||||||
else if (attr_form_is_section_offset (attr))
|
else if (attr_form_is_section_offset (attr))
|
||||||
{
|
{
|
||||||
@@ -5891,12 +5897,15 @@ read_common_block (struct die_info *die,
|
@@ -5980,12 +5986,15 @@ read_common_block (struct die_info *die,
|
||||||
else
|
else
|
||||||
dwarf2_complex_location_expr_complaint ();
|
dwarf2_complex_location_expr_complaint ();
|
||||||
|
|
||||||
@ -42,7 +42,7 @@ Index: gdb-7.0.50.20100115/gdb/dwarf2read.c
|
|||||||
else
|
else
|
||||||
SET_FIELD_PHYSNAME (*field, SYMBOL_LINKAGE_NAME (sym));
|
SET_FIELD_PHYSNAME (*field, SYMBOL_LINKAGE_NAME (sym));
|
||||||
FIELD_TYPE (*field) = SYMBOL_TYPE (sym);
|
FIELD_TYPE (*field) = SYMBOL_TYPE (sym);
|
||||||
@@ -5910,7 +5919,7 @@ read_common_block (struct die_info *die,
|
@@ -5999,7 +6008,7 @@ read_common_block (struct die_info *die,
|
||||||
|
|
||||||
sym = new_symbol (die, type, cu);
|
sym = new_symbol (die, type, cu);
|
||||||
/* SYMBOL_VALUE_ADDRESS never gets used as all its fields are static. */
|
/* SYMBOL_VALUE_ADDRESS never gets used as all its fields are static. */
|
||||||
@ -51,60 +51,11 @@ Index: gdb-7.0.50.20100115/gdb/dwarf2read.c
|
|||||||
|
|
||||||
set_die_type (die, type, cu);
|
set_die_type (die, type, cu);
|
||||||
}
|
}
|
||||||
Index: gdb-7.0.50.20100115/gdb/exec.c
|
Index: gdb-7.0.90.20100306/gdb/gdbtypes.h
|
||||||
===================================================================
|
===================================================================
|
||||||
--- gdb-7.0.50.20100115.orig/gdb/exec.c 2010-01-15 21:35:14.000000000 +0100
|
--- gdb-7.0.90.20100306.orig/gdb/gdbtypes.h 2010-03-06 23:26:34.000000000 +0100
|
||||||
+++ gdb-7.0.50.20100115/gdb/exec.c 2010-01-15 21:47:19.000000000 +0100
|
+++ gdb-7.0.90.20100306/gdb/gdbtypes.h 2010-03-06 23:28:43.000000000 +0100
|
||||||
@@ -35,6 +35,7 @@
|
@@ -412,6 +412,7 @@ enum type_instance_flag_value
|
||||||
#include "arch-utils.h"
|
|
||||||
#include "gdbthread.h"
|
|
||||||
#include "progspace.h"
|
|
||||||
+#include "solib.h"
|
|
||||||
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include "readline/readline.h"
|
|
||||||
@@ -225,6 +226,10 @@ exec_file_attach (char *filename, int fr
|
|
||||||
char *scratch_pathname;
|
|
||||||
int scratch_chan;
|
|
||||||
struct target_section *sections = NULL, *sections_end = NULL;
|
|
||||||
+ struct target_section *p;
|
|
||||||
+ int addr_bit;
|
|
||||||
+ CORE_ADDR mask = CORE_ADDR_MAX;
|
|
||||||
+ CORE_ADDR displacement;
|
|
||||||
|
|
||||||
scratch_chan = openp (getenv ("PATH"), OPF_TRY_CWD_FIRST, filename,
|
|
||||||
write_files ? O_RDWR | O_BINARY : O_RDONLY | O_BINARY,
|
|
||||||
@@ -293,12 +298,23 @@ exec_file_attach (char *filename, int fr
|
|
||||||
scratch_pathname, bfd_errmsg (bfd_get_error ()));
|
|
||||||
}
|
|
||||||
|
|
||||||
+ set_gdbarch_from_file (exec_bfd);
|
|
||||||
+
|
|
||||||
+ addr_bit = gdbarch_addr_bit (target_gdbarch);
|
|
||||||
+ if (addr_bit < (sizeof (CORE_ADDR) * HOST_CHAR_BIT))
|
|
||||||
+ mask = ((CORE_ADDR) 1 << addr_bit) - 1;
|
|
||||||
+
|
|
||||||
+ displacement = solib_exec_displacement ();
|
|
||||||
+ for (p = sections; p < sections_end; p++)
|
|
||||||
+ {
|
|
||||||
+ p->addr = (p->addr + displacement) & mask;
|
|
||||||
+ p->endaddr = (p->endaddr + displacement) & mask;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
exec_bfd_mtime = bfd_get_mtime (exec_bfd);
|
|
||||||
|
|
||||||
validate_files ();
|
|
||||||
|
|
||||||
- set_gdbarch_from_file (exec_bfd);
|
|
||||||
-
|
|
||||||
/* Add the executable's sections to the current address spaces'
|
|
||||||
list of sections. This possibly pushes the exec_ops
|
|
||||||
target. */
|
|
||||||
Index: gdb-7.0.50.20100115/gdb/gdbtypes.h
|
|
||||||
===================================================================
|
|
||||||
--- gdb-7.0.50.20100115.orig/gdb/gdbtypes.h 2010-01-15 21:35:16.000000000 +0100
|
|
||||||
+++ gdb-7.0.50.20100115/gdb/gdbtypes.h 2010-01-15 21:44:24.000000000 +0100
|
|
||||||
@@ -406,6 +406,7 @@ enum type_instance_flag_value
|
|
||||||
enum field_loc_kind
|
enum field_loc_kind
|
||||||
{
|
{
|
||||||
FIELD_LOC_KIND_BITPOS, /* bitpos */
|
FIELD_LOC_KIND_BITPOS, /* bitpos */
|
||||||
@ -112,7 +63,7 @@ Index: gdb-7.0.50.20100115/gdb/gdbtypes.h
|
|||||||
FIELD_LOC_KIND_PHYSADDR, /* physaddr */
|
FIELD_LOC_KIND_PHYSADDR, /* physaddr */
|
||||||
FIELD_LOC_KIND_PHYSNAME /* physname */
|
FIELD_LOC_KIND_PHYSNAME /* physname */
|
||||||
};
|
};
|
||||||
@@ -582,6 +583,7 @@ struct main_type
|
@@ -591,6 +592,7 @@ struct main_type
|
||||||
is the location (in the target) of the static field.
|
is the location (in the target) of the static field.
|
||||||
Otherwise, physname is the mangled label of the static field. */
|
Otherwise, physname is the mangled label of the static field. */
|
||||||
|
|
||||||
@ -120,7 +71,7 @@ Index: gdb-7.0.50.20100115/gdb/gdbtypes.h
|
|||||||
CORE_ADDR physaddr;
|
CORE_ADDR physaddr;
|
||||||
char *physname;
|
char *physname;
|
||||||
}
|
}
|
||||||
@@ -1100,6 +1102,7 @@ extern void allocate_gnat_aux_type (stru
|
@@ -1091,6 +1093,7 @@ extern void allocate_gnat_aux_type (stru
|
||||||
#define FIELD_LOC_KIND(thisfld) ((thisfld).loc_kind)
|
#define FIELD_LOC_KIND(thisfld) ((thisfld).loc_kind)
|
||||||
#define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos)
|
#define FIELD_BITPOS(thisfld) ((thisfld).loc.bitpos)
|
||||||
#define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname)
|
#define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname)
|
||||||
@ -128,7 +79,7 @@ Index: gdb-7.0.50.20100115/gdb/gdbtypes.h
|
|||||||
#define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
|
#define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr)
|
||||||
#define SET_FIELD_BITPOS(thisfld, bitpos) \
|
#define SET_FIELD_BITPOS(thisfld, bitpos) \
|
||||||
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_BITPOS, \
|
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_BITPOS, \
|
||||||
@@ -1107,6 +1110,7 @@ extern void allocate_gnat_aux_type (stru
|
@@ -1098,6 +1101,7 @@ extern void allocate_gnat_aux_type (stru
|
||||||
#define SET_FIELD_PHYSNAME(thisfld, name) \
|
#define SET_FIELD_PHYSNAME(thisfld, name) \
|
||||||
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \
|
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \
|
||||||
FIELD_STATIC_PHYSNAME (thisfld) = (name))
|
FIELD_STATIC_PHYSNAME (thisfld) = (name))
|
||||||
@ -136,7 +87,7 @@ Index: gdb-7.0.50.20100115/gdb/gdbtypes.h
|
|||||||
#define SET_FIELD_PHYSADDR(thisfld, addr) \
|
#define SET_FIELD_PHYSADDR(thisfld, addr) \
|
||||||
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \
|
(FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \
|
||||||
FIELD_STATIC_PHYSADDR (thisfld) = (addr))
|
FIELD_STATIC_PHYSADDR (thisfld) = (addr))
|
||||||
@@ -1119,6 +1123,7 @@ extern void allocate_gnat_aux_type (stru
|
@@ -1110,6 +1114,7 @@ extern void allocate_gnat_aux_type (stru
|
||||||
#define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND (TYPE_FIELD (thistype, n))
|
#define TYPE_FIELD_LOC_KIND(thistype, n) FIELD_LOC_KIND (TYPE_FIELD (thistype, n))
|
||||||
#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n))
|
#define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n))
|
||||||
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n))
|
#define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n))
|
||||||
@ -144,10 +95,10 @@ Index: gdb-7.0.50.20100115/gdb/gdbtypes.h
|
|||||||
#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n))
|
#define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n))
|
||||||
#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
|
#define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n))
|
||||||
#define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n))
|
#define TYPE_FIELD_BITSIZE(thistype, n) FIELD_BITSIZE(TYPE_FIELD(thistype,n))
|
||||||
Index: gdb-7.0.50.20100115/gdb/jv-lang.c
|
Index: gdb-7.0.90.20100306/gdb/jv-lang.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- gdb-7.0.50.20100115.orig/gdb/jv-lang.c 2010-01-15 21:35:13.000000000 +0100
|
--- gdb-7.0.90.20100306.orig/gdb/jv-lang.c 2010-03-06 23:19:13.000000000 +0100
|
||||||
+++ gdb-7.0.50.20100115/gdb/jv-lang.c 2010-01-15 21:41:58.000000000 +0100
|
+++ gdb-7.0.90.20100306/gdb/jv-lang.c 2010-03-06 23:28:43.000000000 +0100
|
||||||
@@ -416,7 +416,8 @@ java_link_class_type (struct gdbarch *gd
|
@@ -416,7 +416,8 @@ java_link_class_type (struct gdbarch *gd
|
||||||
|
|
||||||
fields = NULL;
|
fields = NULL;
|
||||||
@ -168,142 +119,10 @@ Index: gdb-7.0.50.20100115/gdb/jv-lang.c
|
|||||||
else
|
else
|
||||||
TYPE_FIELD_BITPOS (type, i) = 8 * boffset;
|
TYPE_FIELD_BITPOS (type, i) = 8 * boffset;
|
||||||
if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */
|
if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */
|
||||||
Index: gdb-7.0.50.20100115/gdb/solib-svr4.c
|
Index: gdb-7.0.90.20100306/gdb/value.c
|
||||||
===================================================================
|
===================================================================
|
||||||
--- gdb-7.0.50.20100115.orig/gdb/solib-svr4.c 2010-01-15 21:35:16.000000000 +0100
|
--- gdb-7.0.90.20100306.orig/gdb/value.c 2010-03-06 23:19:13.000000000 +0100
|
||||||
+++ gdb-7.0.50.20100115/gdb/solib-svr4.c 2010-01-15 21:44:55.000000000 +0100
|
+++ gdb-7.0.90.20100306/gdb/value.c 2010-03-06 23:28:43.000000000 +0100
|
||||||
@@ -1689,7 +1689,10 @@ svr4_exec_displacement (void)
|
|
||||||
if (target_auxv_search (¤t_target, AT_ENTRY, &entry_point) == 1)
|
|
||||||
return entry_point - bfd_get_start_address (exec_bfd);
|
|
||||||
|
|
||||||
- return svr4_static_exec_displacement ();
|
|
||||||
+ if (!ptid_equal (inferior_ptid, null_ptid))
|
|
||||||
+ return svr4_static_exec_displacement ();
|
|
||||||
+
|
|
||||||
+ return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Relocate the main executable. This function should be called upon
|
|
||||||
@@ -1700,7 +1703,7 @@ svr4_exec_displacement (void)
|
|
||||||
static void
|
|
||||||
svr4_relocate_main_executable (void)
|
|
||||||
{
|
|
||||||
- CORE_ADDR displacement = svr4_exec_displacement ();
|
|
||||||
+ CORE_ADDR displacement = solib_exec_displacement ();
|
|
||||||
|
|
||||||
/* Even if DISPLACEMENT is 0 still try to relocate it as this is a new
|
|
||||||
difference of in-memory vs. in-file addresses and we could already
|
|
||||||
@@ -2054,6 +2057,7 @@ _initialize_svr4_solib (void)
|
|
||||||
svr4_so_ops.free_so = svr4_free_so;
|
|
||||||
svr4_so_ops.clear_solib = svr4_clear_solib;
|
|
||||||
svr4_so_ops.solib_create_inferior_hook = svr4_solib_create_inferior_hook;
|
|
||||||
+ svr4_so_ops.exec_displacement = svr4_exec_displacement;
|
|
||||||
svr4_so_ops.special_symbol_handling = svr4_special_symbol_handling;
|
|
||||||
svr4_so_ops.current_sos = svr4_current_sos;
|
|
||||||
svr4_so_ops.open_symbol_file_object = open_symbol_file_object;
|
|
||||||
Index: gdb-7.0.50.20100115/gdb/solib.c
|
|
||||||
===================================================================
|
|
||||||
--- gdb-7.0.50.20100115.orig/gdb/solib.c 2010-01-15 21:35:16.000000000 +0100
|
|
||||||
+++ gdb-7.0.50.20100115/gdb/solib.c 2010-01-15 21:41:58.000000000 +0100
|
|
||||||
@@ -1037,6 +1037,19 @@ solib_create_inferior_hook (int from_tty
|
|
||||||
ops->solib_create_inferior_hook (from_tty);
|
|
||||||
}
|
|
||||||
|
|
||||||
+/* Query the difference of in-memory VMA addresses vs. exec_bfd VMAs. */
|
|
||||||
+
|
|
||||||
+CORE_ADDR
|
|
||||||
+solib_exec_displacement (void)
|
|
||||||
+{
|
|
||||||
+ struct target_so_ops *ops = solib_ops (target_gdbarch);
|
|
||||||
+
|
|
||||||
+ if (ops->exec_displacement != NULL)
|
|
||||||
+ return (*ops->exec_displacement) ();
|
|
||||||
+ else
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
/* GLOBAL FUNCTION
|
|
||||||
|
|
||||||
in_solib_dynsym_resolve_code -- check to see if an address is in
|
|
||||||
Index: gdb-7.0.50.20100115/gdb/solib.h
|
|
||||||
===================================================================
|
|
||||||
--- gdb-7.0.50.20100115.orig/gdb/solib.h 2010-01-08 23:52:04.000000000 +0100
|
|
||||||
+++ gdb-7.0.50.20100115/gdb/solib.h 2010-01-15 21:42:36.000000000 +0100
|
|
||||||
@@ -44,6 +44,8 @@ extern int solib_read_symbols (struct so
|
|
||||||
|
|
||||||
extern void solib_create_inferior_hook (int from_tty);
|
|
||||||
|
|
||||||
+extern CORE_ADDR solib_exec_displacement (void);
|
|
||||||
+
|
|
||||||
/* If ADDR lies in a shared library, return its name. */
|
|
||||||
|
|
||||||
extern char *solib_name_from_address (struct program_space *, CORE_ADDR);
|
|
||||||
Index: gdb-7.0.50.20100115/gdb/solist.h
|
|
||||||
===================================================================
|
|
||||||
--- gdb-7.0.50.20100115.orig/gdb/solist.h 2010-01-08 23:52:04.000000000 +0100
|
|
||||||
+++ gdb-7.0.50.20100115/gdb/solist.h 2010-01-15 21:41:58.000000000 +0100
|
|
||||||
@@ -92,6 +92,9 @@ struct target_so_ops
|
|
||||||
/* Target dependent code to run after child process fork. */
|
|
||||||
void (*solib_create_inferior_hook) (int from_tty);
|
|
||||||
|
|
||||||
+ /* Query the difference of in-memory VMA addresses vs. exec_bfd VMAs. */
|
|
||||||
+ CORE_ADDR (*exec_displacement) (void);
|
|
||||||
+
|
|
||||||
/* Do additional symbol handling, lookup, etc. after symbols
|
|
||||||
for a shared object have been loaded. */
|
|
||||||
void (*special_symbol_handling) (void);
|
|
||||||
Index: gdb-7.0.50.20100115/gdb/symfile.c
|
|
||||||
===================================================================
|
|
||||||
--- gdb-7.0.50.20100115.orig/gdb/symfile.c 2010-01-15 21:35:14.000000000 +0100
|
|
||||||
+++ gdb-7.0.50.20100115/gdb/symfile.c 2010-01-15 21:41:58.000000000 +0100
|
|
||||||
@@ -832,15 +832,36 @@ syms_from_objfile (struct objfile *objfi
|
|
||||||
if an error occurs during symbol reading. */
|
|
||||||
old_chain = make_cleanup_free_objfile (objfile);
|
|
||||||
|
|
||||||
- /* If ADDRS and OFFSETS are both NULL, put together a dummy address
|
|
||||||
- list. We now establish the convention that an addr of zero means
|
|
||||||
- no load address was specified. */
|
|
||||||
+ /* If ADDRS and OFFSETS are both NULL, put together a dummy offset list. */
|
|
||||||
+
|
|
||||||
if (! addrs && ! offsets)
|
|
||||||
{
|
|
||||||
- local_addr
|
|
||||||
- = alloc_section_addr_info (bfd_count_sections (objfile->obfd));
|
|
||||||
- make_cleanup (xfree, local_addr);
|
|
||||||
- addrs = local_addr;
|
|
||||||
+ /* Relocateble files have an exception in default_symfile_offsets which
|
|
||||||
+ applies only for ADDRS. But calling solib_exec_displacement is more
|
|
||||||
+ suitable for OFFSETS. Fortunately we never need the both
|
|
||||||
+ functionalities simultaneously and in other cases zeroed ADDRS and
|
|
||||||
+ zeroed OFFSETS are equivalent. */
|
|
||||||
+
|
|
||||||
+ if ((bfd_get_file_flags (objfile->obfd) & (EXEC_P | DYNAMIC)) == 0)
|
|
||||||
+ {
|
|
||||||
+ local_addr
|
|
||||||
+ = alloc_section_addr_info (bfd_count_sections (objfile->obfd));
|
|
||||||
+ make_cleanup (xfree, local_addr);
|
|
||||||
+ addrs = local_addr;
|
|
||||||
+ }
|
|
||||||
+ else
|
|
||||||
+ {
|
|
||||||
+ CORE_ADDR displacement = 0;
|
|
||||||
+ int i;
|
|
||||||
+
|
|
||||||
+ if (mainline)
|
|
||||||
+ displacement = solib_exec_displacement ();
|
|
||||||
+
|
|
||||||
+ num_offsets = bfd_count_sections (objfile->obfd);
|
|
||||||
+ offsets = alloca (SIZEOF_N_SECTION_OFFSETS (num_offsets));
|
|
||||||
+ for (i = 0; i < num_offsets; i++)
|
|
||||||
+ offsets->offsets[i] = displacement;
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Now either addrs or offsets is non-zero. */
|
|
||||||
Index: gdb-7.0.50.20100115/gdb/value.c
|
|
||||||
===================================================================
|
|
||||||
--- gdb-7.0.50.20100115.orig/gdb/value.c 2010-01-15 21:35:13.000000000 +0100
|
|
||||||
+++ gdb-7.0.50.20100115/gdb/value.c 2010-01-15 21:41:58.000000000 +0100
|
|
||||||
@@ -1897,7 +1897,8 @@ value_static_field (struct type *type, i
|
@@ -1897,7 +1897,8 @@ value_static_field (struct type *type, i
|
||||||
if (TYPE_FIELD_LOC_KIND (type, fieldno) == FIELD_LOC_KIND_PHYSADDR)
|
if (TYPE_FIELD_LOC_KIND (type, fieldno) == FIELD_LOC_KIND_PHYSADDR)
|
||||||
{
|
{
|
||||||
|
3767
gdb-archer.patch
3767
gdb-archer.patch
File diff suppressed because it is too large
Load Diff
159
gdb-bz562975-std-terminate-double-free.patch
Normal file
159
gdb-bz562975-std-terminate-double-free.patch
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
http://sourceware.org/ml/gdb-patches/2010-02/msg00625.html
|
||||||
|
Subject: RFC: fix bug with std::terminate handler
|
||||||
|
|
||||||
|
I would appreciate comments on this patch.
|
||||||
|
|
||||||
|
This comes from an automatically-reported bug in the Red Hat bugzilla:
|
||||||
|
|
||||||
|
https://bugzilla.redhat.com/show_bug.cgi?id=562975
|
||||||
|
|
||||||
|
call_function_by_hand installs a momentary breakpoint on std::terminate,
|
||||||
|
and then deletes it later. However, this can cause a double deletion of
|
||||||
|
the breakpoint. In the bug, the called function is dlopen, which causes
|
||||||
|
gdb to enter solib_add, which calls breakpoint_re_set, deleting the
|
||||||
|
momentary breakpoint.
|
||||||
|
|
||||||
|
This fix works by creating the momentary breakpoint with an internal
|
||||||
|
breakpoint number, and then trying to delete the breakpoint by number.
|
||||||
|
|
||||||
|
This bug does not always manifest in a crash. In fact, I couldn't make
|
||||||
|
it crash here, but I could observe the problem under valgrind.
|
||||||
|
|
||||||
|
Built and regtested on x86-64 (compile farm). I also manually verified
|
||||||
|
it using valgrind.
|
||||||
|
|
||||||
|
I think this patch is mildly ugly, due to the introduction of
|
||||||
|
set_momentary_breakpoint_at_pc_with_number. However, in the absence of
|
||||||
|
comments, I plan to check it in after a reasonable waiting period.
|
||||||
|
|
||||||
|
Tom
|
||||||
|
|
||||||
|
2010-02-25 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* infcall.c (do_delete_breakpoint_by_number): New function.
|
||||||
|
(call_function_by_hand): Refer to momentary breakpoint by number.
|
||||||
|
* breakpoint.h (set_momentary_breakpoint_at_pc_with_number):
|
||||||
|
Declare.
|
||||||
|
* breakpoint.c (set_momentary_breakpoint_at_pc_with_number): New
|
||||||
|
function.
|
||||||
|
|
||||||
|
Index: gdb-7.0.90.20100312/gdb/breakpoint.c
|
||||||
|
===================================================================
|
||||||
|
--- gdb-7.0.90.20100312.orig/gdb/breakpoint.c 2010-03-12 14:54:26.000000000 +0100
|
||||||
|
+++ gdb-7.0.90.20100312/gdb/breakpoint.c 2010-03-12 14:54:53.000000000 +0100
|
||||||
|
@@ -6115,6 +6115,20 @@ set_momentary_breakpoint_at_pc (struct g
|
||||||
|
|
||||||
|
return set_momentary_breakpoint (gdbarch, sal, null_frame_id, type);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+/* Like set_momentary_breakpoint_at_pc, but ensure that the new
|
||||||
|
+ breakpoint has a number. */
|
||||||
|
+
|
||||||
|
+struct breakpoint *
|
||||||
|
+set_momentary_breakpoint_at_pc_with_number (struct gdbarch *gdbarch,
|
||||||
|
+ CORE_ADDR pc,
|
||||||
|
+ enum bptype type)
|
||||||
|
+{
|
||||||
|
+ struct breakpoint *result = set_momentary_breakpoint_at_pc (gdbarch, pc,
|
||||||
|
+ type);
|
||||||
|
+ result->number = internal_breakpoint_number--;
|
||||||
|
+ return result;
|
||||||
|
+}
|
||||||
|
|
||||||
|
|
||||||
|
/* Tell the user we have just set a breakpoint B. */
|
||||||
|
Index: gdb-7.0.90.20100312/gdb/breakpoint.h
|
||||||
|
===================================================================
|
||||||
|
--- gdb-7.0.90.20100312.orig/gdb/breakpoint.h 2010-03-12 14:54:26.000000000 +0100
|
||||||
|
+++ gdb-7.0.90.20100312/gdb/breakpoint.h 2010-03-12 14:54:53.000000000 +0100
|
||||||
|
@@ -774,6 +774,9 @@ extern struct breakpoint *set_momentary_
|
||||||
|
extern struct breakpoint *set_momentary_breakpoint_at_pc
|
||||||
|
(struct gdbarch *, CORE_ADDR pc, enum bptype type);
|
||||||
|
|
||||||
|
+extern struct breakpoint *set_momentary_breakpoint_at_pc_with_number
|
||||||
|
+ (struct gdbarch *, CORE_ADDR pc, enum bptype type);
|
||||||
|
+
|
||||||
|
extern struct breakpoint *clone_momentary_breakpoint (struct breakpoint *bpkt);
|
||||||
|
|
||||||
|
extern void set_ignore_count (int, int, int);
|
||||||
|
Index: gdb-7.0.90.20100312/gdb/infcall.c
|
||||||
|
===================================================================
|
||||||
|
--- gdb-7.0.90.20100312.orig/gdb/infcall.c 2010-03-12 14:54:26.000000000 +0100
|
||||||
|
+++ gdb-7.0.90.20100312/gdb/infcall.c 2010-03-12 14:55:19.000000000 +0100
|
||||||
|
@@ -410,6 +410,18 @@ run_inferior_call (struct thread_info *c
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
|
+/* A cleanup function that deletes a breakpoint, if it still exists,
|
||||||
|
+ given the breakpoint's number. */
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+do_delete_breakpoint_by_number (void *arg)
|
||||||
|
+{
|
||||||
|
+ int *num = arg;
|
||||||
|
+ struct breakpoint *bp = get_breakpoint (*num);
|
||||||
|
+ if (bp)
|
||||||
|
+ delete_breakpoint (bp);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
/* All this stuff with a dummy frame may seem unnecessarily complicated
|
||||||
|
(why not just save registers in GDB?). The purpose of pushing a dummy
|
||||||
|
frame which looks just like a real frame is so that if you call a
|
||||||
|
@@ -447,7 +459,8 @@ call_function_by_hand (struct value *fun
|
||||||
|
struct cleanup *args_cleanup;
|
||||||
|
struct frame_info *frame;
|
||||||
|
struct gdbarch *gdbarch;
|
||||||
|
- struct breakpoint *terminate_bp = NULL;
|
||||||
|
+ int terminate_bp_num = 0;
|
||||||
|
+ CORE_ADDR terminate_bp_addr = 0;
|
||||||
|
struct minimal_symbol *tm;
|
||||||
|
struct cleanup *terminate_bp_cleanup = NULL;
|
||||||
|
ptid_t call_thread_ptid;
|
||||||
|
@@ -765,8 +778,13 @@ call_function_by_hand (struct value *fun
|
||||||
|
struct minimal_symbol *tm = lookup_minimal_symbol ("std::terminate()",
|
||||||
|
NULL, NULL);
|
||||||
|
if (tm != NULL)
|
||||||
|
- terminate_bp = set_momentary_breakpoint_at_pc
|
||||||
|
+ {
|
||||||
|
+ struct breakpoint *bp;
|
||||||
|
+ bp = set_momentary_breakpoint_at_pc_with_number
|
||||||
|
(gdbarch, SYMBOL_VALUE_ADDRESS (tm), bp_breakpoint);
|
||||||
|
+ terminate_bp_num = bp->number;
|
||||||
|
+ terminate_bp_addr = bp->loc->address;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Everything's ready, push all the info needed to restore the
|
||||||
|
@@ -780,8 +798,9 @@ call_function_by_hand (struct value *fun
|
||||||
|
discard_cleanups (inf_status_cleanup);
|
||||||
|
|
||||||
|
/* Register a clean-up for unwind_on_terminating_exception_breakpoint. */
|
||||||
|
- if (terminate_bp)
|
||||||
|
- terminate_bp_cleanup = make_cleanup_delete_breakpoint (terminate_bp);
|
||||||
|
+ if (terminate_bp_num != 0)
|
||||||
|
+ terminate_bp_cleanup = make_cleanup (do_delete_breakpoint_by_number,
|
||||||
|
+ &terminate_bp_num);
|
||||||
|
|
||||||
|
/* - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP - SNIP -
|
||||||
|
If you're looking to implement asynchronous dummy-frames, then
|
||||||
|
@@ -947,9 +966,9 @@ When the function is done executing, GDB
|
||||||
|
in an inferior function call. Rewind, and warn the
|
||||||
|
user. */
|
||||||
|
|
||||||
|
- if (terminate_bp != NULL
|
||||||
|
+ if (terminate_bp_num != 0
|
||||||
|
&& (inferior_thread ()->stop_bpstat->breakpoint_at->address
|
||||||
|
- == terminate_bp->loc->address))
|
||||||
|
+ == terminate_bp_addr))
|
||||||
|
{
|
||||||
|
/* We must get back to the frame we were before the
|
||||||
|
dummy call. */
|
||||||
|
@@ -998,7 +1017,7 @@ When the function is done executing, GDB
|
||||||
|
|
||||||
|
/* If we get here and the std::terminate() breakpoint has been set,
|
||||||
|
it has to be cleaned manually. */
|
||||||
|
- if (terminate_bp)
|
||||||
|
+ if (terminate_bp_num != 0)
|
||||||
|
do_cleanups (terminate_bp_cleanup);
|
||||||
|
|
||||||
|
/* If we get here the called FUNCTION ran to completion,
|
73
gdb-bz574483-display-sepdebug.patch
Normal file
73
gdb-bz574483-display-sepdebug.patch
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
http://sourceware.org/ml/gdb-patches/2010-04/msg00055.html
|
||||||
|
Subject: [patch] Fix dangling displays in separate debug
|
||||||
|
|
||||||
|
[ Backported. ]
|
||||||
|
|
||||||
|
Hi,
|
||||||
|
|
||||||
|
gdb.base/solib-display.exp using _separate_ debug info:
|
||||||
|
3: c_global = gdbtypes.c:1369: internal-error: check_typedef: Assertion `type' failed.
|
||||||
|
A problem internal to GDB has been detected,
|
||||||
|
|
||||||
|
This problem was fixed before by:
|
||||||
|
[patch 1/8] Types GC [unloading observer]
|
||||||
|
http://sourceware.org/ml/gdb-patches/2009-05/msg00544.html
|
||||||
|
Re: [patch 3/8] Types GC [display_uses_solib_p to exp_iterate]
|
||||||
|
http://sourceware.org/ml/gdb-patches/2009-07/msg00054.html
|
||||||
|
|
||||||
|
but as that patchset is still not in providing this temporary fixup instead.
|
||||||
|
|
||||||
|
One may only address that gdb.base/solib-display.exp was testing symbol
|
||||||
|
in-objfile while now it tests only symbol in-sepdebug-objfile and no longer
|
||||||
|
the in-objfile case. I find the in-sepdebug-objfile as a superset of
|
||||||
|
in-objfile test but I can rework it if anyones addresses this test change.
|
||||||
|
|
||||||
|
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
|
||||||
|
|
||||||
|
|
||||||
|
Thanks,
|
||||||
|
Jan
|
||||||
|
|
||||||
|
|
||||||
|
gdb/
|
||||||
|
2010-04-03 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* printcmd.c (display_uses_solib_p): Check also
|
||||||
|
SEPARATE_DEBUG_OBJFILE.
|
||||||
|
|
||||||
|
gdb/testsuite/
|
||||||
|
2010-04-03 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* gdb.base/solib-display.exp (split solib): New.
|
||||||
|
|
||||||
|
--- a/gdb/printcmd.c
|
||||||
|
+++ b/gdb/printcmd.c
|
||||||
|
@@ -1845,7 +1845,10 @@ clear_dangling_display_expressions (stru
|
||||||
|
|
||||||
|
for (d = display_chain; d != NULL; d = d->next)
|
||||||
|
if (block_objfile (d->block) == objfile
|
||||||
|
- || (d->exp && exp_uses_objfile (d->exp, objfile)))
|
||||||
|
+ || (d->exp && exp_uses_objfile (d->exp, objfile))
|
||||||
|
+ || (objfile->separate_debug_objfile
|
||||||
|
+ && (block_objfile (d->block) == objfile->separate_debug_objfile
|
||||||
|
+ || (d->exp && exp_uses_objfile (d->exp, objfile->separate_debug_objfile)))))
|
||||||
|
{
|
||||||
|
xfree (d->exp);
|
||||||
|
d->exp = NULL;
|
||||||
|
--- a/gdb/testsuite/gdb.base/solib-display.exp
|
||||||
|
+++ b/gdb/testsuite/gdb.base/solib-display.exp
|
||||||
|
@@ -53,6 +53,13 @@ if { [gdb_compile_shlib ${srcfile_lib} ${binfile_lib} $lib_flags] != ""
|
||||||
|
return -1
|
||||||
|
}
|
||||||
|
|
||||||
|
+set test "split solib"
|
||||||
|
+if {[gdb_gnu_strip_debug $binfile_lib] != 0} {
|
||||||
|
+ fail $test
|
||||||
|
+} else {
|
||||||
|
+ pass $test
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
gdb_exit
|
||||||
|
gdb_start
|
||||||
|
gdb_reinitialize_dir $srcdir/$subdir
|
||||||
|
|
1733
gdb-bz578250-avx-01of10.patch
Normal file
1733
gdb-bz578250-avx-01of10.patch
Normal file
File diff suppressed because it is too large
Load Diff
751
gdb-bz578250-avx-02of10.patch
Normal file
751
gdb-bz578250-avx-02of10.patch
Normal file
@ -0,0 +1,751 @@
|
|||||||
|
[ Backported. ]
|
||||||
|
|
||||||
|
commit cb928c67c90cfb5bbb0636d91855b95e51ad275d
|
||||||
|
Author: Daniel Jacobowitz <dan@debian.org>
|
||||||
|
Date: Mon Mar 1 17:19:21 2010 +0000
|
||||||
|
|
||||||
|
* gdbtypes.c (append_composite_type_field_raw): New.
|
||||||
|
(append_composite_type_field_aligned): Use the new function.
|
||||||
|
* gdbtypes.h (append_composite_type_field_raw): Declare.
|
||||||
|
* target-descriptions.c (struct tdesc_type_field): Add start and end.
|
||||||
|
(struct tdesc_type_flag): New type.
|
||||||
|
(struct tdesc_type): Add TDESC_TYPE_STRUCT and TDESC_TYPE_FLAGS to
|
||||||
|
kind. Add size to u.u. Add u.f for flags.
|
||||||
|
(tdesc_gdb_type): Handle TDESC_TYPE_STRUCT and TDESC_TYPE_FLAGS.
|
||||||
|
(tdesc_free_type): Likewise.
|
||||||
|
(tdesc_create_struct, tdesc_set_struct_size, tdesc_create_flags): New.
|
||||||
|
(tdesc_add_field): Handle TDESC_TYPE_STRUCT.
|
||||||
|
(tdesc_add_bitfield, tdesc_add_flag): New.
|
||||||
|
* target-descriptions.h (tdesc_create_struct, tdesc_set_struct_size)
|
||||||
|
(tdesc_create_flags, tdesc_add_bitfield, tdesc_add_flag): Declare.
|
||||||
|
* xml-tdesc.c (struct tdesc_parsing_data): Rename current_union to
|
||||||
|
current_type. Add current_type_size and current_type_is_flags.
|
||||||
|
(tdesc_start_union): Clear the new fields.
|
||||||
|
(tdesc_start_struct, tdesc_start_flags): New.
|
||||||
|
(tdesc_start_field): Handle struct fields, including bitfields.
|
||||||
|
(field_attributes): Make type optional. Add start and end.
|
||||||
|
(union_children): Rename to struct_union_children.
|
||||||
|
(union_attributes): Rename to struct_union_attributes. Add optional
|
||||||
|
size.
|
||||||
|
(flags_attributes): New.
|
||||||
|
(feature_children): Add struct and flags.
|
||||||
|
* features/gdb-target.dtd: Add flags and struct to features.
|
||||||
|
Make field type optional. Add field start and end.
|
||||||
|
|
||||||
|
doc/
|
||||||
|
* gdb.texinfo (Types): Describe <struct> and <flags>.
|
||||||
|
|
||||||
|
testsuite/
|
||||||
|
* gdb.xml/extra-regs.xml: Add struct1, struct2, and flags
|
||||||
|
types. Add structreg, bitfields, and flags registers.
|
||||||
|
* gdb.xml/tdesc-regs.exp: Test structreg and bitfields
|
||||||
|
registers.
|
||||||
|
|
||||||
|
--- gdb-7.1-p0/gdb/doc/gdb.texinfo 2010-04-03 20:24:51.000000000 +0200
|
||||||
|
+++ gdb-7.1/gdb/doc/gdb.texinfo 2010-04-03 21:04:13.000000000 +0200
|
||||||
|
@@ -33115,6 +33115,47 @@ each of which has a @var{name} and a @va
|
||||||
|
</union>
|
||||||
|
@end smallexample
|
||||||
|
|
||||||
|
+@cindex <struct>
|
||||||
|
+If a register's value is composed from several separate values, define
|
||||||
|
+it with a structure type. There are two forms of the @samp{<struct>}
|
||||||
|
+element; a @samp{<struct>} element must either contain only bitfields
|
||||||
|
+or contain no bitfields. If the structure contains only bitfields,
|
||||||
|
+its total size in bytes must be specified, each bitfield must have an
|
||||||
|
+explicit start and end, and bitfields are automatically assigned an
|
||||||
|
+integer type. The field's @var{start} should be less than or
|
||||||
|
+equal to its @var{end}, and zero represents the least significant bit.
|
||||||
|
+
|
||||||
|
+@smallexample
|
||||||
|
+<struct id="@var{id}" size="@var{size}">
|
||||||
|
+ <field name="@var{name}" start="@var{start}" end="@var{end}"/>
|
||||||
|
+ @dots{}
|
||||||
|
+</struct>
|
||||||
|
+@end smallexample
|
||||||
|
+
|
||||||
|
+If the structure contains no bitfields, then each field has an
|
||||||
|
+explicit type, and no implicit padding is added.
|
||||||
|
+
|
||||||
|
+@smallexample
|
||||||
|
+<struct id="@var{id}">
|
||||||
|
+ <field name="@var{name}" type="@var{type}"/>
|
||||||
|
+ @dots{}
|
||||||
|
+</struct>
|
||||||
|
+@end smallexample
|
||||||
|
+
|
||||||
|
+@cindex <flags>
|
||||||
|
+If a register's value is a series of single-bit flags, define it with
|
||||||
|
+a flags type. The @samp{<flags>} element has an explicit @var{size}
|
||||||
|
+and contains one or more @samp{<field>} elements. Each field has a
|
||||||
|
+@var{name}, a @var{start}, and an @var{end}. Only single-bit flags
|
||||||
|
+are supported.
|
||||||
|
+
|
||||||
|
+@smallexample
|
||||||
|
+<flags id="@var{id}" size="@var{size}">
|
||||||
|
+ <field name="@var{name}" start="@var{start}" end="@var{end}"/>
|
||||||
|
+ @dots{}
|
||||||
|
+</flags>
|
||||||
|
+@end smallexample
|
||||||
|
+
|
||||||
|
@subsection Registers
|
||||||
|
@cindex <reg>
|
||||||
|
|
||||||
|
--- gdb-7.1-p0/gdb/features/gdb-target.dtd 2010-01-01 08:31:48.000000000 +0100
|
||||||
|
+++ gdb-7.1/gdb/features/gdb-target.dtd 2010-04-03 21:04:13.000000000 +0200
|
||||||
|
@@ -19,7 +19,8 @@
|
||||||
|
|
||||||
|
<!ELEMENT compatible (#PCDATA)>
|
||||||
|
|
||||||
|
-<!ELEMENT feature ((vector | union)*, reg*)>
|
||||||
|
+<!ELEMENT feature
|
||||||
|
+ ((vector | flags | struct | union )*, reg*)>
|
||||||
|
<!ATTLIST feature
|
||||||
|
name ID #REQUIRED>
|
||||||
|
|
||||||
|
@@ -39,6 +40,16 @@
|
||||||
|
type CDATA #REQUIRED
|
||||||
|
count CDATA #REQUIRED>
|
||||||
|
|
||||||
|
+<!ELEMENT flags (field+)>
|
||||||
|
+<!ATTLIST flags
|
||||||
|
+ id CDATA #REQUIRED
|
||||||
|
+ size CDATA #REQUIRED>
|
||||||
|
+
|
||||||
|
+<!ELEMENT struct (field+)>
|
||||||
|
+<!ATTLIST struct
|
||||||
|
+ id CDATA #REQUIRED
|
||||||
|
+ size CDATA #IMPLIED>
|
||||||
|
+
|
||||||
|
<!ELEMENT union (field+)>
|
||||||
|
<!ATTLIST union
|
||||||
|
id CDATA #REQUIRED>
|
||||||
|
@@ -46,7 +57,9 @@
|
||||||
|
<!ELEMENT field EMPTY>
|
||||||
|
<!ATTLIST field
|
||||||
|
name CDATA #REQUIRED
|
||||||
|
- type CDATA #REQUIRED>
|
||||||
|
+ type CDATA #IMPLIED
|
||||||
|
+ start CDATA #IMPLIED
|
||||||
|
+ end CDATA #IMPLIED>
|
||||||
|
|
||||||
|
<!ENTITY % xinclude SYSTEM "xinclude.dtd">
|
||||||
|
%xinclude;
|
||||||
|
--- gdb-7.1-p0/gdb/gdbtypes.c 2010-04-03 20:24:51.000000000 +0200
|
||||||
|
+++ gdb-7.1/gdb/gdbtypes.c 2010-04-03 21:04:13.000000000 +0200
|
||||||
|
@@ -3798,10 +3798,11 @@ arch_composite_type (struct gdbarch *gdb
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add new field with name NAME and type FIELD to composite type T.
|
||||||
|
- ALIGNMENT (if non-zero) specifies the minimum field alignment. */
|
||||||
|
-void
|
||||||
|
-append_composite_type_field_aligned (struct type *t, char *name,
|
||||||
|
- struct type *field, int alignment)
|
||||||
|
+ Do not set the field's position or adjust the type's length;
|
||||||
|
+ the caller should do so. Return the new field. */
|
||||||
|
+struct field *
|
||||||
|
+append_composite_type_field_raw (struct type *t, char *name,
|
||||||
|
+ struct type *field)
|
||||||
|
{
|
||||||
|
struct field *f;
|
||||||
|
TYPE_NFIELDS (t) = TYPE_NFIELDS (t) + 1;
|
||||||
|
@@ -3811,6 +3812,16 @@ append_composite_type_field_aligned (str
|
||||||
|
memset (f, 0, sizeof f[0]);
|
||||||
|
FIELD_TYPE (f[0]) = field;
|
||||||
|
FIELD_NAME (f[0]) = name;
|
||||||
|
+ return f;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/* Add new field with name NAME and type FIELD to composite type T.
|
||||||
|
+ ALIGNMENT (if non-zero) specifies the minimum field alignment. */
|
||||||
|
+void
|
||||||
|
+append_composite_type_field_aligned (struct type *t, char *name,
|
||||||
|
+ struct type *field, int alignment)
|
||||||
|
+{
|
||||||
|
+ struct field *f = append_composite_type_field_raw (t, name, field);
|
||||||
|
if (TYPE_CODE (t) == TYPE_CODE_UNION)
|
||||||
|
{
|
||||||
|
if (TYPE_LENGTH (t) < TYPE_LENGTH (field))
|
||||||
|
--- gdb-7.1-p0/gdb/gdbtypes.h 2010-04-03 20:24:51.000000000 +0200
|
||||||
|
+++ gdb-7.1/gdb/gdbtypes.h 2010-04-03 21:04:13.000000000 +0200
|
||||||
|
@@ -1395,6 +1395,8 @@ extern void append_composite_type_field_
|
||||||
|
char *name,
|
||||||
|
struct type *field,
|
||||||
|
int alignment);
|
||||||
|
+struct field *append_composite_type_field_raw (struct type *t, char *name,
|
||||||
|
+ struct type *field);
|
||||||
|
|
||||||
|
/* Helper functions to construct a bit flags type. An initially empty
|
||||||
|
type is created using arch_flag_type(). Flags are then added using
|
||||||
|
--- gdb-7.1-p0/gdb/target-descriptions.c 2010-02-10 19:45:02.000000000 +0100
|
||||||
|
+++ gdb-7.1/gdb/target-descriptions.c 2010-04-03 21:04:13.000000000 +0200
|
||||||
|
@@ -90,9 +90,17 @@ typedef struct tdesc_type_field
|
||||||
|
{
|
||||||
|
char *name;
|
||||||
|
struct tdesc_type *type;
|
||||||
|
+ int start, end;
|
||||||
|
} tdesc_type_field;
|
||||||
|
DEF_VEC_O(tdesc_type_field);
|
||||||
|
|
||||||
|
+typedef struct tdesc_type_flag
|
||||||
|
+{
|
||||||
|
+ char *name;
|
||||||
|
+ int start;
|
||||||
|
+} tdesc_type_flag;
|
||||||
|
+DEF_VEC_O(tdesc_type_flag);
|
||||||
|
+
|
||||||
|
typedef struct tdesc_type
|
||||||
|
{
|
||||||
|
/* The name of this type. */
|
||||||
|
@@ -123,7 +131,9 @@ typedef struct tdesc_type
|
||||||
|
|
||||||
|
/* Types defined by a target feature. */
|
||||||
|
TDESC_TYPE_VECTOR,
|
||||||
|
- TDESC_TYPE_UNION
|
||||||
|
+ TDESC_TYPE_STRUCT,
|
||||||
|
+ TDESC_TYPE_UNION,
|
||||||
|
+ TDESC_TYPE_FLAGS
|
||||||
|
} kind;
|
||||||
|
|
||||||
|
/* Kind-specific data. */
|
||||||
|
@@ -136,11 +146,19 @@ typedef struct tdesc_type
|
||||||
|
int count;
|
||||||
|
} v;
|
||||||
|
|
||||||
|
- /* Union type. */
|
||||||
|
+ /* Struct or union type. */
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
VEC(tdesc_type_field) *fields;
|
||||||
|
+ LONGEST size;
|
||||||
|
} u;
|
||||||
|
+
|
||||||
|
+ /* Flags type. */
|
||||||
|
+ struct
|
||||||
|
+ {
|
||||||
|
+ VEC(tdesc_type_flag) *flags;
|
||||||
|
+ LONGEST size;
|
||||||
|
+ } f;
|
||||||
|
} u;
|
||||||
|
} *tdesc_type_p;
|
||||||
|
DEF_VEC_P(tdesc_type_p);
|
||||||
|
@@ -652,6 +670,66 @@ tdesc_gdb_type (struct gdbarch *gdbarch,
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ case TDESC_TYPE_STRUCT:
|
||||||
|
+ {
|
||||||
|
+ struct type *type, *field_type;
|
||||||
|
+ struct tdesc_type_field *f;
|
||||||
|
+ int ix;
|
||||||
|
+
|
||||||
|
+ type = arch_composite_type (gdbarch, NULL, TYPE_CODE_STRUCT);
|
||||||
|
+ TYPE_NAME (type) = xstrdup (tdesc_type->name);
|
||||||
|
+ TYPE_TAG_NAME (type) = TYPE_NAME (type);
|
||||||
|
+
|
||||||
|
+ for (ix = 0;
|
||||||
|
+ VEC_iterate (tdesc_type_field, tdesc_type->u.u.fields, ix, f);
|
||||||
|
+ ix++)
|
||||||
|
+ {
|
||||||
|
+ if (f->type == NULL)
|
||||||
|
+ {
|
||||||
|
+ /* Bitfield. */
|
||||||
|
+ struct field *fld;
|
||||||
|
+ struct type *field_type;
|
||||||
|
+ int bitsize, total_size;
|
||||||
|
+
|
||||||
|
+ /* This invariant should be preserved while creating
|
||||||
|
+ types. */
|
||||||
|
+ gdb_assert (tdesc_type->u.u.size != 0);
|
||||||
|
+ if (tdesc_type->u.u.size > 4)
|
||||||
|
+ field_type = builtin_type (gdbarch)->builtin_uint64;
|
||||||
|
+ else
|
||||||
|
+ field_type = builtin_type (gdbarch)->builtin_uint32;
|
||||||
|
+
|
||||||
|
+ fld = append_composite_type_field_raw (type, xstrdup (f->name),
|
||||||
|
+ field_type);
|
||||||
|
+
|
||||||
|
+ /* For little-endian, BITPOS counts from the LSB of
|
||||||
|
+ the structure and marks the LSB of the field. For
|
||||||
|
+ big-endian, BITPOS counts from the MSB of the
|
||||||
|
+ structure and marks the MSB of the field. Either
|
||||||
|
+ way, it is the number of bits to the "left" of the
|
||||||
|
+ field. To calculate this in big-endian, we need
|
||||||
|
+ the total size of the structure. */
|
||||||
|
+ bitsize = f->end - f->start + 1;
|
||||||
|
+ total_size = tdesc_type->u.u.size * TARGET_CHAR_BIT;
|
||||||
|
+ if (gdbarch_bits_big_endian (gdbarch))
|
||||||
|
+ FIELD_BITPOS (fld[0]) = total_size - f->start - bitsize;
|
||||||
|
+ else
|
||||||
|
+ FIELD_BITPOS (fld[0]) = f->start;
|
||||||
|
+ FIELD_BITSIZE (fld[0]) = bitsize;
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ field_type = tdesc_gdb_type (gdbarch, f->type);
|
||||||
|
+ append_composite_type_field (type, xstrdup (f->name),
|
||||||
|
+ field_type);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (tdesc_type->u.u.size != 0)
|
||||||
|
+ TYPE_LENGTH (type) = tdesc_type->u.u.size;
|
||||||
|
+ return type;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
case TDESC_TYPE_UNION:
|
||||||
|
{
|
||||||
|
struct type *type, *field_type;
|
||||||
|
@@ -668,12 +746,30 @@ tdesc_gdb_type (struct gdbarch *gdbarch,
|
||||||
|
field_type = tdesc_gdb_type (gdbarch, f->type);
|
||||||
|
append_composite_type_field (type, xstrdup (f->name), field_type);
|
||||||
|
|
||||||
|
- /* If any of the children of this union are vectors, flag the
|
||||||
|
+ /* If any of the children of a union are vectors, flag the
|
||||||
|
union as a vector also. This allows e.g. a union of two
|
||||||
|
vector types to show up automatically in "info vector". */
|
||||||
|
if (TYPE_VECTOR (field_type))
|
||||||
|
TYPE_VECTOR (type) = 1;
|
||||||
|
}
|
||||||
|
+ return type;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ case TDESC_TYPE_FLAGS:
|
||||||
|
+ {
|
||||||
|
+ struct type *type, *field_type;
|
||||||
|
+ struct tdesc_type_flag *f;
|
||||||
|
+ int ix;
|
||||||
|
+
|
||||||
|
+ type = arch_flags_type (gdbarch, xstrdup (tdesc_type->name),
|
||||||
|
+ tdesc_type->u.f.size);
|
||||||
|
+ for (ix = 0;
|
||||||
|
+ VEC_iterate (tdesc_type_flag, tdesc_type->u.f.flags, ix, f);
|
||||||
|
+ ix++)
|
||||||
|
+ /* Note that contrary to the function name, this call will
|
||||||
|
+ just set the properties of an already-allocated
|
||||||
|
+ field. */
|
||||||
|
+ append_flags_type_flag (type, f->start, f->name);
|
||||||
|
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
@@ -1161,6 +1257,7 @@ tdesc_free_type (struct tdesc_type *type
|
||||||
|
|
||||||
|
switch (type->kind)
|
||||||
|
{
|
||||||
|
+ case TDESC_TYPE_STRUCT:
|
||||||
|
case TDESC_TYPE_UNION:
|
||||||
|
{
|
||||||
|
struct tdesc_type_field *f;
|
||||||
|
@@ -1175,6 +1272,20 @@ tdesc_free_type (struct tdesc_type *type
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
+ case TDESC_TYPE_FLAGS:
|
||||||
|
+ {
|
||||||
|
+ struct tdesc_type_flag *f;
|
||||||
|
+ int ix;
|
||||||
|
+
|
||||||
|
+ for (ix = 0;
|
||||||
|
+ VEC_iterate (tdesc_type_flag, type->u.f.flags, ix, f);
|
||||||
|
+ ix++)
|
||||||
|
+ xfree (f->name);
|
||||||
|
+
|
||||||
|
+ VEC_free (tdesc_type_flag, type->u.f.flags);
|
||||||
|
+ }
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
@@ -1199,6 +1310,29 @@ tdesc_create_vector (struct tdesc_featur
|
||||||
|
}
|
||||||
|
|
||||||
|
struct tdesc_type *
|
||||||
|
+tdesc_create_struct (struct tdesc_feature *feature, const char *name)
|
||||||
|
+{
|
||||||
|
+ struct tdesc_type *type = XZALLOC (struct tdesc_type);
|
||||||
|
+
|
||||||
|
+ type->name = xstrdup (name);
|
||||||
|
+ type->kind = TDESC_TYPE_STRUCT;
|
||||||
|
+
|
||||||
|
+ VEC_safe_push (tdesc_type_p, feature->types, type);
|
||||||
|
+ return type;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/* Set the total length of TYPE. Structs which contain bitfields may
|
||||||
|
+ omit the reserved bits, so the end of the last field may not
|
||||||
|
+ suffice. */
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+tdesc_set_struct_size (struct tdesc_type *type, LONGEST size)
|
||||||
|
+{
|
||||||
|
+ gdb_assert (type->kind == TDESC_TYPE_STRUCT);
|
||||||
|
+ type->u.u.size = size;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+struct tdesc_type *
|
||||||
|
tdesc_create_union (struct tdesc_feature *feature, const char *name)
|
||||||
|
{
|
||||||
|
struct tdesc_type *type = XZALLOC (struct tdesc_type);
|
||||||
|
@@ -1210,13 +1344,32 @@ tdesc_create_union (struct tdesc_feature
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
|
||||||
|
+struct tdesc_type *
|
||||||
|
+tdesc_create_flags (struct tdesc_feature *feature, const char *name,
|
||||||
|
+ LONGEST size)
|
||||||
|
+{
|
||||||
|
+ struct tdesc_type *type = XZALLOC (struct tdesc_type);
|
||||||
|
+
|
||||||
|
+ type->name = xstrdup (name);
|
||||||
|
+ type->kind = TDESC_TYPE_FLAGS;
|
||||||
|
+ type->u.f.size = size;
|
||||||
|
+
|
||||||
|
+ VEC_safe_push (tdesc_type_p, feature->types, type);
|
||||||
|
+ return type;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/* Add a new field. Return a temporary pointer to the field, which
|
||||||
|
+ is only valid until the next call to tdesc_add_field (the vector
|
||||||
|
+ might be reallocated). */
|
||||||
|
+
|
||||||
|
void
|
||||||
|
tdesc_add_field (struct tdesc_type *type, const char *field_name,
|
||||||
|
struct tdesc_type *field_type)
|
||||||
|
{
|
||||||
|
struct tdesc_type_field f = { 0 };
|
||||||
|
|
||||||
|
- gdb_assert (type->kind == TDESC_TYPE_UNION);
|
||||||
|
+ gdb_assert (type->kind == TDESC_TYPE_UNION
|
||||||
|
+ || type->kind == TDESC_TYPE_STRUCT);
|
||||||
|
|
||||||
|
f.name = xstrdup (field_name);
|
||||||
|
f.type = field_type;
|
||||||
|
@@ -1224,6 +1377,37 @@ tdesc_add_field (struct tdesc_type *type
|
||||||
|
VEC_safe_push (tdesc_type_field, type->u.u.fields, &f);
|
||||||
|
}
|
||||||
|
|
||||||
|
+/* Add a new bitfield. */
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+tdesc_add_bitfield (struct tdesc_type *type, const char *field_name,
|
||||||
|
+ int start, int end)
|
||||||
|
+{
|
||||||
|
+ struct tdesc_type_field f = { 0 };
|
||||||
|
+
|
||||||
|
+ gdb_assert (type->kind == TDESC_TYPE_STRUCT);
|
||||||
|
+
|
||||||
|
+ f.name = xstrdup (field_name);
|
||||||
|
+ f.start = start;
|
||||||
|
+ f.end = end;
|
||||||
|
+
|
||||||
|
+ VEC_safe_push (tdesc_type_field, type->u.u.fields, &f);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+tdesc_add_flag (struct tdesc_type *type, int start,
|
||||||
|
+ const char *flag_name)
|
||||||
|
+{
|
||||||
|
+ struct tdesc_type_flag f = { 0 };
|
||||||
|
+
|
||||||
|
+ gdb_assert (type->kind == TDESC_TYPE_FLAGS);
|
||||||
|
+
|
||||||
|
+ f.name = xstrdup (flag_name);
|
||||||
|
+ f.start = start;
|
||||||
|
+
|
||||||
|
+ VEC_safe_push (tdesc_type_flag, type->u.f.flags, &f);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void
|
||||||
|
tdesc_free_feature (struct tdesc_feature *feature)
|
||||||
|
{
|
||||||
|
--- gdb-7.1-p0/gdb/target-descriptions.h 2010-02-10 19:45:03.000000000 +0100
|
||||||
|
+++ gdb-7.1/gdb/target-descriptions.h 2010-04-03 21:04:13.000000000 +0200
|
||||||
|
@@ -205,10 +205,20 @@ struct tdesc_type *tdesc_create_vector (
|
||||||
|
const char *name,
|
||||||
|
struct tdesc_type *field_type,
|
||||||
|
int count);
|
||||||
|
+struct tdesc_type *tdesc_create_struct (struct tdesc_feature *feature,
|
||||||
|
+ const char *name);
|
||||||
|
+void tdesc_set_struct_size (struct tdesc_type *type, LONGEST size);
|
||||||
|
struct tdesc_type *tdesc_create_union (struct tdesc_feature *feature,
|
||||||
|
const char *name);
|
||||||
|
+struct tdesc_type *tdesc_create_flags (struct tdesc_feature *feature,
|
||||||
|
+ const char *name,
|
||||||
|
+ LONGEST size);
|
||||||
|
void tdesc_add_field (struct tdesc_type *type, const char *field_name,
|
||||||
|
struct tdesc_type *field_type);
|
||||||
|
+void tdesc_add_bitfield (struct tdesc_type *type, const char *field_name,
|
||||||
|
+ int start, int end);
|
||||||
|
+void tdesc_add_flag (struct tdesc_type *type, int start,
|
||||||
|
+ const char *flag_name);
|
||||||
|
void tdesc_create_reg (struct tdesc_feature *feature, const char *name,
|
||||||
|
int regnum, int save_restore, const char *group,
|
||||||
|
int bitsize, const char *type);
|
||||||
|
--- gdb-7.1-p0/gdb/testsuite/gdb.xml/extra-regs.xml 2007-02-08 22:00:36.000000000 +0100
|
||||||
|
+++ gdb-7.1/gdb/testsuite/gdb.xml/extra-regs.xml 2010-04-03 21:04:13.000000000 +0200
|
||||||
|
@@ -8,9 +8,27 @@
|
||||||
|
<field name="v2" type="v2int16"/>
|
||||||
|
</union>
|
||||||
|
|
||||||
|
+ <struct id="struct1">
|
||||||
|
+ <field name="v4" type="v4int8"/>
|
||||||
|
+ <field name="v2" type="v2int16"/>
|
||||||
|
+ </struct>
|
||||||
|
+
|
||||||
|
+ <struct id="struct2" size="8">
|
||||||
|
+ <field name="f1" start="0" end="34"/>
|
||||||
|
+ <field name="f2" start="63" end="63"/>
|
||||||
|
+ </struct>
|
||||||
|
+
|
||||||
|
+ <flags id="flags" size="4">
|
||||||
|
+ <field name="X" start="0" end="0"/>
|
||||||
|
+ <field name="Y" start="2" end="2"/>
|
||||||
|
+ </flags>
|
||||||
|
+
|
||||||
|
<reg name="extrareg" bitsize="32"/>
|
||||||
|
<reg name="uintreg" bitsize="32" type="uint32"/>
|
||||||
|
<reg name="vecreg" bitsize="32" type="v4int8"/>
|
||||||
|
<reg name="unionreg" bitsize="32" type="vecint"/>
|
||||||
|
+ <reg name="structreg" bitsize="64" type="struct1"/>
|
||||||
|
+ <reg name="bitfields" bitsize="64" type="struct2"/>
|
||||||
|
+ <reg name="flags" bitsize="32" type="flags"/>
|
||||||
|
</feature>
|
||||||
|
</target>
|
||||||
|
--- gdb-7.1-p0/gdb/testsuite/gdb.xml/tdesc-regs.exp 2010-04-03 20:59:52.000000000 +0200
|
||||||
|
+++ gdb-7.1/gdb/testsuite/gdb.xml/tdesc-regs.exp 2010-04-03 21:04:13.000000000 +0200
|
||||||
|
@@ -141,6 +141,11 @@ gdb_test "ptype \$vecreg" "type = int8_t
|
||||||
|
gdb_test "ptype \$unionreg" \
|
||||||
|
"type = union {\r\n *v4int8 v4;\r\n *v2int16 v2;\r\n}"
|
||||||
|
gdb_test "ptype \$unionreg.v4" "type = int8_t \\\[4\\\]"
|
||||||
|
+gdb_test "ptype \$structreg" \
|
||||||
|
+ "type = struct struct1 {\r\n *v4int8 v4;\r\n *v2int16 v2;\r\n}"
|
||||||
|
+gdb_test "ptype \$structreg.v4" "type = int8_t \\\[4\\\]"
|
||||||
|
+gdb_test "ptype \$bitfields" \
|
||||||
|
+ "type = struct struct2 {\r\n *uint64_t f1 : 35;\r\n *uint64_t f2 : 1;\r\n}"
|
||||||
|
|
||||||
|
load_description "core-only.xml" ""
|
||||||
|
# The extra register from the previous description should be gone.
|
||||||
|
--- gdb-7.1-p0/gdb/xml-tdesc.c 2010-01-01 08:31:46.000000000 +0100
|
||||||
|
+++ gdb-7.1/gdb/xml-tdesc.c 2010-04-03 21:04:13.000000000 +0200
|
||||||
|
@@ -85,8 +85,15 @@ struct tdesc_parsing_data
|
||||||
|
it does not have its own. This starts at zero. */
|
||||||
|
int next_regnum;
|
||||||
|
|
||||||
|
- /* The union we are currently parsing, or last parsed. */
|
||||||
|
- struct tdesc_type *current_union;
|
||||||
|
+ /* The struct or union we are currently parsing, or last parsed. */
|
||||||
|
+ struct tdesc_type *current_type;
|
||||||
|
+
|
||||||
|
+ /* The byte size of the current struct type, if specified. Zero
|
||||||
|
+ if not specified. */
|
||||||
|
+ int current_type_size;
|
||||||
|
+
|
||||||
|
+ /* Whether the current type is a flags type. */
|
||||||
|
+ int current_type_is_flags;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Handle the end of an <architecture> element and its value. */
|
||||||
|
@@ -229,11 +236,57 @@ tdesc_start_union (struct gdb_xml_parser
|
||||||
|
struct tdesc_parsing_data *data = user_data;
|
||||||
|
char *id = VEC_index (gdb_xml_value_s, attributes, 0)->value;
|
||||||
|
|
||||||
|
- data->current_union = tdesc_create_union (data->current_feature, id);
|
||||||
|
+ data->current_type = tdesc_create_union (data->current_feature, id);
|
||||||
|
+ data->current_type_size = 0;
|
||||||
|
+ data->current_type_is_flags = 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+/* Handle the start of a <struct> element. Initialize the type and
|
||||||
|
+ record it with the current feature. */
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+tdesc_start_struct (struct gdb_xml_parser *parser,
|
||||||
|
+ const struct gdb_xml_element *element,
|
||||||
|
+ void *user_data, VEC(gdb_xml_value_s) *attributes)
|
||||||
|
+{
|
||||||
|
+ struct tdesc_parsing_data *data = user_data;
|
||||||
|
+ char *id = VEC_index (gdb_xml_value_s, attributes, 0)->value;
|
||||||
|
+ struct tdesc_type *type;
|
||||||
|
+
|
||||||
|
+ type = tdesc_create_struct (data->current_feature, id);
|
||||||
|
+ data->current_type = type;
|
||||||
|
+ data->current_type_size = 0;
|
||||||
|
+ data->current_type_is_flags = 0;
|
||||||
|
+
|
||||||
|
+ if (VEC_length (gdb_xml_value_s, attributes) > 1)
|
||||||
|
+ {
|
||||||
|
+ int size = (int) * (ULONGEST *)
|
||||||
|
+ VEC_index (gdb_xml_value_s, attributes, 1)->value;
|
||||||
|
+ tdesc_set_struct_size (type, size);
|
||||||
|
+ data->current_type_size = size;
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static void
|
||||||
|
+tdesc_start_flags (struct gdb_xml_parser *parser,
|
||||||
|
+ const struct gdb_xml_element *element,
|
||||||
|
+ void *user_data, VEC(gdb_xml_value_s) *attributes)
|
||||||
|
+{
|
||||||
|
+ struct tdesc_parsing_data *data = user_data;
|
||||||
|
+ char *id = VEC_index (gdb_xml_value_s, attributes, 0)->value;
|
||||||
|
+ int length = (int) * (ULONGEST *)
|
||||||
|
+ VEC_index (gdb_xml_value_s, attributes, 1)->value;
|
||||||
|
+ struct tdesc_type *type;
|
||||||
|
+
|
||||||
|
+ type = tdesc_create_flags (data->current_feature, id, length);
|
||||||
|
+
|
||||||
|
+ data->current_type = type;
|
||||||
|
+ data->current_type_size = 0;
|
||||||
|
+ data->current_type_is_flags = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Handle the start of a <field> element. Attach the field to the
|
||||||
|
- current union. */
|
||||||
|
+ current struct or union. */
|
||||||
|
|
||||||
|
static void
|
||||||
|
tdesc_start_field (struct gdb_xml_parser *parser,
|
||||||
|
@@ -241,20 +294,84 @@ tdesc_start_field (struct gdb_xml_parser
|
||||||
|
void *user_data, VEC(gdb_xml_value_s) *attributes)
|
||||||
|
{
|
||||||
|
struct tdesc_parsing_data *data = user_data;
|
||||||
|
+ int ix = 0, length;
|
||||||
|
struct gdb_xml_value *attrs = VEC_address (gdb_xml_value_s, attributes);
|
||||||
|
struct tdesc_type *field_type;
|
||||||
|
char *field_name, *field_type_id;
|
||||||
|
+ int start, end;
|
||||||
|
|
||||||
|
- field_name = attrs[0].value;
|
||||||
|
- field_type_id = attrs[1].value;
|
||||||
|
+ length = VEC_length (gdb_xml_value_s, attributes);
|
||||||
|
|
||||||
|
- field_type = tdesc_named_type (data->current_feature, field_type_id);
|
||||||
|
- if (field_type == NULL)
|
||||||
|
- gdb_xml_error (parser, _("Union field \"%s\" references undefined "
|
||||||
|
- "type \"%s\""),
|
||||||
|
- field_name, field_type_id);
|
||||||
|
+ field_name = attrs[ix++].value;
|
||||||
|
+
|
||||||
|
+ if (ix < length && strcmp (attrs[ix].name, "type") == 0)
|
||||||
|
+ field_type_id = attrs[ix++].value;
|
||||||
|
+ else
|
||||||
|
+ field_type_id = NULL;
|
||||||
|
+
|
||||||
|
+ if (ix < length && strcmp (attrs[ix].name, "start") == 0)
|
||||||
|
+ start = * (ULONGEST *) attrs[ix++].value;
|
||||||
|
+ else
|
||||||
|
+ start = -1;
|
||||||
|
+
|
||||||
|
+ if (ix < length && strcmp (attrs[ix].name, "end") == 0)
|
||||||
|
+ end = * (ULONGEST *) attrs[ix++].value;
|
||||||
|
+ else
|
||||||
|
+ end = -1;
|
||||||
|
+
|
||||||
|
+ if (field_type_id != NULL)
|
||||||
|
+ {
|
||||||
|
+ if (data->current_type_is_flags)
|
||||||
|
+ gdb_xml_error (parser, _("Cannot add typed field \"%s\" to flags"),
|
||||||
|
+ field_name);
|
||||||
|
+ if (data->current_type_size != 0)
|
||||||
|
+ gdb_xml_error (parser,
|
||||||
|
+ _("Explicitly sized type can not contain non-bitfield \"%s\""),
|
||||||
|
+ field_name);
|
||||||
|
+
|
||||||
|
+ field_type = tdesc_named_type (data->current_feature, field_type_id);
|
||||||
|
+ if (field_type == NULL)
|
||||||
|
+ gdb_xml_error (parser, _("Field \"%s\" references undefined "
|
||||||
|
+ "type \"%s\""),
|
||||||
|
+ field_name, field_type_id);
|
||||||
|
+
|
||||||
|
+ tdesc_add_field (data->current_type, field_name, field_type);
|
||||||
|
+ }
|
||||||
|
+ else if (start != -1 && end != -1)
|
||||||
|
+ {
|
||||||
|
+ struct tdesc_type *t = data->current_type;
|
||||||
|
+
|
||||||
|
+ if (data->current_type_is_flags)
|
||||||
|
+ tdesc_add_flag (t, start, field_name);
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ if (data->current_type_size == 0)
|
||||||
|
+ gdb_xml_error (parser,
|
||||||
|
+ _("Implicitly sized type can not contain bitfield \"%s\""),
|
||||||
|
+ field_name);
|
||||||
|
+
|
||||||
|
+ if (end >= 64)
|
||||||
|
+ gdb_xml_error (parser,
|
||||||
|
+ _("Bitfield \"%s\" goes past 64 bits (unsupported)"),
|
||||||
|
+ field_name);
|
||||||
|
+
|
||||||
|
+ /* Assume that the bit numbering in XML is "lsb-zero". Most
|
||||||
|
+ architectures other than PowerPC use this ordering. In
|
||||||
|
+ the future, we can add an XML tag to indicate "msb-zero"
|
||||||
|
+ numbering. */
|
||||||
|
+ if (start > end)
|
||||||
|
+ gdb_xml_error (parser, _("Bitfield \"%s\" has start after end"),
|
||||||
|
+ field_name);
|
||||||
|
|
||||||
|
- tdesc_add_field (data->current_union, field_name, field_type);
|
||||||
|
+ if (end >= data->current_type_size * TARGET_CHAR_BIT)
|
||||||
|
+ gdb_xml_error (parser, _("Bitfield \"%s\" does not fit in struct"));
|
||||||
|
+
|
||||||
|
+ tdesc_add_bitfield (t, field_name, start, end);
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ gdb_xml_error (parser, _("Field \"%s\" has neither type nor bit position"),
|
||||||
|
+ field_name);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Handle the start of a <vector> element. Initialize the type and
|
||||||
|
@@ -287,11 +404,13 @@ tdesc_start_vector (struct gdb_xml_parse
|
||||||
|
|
||||||
|
static const struct gdb_xml_attribute field_attributes[] = {
|
||||||
|
{ "name", GDB_XML_AF_NONE, NULL, NULL },
|
||||||
|
- { "type", GDB_XML_AF_NONE, NULL, NULL },
|
||||||
|
+ { "type", GDB_XML_AF_OPTIONAL, NULL, NULL },
|
||||||
|
+ { "start", GDB_XML_AF_OPTIONAL, gdb_xml_parse_attr_ulongest, NULL },
|
||||||
|
+ { "end", GDB_XML_AF_OPTIONAL, gdb_xml_parse_attr_ulongest, NULL },
|
||||||
|
{ NULL, GDB_XML_AF_NONE, NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
-static const struct gdb_xml_element union_children[] = {
|
||||||
|
+static const struct gdb_xml_element struct_union_children[] = {
|
||||||
|
{ "field", field_attributes, NULL, GDB_XML_EF_REPEATABLE,
|
||||||
|
tdesc_start_field, NULL },
|
||||||
|
{ NULL, NULL, NULL, GDB_XML_EF_NONE, NULL, NULL }
|
||||||
|
@@ -308,8 +427,15 @@ static const struct gdb_xml_attribute re
|
||||||
|
{ NULL, GDB_XML_AF_NONE, NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
-static const struct gdb_xml_attribute union_attributes[] = {
|
||||||
|
+static const struct gdb_xml_attribute struct_union_attributes[] = {
|
||||||
|
{ "id", GDB_XML_AF_NONE, NULL, NULL },
|
||||||
|
+ { "size", GDB_XML_AF_OPTIONAL, gdb_xml_parse_attr_ulongest, NULL},
|
||||||
|
+ { NULL, GDB_XML_AF_NONE, NULL, NULL }
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+static const struct gdb_xml_attribute flags_attributes[] = {
|
||||||
|
+ { "id", GDB_XML_AF_NONE, NULL, NULL },
|
||||||
|
+ { "size", GDB_XML_AF_NONE, gdb_xml_parse_attr_ulongest, NULL},
|
||||||
|
{ NULL, GDB_XML_AF_NONE, NULL, NULL }
|
||||||
|
};
|
||||||
|
|
||||||
|
@@ -329,9 +455,15 @@ static const struct gdb_xml_element feat
|
||||||
|
{ "reg", reg_attributes, NULL,
|
||||||
|
GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE,
|
||||||
|
tdesc_start_reg, NULL },
|
||||||
|
- { "union", union_attributes, union_children,
|
||||||
|
+ { "struct", struct_union_attributes, struct_union_children,
|
||||||
|
+ GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE,
|
||||||
|
+ tdesc_start_struct, NULL },
|
||||||
|
+ { "union", struct_union_attributes, struct_union_children,
|
||||||
|
GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE,
|
||||||
|
tdesc_start_union, NULL },
|
||||||
|
+ { "flags", flags_attributes, struct_union_children,
|
||||||
|
+ GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE,
|
||||||
|
+ tdesc_start_flags, NULL },
|
||||||
|
{ "vector", vector_attributes, NULL,
|
||||||
|
GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE,
|
||||||
|
tdesc_start_vector, NULL },
|
457
gdb-bz578250-avx-03of10.patch
Normal file
457
gdb-bz578250-avx-03of10.patch
Normal file
@ -0,0 +1,457 @@
|
|||||||
|
[ Backported. ]
|
||||||
|
|
||||||
|
commit 0257d639d42f896a359993ae8adb5792e280f65f
|
||||||
|
Author: H.J. Lu <hjl.tools@gmail.com>
|
||||||
|
Date: Mon Mar 1 17:26:02 2010 +0000
|
||||||
|
|
||||||
|
Remove TDESC_TYPE_I386_EFLAGS and TDESC_TYPE_I386_MXCSR.
|
||||||
|
|
||||||
|
2010-03-01 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* target-descriptions.c (tdesc_type): Remove
|
||||||
|
TDESC_TYPE_I386_EFLAGS and TDESC_TYPE_I386_MXCSR.
|
||||||
|
(tdesc_predefined_types): Likewise.
|
||||||
|
(tdesc_gdb_type): Likewise. Pass NULL to append_flags_type_flag
|
||||||
|
if flag name is empty.
|
||||||
|
(maint_print_c_tdesc_cmd): Handle TDESC_TYPE_FLAGS.
|
||||||
|
|
||||||
|
* features/i386/32bit-core.xml: Define i386_eflags.
|
||||||
|
* features/i386/64bit-core.xml: Likewise.
|
||||||
|
|
||||||
|
* features/i386/32bit-sse.xml: Define i386_mxcsr.
|
||||||
|
* features/i386/64bit-sse.xml: Likewise.
|
||||||
|
|
||||||
|
* features/i386/amd64-linux.c: Regenerated.
|
||||||
|
* features/i386/amd64.c: Likewise.
|
||||||
|
* features/i386/i386-linux.c: Likewise.
|
||||||
|
* features/i386/i386.c: Likewise.
|
||||||
|
|
||||||
|
--- gdb-7.1-p1/gdb/features/i386/32bit-core.xml 2010-02-08 06:08:46.000000000 +0100
|
||||||
|
+++ gdb-7.1/gdb/features/i386/32bit-core.xml 2010-04-03 21:06:12.000000000 +0200
|
||||||
|
@@ -7,6 +7,26 @@
|
||||||
|
|
||||||
|
<!DOCTYPE feature SYSTEM "gdb-target.dtd">
|
||||||
|
<feature name="org.gnu.gdb.i386.core">
|
||||||
|
+ <flags id="i386_eflags" size="4">
|
||||||
|
+ <field name="CF" start="0" end="0"/>
|
||||||
|
+ <field name="" start="1" end="1"/>
|
||||||
|
+ <field name="PF" start="2" end="2"/>
|
||||||
|
+ <field name="AF" start="4" end="4"/>
|
||||||
|
+ <field name="ZF" start="6" end="6"/>
|
||||||
|
+ <field name="SF" start="7" end="7"/>
|
||||||
|
+ <field name="TF" start="8" end="8"/>
|
||||||
|
+ <field name="IF" start="9" end="9"/>
|
||||||
|
+ <field name="DF" start="10" end="10"/>
|
||||||
|
+ <field name="OF" start="11" end="11"/>
|
||||||
|
+ <field name="NT" start="14" end="14"/>
|
||||||
|
+ <field name="RF" start="16" end="16"/>
|
||||||
|
+ <field name="VM" start="17" end="17"/>
|
||||||
|
+ <field name="AC" start="18" end="18"/>
|
||||||
|
+ <field name="VIF" start="19" end="19"/>
|
||||||
|
+ <field name="VIP" start="20" end="20"/>
|
||||||
|
+ <field name="ID" start="21" end="21"/>
|
||||||
|
+ </flags>
|
||||||
|
+
|
||||||
|
<reg name="eax" bitsize="32" type="int32"/>
|
||||||
|
<reg name="ecx" bitsize="32" type="int32"/>
|
||||||
|
<reg name="edx" bitsize="32" type="int32"/>
|
||||||
|
--- gdb-7.1-p1/gdb/features/i386/32bit-sse.xml 2010-02-08 06:08:46.000000000 +0100
|
||||||
|
+++ gdb-7.1/gdb/features/i386/32bit-sse.xml 2010-04-03 21:06:12.000000000 +0200
|
||||||
|
@@ -22,6 +22,22 @@
|
||||||
|
<field name="v2_int64" type="v2i64"/>
|
||||||
|
<field name="uint128" type="uint128"/>
|
||||||
|
</union>
|
||||||
|
+ <flags id="i386_mxcsr" size="4">
|
||||||
|
+ <field name="IE" start="0" end="0"/>
|
||||||
|
+ <field name="DE" start="1" end="1"/>
|
||||||
|
+ <field name="ZE" start="2" end="2"/>
|
||||||
|
+ <field name="OE" start="3" end="3"/>
|
||||||
|
+ <field name="UE" start="4" end="4"/>
|
||||||
|
+ <field name="PE" start="5" end="5"/>
|
||||||
|
+ <field name="DAZ" start="6" end="6"/>
|
||||||
|
+ <field name="IM" start="7" end="7"/>
|
||||||
|
+ <field name="DM" start="8" end="8"/>
|
||||||
|
+ <field name="ZM" start="9" end="9"/>
|
||||||
|
+ <field name="OM" start="10" end="10"/>
|
||||||
|
+ <field name="UM" start="11" end="11"/>
|
||||||
|
+ <field name="PM" start="12" end="12"/>
|
||||||
|
+ <field name="FZ" start="15" end="15"/>
|
||||||
|
+ </flags>
|
||||||
|
|
||||||
|
<reg name="xmm0" bitsize="128" type="vec128" regnum="32"/>
|
||||||
|
<reg name="xmm1" bitsize="128" type="vec128"/>
|
||||||
|
--- gdb-7.1-p1/gdb/features/i386/64bit-core.xml 2010-02-08 06:08:46.000000000 +0100
|
||||||
|
+++ gdb-7.1/gdb/features/i386/64bit-core.xml 2010-04-03 21:06:12.000000000 +0200
|
||||||
|
@@ -7,6 +7,26 @@
|
||||||
|
|
||||||
|
<!DOCTYPE feature SYSTEM "gdb-target.dtd">
|
||||||
|
<feature name="org.gnu.gdb.i386.core">
|
||||||
|
+ <flags id="i386_eflags" size="4">
|
||||||
|
+ <field name="CF" start="0" end="0"/>
|
||||||
|
+ <field name="" start="1" end="1"/>
|
||||||
|
+ <field name="PF" start="2" end="2"/>
|
||||||
|
+ <field name="AF" start="4" end="4"/>
|
||||||
|
+ <field name="ZF" start="6" end="6"/>
|
||||||
|
+ <field name="SF" start="7" end="7"/>
|
||||||
|
+ <field name="TF" start="8" end="8"/>
|
||||||
|
+ <field name="IF" start="9" end="9"/>
|
||||||
|
+ <field name="DF" start="10" end="10"/>
|
||||||
|
+ <field name="OF" start="11" end="11"/>
|
||||||
|
+ <field name="NT" start="14" end="14"/>
|
||||||
|
+ <field name="RF" start="16" end="16"/>
|
||||||
|
+ <field name="VM" start="17" end="17"/>
|
||||||
|
+ <field name="AC" start="18" end="18"/>
|
||||||
|
+ <field name="VIF" start="19" end="19"/>
|
||||||
|
+ <field name="VIP" start="20" end="20"/>
|
||||||
|
+ <field name="ID" start="21" end="21"/>
|
||||||
|
+ </flags>
|
||||||
|
+
|
||||||
|
<reg name="rax" bitsize="64" type="int64"/>
|
||||||
|
<reg name="rbx" bitsize="64" type="int64"/>
|
||||||
|
<reg name="rcx" bitsize="64" type="int64"/>
|
||||||
|
--- gdb-7.1-p1/gdb/features/i386/64bit-sse.xml 2010-02-08 06:08:46.000000000 +0100
|
||||||
|
+++ gdb-7.1/gdb/features/i386/64bit-sse.xml 2010-04-03 21:06:12.000000000 +0200
|
||||||
|
@@ -22,6 +22,22 @@
|
||||||
|
<field name="v2_int64" type="v2i64"/>
|
||||||
|
<field name="uint128" type="uint128"/>
|
||||||
|
</union>
|
||||||
|
+ <flags id="i386_mxcsr" size="4">
|
||||||
|
+ <field name="IE" start="0" end="0"/>
|
||||||
|
+ <field name="DE" start="1" end="1"/>
|
||||||
|
+ <field name="ZE" start="2" end="2"/>
|
||||||
|
+ <field name="OE" start="3" end="3"/>
|
||||||
|
+ <field name="UE" start="4" end="4"/>
|
||||||
|
+ <field name="PE" start="5" end="5"/>
|
||||||
|
+ <field name="DAZ" start="6" end="6"/>
|
||||||
|
+ <field name="IM" start="7" end="7"/>
|
||||||
|
+ <field name="DM" start="8" end="8"/>
|
||||||
|
+ <field name="ZM" start="9" end="9"/>
|
||||||
|
+ <field name="OM" start="10" end="10"/>
|
||||||
|
+ <field name="UM" start="11" end="11"/>
|
||||||
|
+ <field name="PM" start="12" end="12"/>
|
||||||
|
+ <field name="FZ" start="15" end="15"/>
|
||||||
|
+ </flags>
|
||||||
|
|
||||||
|
<reg name="xmm0" bitsize="128" type="vec128" regnum="40"/>
|
||||||
|
<reg name="xmm1" bitsize="128" type="vec128"/>
|
||||||
|
--- gdb-7.1-p1/gdb/features/i386/amd64-linux.c 2010-02-08 06:08:46.000000000 +0100
|
||||||
|
+++ gdb-7.1/gdb/features/i386/amd64-linux.c 2010-04-03 21:06:12.000000000 +0200
|
||||||
|
@@ -17,6 +17,25 @@ initialize_tdesc_amd64_linux (void)
|
||||||
|
set_tdesc_osabi (result, osabi_from_tdesc_string ("GNU/Linux"));
|
||||||
|
|
||||||
|
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
|
||||||
|
+ field_type = tdesc_create_flags (feature, "i386_eflags", 4);
|
||||||
|
+ tdesc_add_flag (field_type, 0, "CF");
|
||||||
|
+ tdesc_add_flag (field_type, 1, "");
|
||||||
|
+ tdesc_add_flag (field_type, 2, "PF");
|
||||||
|
+ tdesc_add_flag (field_type, 4, "AF");
|
||||||
|
+ tdesc_add_flag (field_type, 6, "ZF");
|
||||||
|
+ tdesc_add_flag (field_type, 7, "SF");
|
||||||
|
+ tdesc_add_flag (field_type, 8, "TF");
|
||||||
|
+ tdesc_add_flag (field_type, 9, "IF");
|
||||||
|
+ tdesc_add_flag (field_type, 10, "DF");
|
||||||
|
+ tdesc_add_flag (field_type, 11, "OF");
|
||||||
|
+ tdesc_add_flag (field_type, 14, "NT");
|
||||||
|
+ tdesc_add_flag (field_type, 16, "RF");
|
||||||
|
+ tdesc_add_flag (field_type, 17, "VM");
|
||||||
|
+ tdesc_add_flag (field_type, 18, "AC");
|
||||||
|
+ tdesc_add_flag (field_type, 19, "VIF");
|
||||||
|
+ tdesc_add_flag (field_type, 20, "VIP");
|
||||||
|
+ tdesc_add_flag (field_type, 21, "ID");
|
||||||
|
+
|
||||||
|
tdesc_create_reg (feature, "rax", 0, 1, NULL, 64, "int64");
|
||||||
|
tdesc_create_reg (feature, "rbx", 1, 1, NULL, 64, "int64");
|
||||||
|
tdesc_create_reg (feature, "rcx", 2, 1, NULL, 64, "int64");
|
||||||
|
@@ -93,6 +112,22 @@ initialize_tdesc_amd64_linux (void)
|
||||||
|
field_type = tdesc_named_type (feature, "uint128");
|
||||||
|
tdesc_add_field (type, "uint128", field_type);
|
||||||
|
|
||||||
|
+ field_type = tdesc_create_flags (feature, "i386_mxcsr", 4);
|
||||||
|
+ tdesc_add_flag (field_type, 0, "IE");
|
||||||
|
+ tdesc_add_flag (field_type, 1, "DE");
|
||||||
|
+ tdesc_add_flag (field_type, 2, "ZE");
|
||||||
|
+ tdesc_add_flag (field_type, 3, "OE");
|
||||||
|
+ tdesc_add_flag (field_type, 4, "UE");
|
||||||
|
+ tdesc_add_flag (field_type, 5, "PE");
|
||||||
|
+ tdesc_add_flag (field_type, 6, "DAZ");
|
||||||
|
+ tdesc_add_flag (field_type, 7, "IM");
|
||||||
|
+ tdesc_add_flag (field_type, 8, "DM");
|
||||||
|
+ tdesc_add_flag (field_type, 9, "ZM");
|
||||||
|
+ tdesc_add_flag (field_type, 10, "OM");
|
||||||
|
+ tdesc_add_flag (field_type, 11, "UM");
|
||||||
|
+ tdesc_add_flag (field_type, 12, "PM");
|
||||||
|
+ tdesc_add_flag (field_type, 15, "FZ");
|
||||||
|
+
|
||||||
|
tdesc_create_reg (feature, "xmm0", 40, 1, NULL, 128, "vec128");
|
||||||
|
tdesc_create_reg (feature, "xmm1", 41, 1, NULL, 128, "vec128");
|
||||||
|
tdesc_create_reg (feature, "xmm2", 42, 1, NULL, 128, "vec128");
|
||||||
|
--- gdb-7.1-p1/gdb/features/i386/amd64.c 2010-02-08 06:08:46.000000000 +0100
|
||||||
|
+++ gdb-7.1/gdb/features/i386/amd64.c 2010-04-03 21:06:12.000000000 +0200
|
||||||
|
@@ -15,6 +15,25 @@ initialize_tdesc_amd64 (void)
|
||||||
|
set_tdesc_architecture (result, bfd_scan_arch ("i386:x86-64"));
|
||||||
|
|
||||||
|
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
|
||||||
|
+ field_type = tdesc_create_flags (feature, "i386_eflags", 4);
|
||||||
|
+ tdesc_add_flag (field_type, 0, "CF");
|
||||||
|
+ tdesc_add_flag (field_type, 1, "");
|
||||||
|
+ tdesc_add_flag (field_type, 2, "PF");
|
||||||
|
+ tdesc_add_flag (field_type, 4, "AF");
|
||||||
|
+ tdesc_add_flag (field_type, 6, "ZF");
|
||||||
|
+ tdesc_add_flag (field_type, 7, "SF");
|
||||||
|
+ tdesc_add_flag (field_type, 8, "TF");
|
||||||
|
+ tdesc_add_flag (field_type, 9, "IF");
|
||||||
|
+ tdesc_add_flag (field_type, 10, "DF");
|
||||||
|
+ tdesc_add_flag (field_type, 11, "OF");
|
||||||
|
+ tdesc_add_flag (field_type, 14, "NT");
|
||||||
|
+ tdesc_add_flag (field_type, 16, "RF");
|
||||||
|
+ tdesc_add_flag (field_type, 17, "VM");
|
||||||
|
+ tdesc_add_flag (field_type, 18, "AC");
|
||||||
|
+ tdesc_add_flag (field_type, 19, "VIF");
|
||||||
|
+ tdesc_add_flag (field_type, 20, "VIP");
|
||||||
|
+ tdesc_add_flag (field_type, 21, "ID");
|
||||||
|
+
|
||||||
|
tdesc_create_reg (feature, "rax", 0, 1, NULL, 64, "int64");
|
||||||
|
tdesc_create_reg (feature, "rbx", 1, 1, NULL, 64, "int64");
|
||||||
|
tdesc_create_reg (feature, "rcx", 2, 1, NULL, 64, "int64");
|
||||||
|
@@ -91,6 +110,22 @@ initialize_tdesc_amd64 (void)
|
||||||
|
field_type = tdesc_named_type (feature, "uint128");
|
||||||
|
tdesc_add_field (type, "uint128", field_type);
|
||||||
|
|
||||||
|
+ field_type = tdesc_create_flags (feature, "i386_mxcsr", 4);
|
||||||
|
+ tdesc_add_flag (field_type, 0, "IE");
|
||||||
|
+ tdesc_add_flag (field_type, 1, "DE");
|
||||||
|
+ tdesc_add_flag (field_type, 2, "ZE");
|
||||||
|
+ tdesc_add_flag (field_type, 3, "OE");
|
||||||
|
+ tdesc_add_flag (field_type, 4, "UE");
|
||||||
|
+ tdesc_add_flag (field_type, 5, "PE");
|
||||||
|
+ tdesc_add_flag (field_type, 6, "DAZ");
|
||||||
|
+ tdesc_add_flag (field_type, 7, "IM");
|
||||||
|
+ tdesc_add_flag (field_type, 8, "DM");
|
||||||
|
+ tdesc_add_flag (field_type, 9, "ZM");
|
||||||
|
+ tdesc_add_flag (field_type, 10, "OM");
|
||||||
|
+ tdesc_add_flag (field_type, 11, "UM");
|
||||||
|
+ tdesc_add_flag (field_type, 12, "PM");
|
||||||
|
+ tdesc_add_flag (field_type, 15, "FZ");
|
||||||
|
+
|
||||||
|
tdesc_create_reg (feature, "xmm0", 40, 1, NULL, 128, "vec128");
|
||||||
|
tdesc_create_reg (feature, "xmm1", 41, 1, NULL, 128, "vec128");
|
||||||
|
tdesc_create_reg (feature, "xmm2", 42, 1, NULL, 128, "vec128");
|
||||||
|
--- gdb-7.1-p1/gdb/features/i386/i386-linux.c 2010-02-08 06:08:46.000000000 +0100
|
||||||
|
+++ gdb-7.1/gdb/features/i386/i386-linux.c 2010-04-03 21:06:12.000000000 +0200
|
||||||
|
@@ -17,6 +17,25 @@ initialize_tdesc_i386_linux (void)
|
||||||
|
set_tdesc_osabi (result, osabi_from_tdesc_string ("GNU/Linux"));
|
||||||
|
|
||||||
|
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
|
||||||
|
+ field_type = tdesc_create_flags (feature, "i386_eflags", 4);
|
||||||
|
+ tdesc_add_flag (field_type, 0, "CF");
|
||||||
|
+ tdesc_add_flag (field_type, 1, "");
|
||||||
|
+ tdesc_add_flag (field_type, 2, "PF");
|
||||||
|
+ tdesc_add_flag (field_type, 4, "AF");
|
||||||
|
+ tdesc_add_flag (field_type, 6, "ZF");
|
||||||
|
+ tdesc_add_flag (field_type, 7, "SF");
|
||||||
|
+ tdesc_add_flag (field_type, 8, "TF");
|
||||||
|
+ tdesc_add_flag (field_type, 9, "IF");
|
||||||
|
+ tdesc_add_flag (field_type, 10, "DF");
|
||||||
|
+ tdesc_add_flag (field_type, 11, "OF");
|
||||||
|
+ tdesc_add_flag (field_type, 14, "NT");
|
||||||
|
+ tdesc_add_flag (field_type, 16, "RF");
|
||||||
|
+ tdesc_add_flag (field_type, 17, "VM");
|
||||||
|
+ tdesc_add_flag (field_type, 18, "AC");
|
||||||
|
+ tdesc_add_flag (field_type, 19, "VIF");
|
||||||
|
+ tdesc_add_flag (field_type, 20, "VIP");
|
||||||
|
+ tdesc_add_flag (field_type, 21, "ID");
|
||||||
|
+
|
||||||
|
tdesc_create_reg (feature, "eax", 0, 1, NULL, 32, "int32");
|
||||||
|
tdesc_create_reg (feature, "ecx", 1, 1, NULL, 32, "int32");
|
||||||
|
tdesc_create_reg (feature, "edx", 2, 1, NULL, 32, "int32");
|
||||||
|
@@ -88,6 +107,22 @@ initialize_tdesc_i386_linux (void)
|
||||||
|
field_type = tdesc_named_type (feature, "uint128");
|
||||||
|
tdesc_add_field (type, "uint128", field_type);
|
||||||
|
|
||||||
|
+ field_type = tdesc_create_flags (feature, "i386_mxcsr", 4);
|
||||||
|
+ tdesc_add_flag (field_type, 0, "IE");
|
||||||
|
+ tdesc_add_flag (field_type, 1, "DE");
|
||||||
|
+ tdesc_add_flag (field_type, 2, "ZE");
|
||||||
|
+ tdesc_add_flag (field_type, 3, "OE");
|
||||||
|
+ tdesc_add_flag (field_type, 4, "UE");
|
||||||
|
+ tdesc_add_flag (field_type, 5, "PE");
|
||||||
|
+ tdesc_add_flag (field_type, 6, "DAZ");
|
||||||
|
+ tdesc_add_flag (field_type, 7, "IM");
|
||||||
|
+ tdesc_add_flag (field_type, 8, "DM");
|
||||||
|
+ tdesc_add_flag (field_type, 9, "ZM");
|
||||||
|
+ tdesc_add_flag (field_type, 10, "OM");
|
||||||
|
+ tdesc_add_flag (field_type, 11, "UM");
|
||||||
|
+ tdesc_add_flag (field_type, 12, "PM");
|
||||||
|
+ tdesc_add_flag (field_type, 15, "FZ");
|
||||||
|
+
|
||||||
|
tdesc_create_reg (feature, "xmm0", 32, 1, NULL, 128, "vec128");
|
||||||
|
tdesc_create_reg (feature, "xmm1", 33, 1, NULL, 128, "vec128");
|
||||||
|
tdesc_create_reg (feature, "xmm2", 34, 1, NULL, 128, "vec128");
|
||||||
|
--- gdb-7.1-p1/gdb/features/i386/i386.c 2010-02-08 06:08:46.000000000 +0100
|
||||||
|
+++ gdb-7.1/gdb/features/i386/i386.c 2010-04-03 21:06:12.000000000 +0200
|
||||||
|
@@ -15,6 +15,25 @@ initialize_tdesc_i386 (void)
|
||||||
|
set_tdesc_architecture (result, bfd_scan_arch ("i386"));
|
||||||
|
|
||||||
|
feature = tdesc_create_feature (result, "org.gnu.gdb.i386.core");
|
||||||
|
+ field_type = tdesc_create_flags (feature, "i386_eflags", 4);
|
||||||
|
+ tdesc_add_flag (field_type, 0, "CF");
|
||||||
|
+ tdesc_add_flag (field_type, 1, "");
|
||||||
|
+ tdesc_add_flag (field_type, 2, "PF");
|
||||||
|
+ tdesc_add_flag (field_type, 4, "AF");
|
||||||
|
+ tdesc_add_flag (field_type, 6, "ZF");
|
||||||
|
+ tdesc_add_flag (field_type, 7, "SF");
|
||||||
|
+ tdesc_add_flag (field_type, 8, "TF");
|
||||||
|
+ tdesc_add_flag (field_type, 9, "IF");
|
||||||
|
+ tdesc_add_flag (field_type, 10, "DF");
|
||||||
|
+ tdesc_add_flag (field_type, 11, "OF");
|
||||||
|
+ tdesc_add_flag (field_type, 14, "NT");
|
||||||
|
+ tdesc_add_flag (field_type, 16, "RF");
|
||||||
|
+ tdesc_add_flag (field_type, 17, "VM");
|
||||||
|
+ tdesc_add_flag (field_type, 18, "AC");
|
||||||
|
+ tdesc_add_flag (field_type, 19, "VIF");
|
||||||
|
+ tdesc_add_flag (field_type, 20, "VIP");
|
||||||
|
+ tdesc_add_flag (field_type, 21, "ID");
|
||||||
|
+
|
||||||
|
tdesc_create_reg (feature, "eax", 0, 1, NULL, 32, "int32");
|
||||||
|
tdesc_create_reg (feature, "ecx", 1, 1, NULL, 32, "int32");
|
||||||
|
tdesc_create_reg (feature, "edx", 2, 1, NULL, 32, "int32");
|
||||||
|
@@ -83,6 +102,22 @@ initialize_tdesc_i386 (void)
|
||||||
|
field_type = tdesc_named_type (feature, "uint128");
|
||||||
|
tdesc_add_field (type, "uint128", field_type);
|
||||||
|
|
||||||
|
+ field_type = tdesc_create_flags (feature, "i386_mxcsr", 4);
|
||||||
|
+ tdesc_add_flag (field_type, 0, "IE");
|
||||||
|
+ tdesc_add_flag (field_type, 1, "DE");
|
||||||
|
+ tdesc_add_flag (field_type, 2, "ZE");
|
||||||
|
+ tdesc_add_flag (field_type, 3, "OE");
|
||||||
|
+ tdesc_add_flag (field_type, 4, "UE");
|
||||||
|
+ tdesc_add_flag (field_type, 5, "PE");
|
||||||
|
+ tdesc_add_flag (field_type, 6, "DAZ");
|
||||||
|
+ tdesc_add_flag (field_type, 7, "IM");
|
||||||
|
+ tdesc_add_flag (field_type, 8, "DM");
|
||||||
|
+ tdesc_add_flag (field_type, 9, "ZM");
|
||||||
|
+ tdesc_add_flag (field_type, 10, "OM");
|
||||||
|
+ tdesc_add_flag (field_type, 11, "UM");
|
||||||
|
+ tdesc_add_flag (field_type, 12, "PM");
|
||||||
|
+ tdesc_add_flag (field_type, 15, "FZ");
|
||||||
|
+
|
||||||
|
tdesc_create_reg (feature, "xmm0", 32, 1, NULL, 128, "vec128");
|
||||||
|
tdesc_create_reg (feature, "xmm1", 33, 1, NULL, 128, "vec128");
|
||||||
|
tdesc_create_reg (feature, "xmm2", 34, 1, NULL, 128, "vec128");
|
||||||
|
--- gdb-7.1-p1/gdb/target-descriptions.c 2010-04-03 21:04:13.000000000 +0200
|
||||||
|
+++ gdb-7.1/gdb/target-descriptions.c 2010-04-03 21:06:12.000000000 +0200
|
||||||
|
@@ -126,8 +126,6 @@ typedef struct tdesc_type
|
||||||
|
TDESC_TYPE_IEEE_DOUBLE,
|
||||||
|
TDESC_TYPE_ARM_FPA_EXT,
|
||||||
|
TDESC_TYPE_I387_EXT,
|
||||||
|
- TDESC_TYPE_I386_EFLAGS,
|
||||||
|
- TDESC_TYPE_I386_MXCSR,
|
||||||
|
|
||||||
|
/* Types defined by a target feature. */
|
||||||
|
TDESC_TYPE_VECTOR,
|
||||||
|
@@ -483,9 +481,7 @@ static struct tdesc_type tdesc_predefine
|
||||||
|
{ "ieee_single", TDESC_TYPE_IEEE_SINGLE },
|
||||||
|
{ "ieee_double", TDESC_TYPE_IEEE_DOUBLE },
|
||||||
|
{ "arm_fpa_ext", TDESC_TYPE_ARM_FPA_EXT },
|
||||||
|
- { "i387_ext", TDESC_TYPE_I387_EXT },
|
||||||
|
- { "i386_eflags", TDESC_TYPE_I386_EFLAGS },
|
||||||
|
- { "i386_mxcsr", TDESC_TYPE_I386_MXCSR }
|
||||||
|
+ { "i387_ext", TDESC_TYPE_I387_EXT }
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Return the type associated with ID in the context of FEATURE, or
|
||||||
|
@@ -607,57 +603,6 @@ tdesc_gdb_type (struct gdbarch *gdbarch,
|
||||||
|
return arch_float_type (gdbarch, -1, "builtin_type_i387_ext",
|
||||||
|
floatformats_i387_ext);
|
||||||
|
|
||||||
|
- case TDESC_TYPE_I386_EFLAGS:
|
||||||
|
- {
|
||||||
|
- struct type *type;
|
||||||
|
-
|
||||||
|
- type = arch_flags_type (gdbarch, "builtin_type_i386_eflags", 4);
|
||||||
|
- append_flags_type_flag (type, 0, "CF");
|
||||||
|
- append_flags_type_flag (type, 1, NULL);
|
||||||
|
- append_flags_type_flag (type, 2, "PF");
|
||||||
|
- append_flags_type_flag (type, 4, "AF");
|
||||||
|
- append_flags_type_flag (type, 6, "ZF");
|
||||||
|
- append_flags_type_flag (type, 7, "SF");
|
||||||
|
- append_flags_type_flag (type, 8, "TF");
|
||||||
|
- append_flags_type_flag (type, 9, "IF");
|
||||||
|
- append_flags_type_flag (type, 10, "DF");
|
||||||
|
- append_flags_type_flag (type, 11, "OF");
|
||||||
|
- append_flags_type_flag (type, 14, "NT");
|
||||||
|
- append_flags_type_flag (type, 16, "RF");
|
||||||
|
- append_flags_type_flag (type, 17, "VM");
|
||||||
|
- append_flags_type_flag (type, 18, "AC");
|
||||||
|
- append_flags_type_flag (type, 19, "VIF");
|
||||||
|
- append_flags_type_flag (type, 20, "VIP");
|
||||||
|
- append_flags_type_flag (type, 21, "ID");
|
||||||
|
-
|
||||||
|
- return type;
|
||||||
|
- }
|
||||||
|
- break;
|
||||||
|
-
|
||||||
|
- case TDESC_TYPE_I386_MXCSR:
|
||||||
|
- {
|
||||||
|
- struct type *type;
|
||||||
|
-
|
||||||
|
- type = arch_flags_type (gdbarch, "builtin_type_i386_mxcsr", 4);
|
||||||
|
- append_flags_type_flag (type, 0, "IE");
|
||||||
|
- append_flags_type_flag (type, 1, "DE");
|
||||||
|
- append_flags_type_flag (type, 2, "ZE");
|
||||||
|
- append_flags_type_flag (type, 3, "OE");
|
||||||
|
- append_flags_type_flag (type, 4, "UE");
|
||||||
|
- append_flags_type_flag (type, 5, "PE");
|
||||||
|
- append_flags_type_flag (type, 6, "DAZ");
|
||||||
|
- append_flags_type_flag (type, 7, "IM");
|
||||||
|
- append_flags_type_flag (type, 8, "DM");
|
||||||
|
- append_flags_type_flag (type, 9, "ZM");
|
||||||
|
- append_flags_type_flag (type, 10, "OM");
|
||||||
|
- append_flags_type_flag (type, 11, "UM");
|
||||||
|
- append_flags_type_flag (type, 12, "PM");
|
||||||
|
- append_flags_type_flag (type, 15, "FZ");
|
||||||
|
-
|
||||||
|
- return type;
|
||||||
|
- }
|
||||||
|
- break;
|
||||||
|
-
|
||||||
|
/* Types defined by a target feature. */
|
||||||
|
case TDESC_TYPE_VECTOR:
|
||||||
|
{
|
||||||
|
@@ -769,7 +714,8 @@ tdesc_gdb_type (struct gdbarch *gdbarch,
|
||||||
|
/* Note that contrary to the function name, this call will
|
||||||
|
just set the properties of an already-allocated
|
||||||
|
field. */
|
||||||
|
- append_flags_type_flag (type, f->start, f->name);
|
||||||
|
+ append_flags_type_flag (type, f->start,
|
||||||
|
+ *f->name ? f->name : NULL);
|
||||||
|
|
||||||
|
return type;
|
||||||
|
}
|
||||||
|
@@ -1602,6 +1548,7 @@ maint_print_c_tdesc_cmd (char *args, int
|
||||||
|
struct tdesc_reg *reg;
|
||||||
|
struct tdesc_type *type;
|
||||||
|
struct tdesc_type_field *f;
|
||||||
|
+ struct tdesc_type_flag *flag;
|
||||||
|
int ix, ix2, ix3;
|
||||||
|
|
||||||
|
/* Use the global target-supplied description, not the current
|
||||||
|
@@ -1715,6 +1662,18 @@ maint_print_c_tdesc_cmd (char *args, int
|
||||||
|
f->name);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
+ case TDESC_TYPE_FLAGS:
|
||||||
|
+ printf_unfiltered
|
||||||
|
+ (" field_type = tdesc_create_flags (feature, \"%s\", %d);\n",
|
||||||
|
+ type->name, (int) type->u.f.size);
|
||||||
|
+ for (ix3 = 0;
|
||||||
|
+ VEC_iterate (tdesc_type_flag, type->u.f.flags, ix3,
|
||||||
|
+ flag);
|
||||||
|
+ ix3++)
|
||||||
|
+ printf_unfiltered
|
||||||
|
+ (" tdesc_add_flag (field_type, %d, \"%s\");\n",
|
||||||
|
+ flag->start, flag->name);
|
||||||
|
+ break;
|
||||||
|
default:
|
||||||
|
error (_("C output is not supported type \"%s\"."), type->name);
|
||||||
|
}
|
1366
gdb-bz578250-avx-04of10.patch
Normal file
1366
gdb-bz578250-avx-04of10.patch
Normal file
File diff suppressed because it is too large
Load Diff
30
gdb-bz578250-avx-05of10.patch
Normal file
30
gdb-bz578250-avx-05of10.patch
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
[ Backported. ]
|
||||||
|
|
||||||
|
commit 6448aace637843e8e7c021d7f8c5d5d5fdd71974
|
||||||
|
Author: H.J. Lu <hjl.tools@gmail.com>
|
||||||
|
Date: Wed Mar 3 20:19:48 2010 +0000
|
||||||
|
|
||||||
|
Mention improvement for X86 general purpose registers.
|
||||||
|
|
||||||
|
2010-03-03 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
Eli Zaretskii <eliz@gnu.org>
|
||||||
|
|
||||||
|
* NEWS: Add X86 general purpose registers section.
|
||||||
|
|
||||||
|
--- gdb-7.1-p3/gdb/NEWS 2010-03-18 22:01:55.000000000 +0100
|
||||||
|
+++ gdb-7.1/gdb/NEWS 2010-04-03 21:07:46.000000000 +0200
|
||||||
|
@@ -438,6 +438,14 @@ GDB will now correctly handle all of:
|
||||||
|
now support hardware watchpoints, and will use them automatically
|
||||||
|
as appropriate.
|
||||||
|
|
||||||
|
+* X86 general purpose registers
|
||||||
|
+
|
||||||
|
+ GDB now supports reading/writing byte, word and double-word x86
|
||||||
|
+ general purpose registers directly. This means you can use, say,
|
||||||
|
+ $ah or $ax to refer, respectively, to the byte register AH and
|
||||||
|
+ 16-bit word register AX that are actually portions of the 32-bit
|
||||||
|
+ register EAX or 64-bit register RAX.
|
||||||
|
+
|
||||||
|
* Python scripting
|
||||||
|
|
||||||
|
GDB now has support for scripting using Python. Whether this is
|
35
gdb-bz578250-avx-06of10.patch
Normal file
35
gdb-bz578250-avx-06of10.patch
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
[ Backported. ]
|
||||||
|
|
||||||
|
commit 49f8d1c24c639d891f58a3b9feda425833b702fb
|
||||||
|
Author: H.J. Lu <hjl.tools@gmail.com>
|
||||||
|
Date: Fri Mar 12 15:12:34 2010 +0000
|
||||||
|
|
||||||
|
Restore sp for x86.
|
||||||
|
|
||||||
|
2010-03-12 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* amd64-tdep.c (amd64_word_names): Replace "sp" with "".
|
||||||
|
* i386-tdep.c (i386_word_names): Likewise.
|
||||||
|
|
||||||
|
--- gdb-7.1-p4/gdb/amd64-tdep.c 2010-04-03 21:06:52.000000000 +0200
|
||||||
|
+++ gdb-7.1/gdb/amd64-tdep.c 2010-04-03 21:08:21.000000000 +0200
|
||||||
|
@@ -222,7 +222,7 @@ static const char *amd64_byte_names[] =
|
||||||
|
|
||||||
|
static const char *amd64_word_names[] =
|
||||||
|
{
|
||||||
|
- "ax", "bx", "cx", "dx", "si", "di", "bp", "sp",
|
||||||
|
+ "ax", "bx", "cx", "dx", "si", "di", "bp", "",
|
||||||
|
"r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w"
|
||||||
|
};
|
||||||
|
|
||||||
|
--- gdb-7.1-p4/gdb/i386-tdep.c 2010-04-03 21:06:52.000000000 +0200
|
||||||
|
+++ gdb-7.1/gdb/i386-tdep.c 2010-04-03 21:08:21.000000000 +0200
|
||||||
|
@@ -94,7 +94,7 @@ static const char *i386_byte_names[] =
|
||||||
|
static const char *i386_word_names[] =
|
||||||
|
{
|
||||||
|
"ax", "cx", "dx", "bx",
|
||||||
|
- "sp", "bp", "si", "di"
|
||||||
|
+ "", "bp", "si", "di"
|
||||||
|
};
|
||||||
|
|
||||||
|
/* MMX register? */
|
183
gdb-bz578250-avx-07of10.patch
Normal file
183
gdb-bz578250-avx-07of10.patch
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
[ Backported. ]
|
||||||
|
|
||||||
|
commit d5ea7042210f5ad319ad19910bce13fd5717c6d6
|
||||||
|
Author: H.J. Lu <hjl.tools@gmail.com>
|
||||||
|
Date: Tue Mar 30 15:45:08 2010 +0000
|
||||||
|
|
||||||
|
Add xmlRegisters= to qSupported packet.
|
||||||
|
|
||||||
|
gdb/
|
||||||
|
|
||||||
|
2010-03-30 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* NEWS: Mention xmlRegisters= in qSupported packet.
|
||||||
|
|
||||||
|
* i386-tdep.c: Include "remote.h".
|
||||||
|
(_initialize_i386_tdep): Call register_remote_support_xml.
|
||||||
|
|
||||||
|
* remote.c (remote_support_xml): New.
|
||||||
|
(register_remote_support_xml): Likewise.
|
||||||
|
(remote_query_supported_append): Likewise.
|
||||||
|
(remote_query_supported): Support remote_support_xml.
|
||||||
|
|
||||||
|
* remote.h (register_remote_support_xml): New.
|
||||||
|
|
||||||
|
gdb/doc/
|
||||||
|
|
||||||
|
2010-03-30 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* gdb.texinfo (General Query Packets): Add xmlRegisters.
|
||||||
|
|
||||||
|
--- gdb-7.1-p5/gdb/NEWS 2010-04-03 21:07:46.000000000 +0200
|
||||||
|
+++ gdb-7.1/gdb/NEWS 2010-04-03 21:10:06.000000000 +0200
|
||||||
|
@@ -1,6 +1,11 @@
|
||||||
|
What has changed in GDB?
|
||||||
|
(Organized release by release)
|
||||||
|
|
||||||
|
+*** Changes since GDB 7.1
|
||||||
|
+
|
||||||
|
+* GDB now sends xmlRegisters= in qSupported packet to indicate that
|
||||||
|
+ it understands register description.
|
||||||
|
+
|
||||||
|
*** Changes in GDB 7.1
|
||||||
|
|
||||||
|
* C++ Improvements
|
||||||
|
--- gdb-7.1-p5/gdb/doc/gdb.texinfo 2010-04-03 21:04:13.000000000 +0200
|
||||||
|
+++ gdb-7.1/gdb/doc/gdb.texinfo 2010-04-03 21:09:29.000000000 +0200
|
||||||
|
@@ -30292,6 +30292,12 @@ extensions to the remote protocol. @val
|
||||||
|
extensions unless the stub also reports that it supports them by
|
||||||
|
including @samp{multiprocess+} in its @samp{qSupported} reply.
|
||||||
|
@xref{multiprocess extensions}, for details.
|
||||||
|
+
|
||||||
|
+@item xmlRegisters
|
||||||
|
+This feature indicates that @value{GDBN} supports the XML target
|
||||||
|
+description. If the stub sees @samp{xmlRegisters=} with target
|
||||||
|
+specific strings separated by a comma, it will report register
|
||||||
|
+description.
|
||||||
|
@end table
|
||||||
|
|
||||||
|
Stubs should ignore any unknown values for
|
||||||
|
--- gdb-7.1-p5/gdb/i386-tdep.c 2010-04-03 21:08:21.000000000 +0200
|
||||||
|
+++ gdb-7.1/gdb/i386-tdep.c 2010-04-03 21:09:29.000000000 +0200
|
||||||
|
@@ -44,6 +44,7 @@
|
||||||
|
#include "value.h"
|
||||||
|
#include "dis-asm.h"
|
||||||
|
#include "disasm.h"
|
||||||
|
+#include "remote.h"
|
||||||
|
|
||||||
|
#include "gdb_assert.h"
|
||||||
|
#include "gdb_string.h"
|
||||||
|
@@ -6000,4 +6001,7 @@ is \"default\"."),
|
||||||
|
|
||||||
|
/* Initialize the standard target descriptions. */
|
||||||
|
initialize_tdesc_i386 ();
|
||||||
|
+
|
||||||
|
+ /* Tell remote stub that we support XML target description. */
|
||||||
|
+ register_remote_support_xml ("i386");
|
||||||
|
}
|
||||||
|
--- gdb-7.1-p5/gdb/remote.c 2010-04-03 20:24:51.000000000 +0200
|
||||||
|
+++ gdb-7.1/gdb/remote.c 2010-04-03 21:09:29.000000000 +0200
|
||||||
|
@@ -3467,6 +3467,53 @@ static struct protocol_feature remote_pr
|
||||||
|
PACKET_bs },
|
||||||
|
};
|
||||||
|
|
||||||
|
+static char *remote_support_xml;
|
||||||
|
+
|
||||||
|
+/* Register string appended to "xmlRegisters=" in qSupported query. */
|
||||||
|
+
|
||||||
|
+void
|
||||||
|
+register_remote_support_xml (const char *xml ATTRIBUTE_UNUSED)
|
||||||
|
+{
|
||||||
|
+#if defined(HAVE_LIBEXPAT)
|
||||||
|
+ if (remote_support_xml == NULL)
|
||||||
|
+ remote_support_xml = concat ("xmlRegisters=", xml, NULL);
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ char *copy = xstrdup (remote_support_xml + 13);
|
||||||
|
+ char *p = strtok (copy, ",");
|
||||||
|
+
|
||||||
|
+ do
|
||||||
|
+ {
|
||||||
|
+ if (strcmp (p, xml) == 0)
|
||||||
|
+ {
|
||||||
|
+ /* already there */
|
||||||
|
+ xfree (copy);
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ while ((p = strtok (NULL, ",")) != NULL);
|
||||||
|
+ xfree (copy);
|
||||||
|
+
|
||||||
|
+ p = concat (remote_support_xml, ",", xml, NULL);
|
||||||
|
+ xfree (remote_support_xml);
|
||||||
|
+ remote_support_xml = p;
|
||||||
|
+ }
|
||||||
|
+#endif
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+static char *
|
||||||
|
+remote_query_supported_append (char *msg, const char *append)
|
||||||
|
+{
|
||||||
|
+ if (msg)
|
||||||
|
+ {
|
||||||
|
+ char *p = concat (msg, ";", append, NULL);
|
||||||
|
+ xfree (msg);
|
||||||
|
+ return p;
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ return xstrdup (append);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void
|
||||||
|
remote_query_supported (void)
|
||||||
|
{
|
||||||
|
@@ -3485,24 +3532,27 @@ remote_query_supported (void)
|
||||||
|
rs->buf[0] = 0;
|
||||||
|
if (remote_protocol_packets[PACKET_qSupported].support != PACKET_DISABLE)
|
||||||
|
{
|
||||||
|
+ char *q = NULL;
|
||||||
|
const char *qsupported = gdbarch_qsupported (target_gdbarch);
|
||||||
|
+
|
||||||
|
+ if (rs->extended)
|
||||||
|
+ q = remote_query_supported_append (q, "multiprocess+");
|
||||||
|
+
|
||||||
|
if (qsupported)
|
||||||
|
+ q = remote_query_supported_append (q, qsupported);
|
||||||
|
+
|
||||||
|
+ if (remote_support_xml)
|
||||||
|
+ q = remote_query_supported_append (q, remote_support_xml);
|
||||||
|
+
|
||||||
|
+ if (q)
|
||||||
|
{
|
||||||
|
- char *q;
|
||||||
|
- if (rs->extended)
|
||||||
|
- q = concat ("qSupported:multiprocess+;", qsupported, NULL);
|
||||||
|
- else
|
||||||
|
- q = concat ("qSupported:", qsupported, NULL);
|
||||||
|
- putpkt (q);
|
||||||
|
+ char *p = concat ("qSupported:", q, NULL);
|
||||||
|
xfree (q);
|
||||||
|
+ putpkt (p);
|
||||||
|
+ xfree (p);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
- {
|
||||||
|
- if (rs->extended)
|
||||||
|
- putpkt ("qSupported:multiprocess+");
|
||||||
|
- else
|
||||||
|
- putpkt ("qSupported");
|
||||||
|
- }
|
||||||
|
+ putpkt ("qSupported");
|
||||||
|
|
||||||
|
getpkt (&rs->buf, &rs->buf_size, 0);
|
||||||
|
|
||||||
|
--- gdb-7.1-p5/gdb/remote.h 2010-01-01 08:31:41.000000000 +0100
|
||||||
|
+++ gdb-7.1/gdb/remote.h 2010-04-03 21:09:29.000000000 +0200
|
||||||
|
@@ -66,6 +66,7 @@ extern void (*deprecated_target_wait_loo
|
||||||
|
|
||||||
|
void register_remote_g_packet_guess (struct gdbarch *gdbarch, int bytes,
|
||||||
|
const struct target_desc *tdesc);
|
||||||
|
+void register_remote_support_xml (const char *);
|
||||||
|
|
||||||
|
void remote_file_put (const char *local_file, const char *remote_file,
|
||||||
|
int from_tty);
|
32
gdb-bz578250-avx-08of10.patch
Normal file
32
gdb-bz578250-avx-08of10.patch
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
[ Backported. ]
|
||||||
|
|
||||||
|
commit 684341392f3ca6703dc28dac548d3051811bff47
|
||||||
|
Author: H.J. Lu <hjl.tools@gmail.com>
|
||||||
|
Date: Tue Mar 30 18:37:03 2010 +0000
|
||||||
|
|
||||||
|
Add org.gnu.gdb.i386.avx.
|
||||||
|
|
||||||
|
2010-03-30 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* gdb.texinfo (i386 Features): Add org.gnu.gdb.i386.avx.
|
||||||
|
|
||||||
|
--- gdb-7.1-p6/gdb/doc/gdb.texinfo 2010-04-03 21:09:29.000000000 +0200
|
||||||
|
+++ gdb-7.1/gdb/doc/gdb.texinfo 2010-04-03 21:10:57.000000000 +0200
|
||||||
|
@@ -33380,6 +33380,17 @@ describe registers:
|
||||||
|
@samp{mxcsr}
|
||||||
|
@end itemize
|
||||||
|
|
||||||
|
+The @samp{org.gnu.gdb.i386.avx} feature is optional. It should
|
||||||
|
+describe the upper 128 bits of @sc{ymm} registers:
|
||||||
|
+
|
||||||
|
+@itemize @minus
|
||||||
|
+@item
|
||||||
|
+@samp{ymm0h} through @samp{ymm7h} for i386
|
||||||
|
+@item
|
||||||
|
+@samp{ymm0h} through @samp{ymm15h} for amd64
|
||||||
|
+@item
|
||||||
|
+@end itemize
|
||||||
|
+
|
||||||
|
The @samp{org.gnu.gdb.i386.linux} feature is optional. It should
|
||||||
|
describe a single register, @samp{orig_eax}.
|
||||||
|
|
183
gdb-bz578250-avx-09of10.patch
Normal file
183
gdb-bz578250-avx-09of10.patch
Normal file
@ -0,0 +1,183 @@
|
|||||||
|
[ Backported. ]
|
||||||
|
|
||||||
|
commit 5362e5e1dc4cfac24fbd58773aaa7a82c615b662
|
||||||
|
Author: H.J. Lu <hjl.tools@gmail.com>
|
||||||
|
Date: Thu Apr 1 20:02:07 2010 +0000
|
||||||
|
|
||||||
|
Support "ah", "bh", "ch", "dh" on amd64.
|
||||||
|
|
||||||
|
gdb/
|
||||||
|
|
||||||
|
2010-04-01 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* amd64-tdep.c (amd64_byte_names): Add "ah", "bh", "ch", "dh".
|
||||||
|
(AMD64_NUM_LOWER_BYTE_REGS): New.
|
||||||
|
(amd64_pseudo_register_read): Handle "ah", "bh", "ch", "dh".
|
||||||
|
(amd64_pseudo_register_write): Likewise.
|
||||||
|
(amd64_init_abi): Set num_byte_regs to 20.
|
||||||
|
|
||||||
|
gdb/testsuite/
|
||||||
|
|
||||||
|
2010-04-01 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
|
* gdb.arch/amd64-byte.exp: Check "ah", "bh", "ch", "dh".
|
||||||
|
|
||||||
|
--- gdb-7.1-p7/gdb/amd64-tdep.c 2010-04-03 21:08:21.000000000 +0200
|
||||||
|
+++ gdb-7.1/gdb/amd64-tdep.c 2010-04-03 21:11:41.000000000 +0200
|
||||||
|
@@ -215,9 +215,13 @@ amd64_arch_reg_to_regnum (int reg)
|
||||||
|
static const char *amd64_byte_names[] =
|
||||||
|
{
|
||||||
|
"al", "bl", "cl", "dl", "sil", "dil", "bpl", "spl",
|
||||||
|
- "r8l", "r9l", "r10l", "r11l", "r12l", "r13l", "r14l", "r15l"
|
||||||
|
+ "r8l", "r9l", "r10l", "r11l", "r12l", "r13l", "r14l", "r15l",
|
||||||
|
+ "ah", "bh", "ch", "dh"
|
||||||
|
};
|
||||||
|
|
||||||
|
+/* Number of lower byte registers. */
|
||||||
|
+#define AMD64_NUM_LOWER_BYTE_REGS 16
|
||||||
|
+
|
||||||
|
/* Register names for word pseudo-registers. */
|
||||||
|
|
||||||
|
static const char *amd64_word_names[] =
|
||||||
|
@@ -263,8 +267,18 @@ amd64_pseudo_register_read (struct gdbar
|
||||||
|
int gpnum = regnum - tdep->al_regnum;
|
||||||
|
|
||||||
|
/* Extract (always little endian). */
|
||||||
|
- regcache_raw_read (regcache, gpnum, raw_buf);
|
||||||
|
- memcpy (buf, raw_buf, 1);
|
||||||
|
+ if (gpnum >= AMD64_NUM_LOWER_BYTE_REGS)
|
||||||
|
+ {
|
||||||
|
+ /* Special handling for AH, BH, CH, DH. */
|
||||||
|
+ regcache_raw_read (regcache,
|
||||||
|
+ gpnum - AMD64_NUM_LOWER_BYTE_REGS, raw_buf);
|
||||||
|
+ memcpy (buf, raw_buf + 1, 1);
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ regcache_raw_read (regcache, gpnum, raw_buf);
|
||||||
|
+ memcpy (buf, raw_buf, 1);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
else if (i386_dword_regnum_p (gdbarch, regnum))
|
||||||
|
{
|
||||||
|
@@ -289,12 +303,26 @@ amd64_pseudo_register_write (struct gdba
|
||||||
|
{
|
||||||
|
int gpnum = regnum - tdep->al_regnum;
|
||||||
|
|
||||||
|
- /* Read ... */
|
||||||
|
- regcache_raw_read (regcache, gpnum, raw_buf);
|
||||||
|
- /* ... Modify ... (always little endian). */
|
||||||
|
- memcpy (raw_buf, buf, 1);
|
||||||
|
- /* ... Write. */
|
||||||
|
- regcache_raw_write (regcache, gpnum, raw_buf);
|
||||||
|
+ if (gpnum >= AMD64_NUM_LOWER_BYTE_REGS)
|
||||||
|
+ {
|
||||||
|
+ /* Read ... AH, BH, CH, DH. */
|
||||||
|
+ regcache_raw_read (regcache,
|
||||||
|
+ gpnum - AMD64_NUM_LOWER_BYTE_REGS, raw_buf);
|
||||||
|
+ /* ... Modify ... (always little endian). */
|
||||||
|
+ memcpy (raw_buf + 1, buf, 1);
|
||||||
|
+ /* ... Write. */
|
||||||
|
+ regcache_raw_write (regcache,
|
||||||
|
+ gpnum - AMD64_NUM_LOWER_BYTE_REGS, raw_buf);
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ {
|
||||||
|
+ /* Read ... */
|
||||||
|
+ regcache_raw_read (regcache, gpnum, raw_buf);
|
||||||
|
+ /* ... Modify ... (always little endian). */
|
||||||
|
+ memcpy (raw_buf, buf, 1);
|
||||||
|
+ /* ... Write. */
|
||||||
|
+ regcache_raw_write (regcache, gpnum, raw_buf);
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
else if (i386_dword_regnum_p (gdbarch, regnum))
|
||||||
|
{
|
||||||
|
@@ -2233,7 +2261,7 @@ amd64_init_abi (struct gdbarch_info info
|
||||||
|
tdep->num_core_regs = AMD64_NUM_GREGS + I387_NUM_REGS;
|
||||||
|
tdep->register_names = amd64_register_names;
|
||||||
|
|
||||||
|
- tdep->num_byte_regs = 16;
|
||||||
|
+ tdep->num_byte_regs = 20;
|
||||||
|
tdep->num_word_regs = 16;
|
||||||
|
tdep->num_dword_regs = 16;
|
||||||
|
/* Avoid wiring in the MMX registers for now. */
|
||||||
|
--- gdb-7.1-p7/gdb/testsuite/gdb.arch/amd64-byte.exp 2010-04-03 21:06:52.000000000 +0200
|
||||||
|
+++ gdb-7.1/gdb/testsuite/gdb.arch/amd64-byte.exp 2010-04-03 21:11:41.000000000 +0200
|
||||||
|
@@ -52,7 +52,6 @@ if ![runto_main] then {
|
||||||
|
gdb_suppress_tests
|
||||||
|
}
|
||||||
|
|
||||||
|
-set nr_regs 14
|
||||||
|
set byte_regs(1) al
|
||||||
|
set byte_regs(2) bl
|
||||||
|
set byte_regs(3) cl
|
||||||
|
@@ -67,6 +66,10 @@ set byte_regs(11) r12l
|
||||||
|
set byte_regs(12) r13l
|
||||||
|
set byte_regs(13) r14l
|
||||||
|
set byte_regs(14) r15l
|
||||||
|
+set byte_regs(15) ah
|
||||||
|
+set byte_regs(16) bh
|
||||||
|
+set byte_regs(17) ch
|
||||||
|
+set byte_regs(18) dh
|
||||||
|
|
||||||
|
gdb_test "break [gdb_get_line_number "first breakpoint here"]" \
|
||||||
|
"Breakpoint .* at .*${srcfile}.*" \
|
||||||
|
@@ -79,12 +82,19 @@ for { set r 1 } { $r <= 6 } { incr r }
|
||||||
|
"check contents of %$byte_regs($r)"
|
||||||
|
}
|
||||||
|
|
||||||
|
+for { set r 1 } { $r <= 4 } { incr r } {
|
||||||
|
+ set h [expr $r + 14]
|
||||||
|
+ gdb_test "print/x \$$byte_regs($h)" \
|
||||||
|
+ ".. = 0x[format %x $r]2" \
|
||||||
|
+ "check contents of %$byte_regs($h)"
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
gdb_test "break [gdb_get_line_number "second breakpoint here"]" \
|
||||||
|
"Breakpoint .* at .*${srcfile}.*" \
|
||||||
|
"set second breakpoint in main"
|
||||||
|
gdb_continue_to_breakpoint "continue to second breakpoint in main"
|
||||||
|
|
||||||
|
-for { set r 7 } { $r <= $nr_regs } { incr r } {
|
||||||
|
+for { set r 7 } { $r <= 14 } { incr r } {
|
||||||
|
gdb_test "print/x \$$byte_regs($r)" \
|
||||||
|
".. = 0x[format %x $r]1" \
|
||||||
|
"check contents of %$byte_regs($r)"
|
||||||
|
@@ -94,6 +104,11 @@ for { set r 1 } { $r <= 6 } { incr r }
|
||||||
|
gdb_test "set var \$$byte_regs($r) = $r" "" "set %$byte_regs($r)"
|
||||||
|
}
|
||||||
|
|
||||||
|
+for { set r 1 } { $r <= 4 } { incr r } {
|
||||||
|
+ set h [expr $r + 14]
|
||||||
|
+ gdb_test "set var \$$byte_regs($h) = $h" "" "set %$byte_regs($h)"
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
gdb_test "break [gdb_get_line_number "third breakpoint here"]" \
|
||||||
|
"Breakpoint .* at .*${srcfile}.*" \
|
||||||
|
"set third breakpoint in main"
|
||||||
|
@@ -105,7 +120,14 @@ for { set r 1 } { $r <= 6 } { incr r }
|
||||||
|
"check contents of %$byte_regs($r)"
|
||||||
|
}
|
||||||
|
|
||||||
|
-for { set r 7 } { $r <= $nr_regs } { incr r } {
|
||||||
|
+for { set r 1 } { $r <= 4 } { incr r } {
|
||||||
|
+ set h [expr $r + 14]
|
||||||
|
+ gdb_test "print \$$byte_regs($h)" \
|
||||||
|
+ ".. = $h" \
|
||||||
|
+ "check contents of %$byte_regs($h)"
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+for { set r 7 } { $r <= 14 } { incr r } {
|
||||||
|
gdb_test "set var \$$byte_regs($r) = $r" "" "set %$byte_regs($r)"
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -114,7 +136,7 @@ gdb_test "break [gdb_get_line_number "fo
|
||||||
|
"set forth breakpoint in main"
|
||||||
|
gdb_continue_to_breakpoint "continue to forth breakpoint in main"
|
||||||
|
|
||||||
|
-for { set r 7 } { $r <= $nr_regs } { incr r } {
|
||||||
|
+for { set r 7 } { $r <= 14 } { incr r } {
|
||||||
|
gdb_test "print \$$byte_regs($r)" \
|
||||||
|
".. = $r" \
|
||||||
|
"check contents of %$byte_regs($r)"
|
16
gdb-bz578250-avx-10of10-ppc.patch
Executable file
16
gdb-bz578250-avx-10of10-ppc.patch
Executable file
@ -0,0 +1,16 @@
|
|||||||
|
http://sourceware.org/ml/gdb-patches/2010-04/msg00056.html
|
||||||
|
|
||||||
|
linux-ppc-low.c:599: error: incompatible types when initializing type ‘enum regset_type’ using type ‘void (*)(struct regcache *, void *)’
|
||||||
|
linux-ppc-low.c:599: warning: initialization from incompatible pointer type
|
||||||
|
|
||||||
|
--- a/gdb/gdbserver/linux-ppc-low.c
|
||||||
|
+++ b/gdb/gdbserver/linux-ppc-low.c
|
||||||
|
@@ -594,7 +594,7 @@ struct regset_info target_regsets[] = {
|
||||||
|
PPC_PTRACE_GETREGS. */
|
||||||
|
{ PTRACE_GETVSXREGS, PTRACE_SETVSXREGS, 0, SIZEOF_VSXREGS, EXTENDED_REGS,
|
||||||
|
ppc_fill_vsxregset, ppc_store_vsxregset },
|
||||||
|
- { PTRACE_GETVRREGS, PTRACE_SETVRREGS, SIZEOF_VRREGS, EXTENDED_REGS,
|
||||||
|
+ { PTRACE_GETVRREGS, PTRACE_SETVRREGS, 0, SIZEOF_VRREGS, EXTENDED_REGS,
|
||||||
|
ppc_fill_vrregset, ppc_store_vrregset },
|
||||||
|
{ PTRACE_GETEVRREGS, PTRACE_SETEVRREGS, 0, 32 * 4 + 8 + 4, EXTENDED_REGS,
|
||||||
|
ppc_fill_evrregset, ppc_store_evrregset },
|
8271
gdb-bz578250-avx-10of10.patch
Normal file
8271
gdb-bz578250-avx-10of10.patch
Normal file
File diff suppressed because it is too large
Load Diff
81
gdb-infcall-sp-underflow.patch
Normal file
81
gdb-infcall-sp-underflow.patch
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
http://sourceware.org/ml/gdb-patches/2010-02/msg00515.html
|
||||||
|
Subject: [patch] infcall: Remove gdb_assert ($sp overflow)
|
||||||
|
|
||||||
|
Hi,
|
||||||
|
|
||||||
|
set $sp=0
|
||||||
|
call something()
|
||||||
|
->
|
||||||
|
../../gdb/infcall.c:521: internal-error: call_function_by_hand: Assertion
|
||||||
|
`(gdbarch_inner_than (gdbarch, 1, 2) && sp <= old_sp) || (gdbarch_inner_than
|
||||||
|
(gdbarch, 2, 1) && sp >= old_sp)' failed.
|
||||||
|
|
||||||
|
as $sp - frame == 0xffffsmth which is not lower than $sp.
|
||||||
|
|
||||||
|
It must not be gdb_assert(). It can be an error() but I left it just to do:
|
||||||
|
(gdb) set $sp=0
|
||||||
|
(gdb) call doubleit (1)
|
||||||
|
Cannot access memory at address 0xffffffffffffff78
|
||||||
|
(gdb) set $sp=-1
|
||||||
|
(gdb) call doubleit (1)
|
||||||
|
Cannot access memory at address 0xffffffffffffff68
|
||||||
|
|
||||||
|
Unaware how inconvenient is an intentional crash of the testcase on some
|
||||||
|
embedded/non-MMU systems.
|
||||||
|
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
|
||||||
|
|
||||||
|
|
||||||
|
Thanks,
|
||||||
|
Jan
|
||||||
|
|
||||||
|
|
||||||
|
gdb/
|
||||||
|
2010-02-19 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* infcall.c (call_function_by_hand): Remove gdb_assert on sp and old_sp.
|
||||||
|
New comment.
|
||||||
|
|
||||||
|
gdb/testsuite/
|
||||||
|
2010-02-19 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* gdb.base/callfuncs.exp: New tests for $spval 0 and -1. Remove return.
|
||||||
|
|
||||||
|
--- a/gdb/infcall.c
|
||||||
|
+++ b/gdb/infcall.c
|
||||||
|
@@ -518,10 +518,9 @@ call_function_by_hand (struct value *function, int nargs, struct value **args)
|
||||||
|
/* Stack grows up. */
|
||||||
|
sp = gdbarch_frame_align (gdbarch, old_sp + 1);
|
||||||
|
}
|
||||||
|
- gdb_assert ((gdbarch_inner_than (gdbarch, 1, 2)
|
||||||
|
- && sp <= old_sp)
|
||||||
|
- || (gdbarch_inner_than (gdbarch, 2, 1)
|
||||||
|
- && sp >= old_sp));
|
||||||
|
+ /* SP may have overflown address zero here from OLD_SP. Memory access
|
||||||
|
+ functions will probably fail in such case but that is a target's
|
||||||
|
+ problem. */
|
||||||
|
}
|
||||||
|
else
|
||||||
|
/* FIXME: cagney/2002-09-18: Hey, you loose!
|
||||||
|
--- a/gdb/testsuite/gdb.base/callfuncs.exp
|
||||||
|
+++ b/gdb/testsuite/gdb.base/callfuncs.exp
|
||||||
|
@@ -469,5 +469,18 @@ if {$old_reg_content == $new_reg_content} then {
|
||||||
|
fail "nested call dummies preserve register contents"
|
||||||
|
}
|
||||||
|
|
||||||
|
-return 0
|
||||||
|
+# GDB should not crash by internal error on $sp overflow during the inferior
|
||||||
|
+# call. It is OK it will stop on some: Cannot access memory at address 0x$hex.
|
||||||
|
|
||||||
|
+foreach spval {0 -1} {
|
||||||
|
+ set old_ldprefix $pf_prefix
|
||||||
|
+ lappend pf_prefix "sp=$spval:"
|
||||||
|
+
|
||||||
|
+ gdb_test {set $old_sp = $sp}
|
||||||
|
+ gdb_test "set \$sp = $spval"
|
||||||
|
+
|
||||||
|
+ gdb_test "call doubleit (1)"
|
||||||
|
+
|
||||||
|
+ gdb_test {set $sp = $old_sp}
|
||||||
|
+ set pf_prefix $old_ldprefix
|
||||||
|
+}
|
||||||
|
|
443
gdb-pie-1of6-reprelinked-bin.patch
Normal file
443
gdb-pie-1of6-reprelinked-bin.patch
Normal file
@ -0,0 +1,443 @@
|
|||||||
|
http://sourceware.org/ml/gdb-patches/2010-03/msg01008.html
|
||||||
|
Subject: [patch 1/6]: PIE: Attach binary even after re-prelinked underneath
|
||||||
|
|
||||||
|
Hi,
|
||||||
|
|
||||||
|
there is a regression (against previous unreleased commits) by:
|
||||||
|
Re: RFC: Verify AT_ENTRY before using it
|
||||||
|
http://sourceware.org/ml/gdb-patches/2010-03/msg00395.html
|
||||||
|
|
||||||
|
for loading PIE executables which have changed on the disk since started.
|
||||||
|
There are in fact 3 different addresses one has to properly deal with.
|
||||||
|
|
||||||
|
This patch uses explicit "file" so it is not dependent on pending:
|
||||||
|
[patch] Attach to running but deleted executable
|
||||||
|
http://sourceware.org/ml/gdb-patches/2010-03/msg00950.html
|
||||||
|
|
||||||
|
The two copy-pasted blocks for elf32 and elf64 are "not nice" but this is the
|
||||||
|
current style in GDB.
|
||||||
|
|
||||||
|
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu for the whole
|
||||||
|
patch series together.
|
||||||
|
|
||||||
|
|
||||||
|
Thanks,
|
||||||
|
Jan
|
||||||
|
|
||||||
|
|
||||||
|
gdb/
|
||||||
|
2010-03-29 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
Fix attaching to PIEs prelinked on the disk since their start.
|
||||||
|
* solib-svr4.c (svr4_exec_displacement): New variable arch_size.
|
||||||
|
Verify it against bfd_get_arch_size. Try to match arbitrary
|
||||||
|
displacement for the phdrs comparison.
|
||||||
|
|
||||||
|
gdb/testsuite/
|
||||||
|
2010-03-29 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* gdb.base/break-interp.exp: Run $binpie with new value "ATTACH", new
|
||||||
|
code for it. New variable relink_args.
|
||||||
|
(prelinkYES): Call prelinkNO.
|
||||||
|
(test_attach): Accept new parameter relink_args. Re-prelink the binary
|
||||||
|
in such case. Move the core code to ...
|
||||||
|
(test_attach_gdb): ... a new function. Send GDB command "file".
|
||||||
|
Extend expected "Attaching to " string.
|
||||||
|
|
||||||
|
--- a/gdb/solib-svr4.c
|
||||||
|
+++ b/gdb/solib-svr4.c
|
||||||
|
@@ -1750,13 +1750,183 @@ svr4_exec_displacement (CORE_ADDR *displacementp)
|
||||||
|
really do not match. */
|
||||||
|
int phdrs_size, phdrs2_size, ok = 1;
|
||||||
|
gdb_byte *buf, *buf2;
|
||||||
|
+ int arch_size;
|
||||||
|
|
||||||
|
- buf = read_program_header (-1, &phdrs_size, NULL);
|
||||||
|
+ buf = read_program_header (-1, &phdrs_size, &arch_size);
|
||||||
|
buf2 = read_program_headers_from_bfd (exec_bfd, &phdrs2_size);
|
||||||
|
- if (buf != NULL && buf2 != NULL
|
||||||
|
- && (phdrs_size != phdrs2_size
|
||||||
|
- || memcmp (buf, buf2, phdrs_size) != 0))
|
||||||
|
- ok = 0;
|
||||||
|
+ if (buf != NULL && buf2 != NULL)
|
||||||
|
+ {
|
||||||
|
+ enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
|
||||||
|
+
|
||||||
|
+ /* We are dealing with three different addresses. EXEC_BFD
|
||||||
|
+ represents current address in on-disk file. target memory content
|
||||||
|
+ may be different from EXEC_BFD as the file may have been prelinked
|
||||||
|
+ to a different address since the executable has been loaded.
|
||||||
|
+ Moreover the address of placement in target memory can be
|
||||||
|
+ different from what say the target memory program headers - this
|
||||||
|
+ is the goal of PIE.
|
||||||
|
+
|
||||||
|
+ Detected DISPLACEMENT covers both the offsets of PIE placement and
|
||||||
|
+ possible new prelink since start of the program. Here relocate
|
||||||
|
+ BUF and BUF2 just by the EXEC_BFD vs. target memory content offset
|
||||||
|
+ for the verification purpose. */
|
||||||
|
+
|
||||||
|
+ if (phdrs_size != phdrs2_size
|
||||||
|
+ || bfd_get_arch_size (exec_bfd) != arch_size)
|
||||||
|
+ ok = 0;
|
||||||
|
+ else if (arch_size == 32 && phdrs_size >= sizeof (Elf32_External_Phdr)
|
||||||
|
+ && phdrs_size % sizeof (Elf32_External_Phdr) == 0)
|
||||||
|
+ {
|
||||||
|
+ Elf_Internal_Ehdr *ehdr2 = elf_tdata (exec_bfd)->elf_header;
|
||||||
|
+ Elf_Internal_Phdr *phdr2 = elf_tdata (exec_bfd)->phdr;
|
||||||
|
+ CORE_ADDR displacement = 0;
|
||||||
|
+ int i;
|
||||||
|
+
|
||||||
|
+ /* DISPLACEMENT could be found easier by the difference of
|
||||||
|
+ ehdr2->e_entry but already read BUF does not contain ehdr. */
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < ehdr2->e_phnum; i++)
|
||||||
|
+ if (phdr2[i].p_type == PT_LOAD)
|
||||||
|
+ {
|
||||||
|
+ Elf32_External_Phdr *phdrp;
|
||||||
|
+ gdb_byte *buf_vaddr_p, *buf_paddr_p;
|
||||||
|
+ CORE_ADDR vaddr, paddr;
|
||||||
|
+ CORE_ADDR displacement_vaddr = 0;
|
||||||
|
+ CORE_ADDR displacement_paddr = 0;
|
||||||
|
+
|
||||||
|
+ phdrp = &((Elf32_External_Phdr *) buf)[i];
|
||||||
|
+ buf_vaddr_p = (gdb_byte *) &phdrp->p_vaddr;
|
||||||
|
+ buf_paddr_p = (gdb_byte *) &phdrp->p_paddr;
|
||||||
|
+
|
||||||
|
+ vaddr = extract_unsigned_integer (buf_vaddr_p, 4,
|
||||||
|
+ byte_order);
|
||||||
|
+ displacement_vaddr = vaddr - phdr2[i].p_vaddr;
|
||||||
|
+
|
||||||
|
+ paddr = extract_unsigned_integer (buf_paddr_p, 4,
|
||||||
|
+ byte_order);
|
||||||
|
+ displacement_paddr = paddr - phdr2[i].p_paddr;
|
||||||
|
+
|
||||||
|
+ if (displacement_vaddr == displacement_paddr)
|
||||||
|
+ displacement = displacement_vaddr;
|
||||||
|
+
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* Now compare BUF and BUF2 with optional DISPLACEMENT. */
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < phdrs_size / sizeof (Elf32_External_Phdr); i++)
|
||||||
|
+ {
|
||||||
|
+ Elf32_External_Phdr *phdrp;
|
||||||
|
+ Elf32_External_Phdr *phdr2p;
|
||||||
|
+ gdb_byte *buf_vaddr_p, *buf_paddr_p;
|
||||||
|
+ CORE_ADDR vaddr, paddr;
|
||||||
|
+
|
||||||
|
+ phdrp = &((Elf32_External_Phdr *) buf)[i];
|
||||||
|
+ buf_vaddr_p = (gdb_byte *) &phdrp->p_vaddr;
|
||||||
|
+ buf_paddr_p = (gdb_byte *) &phdrp->p_paddr;
|
||||||
|
+ phdr2p = &((Elf32_External_Phdr *) buf2)[i];
|
||||||
|
+
|
||||||
|
+ /* PT_GNU_STACK addresses are left as zero not being
|
||||||
|
+ relocated by prelink, their displacing would create false
|
||||||
|
+ verification failure. Feel free to test the unrelocated
|
||||||
|
+ comparison for any segment type. */
|
||||||
|
+
|
||||||
|
+ if (memcmp (phdrp, phdr2p, sizeof (*phdrp)) == 0)
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ vaddr = extract_unsigned_integer (buf_vaddr_p, 4, byte_order);
|
||||||
|
+ vaddr -= displacement;
|
||||||
|
+ store_unsigned_integer (buf_vaddr_p, 4, byte_order, vaddr);
|
||||||
|
+
|
||||||
|
+ paddr = extract_unsigned_integer (buf_paddr_p, 4, byte_order);
|
||||||
|
+ paddr -= displacement;
|
||||||
|
+ store_unsigned_integer (buf_paddr_p, 4, byte_order, paddr);
|
||||||
|
+
|
||||||
|
+ if (memcmp (phdrp, phdr2p, sizeof (*phdrp)) == 0)
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ ok = 0;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ else if (arch_size == 64 && phdrs_size >= sizeof (Elf64_External_Phdr)
|
||||||
|
+ && phdrs_size % sizeof (Elf64_External_Phdr) == 0)
|
||||||
|
+ {
|
||||||
|
+ Elf_Internal_Ehdr *ehdr2 = elf_tdata (exec_bfd)->elf_header;
|
||||||
|
+ Elf_Internal_Phdr *phdr2 = elf_tdata (exec_bfd)->phdr;
|
||||||
|
+ CORE_ADDR displacement = 0;
|
||||||
|
+ int i;
|
||||||
|
+
|
||||||
|
+ /* DISPLACEMENT could be found easier by the difference of
|
||||||
|
+ ehdr2->e_entry but already read BUF does not contain ehdr. */
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < ehdr2->e_phnum; i++)
|
||||||
|
+ if (phdr2[i].p_type == PT_LOAD)
|
||||||
|
+ {
|
||||||
|
+ Elf64_External_Phdr *phdrp;
|
||||||
|
+ gdb_byte *buf_vaddr_p, *buf_paddr_p;
|
||||||
|
+ CORE_ADDR vaddr, paddr;
|
||||||
|
+ CORE_ADDR displacement_vaddr = 0;
|
||||||
|
+ CORE_ADDR displacement_paddr = 0;
|
||||||
|
+
|
||||||
|
+ phdrp = &((Elf64_External_Phdr *) buf)[i];
|
||||||
|
+ buf_vaddr_p = (gdb_byte *) &phdrp->p_vaddr;
|
||||||
|
+ buf_paddr_p = (gdb_byte *) &phdrp->p_paddr;
|
||||||
|
+
|
||||||
|
+ vaddr = extract_unsigned_integer (buf_vaddr_p, 8,
|
||||||
|
+ byte_order);
|
||||||
|
+ displacement_vaddr = vaddr - phdr2[i].p_vaddr;
|
||||||
|
+
|
||||||
|
+ paddr = extract_unsigned_integer (buf_paddr_p, 8,
|
||||||
|
+ byte_order);
|
||||||
|
+ displacement_paddr = paddr - phdr2[i].p_paddr;
|
||||||
|
+
|
||||||
|
+ if (displacement_vaddr == displacement_paddr)
|
||||||
|
+ displacement = displacement_vaddr;
|
||||||
|
+
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* Now compare BUF and BUF2 with optional DISPLACEMENT. */
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < phdrs_size / sizeof (Elf64_External_Phdr); i++)
|
||||||
|
+ {
|
||||||
|
+ Elf64_External_Phdr *phdrp;
|
||||||
|
+ Elf64_External_Phdr *phdr2p;
|
||||||
|
+ gdb_byte *buf_vaddr_p, *buf_paddr_p;
|
||||||
|
+ CORE_ADDR vaddr, paddr;
|
||||||
|
+
|
||||||
|
+ phdrp = &((Elf64_External_Phdr *) buf)[i];
|
||||||
|
+ buf_vaddr_p = (gdb_byte *) &phdrp->p_vaddr;
|
||||||
|
+ buf_paddr_p = (gdb_byte *) &phdrp->p_paddr;
|
||||||
|
+ phdr2p = &((Elf64_External_Phdr *) buf2)[i];
|
||||||
|
+
|
||||||
|
+ /* PT_GNU_STACK addresses are left as zero not being
|
||||||
|
+ relocated by prelink, their displacing would create false
|
||||||
|
+ verification failure. Feel free to test the unrelocated
|
||||||
|
+ comparison for any segment type. */
|
||||||
|
+
|
||||||
|
+ if (memcmp (phdrp, phdr2p, sizeof (*phdrp)) == 0)
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ vaddr = extract_unsigned_integer (buf_vaddr_p, 8, byte_order);
|
||||||
|
+ vaddr -= displacement;
|
||||||
|
+ store_unsigned_integer (buf_vaddr_p, 8, byte_order, vaddr);
|
||||||
|
+
|
||||||
|
+ paddr = extract_unsigned_integer (buf_paddr_p, 8, byte_order);
|
||||||
|
+ paddr -= displacement;
|
||||||
|
+ store_unsigned_integer (buf_paddr_p, 8, byte_order, paddr);
|
||||||
|
+
|
||||||
|
+ if (memcmp (phdrp, phdr2p, sizeof (*phdrp)) == 0)
|
||||||
|
+ continue;
|
||||||
|
+
|
||||||
|
+ ok = 0;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ else
|
||||||
|
+ ok = 0;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
xfree (buf);
|
||||||
|
xfree (buf2);
|
||||||
|
--- a/gdb/testsuite/gdb.base/break-interp.exp
|
||||||
|
+++ b/gdb/testsuite/gdb.base/break-interp.exp
|
||||||
|
@@ -154,6 +154,12 @@ proc prelinkYES {arg {name ""}} {
|
||||||
|
if {$name == ""} {
|
||||||
|
set name [file tail $arg]
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ # Try to unprelink it first so that if it has been already prelinked before
|
||||||
|
+ # we get different address now and the result is not affected by the
|
||||||
|
+ # previous $arg state..
|
||||||
|
+ prelinkNO $arg "$name pre-unprelink"
|
||||||
|
+
|
||||||
|
set test "prelink $name"
|
||||||
|
set command "exec /usr/sbin/prelink -qNR --no-exec-shield $arg"
|
||||||
|
verbose -log "command is $command"
|
||||||
|
@@ -319,38 +325,12 @@ proc test_core {file displacement} {
|
||||||
|
set pf_prefix $old_ldprefix
|
||||||
|
}
|
||||||
|
|
||||||
|
-proc test_attach {file displacement} {
|
||||||
|
- global board_info gdb_prompt expect_out
|
||||||
|
-
|
||||||
|
- gdb_exit
|
||||||
|
-
|
||||||
|
- set test "sleep function started"
|
||||||
|
-
|
||||||
|
- set command "${file} sleep"
|
||||||
|
- set res [remote_spawn host $command];
|
||||||
|
- if { $res < 0 || $res == "" } {
|
||||||
|
- perror "Spawning $command failed."
|
||||||
|
- fail $test
|
||||||
|
- return
|
||||||
|
- }
|
||||||
|
- set pid [exp_pid -i $res]
|
||||||
|
- gdb_expect {
|
||||||
|
- -re "sleeping\r\n" {
|
||||||
|
- pass $test
|
||||||
|
- }
|
||||||
|
- eof {
|
||||||
|
- fail "$test (eof)"
|
||||||
|
- return
|
||||||
|
- }
|
||||||
|
- timeout {
|
||||||
|
- fail "$test (timeout)"
|
||||||
|
- return
|
||||||
|
- }
|
||||||
|
- }
|
||||||
|
+proc test_attach_gdb {file pid displacement prefix} {
|
||||||
|
+ global gdb_prompt expect_out
|
||||||
|
|
||||||
|
global pf_prefix
|
||||||
|
set old_ldprefix $pf_prefix
|
||||||
|
- lappend pf_prefix "attach:"
|
||||||
|
+ lappend pf_prefix "$prefix:"
|
||||||
|
|
||||||
|
gdb_exit
|
||||||
|
gdb_start
|
||||||
|
@@ -358,9 +338,13 @@ proc test_attach {file displacement} {
|
||||||
|
# Print the "PIE (Position Independent Executable) displacement" message.
|
||||||
|
gdb_test "set verbose on"
|
||||||
|
|
||||||
|
+ if {$file != ""} {
|
||||||
|
+ gdb_test "file $file" "Reading symbols from .*done\\." "file"
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
set test "attach"
|
||||||
|
gdb_test_multiple "attach $pid" $test {
|
||||||
|
- -re "Attaching to process $pid\r\n" {
|
||||||
|
+ -re "Attaching to (program: .*, )?process $pid\r\n" {
|
||||||
|
# Missing "$gdb_prompt $" is intentional.
|
||||||
|
pass $test
|
||||||
|
}
|
||||||
|
@@ -396,11 +380,56 @@ proc test_attach {file displacement} {
|
||||||
|
gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "attach main bt"
|
||||||
|
gdb_exit
|
||||||
|
|
||||||
|
- remote_exec host "kill -9 $pid"
|
||||||
|
-
|
||||||
|
set pf_prefix $old_ldprefix
|
||||||
|
}
|
||||||
|
|
||||||
|
+proc test_attach {file displacement {relink_args ""}} {
|
||||||
|
+ global board_info
|
||||||
|
+
|
||||||
|
+ gdb_exit
|
||||||
|
+
|
||||||
|
+ set test "sleep function started"
|
||||||
|
+
|
||||||
|
+ set command "${file} sleep"
|
||||||
|
+ set res [remote_spawn host $command];
|
||||||
|
+ if { $res < 0 || $res == "" } {
|
||||||
|
+ perror "Spawning $command failed."
|
||||||
|
+ fail $test
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
+ set pid [exp_pid -i $res]
|
||||||
|
+ gdb_expect {
|
||||||
|
+ -re "sleeping\r\n" {
|
||||||
|
+ pass $test
|
||||||
|
+ }
|
||||||
|
+ eof {
|
||||||
|
+ fail "$test (eof)"
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
+ timeout {
|
||||||
|
+ fail "$test (timeout)"
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if {$relink_args == ""} {
|
||||||
|
+ test_attach_gdb "" $pid $displacement "attach"
|
||||||
|
+ } else {
|
||||||
|
+ # These could be rather passed as arguments.
|
||||||
|
+ global exec interp_saved interp
|
||||||
|
+
|
||||||
|
+ foreach relink {YES NO} {
|
||||||
|
+ if {[prelink$relink $relink_args [file tail $exec]]
|
||||||
|
+ && [copy $interp_saved $interp]} {
|
||||||
|
+ # /proc/PID/exe cannot be loaded as it is "EXECNAME (deleted)".
|
||||||
|
+ test_attach_gdb $exec $pid $displacement "attach-relink$relink"
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ remote_exec host "kill -9 $pid"
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
proc test_ld {file ifmain trynosym displacement} {
|
||||||
|
global srcdir subdir gdb_prompt expect_out
|
||||||
|
|
||||||
|
@@ -609,7 +638,10 @@ foreach ldprelink {NO YES} {
|
||||||
|
set old_binprefix $pf_prefix
|
||||||
|
foreach binprelink {NO YES} {
|
||||||
|
foreach binsepdebug {NO IN SEP} {
|
||||||
|
- foreach binpie {NO YES} {
|
||||||
|
+ # "ATTACH" is like "YES" but it is modified during run.
|
||||||
|
+ # It cannot be used for problem reproducibility after the
|
||||||
|
+ # testcase ends.
|
||||||
|
+ foreach binpie {NO YES ATTACH} {
|
||||||
|
# This combination is not possible, non-PIE (fixed address)
|
||||||
|
# binary cannot be prelinked to any (other) address.
|
||||||
|
if {$binprelink == "YES" && $binpie == "NO"} {
|
||||||
|
@@ -628,7 +660,7 @@ foreach ldprelink {NO YES} {
|
||||||
|
if {$binsepdebug != "NO"} {
|
||||||
|
lappend opts {debug}
|
||||||
|
}
|
||||||
|
- if {$binpie == "YES"} {
|
||||||
|
+ if {$binpie != "NO"} {
|
||||||
|
lappend opts {additional_flags=-fPIE -pie}
|
||||||
|
}
|
||||||
|
if {[build_executable ${test}.exp [file tail $exec] $srcfile $opts] == -1} {
|
||||||
|
@@ -680,16 +712,45 @@ foreach ldprelink {NO YES} {
|
||||||
|
lappend dests $dest
|
||||||
|
}
|
||||||
|
|
||||||
|
- if {[prelink$binprelink "--dynamic-linker=$interp --ld-library-path=$dir $exec $interp [concat $dests]" [file tail $exec]]
|
||||||
|
+ if {$binpie == "NO"} {
|
||||||
|
+ set displacement "NONE"
|
||||||
|
+ } elseif {$binprelink == "NO"} {
|
||||||
|
+ set displacement "NONZERO"
|
||||||
|
+ } else {
|
||||||
|
+ set displacement "ZERO"
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ set relink_args "--dynamic-linker=$interp --ld-library-path=$dir $exec $interp [concat $dests]"
|
||||||
|
+ if {[prelink$binprelink $relink_args [file tail $exec]]
|
||||||
|
&& [copy $interp_saved $interp]} {
|
||||||
|
- if {$binpie == "NO"} {
|
||||||
|
- set displacement "NONE"
|
||||||
|
- } elseif {$binprelink == "NO"} {
|
||||||
|
- set displacement "NONZERO"
|
||||||
|
+ if {$binpie != "ATTACH"} {
|
||||||
|
+ test_ld $exec 1 [expr {$binsepdebug == "NO"}] $displacement
|
||||||
|
} else {
|
||||||
|
- set displacement "ZERO"
|
||||||
|
+ # If the file has been randomly prelinked it must
|
||||||
|
+ # be "NONZERO". We could see "ZERO" only if it was
|
||||||
|
+ # unprelinked na it is now running at the same
|
||||||
|
+ # address - which is 0 but executable can never run
|
||||||
|
+ # at address 0.
|
||||||
|
+
|
||||||
|
+ set displacement "NONZERO"
|
||||||
|
+ test_attach $exec $displacement $relink_args
|
||||||
|
+
|
||||||
|
+ # ATTACH executables + libraries get modified since
|
||||||
|
+ # they have been run. They cannot be used for
|
||||||
|
+ # problem reproducibility after the testcase ends.
|
||||||
|
+ set exec_debug [system_debug_get $exec]
|
||||||
|
+ if {$exec_debug != ""} {
|
||||||
|
+ # `file delete [glob "${exec_debug}*"]' does not work.
|
||||||
|
+ foreach f [glob "${exec_debug}*"] {
|
||||||
|
+ file delete $f
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ file delete -force $dir
|
||||||
|
+ # `file delete [glob "${exec}*"]' does not work.
|
||||||
|
+ foreach f [glob "${exec}*"] {
|
||||||
|
+ file delete $f
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
- test_ld $exec 1 [expr {$binsepdebug == "NO"}] $displacement
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
87
gdb-pie-2of6-reprelinked-ld.patch
Normal file
87
gdb-pie-2of6-reprelinked-ld.patch
Normal file
@ -0,0 +1,87 @@
|
|||||||
|
http://sourceware.org/ml/gdb-patches/2010-03/msg01000.html
|
||||||
|
Subject: [patch 2/6] PIE: Attach binary even after ld.so re-prelinked underneath
|
||||||
|
|
||||||
|
Hi,
|
||||||
|
|
||||||
|
when I have seen the PIE-binary-changed-sice-start tested also
|
||||||
|
ld.so-changed-since-start and it did not work.
|
||||||
|
|
||||||
|
There is questionable when to print and when to not to print non-fatal memory
|
||||||
|
read errors. Similar change I requested in
|
||||||
|
Re: [RFC/ia64] memory error when reading wrong core file
|
||||||
|
http://sourceware.org/ml/gdb-patches/2010-02/msg00001.html
|
||||||
|
so that GDB prints at least as a warning
|
||||||
|
Cannot access memory at address ...
|
||||||
|
when some unexpected error happens.
|
||||||
|
|
||||||
|
Contrary to it there is not such warning present in the code below as in the
|
||||||
|
case of non-valgrind PIE with re-prelinked ld.so the memory read error happens
|
||||||
|
there. Some GDB code rework could probably avoid it.
|
||||||
|
|
||||||
|
Just for example all the memory read errors in read_program_header or even
|
||||||
|
- primarily - scan_dyntag are currently IMO-incorrectly silent and others.
|
||||||
|
Therefore posted the patch this way, making all these warnings printed and
|
||||||
|
possibly fixing code attempting incorrect reads along the way could be done by
|
||||||
|
a different patch.
|
||||||
|
|
||||||
|
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu for the whole
|
||||||
|
patch series together.
|
||||||
|
|
||||||
|
|
||||||
|
Thanks,
|
||||||
|
Jan
|
||||||
|
|
||||||
|
|
||||||
|
gdb/
|
||||||
|
2010-03-29 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* auxv.c (ld_so_xfer_auxv): Do not error on failed read of data_address.
|
||||||
|
|
||||||
|
gdb/testsuite/
|
||||||
|
2010-03-29 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* gdb.base/break-interp.exp (test_attach): Keep $interp changed. Move
|
||||||
|
its restore after the <$relink_args != ""> loop. new comment.
|
||||||
|
|
||||||
|
--- a/gdb/auxv.c
|
||||||
|
+++ b/gdb/auxv.c
|
||||||
|
@@ -96,7 +96,16 @@ ld_so_xfer_auxv (gdb_byte *readbuf,
|
||||||
|
|
||||||
|
pointer_address = SYMBOL_VALUE_ADDRESS (msym);
|
||||||
|
|
||||||
|
- data_address = read_memory_typed_address (pointer_address, ptr_type);
|
||||||
|
+ /* While it is an error I am not aware how to solve attaching to PIE under
|
||||||
|
+ valgrind --db-attach=yes different way when ld.so on-disk file has prelink
|
||||||
|
+ change in the meantime. Currently GDB will drop back to procfs_xfer_auxv
|
||||||
|
+ (so that at least non-valgrind PIE attachments with prelink change of
|
||||||
|
+ ld.so work). To make it working even with valgrind is PR 11440 requiring
|
||||||
|
+ a valgrind extension. */
|
||||||
|
+ if (target_read_memory (pointer_address, ptr_buf, ptr_size) != 0)
|
||||||
|
+ return -1;
|
||||||
|
+
|
||||||
|
+ data_address = extract_typed_address (ptr_buf, ptr_type);
|
||||||
|
|
||||||
|
/* Possibly still not initialized such as during an inferior startup. */
|
||||||
|
if (data_address == 0)
|
||||||
|
--- a/gdb/testsuite/gdb.base/break-interp.exp
|
||||||
|
+++ b/gdb/testsuite/gdb.base/break-interp.exp
|
||||||
|
@@ -419,12 +419,16 @@ proc test_attach {file displacement {relink_args ""}} {
|
||||||
|
global exec interp_saved interp
|
||||||
|
|
||||||
|
foreach relink {YES NO} {
|
||||||
|
- if {[prelink$relink $relink_args [file tail $exec]]
|
||||||
|
- && [copy $interp_saved $interp]} {
|
||||||
|
+ # It would be more correct to also [copy $interp_saved $interp]
|
||||||
|
+ # here to really test just different prelink of $exec.
|
||||||
|
+ # But we would need a separate test for different prelink of ld.so
|
||||||
|
+ # where a bug occured. It is now all merged into this single test.
|
||||||
|
+ if [prelink$relink $relink_args [file tail $exec]] {
|
||||||
|
# /proc/PID/exe cannot be loaded as it is "EXECNAME (deleted)".
|
||||||
|
test_attach_gdb $exec $pid $displacement "attach-relink$relink"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ copy $interp_saved $interp
|
||||||
|
}
|
||||||
|
|
||||||
|
remote_exec host "kill -9 $pid"
|
||||||
|
|
412
gdb-pie-3of6-relocate-once.patch
Normal file
412
gdb-pie-3of6-relocate-once.patch
Normal file
@ -0,0 +1,412 @@
|
|||||||
|
http://sourceware.org/ml/gdb-patches/2010-03/msg01001.html
|
||||||
|
Subject: [patch 3/6] PIE: Fix occasional error attaching i686 binary
|
||||||
|
|
||||||
|
[ Testcase diff backported. ]
|
||||||
|
|
||||||
|
Hi,
|
||||||
|
|
||||||
|
this is the real bugreport which started this patch series.
|
||||||
|
gdb "Cannot access memory" on a running process
|
||||||
|
https://bugzilla.redhat.com/show_bug.cgi?id=576742
|
||||||
|
|
||||||
|
Offsets on i686 cause that while attaching to an unprelinked running PIE
|
||||||
|
scan_dyntag will incorrectly get a successful read in scan_dyntag from DT_DEBUG
|
||||||
|
it expects is from the mani executable but in fact it is from some ld.so or
|
||||||
|
libc.so (located low for --exec-shield). Another issue is that scan_dyntag
|
||||||
|
could verify more that the target memory matches the .dynamic section it is
|
||||||
|
reading from exec_bfd. It could also complain when the read failed (as always
|
||||||
|
failed so for for PIE attaches first, succeeded later so nobody has noticed
|
||||||
|
anything).
|
||||||
|
|
||||||
|
The successful read reads a bogus DT_DEBUG value and GDB errors on it later.
|
||||||
|
This is again a non-fatal error after the patch by Joel Brobecker above but it
|
||||||
|
was not so before and it is incorrect anyway.
|
||||||
|
|
||||||
|
The svr4_relocate_main_executable call in svr4_special_symbol_handling was
|
||||||
|
there before delayed that way for svr4_static_exec_displacement.
|
||||||
|
But svr4_static_exec_displacement has been removed in the meantime by:
|
||||||
|
Re: RFC: Verify AT_ENTRY before using it
|
||||||
|
http://sourceware.org/ml/gdb-patches/2010-03/msg00030.html
|
||||||
|
|
||||||
|
So it can be simplified + corrected now. Moreover GDB will now finally print
|
||||||
|
exactly "Using PIE (Position Independent Executable) displacement" exactly
|
||||||
|
once.
|
||||||
|
|
||||||
|
The reproducer depends on various offsets which may be distro dependent but it
|
||||||
|
was made so that it is hopefully reproducible everywhere. Reproduced + fixed
|
||||||
|
on Fedora 12 x86_64 and i686.
|
||||||
|
|
||||||
|
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu for the whole
|
||||||
|
patch series together.
|
||||||
|
|
||||||
|
|
||||||
|
Thanks,
|
||||||
|
Jan
|
||||||
|
|
||||||
|
|
||||||
|
gdb/
|
||||||
|
2010-03-29 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* auxv.c (memory_xfer_auxv): Update attach comment.
|
||||||
|
* solib-svr4.c (svr4_special_symbol_handling): Remove the call to
|
||||||
|
svr4_relocate_main_executable.
|
||||||
|
(svr4_solib_create_inferior_hook): Make the call to
|
||||||
|
svr4_relocate_main_executable unconditional.
|
||||||
|
|
||||||
|
gdb/testsuite/
|
||||||
|
2010-03-29 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* gdb.base/attach-pie-misread.exp, gdb.base/attach-pie-misread.c: New.
|
||||||
|
|
||||||
|
--- a/gdb/auxv.c
|
||||||
|
+++ b/gdb/auxv.c
|
||||||
|
@@ -198,7 +198,8 @@ memory_xfer_auxv (struct target_ops *ops,
|
||||||
|
|
||||||
|
/* ld_so_xfer_auxv is the only function safe for virtual executables being
|
||||||
|
executed by valgrind's memcheck. As using ld_so_xfer_auxv is problematic
|
||||||
|
- during inferior startup GDB does call it only for attached processes. */
|
||||||
|
+ during inferior startup as ld.so symbol tables are not yet relocated GDB
|
||||||
|
+ calls ld_so_xfer_auxv only for attached processes. */
|
||||||
|
|
||||||
|
if (current_inferior ()->attach_flag != 0)
|
||||||
|
{
|
||||||
|
--- a/gdb/solib-svr4.c
|
||||||
|
+++ b/gdb/solib-svr4.c
|
||||||
|
@@ -1628,7 +1628,6 @@ enable_break (struct svr4_info *info, int from_tty)
|
||||||
|
static void
|
||||||
|
svr4_special_symbol_handling (void)
|
||||||
|
{
|
||||||
|
- svr4_relocate_main_executable ();
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Read the ELF program headers from ABFD. Return the contents and
|
||||||
|
@@ -2065,8 +2064,7 @@ svr4_solib_create_inferior_hook (int from_tty)
|
||||||
|
info = get_svr4_info ();
|
||||||
|
|
||||||
|
/* Relocate the main executable if necessary. */
|
||||||
|
- if (current_inferior ()->attach_flag == 0)
|
||||||
|
- svr4_relocate_main_executable ();
|
||||||
|
+ svr4_relocate_main_executable ();
|
||||||
|
|
||||||
|
if (!svr4_have_link_map_offsets ())
|
||||||
|
return;
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/gdb/testsuite/gdb.base/attach-pie-misread.c
|
||||||
|
@@ -0,0 +1,47 @@
|
||||||
|
+/* This testcase is part of GDB, the GNU debugger.
|
||||||
|
+
|
||||||
|
+ Copyright 2010 Free Software Foundation, Inc.
|
||||||
|
+
|
||||||
|
+ This program is free software; you can redistribute it and/or modify
|
||||||
|
+ it under the terms of the GNU General Public License as published by
|
||||||
|
+ the Free Software Foundation; either version 3 of the License, or
|
||||||
|
+ (at your option) any later version.
|
||||||
|
+
|
||||||
|
+ This program is distributed in the hope that it will be useful,
|
||||||
|
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
+ GNU General Public License for more details.
|
||||||
|
+
|
||||||
|
+ You should have received a copy of the GNU General Public License
|
||||||
|
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
+
|
||||||
|
+#include <stdio.h>
|
||||||
|
+#include <unistd.h>
|
||||||
|
+
|
||||||
|
+const char stub[] = {
|
||||||
|
+#ifdef GEN
|
||||||
|
+# include GEN
|
||||||
|
+#endif
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+int
|
||||||
|
+main (int argc, char **argv)
|
||||||
|
+{
|
||||||
|
+ /* Generator of GEN written in Python takes about 15s for x86_64's 4MB. */
|
||||||
|
+ if (argc == 2)
|
||||||
|
+ {
|
||||||
|
+ long count = strtol (argv[1], NULL, 0);
|
||||||
|
+
|
||||||
|
+ while (count-- > 0)
|
||||||
|
+ puts ("0x55,");
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+ }
|
||||||
|
+ if (argc != 1)
|
||||||
|
+ return 1;
|
||||||
|
+
|
||||||
|
+ puts ("sleeping");
|
||||||
|
+ fflush (stdout);
|
||||||
|
+
|
||||||
|
+ return sleep (60);
|
||||||
|
+}
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/gdb/testsuite/gdb.base/attach-pie-misread.exp
|
||||||
|
@@ -0,0 +1,209 @@
|
||||||
|
+# Copyright 2010 Free Software Foundation, Inc.
|
||||||
|
+
|
||||||
|
+# This program is free software; you can redistribute it and/or modify
|
||||||
|
+# it under the terms of the GNU General Public License as published by
|
||||||
|
+# the Free Software Foundation; either version 3 of the License, or
|
||||||
|
+# (at your option) any later version.
|
||||||
|
+#
|
||||||
|
+# This program is distributed in the hope that it will be useful,
|
||||||
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
+# GNU General Public License for more details.
|
||||||
|
+#
|
||||||
|
+# You should have received a copy of the GNU General Public License
|
||||||
|
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
+
|
||||||
|
+# This test only works on GNU/Linux.
|
||||||
|
+if { ![isnative] || [is_remote host] || ![istarget *-linux*] || [skip_shlib_tests]} {
|
||||||
|
+ continue
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+set test "attach-pie-misread"
|
||||||
|
+set srcfile ${test}.c
|
||||||
|
+set genfile ${objdir}/${subdir}/${test}-gen.h
|
||||||
|
+set executable ${test}
|
||||||
|
+set binfile ${objdir}/${subdir}/${executable}
|
||||||
|
+
|
||||||
|
+if {[build_executable ${test}.exp $executable $srcfile [list "additional_flags=-fPIE -pie"]] == -1} {
|
||||||
|
+ return -1
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+# Program Headers:
|
||||||
|
+# Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
|
||||||
|
+# LOAD 0x000000 0x0000000000400000 0x0000000000400000 0x134f5ec 0x134f5ec R E 0x200000
|
||||||
|
+# LOAD 0x134f5f0 0x000000000194f5f0 0x000000000194f5f0 0x1dbc60 0x214088 RW 0x200000
|
||||||
|
+# DYNAMIC 0x134f618 0x000000000194f618 0x000000000194f618 0x000200 0x000200 RW 0x8
|
||||||
|
+#
|
||||||
|
+proc read_phdr {binfile test} {
|
||||||
|
+ set readelf_program [transform readelf]
|
||||||
|
+ set command "exec $readelf_program -Wl $binfile"
|
||||||
|
+ verbose -log "command is $command"
|
||||||
|
+ set result [catch $command output]
|
||||||
|
+ verbose -log "result is $result"
|
||||||
|
+ verbose -log "output is $output"
|
||||||
|
+ if {$result != 0} {
|
||||||
|
+ fail $test
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
+ if ![regexp {\nProgram Headers:\n *Type [^\n]* Align\n(.*?)\n\n} $output trash phdr] {
|
||||||
|
+ fail "$test (no Program Headers)"
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
+ if ![regexp -line {^ *DYNAMIC +0x[0-9a-f]+ +(0x[0-9a-f]+) } $phdr trash dynamic_vaddr] {
|
||||||
|
+ fail "$test (no DYNAMIC found)"
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
+ verbose -log "dynamic_vaddr is $dynamic_vaddr"
|
||||||
|
+ set align_max -1
|
||||||
|
+ foreach {trash align} [regexp -line -all -inline {^ *LOAD .* (0x[0-9]+)$} $phdr] {
|
||||||
|
+ if {$align_max < $align} {
|
||||||
|
+ set align_max $align
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ verbose -log "align_max is $align_max"
|
||||||
|
+ if {$align_max == -1} {
|
||||||
|
+ fail "$test (no LOAD found)"
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
+ pass $test
|
||||||
|
+ return [list $dynamic_vaddr $align_max]
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+set phdr [read_phdr $binfile "readelf initial scan"]
|
||||||
|
+set dynamic_vaddr [lindex $phdr 0]
|
||||||
|
+set align_max [lindex $phdr 1]
|
||||||
|
+
|
||||||
|
+set stub_size [format 0x%x [expr "2 * $align_max - ($dynamic_vaddr & ($align_max - 1))"]]
|
||||||
|
+verbose -log "stub_size is $stub_size"
|
||||||
|
+
|
||||||
|
+# On x86_64 it is commonly about 4MB.
|
||||||
|
+if {$stub_size > 25000000} {
|
||||||
|
+ xfail "stub size $stub_size is too large"
|
||||||
|
+ return
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+set test "generate stub"
|
||||||
|
+set command "exec $binfile $stub_size >$genfile"
|
||||||
|
+verbose -log "command is $command"
|
||||||
|
+set result [catch $command output]
|
||||||
|
+verbose -log "result is $result"
|
||||||
|
+verbose -log "output is $output"
|
||||||
|
+if {$result == 0} {
|
||||||
|
+ pass $test
|
||||||
|
+} else {
|
||||||
|
+ fail $test
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+if {[build_executable ${test}.exp $executable $srcfile [list "additional_flags=-fPIE -pie -DGEN=\"$genfile\""]] == -1} {
|
||||||
|
+ return -1
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+# x86_64 file has 25MB, no need to keep it.
|
||||||
|
+file delete -- $genfile
|
||||||
|
+
|
||||||
|
+set phdr [read_phdr $binfile "readelf rebuilt with stub_size"]
|
||||||
|
+set dynamic_vaddr_prelinkno [lindex $phdr 0]
|
||||||
|
+
|
||||||
|
+set command "exec /usr/sbin/prelink -q -N --no-exec-shield -R $binfile"
|
||||||
|
+verbose -log "command is $command"
|
||||||
|
+set result [catch $command output]
|
||||||
|
+verbose -log "result is $result"
|
||||||
|
+verbose -log "output is $output"
|
||||||
|
+
|
||||||
|
+set test "prelink -R"
|
||||||
|
+if {$result == 0 && $output == ""} {
|
||||||
|
+ pass $test
|
||||||
|
+} elseif {$result == 1 && [regexp {^(couldn't execute "/usr/sbin/prelink[^\r\n]*": no such file or directory\n?)*$} $output]} {
|
||||||
|
+ untested attach-pie-misread.exp
|
||||||
|
+ return -1
|
||||||
|
+} else {
|
||||||
|
+ fail $test
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+set phdr [read_phdr $binfile "readelf with prelink -R"]
|
||||||
|
+set dynamic_vaddr_prelinkyes [lindex $phdr 0]
|
||||||
|
+
|
||||||
|
+set first_offset [format 0x%x [expr $dynamic_vaddr_prelinkyes - $dynamic_vaddr_prelinkno]]
|
||||||
|
+verbose -log "first_offset is $first_offset"
|
||||||
|
+
|
||||||
|
+set test "first offset is non-zero"
|
||||||
|
+if {$first_offset == 0} {
|
||||||
|
+ fail "$test (-fPIE -pie in effect?)"
|
||||||
|
+} else {
|
||||||
|
+ pass $test
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+set test "start inferior"
|
||||||
|
+gdb_exit
|
||||||
|
+
|
||||||
|
+set res [remote_spawn host $binfile];
|
||||||
|
+if { $res < 0 || $res == "" } {
|
||||||
|
+ perror "Spawning $binfile failed."
|
||||||
|
+ fail $test
|
||||||
|
+ return
|
||||||
|
+}
|
||||||
|
+set pid [exp_pid -i $res]
|
||||||
|
+gdb_expect {
|
||||||
|
+ -re "sleeping\r\n" {
|
||||||
|
+ pass $test
|
||||||
|
+ }
|
||||||
|
+ eof {
|
||||||
|
+ fail "$test (eof)"
|
||||||
|
+ remote_exec host "kill -9 $pid"
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
+ timeout {
|
||||||
|
+ fail "$test (timeout)"
|
||||||
|
+ remote_exec host "kill -9 $pid"
|
||||||
|
+ return
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+# Due to alignments it was reproducible with 1 on x86_64 but 2 on i686.
|
||||||
|
+foreach align_mult {1 2} {
|
||||||
|
+ set old_ldprefix $pf_prefix
|
||||||
|
+ lappend pf_prefix "shift-by-$align_mult:"
|
||||||
|
+
|
||||||
|
+ # FIXME: We believe there is enough room under FIRST_OFFSET.
|
||||||
|
+ set shifted_offset [format 0x%x [expr "$first_offset - $align_mult * $align_max"]]
|
||||||
|
+ verbose -log "shifted_offset is $shifted_offset"
|
||||||
|
+
|
||||||
|
+ set command "exec /usr/sbin/prelink -q -N --no-exec-shield -r $shifted_offset $binfile"
|
||||||
|
+ verbose -log "command is $command"
|
||||||
|
+ set result [catch $command output]
|
||||||
|
+ verbose -log "result is $result"
|
||||||
|
+ verbose -log "output is $output"
|
||||||
|
+
|
||||||
|
+ set test "prelink -r"
|
||||||
|
+ if {$result == 0 && $output == ""} {
|
||||||
|
+ pass $test
|
||||||
|
+ } else {
|
||||||
|
+ fail $test
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ clean_restart $executable
|
||||||
|
+
|
||||||
|
+ set test "attach"
|
||||||
|
+ gdb_test_multiple "attach $pid" $test {
|
||||||
|
+ -re "Attaching to program: .*, process $pid\r\n" {
|
||||||
|
+ # Missing "$gdb_prompt $" is intentional.
|
||||||
|
+ pass $test
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ set test "error on Cannot access memory at address"
|
||||||
|
+ gdb_test_multiple "" $test {
|
||||||
|
+ -re "\r\nCannot access memory at address .*$gdb_prompt $" {
|
||||||
|
+ fail $test
|
||||||
|
+ }
|
||||||
|
+ -re "$gdb_prompt $" {
|
||||||
|
+ pass $test
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ gdb_test "detach" "Detaching from program: .*"
|
||||||
|
+
|
||||||
|
+ set pf_prefix $old_ldprefix
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+remote_exec host "kill -9 $pid"
|
||||||
|
--- a/gdb/testsuite/gdb.base/break-interp.exp
|
||||||
|
+++ b/gdb/testsuite/gdb.base/break-interp.exp
|
||||||
|
@@ -248,9 +248,8 @@ proc reach {func command displacement} {
|
||||||
|
}
|
||||||
|
if {$displacement == $case} {
|
||||||
|
pass $test_displacement
|
||||||
|
- # Permit multiple such messages.
|
||||||
|
set displacement "FOUND-$displacement"
|
||||||
|
- } elseif {$displacement != "FOUND-$case"} {
|
||||||
|
+ } else {
|
||||||
|
fail $test_displacement
|
||||||
|
}
|
||||||
|
exp_continue
|
||||||
|
@@ -304,9 +303,8 @@ proc test_core {file displacement} {
|
||||||
|
}
|
||||||
|
if {$displacement == $case} {
|
||||||
|
pass $test_displacement
|
||||||
|
- # Permit multiple such messages.
|
||||||
|
set displacement "FOUND-$displacement"
|
||||||
|
- } elseif {$displacement != "FOUND-$case"} {
|
||||||
|
+ } else {
|
||||||
|
fail $test_displacement
|
||||||
|
}
|
||||||
|
exp_continue
|
||||||
|
@@ -362,9 +360,8 @@ proc test_attach_gdb {file pid displacement prefix} {
|
||||||
|
}
|
||||||
|
if {$displacement == $case} {
|
||||||
|
pass $test_displacement
|
||||||
|
- # Permit multiple such messages.
|
||||||
|
set displacement "FOUND-$displacement"
|
||||||
|
- } elseif {$displacement != "FOUND-$case"} {
|
||||||
|
+ } else {
|
||||||
|
fail $test_displacement
|
||||||
|
}
|
||||||
|
exp_continue
|
||||||
|
@@ -451,9 +448,7 @@
|
||||||
|
gdb_test "bt" "#0 +\[^\r\n\]*\\mdl_main\\M.*" "dl bt"
|
||||||
|
|
||||||
|
if $ifmain {
|
||||||
|
- # Displacement message will be printed the second time on initializing
|
||||||
|
- # the linker from svr4_special_symbol_handling.
|
||||||
|
- reach "main" continue $displacement
|
||||||
|
+ reach "main" continue "NONE"
|
||||||
|
|
||||||
|
reach "libfunc" continue "NONE"
|
||||||
|
|
||||||
|
@@ -528,9 +517,8 @@ proc test_ld {file ifmain trynosym displacement} {
|
||||||
|
}
|
||||||
|
if {$displacement == $case} {
|
||||||
|
pass $test_displacement
|
||||||
|
- # Permit multiple such messages.
|
||||||
|
set displacement "FOUND-$displacement"
|
||||||
|
- } elseif {$displacement != "FOUND-$case"} {
|
||||||
|
+ } else {
|
||||||
|
fail $test_displacement
|
||||||
|
}
|
||||||
|
exp_continue
|
||||||
|
|
127
gdb-pie-rerun.patch
Normal file
127
gdb-pie-rerun.patch
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
http://sourceware.org/ml/gdb-patches/2010-03/msg00868.html
|
||||||
|
Subject: [patch] PIE: Fix back re-run [Re: [patch] svr4_exec_displacement success indicator]
|
||||||
|
|
||||||
|
Hi,
|
||||||
|
|
||||||
|
currently:
|
||||||
|
|
||||||
|
$ echo 'main(){}'|gcc -o 1 -fPIE -pie -x c -; ./gdb -nx -ex 'set disable-randomization off' -ex 'b main' -ex r -ex c -ex r ./1
|
||||||
|
Breakpoint 1 at 0x6b0
|
||||||
|
Starting program: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/1
|
||||||
|
Breakpoint 1, 0x00007fbf73e8c6b0 in main ()
|
||||||
|
Continuing.
|
||||||
|
Program exited with code 0140.
|
||||||
|
Starting program: /home/jkratoch/redhat/gdb-clean/gdb/testsuite/1
|
||||||
|
Error in re-setting breakpoint 1: Cannot access memory at address 0x7fbf73e8c6ac
|
||||||
|
|
||||||
|
It is since:
|
||||||
|
[patch] svr4_exec_displacement success indicator [Re: PIE question]
|
||||||
|
http://sourceware.org/ml/gdb-patches/2010-03/msg00336.html
|
||||||
|
|
||||||
|
|
||||||
|
On Mon, 08 Mar 2010 22:53:58 +0100, Jan Kratochvil wrote:
|
||||||
|
> Attached these changes:
|
||||||
|
>
|
||||||
|
> * svr4_exec_displacement calling convention should have success indicator.
|
||||||
|
>
|
||||||
|
> * Preserving now section_offsets if they are already set, inspired by
|
||||||
|
> init_objfile_sect_indices.
|
||||||
|
>
|
||||||
|
> I believe either of parts would be sufficient for this problem.
|
||||||
|
|
||||||
|
The first part has caused the regression for PIE on native x86* GNU/Linux host.
|
||||||
|
|
||||||
|
As I believe for Daniel J.'s seen regression of `qOffsets' the second already
|
||||||
|
checked-in part is sufficient - I would like to remove the first part.
|
||||||
|
|
||||||
|
OK to check it in?
|
||||||
|
|
||||||
|
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
|
||||||
|
|
||||||
|
(I do not think one needs to think about 7.1-branch as it is not a regression
|
||||||
|
against any FSF GDB release.)
|
||||||
|
|
||||||
|
|
||||||
|
Thanks,
|
||||||
|
Jan
|
||||||
|
|
||||||
|
|
||||||
|
gdb/
|
||||||
|
2010-03-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
Fix re-run of PIE executable.
|
||||||
|
* solib-svr4.c (svr4_relocate_main_executable) <symfile_objfile>: Remove
|
||||||
|
the part of pre-set SYMFILE_OBJFILE->SECTION_OFFSETS.
|
||||||
|
|
||||||
|
gdb/testsuite/
|
||||||
|
2010-03-25 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
Fix re-run of PIE executable.
|
||||||
|
* gdb.base/break-interp.exp (test_ld): Turn off "disable-randomization".
|
||||||
|
Remove $displacement_main to match the solib-svr4.c change. New "kill"
|
||||||
|
and re-"run" of the inferior.
|
||||||
|
|
||||||
|
--- a/gdb/solib-svr4.c
|
||||||
|
+++ b/gdb/solib-svr4.c
|
||||||
|
@@ -1791,17 +1791,10 @@ svr4_relocate_main_executable (void)
|
||||||
|
{
|
||||||
|
CORE_ADDR displacement;
|
||||||
|
|
||||||
|
- if (symfile_objfile)
|
||||||
|
- {
|
||||||
|
- int i;
|
||||||
|
-
|
||||||
|
- /* Remote target may have already set specific offsets by `qOffsets'
|
||||||
|
- which should be preferred. */
|
||||||
|
-
|
||||||
|
- for (i = 0; i < symfile_objfile->num_sections; i++)
|
||||||
|
- if (ANOFFSET (symfile_objfile->section_offsets, i) != 0)
|
||||||
|
- return;
|
||||||
|
- }
|
||||||
|
+ /* SYMFILE_OBJFILE->SECTION_OFFSETS may now contain displacement from the
|
||||||
|
+ previous run of the inferior. Re-set it according to the current value,
|
||||||
|
+ if we can find it out. But otherwise keep it as for remote target it may
|
||||||
|
+ have been pre-set by the `qOffsets' packet. */
|
||||||
|
|
||||||
|
if (! svr4_exec_displacement (&displacement))
|
||||||
|
return;
|
||||||
|
--- a/gdb/testsuite/gdb.base/break-interp.exp
|
||||||
|
+++ b/gdb/testsuite/gdb.base/break-interp.exp
|
||||||
|
@@ -416,25 +416,28 @@ proc test_ld {file ifmain trynosym displacement} {
|
||||||
|
# Print the "PIE (Position Independent Executable) displacement" message.
|
||||||
|
gdb_test "set verbose on"
|
||||||
|
|
||||||
|
+ # A bit better test coverage.
|
||||||
|
+ gdb_test "set disable-randomization off"
|
||||||
|
+
|
||||||
|
reach "dl_main" "run segv" $displacement
|
||||||
|
|
||||||
|
gdb_test "bt" "#0 +\[^\r\n\]*\\mdl_main\\M.*" "dl bt"
|
||||||
|
|
||||||
|
if $ifmain {
|
||||||
|
# Displacement message will be printed the second time on initializing
|
||||||
|
- # the linker from svr4_special_symbol_handling. If any ANOFFSET has
|
||||||
|
- # been already set as non-zero the detection will no longer be run.
|
||||||
|
- if {$displacement == "NONZERO"} {
|
||||||
|
- set displacement_main "NONE"
|
||||||
|
- } else {
|
||||||
|
- set displacement_main $displacement
|
||||||
|
- }
|
||||||
|
- reach "main" continue $displacement_main
|
||||||
|
+ # the linker from svr4_special_symbol_handling.
|
||||||
|
+ reach "main" continue $displacement
|
||||||
|
|
||||||
|
reach "libfunc" continue "NONE"
|
||||||
|
|
||||||
|
gdb_test "bt" "#0 +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#1 +\[^\r\n\]*\\mmain\\M.*" "main bt"
|
||||||
|
+ }
|
||||||
|
|
||||||
|
+ # Try re-run if the new PIE displacement takes effect.
|
||||||
|
+ gdb_test "kill" "" "kill" {Kill the program being debugged\? \(y or n\) } "y"
|
||||||
|
+ reach "dl_main" "run segv" $displacement
|
||||||
|
+
|
||||||
|
+ if $ifmain {
|
||||||
|
test_core $file $displacement
|
||||||
|
|
||||||
|
test_attach $file $displacement
|
||||||
|
|
@ -1,648 +0,0 @@
|
|||||||
http://sourceware.org/ml/gdb-patches/2009-11/msg00596.html
|
|
||||||
Subject: [gdb FYI-patch] callback-mode readline-6.0 regression
|
|
||||||
|
|
||||||
Hi Chet,
|
|
||||||
|
|
||||||
FSF GDB currently ships bundled with readline-5.2 which works fine.
|
|
||||||
But using --with-system-readline and readline-6.0-patchlevel4 has
|
|
||||||
a regression:
|
|
||||||
|
|
||||||
readline-5.2: Run `gdb -nx -q' and type CTRL-C:
|
|
||||||
(gdb) Quit
|
|
||||||
(gdb) _
|
|
||||||
|
|
||||||
readline-6.0: Run `gdb -nx -q' and type CTRL-C:
|
|
||||||
(gdb) _
|
|
||||||
= nothing happens (it gets buffered and executed later)
|
|
||||||
(It does also FAIL on gdb.gdb/selftest.exp.)
|
|
||||||
|
|
||||||
It is because GDB waits in its own poll() mainloop and readline uses via
|
|
||||||
rl_callback_handler_install and rl_callback_handler_remove. This way the
|
|
||||||
readline internal variable _rl_interrupt_immediately remains 0 and CTRL-C gets
|
|
||||||
only stored to _rl_caught_signal but not executed.
|
|
||||||
|
|
||||||
Seen in rl_signal_handler even if _rl_interrupt_immediately is set and
|
|
||||||
_rl_handle_signal is called then the signal is still stored to
|
|
||||||
_rl_caught_signal. In the _rl_interrupt_immediately case it should not be
|
|
||||||
stored when it was already processed.
|
|
||||||
|
|
||||||
rl_signal_handler does `_rl_interrupt_immediately = 0;' - while I am not aware
|
|
||||||
of its meaning it breaks the nest-counting of other routines which do
|
|
||||||
`_rl_interrupt_immediately++;' and `_rl_interrupt_immediately--;' possibly
|
|
||||||
creating problematic `_rl_interrupt_immediately == -1'.
|
|
||||||
|
|
||||||
`_rl_interrupt_immediately' is an internal variable, how it could be accessed
|
|
||||||
by a readline application? (OK, maybe it should not be used.)
|
|
||||||
|
|
||||||
Attaching a current GDB-side patch but it must access readline internal
|
|
||||||
variable _rl_caught_signal and it is generally just a workaround. Could you
|
|
||||||
please include support for signals in this asynchronous mode in readline-6.1?
|
|
||||||
I find it would be enough to make RL_CHECK_SIGNALS public?
|
|
||||||
|
|
||||||
|
|
||||||
GDB: No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
|
|
||||||
But this is not a patch intended to be accepted.
|
|
||||||
|
|
||||||
|
|
||||||
Thanks,
|
|
||||||
Jan
|
|
||||||
|
|
||||||
|
|
||||||
gdb/
|
|
||||||
2009-11-29 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
||||||
|
|
||||||
* config.in, configure: Regenerate.
|
|
||||||
* configure.ac (for readline_echoing_p): Move inside $LIBS change.
|
|
||||||
(for _rl_caught_signal): New.
|
|
||||||
* event-loop.c: Include readline/readline.h.
|
|
||||||
(gdb_do_one_event) [HAVE_READLINE_CAUGHT_SIGNAL]: New.
|
|
||||||
|
|
||||||
gdb/testsuite/
|
|
||||||
2009-11-29 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
||||||
|
|
||||||
* gdb.gdb/selftest.exp (backtrace through signal handler): Move before
|
|
||||||
SIGINT pass, drop the timeout case.
|
|
||||||
(send SIGINT signal to child process): Use gdb_test.
|
|
||||||
(backtrace through readline handler): New.
|
|
||||||
|
|
||||||
Index: gdb-7.0.50.20100115/gdb/config.in
|
|
||||||
===================================================================
|
|
||||||
--- gdb-7.0.50.20100115.orig/gdb/config.in 2010-01-15 12:48:04.000000000 +0100
|
|
||||||
+++ gdb-7.0.50.20100115/gdb/config.in 2010-01-15 12:48:40.000000000 +0100
|
|
||||||
@@ -359,6 +359,9 @@
|
|
||||||
/* Define if Python interpreter is being linked in. */
|
|
||||||
#undef HAVE_PYTHON
|
|
||||||
|
|
||||||
+/* readline-6.0 workaround of blocked signals. */
|
|
||||||
+#undef HAVE_READLINE_CAUGHT_SIGNAL
|
|
||||||
+
|
|
||||||
/* Define to 1 if you have the `realpath' function. */
|
|
||||||
#undef HAVE_REALPATH
|
|
||||||
|
|
||||||
Index: gdb-7.0.50.20100115/gdb/configure.ac
|
|
||||||
===================================================================
|
|
||||||
--- gdb-7.0.50.20100115.orig/gdb/configure.ac 2010-01-15 12:48:04.000000000 +0100
|
|
||||||
+++ gdb-7.0.50.20100115/gdb/configure.ac 2010-01-15 12:48:40.000000000 +0100
|
|
||||||
@@ -777,17 +777,25 @@ if test "$with_system_readline" = yes; t
|
|
||||||
# readline-6.0 started to use the name `_rl_echoing_p'.
|
|
||||||
# `$(READLINE_DIR)/' of bundled readline would not resolve in configure.
|
|
||||||
|
|
||||||
- AC_MSG_CHECKING([for readline_echoing_p])
|
|
||||||
save_LIBS=$LIBS
|
|
||||||
LIBS="$LIBS $READLINE"
|
|
||||||
+ AC_MSG_CHECKING([for readline_echoing_p])
|
|
||||||
AC_LINK_IFELSE(AC_LANG_PROGRAM(,[[extern int readline_echoing_p;
|
|
||||||
return readline_echoing_p;]]),
|
|
||||||
[READLINE_ECHOING_P=yes],
|
|
||||||
[READLINE_ECHOING_P=no
|
|
||||||
AC_DEFINE([readline_echoing_p], [_rl_echoing_p],
|
|
||||||
[readline-6.0 started to use different name.])])
|
|
||||||
- LIBS="$save_LIBS"
|
|
||||||
AC_MSG_RESULT([$READLINE_ECHOING_P])
|
|
||||||
+ AC_MSG_CHECKING([for _rl_caught_signal])
|
|
||||||
+ AC_LINK_IFELSE(AC_LANG_PROGRAM(,[[extern int volatile _rl_caught_signal;
|
|
||||||
+ return _rl_caught_signal;]]),
|
|
||||||
+ [READLINE_CAUGHT_SIGNAL=yes
|
|
||||||
+ AC_DEFINE([HAVE_READLINE_CAUGHT_SIGNAL],,
|
|
||||||
+ [readline-6.0 workaround of blocked signals.])],
|
|
||||||
+ [READLINE_CAUGHT_SIGNAL=no])
|
|
||||||
+ AC_MSG_RESULT([$READLINE_CAUGHT_SIGNAL])
|
|
||||||
+ LIBS="$save_LIBS"
|
|
||||||
else
|
|
||||||
READLINE='$(READLINE_DIR)/libreadline.a'
|
|
||||||
READLINE_DEPS='$(READLINE)'
|
|
||||||
Index: gdb-7.0.50.20100115/gdb/event-loop.c
|
|
||||||
===================================================================
|
|
||||||
--- gdb-7.0.50.20100115.orig/gdb/event-loop.c 2010-01-01 08:31:31.000000000 +0100
|
|
||||||
+++ gdb-7.0.50.20100115/gdb/event-loop.c 2010-01-15 12:48:40.000000000 +0100
|
|
||||||
@@ -37,6 +37,7 @@
|
|
||||||
#include "exceptions.h"
|
|
||||||
#include "gdb_assert.h"
|
|
||||||
#include "gdb_select.h"
|
|
||||||
+#include "readline/readline.h"
|
|
||||||
|
|
||||||
/* Data point to pass to the event handler. */
|
|
||||||
typedef union event_data
|
|
||||||
@@ -411,6 +412,9 @@ gdb_do_one_event (void *data)
|
|
||||||
static int event_source_head = 0;
|
|
||||||
const int number_of_sources = 3;
|
|
||||||
int current = 0;
|
|
||||||
+#ifdef HAVE_READLINE_CAUGHT_SIGNAL
|
|
||||||
+ extern int volatile _rl_caught_signal;
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
/* Any events already waiting in the queue? */
|
|
||||||
if (process_event ())
|
|
||||||
@@ -455,6 +459,16 @@ gdb_do_one_event (void *data)
|
|
||||||
if (gdb_wait_for_event (1) < 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
+#ifdef HAVE_READLINE_CAUGHT_SIGNAL
|
|
||||||
+ if (async_command_editing_p && RL_ISSTATE (RL_STATE_CALLBACK)
|
|
||||||
+ && _rl_caught_signal)
|
|
||||||
+ {
|
|
||||||
+ /* Call RL_CHECK_SIGNALS this way. */
|
|
||||||
+ rl_callback_handler_remove ();
|
|
||||||
+ rl_callback_handler_install (NULL, input_handler);
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
/* Handle any new events occurred while waiting. */
|
|
||||||
if (process_event ())
|
|
||||||
return 1;
|
|
||||||
Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.gdb/selftest.exp
|
|
||||||
===================================================================
|
|
||||||
--- gdb-7.0.50.20100115.orig/gdb/testsuite/gdb.gdb/selftest.exp 2010-01-15 12:48:01.000000000 +0100
|
|
||||||
+++ gdb-7.0.50.20100115/gdb/testsuite/gdb.gdb/selftest.exp 2010-01-15 12:48:40.000000000 +0100
|
|
||||||
@@ -471,31 +471,42 @@ GDB.*Copyright \[0-9\]+ Free Software Fo
|
|
||||||
fail "$description (timeout)"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-
|
|
||||||
- set description "send SIGINT signal to child process"
|
|
||||||
- send_gdb "signal SIGINT\n"
|
|
||||||
- gdb_expect {
|
|
||||||
- -re "Continuing with signal SIGINT.*$gdb_prompt $" {
|
|
||||||
+
|
|
||||||
+ # get a stack trace with the poll function
|
|
||||||
+ #
|
|
||||||
+ # This fails on some linux systems for unknown reasons. On the
|
|
||||||
+ # systems where it fails, sometimes it works fine when run manually.
|
|
||||||
+ # The testsuite failures may not be limited to just aout systems.
|
|
||||||
+ setup_xfail "i*86-pc-linuxaout-gnu"
|
|
||||||
+ set description "backtrace through signal handler"
|
|
||||||
+ gdb_test_multiple "backtrace" $description {
|
|
||||||
+ -re "#0.*(read|poll).*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
|
|
||||||
pass "$description"
|
|
||||||
}
|
|
||||||
-re ".*$gdb_prompt $" {
|
|
||||||
+ # On the alpha, we hit the infamous problem about gdb
|
|
||||||
+ # being unable to get the frame pointer (mentioned in
|
|
||||||
+ # gdb/README). As it is intermittent, there is no way to
|
|
||||||
+ # XFAIL it which will give us an XPASS if the problem goes
|
|
||||||
+ # away.
|
|
||||||
+ setup_xfail "alpha*-*-osf*"
|
|
||||||
fail "$description"
|
|
||||||
}
|
|
||||||
- timeout {
|
|
||||||
- fail "$description (timeout)"
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
|
|
||||||
- # get a stack trace
|
|
||||||
+ gdb_test "signal SIGINT" "Continuing with signal SIGINT.*" \
|
|
||||||
+ "send SIGINT signal to child process"
|
|
||||||
+
|
|
||||||
+ # get a stack trace being redelivered by readline
|
|
||||||
#
|
|
||||||
# This fails on some linux systems for unknown reasons. On the
|
|
||||||
# systems where it fails, sometimes it works fine when run manually.
|
|
||||||
# The testsuite failures may not be limited to just aout systems.
|
|
||||||
+ # Optional system readline may not have symbols to be shown.
|
|
||||||
setup_xfail "i*86-pc-linuxaout-gnu"
|
|
||||||
- set description "backtrace through signal handler"
|
|
||||||
- send_gdb "backtrace\n"
|
|
||||||
- gdb_expect {
|
|
||||||
- -re "#0.*(read|poll).*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
|
|
||||||
+ set description "backtrace through readline handler"
|
|
||||||
+ gdb_test_multiple "backtrace" $description {
|
|
||||||
+ -re "#0.*gdb_do_one_event.*in main \\(.*\\) at .*gdb\\.c.*$gdb_prompt $" {
|
|
||||||
pass "$description"
|
|
||||||
}
|
|
||||||
-re ".*$gdb_prompt $" {
|
|
||||||
@@ -507,9 +518,6 @@ GDB.*Copyright \[0-9\]+ Free Software Fo
|
|
||||||
setup_xfail "alpha*-*-osf*"
|
|
||||||
fail "$description"
|
|
||||||
}
|
|
||||||
- timeout {
|
|
||||||
- fail "$description (timeout)"
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
Index: gdb-7.0.50.20100115/gdb/configure
|
|
||||||
===================================================================
|
|
||||||
--- gdb-7.0.50.20100115.orig/gdb/configure 2010-01-15 12:48:04.000000000 +0100
|
|
||||||
+++ gdb-7.0.50.20100115/gdb/configure 2010-01-15 12:48:46.000000000 +0100
|
|
||||||
@@ -6772,6 +6772,185 @@ else
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+# Check whether --with-separate-debug-dir was given.
|
|
||||||
+if test "${with_separate_debug_dir+set}" = set; then :
|
|
||||||
+ withval=$with_separate_debug_dir;
|
|
||||||
+ DEBUGDIR=$withval
|
|
||||||
+else
|
|
||||||
+ DEBUGDIR=${libdir}/debug
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
|
||||||
+ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
|
||||||
+ ac_define_dir=`eval echo $DEBUGDIR`
|
|
||||||
+ ac_define_dir=`eval echo $ac_define_dir`
|
|
||||||
+
|
|
||||||
+cat >>confdefs.h <<_ACEOF
|
|
||||||
+#define DEBUGDIR "$ac_define_dir"
|
|
||||||
+_ACEOF
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
|
|
||||||
+ if test "x$prefix" = xNONE; then
|
|
||||||
+ test_prefix=/usr/local
|
|
||||||
+ else
|
|
||||||
+ test_prefix=$prefix
|
|
||||||
+ fi
|
|
||||||
+ else
|
|
||||||
+ test_prefix=$exec_prefix
|
|
||||||
+ fi
|
|
||||||
+ value=0
|
|
||||||
+ case ${ac_define_dir} in
|
|
||||||
+ "${test_prefix}"|"${test_prefix}/"*|\
|
|
||||||
+ '${exec_prefix}'|'${exec_prefix}/'*)
|
|
||||||
+ value=1
|
|
||||||
+ ;;
|
|
||||||
+ esac
|
|
||||||
+
|
|
||||||
+cat >>confdefs.h <<_ACEOF
|
|
||||||
+#define DEBUGDIR_RELOCATABLE $value
|
|
||||||
+_ACEOF
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+# GDB's datadir relocation
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+# Check whether --with-gdb-datadir was given.
|
|
||||||
+if test "${with_gdb_datadir+set}" = set; then :
|
|
||||||
+ withval=$with_gdb_datadir;
|
|
||||||
+ GDB_DATADIR=$withval
|
|
||||||
+else
|
|
||||||
+ GDB_DATADIR=${datadir}/gdb
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
|
||||||
+ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
|
||||||
+ ac_define_dir=`eval echo $GDB_DATADIR`
|
|
||||||
+ ac_define_dir=`eval echo $ac_define_dir`
|
|
||||||
+
|
|
||||||
+cat >>confdefs.h <<_ACEOF
|
|
||||||
+#define GDB_DATADIR "$ac_define_dir"
|
|
||||||
+_ACEOF
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
|
|
||||||
+ if test "x$prefix" = xNONE; then
|
|
||||||
+ test_prefix=/usr/local
|
|
||||||
+ else
|
|
||||||
+ test_prefix=$prefix
|
|
||||||
+ fi
|
|
||||||
+ else
|
|
||||||
+ test_prefix=$exec_prefix
|
|
||||||
+ fi
|
|
||||||
+ value=0
|
|
||||||
+ case ${ac_define_dir} in
|
|
||||||
+ "${test_prefix}"|"${test_prefix}/"*|\
|
|
||||||
+ '${exec_prefix}'|'${exec_prefix}/'*)
|
|
||||||
+ value=1
|
|
||||||
+ ;;
|
|
||||||
+ esac
|
|
||||||
+
|
|
||||||
+cat >>confdefs.h <<_ACEOF
|
|
||||||
+#define GDB_DATADIR_RELOCATABLE $value
|
|
||||||
+_ACEOF
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+# Check whether --with-relocated-sources was given.
|
|
||||||
+if test "${with_relocated_sources+set}" = set; then :
|
|
||||||
+ withval=$with_relocated_sources; reloc_srcdir="${withval}"
|
|
||||||
+
|
|
||||||
+ test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
|
||||||
+ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
|
||||||
+ ac_define_dir=`eval echo $reloc_srcdir`
|
|
||||||
+ ac_define_dir=`eval echo $ac_define_dir`
|
|
||||||
+
|
|
||||||
+cat >>confdefs.h <<_ACEOF
|
|
||||||
+#define RELOC_SRCDIR "$ac_define_dir"
|
|
||||||
+_ACEOF
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+# GDB's datadir relocation
|
|
||||||
+
|
|
||||||
+gdbdatadir=${datadir}/gdb
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+# Check whether --with-gdb-datadir was given.
|
|
||||||
+if test "${with_gdb_datadir+set}" = set; then :
|
|
||||||
+ withval=$with_gdb_datadir; gdbdatadir="${withval}"
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+ test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
|
||||||
+ test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
|
||||||
+ ac_define_dir=`eval echo $gdbdatadir`
|
|
||||||
+ ac_define_dir=`eval echo $ac_define_dir`
|
|
||||||
+
|
|
||||||
+cat >>confdefs.h <<_ACEOF
|
|
||||||
+#define GDB_DATADIR "$ac_define_dir"
|
|
||||||
+_ACEOF
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
|
|
||||||
+ if test "x$prefix" = xNONE; then
|
|
||||||
+ test_prefix=/usr/local
|
|
||||||
+ else
|
|
||||||
+ test_prefix=$prefix
|
|
||||||
+ fi
|
|
||||||
+else
|
|
||||||
+ test_prefix=$exec_prefix
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
+case ${gdbdatadir} in
|
|
||||||
+ "${test_prefix}"|"${test_prefix}/"*|\
|
|
||||||
+ '${exec_prefix}'|'${exec_prefix}/'*)
|
|
||||||
+
|
|
||||||
+$as_echo "#define GDB_DATADIR_RELOCATABLE 1" >>confdefs.h
|
|
||||||
+
|
|
||||||
+ ;;
|
|
||||||
+esac
|
|
||||||
+GDB_DATADIR_PATH=${gdbdatadir}
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+# Check whether --with-pythondir was given.
|
|
||||||
+if test "${with_pythondir+set}" = set; then :
|
|
||||||
+ withval=$with_pythondir; pythondir="${withval}"
|
|
||||||
+else
|
|
||||||
+ pythondir=no
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+# If the user passed in a path, define it. Otherwise, compute it at
|
|
||||||
+# runtime based on the possibly-relocatable datadir.
|
|
||||||
+if test "$pythondir" = "no"; then
|
|
||||||
+ pythondir='$(GDB_DATADIR_PATH)/python'
|
|
||||||
+else
|
|
||||||
+
|
|
||||||
+cat >>confdefs.h <<_ACEOF
|
|
||||||
+#define PYTHONDIR "$pythondir"
|
|
||||||
+_ACEOF
|
|
||||||
+
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
+
|
|
||||||
# Integration with rpm library to support missing debuginfo suggestions.
|
|
||||||
# --without-rpm: Disable any rpm support.
|
|
||||||
# --with-rpm=libname.so: Try to dynamically open `libname.so' during runtime.
|
|
||||||
@@ -7255,185 +7434,6 @@ fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
-
|
|
||||||
-# Check whether --with-separate-debug-dir was given.
|
|
||||||
-if test "${with_separate_debug_dir+set}" = set; then :
|
|
||||||
- withval=$with_separate_debug_dir;
|
|
||||||
- DEBUGDIR=$withval
|
|
||||||
-else
|
|
||||||
- DEBUGDIR=${libdir}/debug
|
|
||||||
-fi
|
|
||||||
-
|
|
||||||
-
|
|
||||||
- test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
|
||||||
- test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
|
||||||
- ac_define_dir=`eval echo $DEBUGDIR`
|
|
||||||
- ac_define_dir=`eval echo $ac_define_dir`
|
|
||||||
-
|
|
||||||
-cat >>confdefs.h <<_ACEOF
|
|
||||||
-#define DEBUGDIR "$ac_define_dir"
|
|
||||||
-_ACEOF
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-
|
|
||||||
- if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
|
|
||||||
- if test "x$prefix" = xNONE; then
|
|
||||||
- test_prefix=/usr/local
|
|
||||||
- else
|
|
||||||
- test_prefix=$prefix
|
|
||||||
- fi
|
|
||||||
- else
|
|
||||||
- test_prefix=$exec_prefix
|
|
||||||
- fi
|
|
||||||
- value=0
|
|
||||||
- case ${ac_define_dir} in
|
|
||||||
- "${test_prefix}"|"${test_prefix}/"*|\
|
|
||||||
- '${exec_prefix}'|'${exec_prefix}/'*)
|
|
||||||
- value=1
|
|
||||||
- ;;
|
|
||||||
- esac
|
|
||||||
-
|
|
||||||
-cat >>confdefs.h <<_ACEOF
|
|
||||||
-#define DEBUGDIR_RELOCATABLE $value
|
|
||||||
-_ACEOF
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-# GDB's datadir relocation
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-# Check whether --with-gdb-datadir was given.
|
|
||||||
-if test "${with_gdb_datadir+set}" = set; then :
|
|
||||||
- withval=$with_gdb_datadir;
|
|
||||||
- GDB_DATADIR=$withval
|
|
||||||
-else
|
|
||||||
- GDB_DATADIR=${datadir}/gdb
|
|
||||||
-fi
|
|
||||||
-
|
|
||||||
-
|
|
||||||
- test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
|
||||||
- test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
|
||||||
- ac_define_dir=`eval echo $GDB_DATADIR`
|
|
||||||
- ac_define_dir=`eval echo $ac_define_dir`
|
|
||||||
-
|
|
||||||
-cat >>confdefs.h <<_ACEOF
|
|
||||||
-#define GDB_DATADIR "$ac_define_dir"
|
|
||||||
-_ACEOF
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-
|
|
||||||
- if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
|
|
||||||
- if test "x$prefix" = xNONE; then
|
|
||||||
- test_prefix=/usr/local
|
|
||||||
- else
|
|
||||||
- test_prefix=$prefix
|
|
||||||
- fi
|
|
||||||
- else
|
|
||||||
- test_prefix=$exec_prefix
|
|
||||||
- fi
|
|
||||||
- value=0
|
|
||||||
- case ${ac_define_dir} in
|
|
||||||
- "${test_prefix}"|"${test_prefix}/"*|\
|
|
||||||
- '${exec_prefix}'|'${exec_prefix}/'*)
|
|
||||||
- value=1
|
|
||||||
- ;;
|
|
||||||
- esac
|
|
||||||
-
|
|
||||||
-cat >>confdefs.h <<_ACEOF
|
|
||||||
-#define GDB_DATADIR_RELOCATABLE $value
|
|
||||||
-_ACEOF
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-# Check whether --with-relocated-sources was given.
|
|
||||||
-if test "${with_relocated_sources+set}" = set; then :
|
|
||||||
- withval=$with_relocated_sources; reloc_srcdir="${withval}"
|
|
||||||
-
|
|
||||||
- test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
|
||||||
- test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
|
||||||
- ac_define_dir=`eval echo $reloc_srcdir`
|
|
||||||
- ac_define_dir=`eval echo $ac_define_dir`
|
|
||||||
-
|
|
||||||
-cat >>confdefs.h <<_ACEOF
|
|
||||||
-#define RELOC_SRCDIR "$ac_define_dir"
|
|
||||||
-_ACEOF
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-fi
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-# GDB's datadir relocation
|
|
||||||
-
|
|
||||||
-gdbdatadir=${datadir}/gdb
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-# Check whether --with-gdb-datadir was given.
|
|
||||||
-if test "${with_gdb_datadir+set}" = set; then :
|
|
||||||
- withval=$with_gdb_datadir; gdbdatadir="${withval}"
|
|
||||||
-fi
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-
|
|
||||||
- test "x$prefix" = xNONE && prefix="$ac_default_prefix"
|
|
||||||
- test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
|
|
||||||
- ac_define_dir=`eval echo $gdbdatadir`
|
|
||||||
- ac_define_dir=`eval echo $ac_define_dir`
|
|
||||||
-
|
|
||||||
-cat >>confdefs.h <<_ACEOF
|
|
||||||
-#define GDB_DATADIR "$ac_define_dir"
|
|
||||||
-_ACEOF
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
|
|
||||||
- if test "x$prefix" = xNONE; then
|
|
||||||
- test_prefix=/usr/local
|
|
||||||
- else
|
|
||||||
- test_prefix=$prefix
|
|
||||||
- fi
|
|
||||||
-else
|
|
||||||
- test_prefix=$exec_prefix
|
|
||||||
-fi
|
|
||||||
-
|
|
||||||
-case ${gdbdatadir} in
|
|
||||||
- "${test_prefix}"|"${test_prefix}/"*|\
|
|
||||||
- '${exec_prefix}'|'${exec_prefix}/'*)
|
|
||||||
-
|
|
||||||
-$as_echo "#define GDB_DATADIR_RELOCATABLE 1" >>confdefs.h
|
|
||||||
-
|
|
||||||
- ;;
|
|
||||||
-esac
|
|
||||||
-GDB_DATADIR_PATH=${gdbdatadir}
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-# Check whether --with-pythondir was given.
|
|
||||||
-if test "${with_pythondir+set}" = set; then :
|
|
||||||
- withval=$with_pythondir; pythondir="${withval}"
|
|
||||||
-else
|
|
||||||
- pythondir=no
|
|
||||||
-fi
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-# If the user passed in a path, define it. Otherwise, compute it at
|
|
||||||
-# runtime based on the possibly-relocatable datadir.
|
|
||||||
-if test "$pythondir" = "no"; then
|
|
||||||
- pythondir='$(GDB_DATADIR_PATH)/python'
|
|
||||||
-else
|
|
||||||
-
|
|
||||||
-cat >>confdefs.h <<_ACEOF
|
|
||||||
-#define PYTHONDIR "$pythondir"
|
|
||||||
-_ACEOF
|
|
||||||
-
|
|
||||||
-fi
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-
|
|
||||||
-
|
|
||||||
subdirs="$subdirs doc testsuite"
|
|
||||||
|
|
||||||
|
|
||||||
@@ -9290,10 +9290,10 @@ if test "$with_system_readline" = yes; t
|
|
||||||
# readline-6.0 started to use the name `_rl_echoing_p'.
|
|
||||||
# `$(READLINE_DIR)/' of bundled readline would not resolve in configure.
|
|
||||||
|
|
||||||
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline_echoing_p" >&5
|
|
||||||
-$as_echo_n "checking for readline_echoing_p... " >&6; }
|
|
||||||
save_LIBS=$LIBS
|
|
||||||
LIBS="$LIBS $READLINE"
|
|
||||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for readline_echoing_p" >&5
|
|
||||||
+$as_echo_n "checking for readline_echoing_p... " >&6; }
|
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
||||||
/* end confdefs.h. */
|
|
||||||
|
|
||||||
@@ -9316,9 +9316,35 @@ $as_echo "#define readline_echoing_p _rl
|
|
||||||
fi
|
|
||||||
rm -f core conftest.err conftest.$ac_objext \
|
|
||||||
conftest$ac_exeext conftest.$ac_ext
|
|
||||||
- LIBS="$save_LIBS"
|
|
||||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINE_ECHOING_P" >&5
|
|
||||||
$as_echo "$READLINE_ECHOING_P" >&6; }
|
|
||||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _rl_caught_signal" >&5
|
|
||||||
+$as_echo_n "checking for _rl_caught_signal... " >&6; }
|
|
||||||
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
|
||||||
+/* end confdefs.h. */
|
|
||||||
+
|
|
||||||
+int
|
|
||||||
+main ()
|
|
||||||
+{
|
|
||||||
+extern int volatile _rl_caught_signal;
|
|
||||||
+ return _rl_caught_signal;
|
|
||||||
+ ;
|
|
||||||
+ return 0;
|
|
||||||
+}
|
|
||||||
+_ACEOF
|
|
||||||
+if ac_fn_c_try_link "$LINENO"; then :
|
|
||||||
+ READLINE_CAUGHT_SIGNAL=yes
|
|
||||||
+
|
|
||||||
+$as_echo "#define HAVE_READLINE_CAUGHT_SIGNAL /**/" >>confdefs.h
|
|
||||||
+
|
|
||||||
+else
|
|
||||||
+ READLINE_CAUGHT_SIGNAL=no
|
|
||||||
+fi
|
|
||||||
+rm -f core conftest.err conftest.$ac_objext \
|
|
||||||
+ conftest$ac_exeext conftest.$ac_ext
|
|
||||||
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READLINE_CAUGHT_SIGNAL" >&5
|
|
||||||
+$as_echo "$READLINE_CAUGHT_SIGNAL" >&6; }
|
|
||||||
+ LIBS="$save_LIBS"
|
|
||||||
else
|
|
||||||
READLINE='$(READLINE_DIR)/libreadline.a'
|
|
||||||
READLINE_DEPS='$(READLINE)'
|
|
@ -69,7 +69,7 @@ Index: gdb-7.0.50.20100115/gdb/testsuite/gdb.base/break-interp.exp
|
|||||||
}
|
}
|
||||||
|
|
||||||
@@ -480,9 +500,33 @@ foreach ldprelink {NO YES} {
|
@@ -480,9 +500,33 @@ foreach ldprelink {NO YES} {
|
||||||
if {$binpie == "YES"} {
|
if {$binpie != "NO"} {
|
||||||
lappend opts {additional_flags=-fPIE -pie}
|
lappend opts {additional_flags=-fPIE -pie}
|
||||||
}
|
}
|
||||||
- if {[build_executable ${test}.exp [file tail $exec] $srcfile $opts] == -1} {
|
- if {[build_executable ${test}.exp [file tail $exec] $srcfile $opts] == -1} {
|
||||||
|
41
gdb-solib-memory-error-nonfatal.patch
Normal file
41
gdb-solib-memory-error-nonfatal.patch
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
[RFC/ia64] memory error when reading wrong core file
|
||||||
|
http://sourceware.org/ml/gdb-patches/2010-01/msg00645.html
|
||||||
|
http://sourceware.org/ml/gdb-patches/2010-02/msg00001.html
|
||||||
|
http://sourceware.org/ml/gdb-patches/2010-03/msg00298.html
|
||||||
|
http://sourceware.org/ml/gdb-cvs/2010-03/msg00065.html
|
||||||
|
c961a8da422283662e09ee498c0598d48fc9d70f
|
||||||
|
|
||||||
|
--- src/gdb/solib-svr4.c 2010/02/24 00:29:02 1.125
|
||||||
|
+++ src/gdb/solib-svr4.c 2010/03/08 07:45:49 1.126
|
||||||
|
@@ -868,9 +868,16 @@
|
||||||
|
{
|
||||||
|
struct link_map_offsets *lmo = svr4_fetch_link_map_offsets ();
|
||||||
|
struct type *ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
|
||||||
|
+ CORE_ADDR addr = 0;
|
||||||
|
+ volatile struct gdb_exception ex;
|
||||||
|
|
||||||
|
- return read_memory_typed_address (info->debug_base + lmo->r_map_offset,
|
||||||
|
- ptr_type);
|
||||||
|
+ TRY_CATCH (ex, RETURN_MASK_ERROR)
|
||||||
|
+ {
|
||||||
|
+ addr = read_memory_typed_address (info->debug_base + lmo->r_map_offset,
|
||||||
|
+ ptr_type);
|
||||||
|
+ }
|
||||||
|
+ exception_print (gdb_stderr, ex);
|
||||||
|
+ return addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Find r_brk from the inferior's debug base. */
|
||||||
|
### src/gdb/ChangeLog 2010/03/08 01:49:30 1.11441
|
||||||
|
### src/gdb/ChangeLog 2010/03/08 07:45:49 1.11442
|
||||||
|
## -1,3 +1,10 @@
|
||||||
|
+2010-03-08 Joel Brobecker <brobecker@adacore.com>
|
||||||
|
+
|
||||||
|
+ Memory error when reading wrong core file.
|
||||||
|
+ * solib-svr4.c (solib_svr4_r_map): catch and print all exception
|
||||||
|
+ errors while reading the inferior memory, and return zero if
|
||||||
|
+ an exception was raised.
|
||||||
|
+
|
||||||
|
2010-03-07 Michael Snyder <msnyder@vmware.com>
|
||||||
|
|
||||||
|
* record.c (record_restore): Rename tmpu8 to rectype.
|
@ -1,154 +0,0 @@
|
|||||||
http://sourceware.org/ml/gdb-patches/2009-12/msg00364.html
|
|
||||||
Subject: [patch] related_breakpoint stale ref crash fix
|
|
||||||
|
|
||||||
Hi,
|
|
||||||
|
|
||||||
getting occasional random:
|
|
||||||
PASS: gdb.threads/local-watch-wrong-thread.exp: local watchpoint still triggers
|
|
||||||
PASS: gdb.threads/local-watch-wrong-thread.exp: let thread_function0 return
|
|
||||||
PASS: gdb.threads/local-watch-wrong-thread.exp: breakpoint on thread_function0's caller
|
|
||||||
-PASS: gdb.threads/local-watch-wrong-thread.exp: local watchpoint automatically deleted
|
|
||||||
+ERROR: Process no longer exists
|
|
||||||
+UNRESOLVED: gdb.threads/local-watch-wrong-thread.exp: local watchpoint automatically deleted
|
|
||||||
|
|
||||||
It is even reproducible on HEAD using "input" file below and:
|
|
||||||
valgrind ../gdb -nx <input
|
|
||||||
|
|
||||||
(gdb) (gdb) Breakpoint 6 at 0x400685: file ./gdb.threads/local-watch-wrong-thread.c, line 47.
|
|
||||||
(gdb) ==31759== Invalid write of size 4
|
|
||||||
==31759== at 0x601A11: bpstat_check_breakpoint_conditions (breakpoint.c:3482)
|
|
||||||
==31759== by 0x601C70: bpstat_stop_status (breakpoint.c:3596)
|
|
||||||
==31759== by 0x65D228: handle_inferior_event (infrun.c:3589)
|
|
||||||
==31759== by 0x65A563: wait_for_inferior (infrun.c:2281)
|
|
||||||
==31759== by 0x659AA0: proceed (infrun.c:1883)
|
|
||||||
==31759== by 0x65300B: continue_1 (infcmd.c:668)
|
|
||||||
==31759== by 0x653282: continue_command (infcmd.c:760)
|
|
||||||
==31759== by 0x5C51D8: do_cfunc (cli-decode.c:67)
|
|
||||||
==31759== by 0x5C824F: cmd_func (cli-decode.c:1738)
|
|
||||||
==31759== by 0x48335A: execute_command (top.c:450)
|
|
||||||
==31759== by 0x67273E: command_handler (event-top.c:511)
|
|
||||||
==31759== by 0x672E53: command_line_handler (event-top.c:736)
|
|
||||||
==31759== Address 0xbbdc950 is 240 bytes inside a block of size 336 free'd
|
|
||||||
==31759== at 0x4A04D72: free (vg_replace_malloc.c:325)
|
|
||||||
==31759== by 0x486E4B: xfree (utils.c:1286)
|
|
||||||
==31759== by 0x60BC35: delete_breakpoint (breakpoint.c:8708)
|
|
||||||
==31759== by 0x60BDAF: delete_command (breakpoint.c:8765)
|
|
||||||
==31759== by 0x5C51D8: do_cfunc (cli-decode.c:67)
|
|
||||||
==31759== by 0x5C824F: cmd_func (cli-decode.c:1738)
|
|
||||||
==31759== by 0x48335A: execute_command (top.c:450)
|
|
||||||
==31759== by 0x67273E: command_handler (event-top.c:511)
|
|
||||||
==31759== by 0x672E53: command_line_handler (event-top.c:736)
|
|
||||||
==31759== by 0x672FCF: gdb_readline2 (event-top.c:817)
|
|
||||||
==31759== by 0x6725F7: stdin_event_handler (event-top.c:433)
|
|
||||||
==31759== by 0x670CDE: handle_file_event (event-loop.c:812)
|
|
||||||
==31759==
|
|
||||||
|
|
||||||
Watchpoint 4 deleted because the program has left the block in
|
|
||||||
which its expression is valid.
|
|
||||||
|
|
||||||
|
|
||||||
There is already automatic deletion of RELATED_BREAKPOINT in
|
|
||||||
map_breakpoint_numbers but "delete breakpoints" (for all the breakpoints)
|
|
||||||
calls delete_breakpoint from delete_command directly without calling
|
|
||||||
map_breakpoint_numbers and it does not delete the associated
|
|
||||||
bp_watchpoint_scope.
|
|
||||||
|
|
||||||
I find the attached patch is right for delete_breakpoint itself as such
|
|
||||||
function should not leave stale references in the leftover data structures.
|
|
||||||
How well could be other code cleaned up with this patch in place I have not
|
|
||||||
targeted by this patch.
|
|
||||||
|
|
||||||
|
|
||||||
The existing code expects accessibility of freed memory and discusses the
|
|
||||||
current stale references problem:
|
|
||||||
|
|
||||||
void
|
|
||||||
delete_breakpoint (struct breakpoint *bpt)
|
|
||||||
[...]
|
|
||||||
/* Has this bp already been deleted? This can happen because multiple
|
|
||||||
lists can hold pointers to bp's. bpstat lists are especial culprits.
|
|
||||||
|
|
||||||
One example of this happening is a watchpoint's scope bp. When the
|
|
||||||
scope bp triggers, we notice that the watchpoint is out of scope, and
|
|
||||||
delete it. We also delete its scope bp. But the scope bp is marked
|
|
||||||
"auto-deleting", and is already on a bpstat. That bpstat is then
|
|
||||||
checked for auto-deleting bp's, which are deleted.
|
|
||||||
|
|
||||||
A real solution to this problem might involve reference counts in bp's,
|
|
||||||
and/or giving them pointers back to their referencing bpstat's, and
|
|
||||||
teaching delete_breakpoint to only free a bp's storage when no more
|
|
||||||
references were extent. A cheaper bandaid was chosen. */
|
|
||||||
if (bpt->type == bp_none)
|
|
||||||
return;
|
|
||||||
[...]
|
|
||||||
bpt->type = bp_none;
|
|
||||||
|
|
||||||
xfree (bpt);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
While fixing this part may be difficult I find the attached patch easy enough
|
|
||||||
fixing the IMO currently most common crash due to it.
|
|
||||||
|
|
||||||
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
|
|
||||||
|
|
||||||
|
|
||||||
Thanks,
|
|
||||||
Jan
|
|
||||||
|
|
||||||
|
|
||||||
"input":
|
|
||||||
set height 0
|
|
||||||
set width 0
|
|
||||||
set confirm no
|
|
||||||
file ../testsuite/gdb.threads/local-watch-wrong-thread
|
|
||||||
set can-use-hw-watchpoints 1
|
|
||||||
break main
|
|
||||||
run
|
|
||||||
break local-watch-wrong-thread.c:36
|
|
||||||
continue
|
|
||||||
delete breakpoints
|
|
||||||
watch *myp
|
|
||||||
continue
|
|
||||||
delete breakpoints
|
|
||||||
echo MAKE watch\n
|
|
||||||
watch *myp if trigger != 0
|
|
||||||
echo MAKE break\n
|
|
||||||
break local-watch-wrong-thread.c:60
|
|
||||||
info break
|
|
||||||
continue
|
|
||||||
echo DELETE five\n
|
|
||||||
delete 5
|
|
||||||
set trigger=1
|
|
||||||
continue
|
|
||||||
set *myp=0
|
|
||||||
break local-watch-wrong-thread.c:47
|
|
||||||
continue
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
2009-12-23 Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
||||||
|
|
||||||
* breakpoint.c (delete_breakpoint <bpt->related_breakpoint != NULL>):
|
|
||||||
New.
|
|
||||||
|
|
||||||
--- a/gdb/breakpoint.c
|
|
||||||
+++ b/gdb/breakpoint.c
|
|
||||||
@@ -8649,6 +8649,16 @@ delete_breakpoint (struct breakpoint *bpt)
|
|
||||||
if (bpt->type == bp_none)
|
|
||||||
return;
|
|
||||||
|
|
||||||
+ /* At least avoid this stale reference until the reference counting of
|
|
||||||
+ breakpoints gets resolved. */
|
|
||||||
+ if (bpt->related_breakpoint != NULL)
|
|
||||||
+ {
|
|
||||||
+ gdb_assert (bpt->related_breakpoint->related_breakpoint == bpt);
|
|
||||||
+ bpt->related_breakpoint->disposition = disp_del_at_next_stop;
|
|
||||||
+ bpt->related_breakpoint->related_breakpoint = NULL;
|
|
||||||
+ bpt->related_breakpoint = NULL;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
observer_notify_breakpoint_deleted (bpt->number);
|
|
||||||
|
|
||||||
if (breakpoint_chain == bpt)
|
|
||||||
|
|
803
gdb-upstream.patch
Normal file
803
gdb-upstream.patch
Normal file
@ -0,0 +1,803 @@
|
|||||||
|
http://sourceware.org/ml/gdb-cvs/2010-03/msg00104.html
|
||||||
|
5855954454f19a801f76bbf7baafd11a693c5d33
|
||||||
|
|
||||||
|
Imported to sync gdb.base/break-interp.exp for gdb-pie-rerun.patch.
|
||||||
|
|
||||||
|
### src/gdb/ChangeLog 2010/03/11 03:45:48 1.11469
|
||||||
|
### src/gdb/ChangeLog 2010/03/11 22:07:00 1.11470
|
||||||
|
## -1,3 +1,9 @@
|
||||||
|
+2010-03-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
+
|
||||||
|
+ * solib-svr4.c (LM_ADDR_CHECK) <info_verbose>: Use printf_unfiltered
|
||||||
|
+ for the PIC displacement, print also the displacement value.
|
||||||
|
+ (svr4_exec_displacement): Print DISPLACEMENT if INFO_VERBOSE.
|
||||||
|
+
|
||||||
|
2010-03-10 Kevin Buettner <kevinb@redhat.com>
|
||||||
|
|
||||||
|
* remote-mips.c (close_ports, mips_initialize_cleanups)
|
||||||
|
--- src/gdb/solib-svr4.c 2010/03/10 20:55:44 1.129
|
||||||
|
+++ src/gdb/solib-svr4.c 2010/03/11 22:07:02 1.130
|
||||||
|
@@ -243,12 +243,10 @@
|
||||||
|
l_addr = l_dynaddr - dynaddr;
|
||||||
|
|
||||||
|
if (info_verbose)
|
||||||
|
- {
|
||||||
|
- warning (_(".dynamic section for \"%s\" "
|
||||||
|
- "is not at the expected address"), so->so_name);
|
||||||
|
- warning (_("difference appears to be caused by prelink, "
|
||||||
|
- "adjusting expectations"));
|
||||||
|
- }
|
||||||
|
+ printf_unfiltered (_("Using PIC (Position Independent Code) "
|
||||||
|
+ "prelink displacement %s for \"%s\".\n"),
|
||||||
|
+ paddress (target_gdbarch, l_addr),
|
||||||
|
+ so->so_name);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
warning (_(".dynamic section for \"%s\" "
|
||||||
|
@@ -1767,6 +1765,18 @@
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ if (info_verbose)
|
||||||
|
+ {
|
||||||
|
+ /* It can be printed repeatedly as there is no easy way to check
|
||||||
|
+ the executable symbols/file has been already relocated to
|
||||||
|
+ displacement. */
|
||||||
|
+
|
||||||
|
+ printf_unfiltered (_("Using PIE (Position Independent Executable) "
|
||||||
|
+ "displacement %s for \"%s\".\n"),
|
||||||
|
+ paddress (target_gdbarch, displacement),
|
||||||
|
+ bfd_get_filename (exec_bfd));
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
*displacementp = displacement;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
### src/gdb/testsuite/ChangeLog 2010/03/11 00:20:29 1.2168
|
||||||
|
### src/gdb/testsuite/ChangeLog 2010/03/11 22:07:02 1.2169
|
||||||
|
## -1,3 +1,20 @@
|
||||||
|
+2010-03-11 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
+
|
||||||
|
+ * gdb.base/break-interp.exp: Create new displacement parameter value
|
||||||
|
+ for the test_ld calls.
|
||||||
|
+ (reach): New parameter displacement, verify its content. New push of
|
||||||
|
+ pf_prefix "reach-$func:". Import global expect_out.
|
||||||
|
+ (test_core): New parameter displacement, verify its content. New push
|
||||||
|
+ of pf_prefix "core:". New command "set verbose on". Import global
|
||||||
|
+ expect_out.
|
||||||
|
+ (test_attach): New parameter displacement, verify its content. New
|
||||||
|
+ push of pf_prefix "attach:". New command "set verbose on". Import
|
||||||
|
+ global expect_out.
|
||||||
|
+ (test_ld): New parameter displacement, pass it to the reach, test_core
|
||||||
|
+ and test_attach calls and verify its content in the "ld.so exit" test.
|
||||||
|
+ * gdb.base/prelink.exp: Remove gdb_exit and final return.
|
||||||
|
+ (prelink): Update expected text, use gdb_test.
|
||||||
|
+
|
||||||
|
2010-03-10 Doug Evans <dje@google.com>
|
||||||
|
|
||||||
|
* gdb.base/checkpoint.exp: Fix comment.
|
||||||
|
--- src/gdb/testsuite/gdb.base/break-interp.exp 2010/01/27 20:53:22 1.6
|
||||||
|
+++ src/gdb/testsuite/gdb.base/break-interp.exp 2010/03/11 22:07:03 1.7
|
||||||
|
@@ -221,30 +221,61 @@
|
||||||
|
}
|
||||||
|
|
||||||
|
# `runto' does not check we stopped really at the function we specified.
|
||||||
|
-proc reach {func command} {
|
||||||
|
- global gdb_prompt
|
||||||
|
+# DISPLACEMENT can be "NONE", "ZERO" or "NONZERO"
|
||||||
|
+proc reach {func command displacement} {
|
||||||
|
+ global gdb_prompt expect_out
|
||||||
|
+
|
||||||
|
+ global pf_prefix
|
||||||
|
+ set old_ldprefix $pf_prefix
|
||||||
|
+ lappend pf_prefix "reach-$func:"
|
||||||
|
|
||||||
|
if [gdb_breakpoint $func allow-pending] {
|
||||||
|
- set test "reach $func"
|
||||||
|
+ set test "reach"
|
||||||
|
+ set test_displacement "seen displacement message as $displacement"
|
||||||
|
gdb_test_multiple $command $test {
|
||||||
|
+ -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " {
|
||||||
|
+ # Missing "$gdb_prompt $" is intentional.
|
||||||
|
+ if {$expect_out(1,string) == "0x0"} {
|
||||||
|
+ set case "ZERO"
|
||||||
|
+ } else {
|
||||||
|
+ set case "NONZERO"
|
||||||
|
+ }
|
||||||
|
+ if {$displacement == $case} {
|
||||||
|
+ pass $test_displacement
|
||||||
|
+ # Permit multiple such messages.
|
||||||
|
+ set displacement "FOUND-$displacement"
|
||||||
|
+ } elseif {$displacement != "FOUND-$case"} {
|
||||||
|
+ fail $test_displacement
|
||||||
|
+ }
|
||||||
|
+ exp_continue
|
||||||
|
+ }
|
||||||
|
-re "Breakpoint \[0-9\]+, $func \\(.*\\) at .*:\[0-9\]+\r\n.*$gdb_prompt $" {
|
||||||
|
pass $test
|
||||||
|
}
|
||||||
|
- -re "Breakpoint \[0-9\]+, \[0-9xa-f\]+ in $func \\(\\)( from .*)?\r\n$gdb_prompt $" {
|
||||||
|
+ -re "Breakpoint \[0-9\]+, \[0-9xa-f\]+ in $func \\(\\)( from .*)?\r\n$gdb_prompt $" {
|
||||||
|
pass $test
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+ if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
|
||||||
|
+ fail $test_displacement
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ set pf_prefix $old_ldprefix
|
||||||
|
}
|
||||||
|
|
||||||
|
-proc test_core {file} {
|
||||||
|
- global srcdir subdir gdb_prompt
|
||||||
|
+proc test_core {file displacement} {
|
||||||
|
+ global srcdir subdir gdb_prompt expect_out
|
||||||
|
|
||||||
|
set corefile [core_find $file {} "segv"]
|
||||||
|
if {$corefile == ""} {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
+ global pf_prefix
|
||||||
|
+ set old_ldprefix $pf_prefix
|
||||||
|
+ lappend pf_prefix "core:"
|
||||||
|
+
|
||||||
|
gdb_exit
|
||||||
|
gdb_start
|
||||||
|
# Clear it to never find any separate debug infos in $debug_root.
|
||||||
|
@@ -252,14 +283,44 @@
|
||||||
|
gdb_reinitialize_dir $srcdir/$subdir
|
||||||
|
gdb_load $file
|
||||||
|
|
||||||
|
- # Do not check the binary filename as it may be truncated.
|
||||||
|
- gdb_test "core-file $corefile" "Core was generated by .*\r\n#0 .*" "core loaded"
|
||||||
|
+ # Print the "PIE (Position Independent Executable) displacement" message.
|
||||||
|
+ gdb_test "set verbose on"
|
||||||
|
+
|
||||||
|
+ set test "core loaded"
|
||||||
|
+ set test_displacement "seen displacement message"
|
||||||
|
+ gdb_test_multiple "core-file $corefile" $test {
|
||||||
|
+ -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " {
|
||||||
|
+ # Missing "$gdb_prompt $" is intentional.
|
||||||
|
+ if {$expect_out(1,string) == "0x0"} {
|
||||||
|
+ set case "ZERO"
|
||||||
|
+ } else {
|
||||||
|
+ set case "NONZERO"
|
||||||
|
+ }
|
||||||
|
+ if {$displacement == $case} {
|
||||||
|
+ pass $test_displacement
|
||||||
|
+ # Permit multiple such messages.
|
||||||
|
+ set displacement "FOUND-$displacement"
|
||||||
|
+ } elseif {$displacement != "FOUND-$case"} {
|
||||||
|
+ fail $test_displacement
|
||||||
|
+ }
|
||||||
|
+ exp_continue
|
||||||
|
+ }
|
||||||
|
+ -re "Core was generated by .*\r\n#0 .*$gdb_prompt $" {
|
||||||
|
+ # Do not check the binary filename as it may be truncated.
|
||||||
|
+ pass $test
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
|
||||||
|
+ fail $test_displacement
|
||||||
|
+ }
|
||||||
|
|
||||||
|
gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "core main bt"
|
||||||
|
+
|
||||||
|
+ set pf_prefix $old_ldprefix
|
||||||
|
}
|
||||||
|
|
||||||
|
-proc test_attach {file} {
|
||||||
|
- global board_info
|
||||||
|
+proc test_attach {file displacement} {
|
||||||
|
+ global board_info gdb_prompt expect_out
|
||||||
|
|
||||||
|
gdb_exit
|
||||||
|
|
||||||
|
@@ -287,17 +348,61 @@
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+ global pf_prefix
|
||||||
|
+ set old_ldprefix $pf_prefix
|
||||||
|
+ lappend pf_prefix "attach:"
|
||||||
|
+
|
||||||
|
gdb_exit
|
||||||
|
gdb_start
|
||||||
|
- gdb_test "attach $pid" "Attaching to process $pid\r\n.*" "attach"
|
||||||
|
+
|
||||||
|
+ # Print the "PIE (Position Independent Executable) displacement" message.
|
||||||
|
+ gdb_test "set verbose on"
|
||||||
|
+
|
||||||
|
+ set test "attach"
|
||||||
|
+ gdb_test_multiple "attach $pid" $test {
|
||||||
|
+ -re "Attaching to process $pid\r\n" {
|
||||||
|
+ # Missing "$gdb_prompt $" is intentional.
|
||||||
|
+ pass $test
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ set test "attach final prompt"
|
||||||
|
+ set test_displacement "seen displacement message"
|
||||||
|
+ gdb_test_multiple "" $test {
|
||||||
|
+ -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " {
|
||||||
|
+ # Missing "$gdb_prompt $" is intentional.
|
||||||
|
+ if {$expect_out(1,string) == "0x0"} {
|
||||||
|
+ set case "ZERO"
|
||||||
|
+ } else {
|
||||||
|
+ set case "NONZERO"
|
||||||
|
+ }
|
||||||
|
+ if {$displacement == $case} {
|
||||||
|
+ pass $test_displacement
|
||||||
|
+ # Permit multiple such messages.
|
||||||
|
+ set displacement "FOUND-$displacement"
|
||||||
|
+ } elseif {$displacement != "FOUND-$case"} {
|
||||||
|
+ fail $test_displacement
|
||||||
|
+ }
|
||||||
|
+ exp_continue
|
||||||
|
+ }
|
||||||
|
+ -re "$gdb_prompt $" {
|
||||||
|
+ pass $test
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
|
||||||
|
+ fail $test_displacement
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
gdb_test "bt" "#\[0-9\]+ +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#\[0-9\]+ +\[^\r\n\]*\\mmain\\M.*" "attach main bt"
|
||||||
|
gdb_exit
|
||||||
|
|
||||||
|
remote_exec host "kill -9 $pid"
|
||||||
|
+
|
||||||
|
+ set pf_prefix $old_ldprefix
|
||||||
|
}
|
||||||
|
|
||||||
|
-proc test_ld {file ifmain trynosym} {
|
||||||
|
- global srcdir subdir gdb_prompt
|
||||||
|
+proc test_ld {file ifmain trynosym displacement} {
|
||||||
|
+ global srcdir subdir gdb_prompt expect_out
|
||||||
|
|
||||||
|
# First test normal `file'-command loaded $FILE with symbols.
|
||||||
|
|
||||||
|
@@ -308,20 +413,31 @@
|
||||||
|
gdb_reinitialize_dir $srcdir/$subdir
|
||||||
|
gdb_load $file
|
||||||
|
|
||||||
|
- reach "dl_main" "run segv"
|
||||||
|
+ # Print the "PIE (Position Independent Executable) displacement" message.
|
||||||
|
+ gdb_test "set verbose on"
|
||||||
|
+
|
||||||
|
+ reach "dl_main" "run segv" $displacement
|
||||||
|
|
||||||
|
gdb_test "bt" "#0 +\[^\r\n\]*\\mdl_main\\M.*" "dl bt"
|
||||||
|
|
||||||
|
if $ifmain {
|
||||||
|
- reach "main" continue
|
||||||
|
+ # Displacement message will be printed the second time on initializing
|
||||||
|
+ # the linker from svr4_special_symbol_handling. If any ANOFFSET has
|
||||||
|
+ # been already set as non-zero the detection will no longer be run.
|
||||||
|
+ if {$displacement == "NONZERO"} {
|
||||||
|
+ set displacement_main "NONE"
|
||||||
|
+ } else {
|
||||||
|
+ set displacement_main $displacement
|
||||||
|
+ }
|
||||||
|
+ reach "main" continue $displacement_main
|
||||||
|
|
||||||
|
- reach "libfunc" continue
|
||||||
|
+ reach "libfunc" continue "NONE"
|
||||||
|
|
||||||
|
gdb_test "bt" "#0 +\[^\r\n\]*\\mlibfunc\\M\[^\r\n\]*\r\n#1 +\[^\r\n\]*\\mmain\\M.*" "main bt"
|
||||||
|
|
||||||
|
- test_core $file
|
||||||
|
+ test_core $file $displacement
|
||||||
|
|
||||||
|
- test_attach $file
|
||||||
|
+ test_attach $file $displacement
|
||||||
|
}
|
||||||
|
|
||||||
|
if !$trynosym {
|
||||||
|
@@ -341,18 +457,21 @@
|
||||||
|
gdb_test "set debug-file-directory"
|
||||||
|
gdb_reinitialize_dir $srcdir/$subdir
|
||||||
|
|
||||||
|
+ # Print the "PIE (Position Independent Executable) displacement" message.
|
||||||
|
+ gdb_test "set verbose on"
|
||||||
|
+
|
||||||
|
# Test no (error) message has been printed by `exec-file'.
|
||||||
|
set escapedfile [string_to_regexp $file]
|
||||||
|
gdb_test "exec-file $file" "exec-file $escapedfile" "load"
|
||||||
|
|
||||||
|
if $ifmain {
|
||||||
|
- reach "dl_main" run
|
||||||
|
+ reach "dl_main" run $displacement
|
||||||
|
|
||||||
|
set test "info files"
|
||||||
|
set entrynohex ""
|
||||||
|
gdb_test_multiple $test $test {
|
||||||
|
-re "\r\n\[\t \]*Entry point:\[\t \]*0x(\[0-9a-f\]+)\r\n.*$gdb_prompt $" {
|
||||||
|
- set entrynohex $expect_out(1,string)
|
||||||
|
+ set entrynohex $expect_out(1,string)
|
||||||
|
pass $test
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -363,7 +482,34 @@
|
||||||
|
} else {
|
||||||
|
# There is no symbol to break at ld.so. Moreover it can exit with an
|
||||||
|
# error code.
|
||||||
|
- gdb_test "run" "Program exited (normally|with code \[0-9\]+)\\." "ld.so exit"
|
||||||
|
+
|
||||||
|
+ set test "ld.so exit"
|
||||||
|
+ set test_displacement "seen displacement message"
|
||||||
|
+ gdb_test_multiple "run" $test {
|
||||||
|
+ -re "Using PIE \\(Position Independent Executable\\) displacement (0x\[0-9a-f\]+) " {
|
||||||
|
+ # Missing "$gdb_prompt $" is intentional.
|
||||||
|
+ if {$expect_out(1,string) == "0x0"} {
|
||||||
|
+ set case "ZERO"
|
||||||
|
+ } else {
|
||||||
|
+ set case "NONZERO"
|
||||||
|
+ }
|
||||||
|
+ if {$displacement == $case} {
|
||||||
|
+ pass $test_displacement
|
||||||
|
+ # Permit multiple such messages.
|
||||||
|
+ set displacement "FOUND-$displacement"
|
||||||
|
+ } elseif {$displacement != "FOUND-$case"} {
|
||||||
|
+ fail $test_displacement
|
||||||
|
+ }
|
||||||
|
+ exp_continue
|
||||||
|
+ }
|
||||||
|
+ -re "Program exited (normally|with code \[0-9\]+)\\.\r\n$gdb_prompt $" {
|
||||||
|
+ # Do not check the binary filename as it may be truncated.
|
||||||
|
+ pass $test
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+ if ![regexp {^(NONE|FOUND-.*)$} $displacement] {
|
||||||
|
+ fail $test_displacement
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
|
||||||
|
set pf_prefix $old_ldprefix
|
||||||
|
@@ -450,7 +596,12 @@
|
||||||
|
if ![prelink$ldprelink $interp] {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
- test_ld $interp 0 [expr {$ldsepdebug == "NO"}]
|
||||||
|
+ if {$ldprelink == "NO"} {
|
||||||
|
+ set displacement "NONZERO"
|
||||||
|
+ } else {
|
||||||
|
+ set displacement "ZERO"
|
||||||
|
+ }
|
||||||
|
+ test_ld $interp 0 [expr {$ldsepdebug == "NO"}] $displacement
|
||||||
|
|
||||||
|
if ![copy $interp $interp_saved] {
|
||||||
|
continue
|
||||||
|
@@ -531,7 +682,14 @@
|
||||||
|
|
||||||
|
if {[prelink$binprelink "--dynamic-linker=$interp --ld-library-path=$dir $exec $interp [concat $dests]" [file tail $exec]]
|
||||||
|
&& [copy $interp_saved $interp]} {
|
||||||
|
- test_ld $exec 1 [expr {$binsepdebug == "NO"}]
|
||||||
|
+ if {$binpie == "NO"} {
|
||||||
|
+ set displacement "NONE"
|
||||||
|
+ } elseif {$binprelink == "NO"} {
|
||||||
|
+ set displacement "NONZERO"
|
||||||
|
+ } else {
|
||||||
|
+ set displacement "ZERO"
|
||||||
|
+ }
|
||||||
|
+ test_ld $exec 1 [expr {$binsepdebug == "NO"}] $displacement
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
--- src/gdb/testsuite/gdb.base/prelink.exp 2010/02/13 12:02:29 1.11
|
||||||
|
+++ src/gdb/testsuite/gdb.base/prelink.exp 2010/03/11 22:07:03 1.12
|
||||||
|
@@ -112,15 +112,4 @@
|
||||||
|
# Print the "adjusting expectations" message.
|
||||||
|
gdb_test "set verbose on"
|
||||||
|
|
||||||
|
-set test "prelink"
|
||||||
|
-global gdb_prompt
|
||||||
|
-gdb_test_multiple "core-file $objdir/$subdir/prelink.core" "$test" {
|
||||||
|
- -re "warning: \.dynamic section.*not at the expected address.*warning: difference.*caused by prelink, adjusting expectations.*$gdb_prompt $" {
|
||||||
|
- pass "$test"
|
||||||
|
- }
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-gdb_exit
|
||||||
|
-
|
||||||
|
-return 0
|
||||||
|
-
|
||||||
|
+gdb_test "core-file $objdir/$subdir/prelink.core" {Using PIC \(Position Independent Code\) prelink displacement.*} "prelink"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
http://sourceware.org/ml/gdb-cvs/2010-03/msg00066.html
|
||||||
|
16558457783d71e2856ff2b9ceaa83199d2d9811
|
||||||
|
|
||||||
|
### src/gdb/ChangeLog 2010/03/08 07:45:49 1.11442
|
||||||
|
### src/gdb/ChangeLog 2010/03/08 08:32:49 1.11443
|
||||||
|
## -1,3 +1,8 @@
|
||||||
|
+2010-03-08 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
+
|
||||||
|
+ * symfile.c (addr_info_make_relative): New variable sect_name, use it.
|
||||||
|
+ Do not warn on ".gnu.liblist" and ".gnu.conflict".
|
||||||
|
+
|
||||||
|
2010-03-08 Joel Brobecker <brobecker@adacore.com>
|
||||||
|
|
||||||
|
Memory error when reading wrong core file.
|
||||||
|
--- src/gdb/symfile.c 2010/03/05 19:32:44 1.275
|
||||||
|
+++ src/gdb/symfile.c 2010/03/08 08:32:49 1.276
|
||||||
|
@@ -592,7 +592,8 @@
|
||||||
|
|
||||||
|
for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++)
|
||||||
|
{
|
||||||
|
- asection *sect = bfd_get_section_by_name (abfd, addrs->other[i].name);
|
||||||
|
+ const char *sect_name = addrs->other[i].name;
|
||||||
|
+ asection *sect = bfd_get_section_by_name (abfd, sect_name);
|
||||||
|
|
||||||
|
if (sect)
|
||||||
|
{
|
||||||
|
@@ -609,8 +610,22 @@
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
- warning (_("section %s not found in %s"), addrs->other[i].name,
|
||||||
|
- bfd_get_filename (abfd));
|
||||||
|
+ /* This section does not exist in ABFD, which is normally
|
||||||
|
+ unexpected and we want to issue a warning.
|
||||||
|
+
|
||||||
|
+ However, the ELF prelinker does create a couple of sections
|
||||||
|
+ (".gnu.liblist" and ".gnu.conflict") which are marked in the main
|
||||||
|
+ executable as loadable (they are loaded in memory from the
|
||||||
|
+ DYNAMIC segment) and yet are not present in separate debug info
|
||||||
|
+ files. This is fine, and should not cause a warning. Shared
|
||||||
|
+ libraries contain just the section ".gnu.liblist" but it is not
|
||||||
|
+ marked as loadable there. */
|
||||||
|
+
|
||||||
|
+ if (!(strcmp (sect_name, ".gnu.liblist") == 0
|
||||||
|
+ || strcmp (sect_name, ".gnu.conflict") == 0))
|
||||||
|
+ warning (_("section %s not found in %s"), sect_name,
|
||||||
|
+ bfd_get_filename (abfd));
|
||||||
|
+
|
||||||
|
addrs->other[i].addr = 0;
|
||||||
|
|
||||||
|
/* SECTINDEX is invalid if ADDR is zero. */
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
http://sourceware.org/ml/gdb-cvs/2010-03/msg00138.html
|
||||||
|
http://sourceware.org/ml/gdb-patches/2010-03/msg00535.html
|
||||||
|
cc3e71651e2fd0168a2d3dd4efc2d3e15fd508dd
|
||||||
|
|
||||||
|
### src/gdb/ChangeLog 2010/03/15 03:48:46 1.11479
|
||||||
|
### src/gdb/ChangeLog 2010/03/15 09:31:30 1.11480
|
||||||
|
## -1,3 +1,8 @@
|
||||||
|
+2010-03-15 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
+
|
||||||
|
+ * symfile.c (addr_info_make_relative): Ignore also missing ".dynbss"
|
||||||
|
+ and ".sdynbss". Update the comment.
|
||||||
|
+
|
||||||
|
2010-03-15 Jie Zhang <jie@codesourcery.com>
|
||||||
|
|
||||||
|
* MAINTAINERS: Update my email address.
|
||||||
|
--- src/gdb/symfile.c 2010/03/10 18:20:07 1.277
|
||||||
|
+++ src/gdb/symfile.c 2010/03/15 09:31:34 1.278
|
||||||
|
@@ -576,16 +576,19 @@
|
||||||
|
/* This section does not exist in ABFD, which is normally
|
||||||
|
unexpected and we want to issue a warning.
|
||||||
|
|
||||||
|
- However, the ELF prelinker does create a couple of sections
|
||||||
|
- (".gnu.liblist" and ".gnu.conflict") which are marked in the main
|
||||||
|
- executable as loadable (they are loaded in memory from the
|
||||||
|
- DYNAMIC segment) and yet are not present in separate debug info
|
||||||
|
- files. This is fine, and should not cause a warning. Shared
|
||||||
|
- libraries contain just the section ".gnu.liblist" but it is not
|
||||||
|
- marked as loadable there. */
|
||||||
|
+ However, the ELF prelinker does create a few sections which are
|
||||||
|
+ marked in the main executable as loadable (they are loaded in
|
||||||
|
+ memory from the DYNAMIC segment) and yet are not present in
|
||||||
|
+ separate debug info files. This is fine, and should not cause
|
||||||
|
+ a warning. Shared libraries contain just the section
|
||||||
|
+ ".gnu.liblist" but it is not marked as loadable there. There is
|
||||||
|
+ no other way to identify them than by their name as the sections
|
||||||
|
+ created by prelink have no special flags. */
|
||||||
|
|
||||||
|
if (!(strcmp (sect_name, ".gnu.liblist") == 0
|
||||||
|
- || strcmp (sect_name, ".gnu.conflict") == 0))
|
||||||
|
+ || strcmp (sect_name, ".gnu.conflict") == 0
|
||||||
|
+ || strcmp (sect_name, ".dynbss") == 0
|
||||||
|
+ || strcmp (sect_name, ".sdynbss") == 0))
|
||||||
|
warning (_("section %s not found in %s"), sect_name,
|
||||||
|
bfd_get_filename (abfd));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
http://sourceware.org/ml/gdb-patches/2010-03/msg00799.html
|
||||||
|
Subject: [patch] Fix separate-debug with non-unique section names (PR 11409)
|
||||||
|
|
||||||
|
A different version was checked-in but they are interchangeable:
|
||||||
|
http://sourceware.org/ml/gdb-patches/2010-03/msg00799.html
|
||||||
|
http://sourceware.org/ml/gdb-cvs/2010-03/msg00241.html
|
||||||
|
|
||||||
|
Hi,
|
||||||
|
|
||||||
|
gdb-7.1 is now broken for example for debugging /usr/bin/emacs due to:
|
||||||
|
http://sourceware.org/bugzilla/show_bug.cgi?id=11409
|
||||||
|
[22] .data PROGBITS 00000000007fe8a0 1fe8a0 215068 00 WA 0 0 32
|
||||||
|
[23] .data PROGBITS 0000000000a13920 413920 68c6e0 00 WA 0 0 32
|
||||||
|
|
||||||
|
It is in fact a regression against gdb-7.0 by me due to:
|
||||||
|
|
||||||
|
commit 71d0069a9f238a11f7f455bf6ad2adfc25683521
|
||||||
|
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
Date: Tue Jan 5 15:51:01 2010 +0000
|
||||||
|
|
||||||
|
gdb/
|
||||||
|
* symfile.c (syms_from_objfile): Remove the !MAINLINE conditional.
|
||||||
|
|
||||||
|
as while the code was broken even before the broken relocation was not applied
|
||||||
|
to mainline binary (before PIE+OSX patches went in).
|
||||||
|
|
||||||
|
|
||||||
|
No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.
|
||||||
|
|
||||||
|
OK to check-in also for gdb-7.1 (7.1.1)?
|
||||||
|
|
||||||
|
|
||||||
|
Thanks,
|
||||||
|
Jan
|
||||||
|
|
||||||
|
|
||||||
|
gdb/
|
||||||
|
2010-03-23 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* symfile.c (addr_info_make_relative): Move sect declaration to the
|
||||||
|
outer block. Initialize it to NULL. Prefer SECT->next more than
|
||||||
|
bfd_get_section_by_name.
|
||||||
|
|
||||||
|
gdb/testsuite/
|
||||||
|
2010-03-23 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
* gdb.base/dup-sect.exp, gdb.base/dup-sect.S: New.
|
||||||
|
|
||||||
|
--- a/gdb/symfile.c
|
||||||
|
+++ b/gdb/symfile.c
|
||||||
|
@@ -529,6 +529,7 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
|
||||||
|
asection *lower_sect;
|
||||||
|
CORE_ADDR lower_offset;
|
||||||
|
int i;
|
||||||
|
+ asection *sect;
|
||||||
|
|
||||||
|
/* Find lowest loadable section to be used as starting point for
|
||||||
|
continguous sections. */
|
||||||
|
@@ -553,11 +554,23 @@ addr_info_make_relative (struct section_addr_info *addrs, bfd *abfd)
|
||||||
|
(the loadable section directly below it in memory).
|
||||||
|
this_offset = lower_offset = lower_addr - lower_orig_addr */
|
||||||
|
|
||||||
|
+ sect = NULL;
|
||||||
|
for (i = 0; i < addrs->num_sections && addrs->other[i].name; i++)
|
||||||
|
{
|
||||||
|
const char *sect_name = addrs->other[i].name;
|
||||||
|
- asection *sect = bfd_get_section_by_name (abfd, sect_name);
|
||||||
|
|
||||||
|
+ /* Prefer the next section of that we have found last. The separate
|
||||||
|
+ debug info files have either the same section layout or just a few
|
||||||
|
+ sections are missing there. On the other hand the section name is not
|
||||||
|
+ unique and we could find an inappropraite section by its name. */
|
||||||
|
+
|
||||||
|
+ if (sect)
|
||||||
|
+ sect = sect->next;
|
||||||
|
+ if (sect && strcmp (sect_name, bfd_get_section_name (abfd, sect)) != 0)
|
||||||
|
+ sect = NULL;
|
||||||
|
+
|
||||||
|
+ if (sect == NULL)
|
||||||
|
+ sect = bfd_get_section_by_name (abfd, sect_name);
|
||||||
|
if (sect)
|
||||||
|
{
|
||||||
|
/* This is the index used by BFD. */
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/gdb/testsuite/gdb.base/dup-sect.S
|
||||||
|
@@ -0,0 +1,22 @@
|
||||||
|
+/* This testcase is part of GDB, the GNU debugger.
|
||||||
|
+
|
||||||
|
+ Copyright 2010 Free Software Foundation, Inc.
|
||||||
|
+
|
||||||
|
+ This program is free software; you can redistribute it and/or modify
|
||||||
|
+ it under the terms of the GNU General Public License as published by
|
||||||
|
+ the Free Software Foundation; either version 3 of the License, or
|
||||||
|
+ (at your option) any later version.
|
||||||
|
+
|
||||||
|
+ This program is distributed in the hope that it will be useful,
|
||||||
|
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
+ GNU General Public License for more details.
|
||||||
|
+
|
||||||
|
+ You should have received a copy of the GNU General Public License
|
||||||
|
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
|
||||||
|
+
|
||||||
|
+ .section sect1, "a"
|
||||||
|
+var1: .byte 1
|
||||||
|
+
|
||||||
|
+ .section sect2, "a"
|
||||||
|
+var2: .byte 2
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/gdb/testsuite/gdb.base/dup-sect.exp
|
||||||
|
@@ -0,0 +1,79 @@
|
||||||
|
+# This testcase is part of GDB, the GNU debugger.
|
||||||
|
+
|
||||||
|
+# Copyright 2010 Free Software Foundation, Inc.
|
||||||
|
+
|
||||||
|
+# This program is free software; you can redistribute it and/or modify
|
||||||
|
+# it under the terms of the GNU General Public License as published by
|
||||||
|
+# the Free Software Foundation; either version 3 of the License, or
|
||||||
|
+# (at your option) any later version.
|
||||||
|
+#
|
||||||
|
+# This program is distributed in the hope that it will be useful,
|
||||||
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
+# GNU General Public License for more details.
|
||||||
|
+#
|
||||||
|
+# You should have received a copy of the GNU General Public License
|
||||||
|
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
+
|
||||||
|
+# Test inappropriate offseting of multiple sections with the same name.
|
||||||
|
+# When kept in object file (before final executable link) it still works.
|
||||||
|
+# When separate debug info file is not used it still works.
|
||||||
|
+# When the ELF symbol table is kept in the main binary it still works.
|
||||||
|
+# Used .S file as in .c file we would need __attriute__((section)) which is
|
||||||
|
+# a GCC extension.
|
||||||
|
+
|
||||||
|
+# This test can only be run on targets which support ELF and use gas.
|
||||||
|
+# For now pick a sampling of likely targets.
|
||||||
|
+if {![istarget *-*-linux*]
|
||||||
|
+ && ![istarget *-*-gnu*]
|
||||||
|
+ && ![istarget *-*-elf*]
|
||||||
|
+ && ![istarget arm-*-eabi*]
|
||||||
|
+ && ![istarget powerpc-*-eabi*]} {
|
||||||
|
+ return 0
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+set testfile dup-sect
|
||||||
|
+set srcfile ${testfile}.S
|
||||||
|
+set srcmainfile start.c
|
||||||
|
+set executable ${testfile}
|
||||||
|
+set binfile ${objdir}/${subdir}/${executable}
|
||||||
|
+
|
||||||
|
+if {[build_executable ${testfile}.exp $executable [list ${srcfile} ${srcmainfile}] {}] == -1} {
|
||||||
|
+ return -1
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+set test "rename section"
|
||||||
|
+set objcopy_program [transform objcopy]
|
||||||
|
+set result [catch "exec $objcopy_program --rename-section sect2=sect1 $binfile" output]
|
||||||
|
+verbose "result is $result"
|
||||||
|
+verbose "output is $output"
|
||||||
|
+if {$result != 0} {
|
||||||
|
+ fail $test
|
||||||
|
+ return
|
||||||
|
+}
|
||||||
|
+pass $test
|
||||||
|
+
|
||||||
|
+set test "split"
|
||||||
|
+if {[gdb_gnu_strip_debug $binfile] != 0} {
|
||||||
|
+ fail $test
|
||||||
|
+} else {
|
||||||
|
+ pass $test
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+# gdb_gnu_strip_debug uses only --strip-debug and keeps the ELF symbol table
|
||||||
|
+# in $binfile.
|
||||||
|
+set test "strip"
|
||||||
|
+set strip_program [transform strip]
|
||||||
|
+set result [catch "exec $strip_program $binfile" output]
|
||||||
|
+verbose "result is $result"
|
||||||
|
+verbose "output is $output"
|
||||||
|
+if {$result != 0} {
|
||||||
|
+ fail $test
|
||||||
|
+ return
|
||||||
|
+}
|
||||||
|
+pass $test
|
||||||
|
+
|
||||||
|
+clean_restart $executable
|
||||||
|
+
|
||||||
|
+gdb_test "p/d *(const char *) &var1" " = 1" "var1 after strip"
|
||||||
|
+gdb_test "p/d *(const char *) &var2" " = 2" "var2 after strip"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[patch] Fix breakpoint at *_start
|
||||||
|
http://sourceware.org/ml/gdb-patches/2010-04/msg00059.html
|
||||||
|
http://sourceware.org/ml/gdb-cvs/2010-04/msg00029.html
|
||||||
|
|
||||||
|
### src/gdb/ChangeLog 2010/04/04 13:54:42 1.11568
|
||||||
|
### src/gdb/ChangeLog 2010/04/04 22:12:04 1.11569
|
||||||
|
## -1,5 +1,10 @@
|
||||||
|
2010-04-04 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
|
+ * infcmd.c (run_command_1): Call proceed with regcache_read_pc address.
|
||||||
|
+ * config/djgpp/fnchange.lst: Add translation for break-entry.exp.
|
||||||
|
+
|
||||||
|
+2010-04-04 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
+
|
||||||
|
* breakpoint.c (bpstat_find_step_resume_breakpoint): Remove.
|
||||||
|
* breakpoint.h (bpstat_find_step_resume_breakpoint): Remove.
|
||||||
|
|
||||||
|
--- src/gdb/infcmd.c 2010/03/25 20:48:53 1.263
|
||||||
|
+++ src/gdb/infcmd.c 2010/04/04 22:12:04 1.264
|
||||||
|
@@ -580,8 +580,9 @@
|
||||||
|
has done its thing; now we are setting up the running program. */
|
||||||
|
post_create_inferior (¤t_target, 0);
|
||||||
|
|
||||||
|
- /* Start the target running. */
|
||||||
|
- proceed ((CORE_ADDR) -1, TARGET_SIGNAL_0, 0);
|
||||||
|
+ /* Start the target running. Do not use -1 continuation as it would skip
|
||||||
|
+ breakpoint right at the entry point. */
|
||||||
|
+ proceed (regcache_read_pc (get_current_regcache ()), TARGET_SIGNAL_0, 0);
|
||||||
|
|
||||||
|
/* Since there was no error, there's no need to finish the thread
|
||||||
|
states here. */
|
||||||
|
--- src/gdb/config/djgpp/fnchange.lst 2010/02/01 19:27:55 1.108
|
||||||
|
+++ src/gdb/config/djgpp/fnchange.lst 2010/04/04 22:12:07 1.109
|
||||||
|
@@ -371,6 +371,7 @@
|
||||||
|
@V@/gdb/testsuite/gdb.arch/powerpc-prologue.exp @V@/gdb/testsuite/gdb.arch/ppc-prologue.exp
|
||||||
|
@V@/gdb/testsuite/gdb.base/bitfields2.c @V@/gdb/testsuite/gdb.base/bitfiel2.c
|
||||||
|
@V@/gdb/testsuite/gdb.base/bitfields2.exp @V@/gdb/testsuite/gdb.base/bitfiel2.exp
|
||||||
|
+@V@/gdb/testsuite/gdb.base/break-entry.exp @V@/gdb/testsuite/gdb.base/brkentry.exp
|
||||||
|
@V@/gdb/testsuite/gdb.base/coremaker2.c @V@/gdb/testsuite/gdb.base/core2maker.c
|
||||||
|
@V@/gdb/testsuite/gdb.base/hashline1.exp @V@/gdb/testsuite/gdb.base/hash1line.exp
|
||||||
|
@V@/gdb/testsuite/gdb.base/hashline2.exp @V@/gdb/testsuite/gdb.base/hash2line.exp
|
||||||
|
### src/gdb/testsuite/ChangeLog 2010/04/02 05:13:07 1.2218
|
||||||
|
### src/gdb/testsuite/ChangeLog 2010/04/04 22:12:09 1.2219
|
||||||
|
## -1,3 +1,7 @@
|
||||||
|
+2010-04-04 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
+
|
||||||
|
+ * gdb.base/break-entry.exp: New.
|
||||||
|
+
|
||||||
|
2010-04-02 Hui Zhu <teawater@gmail.com>
|
||||||
|
Michael Snyder <msnyder@vmware.com>
|
||||||
|
|
||||||
|
--- src/gdb/testsuite/gdb.base/break-entry.exp
|
||||||
|
+++ src/gdb/testsuite/gdb.base/break-entry.exp 2010-04-05 20:17:39.234684000 +0000
|
||||||
|
@@ -0,0 +1,43 @@
|
||||||
|
+# Copyright (C) 2010 Free Software Foundation, Inc.
|
||||||
|
+
|
||||||
|
+# This program is free software; you can redistribute it and/or modify
|
||||||
|
+# it under the terms of the GNU General Public License as published by
|
||||||
|
+# the Free Software Foundation; either version 3 of the License, or
|
||||||
|
+# (at your option) any later version.
|
||||||
|
+#
|
||||||
|
+# This program is distributed in the hope that it will be useful,
|
||||||
|
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
+# GNU General Public License for more details.
|
||||||
|
+#
|
||||||
|
+# You should have received a copy of the GNU General Public License
|
||||||
|
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
+
|
||||||
|
+# Test inferior can stop at its very first instruction, usually "_start".
|
||||||
|
+# Dynamic executables have first instruction in ld.so.
|
||||||
|
+
|
||||||
|
+set testfile break-entry
|
||||||
|
+if { [prepare_for_testing ${testfile}.exp ${testfile} start.c {additional_flags=-static}] } {
|
||||||
|
+ return -1
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+set test "info files"
|
||||||
|
+set entry ""
|
||||||
|
+gdb_test_multiple $test $test {
|
||||||
|
+ -re "\r\n\[\t \]*Entry point:\[\t \]*(0x\[0-9a-f\]+)\r\n.*$gdb_prompt $" {
|
||||||
|
+ set entry $expect_out(1,string)
|
||||||
|
+ pass $test
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+if {$entry == ""} {
|
||||||
|
+ untested ${testfile}.exp
|
||||||
|
+ return
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+if ![runto "*$entry"] {
|
||||||
|
+ return
|
||||||
|
+}
|
||||||
|
+gdb_test {p/x $pc} " = $entry"
|
||||||
|
+
|
||||||
|
+gdb_breakpoint "main"
|
||||||
|
+gdb_continue_to_breakpoint "main" "main.*"
|
214
gdb-using-directive-leak.patch
Normal file
214
gdb-using-directive-leak.patch
Normal file
@ -0,0 +1,214 @@
|
|||||||
|
FSF GDB variant is at:
|
||||||
|
http://sourceware.org/ml/gdb-patches/2010-03/msg00789.html
|
||||||
|
|
||||||
|
commit 56b45f494f647360f9d6ff84f12f59c08cbe05af
|
||||||
|
Author: Sami Wagiaalla <swagiaal@redhat.com>
|
||||||
|
Date: Mon Mar 29 16:08:58 2010 -0400
|
||||||
|
|
||||||
|
Fix using_directive memory leak.
|
||||||
|
|
||||||
|
diff --git a/gdb/buildsym.c b/gdb/buildsym.c
|
||||||
|
index ff2c9b1..35e4663 100644
|
||||||
|
--- a/gdb/buildsym.c
|
||||||
|
+++ b/gdb/buildsym.c
|
||||||
|
@@ -387,6 +387,7 @@ finish_block (struct symbol *symbol, struct pending **listhead,
|
||||||
|
}
|
||||||
|
|
||||||
|
block_set_using (block, using_directives, &objfile->objfile_obstack);
|
||||||
|
+ using_directives = NULL;
|
||||||
|
|
||||||
|
record_pending_block (objfile, block, opblock);
|
||||||
|
|
||||||
|
diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
|
||||||
|
index 6325ead..c6df91f 100644
|
||||||
|
--- a/gdb/cp-namespace.c
|
||||||
|
+++ b/gdb/cp-namespace.c
|
||||||
|
@@ -120,7 +120,8 @@ cp_scan_for_anonymous_namespaces (const struct symbol *symbol)
|
||||||
|
anonymous namespace. So add symbols in it to the
|
||||||
|
namespace given by the previous component if there is
|
||||||
|
one, or to the global namespace if there isn't. */
|
||||||
|
- cp_add_using_directive (dest, src, NULL, "", 0);
|
||||||
|
+ cp_add_using_directive (dest, src, NULL, "", 0,
|
||||||
|
+ &SYMBOL_SYMTAB (symbol)->objfile->objfile_obstack);
|
||||||
|
}
|
||||||
|
/* The "+ 2" is for the "::". */
|
||||||
|
previous_component = next_component + 2;
|
||||||
|
@@ -132,11 +133,17 @@ cp_scan_for_anonymous_namespaces (const struct symbol *symbol)
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add a using directive to using_list. If the using directive in question
|
||||||
|
- has already been added, don't add it twice. */
|
||||||
|
+ has already been added, don't add it twice.
|
||||||
|
+ Create a new struct using_direct which imports the namespace SRC into the
|
||||||
|
+ scope DEST. ALIAS is the name of the imported namespace in the current
|
||||||
|
+ scope. If ALIAS is NULL then the namespace is known by its original name.
|
||||||
|
+ The arguments are copied into newly allocated memory so they can be
|
||||||
|
+ temporaries. */
|
||||||
|
|
||||||
|
void
|
||||||
|
cp_add_using_directive (const char *dest, const char *src, const char *alias,
|
||||||
|
- const char *declaration, const int line_number)
|
||||||
|
+ const char *declaration, const int line_number,
|
||||||
|
+ struct obstack *obstack)
|
||||||
|
{
|
||||||
|
struct using_direct *current;
|
||||||
|
struct using_direct *new;
|
||||||
|
@@ -146,12 +153,26 @@ cp_add_using_directive (const char *dest, const char *src, const char *alias,
|
||||||
|
for (current = using_directives; current != NULL; current = current->next)
|
||||||
|
{
|
||||||
|
if (strcmp (current->import_src, src) == 0
|
||||||
|
- && strcmp (current->import_dest, dest) == 0)
|
||||||
|
+ && strcmp (current->import_dest, dest) == 0
|
||||||
|
+ && ((alias == NULL && current->alias == NULL)
|
||||||
|
+ || (alias != NULL && current->alias != NULL
|
||||||
|
+ && strcmp (alias, current->alias) == 0)))
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
- using_directives = cp_add_using (dest, src, alias, declaration,
|
||||||
|
- line_number, using_directives);
|
||||||
|
+ new = OBSTACK_ZALLOC (obstack, struct using_direct);
|
||||||
|
+
|
||||||
|
+ new->import_src = obsavestring (src, strlen (src), obstack);
|
||||||
|
+ new->import_dest = obsavestring (dest, strlen (dest), obstack);
|
||||||
|
+
|
||||||
|
+ if (alias != NULL)
|
||||||
|
+ new->alias = obsavestring (alias, strlen (alias), obstack);
|
||||||
|
+
|
||||||
|
+ new->declaration = obsavestring (declaration, strlen (declaration), obstack);
|
||||||
|
+ new->line_number = line_number;
|
||||||
|
+
|
||||||
|
+ new->next = using_directives;
|
||||||
|
+ using_directives = new;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -203,42 +224,6 @@ cp_is_anonymous (const char *namespace)
|
||||||
|
!= NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
-/* Create a new struct using direct which imports the namespace SRC
|
||||||
|
- into the scope DEST. ALIAS is the name of the imported namespace
|
||||||
|
- in the current scope. If ALIAS is NULL then the
|
||||||
|
- namespace is known by its original name.
|
||||||
|
-
|
||||||
|
- Set its next member in the linked list to NEXT; allocate all memory
|
||||||
|
- using xmalloc. It copies the strings, so NAME can be a temporary
|
||||||
|
- string. */
|
||||||
|
-
|
||||||
|
-struct using_direct *
|
||||||
|
-cp_add_using (const char *dest,
|
||||||
|
- const char *src,
|
||||||
|
- const char *alias,
|
||||||
|
- const char *declaration,
|
||||||
|
- const int line_number,
|
||||||
|
- struct using_direct *next)
|
||||||
|
-{
|
||||||
|
- struct using_direct *retval;
|
||||||
|
-
|
||||||
|
- retval = xmalloc (sizeof (struct using_direct));
|
||||||
|
- retval->import_src = savestring (src, strlen (src));
|
||||||
|
- retval->import_dest = savestring (dest, strlen (dest));
|
||||||
|
-
|
||||||
|
- if (alias != NULL)
|
||||||
|
- retval->alias = savestring (alias, strlen (alias));
|
||||||
|
- else
|
||||||
|
- retval->alias = NULL;
|
||||||
|
-
|
||||||
|
- retval->declaration = savestring (declaration, strlen (declaration));
|
||||||
|
- retval->line_number = line_number;
|
||||||
|
- retval->next = next;
|
||||||
|
- retval->searched = 0;
|
||||||
|
-
|
||||||
|
- return retval;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
/* The C++-specific version of name lookup for static and global
|
||||||
|
names. This makes sure that names get looked for in all namespaces
|
||||||
|
that are in scope. NAME is the natural name of the symbol that
|
||||||
|
diff --git a/gdb/cp-support.h b/gdb/cp-support.h
|
||||||
|
index 57aa5e5..41f17fe 100644
|
||||||
|
--- a/gdb/cp-support.h
|
||||||
|
+++ b/gdb/cp-support.h
|
||||||
|
@@ -101,14 +101,8 @@ extern void cp_add_using_directive (const char *dest,
|
||||||
|
const char *src,
|
||||||
|
const char *alias,
|
||||||
|
const char *declaration,
|
||||||
|
- const int line_number);
|
||||||
|
-
|
||||||
|
-extern struct using_direct *cp_add_using (const char *dest,
|
||||||
|
- const char *src,
|
||||||
|
- const char *alias,
|
||||||
|
- const char *declaration,
|
||||||
|
- const int line_number,
|
||||||
|
- struct using_direct *next);
|
||||||
|
+ const int line_number,
|
||||||
|
+ struct obstack *obstack);
|
||||||
|
|
||||||
|
extern void cp_initialize_namespace (void);
|
||||||
|
|
||||||
|
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
|
||||||
|
index e3a780e..b73f444 100644
|
||||||
|
--- a/gdb/dwarf2read.c
|
||||||
|
+++ b/gdb/dwarf2read.c
|
||||||
|
@@ -3563,12 +3563,12 @@ read_import_statement (struct die_info *die, struct dwarf2_cu *cu)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- using_directives = cp_add_using (import_prefix,
|
||||||
|
- canonical_name,
|
||||||
|
- import_alias,
|
||||||
|
- imported_declaration,
|
||||||
|
- line_number,
|
||||||
|
- using_directives);
|
||||||
|
+ cp_add_using_directive (import_prefix,
|
||||||
|
+ canonical_name,
|
||||||
|
+ import_alias,
|
||||||
|
+ imported_declaration,
|
||||||
|
+ line_number,
|
||||||
|
+ &cu->objfile->objfile_obstack);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
@@ -5703,7 +5703,12 @@ read_namespace (struct die_info *die, struct dwarf2_cu *cu)
|
||||||
|
if (is_anonymous)
|
||||||
|
{
|
||||||
|
const char *previous_prefix = determine_prefix (die, cu);
|
||||||
|
- cp_add_using_directive (previous_prefix, TYPE_NAME (type), NULL, "", dwarf2_read_decl_line(die, cu));
|
||||||
|
+ cp_add_using_directive (previous_prefix,
|
||||||
|
+ TYPE_NAME (type),
|
||||||
|
+ NULL,
|
||||||
|
+ "",
|
||||||
|
+ dwarf2_read_decl_line(die, cu),
|
||||||
|
+ &objfile->objfile_obstack);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
diff --git a/gdb/testsuite/gdb.cp/gdb2384-base.cc b/gdb/testsuite/gdb.cp/gdb2384-base.cc
|
||||||
|
index 09ed04e..b58f30d 100644
|
||||||
|
--- a/gdb/testsuite/gdb.cp/gdb2384-base.cc
|
||||||
|
+++ b/gdb/testsuite/gdb.cp/gdb2384-base.cc
|
||||||
|
@@ -23,6 +23,8 @@ base::base (int _x)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
+using namespace B;
|
||||||
|
+
|
||||||
|
int
|
||||||
|
base::meth ()
|
||||||
|
{
|
||||||
|
diff --git a/gdb/testsuite/gdb.cp/gdb2384-base.h b/gdb/testsuite/gdb.cp/gdb2384-base.h
|
||||||
|
index b09701e..981943c 100644
|
||||||
|
--- a/gdb/testsuite/gdb.cp/gdb2384-base.h
|
||||||
|
+++ b/gdb/testsuite/gdb.cp/gdb2384-base.h
|
||||||
|
@@ -16,6 +16,10 @@
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
+namespace B{
|
||||||
|
+ int x;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
class base
|
||||||
|
{
|
||||||
|
public:
|
188
gdb.spec
188
gdb.spec
@ -32,17 +32,18 @@ Name: gdb%{?_with_debug:-debug}
|
|||||||
# Set version to contents of gdb/version.in.
|
# Set version to contents of gdb/version.in.
|
||||||
# NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3
|
# 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).
|
# 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.20100203
|
Version: 7.1
|
||||||
|
|
||||||
# The release always contains a leading reserved number, start it at 1.
|
# 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.
|
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
|
||||||
Release: 15%{?_with_upstream:.upstream}%{dist}
|
Release: 11%{?_with_upstream:.upstream}%{dist}
|
||||||
|
|
||||||
License: GPLv3+
|
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and GFDL and BSD and Public Domain
|
||||||
Group: Development/Debuggers
|
Group: Development/Debuggers
|
||||||
|
# Do not provide URL for snapshots as the file lasts there only for 2 days.
|
||||||
# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{version}.tar.bz2
|
# ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{version}.tar.bz2
|
||||||
# ftp://sourceware.org/pub/gdb/releases/gdb-%{version}.tar.bz2
|
# ftp://sourceware.org/pub/gdb/releases/gdb-%{version}.tar.bz2
|
||||||
Source: ftp://sourceware.org/pub/gdb/snapshots/branch/gdb-%{version}.tar.bz2
|
Source: ftp://sourceware.org/pub/gdb/releases/gdb-%{version}.tar.bz2
|
||||||
Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
||||||
URL: http://gnu.org/software/gdb/
|
URL: http://gnu.org/software/gdb/
|
||||||
|
|
||||||
@ -118,7 +119,6 @@ Patch118: gdb-6.3-gstack-20050411.patch
|
|||||||
|
|
||||||
# VSYSCALL and PIE
|
# VSYSCALL and PIE
|
||||||
Patch122: gdb-6.3-test-pie-20050107.patch
|
Patch122: gdb-6.3-test-pie-20050107.patch
|
||||||
Patch124: gdb-archer-pie-0315-breakpoint_address_match.patch
|
|
||||||
Patch389: gdb-archer-pie-addons.patch
|
Patch389: gdb-archer-pie-addons.patch
|
||||||
Patch394: gdb-archer-pie-addons-keep-disabled.patch
|
Patch394: gdb-archer-pie-addons-keep-disabled.patch
|
||||||
|
|
||||||
@ -183,10 +183,6 @@ Patch170: gdb-6.3-bt-past-zero-20051201.patch
|
|||||||
# Use bigger numbers than int.
|
# Use bigger numbers than int.
|
||||||
Patch176: gdb-6.3-large-core-20051206.patch
|
Patch176: gdb-6.3-large-core-20051206.patch
|
||||||
|
|
||||||
# Hard-code executable names in gstack, such that it can run with a
|
|
||||||
# corrupted or missing PATH.
|
|
||||||
Patch177: gdb-6.3-gstack-without-path-20060414.patch
|
|
||||||
|
|
||||||
# Fix debuginfo addresses resolving for --emit-relocs Linux kernels (BZ 203661).
|
# Fix debuginfo addresses resolving for --emit-relocs Linux kernels (BZ 203661).
|
||||||
Patch188: gdb-6.5-bz203661-emit-relocs.patch
|
Patch188: gdb-6.5-bz203661-emit-relocs.patch
|
||||||
|
|
||||||
@ -224,8 +220,7 @@ Patch213: gdb-6.5-readline-long-line-crash-test.patch
|
|||||||
# Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711).
|
# Fix bogus 0x0 unwind of the thread's topmost function clone(3) (BZ 216711).
|
||||||
Patch214: gdb-6.5-bz216711-clone-is-outermost.patch
|
Patch214: gdb-6.5-bz216711-clone-is-outermost.patch
|
||||||
|
|
||||||
# Try to reduce sideeffects of skipping ppc .so libs trampolines (BZ 218379).
|
# Test sideeffects of skipping ppc .so libs trampolines (BZ 218379).
|
||||||
Patch215: gdb-6.5-bz218379-ppc-solib-trampoline-fix.patch
|
|
||||||
Patch216: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
|
Patch216: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch
|
||||||
|
|
||||||
# Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379).
|
# Fix lockup on trampoline vs. its function lookup; unreproducible (BZ 218379).
|
||||||
@ -241,7 +236,7 @@ Patch229: gdb-6.3-bz140532-ppc-unwinding-test.patch
|
|||||||
Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch
|
Patch231: gdb-6.3-bz202689-exec-from-pthread-test.patch
|
||||||
|
|
||||||
# Backported fixups post the source tarball.
|
# Backported fixups post the source tarball.
|
||||||
#Patch232: gdb-upstream.patch
|
Patch232: gdb-upstream.patch
|
||||||
|
|
||||||
# Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
|
# Testcase for PPC Power6/DFP instructions disassembly (BZ 230000).
|
||||||
Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch
|
Patch234: gdb-6.6-bz230000-power6-disassembly-test.patch
|
||||||
@ -344,13 +339,6 @@ Patch324: gdb-6.8-glibc-headers-compat.patch
|
|||||||
# Create a single binary `gdb' autodetecting --tui by its argv[0].
|
# Create a single binary `gdb' autodetecting --tui by its argv[0].
|
||||||
Patch326: gdb-6.8-tui-singlebinary.patch
|
Patch326: gdb-6.8-tui-singlebinary.patch
|
||||||
|
|
||||||
# Support transparent debugging of inlined functions for an optimized code.
|
|
||||||
# Disable break-by-name on inlined functions due to a regression on parameters
|
|
||||||
# of inlined functions falsely <optimized out> (BZ 556975 Comment 8).
|
|
||||||
# Disable addon (finish) due to inline-cmds.exp: up from outer_inline2 assert.
|
|
||||||
Patch350: gdb-6.8-inlining-addon.patch
|
|
||||||
Patch328: gdb-6.8-inlining-by-name.patch
|
|
||||||
|
|
||||||
# Fix PRPSINFO in the core files dumped by gcore (BZ 254229).
|
# Fix PRPSINFO in the core files dumped by gcore (BZ 254229).
|
||||||
Patch329: gdb-6.8-bz254229-gcore-prpsinfo.patch
|
Patch329: gdb-6.8-bz254229-gcore-prpsinfo.patch
|
||||||
|
|
||||||
@ -374,6 +362,7 @@ Patch348: gdb-6.8-bz466901-backtrace-full-prelinked.patch
|
|||||||
|
|
||||||
# The merged branch `archer' of: http://sourceware.org/gdb/wiki/ProjectArcher
|
# The merged branch `archer' of: http://sourceware.org/gdb/wiki/ProjectArcher
|
||||||
Patch349: gdb-archer.patch
|
Patch349: gdb-archer.patch
|
||||||
|
Patch420: gdb-archer-ada.patch
|
||||||
|
|
||||||
# Fix parsing elf64-i386 files for kdump PAE vmcore dumps (BZ 457187).
|
# Fix parsing elf64-i386 files for kdump PAE vmcore dumps (BZ 457187).
|
||||||
# - Turn on 64-bit BFD support, globally enable AC_SYS_LARGEFILE.
|
# - Turn on 64-bit BFD support, globally enable AC_SYS_LARGEFILE.
|
||||||
@ -385,9 +374,6 @@ Patch381: gdb-simultaneous-step-resume-breakpoint-test.patch
|
|||||||
# Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
|
# Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
|
||||||
Patch382: gdb-core-open-vdso-warning.patch
|
Patch382: gdb-core-open-vdso-warning.patch
|
||||||
|
|
||||||
# Fix callback-mode readline-6.0 regression for CTRL-C.
|
|
||||||
Patch390: gdb-readline-6.0-signal.patch
|
|
||||||
|
|
||||||
# Fix syscall restarts for amd64->i386 biarch.
|
# Fix syscall restarts for amd64->i386 biarch.
|
||||||
Patch391: gdb-x86_64-i386-syscall-restart.patch
|
Patch391: gdb-x86_64-i386-syscall-restart.patch
|
||||||
|
|
||||||
@ -404,9 +390,6 @@ Patch335: gdb-rhel5-compat.patch
|
|||||||
# Fix regression by python on ia64 due to stale current frame.
|
# Fix regression by python on ia64 due to stale current frame.
|
||||||
Patch397: gdb-follow-child-stale-parent.patch
|
Patch397: gdb-follow-child-stale-parent.patch
|
||||||
|
|
||||||
# Fix related_breakpoint stale ref crash.
|
|
||||||
Patch400: gdb-stale-related_breakpoint.patch
|
|
||||||
|
|
||||||
# Workaround ccache making lineno non-zero for command-line definitions.
|
# Workaround ccache making lineno non-zero for command-line definitions.
|
||||||
Patch403: gdb-ccache-workaround.patch
|
Patch403: gdb-ccache-workaround.patch
|
||||||
|
|
||||||
@ -429,6 +412,47 @@ Patch412: gdb-unused-revert.patch
|
|||||||
# Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866).
|
# Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866).
|
||||||
Patch417: gdb-bz541866-rwatch-before-run.patch
|
Patch417: gdb-bz541866-rwatch-before-run.patch
|
||||||
|
|
||||||
|
# Remove false gdb_assert on $sp underflow.
|
||||||
|
Patch422: gdb-infcall-sp-underflow.patch
|
||||||
|
|
||||||
|
# Fix double-free on std::terminate handler (Tom Tromey, BZ 562975).
|
||||||
|
Patch429: gdb-bz562975-std-terminate-double-free.patch
|
||||||
|
|
||||||
|
# PIE: Fix back re-reun.
|
||||||
|
Patch430: gdb-pie-rerun.patch
|
||||||
|
|
||||||
|
# Do not consider memory error on reading _r_debug->r_map as fatal (BZ 576742).
|
||||||
|
Patch432: gdb-solib-memory-error-nonfatal.patch
|
||||||
|
|
||||||
|
# testsuite: Fix unstable results of gdb.base/prelink.exp.
|
||||||
|
Patch433: gdb-6.7-testsuite-stable-results-prelink.patch
|
||||||
|
|
||||||
|
# [patch 1/6] PIE: Attach binary even after re-prelinked underneath
|
||||||
|
# [patch 2/6] PIE: Attach binary even after ld.so re-prelinked underneath
|
||||||
|
# [patch 3/6] PIE: Fix occasional error attaching i686 binary
|
||||||
|
Patch434: gdb-pie-1of6-reprelinked-bin.patch
|
||||||
|
Patch435: gdb-pie-2of6-reprelinked-ld.patch
|
||||||
|
Patch436: gdb-pie-3of6-relocate-once.patch
|
||||||
|
|
||||||
|
# [expr-cumulative] using-directive: Fix memory leak (Sami Wagiaalla).
|
||||||
|
Patch437: gdb-using-directive-leak.patch
|
||||||
|
|
||||||
|
# Fix dangling displays in separate debuginfo (BZ 574483).
|
||||||
|
Patch438: gdb-bz574483-display-sepdebug.patch
|
||||||
|
|
||||||
|
# Support AVX registers (BZ 578250).
|
||||||
|
Patch439: gdb-bz578250-avx-01of10.patch
|
||||||
|
Patch440: gdb-bz578250-avx-02of10.patch
|
||||||
|
Patch441: gdb-bz578250-avx-03of10.patch
|
||||||
|
Patch442: gdb-bz578250-avx-04of10.patch
|
||||||
|
Patch443: gdb-bz578250-avx-05of10.patch
|
||||||
|
Patch444: gdb-bz578250-avx-06of10.patch
|
||||||
|
Patch445: gdb-bz578250-avx-07of10.patch
|
||||||
|
Patch446: gdb-bz578250-avx-08of10.patch
|
||||||
|
Patch447: gdb-bz578250-avx-09of10.patch
|
||||||
|
Patch448: gdb-bz578250-avx-10of10.patch
|
||||||
|
Patch449: gdb-bz578250-avx-10of10-ppc.patch
|
||||||
|
|
||||||
BuildRequires: ncurses-devel%{?_isa} texinfo gettext flex bison expat-devel%{?_isa}
|
BuildRequires: ncurses-devel%{?_isa} texinfo gettext flex bison expat-devel%{?_isa}
|
||||||
Requires: readline%{?_isa}
|
Requires: readline%{?_isa}
|
||||||
BuildRequires: readline-devel%{?_isa}
|
BuildRequires: readline-devel%{?_isa}
|
||||||
@ -459,7 +483,7 @@ BuildRequires: libstdc++%{?_isa}
|
|||||||
%define bits_other %{?_isa}
|
%define bits_other %{?_isa}
|
||||||
%if 0%{!?el5:1}
|
%if 0%{!?el5:1}
|
||||||
%ifarch s390x
|
%ifarch s390x
|
||||||
%define bits_other (%{__isa_name}-31)
|
%define bits_other (%{__isa_name}-32)
|
||||||
%else #!s390x
|
%else #!s390x
|
||||||
%ifarch ppc
|
%ifarch ppc
|
||||||
%define bits_other (%{__isa_name}-64)
|
%define bits_other (%{__isa_name}-64)
|
||||||
@ -539,7 +563,8 @@ GDB, the GNU debugger, allows you to debug programs written in C, C++,
|
|||||||
Java, and other languages, by executing them in a controlled fashion
|
Java, and other languages, by executing them in a controlled fashion
|
||||||
and printing their data.
|
and printing their data.
|
||||||
|
|
||||||
This package provides a program that allows you to run GDB on a different machine than the one which is running the program being debugged.
|
This package provides a program that allows you to run GDB on a different
|
||||||
|
machine than the one which is running the program being debugged.
|
||||||
%endif # 0%{!?el5:1}
|
%endif # 0%{!?el5:1}
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
@ -563,9 +588,9 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
|
|||||||
|
|
||||||
%if 0%{!?_with_upstream:1}
|
%if 0%{!?_with_upstream:1}
|
||||||
|
|
||||||
#patch232 -p1
|
%patch232 -p1
|
||||||
%patch349 -p1
|
%patch349 -p1
|
||||||
%patch124 -p1
|
%patch420 -p1
|
||||||
%patch1 -p1
|
%patch1 -p1
|
||||||
%patch3 -p1
|
%patch3 -p1
|
||||||
|
|
||||||
@ -596,7 +621,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
|
|||||||
%patch169 -p1
|
%patch169 -p1
|
||||||
%patch170 -p1
|
%patch170 -p1
|
||||||
%patch176 -p1
|
%patch176 -p1
|
||||||
%patch177 -p1
|
|
||||||
%patch188 -p1
|
%patch188 -p1
|
||||||
%patch190 -p1
|
%patch190 -p1
|
||||||
%patch194 -p1
|
%patch194 -p1
|
||||||
@ -609,7 +633,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
|
|||||||
%patch211 -p1
|
%patch211 -p1
|
||||||
%patch213 -p1
|
%patch213 -p1
|
||||||
%patch214 -p1
|
%patch214 -p1
|
||||||
%patch215 -p1
|
|
||||||
%patch216 -p1
|
%patch216 -p1
|
||||||
%patch217 -p1
|
%patch217 -p1
|
||||||
%patch225 -p1
|
%patch225 -p1
|
||||||
@ -651,8 +674,6 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
|
|||||||
%patch322 -p1
|
%patch322 -p1
|
||||||
%patch324 -p1
|
%patch324 -p1
|
||||||
%patch326 -p1
|
%patch326 -p1
|
||||||
###patch350 -p1
|
|
||||||
###patch328 -p1
|
|
||||||
%patch329 -p1
|
%patch329 -p1
|
||||||
%patch330 -p1
|
%patch330 -p1
|
||||||
%patch331 -p1
|
%patch331 -p1
|
||||||
@ -663,11 +684,9 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
|
|||||||
%patch360 -p1
|
%patch360 -p1
|
||||||
%patch381 -p1
|
%patch381 -p1
|
||||||
%patch382 -p1
|
%patch382 -p1
|
||||||
%patch390 -p1
|
|
||||||
%patch391 -p1
|
%patch391 -p1
|
||||||
%patch392 -p1
|
%patch392 -p1
|
||||||
%patch397 -p1
|
%patch397 -p1
|
||||||
%patch400 -p1
|
|
||||||
%patch403 -p1
|
%patch403 -p1
|
||||||
%patch404 -p1
|
%patch404 -p1
|
||||||
%patch405 -p1
|
%patch405 -p1
|
||||||
@ -678,6 +697,27 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
|
|||||||
%patch408 -p1
|
%patch408 -p1
|
||||||
%patch412 -p1
|
%patch412 -p1
|
||||||
%patch417 -p1
|
%patch417 -p1
|
||||||
|
%patch422 -p1
|
||||||
|
%patch429 -p1
|
||||||
|
%patch430 -p1
|
||||||
|
%patch432 -p1
|
||||||
|
%patch433 -p1
|
||||||
|
%patch434 -p1
|
||||||
|
%patch435 -p1
|
||||||
|
%patch436 -p1
|
||||||
|
%patch437 -p1
|
||||||
|
%patch438 -p1
|
||||||
|
%patch439 -p1
|
||||||
|
%patch440 -p1
|
||||||
|
%patch441 -p1
|
||||||
|
%patch442 -p1
|
||||||
|
%patch443 -p1
|
||||||
|
%patch444 -p1
|
||||||
|
%patch445 -p1
|
||||||
|
%patch446 -p1
|
||||||
|
%patch447 -p1
|
||||||
|
%patch448 -p1
|
||||||
|
%patch449 -p1
|
||||||
|
|
||||||
%patch415 -p1
|
%patch415 -p1
|
||||||
%patch393 -p1
|
%patch393 -p1
|
||||||
@ -685,7 +725,7 @@ rm -f gdb/jv-exp.c gdb/m2-exp.c gdb/objc-exp.c gdb/p-exp.c
|
|||||||
# Patch415: gdb-6.6-buildid-locate-core-as-arg.patch
|
# Patch415: gdb-6.6-buildid-locate-core-as-arg.patch
|
||||||
# Currently disabled for RHEL as it is a new experimental feature not present
|
# Currently disabled for RHEL as it is a new experimental feature not present
|
||||||
# in FSF GDB and possibly affecting new user scripts.
|
# in FSF GDB and possibly affecting new user scripts.
|
||||||
%if 0%{!?rhel:1}
|
%if 0%{?rhel:1}
|
||||||
%patch415 -p1 -R
|
%patch415 -p1 -R
|
||||||
%endif
|
%endif
|
||||||
%if 0%{!?el5:1}
|
%if 0%{!?el5:1}
|
||||||
@ -978,7 +1018,7 @@ fi
|
|||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%doc COPYING COPYING.LIB README NEWS
|
%doc COPYING3 COPYING COPYING.LIB README NEWS
|
||||||
%{_bindir}/gcore
|
%{_bindir}/gcore
|
||||||
%{_bindir}/gdb
|
%{_bindir}/gdb
|
||||||
%{_bindir}/gdbtui
|
%{_bindir}/gdbtui
|
||||||
@ -1010,6 +1050,80 @@ fi
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Apr 8 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.1-11.fc13
|
||||||
|
- testsuite: Fix gdb.base/gstack.exp also for ppc64 inferiors (for BZ 579793).
|
||||||
|
|
||||||
|
* Thu Apr 8 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.1-10.fc13
|
||||||
|
- Fix s390 --with testsuite Buildrequiers to be (s390-32) (BZ 580347, Cai Qian).
|
||||||
|
|
||||||
|
* Wed Apr 7 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.1-9.fc13
|
||||||
|
- Fix gstack to print even the frame #0. New gdb.base/gstack.exp. (BZ 579793)
|
||||||
|
- Merge gdb-6.3-gstack-without-path-20060414.p* into gdb-6.3-gstack-20050411.p*,
|
||||||
|
no real code change.
|
||||||
|
|
||||||
|
* Mon Apr 5 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.1-8.fc13
|
||||||
|
- Fix breakpoint at *_start (BZ 162775, bugreport by John Reiser).
|
||||||
|
|
||||||
|
* Sat Apr 3 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.1-7.fc13
|
||||||
|
- Fix ppc build of the AVX registers support (for BZ 578250).
|
||||||
|
|
||||||
|
* Sat Apr 3 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.1-6.fc13
|
||||||
|
- Support AVX registers (BZ 578250).
|
||||||
|
|
||||||
|
* Sat Apr 3 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.1-5.fc13
|
||||||
|
- Fix dangling displays in separate debuginfo (BZ 574483).
|
||||||
|
|
||||||
|
* Wed Mar 31 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.1-4.fc13
|
||||||
|
- Remove gdb-readline-6.0-signal.patch with a bug causing crash while no longer
|
||||||
|
required with F-13 readline-6.1 (BZ 575516)
|
||||||
|
|
||||||
|
* Mon Mar 29 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.1-3.fc13
|
||||||
|
- [expr-cumulative] using-directive: Fix memory leak (Sami Wagiaalla).
|
||||||
|
|
||||||
|
* Mon Mar 29 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.1-2.fc13
|
||||||
|
- Drop obsoleted `gdb-archer-pie-0315-breakpoint_address_match.patch'.
|
||||||
|
- Do not consider memory error on reading _r_debug->r_map as fatal (BZ 576742).
|
||||||
|
- PIE: Attach binary even after re-prelinked underneath.
|
||||||
|
- PIE: Attach binary even after ld.so re-prelinked underneath.
|
||||||
|
- PIE: Fix occasional error attaching i686 binary (BZ 576742).
|
||||||
|
- testsuite: Fix unstable results of gdb.base/prelink.exp.
|
||||||
|
|
||||||
|
* Thu Mar 25 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.1-1.fc13
|
||||||
|
- Update to new FSF GDB release.
|
||||||
|
|
||||||
|
* Mon Mar 15 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.90.20100312-24.fc13
|
||||||
|
- Drop gdb-6.5-bz218379-ppc-solib-trampoline-fix.patch having false symbols
|
||||||
|
resolving (related to BZ 573277).
|
||||||
|
|
||||||
|
* Fri Mar 12 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.90.20100312-23.fc13
|
||||||
|
- Update to new FSF GDB snapshot.
|
||||||
|
- Fix double-free on std::terminate handler (Tom Tromey, BZ 562975).
|
||||||
|
|
||||||
|
* Wed Mar 10 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.90.20100306-22.fc13
|
||||||
|
- Another License update.
|
||||||
|
|
||||||
|
* Wed Mar 10 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.90.20100306-21.fc13
|
||||||
|
- Update License for all the licenses contained in .src.rpm.
|
||||||
|
|
||||||
|
* Mon Mar 8 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.90.20100306-20.fc13
|
||||||
|
- Remove unapplied: gdb-6.8-inlining-addon.patch gdb-6.8-inlining-by-name.patch
|
||||||
|
|
||||||
|
* Mon Mar 8 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.90.20100306-19.fc13
|
||||||
|
- Include also %%doc COPYING3 (review by Petr Machata).
|
||||||
|
- Remove URL for Source (review by Matej Cepl).
|
||||||
|
|
||||||
|
* Sun Mar 7 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.90.20100306-18.fc13
|
||||||
|
- archer-jankratochvil-fedora13 commit: 59c35a31f0981a0f0b884b32c91ae6325b2126cd
|
||||||
|
|
||||||
|
* Sun Feb 28 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.50.20100203-17.fc13
|
||||||
|
- Fix false warning: section .gnu.liblist not found in ...
|
||||||
|
- Fix crash on stale addrinfo->sectindex (more sensitive due to the PIE patch).
|
||||||
|
|
||||||
|
* Fri Feb 26 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.50.20100203-16.fc13
|
||||||
|
- Fix ia64 part of the bt-clone-stop.exp fix.
|
||||||
|
- Fix gdb.ada/* regressions (Keith Seitz).
|
||||||
|
- Remove false gdb_assert on $sp underflow.
|
||||||
|
|
||||||
* Mon Feb 8 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.50.20100203-15.fc13
|
* Mon Feb 8 2010 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.0.50.20100203-15.fc13
|
||||||
- Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866).
|
- Fix i386+x86_64 rwatch+awatch before run, regression against 6.8 (BZ 541866).
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user