gdb: make catch_syscall_enabled return bool
Make it return a bool and adjust a few comparisons where it's used. Change-Id: Ic77d23b0dcfcfc9195dfe65e4c7ff9cf3229f6fb
This commit is contained in:
parent
935dc9ff65
commit
f087eb2765
6 changed files with 10 additions and 9 deletions
|
@ -465,8 +465,10 @@ is_syscall_catchpoint_enabled (struct breakpoint *bp)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
/* See breakpoint.h. */
|
||||||
catch_syscall_enabled (void)
|
|
||||||
|
bool
|
||||||
|
catch_syscall_enabled ()
|
||||||
{
|
{
|
||||||
struct catch_syscall_inferior_data *inf_data
|
struct catch_syscall_inferior_data *inf_data
|
||||||
= get_catch_syscall_inferior_data (current_inferior ());
|
= get_catch_syscall_inferior_data (current_inferior ());
|
||||||
|
|
|
@ -1868,9 +1868,8 @@ extern void set_breakpoint_condition (struct breakpoint *b, const char *exp,
|
||||||
extern void set_breakpoint_condition (int bpnum, const char *exp,
|
extern void set_breakpoint_condition (int bpnum, const char *exp,
|
||||||
int from_tty, bool force);
|
int from_tty, bool force);
|
||||||
|
|
||||||
/* Checks if we are catching syscalls or not.
|
/* Checks if we are catching syscalls or not. */
|
||||||
Returns 0 if not, greater than 0 if we are. */
|
extern bool catch_syscall_enabled ();
|
||||||
extern int catch_syscall_enabled (void);
|
|
||||||
|
|
||||||
/* Checks if we are catching syscalls with the specific
|
/* Checks if we are catching syscalls with the specific
|
||||||
syscall_number. Used for "filtering" the catchpoints.
|
syscall_number. Used for "filtering" the catchpoints.
|
||||||
|
|
|
@ -652,7 +652,7 @@ i386_linux_nat_target::low_resume (ptid_t ptid, int step, enum gdb_signal signal
|
||||||
int pid = ptid.lwp ();
|
int pid = ptid.lwp ();
|
||||||
int request;
|
int request;
|
||||||
|
|
||||||
if (catch_syscall_enabled () > 0)
|
if (catch_syscall_enabled ())
|
||||||
request = PTRACE_SYSCALL;
|
request = PTRACE_SYSCALL;
|
||||||
else
|
else
|
||||||
request = PTRACE_CONT;
|
request = PTRACE_CONT;
|
||||||
|
|
|
@ -262,7 +262,7 @@ inf_ptrace_target::resume (ptid_t ptid, int step, enum gdb_signal signal)
|
||||||
single-threaded processes, so simply resume the inferior. */
|
single-threaded processes, so simply resume the inferior. */
|
||||||
ptid = ptid_t (inferior_ptid.pid ());
|
ptid = ptid_t (inferior_ptid.pid ());
|
||||||
|
|
||||||
if (catch_syscall_enabled () > 0)
|
if (catch_syscall_enabled ())
|
||||||
request = PT_SYSCALL;
|
request = PT_SYSCALL;
|
||||||
else
|
else
|
||||||
request = PT_CONTINUE;
|
request = PT_CONTINUE;
|
||||||
|
|
|
@ -5080,7 +5080,7 @@ handle_syscall_event (struct execution_control_state *ecs)
|
||||||
syscall_number = ecs->ws.syscall_number ();
|
syscall_number = ecs->ws.syscall_number ();
|
||||||
ecs->event_thread->set_stop_pc (regcache_read_pc (regcache));
|
ecs->event_thread->set_stop_pc (regcache_read_pc (regcache));
|
||||||
|
|
||||||
if (catch_syscall_enabled () > 0
|
if (catch_syscall_enabled ()
|
||||||
&& catching_syscall_number (syscall_number))
|
&& catching_syscall_number (syscall_number))
|
||||||
{
|
{
|
||||||
infrun_debug_printf ("syscall number=%d", syscall_number);
|
infrun_debug_printf ("syscall number=%d", syscall_number);
|
||||||
|
|
|
@ -509,7 +509,7 @@ nbsd_resume(nbsd_nat_target *target, ptid_t ptid, int step,
|
||||||
perror_with_name (("ptrace"));
|
perror_with_name (("ptrace"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (catch_syscall_enabled () > 0)
|
if (catch_syscall_enabled ())
|
||||||
request = PT_SYSCALL;
|
request = PT_SYSCALL;
|
||||||
else
|
else
|
||||||
request = PT_CONTINUE;
|
request = PT_CONTINUE;
|
||||||
|
|
Loading…
Add table
Reference in a new issue