aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2022-10-04 14:13:53 +0100
committerAndrew Burgess <aburgess@redhat.com>2022-10-20 16:41:51 +0100
commitd8de7963a9d64d82e745e402f7f264fc53f4f2a7 (patch)
treea8deb3c61f65b3b8cd429ddd67da6e7e0b54b32b /gdb
parentaaa141a0a99fb63f6209da75257c58d94404a963 (diff)
downloadgdb-d8de7963a9d64d82e745e402f7f264fc53f4f2a7.zip
gdb-d8de7963a9d64d82e745e402f7f264fc53f4f2a7.tar.gz
gdb-d8de7963a9d64d82e745e402f7f264fc53f4f2a7.tar.bz2
gdb: some int to bool conversion in breakpoint.c
Some int to bool conversion in breakpoint.c. I've only updated the function signatures of static functions, but I've updated some function local variables throughout the file. There should be no user visible changes after this commit. Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/breakpoint.c276
1 files changed, 135 insertions, 141 deletions
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index bfa017f..a0653f1 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -114,27 +114,27 @@ static struct breakpoint *
enum bptype type,
int loc_enabled, int thread);
-static void breakpoint_adjustment_warning (CORE_ADDR, CORE_ADDR, int, int);
+static void breakpoint_adjustment_warning (CORE_ADDR, CORE_ADDR, int, bool);
static CORE_ADDR adjust_breakpoint_address (struct gdbarch *gdbarch,
CORE_ADDR bpaddr,
enum bptype bptype,
struct program_space *pspace);
-static int watchpoint_locations_match (const struct bp_location *loc1,
- const struct bp_location *loc2);
+static bool watchpoint_locations_match (const struct bp_location *loc1,
+ const struct bp_location *loc2);
-static int breakpoint_locations_match (const struct bp_location *loc1,
- const struct bp_location *loc2,
- bool sw_hw_bps_match = false);
+static bool breakpoint_locations_match (const struct bp_location *loc1,
+ const struct bp_location *loc2,
+ bool sw_hw_bps_match = false);
-static int breakpoint_location_address_match (struct bp_location *bl,
- const struct address_space *aspace,
- CORE_ADDR addr);
+static bool breakpoint_location_address_match (struct bp_location *bl,
+ const struct address_space *aspace,
+ CORE_ADDR addr);
-static int breakpoint_location_address_range_overlap (struct bp_location *,
- const address_space *,
- CORE_ADDR, int);
+static bool breakpoint_location_address_range_overlap (struct bp_location *,
+ const address_space *,
+ CORE_ADDR, int);
static int remove_breakpoint (struct bp_location *);
static int remove_breakpoint_1 (struct bp_location *, enum remove_bp_reason);
@@ -210,10 +210,10 @@ static void set_tracepoint_count (int num);
static bool is_masked_watchpoint (const struct breakpoint *b);
-/* Return 1 if B refers to a static tracepoint set by marker ("-m"), zero
- otherwise. */
+/* Return true if B refers to a static tracepoint set by marker ("-m"),
+ zero otherwise. */
-static int strace_marker_p (struct breakpoint *b);
+static bool strace_marker_p (struct breakpoint *b);
static void bkpt_probe_create_sals_from_location_spec
(location_spec *locspec,
@@ -593,7 +593,7 @@ breakpoint_condition_evaluation_mode (void)
/* Return true if GDB should evaluate breakpoint conditions or false
otherwise. */
-static int
+static bool
gdb_evaluates_breakpoint_condition_p (void)
{
const char *mode = breakpoint_condition_evaluation_mode ();
@@ -758,7 +758,7 @@ static struct cmd_list_element *breakpoint_show_cmdlist;
struct cmd_list_element *save_cmdlist;
/* Return whether a breakpoint is an active enabled breakpoint. */
-static int
+static bool
breakpoint_enabled (struct breakpoint *b)
{
return (b->enable_state == bp_enabled);
@@ -1556,19 +1556,19 @@ commands_from_control_command (const char *arg, struct command_line *cmd)
return simple_control;
}
-/* Return non-zero if BL->TARGET_INFO contains valid information. */
+/* Return true if BL->TARGET_INFO contains valid information. */
-static int
+static bool
bp_location_has_shadow (struct bp_location *bl)
{
if (bl->loc_type != bp_loc_software_breakpoint)
- return 0;
+ return false;
if (!bl->inserted)
- return 0;
+ return false;
if (bl->target_info.shadow_len == 0)
/* BL isn't valid, or doesn't shadow memory. */
- return 0;
- return 1;
+ return false;
+ return true;
}
/* Update BUF, which is LEN bytes read from the target address
@@ -1806,7 +1806,7 @@ is_watchpoint (const struct breakpoint *bpt)
and in any state. It is presently left to the target allowing
memory accesses when threads are running. */
-static int
+static bool
watchpoint_in_thread_scope (struct watchpoint *b)
{
return (b->pspace == current_program_space
@@ -1870,7 +1870,7 @@ add_dummy_location (struct breakpoint *b,
}
/* Assuming that B is a watchpoint:
- - Reparse watchpoint expression, if REPARSE is non-zero
+ - Reparse watchpoint expression, if REPARSE is true
- Evaluate expression and store the result in B->val
- Evaluate the condition if there is one, and store the result
in b->loc->cond.
@@ -1922,7 +1922,7 @@ add_dummy_location (struct breakpoint *b,
watchpoint removal from inferior. */
static void
-update_watchpoint (struct watchpoint *b, int reparse)
+update_watchpoint (struct watchpoint *b, bool reparse)
{
bool within_current_scope;
@@ -2226,27 +2226,27 @@ in which its expression is valid.\n"),
}
}
-
-/* Returns 1 iff breakpoint location should be
+/* Returns true iff breakpoint location should be
inserted in the inferior. We don't differentiate the type of BL's owner
(breakpoint vs. tracepoint), although insert_location in tracepoint's
breakpoint_ops is not defined, because in insert_bp_location,
tracepoint's insert_location will not be called. */
-static int
+
+static bool
should_be_inserted (struct bp_location *bl)
{
if (bl->owner == NULL || !breakpoint_enabled (bl->owner))
- return 0;
+ return false;
if (bl->owner->disposition == disp_del_at_next_stop)
- return 0;
+ return false;
if (!bl->enabled || bl->disabled_by_cond
|| bl->shlib_disabled || bl->duplicate)
- return 0;
+ return false;
if (user_breakpoint_p (bl->owner) && bl->pspace->executing_startup)
- return 0;
+ return false;
/* This is set for example, when we're attached to the parent of a
vfork, and have detached from the child. The child is running
@@ -2257,7 +2257,7 @@ should_be_inserted (struct bp_location *bl)
the child could still trip on the parent's breakpoints. Since
the parent is blocked anyway, it won't miss any breakpoint. */
if (bl->pspace->breakpoints_not_allowed)
- return 0;
+ return false;
/* Don't insert a breakpoint if we're trying to step past its
location, except if the breakpoint is a single-step breakpoint,
@@ -2279,7 +2279,7 @@ should_be_inserted (struct bp_location *bl)
{
infrun_debug_printf ("skipping breakpoint: stepping past insn at: %s",
paddress (bl->gdbarch, bl->address));
- return 0;
+ return false;
}
/* Don't insert watchpoints if we're trying to step past the
@@ -2290,10 +2290,10 @@ should_be_inserted (struct bp_location *bl)
infrun_debug_printf ("stepping past non-steppable watchpoint. "
"skipping watchpoint at %s:%d",
paddress (bl->gdbarch, bl->address), bl->length);
- return 0;
+ return false;
}
- return 1;
+ return true;
}
/* Same as should_be_inserted but does the check assuming
@@ -2348,7 +2348,7 @@ parse_cond_to_aexpr (CORE_ADDR scope, struct expression *cond)
static void
build_target_condition_list (struct bp_location *bl)
{
- int null_condition_or_parse_error = 0;
+ bool null_condition_or_parse_error = false;
int modified = bl->needs_update;
/* Release conditions left over from a previous insert. */
@@ -2391,7 +2391,7 @@ build_target_condition_list (struct bp_location *bl)
went wrong or we have a null condition expression. */
if (!loc->cond_bytecode)
{
- null_condition_or_parse_error = 1;
+ null_condition_or_parse_error = true;
break;
}
}
@@ -2525,7 +2525,7 @@ parse_cmd_to_aexpr (CORE_ADDR scope, char *cmd)
static void
build_target_command_list (struct bp_location *bl)
{
- int null_command_or_parse_error = 0;
+ bool null_command_or_parse_error = false;
int modified = bl->needs_update;
/* Clear commands left over from a previous insert. */
@@ -2574,7 +2574,7 @@ build_target_command_list (struct bp_location *bl)
went wrong or we have a null command expression. */
if (!loc->cmd_bytecode)
{
- null_command_or_parse_error = 1;
+ null_command_or_parse_error = true;
break;
}
}
@@ -3019,7 +3019,7 @@ insert_breakpoints (void)
{
struct watchpoint *w = (struct watchpoint *) bpt;
- update_watchpoint (w, 0 /* don't reparse. */);
+ update_watchpoint (w, false /* don't reparse. */);
}
/* Updating watchpoints creates new locations, so update the global
@@ -3140,7 +3140,7 @@ insert_breakpoint_locations (void)
them, as half-inserted watchpoint is of limited use. */
for (breakpoint *bpt : all_breakpoints ())
{
- int some_failed = 0;
+ bool some_failed = false;
if (!is_hardware_watchpoint (bpt))
continue;
@@ -3154,7 +3154,7 @@ insert_breakpoint_locations (void)
for (bp_location *loc : bpt->locations ())
if (!loc->inserted && should_be_inserted (loc))
{
- some_failed = 1;
+ some_failed = true;
break;
}
@@ -3321,7 +3321,7 @@ static struct minimal_symbol msym_not_found;
/* Returns TRUE if MSYM point to the "not found" sentinel. */
-static int
+static bool
msym_not_found_p (const struct minimal_symbol *msym)
{
return msym == &msym_not_found;
@@ -3683,7 +3683,7 @@ create_exception_master_breakpoint (void)
/* Does B have a location spec? */
-static int
+static bool
breakpoint_location_spec_empty_p (const struct breakpoint *b)
{
return (b->locspec != nullptr && b->locspec->empty_p ());
@@ -4142,7 +4142,7 @@ breakpoint_init_inferior (enum inf_context context)
enum breakpoint_here
breakpoint_here_p (const address_space *aspace, CORE_ADDR pc)
{
- int any_breakpoint_here = 0;
+ bool any_breakpoint_here = false;
for (bp_location *bl : all_bp_locations ())
{
@@ -4162,7 +4162,7 @@ breakpoint_here_p (const address_space *aspace, CORE_ADDR pc)
else if (bl->permanent)
return permanent_breakpoint_here;
else
- any_breakpoint_here = 1;
+ any_breakpoint_here = true;
}
}
@@ -4213,10 +4213,9 @@ moribund_breakpoint_here_p (const address_space *aspace, CORE_ADDR pc)
return 0;
}
-/* Returns non-zero iff BL is inserted at PC, in address space
- ASPACE. */
+/* Returns true iff BL is inserted at PC, in address space ASPACE. */
-static int
+static bool
bp_location_inserted_here_p (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR pc)
{
@@ -4224,14 +4223,12 @@ bp_location_inserted_here_p (const struct bp_location *bl,
&& breakpoint_address_match (bl->pspace->aspace, bl->address,
aspace, pc))
{
- if (overlay_debugging
- && section_is_overlay (bl->section)
- && !section_is_mapped (bl->section))
- return 0; /* unmapped overlay -- can't be a match */
- else
- return 1;
+ /* An unmapped overlay can't be a match. */
+ return !(overlay_debugging
+ && section_is_overlay (bl->section)
+ && !section_is_mapped (bl->section));
}
- return 0;
+ return false;
}
/* Returns non-zero iff there's a breakpoint inserted at PC. */
@@ -4494,10 +4491,10 @@ breakpoint_about_to_proceed (void)
breakpoint_proceeded = 1;
}
-/* Return non-zero iff CMD as the first line of a command sequence is `silent'
+/* Return true iff CMD as the first line of a command sequence is `silent'
or its equivalent. */
-static int
+static bool
command_line_is_silent (struct command_line *cmd)
{
return cmd && (strcmp ("silent", cmd->line) == 0);
@@ -4512,16 +4509,16 @@ command_line_is_silent (struct command_line *cmd)
case, it is the caller's responsibility to recall it again with the
bpstat of the current thread. */
-static int
+static bool
bpstat_do_actions_1 (bpstat **bsp)
{
bpstat *bs;
- int again = 0;
+ bool again = false;
/* Avoid endless recursion if a `source' command is contained
in bs->commands. */
if (executing_breakpoint_commands)
- return 0;
+ return false;
scoped_restore save_executing
= make_scoped_restore (&executing_breakpoint_commands, 1);
@@ -4587,7 +4584,7 @@ bpstat_do_actions_1 (bpstat **bsp)
command, and can easily blow up GDB stack. Instead, we
return true, which will trigger the caller to recall us
with the new stop_bpstat. */
- again = 1;
+ again = true;
break;
}
}
@@ -4958,7 +4955,7 @@ watchpoint_check (bpstat *bs)
{
struct watchpoint *b;
frame_info_ptr fr;
- int within_current_scope;
+ bool within_current_scope;
/* BS is built from an existing struct breakpoint. */
gdb_assert (bs->breakpoint_at != NULL);
@@ -4971,7 +4968,7 @@ watchpoint_check (bpstat *bs)
return WP_IGNORE;
if (b->exp_valid_block == NULL)
- within_current_scope = 1;
+ within_current_scope = true;
else
{
frame_info_ptr frame = get_current_frame ();
@@ -5002,7 +4999,7 @@ watchpoint_check (bpstat *bs)
function = get_frame_function (fr);
if (function == NULL
|| !contained_in (b->exp_valid_block, function->value_block ()))
- within_current_scope = 0;
+ within_current_scope = false;
}
if (within_current_scope)
@@ -5098,7 +5095,7 @@ watchpoint_check (bpstat *bs)
breakpoint location BL. This function does not check if we should
stop, only if BL explains the stop. */
-static int
+static bool
bpstat_check_location (const struct bp_location *bl,
const address_space *aspace, CORE_ADDR bp_addr,
const target_waitstatus &ws)
@@ -5127,24 +5124,24 @@ bpstat_check_watchpoint (bpstat *bs)
gdb_assert (b != NULL);
{
- int must_check_value = 0;
-
+ bool must_check_value = false;
+
if (b->type == bp_watchpoint)
/* For a software watchpoint, we must always check the
watched value. */
- must_check_value = 1;
+ must_check_value = true;
else if (b->watchpoint_triggered == watch_triggered_yes)
/* We have a hardware watchpoint (read, write, or access)
and the target earlier reported an address watched by
this watchpoint. */
- must_check_value = 1;
+ must_check_value = true;
else if (b->watchpoint_triggered == watch_triggered_unknown
&& b->type == bp_hardware_watchpoint)
/* We were stopped by a hardware watchpoint, but the target could
not report the data address. We must check the watchpoint's
value. Access and read watchpoints are out of luck; without
a data address, we can't figure it out. */
- must_check_value = 1;
+ must_check_value = true;
if (must_check_value)
{
@@ -5266,7 +5263,7 @@ bpstat_check_watchpoint (bpstat *bs)
break;
}
}
- else /* must_check_value == 0 */
+ else /* !must_check_value */
{
/* This is a case where some watchpoint(s) triggered, but
not at the address of this watchpoint, or else no
@@ -5346,7 +5343,7 @@ bpstat_check_breakpoint_conditions (bpstat *bs, thread_info *thread)
if (cond != nullptr && b->disposition != disp_del_at_next_stop)
{
- int within_current_scope = 1;
+ bool within_current_scope = true;
struct watchpoint * w;
/* We use scoped_value_mark because it could be a long time
@@ -5390,7 +5387,7 @@ bpstat_check_breakpoint_conditions (bpstat *bs, thread_info *thread)
if (frame != NULL)
select_frame (frame);
else
- within_current_scope = 0;
+ within_current_scope = false;
}
if (within_current_scope)
{
@@ -5441,7 +5438,7 @@ bpstat_check_breakpoint_conditions (bpstat *bs, thread_info *thread)
/* Returns true if we need to track moribund locations of LOC's type
on the current target. */
-static int
+static bool
need_moribund_for_location_type (const struct bp_location *loc)
{
return ((loc->loc_type == bp_loc_software_breakpoint
@@ -5623,7 +5620,7 @@ bpstat_stop_status (const address_space *aspace,
{
struct watchpoint *w = (struct watchpoint *) bs->breakpoint_at;
- update_watchpoint (w, 0 /* don't reparse. */);
+ update_watchpoint (w, false /* don't reparse. */);
need_remove_insert = 1;
}
@@ -6184,8 +6181,8 @@ print_one_breakpoint_location (struct breakpoint *b,
static char bpenables[] = "nynny";
struct ui_out *uiout = current_uiout;
- int header_of_multiple = 0;
- int part_of_multiple = (loc != NULL);
+ bool header_of_multiple = false;
+ bool part_of_multiple = (loc != NULL);
struct value_print_options opts;
get_user_print_options (&opts);
@@ -6197,7 +6194,7 @@ print_one_breakpoint_location (struct breakpoint *b,
&& (b->loc != NULL
&& (b->loc->next != NULL
|| !b->loc->enabled || b->loc->disabled_by_cond)))
- header_of_multiple = 1;
+ header_of_multiple = true;
if (loc == NULL)
loc = b->loc;
@@ -6856,7 +6853,7 @@ maintenance_info_breakpoints (const char *args, int from_tty)
default_collect_info ();
}
-static int
+static bool
breakpoint_has_pc (struct breakpoint *b,
struct program_space *pspace,
CORE_ADDR pc, struct obj_section *section)
@@ -6866,9 +6863,9 @@ breakpoint_has_pc (struct breakpoint *b,
if (bl->pspace == pspace
&& bl->address == pc
&& (!overlay_debugging || bl->section == section))
- return 1;
+ return true;
}
- return 0;
+ return false;
}
/* See breakpoint.h. */
@@ -6934,7 +6931,7 @@ bl_address_is_meaningful (bp_location *loc)
/* Assuming LOC1 and LOC2's owners are hardware watchpoints, returns
true if LOC1 and LOC2 represent the same watchpoint location. */
-static int
+static bool
watchpoint_locations_match (const struct bp_location *loc1,
const struct bp_location *loc2)
{
@@ -6961,7 +6958,7 @@ watchpoint_locations_match (const struct bp_location *loc1,
loc2->length,
loc2->watchpoint_type,
w2->cond_exp.get ())))
- return 0;
+ return false;
/* Note that this checks the owner's type, not the location's. In
case the target does not support read watchpoints, but does
@@ -6991,7 +6988,7 @@ breakpoint_address_match (const address_space *aspace1, CORE_ADDR addr1,
matches ASPACE2. On targets that have global breakpoints, the address
space doesn't really matter. */
-static int
+static bool
breakpoint_address_match_range (const address_space *aspace1,
CORE_ADDR addr1,
int len1, const address_space *aspace2,
@@ -7007,7 +7004,7 @@ breakpoint_address_match_range (const address_space *aspace1,
matches the breakpoint's address space. On targets that have global
breakpoints, the address space doesn't really matter. */
-static int
+static bool
breakpoint_location_address_match (struct bp_location *bl,
const address_space *aspace,
CORE_ADDR addr)
@@ -7026,7 +7023,7 @@ breakpoint_location_address_match (struct bp_location *bl,
space. On targets that have global breakpoints, the address space
doesn't really matter. */
-static int
+static bool
breakpoint_location_address_range_overlap (struct bp_location *bl,
const address_space *aspace,
CORE_ADDR addr, int len)
@@ -7046,7 +7043,7 @@ breakpoint_location_address_range_overlap (struct bp_location *bl,
Then, if LOC1 and LOC2 represent the same tracepoint location, returns
true, otherwise returns false. */
-static int
+static bool
tracepoint_locations_match (const struct bp_location *loc1,
const struct bp_location *loc2)
{
@@ -7056,7 +7053,7 @@ tracepoint_locations_match (const struct bp_location *loc1,
different locations. */
return (loc1->address == loc2->address && loc1->owner == loc2->owner);
else
- return 0;
+ return false;
}
/* Assuming LOC1 and LOC2's types' have meaningful target addresses
@@ -7065,7 +7062,7 @@ tracepoint_locations_match (const struct bp_location *loc1,
breakpoint locations and hardware breakpoint locations match,
otherwise they don't. */
-static int
+static bool
breakpoint_locations_match (const struct bp_location *loc1,
const struct bp_location *loc2,
bool sw_hw_bps_match)
@@ -7080,7 +7077,7 @@ breakpoint_locations_match (const struct bp_location *loc1,
hw_point2 = is_hardware_watchpoint (loc2->owner);
if (hw_point1 != hw_point2)
- return 0;
+ return false;
else if (hw_point1)
return watchpoint_locations_match (loc1, loc2);
else if (is_tracepoint (loc1->owner) || is_tracepoint (loc2->owner))
@@ -7097,7 +7094,7 @@ breakpoint_locations_match (const struct bp_location *loc1,
static void
breakpoint_adjustment_warning (CORE_ADDR from_addr, CORE_ADDR to_addr,
- int bnum, int have_bnum)
+ int bnum, bool have_bnum)
{
/* The longest string possibly returned by hex_string_custom
is 50 chars. These must be at least that big for safety. */
@@ -7169,7 +7166,7 @@ adjust_breakpoint_address (struct gdbarch *gdbarch,
a user's expectations. Print a warning if an adjustment
is required. */
if (adjusted_bpaddr != bpaddr)
- breakpoint_adjustment_warning (bpaddr, adjusted_bpaddr, 0, 0);
+ breakpoint_adjustment_warning (bpaddr, adjusted_bpaddr, 0, false);
return adjusted_bpaddr;
}
@@ -7679,7 +7676,7 @@ disable_breakpoints_in_shlibs (void)
static void
disable_breakpoints_in_unloaded_shlib (struct so_list *solib)
{
- int disabled_shlib_breaks = 0;
+ bool disabled_shlib_breaks = false;
for (bp_location *loc : all_bp_locations ())
{
@@ -7712,7 +7709,7 @@ disable_breakpoints_in_unloaded_shlib (struct so_list *solib)
"for unloaded shared library \"%s\""),
solib->so_name);
}
- disabled_shlib_breaks = 1;
+ disabled_shlib_breaks = true;
}
}
}
@@ -7744,7 +7741,7 @@ disable_breakpoints_in_freed_objfile (struct objfile *objfile)
for (breakpoint *b : all_breakpoints ())
{
- int bp_modified = 0;
+ bool bp_modified = false;
if (!is_breakpoint (b) && !is_tracepoint (b))
continue;
@@ -7778,7 +7775,7 @@ disable_breakpoints_in_freed_objfile (struct objfile *objfile)
mark_breakpoint_location_modified (loc);
- bp_modified = 1;
+ bp_modified = true;
}
}
@@ -8813,7 +8810,7 @@ create_breakpoint (struct gdbarch *gdbarch,
unsigned flags)
{
struct linespec_result canonical;
- int pending = 0;
+ bool pending = false;
int task = 0;
int prev_bkpt_count = breakpoint_count;
@@ -8852,7 +8849,7 @@ create_breakpoint (struct gdbarch *gdbarch,
a pending breakpoint and selected yes, or pending
breakpoint behavior is on and thus a pending breakpoint
is defaulted on behalf of the user. */
- pending = 1;
+ pending = true;
}
else
throw;
@@ -9446,7 +9443,7 @@ watchpoint::re_set ()
Don't do anything about disabled watchpoints, since they will be
reevaluated again when enabled. */
- update_watchpoint (this, 1 /* reparse */);
+ update_watchpoint (this, true /* reparse */);
}
/* Implement the "insert" method for hardware watchpoints. */
@@ -10183,7 +10180,7 @@ watch_command_1 (const char *arg, int accessflag, int from_tty,
/* Finally update the new watchpoint. This creates the locations
that should be inserted. */
- update_watchpoint (w.get (), 1);
+ update_watchpoint (w.get (), true /* reparse */);
install_breakpoint (internal, std::move (w), 1);
}
@@ -10834,7 +10831,7 @@ download_tracepoint_locations (void)
for (breakpoint *b : all_tracepoints ())
{
struct tracepoint *t;
- int bp_location_downloaded = 0;
+ bool bp_location_downloaded = false;
if ((b->type == bp_fast_tracepoint
? !may_insert_fast_tracepoints
@@ -10865,7 +10862,7 @@ download_tracepoint_locations (void)
target_download_tracepoint (bl);
bl->inserted = 1;
- bp_location_downloaded = 1;
+ bp_location_downloaded = true;
}
t = (struct tracepoint *) b;
t->number_on_target = b->number;
@@ -11009,10 +11006,10 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
{
/* Tells if 'old_loc' is found among the new locations. If
not, we have to free it. */
- int found_object = 0;
+ bool found_object = false;
/* Tells if the location should remain inserted in the target. */
- int keep_in_target = 0;
- int removed = 0;
+ bool keep_in_target = false;
+ bool removed = false;
/* Skip LOCP entries which will definitely never be needed.
Stop either at or being the one matching OLD_LOC. */
@@ -11038,7 +11035,7 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
}
if (bp_locations[loc2_i] == old_loc)
- found_object = 1;
+ found_object = true;
}
/* We have already handled this address, update it so that we don't
@@ -11064,7 +11061,7 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
{
/* The location is still present in the location list,
and still should be inserted. Don't do anything. */
- keep_in_target = 1;
+ keep_in_target = true;
}
else
{
@@ -11107,7 +11104,7 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
if (unduplicated_should_be_inserted (loc2))
{
swap_insertion (old_loc, loc2);
- keep_in_target = 1;
+ keep_in_target = true;
break;
}
}
@@ -11131,7 +11128,7 @@ update_global_location_list (enum ugll_insert_mode insert_mode)
"breakpoint %d\n"),
old_loc->owner->number);
}
- removed = 1;
+ removed = true;
}
}
@@ -11605,7 +11602,7 @@ ordinary_breakpoint::print_it (const bpstat *bs) const
if (bl->address != bl->requested_address)
breakpoint_adjustment_warning (bl->requested_address,
bl->address,
- number, 1);
+ number, true);
annotate_breakpoint (number);
maybe_print_thread_hit_breakpoint (uiout);
@@ -12098,7 +12095,7 @@ static struct breakpoint_ops strace_marker_breakpoint_ops =
strace_marker_create_breakpoints_sal,
};
-static int
+static bool
strace_marker_p (struct breakpoint *b)
{
return b->type == bp_static_marker_tracepoint;
@@ -12270,7 +12267,7 @@ delete_command (const char *arg, int from_tty)
PSPACE is NULL, all locations of all program spaces are
considered. */
-static int
+static bool
all_locations_are_pending (struct breakpoint *b, struct program_space *pspace)
{
for (bp_location *loc : b->locations ())
@@ -12278,15 +12275,15 @@ all_locations_are_pending (struct breakpoint *b, struct program_space *pspace)
|| loc->pspace == pspace)
&& !loc->shlib_disabled
&& !loc->pspace->executing_startup)
- return 0;
- return 1;
+ return false;
+ return true;
}
/* Subroutine of update_breakpoint_locations to simplify it.
- Return non-zero if multiple fns in list LOC have the same name.
+ Return true if multiple fns in list LOC have the same name.
Null names are ignored. */
-static int
+static bool
ambiguous_names_p (struct bp_location *loc)
{
struct bp_location *l;
@@ -12307,11 +12304,11 @@ ambiguous_names_p (struct bp_location *loc)
/* NOTE: We can assume slot != NULL here because xcalloc never
returns NULL. */
if (*slot != NULL)
- return 1;
+ return true;
*slot = name;
}
- return 0;
+ return false;
}
/* When symbols change, it probably means the sources changed as well,
@@ -12438,34 +12435,34 @@ update_static_tracepoint (struct breakpoint *b, struct symtab_and_line sal)
return sal;
}
-/* Returns 1 iff locations A and B are sufficiently same that
+/* Returns true iff locations A and B are sufficiently same that
we don't need to report breakpoint as changed. */
-static int
+static bool
locations_are_equal (struct bp_location *a, struct bp_location *b)
{
while (a && b)
{
if (a->address != b->address)
- return 0;
+ return false;
if (a->shlib_disabled != b->shlib_disabled)
- return 0;
+ return false;
if (a->enabled != b->enabled)
- return 0;
+ return false;
if (a->disabled_by_cond != b->disabled_by_cond)
- return 0;
+ return false;
a = a->next;
b = b->next;
}
if ((a == NULL) != (b == NULL))
- return 0;
+ return false;
- return 1;
+ return true;
}
/* Split all locations of B that are bound to PSPACE out of B's
@@ -12650,7 +12647,7 @@ code_breakpoint::location_spec_to_sals (location_spec *locspec,
}
catch (gdb_exception_error &e)
{
- int not_found_and_ok = 0;
+ int not_found_and_ok = false;
/* For pending breakpoints, it's expected that parsing will
fail until the right shared library is loaded. User has
@@ -12667,7 +12664,7 @@ code_breakpoint::location_spec_to_sals (location_spec *locspec,
|| (loc && loc->shlib_disabled)
|| (loc && loc->pspace->executing_startup)
|| enable_state == bp_disabled))
- not_found_and_ok = 1;
+ not_found_and_ok = true;
if (!not_found_and_ok)
{
@@ -13327,7 +13324,7 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition,
orig_enable_state = bpt->enable_state;
bpt->enable_state = bp_enabled;
- update_watchpoint (w, 1 /* reparse */);
+ update_watchpoint (w, true /* reparse */);
}
catch (const gdb_exception &e)
{
@@ -13969,7 +13966,7 @@ static void
save_breakpoints (const char *filename, int from_tty,
bool (*filter) (const struct breakpoint *))
{
- int any = 0;
+ bool any = false;
int extra_trace_bits = 0;
if (filename == 0 || *filename == 0)
@@ -13986,7 +13983,7 @@ save_breakpoints (const char *filename, int from_tty,
if (filter && !filter (tp))
continue;
- any = 1;
+ any = true;
if (is_tracepoint (tp))
{
@@ -14174,18 +14171,15 @@ add_catch_command (const char *name, const char *docstring,
set_cmd_completer (command, completer);
}
-/* Zero if any of the breakpoint's locations could be a location where
- functions have been inlined, nonzero otherwise. */
+/* False if any of the breakpoint's locations could be a location where
+ functions have been inlined, true otherwise. */
-static int
+static bool
is_non_inline_function (struct breakpoint *b)
{
/* The shared library event breakpoint is set on the address of a
non-inline function. */
- if (b->type == bp_shlib_event)
- return 1;
-
- return 0;
+ return (b->type == bp_shlib_event);
}
/* Nonzero if the specified PC cannot be a location where functions