target_ops: Use bool throughout

After the previous target_ops/C++ patches are all squashed and merged,
this one can go in separately.

This patch adjusts all the target methods to return bool instead of int
when they're returning a boolean.

gdb/ChangeLog:
2018-05-02  Pedro Alves  <palves@redhat.com>

	* target.h (target_ops)
	<stopped_by_sw_breakpoint, supports_stopped_by_sw_breakpoint,
	stopped_by_hw_breakpoint, supports_stopped_by_hw_breakpoint,
	stopped_by_watchpoint, have_continuable_watchpoint,
	stopped_data_address, watchpoint_addr_within_range,
	can_accel_watchpoint_condition, can_run, thread_alive,
	has_all_memory, has_memory, has_stack, has_registers,
	has_execution, can_async_p, is_async_p, supports_non_stop,
	always_non_stop_p, can_execute_reverse, supports_multi_process,
	supports_enable_disable_tracepoint,
	supports_disable_randomization, supports_string_tracing,
	supports_evaluation_of_breakpoint_conditions,
	can_run_breakpoint_commands, filesystem_is_local,
	can_download_tracepoint, get_trace_state_variable_value,
	set_trace_notes, get_tib_address, use_agent, can_use_agent,
	record_is_replaying, record_will_replay,
	augmented_libraries_svr4_read>: Adjust to return bool.
	* aarch64-linux-nat.c: All implementations adjusted.
	* aix-thread.c: All implementations adjusted.
	* arm-linux-nat.c: All implementations adjusted.
	* breakpoint.c: All implementations adjusted.
	* bsd-kvm.c: All implementations adjusted.
	* bsd-uthread.c: All implementations adjusted.
	* corelow.c: All implementations adjusted.
	* ctf.c: All implementations adjusted.
	* darwin-nat.c: All implementations adjusted.
	* darwin-nat.h: All implementations adjusted.
	* exec.c: All implementations adjusted.
	* fbsd-nat.c: All implementations adjusted.
	* fbsd-nat.h: All implementations adjusted.
	* gnu-nat.c: All implementations adjusted.
	* gnu-nat.h: All implementations adjusted.
	* go32-nat.c: All implementations adjusted.
	* ia64-linux-nat.c: All implementations adjusted.
	* inf-child.c: All implementations adjusted.
	* inf-child.h: All implementations adjusted.
	* inf-ptrace.c: All implementations adjusted.
	* inf-ptrace.h: All implementations adjusted.
	* linux-nat.c: All implementations adjusted.
	* linux-nat.h: All implementations adjusted.
	* mips-linux-nat.c: All implementations adjusted.
	* nto-procfs.c: All implementations adjusted.
	* ppc-linux-nat.c: All implementations adjusted.
	* procfs.c: All implementations adjusted.
	* ravenscar-thread.c: All implementations adjusted.
	* record-btrace.c: All implementations adjusted.
	* record-full.c: All implementations adjusted.
	* remote-sim.c: All implementations adjusted.
	* remote.c: All implementations adjusted.
	* s390-linux-nat.c: All implementations adjusted.
	* sol-thread.c: All implementations adjusted.
	* spu-multiarch.c: All implementations adjusted.
	* target-delegates.c: All implementations adjusted.
	* target.c: All implementations adjusted.
	* target.h: All implementations adjusted.
	* tracefile-tfile.c: All implementations adjusted.
	* tracefile.c: All implementations adjusted.
	* tracefile.h: All implementations adjusted.
	* windows-nat.c: All implementations adjusted.
	* x86-linux-nat.h: All implementations adjusted.
	* x86-nat.h: All implementations adjusted.
This commit is contained in:
Pedro Alves 2018-05-03 00:37:26 +01:00
parent ad6a4e2dd6
commit 57810aa7e8
47 changed files with 772 additions and 708 deletions

View File

@ -1,3 +1,67 @@
2018-05-02 Pedro Alves <palves@redhat.com>
* target.h (target_ops)
<stopped_by_sw_breakpoint, supports_stopped_by_sw_breakpoint,
stopped_by_hw_breakpoint, supports_stopped_by_hw_breakpoint,
stopped_by_watchpoint, have_continuable_watchpoint,
stopped_data_address, watchpoint_addr_within_range,
can_accel_watchpoint_condition, can_run, thread_alive,
has_all_memory, has_memory, has_stack, has_registers,
has_execution, can_async_p, is_async_p, supports_non_stop,
always_non_stop_p, can_execute_reverse, supports_multi_process,
supports_enable_disable_tracepoint,
supports_disable_randomization, supports_string_tracing,
supports_evaluation_of_breakpoint_conditions,
can_run_breakpoint_commands, filesystem_is_local,
can_download_tracepoint, get_trace_state_variable_value,
set_trace_notes, get_tib_address, use_agent, can_use_agent,
record_is_replaying, record_will_replay,
augmented_libraries_svr4_read>: Adjust to return bool.
* aarch64-linux-nat.c: All implementations adjusted.
* aix-thread.c: All implementations adjusted.
* arm-linux-nat.c: All implementations adjusted.
* breakpoint.c: All implementations adjusted.
* bsd-kvm.c: All implementations adjusted.
* bsd-uthread.c: All implementations adjusted.
* corelow.c: All implementations adjusted.
* ctf.c: All implementations adjusted.
* darwin-nat.c: All implementations adjusted.
* darwin-nat.h: All implementations adjusted.
* exec.c: All implementations adjusted.
* fbsd-nat.c: All implementations adjusted.
* fbsd-nat.h: All implementations adjusted.
* gnu-nat.c: All implementations adjusted.
* gnu-nat.h: All implementations adjusted.
* go32-nat.c: All implementations adjusted.
* ia64-linux-nat.c: All implementations adjusted.
* inf-child.c: All implementations adjusted.
* inf-child.h: All implementations adjusted.
* inf-ptrace.c: All implementations adjusted.
* inf-ptrace.h: All implementations adjusted.
* linux-nat.c: All implementations adjusted.
* linux-nat.h: All implementations adjusted.
* mips-linux-nat.c: All implementations adjusted.
* nto-procfs.c: All implementations adjusted.
* ppc-linux-nat.c: All implementations adjusted.
* procfs.c: All implementations adjusted.
* ravenscar-thread.c: All implementations adjusted.
* record-btrace.c: All implementations adjusted.
* record-full.c: All implementations adjusted.
* remote-sim.c: All implementations adjusted.
* remote.c: All implementations adjusted.
* s390-linux-nat.c: All implementations adjusted.
* sol-thread.c: All implementations adjusted.
* spu-multiarch.c: All implementations adjusted.
* target-delegates.c: All implementations adjusted.
* target.c: All implementations adjusted.
* target.h: All implementations adjusted.
* tracefile-tfile.c: All implementations adjusted.
* tracefile.c: All implementations adjusted.
* tracefile.h: All implementations adjusted.
* windows-nat.c: All implementations adjusted.
* x86-linux-nat.h: All implementations adjusted.
* x86-nat.h: All implementations adjusted.
2018-05-02 Pedro Alves <palves@redhat.com>
* make-target-delegates (scan_target_h): Don't trim lines here.

View File

@ -67,9 +67,9 @@ public:
struct expression *) override;
int remove_watchpoint (CORE_ADDR, int, enum target_hw_bp_type,
struct expression *) override;
int stopped_by_watchpoint () override;
int stopped_data_address (CORE_ADDR *) override;
int watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override;
bool stopped_by_watchpoint () override;
bool stopped_data_address (CORE_ADDR *) override;
bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override;
int can_do_single_step () override;
@ -733,7 +733,7 @@ aarch64_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
/* Implement the "stopped_data_address" target_ops method. */
int
bool
aarch64_linux_nat_target::stopped_data_address (CORE_ADDR *addr_p)
{
siginfo_t siginfo;
@ -741,12 +741,12 @@ aarch64_linux_nat_target::stopped_data_address (CORE_ADDR *addr_p)
struct aarch64_debug_reg_state *state;
if (!linux_nat_get_siginfo (inferior_ptid, &siginfo))
return 0;
return false;
/* This must be a hardware breakpoint. */
if (siginfo.si_signo != SIGTRAP
|| (siginfo.si_code & 0xffff) != TRAP_HWBKPT)
return 0;
return false;
/* Check if the address matches any watched address. */
state = aarch64_get_debug_reg_state (ptid_get_pid (inferior_ptid));
@ -762,16 +762,16 @@ aarch64_linux_nat_target::stopped_data_address (CORE_ADDR *addr_p)
&& addr_trap < addr_watch + len)
{
*addr_p = addr_trap;
return 1;
return true;
}
}
return 0;
return false;
}
/* Implement the "stopped_by_watchpoint" target_ops method. */
int
bool
aarch64_linux_nat_target::stopped_by_watchpoint ()
{
CORE_ADDR addr;
@ -781,7 +781,7 @@ aarch64_linux_nat_target::stopped_by_watchpoint ()
/* Implement the "watchpoint_addr_within_range" target_ops method. */
int
bool
aarch64_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr,
CORE_ADDR start, int length)
{

View File

@ -137,7 +137,7 @@ public:
void mourn_inferior () override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
const char *pid_to_str (ptid_t) override;
@ -1762,7 +1762,7 @@ aix_thread_target::mourn_inferior ()
/* Return whether thread PID is still valid. */
int
bool
aix_thread_target::thread_alive (ptid_t ptid)
{
struct target_ops *beneath = find_target_beneath (this);

View File

@ -45,7 +45,7 @@ public:
const struct target_desc *read_description () override;
#if defined(HAVE_PT_GETDBREGS) && defined(USE_SIGTRAP_SIGINFO)
int supports_stopped_by_hw_breakpoint () override;
bool supports_stopped_by_hw_breakpoint () override;
#endif
};
@ -202,10 +202,10 @@ amd64_fbsd_nat_target::read_description ()
#if defined(HAVE_PT_GETDBREGS) && defined(USE_SIGTRAP_SIGINFO)
/* Implement the supports_stopped_by_hw_breakpoints method. */
int
bool
amd64_fbsd_nat_target::supports_stopped_by_hw_breakpoint ()
{
return 1;
return true;
}
#endif

View File

@ -87,11 +87,11 @@ public:
int remove_watchpoint (CORE_ADDR, int, enum target_hw_bp_type,
struct expression *) override;
int stopped_by_watchpoint () override;
bool stopped_by_watchpoint () override;
int stopped_data_address (CORE_ADDR *) override;
bool stopped_data_address (CORE_ADDR *) override;
int watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override;
bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override;
const struct target_desc *read_description () override;
};
@ -1162,19 +1162,19 @@ arm_linux_nat_target::remove_watchpoint (CORE_ADDR addr,
}
/* What was the data address the target was stopped on accessing. */
int
bool
arm_linux_nat_target::stopped_data_address (CORE_ADDR *addr_p)
{
siginfo_t siginfo;
int slot;
if (!linux_nat_get_siginfo (inferior_ptid, &siginfo))
return 0;
return false;
/* This must be a hardware breakpoint. */
if (siginfo.si_signo != SIGTRAP
|| (siginfo.si_code & 0xffff) != 0x0004 /* TRAP_HWBKPT */)
return 0;
return false;
/* We must be able to set hardware watchpoints. */
if (arm_linux_get_hw_watchpoint_count () == 0)
@ -1185,21 +1185,21 @@ arm_linux_nat_target::stopped_data_address (CORE_ADDR *addr_p)
/* If we are in a positive slot then we're looking at a breakpoint and not
a watchpoint. */
if (slot >= 0)
return 0;
return false;
*addr_p = (CORE_ADDR) (uintptr_t) siginfo.si_addr;
return 1;
return true;
}
/* Has the target been stopped by hitting a watchpoint? */
int
bool
arm_linux_nat_target::stopped_by_watchpoint ()
{
CORE_ADDR addr;
return stopped_data_address (&addr);
}
int
bool
arm_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr,
CORE_ADDR start,
int length)

View File

@ -4733,7 +4733,7 @@ bpstats::bpstats ()
int
watchpoints_triggered (struct target_waitstatus *ws)
{
int stopped_by_watchpoint = target_stopped_by_watchpoint ();
bool stopped_by_watchpoint = target_stopped_by_watchpoint ();
CORE_ADDR addr;
struct breakpoint *b;

View File

@ -93,12 +93,12 @@ Optionally specify the filename of a core dump.");
ULONGEST *xfered_len) override;
void files_info () override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
const char *pid_to_str (ptid_t) override;
int has_memory () override { return 1; }
int has_stack () override { return 1; }
int has_registers () override { return 1; }
bool has_memory () override { return true; }
bool has_stack () override { return true; }
bool has_registers () override { return true; }
};
/* Target ops for libkvm interface. */
@ -364,10 +364,10 @@ bsd_kvm_pcb_cmd (const char *arg, int fromtty)
print_stack_frame (get_selected_frame (NULL), 0, SRC_AND_LOC, 1);
}
int
bool
bsd_kvm_target::thread_alive (ptid_t ptid)
{
return 1;
return true;
}
const char *

View File

@ -57,7 +57,7 @@ struct bsd_uthread_target final : public target_ops
ptid_t wait (ptid_t, struct target_waitstatus *, int) override;
void resume (ptid_t, int, enum gdb_signal) override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
void update_thread_list () override;
@ -437,7 +437,7 @@ bsd_uthread_target::resume (ptid_t ptid, int step, enum gdb_signal sig)
beneath->resume (ptid, step, sig);
}
int
bool
bsd_uthread_target::thread_alive (ptid_t ptid)
{
enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch ());
@ -453,7 +453,7 @@ bsd_uthread_target::thread_alive (ptid_t ptid)
state = read_memory_unsigned_integer (addr + offset, 4, byte_order);
if (state == BSD_UTHREAD_PS_DEAD)
return 0;
return false;
}
return beneath->thread_alive (ptid);

View File

@ -83,16 +83,16 @@ Use a core file as a target. Specify the filename of the core file.");
ULONGEST *xfered_len) override;
void files_info () override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
const struct target_desc *read_description () override;
const char *pid_to_str (ptid_t) override;
const char *thread_name (struct thread_info *) override;
int has_memory () override;
int has_stack () override;
int has_registers () override;
bool has_memory () override;
bool has_stack () override;
bool has_registers () override;
bool info_proc (const char *, enum info_proc_what) override;
};
@ -922,10 +922,10 @@ core_target::xfer_partial (enum target_object object, const char *annex,
to appear in an "info thread" command, which is quite a useful
behaviour.
*/
int
bool
core_target::thread_alive (ptid_t ptid)
{
return 1;
return true;
}
/* Ask the current architecture what it knows about this core file.
@ -989,19 +989,19 @@ core_target::thread_name (struct thread_info *thr)
return NULL;
}
int
bool
core_target::has_memory ()
{
return (core_bfd != NULL);
}
int
bool
core_target::has_stack ()
{
return (core_bfd != NULL);
}
int
bool
core_target::has_registers ()
{
return (core_bfd != NULL);

View File

@ -62,7 +62,7 @@ Specify the filename of the CTF directory.");
void files_info () override;
int trace_find (enum trace_find_type type, int num,
CORE_ADDR addr1, CORE_ADDR addr2, int *tpp) override;
int get_trace_state_variable_value (int tsv, LONGEST *val) override;
bool get_trace_state_variable_value (int tsv, LONGEST *val) override;
traceframe_info_up traceframe_info () override;
};
@ -1430,11 +1430,11 @@ ctf_target::xfer_partial (enum target_object object,
trace variable is found, set the value of it to *VAL and return
true, otherwise return false. */
int
bool
ctf_target::get_trace_state_variable_value (int tsvnum, LONGEST *val)
{
struct bt_iter_pos *pos;
int found = 0;
bool found = false;
gdb_assert (ctf_iter != NULL);
/* Save the current position. */
@ -1465,7 +1465,7 @@ ctf_target::get_trace_state_variable_value (int tsvnum, LONGEST *val)
def = bt_ctf_get_field (event, scope, "val");
*val = bt_ctf_get_uint64 (def);
found = 1;
found = true;
}
}

View File

@ -1959,10 +1959,10 @@ darwin_nat_target::pid_to_str (ptid_t ptid)
return normal_pid_to_str (ptid);
}
int
bool
darwin_nat_target::thread_alive (ptid_t ptid)
{
return 1;
return true;
}
/* If RDADDR is not NULL, read inferior task's LEN bytes from ADDR and
@ -2306,10 +2306,10 @@ darwin_nat_target::get_ada_task_ptid (long lwp, long thread)
return null_ptid;
}
int
bool
darwin_nat_target::supports_multi_process ()
{
return 1;
return true;
}
void

View File

@ -43,7 +43,7 @@ class darwin_nat_target : public inf_child_target
void resume (ptid_t, int , enum gdb_signal) override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
const char *pid_to_str (ptid_t) override;
@ -56,7 +56,7 @@ class darwin_nat_target : public inf_child_target
ULONGEST offset, ULONGEST len,
ULONGEST *xfered_len) override;
int supports_multi_process () override;
bool supports_multi_process () override;
ptid_t get_ada_task_ptid (long lwp, long thread) override;
};

View File

@ -80,7 +80,7 @@ Specify the filename of the executable file.");
struct target_section_table *get_section_table () override;
void files_info () override;
int has_memory () override;
bool has_memory () override;
char *make_corefile_notes (bfd *, int *) override;
int find_memory_regions (find_memory_region_ftype func, void *data) override;
};
@ -1031,7 +1031,7 @@ exec_set_section_address (const char *filename, int index, CORE_ADDR address)
}
}
int
bool
exec_target::has_memory ()
{
/* We can provide memory if we have any file/target sections to read

View File

@ -807,7 +807,7 @@ show_fbsd_nat_debug (struct ui_file *file, int from_tty,
/* Return true if PTID is still active in the inferior. */
int
bool
fbsd_nat_target::thread_alive (ptid_t ptid)
{
if (ptid_lwp_p (ptid))
@ -816,14 +816,14 @@ fbsd_nat_target::thread_alive (ptid_t ptid)
if (ptrace (PT_LWPINFO, ptid_get_lwp (ptid), (caddr_t) &pl, sizeof pl)
== -1)
return 0;
return false;
#ifdef PL_FLAG_EXITED
if (pl.pl_flags & PL_FLAG_EXITED)
return 0;
return false;
#endif
}
return 1;
return true;
}
/* Convert PTID to a string. Returns the string in a static
@ -1452,14 +1452,14 @@ fbsd_nat_target::wait (ptid_t ptid, struct target_waitstatus *ourstatus,
#ifdef USE_SIGTRAP_SIGINFO
/* Implement the "stopped_by_sw_breakpoint" target_ops method. */
int
bool
fbsd_nat_target::stopped_by_sw_breakpoint ()
{
struct ptrace_lwpinfo pl;
if (ptrace (PT_LWPINFO, get_ptrace_pid (inferior_ptid), (caddr_t) &pl,
sizeof pl) == -1)
return 0;
return false;
return ((pl.pl_flags & PL_FLAG_SI)
&& pl.pl_siginfo.si_signo == SIGTRAP
@ -1469,10 +1469,10 @@ fbsd_nat_target::stopped_by_sw_breakpoint ()
/* Implement the "supports_stopped_by_sw_breakpoint" target_ops
method. */
int
bool
fbsd_nat_target::supports_stopped_by_sw_breakpoint ()
{
return 1;
return true;
}
#endif

View File

@ -51,7 +51,7 @@ public:
#endif
#ifdef PT_LWPINFO
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
const char *pid_to_str (ptid_t) override;
#ifdef HAVE_STRUCT_PTRACE_LWPINFO_PL_TDNAME
@ -71,8 +71,8 @@ public:
void post_attach (int) override;
#ifdef USE_SIGTRAP_SIGINFO
int supports_stopped_by_sw_breakpoint () override;
int stopped_by_sw_breakpoint () override;
bool supports_stopped_by_sw_breakpoint () override;
bool stopped_by_sw_breakpoint () override;
#endif
#ifdef TDP_RFPPWAIT

View File

@ -2288,7 +2288,7 @@ gnu_nat_target::stop (ptid_t ptid)
error (_("stop target function not implemented"));
}
int
bool
gnu_nat_target::thread_alive (ptid_t ptid)
{
inf_update_procs (gnu_current_inf);

View File

@ -130,7 +130,7 @@ struct gnu_nat_target : public inf_child_target
void create_inferior (const char *, const std::string &,
char **, int) override;
void mourn_inferior () override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
const char *pid_to_str (ptid_t) override;
void stop (ptid_t) override;
};

View File

@ -375,7 +375,7 @@ struct go32_nat_target final : public x86_nat_target<inf_child_target>
void mourn_inferior () override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
const char *pid_to_str (ptid_t) override;
};
@ -987,7 +987,7 @@ go32_nat_target::pass_ctrlc ()
{
}
int
bool
go32_nat_target::thread_alive (ptid_t ptid)
{
return !ptid_equal (ptid, null_ptid);

View File

@ -46,7 +46,7 @@ public:
void resume (ptid_t, int, enum gdb_signal) override;
#if defined(HAVE_PT_GETDBREGS) && defined(USE_SIGTRAP_SIGINFO)
int supports_stopped_by_hw_breakpoint () override;
bool supports_stopped_by_hw_breakpoint () override;
#endif
};
@ -167,10 +167,10 @@ i386_fbsd_nat_target::read_description ()
#if defined(HAVE_PT_GETDBREGS) && defined(USE_SIGTRAP_SIGINFO)
/* Implement the supports_stopped_by_hw_breakpoints method. */
int
bool
i386_fbsd_nat_target::supports_stopped_by_hw_breakpoint ()
{
return 1;
return true;
}
#endif

View File

@ -70,11 +70,11 @@ public:
has determined that a hardware watchpoint has indeed been hit.
The CPU will then be able to execute one instruction without
triggering a watchpoint. */
int have_steppable_watchpoint () { return 1; }
bool have_steppable_watchpoint () { return 1; }
int can_use_hw_breakpoint (enum bptype, int, int) override;
int stopped_by_watchpoint () override;
int stopped_data_address (CORE_ADDR *) override;
bool stopped_by_watchpoint () override;
bool stopped_data_address (CORE_ADDR *) override;
int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type,
struct expression *) override;
int remove_watchpoint (CORE_ADDR, int, enum target_hw_bp_type,
@ -688,7 +688,7 @@ ia64_linux_new_thread (struct lwp_info *lp)
enable_watchpoints_in_psr (lp->ptid);
}
int
bool
ia64_linux_nat_target::stopped_data_address (CORE_ADDR *addr_p)
{
CORE_ADDR psr;
@ -696,11 +696,11 @@ ia64_linux_nat_target::stopped_data_address (CORE_ADDR *addr_p)
struct regcache *regcache = get_current_regcache ();
if (!linux_nat_get_siginfo (inferior_ptid, &siginfo))
return 0;
return false;
if (siginfo.si_signo != SIGTRAP
|| (siginfo.si_code & 0xffff) != 0x0004 /* TRAP_HWBKPT */)
return 0;
return false;
regcache_cooked_read_unsigned (regcache, IA64_PSR_REGNUM, &psr);
psr |= IA64_PSR_DD; /* Set the dd bit - this will disable the watchpoint
@ -708,10 +708,10 @@ ia64_linux_nat_target::stopped_data_address (CORE_ADDR *addr_p)
regcache_cooked_write_unsigned (regcache, IA64_PSR_REGNUM, psr);
*addr_p = (CORE_ADDR) siginfo.si_addr;
return 1;
return true;
}
int
bool
ia64_linux_nat_target::stopped_by_watchpoint ()
{
CORE_ADDR addr;

View File

@ -200,10 +200,10 @@ inf_child_target::post_startup_inferior (ptid_t ptid)
operation by a debugger. */
}
int
bool
inf_child_target::can_run ()
{
return 1;
return true;
}
bool
@ -226,31 +226,31 @@ inf_child_target::pid_to_exec_file (int pid)
return NULL;
}
int
bool
inf_child_target::has_all_memory ()
{
return default_child_has_all_memory ();
}
int
bool
inf_child_target::has_memory ()
{
return default_child_has_memory ();
}
int
bool
inf_child_target::has_stack ()
{
return default_child_has_stack ();
}
int
bool
inf_child_target::has_registers ()
{
return default_child_has_registers ();
}
int
bool
inf_child_target::has_execution (ptid_t ptid)
{
return default_child_has_execution (ptid);
@ -404,19 +404,19 @@ inf_child_target::fileio_readlink (struct inferior *inf, const char *filename,
#endif
}
int
inf_child_target::use_agent (int use)
bool
inf_child_target::use_agent (bool use)
{
if (agent_loaded_p ())
{
::use_agent = use;
return 1;
return true;
}
else
return 0;
return false;
}
int
bool
inf_child_target::can_use_agent ()
{
return agent_loaded_p ();

View File

@ -65,7 +65,7 @@ public:
void mourn_inferior () override;
int can_run () override;
bool can_run () override;
bool can_create_inferior () override;
void create_inferior (const char *, const std::string &,
@ -78,17 +78,17 @@ public:
/* We must default these because they must be implemented by any
target that can run. */
int can_async_p () override { return 0; }
int supports_non_stop () override { return 0; }
int supports_disable_randomization () override { return 0; }
bool can_async_p () override { return false; }
bool supports_non_stop () override { return false; }
bool supports_disable_randomization () override { return false; }
char *pid_to_exec_file (int pid) override;
int has_all_memory () override;
int has_memory () override;
int has_stack () override;
int has_registers () override;
int has_execution (ptid_t) override;
bool has_all_memory () override;
bool has_memory () override;
bool has_stack () override;
bool has_registers () override;
bool has_execution (ptid_t) override;
int fileio_open (struct inferior *inf, const char *filename,
int flags, int mode, int warn_if_slow,
@ -105,9 +105,9 @@ public:
gdb::optional<std::string> fileio_readlink (struct inferior *inf,
const char *filename,
int *target_errno) override;
int use_agent (int use) override;
bool use_agent (bool use) override;
int can_use_agent () override;
bool can_use_agent () override;
protected:
/* Unpush the target if it wasn't explicitly open with "target native"

View File

@ -610,7 +610,7 @@ inf_ptrace_target::xfer_partial (enum target_object object,
/* Return non-zero if the thread specified by PTID is alive. */
int
bool
inf_ptrace_target::thread_alive (ptid_t ptid)
{
/* ??? Is kill the right way to do this? */

View File

@ -57,7 +57,7 @@ struct inf_ptrace_target : public inf_child_target
void mourn_inferior () override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
const char *pid_to_str (ptid_t) override;

View File

@ -2474,7 +2474,7 @@ check_stopped_by_watchpoint (struct lwp_info *lp)
/* Returns true if the LWP had stopped for a watchpoint. */
int
bool
linux_nat_target::stopped_by_watchpoint ()
{
struct lwp_info *lp = find_lwp_pid (inferior_ptid);
@ -2484,7 +2484,7 @@ linux_nat_target::stopped_by_watchpoint ()
return lp->stop_reason == TARGET_STOPPED_BY_WATCHPOINT;
}
int
bool
linux_nat_target::stopped_data_address (CORE_ADDR *addr_p)
{
struct lwp_info *lp = find_lwp_pid (inferior_ptid);
@ -2835,7 +2835,7 @@ save_stop_reason (struct lwp_info *lp)
/* Returns true if the LWP had stopped for a software breakpoint. */
int
bool
linux_nat_target::stopped_by_sw_breakpoint ()
{
struct lwp_info *lp = find_lwp_pid (inferior_ptid);
@ -2847,7 +2847,7 @@ linux_nat_target::stopped_by_sw_breakpoint ()
/* Implement the supports_stopped_by_sw_breakpoint method. */
int
bool
linux_nat_target::supports_stopped_by_sw_breakpoint ()
{
return USE_SIGTRAP_SIGINFO;
@ -2856,7 +2856,7 @@ linux_nat_target::supports_stopped_by_sw_breakpoint ()
/* Returns true if the LWP had stopped for a hardware
breakpoint/watchpoint. */
int
bool
linux_nat_target::stopped_by_hw_breakpoint ()
{
struct lwp_info *lp = find_lwp_pid (inferior_ptid);
@ -2868,7 +2868,7 @@ linux_nat_target::stopped_by_hw_breakpoint ()
/* Implement the supports_stopped_by_hw_breakpoint method. */
int
bool
linux_nat_target::supports_stopped_by_hw_breakpoint ()
{
return USE_SIGTRAP_SIGINFO;
@ -3940,7 +3940,7 @@ linux_nat_target::xfer_partial (enum target_object object,
offset, len, xfered_len);
}
int
bool
linux_nat_target::thread_alive (ptid_t ptid)
{
/* As long as a PTID is in lwp list, consider it alive. */
@ -4322,7 +4322,7 @@ linux_nat_target::static_tracepoint_markers_by_strid (const char *strid)
/* target_is_async_p implementation. */
int
bool
linux_nat_target::is_async_p ()
{
return linux_is_async_p ();
@ -4330,7 +4330,7 @@ linux_nat_target::is_async_p ()
/* target_can_async_p implementation. */
int
bool
linux_nat_target::can_async_p ()
{
/* We're always async, unless the user explicitly prevented it with the
@ -4338,7 +4338,7 @@ linux_nat_target::can_async_p ()
return target_async_permitted;
}
int
bool
linux_nat_target::supports_non_stop ()
{
return 1;
@ -4346,7 +4346,7 @@ linux_nat_target::supports_non_stop ()
/* to_always_non_stop_p implementation. */
int
bool
linux_nat_target::always_non_stop_p ()
{
return 1;
@ -4357,13 +4357,13 @@ linux_nat_target::always_non_stop_p ()
int linux_multi_process = 1;
int
bool
linux_nat_target::supports_multi_process ()
{
return linux_multi_process;
}
int
bool
linux_nat_target::supports_disable_randomization ()
{
#ifdef HAVE_PERSONALITY
@ -4574,13 +4574,13 @@ linux_nat_target::core_of_thread (ptid_t ptid)
/* Implementation of to_filesystem_is_local. */
int
bool
linux_nat_target::filesystem_is_local ()
{
struct inferior *inf = current_inferior ();
if (inf->fake_pid_p || inf->pid == 0)
return 1;
return true;
return linux_ns_same (inf->pid, LINUX_NS_MNT);
}

View File

@ -57,7 +57,7 @@ public:
void kill () override;
void mourn_inferior () override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
void update_thread_list () override;
@ -67,23 +67,23 @@ public:
struct address_space *thread_address_space (ptid_t) override;
int stopped_by_watchpoint () override;
bool stopped_by_watchpoint () override;
int stopped_data_address (CORE_ADDR *) override;
bool stopped_data_address (CORE_ADDR *) override;
int stopped_by_sw_breakpoint () override;
int supports_stopped_by_sw_breakpoint () override;
bool stopped_by_sw_breakpoint () override;
bool supports_stopped_by_sw_breakpoint () override;
int stopped_by_hw_breakpoint () override;
int supports_stopped_by_hw_breakpoint () override;
bool stopped_by_hw_breakpoint () override;
bool supports_stopped_by_hw_breakpoint () override;
void thread_events (int) override;
int can_async_p () override;
int is_async_p () override;
bool can_async_p () override;
bool is_async_p () override;
int supports_non_stop () override;
int always_non_stop_p () override;
bool supports_non_stop () override;
bool always_non_stop_p () override;
void async (int) override;
@ -91,13 +91,13 @@ public:
void stop (ptid_t) override;
int supports_multi_process () override;
bool supports_multi_process () override;
int supports_disable_randomization () override;
bool supports_disable_randomization () override;
int core_of_thread (ptid_t ptid) override;
int filesystem_is_local () override;
bool filesystem_is_local () override;
int fileio_open (struct inferior *inf, const char *filename,
int flags, int mode, int warn_if_slow,
@ -140,11 +140,11 @@ public:
virtual void low_resume (ptid_t ptid, int step, enum gdb_signal sig)
{ inf_ptrace_target::resume (ptid, step, sig); }
virtual int low_stopped_by_watchpoint ()
{ return 0; }
virtual bool low_stopped_by_watchpoint ()
{ return false; }
virtual int low_stopped_data_address (CORE_ADDR *addr_p)
{ return 0; }
virtual bool low_stopped_data_address (CORE_ADDR *addr_p)
{ return false; }
};
/* The final/concrete instance. */

View File

@ -59,9 +59,9 @@ public:
int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type,
struct expression *) override;
int stopped_by_watchpoint () override;
bool stopped_by_watchpoint () override;
int stopped_data_address (CORE_ADDR *) override;
bool stopped_data_address (CORE_ADDR *) override;
int region_ok_for_hw_watchpoint (CORE_ADDR, int) override;
@ -572,7 +572,7 @@ mips_linux_nat_target::can_use_hw_breakpoint (enum bptype type,
stopped by watchpoint. The watchhi R and W bits indicate the watch
register triggered. */
int
bool
mips_linux_nat_target::stopped_by_watchpoint ()
{
int n;
@ -581,27 +581,27 @@ mips_linux_nat_target::stopped_by_watchpoint ()
if (!mips_linux_read_watch_registers (ptid_get_lwp (inferior_ptid),
&watch_readback,
&watch_readback_valid, 1))
return 0;
return false;
num_valid = mips_linux_watch_get_num_valid (&watch_readback);
for (n = 0; n < MAX_DEBUG_REGISTER && n < num_valid; n++)
if (mips_linux_watch_get_watchhi (&watch_readback, n) & (R_MASK | W_MASK))
return 1;
return true;
return 0;
return false;
}
/* Target to_stopped_data_address implementation. Set the address
where the watch triggered (if known). Return 1 if the address was
known. */
int
bool
mips_linux_nat_target::stopped_data_address (CORE_ADDR *paddr)
{
/* On mips we don't know the low order 3 bits of the data address,
so we must return false. */
return 0;
return false;
}
/* Target to_region_ok_for_hw_watchpoint implementation. Return 1 if

View File

@ -100,7 +100,7 @@ struct nto_procfs_target : public inf_child_target
int remove_watchpoint (CORE_ADDR, int, enum target_hw_bp_type,
struct expression *) override;
int stopped_by_watchpoint () override;
bool stopped_by_watchpoint () override;
void kill () override;
@ -111,7 +111,7 @@ struct nto_procfs_target : public inf_child_target
void pass_signals (int, unsigned char *) override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
void update_thread_list () override;
@ -297,8 +297,9 @@ procfs_set_thread (ptid_t ptid)
devctl (ctl_fd, DCMD_PROC_CURTHREAD, &tid, sizeof (tid), 0);
}
/* Return nonzero if the thread TH is still alive. */
int
/* Return true if the thread TH is still alive. */
bool
nto_procfs_target::thread_alive (ptid_t ptid)
{
pid_t tid;
@ -310,12 +311,12 @@ nto_procfs_target::thread_alive (ptid_t ptid)
pid = ptid_get_pid (ptid);
if (kill (pid, 0) == -1)
return 0;
return false;
status.tid = tid;
if ((err = devctl (ctl_fd, DCMD_PROC_TIDSTATUS,
&status, sizeof (status), 0)) != EOK)
return 0;
return false;
/* Thread is alive or dead but not yet joined,
or dead and there is an alive (or dead unjoined) thread with
@ -1583,7 +1584,7 @@ procfs_hw_watchpoint (int addr, int len, enum target_hw_bp_type type)
return 0;
}
int
bool
nto_procfs_target::can_use_hw_breakpoint (enum bptype type,
int cnt, int othertype)
{
@ -1606,7 +1607,7 @@ nto_procfs_target::insert_hw_watchpoint (CORE_ADDR addr, int len,
return procfs_hw_watchpoint (addr, len, type);
}
int
bool
nto_procfs_target::stopped_by_watchpoint ()
{
/* NOTE: nto_stopped_by_watchpoint will be called ONLY while we are

View File

@ -296,13 +296,13 @@ struct ppc_linux_nat_target final : public linux_nat_target
int remove_mask_watchpoint (CORE_ADDR, CORE_ADDR, enum target_hw_bp_type)
override;
int stopped_by_watchpoint () override;
bool stopped_by_watchpoint () override;
int stopped_data_address (CORE_ADDR *) override;
bool stopped_data_address (CORE_ADDR *) override;
int watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override;
bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override;
int can_accel_watchpoint_condition (CORE_ADDR, int, int, struct expression *)
bool can_accel_watchpoint_condition (CORE_ADDR, int, int, struct expression *)
override;
int masked_watch_num_registers (CORE_ADDR, CORE_ADDR) override;
@ -1986,7 +1986,7 @@ check_condition (CORE_ADDR watch_addr, struct expression *cond,
/* Return non-zero if the target is capable of using hardware to evaluate
the condition expression, thus only triggering the watchpoint when it is
true. */
int
bool
ppc_linux_nat_target::can_accel_watchpoint_condition (CORE_ADDR addr, int len,
int rw,
struct expression *cond)
@ -2222,17 +2222,17 @@ ppc_linux_thread_exit (struct thread_info *tp, int silent)
xfree (t);
}
int
bool
ppc_linux_nat_target::stopped_data_address (CORE_ADDR *addr_p)
{
siginfo_t siginfo;
if (!linux_nat_get_siginfo (inferior_ptid, &siginfo))
return 0;
return false;
if (siginfo.si_signo != SIGTRAP
|| (siginfo.si_code & 0xffff) != 0x0004 /* TRAP_HWBKPT */)
return 0;
return false;
if (have_ptrace_hwdebug_interface ())
{
@ -2253,22 +2253,22 @@ ppc_linux_nat_target::stopped_data_address (CORE_ADDR *addr_p)
if (hw_breaks[i].hw_break && hw_breaks[i].slot == slot
&& hw_breaks[i].hw_break->trigger_type
== PPC_BREAKPOINT_TRIGGER_EXECUTE)
return 0;
return false;
}
}
*addr_p = (CORE_ADDR) (uintptr_t) siginfo.si_addr;
return 1;
return true;
}
int
bool
ppc_linux_nat_target::stopped_by_watchpoint ()
{
CORE_ADDR addr;
return stopped_data_address (&addr);
}
int
bool
ppc_linux_nat_target::watchpoint_addr_within_range (CORE_ADDR addr,
CORE_ADDR start,
int length)

View File

@ -124,7 +124,7 @@ public:
void update_thread_list () override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
const char *pid_to_str (ptid_t) override;
@ -145,7 +145,7 @@ public:
override;
#endif
int stopped_by_watchpoint () override;
bool stopped_by_watchpoint () override;
int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type,
struct expression *) override;
@ -156,7 +156,7 @@ public:
int region_ok_for_hw_watchpoint (CORE_ADDR, int) override;
int can_use_hw_breakpoint (enum bptype, int, int) override;
int stopped_data_address (CORE_ADDR *) override;
bool stopped_data_address (CORE_ADDR *) override;
};
static procfs_target the_procfs_target;
@ -3179,7 +3179,7 @@ procfs_target::update_thread_list ()
really seem to be doing his job. Got to investigate how to tell
when a thread is really gone. */
int
bool
procfs_target::thread_alive (ptid_t ptid)
{
int proc, thread;
@ -3189,18 +3189,18 @@ procfs_target::thread_alive (ptid_t ptid)
thread = ptid_get_lwp (ptid);
/* If I don't know it, it ain't alive! */
if ((pi = find_procinfo (proc, thread)) == NULL)
return 0;
return false;
/* If I can't get its status, it ain't alive!
What's more, I need to forget about it! */
if (!proc_get_status (pi))
{
destroy_procinfo (pi);
return 0;
return false;
}
/* I couldn't have got its status if it weren't alive, so it's
alive. */
return 1;
return true;
}
/* Convert PTID to a string. Returns the string in a static
@ -3301,7 +3301,7 @@ procfs_target::can_use_hw_breakpoint (enum bptype type, int cnt, int othertype)
/* Returns non-zero if process is stopped on a hardware watchpoint
fault, else returns zero. */
int
bool
procfs_target::stopped_by_watchpoint ()
{
procinfo *pi;
@ -3313,10 +3313,10 @@ procfs_target::stopped_by_watchpoint ()
if (proc_why (pi) == PR_FAULTED)
{
if (proc_what (pi) == FLTWATCH)
return 1;
return true;
}
}
return 0;
return false;
}
/* Returns 1 if the OS knows the position of the triggered watchpoint,
@ -3325,7 +3325,7 @@ procfs_target::stopped_by_watchpoint ()
procfs_stopped_by_watchpoint returned 1, thus no further checks are
done. The function also assumes that ADDR is not NULL. */
int
bool
procfs_target::stopped_data_address (CORE_ADDR *addr)
{
procinfo *pi;

View File

@ -95,15 +95,15 @@ struct ravenscar_thread_target final : public target_ops
void prepare_to_store (struct regcache *) override;
int stopped_by_sw_breakpoint () override;
bool stopped_by_sw_breakpoint () override;
int stopped_by_hw_breakpoint () override;
bool stopped_by_hw_breakpoint () override;
int stopped_by_watchpoint () override;
bool stopped_by_watchpoint () override;
int stopped_data_address (CORE_ADDR *) override;
bool stopped_data_address (CORE_ADDR *) override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
int core_of_thread (ptid_t ptid) override;
@ -117,11 +117,11 @@ struct ravenscar_thread_target final : public target_ops
void mourn_inferior () override;
int has_all_memory () override { return default_child_has_all_memory (); }
int has_memory () override { return default_child_has_memory (); }
int has_stack () override { return default_child_has_stack (); }
int has_registers () override { return default_child_has_registers (); }
int has_execution (ptid_t ptid) override
bool has_all_memory () override { return default_child_has_all_memory (); }
bool has_memory () override { return default_child_has_memory (); }
bool has_stack () override { return default_child_has_stack (); }
bool has_registers () override { return default_child_has_registers (); }
bool has_execution (ptid_t ptid) override
{ return default_child_has_execution (ptid); }
};
@ -396,11 +396,11 @@ ravenscar_thread_target::extra_thread_info (thread_info *tp)
return "Ravenscar task";
}
int
bool
ravenscar_thread_target::thread_alive (ptid_t ptid)
{
/* Ravenscar tasks are non-terminating. */
return 1;
return true;
}
const char *
@ -475,12 +475,12 @@ ravenscar_thread_target::prepare_to_store (struct regcache *regcache)
/* Implement the to_stopped_by_sw_breakpoint target_ops "method". */
int
bool
ravenscar_thread_target::stopped_by_sw_breakpoint ()
{
ptid_t saved_ptid = inferior_ptid;
struct target_ops *beneath = find_target_beneath (this);
int result;
bool result;
inferior_ptid = get_base_thread_from_ravenscar_task (saved_ptid);
result = beneath->stopped_by_sw_breakpoint ();
@ -490,12 +490,12 @@ ravenscar_thread_target::stopped_by_sw_breakpoint ()
/* Implement the to_stopped_by_hw_breakpoint target_ops "method". */
int
bool
ravenscar_thread_target::stopped_by_hw_breakpoint ()
{
ptid_t saved_ptid = inferior_ptid;
struct target_ops *beneath = find_target_beneath (this);
int result;
bool result;
inferior_ptid = get_base_thread_from_ravenscar_task (saved_ptid);
result = beneath->stopped_by_hw_breakpoint ();
@ -505,12 +505,12 @@ ravenscar_thread_target::stopped_by_hw_breakpoint ()
/* Implement the to_stopped_by_watchpoint target_ops "method". */
int
bool
ravenscar_thread_target::stopped_by_watchpoint ()
{
ptid_t saved_ptid = inferior_ptid;
struct target_ops *beneath = find_target_beneath (this);
int result;
bool result;
inferior_ptid = get_base_thread_from_ravenscar_task (saved_ptid);
result = beneath->stopped_by_watchpoint ();
@ -520,12 +520,12 @@ ravenscar_thread_target::stopped_by_watchpoint ()
/* Implement the to_stopped_data_address target_ops "method". */
int
bool
ravenscar_thread_target::stopped_data_address (CORE_ADDR *addr_p)
{
ptid_t saved_ptid = inferior_ptid;
struct target_ops *beneath = find_target_beneath (this);
int result;
bool result;
inferior_ptid = get_base_thread_from_ravenscar_task (saved_ptid);
result = beneath->stopped_data_address (addr_p);

View File

@ -89,8 +89,8 @@ public:
void call_history_range (ULONGEST begin, ULONGEST end, record_print_flags flags)
override;
int record_is_replaying (ptid_t ptid) override;
int record_will_replay (ptid_t ptid, int dir) override;
bool record_is_replaying (ptid_t ptid) override;
bool record_will_replay (ptid_t ptid, int dir) override;
void record_stop_replaying () override;
enum target_xfer_status xfer_partial (enum target_object object,
@ -120,18 +120,18 @@ public:
void stop (ptid_t) override;
void update_thread_list () override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
void goto_record_begin () override;
void goto_record_end () override;
void goto_record (ULONGEST insn) override;
int can_execute_reverse () override;
bool can_execute_reverse () override;
int stopped_by_sw_breakpoint () override;
int supports_stopped_by_sw_breakpoint () override;
bool stopped_by_sw_breakpoint () override;
bool supports_stopped_by_sw_breakpoint () override;
int stopped_by_hw_breakpoint () override;
int supports_stopped_by_hw_breakpoint () override;
bool stopped_by_hw_breakpoint () override;
bool supports_stopped_by_hw_breakpoint () override;
enum exec_direction_kind execution_direction () override;
void prepare_to_generate_core () override;
@ -1396,21 +1396,21 @@ record_btrace_target::record_method (ptid_t ptid)
/* The record_is_replaying method of target record-btrace. */
int
bool
record_btrace_target::record_is_replaying (ptid_t ptid)
{
struct thread_info *tp;
ALL_NON_EXITED_THREADS (tp)
if (ptid_match (tp->ptid, ptid) && btrace_is_replaying (tp))
return 1;
return true;
return 0;
return false;
}
/* The record_will_replay method of target record-btrace. */
int
bool
record_btrace_target::record_will_replay (ptid_t ptid, int dir)
{
return dir == EXEC_REVERSE || record_is_replaying (ptid);
@ -2708,15 +2708,15 @@ record_btrace_target::stop (ptid_t ptid)
/* The can_execute_reverse method of target record-btrace. */
int
bool
record_btrace_target::can_execute_reverse ()
{
return 1;
return true;
}
/* The stopped_by_sw_breakpoint method of target record-btrace. */
int
bool
record_btrace_target::stopped_by_sw_breakpoint ()
{
if (record_is_replaying (minus_one_ptid))
@ -2732,18 +2732,18 @@ record_btrace_target::stopped_by_sw_breakpoint ()
/* The supports_stopped_by_sw_breakpoint method of target
record-btrace. */
int
bool
record_btrace_target::supports_stopped_by_sw_breakpoint ()
{
if (record_is_replaying (minus_one_ptid))
return 1;
return true;
return this->beneath->supports_stopped_by_sw_breakpoint ();
}
/* The stopped_by_sw_breakpoint method of target record-btrace. */
int
bool
record_btrace_target::stopped_by_hw_breakpoint ()
{
if (record_is_replaying (minus_one_ptid))
@ -2759,11 +2759,11 @@ record_btrace_target::stopped_by_hw_breakpoint ()
/* The supports_stopped_by_hw_breakpoint method of target
record-btrace. */
int
bool
record_btrace_target::supports_stopped_by_hw_breakpoint ()
{
if (record_is_replaying (minus_one_ptid))
return 1;
return true;
return this->beneath->supports_stopped_by_hw_breakpoint ();
}
@ -2783,7 +2783,7 @@ record_btrace_target::update_thread_list ()
/* The thread_alive method of target record-btrace. */
int
bool
record_btrace_target::thread_alive (ptid_t ptid)
{
/* We don't add or remove threads during replay. */

View File

@ -227,16 +227,16 @@ public:
void close () override;
void async (int) override;
ptid_t wait (ptid_t, struct target_waitstatus *, int) override;
int stopped_by_watchpoint () override;
int stopped_data_address (CORE_ADDR *) override;
bool stopped_by_watchpoint () override;
bool stopped_data_address (CORE_ADDR *) override;
int stopped_by_sw_breakpoint () override;
int supports_stopped_by_sw_breakpoint () override;
bool stopped_by_sw_breakpoint () override;
bool supports_stopped_by_sw_breakpoint () override;
int stopped_by_hw_breakpoint () override;
int supports_stopped_by_hw_breakpoint () override;
bool stopped_by_hw_breakpoint () override;
bool supports_stopped_by_hw_breakpoint () override;
int can_execute_reverse () override;
bool can_execute_reverse () override;
/* Add bookmark target methods. */
gdb_byte *get_bookmark (const char *, int) override;
@ -247,8 +247,8 @@ public:
void save_record (const char *filename) override;
bool supports_delete_record () override;
void delete_record () override;
int record_is_replaying (ptid_t ptid) override;
int record_will_replay (ptid_t ptid, int dir) override;
bool record_is_replaying (ptid_t ptid) override;
bool record_will_replay (ptid_t ptid, int dir) override;
void record_stop_replaying () override;
void goto_record_begin () override;
void goto_record_end () override;
@ -309,7 +309,7 @@ public:
struct bp_target_info *,
enum remove_bp_reason) override;
int has_execution (ptid_t) override;
bool has_execution (ptid_t) override;
};
static record_full_target record_full_ops;
@ -1463,7 +1463,7 @@ record_full_base_target::wait (ptid_t ptid, struct target_waitstatus *status,
return return_ptid;
}
int
bool
record_full_base_target::stopped_by_watchpoint ()
{
if (RECORD_FULL_IS_REPLAY)
@ -1472,18 +1472,18 @@ record_full_base_target::stopped_by_watchpoint ()
return beneath->stopped_by_watchpoint ();
}
int
bool
record_full_base_target::stopped_data_address (CORE_ADDR *addr_p)
{
if (RECORD_FULL_IS_REPLAY)
return 0;
return false;
else
return this->beneath->stopped_data_address (addr_p);
}
/* The stopped_by_sw_breakpoint method of target record-full. */
int
bool
record_full_base_target::stopped_by_sw_breakpoint ()
{
return record_full_stop_reason == TARGET_STOPPED_BY_SW_BREAKPOINT;
@ -1492,15 +1492,15 @@ record_full_base_target::stopped_by_sw_breakpoint ()
/* The supports_stopped_by_sw_breakpoint method of target
record-full. */
int
bool
record_full_base_target::supports_stopped_by_sw_breakpoint ()
{
return 1;
return true;
}
/* The stopped_by_hw_breakpoint method of target record-full. */
int
bool
record_full_base_target::stopped_by_hw_breakpoint ()
{
return record_full_stop_reason == TARGET_STOPPED_BY_HW_BREAKPOINT;
@ -1509,10 +1509,10 @@ record_full_base_target::stopped_by_hw_breakpoint ()
/* The supports_stopped_by_sw_breakpoint method of target
record-full. */
int
bool
record_full_base_target::supports_stopped_by_hw_breakpoint ()
{
return 1;
return true;
}
/* Record registers change (by user or by GDB) to list as an instruction. */
@ -1834,10 +1834,10 @@ record_full_target::remove_breakpoint (struct gdbarch *gdbarch,
/* "can_execute_reverse" method for process record target. */
int
bool
record_full_base_target::can_execute_reverse ()
{
return 1;
return true;
}
/* "get_bookmark" method for process record and prec over core. */
@ -1962,7 +1962,7 @@ record_full_base_target::delete_record ()
/* The "record_is_replaying" target method. */
int
bool
record_full_base_target::record_is_replaying (ptid_t ptid)
{
return RECORD_FULL_IS_REPLAY;
@ -1970,7 +1970,7 @@ record_full_base_target::record_is_replaying (ptid_t ptid)
/* The "record_will_replay" target method. */
int
bool
record_full_base_target::record_will_replay (ptid_t ptid, int dir)
{
/* We can currently only record when executing forwards. Should we be able
@ -2240,10 +2240,10 @@ record_full_core_target::remove_breakpoint (struct gdbarch *gdbarch,
/* "has_execution" method for prec over corefile. */
int
bool
record_full_core_target::has_execution (ptid_t the_ptid)
{
return 1;
return true;
}
/* Record log save-file format

View File

@ -123,20 +123,20 @@ struct gdbsim_target final
void interrupt () override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
const char *pid_to_str (ptid_t) override;
int has_all_memory () override;
int has_memory () override;
bool has_all_memory () override;
bool has_memory () override;
int has_stack () override
bool has_stack () override
{ return default_child_has_stack (); }
int has_registers () override
bool has_registers () override
{ return default_child_has_registers (); }
int has_execution (ptid_t ptid) override
bool has_execution (ptid_t ptid) override
{ return default_child_has_execution (ptid); }
};
@ -1288,20 +1288,20 @@ sim_command_completer (struct cmd_list_element *ignore,
/* Check to see if a thread is still alive. */
int
bool
gdbsim_target::thread_alive (ptid_t ptid)
{
struct sim_inferior_data *sim_data
= get_sim_inferior_data_by_ptid (ptid, SIM_INSTANCE_NOT_NEEDED);
if (sim_data == NULL)
return 0;
return false;
if (ptid_equal (ptid, sim_data->remote_sim_ptid))
/* The simulators' task is always alive. */
return 1;
return true;
return 0;
return false;
}
/* Convert a thread ID to a string. Returns the string in a static
@ -1315,28 +1315,28 @@ gdbsim_target::pid_to_str (ptid_t ptid)
/* Simulator memory may be accessed after the program has been loaded. */
int
bool
gdbsim_target::has_all_memory ()
{
struct sim_inferior_data *sim_data
= get_sim_inferior_data (current_inferior (), SIM_INSTANCE_NOT_NEEDED);
if (!sim_data->program_loaded)
return 0;
return false;
return 1;
return true;
}
int
bool
gdbsim_target::has_memory ()
{
struct sim_inferior_data *sim_data
= get_sim_inferior_data (current_inferior (), SIM_INSTANCE_NOT_NEEDED);
if (!sim_data->program_loaded)
return 0;
return false;
return 1;
return true;
}
void

View File

@ -125,18 +125,18 @@ Specify the serial device it is connected to\n\
enum remove_bp_reason) override;
int stopped_by_sw_breakpoint () override;
int supports_stopped_by_sw_breakpoint () override;
bool stopped_by_sw_breakpoint () override;
bool supports_stopped_by_sw_breakpoint () override;
int stopped_by_hw_breakpoint () override;
bool stopped_by_hw_breakpoint () override;
int supports_stopped_by_hw_breakpoint () override;
bool supports_stopped_by_hw_breakpoint () override;
int stopped_by_watchpoint () override;
bool stopped_by_watchpoint () override;
int stopped_data_address (CORE_ADDR *) override;
bool stopped_data_address (CORE_ADDR *) override;
int watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override;
bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override;
int can_use_hw_breakpoint (enum bptype, int, int) override;
@ -165,7 +165,7 @@ Specify the serial device it is connected to\n\
void program_signals (int, unsigned char *) override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
const char *thread_name (struct thread_info *) override;
@ -209,13 +209,13 @@ Specify the serial device it is connected to\n\
CORE_ADDR load_module_addr,
CORE_ADDR offset) override;
int has_all_memory () override { return default_child_has_all_memory (); }
int has_memory () override { return default_child_has_memory (); }
int has_stack () override { return default_child_has_stack (); }
int has_registers () override { return default_child_has_registers (); }
int has_execution (ptid_t ptid) override { return default_child_has_execution (ptid); }
bool has_all_memory () override { return default_child_has_all_memory (); }
bool has_memory () override { return default_child_has_memory (); }
bool has_stack () override { return default_child_has_stack (); }
bool has_registers () override { return default_child_has_registers (); }
bool has_execution (ptid_t ptid) override { return default_child_has_execution (ptid); }
int can_execute_reverse () override;
bool can_execute_reverse () override;
std::vector<mem_region> memory_map () override;
@ -229,9 +229,9 @@ Specify the serial device it is connected to\n\
const gdb_byte *pattern, ULONGEST pattern_len,
CORE_ADDR *found_addrp) override;
int can_async_p () override;
bool can_async_p () override;
int is_async_p () override;
bool is_async_p () override;
void async (int) override;
@ -243,13 +243,13 @@ Specify the serial device it is connected to\n\
void terminal_ours () override;
int supports_non_stop () override;
bool supports_non_stop () override;
int supports_multi_process () override;
bool supports_multi_process () override;
int supports_disable_randomization () override;
bool supports_disable_randomization () override;
int filesystem_is_local () override;
bool filesystem_is_local () override;
int fileio_open (struct inferior *inf, const char *filename,
@ -275,19 +275,19 @@ Specify the serial device it is connected to\n\
const char *filename,
int *target_errno) override;
int supports_enable_disable_tracepoint () override;
bool supports_enable_disable_tracepoint () override;
int supports_string_tracing () override;
bool supports_string_tracing () override;
int supports_evaluation_of_breakpoint_conditions () override;
bool supports_evaluation_of_breakpoint_conditions () override;
int can_run_breakpoint_commands () override;
bool can_run_breakpoint_commands () override;
void trace_init () override;
void download_tracepoint (struct bp_location *location) override;
int can_download_tracepoint () override;
bool can_download_tracepoint () override;
void download_trace_state_variable (const trace_state_variable &tsv) override;
@ -309,7 +309,7 @@ Specify the serial device it is connected to\n\
int trace_find (enum trace_find_type type, int num,
CORE_ADDR addr1, CORE_ADDR addr2, int *tpp) override;
int get_trace_state_variable_value (int tsv, LONGEST *val) override;
bool get_trace_state_variable_value (int tsv, LONGEST *val) override;
int save_trace_data (const char *filename) override;
@ -327,8 +327,8 @@ Specify the serial device it is connected to\n\
void set_trace_buffer_size (LONGEST val) override;
int set_trace_notes (const char *user, const char *notes,
const char *stopnotes) override;
bool set_trace_notes (const char *user, const char *notes,
const char *stopnotes) override;
int core_of_thread (ptid_t ptid) override;
@ -336,7 +336,7 @@ Specify the serial device it is connected to\n\
CORE_ADDR memaddr, ULONGEST size) override;
int get_tib_address (ptid_t ptid, CORE_ADDR *addr) override;
bool get_tib_address (ptid_t ptid, CORE_ADDR *addr) override;
void set_permissions () override;
@ -349,8 +349,8 @@ Specify the serial device it is connected to\n\
traceframe_info_up traceframe_info () override;
int use_agent (int use) override;
int can_use_agent () override;
bool use_agent (bool use) override;
bool can_use_agent () override;
struct btrace_target_info *enable_btrace (ptid_t ptid,
const struct btrace_config *conf) override;
@ -364,7 +364,7 @@ Specify the serial device it is connected to\n\
enum btrace_read_type type) override;
const struct btrace_config *btrace_conf (const struct btrace_target_info *) override;
int augmented_libraries_svr4_read () override;
bool augmented_libraries_svr4_read () override;
int follow_fork (int, int) override;
void follow_exec (struct inferior *, char *) override;
int insert_fork_catchpoint (int) override;
@ -404,7 +404,7 @@ public:
void attach (const char *, int) override;
void post_attach (int) override;
int supports_disable_randomization () override;
bool supports_disable_randomization () override;
};
/* Per-program-space data key. */
@ -2518,7 +2518,7 @@ remote_thread_always_alive (ptid_t ptid)
/* Return nonzero if the thread PTID is still alive on the remote
system. */
int
bool
remote_target::thread_alive (ptid_t ptid)
{
struct remote_state *rs = get_remote_state ();
@ -9700,7 +9700,7 @@ remote_target::mourn_inferior ()
}
}
int
bool
extended_remote_target::supports_disable_randomization ()
{
return packet_support (PACKET_QDisableRandomization) == PACKET_ENABLE;
@ -10158,7 +10158,7 @@ remote_target::insert_watchpoint (CORE_ADDR addr, int len,
_("remote_insert_watchpoint: reached end of function"));
}
int
bool
remote_target::watchpoint_addr_within_range (CORE_ADDR addr,
CORE_ADDR start, int length)
{
@ -10251,7 +10251,7 @@ remote_target::can_use_hw_breakpoint (enum bptype type, int cnt, int ot)
/* The to_stopped_by_sw_breakpoint method of target remote. */
int
bool
remote_target::stopped_by_sw_breakpoint ()
{
struct thread_info *thread = inferior_thread ();
@ -10264,7 +10264,7 @@ remote_target::stopped_by_sw_breakpoint ()
/* The to_supports_stopped_by_sw_breakpoint method of target
remote. */
int
bool
remote_target::supports_stopped_by_sw_breakpoint ()
{
return (packet_support (PACKET_swbreak_feature) == PACKET_ENABLE);
@ -10272,7 +10272,7 @@ remote_target::supports_stopped_by_sw_breakpoint ()
/* The to_stopped_by_hw_breakpoint method of target remote. */
int
bool
remote_target::stopped_by_hw_breakpoint ()
{
struct thread_info *thread = inferior_thread ();
@ -10285,13 +10285,13 @@ remote_target::stopped_by_hw_breakpoint ()
/* The to_supports_stopped_by_hw_breakpoint method of target
remote. */
int
bool
remote_target::supports_stopped_by_hw_breakpoint ()
{
return (packet_support (PACKET_hwbreak_feature) == PACKET_ENABLE);
}
int
bool
remote_target::stopped_by_watchpoint ()
{
struct thread_info *thread = inferior_thread ();
@ -10301,7 +10301,7 @@ remote_target::stopped_by_watchpoint ()
== TARGET_STOPPED_BY_WATCHPOINT));
}
int
bool
remote_target::stopped_data_address (CORE_ADDR *addr_p)
{
struct thread_info *thread = inferior_thread ();
@ -10311,10 +10311,10 @@ remote_target::stopped_data_address (CORE_ADDR *addr_p)
== TARGET_STOPPED_BY_WATCHPOINT))
{
*addr_p = get_remote_thread_info (thread)->watch_data_address;
return 1;
return true;
}
return 0;
return false;
}
@ -11330,7 +11330,7 @@ remote_target::get_thread_local_address (ptid_t ptid, CORE_ADDR lm,
/* Provide thread local base, i.e. Thread Information Block address.
Returns 1 if ptid is found and thread_local_base is non zero. */
int
bool
remote_target::get_tib_address (ptid_t ptid, CORE_ADDR *addr)
{
if (packet_support (PACKET_qGetTIBAddr) != PACKET_DISABLE)
@ -11356,7 +11356,7 @@ remote_target::get_tib_address (ptid_t ptid, CORE_ADDR *addr)
unpack_varlen_hex (rs->buf, &result);
if (addr)
*addr = (CORE_ADDR) result;
return 1;
return true;
}
else if (result == PACKET_UNKNOWN)
error (_("Remote target doesn't support qGetTIBAddr packet"));
@ -11366,7 +11366,7 @@ remote_target::get_tib_address (ptid_t ptid, CORE_ADDR *addr)
else
error (_("qGetTIBAddr not supported or disabled on this target"));
/* Not reached. */
return 0;
return false;
}
/* Support for inferring a target description based on the current
@ -12085,7 +12085,7 @@ remote_target::fileio_fstat (int fd, struct stat *st, int *remote_errno)
/* Implementation of to_filesystem_is_local. */
int
bool
remote_target::filesystem_is_local ()
{
/* Valgrind GDB presents itself as a remote target but works
@ -12127,11 +12127,11 @@ remote_target::filesystem_is_local ()
warning_issued = 1;
}
return 1;
return true;
}
}
return 0;
return false;
}
static int
@ -12416,30 +12416,30 @@ remote_command (const char *args, int from_tty)
help_list (remote_cmdlist, "remote ", all_commands, gdb_stdout);
}
int
bool
remote_target::can_execute_reverse ()
{
if (packet_support (PACKET_bs) == PACKET_ENABLE
|| packet_support (PACKET_bc) == PACKET_ENABLE)
return 1;
return true;
else
return 0;
return false;
}
int
bool
remote_target::supports_non_stop ()
{
return 1;
return true;
}
int
bool
remote_target::supports_disable_randomization ()
{
/* Only supported in extended mode. */
return 0;
return false;
}
int
bool
remote_target::supports_multi_process ()
{
struct remote_state *rs = get_remote_state ();
@ -12453,7 +12453,7 @@ remote_supports_cond_tracepoints ()
return packet_support (PACKET_ConditionalTracepoints) == PACKET_ENABLE;
}
int
bool
remote_target::supports_evaluation_of_breakpoint_conditions ()
{
return packet_support (PACKET_ConditionalBreakpoints) == PACKET_ENABLE;
@ -12477,20 +12477,20 @@ remote_supports_install_in_trace ()
return packet_support (PACKET_InstallInTrace) == PACKET_ENABLE;
}
int
bool
remote_target::supports_enable_disable_tracepoint ()
{
return (packet_support (PACKET_EnableDisableTracepoints_feature)
== PACKET_ENABLE);
}
int
bool
remote_target::supports_string_tracing ()
{
return packet_support (PACKET_tracenz_feature) == PACKET_ENABLE;
}
int
bool
remote_target::can_run_breakpoint_commands ()
{
return packet_support (PACKET_BreakpointCommands) == PACKET_ENABLE;
@ -12711,7 +12711,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
}
}
int
bool
remote_target::can_download_tracepoint ()
{
struct remote_state *rs = get_remote_state ();
@ -12722,20 +12722,20 @@ remote_target::can_download_tracepoint ()
symbols, and fetched and merged the target's tracepoint list with
ours. */
if (rs->starting_up)
return 0;
return false;
ts = current_trace_status ();
status = get_trace_status (ts);
if (status == -1 || !ts->running_known || !ts->running)
return 0;
return false;
/* If we are in a tracing experiment, but remote stub doesn't support
installing tracepoint in trace, we have to return. */
if (!remote_supports_install_in_trace ())
return 0;
return false;
return 1;
return true;
}
@ -13053,7 +13053,7 @@ remote_target::trace_find (enum trace_find_type type, int num,
return target_frameno;
}
int
bool
remote_target::get_trace_state_variable_value (int tsvnum, LONGEST *val)
{
struct remote_state *rs = get_remote_state ();
@ -13071,10 +13071,10 @@ remote_target::get_trace_state_variable_value (int tsvnum, LONGEST *val)
{
unpack_varlen_hex (reply + 1, &uval);
*val = (LONGEST) uval;
return 1;
return true;
}
}
return 0;
return false;
}
int
@ -13266,7 +13266,7 @@ remote_target::set_trace_buffer_size (LONGEST val)
}
}
int
bool
remote_target::set_trace_notes (const char *user, const char *notes,
const char *stop_notes)
{
@ -13304,16 +13304,16 @@ remote_target::set_trace_notes (const char *user, const char *notes,
putpkt (rs->buf);
reply = remote_get_noisy_reply ();
if (*reply == '\0')
return 0;
return false;
if (strcmp (reply, "OK") != 0)
error (_("Bogus reply from target: %s"), reply);
return 1;
return true;
}
int
remote_target::use_agent (int use)
bool
remote_target::use_agent (bool use)
{
if (packet_support (PACKET_QAgent) != PACKET_DISABLE)
{
@ -13327,14 +13327,14 @@ remote_target::use_agent (int use)
if (strcmp (rs->buf, "OK") == 0)
{
::use_agent = use;
return 1;
return true;
}
}
return 0;
return false;
}
int
bool
remote_target::can_use_agent ()
{
return (packet_support (PACKET_QAgent) != PACKET_DISABLE);
@ -13635,7 +13635,7 @@ remote_target::btrace_conf (const struct btrace_target_info *tinfo)
return &tinfo->conf;
}
int
bool
remote_target::augmented_libraries_svr4_read ()
{
return (packet_support (PACKET_augmented_libraries_svr4_read_feature)
@ -13745,7 +13745,7 @@ remote_target::thread_handle_to_thread_info (const gdb_byte *thread_handle,
return NULL;
}
int
bool
remote_target::can_async_p ()
{
struct remote_state *rs = get_remote_state ();
@ -13753,20 +13753,20 @@ remote_target::can_async_p ()
/* We don't go async if the user has explicitly prevented it with the
"maint set target-async" command. */
if (!target_async_permitted)
return 0;
return false;
/* We're async whenever the serial device is. */
return serial_can_async_p (rs->remote_desc);
}
int
bool
remote_target::is_async_p ()
{
struct remote_state *rs = get_remote_state ();
if (!target_async_permitted)
/* We only enable async when the user specifically asks for it. */
return 0;
return false;
/* We're async whenever the serial device is. */
return serial_is_async_p (rs->remote_desc);

View File

@ -122,9 +122,9 @@ public:
int remove_hw_breakpoint (struct gdbarch *, struct bp_target_info *)
override;
int region_ok_for_hw_watchpoint (CORE_ADDR, int) override;
int have_continuable_watchpoint () { return 1; }
int stopped_by_watchpoint () override;
int watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override;
bool have_continuable_watchpoint () { return 1; }
bool stopped_by_watchpoint () override;
bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int) override;
int insert_watchpoint (CORE_ADDR, int, enum target_hw_bp_type,
struct expression *) override;
int remove_watchpoint (CORE_ADDR, int, enum target_hw_bp_type,
@ -657,21 +657,20 @@ s390_show_debug_regs (int tid, const char *where)
per_info.lowcore.words.access_id);
}
int
bool
s390_linux_nat_target::stopped_by_watchpoint ()
{
struct s390_debug_reg_state *state
= s390_get_debug_reg_state (ptid_get_pid (inferior_ptid));
per_lowcore_bits per_lowcore;
ptrace_area parea;
int result;
if (show_debug_regs)
s390_show_debug_regs (s390_inferior_tid (), "stop");
/* Speed up common case. */
if (VEC_empty (s390_watch_area, state->watch_areas))
return 0;
return false;
parea.len = sizeof (per_lowcore);
parea.process_addr = (addr_t) & per_lowcore;
@ -679,8 +678,8 @@ s390_linux_nat_target::stopped_by_watchpoint ()
if (ptrace (PTRACE_PEEKUSR_AREA, s390_inferior_tid (), &parea, 0) < 0)
perror_with_name (_("Couldn't retrieve watchpoint status"));
result = (per_lowcore.perc_storage_alteration == 1
&& per_lowcore.perc_store_real_address == 0);
bool result = (per_lowcore.perc_storage_alteration == 1
&& per_lowcore.perc_store_real_address == 0);
if (result)
{

View File

@ -99,7 +99,7 @@ public:
ULONGEST offset, ULONGEST len,
ULONGEST *xfered_len) override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
void update_thread_list () override;
};
@ -700,7 +700,7 @@ sol_thread_target::mourn_inferior ()
/* Return true if PTID is still active in the inferior. */
int
bool
sol_thread_target::thread_alive (ptid_t ptid)
{
if (ptid_tid_p (ptid))
@ -712,10 +712,10 @@ sol_thread_target::thread_alive (ptid_t ptid)
pid = ptid_get_tid (ptid);
if ((val = p_td_ta_map_id2thr (main_ta, pid, &th)) != TD_OK)
return 0; /* Thread not found. */
return false; /* Thread not found. */
if ((val = p_td_thr_validate (&th)) != TD_OK)
return 0; /* Thread not valid. */
return 1; /* Known thread. */
return false; /* Thread not valid. */
return true; /* Known thread. */
}
else
{

View File

@ -52,7 +52,7 @@ struct spu_multiarch_target final : public target_ops
void mourn_inferior () override;
void fetch_registers (struct regcache *, int) override;
void fetch_registers (struct regcache *, int) override;
void store_registers (struct regcache *, int) override;
enum target_xfer_status xfer_partial (enum target_object object,
@ -162,6 +162,7 @@ spu_multiarch_target::thread_architecture (ptid_t ptid)
}
/* Override the to_region_ok_for_hw_watchpoint routine. */
int
spu_multiarch_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len)
{

File diff suppressed because it is too large Load Diff

View File

@ -2650,10 +2650,10 @@ target_ops::create_inferior (const char *, const std::string &,
gdb_assert_not_reached ("target_ops::create_inferior called");
}
int
bool
target_ops::can_run ()
{
return 0;
return false;
}
int

View File

@ -482,11 +482,11 @@ struct target_ops
done from the target, so GDB needs to be able to tell whether
it should ignore the event and whether it should adjust the PC.
See adjust_pc_after_break. */
virtual int stopped_by_sw_breakpoint ()
TARGET_DEFAULT_RETURN (0);
virtual bool stopped_by_sw_breakpoint ()
TARGET_DEFAULT_RETURN (false);
/* Returns true if the above method is supported. */
virtual int supports_stopped_by_sw_breakpoint ()
TARGET_DEFAULT_RETURN (0);
virtual bool supports_stopped_by_sw_breakpoint ()
TARGET_DEFAULT_RETURN (false);
/* Returns true if the target stopped for a hardware breakpoint.
Likewise, if the target supports hardware breakpoints, this
@ -495,11 +495,11 @@ struct target_ops
require PC adjustment, GDB needs to be able to tell whether the
hardware breakpoint event is a delayed event for a breakpoint
that is already gone and should thus be ignored. */
virtual int stopped_by_hw_breakpoint ()
TARGET_DEFAULT_RETURN (0);
virtual bool stopped_by_hw_breakpoint ()
TARGET_DEFAULT_RETURN (false);
/* Returns true if the above method is supported. */
virtual int supports_stopped_by_hw_breakpoint ()
TARGET_DEFAULT_RETURN (0);
virtual bool supports_stopped_by_hw_breakpoint ()
TARGET_DEFAULT_RETURN (false);
virtual int can_use_hw_breakpoint (enum bptype, int, int)
TARGET_DEFAULT_RETURN (0);
@ -527,15 +527,15 @@ struct target_ops
virtual int remove_mask_watchpoint (CORE_ADDR, CORE_ADDR,
enum target_hw_bp_type)
TARGET_DEFAULT_RETURN (1);
virtual int stopped_by_watchpoint ()
TARGET_DEFAULT_RETURN (0);
virtual bool stopped_by_watchpoint ()
TARGET_DEFAULT_RETURN (false);
virtual int have_steppable_watchpoint ()
TARGET_DEFAULT_RETURN (0);
TARGET_DEFAULT_RETURN (false);
virtual bool have_continuable_watchpoint ()
TARGET_DEFAULT_RETURN (0);
virtual int stopped_data_address (CORE_ADDR *)
TARGET_DEFAULT_RETURN (0);
virtual int watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int)
TARGET_DEFAULT_RETURN (false);
virtual bool stopped_data_address (CORE_ADDR *)
TARGET_DEFAULT_RETURN (false);
virtual bool watchpoint_addr_within_range (CORE_ADDR, CORE_ADDR, int)
TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range);
/* Documentation of this routine is provided with the corresponding
@ -543,9 +543,9 @@ struct target_ops
virtual int region_ok_for_hw_watchpoint (CORE_ADDR, int)
TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint);
virtual int can_accel_watchpoint_condition (CORE_ADDR, int, int,
struct expression *)
TARGET_DEFAULT_RETURN (0);
virtual bool can_accel_watchpoint_condition (CORE_ADDR, int, int,
struct expression *)
TARGET_DEFAULT_RETURN (false);
virtual int masked_watch_num_registers (CORE_ADDR, CORE_ADDR)
TARGET_DEFAULT_RETURN (-1);
@ -555,7 +555,7 @@ struct target_ops
TARGET_DEFAULT_RETURN (-1);
virtual bool supports_terminal_ours ()
TARGET_DEFAULT_RETURN (0);
TARGET_DEFAULT_RETURN (false);
virtual void terminal_init ()
TARGET_DEFAULT_IGNORE ();
virtual void terminal_inferior ()
@ -607,7 +607,7 @@ struct target_ops
/* Note that can_run is special and can be invoked on an unpushed
target. Targets defining this method must also define
to_can_async_p and to_supports_non_stop. */
virtual int can_run ();
virtual bool can_run ();
/* Documentation of this routine is provided with the corresponding
target_* macro. */
@ -621,8 +621,8 @@ struct target_ops
unsigned char * TARGET_DEBUG_PRINTER (target_debug_print_signals))
TARGET_DEFAULT_IGNORE ();
virtual int thread_alive (ptid_t ptid)
TARGET_DEFAULT_RETURN (0);
virtual bool thread_alive (ptid_t ptid)
TARGET_DEFAULT_RETURN (false);
virtual void update_thread_list ()
TARGET_DEFAULT_IGNORE ();
virtual const char *pid_to_str (ptid_t)
@ -652,11 +652,11 @@ struct target_ops
enum strata to_stratum;
/* Provide default values for all "must have" methods. */
virtual int has_all_memory () { return 0; }
virtual int has_memory () { return 0; }
virtual int has_stack () { return 0; }
virtual int has_registers () { return 0; }
virtual int has_execution (ptid_t) { return 0; }
virtual bool has_all_memory () { return false; }
virtual bool has_memory () { return false; }
virtual bool has_stack () { return false; }
virtual bool has_registers () { return false; }
virtual bool has_execution (ptid_t) { return false; }
/* Control thread execution. */
virtual thread_control_capabilities get_thread_control_capabilities ()
@ -665,22 +665,22 @@ struct target_ops
TARGET_DEFAULT_RETURN (0);
/* This method must be implemented in some situations. See the
comment on 'can_run'. */
virtual int can_async_p ()
TARGET_DEFAULT_RETURN (0);
virtual int is_async_p ()
TARGET_DEFAULT_RETURN (0);
virtual bool can_async_p ()
TARGET_DEFAULT_RETURN (false);
virtual bool is_async_p ()
TARGET_DEFAULT_RETURN (false);
virtual void async (int)
TARGET_DEFAULT_NORETURN (tcomplain ());
virtual void thread_events (int)
TARGET_DEFAULT_IGNORE ();
/* This method must be implemented in some situations. See the
comment on 'can_run'. */
virtual int supports_non_stop ()
TARGET_DEFAULT_RETURN (0);
virtual bool supports_non_stop ()
TARGET_DEFAULT_RETURN (false);
/* Return true if the target operates in non-stop mode even with
"set non-stop off". */
virtual int always_non_stop_p ()
TARGET_DEFAULT_RETURN (0);
virtual bool always_non_stop_p ()
TARGET_DEFAULT_RETURN (false);
/* find_memory_regions support method for gcore */
virtual int find_memory_regions (find_memory_region_ftype func, void *data)
TARGET_DEFAULT_FUNC (dummy_find_memory_regions);
@ -815,8 +815,8 @@ struct target_ops
TARGET_DEFAULT_FUNC (default_search_memory);
/* Can target execute in reverse? */
virtual int can_execute_reverse ()
TARGET_DEFAULT_RETURN (0);
virtual bool can_execute_reverse ()
TARGET_DEFAULT_RETURN (false);
/* The direction the target is currently executing. Must be
implemented on targets that support reverse execution and async
@ -826,31 +826,31 @@ struct target_ops
/* Does this target support debugging multiple processes
simultaneously? */
virtual int supports_multi_process ()
TARGET_DEFAULT_RETURN (0);
virtual bool supports_multi_process ()
TARGET_DEFAULT_RETURN (false);
/* Does this target support enabling and disabling tracepoints while a trace
experiment is running? */
virtual int supports_enable_disable_tracepoint ()
TARGET_DEFAULT_RETURN (0);
virtual bool supports_enable_disable_tracepoint ()
TARGET_DEFAULT_RETURN (false);
/* Does this target support disabling address space randomization? */
virtual int supports_disable_randomization ()
virtual bool supports_disable_randomization ()
TARGET_DEFAULT_FUNC (find_default_supports_disable_randomization);
/* Does this target support the tracenz bytecode for string collection? */
virtual int supports_string_tracing ()
TARGET_DEFAULT_RETURN (0);
virtual bool supports_string_tracing ()
TARGET_DEFAULT_RETURN (false);
/* Does this target support evaluation of breakpoint conditions on its
end? */
virtual int supports_evaluation_of_breakpoint_conditions ()
TARGET_DEFAULT_RETURN (0);
virtual bool supports_evaluation_of_breakpoint_conditions ()
TARGET_DEFAULT_RETURN (false);
/* Does this target support evaluation of breakpoint commands on its
end? */
virtual int can_run_breakpoint_commands ()
TARGET_DEFAULT_RETURN (0);
virtual bool can_run_breakpoint_commands ()
TARGET_DEFAULT_RETURN (false);
/* Determine current architecture of thread PTID.
@ -876,8 +876,8 @@ struct target_ops
/* Return nonzero if the filesystem seen by the current inferior
is the local filesystem, zero otherwise. */
virtual int filesystem_is_local ()
TARGET_DEFAULT_RETURN (1);
virtual bool filesystem_is_local ()
TARGET_DEFAULT_RETURN (true);
/* Open FILENAME on the target, in the filesystem as seen by INF,
using FLAGS and MODE. If INF is NULL, use the filesystem seen
@ -944,8 +944,8 @@ struct target_ops
/* Is the target able to download tracepoint locations in current
state? */
virtual int can_download_tracepoint ()
TARGET_DEFAULT_RETURN (0);
virtual bool can_download_tracepoint ()
TARGET_DEFAULT_RETURN (false);
/* Send full details of a trace state variable to the target. */
virtual void download_trace_state_variable (const trace_state_variable &tsv)
@ -993,8 +993,8 @@ struct target_ops
/* Get the value of the trace state variable number TSV, returning
1 if the value is known and writing the value itself into the
location pointed to by VAL, else returning 0. */
virtual int get_trace_state_variable_value (int tsv, LONGEST *val)
TARGET_DEFAULT_RETURN (0);
virtual bool get_trace_state_variable_value (int tsv, LONGEST *val)
TARGET_DEFAULT_RETURN (false);
virtual int save_trace_data (const char *filename)
TARGET_DEFAULT_NORETURN (tcomplain ());
@ -1028,9 +1028,9 @@ struct target_ops
/* Add/change textual notes about the trace run, returning 1 if
successful, 0 otherwise. */
virtual int set_trace_notes (const char *user, const char *notes,
const char *stopnotes)
TARGET_DEFAULT_RETURN (0);
virtual bool set_trace_notes (const char *user, const char *notes,
const char *stopnotes)
TARGET_DEFAULT_RETURN (false);
/* Return the processor core that thread PTID was last seen on.
This information is updated only when:
@ -1052,7 +1052,7 @@ struct target_ops
/* Return the address of the start of the Thread Information Block
a Windows OS specific feature. */
virtual int get_tib_address (ptid_t ptid, CORE_ADDR *addr)
virtual bool get_tib_address (ptid_t ptid, CORE_ADDR *addr)
TARGET_DEFAULT_NORETURN (tcomplain ());
/* Send the new settings of write permission variables. */
@ -1078,14 +1078,14 @@ struct target_ops
virtual traceframe_info_up traceframe_info ()
TARGET_DEFAULT_NORETURN (tcomplain ());
/* Ask the target to use or not to use agent according to USE. Return 1
successful, 0 otherwise. */
virtual int use_agent (int use)
/* Ask the target to use or not to use agent according to USE.
Return true if successful, false otherwise. */
virtual bool use_agent (bool use)
TARGET_DEFAULT_NORETURN (tcomplain ());
/* Is the target able to use agent in current state? */
virtual int can_use_agent ()
TARGET_DEFAULT_RETURN (0);
virtual bool can_use_agent ()
TARGET_DEFAULT_RETURN (false);
/* Enable branch tracing for PTID using CONF configuration.
Return a branch trace target information struct for reading and for
@ -1140,13 +1140,13 @@ struct target_ops
TARGET_DEFAULT_NORETURN (tcomplain ());
/* Query if the record target is currently replaying PTID. */
virtual int record_is_replaying (ptid_t ptid)
TARGET_DEFAULT_RETURN (0);
virtual bool record_is_replaying (ptid_t ptid)
TARGET_DEFAULT_RETURN (false);
/* Query if the record target will replay PTID if it were resumed in
execution direction DIR. */
virtual int record_will_replay (ptid_t ptid, int dir)
TARGET_DEFAULT_RETURN (0);
virtual bool record_will_replay (ptid_t ptid, int dir)
TARGET_DEFAULT_RETURN (false);
/* Stop replaying. */
virtual void record_stop_replaying ()
@ -1203,10 +1203,10 @@ struct target_ops
virtual void call_history_range (ULONGEST begin, ULONGEST end, record_print_flags flags)
TARGET_DEFAULT_NORETURN (tcomplain ());
/* Nonzero if TARGET_OBJECT_LIBRARIES_SVR4 may be read with a
/* True if TARGET_OBJECT_LIBRARIES_SVR4 may be read with a
non-empty annex. */
virtual int augmented_libraries_svr4_read ()
TARGET_DEFAULT_RETURN (0);
virtual bool augmented_libraries_svr4_read ()
TARGET_DEFAULT_RETURN (false);
/* Those unwinders are tried before any other arch unwinders. If
SELF doesn't have unwinders, it should delegate to the
@ -2481,19 +2481,19 @@ public:
return NULL;
}
int has_registers () override
bool has_registers () override
{
return 1;
return true;
}
int has_stack () override
bool has_stack () override
{
return 1;
return true;
}
int has_memory () override
bool has_memory () override
{
return 1;
return true;
}
void prepare_to_store (regcache *regs) override

View File

@ -67,7 +67,7 @@ Use a trace file as a target. Specify the filename of the trace file.");
void files_info () override;
int trace_find (enum trace_find_type type, int num,
CORE_ADDR addr1, CORE_ADDR addr2, int *tpp) override;
int get_trace_state_variable_value (int tsv, LONGEST *val) override;
bool get_trace_state_variable_value (int tsv, LONGEST *val) override;
traceframe_info_up traceframe_info () override;
void get_tracepoint_status (struct breakpoint *tp,
@ -1033,11 +1033,11 @@ tfile_target::xfer_partial (enum target_object object,
/* Iterate through the blocks of a trace frame, looking for a 'V'
block with a matching tsv number. */
int
bool
tfile_target::get_trace_state_variable_value (int tsvnum, LONGEST *val)
{
int pos;
int found = 0;
bool found = false;
/* Iterate over blocks in current frame and find the last 'V'
block in which tsv number is TSVNUM. In one trace frame, there
@ -1058,7 +1058,7 @@ tfile_target::get_trace_state_variable_value (int tsvnum, LONGEST *val)
*val = extract_signed_integer ((gdb_byte *) val, 8,
gdbarch_byte_order
(target_gdbarch ()));
found = 1;
found = true;
}
pos += (4 + 8);
}

View File

@ -425,7 +425,7 @@ tracefile_fetch_registers (struct regcache *regcache, int regno)
/* This is the implementation of target_ops method to_has_all_memory. */
int
bool
tracefile_target::has_all_memory ()
{
return 1;
@ -433,7 +433,7 @@ tracefile_target::has_all_memory ()
/* This is the implementation of target_ops method to_has_memory. */
int
bool
tracefile_target::has_memory ()
{
return 1;
@ -443,7 +443,7 @@ tracefile_target::has_memory ()
The target has a stack when GDB has already selected one trace
frame. */
int
bool
tracefile_target::has_stack ()
{
return get_traceframe_number () != -1;
@ -453,7 +453,7 @@ tracefile_target::has_stack ()
The target has registers when GDB has already selected one trace
frame. */
int
bool
tracefile_target::has_registers ()
{
return get_traceframe_number () != -1;
@ -462,7 +462,7 @@ tracefile_target::has_registers ()
/* This is the implementation of target_ops method to_thread_alive.
tracefile has one thread faked by GDB. */
int
bool
tracefile_target::thread_alive (ptid_t ptid)
{
return 1;

View File

@ -122,11 +122,11 @@ public:
tracefile_target ();
int get_trace_status (trace_status *ts) override;
int has_all_memory () override;
int has_memory () override;
int has_stack () override;
int has_registers () override;
int thread_alive (ptid_t ptid) override;
bool has_all_memory () override;
bool has_memory () override;
bool has_stack () override;
bool has_registers () override;
bool thread_alive (ptid_t ptid) override;
};
extern void tracefile_fetch_registers (struct regcache *regcache, int regno);

View File

@ -333,7 +333,7 @@ struct windows_nat_target final : public x86_nat_target<inf_child_target>
void mourn_inferior () override;
int thread_alive (ptid_t ptid) override;
bool thread_alive (ptid_t ptid) override;
const char *pid_to_str (ptid_t) override;
@ -343,7 +343,7 @@ struct windows_nat_target final : public x86_nat_target<inf_child_target>
ptid_t get_ada_task_ptid (long lwp, long thread) override;
int get_tib_address (ptid_t ptid, CORE_ADDR *addr) override;
bool get_tib_address (ptid_t ptid, CORE_ADDR *addr) override;
const char *thread_name (struct thread_info *) override;
};
@ -2975,19 +2975,19 @@ windows_nat_target::xfer_partial (enum target_object object,
/* Provide thread local base, i.e. Thread Information Block address.
Returns 1 if ptid is found and sets *ADDR to thread_local_base. */
int
bool
windows_nat_target::get_tib_address (ptid_t ptid, CORE_ADDR *addr)
{
windows_thread_info *th;
th = thread_rec (ptid_get_tid (ptid), 0);
if (th == NULL)
return 0;
return false;
if (addr != NULL)
*addr = th->thread_local_base;
return 1;
return true;
}
ptid_t
@ -3156,7 +3156,7 @@ cygwin_get_dr7 (void)
by "polling" it. If WaitForSingleObject returns WAIT_OBJECT_0
it means that the thread has died. Otherwise it is assumed to be alive. */
int
bool
windows_nat_target::thread_alive (ptid_t ptid)
{
int tid;
@ -3164,8 +3164,7 @@ windows_nat_target::thread_alive (ptid_t ptid)
gdb_assert (ptid_get_tid (ptid) != 0);
tid = ptid_get_tid (ptid);
return WaitForSingleObject (thread_rec (tid, FALSE)->h, 0) == WAIT_OBJECT_0
? FALSE : TRUE;
return WaitForSingleObject (thread_rec (tid, FALSE)->h, 0) != WAIT_OBJECT_0;
}
void

View File

@ -47,16 +47,16 @@ struct x86_linux_nat_target : public x86_nat_target<linux_nat_target>
stopped-by-watchpoint info as soon as an lwp stops (via the low_
methods) and caches the result, to be returned via the normal
non-low methods. */
int stopped_by_watchpoint () override
bool stopped_by_watchpoint () override
{ return linux_nat_target::stopped_by_watchpoint (); }
int stopped_data_address (CORE_ADDR *addr_p) override
bool stopped_data_address (CORE_ADDR *addr_p) override
{ return linux_nat_target::stopped_data_address (addr_p); }
int low_stopped_by_watchpoint () override
bool low_stopped_by_watchpoint () override
{ return x86_nat_target::stopped_by_watchpoint (); }
int low_stopped_data_address (CORE_ADDR *addr_p) override
bool low_stopped_data_address (CORE_ADDR *addr_p) override
{ return x86_nat_target::stopped_data_address (addr_p); }
};

View File

@ -103,16 +103,16 @@ struct x86_nat_target : public BaseTarget
struct bp_target_info *bp_tgt) override
{ return x86_remove_hw_breakpoint (gdbarch, bp_tgt); }
int stopped_by_watchpoint () override
bool stopped_by_watchpoint () override
{ return x86_stopped_by_watchpoint (); }
int stopped_data_address (CORE_ADDR *addr_p) override
bool stopped_data_address (CORE_ADDR *addr_p) override
{ return x86_stopped_data_address (addr_p); }
/* A target must provide an implementation of the
"supports_stopped_by_hw_breakpoint" target method before this
callback will be used. */
int stopped_by_hw_breakpoint () override
bool stopped_by_hw_breakpoint () override
{ return x86_stopped_by_hw_breakpoint (); }
};