Hello community,
here is the log from the commit of package gdb for openSUSE:Factory
checked in at Fri Aug 27 14:50:14 CEST 2010.
--------
--- gdb/gdb.changes 2010-08-05 13:24:17.000000000 +0200
+++ /mounts/work_src_done/STABLE/gdb/gdb.changes 2010-08-25 13:20:26.000000000 +0200
@@ -1,0 +2,15 @@
+Wed Aug 25 11:04:38 UTC 2010 - rguenther@novell.com
+
+- Backport fix for gcore not handling GNU_RELRO sections. [bnc#596646]
+
+-------------------------------------------------------------------
+Wed Aug 25 10:53:50 UTC 2010 - rguenther@novell.com
+
+- Merge from gdb-7.1-33.fc13.src.rpm.
+
+-------------------------------------------------------------------
+Fri Aug 6 12:25:13 UTC 2010 - rguenther@novell.com
+
+- Backport fix for setting of VSX registers. [bnc#626970]
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
New:
----
gdb-7.1-bnc626970.patch
gdb-7.2-bnc596646.patch
gdb-bz602644-ro-filesystem.patch
gdb-bz620012-slow-long-bt.patch
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ gdb.spec ++++++
--- /var/tmp/diff_new_pack.O7hwXX/_old 2010-08-27 14:38:18.000000000 +0200
+++ /var/tmp/diff_new_pack.O7hwXX/_new 2010-08-27 14:38:18.000000000 +0200
@@ -24,7 +24,7 @@
# NOTE: the FSF gdb versions are numbered N.M for official releases, like 6.3
# and, since January 2005, X.Y.Z.date for daily snapshots, like 6.3.50.20050112 # (daily snapshot from mailine), or 6.3.0.20040112 (head of the release branch).
Version: 7.1
-Release: 7
+Release: 8
# 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.
@@ -508,6 +508,12 @@
# Fix crash in gdbpy_is_string (BZ 611569, Tom Tromey).
Patch492: gdb-bz611569-gdbpy_is_string.patch
+# Fix long delay printing an overflown stack backtrace (BZ 620012, Tom Tromey).
+Patch494: gdb-bz620012-slow-long-bt.patch
+
+# Fix GDB regression for starting on r/o filesystem (BZ 602644).
+Patch495: gdb-bz602644-ro-filesystem.patch
+
# Fix readline 5.1 warnings
Patch1000: readline-5.1-random.patch
# Upstream patch to fix gcc -Werror
@@ -515,6 +521,10 @@
Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch
# Fix build on hppa
Patch1003: gdb-hppa.patch
+# Fix setting of VSX registers, bnc#626970
+Patch1004: gdb-7.1-bnc626970.patch
+# Fix gcore with GNU_RELRO sections, bnc#596646
+Patch1005: gdb-7.2-bnc596646.patch
BuildRequires: bison flex gettext glibc-devel ncurses-devel texinfo zlib-devel
%if %{suse_version} < 1020
@@ -783,11 +793,15 @@
%patch489 -p1
%patch490 -p1
%patch492 -p1
+%patch494 -p1
+%patch495 -p1
%patch1000
%patch1001 -p0
%patch1002 -p1
%patch1003
+%patch1004 -p1
+%patch1005 -p1
find -name "*.orig" | xargs rm -f
! find -name "*.rej" # Should not happen.
++++++ gdb-7.1-bnc626970.patch ++++++
Index: gdb-7.1/gdb/ppc-linux-nat.c
===================================================================
--- gdb-7.1.orig/gdb/ppc-linux-nat.c 2010-07-29 16:43:11.000000000 -0300
+++ gdb-7.1/gdb/ppc-linux-nat.c 2010-07-29 16:45:01.000000000 -0300
@@ -807,7 +807,7 @@ store_vsx_register (const struct regcach
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
int vsxregsize = register_size (gdbarch, tdep->ppc_vsr0_upper_regnum);
- ret = ptrace (PTRACE_SETVSXREGS, tid, 0, ®s);
+ ret = ptrace (PTRACE_GETVSXREGS, tid, 0, ®s);
if (ret < 0)
{
if (errno == EIO)
Index: gdb-7.1/gdb/testsuite/gdb.arch/vsx-regs.exp
===================================================================
--- gdb-7.1.orig/gdb/testsuite/gdb.arch/vsx-regs.exp 2010-01-01 05:32:00.000000000 -0200
+++ gdb-7.1/gdb/testsuite/gdb.arch/vsx-regs.exp 2010-07-29 17:11:18.000000000 -0300
@@ -14,8 +14,6 @@
# along with this program. If not, see http://www.gnu.org/licenses/.
#
-# Tests for Powerpc AltiVec register setting and fetching
-
if $tracelevel then {
strace $tracelevel
}
@@ -68,11 +66,13 @@ if ![runto_main] then {
# Data sets used throughout the test
-set vector_register1 ".uint128 = 0x3ff4cccccccccccc0000000000000000, v4_float = .0x1, 0xf99999a0, 0x0, 0x0., v4_int32 = .0x3ff4cccc, 0xcccccccc, 0x0, 0x0., v8_int16 = .0x3ff4, 0xcccc, 0xcccc, 0xcccc, 0x0, 0x0, 0x0, 0x0., v16_int8 = .0x3f, 0xf4, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0.."
+set vector_register1 ".uint128 = 0x3ff4cccccccccccc0000000000000000, v2_double = .0x1, 0x0., v4_float = .0x1, 0xf99999a0, 0x0, 0x0., v4_int32 = .0x3ff4cccc, 0xcccccccc, 0x0, 0x0., v8_int16 = .0x3ff4, 0xcccc, 0xcccc, 0xcccc, 0x0, 0x0, 0x0, 0x0., v16_int8 = .0x3f, 0xf4, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0.."
+
+set vector_register2 "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v2_double = .0x1, 0x1., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef., v16_int8 = .0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef.."
-set vector_register2 "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef., v16_int8 = .0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef.."
+set vector_register3 ".uint128 = 0x00000001000000010000000100000001, v2_double = .0x0, 0x0., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.."
-set vector_register3 ".uint128 = 0x00000001000000010000000100000001, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.."
+set vector_register3_vr ".uint128 = 0x00000001000000010000000100000001, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.."
set float_register ".raw 0xdeadbeefdeadbeef."
@@ -80,7 +80,7 @@ set float_register ".raw 0xdeadbeefdeadb
# 1: Set F0~F31 registers and check if it reflects on VS0~VS31.
for {set i 0} {$i < 32} {incr i 1} {
- send_gdb "set \$f$i = 1\.3"
+ gdb_test "set \$f$i = 1\.3" ""
}
for {set i 0} {$i < 32} {incr i 1} {
@@ -90,7 +90,7 @@ for {set i 0} {$i < 32} {incr i 1} {
# 2: Set VS0~VS31 registers and check if it reflects on F0~F31.
for {set i 0} {$i < 32} {incr i 1} {
for {set j 0} {$j < 4} {incr j 1} {
- send_gdb "set \$vs$i.v4_int32\[$j\] = 0xdeadbeef"
+ gdb_test "set \$vs$i.v4_int32\[$j\] = 0xdeadbeef" ""
}
}
@@ -107,7 +107,7 @@ for {set i 0} {$i < 32} {incr i 1} {
# 1: Set VR0~VR31 registers and check if it reflects on VS32~VS63.
for {set i 0} {$i < 32} {incr i 1} {
for {set j 0} {$j < 4} {incr j 1} {
- send_gdb "set \$vr$i.v4_int32\[$j\] = 1"
+ gdb_test "set \$vr$i.v4_int32\[$j\] = 1" ""
}
}
@@ -117,12 +117,12 @@ for {set i 32} {$i < 64} {incr i 1} {
# 2: Set VS32~VS63 registers and check if it reflects on VR0~VR31.
for {set i 32} {$i < 64} {incr i 1} {
for {set j 0} {$j < 4} {incr j 1} {
- send_gdb "set \$vs$i.v4_int32\[$j\] = 1"
+ gdb_test "set \$vs$i.v4_int32\[$j\] = 1" ""
}
}
for {set i 0} {$i < 32} {incr i 1} {
- gdb_test "info reg vr$i" "vr$i.*$vector_register3" "info reg vr$i"
+ gdb_test "info reg vr$i" "vr$i.*$vector_register3_vr" "info reg vr$i"
}
set escapedfilename [string_to_regexp ${objdir}/${subdir}/vsx-core.test]
++++++ gdb-7.2-bnc596646.patch ++++++
Index: gdb-7.1/gdb/defs.h
===================================================================
--- gdb-7.1.orig/gdb/defs.h 2010-08-25 13:05:57.000000000 +0200
+++ gdb-7.1/gdb/defs.h 2010-08-25 13:06:43.000000000 +0200
@@ -646,12 +646,14 @@ extern void init_source_path (void);
/* From exec.c */
+/* MODIFIED has value -1 for unknown, 0 for not modified, 1 for modified. */
+typedef int (*find_memory_region_t) (CORE_ADDR addr, unsigned long size,
+ int read, int write, int exec,
+ int modified, void *data);
+
/* Take over the 'find_mapped_memory' vector from exec.c. */
-extern void exec_set_find_memory_regions (int (*) (int (*) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
- void *));
+extern void exec_set_find_memory_regions (int (*func) (find_memory_region_t,
+ void *));
/* Possible lvalue types. Like enum language, this should be in
value.h, but needs to be here for the same reason. */
Index: gdb-7.1/gdb/exec.c
===================================================================
--- gdb-7.1.orig/gdb/exec.c 2010-08-25 13:05:56.000000000 +0200
+++ gdb-7.1/gdb/exec.c 2010-08-25 13:06:43.000000000 +0200
@@ -835,11 +835,7 @@ exec_has_memory (struct target_ops *ops)
/* Find mapped memory. */
extern void
-exec_set_find_memory_regions (int (*func) (int (*) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
- void *))
+exec_set_find_memory_regions (int (*func) (find_memory_region_t, void *))
{
exec_ops.to_find_memory_regions = func;
}
Index: gdb-7.1/gdb/fbsd-nat.c
===================================================================
--- gdb-7.1.orig/gdb/fbsd-nat.c 2010-08-25 13:05:57.000000000 +0200
+++ gdb-7.1/gdb/fbsd-nat.c 2010-08-25 13:06:43.000000000 +0200
@@ -92,9 +92,7 @@ fbsd_read_mapping (FILE *mapfile, unsign
argument to FUNC. */
int
-fbsd_find_memory_regions (int (*func) (CORE_ADDR, unsigned long,
- int, int, int, void *),
- void *obfd)
+fbsd_find_memory_regions (find_memory_region_t func, void *obfd)
{
pid_t pid = ptid_get_pid (inferior_ptid);
char *mapfilename;
@@ -135,7 +133,7 @@ fbsd_find_memory_regions (int (*func) (C
}
/* Invoke the callback function to create the corefile segment. */
- func (start, size, read, write, exec, obfd);
+ func (start, size, read, write, exec, -1, obfd);
}
do_cleanups (cleanup);
Index: gdb-7.1/gdb/gcore.c
===================================================================
--- gdb-7.1.orig/gdb/gcore.c 2010-08-25 13:05:56.000000000 +0200
+++ gdb-7.1/gdb/gcore.c 2010-08-25 13:06:43.000000000 +0200
@@ -378,8 +378,8 @@ make_output_phdrs (bfd *obfd, asection *
}
static int
-gcore_create_callback (CORE_ADDR vaddr, unsigned long size,
- int read, int write, int exec, void *data)
+gcore_create_callback (CORE_ADDR vaddr, unsigned long size, int read,
+ int write, int exec, int modified, void *data)
{
bfd *obfd = data;
asection *osec;
@@ -393,7 +393,7 @@ gcore_create_callback (CORE_ADDR vaddr,
/* If the memory segment has no permissions set, ignore it, otherwise
when we later try to access it for read/write, we'll get an error
or jam the kernel. */
- if (read == 0 && write == 0 && exec == 0)
+ if (read == 0 && write == 0 && exec == 0 && modified == 0)
{
if (info_verbose)
{
@@ -404,7 +404,7 @@ gcore_create_callback (CORE_ADDR vaddr,
return 0;
}
- if (write == 0 && !solib_keep_data_in_core (vaddr, size))
+ if (write == 0 && modified == 0 && !solib_keep_data_in_core (vaddr, size))
{
/* See if this region of memory lies inside a known file on disk.
If so, we can avoid copying its contents by clearing SEC_LOAD. */
@@ -436,10 +436,12 @@ gcore_create_callback (CORE_ADDR vaddr,
}
}
- keep:
- flags |= SEC_READONLY;
+ keep:;
}
+ if (write == 0)
+ flags |= SEC_READONLY;
+
if (exec)
flags |= SEC_CODE;
else
@@ -466,9 +468,7 @@ gcore_create_callback (CORE_ADDR vaddr,
}
static int
-objfile_find_memory_regions (int (*func) (CORE_ADDR, unsigned long,
- int, int, int, void *),
- void *obfd)
+objfile_find_memory_regions (find_memory_region_t func, void *obfd)
{
/* Use objfile data to create memory sections. */
struct objfile *objfile;
@@ -492,6 +492,7 @@ objfile_find_memory_regions (int (*func)
1, /* All sections will be readable. */
(flags & SEC_READONLY) == 0, /* Writable. */
(flags & SEC_CODE) != 0, /* Executable. */
+ -1, /* Modified is unknown. */
obfd);
if (ret != 0)
return ret;
@@ -504,6 +505,7 @@ objfile_find_memory_regions (int (*func)
1, /* Stack section will be readable. */
1, /* Stack section will be writable. */
0, /* Stack section will not be executable. */
+ 1, /* Stack section will be modified. */
obfd);
/* Make a heap segment. */
@@ -512,6 +514,7 @@ objfile_find_memory_regions (int (*func)
1, /* Heap section will be readable. */
1, /* Heap section will be writable. */
0, /* Heap section will not be executable. */
+ 1, /* Heap section will be modified. */
obfd);
return 0;
Index: gdb-7.1/gdb/gnu-nat.c
===================================================================
--- gdb-7.1.orig/gdb/gnu-nat.c 2010-02-15 18:35:49.000000000 +0100
+++ gdb-7.1/gdb/gnu-nat.c 2010-08-25 13:06:43.000000000 +0200
@@ -2475,11 +2475,7 @@ gnu_xfer_memory (CORE_ADDR memaddr, gdb_
/* Call FUNC on each memory region in the task. */
static int
-gnu_find_memory_regions (int (*func) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
- void *data)
+gnu_find_memory_regions (find_memory_region_t func, void *data)
{
error_t err;
task_t task;
@@ -2536,7 +2532,7 @@ gnu_find_memory_regions (int (*func) (CO
last_protection & VM_PROT_READ,
last_protection & VM_PROT_WRITE,
last_protection & VM_PROT_EXECUTE,
- data);
+ -1, data);
last_region_address = region_address;
last_region_end = region_address += region_length;
last_protection = protection;
@@ -2549,7 +2545,7 @@ gnu_find_memory_regions (int (*func) (CO
last_protection & VM_PROT_READ,
last_protection & VM_PROT_WRITE,
last_protection & VM_PROT_EXECUTE,
- data);
+ -1, data);
return 0;
}
Index: gdb-7.1/gdb/linux-nat.c
===================================================================
--- gdb-7.1.orig/gdb/linux-nat.c 2010-08-25 13:05:57.000000000 +0200
+++ gdb-7.1/gdb/linux-nat.c 2010-08-25 13:07:43.000000000 +0200
@@ -4198,7 +4198,7 @@ read_mapping (FILE *mapfile,
long long *endaddr,
char *permissions,
long long *offset,
- char *device, long long *inode, char *filename)
+ char *device, long long *inode, char *filename, int *modified)
{
int ret = fscanf (mapfile, "%llx-%llx %s %llx %s %llx",
addr, endaddr, permissions, offset, device, inode);
@@ -4216,6 +4216,40 @@ read_mapping (FILE *mapfile,
ret += fscanf (mapfile, "%[^\n]\n", filename);
}
+ if (modified != NULL)
+ {
+ *modified = -1;
+ for (;;)
+ {
+ int ch;
+ char keyword[64 + 1];
+ unsigned long number;
+
+ ch = fgetc (mapfile);
+ if (ch != EOF)
+ ungetc (ch, mapfile);
+ if (ch < 'A' || ch > 'Z')
+ break;
+ if (fscanf (mapfile, "%64s%lu kB\n", keyword, &number) != 2)
+ {
+ warning (_("Error parsing /proc/PID/{s,}maps file"));
+ do
+ ch = fgetc (mapfile);
+ while (ch != EOF && ch != '\n');
+ break;
+ }
+ if (number != 0 && (strcmp (keyword, "Shared_Dirty:") == 0
+ || strcmp (keyword, "Private_Dirty:") == 0
+ || strcmp (keyword, "Swap:") == 0))
+ *modified = 1;
+ else if (*modified == -1)
+ {
+ /* Valid line proves an smaps file is being read in. */
+ *modified = 0;
+ }
+ }
+ }
+
return (ret != 0 && ret != EOF);
}
@@ -4223,23 +4257,25 @@ read_mapping (FILE *mapfile,
regions in the inferior for a corefile. */
static int
-linux_nat_find_memory_regions (int (*func) (CORE_ADDR,
- unsigned long,
- int, int, int, void *), void *obfd)
+linux_nat_find_memory_regions (find_memory_region_t func, void *obfd)
{
int pid = PIDGET (inferior_ptid);
char mapsfilename[MAXPATHLEN];
FILE *mapsfile;
long long addr, endaddr, size, offset, inode;
char permissions[8], device[8], filename[MAXPATHLEN];
- int read, write, exec;
+ int read, write, exec, modified;
int ret;
struct cleanup *cleanup;
/* Compose the filename for the /proc memory map, and open it. */
- sprintf (mapsfilename, "/proc/%d/maps", pid);
+ sprintf (mapsfilename, "/proc/%d/smaps", pid);
if ((mapsfile = fopen (mapsfilename, "r")) == NULL)
- error (_("Could not open %s."), mapsfilename);
+ {
+ sprintf (mapsfilename, "/proc/%d/maps", pid);
+ if ((mapsfile = fopen (mapsfilename, "r")) == NULL)
+ error (_("Could not open %s."), mapsfilename);
+ }
cleanup = make_cleanup_fclose (mapsfile);
if (info_verbose)
@@ -4248,7 +4284,7 @@ linux_nat_find_memory_regions (int (*fun
/* Now iterate until end-of-file. */
while (read_mapping (mapsfile, &addr, &endaddr, &permissions[0],
- &offset, &device[0], &inode, &filename[0]))
+ &offset, &device[0], &inode, &filename[0], &modified))
{
size = endaddr - addr;
@@ -4271,7 +4307,7 @@ linux_nat_find_memory_regions (int (*fun
/* Invoke the callback function to create the corefile
segment. */
- func (addr, size, read, write, exec, obfd);
+ func (addr, size, read, write, exec, modified, obfd);
}
do_cleanups (cleanup);
return 0;
@@ -4902,7 +4938,8 @@ linux_nat_info_proc_cmd (char *args, int
}
while (read_mapping (procfile, &addr, &endaddr, &permissions[0],
- &offset, &device[0], &inode, &filename[0]))
+ &offset, &device[0], &inode, &filename[0],
+ NULL))
{
size = endaddr - addr;
Index: gdb-7.1/gdb/procfs.c
===================================================================
--- gdb-7.1.orig/gdb/procfs.c 2010-08-25 13:05:57.000000000 +0200
+++ gdb-7.1/gdb/procfs.c 2010-08-25 13:09:32.000000000 +0200
@@ -4049,7 +4049,7 @@ insert_dbx_link_bpt_in_file (int fd, COR
static int
insert_dbx_link_bpt_in_region (struct prmap *map,
- int (*child_func) (),
+ find_memory_region_t child_func,
void *data)
{
procinfo *pi = (procinfo *) data;
@@ -5570,9 +5570,9 @@ procfs_use_watchpoints (struct target_op
*/
static int
-iterate_over_mappings (procinfo *pi, int (*child_func) (), void *data,
+iterate_over_mappings (procinfo *pi, find_memory_region_t child_func, void *data,
int (*func) (struct prmap *map,
- int (*child_func) (),
+ find_memory_region_t child_func,
void *data))
{
char pathname[MAX_PROC_NAME_SIZE];
@@ -5691,10 +5691,7 @@ int solib_mappings_callback (struct prma
static int
find_memory_regions_callback (struct prmap *map,
- int (*func) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
+ find_memory_region_t func,
void *data)
{
return (*func) ((CORE_ADDR) map->pr_vaddr,
@@ -5702,7 +5699,7 @@ find_memory_regions_callback (struct prm
(map->pr_mflags & MA_READ) != 0,
(map->pr_mflags & MA_WRITE) != 0,
(map->pr_mflags & MA_EXEC) != 0,
- data);
+ -1, data);
}
/*
@@ -5721,11 +5718,7 @@ find_memory_regions_callback (struct prm
*/
static int
-proc_find_memory_regions (int (*func) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
- void *data)
+proc_find_memory_regions (find_memory_region_t func, void *data)
{
procinfo *pi = find_procinfo_or_die (PIDGET (inferior_ptid), 0);
@@ -5771,7 +5764,7 @@ mappingflags (long flags)
*/
static int
-info_mappings_callback (struct prmap *map, int (*ignore) (), void *unused)
+info_mappings_callback (struct prmap *map, find_memory_region_t ignore, void *unused)
{
unsigned int pr_off;
Index: gdb-7.1/gdb/target.c
===================================================================
--- gdb-7.1.orig/gdb/target.c 2010-08-25 13:05:56.000000000 +0200
+++ gdb-7.1/gdb/target.c 2010-08-25 13:06:43.000000000 +0200
@@ -2836,7 +2836,7 @@ dummy_pid_to_str (struct target_ops *ops
/* Error-catcher for target_find_memory_regions. */
static int
-dummy_find_memory_regions (int (*ignore1) (), void *ignore2)
+dummy_find_memory_regions (find_memory_region_t ignore1, void *ignore2)
{
error (_("Command not implemented for this target."));
return 0;
Index: gdb-7.1/gdb/target.h
===================================================================
--- gdb-7.1.orig/gdb/target.h 2010-08-25 13:05:58.000000000 +0200
+++ gdb-7.1/gdb/target.h 2010-08-25 13:06:43.000000000 +0200
@@ -479,11 +479,7 @@ struct target_ops
int (*to_async_mask) (int);
int (*to_supports_non_stop) (void);
/* find_memory_regions support method for gcore */
- int (*to_find_memory_regions) (int (*) (CORE_ADDR,
- unsigned long,
- int, int, int,
- void *),
- void *);
+ int (*to_find_memory_regions) (find_memory_region_t func, void *data);
/* make_corefile_notes support method for gcore */
char * (*to_make_corefile_notes) (bfd *, int *);
/* get_bookmark support method for bookmarks */
Index: gdb-7.1/gdb/testsuite/gdb.base/gcore-relro-lib.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.1/gdb/testsuite/gdb.base/gcore-relro-lib.c 2010-08-25 13:06:43.000000000 +0200
@@ -0,0 +1,21 @@
+/* Copyright 2010 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see http://www.gnu.org/licenses/. */
+
+void
+lib (void)
+{
+}
Index: gdb-7.1/gdb/testsuite/gdb.base/gcore-relro-main.c
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.1/gdb/testsuite/gdb.base/gcore-relro-main.c 2010-08-25 13:06:43.000000000 +0200
@@ -0,0 +1,25 @@
+/* Copyright 2010 Free Software Foundation, Inc.
+
+ This file is part of GDB.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see http://www.gnu.org/licenses/. */
+
+extern void lib (void);
+
+int
+main (void)
+{
+ lib ();
+ return 0;
+}
Index: gdb-7.1/gdb/testsuite/gdb.base/gcore-relro.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.1/gdb/testsuite/gdb.base/gcore-relro.exp 2010-08-25 13:06:43.000000000 +0200
@@ -0,0 +1,80 @@
+# 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/.
+
+if {[skip_shlib_tests]} {
+ return 0
+}
+
+set testfile "gcore-relro"
+set srcmainfile ${testfile}-main.c
+set srclibfile ${testfile}-lib.c
+set libfile ${objdir}/${subdir}/${testfile}-lib.so
+set objfile ${objdir}/${subdir}/${testfile}-main.o
+set executable ${testfile}-main
+set binfile ${objdir}/${subdir}/${executable}
+set gcorefile ${objdir}/${subdir}/${executable}.gcore
+
+if { [gdb_compile_shlib ${srcdir}/${subdir}/${srclibfile} ${libfile} {debug}] != ""
+ || [gdb_compile ${srcdir}/${subdir}/${srcmainfile} ${objfile} object {debug}] != "" } {
+ untested ${testfile}.exp
+ return -1
+}
+set opts [list debug shlib=${libfile} additional_flags=-Wl,-z,relro]
+if { [gdb_compile ${objfile} ${binfile} executable $opts] != "" } {
+ unsupported "-Wl,-z,relro compilation failed"
+ return -1
+}
+
+clean_restart $executable
+gdb_load_shlibs $libfile
+
+# Does this gdb support gcore?
+set test "help gcore"
+gdb_test_multiple $test $test {
+ -re "Undefined command: .gcore.*\r\n$gdb_prompt $" {
+ # gcore command not supported -- nothing to test here.
+ unsupported "gdb does not support gcore on this target"
+ return -1;
+ }
+ -re "Save a core file .*\r\n$gdb_prompt $" {
+ pass $test
+ }
+}
+
+if { ![runto lib] } then {
+ return -1
+}
+
+set escapedfilename [string_to_regexp ${gcorefile}]
+
+set test "save a corefile"
+gdb_test_multiple "gcore ${gcorefile}" $test {
+ -re "Saved corefile ${escapedfilename}\r\n$gdb_prompt $" {
+ pass $test
+ }
+ -re "Can't create a corefile\r\n$gdb_prompt $" {
+ unsupported $test
+ return -1
+ }
+}
+
+# Now restart gdb and load the corefile.
+
+clean_restart $executable
+gdb_load_shlibs $libfile
+
+gdb_test "core ${gcorefile}" "Core was generated by .*" "re-load generated corefile"
+
+gdb_test "frame" "#0 \[^\r\n\]* lib .*" "library got loaded"
++++++ gdb-bz602644-ro-filesystem.patch ++++++
http://sourceware.org/ml/gdb-cvs/2010-06/msg00161.html
### src/gdb/ChangeLog 2010/06/24 15:17:24 1.11921
### src/gdb/ChangeLog 2010/06/24 18:24:02 1.11922
## -1,4 +1,10 @@
2010-06-24 Jan Kratochvil