]> git.pld-linux.org Git - packages/gdb.git/blame - gdb-core-open-vdso-warning.patch
- lib requires python-static
[packages/gdb.git] / gdb-core-open-vdso-warning.patch
CommitLineData
ab050a48
BZ
1http://sourceware.org/ml/gdb-patches/2009-10/msg00142.html
2Subject: [patch] Fix GNU/Linux core open: Can't read pathname for load map: Input/output error.
3
4Hi,
5
6GDB currently always prints on loading a core file:
7 warning: Can't read pathname for load map: Input/output error.
8
9The patch is not nice but it was WONTFIXed on the glibc side in:
10 http://sourceware.org/ml/libc-alpha/2009-10/msg00001.html
11
12The same message in GDB PR 8882 and glibc PR 387 was for ld-linux.so.2 l_name
13but that one is now ignored thanks to IGNORE_FIRST_LINK_MAP_ENTRY.
14
15This fix is intended for Linux system vDSO l_name which is a second entry in
16the DSO list.
17
18Regression tested on {x86_86,x86_64-m32,i686}-fedora11-linux-gnu.
19
20
21Thanks,
22Jan
23
24
25gdb/
262009-10-06 Jan Kratochvil <jan.kratochvil@redhat.com>
27
28 Do not print false warning on reading core file with vDSO on GNU/Linux.
29 * solib-svr4.c (svr4_current_sos): Suppress the warning if
30 MASTER_SO_LIST is still NULL.
31 * solib.c (update_solib_list): New variable saved_so_list_head.
32 Conditionally restart the function.
33
34[ Context backport. ]
35
51a5ef0f
PS
36Index: gdb-7.1.90.20100711/gdb/solib-svr4.c
37===================================================================
38--- gdb-7.1.90.20100711.orig/gdb/solib-svr4.c 2010-07-12 23:07:35.000000000 +0200
39+++ gdb-7.1.90.20100711/gdb/solib-svr4.c 2010-07-13 00:19:03.000000000 +0200
40@@ -1177,8 +1177,18 @@ svr4_current_sos (void)
ab050a48
BZ
41 target_read_string (LM_NAME (new), &buffer,
42 SO_NAME_MAX_PATH_SIZE - 1, &errcode);
43 if (errcode != 0)
44- warning (_("Can't read pathname for load map: %s."),
45- safe_strerror (errcode));
46+ {
47+ /* During the first ever DSO list reading some strings may be
48+ unreadable as residing in the ld.so readonly memory not being
49+ present in a dumped core file. Delay the error check after
50+ the first pass of DSO list scanning when ld.so should be
51+ already mapped in and all the DSO list l_name memory gets
52+ readable. */
53+
54+ if (master_so_list () != NULL)
55+ warning (_("Can't read pathname for load map: %s."),
56+ safe_strerror (errcode));
57+ }
58 else
59 {
60 struct build_id *build_id;
51a5ef0f
PS
61Index: gdb-7.1.90.20100711/gdb/solib.c
62===================================================================
63--- gdb-7.1.90.20100711.orig/gdb/solib.c 2010-05-17 01:49:58.000000000 +0200
64+++ gdb-7.1.90.20100711/gdb/solib.c 2010-07-13 00:21:01.000000000 +0200
65@@ -705,6 +705,7 @@ update_solib_list (int from_tty, struct
ab050a48
BZ
66 struct target_so_ops *ops = solib_ops (target_gdbarch);
67 struct so_list *inferior = ops->current_sos();
68 struct so_list *gdb, **gdb_link;
69+ struct so_list *saved_so_list_head = so_list_head;
70
71 /* We can reach here due to changing solib-search-path or the
72 sysroot, before having any inferior. */
51a5ef0f 73@@ -844,6 +845,12 @@ Error while mapping shared library secti
ab050a48
BZ
74 observer_notify_solib_loaded (i);
75 }
51a5ef0f
PS
76
77+ /* If this was the very first DSO list scan and we possibly read in ld.so
78+ recheck all the formerly unreadable DSO names strings. */
ab050a48 79+
51a5ef0f
PS
80+ if (saved_so_list_head == NULL && so_list_head != NULL)
81+ return update_solib_list (from_tty, target);
ab050a48 82+
51a5ef0f
PS
83 /* If a library was not found, issue an appropriate warning
84 message. We have to use a single call to warning in case the
85 front end does something special with warnings, e.g., pop up
This page took 0.049714 seconds and 4 git commands to generate.