aboutsummaryrefslogtreecommitdiff
path: root/gdb/breakpoint.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-01-24 21:32:56 +0000
committerTom Tromey <tromey@redhat.com>2012-01-24 21:32:56 +0000
commitf90263c12471deb24d0fb69c09b8039b1d50af16 (patch)
tree47be77e01d022ebdde0b0df328888aae12302d2d /gdb/breakpoint.c
parent09ac7c10d43e1cbbebdc90e9f7b044d34488f2ec (diff)
downloadgdb-f90263c12471deb24d0fb69c09b8039b1d50af16.zip
gdb-f90263c12471deb24d0fb69c09b8039b1d50af16.tar.gz
gdb-f90263c12471deb24d0fb69c09b8039b1d50af16.tar.bz2
2012-01-24 Pedro Alves <pedro@codesourcery.com>
* breakpoint.c (breakpoint_hit_catch_fork) (breakpoint_hit_catch_vfork, breakpoint_hit_catch_syscall) (breakpoint_hit_catch_exec): Make use of the `ws' argument. * infrun.c (inferior_has_forked, inferior_has_vforked) (inferior_has_execd, inferior_has_called_syscall): Delete. (handle_syscall_event): Get syscall_number from the execution control state's wait status. (wait_for_inferior): Don't clear syscall_number.
Diffstat (limited to 'gdb/breakpoint.c')
-rw-r--r--gdb/breakpoint.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 6181c49..cf81498 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -6232,7 +6232,11 @@ breakpoint_hit_catch_fork (const struct bp_location *bl,
{
struct fork_catchpoint *c = (struct fork_catchpoint *) bl->owner;
- return inferior_has_forked (inferior_ptid, &c->forked_inferior_pid);
+ if (ws->kind != TARGET_WAITKIND_FORKED)
+ return 0;
+
+ c->forked_inferior_pid = ws->value.related_pid;
+ return 1;
}
/* Implement the "print_it" breakpoint_ops method for fork
@@ -6342,7 +6346,11 @@ breakpoint_hit_catch_vfork (const struct bp_location *bl,
{
struct fork_catchpoint *c = (struct fork_catchpoint *) bl->owner;
- return inferior_has_vforked (inferior_ptid, &c->forked_inferior_pid);
+ if (ws->kind != TARGET_WAITKIND_VFORKED)
+ return 0;
+
+ c->forked_inferior_pid = ws->value.related_pid;
+ return 1;
}
/* Implement the "print_it" breakpoint_ops method for vfork
@@ -6552,9 +6560,12 @@ breakpoint_hit_catch_syscall (const struct bp_location *bl,
const struct syscall_catchpoint *c
= (const struct syscall_catchpoint *) bl->owner;
- if (!inferior_has_called_syscall (inferior_ptid, &syscall_number))
+ if (ws->kind != TARGET_WAITKIND_SYSCALL_ENTRY
+ && ws->kind != TARGET_WAITKIND_SYSCALL_RETURN)
return 0;
+ syscall_number = ws->value.syscall_number;
+
/* Now, checking if the syscall is the same. */
if (c->syscalls_to_be_caught)
{
@@ -6860,7 +6871,11 @@ breakpoint_hit_catch_exec (const struct bp_location *bl,
{
struct exec_catchpoint *c = (struct exec_catchpoint *) bl->owner;
- return inferior_has_execd (inferior_ptid, &c->exec_pathname);
+ if (ws->kind != TARGET_WAITKIND_EXECD)
+ return 0;
+
+ c->exec_pathname = xstrdup (ws->value.execd_pathname);
+ return 1;
}
static enum print_stop_action