|
|
01917d |
http://sourceware.org/ml/gdb-patches/2009-10/msg00142.html
|
|
|
01917d |
Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
|
|
|
01917d |
|
|
|
01917d |
[ New patch variant. ]
|
|
|
01917d |
|
|
|
01917d |
Index: gdb-7.5.50.20130118/gdb/solib-svr4.c
|
|
|
01917d |
===================================================================
|
|
|
01917d |
--- gdb-7.5.50.20130118.orig/gdb/solib-svr4.c 2013-01-18 23:05:19.414210015 +0100
|
|
|
01917d |
+++ gdb-7.5.50.20130118/gdb/solib-svr4.c 2013-01-18 23:05:34.813231664 +0100
|
|
|
01917d |
@@ -1221,8 +1221,17 @@ svr4_read_so_list (CORE_ADDR lm, struct
|
|
|
01917d |
SO_NAME_MAX_PATH_SIZE - 1, &errcode);
|
|
|
01917d |
if (errcode != 0)
|
|
|
01917d |
{
|
|
|
01917d |
- warning (_("Can't read pathname for load map: %s."),
|
|
|
01917d |
- safe_strerror (errcode));
|
|
|
01917d |
+ /* During the first ever DSO list reading some strings may be
|
|
|
01917d |
+ unreadable as residing in the ld.so readonly memory not being
|
|
|
01917d |
+ present in a dumped core file. Delay the error check after
|
|
|
01917d |
+ the first pass of DSO list scanning when ld.so should be
|
|
|
01917d |
+ already mapped in and all the DSO list l_name memory gets
|
|
|
01917d |
+ readable. */
|
|
|
01917d |
+
|
|
|
01917d |
+ if (master_so_list () != NULL)
|
|
|
01917d |
+ warning (_("Can't read pathname for load map: %s."),
|
|
|
01917d |
+ safe_strerror (errcode));
|
|
|
01917d |
+
|
|
|
01917d |
do_cleanups (old_chain);
|
|
|
01917d |
continue;
|
|
|
01917d |
}
|
|
|
01917d |
Index: gdb-7.5.50.20130118/gdb/solib.c
|
|
|
01917d |
===================================================================
|
|
|
01917d |
--- gdb-7.5.50.20130118.orig/gdb/solib.c 2013-01-18 23:05:19.415210017 +0100
|
|
|
01917d |
+++ gdb-7.5.50.20130118/gdb/solib.c 2013-01-18 23:05:57.421263173 +0100
|
|
|
01917d |
@@ -666,7 +666,7 @@ solib_used (const struct so_list *const
|
|
|
01917d |
processes we've just attached to, so that's okay. */
|
|
|
01917d |
|
|
|
01917d |
static void
|
|
|
01917d |
-update_solib_list (int from_tty, struct target_ops *target)
|
|
|
01917d |
+update_solib_list_1 (int from_tty, struct target_ops *target)
|
|
|
01917d |
{
|
|
|
01917d |
struct target_so_ops *ops = solib_ops (target_gdbarch ());
|
|
|
01917d |
struct so_list *inferior = ops->current_sos();
|
|
|
01917d |
@@ -837,6 +837,21 @@ Do you need \"set solib-search-path\" or
|
|
|
01917d |
}
|
|
|
01917d |
}
|
|
|
01917d |
|
|
|
01917d |
+/* Wrapper for Fedora: gdb-core-open-vdso-warning.patch */
|
|
|
01917d |
+
|
|
|
01917d |
+static void
|
|
|
01917d |
+update_solib_list (int from_tty, struct target_ops *target)
|
|
|
01917d |
+{
|
|
|
01917d |
+ struct so_list *saved_so_list_head = so_list_head;
|
|
|
01917d |
+
|
|
|
01917d |
+ update_solib_list_1 (from_tty, target);
|
|
|
01917d |
+
|
|
|
01917d |
+ /* If this was the very first DSO list scan and we possibly read in ld.so
|
|
|
01917d |
+ recheck all the formerly unreadable DSO names strings. */
|
|
|
01917d |
+
|
|
|
01917d |
+ if (saved_so_list_head == NULL && so_list_head != NULL)
|
|
|
01917d |
+ update_solib_list_1 (from_tty, target);
|
|
|
01917d |
+}
|
|
|
01917d |
|
|
|
01917d |
/* Return non-zero if NAME is the libpthread shared library.
|
|
|
01917d |
|
|
|
01917d |
Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/corefile.exp
|
|
|
01917d |
===================================================================
|
|
|
01917d |
--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.base/corefile.exp 2013-01-18 23:05:19.416210020 +0100
|
|
|
01917d |
+++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/corefile.exp 2013-01-18 23:05:34.814231667 +0100
|
|
|
01917d |
@@ -286,3 +286,19 @@ if {$buildid == ""} {
|
|
|
01917d |
gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*"
|
|
|
01917d |
pass $wholetest
|
|
|
01917d |
}
|
|
|
01917d |
+
|
|
|
01917d |
+
|
|
|
01917d |
+# Test Linux specific vDSO warning:
|
|
|
01917d |
+# warning: Can't read pathname for load map: Input/output error.
|
|
|
01917d |
+
|
|
|
01917d |
+clean_restart ${testfile}
|
|
|
01917d |
+
|
|
|
01917d |
+set test "core-file vdso warning"
|
|
|
01917d |
+gdb_test_multiple "core-file $corefile" $test {
|
|
|
01917d |
+ -re "warning: Can't read pathname for load map: Input/output error\\.\r\n.*\r\n$gdb_prompt $" {
|
|
|
01917d |
+ fail $test
|
|
|
01917d |
+ }
|
|
|
01917d |
+ -re "\r\n$gdb_prompt $" {
|
|
|
01917d |
+ pass $test
|
|
|
01917d |
+ }
|
|
|
01917d |
+}
|
|
|
01917d |
Index: gdb-7.5.50.20130118/gdb/testsuite/gdb.base/solib-symbol.exp
|
|
|
01917d |
===================================================================
|
|
|
01917d |
--- gdb-7.5.50.20130118.orig/gdb/testsuite/gdb.base/solib-symbol.exp 2013-01-18 23:05:19.416210020 +0100
|
|
|
01917d |
+++ gdb-7.5.50.20130118/gdb/testsuite/gdb.base/solib-symbol.exp 2013-01-18 23:05:34.814231667 +0100
|
|
|
01917d |
@@ -27,7 +27,8 @@ set lib_flags [list debug ldflags=-Wl,-B
|
|
|
01917d |
# Binary file.
|
|
|
01917d |
set testfile "solib-symbol-main"
|
|
|
01917d |
set srcfile ${srcdir}/${subdir}/${testfile}.c
|
|
|
01917d |
-set binfile ${objdir}/${subdir}/${testfile}
|
|
|
01917d |
+set executable ${testfile}
|
|
|
01917d |
+set binfile ${objdir}/${subdir}/${executable}
|
|
|
01917d |
set bin_flags [list debug shlib=${binfile_lib}]
|
|
|
01917d |
|
|
|
01917d |
if [get_compiler_info] {
|
|
|
01917d |
@@ -72,8 +73,26 @@ gdb_test "br foo2" \
|
|
|
01917d |
"Breakpoint.*: foo2. .2 locations..*" \
|
|
|
01917d |
"foo2 in mdlib"
|
|
|
01917d |
|
|
|
01917d |
-gdb_exit
|
|
|
01917d |
+# Test GDB warns for shared libraris which have not been found.
|
|
|
01917d |
|
|
|
01917d |
-return 0
|
|
|
01917d |
+gdb_test "info sharedlibrary" "/${libname}.*"
|
|
|
01917d |
|
|
|
01917d |
+clean_restart ${executable}
|
|
|
01917d |
+gdb_breakpoint "main"
|
|
|
01917d |
+gdb_run_cmd
|
|
|
01917d |
+set test "no warning for missing libraries"
|
|
|
01917d |
+gdb_test_multiple "" $test {
|
|
|
01917d |
+ -re "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\n$gdb_prompt $" {
|
|
|
01917d |
+ fail $test
|
|
|
01917d |
+ }
|
|
|
01917d |
+ -re "Breakpoint \[0-9\]+, main .*\r\n$gdb_prompt $" {
|
|
|
01917d |
+ pass $test
|
|
|
01917d |
+ }
|
|
|
01917d |
+}
|
|
|
01917d |
|
|
|
01917d |
+clean_restart ${executable}
|
|
|
01917d |
+gdb_test_no_output "set solib-absolute-prefix /doESnotEXIST"
|
|
|
01917d |
+gdb_breakpoint "main"
|
|
|
01917d |
+gdb_run_cmd
|
|
|
01917d |
+gdb_test "" "warning: Could not load shared library symbols for \[0-9\]+ libraries,.*\r\nBreakpoint \[0-9\]+, main .*" \
|
|
|
01917d |
+ "warning for missing libraries"
|