+2018-10-04 Tom Tromey <tom@tromey.com>
+
+ * ctf.c (SET_ARRAY_FIELD): Rename "u32".
+ * p-valprint.c (pascal_val_print): Split inner "i" variable.
+ * xtensa-tdep.c (xtensa_push_dummy_call): Declare "i" in loop
+ header.
+ * xstormy16-tdep.c (xstormy16_push_dummy_call): Declare "val" in
+ more inner scope.
+ * xcoffread.c (read_xcoff_symtab): Rename inner "symbol".
+ * varobj.c (varobj_update): Rename inner "newobj",
+ "type_changed".
+ * valprint.c (generic_emit_char): Rename inner "buf".
+ * valops.c (find_overload_match): Rename inner "temp".
+ (value_struct_elt_for_reference): Declare "v" in more inner
+ scope.
+ * v850-tdep.c (v850_push_dummy_call): Rename "len".
+ * unittests/array-view-selftests.c (run_tests): Rename inner
+ "vec".
+ * tui/tui-stack.c (tui_show_frame_info): Declare "i" in loop
+ header.
+ * tracepoint.c (merge_uploaded_trace_state_variables): Declare
+ "tsv" in more inner scope.
+ (print_one_static_tracepoint_marker): Rename inner
+ "tuple_emitter".
+ * tic6x-tdep.c (tic6x_analyze_prologue): Declare "inst" lower.
+ (tic6x_push_dummy_call): Don't redeclare "addr".
+ * target-float.c: Declare "dto" lower.
+ * symtab.c (lookup_local_symbol): Rename inner "sym".
+ (find_pc_sect_line): Rename inner "pc".
+ * stack.c (print_frame): Don't redeclare "gdbarch".
+ (return_command): Rename inner "gdbarch".
+ * s390-tdep.c (s390_prologue_frame_unwind_cache): Renam inner
+ "sp".
+ * rust-lang.c (rust_internal_print_type): Declare "i" in loop
+ header.
+ * rs6000-tdep.c (ppc_process_record): Rename inner "addr".
+ * riscv-tdep.c (riscv_push_dummy_call): Declare "info" in inner
+ scope.
+ * remote.c (remote_target::update_thread_list): Don't redeclare
+ "tp".
+ (remote_target::process_initial_stop_replies): Rename inner
+ "thread".
+ (remote_target::remote_parse_stop_reply): Don't redeclare "p".
+ (remote_target::wait_as): Don't redeclare "stop_reply".
+ (remote_target::get_thread_local_address): Rename inner
+ "result".
+ (remote_target::get_tib_address): Likewise.
+
+ * regcache.c (cooked_read_test): Rename "regnum".
+ * record-btrace.c (cmd_record_btrace_start): Rename inner
+ "exception".
+ * ppc-sysv-tdep.c (ppc64_sysv_abi_return_value): Declare "i" in
+ loop header.
+ * ppc-linux-tdep.c (ppc_linux_syscall_record): Declare "i" in loop
+ header.
+ (ppu2spu_sniffer): Rename inner "buf".
+ * parse.c (operator_check_standard): Rename inner "type",
+ "objfile".
+ * p-valprint.c (pascal_val_print): Introduce new scope for
+ "low_bound", "high_bound".
+ * p-exp.y (yylex): Declare "i" in loop header.
+ * objfiles.c (objfile_relocate1): Declare "i" in loop header.
+ Lower declaration of "s".
+ * nios2-tdep.c (nios2_analyze_prologue): Declare "i" in loop
+ header.
+ (nios2_push_dummy_call): Rename "len".
+ * nat/linux-osdata.c (linux_xfer_osdata_cpus): Rename static
+ "buf".
+ (linux_xfer_osdata_fds, linux_xfer_osdata_shm)
+ (linux_xfer_osdata_sem, linux_xfer_osdata_msg)
+ (linux_xfer_osdata_modules): Likewise.
+ * mips-tdep.c (mips_eabi_push_dummy_call): Rename outer "len".
+ (mips_n32n64_push_dummy_call, mips_o32_push_dummy_call)
+ (mips_o64_push_dummy_call): Likewise.
+ * microblaze-tdep.c (microblaze_analyze_prologue): Rename inner
+ "op".
+ * mi/mi-main.c (list_available_thread_groups): Rename inner
+ "tuple_emitter".
+ (mi_cmd_data_read_memory): Rename inner "opts".
+ * mi/mi-cmd-var.c (varobj_update_one): Rename inner
+ "tuple_emitter".
+ * mep-tdep.c (mep_analyze_prologue): Declare "rn" in loop header.
+ * mdebugread.c (parse_symbol): Rename inner "b". Declare "f" in
+ more inner scope.
+ (parse_partial_symbols): Rename inner "pst", "p", "name"
+ * main.c (captured_main_1): Rename inner "i"s.
+ * machoread.c (macho_symfile_read_all_oso): Don't redeclare
+ "oso2".
+ * linux-tdep.c (linux_info_proc): Rename inner "filename".
+ * linespec.c (linespec_lexer_lex_string): Rename inner "p".
+ * infrun.c (handle_no_resumed): Don't redeclare "thread".
+ (handle_signal_stop): Rename inner "gdbarch".
+ (handle_command): Declare "signum" in loop header.
+ * ia64-tdep.c (ia64_pseudo_register_read): Don't redeclare
+ "status".
+ (examine_prologue): Rename inner "sol" and "sof".
+ (ia64_extract_return_value): Rename inner "val". Declare another
+ "val" in a more inner scope.
+ * hppa-bsd-tdep.c (hppabsd_find_global_pointer): Declare "buf" in
+ inner scope.
+ * guile/scm-symbol.c (gdbscm_lookup_symbol): Rename inner
+ "except".
+ * findvar.c (default_read_var_value): Don't redeclare "addr".
+ * f-exp.y (yylex): Declare "i" in loop header.
+ * eval.c (evaluate_subexp_standard): Don't redeclare "type".
+ Rename inner "type", "expect_type".
+ (evaluate_subexp_for_sizeof): Rename inner "pc".
+ * elfread.c (elf_symfile_read): Rename inner "abfd".
+ * dwarf2read.c (read_debug_names_from_section): Don't redeclare
+ "bytes_read".
+ (process_psymtab_comp_unit_reader): Don't redeclare "gdbarch".
+ (add_partial_subprogram): Rename inner "lowpc" and "highpc".
+ (dwarf_decode_line_header): Rename inner "lh".
+ * dwarf2loc.c (dwarf2_compile_expr_to_ax): Don't redeclare
+ "offset". Declare "i" in loop header.
+ (disassemble_dwarf_expression): Rename inner "addr_size".
+ * dwarf2expr.c (dwarf_expr_context::execute_stack_op): Rename
+ inner "result".
+ (dwarf_expr_context::execute_stack_op): Rename inner "offset".
+ * dwarf2-frame.c (decode_frame_entry_1): Rename inner "length"s.
+ * disasm.c (do_mixed_source_and_assembly_deprecated): Rename inner
+ "inner_list_emitter".
+ (do_mixed_source_and_assembly): Rename inner "tuple_emitter".
+ * disasm-selftests.c (print_one_insn_test): Wrap "bplen"
+ declaration in a block.
+ * csky-tdep.c (csky_analyze_prologue): Declare "offset" lower.
+ * cp-valprint.c (cp_print_value_fields): Don't redeclare
+ "obstack_final_size".
+ * cp-support.c (inspect_type): Declare "i" in loop header.
+ * compile/compile.c (compile_instance::insert_symbol_error):
+ Rename inner "e".
+ * common/agent.c (agent_run_command): Remove inner "ret"
+ declaration.
+ * coffread.c (coff_symfile_read): Rename inner "name".
+ (coff_symfile_read): Rename inner "abfd".
+ * cli/cli-utils.c (get_number_trailer): Rename inner "val".
+ * cli/cli-cmds.c (print_disassembly): Rename inner "low" and
+ "high".
+ * c-exp.y (lex_one_token): Move "len" declaration lower.
+ * breakpoint.c (create_longjmp_master_breakpoint): Don't redeclare
+ "gdbarch".
+ (create_exception_master_breakpoint): Likewise. Don't redeclare
+ "b".
+ (watch_command_1): Declare "mark" later.
+ (clear_command): Don't shadow "a" or "b".
+ (delete_command): Rename inner "b".
+ (delete_trace_command): Likewise.
+ * arm-tdep.c (thumb_process_displaced_32bit_insn): Rename inner
+ "op".
+ (arm_gdbarch_init): Remove inner "e_flags".
+ * arch/arm-get-next-pcs.c (thumb_get_next_pcs_raw): Declare
+ "offset" in inner blocks.
+
2018-10-04 Simon Marchi <simon.marchi@ericsson.com>
* dwarf-index-write.c (file_write): Don't write if the vector is
unsigned long pc_val = ((unsigned long) pc) + 4; /* PC after prefetch */
unsigned short inst1;
CORE_ADDR nextpc = pc + 2; /* Default is next instruction. */
- unsigned long offset;
ULONGEST status, itstate;
struct regcache *regcache = self->regcache;
std::vector<CORE_ADDR> next_pcs;
/* Fetch the saved PC from the stack. It's stored above
all of the other registers. */
- offset = bitcount (bits (inst1, 0, 7)) * INT_REGISTER_SIZE;
+ unsigned long offset = bitcount (bits (inst1, 0, 7)) * INT_REGISTER_SIZE;
sp = regcache_raw_get_unsigned (regcache, ARM_SP_REGNUM);
nextpc = self->ops->read_mem_uint (sp + offset, 4, byte_order);
}
j1 = bit (inst2, 13);
j2 = bit (inst2, 11);
- offset = ((imm1 << 12) + (imm2 << 1));
+ unsigned long offset = ((imm1 << 12) + (imm2 << 1));
offset ^= ((!j2) << 22) | ((!j1) << 23);
nextpc = pc_val + offset;
j1 = bit (inst2, 13);
j2 = bit (inst2, 11);
- offset = (sign << 20) + (j2 << 19) + (j1 << 18);
+ unsigned long offset
+ = (sign << 20) + (j2 << 19) + (j1 << 18);
offset += (imm1 << 12) + (imm2 << 1);
nextpc = pc_val + offset;
{
if (bit (insn1, 9)) /* Data processing (plain binary imm). */
{
- int op = bits (insn1, 4, 8);
+ int dp_op = bits (insn1, 4, 8);
int rn = bits (insn1, 0, 3);
- if ((op == 0 || op == 0xa) && rn == 0xf)
+ if ((dp_op == 0 || dp_op == 0xa) && rn == 0xf)
err = thumb_copy_pc_relative_32bit (gdbarch, insn1, insn2,
regs, dsc);
else
if (fp_model == ARM_FLOAT_AUTO)
{
- int e_flags = elf_elfheader (info.abfd)->e_flags;
-
switch (e_flags & (EF_ARM_SOFT_FLOAT | EF_ARM_VFP_FLOAT))
{
case 0:
if (!bp_objfile_data->longjmp_probes.empty ())
{
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
-
for (probe *p : bp_objfile_data->longjmp_probes)
{
struct breakpoint *b;
if (!bp_objfile_data->exception_probes.empty ())
{
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
+ gdbarch = get_objfile_arch (objfile);
for (probe *p : bp_objfile_data->exception_probes)
{
- struct breakpoint *b;
-
b = create_internal_breakpoint (gdbarch,
p->get_relocated_address (objfile),
bp_exception_master,
{
struct breakpoint *scope_breakpoint = NULL;
const struct block *exp_valid_block = NULL, *cond_exp_valid_block = NULL;
- struct value *mark, *result;
+ struct value *result;
int saved_bitpos = 0, saved_bitsize = 0;
const char *exp_start = NULL;
const char *exp_end = NULL;
}
exp_valid_block = innermost_block.block ();
- mark = value_mark ();
+ struct value *mark = value_mark ();
struct value *val_as_value = nullptr;
fetch_subexp_value (exp.get (), &pc, &val_as_value, &result, NULL,
just_location);
/* Remove duplicates from the vec. */
std::sort (found.begin (), found.end (),
- [] (const breakpoint *a, const breakpoint *b)
+ [] (const breakpoint *bp_a, const breakpoint *bp_b)
{
- return compare_breakpoints (a, b) < 0;
+ return compare_breakpoints (bp_a, bp_b) < 0;
});
found.erase (std::unique (found.begin (), found.end (),
- [] (const breakpoint *a, const breakpoint *b)
+ [] (const breakpoint *bp_a, const breakpoint *bp_b)
{
- return compare_breakpoints (a, b) == 0;
+ return compare_breakpoints (bp_a, bp_b) == 0;
}),
found.end ());
}
else
map_breakpoint_numbers
- (arg, [&] (breakpoint *b)
+ (arg, [&] (breakpoint *br)
{
- iterate_over_related_breakpoints (b, delete_breakpoint);
+ iterate_over_related_breakpoints (br, delete_breakpoint);
});
}
}
else
map_breakpoint_numbers
- (arg, [&] (breakpoint *b)
+ (arg, [&] (breakpoint *br)
{
- iterate_over_related_breakpoints (b, delete_breakpoint);
+ iterate_over_related_breakpoints (br, delete_breakpoint);
});
}
case '@':
{
const char *p = &tokstart[1];
- size_t len = strlen ("entry");
if (parse_language (par_state)->la_language == language_objc)
{
while (ISSPACE (*p))
p++;
+ size_t len = strlen ("entry");
if (strncmp (p, "entry", len) == 0 && !c_ident_is_alnum (p[len])
&& p[len] != '_')
{
{
for (int i = 0; i < BLOCK_NRANGES (block); i++)
{
- CORE_ADDR low = BLOCK_RANGE_START (block, i);
- CORE_ADDR high = BLOCK_RANGE_END (block, i);
+ CORE_ADDR range_low = BLOCK_RANGE_START (block, i);
+ CORE_ADDR range_high = BLOCK_RANGE_END (block, i);
printf_filtered (_("Address range %s to %s:\n"),
- paddress (gdbarch, low),
- paddress (gdbarch, high));
- gdb_disassembly (gdbarch, current_uiout, flags, -1, low, high);
+ paddress (gdbarch, range_low),
+ paddress (gdbarch, range_high));
+ gdb_disassembly (gdbarch, current_uiout, flags, -1,
+ range_low, range_high);
}
}
printf_filtered ("End of assembler dump.\n");
null-terminate it to pass to lookup_internalvar(). */
char *varname;
const char *start = ++p;
- LONGEST val;
+ LONGEST longest_val;
while (isalnum (*p) || *p == '_')
p++;
varname = (char *) alloca (p - start + 1);
strncpy (varname, start, p - start);
varname[p - start] = '\0';
- if (get_internalvar_integer (lookup_internalvar (varname), &val))
- retval = (int) val;
+ if (get_internalvar_integer (lookup_internalvar (varname),
+ &longest_val))
+ retval = (int) longest_val;
else
{
printf_filtered (_("Convenience variable must "
struct coff_symfile_info *info;
bfd *abfd = objfile->obfd;
coff_data_type *cdata = coff_data (abfd);
- char *name = bfd_get_filename (abfd);
+ char *filename = bfd_get_filename (abfd);
int val;
unsigned int num_symbols;
int symtab_offset;
val = init_lineno (abfd, info->min_lineno_offset,
info->max_lineno_offset - info->min_lineno_offset);
if (val < 0)
- error (_("\"%s\": error reading line numbers."), name);
+ error (_("\"%s\": error reading line numbers."), filename);
}
/* Now read the string table, all at once. */
make_cleanup (free_stringtab_cleanup, 0 /*ignore*/);
val = init_stringtab (abfd, stringtab_offset);
if (val < 0)
- error (_("\"%s\": can't get string table"), name);
+ error (_("\"%s\": can't get string table"), filename);
minimal_symbol_reader reader (objfile);
{
error (_("The debugging information in `%s' is corrupted.\nThe "
"file has a `.stabs' section, but no `.stabstr' section."),
- name);
+ filename);
}
/* FIXME: dubious. Why can't we use something normal like
if (!debugfile.empty ())
{
- gdb_bfd_ref_ptr abfd (symfile_bfd_open (debugfile.c_str ()));
+ gdb_bfd_ref_ptr debug_bfd (symfile_bfd_open (debugfile.c_str ()));
- symbol_file_add_separate (abfd.get (), debugfile.c_str (),
+ symbol_file_add_separate (debug_bfd.get (), debugfile.c_str (),
symfile_flags, objfile);
}
}
if (fd >= 0)
{
char buf[1] = "";
- int ret;
DEBUG_AGENT ("agent: signalling helper thread\n");
slot = htab_find_slot (m_symbol_err_map.get (), &e, INSERT);
if (*slot == NULL)
{
- struct symbol_error *e = XNEW (struct symbol_error);
+ struct symbol_error *ep = XNEW (struct symbol_error);
- e->sym = sym;
- e->message = xstrdup (text);
- *slot = e;
+ ep->sym = sym;
+ ep->message = xstrdup (text);
+ *slot = ep;
}
}
canonicalization_ftype *finder,
void *data)
{
- int i;
char *name;
struct symbol *sym;
name[ret_comp->u.s_name.len] = '\0';
/* Ignore any typedefs that should not be substituted. */
- for (i = 0; i < ARRAY_SIZE (ignore_typedefs); ++i)
+ for (int i = 0; i < ARRAY_SIZE (ignore_typedefs); ++i)
{
if (strcmp (name, ignore_typedefs[i]) == 0)
return 0;
if (last_set_recurse != recurse)
{
- size_t obstack_final_size =
+ obstack_final_size =
obstack_object_size (&dont_print_stat_array_obstack);
if (obstack_final_size > stat_array_obstack_initial_size)
else if (CSKY_16_IS_LRW4 (insn) || CSKY_16_IS_MOVI4 (insn))
{
int adjust = 0;
- int offset = 0;
unsigned int insn2;
if (csky_debug)
fprintf_unfiltered (gdb_stdlog,
"csky: looking for r4 adjusters...\n");
}
- offset = 2;
+ int offset = 2;
insn_len = csky_get_insn (gdbarch, addr + offset, &insn2);
while (CSKY_IS_R4_ADJUSTER (insn2))
{
#define SET_ARRAY_FIELD(EVENT, SCOPE, VAR, NUM, ARRAY) \
do \
{ \
- uint32_t u32, i; \
+ uint32_t lu32, i; \
const struct bt_definition *def; \
\
- u32 = (uint32_t) bt_ctf_get_uint64 (bt_ctf_get_field ((EVENT), \
- (SCOPE), \
- #NUM)); \
+ lu32 = (uint32_t) bt_ctf_get_uint64 (bt_ctf_get_field ((EVENT), \
+ (SCOPE), \
+ #NUM)); \
def = bt_ctf_get_field ((EVENT), (SCOPE), #ARRAY); \
- for (i = 0; i < u32; i++) \
+ for (i = 0; i < lu32; i++) \
{ \
const struct bt_definition *element \
= bt_ctf_get_index ((EVENT), def, i); \
/* nios2, riscv, and score need to know the current instruction
to select breakpoint instruction. Give the breakpoint
instruction kind explicitly. */
- int bplen;
- insn = gdbarch_sw_breakpoint_from_kind (gdbarch, 4, &bplen);
- len = bplen;
+ {
+ int bplen;
+ insn = gdbarch_sw_breakpoint_from_kind (gdbarch, 4, &bplen);
+ len = bplen;
+ }
break;
default:
{
"src_and_asm_line");
print_source_lines (symtab, next_line, next_line + 1,
psl_flags);
- ui_out_emit_list inner_list_emitter (uiout,
- "line_asm_insn");
+ ui_out_emit_list temp_list_emitter (uiout,
+ "line_asm_insn");
}
/* Print the last line and leave list open for
asm instructions to be added. */
l < end_preceding_line_to_display;
++l)
{
- ui_out_emit_tuple tuple_emitter (uiout, "src_and_asm_line");
+ ui_out_emit_tuple line_tuple_emitter (uiout,
+ "src_and_asm_line");
print_source_lines (sal.symtab, l, l + 1, psl_flags);
ui_out_emit_list chain_line_emitter (uiout, "line_asm_insn");
}
cie->saw_z_augmentation = (*augmentation == 'z');
if (cie->saw_z_augmentation)
{
- uint64_t length;
+ uint64_t uleb_length;
- buf = gdb_read_uleb128 (buf, end, &length);
+ buf = gdb_read_uleb128 (buf, end, &uleb_length);
if (buf == NULL)
return NULL;
- cie->initial_instructions = buf + length;
+ cie->initial_instructions = buf + uleb_length;
augmentation++;
}
can skip the whole thing. */
if (fde->cie->saw_z_augmentation)
{
- uint64_t length;
+ uint64_t uleb_length;
- buf = gdb_read_uleb128 (buf, end, &length);
+ buf = gdb_read_uleb128 (buf, end, &uleb_length);
if (buf == NULL)
return NULL;
- buf += length;
+ buf += uleb_length;
if (buf > end)
return NULL;
}
from the type length, we need to zero-extend it. */
if (TYPE_LENGTH (type) != addr_size)
{
- ULONGEST result =
+ ULONGEST datum =
extract_unsigned_integer (buf, addr_size, byte_order);
buf = (gdb_byte *) alloca (TYPE_LENGTH (type));
store_unsigned_integer (buf, TYPE_LENGTH (type),
- byte_order, result);
+ byte_order, datum);
}
result_val = value_from_contents_and_address (type, buf, addr);
case DW_OP_bit_piece:
{
- uint64_t size, offset;
+ uint64_t size, uleb_offset;
/* Record the piece. */
op_ptr = safe_read_uleb128 (op_ptr, op_end, &size);
- op_ptr = safe_read_uleb128 (op_ptr, op_end, &offset);
- add_piece (size, offset);
+ op_ptr = safe_read_uleb128 (op_ptr, op_end, &uleb_offset);
+ add_piece (size, uleb_offset);
/* Pop off the address/regnum, and reset the location
type. */
struct dwarf2_per_cu_data *per_cu)
{
gdbarch *arch = expr->gdbarch;
- int i;
std::vector<int> dw_labels, patches;
const gdb_byte * const base = op_ptr;
const gdb_byte *previous_piece = op_ptr;
case DW_OP_piece:
case DW_OP_bit_piece:
{
- uint64_t size, offset;
+ uint64_t size;
if (op_ptr - 1 == previous_piece)
error (_("Cannot translate empty pieces to agent expressions"));
if (op == DW_OP_piece)
{
size *= 8;
- offset = 0;
+ uoffset = 0;
}
else
- op_ptr = safe_read_uleb128 (op_ptr, op_end, &offset);
+ op_ptr = safe_read_uleb128 (op_ptr, op_end, &uoffset);
if (bits_collected + size > 8 * sizeof (LONGEST))
error (_("Expression pieces exceed word size"));
case axs_lvalue_memory:
/* Offset the pointer, if needed. */
- if (offset > 8)
+ if (uoffset > 8)
{
- ax_const_l (expr, offset / 8);
+ ax_const_l (expr, uoffset / 8);
ax_simple (expr, aop_add);
- offset %= 8;
+ uoffset %= 8;
}
access_memory (arch, expr, size);
break;
uoffset = extract_unsigned_integer (op_ptr, size, byte_order);
op_ptr += size;
- cu_offset offset = (cu_offset) uoffset;
- block = dwarf2_fetch_die_loc_cu_off (offset, per_cu,
+ cu_offset cuoffset = (cu_offset) uoffset;
+ block = dwarf2_fetch_die_loc_cu_off (cuoffset, per_cu,
get_ax_pc, expr);
/* DW_OP_call_ref is currently not supported. */
}
/* Patch all the branches we emitted. */
- for (i = 0; i < patches.size (); ++i)
+ for (int i = 0; i < patches.size (); ++i)
{
int targ = offsets[dw_labels[i]];
if (targ == -1)
case DW_OP_deref_type:
case DW_OP_GNU_deref_type:
{
- int addr_size = *data++;
+ int deref_addr_size = *data++;
struct type *type;
data = safe_read_uleb128 (data, end, &ul);
type_print (type, "", stream, -1);
fprintf_filtered (stream, " [0x%s]> %d",
phex_nz (to_underlying (offset), 0),
- addr_size);
+ deref_addr_size);
}
break;
const gdb_byte *abbrev_table_start = addr;
for (;;)
{
- unsigned int bytes_read;
const ULONGEST index_num = read_unsigned_leb128 (abfd, addr, &bytes_read);
addr += bytes_read;
if (index_num == 0)
dwarf2_build_include_psymtabs (cu, comp_unit_die, pst);
if (dwarf_read_debug)
- {
- struct gdbarch *gdbarch = get_objfile_arch (objfile);
-
- fprintf_unfiltered (gdb_stdlog,
- "Psymtab for %s unit @%s: %s - %s"
- ", %d global, %d static syms\n",
- per_cu->is_debug_types ? "type" : "comp",
- sect_offset_str (per_cu->sect_off),
- paddress (gdbarch, pst->text_low (objfile)),
- paddress (gdbarch, pst->text_high (objfile)),
- pst->n_global_syms, pst->n_static_syms);
- }
+ fprintf_unfiltered (gdb_stdlog,
+ "Psymtab for %s unit @%s: %s - %s"
+ ", %d global, %d static syms\n",
+ per_cu->is_debug_types ? "type" : "comp",
+ sect_offset_str (per_cu->sect_off),
+ paddress (gdbarch, pst->text_low (objfile)),
+ paddress (gdbarch, pst->text_high (objfile)),
+ pst->n_global_syms, pst->n_static_syms);
}
/* Subroutine of dwarf2_build_psymtabs_hard to simplify it.
struct objfile *objfile = cu->per_cu->dwarf2_per_objfile->objfile;
struct gdbarch *gdbarch = get_objfile_arch (objfile);
CORE_ADDR baseaddr;
- CORE_ADDR highpc;
- CORE_ADDR lowpc;
+ CORE_ADDR this_highpc;
+ CORE_ADDR this_lowpc;
baseaddr = ANOFFSET (objfile->section_offsets,
SECT_OFF_TEXT (objfile));
- lowpc = (gdbarch_adjust_dwarf2_addr (gdbarch,
- pdi->lowpc + baseaddr)
- - baseaddr);
- highpc = (gdbarch_adjust_dwarf2_addr (gdbarch,
- pdi->highpc + baseaddr)
- - baseaddr);
- addrmap_set_empty (objfile->psymtabs_addrmap, lowpc, highpc - 1,
+ this_lowpc
+ = (gdbarch_adjust_dwarf2_addr (gdbarch,
+ pdi->lowpc + baseaddr)
+ - baseaddr);
+ this_highpc
+ = (gdbarch_adjust_dwarf2_addr (gdbarch,
+ pdi->highpc + baseaddr)
+ - baseaddr);
+ addrmap_set_empty (objfile->psymtabs_addrmap,
+ this_lowpc, this_highpc - 1,
cu->per_cu->v.psymtab);
}
}
/* Read directory table. */
read_formatted_entries (dwarf2_per_objfile, abfd, &line_ptr, lh.get (),
&cu->header,
- [] (struct line_header *lh, const char *name,
+ [] (struct line_header *header, const char *name,
dir_index d_index, unsigned int mod_time,
unsigned int length)
{
- lh->add_include_dir (name);
+ header->add_include_dir (name);
});
/* Read file name table. */
read_formatted_entries (dwarf2_per_objfile, abfd, &line_ptr, lh.get (),
&cu->header,
- [] (struct line_header *lh, const char *name,
+ [] (struct line_header *header, const char *name,
dir_index d_index, unsigned int mod_time,
unsigned int length)
{
- lh->add_file_name (name, d_index, mod_time, length);
+ header->add_file_name (name, d_index, mod_time, length);
});
}
else
if (!debugfile.empty ())
{
- gdb_bfd_ref_ptr abfd (symfile_bfd_open (debugfile.c_str ()));
+ gdb_bfd_ref_ptr debug_bfd (symfile_bfd_open (debugfile.c_str ()));
- symbol_file_add_separate (abfd.get (), debugfile.c_str (),
+ symbol_file_add_separate (debug_bfd.get (), debugfile.c_str (),
symfile_flags, objfile);
}
}
only). */
if (gnu_runtime)
{
- struct type *type = selector_type;
+ type = selector_type;
type = lookup_function_type (type);
type = lookup_pointer_type (type);
it's opinion (ie. through "whatis"), it won't offer
it. */
- struct type *type = value_type (called_method);
+ struct type *callee_type = value_type (called_method);
- if (type && TYPE_CODE (type) == TYPE_CODE_PTR)
- type = TYPE_TARGET_TYPE (type);
- type = TYPE_TARGET_TYPE (type);
+ if (callee_type && TYPE_CODE (callee_type) == TYPE_CODE_PTR)
+ callee_type = TYPE_TARGET_TYPE (callee_type);
+ callee_type = TYPE_TARGET_TYPE (callee_type);
- if (type)
+ if (callee_type)
{
- if ((TYPE_CODE (type) == TYPE_CODE_ERROR) && expect_type)
+ if ((TYPE_CODE (callee_type) == TYPE_CODE_ERROR) && expect_type)
return allocate_value (expect_type);
else
- return allocate_value (type);
+ return allocate_value (callee_type);
}
else
error (_("Expression of type other than "
with rtti type in order to continue on with successful
lookup of member / method only available in the rtti type. */
{
- struct type *type = value_type (arg1);
+ struct type *arg_type = value_type (arg1);
struct type *real_type;
int full, using_enc;
LONGEST top;
struct value_print_options opts;
get_user_print_options (&opts);
- if (opts.objectprint && TYPE_TARGET_TYPE(type)
- && (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRUCT))
+ if (opts.objectprint && TYPE_TARGET_TYPE (arg_type)
+ && (TYPE_CODE (TYPE_TARGET_TYPE (arg_type)) == TYPE_CODE_STRUCT))
{
real_type = value_rtti_indirect_type (arg1, &full, &top,
&using_enc);
for (ix = 0; ix < nargs; ++ix)
arg_types[ix] = exp->elts[pc + 2 + ix + 1].type;
- fake_method expect_type (flags, nargs, arg_types);
+ fake_method fake_expect_type (flags, nargs, arg_types);
*(pos) += 4 + nargs;
- return evaluate_subexp_standard (expect_type.type (), exp, pos, noside);
+ return evaluate_subexp_standard (fake_expect_type.type (), exp, pos,
+ noside);
}
case BINOP_CONCAT:
case UNOP_ALIGNOF:
{
- struct type *type
- = value_type (evaluate_subexp (NULL_TYPE, exp, pos,
- EVAL_AVOID_SIDE_EFFECTS));
+ type = value_type (evaluate_subexp (NULL_TYPE, exp, pos,
+ EVAL_AVOID_SIDE_EFFECTS));
/* FIXME: This should be size_t. */
struct type *size_type = builtin_type (exp->gdbarch)->builtin_int;
ULONGEST align = type_align (type);
|| sub_op == STRUCTOP_PTR
|| sub_op == OP_SCOPE))
{
- struct type *type = value_type (result);
+ type = value_type (result);
if (!TYPE_IS_REFERENCE (type))
{
(*pos) += 4;
minimal_symbol *msymbol = exp->elts[pc + 2].msymbol;
- value *val = evaluate_var_msym_value (noside,
- exp->elts[pc + 1].objfile,
- msymbol);
+ value *mval = evaluate_var_msym_value (noside,
+ exp->elts[pc + 1].objfile,
+ msymbol);
- type = value_type (val);
+ type = value_type (mval);
if (TYPE_CODE (type) == TYPE_CODE_ERROR)
error_unknown_type (MSYMBOL_PRINT_NAME (msymbol));
case BINOP_SUBSCRIPT:
if (noside == EVAL_NORMAL)
{
- int pc = (*pos) + 1;
+ int npc = (*pos) + 1;
- val = evaluate_subexp (NULL_TYPE, exp, &pc, EVAL_AVOID_SIDE_EFFECTS);
+ val = evaluate_subexp (NULL_TYPE, exp, &npc, EVAL_AVOID_SIDE_EFFECTS);
type = check_typedef (value_type (val));
if (TYPE_CODE (type) == TYPE_CODE_ARRAY)
{
{
int c;
int namelen;
- unsigned int i,token;
+ unsigned int token;
const char *tokstart;
retry:
if (*lexptr == '.')
{
- for (i = 0; boolean_values[i].name != NULL; i++)
+ for (int i = 0; boolean_values[i].name != NULL; i++)
{
if (strncmp (tokstart, boolean_values[i].name,
strlen (boolean_values[i].name)) == 0)
/* See if it is a special .foo. operator. */
- for (i = 0; dot_ops[i].oper != NULL; i++)
+ for (int i = 0; dot_ops[i].oper != NULL; i++)
if (strncmp (tokstart, dot_ops[i].oper,
strlen (dot_ops[i].oper)) == 0)
{
/* Catch specific keywords. */
- for (i = 0; f77_keywords[i].oper != NULL; i++)
+ for (int i = 0; f77_keywords[i].oper != NULL; i++)
if (strlen (f77_keywords[i].oper) == namelen
&& strncmp (tokstart, f77_keywords[i].oper, namelen) == 0)
{
VAR_DOMAIN,
MODULE_DOMAIN
};
- int i;
int hextype;
- for (i = 0; i < ARRAY_SIZE (lookup_domains); ++i)
+ for (int i = 0; i < ARRAY_SIZE (lookup_domains); ++i)
{
/* Initialize this in case we *don't* use it in this call; that
way we can refer to it unconditionally below. */
v = allocate_value (type);
if (overlay_debugging)
{
- CORE_ADDR addr
+ addr
= symbol_overlayed_address (SYMBOL_VALUE_ADDRESS (var),
SYMBOL_OBJ_SECTION (symbol_objfile (var),
var));
selected_frame = get_selected_frame (_("no frame selected"));
block = get_frame_block (selected_frame, NULL);
}
- CATCH (except, RETURN_MASK_ALL)
+ CATCH (ex, RETURN_MASK_ALL)
{
xfree (name);
- GDBSCM_HANDLE_GDB_EXCEPTION (except);
+ GDBSCM_HANDLE_GDB_EXCEPTION (ex);
}
END_CATCH
}
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR faddr = value_as_address (function);
struct obj_section *faddr_sec;
- gdb_byte buf[4];
/* Is this a plabel? If so, dereference it to get the Global Pointer
value. */
if (faddr & 2)
{
+ gdb_byte buf[4];
if (target_read_memory ((faddr & ~3) + 4, buf, sizeof buf) == 0)
return extract_unsigned_integer (buf, sizeof buf, byte_order);
}
found sequentially in memory starting at $bof. This
isn't always true, but without libunwind, this is the
best we can do. */
- enum register_status status;
ULONGEST cfm;
ULONGEST bsp;
CORE_ADDR reg;
&& it == M && ((instr & 0x1ee0000003fLL) == 0x02c00000000LL))
{
/* alloc - start of a regular function. */
- int sol = (int) ((instr & 0x00007f00000LL) >> 20);
- int sof = (int) ((instr & 0x000000fe000LL) >> 13);
+ int sol_bits = (int) ((instr & 0x00007f00000LL) >> 20);
+ int sof_bits = (int) ((instr & 0x000000fe000LL) >> 13);
int rN = (int) ((instr & 0x00000001fc0LL) >> 6);
/* Verify that the current cfm matches what we think is the
addresses of various registers such as the return address.
We will instead treat the frame as frameless. */
if (!this_frame ||
- (sof == (cache->cfm & 0x7f) &&
- sol == ((cache->cfm >> 7) & 0x7f)))
+ (sof_bits == (cache->cfm & 0x7f) &&
+ sol_bits == ((cache->cfm >> 7) & 0x7f)))
frameless = 0;
cfm_reg = rN;
while (n-- > 0)
{
- ULONGEST val;
- regcache_cooked_read_unsigned (regcache, regnum, &val);
- memcpy ((char *)valbuf + offset, &val, reglen);
+ ULONGEST regval;
+ regcache_cooked_read_unsigned (regcache, regnum, ®val);
+ memcpy ((char *)valbuf + offset, ®val, reglen);
offset += reglen;
regnum++;
}
}
else
{
- ULONGEST val;
int offset = 0;
int regnum = IA64_GR8_REGNUM;
int reglen = TYPE_LENGTH (register_type (gdbarch, IA64_GR8_REGNUM));
if (m)
{
+ ULONGEST val;
memcpy (&val, (char *)valbuf + offset, m);
regcache_cooked_write_unsigned (regcache, regnum, val);
}
if (inf->pid == 0)
continue;
- thread_info *thread = any_live_thread_of_inferior (inf);
+ thread = any_live_thread_of_inferior (inf);
if (thread == NULL)
{
if (debug_infrun)
if (debug_infrun)
{
struct regcache *regcache = get_thread_regcache (ecs->event_thread);
- struct gdbarch *gdbarch = regcache->arch ();
+ struct gdbarch *reg_gdbarch = regcache->arch ();
scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
inferior_ptid = ecs->ptid;
fprintf_unfiltered (gdb_stdlog, "infrun: stop_pc = %s\n",
- paddress (gdbarch,
+ paddress (reg_gdbarch,
ecs->event_thread->suspend.stop_pc));
if (target_stopped_by_watchpoint ())
{
if (target_stopped_data_address (current_top_target (), &addr))
fprintf_unfiltered (gdb_stdlog,
"infrun: stopped data address = %s\n",
- paddress (gdbarch, addr));
+ paddress (reg_gdbarch, addr));
else
fprintf_unfiltered (gdb_stdlog,
"infrun: (no data address available)\n");
handle_command (const char *args, int from_tty)
{
int digits, wordlen;
- int sigfirst, signum, siglast;
+ int sigfirst, siglast;
enum gdb_signal oursig;
int allsigs;
int nsigs;
if (sigfirst > siglast)
{
/* Bet he didn't figure we'd think of this case... */
- signum = sigfirst;
- sigfirst = siglast;
- siglast = signum;
+ std::swap (sigfirst, siglast);
}
}
else
/* If any signal numbers or symbol names were found, set flags for
which signals to apply actions to. */
- for (signum = sigfirst; signum >= 0 && signum <= siglast; signum++)
+ for (int signum = sigfirst; signum >= 0 && signum <= siglast; signum++)
{
switch ((enum gdb_signal) signum)
{
}
}
- for (signum = 0; signum < nsigs; signum++)
+ for (int signum = 0; signum < nsigs; signum++)
if (sigs[signum])
{
signal_cache_update (-1);
== language_cplus)
&& (PARSER_STREAM (parser) - start) >= CP_OPERATOR_LEN)
{
- const char *p = PARSER_STREAM (parser);
+ const char *op = PARSER_STREAM (parser);
- while (p > start && isspace (p[-1]))
- p--;
- if (p - start >= CP_OPERATOR_LEN)
+ while (op > start && isspace (op[-1]))
+ op--;
+ if (op - start >= CP_OPERATOR_LEN)
{
- p -= CP_OPERATOR_LEN;
- if (strncmp (p, CP_OPERATOR_STR, CP_OPERATOR_LEN) == 0
- && (p == start
- || !(isalnum (p[-1]) || p[-1] == '_')))
+ op -= CP_OPERATOR_LEN;
+ if (strncmp (op, CP_OPERATOR_STR, CP_OPERATOR_LEN) == 0
+ && (op == start
+ || !(isalnum (op[-1]) || op[-1] == '_')))
{
/* This is an operator name. Keep going. */
++(PARSER_STREAM (parser));
}
}
- const char *p = find_parameter_list_end (PARSER_STREAM (parser));
- PARSER_STREAM (parser) = p;
+ const char *end = find_parameter_list_end (PARSER_STREAM (parser));
+ PARSER_STREAM (parser) = end;
/* Don't loop around to the normal \0 case above because
we don't want to misinterpret a potential keyword at
the end of the token when the string isn't
"()<>"-balanced. This handles "b
function(thread<tab>" in completion mode. */
- if (*p == '\0')
+ if (*end == '\0')
{
LS_TOKEN_STOKEN (token).ptr = start;
LS_TOKEN_STOKEN (token).length
== language_cplus)
&& (PARSER_STREAM (parser) - start) > CP_OPERATOR_LEN)
{
- const char *p = strstr (start, CP_OPERATOR_STR);
+ const char *op = strstr (start, CP_OPERATOR_STR);
- if (p != NULL && is_operator_name (p))
+ if (op != NULL && is_operator_name (op))
{
/* This is an operator name. Keep going. */
++(PARSER_STREAM (parser));
line = strtok (NULL, "\n"))
{
ULONGEST addr, endaddr, offset, inode;
- const char *permissions, *device, *filename;
+ const char *permissions, *device, *mapping_filename;
size_t permissions_len, device_len;
read_mapping (line, &addr, &endaddr,
&permissions, &permissions_len,
&offset, &device, &device_len,
- &inode, &filename);
+ &inode, &mapping_filename);
if (gdbarch_addr_bit (gdbarch) == 32)
{
paddress (gdbarch, endaddr),
hex_string (endaddr - addr),
hex_string (offset),
- *filename? filename : "");
+ *mapping_filename ? mapping_filename : "");
}
else
{
paddress (gdbarch, endaddr),
hex_string (endaddr - addr),
hex_string (offset),
- *filename? filename : "");
+ *mapping_filename ? mapping_filename : "");
}
}
}
}
for (ix2 = ix; ix2 < last_ix; ix2++)
{
- oso_el *oso2 = &(*oso_vector_ptr)[ix2];
+ oso2 = &(*oso_vector_ptr)[ix2];
if (oso2->name != NULL)
warning (_("Could not find specified archive member "
break;
case 'b':
{
- int i;
+ int rate;
char *p;
- i = strtol (optarg, &p, 0);
- if (i == 0 && p == optarg)
+ rate = strtol (optarg, &p, 0);
+ if (rate == 0 && p == optarg)
warning (_("could not set baud rate to `%s'."),
optarg);
else
- baud_rate = i;
+ baud_rate = rate;
}
break;
case 'l':
{
- int i;
+ int timeout;
char *p;
- i = strtol (optarg, &p, 0);
- if (i == 0 && p == optarg)
+ timeout = strtol (optarg, &p, 0);
+ if (timeout == 0 && p == optarg)
warning (_("could not set timeout limit to `%s'."),
optarg);
else
- remote_timeout = i;
+ remote_timeout = timeout;
}
break;
struct block *b;
struct mdebug_pending *pend;
struct type *t;
- struct field *f;
int count = 1;
TIR tir;
long svalue = sh->value;
const struct blockvector *bv
= SYMTAB_BLOCKVECTOR (top_stack->cur_st);
struct mdebug_extra_func_info *e;
- struct block *b = top_stack->cur_block;
+ struct block *cblock = top_stack->cur_block;
struct type *ftype = top_stack->cur_type;
int i;
{
struct block *b_bad = BLOCKVECTOR_BLOCK (bv, i);
- if (BLOCK_SUPERBLOCK (b_bad) == b
+ if (BLOCK_SUPERBLOCK (b_bad) == cblock
&& BLOCK_START (b_bad) == top_stack->procadr
&& BLOCK_END (b_bad) == top_stack->procadr)
{
- BLOCK_START (b_bad) = BLOCK_START (b);
- BLOCK_END (b_bad) = BLOCK_END (b);
+ BLOCK_START (b_bad) = BLOCK_START (cblock);
+ BLOCK_END (b_bad) = BLOCK_END (cblock);
}
}
TYPE_ALLOC (ftype, nparams * sizeof (struct field));
iparams = 0;
- ALL_BLOCK_SYMBOLS (b, iter, sym)
+ ALL_BLOCK_SYMBOLS (cblock, iter, sym)
{
if (iparams == nparams)
break;
break;
case stMember: /* member of struct or union */
- f = &TYPE_FIELDS (top_stack->cur_type)[top_stack->cur_field++];
- FIELD_NAME (*f) = name;
- SET_FIELD_BITPOS (*f, sh->value);
- bitsize = 0;
- FIELD_TYPE (*f) = parse_type (cur_fd, ax, sh->index,
- &bitsize, bigend, name);
- FIELD_BITSIZE (*f) = bitsize;
+ {
+ struct field *f
+ = &TYPE_FIELDS (top_stack->cur_type)[top_stack->cur_field++];
+ FIELD_NAME (*f) = name;
+ SET_FIELD_BITPOS (*f, sh->value);
+ bitsize = 0;
+ FIELD_TYPE (*f) = parse_type (cur_fd, ax, sh->index,
+ &bitsize, bigend, name);
+ FIELD_BITSIZE (*f) = bitsize;
+ }
break;
case stIndirect: /* forward declaration on Irix5 */
fdr_to_pst = fdr_to_pst_holder.data ();
fdr_to_pst++;
{
- struct partial_symtab *pst = new_psymtab ("", objfile);
+ struct partial_symtab *new_pst = new_psymtab ("", objfile);
- fdr_to_pst[-1].pst = pst;
- FDR_IDX (pst) = -1;
+ fdr_to_pst[-1].pst = new_pst;
+ FDR_IDX (new_pst) = -1;
}
/* Allocate the global pending list. */
case N_SO:
{
static int prev_so_symnum = -10;
- const char *p;
+ const char *basename;
/* A zero value is probably an indication for the
SunPRO 3.0 compiler. dbx_end_psymtab explicitly tests
the second the file name. If pst exists, is
empty, and has a filename ending in '/', we assume
the previous N_SO was a directory name. */
- p = lbasename (namestring);
- if (p != namestring && *p == '\000')
+ basename = lbasename (namestring);
+ if (basename != namestring && *basename == '\000')
continue; /* Simply ignore directory
name SOs. */
{
for (cur_sdx = 0; cur_sdx < fh->csym;)
{
- char *name;
+ char *sym_name;
enum address_class theclass;
CORE_ADDR minsym_value;
short section = -1;
continue;
}
- name = debug_info->ss + fh->issBase + sh.iss;
+ sym_name = debug_info->ss + fh->issBase + sh.iss;
minsym_value = sh.value;
int new_sdx;
case stStaticProc:
- reader.record_with_info (name, minsym_value,
+ reader.record_with_info (sym_name, minsym_value,
mst_file_text,
SECT_OFF_TEXT (objfile));
{
/* Should not happen, but does when cross-compiling
with the MIPS compiler. FIXME -- pull later. */
- index_complaint (name);
+ index_complaint (sym_name);
new_sdx = cur_sdx + 1; /* Don't skip at all. */
}
else
{
/* This should not happen either... FIXME. */
complaint (_("bad proc end in aux found from symbol %s"),
- name);
+ sym_name);
new_sdx = cur_sdx + 1; /* Don't skip backward. */
}
symbol table, and the MAIN__ symbol via the minimal
symbol table. */
if (sh.st == stProc)
- add_psymbol_to_list (name, strlen (name), 1,
+ add_psymbol_to_list (sym_name, strlen (sym_name), 1,
VAR_DOMAIN, LOC_BLOCK,
section,
&objfile->global_psymbols,
sh.value, psymtab_language, objfile);
else
- add_psymbol_to_list (name, strlen (name), 1,
+ add_psymbol_to_list (sym_name, strlen (sym_name), 1,
VAR_DOMAIN, LOC_BLOCK,
section,
&objfile->static_psymbols,
case stStatic: /* Variable */
if (SC_IS_DATA (sh.sc))
- reader.record_with_info (name, minsym_value,
+ reader.record_with_info (sym_name, minsym_value,
mst_file_data,
SECT_OFF_DATA (objfile));
else
- reader.record_with_info (name, minsym_value,
+ reader.record_with_info (sym_name, minsym_value,
mst_file_bss,
SECT_OFF_BSS (objfile));
theclass = LOC_STATIC;
&& sh.iss != 0
&& sh.index != cur_sdx + 2)
{
- add_psymbol_to_list (name, strlen (name), 1,
+ add_psymbol_to_list (sym_name, strlen (sym_name), 1,
STRUCT_DOMAIN, LOC_TYPEDEF, -1,
&objfile->static_psymbols,
0, psymtab_language, objfile);
if (new_sdx <= cur_sdx)
{
/* This happens with the Ultrix kernel. */
- complaint (_("bad aux index at block symbol %s"), name);
+ complaint (_("bad aux index at block symbol %s"),
+ sym_name);
new_sdx = cur_sdx + 1; /* Don't skip backward. */
}
cur_sdx = new_sdx;
goto skip;
default:
- /* Both complaints are valid: one gives symbol name,
+ /* Both complaints are valid: one gives symbol sym_name,
the other the offending symbol type. */
complaint (_("unknown local symbol %s"),
- name);
+ sym_name);
complaint (_("with type %d"), sh.st);
cur_sdx++;
continue;
}
/* Use this gdb symbol. */
- add_psymbol_to_list (name, strlen (name), 1,
+ add_psymbol_to_list (sym_name, strlen (sym_name), 1,
VAR_DOMAIN, theclass, section,
&objfile->static_psymbols,
sh.value, psymtab_language, objfile);
{
enum address_class theclass;
SYMR *psh;
- char *name;
CORE_ADDR svalue;
short section;
theclass = LOC_STATIC;
break;
}
- name = debug_info->ssext + psh->iss;
- add_psymbol_to_list (name, strlen (name), 1,
+ char *sym_name = debug_info->ssext + psh->iss;
+ add_psymbol_to_list (sym_name, strlen (sym_name), 1,
VAR_DOMAIN, theclass,
section,
&objfile->global_psymbols,
{
CORE_ADDR pc;
unsigned long insn;
- int rn;
pv_t reg[MEP_NUM_REGS];
CORE_ADDR after_last_frame_setup_insn = start_pc;
memset (result, 0, sizeof (*result));
result->gdbarch = gdbarch;
- for (rn = 0; rn < MEP_NUM_REGS; rn++)
+ for (int rn = 0; rn < MEP_NUM_REGS; rn++)
{
reg[rn] = pv_register (rn, 0);
result->reg_offset[rn] = 1;
for (varobj *child : r.newobj)
{
- ui_out_emit_tuple tuple_emitter (uiout, NULL);
+ ui_out_emit_tuple inner_tuple_emitter (uiout, NULL);
print_varobj (child, print_values, 1 /* print_expression */);
}
}
for (const osdata_item &child : children)
{
- ui_out_emit_tuple tuple_emitter (uiout, NULL);
+ ui_out_emit_tuple inner_tuple_emitter (uiout, NULL);
const std::string *tid = get_osdata_column (child, "tid");
const std::string *tcore = get_osdata_column (child, "core");
{
int col;
int col_byte;
- struct value_print_options opts;
+ struct value_print_options print_opts;
ui_out_emit_tuple tuple_emitter (uiout, NULL);
uiout->field_core_addr ("addr", gdbarch, addr + row_byte);
row_byte); */
{
ui_out_emit_list list_data_emitter (uiout, "data");
- get_formatted_print_options (&opts, word_format);
+ get_formatted_print_options (&print_opts, word_format);
for (col = 0, col_byte = row_byte;
col < nr_cols;
col++, col_byte += word_size)
else
{
stream.clear ();
- print_scalar_formatted (&mbuf[col_byte], word_type, &opts,
- word_asize, &stream);
+ print_scalar_formatted (&mbuf[col_byte], word_type,
+ &print_opts, word_asize, &stream);
uiout->field_stream (NULL, stream);
}
}
instruction. */
{
- unsigned op = (unsigned)insn >> 26;
+ unsigned ctrl_op = (unsigned)insn >> 26;
/* continue if not control flow (branch, return). */
- if (op != 0x26 && op != 0x27 && op != 0x2d && op != 0x2e && op != 0x2f)
+ if (ctrl_op != 0x26 && ctrl_op != 0x27 && ctrl_op != 0x2d
+ && ctrl_op != 0x2e && ctrl_op != 0x2f)
continue;
- else if (op == 0x2c)
+ else if (ctrl_op == 0x2c)
continue; /* continue if imm. */
}
int argreg;
int float_argreg;
int argnum;
- int len = 0;
+ int arg_space = 0;
int stack_offset = 0;
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR func_addr = find_function_addr (function, NULL);
than necessary for EABI, because the first few arguments are
passed in registers, but that's OK. */
for (argnum = 0; argnum < nargs; argnum++)
- len += align_up (TYPE_LENGTH (value_type (args[argnum])), abi_regsize);
- sp -= align_up (len, 16);
+ arg_space += align_up (TYPE_LENGTH (value_type (args[argnum])), abi_regsize);
+ sp -= align_up (arg_space, 16);
if (mips_debug)
fprintf_unfiltered (gdb_stdlog,
"mips_eabi_push_dummy_call: sp=%s allocated %ld\n",
- paddress (gdbarch, sp), (long) align_up (len, 16));
+ paddress (gdbarch, sp),
+ (long) align_up (arg_space, 16));
/* Initialize the integer and float register pointers. */
argreg = MIPS_A0_REGNUM;
int argreg;
int float_argreg;
int argnum;
- int len = 0;
+ int arg_space = 0;
int stack_offset = 0;
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR func_addr = find_function_addr (function, NULL);
/* Now make space on the stack for the args. */
for (argnum = 0; argnum < nargs; argnum++)
- len += align_up (TYPE_LENGTH (value_type (args[argnum])), MIPS64_REGSIZE);
- sp -= align_up (len, 16);
+ arg_space += align_up (TYPE_LENGTH (value_type (args[argnum])), MIPS64_REGSIZE);
+ sp -= align_up (arg_space, 16);
if (mips_debug)
fprintf_unfiltered (gdb_stdlog,
"mips_n32n64_push_dummy_call: sp=%s allocated %ld\n",
- paddress (gdbarch, sp), (long) align_up (len, 16));
+ paddress (gdbarch, sp),
+ (long) align_up (arg_space, 16));
/* Initialize the integer and float register pointers. */
argreg = MIPS_A0_REGNUM;
int argreg;
int float_argreg;
int argnum;
- int len = 0;
+ int arg_space = 0;
int stack_offset = 0;
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR func_addr = find_function_addr (function, NULL);
/* Align to double-word if necessary. */
if (mips_type_needs_double_align (arg_type))
- len = align_up (len, MIPS32_REGSIZE * 2);
+ arg_space = align_up (arg_space, MIPS32_REGSIZE * 2);
/* Allocate space on the stack. */
- len += align_up (TYPE_LENGTH (arg_type), MIPS32_REGSIZE);
+ arg_space += align_up (TYPE_LENGTH (arg_type), MIPS32_REGSIZE);
}
- sp -= align_up (len, 16);
+ sp -= align_up (arg_space, 16);
if (mips_debug)
fprintf_unfiltered (gdb_stdlog,
"mips_o32_push_dummy_call: sp=%s allocated %ld\n",
- paddress (gdbarch, sp), (long) align_up (len, 16));
+ paddress (gdbarch, sp),
+ (long) align_up (arg_space, 16));
/* Initialize the integer and float register pointers. */
argreg = MIPS_A0_REGNUM;
int argreg;
int float_argreg;
int argnum;
- int len = 0;
+ int arg_space = 0;
int stack_offset = 0;
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
CORE_ADDR func_addr = find_function_addr (function, NULL);
struct type *arg_type = check_typedef (value_type (args[argnum]));
/* Allocate space on the stack. */
- len += align_up (TYPE_LENGTH (arg_type), MIPS64_REGSIZE);
+ arg_space += align_up (TYPE_LENGTH (arg_type), MIPS64_REGSIZE);
}
- sp -= align_up (len, 16);
+ sp -= align_up (arg_space, 16);
if (mips_debug)
fprintf_unfiltered (gdb_stdlog,
"mips_o64_push_dummy_call: sp=%s allocated %ld\n",
- paddress (gdbarch, sp), (long) align_up (len, 16));
+ paddress (gdbarch, sp),
+ (long) align_up (arg_space, 16));
/* Initialize the integer and float register pointers. */
argreg = MIPS_A0_REGNUM;
linux_xfer_osdata_cpus (gdb_byte *readbuf,
ULONGEST offset, ULONGEST len)
{
- static const char *buf;
+ static const char *saved_buf;
static LONGEST len_avail = -1;
static struct buffer buffer;
if (len_avail != -1 && len_avail != 0)
buffer_free (&buffer);
len_avail = 0;
- buf = NULL;
+ saved_buf = NULL;
buffer_init (&buffer);
buffer_grow_str (&buffer, "<osdata type=\"cpus\">\n");
}
buffer_grow_str0 (&buffer, "</osdata>\n");
- buf = buffer_finish (&buffer);
- len_avail = strlen (buf);
+ saved_buf = buffer_finish (&buffer);
+ len_avail = strlen (saved_buf);
}
if (offset >= len_avail)
{
/* Done. Get rid of the buffer. */
buffer_free (&buffer);
- buf = NULL;
+ saved_buf = NULL;
len_avail = 0;
return 0;
}
if (len > len_avail - offset)
len = len_avail - offset;
- memcpy (readbuf, buf + offset, len);
+ memcpy (readbuf, saved_buf + offset, len);
return len;
}
ULONGEST offset, ULONGEST len)
{
/* We make the process list snapshot when the object starts to be read. */
- static const char *buf;
+ static const char *saved_buf;
static LONGEST len_avail = -1;
static struct buffer buffer;
if (len_avail != -1 && len_avail != 0)
buffer_free (&buffer);
len_avail = 0;
- buf = NULL;
+ saved_buf = NULL;
buffer_init (&buffer);
buffer_grow_str (&buffer, "<osdata type=\"files\">\n");
}
buffer_grow_str0 (&buffer, "</osdata>\n");
- buf = buffer_finish (&buffer);
- len_avail = strlen (buf);
+ saved_buf = buffer_finish (&buffer);
+ len_avail = strlen (saved_buf);
}
if (offset >= len_avail)
{
/* Done. Get rid of the buffer. */
buffer_free (&buffer);
- buf = NULL;
+ saved_buf = NULL;
len_avail = 0;
return 0;
}
if (len > len_avail - offset)
len = len_avail - offset;
- memcpy (readbuf, buf + offset, len);
+ memcpy (readbuf, saved_buf + offset, len);
return len;
}
linux_xfer_osdata_shm (gdb_byte *readbuf,
ULONGEST offset, ULONGEST len)
{
- static const char *buf;
+ static const char *saved_buf;
static LONGEST len_avail = -1;
static struct buffer buffer;
if (len_avail != -1 && len_avail != 0)
buffer_free (&buffer);
len_avail = 0;
- buf = NULL;
+ saved_buf = NULL;
buffer_init (&buffer);
buffer_grow_str (&buffer, "<osdata type=\"shared memory\">\n");
}
buffer_grow_str0 (&buffer, "</osdata>\n");
- buf = buffer_finish (&buffer);
- len_avail = strlen (buf);
+ saved_buf = buffer_finish (&buffer);
+ len_avail = strlen (saved_buf);
}
if (offset >= len_avail)
{
/* Done. Get rid of the buffer. */
buffer_free (&buffer);
- buf = NULL;
+ saved_buf = NULL;
len_avail = 0;
return 0;
}
if (len > len_avail - offset)
len = len_avail - offset;
- memcpy (readbuf, buf + offset, len);
+ memcpy (readbuf, saved_buf + offset, len);
return len;
}
linux_xfer_osdata_sem (gdb_byte *readbuf,
ULONGEST offset, ULONGEST len)
{
- static const char *buf;
+ static const char *saved_buf;
static LONGEST len_avail = -1;
static struct buffer buffer;
if (len_avail != -1 && len_avail != 0)
buffer_free (&buffer);
len_avail = 0;
- buf = NULL;
+ saved_buf = NULL;
buffer_init (&buffer);
buffer_grow_str (&buffer, "<osdata type=\"semaphores\">\n");
}
buffer_grow_str0 (&buffer, "</osdata>\n");
- buf = buffer_finish (&buffer);
- len_avail = strlen (buf);
+ saved_buf = buffer_finish (&buffer);
+ len_avail = strlen (saved_buf);
}
if (offset >= len_avail)
{
/* Done. Get rid of the buffer. */
buffer_free (&buffer);
- buf = NULL;
+ saved_buf = NULL;
len_avail = 0;
return 0;
}
if (len > len_avail - offset)
len = len_avail - offset;
- memcpy (readbuf, buf + offset, len);
+ memcpy (readbuf, saved_buf + offset, len);
return len;
}
linux_xfer_osdata_msg (gdb_byte *readbuf,
ULONGEST offset, ULONGEST len)
{
- static const char *buf;
+ static const char *saved_buf;
static LONGEST len_avail = -1;
static struct buffer buffer;
if (len_avail != -1 && len_avail != 0)
buffer_free (&buffer);
len_avail = 0;
- buf = NULL;
+ saved_buf = NULL;
buffer_init (&buffer);
buffer_grow_str (&buffer, "<osdata type=\"message queues\">\n");
}
buffer_grow_str0 (&buffer, "</osdata>\n");
- buf = buffer_finish (&buffer);
- len_avail = strlen (buf);
+ saved_buf = buffer_finish (&buffer);
+ len_avail = strlen (saved_buf);
}
if (offset >= len_avail)
{
/* Done. Get rid of the buffer. */
buffer_free (&buffer);
- buf = NULL;
+ saved_buf = NULL;
len_avail = 0;
return 0;
}
if (len > len_avail - offset)
len = len_avail - offset;
- memcpy (readbuf, buf + offset, len);
+ memcpy (readbuf, saved_buf + offset, len);
return len;
}
linux_xfer_osdata_modules (gdb_byte *readbuf,
ULONGEST offset, ULONGEST len)
{
- static const char *buf;
+ static const char *saved_buf;
static LONGEST len_avail = -1;
static struct buffer buffer;
if (len_avail != -1 && len_avail != 0)
buffer_free (&buffer);
len_avail = 0;
- buf = NULL;
+ saved_buf = NULL;
buffer_init (&buffer);
buffer_grow_str (&buffer, "<osdata type=\"modules\">\n");
}
buffer_grow_str0 (&buffer, "</osdata>\n");
- buf = buffer_finish (&buffer);
- len_avail = strlen (buf);
+ saved_buf = buffer_finish (&buffer);
+ len_avail = strlen (saved_buf);
}
if (offset >= len_avail)
{
/* Done. Get rid of the buffer. */
buffer_free (&buffer);
- buf = NULL;
+ saved_buf = NULL;
len_avail = 0;
return 0;
}
if (len > len_avail - offset)
len = len_avail - offset;
- memcpy (readbuf, buf + offset, len);
+ memcpy (readbuf, saved_buf + offset, len);
return len;
}
struct reg_value *value = cache->reg_value;
struct reg_value temp_value[NIOS2_NUM_REGS];
- int i;
-
/* Save the starting PC so we can correct the pc after running
through the prolog, using symbol info. */
CORE_ADDR pc = start_pc;
/* If any registers were saved on the stack before then
we can't backtrace into them now. */
- for (i = 0 ; i < NIOS2_NUM_REGS ; i++)
+ for (int i = 0 ; i < NIOS2_NUM_REGS ; i++)
{
if (cache->reg_saved[i].basereg == NIOS2_SP_REGNUM)
cache->reg_saved[i].basereg = -1;
/* PUSH.N {reglist}, adjust
or
STWM {reglist}, --(SP)[, writeback] */
- int i;
int off = 0;
if (ra != NIOS2_SP_REGNUM || id != 0)
part of the prologue. */
break;
- for (i = 31; i >= 0; i--)
+ for (int i = 31; i >= 0; i--)
if (reglist & (1 << i))
{
int orig = value[i].reg;
if ra has been stored into r8 beforehand and if it's
before the stack adjust.
Note mcount corrupts r2-r3, r9-r15 & ra. */
- for (i = 2 ; i <= 3 ; i++)
+ for (int i = 2 ; i <= 3 ; i++)
value[i].reg = -1;
- for (i = 9 ; i <= 15 ; i++)
+ for (int i = 9 ; i <= 15 ; i++)
value[i].reg = -1;
value[NIOS2_RA_REGNUM].reg = -1;
/* Adjust all the saved registers such that they contain addresses
instead of offsets. */
- for (i = 0; i < NIOS2_NUM_REGS; i++)
+ for (int i = 0; i < NIOS2_NUM_REGS; i++)
if (cache->reg_saved[i].basereg == NIOS2_SP_REGNUM)
{
cache->reg_saved[i].basereg = NIOS2_Z_REGNUM;
cache->reg_saved[i].addr += frame_high;
}
- for (i = 0; i < NIOS2_NUM_REGS; i++)
+ for (int i = 0; i < NIOS2_NUM_REGS; i++)
if (cache->reg_saved[i].basereg == NIOS2_GP_REGNUM)
{
CORE_ADDR gp = get_frame_register_unsigned (this_frame,
{
int argreg;
int argnum;
- int len = 0;
+ int arg_space = 0;
int stack_offset = 0;
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
/* Now make space on the stack for the args. */
for (argnum = 0; argnum < nargs; argnum++)
- len += align_up (TYPE_LENGTH (value_type (args[argnum])), 4);
- sp -= len;
+ arg_space += align_up (TYPE_LENGTH (value_type (args[argnum])), 4);
+ sp -= arg_space;
/* Initialize the register pointer. */
argreg = NIOS2_FIRST_ARGREG;
objfile_relocate1 (struct objfile *objfile,
const struct section_offsets *new_offsets)
{
- struct obj_section *s;
struct section_offsets *delta =
((struct section_offsets *)
alloca (SIZEOF_N_SECTION_OFFSETS (objfile->num_sections)));
- int i;
int something_changed = 0;
- for (i = 0; i < objfile->num_sections; ++i)
+ for (int i = 0; i < objfile->num_sections; ++i)
{
delta->offsets[i] =
ANOFFSET (new_offsets, i) - ANOFFSET (objfile->section_offsets, i);
ALL_OBJFILE_FILETABS (objfile, cust, s)
{
struct linetable *l;
- int i;
/* First the line table. */
l = SYMTAB_LINETABLE (s);
if (l)
{
- for (i = 0; i < l->nitems; ++i)
+ for (int i = 0; i < l->nitems; ++i)
l->item[i].pc += ANOFFSET (delta,
COMPUNIT_BLOCK_LINE_SECTION
(cust));
addrmap_relocate (BLOCKVECTOR_MAP (bv),
ANOFFSET (delta, block_line_section));
- for (i = 0; i < BLOCKVECTOR_NBLOCKS (bv); ++i)
+ for (int i = 0; i < BLOCKVECTOR_NBLOCKS (bv); ++i)
{
struct block *b;
struct symbol *sym;
get_objfile_pspace_data (objfile->pspace)->section_map_dirty = 1;
/* Update the table in exec_ops, used to read memory. */
+ struct obj_section *s;
ALL_OBJFILE_OSECTIONS (objfile, s)
{
int idx = s - objfile->sections;
{
int c;
int namelen;
- unsigned int i;
const char *tokstart;
char *uptokstart;
const char *tokptr;
/* See if it is a special token of length 3. */
if (explen > 2)
- for (i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++)
+ for (int i = 0; i < sizeof (tokentab3) / sizeof (tokentab3[0]); i++)
if (strncasecmp (tokstart, tokentab3[i].oper, 3) == 0
&& (!isalpha (tokentab3[i].oper[0]) || explen == 3
|| (!isalpha (tokstart[3])
/* See if it is a special token of length 2. */
if (explen > 1)
- for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
+ for (int i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
if (strncasecmp (tokstart, tokentab2[i].oper, 2) == 0
&& (!isalpha (tokentab2[i].oper[0]) || explen == 2
|| (!isalpha (tokstart[2])
/* second chance uppercased (as Free Pascal does). */
if (!sym && is_a_field_of_this.type == NULL && !is_a_field)
{
- for (i = 0; i <= namelen; i++)
+ for (int i = 0; i <= namelen; i++)
{
if ((tmp[i] >= 'a' && tmp[i] <= 'z'))
tmp[i] -= ('a'-'A');
/* Third chance Capitalized (as GPC does). */
if (!sym && is_a_field_of_this.type == NULL && !is_a_field)
{
- for (i = 0; i <= namelen; i++)
+ for (int i = 0; i <= namelen; i++)
{
if (i == 0)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
unsigned int i = 0; /* Number of characters printed */
unsigned len;
- LONGEST low_bound, high_bound;
struct type *elttype;
unsigned eltlen;
int length_pos, length_size, string_pos;
switch (TYPE_CODE (type))
{
case TYPE_CODE_ARRAY:
- if (get_array_bounds (type, &low_bound, &high_bound))
- {
- len = high_bound - low_bound + 1;
- elttype = check_typedef (TYPE_TARGET_TYPE (type));
- eltlen = TYPE_LENGTH (elttype);
- if (options->prettyformat_arrays)
- {
- print_spaces_filtered (2 + 2 * recurse, stream);
- }
- /* If 's' format is used, try to print out as string.
- If no format is given, print as string if element type
- is of TYPE_CODE_CHAR and element size is 1,2 or 4. */
- if (options->format == 's'
- || ((eltlen == 1 || eltlen == 2 || eltlen == 4)
- && TYPE_CODE (elttype) == TYPE_CODE_CHAR
- && options->format == 0))
- {
- /* If requested, look for the first null char and only print
- elements up to it. */
- if (options->stop_print_at_null)
- {
- unsigned int temp_len;
-
- /* Look for a NULL char. */
- for (temp_len = 0;
- extract_unsigned_integer (valaddr + embedded_offset +
- temp_len * eltlen, eltlen,
- byte_order)
- && temp_len < len && temp_len < options->print_max;
- temp_len++);
- len = temp_len;
- }
-
- LA_PRINT_STRING (stream, TYPE_TARGET_TYPE (type),
- valaddr + embedded_offset, len, NULL, 0,
- options);
- i = len;
- }
- else
- {
- fprintf_filtered (stream, "{");
- /* If this is a virtual function table, print the 0th
- entry specially, and the rest of the members normally. */
- if (pascal_object_is_vtbl_ptr_type (elttype))
- {
- i = 1;
- fprintf_filtered (stream, "%d vtable entries", len - 1);
- }
- else
- {
- i = 0;
- }
- val_print_array_elements (type, embedded_offset,
- address, stream, recurse,
- original_value, options, i);
- fprintf_filtered (stream, "}");
- }
- break;
- }
- /* Array of unspecified length: treat like pointer to first elt. */
- addr = address + embedded_offset;
+ {
+ LONGEST low_bound, high_bound;
+
+ if (get_array_bounds (type, &low_bound, &high_bound))
+ {
+ len = high_bound - low_bound + 1;
+ elttype = check_typedef (TYPE_TARGET_TYPE (type));
+ eltlen = TYPE_LENGTH (elttype);
+ if (options->prettyformat_arrays)
+ {
+ print_spaces_filtered (2 + 2 * recurse, stream);
+ }
+ /* If 's' format is used, try to print out as string.
+ If no format is given, print as string if element type
+ is of TYPE_CODE_CHAR and element size is 1,2 or 4. */
+ if (options->format == 's'
+ || ((eltlen == 1 || eltlen == 2 || eltlen == 4)
+ && TYPE_CODE (elttype) == TYPE_CODE_CHAR
+ && options->format == 0))
+ {
+ /* If requested, look for the first null char and only print
+ elements up to it. */
+ if (options->stop_print_at_null)
+ {
+ unsigned int temp_len;
+
+ /* Look for a NULL char. */
+ for (temp_len = 0;
+ extract_unsigned_integer (valaddr + embedded_offset +
+ temp_len * eltlen, eltlen,
+ byte_order)
+ && temp_len < len && temp_len < options->print_max;
+ temp_len++);
+ len = temp_len;
+ }
+
+ LA_PRINT_STRING (stream, TYPE_TARGET_TYPE (type),
+ valaddr + embedded_offset, len, NULL, 0,
+ options);
+ i = len;
+ }
+ else
+ {
+ fprintf_filtered (stream, "{");
+ /* If this is a virtual function table, print the 0th
+ entry specially, and the rest of the members normally. */
+ if (pascal_object_is_vtbl_ptr_type (elttype))
+ {
+ i = 1;
+ fprintf_filtered (stream, "%d vtable entries", len - 1);
+ }
+ else
+ {
+ i = 0;
+ }
+ val_print_array_elements (type, embedded_offset,
+ address, stream, recurse,
+ original_value, options, i);
+ fprintf_filtered (stream, "}");
+ }
+ break;
+ }
+ /* Array of unspecified length: treat like pointer to first elt. */
+ addr = address + embedded_offset;
+ }
goto print_unpacked_pointer;
case TYPE_CODE_PTR:
{
struct type *range = elttype;
LONGEST low_bound, high_bound;
- int i;
int need_comma = 0;
fputs_filtered ("[", stream);
- i = get_discrete_bounds (range, &low_bound, &high_bound);
+ int bound_info = get_discrete_bounds (range, &low_bound, &high_bound);
if (low_bound == 0 && high_bound == -1 && TYPE_LENGTH (type) > 0)
{
/* If we know the size of the set type, we can figure out the
maximum value. */
- i = 0;
+ bound_info = 0;
high_bound = TYPE_LENGTH (type) * TARGET_CHAR_BIT - 1;
TYPE_HIGH_BOUND (range) = high_bound;
}
maybe_bad_bstring:
- if (i < 0)
+ if (bound_info < 0)
{
fputs_filtered ("<error value>", stream);
goto done;
for (arg = 0; arg < nargs; arg++)
{
- struct type *type = elts[pos + 3 + arg].type;
- struct objfile *objfile = TYPE_OBJFILE (type);
+ struct type *inst_type = elts[pos + 3 + arg].type;
+ struct objfile *inst_objfile = TYPE_OBJFILE (inst_type);
- if (objfile && (*objfile_func) (objfile, data))
+ if (inst_objfile && (*objfile_func) (inst_objfile, data))
return 1;
}
}
ULONGEST scnum;
enum gdb_syscall syscall_gdb;
int ret;
- int i;
regcache_raw_read_unsigned (regcache, tdep->ppc_gp0_regnum, &scnum);
syscall_gdb = ppc_canonicalize_syscall (scnum);
return ret;
/* Record registers clobbered during syscall. */
- for (i = 3; i <= 12; i++)
+ for (int i = 3; i <= 12; i++)
{
if (record_full_arch_list_add_reg (regcache, tdep->ppc_gp0_regnum + i))
return -1;
data.gprs, 0, sizeof data.gprs)
== sizeof data.gprs)
{
- auto cooked_read = [&data] (int regnum, gdb_byte *buf)
+ auto cooked_read = [&data] (int regnum, gdb_byte *out_buf)
{
- return ppu2spu_unwind_register (&data, regnum, buf);
+ return ppu2spu_unwind_register (&data, regnum, out_buf);
};
struct ppu2spu_cache *cache
= FRAME_OBSTACK_CALLOC (1, struct ppu2spu_cache);
struct type *func_type = function ? value_type (function) : NULL;
int opencl_abi = func_type? ppc_sysv_use_opencl_abi (func_type) : 0;
struct type *eltype;
- int nelt, i, ok;
+ int nelt, ok;
/* This function exists to support a calling convention that
requires floating-point registers. It shouldn't be used on
{
eltype = check_typedef (TYPE_TARGET_TYPE (valtype));
- for (i = 0; i < 2; i++)
+ for (int i = 0; i < 2; i++)
{
ok = ppc64_sysv_abi_return_value_base (gdbarch, eltype, regcache,
readbuf, writebuf, i);
eltype = register_type (gdbarch, tdep->ppc_vr0_regnum);
nelt = TYPE_LENGTH (valtype) / TYPE_LENGTH (eltype);
- for (i = 0; i < nelt; i++)
+ for (int i = 0; i < nelt; i++)
{
ok = ppc64_sysv_abi_return_value_base (gdbarch, eltype, regcache,
readbuf, writebuf, i);
&& tdep->vector_abi == POWERPC_VEC_ALTIVEC
&& TYPE_LENGTH (eltype) == 16)))
{
- for (i = 0; i < nelt; i++)
+ for (int i = 0; i < nelt; i++)
{
ok = ppc64_sysv_abi_return_value_base (gdbarch, eltype, regcache,
readbuf, writebuf, i);
{
int n_regs = ((TYPE_LENGTH (valtype) + tdep->wordsize - 1)
/ tdep->wordsize);
- int i;
- for (i = 0; i < n_regs; i++)
+ for (int i = 0; i < n_regs; i++)
{
gdb_byte regval[PPC_MAX_REGISTER_SIZE];
int regnum = tdep->ppc_gp0_regnum + 3 + i;
{
execute_command ("target record-btrace", from_tty);
}
- CATCH (exception, RETURN_MASK_ALL)
+ CATCH (ex, RETURN_MASK_ALL)
{
record_btrace_conf.format = BTRACE_FORMAT_NONE;
- throw_exception (exception);
+ throw_exception (ex);
}
END_CATCH
}
/* Test that read one raw register from regcache_no_target will go
to the target layer. */
- int regnum;
/* Find a raw register which size isn't zero. */
- for (regnum = 0; regnum < gdbarch_num_regs (gdbarch); regnum++)
+ int nonzero_regnum;
+ for (nonzero_regnum = 0;
+ nonzero_regnum < gdbarch_num_regs (gdbarch);
+ nonzero_regnum++)
{
- if (register_size (gdbarch, regnum) != 0)
+ if (register_size (gdbarch, nonzero_regnum) != 0)
break;
}
readwrite_regcache readwrite (gdbarch);
- gdb::def_vector<gdb_byte> buf (register_size (gdbarch, regnum));
+ gdb::def_vector<gdb_byte> buf (register_size (gdbarch, nonzero_regnum));
- readwrite.raw_read (regnum, buf.data ());
+ readwrite.raw_read (nonzero_regnum, buf.data ());
/* raw_read calls target_fetch_registers. */
SELF_CHECK (mock_target.fetch_registers_called > 0);
if (register_size (gdbarch, regnum) == 0)
continue;
- gdb::def_vector<gdb_byte> buf (register_size (gdbarch, regnum));
+ gdb::def_vector<gdb_byte> inner_buf (register_size (gdbarch, regnum));
- SELF_CHECK (REG_VALID == readwrite.cooked_read (regnum, buf.data ()));
+ SELF_CHECK (REG_VALID == readwrite.cooked_read (regnum,
+ inner_buf.data ()));
SELF_CHECK (mock_target.fetch_registers_called == 0);
SELF_CHECK (mock_target.store_registers_called == 0);
if (register_size (gdbarch, regnum) == 0)
continue;
- gdb::def_vector<gdb_byte> buf (register_size (gdbarch, regnum));
+ gdb::def_vector<gdb_byte> inner_buf (register_size (gdbarch, regnum));
enum register_status status = readonly.cooked_read (regnum,
- buf.data ());
+ inner_buf.data ());
if (regnum < gdbarch_num_regs (gdbarch))
{
remote_notice_new_inferior (item.ptid, executing);
- thread_info *tp = find_thread_ptid (item.ptid);
+ tp = find_thread_ptid (item.ptid);
remote_thread_info *info = get_remote_thread_info (tp);
info->core = item.core;
info->extra = std::move (item.extra);
ptid_t event_ptid;
struct target_waitstatus ws;
int ignore_event = 0;
- struct thread_info *thread;
memset (&ws, 0, sizeof (ws));
event_ptid = target_wait (waiton_ptid, &ws, TARGET_WNOHANG);
if (ignore_event)
continue;
- thread = find_thread_ptid (event_ptid);
+ struct thread_info *evthread = find_thread_ptid (event_ptid);
if (ws.kind == TARGET_WAITKIND_STOPPED)
{
instead of signal 0. Suppress it. */
if (sig == GDB_SIGNAL_TRAP)
sig = GDB_SIGNAL_0;
- thread->suspend.stop_signal = sig;
+ evthread->suspend.stop_signal = sig;
ws.value.sig = sig;
}
- thread->suspend.waitstatus = ws;
+ evthread->suspend.waitstatus = ws;
if (ws.kind != TARGET_WAITKIND_STOPPED
|| ws.value.sig != GDB_SIGNAL_0)
- thread->suspend.waitstatus_pending_p = 1;
+ evthread->suspend.waitstatus_pending_p = 1;
set_executing (event_ptid, 0);
set_running (event_ptid, 0);
- get_remote_thread_info (thread)->vcont_resumed = 0;
+ get_remote_thread_info (evthread)->vcont_resumed = 0;
}
/* "Notice" the new inferiors before anything related to
break;
case 'w': /* Thread exited. */
{
- const char *p;
ULONGEST value;
event->ws.kind = TARGET_WAITKIND_THREAD_EXITED;
case 'W': /* Target exited. */
case 'X':
{
- const char *p;
int pid;
ULONGEST value;
break;
case 'N': case 'T': case 'S': case 'X': case 'W':
{
- struct stop_reply *stop_reply;
-
/* There is a stop reply to handle. */
rs->waiting_for_stop_reply = 0;
&remote_protocol_packets[PACKET_qGetTLSAddr]);
if (result == PACKET_OK)
{
- ULONGEST result;
+ ULONGEST addr;
- unpack_varlen_hex (rs->buf, &result);
- return result;
+ unpack_varlen_hex (rs->buf, &addr);
+ return addr;
}
else if (result == PACKET_UNKNOWN)
throw_error (TLS_GENERIC_ERROR,
&remote_protocol_packets[PACKET_qGetTIBAddr]);
if (result == PACKET_OK)
{
- ULONGEST result;
-
- unpack_varlen_hex (rs->buf, &result);
+ ULONGEST val;
+ unpack_varlen_hex (rs->buf, &val);
if (addr)
- *addr = (CORE_ADDR) result;
+ *addr = (CORE_ADDR) val;
return true;
}
else if (result == PACKET_UNKNOWN)
struct riscv_arg_info *arg_info =
(struct riscv_arg_info *) alloca (nargs * sizeof (struct riscv_arg_info));
- struct riscv_arg_info *info;
struct riscv_call_info call_info (gdbarch);
if (struct_return)
++call_info.int_regs.next_regnum;
- for (i = 0, info = &arg_info[0];
- i < nargs;
- ++i, ++info)
+ for (i = 0; i < nargs; ++i)
{
struct value *arg_value;
struct type *arg_type;
+ struct riscv_arg_info *info = &arg_info[i];
arg_value = args[i];
arg_type = check_typedef (value_type (arg_value));
case 47: /* Store Multiple Word */
{
- ULONGEST addr = 0;
+ ULONGEST iaddr = 0;
if (PPC_RA (insn) != 0)
regcache_raw_read_unsigned (regcache,
tdep->ppc_gp0_regnum + PPC_RA (insn),
- &addr);
+ &iaddr);
- addr += PPC_D (insn);
- record_full_arch_list_add_mem (addr, 4 * (32 - PPC_RS (insn)));
+ iaddr += PPC_D (insn);
+ record_full_arch_list_add_mem (iaddr, 4 * (32 - PPC_RS (insn)));
}
break;
case 52: /* Store Floating-Point Single */
case 54: /* Store Floating-Point Double */
{
- ULONGEST addr = 0;
+ ULONGEST iaddr = 0;
int size = -1;
if (PPC_RA (insn) != 0)
regcache_raw_read_unsigned (regcache,
tdep->ppc_gp0_regnum + PPC_RA (insn),
- &addr);
- addr += PPC_D (insn);
+ &iaddr);
+ iaddr += PPC_D (insn);
if (op6 == 36 || op6 == 37 || op6 == 52 || op6 == 53)
size = 4;
else
gdb_assert (0);
- record_full_arch_list_add_mem (addr, size);
+ record_full_arch_list_add_mem (iaddr, size);
}
break;
/* Store Doubleword with Update */
/* Store Quadword with Update */
{
- ULONGEST addr = 0;
+ ULONGEST iaddr = 0;
int size;
int sub2 = PPC_FIELD (insn, 30, 2);
if (PPC_RA (insn) != 0)
regcache_raw_read_unsigned (regcache,
tdep->ppc_gp0_regnum + PPC_RA (insn),
- &addr);
+ &iaddr);
size = (sub2 == 2) ? 16 : 8;
- addr += PPC_DS (insn) << 2;
- record_full_arch_list_add_mem (addr, size);
+ iaddr += PPC_DS (insn) << 2;
+ record_full_arch_list_add_mem (iaddr, size);
if (op6 == 62 && sub2 == 1)
record_full_arch_list_add_reg (regcache,
const struct type_print_options *flags,
bool for_rust_enum, print_offset_data *podata)
{
- int i;
-
QUIT;
if (show <= 0
&& TYPE_NAME (type) != NULL)
if (varstring != NULL)
fputs_filtered (varstring, stream);
fputs_filtered ("(", stream);
- for (i = 0; i < TYPE_NFIELDS (type); ++i)
+ for (int i = 0; i < TYPE_NFIELDS (type); ++i)
{
QUIT;
if (i > 0)
case TYPE_CODE_ENUM:
{
- int i, len = 0;
+ int len = 0;
fputs_filtered ("enum ", stream);
if (TYPE_NAME (type) != NULL)
}
fputs_filtered ("{\n", stream);
- for (i = 0; i < TYPE_NFIELDS (type); ++i)
+ for (int i = 0; i < TYPE_NFIELDS (type); ++i)
{
const char *name = TYPE_FIELD_NAME (type, i);
Recognize this case by looking ahead a bit ... */
struct s390_prologue_data data2;
- pv_t *sp = &data2.gpr[S390_SP_REGNUM - S390_R0_REGNUM];
+ pv_t *sp2 = &data2.gpr[S390_SP_REGNUM - S390_R0_REGNUM];
if (!(s390_analyze_prologue (gdbarch, func, (CORE_ADDR)-1, &data2)
- && pv_is_register (*sp, S390_SP_REGNUM)
- && sp->k != 0))
+ && pv_is_register (*sp2, S390_SP_REGNUM)
+ && sp2->k != 0))
return 0;
}
}
uiout->text (" (");
if (print_args)
{
- struct gdbarch *gdbarch = get_frame_arch (frame);
int numargs;
if (gdbarch_frame_num_args_p (gdbarch))
if (return_value != NULL)
{
struct type *return_type = value_type (return_value);
- struct gdbarch *gdbarch = get_current_regcache ()->arch ();
+ struct gdbarch *cache_arch = get_current_regcache ()->arch ();
gdb_assert (rv_conv != RETURN_VALUE_STRUCT_CONVENTION
&& rv_conv != RETURN_VALUE_ABI_RETURNS_ADDRESS);
- gdbarch_return_value (gdbarch, function, return_type,
+ gdbarch_return_value (cache_arch, function, return_type,
get_current_regcache (), NULL /*read*/,
value_contents (return_value) /*write*/);
}
if (language == language_cplus || language == language_fortran)
{
- struct block_symbol sym
+ struct block_symbol blocksym
= cp_lookup_symbol_imports_or_template (scope, name, block,
domain);
- if (sym.symbol != NULL)
- return sym;
+ if (blocksym.symbol != NULL)
+ return blocksym;
}
if (BLOCK_FUNCTION (block) != NULL && block_inlined_p (block))
if (item->pc > pc && (!alt || item->pc < alt->pc))
alt = item;
- auto pc_compare = [](const CORE_ADDR & pc,
+ auto pc_compare = [](const CORE_ADDR & comp_pc,
const struct linetable_entry & lhs)->bool
{
- return pc < lhs.pc;
+ return comp_pc < lhs.pc;
};
struct linetable_entry *first = item;
}
unsigned char *ufrom = (unsigned char *) from;
- T dto;
long exponent;
unsigned long mant;
unsigned int mant_bits, mant_off;
mant_bits_left = fmt->man_len;
mant_off = fmt->man_start;
- dto = 0.0;
+ T dto = 0.0;
special_exponent = exponent == 0 || exponent == fmt->exp_nan;
struct tic6x_unwind_cache *cache,
struct frame_info *this_frame)
{
- unsigned long inst;
unsigned int src_reg, base_reg, dst_reg;
int i;
CORE_ADDR pc = start_pc;
}
/* Step 2: Skip insn on setting up dsbt if it is. Usually, it looks like,
ldw .D2T2 *+b14(0),b14 */
- inst = tic6x_fetch_instruction (gdbarch, pc);
+ unsigned long inst = tic6x_fetch_instruction (gdbarch, pc);
/* The s bit determines which file dst will be loaded into, same effect as
other places. */
dst_reg = tic6x_register_number ((inst >> 23) & 0x1f, (inst >> 1) & 1, 0);
if (typecode == TYPE_CODE_COMPLEX)
{
/* The argument is being passed by reference on stack. */
- CORE_ADDR addr;
references_offset = align_up (references_offset, 8);
addr = sp + references_offset;
merge_uploaded_trace_state_variables (struct uploaded_tsv **uploaded_tsvs)
{
struct uploaded_tsv *utsv;
- struct trace_state_variable *tsv;
int highest;
/* Most likely some numbers will have to be reassigned as part of
for (utsv = *uploaded_tsvs; utsv; utsv = utsv->next)
{
- tsv = find_matching_tsv (utsv);
+ struct trace_state_variable *tsv = find_matching_tsv (utsv);
if (tsv)
{
if (info_verbose)
int ix;
{
- ui_out_emit_tuple tuple_emitter (uiout, "tracepoints-at");
+ ui_out_emit_tuple inner_tuple_emitter (uiout, "tracepoints-at");
uiout->text (extra_field_indent);
uiout->text (_("Probed by static tracepoints: "));
{
struct tui_win_info *win_info;
int locator_changed_p;
- int i;
if (fi)
{
return 0;
tui_show_locator_content ();
- for (i = 0; i < (tui_source_windows ())->count; i++)
+ for (int i = 0; i < (tui_source_windows ())->count; i++)
{
win_info = (tui_source_windows ())->list[i];
tui_clear_source_content (win_info, EMPTY_SOURCE_PROMPT);
/* op[] */
{
- std::vector<gdb_byte> vec = {0x11, 0x22};
- gdb::array_view<gdb_byte> view = vec;
- gdb::array_view<const gdb_byte> cview = vec;
+ std::vector<gdb_byte> vec2 = {0x11, 0x22};
+ gdb::array_view<gdb_byte> view = vec2;
+ gdb::array_view<const gdb_byte> cview = vec2;
/* Check that op[] on a non-const view of non-const T returns a
mutable reference. */
view[0] = 0x33;
- SELF_CHECK (vec[0] == 0x33);
+ SELF_CHECK (vec2[0] == 0x33);
/* OTOH, check that assigning through op[] on a view of const T
wouldn't compile. */
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
int argreg;
int argnum;
- int len = 0;
+ int arg_space = 0;
int stack_offset;
if (gdbarch_tdep (gdbarch)->abi == V850_ABI_RH850)
/* Now make space on the stack for the args. */
for (argnum = 0; argnum < nargs; argnum++)
- len += ((TYPE_LENGTH (value_type (args[argnum])) + 3) & ~3);
- sp -= len + stack_offset;
+ arg_space += ((TYPE_LENGTH (value_type (args[argnum])) + 3) & ~3);
+ sp -= arg_space + stack_offset;
argreg = E_ARG0_REGNUM;
/* The struct_return pointer occupies the first parameter register. */
&& TYPE_CODE (check_typedef (SYMBOL_TYPE (fsym)))
== TYPE_CODE_FUNC)
{
- char *temp;
+ char *temp_func;
- temp = cp_func_name (qualified_name);
+ temp_func = cp_func_name (qualified_name);
/* If cp_func_name did not remove anything, the name of the
symbol did not include scope or argument types - it was
probably a C-style function. */
- if (temp)
+ if (temp_func)
{
- make_cleanup (xfree, temp);
- if (strcmp (temp, qualified_name) == 0)
+ make_cleanup (xfree, temp_func);
+ if (strcmp (temp_func, qualified_name) == 0)
func_name = NULL;
else
- func_name = temp;
+ func_name = temp_func;
}
}
}
{
struct type *t = check_typedef (curtype);
int i;
- struct value *v, *result;
+ struct value *result;
if (TYPE_CODE (t) != TYPE_CODE_STRUCT
&& TYPE_CODE (t) != TYPE_CODE_UNION)
{
if (field_is_static (&TYPE_FIELD (t, i)))
{
- v = value_static_field (t, i);
+ struct value *v = value_static_field (t, i);
if (want_address)
v = value_addr (v);
return v;
/* Try to evaluate NAME as a qualified name with implicit
this pointer. In this case, attempt to return the
equivalent to `this->*(&TYPE::NAME)'. */
- v = value_of_this_silent (current_language);
+ struct value *v = value_of_this_silent (current_language);
if (v != NULL)
{
struct value *ptr;
if (s == NULL)
return NULL;
- v = read_var_value (s, 0, 0);
+ struct value *v = read_var_value (s, 0, 0);
if (!want_address)
result = v;
else
{
enum bfd_endian byte_order
= gdbarch_byte_order (get_type_arch (type));
- gdb_byte *buf;
+ gdb_byte *c_buf;
int need_escape = 0;
- buf = (gdb_byte *) alloca (TYPE_LENGTH (type));
- pack_long (buf, type, c);
+ c_buf = (gdb_byte *) alloca (TYPE_LENGTH (type));
+ pack_long (c_buf, type, c);
- wchar_iterator iter (buf, TYPE_LENGTH (type), encoding, TYPE_LENGTH (type));
+ wchar_iterator iter (c_buf, TYPE_LENGTH (type), encoding, TYPE_LENGTH (type));
/* This holds the printable form of the wchar_t data. */
auto_obstack wchar_buf;
for which -var-list-children was never invoked. */
if (varobj_is_dynamic_p (v))
{
- std::vector<varobj *> changed, type_changed, unchanged, newobj;
+ std::vector<varobj *> changed, type_changed_vec, unchanged, newobj_vec;
bool children_changed = false;
if (v->frozen)
/* If update_dynamic_varobj_children returns false, then we have
a non-conforming pretty-printer, so we skip it. */
- if (update_dynamic_varobj_children (v, &changed, &type_changed, &newobj,
- &unchanged, &children_changed, true,
- v->from, v->to))
+ if (update_dynamic_varobj_children (v, &changed, &type_changed_vec,
+ &newobj_vec,
+ &unchanged, &children_changed,
+ true, v->from, v->to))
{
- if (children_changed || !newobj.empty ())
+ if (children_changed || !newobj_vec.empty ())
{
r.children_changed = true;
- r.newobj = std::move (newobj);
+ r.newobj = std::move (newobj_vec);
}
/* Push in reverse order so that the first child is
popped from the work stack first, and so will be
added to result first. This does not affect
correctness, just "nicer". */
- for (int i = type_changed.size () - 1; i >= 0; --i)
+ for (int i = type_changed_vec.size () - 1; i >= 0; --i)
{
- varobj_update_result r (type_changed[i]);
+ varobj_update_result item (type_changed_vec[i]);
/* Type may change only if value was changed. */
- r.changed = true;
- r.type_changed = true;
- r.value_installed = true;
+ item.changed = true;
+ item.type_changed = true;
+ item.value_installed = true;
- stack.push_back (std::move (r));
+ stack.push_back (std::move (item));
}
for (int i = changed.size () - 1; i >= 0; --i)
{
- varobj_update_result r (changed[i]);
+ varobj_update_result item (changed[i]);
- r.changed = true;
- r.value_installed = true;
+ item.changed = true;
+ item.value_installed = true;
- stack.push_back (std::move (r));
+ stack.push_back (std::move (item));
}
for (int i = unchanged.size () - 1; i >= 0; --i)
{
if (!unchanged[i]->frozen)
{
- varobj_update_result r (unchanged[i]);
+ varobj_update_result item (unchanged[i]);
- r.value_installed = true;
+ item.value_installed = true;
- stack.push_back (std::move (r));
+ stack.push_back (std::move (item));
}
}
if (r.changed || r.children_changed)
case C_BSTAT:
/* Begin static block. */
{
- struct internal_syment symbol;
+ struct internal_syment static_symbol;
- read_symbol (&symbol, cs->c_value);
- static_block_base = symbol.n_value;
+ read_symbol (&static_symbol, cs->c_value);
+ static_block_base = static_symbol.n_value;
static_block_section =
- secnum_to_section (symbol.n_scnum, objfile);
+ secnum_to_section (static_symbol.n_scnum, objfile);
}
break;
int argreg = E_1ST_ARG_REGNUM;
int i, j;
int typelen, slacklen;
- const gdb_byte *val;
gdb_byte buf[xstormy16_pc_size];
/* If struct_return is true, then the struct return address will
break;
/* Put argument into registers wordwise. */
- val = value_contents (args[i]);
+ const gdb_byte *val = value_contents (args[i]);
for (j = 0; j < typelen; j += xstormy16_reg_size)
{
ULONGEST regval;
CORE_ADDR struct_addr)
{
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- int i;
int size, onstack_size;
gdb_byte *buf = (gdb_byte *) alloca (16);
CORE_ADDR ra, ps;
if (xtensa_debug_level > 3)
{
- int i;
DEBUGINFO ("[xtensa_push_dummy_call] nargs = %d\n", nargs);
DEBUGINFO ("[xtensa_push_dummy_call] sp=0x%x, struct_return=%d, "
"struct_addr=0x%x\n",
(int) sp, (int) struct_return, (int) struct_addr);
- for (i = 0; i < nargs; i++)
+ for (int i = 0; i < nargs; i++)
{
struct value *arg = args[i];
struct type *arg_type = check_typedef (value_type (arg));
size = 0;
onstack_size = 0;
- i = 0;
if (struct_return)
size = REGISTER_SIZE;
- for (i = 0; i < nargs; i++)
+ for (int i = 0; i < nargs; i++)
{
struct argument_info *info = &arg_info[i];
struct value *arg = args[i];
regcache->cooked_write (ARG_1ST (gdbarch), buf);
}
- for (i = 0; i < nargs; i++)
+ for (int i = 0; i < nargs; i++)
{
struct argument_info *info = &arg_info[i];