| Juan Cespedes | d44c6b8 | 1998-09-25 14:48:42 +0200 | [diff] [blame] | 1 | #include "config.h" |
| Juan Cespedes | d44c6b8 | 1998-09-25 14:48:42 +0200 | [diff] [blame] | 2 | |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 3 | #define _GNU_SOURCE 1 |
| Juan Cespedes | 1cd999a | 2001-07-03 00:46:04 +0200 | [diff] [blame] | 4 | #include <stdlib.h> |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 5 | #include <sys/types.h> |
| 6 | #include <sys/wait.h> |
| 7 | #include <errno.h> |
| 8 | #include <signal.h> |
| 9 | #include <string.h> |
| Juan Cespedes | 1e58313 | 2009-04-07 18:17:11 +0200 | [diff] [blame] | 10 | #include <sys/ptrace.h> |
| Petr Machata | 69a03e6 | 2011-07-09 11:29:12 +0200 | [diff] [blame] | 11 | #include <assert.h> |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 12 | |
| Juan Cespedes | f728123 | 2009-06-25 16:11:21 +0200 | [diff] [blame] | 13 | #include "common.h" |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 14 | |
| Juan Cespedes | 393f1d0 | 2009-05-07 11:13:54 +0200 | [diff] [blame] | 15 | static Event event; |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 16 | |
| Petr Machata | 69a03e6 | 2011-07-09 11:29:12 +0200 | [diff] [blame] | 17 | /* A queue of events that we missed while enabling the |
| 18 | * breakpoint in one of tasks. */ |
| 19 | static Event * delayed_events = NULL; |
| 20 | static Event * end_delayed_events = NULL; |
| 21 | |
| Petr Machata | cebb884 | 2011-07-09 11:14:11 +0200 | [diff] [blame] | 22 | static enum pcb_status |
| 23 | first (Process * proc, void * data) |
| 24 | { |
| 25 | return pcb_stop; |
| 26 | } |
| 27 | |
| Petr Machata | 69a03e6 | 2011-07-09 11:29:12 +0200 | [diff] [blame] | 28 | void |
| 29 | enque_event(Event * event) |
| 30 | { |
| 31 | debug(DEBUG_FUNCTION, "%d: queuing event %d for later", |
| 32 | event->proc->pid, event->type); |
| 33 | Event * ne = malloc(sizeof(*ne)); |
| 34 | if (ne == NULL) { |
| 35 | perror("event will be missed: malloc"); |
| 36 | return; |
| 37 | } |
| 38 | |
| 39 | *ne = *event; |
| 40 | ne->next = NULL; |
| 41 | if (end_delayed_events == NULL) { |
| 42 | assert(delayed_events == NULL); |
| 43 | end_delayed_events = delayed_events = ne; |
| 44 | } |
| 45 | else { |
| 46 | assert(delayed_events != NULL); |
| 47 | end_delayed_events = end_delayed_events->next = ne; |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | Event * |
| 52 | each_qd_event(enum ecb_status (*pred)(Event *, void *), void * data) |
| 53 | { |
| 54 | Event * prev = delayed_events; |
| 55 | Event * event; |
| 56 | for (event = prev; event != NULL; ) { |
| 57 | switch ((*pred)(event, data)) { |
| 58 | case ecb_cont: |
| 59 | prev = event; |
| 60 | event = event->next; |
| 61 | continue; |
| 62 | |
| 63 | case ecb_deque: |
| 64 | debug(DEBUG_FUNCTION, "dequeuing event %d for %d", |
| 65 | event->type, |
| 66 | event->proc != NULL ? event->proc->pid : -1); |
| 67 | /* |
| 68 | printf("dequeuing event %d for %d\n", event->type, |
| 69 | event->proc != NULL ? event->proc->pid : -1) ; |
| 70 | */ |
| 71 | if (end_delayed_events == event) |
| 72 | end_delayed_events = prev; |
| 73 | if (delayed_events == event) |
| 74 | delayed_events = event->next; |
| 75 | else |
| 76 | prev->next = event->next; |
| 77 | if (delayed_events == NULL) |
| 78 | end_delayed_events = NULL; |
| 79 | /* fall-through */ |
| 80 | |
| 81 | case ecb_yield: |
| 82 | return event; |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | return NULL; |
| 87 | } |
| 88 | |
| 89 | static enum ecb_status |
| 90 | event_process_not_reenabling(Event * event, void * data) |
| 91 | { |
| Petr Machata | 4007d74 | 2011-07-09 11:29:42 +0200 | [diff] [blame] | 92 | if (event->proc == NULL |
| 93 | || event->proc->leader == NULL |
| 94 | || event->proc->leader->event_handler == NULL) |
| 95 | return ecb_deque; |
| 96 | else |
| 97 | return ecb_cont; |
| Petr Machata | 69a03e6 | 2011-07-09 11:29:12 +0200 | [diff] [blame] | 98 | } |
| 99 | |
| 100 | static Event * |
| 101 | next_qd_event(void) |
| 102 | { |
| 103 | return each_qd_event(&event_process_not_reenabling, NULL); |
| 104 | } |
| 105 | |
| Juan Cespedes | 393f1d0 | 2009-05-07 11:13:54 +0200 | [diff] [blame] | 106 | Event * |
| Petr Machata | 2662768 | 2011-07-08 18:15:32 +0200 | [diff] [blame] | 107 | next_event(void) |
| 108 | { |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 109 | pid_t pid; |
| 110 | int status; |
| 111 | int tmp; |
| Petr Machata | ef46b3e | 2007-05-09 19:21:42 +0200 | [diff] [blame] | 112 | int stop_signal; |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 113 | |
| Juan Cespedes | cd8976d | 2009-05-14 13:47:58 +0200 | [diff] [blame] | 114 | debug(DEBUG_FUNCTION, "next_event()"); |
| Petr Machata | 69a03e6 | 2011-07-09 11:29:12 +0200 | [diff] [blame] | 115 | Event * ev; |
| 116 | if ((ev = next_qd_event()) != NULL) { |
| 117 | event = *ev; |
| 118 | free(ev); |
| 119 | return &event; |
| 120 | } |
| 121 | |
| Petr Machata | cebb884 | 2011-07-09 11:14:11 +0200 | [diff] [blame] | 122 | if (!each_process(NULL, &first, NULL)) { |
| Juan Cespedes | cd8976d | 2009-05-14 13:47:58 +0200 | [diff] [blame] | 123 | debug(DEBUG_EVENT, "event: No more traced programs: exiting"); |
| Juan Cespedes | 28f6019 | 1998-04-12 00:04:39 +0200 | [diff] [blame] | 124 | exit(0); |
| 125 | } |
| Juan Cespedes | 6be8028 | 2009-05-28 19:06:00 +0200 | [diff] [blame] | 126 | pid = waitpid(-1, &status, __WALL); |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 127 | if (pid == -1) { |
| 128 | if (errno == ECHILD) { |
| Juan Cespedes | cd8976d | 2009-05-14 13:47:58 +0200 | [diff] [blame] | 129 | debug(DEBUG_EVENT, "event: No more traced programs: exiting"); |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 130 | exit(0); |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 131 | } else if (errno == EINTR) { |
| Juan Cespedes | cd8976d | 2009-05-14 13:47:58 +0200 | [diff] [blame] | 132 | debug(DEBUG_EVENT, "event: none (wait received EINTR?)"); |
| Juan Cespedes | 8f6d1ec | 2009-05-07 17:50:34 +0200 | [diff] [blame] | 133 | event.type = EVENT_NONE; |
| Juan Cespedes | 28f6019 | 1998-04-12 00:04:39 +0200 | [diff] [blame] | 134 | return &event; |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 135 | } |
| 136 | perror("wait"); |
| 137 | exit(1); |
| 138 | } |
| 139 | event.proc = pid2proc(pid); |
| Juan Cespedes | 2721e6a | 2009-05-21 15:15:40 +0200 | [diff] [blame] | 140 | if (!event.proc || event.proc->state == STATE_BEING_CREATED) { |
| Juan Cespedes | 8f6d1ec | 2009-05-07 17:50:34 +0200 | [diff] [blame] | 141 | event.type = EVENT_NEW; |
| Juan Cespedes | 2721e6a | 2009-05-21 15:15:40 +0200 | [diff] [blame] | 142 | event.e_un.newpid = pid; |
| Juan Cespedes | cd8976d | 2009-05-14 13:47:58 +0200 | [diff] [blame] | 143 | debug(DEBUG_EVENT, "event: NEW: pid=%d", pid); |
| Juan Cespedes | a8909f7 | 2009-04-28 20:02:41 +0200 | [diff] [blame] | 144 | return &event; |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 145 | } |
| Juan Cespedes | 5c3fe06 | 2004-06-14 18:08:37 +0200 | [diff] [blame] | 146 | get_arch_dep(event.proc); |
| Juan Cespedes | 1e58313 | 2009-04-07 18:17:11 +0200 | [diff] [blame] | 147 | debug(3, "event from pid %u", pid); |
| Petr Machata | 9a5420c | 2011-07-09 11:21:23 +0200 | [diff] [blame] | 148 | if (event.proc->breakpoints_enabled == -1) |
| Ian Wienand | 9a2ad35 | 2006-02-20 22:44:45 +0100 | [diff] [blame] | 149 | trace_set_options(event.proc, event.proc->pid); |
| Petr Machata | 9a5420c | 2011-07-09 11:21:23 +0200 | [diff] [blame] | 150 | Process *leader = event.proc->leader; |
| 151 | if (leader == event.proc) { |
| 152 | if (event.proc->breakpoints_enabled == -1) { |
| 153 | event.type = EVENT_NONE; |
| 154 | enable_all_breakpoints(event.proc); |
| 155 | continue_process(event.proc->pid); |
| 156 | debug(DEBUG_EVENT, |
| 157 | "event: NONE: pid=%d (enabling breakpoints)", |
| 158 | pid); |
| 159 | return &event; |
| 160 | } else if (!event.proc->libdl_hooked) { |
| 161 | /* debug struct may not have been written yet.. */ |
| 162 | if (linkmap_init(event.proc, &main_lte) == 0) { |
| 163 | event.proc->libdl_hooked = 1; |
| 164 | } |
| Joe Damato | f0bd98b | 2010-11-08 15:47:42 -0800 | [diff] [blame] | 165 | } |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 166 | } |
| Joe Damato | f0bd98b | 2010-11-08 15:47:42 -0800 | [diff] [blame] | 167 | |
| Petr Machata | f2d2ba5 | 2011-07-09 11:03:26 +0200 | [diff] [blame^] | 168 | /* The process should be stopped after the waitpid call. But |
| 169 | * when the whole thread group is terminated, we see |
| 170 | * individual tasks spontaneously transitioning from 't' to |
| 171 | * 'R' and 'Z'. Calls to ptrace fail and /proc/pid/status may |
| 172 | * not even be available anymore, so we can't check in |
| 173 | * advance. So we just drop the error checking around ptrace |
| 174 | * calls. We check for termination ex post when it fails, |
| 175 | * suppress the event, and let the event loop collect the |
| 176 | * termination in the next iteration. */ |
| 177 | #define CHECK_PROCESS_TERMINATED \ |
| 178 | do { \ |
| 179 | int errno_save = errno; \ |
| 180 | switch (process_stopped(pid)) \ |
| 181 | case 0: \ |
| 182 | case -1: { \ |
| 183 | debug(DEBUG_EVENT, \ |
| 184 | "process not stopped, is it terminating?"); \ |
| 185 | event.type = EVENT_NONE; \ |
| 186 | continue_process(event.proc->pid); \ |
| 187 | return &event; \ |
| 188 | } \ |
| 189 | errno = errno_save; \ |
| 190 | } while (0) |
| 191 | |
| Petr Machata | 9a5420c | 2011-07-09 11:21:23 +0200 | [diff] [blame] | 192 | event.proc->instruction_pointer = (void *)(uintptr_t)-1; |
| Petr Machata | 6901b7e | 2011-07-09 11:00:33 +0200 | [diff] [blame] | 193 | |
| Petr Machata | f2d2ba5 | 2011-07-09 11:03:26 +0200 | [diff] [blame^] | 194 | /* Check for task termination now, before we have a need to |
| 195 | * call CHECK_PROCESS_TERMINATED later. That would suppress |
| 196 | * the event that we are processing. */ |
| 197 | if (WIFSIGNALED(status)) { |
| 198 | event.type = EVENT_EXIT_SIGNAL; |
| 199 | event.e_un.signum = WTERMSIG(status); |
| 200 | debug(DEBUG_EVENT, "event: EXIT_SIGNAL: pid=%d, signum=%d", pid, event.e_un.signum); |
| 201 | return &event; |
| 202 | } |
| 203 | if (WIFEXITED(status)) { |
| 204 | event.type = EVENT_EXIT; |
| 205 | event.e_un.ret_val = WEXITSTATUS(status); |
| 206 | debug(DEBUG_EVENT, "event: EXIT: pid=%d, status=%d", pid, event.e_un.ret_val); |
| 207 | return &event; |
| 208 | } |
| 209 | |
| Petr Machata | 6901b7e | 2011-07-09 11:00:33 +0200 | [diff] [blame] | 210 | event.proc->instruction_pointer = get_instruction_pointer(event.proc); |
| 211 | if (event.proc->instruction_pointer == (void *)(uintptr_t)-1) { |
| Petr Machata | f2d2ba5 | 2011-07-09 11:03:26 +0200 | [diff] [blame^] | 212 | CHECK_PROCESS_TERMINATED; |
| Petr Machata | 6901b7e | 2011-07-09 11:00:33 +0200 | [diff] [blame] | 213 | if (errno != 0) |
| 214 | perror("get_instruction_pointer"); |
| Juan Cespedes | f0fdae9 | 1998-03-11 00:03:00 +0100 | [diff] [blame] | 215 | } |
| Petr Machata | 6901b7e | 2011-07-09 11:00:33 +0200 | [diff] [blame] | 216 | |
| Ian Wienand | 2d45b1a | 2006-02-20 22:48:07 +0100 | [diff] [blame] | 217 | switch (syscall_p(event.proc, status, &tmp)) { |
| Juan Cespedes | 63184be | 2008-12-10 13:30:12 +0100 | [diff] [blame] | 218 | case 1: |
| Juan Cespedes | 8f6d1ec | 2009-05-07 17:50:34 +0200 | [diff] [blame] | 219 | event.type = EVENT_SYSCALL; |
| Juan Cespedes | 63184be | 2008-12-10 13:30:12 +0100 | [diff] [blame] | 220 | event.e_un.sysnum = tmp; |
| Juan Cespedes | cd8976d | 2009-05-14 13:47:58 +0200 | [diff] [blame] | 221 | debug(DEBUG_EVENT, "event: SYSCALL: pid=%d, sysnum=%d", pid, tmp); |
| Juan Cespedes | 63184be | 2008-12-10 13:30:12 +0100 | [diff] [blame] | 222 | return &event; |
| 223 | case 2: |
| Juan Cespedes | 8f6d1ec | 2009-05-07 17:50:34 +0200 | [diff] [blame] | 224 | event.type = EVENT_SYSRET; |
| Juan Cespedes | 63184be | 2008-12-10 13:30:12 +0100 | [diff] [blame] | 225 | event.e_un.sysnum = tmp; |
| Juan Cespedes | cd8976d | 2009-05-14 13:47:58 +0200 | [diff] [blame] | 226 | debug(DEBUG_EVENT, "event: SYSRET: pid=%d, sysnum=%d", pid, tmp); |
| Juan Cespedes | 63184be | 2008-12-10 13:30:12 +0100 | [diff] [blame] | 227 | return &event; |
| 228 | case 3: |
| Juan Cespedes | 8f6d1ec | 2009-05-07 17:50:34 +0200 | [diff] [blame] | 229 | event.type = EVENT_ARCH_SYSCALL; |
| Juan Cespedes | 63184be | 2008-12-10 13:30:12 +0100 | [diff] [blame] | 230 | event.e_un.sysnum = tmp; |
| Juan Cespedes | cd8976d | 2009-05-14 13:47:58 +0200 | [diff] [blame] | 231 | debug(DEBUG_EVENT, "event: ARCH_SYSCALL: pid=%d, sysnum=%d", pid, tmp); |
| Juan Cespedes | 63184be | 2008-12-10 13:30:12 +0100 | [diff] [blame] | 232 | return &event; |
| 233 | case 4: |
| Juan Cespedes | 8f6d1ec | 2009-05-07 17:50:34 +0200 | [diff] [blame] | 234 | event.type = EVENT_ARCH_SYSRET; |
| Juan Cespedes | 63184be | 2008-12-10 13:30:12 +0100 | [diff] [blame] | 235 | event.e_un.sysnum = tmp; |
| Juan Cespedes | cd8976d | 2009-05-14 13:47:58 +0200 | [diff] [blame] | 236 | debug(DEBUG_EVENT, "event: ARCH_SYSRET: pid=%d, sysnum=%d", pid, tmp); |
| Juan Cespedes | 63184be | 2008-12-10 13:30:12 +0100 | [diff] [blame] | 237 | return &event; |
| 238 | case -1: |
| Petr Machata | f2d2ba5 | 2011-07-09 11:03:26 +0200 | [diff] [blame^] | 239 | CHECK_PROCESS_TERMINATED; |
| 240 | if (errno != 0) |
| 241 | perror("syscall_p"); |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 242 | } |
| Juan Cespedes | 1e58313 | 2009-04-07 18:17:11 +0200 | [diff] [blame] | 243 | if (WIFSTOPPED(status) && ((status>>16 == PTRACE_EVENT_FORK) || (status>>16 == PTRACE_EVENT_VFORK) || (status>>16 == PTRACE_EVENT_CLONE))) { |
| 244 | unsigned long data; |
| 245 | ptrace(PTRACE_GETEVENTMSG, pid, NULL, &data); |
| Juan Cespedes | 8f6d1ec | 2009-05-07 17:50:34 +0200 | [diff] [blame] | 246 | event.type = EVENT_CLONE; |
| Juan Cespedes | 1e58313 | 2009-04-07 18:17:11 +0200 | [diff] [blame] | 247 | event.e_un.newpid = data; |
| Juan Cespedes | cd8976d | 2009-05-14 13:47:58 +0200 | [diff] [blame] | 248 | debug(DEBUG_EVENT, "event: CLONE: pid=%d, newpid=%d", pid, (int)data); |
| Juan Cespedes | 1e58313 | 2009-04-07 18:17:11 +0200 | [diff] [blame] | 249 | return &event; |
| 250 | } |
| Juan Cespedes | 1e58313 | 2009-04-07 18:17:11 +0200 | [diff] [blame] | 251 | if (WIFSTOPPED(status) && (status>>16 == PTRACE_EVENT_EXEC)) { |
| Juan Cespedes | 8f6d1ec | 2009-05-07 17:50:34 +0200 | [diff] [blame] | 252 | event.type = EVENT_EXEC; |
| Juan Cespedes | cd8976d | 2009-05-14 13:47:58 +0200 | [diff] [blame] | 253 | debug(DEBUG_EVENT, "event: EXEC: pid=%d", pid); |
| Juan Cespedes | 1e58313 | 2009-04-07 18:17:11 +0200 | [diff] [blame] | 254 | return &event; |
| 255 | } |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 256 | if (!WIFSTOPPED(status)) { |
| Juan Cespedes | 427b781 | 2009-07-06 23:05:30 +0200 | [diff] [blame] | 257 | /* should never happen */ |
| Juan Cespedes | 8f6d1ec | 2009-05-07 17:50:34 +0200 | [diff] [blame] | 258 | event.type = EVENT_NONE; |
| Juan Cespedes | cd8976d | 2009-05-14 13:47:58 +0200 | [diff] [blame] | 259 | debug(DEBUG_EVENT, "event: NONE: pid=%d (wait error?)", pid); |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 260 | return &event; |
| 261 | } |
| Petr Machata | ef46b3e | 2007-05-09 19:21:42 +0200 | [diff] [blame] | 262 | |
| 263 | stop_signal = WSTOPSIG(status); |
| 264 | |
| 265 | /* On some targets, breakpoints are signalled not using |
| Petr Machata | 6901b7e | 2011-07-09 11:00:33 +0200 | [diff] [blame] | 266 | SIGTRAP, but also with SIGILL, SIGSEGV or SIGEMT. SIGEMT |
| 267 | is not defined on Linux, but check for the others. |
| Petr Machata | ef46b3e | 2007-05-09 19:21:42 +0200 | [diff] [blame] | 268 | |
| Petr Machata | 6901b7e | 2011-07-09 11:00:33 +0200 | [diff] [blame] | 269 | N.B. see comments in GDB's infrun.c for details. I've |
| 270 | actually seen this on an Itanium machine on RHEL 5, I don't |
| 271 | remember the exact kernel version anymore. ia64-sigill.s |
| 272 | in the test suite tests this. Petr Machata 2011-06-08. */ |
| 273 | void * break_address |
| 274 | = event.proc->instruction_pointer - DECR_PC_AFTER_BREAK; |
| 275 | if ((stop_signal == SIGSEGV || stop_signal == SIGILL) |
| Petr Machata | 9a5420c | 2011-07-09 11:21:23 +0200 | [diff] [blame] | 276 | && leader != NULL |
| 277 | && address2bpstruct(leader, break_address)) |
| Petr Machata | ef46b3e | 2007-05-09 19:21:42 +0200 | [diff] [blame] | 278 | stop_signal = SIGTRAP; |
| Petr Machata | ef46b3e | 2007-05-09 19:21:42 +0200 | [diff] [blame] | 279 | |
| 280 | if (stop_signal != (SIGTRAP | event.proc->tracesysgood) |
| Juan Cespedes | 427b781 | 2009-07-06 23:05:30 +0200 | [diff] [blame] | 281 | && stop_signal != SIGTRAP) { |
| Juan Cespedes | 8f6d1ec | 2009-05-07 17:50:34 +0200 | [diff] [blame] | 282 | event.type = EVENT_SIGNAL; |
| Juan Cespedes | a413e5b | 2007-09-04 17:34:53 +0200 | [diff] [blame] | 283 | event.e_un.signum = stop_signal; |
| Juan Cespedes | cd8976d | 2009-05-14 13:47:58 +0200 | [diff] [blame] | 284 | debug(DEBUG_EVENT, "event: SIGNAL: pid=%d, signum=%d", pid, stop_signal); |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 285 | return &event; |
| 286 | } |
| Petr Machata | 55ed83b | 2007-05-17 16:24:15 +0200 | [diff] [blame] | 287 | |
| Juan Cespedes | 427b781 | 2009-07-06 23:05:30 +0200 | [diff] [blame] | 288 | /* last case [by exhaustion] */ |
| Juan Cespedes | 8f6d1ec | 2009-05-07 17:50:34 +0200 | [diff] [blame] | 289 | event.type = EVENT_BREAKPOINT; |
| Juan Cespedes | 427b781 | 2009-07-06 23:05:30 +0200 | [diff] [blame] | 290 | |
| Petr Machata | 6901b7e | 2011-07-09 11:00:33 +0200 | [diff] [blame] | 291 | event.e_un.brk_addr = break_address; |
| Juan Cespedes | cd8976d | 2009-05-14 13:47:58 +0200 | [diff] [blame] | 292 | debug(DEBUG_EVENT, "event: BREAKPOINT: pid=%d, addr=%p", pid, event.e_un.brk_addr); |
| Petr Machata | 6901b7e | 2011-07-09 11:00:33 +0200 | [diff] [blame] | 293 | |
| Juan Cespedes | 5e01f65 | 1998-03-08 22:31:44 +0100 | [diff] [blame] | 294 | return &event; |
| 295 | } |