2 - Workaround RHEL-5 kernels for detaching SIGSTOPped processes (BZ 498595).
4 Index: gdb-7.2.50.20110328/gdb/elfread.c
5 ===================================================================
6 --- gdb-7.2.50.20110328.orig/gdb/elfread.c 2011-03-28 18:46:16.000000000 +0200
7 +++ gdb-7.2.50.20110328/gdb/elfread.c 2011-03-28 18:48:19.000000000 +0200
8 @@ -1083,7 +1083,7 @@ elf_gnu_ifunc_resolver_return_stop (stru
9 #define BUILD_ID_VERBOSE_NONE 0
10 #define BUILD_ID_VERBOSE_FILENAMES 1
11 #define BUILD_ID_VERBOSE_BINARY_PARSE 2
12 -static int build_id_verbose = BUILD_ID_VERBOSE_FILENAMES;
13 +static int build_id_verbose = BUILD_ID_VERBOSE_NONE;
15 show_build_id_verbose (struct ui_file *file, int from_tty,
16 struct cmd_list_element *c, const char *value)
17 @@ -2173,8 +2173,10 @@ find_separate_debug_file_by_buildid (str
18 if (build_id_name != NULL
19 && filename_cmp (build_id_name, objfile->name) == 0)
21 +#if 0 /* RHEL-5 backward behavior compatibility. */
22 warning (_("\"%s\": separate debug info file has no debug info"),
25 xfree (build_id_name);
27 else if (build_id_name != NULL)
28 Index: gdb-7.2.50.20110328/gdb/corelow.c
29 ===================================================================
30 --- gdb-7.2.50.20110328.orig/gdb/corelow.c 2011-03-28 18:46:16.000000000 +0200
31 +++ gdb-7.2.50.20110328/gdb/corelow.c 2011-03-28 18:47:56.000000000 +0200
32 @@ -282,7 +282,7 @@ add_to_thread_list (bfd *abfd, asection
33 inferior_ptid = ptid; /* Yes, make it current. */
36 -static int build_id_core_loads = 1;
37 +static int build_id_core_loads = 0;
40 build_id_locate_exec (int from_tty)
41 Index: gdb-7.2.50.20110328/gdb/linux-nat.c
42 ===================================================================
43 --- gdb-7.2.50.20110328.orig/gdb/linux-nat.c 2011-03-28 18:46:16.000000000 +0200
44 +++ gdb-7.2.50.20110328/gdb/linux-nat.c 2011-03-28 18:47:56.000000000 +0200
45 @@ -1774,8 +1774,22 @@ get_pending_status (struct lwp_info *lp,
46 target_signal_to_string (signo));
49 - if (*status == 0 && GET_PID (lp->ptid) == pid_was_stopped)
50 - *status = W_STOPCODE (SIGSTOP);
51 + /* Workaround RHEL-5 kernel which has unreliable PTRACE_DETACH, SIGSTOP (that
52 + many TIDs are left unstopped). See RH Bug 496732. */
53 + if (GET_PID (lp->ptid) == pid_was_stopped)
58 + err = kill_lwp (GET_LWP (lp->ptid), SIGSTOP);
59 + if (debug_linux_nat)
61 + fprintf_unfiltered (gdb_stdlog,
62 + "SC: lwp kill %d %s\n",
64 + errno ? safe_strerror (errno) : "ERRNO-OK");