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