+2021-05-27 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * Fix some indentation mistakes throughout.
+
2021-05-27 Simon Marchi <simon.marchi@polymtl.ca>
* breakpoint.h (iterate_over_bp_locations): Remove. Update
{ \
unsigned int mem_len = LENGTH; \
if (mem_len) \
- { \
- MEMS = XNEWVEC (struct aarch64_mem_r, mem_len); \
- memcpy(&MEMS->len, &RECORD_BUF[0], \
- sizeof(struct aarch64_mem_r) * LENGTH); \
- } \
+ { \
+ MEMS = XNEWVEC (struct aarch64_mem_r, mem_len); \
+ memcpy(&MEMS->len, &RECORD_BUF[0], \
+ sizeof(struct aarch64_mem_r) * LENGTH); \
+ } \
} \
while (0)
tid_t ktid = 0;
while (1)
- {
- if (getthrds (inferior_ptid.pid (), &thrinf,
- sizeof (thrinf), &ktid, 1) != 1)
- break;
+ {
+ if (getthrds (inferior_ptid.pid (), &thrinf,
+ sizeof (thrinf), &ktid, 1) != 1)
+ break;
- if (thrinf.ti_cursig == SIGTRAP)
- return thrinf.ti_tid;
- }
+ if (thrinf.ti_cursig == SIGTRAP)
+ return thrinf.ti_tid;
+ }
/* Didn't find any thread stopped on a SIGTRAP signal. */
return 0;
if (arm_hwcap & HWCAP_NEON)
return aarch32_read_description ();
else if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPD32))
- == (HWCAP_VFPv3 | HWCAP_VFPD32))
+ == (HWCAP_VFPv3 | HWCAP_VFPD32))
return arm_read_description (ARM_FP_TYPE_VFPV3);
else
- return arm_read_description (ARM_FP_TYPE_VFPV2);
+ return arm_read_description (ARM_FP_TYPE_VFPV2);
}
return nullptr;
{ \
unsigned int mem_len = LENGTH; \
if (mem_len) \
- { \
- MEMS = XNEWVEC (struct arm_mem_r, mem_len); \
- memcpy(&MEMS->len, &RECORD_BUF[0], \
- sizeof(struct arm_mem_r) * LENGTH); \
- } \
+ { \
+ MEMS = XNEWVEC (struct arm_mem_r, mem_len); \
+ memcpy(&MEMS->len, &RECORD_BUF[0], \
+ sizeof(struct arm_mem_r) * LENGTH); \
+ } \
} \
while (0)
{
/* Handle MLA(S) and MUL(S). */
if (in_inclusive_range (insn_op1, 0U, 3U))
- {
- record_buf[0] = bits (arm_insn_r->arm_insn, 12, 15);
- record_buf[1] = ARM_PS_REGNUM;
- arm_insn_r->reg_rec_count = 2;
- }
+ {
+ record_buf[0] = bits (arm_insn_r->arm_insn, 12, 15);
+ record_buf[1] = ARM_PS_REGNUM;
+ arm_insn_r->reg_rec_count = 2;
+ }
else if (in_inclusive_range (insn_op1, 4U, 15U))
- {
- /* Handle SMLAL(S), SMULL(S), UMLAL(S), UMULL(S). */
- record_buf[0] = bits (arm_insn_r->arm_insn, 16, 19);
- record_buf[1] = bits (arm_insn_r->arm_insn, 12, 15);
- record_buf[2] = ARM_PS_REGNUM;
- arm_insn_r->reg_rec_count = 3;
- }
+ {
+ /* Handle SMLAL(S), SMULL(S), UMLAL(S), UMULL(S). */
+ record_buf[0] = bits (arm_insn_r->arm_insn, 16, 19);
+ record_buf[1] = bits (arm_insn_r->arm_insn, 12, 15);
+ record_buf[2] = ARM_PS_REGNUM;
+ arm_insn_r->reg_rec_count = 3;
+ }
}
opcode1 = bits (arm_insn_r->arm_insn, 26, 27);
/* Note: BLX(1) doesnt fall here but instead it falls into
extension space. */
if (bit (arm_insn_r->arm_insn, 24))
- {
- record_buf[0] = ARM_LR_REGNUM;
- arm_insn_r->reg_rec_count = 1;
- }
+ {
+ record_buf[0] = ARM_LR_REGNUM;
+ arm_insn_r->reg_rec_count = 1;
+ }
REG_ALLOC (arm_insn_r->arm_regs, arm_insn_r->reg_rec_count, record_buf);
/* Now do full processing of the found relevant range of elements. */
for (bc = bc_l; bc < bp_locations.size (); bc++)
- {
- struct bp_location *bl = bp_locations[bc];
+ {
+ struct bp_location *bl = bp_locations[bc];
- /* bp_location array has BL->OWNER always non-NULL. */
- if (bl->owner->type == bp_none)
- warning (_("reading through apparently deleted breakpoint #%d?"),
- bl->owner->number);
+ /* bp_location array has BL->OWNER always non-NULL. */
+ if (bl->owner->type == bp_none)
+ warning (_("reading through apparently deleted breakpoint #%d?"),
+ bl->owner->number);
- /* Performance optimization: any further element can no longer affect BUF
- content. */
+ /* Performance optimization: any further element can no longer affect BUF
+ content. */
- if (bl->address >= bp_locations_placed_address_before_address_max
- && memaddr + len <= (bl->address
- - bp_locations_placed_address_before_address_max))
- break;
+ if (bl->address >= bp_locations_placed_address_before_address_max
+ && (memaddr + len
+ <= (bl->address
+ - bp_locations_placed_address_before_address_max)))
+ break;
- if (!bp_location_has_shadow (bl))
- continue;
+ if (!bp_location_has_shadow (bl))
+ continue;
- one_breakpoint_xfer_memory (readbuf, writebuf, writebuf_org,
- memaddr, len, &bl->target_info, bl->gdbarch);
- }
+ one_breakpoint_xfer_memory (readbuf, writebuf, writebuf_org,
+ memaddr, len, &bl->target_info, bl->gdbarch);
+ }
}
/* See breakpoint.h. */
int val = 0;
for (bp_location *bl : all_bp_locations ())
- {
if (bl->inserted && !is_tracepoint (bl->owner))
val |= remove_breakpoint (bl);
- }
+
return val;
}
int val;
for (bp_location *bl : all_bp_locations ())
- {
- if (bl->pspace != inf->pspace)
- continue;
+ {
+ if (bl->pspace != inf->pspace)
+ continue;
- if (bl->inserted && !bl->target_info.persist)
- {
- val = remove_breakpoint (bl);
- if (val != 0)
- return;
- }
- }
+ if (bl->inserted && !bl->target_info.persist)
+ {
+ val = remove_breakpoint (bl);
+ if (val != 0)
+ return;
+ }
+ }
}
static int internal_breakpoint_number = -1;
gdb_assert (!bploc->inserted);
for (breakpoint *b : all_breakpoints_safe ())
- {
- if (b->pspace != current_program_space)
- continue;
-
- /* Solib breakpoints must be explicitly reset after an exec(). */
- if (b->type == bp_shlib_event)
- {
- delete_breakpoint (b);
+ {
+ if (b->pspace != current_program_space)
continue;
- }
- /* JIT breakpoints must be explicitly reset after an exec(). */
- if (b->type == bp_jit_event)
- {
- delete_breakpoint (b);
- continue;
- }
+ /* Solib breakpoints must be explicitly reset after an exec(). */
+ if (b->type == bp_shlib_event)
+ {
+ delete_breakpoint (b);
+ continue;
+ }
- /* Thread event breakpoints must be set anew after an exec(),
- as must overlay event and longjmp master breakpoints. */
- if (b->type == bp_thread_event || b->type == bp_overlay_event
- || b->type == bp_longjmp_master || b->type == bp_std_terminate_master
- || b->type == bp_exception_master)
- {
- delete_breakpoint (b);
- continue;
- }
+ /* JIT breakpoints must be explicitly reset after an exec(). */
+ if (b->type == bp_jit_event)
+ {
+ delete_breakpoint (b);
+ continue;
+ }
- /* Step-resume breakpoints are meaningless after an exec(). */
- if (b->type == bp_step_resume || b->type == bp_hp_step_resume)
- {
- delete_breakpoint (b);
- continue;
- }
+ /* Thread event breakpoints must be set anew after an exec(),
+ as must overlay event and longjmp master breakpoints. */
+ if (b->type == bp_thread_event || b->type == bp_overlay_event
+ || b->type == bp_longjmp_master || b->type == bp_std_terminate_master
+ || b->type == bp_exception_master)
+ {
+ delete_breakpoint (b);
+ continue;
+ }
- /* Just like single-step breakpoints. */
- if (b->type == bp_single_step)
- {
- delete_breakpoint (b);
- continue;
- }
+ /* Step-resume breakpoints are meaningless after an exec(). */
+ if (b->type == bp_step_resume || b->type == bp_hp_step_resume)
+ {
+ delete_breakpoint (b);
+ continue;
+ }
- /* Longjmp and longjmp-resume breakpoints are also meaningless
- after an exec. */
- if (b->type == bp_longjmp || b->type == bp_longjmp_resume
- || b->type == bp_longjmp_call_dummy
- || b->type == bp_exception || b->type == bp_exception_resume)
- {
- delete_breakpoint (b);
- continue;
- }
+ /* Just like single-step breakpoints. */
+ if (b->type == bp_single_step)
+ {
+ delete_breakpoint (b);
+ continue;
+ }
- if (b->type == bp_catchpoint)
- {
- /* For now, none of the bp_catchpoint breakpoints need to
- do anything at this point. In the future, if some of
- the catchpoints need to something, we will need to add
- a new method, and call this method from here. */
- continue;
- }
+ /* Longjmp and longjmp-resume breakpoints are also meaningless
+ after an exec. */
+ if (b->type == bp_longjmp || b->type == bp_longjmp_resume
+ || b->type == bp_longjmp_call_dummy
+ || b->type == bp_exception || b->type == bp_exception_resume)
+ {
+ delete_breakpoint (b);
+ continue;
+ }
- /* bp_finish is a special case. The only way we ought to be able
- to see one of these when an exec() has happened, is if the user
- caught a vfork, and then said "finish". Ordinarily a finish just
- carries them to the call-site of the current callee, by setting
- a temporary bp there and resuming. But in this case, the finish
- will carry them entirely through the vfork & exec.
-
- We don't want to allow a bp_finish to remain inserted now. But
- we can't safely delete it, 'cause finish_command has a handle to
- the bp on a bpstat, and will later want to delete it. There's a
- chance (and I've seen it happen) that if we delete the bp_finish
- here, that its storage will get reused by the time finish_command
- gets 'round to deleting the "use to be a bp_finish" breakpoint.
- We really must allow finish_command to delete a bp_finish.
-
- In the absence of a general solution for the "how do we know
- it's safe to delete something others may have handles to?"
- problem, what we'll do here is just uninsert the bp_finish, and
- let finish_command delete it.
-
- (We know the bp_finish is "doomed" in the sense that it's
- momentary, and will be deleted as soon as finish_command sees
- the inferior stopped. So it doesn't matter that the bp's
- address is probably bogus in the new a.out, unlike e.g., the
- solib breakpoints.) */
-
- if (b->type == bp_finish)
- {
- continue;
- }
+ if (b->type == bp_catchpoint)
+ {
+ /* For now, none of the bp_catchpoint breakpoints need to
+ do anything at this point. In the future, if some of
+ the catchpoints need to something, we will need to add
+ a new method, and call this method from here. */
+ continue;
+ }
- /* Without a symbolic address, we have little hope of the
- pre-exec() address meaning the same thing in the post-exec()
- a.out. */
- if (breakpoint_event_location_empty_p (b))
- {
- delete_breakpoint (b);
- continue;
- }
- }
+ /* bp_finish is a special case. The only way we ought to be able
+ to see one of these when an exec() has happened, is if the user
+ caught a vfork, and then said "finish". Ordinarily a finish just
+ carries them to the call-site of the current callee, by setting
+ a temporary bp there and resuming. But in this case, the finish
+ will carry them entirely through the vfork & exec.
+
+ We don't want to allow a bp_finish to remain inserted now. But
+ we can't safely delete it, 'cause finish_command has a handle to
+ the bp on a bpstat, and will later want to delete it. There's a
+ chance (and I've seen it happen) that if we delete the bp_finish
+ here, that its storage will get reused by the time finish_command
+ gets 'round to deleting the "use to be a bp_finish" breakpoint.
+ We really must allow finish_command to delete a bp_finish.
+
+ In the absence of a general solution for the "how do we know
+ it's safe to delete something others may have handles to?"
+ problem, what we'll do here is just uninsert the bp_finish, and
+ let finish_command delete it.
+
+ (We know the bp_finish is "doomed" in the sense that it's
+ momentary, and will be deleted as soon as finish_command sees
+ the inferior stopped. So it doesn't matter that the bp's
+ address is probably bogus in the new a.out, unlike e.g., the
+ solib breakpoints.) */
+
+ if (b->type == bp_finish)
+ {
+ continue;
+ }
+
+ /* Without a symbolic address, we have little hope of the
+ pre-exec() address meaning the same thing in the post-exec()
+ a.out. */
+ if (breakpoint_event_location_empty_p (b))
+ {
+ delete_breakpoint (b);
+ continue;
+ }
+ }
}
int
/* Set inferior_ptid; remove_breakpoint_1 uses this global. */
inferior_ptid = ptid;
for (bp_location *bl : all_bp_locations ())
- {
- if (bl->pspace != inf->pspace)
- continue;
-
- /* This function must physically remove breakpoints locations
- from the specified ptid, without modifying the breakpoint
- package's state. Locations of type bp_loc_other are only
- maintained at GDB side. So, there is no need to remove
- these bp_loc_other locations. Moreover, removing these
- would modify the breakpoint package's state. */
- if (bl->loc_type == bp_loc_other)
- continue;
-
- if (bl->inserted)
- val |= remove_breakpoint_1 (bl, DETACH_BREAKPOINT);
- }
+ {
+ if (bl->pspace != inf->pspace)
+ continue;
+
+ /* This function must physically remove breakpoints locations
+ from the specified ptid, without modifying the breakpoint
+ package's state. Locations of type bp_loc_other are only
+ maintained at GDB side. So, there is no need to remove
+ these bp_loc_other locations. Moreover, removing these
+ would modify the breakpoint package's state. */
+ if (bl->loc_type == bp_loc_other)
+ continue;
+
+ if (bl->inserted)
+ val |= remove_breakpoint_1 (bl, DETACH_BREAKPOINT);
+ }
return val;
}
mark_breakpoints_out ();
for (breakpoint *b : all_breakpoints_safe ())
- {
- if (b->loc && b->loc->pspace != pspace)
- continue;
+ {
+ if (b->loc && b->loc->pspace != pspace)
+ continue;
- switch (b->type)
- {
- case bp_call_dummy:
- case bp_longjmp_call_dummy:
+ switch (b->type)
+ {
+ case bp_call_dummy:
+ case bp_longjmp_call_dummy:
- /* If the call dummy breakpoint is at the entry point it will
- cause problems when the inferior is rerun, so we better get
- rid of it. */
+ /* If the call dummy breakpoint is at the entry point it will
+ cause problems when the inferior is rerun, so we better get
+ rid of it. */
- case bp_watchpoint_scope:
+ case bp_watchpoint_scope:
- /* Also get rid of scope breakpoints. */
+ /* Also get rid of scope breakpoints. */
- case bp_shlib_event:
+ case bp_shlib_event:
- /* Also remove solib event breakpoints. Their addresses may
- have changed since the last time we ran the program.
- Actually we may now be debugging against different target;
- and so the solib backend that installed this breakpoint may
- not be used in by the target. E.g.,
+ /* Also remove solib event breakpoints. Their addresses may
+ have changed since the last time we ran the program.
+ Actually we may now be debugging against different target;
+ and so the solib backend that installed this breakpoint may
+ not be used in by the target. E.g.,
- (gdb) file prog-linux
- (gdb) run # native linux target
- ...
- (gdb) kill
- (gdb) file prog-win.exe
- (gdb) tar rem :9999 # remote Windows gdbserver.
- */
+ (gdb) file prog-linux
+ (gdb) run # native linux target
+ ...
+ (gdb) kill
+ (gdb) file prog-win.exe
+ (gdb) tar rem :9999 # remote Windows gdbserver.
+ */
- case bp_step_resume:
+ case bp_step_resume:
- /* Also remove step-resume breakpoints. */
+ /* Also remove step-resume breakpoints. */
- case bp_single_step:
+ case bp_single_step:
- /* Also remove single-step breakpoints. */
+ /* Also remove single-step breakpoints. */
- delete_breakpoint (b);
- break;
+ delete_breakpoint (b);
+ break;
- case bp_watchpoint:
- case bp_hardware_watchpoint:
- case bp_read_watchpoint:
- case bp_access_watchpoint:
- {
- struct watchpoint *w = (struct watchpoint *) b;
+ case bp_watchpoint:
+ case bp_hardware_watchpoint:
+ case bp_read_watchpoint:
+ case bp_access_watchpoint:
+ {
+ struct watchpoint *w = (struct watchpoint *) b;
- /* Likewise for watchpoints on local expressions. */
- if (w->exp_valid_block != NULL)
- delete_breakpoint (b);
- else
- {
- /* Get rid of existing locations, which are no longer
- valid. New ones will be created in
- update_watchpoint, when the inferior is restarted.
- The next update_global_location_list call will
- garbage collect them. */
- b->loc = NULL;
-
- if (context == inf_starting)
- {
- /* Reset val field to force reread of starting value in
- insert_breakpoints. */
- w->val.reset (nullptr);
- w->val_valid = false;
- }
- }
+ /* Likewise for watchpoints on local expressions. */
+ if (w->exp_valid_block != NULL)
+ delete_breakpoint (b);
+ else
+ {
+ /* Get rid of existing locations, which are no longer
+ valid. New ones will be created in
+ update_watchpoint, when the inferior is restarted.
+ The next update_global_location_list call will
+ garbage collect them. */
+ b->loc = NULL;
+
+ if (context == inf_starting)
+ {
+ /* Reset val field to force reread of starting value in
+ insert_breakpoints. */
+ w->val.reset (nullptr);
+ w->val_valid = false;
+ }
+ }
+ }
+ break;
+ default:
+ break;
}
- break;
- default:
- break;
- }
- }
+ }
/* Get rid of the moribund locations. */
for (bp_location *bl : moribund_locations)
{
for (breakpoint *b : all_breakpoints ())
if (b->type == bp_overlay_event)
- {
- b->enable_state = bp_enabled;
- update_global_location_list (UGLL_MAY_INSERT);
- overlay_events_enabled = 1;
- }
+ {
+ b->enable_state = bp_enabled;
+ update_global_location_list (UGLL_MAY_INSERT);
+ overlay_events_enabled = 1;
+ }
}
void
{
for (breakpoint *b : all_breakpoints ())
if (b->type == bp_overlay_event)
- {
- b->enable_state = bp_disabled;
- update_global_location_list (UGLL_DONT_INSERT);
- overlay_events_enabled = 0;
- }
+ {
+ b->enable_state = bp_disabled;
+ update_global_location_list (UGLL_DONT_INSERT);
+ overlay_events_enabled = 0;
+ }
}
/* Set an active std::terminate breakpoint for each std::terminate
disable_breakpoints_in_shlibs (void)
{
for (bp_location *loc : all_bp_locations ())
- {
- /* ALL_BP_LOCATIONS bp_location has LOC->OWNER always non-NULL. */
- struct breakpoint *b = loc->owner;
-
- /* We apply the check to all breakpoints, including disabled for
- those with loc->duplicate set. This is so that when breakpoint
- becomes enabled, or the duplicate is removed, gdb will try to
- insert all breakpoints. If we don't set shlib_disabled here,
- we'll try to insert those breakpoints and fail. */
- if (((b->type == bp_breakpoint)
- || (b->type == bp_jit_event)
- || (b->type == bp_hardware_breakpoint)
- || (is_tracepoint (b)))
- && loc->pspace == current_program_space
- && !loc->shlib_disabled
- && solib_name_from_address (loc->pspace, loc->address)
- )
- {
- loc->shlib_disabled = 1;
- }
- }
+ {
+ /* ALL_BP_LOCATIONS bp_location has LOC->OWNER always non-NULL. */
+ struct breakpoint *b = loc->owner;
+
+ /* We apply the check to all breakpoints, including disabled for
+ those with loc->duplicate set. This is so that when breakpoint
+ becomes enabled, or the duplicate is removed, gdb will try to
+ insert all breakpoints. If we don't set shlib_disabled here,
+ we'll try to insert those breakpoints and fail. */
+ if (((b->type == bp_breakpoint)
+ || (b->type == bp_jit_event)
+ || (b->type == bp_hardware_breakpoint)
+ || (is_tracepoint (b)))
+ && loc->pspace == current_program_space
+ && !loc->shlib_disabled
+ && solib_name_from_address (loc->pspace, loc->address)
+ )
+ {
+ loc->shlib_disabled = 1;
+ }
+ }
}
/* Disable any breakpoints and tracepoints that are in SOLIB upon
int disabled_shlib_breaks = 0;
for (bp_location *loc : all_bp_locations ())
- {
- /* ALL_BP_LOCATIONS bp_location has LOC->OWNER always non-NULL. */
- struct breakpoint *b = loc->owner;
-
- if (solib->pspace == loc->pspace
- && !loc->shlib_disabled
- && (((b->type == bp_breakpoint
- || b->type == bp_jit_event
- || b->type == bp_hardware_breakpoint)
- && (loc->loc_type == bp_loc_hardware_breakpoint
- || loc->loc_type == bp_loc_software_breakpoint))
- || is_tracepoint (b))
- && solib_contains_address_p (solib, loc->address))
- {
- loc->shlib_disabled = 1;
- /* At this point, we cannot rely on remove_breakpoint
- succeeding so we must mark the breakpoint as not inserted
- to prevent future errors occurring in remove_breakpoints. */
- loc->inserted = 0;
-
- /* This may cause duplicate notifications for the same breakpoint. */
- gdb::observers::breakpoint_modified.notify (b);
-
- if (!disabled_shlib_breaks)
- {
- target_terminal::ours_for_output ();
- warning (_("Temporarily disabling breakpoints "
- "for unloaded shared library \"%s\""),
- solib->so_name);
- }
- disabled_shlib_breaks = 1;
- }
- }
+ {
+ /* ALL_BP_LOCATIONS bp_location has LOC->OWNER always non-NULL. */
+ struct breakpoint *b = loc->owner;
+
+ if (solib->pspace == loc->pspace
+ && !loc->shlib_disabled
+ && (((b->type == bp_breakpoint
+ || b->type == bp_jit_event
+ || b->type == bp_hardware_breakpoint)
+ && (loc->loc_type == bp_loc_hardware_breakpoint
+ || loc->loc_type == bp_loc_software_breakpoint))
+ || is_tracepoint (b))
+ && solib_contains_address_p (solib, loc->address))
+ {
+ loc->shlib_disabled = 1;
+ /* At this point, we cannot rely on remove_breakpoint
+ succeeding so we must mark the breakpoint as not inserted
+ to prevent future errors occurring in remove_breakpoints. */
+ loc->inserted = 0;
+
+ /* This may cause duplicate notifications for the same breakpoint. */
+ gdb::observers::breakpoint_modified.notify (b);
+
+ if (!disabled_shlib_breaks)
+ {
+ target_terminal::ours_for_output ();
+ warning (_("Temporarily disabling breakpoints "
+ "for unloaded shared library \"%s\""),
+ solib->so_name);
+ }
+ disabled_shlib_breaks = 1;
+ }
+ }
}
/* Disable any breakpoints and tracepoints in OBJFILE upon
return 1;
for (breakpoint *other : all_breakpoints ())
- {
- if (other == bl->owner)
- continue;
+ {
+ if (other == bl->owner)
+ continue;
- if (other->type != bp_shlib_event)
- continue;
+ if (other->type != bp_shlib_event)
+ continue;
- if (self->pspace != NULL && other->pspace != self->pspace)
- continue;
+ if (self->pspace != NULL && other->pspace != self->pspace)
+ continue;
- for (bp_location *other_bl : other->locations ())
- {
- if (other->ops->breakpoint_hit (other_bl, aspace, bp_addr, ws))
- return 1;
- }
- }
+ for (bp_location *other_bl : other->locations ())
+ {
+ if (other->ops->breakpoint_hit (other_bl, aspace, bp_addr, ws))
+ return 1;
+ }
+ }
return 0;
}
for (breakpoint *b : all_breakpoints ())
if (b->next == bpt)
- {
- b->next = bpt->next;
- break;
- }
+ {
+ b->next = bpt->next;
+ break;
+ }
/* Be sure no bpstat's are pointing at the breakpoint after it's
been freed. */
for (breakpoint *b : all_breakpoints ())
if (b->number == bptnum)
- {
- if (is_tracepoint (b))
- {
- if (from_tty && count != 0)
- printf_filtered (_("Ignore count ignored for tracepoint %d."),
- bptnum);
- return;
- }
-
- b->ignore_count = count;
- if (from_tty)
- {
- if (count == 0)
- printf_filtered (_("Will stop next time "
- "breakpoint %d is reached."),
- bptnum);
- else if (count == 1)
- printf_filtered (_("Will ignore next crossing of breakpoint %d."),
- bptnum);
- else
- printf_filtered (_("Will ignore next %d "
- "crossings of breakpoint %d."),
- count, bptnum);
- }
- gdb::observers::breakpoint_modified.notify (b);
- return;
- }
+ {
+ if (is_tracepoint (b))
+ {
+ if (from_tty && count != 0)
+ printf_filtered (_("Ignore count ignored for tracepoint %d."),
+ bptnum);
+ return;
+ }
+
+ b->ignore_count = count;
+ if (from_tty)
+ {
+ if (count == 0)
+ printf_filtered (_("Will stop next time "
+ "breakpoint %d is reached."),
+ bptnum);
+ else if (count == 1)
+ printf_filtered (_("Will ignore next crossing of breakpoint %d."),
+ bptnum);
+ else
+ printf_filtered (_("Will ignore next %d "
+ "crossings of breakpoint %d."),
+ count, bptnum);
+ }
+ gdb::observers::breakpoint_modified.notify (b);
+ return;
+ }
error (_("No breakpoint number %d."), bptnum);
}
error (_("Junk at end of arguments."));
for (breakpoint *b : all_tracepoints ())
- {
- t1 = (struct tracepoint *) b;
- trace_pass_set_count (t1, count, from_tty);
- }
+ {
+ t1 = (struct tracepoint *) b;
+ trace_pass_set_count (t1, count, from_tty);
+ }
}
else if (*args == '\0')
{
for (breakpoint *t : all_tracepoints ())
if (t->number == tpnum)
- {
return (struct tracepoint *) t;
- }
printf_unfiltered ("No tracepoint number %d.\n", tpnum);
return NULL;
/* See if we have anything to save. */
for (breakpoint *tp : all_breakpoints ())
- {
- /* Skip internal and momentary breakpoints. */
- if (!user_breakpoint_p (tp))
- continue;
+ {
+ /* Skip internal and momentary breakpoints. */
+ if (!user_breakpoint_p (tp))
+ continue;
- /* If we have a filter, only save the breakpoints it accepts. */
- if (filter && !filter (tp))
- continue;
+ /* If we have a filter, only save the breakpoints it accepts. */
+ if (filter && !filter (tp))
+ continue;
- any = 1;
+ any = 1;
- if (is_tracepoint (tp))
- {
- extra_trace_bits = 1;
+ if (is_tracepoint (tp))
+ {
+ extra_trace_bits = 1;
- /* We can stop searching. */
- break;
- }
- }
+ /* We can stop searching. */
+ break;
+ }
+ }
if (!any)
{
save_trace_state_variables (&fp);
for (breakpoint *tp : all_breakpoints ())
- {
- /* Skip internal and momentary breakpoints. */
- if (!user_breakpoint_p (tp))
- continue;
+ {
+ /* Skip internal and momentary breakpoints. */
+ if (!user_breakpoint_p (tp))
+ continue;
- /* If we have a filter, only save the breakpoints it accepts. */
- if (filter && !filter (tp))
- continue;
+ /* If we have a filter, only save the breakpoints it accepts. */
+ if (filter && !filter (tp))
+ continue;
- tp->ops->print_recreate (tp, &fp);
+ tp->ops->print_recreate (tp, &fp);
- /* Note, we can't rely on tp->number for anything, as we can't
- assume the recreated breakpoint numbers will match. Use $bpnum
- instead. */
+ /* Note, we can't rely on tp->number for anything, as we can't
+ assume the recreated breakpoint numbers will match. Use $bpnum
+ instead. */
- if (tp->cond_string)
- fp.printf (" condition $bpnum %s\n", tp->cond_string);
+ if (tp->cond_string)
+ fp.printf (" condition $bpnum %s\n", tp->cond_string);
- if (tp->ignore_count)
- fp.printf (" ignore $bpnum %d\n", tp->ignore_count);
+ if (tp->ignore_count)
+ fp.printf (" ignore $bpnum %d\n", tp->ignore_count);
- if (tp->type != bp_dprintf && tp->commands)
- {
- fp.puts (" commands\n");
-
- current_uiout->redirect (&fp);
- try
- {
- print_command_lines (current_uiout, tp->commands.get (), 2);
- }
- catch (const gdb_exception &ex)
- {
- current_uiout->redirect (NULL);
- throw;
- }
+ if (tp->type != bp_dprintf && tp->commands)
+ {
+ fp.puts (" commands\n");
- current_uiout->redirect (NULL);
- fp.puts (" end\n");
- }
+ current_uiout->redirect (&fp);
+ try
+ {
+ print_command_lines (current_uiout, tp->commands.get (), 2);
+ }
+ catch (const gdb_exception &ex)
+ {
+ current_uiout->redirect (NULL);
+ throw;
+ }
- if (tp->enable_state == bp_disabled)
- fp.puts ("disable $bpnum\n");
+ current_uiout->redirect (NULL);
+ fp.puts (" end\n");
+ }
- /* If this is a multi-location breakpoint, check if the locations
- should be individually disabled. Watchpoint locations are
- special, and not user visible. */
- if (!is_watchpoint (tp) && tp->loc && tp->loc->next)
- {
- int n = 1;
+ if (tp->enable_state == bp_disabled)
+ fp.puts ("disable $bpnum\n");
- for (bp_location *loc : tp->locations ())
- {
- if (!loc->enabled)
- fp.printf ("disable $bpnum.%d\n", n);
+ /* If this is a multi-location breakpoint, check if the locations
+ should be individually disabled. Watchpoint locations are
+ special, and not user visible. */
+ if (!is_watchpoint (tp) && tp->loc && tp->loc->next)
+ {
+ int n = 1;
- n++;
- }
- }
- }
+ for (bp_location *loc : tp->locations ())
+ {
+ if (!loc->enabled)
+ fp.printf ("disable $bpnum.%d\n", n);
+
+ n++;
+ }
+ }
+ }
if (extra_trace_bits && *default_collect)
fp.printf ("set default-collect %s\n", default_collect);
case CTF_K_UNION:
case CTF_K_ENUM:
if (type == nullptr)
- {
- complaint (_("ctf_add_var_cb: %s has NO type (%ld)"), name, id);
- type = objfile_type (ccp->of)->builtin_error;
- }
+ {
+ complaint (_("ctf_add_var_cb: %s has NO type (%ld)"), name, id);
+ type = objfile_type (ccp->of)->builtin_error;
+ }
sym = new (&ccp->of->objfile_obstack) symbol;
OBJSTAT (ccp->of, n_syms++);
SYMBOL_TYPE (sym) = type;
return (sum_ranks (rank_one_type (TYPE_TARGET_TYPE (parm), arg, NULL),
REFERENCE_SEE_THROUGH_BADNESS));
if (overload_debug)
- /* Debugging only. */
- fprintf_filtered (gdb_stderr,
- "------ Arg is %s [%d], parm is %s [%d]\n",
- arg->name (), arg->code (),
- parm->name (), parm->code ());
+ {
+ /* Debugging only. */
+ fprintf_filtered (gdb_stderr,
+ "------ Arg is %s [%d], parm is %s [%d]\n",
+ arg->name (), arg->code (),
+ parm->name (), parm->code ());
+ }
/* x -> y means arg of type x being supplied for parameter of type y. */
resume_is_step = step;
if (siggnal != GDB_SIGNAL_0 && siggnal != GDB_SIGNAL_TRAP)
- {
- for (i = 0, resume_signal = -1;
- excepn_map[i].gdb_sig != GDB_SIGNAL_LAST; i++)
- if (excepn_map[i].gdb_sig == siggnal)
- {
- resume_signal = excepn_map[i].djgpp_excepno;
- break;
- }
- if (resume_signal == -1)
- printf_unfiltered ("Cannot deliver signal %s on this platform.\n",
- gdb_signal_to_name (siggnal));
- }
+ {
+ for (i = 0, resume_signal = -1;
+ excepn_map[i].gdb_sig != GDB_SIGNAL_LAST; i++)
+ if (excepn_map[i].gdb_sig == siggnal)
+ {
+ resume_signal = excepn_map[i].djgpp_excepno;
+ break;
+ }
+ if (resume_signal == -1)
+ printf_unfiltered ("Cannot deliver signal %s on this platform.\n",
+ gdb_signal_to_name (siggnal));
+ }
}
static char child_cwd[FILENAME_MAX];
newmode &= ~0x20;
if (oldmode & 0x80) /* Only for character dev. */
- {
- regs.x.ax = 0x4401;
- regs.x.bx = fd;
- regs.x.dx = newmode & 0xff; /* Force upper byte zero, else it fails. */
- __dpmi_int (0x21, ®s);
- if (regs.x.flags & 1)
- return -1;
- }
+ {
+ regs.x.ax = 0x4401;
+ regs.x.bx = fd;
+ regs.x.dx = newmode & 0xff; /* Force upper byte zero, else it fails. */
+ __dpmi_int (0x21, ®s);
+ if (regs.x.flags & 1)
+ return -1;
+ }
return (oldmode & 0x20) == 0x20;
}
#if __DJGPP_MINOR__ > 2
if (child_cmd.redirection)
- {
- int i;
-
- for (i = 0; i < DBG_HANDLES; i++)
{
- if (child_cmd.redirection[i]->file_name)
- printf_unfiltered ("\tFile handle %d is redirected to `%s'.\n",
- i, child_cmd.redirection[i]->file_name);
- else if (_get_dev_info (child_cmd.redirection[i]->inf_handle) == -1)
- printf_unfiltered
- ("\tFile handle %d appears to be closed by inferior.\n", i);
- /* Mask off the raw/cooked bit when comparing device info words. */
- else if ((_get_dev_info (child_cmd.redirection[i]->inf_handle) & 0xdf)
- != (_get_dev_info (i) & 0xdf))
- printf_unfiltered
- ("\tFile handle %d appears to be redirected by inferior.\n", i);
+ int i;
+
+ for (i = 0; i < DBG_HANDLES; i++)
+ {
+ if (child_cmd.redirection[i]->file_name)
+ printf_unfiltered ("\tFile handle %d is redirected to `%s'.\n",
+ i, child_cmd.redirection[i]->file_name);
+ else if (_get_dev_info (child_cmd.redirection[i]->inf_handle) == -1)
+ printf_unfiltered
+ ("\tFile handle %d appears to be closed by inferior.\n", i);
+ /* Mask off the raw/cooked bit when comparing device info words. */
+ else if ((_get_dev_info (child_cmd.redirection[i]->inf_handle) & 0xdf)
+ != (_get_dev_info (i) & 0xdf))
+ printf_unfiltered
+ ("\tFile handle %d appears to be redirected by inferior.\n", i);
+ }
}
- }
#endif
}
/* Redirect standard handles as child wants them. */
errno = 0;
if (redir_to_child (&child_cmd) == -1)
- {
- redir_to_debugger (&child_cmd);
- error (_("Cannot redirect standard handles for program: %s."),
- safe_strerror (errno));
- }
+ {
+ redir_to_debugger (&child_cmd);
+ error (_("Cannot redirect standard handles for program: %s."),
+ safe_strerror (errno));
+ }
/* Set the console device of the inferior to whatever mode
(raw or cooked) we found it last time. */
if (terminal_is_ours)
- {
- if (inf_mode_valid)
- device_mode (0, inf_terminal_mode);
- terminal_is_ours = 0;
- }
+ {
+ if (inf_mode_valid)
+ device_mode (0, inf_terminal_mode);
+ terminal_is_ours = 0;
+ }
}
void
/* Switch to cooked mode on the gdb terminal and save the inferior
terminal mode to be restored when it is resumed. */
if (!terminal_is_ours)
- {
- inf_terminal_mode = device_mode (0, 0);
- if (inf_terminal_mode != -1)
- inf_mode_valid = 1;
- else
- /* If device_mode returned -1, we don't know what happens with
- handle 0 anymore, so make the info invalid. */
- inf_mode_valid = 0;
- terminal_is_ours = 1;
-
- /* Restore debugger's standard handles. */
- errno = 0;
- if (redir_to_debugger (&child_cmd) == -1)
{
- redir_to_child (&child_cmd);
- error (_("Cannot redirect standard handles for debugger: %s."),
- safe_strerror (errno));
+ inf_terminal_mode = device_mode (0, 0);
+ if (inf_terminal_mode != -1)
+ inf_mode_valid = 1;
+ else
+ /* If device_mode returned -1, we don't know what happens with
+ handle 0 anymore, so make the info invalid. */
+ inf_mode_valid = 0;
+ terminal_is_ours = 1;
+
+ /* Restore debugger's standard handles. */
+ errno = 0;
+ if (redir_to_debugger (&child_cmd) == -1)
+ {
+ redir_to_child (&child_cmd);
+ error (_("Cannot redirect standard handles for debugger: %s."),
+ safe_strerror (errno));
+ }
}
- }
}
void
2. Arrays. Always print a ",".
3. Other. Always print a ",". */
if (i == 0)
- {
- if (!printed_nothing)
- fputs_filtered (" = ", stream);
- }
+ {
+ if (!printed_nothing)
+ fputs_filtered (" = ", stream);
+ }
else if (! is_map || i % 2 == 0)
fputs_filtered (pretty ? "," : ", ", stream);
sp = pc - pcoffs[attempt];
}
else
- {
return 0;
- }
}
/* sp + sfoffs[try] points to a struct rt_sigframe, which contains
else if (I386_SAVE_FPU_ENV_REG_STACK == iregnum)
{
for (i = I387_ST0_REGNUM (tdep); i <= I387_FOP_REGNUM (tdep); i++)
- {
if (record_full_arch_list_add_reg (ir->regcache, i))
return -1;
- }
}
else if ((iregnum >= I387_ST0_REGNUM (tdep)) &&
(iregnum <= I387_FOP_REGNUM (tdep)))
ui_out_emit_list list_emitter (uiout, "lines");
if (SYMTAB_LINETABLE (s) != NULL && SYMTAB_LINETABLE (s)->nitems > 0)
for (i = 0; i < SYMTAB_LINETABLE (s)->nitems; i++)
- {
- ui_out_emit_tuple tuple_emitter (uiout, NULL);
- uiout->field_core_addr ("pc", gdbarch, SYMTAB_LINETABLE (s)->item[i].pc);
- uiout->field_signed ("line", SYMTAB_LINETABLE (s)->item[i].line);
- }
+ {
+ ui_out_emit_tuple tuple_emitter (uiout, NULL);
+ uiout->field_core_addr ("pc", gdbarch, SYMTAB_LINETABLE (s)->item[i].pc);
+ uiout->field_signed ("line", SYMTAB_LINETABLE (s)->item[i].line);
+ }
}
/* Used by the -symbol-info-* and -symbol-info-module-* commands to print
inferior function call, and the VG register comes after the Z
registers. */
if (reg_buf->get_register_status (AARCH64_SVE_VG_REGNUM) != REG_VALID)
- {
- /* If vg is not available yet, fetch it from ptrace. The VG value from
- ptrace is likely the correct one. */
- uint64_t vq = aarch64_sve_get_vq (tid);
+ {
+ /* If vg is not available yet, fetch it from ptrace. The VG value from
+ ptrace is likely the correct one. */
+ uint64_t vq = aarch64_sve_get_vq (tid);
- /* If something went wrong, just bail out. */
- if (vq == 0)
- return false;
+ /* If something went wrong, just bail out. */
+ if (vq == 0)
+ return false;
- reg_vg = sve_vg_from_vq (vq);
- }
+ reg_vg = sve_vg_from_vq (vq);
+ }
else
reg_buf->raw_collect (AARCH64_SVE_VG_REGNUM, ®_vg);
int i;
for (i = 0; i < NIOS2_NUM_REGS; i++)
- {
- /* All registers start off holding their previous values. */
- cache->reg_value[i].reg = i;
- cache->reg_value[i].offset = 0;
-
- /* All registers start off not saved. */
- cache->reg_saved[i].basereg = -1;
- cache->reg_saved[i].addr = 0;
- }
+ {
+ /* All registers start off holding their previous values. */
+ cache->reg_value[i].reg = i;
+ cache->reg_value[i].offset = 0;
+
+ /* All registers start off not saved. */
+ cache->reg_saved[i].basereg = -1;
+ cache->reg_saved[i].addr = 0;
+ }
}
/* Initialize the unwind cache. */
enum branch_condition cond;
if (pc == current_pc)
- {
- /* When we reach the current PC we must save the current
- register state (for the backtrace) but keep analysing
- because there might be more to find out (eg. is this an
- exception handler). */
- memcpy (temp_value, value, sizeof (temp_value));
- value = temp_value;
- if (nios2_debug)
- fprintf_unfiltered (gdb_stdlog, "*");
- }
+ {
+ /* When we reach the current PC we must save the current
+ register state (for the backtrace) but keep analysing
+ because there might be more to find out (eg. is this an
+ exception handler). */
+ memcpy (temp_value, value, sizeof (temp_value));
+ value = temp_value;
+ if (nios2_debug)
+ fprintf_unfiltered (gdb_stdlog, "*");
+ }
op = nios2_fetch_insn (gdbarch, pc, &insn);
/* 32-bit decimal floats are right aligned in the
doubleword. */
if (TYPE_LENGTH (type) == 4)
- {
- memcpy (regval + 4, val, 4);
- p = regval;
- }
+ {
+ memcpy (regval + 4, val, 4);
+ p = regval;
+ }
else
p = val;
get_user_print_options (&opts);
if (print_frame_info)
- {
- gdb::optional<enum print_what> user_frame_info_print_what;
-
- get_user_print_what_frame_info (&user_frame_info_print_what);
- if (!out->is_mi_like_p () && user_frame_info_print_what.has_value ())
- {
- /* Use the specific frame information desired by the user. */
- print_what = *user_frame_info_print_what;
- }
- }
+ {
+ gdb::optional<enum print_what> user_frame_info_print_what;
+
+ get_user_print_what_frame_info (&user_frame_info_print_what);
+ if (!out->is_mi_like_p () && user_frame_info_print_what.has_value ())
+ {
+ /* Use the specific frame information desired by the user. */
+ print_what = *user_frame_info_print_what;
+ }
+ }
/* Get the underlying frame. This is needed to determine GDB
architecture, and also, in the cases of frame variables/arguments to
2. Arrays. Always print a ",".
3. Other. Always print a ",". */
if (i == 0)
- {
- if (!is_py_none)
- fputs_filtered (" = ", stream);
- }
+ {
+ if (!is_py_none)
+ fputs_filtered (" = ", stream);
+ }
else if (! is_map || i % 2 == 0)
fputs_filtered (pretty ? "," : ", ", stream);
else if ((insn & BP_MASK) == BP_INSN)
regcache_cooked_write_unsigned (regs, gdbarch_pc_regnum (gdbarch), from);
else
- /* Handle any other instructions that do not fit in the categories above. */
- regcache_cooked_write_unsigned (regs, gdbarch_pc_regnum (gdbarch),
- from + offset);
+ {
+ /* Handle any other instructions that do not fit in the categories
+ above. */
+ regcache_cooked_write_unsigned (regs, gdbarch_pc_regnum (gdbarch),
+ from + offset);
+ }
}
/* Implementation of gdbarch_displaced_step_prepare. */
cause GDB to crash with an internal error when the user tries to set
an unsupported OSABI. */
if (!tdesc_has_registers (tdesc))
- {
- if (info.bfd_arch_info->mach == bfd_mach_s390_31)
- tdesc = tdesc_s390_linux32;
- else
- tdesc = tdesc_s390x_linux64;
- }
+ {
+ if (info.bfd_arch_info->mach == bfd_mach_s390_31)
+ tdesc = tdesc_s390_linux32;
+ else
+ tdesc = tdesc_s390x_linux64;
+ }
tdep->tdesc = tdesc;
/* Check any target description for validity. */
std::string flags = gdbarch_get_pc_address_flags (gdbarch, frame, pc);
if (!flags.empty ())
- {
- uiout->text (" [");
- uiout->field_string ("addr_flags", flags);
- uiout->text ("]");
- }
+ {
+ uiout->text (" [");
+ uiout->field_string ("addr_flags", flags);
+ uiout->text ("]");
+ }
}
/* See stack.h. */
struct frame_info *fid;
if (args == NULL)
- error (_("Missing address argument to view a frame"));
+ error (_("Missing address argument to view a frame"));
gdb_argv argv (args);
if (mode == complete_symbol_mode::LINESPEC)
sym_text = text;
else
- {
- const char *p;
- char quote_found;
- const char *quote_pos = NULL;
+ {
+ const char *p;
+ char quote_found;
+ const char *quote_pos = NULL;
- /* First see if this is a quoted string. */
- quote_found = '\0';
- for (p = text; *p != '\0'; ++p)
- {
- if (quote_found != '\0')
- {
- if (*p == quote_found)
- /* Found close quote. */
- quote_found = '\0';
- else if (*p == '\\' && p[1] == quote_found)
- /* A backslash followed by the quote character
- doesn't end the string. */
- ++p;
- }
- else if (*p == '\'' || *p == '"')
- {
- quote_found = *p;
- quote_pos = p;
- }
- }
- if (quote_found == '\'')
- /* A string within single quotes can be a symbol, so complete on it. */
- sym_text = quote_pos + 1;
- else if (quote_found == '"')
- /* A double-quoted string is never a symbol, nor does it make sense
- to complete it any other way. */
- {
- return;
- }
- else
- {
- /* It is not a quoted string. Break it based on the characters
- which are in symbols. */
- while (p > text)
- {
- if (isalnum (p[-1]) || p[-1] == '_' || p[-1] == '\0'
- || p[-1] == ':' || strchr (break_on, p[-1]) != NULL)
- --p;
- else
- break;
- }
- sym_text = p;
- }
- }
+ /* First see if this is a quoted string. */
+ quote_found = '\0';
+ for (p = text; *p != '\0'; ++p)
+ {
+ if (quote_found != '\0')
+ {
+ if (*p == quote_found)
+ /* Found close quote. */
+ quote_found = '\0';
+ else if (*p == '\\' && p[1] == quote_found)
+ /* A backslash followed by the quote character
+ doesn't end the string. */
+ ++p;
+ }
+ else if (*p == '\'' || *p == '"')
+ {
+ quote_found = *p;
+ quote_pos = p;
+ }
+ }
+ if (quote_found == '\'')
+ /* A string within single quotes can be a symbol, so complete on it. */
+ sym_text = quote_pos + 1;
+ else if (quote_found == '"')
+ /* A double-quoted string is never a symbol, nor does it make sense
+ to complete it any other way. */
+ {
+ return;
+ }
+ else
+ {
+ /* It is not a quoted string. Break it based on the characters
+ which are in symbols. */
+ while (p > text)
+ {
+ if (isalnum (p[-1]) || p[-1] == '_' || p[-1] == '\0'
+ || p[-1] == ':' || strchr (break_on, p[-1]) != NULL)
+ --p;
+ else
+ break;
+ }
+ sym_text = p;
+ }
+ }
lookup_name_info lookup_name (sym_text, name_match_type, true);
if (mode == complete_symbol_mode::LINESPEC)
sym_text = text;
else
- {
- const char *p;
- char quote_found;
- const char *quote_pos = NULL;
+ {
+ const char *p;
+ char quote_found;
+ const char *quote_pos = NULL;
- /* First see if this is a quoted string. */
- quote_found = '\0';
- for (p = text; *p != '\0'; ++p)
- {
- if (quote_found != '\0')
- {
- if (*p == quote_found)
- /* Found close quote. */
- quote_found = '\0';
- else if (*p == '\\' && p[1] == quote_found)
- /* A backslash followed by the quote character
- doesn't end the string. */
- ++p;
- }
- else if (*p == '\'' || *p == '"')
- {
- quote_found = *p;
- quote_pos = p;
- }
- }
- if (quote_found == '\'')
- /* A string within single quotes can be a symbol, so complete on it. */
- sym_text = quote_pos + 1;
- else if (quote_found == '"')
- /* A double-quoted string is never a symbol, nor does it make sense
- to complete it any other way. */
- {
- return;
- }
- else
- {
- /* Not a quoted string. */
- sym_text = language_search_unquoted_string (text, p);
- }
- }
+ /* First see if this is a quoted string. */
+ quote_found = '\0';
+ for (p = text; *p != '\0'; ++p)
+ {
+ if (quote_found != '\0')
+ {
+ if (*p == quote_found)
+ /* Found close quote. */
+ quote_found = '\0';
+ else if (*p == '\\' && p[1] == quote_found)
+ /* A backslash followed by the quote character
+ doesn't end the string. */
+ ++p;
+ }
+ else if (*p == '\'' || *p == '"')
+ {
+ quote_found = *p;
+ quote_pos = p;
+ }
+ }
+ if (quote_found == '\'')
+ /* A string within single quotes can be a symbol, so complete on it. */
+ sym_text = quote_pos + 1;
+ else if (quote_found == '"')
+ /* A double-quoted string is never a symbol, nor does it make sense
+ to complete it any other way. */
+ {
+ return;
+ }
+ else
+ {
+ /* Not a quoted string. */
+ sym_text = language_search_unquoted_string (text, p);
+ }
+ }
lookup_name_info lookup_name (sym_text, name_match_type, true);
/* Convert between two different formats in the same category. */
if (!target_float_same_format_p (from_type, to_type))
- {
- const target_float_ops *ops = get_target_float_ops (from_type, to_type);
- ops->convert (from, from_type, to, to_type);
- return;
- }
+ {
+ const target_float_ops *ops = get_target_float_ops (from_type, to_type);
+ ops->convert (from, from_type, to, to_type);
+ return;
+ }
/* The floating-point formats match, so we simply copy the data, ensuring
possible padding bytes in the target buffer are zeroed out. */
{ /* TFIND with no args means find NEXT trace frame. */
if (traceframe_number == -1)
frameno = 0; /* "next" is first one. */
- else
+ else
frameno = traceframe_number + 1;
}
else if (0 == strcmp (args, "-"))
}
}
else
- /* Is there any case in which we get here, and have an address
- which the user would want to see? If we have debugging
- symbols and no line numbers? */
- error (_("Line number %d is out of range for \"%s\"."),
- sal.line, symtab_to_filename_for_display (sal.symtab));
+ {
+ /* Is there any case in which we get here, and have an address
+ which the user would want to see? If we have debugging
+ symbols and no line numbers? */
+ error (_("Line number %d is out of range for \"%s\"."),
+ sal.line, symtab_to_filename_for_display (sal.symtab));
+ }
/* Find within range of stated line. */
if (args && *args)
if (gdbarch_tdep (gdbarch)->abi == V850_ABI_RH850)
stack_offset = 0;
else
- /* The offset onto the stack at which we will start copying parameters
- (after the registers are used up) begins at 16 rather than at zero.
- That's how the ABI is defined, though there's no indication that these
- 16 bytes are used for anything, not even for saving incoming
- argument registers. */
- stack_offset = 16;
+ {
+ /* The offset onto the stack at which we will start copying parameters
+ (after the registers are used up) begins at 16 rather than at zero.
+ That's how the ABI is defined, though there's no indication that these
+ 16 bytes are used for anything, not even for saving incoming
+ argument registers. */
+ stack_offset = 16;
+ }
/* Now make space on the stack for the args. */
for (argnum = 0; argnum < nargs; argnum++)
type->set_is_unsigned (true);
for (i = 0; i < count; i++)
- {
- TYPE_FIELD_NAME (type, i) = values[i].name;
- SET_FIELD_ENUMVAL (type->field (i), values[i].value);
- }
+ {
+ TYPE_FIELD_NAME (type, i) = values[i].name;
+ SET_FIELD_ENUMVAL (type->field (i), values[i].value);
+ }
return type;
}
newline = 0;
if (oldLineTb->item[0].line != 0)
for (newline = 0;
- newline < oldLineTb->nitems && oldLineTb->item[newline].line; ++newline)
+ newline < oldLineTb->nitems && oldLineTb->item[newline].line;
+ ++newline)
newLineTb->item[newline] = oldLineTb->item[newline];
/* Now copy function lines one by one. */
to 32(0x20). So we need to read the first function auxiliary entry
which contains the size. */
if (cs->c_naux > 1 && ISFCN (cs->c_type))
- {
- /* a function entry point. */
+ {
+ /* a function entry point. */
- fcn_start_addr = cs->c_value;
+ fcn_start_addr = cs->c_value;
- /* save the function header info, which will be used
- when `.bf' is seen. */
- fcn_cs_saved = *cs;
+ /* save the function header info, which will be used
+ when `.bf' is seen. */
+ fcn_cs_saved = *cs;
- /* Convert the auxent to something we can access. */
- bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
- 0, cs->c_naux, &fcn_aux_saved);
- continue;
- }
+ /* Convert the auxent to something we can access. */
+ bfd_coff_swap_aux_in (abfd, raw_auxptr, cs->c_type, cs->c_sclass,
+ 0, cs->c_naux, &fcn_aux_saved);
+ continue;
+ }
/* Read the csect auxiliary header, which is always the last by
convention. */
bfd_coff_swap_aux_in (abfd,
+2021-05-27 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * Fix some indentation mistakes throughout.
+
2021-05-17 Andrew Burgess <andrew.burgess@embecosm.com>
* .dir-locals.el: Set sentence-end-double-space for all modes, and
0x98, 0x23, 0x10, 0x00, /* lm %r2, %r3, 0(%r1) */
};
if (num < 0x8000 && num >= 0)
- {
add_insns (buf_s, sizeof buf_s);
- }
else
- {
- s390_emit_litpool (8);
- add_insns ((unsigned char *) &n, sizeof n);
- add_insns (buf_l, sizeof buf_l);
- }
+ {
+ s390_emit_litpool (8);
+ add_insns ((unsigned char *) &n, sizeof n);
+ add_insns (buf_l, sizeof buf_l);
+ }
}
/* The "emit_call" emit_ops method for s390. */
0x58, 0x20, 0x10, 0x00, /* l %r2, 0(%r1) */
};
if (arg1 < 0x8000 && arg1 >= -0x8000)
- {
add_insns (buf_s, sizeof buf_s);
- }
else
- {
- s390_emit_litpool (4);
- add_insns ((unsigned char *) &arg1, sizeof arg1);
- add_insns (buf_l, sizeof buf_l);
- }
+ {
+ s390_emit_litpool (4);
+ add_insns ((unsigned char *) &arg1, sizeof arg1);
+ add_insns (buf_l, sizeof buf_l);
+ }
}
/* The "emit_int_call_1" emit_ops method for s390. */
0xe3, 0x20, 0x10, 0x00, 0x00, 0x04, /* lg %r2, 0(%r1) */
};
if (num < 0x8000 && num >= -0x8000)
- {
add_insns (buf_s, sizeof buf_s);
- }
else
- {
- s390_emit_litpool (8);
- add_insns ((unsigned char *) &n, sizeof n);
- add_insns (buf_l, sizeof buf_l);
- }
+ {
+ s390_emit_litpool (8);
+ add_insns ((unsigned char *) &n, sizeof n);
+ add_insns (buf_l, sizeof buf_l);
+ }
}
/* The "emit_call" emit_ops method for s390x. */