]> git.pld-linux.org Git - packages/gdb.git/blob - gdb-6.6-step-thread-exit.patch
- update to 6.8.91.20090930-1 from fedora
[packages/gdb.git] / gdb-6.6-step-thread-exit.patch
1 Index: gdb-6.8.50.20090811/gdb/linux-nat.c
2 ===================================================================
3 --- gdb-6.8.50.20090811.orig/gdb/linux-nat.c    2009-08-12 07:21:20.000000000 +0200
4 +++ gdb-6.8.50.20090811/gdb/linux-nat.c 2009-08-12 08:11:25.000000000 +0200
5 @@ -1656,16 +1656,18 @@ resume_set_callback (struct lwp_info *lp
6  
7  static void
8  linux_nat_resume (struct target_ops *ops,
9 -                 ptid_t ptid, int step, enum target_signal signo)
10 +                 ptid_t ptid, int step_int, enum target_signal signo)
11  {
12    sigset_t prev_mask;
13    struct lwp_info *lp;
14    int resume_many;
15 +  enum resume_step step = step_int;
16  
17    if (debug_linux_nat)
18      fprintf_unfiltered (gdb_stdlog,
19                         "LLR: Preparing to %s %s, %s, inferior_ptid %s\n",
20 -                       step ? "step" : "resume",
21 +                       (step == RESUME_STEP_NEEDED
22 +                        ? "needed" : (step ? "step" : "resume")),
23                         target_pid_to_str (ptid),
24                         signo ? strsignal (signo) : "0",
25                         target_pid_to_str (inferior_ptid));
26 @@ -2625,10 +2627,34 @@ linux_nat_filter_event (int lwpid, int s
27  
28        if (num_lwps (GET_PID (lp->ptid)) > 1)
29         {
30 +       enum resume_step step = lp->step;
31 +       pid_t pid = GET_PID (lp->ptid);
32 +
33          /* If there is at least one more LWP, then the exit signal
34             was not the end of the debugged application and should be
35             ignored.  */
36          exit_lwp (lp);
37 +
38 +       if (step == RESUME_STEP_USER)
39 +         {
40 +           /* Now stop the closest LWP's ...  */
41 +           lp = find_lwp_pid (pid_to_ptid (pid));
42 +           if (!lp)
43 +             lp = lwp_list;
44 +           gdb_assert (lp != NULL);
45 +           errno = 0;
46 +           ptrace (PTRACE_CONT, GET_LWP (lp->ptid), 0,
47 +                   (void *) (unsigned long) SIGSTOP);
48 +           if (debug_linux_nat)
49 +             fprintf_unfiltered (gdb_stdlog,
50 +                                 "PTRACE_CONT %s, 0, 0 (%s)\n",
51 +                                 target_pid_to_str (lp->ptid),
52 +                                 errno ? safe_strerror (errno)
53 +                                       : "OK");
54 +           /* Avoid the silent `delayed SIGSTOP' handling.  */
55 +           lp->signalled = 0;
56 +         }
57 +
58          return NULL;
59         }
60      }
This page took 0.03705 seconds and 3 git commands to generate.