aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/valgrind-db-attach.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-01-14 21:15:00 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-01-14 21:15:00 +0000
commit9f2982ff0bf5e33d54b085b98970ab15ba4fac46 (patch)
treecb004329356d337dade67017cf7bb35db6015e38 /gdb/testsuite/gdb.base/valgrind-db-attach.c
parentbbfba9ed150f56ba5b09360314b30381a865ff5c (diff)
downloadgdb-9f2982ff0bf5e33d54b085b98970ab15ba4fac46.zip
gdb-9f2982ff0bf5e33d54b085b98970ab15ba4fac46.tar.gz
gdb-9f2982ff0bf5e33d54b085b98970ab15ba4fac46.tar.bz2
gdb/
Support Valgrind attachments broken by the PIE support. * auxv.c: Include gdbcore.h. (procfs_xfer_auxv): Make static. Reduce its comment. Drop its parameters ops, object and annex. Remove their assertions. (ld_so_xfer_auxv, memory_xfer_auxv): New function. * auxv.h (procfs_xfer_auxv): Remove comment. Rename to ... (memory_xfer_auxv): ... here. * linux-nat.c (linux_xfer_partial): Rename procfs_xfer_auxv to memory_xfer_auxv. * procfs.c (procfs_xfer_partial): Likewise. * solib-svr4.c (svr4_relocate_main_executable): New prototype. (svr4_special_symbol_handling): Call svr4_relocate_main_executable. (svr4_solib_create_inferior_hook): Conditionalize the svr4_relocate_main_executable call. gdb/testsuite/ * gdb.base/valgrind-db-attach.exp, gdb.base/valgrind-db-attach.c: New.
Diffstat (limited to 'gdb/testsuite/gdb.base/valgrind-db-attach.c')
-rw-r--r--gdb/testsuite/gdb.base/valgrind-db-attach.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/gdb/testsuite/gdb.base/valgrind-db-attach.c b/gdb/testsuite/gdb.base/valgrind-db-attach.c
new file mode 100644
index 0000000..5faaaac
--- /dev/null
+++ b/gdb/testsuite/gdb.base/valgrind-db-attach.c
@@ -0,0 +1,30 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2009 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <stdlib.h>
+
+int main()
+{
+ void *p;
+
+ p = malloc (1);
+ if (p == NULL)
+ return 1;
+ free (p);
+ free (p); /* double-free */
+ return 0;
+}