aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2013-09-25 11:52:50 +0000
committerUlrich Weigand <uweigand@de.ibm.com>2013-09-25 11:52:50 +0000
commit7d760051ffb8a23cdc51342d4e6243fbc462f73f (patch)
treefb9306fe2c91b5731821ac3bfb9689660849fea7 /gdb
parent020f703635b9a8dcc29dce41a682b99bde1e8c74 (diff)
downloadgdb-7d760051ffb8a23cdc51342d4e6243fbc462f73f.zip
gdb-7d760051ffb8a23cdc51342d4e6243fbc462f73f.tar.gz
gdb-7d760051ffb8a23cdc51342d4e6243fbc462f73f.tar.bz2
ChangeLog:
2013-09-25 Andreas Arnez <arnez@linux.vnet.ibm.com> PR shlibs/8882 * solib-svr4.c (svr4_read_so_list): Skip the vDSO when reading link map entries. testsuite/ChangeLog: 2013-09-25 Andreas Arnez <arnez@linux.vnet.ibm.com> PR shlibs/8882 * gdb.base/corefile.exp: Add a check to assure warning-free core-file load.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/solib-svr4.c12
-rw-r--r--gdb/testsuite/ChangeLog6
-rw-r--r--gdb/testsuite/gdb.base/corefile.exp16
4 files changed, 38 insertions, 2 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 1d3d96f..44ffc1f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2013-09-25 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
+ PR shlibs/8882
+ * solib-svr4.c (svr4_read_so_list): Skip the vDSO when reading
+ link map entries.
+
2013-09-24 Doug Evans <dje@google.com>
* objfiles.c (free_objfile): Move comment.
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index a497c6c..ddbbd94 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -1310,6 +1310,7 @@ static int
svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
struct so_list ***link_ptr_ptr, int ignore_first)
{
+ struct so_list *first = NULL;
CORE_ADDR next_lm;
for (; lm != 0; prev_lm = lm, lm = next_lm)
@@ -1349,6 +1350,7 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
{
struct svr4_info *info = get_svr4_info ();
+ first = new;
info->main_lm_addr = new->lm_info->lm_addr;
do_cleanups (old_chain);
continue;
@@ -1359,8 +1361,14 @@ svr4_read_so_list (CORE_ADDR lm, CORE_ADDR prev_lm,
SO_NAME_MAX_PATH_SIZE - 1, &errcode);
if (errcode != 0)
{
- warning (_("Can't read pathname for load map: %s."),
- safe_strerror (errcode));
+ /* If this entry's l_name address matches that of the
+ inferior executable, then this is not a normal shared
+ object, but (most likely) a vDSO. In this case, silently
+ skip it; otherwise emit a warning. */
+ if (first == NULL
+ || new->lm_info->l_name != first->lm_info->l_name)
+ warning (_("Can't read pathname for load map: %s."),
+ safe_strerror (errcode));
do_cleanups (old_chain);
continue;
}
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 86fedd0..88c8d2c 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2013-09-25 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
+ PR shlibs/8882
+ * gdb.base/corefile.exp: Add a check to assure warning-free
+ core-file load.
+
2013-09-24 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.dwarf2/dwp-symlink.c: New file.
diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefile.exp
index 24a33a3..04ae969 100644
--- a/gdb/testsuite/gdb.base/corefile.exp
+++ b/gdb/testsuite/gdb.base/corefile.exp
@@ -255,3 +255,19 @@ if ![is_remote target] {
gdb_exit
}
+
+# Test warning-free core file load. E.g., a Linux vDSO used to
+# trigger this warning:
+# warning: Can't read pathname for load map: Input/output error.
+
+clean_restart ${testfile}
+
+set test "core-file warning-free"
+gdb_test_multiple "core-file $corefile" $test {
+ -re "warning: .*\r\n.*\r\n$gdb_prompt $" {
+ fail $test
+ }
+ -re "\r\n$gdb_prompt $" {
+ pass $test
+ }
+}