From: Simon Marchi Date: Sat, 11 Oct 2025 03:59:32 +0000 (-0400) Subject: gdb, gdbserver, gdbsupport: trim trailing whitespaces X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a5cbe67512d3cfb1767733c8de74b70b45ebe052;p=thirdparty%2Fbinutils-gdb.git gdb, gdbserver, gdbsupport: trim trailing whitespaces I noticed my IDE (VSCode) starting to automatically trim trailing whitespaces on save, despite the setting for it being disabled. I realized that this is because the .editorconfig file now has trim_trailing_whitespace = true for many file types. If we have this EditorConfig setting forcing editors to trim trailing whitespaces, I think it would make sense to clean up trailing whitespaces from our files. Otherwise, people will always get spurious whitespace changes when editing these files. I did a mass cleanup using this command: $ find gdb gdbserver gdbsupport -type f \( \ -name "*.c" -o \ -name "*.h" -o \ -name "*.cc" -o \ -name "*.texi" -o \ -name "*.exp" -o \ -name "*.tcl" -o \ -name "*.py" -o \ -name "*.s" -o \ -name "*.S" -o \ -name "*.asm" -o \ -name "*.awk" -o \ -name "*.ac" -o \ -name "Makefile*" -o \ -name "*.sh" -o \ -name "*.adb" -o \ -name "*.ads" -o \ -name "*.d" -o \ -name "*.go" -o \ -name "*.F90" -o \ -name "*.f90" \ \) -exec sed -ri 's/[ \t]+$//' {} + I then did an autotools regen, because we don't actually want to change the Makefile and Makefile.in files that are generated. Change-Id: I6f91b83e3b8c4dc7d5d51a2ebf60706120efe691 --- diff --git a/gdb/aarch64-ravenscar-thread.h b/gdb/aarch64-ravenscar-thread.h index 198d05292b8..2820caa98fc 100644 --- a/gdb/aarch64-ravenscar-thread.h +++ b/gdb/aarch64-ravenscar-thread.h @@ -1,5 +1,5 @@ /* Ravenscar Aarch64 target support. - + Copyright (C) 2017-2025 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 4d363e643bb..89c33a84d1d 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -448,7 +448,7 @@ static const char * ada_unqualified_name (const char *decoded_name) { const char *result; - + /* If the decoded name starts with '<', it means that the encoded name does not follow standard naming conventions, and thus that it is not your typical Ada symbol name. Trying to unqualify it @@ -1445,7 +1445,7 @@ ada_decode (const char *encoded, bool wrap, bool translate) && c_isdigit (encoded [i+4])) { int k = i + 5; - + while (k < len0 && c_isdigit (encoded[k])) k++; /* Skip any extra digit. */ @@ -1641,7 +1641,7 @@ ada_decode_tests () /* Table for keeping permanent unique copies of decoded names. Once allocated, names in this table are never released. While this is a storage leak, it should not be significant unless there are massive - changes in the set of decoded names in successive versions of a + changes in the set of decoded names in successive versions of a symbol table loaded during a single session. */ static gdb::string_set decoded_names_store; @@ -2104,7 +2104,7 @@ desc_arity (struct type *type) return 0; } -/* Non-zero iff TYPE is a simple array type (not a pointer to one) or +/* Non-zero iff TYPE is a simple array type (not a pointer to one) or an array descriptor type (representing an unconstrained array type). */ @@ -2826,7 +2826,7 @@ ada_unpack_from_contents (const gdb_byte *src, int bit_offset, int bit_size, proceeding for BIT_SIZE bits. If OBJ is an lval in memory, then assigning through the result will set the field fetched from. VALADDR is ignored unless OBJ is NULL, in which case, - VALADDR+OFFSET must address the start of storage containing the + VALADDR+OFFSET must address the start of storage containing the packed value. The value returned in this case is never an lval. Assumes 0 <= BIT_OFFSET < HOST_CHAR_BIT. */ @@ -4351,19 +4351,19 @@ possible_user_operator_p (enum exp_opcode op, struct value *args[]) /* Renaming */ -/* NOTES: +/* NOTES: 1. In the following, we assume that a renaming type's name may have an ___XD suffix. It would be nice if this went away at some point. - 2. We handle both the (old) purely type-based representation of + 2. We handle both the (old) purely type-based representation of renamings and the (new) variable-based encoding. At some point, - it is devoutly to be hoped that the former goes away + it is devoutly to be hoped that the former goes away (FIXME: hilfinger-2007-07-09). 3. Subprogram renamings are not implemented, although the XRS suffix is recognized (FIXME: hilfinger-2007-07-09). */ -/* If SYM encodes a renaming, +/* If SYM encodes a renaming, renames , @@ -4384,7 +4384,7 @@ possible_user_operator_p (enum exp_opcode op, struct value *args[]) enum ada_renaming_category ada_parse_renaming (struct symbol *sym, - const char **renamed_entity, int *len, + const char **renamed_entity, int *len, const char **renaming_expr) { enum ada_renaming_category kind; @@ -4851,7 +4851,7 @@ standard_lookup (const char *name, const struct block *block, /* Non-zero iff there is at least one non-function/non-enumeral symbol - in the symbol fields of SYMS. We treat enumerals as functions, + in the symbol fields of SYMS. We treat enumerals as functions, since they contend in overloading in the same way. */ static int is_nonfunction (const std::vector &syms) @@ -5167,7 +5167,7 @@ remove_extra_symbols (std::vector &syms) remove_p = true; } } - + /* Two functions with the same block are identical. */ else if (syms[i].symbol->loc_class () == LOC_BLOCK) @@ -5298,14 +5298,14 @@ old_renaming_is_invisible (const struct symbol *sym, const char *function_name) remove from the SYMS list renaming symbols that should be visible from CURRENT_BLOCK. However, there does not seem be a 100% reliable method with the current information available. The implementation - below has a couple of limitations (FIXME: brobecker-2003-05-12): - + below has a couple of limitations (FIXME: brobecker-2003-05-12): + - When the user tries to print a rename in a function while there is another rename entity defined in a package: Normally, the rename in the function has precedence over the rename in the package, so the latter should be removed from the list. This is currently not the case. - + - This function will incorrectly remove valid renames if the CURRENT_BLOCK corresponds to a function which symbol name has been changed by an "Export" pragma. As a consequence, @@ -5454,7 +5454,7 @@ match_data::operator() (struct block_symbol *bsym) found_sym = false; arg_sym = NULL; } - else + else { if (sym->loc_class () == LOC_UNRESOLVED) return true; @@ -5683,7 +5683,7 @@ ada_add_all_symbols (std::vector &result, *made_global_lookup_p = 1; /* Search symbols from all global blocks. */ - + add_nonlocal_symbols (result, lookup_name, domain, 1); /* Now add symbols from all per-file blocks if we've gotten no hits @@ -5815,7 +5815,7 @@ is_name_suffix (const char *str) while (c_isdigit (str[0])) str += 1; } - + /* [.$][0-9]+ */ if (str[0] == '.' || str[0] == '$') @@ -6911,19 +6911,19 @@ ada_value_primitive_field (struct value *arg1, int offset, int fieldno, return arg1->primitive_field (offset, fieldno, arg_type); } -/* Find field with name NAME in object of type TYPE. If found, +/* Find field with name NAME in object of type TYPE. If found, set the following for each argument that is non-null: - - *FIELD_TYPE_P to the field's type; - - *BYTE_OFFSET_P to OFFSET + the byte offset of the field within + - *FIELD_TYPE_P to the field's type; + - *BYTE_OFFSET_P to OFFSET + the byte offset of the field within an object of that type; - - *BIT_OFFSET_P to the bit offset modulo byte size of the field; - - *BIT_SIZE_P to its size in bits if the field is packed, and + - *BIT_OFFSET_P to the bit offset modulo byte size of the field; + - *BIT_SIZE_P to its size in bits if the field is packed, and 0 otherwise; If INDEX_P is non-null, increment *INDEX_P by the number of source-visible fields up to but not including the desired field, or by the total number of fields if not found. A NULL value of NAME never matches; the function just counts visible fields in this case. - + Notice that we need to handle when a tagged record hierarchy has some components with the same name, like in this scenario: @@ -7050,7 +7050,7 @@ find_struct_field (const char *name, struct type *type, int offset, } else if (ada_is_variant_part (type, i)) { - /* PNH: Wait. Do we ever execute this section, or is ARG always of + /* PNH: Wait. Do we ever execute this section, or is ARG always of fixed type?? */ int j; struct type *field_type @@ -7264,7 +7264,7 @@ type_as_string (struct type *type) Matches any field whose name has NAME as a prefix, possibly followed by "___". - TYPE can be either a struct or union. If REFOK, TYPE may also + TYPE can be either a struct or union. If REFOK, TYPE may also be a (pointer or reference)+ to a struct or union, and the ultimate target type will be searched. @@ -8428,13 +8428,13 @@ to_fixed_array_type (struct type *type0, struct value *dval, DVAL describes a record containing any discriminants used in TYPE0, and may be NULL if there are none, or if the object of type TYPE at ADDRESS or in VALADDR contains these discriminants. - + If CHECK_TAG is not null, in the case of tagged types, this function attempts to locate the object's tag and use it to compute the actual type. However, when ADDRESS is null, we cannot use it to determine the location of the tag, and therefore compute the tagged type's actual type. So we return the tagged type without consulting the tag. */ - + static struct type * ada_to_fixed_type_1 (struct type *type, const gdb_byte *valaddr, CORE_ADDR address, struct value *dval, int check_tag) @@ -8885,7 +8885,7 @@ ada_is_character_type (struct type *type) and don't check any further. */ if (type->code () == TYPE_CODE_CHAR) return true; - + /* Otherwise, assume it's a character type iff it is a discrete type with a known character type name. */ name = ada_type_name (type); @@ -9815,7 +9815,7 @@ aggregate_assigner::add_interval (LONGEST from, LONGEST to) else if (to < indices[i]) break; } - + indices.resize (indices.size () + 2); for (j = indices.size () - 1; j >= i + 2; j -= 1) indices[j] = indices[j - 2]; @@ -10486,7 +10486,7 @@ ada_unop_atr (struct expression *exp, enum noside noside, enum exp_opcode op, default: error (_("unexpected attribute encountered")); case OP_ATR_FIRST: - return value_from_longest + return value_from_longest (range_type, ada_discrete_type_low_bound (range_type)); case OP_ATR_LAST: return value_from_longest @@ -11962,7 +11962,7 @@ ada_find_printable_frame (const frame_info_ptr &initial_fi) /* Assuming that the inferior just triggered an unhandled exception catchpoint, return the address in inferior memory where the name of the exception is stored. - + Return zero if the address could not be computed. */ static CORE_ADDR @@ -11990,7 +11990,7 @@ ada_unhandled_exception_name_addr_from_raise (void) fi = get_current_frame (); for (frame_level = 0; frame_level < 3; frame_level += 1) if (fi != NULL) - fi = get_prev_frame (fi); + fi = get_prev_frame (fi); while (fi != NULL) { @@ -12459,7 +12459,7 @@ ada_catchpoint::print_it (const bpstat *bs) const bool ada_catchpoint::print_one (const bp_location **last_loc) const -{ +{ struct ui_out *uiout = current_uiout; struct value_print_options opts; @@ -12481,13 +12481,13 @@ ada_catchpoint::print_one (const bp_location **last_loc) const } else uiout->field_string ("what", "all Ada exceptions"); - + break; case ada_catch_exception_unhandled: uiout->field_string ("what", "unhandled Ada exceptions"); break; - + case ada_catch_handlers: if (!m_excep_string.empty ()) { @@ -12603,7 +12603,7 @@ is_ada_exception_catchpoint (breakpoint *bp) return dynamic_cast (bp) != nullptr; } -/* Split the arguments specified in a "catch exception" command. +/* Split the arguments specified in a "catch exception" command. Set EX to the appropriate catchpoint type. Set EXCEP_STRING to the name of the specific exception if specified by the user. diff --git a/gdb/ada-tasks.c b/gdb/ada-tasks.c index f9551d445df..3298b04d64b 100644 --- a/gdb/ada-tasks.c +++ b/gdb/ada-tasks.c @@ -348,7 +348,7 @@ ada_get_task_number (thread_info *thread) /* Return the task number of the task running in inferior INF which matches TASK_ID , or zero if the task could not be found. */ - + static int get_task_number_from_id (CORE_ADDR task_id, struct inferior *inf) { @@ -1324,7 +1324,7 @@ info_task (struct ui_out *uiout, const char *taskno_str, struct inferior *inf) /* If ARG is empty or null, then print a list of all Ada tasks. Otherwise, print detailed information about the task whose ID is ARG. - + Does nothing if the program doesn't use Ada tasking. */ static void @@ -1377,7 +1377,7 @@ task_command_1 (const char *taskno_str, int from_tty, struct inferior *inf) if (!ada_task_is_alive (task_info)) error (_("Cannot switch to task %s: Task is no longer running"), task_to_str (taskno, task_info).c_str ()); - + /* On some platforms, the thread list is not updated until the user performs a thread-related operation (by using the "info threads" command, for instance). So this thread list may not be up to date diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index 5829a9b4ef3..2bafa5de68d 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -542,7 +542,7 @@ print_variant_clauses (struct type *var_type, struct type *discr_type, /* Assuming that field FIELD_NUM of TYPE represents variants whose discriminant is contained in OUTER_TYPE, print its components on STREAM. LEVEL is the recursion (indentation) level, in case any of the fields - themselves have nested structure, and SHOW is the number of levels of + themselves have nested structure, and SHOW is the number of levels of internal structure to show (see ada_print_type). For this purpose, fields nested in a variant part are taken to be at the same level as the fields immediately outside the variant part. */ @@ -789,7 +789,7 @@ print_record_field_types (struct type *type, struct type *outer_type, 0, type->num_fields () - 1, stream, show, level, flags); } - + /* Print record type TYPE on STREAM. LEVEL is the recursion (indentation) level, in case the element type itself has nested structure, and SHOW is @@ -1040,7 +1040,7 @@ ada_print_type (struct type *type0, const char *varstring, gdb_printf (stream, ">"); } else if (ada_is_modular_type (type)) - gdb_printf (stream, "mod %s", + gdb_printf (stream, "mod %s", int_string (ada_modulus (type), 10, 0, 0, 1)); else { diff --git a/gdb/addrmap.c b/gdb/addrmap.c index 2b333a1fd70..ff4a9beed5d 100644 --- a/gdb/addrmap.c +++ b/gdb/addrmap.c @@ -311,7 +311,7 @@ addrmap_fixed::addrmap_fixed (struct obstack *obstack, transitions[0].addr = 0; transitions[0].value = NULL; - /* Copy all entries from the splay tree to the array, in order + /* Copy all entries from the splay tree to the array, in order of increasing address. */ mut->foreach ([&] (CORE_ADDR start, const void *obj) { diff --git a/gdb/addrmap.h b/gdb/addrmap.h index 398bdd84215..440d733be8e 100644 --- a/gdb/addrmap.h +++ b/gdb/addrmap.h @@ -200,7 +200,7 @@ private: transition at address T if T-1 and T map to different objects. Any addresses below the first node map to NULL. (Unlike - fixed maps, we have no entry at (CORE_ADDR) 0; it doesn't + fixed maps, we have no entry at (CORE_ADDR) 0; it doesn't simplify enough.) The last region is assumed to end at CORE_ADDR_MAX. diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c index 7007f76b85a..d81a0dc851c 100644 --- a/gdb/aix-thread.c +++ b/gdb/aix-thread.c @@ -147,10 +147,10 @@ static int pdc_symbol_addrs (pthdb_user_t, pthdb_symbol_t *, int); static int pdc_read_data (pthdb_user_t, void *, pthdb_addr_t, size_t); static int pdc_write_data (pthdb_user_t, void *, pthdb_addr_t, size_t); static int pdc_read_regs (pthdb_user_t user, pthdb_tid_t tid, - unsigned long long flags, + unsigned long long flags, pthdb_context_t *context); static int pdc_write_regs (pthdb_user_t user, pthdb_tid_t tid, - unsigned long long flags, + unsigned long long flags, pthdb_context_t *context); static int pdc_alloc (pthdb_user_t, size_t, void **); static int pdc_realloc (pthdb_user_t, void *, size_t, void **); @@ -300,7 +300,7 @@ ptrace_check (int req, int id, int ret) if (ret == -1 && errno == EPERM) { if (debug_aix_thread) - gdb_printf (gdb_stdlog, + gdb_printf (gdb_stdlog, "ptrace (%d, %d) = %d (errno = %d)\n", req, id, ret, errno); return ret == -1 ? 0 : 1; @@ -353,7 +353,7 @@ static int ptrace32 (int req, int id, addr_ptr addr, int data, int *buf) { errno = 0; - return ptrace_check (req, id, + return ptrace_check (req, id, ptrace (req, id, addr, data, buf)); } @@ -388,7 +388,7 @@ pdc_symbol_addrs (pthdb_user_t user_current_pid, pthdb_symbol_t *symbols, int co { name = symbols[i].name; if (debug_aix_thread) - gdb_printf (gdb_stdlog, + gdb_printf (gdb_stdlog, " symbols[%d].name = \"%s\"\n", i, name); if (!*name) @@ -417,7 +417,7 @@ pdc_symbol_addrs (pthdb_user_t user_current_pid, pthdb_symbol_t *symbols, int co /* Read registers call back function should be able to read the context information of a debuggee kernel thread from an active process or from a core file. The information should be formatted - in context64 form for both 32-bit and 64-bit process. + in context64 form for both 32-bit and 64-bit process. If successful return 0, else non-zero is returned. */ static int @@ -450,7 +450,7 @@ pdc_read_regs (pthdb_user_t user_current_pid, { if (data->arch64) { - if (!ptrace64aix (PTT_READ_GPRS, tid, + if (!ptrace64aix (PTT_READ_GPRS, tid, (unsigned long) gprs64, 0, NULL)) memset (gprs64, 0, sizeof (gprs64)); memcpy (context->gpr, gprs64, sizeof(gprs64)); @@ -476,7 +476,7 @@ pdc_read_regs (pthdb_user_t user_current_pid, { if (data->arch64) { - if (!ptrace64aix (PTT_READ_SPRS, tid, + if (!ptrace64aix (PTT_READ_SPRS, tid, (unsigned long) &sprs64, 0, NULL)) memset (&sprs64, 0, sizeof (sprs64)); memcpy (&context->msr, &sprs64, sizeof(sprs64)); @@ -487,7 +487,7 @@ pdc_read_regs (pthdb_user_t user_current_pid, memset (&sprs32, 0, sizeof (sprs32)); memcpy (&context->msr, &sprs32, sizeof(sprs32)); } - } + } /* vector registers. */ __vmx_context_t vmx; @@ -536,7 +536,7 @@ pdc_write_regs (pthdb_user_t user_current_pid, pthdb_tid_t tid, unsigned long long flags, pthdb_context_t *context) -{ +{ /* This function doesn't appear to be used, so we could probably just return 0 here. HOWEVER, if it is not defined, the OS will complain and several thread debug functions will fail. In case @@ -555,7 +555,7 @@ pdc_write_regs (pthdb_user_t user_current_pid, if (flags & PTHDB_FLAG_GPRS) { if (data->arch64) - ptrace64aix (PTT_WRITE_GPRS, tid, + ptrace64aix (PTT_WRITE_GPRS, tid, (unsigned long) context->gpr, 0, NULL); else ptrace32 (PTT_WRITE_GPRS, tid, (uintptr_t) context->gpr, 0, NULL); @@ -572,7 +572,7 @@ pdc_write_regs (pthdb_user_t user_current_pid, { if (data->arch64) { - ptrace64aix (PTT_WRITE_SPRS, tid, + ptrace64aix (PTT_WRITE_SPRS, tid, (unsigned long) &context->msr, 0, NULL); } else @@ -670,7 +670,7 @@ pdc_alloc (pthdb_user_t user_current_pid, size_t len, void **bufp) user_current_pid, len, (long) bufp); *bufp = xmalloc (len); if (debug_aix_thread) - gdb_printf (gdb_stdlog, + gdb_printf (gdb_stdlog, " malloc returned 0x%lx\n", (long) *bufp); /* Note: xmalloc() can't return 0; therefore PDC_FAILURE will never @@ -692,7 +692,7 @@ pdc_realloc (pthdb_user_t user_current_pid, void *buf, size_t len, void **bufp) user_current_pid, (long) buf, len, (long) bufp); *bufp = xrealloc (buf, len); if (debug_aix_thread) - gdb_printf (gdb_stdlog, + gdb_printf (gdb_stdlog, " realloc returned 0x%lx\n", (long) *bufp); return *bufp ? PDC_SUCCESS : PDC_FAILURE; } @@ -704,7 +704,7 @@ static int pdc_dealloc (pthdb_user_t user_current_pid, void *buf) { if (debug_aix_thread) - gdb_printf (gdb_stdlog, + gdb_printf (gdb_stdlog, "pdc_free (user_current_pid = %ld, buf = 0x%lx)\n", user_current_pid, (long) buf); xfree (buf); @@ -1127,7 +1127,7 @@ aix_thread_target::wait (ptid_t ptid, struct target_waitstatus *status, /* Supply AIX altivec registers, both 64 and 32 bit. */ -static void +static void supply_altivec_regs (struct regcache *regcache, __vmx_context_t vmx) { ppc_gdbarch_tdep *tdep @@ -1275,7 +1275,7 @@ fetch_regs_user_thread (struct regcache *regcache, pthdb_pthread_t pdtid) data = get_thread_data_helper_for_ptid (inferior_ptid); if (debug_aix_thread) - gdb_printf (gdb_stdlog, + gdb_printf (gdb_stdlog, "fetch_regs_user_thread %lx\n", (long) pdtid); status = pthdb_pthread_context (data->pd_session, pdtid, &ctx); if (status != PTHDB_SUCCESS) @@ -1354,7 +1354,7 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno, { if (data->arch64) { - if (!ptrace64aix (PTT_READ_GPRS, tid, + if (!ptrace64aix (PTT_READ_GPRS, tid, (unsigned long) gprs64, 0, NULL)) memset (gprs64, 0, sizeof (gprs64)); supply_gprs64 (regcache, gprs64); @@ -1418,7 +1418,7 @@ fetch_regs_kernel_thread (struct regcache *regcache, int regno, { if (data->arch64) { - if (!ptrace64aix (PTT_READ_SPRS, tid, + if (!ptrace64aix (PTT_READ_SPRS, tid, (unsigned long) &sprs64, 0, NULL)) memset (&sprs64, 0, sizeof (sprs64)); supply_sprs64 (regcache, sprs64.pt_iar, sprs64.pt_msr, @@ -1517,7 +1517,7 @@ fill_gprs64 (const struct regcache *regcache, uint64_t *vals) regcache->raw_collect (tdep->ppc_gp0_regnum + regno, vals + regno); } -static void +static void fill_gprs32 (const struct regcache *regcache, uint32_t *vals) { ppc_gdbarch_tdep *tdep @@ -1641,7 +1641,7 @@ store_regs_user_thread (const struct regcache *regcache, pthdb_pthread_t pdtid) __vsx_context_t vsx; if (debug_aix_thread) - gdb_printf (gdb_stdlog, + gdb_printf (gdb_stdlog, "store_regs_user_thread %lx\n", (long) pdtid); /* Retrieve the thread's current context for its non-register @@ -1768,7 +1768,7 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno, data = get_thread_data_helper_for_ptid (regcache->ptid ()); if (debug_aix_thread) - gdb_printf (gdb_stdlog, + gdb_printf (gdb_stdlog, "store_regs_kernel_thread tid=%lx regno=%d\n", (long) tid, regno); @@ -1813,12 +1813,12 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno, if (data->arch64) { /* Pre-fetch: some registers won't be in the cache. */ - ptrace64aix (PTT_READ_SPRS, tid, + ptrace64aix (PTT_READ_SPRS, tid, (unsigned long) &sprs64, 0, NULL); fill_sprs64 (regcache, &sprs64.pt_iar, &sprs64.pt_msr, &sprs64.pt_cr, &sprs64.pt_lr, &sprs64.pt_ctr, &sprs64.pt_xer, &sprs64.pt_fpscr); - ptrace64aix (PTT_WRITE_SPRS, tid, + ptrace64aix (PTT_WRITE_SPRS, tid, (unsigned long) &sprs64, 0, NULL); } else @@ -1856,7 +1856,7 @@ store_regs_kernel_thread (const struct regcache *regcache, int regno, ptrace32 (PTT_WRITE_SPRS, tid, (uintptr_t) &sprs32, 0, NULL); } } - + /* Vector registers. */ if (tdep->ppc_vr0_regnum != -1 && tdep->ppc_vrsave_regnum != -1 && (regno == -1 || (regno >= tdep->ppc_vr0_regnum diff --git a/gdb/alpha-mdebug-tdep.c b/gdb/alpha-mdebug-tdep.c index b22641e776e..b8fe8f653e5 100644 --- a/gdb/alpha-mdebug-tdep.c +++ b/gdb/alpha-mdebug-tdep.c @@ -285,7 +285,7 @@ alpha_mdebug_frame_prev_register (const frame_info_ptr &this_frame, the correct place. */ if (regnum == ALPHA_PC_REGNUM) regnum = PROC_PC_REG (info->proc_desc); - + return trad_frame_get_prev_register (this_frame, info->saved_regs, regnum); } diff --git a/gdb/alpha-netbsd-tdep.c b/gdb/alpha-netbsd-tdep.c index 56143eeedf7..2122ddfa0fd 100644 --- a/gdb/alpha-netbsd-tdep.c +++ b/gdb/alpha-netbsd-tdep.c @@ -82,8 +82,8 @@ alphanbsd_aout_supply_gregset (const struct regset *regset, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 13, 14, 15, - 30, 31, 32, 16, + 12, 13, 14, 15, + 30, 31, 32, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 29, 26 diff --git a/gdb/alpha-tdep.c b/gdb/alpha-tdep.c index 654cef2c2f2..0e29889160f 100644 --- a/gdb/alpha-tdep.c +++ b/gdb/alpha-tdep.c @@ -118,7 +118,7 @@ static int alpha_register_reggroup_p (struct gdbarch *gdbarch, int regnum, const struct reggroup *group) { - /* Filter out any registers eliminated, but whose regnum is + /* Filter out any registers eliminated, but whose regnum is reserved for backward compatibility, e.g. the vfp. */ if (*gdbarch_register_name (gdbarch, regnum) == '\0') return 0; @@ -510,7 +510,7 @@ alpha_extract_return_value (struct type *valtype, struct regcache *regcache, } } -/* Insert the given value into REGCACHE as if it was being +/* Insert the given value into REGCACHE as if it was being returned by a function. */ static void @@ -736,7 +736,7 @@ static const int stq_c_opcode = 0x2f; /* Checks for an atomic sequence of instructions beginning with a LDL_L/LDQ_L instruction and ending with a STL_C/STQ_C instruction. If such a sequence - is found, attempt to step through it. A breakpoint is placed at the end of + is found, attempt to step through it. A breakpoint is placed at the end of the sequence. */ static std::vector @@ -748,7 +748,7 @@ alpha_deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc) unsigned int insn = alpha_read_insn (gdbarch, loc); int insn_count; int index; - int last_breakpoint = 0; /* Defaults to 0 (no breakpoints placed). */ + int last_breakpoint = 0; /* Defaults to 0 (no breakpoints placed). */ const int atomic_sequence_length = 16; /* Instruction sequence length. */ int bc_insn_count = 0; /* Conditional branch instruction count. */ @@ -757,7 +757,7 @@ alpha_deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc) && INSN_OPCODE (insn) != ldq_l_opcode) return {}; - /* Assume that no atomic sequence is longer than "atomic_sequence_length" + /* Assume that no atomic sequence is longer than "atomic_sequence_length" instructions. */ for (insn_count = 0; insn_count < atomic_sequence_length; ++insn_count) { @@ -765,7 +765,7 @@ alpha_deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc) insn = alpha_read_insn (gdbarch, loc); /* Assume that there is at most one branch in the atomic - sequence. If a branch is found, put a breakpoint in + sequence. If a branch is found, put a breakpoint in its destination address. */ if (INSN_OPCODE (insn) >= br_opcode) { @@ -800,7 +800,7 @@ alpha_deal_with_atomic_sequence (struct gdbarch *gdbarch, CORE_ADDR pc) breaks[0] = loc; /* Check for duplicated breakpoints. Check also for a breakpoint - placed (branch instruction's destination) anywhere in sequence. */ + placed (branch instruction's destination) anywhere in sequence. */ if (last_breakpoint && (breaks[1] == breaks[0] || (breaks[1] >= pc && breaks[1] <= closing_insn))) @@ -876,7 +876,7 @@ alpha_sigtramp_frame_unwind_cache (const frame_info_ptr &this_frame, static CORE_ADDR alpha_sigtramp_register_address (struct gdbarch *gdbarch, CORE_ADDR sigcontext_addr, int regnum) -{ +{ alpha_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (regnum >= 0 && regnum < 32) @@ -884,7 +884,7 @@ alpha_sigtramp_register_address (struct gdbarch *gdbarch, else if (regnum >= ALPHA_FP0_REGNUM && regnum < ALPHA_FP0_REGNUM + 32) return sigcontext_addr + tdep->sc_fpregs_offset + regnum * 8; else if (regnum == ALPHA_PC_REGNUM) - return sigcontext_addr + tdep->sc_pc_offset; + return sigcontext_addr + tdep->sc_pc_offset; return 0; } @@ -1093,7 +1093,7 @@ Otherwise, you told GDB there was a function where there isn't one, or\n\ something about the traditional layout of alpha stack frames. */ struct alpha_heuristic_unwind_cache -{ +{ CORE_ADDR vfp; CORE_ADDR start_pc; trad_frame_saved_reg *saved_regs; @@ -1123,7 +1123,7 @@ alpha_heuristic_analyze_probing_loop (struct gdbarch *gdbarch, CORE_ADDR *pc, subq REG_INDEX,0x1,REG_INDEX lda REG_PROBE,(REG_PROBE) bne REG_INDEX, LOOP_START - + lda sp,(REG_PROBE) If anything different is found, the function returns without @@ -1149,14 +1149,14 @@ alpha_heuristic_analyze_probing_loop (struct gdbarch *gdbarch, CORE_ADDR *pc, cur_frame_size -= MEM_DISP (insn); /* stq zero,(REG_PROBE) */ - + cur_pc += ALPHA_INSN_SIZE; insn = alpha_read_insn (gdbarch, cur_pc); if (INSN_OPCODE (insn) != stq_opcode || MEM_RA (insn) != 0x1f || MEM_RB (insn) != reg_probe) return; - + /* subq REG_INDEX,0x1,REG_INDEX */ cur_pc += ALPHA_INSN_SIZE; @@ -1168,9 +1168,9 @@ alpha_heuristic_analyze_probing_loop (struct gdbarch *gdbarch, CORE_ADDR *pc, || OPR_RA (insn) != reg_index || OPR_RC (insn) != reg_index) return; - + /* lda REG_PROBE,(REG_PROBE) */ - + cur_pc += ALPHA_INSN_SIZE; insn = alpha_read_insn (gdbarch, cur_pc); if (INSN_OPCODE (insn) != lda_opcode @@ -1403,7 +1403,7 @@ alpha_heuristic_frame_prev_register (const frame_info_ptr &this_frame, the correct place. */ if (regnum == ALPHA_PC_REGNUM) regnum = info->return_reg; - + return trad_frame_get_prev_register (this_frame, info->saved_regs, regnum); } @@ -1522,7 +1522,7 @@ alpha_fill_fp_regs (const struct regcache *regcache, /* Return nonzero if the G_floating register value in REG is equal to zero for FP control instructions. */ - + static int fp_register_zero_p (LONGEST reg) { @@ -1597,7 +1597,7 @@ alpha_next_pc (struct regcache *regcache, CORE_ADDR pc) case 0x35: /* FBNE */ regno += gdbarch_fp0_regnum (gdbarch); } - + rav = regcache_raw_get_signed (regcache, regno); switch (op) @@ -1636,7 +1636,7 @@ alpha_next_pc (struct regcache *regcache, CORE_ADDR pc) break; /* Floating point branches. */ - + case 0x31: /* FBEQ */ if (fp_register_zero_p (rav)) goto branch_taken; diff --git a/gdb/alpha-tdep.h b/gdb/alpha-tdep.h index 5e0adf39836..318cda611f6 100644 --- a/gdb/alpha-tdep.h +++ b/gdb/alpha-tdep.h @@ -56,7 +56,7 @@ struct regcache; #define ALPHA_INSN_SIZE 4 /* The alpha has two different virtual pointers for arguments and locals. - + The virtual argument pointer is pointing to the bottom of the argument transfer area, which is located immediately below the virtual frame pointer. Its size is fixed for the native compiler, it is either zero @@ -64,7 +64,7 @@ struct regcache; gcc uses a variable sized argument transfer area. As it has to stay compatible with the native debugging tools it has to use the same virtual argument pointer and adjust the argument offsets accordingly. - + The virtual local pointer is localoff bytes below the virtual frame pointer, the value of localoff is obtained from the PDR. */ #define ALPHA_NUM_ARG_REGS 6 diff --git a/gdb/amd64-darwin-tdep.c b/gdb/amd64-darwin-tdep.c index c687b1f097a..978fbc0db80 100644 --- a/gdb/amd64-darwin-tdep.c +++ b/gdb/amd64-darwin-tdep.c @@ -68,7 +68,7 @@ int amd64_darwin_thread_state_reg_offset[] = 20 * 8 /* %gs */ }; -const int amd64_darwin_thread_state_num_regs = +const int amd64_darwin_thread_state_num_regs = ARRAY_SIZE (amd64_darwin_thread_state_reg_offset); /* Assuming THIS_FRAME is a Darwin sigtramp routine, return the diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c index 4b23fd9de53..96acfda7d00 100644 --- a/gdb/amd64-linux-nat.c +++ b/gdb/amd64-linux-nat.c @@ -111,7 +111,7 @@ amd64_linux_collect_native_gregset (const struct regcache *regcache, if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word == 32) { /* Sign extend EAX value to avoid potential syscall restart - problems. + problems. On Linux, when a syscall is interrupted by a signal, the (kernel function implementing the) syscall may return @@ -121,7 +121,7 @@ amd64_linux_collect_native_gregset (const struct regcache *regcache, handler is called, the kernel can then either return -EINTR or it can cause the syscall to be restarted. We are concerned with the latter case here. - + On (32-bit) i386, the status (-ERESTARTSYS) is placed in the EAX register. When debugging a 32-bit process from a 64-bit (amd64) GDB, the debugger fetches 64-bit registers even @@ -138,11 +138,11 @@ amd64_linux_collect_native_gregset (const struct regcache *regcache, syscall after a signal expects to see a negative value (specifically -ERESTARTSYS) in the 64-bit RAX register in order to correctly cause a syscall to be restarted. - + The call to amd64_collect_native_gregset, above, is setting the high 32 bits of RAX (and other registers too) to 0. For syscall restart, we need to sign extend EAX so that RAX will - appear as a negative value when EAX is set to -ERESTARTSYS. + appear as a negative value when EAX is set to -ERESTARTSYS. This in turn will cause the signal handling code in the kernel to recognize -ERESTARTSYS which will in turn cause the syscall to be restarted. @@ -153,7 +153,7 @@ amd64_linux_collect_native_gregset (const struct regcache *regcache, if (regnum == -1 || regnum == I386_EAX_REGNUM) { - void *ptr = ((gdb_byte *) gregs + void *ptr = ((gdb_byte *) gregs + amd64_linux_gregset32_reg_offset[I386_EAX_REGNUM]); *(int64_t *) ptr = *(int32_t *) ptr; diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c index a21f8a9a5ce..284c956cd9b 100644 --- a/gdb/amd64-linux-tdep.c +++ b/gdb/amd64-linux-tdep.c @@ -295,7 +295,7 @@ static int amd64_linux_sc_reg_offset[] = static int amd64_linux_register_reggroup_p (struct gdbarch *gdbarch, int regnum, const struct reggroup *group) -{ +{ if (regnum == AMD64_LINUX_ORIG_RAX_REGNUM) return (group == system_reggroup || group == save_reggroup @@ -370,8 +370,8 @@ amd64_all_but_ip_registers_record (struct regcache *regcache) return 0; } -/* amd64_canonicalize_syscall maps from the native amd64 Linux set - of syscall ids into a canonical set of syscall ids used by +/* amd64_canonicalize_syscall maps from the native amd64 Linux set + of syscall ids into a canonical set of syscall ids used by process record. */ static enum gdb_syscall @@ -1521,7 +1521,7 @@ amd64_linux_syscall_record_common (struct regcache *regcache, { gdb_printf (gdb_stderr, _("Process record and replay target doesn't " - "support syscall number %s\n"), + "support syscall number %s\n"), pulongest (syscall_native)); return -1; } @@ -1752,7 +1752,7 @@ amd64_dtrace_probe_is_enabled (struct gdbarch *gdbarch, CORE_ADDR addr) Note that ADDR is offset 3 bytes from the beginning of these sequences. */ - + read_code (addr - 3, buf, 5); return (memcmp (buf, amd64_dtrace_disabled_probe_sequence_1, 5) != 0 && memcmp (buf, amd64_dtrace_disabled_probe_sequence_2, 5) != 0); diff --git a/gdb/amd64-obsd-tdep.c b/gdb/amd64-obsd-tdep.c index 6b60e0aff6d..ad9a9dc37e0 100644 --- a/gdb/amd64-obsd-tdep.c +++ b/gdb/amd64-obsd-tdep.c @@ -367,7 +367,7 @@ amd64obsd_trapframe_this_id (const frame_info_ptr &this_frame, { struct trad_frame_cache *cache = amd64obsd_trapframe_cache (this_frame, this_cache); - + trad_frame_get_id (cache, this_id); } diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index b670586050b..3cbc0224275 100755 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -61,7 +61,7 @@ /* Register information. */ -static const char * const amd64_register_names[] = +static const char * const amd64_register_names[] = { "rax", "rbx", "rcx", "rdx", "rsi", "rdi", "rbp", "rsp", @@ -79,7 +79,7 @@ static const char * const amd64_register_names[] = "mxcsr", }; -static const char * const amd64_ymm_names[] = +static const char * const amd64_ymm_names[] = { "ymm0", "ymm1", "ymm2", "ymm3", "ymm4", "ymm5", "ymm6", "ymm7", @@ -95,7 +95,7 @@ static const char * const amd64_ymm_avx512_names[] = "ymm28", "ymm29", "ymm30", "ymm31" }; -static const char * const amd64_ymmh_names[] = +static const char * const amd64_ymmh_names[] = { "ymm0h", "ymm1h", "ymm2h", "ymm3h", "ymm4h", "ymm5h", "ymm6h", "ymm7h", @@ -329,7 +329,7 @@ static const char * const amd64_byte_names[] = static const char * const amd64_word_names[] = { - "ax", "bx", "cx", "dx", "si", "di", "bp", "", + "ax", "bx", "cx", "dx", "si", "di", "bp", "", "r8w", "r9w", "r10w", "r11w", "r12w", "r13w", "r14w", "r15w" }; @@ -337,7 +337,7 @@ static const char * const amd64_word_names[] = static const char * const amd64_dword_names[] = { - "eax", "ebx", "ecx", "edx", "esi", "edi", "ebp", "esp", + "eax", "ebx", "ecx", "edx", "esi", "edi", "ebp", "esp", "r8d", "r9d", "r10d", "r11d", "r12d", "r13d", "r14d", "r15d", "eip" }; @@ -1021,7 +1021,7 @@ if (return_method == return_method_struct) containing ellipsis (...) in the declaration) %al is used as hidden argument to specify the number of SSE registers used. */ regcache_raw_write_unsigned (regcache, AMD64_RAX_REGNUM, sse_reg); - return sp; + return sp; } static CORE_ADDR @@ -2213,7 +2213,7 @@ amd64_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, pushq -8(%reg) "andq $-XXX, %rsp" can be either 4 bytes or 7 bytes: - + 0x48 0x83 0xe4 0xf0 andq $-16, %rsp 0x48 0x81 0xe4 0x00 0xff 0xff 0xff andq $-256, %rsp */ @@ -2279,7 +2279,7 @@ amd64_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, /* MOD must be binary 10 and R/M must be binary 100. */ if ((buf[offset + 2] & 0xc7) != 0x44) return pc; - + /* REG has register number. */ r = (buf[offset + 2] >> 3) & 7; @@ -2345,7 +2345,7 @@ amd64_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, static CORE_ADDR amd64_x32_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, - struct amd64_frame_cache *cache) + struct amd64_frame_cache *cache) { /* There are 2 code sequences to re-align stack before the frame gets set up: @@ -2377,12 +2377,12 @@ amd64_x32_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, [addr32] pushq -8(%reg) "andq $-XXX, %rsp" can be either 4 bytes or 7 bytes: - + 0x48 0x83 0xe4 0xf0 andq $-16, %rsp 0x48 0x81 0xe4 0x00 0xff 0xff 0xff andq $-256, %rsp "andl $-XXX, %esp" can be either 3 bytes or 6 bytes: - + 0x83 0xe4 0xf0 andl $-16, %esp 0x81 0xe4 0x00 0xff 0xff 0xff andl $-256, %esp */ @@ -2454,7 +2454,7 @@ amd64_x32_analyze_stack_align (CORE_ADDR pc, CORE_ADDR current_pc, /* MOD must be binary 10 and R/M must be binary 100. */ if ((buf[offset + 2] & 0xc7) != 0x44) return pc; - + /* REG has register number. */ r = (buf[offset + 2] >> 3) & 7; @@ -3379,7 +3379,7 @@ static const struct frame_unwind_legacy amd64_epilogue_frame_unwind ( amd64_epilogue_frame_unwind_stop_reason, amd64_epilogue_frame_this_id, amd64_frame_prev_register, - NULL, + NULL, amd64_epilogue_frame_sniffer ); diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 377694537bd..2b9628e2439 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -257,7 +257,7 @@ cannot_register_not (struct gdbarch *gdbarch, int regnum) cooked or raw. */ void -legacy_virtual_frame_pointer (struct gdbarch *gdbarch, +legacy_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, int *frame_regnum, LONGEST *frame_offset) @@ -692,7 +692,7 @@ void initialize_current_architecture (void) { arches = gdbarch_printable_names (); - + /* Find a default architecture. */ if (default_bfd_arch == NULL) { @@ -1538,7 +1538,7 @@ core_file_exec_context::environment () const INIT_GDB_FILE (gdbarch_utils) { add_setshow_enum_cmd ("endian", class_support, - endian_enum, &set_endian_string, + endian_enum, &set_endian_string, _("Set endianness of target."), _("Show endianness of target."), NULL, set_endian, show_endian, diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c index dc5165e3a79..9b46876ae86 100644 --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c @@ -481,7 +481,7 @@ arm_linux_nat_target::store_registers (struct regcache *regcache, int regno) thread debugging. */ void -fill_gregset (const struct regcache *regcache, +fill_gregset (const struct regcache *regcache, gdb_gregset_t *gregsetp, int regno) { arm_linux_collect_gregset (NULL, regcache, regno, gregsetp, 0); @@ -591,7 +591,7 @@ struct arm_linux_hwbp_cap #define MAX_WPTS 16 /* Get hold of the Hardware Breakpoint information for the target we are - attached to. Returns NULL if the kernel doesn't support Hardware + attached to. Returns NULL if the kernel doesn't support Hardware breakpoints at all, or a pointer to the information structure. */ static const struct arm_linux_hwbp_cap * arm_linux_get_hwbp_cap (void) @@ -710,7 +710,7 @@ struct arm_linux_hw_breakpoint /* Structure containing arrays of per process hardware break-/watchpoints for caching address and control information. - The Linux ptrace interface to hardware break-/watch-points presents the + The Linux ptrace interface to hardware break-/watch-points presents the values in a vector centred around 0 (which is used fo generic information). Positive indices refer to breakpoint addresses/control registers, negative indices to watchpoint addresses/control registers. @@ -722,8 +722,8 @@ struct arm_linux_hw_breakpoint ((i << 1) + 1): Address register for breakpoint i. ((i << 1) + 2): Control register for breakpoint i. - This structure is used as a per-thread cache of the state stored by the - kernel, so that we don't need to keep calling into the kernel to find a + This structure is used as a per-thread cache of the state stored by the + kernel, so that we don't need to keep calling into the kernel to find a free breakpoint. We treat break-/watch-points with their enable bit clear as being deleted. @@ -852,16 +852,16 @@ arm_linux_get_debug_reg_state (pid_t pid) } /* Initialize an ARM hardware break-/watch-point control register value. - BYTE_ADDRESS_SELECT is the mask of bytes to trigger on; HWBP_TYPE is the + BYTE_ADDRESS_SELECT is the mask of bytes to trigger on; HWBP_TYPE is the type of break-/watch-point; ENABLE indicates whether the point is enabled. */ -static arm_hwbp_control_t +static arm_hwbp_control_t arm_hwbp_control_initialize (unsigned byte_address_select, arm_hwbp_type hwbp_type, int enable) { gdb_assert ((byte_address_select & ~0xffU) == 0); - gdb_assert (hwbp_type != arm_hwbp_break + gdb_assert (hwbp_type != arm_hwbp_break || ((byte_address_select & 0xfU) != 0)); return (byte_address_select << 5) | (hwbp_type << 3) | (3 << 1) | enable; @@ -918,7 +918,7 @@ arm_linux_hw_breakpoint_initialize (struct gdbarch *gdbarch, /* Get the ARM hardware breakpoint type from the TYPE value we're given when asked to set a watchpoint. */ -static arm_hwbp_type +static arm_hwbp_type arm_linux_get_hwbp_type (enum target_hw_bp_type type) { if (type == hw_read) @@ -945,7 +945,7 @@ arm_linux_hw_watchpoint_initialize (CORE_ADDR addr, int len, mask = (1 << len) - 1; p->address = (unsigned int) addr; - p->control = arm_hwbp_control_initialize (mask, + p->control = arm_hwbp_control_initialize (mask, arm_linux_get_hwbp_type (type), 1); } @@ -984,7 +984,7 @@ update_registers_callback (struct lwp_info *lwp, int watch, int index) /* Insert the hardware breakpoint (WATCHPOINT = 0) or watchpoint (WATCHPOINT =1) BPT for thread TID. */ static void -arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt, +arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt, int watchpoint) { int pid; @@ -1025,7 +1025,7 @@ arm_linux_insert_hw_breakpoint1 (const struct arm_linux_hw_breakpoint* bpt, /* Remove the hardware breakpoint (WATCHPOINT = 0) or watchpoint (WATCHPOINT = 1) BPT for thread TID. */ static void -arm_linux_remove_hw_breakpoint1 (const struct arm_linux_hw_breakpoint *bpt, +arm_linux_remove_hw_breakpoint1 (const struct arm_linux_hw_breakpoint *bpt, int watchpoint) { int pid; @@ -1097,7 +1097,7 @@ arm_linux_nat_target::remove_hw_breakpoint (struct gdbarch *gdbarch, return 0; } -/* Are we able to use a hardware watchpoint for the LEN bytes starting at +/* Are we able to use a hardware watchpoint for the LEN bytes starting at ADDR? */ int arm_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) diff --git a/gdb/arm-linux-tdep.c b/gdb/arm-linux-tdep.c index 200ba9d35af..91db7b2eb42 100644 --- a/gdb/arm-linux-tdep.c +++ b/gdb/arm-linux-tdep.c @@ -93,11 +93,11 @@ static const gdb_byte arm_linux_thumb2_be_breakpoint[] = { 0xf7, 0xf0, 0xa0, 0x0 static const gdb_byte arm_linux_thumb2_le_breakpoint[] = { 0xf0, 0xf7, 0x00, 0xa0 }; -/* Description of the longjmp buffer. The buffer is treated as an array of +/* Description of the longjmp buffer. The buffer is treated as an array of elements of size ARM_LINUX_JB_ELEMENT_SIZE. The location of saved registers in this buffer (in particular the PC - to use after longjmp is called) varies depending on the ABI (in + to use after longjmp is called) varies depending on the ABI (in particular the FP model) and also (possibly) the C Library. */ #define ARM_LINUX_JB_ELEMENT_SIZE ARM_INT_REGISTER_SIZE /* For the FPA model the PC is at offset 21 in the buffer. */ @@ -144,7 +144,7 @@ static const gdb_byte arm_linux_thumb2_le_breakpoint[] = { 0xf0, 0xf7, 0x00, 0xa with the real function address. Subsequent calls go through steps 1, 2 and 3 and end up calling the real code. - 1) In the code: + 1) In the code: b function_call bl function_call @@ -870,7 +870,7 @@ arm_linux_get_syscall_number (struct gdbarch *gdbarch, } else { - enum bfd_endian byte_order_for_code = + enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch); /* PC gets incremented before the syscall-stop, so read the @@ -918,9 +918,9 @@ arm_linux_get_next_pcs_syscall_next_pc (struct arm_get_next_pcs *self) else { struct gdbarch *gdbarch = regcache->arch (); - enum bfd_endian byte_order_for_code = + enum bfd_endian byte_order_for_code = gdbarch_byte_order_for_code (gdbarch); - unsigned long this_instr = + unsigned long this_instr = read_memory_unsigned_integer (pc, 4, byte_order_for_code); unsigned long svc_operand = (0x00ffffff & this_instr); diff --git a/gdb/arm-netbsd-nat.c b/gdb/arm-netbsd-nat.c index ebf4084079f..2a796ae9c81 100644 --- a/gdb/arm-netbsd-nat.c +++ b/gdb/arm-netbsd-nat.c @@ -183,7 +183,7 @@ store_register (const struct regcache *regcache, int regno) unsigned pc_val; regcache->raw_collect (ARM_PC_REGNUM, (char *) &pc_val); - + pc_val = gdbarch_addr_bits_remove (gdbarch, pc_val); inferior_registers.r_pc ^= gdbarch_addr_bits_remove (gdbarch, inferior_registers.r_pc); @@ -249,7 +249,7 @@ store_regs (const struct regcache *regcache) regcache->raw_collect (ARM_PC_REGNUM, (char *) &pc_val); regcache->raw_collect (ARM_PS_REGNUM, (char *) &psr_val); - + pc_val = gdbarch_addr_bits_remove (gdbarch, pc_val); psr_val ^= gdbarch_addr_bits_remove (gdbarch, psr_val); diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index ad708e9bd45..5b7846f77ac 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -1873,7 +1873,7 @@ arm_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) SP -> -12 additional stack space (12 bytes) The frame size would thus be 36 bytes, and the frame offset would be 12 bytes. The frame register is R7. - + The comments for thumb_skip_prolog() describe the algorithm we use to detect the end of the prolog. */ @@ -1977,7 +1977,7 @@ arm_analyze_prologue (struct gdbarch *gdbarch, Be careful, however, and if it doesn't look like a prologue, don't try to scan it. If, for instance, a frameless function begins with stmfd sp!, then we will tell ourselves there is - a frame, which will confuse stack traceback, as well as "finish" + a frame, which will confuse stack traceback, as well as "finish" and other operations that rely on a knowledge of the stack traceback. */ @@ -2530,7 +2530,7 @@ arm_obj_section_from_vma (struct objfile *objfile, bfd_vma vma) The extracted and normalized instructions are stored for later retrieval by the arm_find_exidx_entry routine. */ - + static void arm_exidx_new_objfile (struct objfile *objfile) { @@ -2648,7 +2648,7 @@ arm_exidx_new_objfile (struct objfile *objfile) pers_sec = arm_obj_section_from_vma (objfile, pers); if (pers_sec) { - static const char *personality[] = + static const char *personality[] = { "__gcc_personality_v0", "__gxx_personality_v0", @@ -3154,7 +3154,7 @@ arm_exidx_unwind_sniffer (const struct frame_unwind *self, exc_valid = 1; } } - + /* Bail out if we don't know that exception information is valid. */ if (!exc_valid) return 0; @@ -4784,7 +4784,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function, si = push_stack_item (si, val, ARM_INT_REGISTER_SIZE); nstack += ARM_INT_REGISTER_SIZE; } - + /* Doubleword aligned quantities must go in even register pairs. */ if (may_use_core_reg && argreg <= ARM_LAST_ARG_REGNUM @@ -4842,7 +4842,7 @@ arm_push_dummy_call (struct gdbarch *gdbarch, struct value *function, si = push_stack_item (si, buf, ARM_INT_REGISTER_SIZE); nstack += ARM_INT_REGISTER_SIZE; } - + len -= partial_len; val += partial_len; } @@ -8731,7 +8731,7 @@ gdb_print_insn_arm (bfd_vma memaddr, disassemble_info *info) if (csym.native == NULL) { /* Create a fake symbol vector containing a Thumb symbol. - This is solely so that the code in print_insn_little_arm() + This is solely so that the code in print_insn_little_arm() and print_insn_big_arm() in opcodes/arm-dis.c will detect the presence of a Thumb symbol and switch to decoding Thumb instructions. */ @@ -8768,12 +8768,12 @@ gdb_print_insn_arm (bfd_vma memaddr, disassemble_info *info) /* The following define instruction sequences that will cause ARM cpu's to take an undefined instruction trap. These are used to signal a breakpoint to GDB. - + The newer ARMv4T cpu's are capable of operating in ARM or Thumb modes. A different instruction is required for each mode. The ARM cpu's can also be big or little endian. Thus four different instructions are needed to support all cases. - + Note: ARMv4 defines several new instructions that will take the undefined instruction trap. ARM7TDMI is nominally ARMv4T, but does not in fact add the new instructions. The new undefined @@ -8781,14 +8781,14 @@ gdb_print_insn_arm (bfd_vma memaddr, disassemble_info *info) behavior in earlier chips. There is no guarantee that they will raise an exception, but may be treated as NOP's. In practice, it may only safe to rely on instructions matching: - - 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 + + 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 C C C C 0 1 1 x x x x x x x x x x x x x x x x x x x x 1 x x x x - + Even this may only true if the condition predicate is true. The following use a condition predicate of ALWAYS so it is always TRUE. - + There are other ways of forcing a breakpoint. GNU/Linux, RISC iX, and NetBSD all use a software interrupt rather than an undefined instruction to force a trap. This can be handled by by the @@ -8975,7 +8975,7 @@ arm_extract_return_value (struct type *type, struct regcache *regs, /* By using store_unsigned_integer we avoid having to do anything special for small big-endian values. */ regcache_cooked_read_unsigned (regs, regno++, &tmp); - store_unsigned_integer (valbuf, + store_unsigned_integer (valbuf, (len > ARM_INT_REGISTER_SIZE ? ARM_INT_REGISTER_SIZE : len), byte_order, tmp); @@ -8986,7 +8986,7 @@ arm_extract_return_value (struct type *type, struct regcache *regs, else { /* For a structure or union the behavior is as if the value had - been stored to word-aligned memory and then loaded into + been stored to word-aligned memory and then loaded into registers with 32-bit load instruction(s). */ int len = type->length (); int regno = ARM_A1_REGNUM; @@ -9109,7 +9109,7 @@ arm_return_in_memory (struct gdbarch *gdbarch, struct type *type) /* If bitpos != 0, then we have to care about it. */ if (type->field (i).loc_bitpos () != 0) { - /* Bitfields are not addressable. If the field bitsize is + /* Bitfields are not addressable. If the field bitsize is zero, then the field is not packed. Hence it cannot be a bitfield or any other packed type. */ if (type->field (i).bitsize () == 0) @@ -9216,7 +9216,7 @@ arm_store_return_value (struct type *type, struct regcache *regs, else { /* For a structure or union the behavior is as if the value had - been stored to word-aligned memory and then loaded into + been stored to word-aligned memory and then loaded into registers with 32-bit load instruction(s). */ int len = type->length (); int regno = ARM_A1_REGNUM; @@ -9349,7 +9349,7 @@ arm_get_longjmp_target (const frame_info_ptr &frame, CORE_ADDR *pc) enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR jb_addr; gdb_byte buf[ARM_INT_REGISTER_SIZE]; - + jb_addr = get_frame_register_unsigned (frame, ARM_A1_REGNUM); if (target_read_memory (jb_addr + tdep->jb_pc * tdep->jb_elt_size, buf, @@ -9719,11 +9719,11 @@ coff_sym_is_thumb (int val) /* arm_coff_make_msymbol_special() arm_elf_make_msymbol_special() - + These functions test whether the COFF or ELF symbol corresponds to an address in thumb code, and set a "special" bit in a minimal symbol to indicate that it does. */ - + static void arm_elf_make_msymbol_special (const asymbol *sym, struct minimal_symbol *msym) { @@ -11157,7 +11157,7 @@ vfp - VFP co-processor."), /* ARM-reversible process record data structures. */ -#define ARM_INSN_SIZE_BYTES 4 +#define ARM_INSN_SIZE_BYTES 4 #define THUMB_INSN_SIZE_BYTES 2 #define THUMB2_INSN_SIZE_BYTES 4 @@ -11268,7 +11268,7 @@ enum record_type_t static int -arm_record_strx (arm_insn_decode_record *arm_insn_r, uint32_t *record_buf, +arm_record_strx (arm_insn_decode_record *arm_insn_r, uint32_t *record_buf, uint32_t *record_buf_mem, arm_record_strx_t str_type) { @@ -11469,7 +11469,7 @@ arm_record_extension_space (arm_insn_decode_record *arm_insn_r) if (3 == opcode1 && bit (arm_insn_r->arm_insn, 4)) { ret = -1; - /* Undefined instruction on ARM V5; need to handle if later + /* Undefined instruction on ARM V5; need to handle if later versions define it. */ } @@ -11569,7 +11569,7 @@ arm_record_extension_space (arm_insn_decode_record *arm_insn_r) /* Save SPSR also;how? */ return -1; } - else if(8 == bits (arm_insn_r->arm_insn, 4, 7) + else if(8 == bits (arm_insn_r->arm_insn, 4, 7) || 10 == bits (arm_insn_r->arm_insn, 4, 7) || 12 == bits (arm_insn_r->arm_insn, 4, 7) || 14 == bits (arm_insn_r->arm_insn, 4, 7) @@ -11623,7 +11623,7 @@ arm_record_extension_space (arm_insn_decode_record *arm_insn_r) /* Handle load/store insn extension space. */ - if (!opcode1 && bit (arm_insn_r->arm_insn, 7) + if (!opcode1 && bit (arm_insn_r->arm_insn, 7) && bit (arm_insn_r->arm_insn, 4) && 1 != arm_insn_r->cond && !INSN_RECORDED(arm_insn_r)) { @@ -12289,7 +12289,7 @@ arm_record_ld_st_reg_offset (arm_insn_decode_record *arm_insn_r) /* STR. */ case 8: case 12: - /* STR. */ + /* STR. */ case 9: case 13: /* STRT. */ @@ -12307,7 +12307,7 @@ arm_record_ld_st_reg_offset (arm_insn_decode_record *arm_insn_r) /* STRB. */ case 11: case 15: - /* STRBT. */ + /* STRBT. */ case 3: case 7: /* STRB. */ @@ -12419,7 +12419,7 @@ arm_record_ld_st_reg_offset (arm_insn_decode_record *arm_insn_r) /* STR. */ case 8: case 12: - /* STR. */ + /* STR. */ case 9: case 13: /* STRT. */ @@ -12437,7 +12437,7 @@ arm_record_ld_st_reg_offset (arm_insn_decode_record *arm_insn_r) /* STRB. */ case 11: case 15: - /* STRBT. */ + /* STRBT. */ case 3: case 7: /* STRB. */ @@ -12510,7 +12510,7 @@ arm_record_ld_st_multiple (arm_insn_decode_record *arm_insn_r) register_count++; } - + /* If wback is true, also save the base register, which is going to be written to. */ if (wback) @@ -12523,7 +12523,7 @@ arm_record_ld_st_multiple (arm_insn_decode_record *arm_insn_r) { /* STM (STMIA, STMEA), STMDA (STMED), STMDB (STMFD) and STMIB (STMFA). */ - addr_mode = bits (arm_insn_r->arm_insn, 23, 24); + addr_mode = bits (arm_insn_r->arm_insn, 23, 24); regcache_raw_read_unsigned (reg_cache, reg_base, &u_regval); @@ -13450,7 +13450,7 @@ thumb_record_ld_st_imm_offset (arm_insn_decode_record *thumb_insn_r) } REG_ALLOC (thumb_insn_r->arm_regs, thumb_insn_r->reg_rec_count, record_buf); - MEM_ALLOC (thumb_insn_r->arm_mems, thumb_insn_r->mem_rec_count, + MEM_ALLOC (thumb_insn_r->arm_mems, thumb_insn_r->mem_rec_count, record_buf_mem); return 0; @@ -13616,7 +13616,7 @@ thumb_record_misc (arm_insn_decode_record *thumb_insn_r) /* CPSR is changed to be executed in ARM state, disabling normal interrupts, entering abort mode. */ /* According to high vector configuration PC is set. */ - /* User hits breakpoint and type reverse, in that case, we need to go back with + /* User hits breakpoint and type reverse, in that case, we need to go back with previous CPSR and Program Counter. */ record_buf[0] = ARM_PS_REGNUM; record_buf[1] = ARM_LR_REGNUM; @@ -13754,12 +13754,12 @@ thumb_record_branch (arm_insn_decode_record *thumb_insn_r) thumb_insn_r->reg_rec_count = 2; } - /* B(2) is automatically taken care in process_record, as PC is + /* B(2) is automatically taken care in process_record, as PC is saved there. */ REG_ALLOC (thumb_insn_r->arm_regs, thumb_insn_r->reg_rec_count, record_buf); - return 0; + return 0; } /* Handler for thumb2 load/store multiple instructions. */ @@ -14855,11 +14855,11 @@ arm_analyze_prologue_test () /* Cleans up local record registers and memory allocations. */ -static void +static void deallocate_reg_mem (arm_insn_decode_record *record) { xfree (record->arm_regs); - xfree (record->arm_mems); + xfree (record->arm_mems); } diff --git a/gdb/arm-tdep.h b/gdb/arm-tdep.h index aa950fbc4b9..c543b98f0ff 100644 --- a/gdb/arm-tdep.h +++ b/gdb/arm-tdep.h @@ -36,7 +36,7 @@ extern bool arm_apcs_32; #include -/* Number of machine registers. The only define actually required +/* Number of machine registers. The only define actually required is gdbarch_num_regs. The other definitions are used for documentation purposes and code readability. */ /* For 26 bit ARM code, a fake copy of the PC is placed in register 25 (PS) @@ -52,11 +52,11 @@ extern bool arm_apcs_32; /* Type of floating-point code in use by inferior. There are really 3 models that are traditionally supported (plus the endianness issue), but gcc can only generate 2 of those. The third is APCS_FLOAT, where arguments to - functions are passed in floating-point registers. + functions are passed in floating-point registers. - In addition to the traditional models, VFP adds two more. + In addition to the traditional models, VFP adds two more. - If you update this enum, don't forget to update fp_model_strings in + If you update this enum, don't forget to update fp_model_strings in arm-tdep.c. */ enum arm_float_model @@ -306,7 +306,7 @@ extern int arm_psr_thumb_bit (struct gdbarch *); instruction? */ extern int arm_pc_is_thumb (struct gdbarch *, CORE_ADDR); -extern int arm_process_record (struct gdbarch *gdbarch, +extern int arm_process_record (struct gdbarch *gdbarch, struct regcache *regcache, CORE_ADDR addr); /* Functions exported from arm-bsd-tdep.h. */ diff --git a/gdb/async-event.c b/gdb/async-event.c index 27b739f7816..b114dd7de57 100644 --- a/gdb/async-event.c +++ b/gdb/async-event.c @@ -127,9 +127,9 @@ initialize_async_signal_handlers (void) /* Create an asynchronous handler, allocating memory for it. Return a pointer to the newly created handler. - This pointer will be used to invoke the handler by + This pointer will be used to invoke the handler by invoke_async_signal_handler. - PROC is the function to call with CLIENT_DATA argument + PROC is the function to call with CLIENT_DATA argument whenever the handler is invoked. */ async_signal_handler * create_async_signal_handler (sig_handler_func * proc, diff --git a/gdb/auto-load.c b/gdb/auto-load.c index 8817bd12cb0..169a7359b23 100644 --- a/gdb/auto-load.c +++ b/gdb/auto-load.c @@ -462,7 +462,7 @@ filename_is_in_auto_load_safe_path_vec (const char *filename, pattern = p.get (); break; } - + if (pattern == NULL) { if (*filename_realp == NULL) diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c index 6274529c4ab..35ac952e73e 100644 --- a/gdb/avr-tdep.c +++ b/gdb/avr-tdep.c @@ -481,7 +481,7 @@ avr_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, sbiw r28, out __SP_H__, r29 out __SP_L__, r28 - + A interrupt handler prologue looks like this: sei push __zero_reg__ @@ -498,7 +498,7 @@ avr_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, sbiw r28, cli out __SP_H__, r29 - sei + sei out __SP_L__, r28 A `-mcall-prologues' prologue looks like this (Note that the megas use a @@ -540,7 +540,7 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end, /* FIXME: TRoth/2003-06-11: This could be made more efficient by only reading in the bytes of the prologue. The problem is that the figuring - out where the end of the prologue is is a bit difficult. The old code + out where the end of the prologue is is a bit difficult. The old code tried to do that, but failed quite often. */ read_memory (pc_beg, prologue, len); @@ -843,7 +843,7 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end, { vpc += sizeof (img_sig); } - else if (vpc + sizeof (img_int) < len + else if (vpc + sizeof (img_int) < len && memcmp (prologue + vpc, img_int, sizeof (img_int)) == 0) { vpc += sizeof (img_int); @@ -873,7 +873,7 @@ avr_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc_beg, CORE_ADDR pc_end, else break; } - + return pc_beg + vpc; } @@ -898,13 +898,13 @@ avr_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) trad_frame_saved_reg saved_regs[AVR_NUM_REGS]; info.saved_regs = saved_regs; - + /* Need to run the prologue scanner to figure out if the function has a prologue and possibly skip over moving arguments passed via registers to other registers. */ - + prologue_end = avr_scan_prologue (gdbarch, func_addr, func_end, &info); - + if (info.prologue_type != AVR_PROLOGUE_NONE) return prologue_end; } @@ -1016,10 +1016,10 @@ avr_frame_unwind_cache (const frame_info_ptr &this_frame, this_base = get_frame_register_unsigned (this_frame, AVR_FP_REGNUM); high_base = get_frame_register_unsigned (this_frame, AVR_FP_REGNUM + 1); this_base += (high_base << 8); - + /* The FP points at the last saved register. Adjust the FP back to before the first saved register giving the SP. */ - prev_sp = this_base + info->size; + prev_sp = this_base + info->size; } else { @@ -1124,7 +1124,7 @@ avr_frame_prev_register (const frame_info_ptr &this_frame, Also, note that the value on the stack is an addr to a word not a byte, so we will need to multiply it by two at some - point. + point. And to confuse matters even more, the return address stored on the stack is in big endian byte order, even though most @@ -1260,7 +1260,7 @@ pop_stack_item (struct avr_stack_item *si) optimization. I suspect this is a compiler bug. Arguments of these odd sizes are left-justified within the word (as opposed to arguments smaller than WORDSIZE bytes, which are right-justified). - + If the function is to return an aggregate type such as a struct, the caller must allocate space into which the callee will copy the return value. In this case, a pointer to the return value location is passed into the callee @@ -1469,7 +1469,7 @@ avr_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) gdbarch *gdbarch = gdbarch_alloc (&info, gdbarch_tdep_up (new avr_gdbarch_tdep)); avr_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - + tdep->call_length = call_length; /* Create a type for PC. We can't use builtin types here, as they may not diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c index 54717bf2a80..6317afdf65a 100644 --- a/gdb/ax-gdb.c +++ b/gdb/ax-gdb.c @@ -303,7 +303,7 @@ gen_traced_pop (struct agent_expr *ax, struct axs_value *value) larger than will fit in a stack, so just mark it for collection and be done with it. */ ax_reg_mask (ax, value->u.reg); - + /* But if the register points to a string, assume the value will fit on the stack and push it anyway. */ if (string_trace) @@ -1424,7 +1424,7 @@ gen_struct_ref (struct agent_expr *ax, struct axs_value *value, /* Search through fields and base classes recursively. */ found = gen_struct_ref_recursive (ax, value, field, 0, type); - + if (!found) error (_("Couldn't find member named `%s' in struct/union/class `%s'"), field, type->name ()); @@ -1457,7 +1457,7 @@ gen_static_field (struct agent_expr *ax, struct axs_value *value, if (sym) { gen_var_ref (ax, value, sym); - + /* Don't error if the value was optimized out, we may be scanning all static fields and just want to pass over this and continue with the rest. */ @@ -1500,7 +1500,7 @@ gen_struct_elt_for_reference (struct agent_expr *ax, struct axs_value *value, if (t->field (i).is_packed ()) error (_("pointers to bitfield members not allowed")); - /* FIXME we need a way to do "want_address" equivalent */ + /* FIXME we need a way to do "want_address" equivalent */ error (_("Cannot reference non-static field \"%s\""), fieldname); } @@ -1522,7 +1522,7 @@ gen_namespace_elt (struct agent_expr *ax, struct axs_value *value, int found = gen_maybe_namespace_elt (ax, value, curtype, name); if (!found) - error (_("No symbol \"%s\" in namespace \"%s\"."), + error (_("No symbol \"%s\" in namespace \"%s\"."), name, curtype->name ()); return found; @@ -2177,7 +2177,7 @@ gen_expr_binop_rest (struct expression *exp, gen_binop (ax, value, value1, value2, aop_bit_or, aop_bit_or, 0, "bitwise or"); break; - + case BINOP_BITWISE_XOR: gen_binop (ax, value, value1, value2, aop_bit_xor, aop_bit_xor, 0, "bitwise exclusive-or"); @@ -2592,7 +2592,7 @@ maint_agent_printf_command (const char *cmdrest, int from_tty) if (*cmdrest++ != '"') error (_("Bad format string, non-terminated '\"'.")); - + cmdrest = skip_spaces (cmdrest); if (*cmdrest != ',' && *cmdrest != 0) diff --git a/gdb/bcache.c b/gdb/bcache.c index fd74c622953..8b3045a53a8 100644 --- a/gdb/bcache.c +++ b/gdb/bcache.c @@ -64,7 +64,7 @@ bcache::expand_hash_table () { /* A table of good hash table sizes. Whenever we grow, we pick the next larger size from this table. sizes[i] is close to 1 << (i+10), - so we roughly double the table size each time. After we fall off + so we roughly double the table size each time. After we fall off the end of this table, we just double. Don't laugh --- there have been executables sighted with a gigabyte of debug info. */ static const unsigned long sizes[] = { @@ -282,7 +282,7 @@ bcache::print_statistics (const char *type) if (s) { occupied_buckets++; - + while (s) { gdb_assert (b < m_num_buckets); @@ -343,7 +343,7 @@ bcache::print_statistics (const char *type) gdb_printf ("%ld\n", m_unique_size / m_unique_count); else /* i18n: "Average entry size: (not applicable)". */ - gdb_printf (_("(not applicable)\n")); + gdb_printf (_("(not applicable)\n")); gdb_printf (_(" Median entry size: %d\n"), median_entry_size); gdb_printf ("\n"); @@ -356,7 +356,7 @@ Total memory used by bcache, including overhead: %ld\n"), print_percentage (m_total_size - m_structure_size, m_total_size); gdb_printf ("\n"); - gdb_printf (_(" Hash table size: %3d\n"), + gdb_printf (_(" Hash table size: %3d\n"), m_num_buckets); gdb_printf (_(" Hash table expands: %lu\n"), m_expand_count); @@ -374,7 +374,7 @@ Total memory used by bcache, including overhead: %ld\n"), else /* i18n: "Average hash chain length: (not applicable)". */ gdb_printf (_("(not applicable)\n")); - gdb_printf (_(" Maximum hash chain length: %3d\n"), + gdb_printf (_(" Maximum hash chain length: %3d\n"), max_chain_length); gdb_printf ("\n"); } diff --git a/gdb/bcache.h b/gdb/bcache.h index 0980c07c2d3..46b17ff2089 100644 --- a/gdb/bcache.h +++ b/gdb/bcache.h @@ -133,7 +133,7 @@ Mind you, looking at the wall clock, the same GDB debugging GDB showed only marginal speed up (0.780 vs 0.773s). Seems GDB is too busy doing something else :-( - + */ namespace gdb { diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 654d635f8ba..5fed7843ff1 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -141,7 +141,7 @@ find_symbol_for_pc_sect (CORE_ADDR pc, struct obj_section *section) } /* Return the function containing pc value PC. - Returns 0 if function is not known. + Returns 0 if function is not known. Backward compatibility, no section */ struct symbol * diff --git a/gdb/break-catch-syscall.c b/gdb/break-catch-syscall.c index fad76e718d0..c3ba1f2ab48 100644 --- a/gdb/break-catch-syscall.c +++ b/gdb/break-catch-syscall.c @@ -413,7 +413,7 @@ catch_syscall_split_args (const char *arg) /* Implement the "catch syscall" command. */ static void -catch_syscall_command_1 (const char *arg, int from_tty, +catch_syscall_command_1 (const char *arg, int from_tty, struct cmd_list_element *command) { int tempflag; diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c index 1a45d7c7498..3ad3beb41e8 100644 --- a/gdb/break-catch-throw.c +++ b/gdb/break-catch-throw.c @@ -366,11 +366,11 @@ handle_gnu_v3_exceptions (int tempflag, std::string &&except_rx, /* Look for an "if" token in *STRING. The "if" token must be preceded by whitespace. - + If there is any non-whitespace text between *STRING and the "if" token, then it is returned in a newly-xmalloc'd string. Otherwise, this returns NULL. - + STRING is updated to point to the "if" token, if it exists, or to the end of the string. */ diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 494a1773e16..a70410a25ed 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -917,7 +917,7 @@ get_breakpoint (int num) for (breakpoint &b : all_breakpoints ()) if (b.number == num) return &b; - + return nullptr; } @@ -1544,7 +1544,7 @@ static_tracepoints_here (CORE_ADDR addr) validate that only allowed commands are included. */ void -breakpoint_set_commands (struct breakpoint *b, +breakpoint_set_commands (struct breakpoint *b, counted_command_line &&commands) { /* If the commands have not changed then there's no need to update @@ -2147,7 +2147,7 @@ add_dummy_location (struct breakpoint *b, * target_stopped_by_watchpoint and target_stopped_data_address are called several times when GDB stops. - [linux] + [linux] * Multiple hardware watchpoints can be hit at the same time, causing GDB to stop. GDB only presents one hardware watchpoint hit at a time as the reason for stopping, and all the other hits @@ -2730,7 +2730,7 @@ parse_cmd_to_aexpr (CORE_ADDR scope, char *cmd) if (*cmdrest++ != '"') error (_("Bad format string, non-terminated '\"'.")); - + cmdrest = skip_spaces (cmdrest); if (!(*cmdrest == ',' || *cmdrest == '\0')) @@ -3028,7 +3028,7 @@ insert_bp_location (struct bp_location *bl, Shall we set a breakpoint at the LMA? */ if (!overlay_events_enabled) { - /* Yes -- overlay event support is not active, + /* Yes -- overlay event support is not active, so we must try to set a breakpoint at the LMA. This will not work for a hardware breakpoint. */ if (bl->loc_type == bp_loc_hardware_breakpoint) @@ -3089,7 +3089,7 @@ insert_bp_location (struct bp_location *bl, } else { - /* No. This breakpoint will not be inserted. + /* No. This breakpoint will not be inserted. No error, but do not mark the bp as 'inserted'. */ return 0; } @@ -3120,10 +3120,10 @@ insert_bp_location (struct bp_location *bl, notify_breakpoint_modified (bl->owner); if (!*disabled_breaks) { - gdb_printf (tmp_error_stream, - "Cannot insert breakpoint %d.\n", + gdb_printf (tmp_error_stream, + "Cannot insert breakpoint %d.\n", bl->owner->number); - gdb_printf (tmp_error_stream, + gdb_printf (tmp_error_stream, "Temporarily disabling shared " "library breakpoints:\n"); } @@ -4228,7 +4228,7 @@ remove_breakpoint_1 (struct bp_location *bl, enum remove_bp_reason reason) if (!overlay_events_enabled) { /* Yes -- overlay event support is not active, so we - should have set a breakpoint at the LMA. Remove it. + should have set a breakpoint at the LMA. Remove it. */ /* Ignore any failures: if the LMA is in ROM, we will have already warned when we failed to insert it. */ @@ -4240,7 +4240,7 @@ remove_breakpoint_1 (struct bp_location *bl, enum remove_bp_reason reason) &bl->overlay_target_info, reason); } - /* Did we set a breakpoint at the VMA? + /* Did we set a breakpoint at the VMA? If so, we will have marked the breakpoint 'inserted'. */ if (bl->inserted) { @@ -4465,7 +4465,7 @@ breakpoint_here_p (const address_space *aspace, CORE_ADDR pc) || bl->permanent) && breakpoint_location_address_match (bl, aspace, pc)) { - if (overlay_debugging + if (overlay_debugging && section_is_overlay (bl->section) && !section_is_mapped (bl->section)) continue; /* unmapped overlay -- can't be a match */ @@ -5165,14 +5165,14 @@ print_solib_event (bool is_catchpoint) PRINT_UNKNOWN: Means we printed nothing. PRINT_SRC_AND_LOC: Means we printed something, and expect subsequent - code to print the location. An example is + code to print the location. An example is "Breakpoint 1, " which should be followed by the location. PRINT_SRC_ONLY: Means we printed something, but there is no need to also print the location part of the message. An example is the catch/throw messages, which don't require a location appended to the end. - PRINT_NOTHING: We have done some printing and we don't need any + PRINT_NOTHING: We have done some printing and we don't need any further info to be printed. */ enum print_stop_action @@ -5187,7 +5187,7 @@ bpstat_print (bpstat *bs, target_waitkind kind) for (; bs; bs = bs->next) { val = print_bp_stop_message (bs); - if (val == PRINT_SRC_ONLY + if (val == PRINT_SRC_ONLY || val == PRINT_SRC_AND_LOC || val == PRINT_NOTHING) return val; @@ -6426,7 +6426,7 @@ print_breakpoint_location (const breakpoint *b, const bp_location *loc) if (uiout->is_mi_like_p ()) uiout->field_string ("fullname", symtab_to_fullname (loc->symtab)); - + uiout->field_signed ("line", loc->line_number, line_number_style.style ()); } @@ -6561,7 +6561,7 @@ output_thread_groups (struct ui_out *uiout, uiout->text (" inf "); else uiout->text (", "); - + uiout->text (plongest (inf_nums[i])); } } @@ -6598,7 +6598,7 @@ print_one_breakpoint_location (struct breakpoint *b, gdb_assert (!loc || loc_number != 0); /* See comment in print_one_breakpoint concerning treatment of breakpoints with single disabled location. */ - if (loc == NULL + if (loc == NULL && (b->has_locations () && (b->has_multiple_locations () || !b->first_loc ().enabled || b->first_loc ().disabled_by_cond))) @@ -6765,7 +6765,7 @@ print_one_breakpoint_location (struct breakpoint *b, b->gdbarch, b->frame_id.stack_addr); uiout->text ("\n"); } - + if (!part_of_multiple && b->cond_string) { annotate_field (7); @@ -7246,7 +7246,7 @@ default_collect_info (void) uiout->field_string ("default-collect", default_collect); uiout->text (" \n"); } - + static void info_breakpoints_command (const char *args, int from_tty) { @@ -7332,7 +7332,7 @@ describe_other_breakpoints (struct gdbarch *gdbarch, || b.enable_state == bp_call_disabled) ? " (disabled)" : ""), - (others > 1) ? "," + (others > 1) ? "," : ((others == 1) ? " and" : "")); } current_uiout->message (_("also set at pc %ps.\n"), @@ -7380,12 +7380,12 @@ watchpoint_locations_match (const struct bp_location *loc1, true, not giving a chance for GDB to check the condition of the other watchpoint. */ if ((w1->cond_exp - && target_can_accel_watchpoint_condition (loc1->address, + && target_can_accel_watchpoint_condition (loc1->address, loc1->length, loc1->watchpoint_type, w1->cond_exp.get ())) || (w2->cond_exp - && target_can_accel_watchpoint_condition (loc2->address, + && target_can_accel_watchpoint_condition (loc2->address, loc2->length, loc2->watchpoint_type, w2->cond_exp.get ()))) @@ -8937,7 +8937,7 @@ create_breakpoint_sal (struct gdbarch *gdbarch, function. In that case, it's still not possible to specify separate conditions for different overloaded functions, so we take just a single condition string. - + NOTE: If the function succeeds, the caller is expected to cleanup the arrays ADDR_STRING, COND_STRING, and SALS (but not the array contents). If the function fails (error() is called), the @@ -9074,7 +9074,7 @@ parse_breakpoint_sals (location_spec *locspec, static void breakpoint_sals_to_pc (std::vector &sals) -{ +{ for (auto &sal : sals) resolve_sal_pc (&sal); } @@ -10313,8 +10313,8 @@ is_masked_watchpoint (const struct breakpoint *b) return dynamic_cast (b) != nullptr; } -/* accessflag: hw_write: watch write, - hw_read: watch read, +/* accessflag: hw_write: watch write, + hw_read: watch read, hw_access: watch access (read or write) */ static void watch_command_1 (const char *arg, int accessflag, int from_tty, @@ -11078,14 +11078,14 @@ clear_command (const char *arg, int from_tty) file/line and pc set. So, if clear is given file/line, we can match this to existing breakpoint without obtaining pc at all. - We only support clearing given the address explicitly - present in breakpoint table. Say, we've set breakpoint + We only support clearing given the address explicitly + present in breakpoint table. Say, we've set breakpoint at file:line. There were several PC values for that file:line, due to optimization, all in one block. We've picked one PC value. If "clear" is issued with another PC corresponding to the same file:line, the breakpoint won't - be cleared. We probably can still clear the breakpoint, but + be cleared. We probably can still clear the breakpoint, but since the other PC value is never presented to user, user can only find it by guessing, and it does not seem important to support that. */ @@ -11489,7 +11489,7 @@ update_global_location_list (enum ugll_insert_mode insert_mode) if there's another location at the same address (previously marked as duplicate), we don't need to remove/insert the location. - + LOCP is kept in sync with OLD_LOCP, each pointing to the current and former bp_location array state respectively. */ @@ -11612,7 +11612,7 @@ update_global_location_list (enum ugll_insert_mode insert_mode) this location on the global list, and try to remove it next time, but there's no particular reason why we will succeed next time. - + Note that at this point, old_loc->owner is still valid, as delete_breakpoint frees the breakpoint only after calling us. */ @@ -13478,7 +13478,7 @@ find_location_by_number (int bp_num, int loc_num) if (!b || b->number != bp_num) error (_("Bad breakpoint number '%d'"), bp_num); - + if (loc_num == 0) error (_("Bad breakpoint location number '%d'"), loc_num); @@ -13820,8 +13820,8 @@ enable_breakpoint_disp (struct breakpoint *bpt, enum bpdisp disposition, { int i; i = hw_breakpoint_used_count (); - target_resources_ok = - target_can_use_hardware_watchpoint (bp_hardware_breakpoint, + target_resources_ok = + target_can_use_hardware_watchpoint (bp_hardware_breakpoint, i + 1, 0); if (target_resources_ok == 0) error (_("No hardware breakpoint support in the target.")); @@ -14167,7 +14167,7 @@ read_uploaded_action (std::string &buffer) equivalent GDB tracepoint. This is not a reliable process, since the target does not necessarily have all the information used when the tracepoint was originally defined. */ - + struct tracepoint * create_tracepoint_from_upload (struct uploaded_tp *utp) { @@ -14259,7 +14259,7 @@ create_tracepoint_from_upload (struct uploaded_tp *utp) return tp; } - + /* Print information on tracepoint number TPNUM_EXP, or all if omitted. */ @@ -14310,7 +14310,7 @@ delete_trace_command (const char *arg, int from_tty) /* Delete all tracepoints if no argument. Do not delete internal or call-dummy breakpoints, these - have to be deleted with an explicit breakpoint number + have to be deleted with an explicit breakpoint number argument. */ for (breakpoint &tp : all_tracepoints ()) if (is_tracepoint (&tp) && user_breakpoint_p (&tp)) @@ -14449,7 +14449,7 @@ get_tracepoint_by_number (const char **arg, if (tpnum <= 0) { if (instring && *instring) - gdb_printf (_("bad tracepoint number at or near '%s'\n"), + gdb_printf (_("bad tracepoint number at or near '%s'\n"), instring); else gdb_printf (_("No previous tracepoint\n")); diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 93411122e90..c94165a8f93 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -154,7 +154,7 @@ enum bptype dynamic libraries. */ bp_shlib_event, - /* Some multi-threaded systems can arrange for a location in the + /* Some multi-threaded systems can arrange for a location in the inferior to be executed when certain thread-related events occur (such as thread creation or thread death). @@ -167,10 +167,10 @@ enum bptype /* On the same principal, an overlay manager can arrange to call a magic location in the inferior whenever there is an interesting change in overlay status. GDB can update its overlay tables - and fiddle with breakpoints in overlays when this breakpoint + and fiddle with breakpoints in overlays when this breakpoint is hit. */ - bp_overlay_event, + bp_overlay_event, /* Master copies of longjmp breakpoints. These are always installed as soon as an objfile containing longjmp is loaded, but they are @@ -241,7 +241,7 @@ enum enable_state enum bpdisp { disp_del, /* Delete it */ - disp_del_at_next_stop, /* Delete at next stop, + disp_del_at_next_stop, /* Delete at next stop, whether hit or not */ disp_disable, /* Disable it */ disp_donttouch /* Leave it alone */ @@ -393,7 +393,7 @@ public: /* Is this particular location enabled. */ bool enabled = false; - + /* Is this particular location disabled because the condition expression is invalid at this location. For a location to be reported as enabled, the ENABLED field above has to be true *and* @@ -602,7 +602,7 @@ enum watchpoint_triggered watch_triggered_unknown, /* This hardware watchpoint definitely did trigger. */ - watch_triggered_yes + watch_triggered_yes }; /* Some targets (e.g., embedded PowerPC) need two debug registers to set @@ -1805,7 +1805,7 @@ extern void disable_breakpoint (struct breakpoint *); extern void enable_breakpoint (struct breakpoint *); -extern void breakpoint_set_commands (struct breakpoint *b, +extern void breakpoint_set_commands (struct breakpoint *b, counted_command_line &&commands); extern void breakpoint_set_silent (struct breakpoint *b, int silent); diff --git a/gdb/bsd-kvm.c b/gdb/bsd-kvm.c index baffa76146f..c840b9dc9a4 100644 --- a/gdb/bsd-kvm.c +++ b/gdb/bsd-kvm.c @@ -381,7 +381,7 @@ bsd_kvm_add_target (int (*supply_pcb)(struct regcache *, struct pcb *)) bsd_kvm_supply_pcb = supply_pcb; add_target (bsd_kvm_target_info, bsd_kvm_target_open); - + add_prefix_cmd ("kvm", class_obscure, bsd_kvm_cmd, _("\ Generic command for manipulating the kernel memory interface."), &bsd_kvm_cmdlist, 0, &cmdlist); diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 2a8e95e078b..b4b8b0a5215 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -323,7 +323,7 @@ buildsym_compunit::finish_block_internal opblock = NULL; for (pblock = m_pending_blocks; - pblock && pblock != old_blocks; + pblock && pblock != old_blocks; pblock = pblock->next) { if (pblock->block->superblock () == NULL) diff --git a/gdb/c-lang.c b/gdb/c-lang.c index e8e66a6e19f..95bfaa4c8ae 100644 --- a/gdb/c-lang.c +++ b/gdb/c-lang.c @@ -311,7 +311,7 @@ c_get_string (struct value *value, gdb::unique_xmalloc_ptr *buffer, if (extract_unsigned_integer (contents + i * width, width, byte_order) == 0) break; - + /* I is now either a user-defined length, the number of non-null characters, or FETCHLIMIT. */ *length = i * width; @@ -366,7 +366,7 @@ c_get_string (struct value *value, gdb::unique_xmalloc_ptr *buffer, && extract_unsigned_integer (buffer->get () + *length - width, width, byte_order) == 0) *length -= width; - + /* The read_string function will return the number of bytes read. If length returned from read_string was > 0, return the number of characters read by dividing the number of bytes by width. */ diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index be19987ea53..1dab82135d0 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -337,7 +337,7 @@ cp_type_print_method_args (struct type *mtype, const char *prefix, On outermost call, SHOW > 0 means should ignore any typename for TYPE and show its details. SHOW is always zero on recursive calls. - + NEED_POST_SPACE is non-zero when a space will be be needed between a trailing qualifier and a field, variable, or function name. */ @@ -743,7 +743,7 @@ c_type_print_varspec_suffix (struct type *type, || type->bounds ()->high.kind () == PROP_LOCLIST) gdb_printf (stream, "variable length"); else if (get_array_bounds (type, &low_bound, &high_bound)) - gdb_printf (stream, "%s", + gdb_printf (stream, "%s", plongest (high_bound - low_bound + 1)); gdb_printf (stream, (is_vector ? ")))" : "]")); @@ -1404,7 +1404,7 @@ c_type_print_base_1 (struct type *type, struct ui_file *stream, if (type->is_declared_class ()) gdb_printf (stream, "class "); /* Print the tag name if it exists. - The aCC compiler emits a spurious + The aCC compiler emits a spurious "{unnamed struct}"/"{unnamed union}"/"{unnamed enum}" tag for unnamed struct/union/enum's, which we don't want to print. */ diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c index 1a51fed74df..fd31f09ce63 100644 --- a/gdb/c-valprint.c +++ b/gdb/c-valprint.c @@ -468,7 +468,7 @@ c_value_print_inner (struct value *val, struct ui_file *stream, int recurse, void -c_value_print (struct value *val, struct ui_file *stream, +c_value_print (struct value *val, struct ui_file *stream, const struct value_print_options *options) { struct type *type, *real_type; @@ -563,7 +563,7 @@ c_value_print (struct value *val, struct ui_file *stream, if (real_type) { /* We have RTTI information, so use it. */ - val = value_full_object (val, real_type, + val = value_full_object (val, real_type, full, top, using_enc); /* In a destructor we might see a real type that is a superclass of the object's type. In this case it is diff --git a/gdb/c-varobj.c b/gdb/c-varobj.c index df407b1ebe7..447a19fe4d4 100644 --- a/gdb/c-varobj.c +++ b/gdb/c-varobj.c @@ -72,7 +72,7 @@ adjust_value_for_child_access (struct value **value, *was_ptr = 0; *type = check_typedef (*type); - + /* The type of value stored in varobj, that is passed to us, is already supposed to be reference-stripped. */ @@ -211,7 +211,7 @@ c_number_of_children (const struct varobj *var) We can show char* so we allow it to be dereferenced. If you decide to test for it, please mind that a little magic is necessary to - properly identify it: char* has TYPE_CODE == TYPE_CODE_INT and + properly identify it: char* has TYPE_CODE == TYPE_CODE_INT and TYPE_NAME == "char". */ if (target->code () == TYPE_CODE_FUNC || target->code () == TYPE_CODE_VOID) @@ -277,7 +277,7 @@ value_struct_element_index (struct value *value, int type_index) information cannot be determined, set *CNAME, *CVALUE, or *CTYPE to empty. */ -static void +static void c_describe_child (const struct varobj *parent, int index, std::string *cname, struct value **cvalue, struct type **ctype, std::string *cfull_expression) @@ -432,7 +432,7 @@ c_path_expr_of_child (const struct varobj *child) { std::string path_expr; - c_describe_child (child->parent, child->index, NULL, NULL, NULL, + c_describe_child (child->parent, child->index, NULL, NULL, NULL, &path_expr); return path_expr; } @@ -513,7 +513,7 @@ c_value_of_variable (const struct varobj *var, gdb_assert (varobj_value_is_changeable_p (var)); gdb_assert (!var->value->lazy ()); - + /* If the specified format is the current one, we can reuse print_value. */ if (format == var->format) @@ -795,7 +795,7 @@ cplus_describe_child (const struct varobj *parent, int index, const char *ptr = was_ptr ? "*" : ""; /* Cast the parent to the base' type. Note that in gdb, - expression like + expression like (Base1)d will create an lvalue, for all appearances, so we don't need to use more fancy: @@ -834,7 +834,7 @@ cplus_describe_child (const struct varobj *parent, int index, access = "public"; else if (children[v_private] > 0) access = "private"; - else + else access = "protected"; break; case 1: @@ -867,7 +867,7 @@ cplus_describe_child (const struct varobj *parent, int index, else { c_describe_child (parent, index, cname, cvalue, ctype, cfull_expression); - } + } } static std::string @@ -884,7 +884,7 @@ cplus_path_expr_of_child (const struct varobj *child) { std::string path_expr; - cplus_describe_child (child->parent, child->index, NULL, NULL, NULL, + cplus_describe_child (child->parent, child->index, NULL, NULL, NULL, &path_expr); return path_expr; } diff --git a/gdb/charset-list.h b/gdb/charset-list.h index 2119e238a1c..0af3888b33a 100644 --- a/gdb/charset-list.h +++ b/gdb/charset-list.h @@ -22,9 +22,9 @@ /* Note that the first entry must always be "auto". The remaining entries were created by running this script: - + iconv -l | sed -e '/[/]...*$/d' -e 's@^\(.*\)//$@"\1", \\@' - + .. and then removing the final backslash. It would be nice to separate narrow and wide character sets, but there is no good way to do that. */ diff --git a/gdb/charset.c b/gdb/charset.c index fe725efcfd1..0ece7ed4384 100644 --- a/gdb/charset.c +++ b/gdb/charset.c @@ -61,7 +61,7 @@ conversions), and so on. - + To avoid excessive code duplication and maintenance efforts, GDB simply requires a capable iconv function. Users on platforms without a suitable iconv can use the GNU iconv library. */ @@ -80,7 +80,7 @@ #else # define GDB_DEFAULT_HOST_CHARSET "ISO-8859-1" #endif -#define GDB_DEFAULT_TARGET_CHARSET GDB_DEFAULT_HOST_CHARSET +#define GDB_DEFAULT_TARGET_CHARSET GDB_DEFAULT_HOST_CHARSET #define GDB_DEFAULT_TARGET_WIDE_CHARSET "UTF-32" #undef DEFAULT_CHARSET_NAMES #define DEFAULT_CHARSET_NAMES GDB_DEFAULT_HOST_CHARSET , @@ -255,9 +255,9 @@ show_target_charset_name (struct ui_file *file, int from_tty, static const char *target_wide_charset_name = "auto"; static void -show_target_wide_charset_name (struct ui_file *file, +show_target_wide_charset_name (struct ui_file *file, int from_tty, - struct cmd_list_element *c, + struct cmd_list_element *c, const char *value) { if (!strcmp (value, "auto")) @@ -363,7 +363,7 @@ validate (struct gdbarch *gdbarch) /* This is the sfunc for the 'set charset' command. */ static void -set_charset_sfunc (const char *charset, int from_tty, +set_charset_sfunc (const char *charset, int from_tty, struct cmd_list_element *c) { /* CAREFUL: set the target charset here as well. */ @@ -398,13 +398,13 @@ set_target_wide_charset_sfunc (const char *charset, int from_tty, /* sfunc for the 'show charset' command. */ static void -show_charset (struct ui_file *file, int from_tty, +show_charset (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *name) { show_host_charset_name (file, from_tty, c, host_charset_name); show_target_charset_name (file, from_tty, c, target_charset_name); - show_target_wide_charset_name (file, from_tty, c, + show_target_wide_charset_name (file, from_tty, c, target_wide_charset_name); } @@ -585,7 +585,7 @@ convert_between_encodings (const char *from, const char *to, /* Create a new iterator. */ -wchar_iterator::wchar_iterator (const gdb_byte *input, size_t bytes, +wchar_iterator::wchar_iterator (const gdb_byte *input, size_t bytes, const char *charset, size_t width) : m_input (input), m_bytes (bytes), @@ -638,7 +638,7 @@ wchar_iterator::iterate (enum wchar_iterate_result *out_result, converted a character; if so, return it. */ if (out_avail < out_request * sizeof (gdb_wchar_t)) break; - + /* Otherwise skip the first invalid character, and let the caller know about it. */ *out_result = wchar_iterate_invalid; diff --git a/gdb/charset.h b/gdb/charset.h index a0f109da5ee..7a342d205e6 100644 --- a/gdb/charset.h +++ b/gdb/charset.h @@ -101,7 +101,7 @@ class wchar_iterator ~wchar_iterator (); /* Perform a single iteration of a wchar_t iterator. - + Returns the number of characters converted. A negative result means that EOF has been reached. A positive result indicates the number of valid wchar_ts in the result; *OUT_CHARS is updated to @@ -120,7 +120,7 @@ class wchar_iterator wchar_iterate_incomplete means that an incomplete character was seen at the end of the input sequence. - + wchar_iterate_eof means that all bytes were successfully converted. The other output arguments are not set. */ int iterate (enum wchar_iterate_result *out_result, gdb_wchar_t **out_chars, diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c index 2b30a6e04fb..cd3c12990a6 100644 --- a/gdb/cli/cli-decode.c +++ b/gdb/cli/cli-decode.c @@ -188,7 +188,7 @@ cmd_list_element::command_components () const Add this command to command list *LIST. - Returns a pointer to the added command (not necessarily the head + Returns a pointer to the added command (not necessarily the head of *LIST). */ static struct cmd_list_element * @@ -2526,23 +2526,23 @@ lookup_cmd_exact (const char *name, deprecated and a warning message should be generated. This function decodes TEXT and potentially generates a warning message as outlined below. - + Example for 'set endian big' which has a fictitious alias 'seb'. - + If alias wasn't used in TEXT, and the command is deprecated: - "warning: 'set endian big' is deprecated." - + "warning: 'set endian big' is deprecated." + If alias was used, and only the alias is deprecated: "warning: 'seb' an alias for the command 'set endian big' is deprecated." - + If alias was used and command is deprecated (regardless of whether the alias itself is deprecated: - + "warning: 'set endian big' (seb) is deprecated." After the message has been sent, clear the appropriate flags in the command and/or the alias so the user is no longer bothered. - + */ void deprecated_cmd_warning (const char *text, struct cmd_list_element *list) diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c index 3cdd9a334d3..b2fb13983e7 100644 --- a/gdb/cli/cli-dump.c +++ b/gdb/cli/cli-dump.c @@ -128,7 +128,7 @@ static struct cmd_list_element *binary_dump_cmdlist; static struct cmd_list_element *binary_append_cmdlist; static void -dump_binary_file (const char *filename, const char *mode, +dump_binary_file (const char *filename, const char *mode, const bfd_byte *buf, ULONGEST len) { int status; @@ -143,8 +143,8 @@ dump_binary_file (const char *filename, const char *mode, } static void -dump_bfd_file (const char *filename, const char *mode, - const char *target, CORE_ADDR vaddr, +dump_bfd_file (const char *filename, const char *mode, + const char *target, CORE_ADDR vaddr, const bfd_byte *buf, ULONGEST len) { asection *osection; @@ -192,7 +192,7 @@ dump_memory_to_file (const char *cmd, const char *mode, const char *file_format) value. */ gdb::byte_vector buf (count); read_memory (lo, buf.data (), count); - + /* Have everything. Open/write the data. */ if (file_format == NULL || strcmp (file_format, "binary") == 0) dump_binary_file (filename.get (), mode, buf.data (), count); @@ -240,7 +240,7 @@ dump_value_to_file (const char *cmd, const char *mode, const char *file_format) } dump_bfd_file (filename.get (), mode, file_format, vaddr, - val->contents ().data (), + val->contents ().data (), val->type ()->length ()); } } @@ -364,10 +364,10 @@ add_dump_command (const char *name, /* Replace "Dump " at start of docstring with "Append " (borrowed from [deleted] deprecated_add_show_from_set). */ - if ( c->doc[0] == 'W' - && c->doc[1] == 'r' + if ( c->doc[0] == 'W' + && c->doc[1] == 'r' && c->doc[2] == 'i' - && c->doc[3] == 't' + && c->doc[3] == 't' && c->doc[4] == 'e' && c->doc[5] == ' ') c->doc = concat ("Append ", c->doc + 6, (char *)NULL); @@ -397,7 +397,7 @@ restore_one_section (bfd *ibfd, asection *isec, || (load_end > 0 && sec_start >= load_end)) { /* No, no usable data in this section. */ - gdb_printf (_("skipping section %s...\n"), + gdb_printf (_("skipping section %s...\n"), bfd_section_name (isec)); return; } @@ -415,12 +415,12 @@ restore_one_section (bfd *ibfd, asection *isec, /* Get the data. */ gdb::byte_vector buf (size); if (!bfd_get_section_contents (ibfd, isec, buf.data (), 0, size)) - error (_("Failed to read bfd file %s: '%s'."), bfd_get_filename (ibfd), + error (_("Failed to read bfd file %s: '%s'."), bfd_get_filename (ibfd), bfd_errmsg (bfd_get_error ())); gdb_printf ("Restoring section %s (0x%lx to 0x%lx)", - bfd_section_name (isec), - (unsigned long) sec_start, + bfd_section_name (isec), + (unsigned long) sec_start, (unsigned long) sec_end); if (load_offset != 0 || load_start != 0 || load_end != 0) @@ -463,7 +463,7 @@ restore_binary_file (const char *filename, CORE_ADDR load_offset, perror_with_name (filename); if (len <= load_start) - error (_("Start address is greater than length of binary file %s."), + error (_("Start address is greater than length of binary file %s."), filename); /* Chop off "len" if it exceeds the requested load_end addr. */ @@ -473,9 +473,9 @@ restore_binary_file (const char *filename, CORE_ADDR load_offset, if (load_start > 0) len -= load_start; - gdb_printf - ("Restoring binary file %s into memory (0x%lx to 0x%lx)\n", - filename, + gdb_printf + ("Restoring binary file %s into memory (0x%lx to 0x%lx)\n", + filename, (unsigned long) (load_start + load_offset), (unsigned long) (load_start + load_offset + len)); @@ -591,13 +591,13 @@ the specified FILE in raw target ordered bytes."); add_basic_prefix_cmd ("srec", all_commands, _("Write target code/data to an srec file."), &srec_cmdlist, - 0 /*allow-unknown*/, + 0 /*allow-unknown*/, &dump_cmdlist); add_basic_prefix_cmd ("ihex", all_commands, _("Write target code/data to an intel hex file."), &ihex_cmdlist, - 0 /*allow-unknown*/, + 0 /*allow-unknown*/, &dump_cmdlist); add_basic_prefix_cmd ("verilog", all_commands, @@ -609,19 +609,19 @@ the specified FILE in raw target ordered bytes."); add_basic_prefix_cmd ("tekhex", all_commands, _("Write target code/data to a tekhex file."), &tekhex_cmdlist, - 0 /*allow-unknown*/, + 0 /*allow-unknown*/, &dump_cmdlist); add_basic_prefix_cmd ("binary", all_commands, _("Write target code/data to a raw binary file."), &binary_dump_cmdlist, - 0 /*allow-unknown*/, + 0 /*allow-unknown*/, &dump_cmdlist); add_basic_prefix_cmd ("binary", all_commands, _("Append target code/data to a raw binary file."), &binary_append_cmdlist, - 0 /*allow-unknown*/, + 0 /*allow-unknown*/, &append_cmdlist); add_cmd ("memory", all_commands, dump_srec_memory, _("\ diff --git a/gdb/cli/cli-logging.c b/gdb/cli/cli-logging.c index d6eb6c2b98f..9727b5a3538 100644 --- a/gdb/cli/cli-logging.c +++ b/gdb/cli/cli-logging.c @@ -167,7 +167,7 @@ set_logging_on (const char *args, int from_tty) handle_redirections (from_tty); } -static void +static void set_logging_off (const char *args, int from_tty) { if (saved_filename.empty ()) diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index 048d3914ffd..c5b6f88bf88 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -931,7 +931,7 @@ line_first_arg (const char *p) { const char *first_arg = p + find_command_name_length (p); - return skip_spaces (first_arg); + return skip_spaces (first_arg); } /* Process one input line. If the command is an "end", return such an @@ -1383,7 +1383,7 @@ do_define_command (const char *comname, int from_tty, const char *comfull; int hook_type = CMD_NO_HOOK; int hook_name_size = 0; - + #define HOOK_STRING "hook-" #define HOOK_LEN 5 #define HOOK_POST_STRING "hookpost-" diff --git a/gdb/cli/cli-utils.c b/gdb/cli/cli-utils.c index d0ca594671d..8396f74e6ac 100644 --- a/gdb/cli/cli-utils.c +++ b/gdb/cli/cli-utils.c @@ -334,12 +334,12 @@ number_or_range_parser::finished () const && (c_isdigit (m_cur_tok[1]) || m_cur_tok[1] == '$')))); } -/* Accept a number and a string-form list of numbers such as is +/* Accept a number and a string-form list of numbers such as is accepted by get_number_or_range. Return TRUE if the number is in the list. - By definition, an empty list includes all numbers. This is to - be interpreted as typing a command such as "delete break" with + By definition, an empty list includes all numbers. This is to + be interpreted as typing a command such as "delete break" with no arguments. */ int diff --git a/gdb/cli/cli-utils.h b/gdb/cli/cli-utils.h index f9b012317f2..22db7c1d0a1 100644 --- a/gdb/cli/cli-utils.h +++ b/gdb/cli/cli-utils.h @@ -145,12 +145,12 @@ private: bool m_in_range; }; -/* Accept a number and a string-form list of numbers such as is +/* Accept a number and a string-form list of numbers such as is accepted by get_number_or_range. Return TRUE if the number is in the list. - By definition, an empty list includes all numbers. This is to - be interpreted as typing a command such as "delete break" with + By definition, an empty list includes all numbers. This is to + be interpreted as typing a command such as "delete break" with no arguments. */ extern int number_is_in_list (const char *list, int number); diff --git a/gdb/coffread.c b/gdb/coffread.c index 0a3be97c8d8..f8295586d8c 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -405,7 +405,7 @@ cs_section_address (struct coff_symbol *cs, bfd *abfd) /* Look up a coff type-number index. Return the address of the slot where the type for that index is stored. - The type-number is in INDEX. + The type-number is in INDEX. This can be used for finding the type associated with that index or for associating a new type with the index. */ @@ -537,7 +537,7 @@ is_import_fixup_symbol (struct coff_symbol *cs, static struct minimal_symbol * record_minimal_symbol (minimal_symbol_reader &reader, struct coff_symbol *cs, unrelocated_addr address, - enum minimal_symbol_type type, int section, + enum minimal_symbol_type type, int section, struct objfile *objfile) { /* We don't want TDESC entry points in the minimal symbol table. */ @@ -706,7 +706,7 @@ coff_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags) file_ptr symtab_offset; file_ptr stringtab_offset; unsigned int stabstrsize; - + info = coff_objfile_data_key.get (objfile); symfile_bfd = abfd; /* Kludge for swap routines. */ @@ -1141,7 +1141,7 @@ coff_symtab_read (minimal_symbol_reader &reader, newobj = push_context (depth, fcn_start_addr); fcn_cs_saved.c_name = getsymname (&fcn_sym_saved); newobj->name = - process_coff_symbol (&fcn_cs_saved, + process_coff_symbol (&fcn_cs_saved, &fcn_aux_saved, objfile); } else if (strcmp (cs->c_name, ".ef") == 0) @@ -1732,7 +1732,7 @@ process_coff_symbol (struct coff_symbol *cs, /* If we are giving a name to a type such as "pointer to foo" or "function returning foo", we better not set the TYPE_NAME. If the program - contains "typedef char *caddr_t;", we don't want + contains "typedef char *caddr_t;", we don't want all variables of type char * to print as caddr_t. This is not just a consequence of GDB's type management; CC and GCC (at least through version @@ -1879,9 +1879,9 @@ decode_type (struct coff_symbol *cs, unsigned int c_type, return the type that the function returns. */ static struct type * -decode_function_type (struct coff_symbol *cs, +decode_function_type (struct coff_symbol *cs, unsigned int c_type, - union internal_auxent *aux, + union internal_auxent *aux, struct objfile *objfile) { if (aux->x_sym.x_tagndx.u32 == 0) @@ -1894,9 +1894,9 @@ decode_function_type (struct coff_symbol *cs, /* Basic C types. */ static struct type * -decode_base_type (struct coff_symbol *cs, +decode_base_type (struct coff_symbol *cs, unsigned int c_type, - union internal_auxent *aux, + union internal_auxent *aux, struct objfile *objfile) { struct gdbarch *gdbarch = objfile->arch (); diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c index 49b967afed5..6bee32ec31b 100644 --- a/gdb/compile/compile-object-load.c +++ b/gdb/compile/compile-object-load.c @@ -484,7 +484,7 @@ get_out_value_type (struct symbol *func_sym, struct objfile *objfile, "in compiled module \"%s\"."), gdb_type_from_ptr->code (), COMPILE_I_EXPR_VAL, objfile_name (objfile)); - + retval = gdb_type_from_ptr; switch (gdb_type_from_ptr->code ()) { diff --git a/gdb/complaints.c b/gdb/complaints.c index 03d27d615a5..fa0cd672e99 100644 --- a/gdb/complaints.c +++ b/gdb/complaints.c @@ -182,7 +182,7 @@ test_complaints () INIT_GDB_FILE (complaints) { - add_setshow_zinteger_cmd ("complaints", class_support, + add_setshow_zinteger_cmd ("complaints", class_support, &stop_whining, _("\ Set max number of complaints about incorrect symbols."), _("\ Show max number of complaints about incorrect symbols."), NULL, diff --git a/gdb/completer.c b/gdb/completer.c index b919b4c4dc3..df9feffb68e 100644 --- a/gdb/completer.c +++ b/gdb/completer.c @@ -160,7 +160,7 @@ enum explicit_location_match_type will quote it. That's why we switch between current_language->word_break_characters () and gdb_completer_command_word_break_characters. I'm not sure when - we need this behavior (perhaps for funky characters in C++ + we need this behavior (perhaps for funky characters in C++ symbols?). */ /* Variables which are necessary for fancy command line editing. */ @@ -212,7 +212,7 @@ static const char gdb_completer_file_name_quote_characters[] = "'\""; symbols but don't want to complete on anything else either. */ void -noop_completer (struct cmd_list_element *ignore, +noop_completer (struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *prefix) { @@ -2164,7 +2164,7 @@ complete_line (completion_tracker &tracker, /* Complete on command names. Used by "help". */ void -command_completer (struct cmd_list_element *ignore, +command_completer (struct cmd_list_element *ignore, completion_tracker &tracker, const char *text, const char *word) { diff --git a/gdb/contrib/ari/update-web-ari.sh b/gdb/contrib/ari/update-web-ari.sh index b9ef18471a9..117c0ba5900 100644 --- a/gdb/contrib/ari/update-web-ari.sh +++ b/gdb/contrib/ari/update-web-ari.sh @@ -762,7 +762,7 @@ END { print "bugs/oks: " bugs "/" oks print bugs "/ (" oks "+" legacy "+" deprecated ")" } - # This value should be as low as possible + # This value should be as low as possible print bugs / ( oks + legacy + deprecated ) } ' ${wwwdir}/ari.doc` diff --git a/gdb/copying.awk b/gdb/copying.awk index 7a450d46c80..51e62a431b3 100644 --- a/gdb/copying.awk +++ b/gdb/copying.awk @@ -22,7 +22,7 @@ NR == 1,/^[ ]*15\. Disclaimer of Warranty\.[ ]*$/ { { printf " gdb_printf (\"\\n\");\n"; } - else if ($0 !~ /^[ ]*15\. Disclaimer of Warranty\.[ ]*$/) + else if ($0 !~ /^[ ]*15\. Disclaimer of Warranty\.[ ]*$/) { printf " gdb_printf (\""; for (i = 1; i < NF; i++) @@ -37,8 +37,8 @@ NR == 1,/^[ ]*15\. Disclaimer of Warranty\.[ ]*$/ { print "show_warranty_command (const char *ignore, int from_tty)"; print "{"; } -/^[ ]*15\. Disclaimer of Warranty\.[ ]*$/, /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/{ - if (! ($0 ~ /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/)) +/^[ ]*15\. Disclaimer of Warranty\.[ ]*$/, /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/{ + if (! ($0 ~ /^[ ]*END OF TERMS AND CONDITIONS[ ]*$/)) { printf " gdb_printf (\""; for (i = 1; i < NF; i++) diff --git a/gdb/corefile.c b/gdb/corefile.c index 666ff55e814..e766c214634 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -190,7 +190,7 @@ read_code (CORE_ADDR memaddr, gdb_byte *myaddr, ssize_t len) if successful. */ int -safe_read_memory_integer (CORE_ADDR memaddr, int len, +safe_read_memory_integer (CORE_ADDR memaddr, int len, enum bfd_endian byte_order, LONGEST *return_value) { @@ -273,7 +273,7 @@ read_memory_typed_address (CORE_ADDR addr, struct type *type) /* See gdbcore.h. */ void -write_memory (CORE_ADDR memaddr, +write_memory (CORE_ADDR memaddr, const bfd_byte *myaddr, ssize_t len) { int status; @@ -306,7 +306,7 @@ write_memory_with_notification (CORE_ADDR memaddr, const bfd_byte *myaddr, /* Store VALUE at ADDR in the inferior as a LEN-byte unsigned integer. */ void -write_memory_unsigned_integer (CORE_ADDR addr, int len, +write_memory_unsigned_integer (CORE_ADDR addr, int len, enum bfd_endian byte_order, ULONGEST value) { @@ -319,7 +319,7 @@ write_memory_unsigned_integer (CORE_ADDR addr, int len, /* Store VALUE at ADDR in the inferior as a LEN-byte signed integer. */ void -write_memory_signed_integer (CORE_ADDR addr, int len, +write_memory_signed_integer (CORE_ADDR addr, int len, enum bfd_endian byte_order, LONGEST value) { diff --git a/gdb/corelow.c b/gdb/corelow.c index 65a672bbaa3..218504bcdc8 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -1914,7 +1914,7 @@ core_target::info_proc_mappings (struct gdbarch *gdbarch) } } -/* Implement "maintenance print core-file-backed-mappings" command. +/* Implement "maintenance print core-file-backed-mappings" command. If mappings are loaded, the results should be similar to the mappings shown by "info proc mappings". This command is mainly a diff --git a/gdb/cp-abi.h b/gdb/cp-abi.h index c564d67c814..b098e23e00f 100644 --- a/gdb/cp-abi.h +++ b/gdb/cp-abi.h @@ -72,7 +72,7 @@ enum dtor_kinds { object. */ base_object_dtor }; - + /* Return non-zero iff NAME is the mangled name of a destructor. Actually, return an `enum dtor_kind' value describing what *kind* of destructor it is. */ diff --git a/gdb/cp-support.c b/gdb/cp-support.c index 5d459dad0da..cdb3a33ed5f 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -706,7 +706,7 @@ mangled_name_to_comp (const char *mangled_name, int options, options); if (demangled_name == NULL) return NULL; - + /* If we could demangle the name, parse it to build the component tree. */ std::unique_ptr info diff --git a/gdb/cris-tdep.c b/gdb/cris-tdep.c index 5c04c7cb8cc..e6925a617ea 100644 --- a/gdb/cris-tdep.c +++ b/gdb/cris-tdep.c @@ -51,15 +51,15 @@ enum cris_num_regs { /* There are no floating point registers. Used in gdbserver low-linux.c. */ NUM_FREGS = 0, - + /* There are 16 general registers. */ NUM_GENREGS = 16, - + /* There are 16 special registers. */ NUM_SPECREGS = 16, /* CRISv32 has a pseudo PC register, not noted here. */ - + /* CRISv32 has 16 support registers. */ NUM_SUPPREGS = 16 }; @@ -79,7 +79,7 @@ enum cris_num_regs enum cris_regnums { - /* Enums with respect to the general registers, valid for all + /* Enums with respect to the general registers, valid for all CRIS versions. The frame pointer is always in R8. */ CRIS_FP_REGNUM = 8, /* ABI related registers. */ @@ -89,7 +89,7 @@ enum cris_regnums ARG2_REGNUM = 11, ARG3_REGNUM = 12, ARG4_REGNUM = 13, - + /* Registers which happen to be common. */ VR_REGNUM = 17, MOF_REGNUM = 23, @@ -341,17 +341,17 @@ cris_sigtramp_frame_unwind_cache (const frame_info_ptr &this_frame, info->base = extract_unsigned_integer (buf, 4, byte_order); addr = cris_sigcontext_addr (this_frame); - + /* Layout of the sigcontext struct: struct sigcontext { struct pt_regs regs; unsigned long oldmask; unsigned long usp; }; */ - + if (tdep->cris_version == 10) { - /* R0 to R13 are stored in reverse order at offset (2 * 4) in + /* R0 to R13 are stored in reverse order at offset (2 * 4) in struct pt_regs. */ for (i = 0; i <= 13; i++) info->saved_regs[i].set_addr (addr + ((15 - i) * 4)); @@ -360,7 +360,7 @@ cris_sigtramp_frame_unwind_cache (const frame_info_ptr &this_frame, info->saved_regs[DCCR_REGNUM].set_addr (addr + (17 * 4)); info->saved_regs[SRP_REGNUM].set_addr (addr + (18 * 4)); /* Note: IRP is off by 2 at this point. There's no point in correcting - it though since that will mean that the backtrace will show a PC + it though since that will mean that the backtrace will show a PC different from what is shown when stopped. */ info->saved_regs[IRP_REGNUM].set_addr (addr + (19 * 4)); info->saved_regs[gdbarch_pc_regnum (gdbarch)] @@ -370,7 +370,7 @@ cris_sigtramp_frame_unwind_cache (const frame_info_ptr &this_frame, else { /* CRISv32. */ - /* R0 to R13 are stored in order at offset (1 * 4) in + /* R0 to R13 are stored in order at offset (1 * 4) in struct pt_regs. */ for (i = 0; i <= 13; i++) info->saved_regs[i].set_addr (addr + ((i + 1) * 4)); @@ -389,7 +389,7 @@ cris_sigtramp_frame_unwind_cache (const frame_info_ptr &this_frame, be wrong at this point. This problem manifests itself in the sigaltstack.exp test case, which occasionally generates FAILs when the signal is received while in a delay slot. - + This could be solved by a couple of read_memory_unsigned_integer and a trad_frame_set_value. */ info->saved_regs[gdbarch_pc_regnum (gdbarch)] @@ -397,7 +397,7 @@ cris_sigtramp_frame_unwind_cache (const frame_info_ptr &this_frame, info->saved_regs[gdbarch_sp_regnum (gdbarch)].set_addr (addr + (25 * 4)); } - + return info; } @@ -428,7 +428,7 @@ cris_sigtramp_frame_sniffer (const struct frame_unwind *self, const frame_info_ptr &this_frame, void **this_cache) { - if (cris_sigtramp_start (this_frame) + if (cris_sigtramp_start (this_frame) || cris_rt_sigtramp_start (this_frame)) return 1; @@ -471,7 +471,7 @@ crisv32_single_step_through_delay (struct gdbarch *gdbarch, /* The instruction environment needed to find single-step breakpoints. */ -typedef +typedef struct instruction_environment { unsigned long reg[NUM_GENREGS]; @@ -538,7 +538,7 @@ enum cris_opcode_masks 5 - 4 Size 3 - 0 Operand1 */ -static int +static int cris_get_operand2 (unsigned short insn) { return ((insn & 0xF000) >> 12); @@ -615,8 +615,8 @@ cris_is_xflag_bit_on (unsigned short insn) static void cris_set_size_to_dword (unsigned short *insn) { - *insn &= 0xFFCF; - *insn |= 0x20; + *insn &= 0xFFCF; + *insn |= 0x20; } static signed char @@ -635,20 +635,20 @@ static struct gdbarch *cris_gdbarch_init (struct gdbarch_info, static void cris_dump_tdep (struct gdbarch *, struct ui_file *); -static void set_cris_version (const char *ignore_args, int from_tty, +static void set_cris_version (const char *ignore_args, int from_tty, struct cmd_list_element *c); -static void set_cris_mode (const char *ignore_args, int from_tty, +static void set_cris_mode (const char *ignore_args, int from_tty, struct cmd_list_element *c); -static void set_cris_dwarf2_cfi (const char *ignore_args, int from_tty, +static void set_cris_dwarf2_cfi (const char *ignore_args, int from_tty, struct cmd_list_element *c); -static CORE_ADDR cris_scan_prologue (CORE_ADDR pc, +static CORE_ADDR cris_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, struct cris_unwind_cache *info); -static CORE_ADDR crisv32_scan_prologue (CORE_ADDR pc, +static CORE_ADDR crisv32_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, struct cris_unwind_cache *info); @@ -820,13 +820,13 @@ cris_push_dummy_call (struct gdbarch *gdbarch, struct value *function, const gdb_byte *val; int reg_demand; int i; - + len = args[argnum]->type ()->length (); val = args[argnum]->contents ().data (); - + /* How may registers worth of storage do we need for this argument? */ reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0); - + if (len <= (2 * 4) && (argreg + reg_demand - 1 <= ARG4_REGNUM)) { /* Data passed by value. Fits in available register(s). */ @@ -919,7 +919,7 @@ cris_frame_base_address (const frame_info_ptr &this_frame, void **this_cache) return info->base; } -static const struct frame_base cris_frame_base = +static const struct frame_base cris_frame_base = { &cris_frame_unwind, cris_frame_base_address, @@ -972,7 +972,7 @@ static const struct frame_base cris_frame_base = If local variables are declared or register contents are saved on stack the subq-instruction will be present with X as the number of bytes needed for storage. The reshuffle with respect to r8 may be performed - with any size S (b, w, d) and any of the general registers Z={0..13}. + with any size S (b, w, d) and any of the general registers Z={0..13}. The offset U should be representable by a signed 8-bit value in all cases. Thus, the prefix word is assumed to be immediate byte offset mode followed by another word containing the instruction. @@ -982,7 +982,7 @@ static const struct frame_base cris_frame_base = push r8 move.d sp,r8 move.d r8,sp - pop r8 + pop r8 Prologue instructions C++-code. Case 1) and 2) in the C-code may be followed by @@ -993,17 +993,17 @@ static const struct frame_base cris_frame_base = move.d r13,rV ; P3 move.S [r8+U],rZ ; P4 - if any of the call parameters are stored. The host expects these + if any of the call parameters are stored. The host expects these instructions to be executed in order to get the call parameters right. */ -/* Examine the prologue of a function. The variable ip is the address of - the first instruction of the prologue. The variable limit is the address - of the first instruction after the prologue. The variable fi contains the +/* Examine the prologue of a function. The variable ip is the address of + the first instruction of the prologue. The variable limit is the address + of the first instruction after the prologue. The variable fi contains the information in struct frame_info. The variable frameless_p controls whether - the entire prologue is examined (0) or just enough instructions to + the entire prologue is examined (0) or just enough instructions to determine that it is a prologue (1). */ -static CORE_ADDR +static CORE_ADDR cris_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, struct cris_unwind_cache *info) { @@ -1014,17 +1014,17 @@ cris_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, unsigned short insn; /* Next instruction, lookahead. */ - unsigned short insn_next; + unsigned short insn_next; int regno; /* Number of byte on stack used for local variables and movem. */ - int val; + int val; /* Highest register number in a movem. */ int regsave; /* move.d r,rS */ - short source_register; + short source_register; /* Scan limit. */ int limit; @@ -1060,7 +1060,7 @@ cris_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, { info->sp_offset += 4; } - /* This check, meant to recognize srp, used to be regno == + /* This check, meant to recognize srp, used to be regno == (SRP_REGNUM - NUM_GENREGS), but that covers r11 also. */ if (insn_next == 0xBE7E) { @@ -1097,7 +1097,7 @@ cris_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, info->sp_offset += cris_get_quick_value (insn); } } - else if (cris_get_mode (insn) == 0x0002 + else if (cris_get_mode (insn) == 0x0002 && cris_get_opcode (insn) == 0x000F && cris_get_size (insn) == 0x0003 && cris_get_operand1 (insn) == gdbarch_sp_regnum (gdbarch)) @@ -1109,9 +1109,9 @@ cris_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, && ((insn & 0x0F00) >> 8) == 0x0001 && (cris_get_signed_offset (insn) < 0)) { - /* Immediate byte offset addressing prefix word with sp as base - register. Used for CRIS v8 i.e. ETRAX 100 and newer if - is between 64 and 128. + /* Immediate byte offset addressing prefix word with sp as base + register. Used for CRIS v8 i.e. ETRAX 100 and newer if + is between 64 and 128. movem r,[sp=sp-] */ if (info) { @@ -1155,11 +1155,11 @@ cris_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, break; } } - else if (cris_get_operand2 (insn) == CRIS_FP_REGNUM + else if (cris_get_operand2 (insn) == CRIS_FP_REGNUM /* The size is a fixed-size. */ - && ((insn & 0x0F00) >> 8) == 0x0001 + && ((insn & 0x0F00) >> 8) == 0x0001 /* A negative offset. */ - && (cris_get_signed_offset (insn) < 0)) + && (cris_get_signed_offset (insn) < 0)) { /* move.S rZ,[r8-U] (?) */ insn_next = read_memory_unsigned_integer (pc, 2, byte_order); @@ -1179,11 +1179,11 @@ cris_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, break; } } - else if (cris_get_operand2 (insn) == CRIS_FP_REGNUM + else if (cris_get_operand2 (insn) == CRIS_FP_REGNUM /* The size is a fixed-size. */ - && ((insn & 0x0F00) >> 8) == 0x0001 + && ((insn & 0x0F00) >> 8) == 0x0001 /* A positive offset. */ - && (cris_get_signed_offset (insn) > 0)) + && (cris_get_signed_offset (insn) > 0)) { /* move.S [r8+U],rZ (?) */ insn_next = read_memory_unsigned_integer (pc, 2, byte_order); @@ -1232,14 +1232,14 @@ cris_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, this_base = get_frame_register_unsigned (this_frame, CRIS_FP_REGNUM); info->base = this_base; info->saved_regs[CRIS_FP_REGNUM].set_addr (info->base); - + /* The FP points at the last saved register. Adjust the FP back to before the first saved register giving the SP. */ info->prev_sp = info->base + info->r8_offset; } else { - ULONGEST this_base; + ULONGEST this_base; /* Assume that the FP is this frame's SP but with that pushed stack space added back. */ this_base = get_frame_register_unsigned (this_frame, @@ -1247,10 +1247,10 @@ cris_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, info->base = this_base; info->prev_sp = info->base + info->size; } - + /* Calculate the addresses for the saved registers on the stack. */ /* FIXME: The address calculation should really be done on the fly while - we're analyzing the prologue (we only hold one regsave value as it is + we're analyzing the prologue (we only hold one regsave value as it is now). */ val = info->sp_offset; @@ -1286,7 +1286,7 @@ cris_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, return pc; } -static CORE_ADDR +static CORE_ADDR crisv32_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, struct cris_unwind_cache *info) { @@ -1294,14 +1294,14 @@ crisv32_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, ULONGEST this_base; /* Unlike the CRISv10 prologue scanner (cris_scan_prologue), this is not - meant to be a full-fledged prologue scanner. It is only needed for + meant to be a full-fledged prologue scanner. It is only needed for the cases where we end up in code always lacking DWARF-2 CFI, notably: * PLT stubs (library calls) * call dummys * signal trampolines - For those cases, it is assumed that there is no actual prologue; that + For those cases, it is assumed that there is no actual prologue; that the stack pointer is not adjusted, and (as a consequence) the return address is not pushed onto the stack. */ @@ -1317,7 +1317,7 @@ crisv32_scan_prologue (CORE_ADDR pc, const frame_info_ptr &this_frame, gdbarch_sp_regnum (gdbarch)); info->base = this_base; info->prev_sp = this_base; - + /* The PC is assumed to be found in SRP. */ info->saved_regs[gdbarch_pc_regnum (gdbarch)] = info->saved_regs[SRP_REGNUM]; @@ -1338,7 +1338,7 @@ cris_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) CORE_ADDR func_addr, func_end; struct symtab_and_line sal; CORE_ADDR pc_after_prologue; - + /* If we have line debugging information, then the end of the prologue should the first assembly instruction of the first source line. */ if (find_pc_partial_function (pc, NULL, &func_addr, &func_end)) @@ -1390,7 +1390,7 @@ cris_spec_reg_applicable (struct gdbarch *gdbarch, { cris_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); unsigned int version = tdep->cris_version; - + switch (spec_reg.applicable_version) { case cris_ver_version_all: @@ -1432,7 +1432,7 @@ cris_register_size (struct gdbarch *gdbarch, int regno) { int i; int spec_regno; - + if (regno >= 0 && regno < NUM_GENREGS) { /* General registers (R0 - R15) are 32 bits. */ @@ -1440,13 +1440,13 @@ cris_register_size (struct gdbarch *gdbarch, int regno) } else if (regno >= NUM_GENREGS && regno < (NUM_GENREGS + NUM_SPECREGS)) { - /* Special register (R16 - R31). cris_spec_regs is zero-based. + /* Special register (R16 - R31). cris_spec_regs is zero-based. Adjust regno accordingly. */ spec_regno = regno - NUM_GENREGS; - + for (i = 0; cris_spec_regs[i].name != NULL; i++) { - if (cris_spec_regs[i].number == spec_regno + if (cris_spec_regs[i].number == spec_regno && cris_spec_reg_applicable (gdbarch, cris_spec_regs[i])) /* Go with the first applicable register. */ return cris_spec_regs[i].reg_size; @@ -1462,7 +1462,7 @@ cris_register_size (struct gdbarch *gdbarch, int regno) return 4; } - + return -1; } @@ -1476,7 +1476,7 @@ cris_cannot_fetch_register (struct gdbarch *gdbarch, int regno) || (cris_register_size (gdbarch, regno) == 0)); } -/* Nonzero if regno should not be written to the target, for various +/* Nonzero if regno should not be written to the target, for various reasons. */ static int @@ -1503,7 +1503,7 @@ cris_cannot_store_register (struct gdbarch *gdbarch, int regno) /* IBR, BAR, BRP and IRP are read-only in user mode. Let the debug agent decide whether they are writable. */ - + return 0; } @@ -1517,7 +1517,7 @@ crisv32_cannot_fetch_register (struct gdbarch *gdbarch, int regno) || (cris_register_size (gdbarch, regno) == 0)); } -/* Nonzero if regno should not be written to the target, for various +/* Nonzero if regno should not be written to the target, for various reasons. */ static int @@ -1544,7 +1544,7 @@ crisv32_cannot_store_register (struct gdbarch *gdbarch, int regno) /* Many special registers are read-only in user mode. Let the debug agent decide whether they are writable. */ - + return 0; } @@ -1599,7 +1599,7 @@ crisv32_register_type (struct gdbarch *gdbarch, int regno) } } -/* Stores a function return value of type type, where valbuf is the address +/* Stores a function return value of type type, where valbuf is the address of the value to be stored. */ /* In the CRIS ABI, R10 and R11 are used to store return values. */ @@ -1612,7 +1612,7 @@ cris_store_return_value (struct type *type, struct regcache *regcache, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST val; int len = type->length (); - + if (len <= 4) { /* Put the return value in R10. */ @@ -1640,15 +1640,15 @@ cris_special_register_name (struct gdbarch *gdbarch, int regno) int spec_regno; int i; - /* Special register (R16 - R31). cris_spec_regs is zero-based. + /* Special register (R16 - R31). cris_spec_regs is zero-based. Adjust regno accordingly. */ spec_regno = regno - NUM_GENREGS; - + /* Assume nothing about the layout of the cris_spec_regs struct when searching. */ for (i = 0; cris_spec_regs[i].name != NULL; i++) { - if (cris_spec_regs[i].number == spec_regno + if (cris_spec_regs[i].number == spec_regno && cris_spec_reg_applicable (gdbarch, cris_spec_regs[i])) /* Go with the first applicable register. */ return cris_spec_regs[i].name; @@ -1768,7 +1768,7 @@ cris_dwarf2_frame_init_reg (struct gdbarch *gdbarch, int regnum, } /* Extract from an array regbuf containing the raw register state a function - return value of type type, and copy that, in virtual format, into + return value of type type, and copy that, in virtual format, into valbuf. */ /* In the CRIS ABI, R10 and R11 are used to store return values. */ @@ -1781,7 +1781,7 @@ cris_extract_return_value (struct type *type, struct regcache *regcache, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); ULONGEST val; int len = type->length (); - + if (len <= 4) { /* Get the return value from R10. */ @@ -1822,7 +1822,7 @@ cris_return_value (struct gdbarch *gdbarch, struct value *function, return RETURN_VALUE_REGISTER_CONVENTION; } -/* Calculates a value that measures how good inst_args constraints an +/* Calculates a value that measures how good inst_args constraints an instruction. It stems from cris_constraint, found in cris-dis.c. */ static int @@ -1835,13 +1835,13 @@ constraint (unsigned int insn, const char *inst_args, const gdb_byte *s = (const gdb_byte *) inst_args; for (; *s; s++) - switch (*s) + switch (*s) { case 'm': if ((insn & 0x30) == 0x30) return -1; break; - + case 'S': /* A prefix operand. */ if (inst_env->prefix_found) @@ -1861,7 +1861,7 @@ constraint (unsigned int insn, const char *inst_args, retval = (((insn >> 0xC) & 0xF) == (insn & 0xF)); if (!retval) return -1; - else + else retval += 4; break; @@ -1889,7 +1889,7 @@ constraint (unsigned int insn, const char *inst_args, break; } } - + if (cris_spec_regs[i].name == NULL) return -1; break; @@ -1903,7 +1903,7 @@ static int number_of_bits (unsigned int value) { int number_of_bits = 0; - + while (value != 0) { number_of_bits += 1; @@ -1912,7 +1912,7 @@ number_of_bits (unsigned int value) return number_of_bits; } -/* Finds the address that should contain the single step breakpoint(s). +/* Finds the address that should contain the single step breakpoint(s). It stems from code in cris-dis.c. */ static int @@ -1925,7 +1925,7 @@ find_cris_op (unsigned short insn, inst_env_type *inst_env) for (i = 0; cris_opcodes[i].name != NULL; i++) { - if (((cris_opcodes[i].match & insn) == cris_opcodes[i].match) + if (((cris_opcodes[i].match & insn) == cris_opcodes[i].match) && ((cris_opcodes[i].lose & insn) == 0) /* Only CRISv10 instructions, please. */ && (cris_opcodes[i].applicable_version != cris_ver_v32p)) @@ -1966,13 +1966,13 @@ find_step_target (struct regcache *regcache, inst_env_type *inst_env) /* Create a local register image and set the initial state. */ for (i = 0; i < NUM_GENREGS; i++) { - inst_env->reg[i] = + inst_env->reg[i] = (unsigned long) regcache_raw_get_unsigned (regcache, i); } offset = NUM_GENREGS; for (i = 0; i < NUM_SPECREGS; i++) { - inst_env->preg[i] = + inst_env->preg[i] = (unsigned long) regcache_raw_get_unsigned (regcache, offset + i); } inst_env->branch_found = 0; @@ -1993,8 +1993,8 @@ find_step_target (struct regcache *regcache, inst_env_type *inst_env) /* If the instruction is not in a delay slot the new content of the PC is [PC] + 2. If the instruction is in a delay slot it is not - that simple. Since a instruction in a delay slot cannot change - the content of the PC, it does not matter what value PC will have. + that simple. Since a instruction in a delay slot cannot change + the content of the PC, it does not matter what value PC will have. Just make sure it is a valid instruction. */ if (!inst_env->delay_slot_pc_active) { @@ -2016,8 +2016,8 @@ find_step_target (struct regcache *regcache, inst_env_type *inst_env) { cris_gdb_func (gdbarch, cris_opcodes[i].op, insn, inst_env); } - } while (!inst_env->invalid - && (inst_env->prefix_found || inst_env->xflag_found + } while (!inst_env->invalid + && (inst_env->prefix_found || inst_env->xflag_found || inst_env->slot_needed)); return i; } @@ -2033,12 +2033,12 @@ cris_software_single_step (struct regcache *regcache) inst_env_type inst_env; std::vector next_pcs; - /* Analyse the present instruction environment and insert + /* Analyse the present instruction environment and insert breakpoints. */ int status = find_step_target (regcache, &inst_env); if (status == -1) { - /* Could not find a target. Things are likely to go downhill + /* Could not find a target. Things are likely to go downhill from here. */ warning (_("CRIS software single step could not find a step target.")); } @@ -2050,7 +2050,7 @@ cris_software_single_step (struct regcache *regcache) = (CORE_ADDR) inst_env.reg[gdbarch_pc_regnum (gdbarch)]; next_pcs.push_back (next_pc); - if (inst_env.branch_found + if (inst_env.branch_found && (CORE_ADDR) inst_env.branch_break_address != next_pc) { CORE_ADDR branch_target_address @@ -2073,9 +2073,9 @@ quick_mode_bdap_prefix (unsigned short inst, inst_env_type *inst_env) if (inst_env->slot_needed || inst_env->prefix_found) { inst_env->invalid = 1; - return; + return; } - + inst_env->prefix_value = inst_env->reg[cris_get_operand2 (inst)]; inst_env->prefix_value += cris_get_bdap_quick_offset (inst); @@ -2085,11 +2085,11 @@ quick_mode_bdap_prefix (unsigned short inst, inst_env_type *inst_env) inst_env->prefix_found = 1; } -/* Updates the autoincrement register. The size of the increment is derived +/* Updates the autoincrement register. The size of the increment is derived from the size of the operation. The PC is always kept aligned on even word addresses. */ -static void +static void process_autoincrement (int size, unsigned short inst, inst_env_type *inst_env) { if (size == INST_BYTE_SIZE) @@ -2124,7 +2124,7 @@ static unsigned long get_data_from_address (unsigned short *inst, CORE_ADDR address, enum bfd_endian byte_order); -/* Calculates the prefix value for the general case of offset addressing +/* Calculates the prefix value for the general case of offset addressing mode. */ static void @@ -2134,7 +2134,7 @@ bdap_prefix (unsigned short inst, inst_env_type *inst_env) if (inst_env->slot_needed || inst_env->prefix_found) { inst_env->invalid = 1; - return; + return; } /* The calculation of prefix_value used to be after process_autoincrement, @@ -2144,15 +2144,15 @@ bdap_prefix (unsigned short inst, inst_env_type *inst_env) inst_env->prefix_value = inst_env->reg[cris_get_operand2 (inst)]; /* The offset is an indirection of the contents of the operand1 register. */ - inst_env->prefix_value += + inst_env->prefix_value += get_data_from_address (&inst, inst_env->reg[cris_get_operand1 (inst)], inst_env->byte_order); - + if (cris_get_mode (inst) == AUTOINC_MODE) { - process_autoincrement (cris_get_size (inst), inst, inst_env); + process_autoincrement (cris_get_size (inst), inst, inst_env); } - + /* A prefix doesn't change the xflag_found. But the rest of the flags need updating. */ inst_env->slot_needed = 0; @@ -2171,15 +2171,15 @@ biap_prefix (unsigned short inst, inst_env_type *inst_env) inst_env->invalid = 1; return; } - + inst_env->prefix_value = inst_env->reg[cris_get_operand1 (inst)]; - /* The offset is the operand2 value shifted the size of the instruction + /* The offset is the operand2 value shifted the size of the instruction to the left. */ - inst_env->prefix_value += + inst_env->prefix_value += inst_env->reg[cris_get_operand2 (inst)] << cris_get_size (inst); - - /* If the PC is operand1 (base) the address used is the address after + + /* If the PC is operand1 (base) the address used is the address after the main instruction, i.e. address + 2 (the PC is already compensated for the prefix operation). */ if (cris_get_operand1 (inst) == REG_PC) @@ -2196,7 +2196,7 @@ biap_prefix (unsigned short inst, inst_env_type *inst_env) /* Calculates the prefix value for the double indirect addressing mode. */ -static void +static void dip_prefix (unsigned short inst, inst_env_type *inst_env) { @@ -2208,13 +2208,13 @@ dip_prefix (unsigned short inst, inst_env_type *inst_env) inst_env->invalid = 1; return; } - + /* The prefix value is one dereference of the contents of the operand1 register. */ address = (CORE_ADDR) inst_env->reg[cris_get_operand1 (inst)]; inst_env->prefix_value = read_memory_unsigned_integer (address, 4, inst_env->byte_order); - + /* Check if the mode is autoincrement. */ if (cris_get_mode (inst) == AUTOINC_MODE) { @@ -2242,7 +2242,7 @@ eight_bit_offset_branch_op (unsigned short inst, inst_env_type *inst_env) inst_env->invalid = 1; return; } - + /* We have a branch, find out where the branch will land. */ offset = cris_get_branch_short_offset (inst); @@ -2251,11 +2251,11 @@ eight_bit_offset_branch_op (unsigned short inst, inst_env_type *inst_env) { offset |= 0xFF00; } - + /* The offset ends with the sign bit, set it to zero. The address should always be word aligned. */ offset &= ~BRANCH_SIGNED_SHORT_OFFSET_MASK; - + inst_env->branch_found = 1; inst_env->branch_break_address = inst_env->reg[REG_PC] + offset; @@ -2267,7 +2267,7 @@ eight_bit_offset_branch_op (unsigned short inst, inst_env_type *inst_env) /* Finds the destination for a branch with 16-bits offset. */ -static void +static void sixteen_bit_offset_branch_op (unsigned short inst, inst_env_type *inst_env) { short offset; @@ -2299,12 +2299,12 @@ sixteen_bit_offset_branch_op (unsigned short inst, inst_env_type *inst_env) /* Handles the ABS instruction. */ -static void +static void abs_op (unsigned short inst, inst_env_type *inst_env) { long value; - + /* ABS can't have a prefix, so it's bad if it does. */ if (inst_env->prefix_found) { @@ -2315,7 +2315,7 @@ abs_op (unsigned short inst, inst_env_type *inst_env) /* Check if the operation affects the PC. */ if (cris_get_operand2 (inst) == REG_PC) { - + /* It's invalid to change to the PC if we are in a delay slot. */ if (inst_env->slot_needed) { @@ -2341,7 +2341,7 @@ abs_op (unsigned short inst, inst_env_type *inst_env) /* Handles the ADDI instruction. */ -static void +static void addi_op (unsigned short inst, inst_env_type *inst_env) { /* It's invalid to have the PC as base register. And ADDI can't have @@ -2360,7 +2360,7 @@ addi_op (unsigned short inst, inst_env_type *inst_env) /* Handles the ASR instruction. */ -static void +static void asr_op (unsigned short inst, inst_env_type *inst_env) { int shift_steps; @@ -2438,14 +2438,14 @@ asr_op (unsigned short inst, inst_env_type *inst_env) /* Handles the ASRQ instruction. */ -static void +static void asrq_op (unsigned short inst, inst_env_type *inst_env) { int shift_steps; unsigned long value; unsigned long signed_extend_mask = 0; - + /* ASRQ can't have a prefix, so check that it doesn't. */ if (inst_env->prefix_found) { @@ -2485,7 +2485,7 @@ asrq_op (unsigned short inst, inst_env_type *inst_env) /* Handles the AX, EI and SETF instruction. */ -static void +static void ax_ei_setf_op (unsigned short inst, inst_env_type *inst_env) { if (inst_env->prefix_found) @@ -2507,11 +2507,11 @@ ax_ei_setf_op (unsigned short inst, inst_env_type *inst_env) inst_env->disable_interrupt = 1; } -/* Checks if the instruction is in assign mode. If so, it updates the assign +/* Checks if the instruction is in assign mode. If so, it updates the assign register. Note that check_assign assumes that the caller has checked that there is a prefix to this instruction. The mode check depends on this. */ -static void +static void check_assign (unsigned short inst, inst_env_type *inst_env) { /* Check if it's an assign addressing mode. */ @@ -2524,7 +2524,7 @@ check_assign (unsigned short inst, inst_env_type *inst_env) /* Handles the 2-operand BOUND instruction. */ -static void +static void two_operand_bound_op (unsigned short inst, inst_env_type *inst_env) { /* It's invalid to have the PC as the index operand. */ @@ -2557,7 +2557,7 @@ two_operand_bound_op (unsigned short inst, inst_env_type *inst_env) /* Handles the 3-operand BOUND instruction. */ -static void +static void three_operand_bound_op (unsigned short inst, inst_env_type *inst_env) { /* It's an error if we haven't got a prefix. And it's also an error @@ -2575,7 +2575,7 @@ three_operand_bound_op (unsigned short inst, inst_env_type *inst_env) /* Clears the status flags in inst_env. */ -static void +static void btst_nop_op (unsigned short inst, inst_env_type *inst_env) { /* It's an error if we have got a prefix. */ @@ -2593,7 +2593,7 @@ btst_nop_op (unsigned short inst, inst_env_type *inst_env) /* Clears the status flags in inst_env. */ -static void +static void clearf_di_op (unsigned short inst, inst_env_type *inst_env) { /* It's an error if we have got a prefix. */ @@ -2611,7 +2611,7 @@ clearf_di_op (unsigned short inst, inst_env_type *inst_env) /* Handles the CLEAR instruction if it's in register mode. */ -static void +static void reg_mode_clear_op (unsigned short inst, inst_env_type *inst_env) { /* Check if the target is the PC. */ @@ -2631,7 +2631,7 @@ reg_mode_clear_op (unsigned short inst, inst_env_type *inst_env) { inst_env->delay_slot_pc = 0x0; } - /* The jump will be delayed with one delay slot. So we need a delay + /* The jump will be delayed with one delay slot. So we need a delay slot. */ inst_env->slot_needed = 1; inst_env->delay_slot_pc_active = 1; @@ -2664,10 +2664,10 @@ reg_mode_test_op (unsigned short inst, inst_env_type *inst_env) } -/* Handles the CLEAR and TEST instruction if the instruction isn't +/* Handles the CLEAR and TEST instruction if the instruction isn't in register mode. */ -static void +static void none_reg_mode_clear_test_op (unsigned short inst, inst_env_type *inst_env) { /* Check if we are in a prefix mode. */ @@ -2692,7 +2692,7 @@ none_reg_mode_clear_test_op (unsigned short inst, inst_env_type *inst_env) /* Checks that the PC isn't the destination register or the instructions has a prefix. */ -static void +static void dstep_logshift_mstep_neg_not_op (unsigned short inst, inst_env_type *inst_env) { /* It's invalid to have the PC as the destination. The instruction can't @@ -2749,17 +2749,17 @@ scc_op (unsigned short inst, inst_env_type *inst_env) /* Handles the register mode JUMP instruction. */ -static void +static void reg_mode_jump_op (unsigned short inst, inst_env_type *inst_env) { - /* It's invalid to do a JUMP in a delay slot. The mode is register, so + /* It's invalid to do a JUMP in a delay slot. The mode is register, so you can't have a prefix. */ if ((inst_env->slot_needed) || (inst_env->prefix_found)) { inst_env->invalid = 1; return; } - + /* Just change the PC. */ inst_env->reg[REG_PC] = inst_env->reg[cris_get_operand1 (inst)]; inst_env->slot_needed = 0; @@ -2789,7 +2789,7 @@ none_reg_mode_jump_op (unsigned short inst, inst_env_type *inst_env) check_assign (inst, inst_env); /* Get the new value for the PC. */ - newpc = + newpc = read_memory_unsigned_integer ((CORE_ADDR) inst_env->prefix_value, 4, inst_env->byte_order); } @@ -2816,7 +2816,7 @@ none_reg_mode_jump_op (unsigned short inst, inst_env_type *inst_env) /* Handles moves to special registers (aka P-register) for all modes. */ -static void +static void move_to_preg_op (struct gdbarch *gdbarch, unsigned short inst, inst_env_type *inst_env) { @@ -2840,7 +2840,7 @@ move_to_preg_op (struct gdbarch *gdbarch, unsigned short inst, are interested in is the autoincrement mode. */ if (cris_get_operand1 (inst) == REG_PC) { - /* If the PC is to be incremented it's invalid to be in a + /* If the PC is to be incremented it's invalid to be in a delay slot. */ if (inst_env->slot_needed) { @@ -2872,7 +2872,7 @@ move_to_preg_op (struct gdbarch *gdbarch, unsigned short inst, /* Handles moves from special registers (aka P-register) for all modes except register. */ -static void +static void none_reg_mode_move_from_preg_op (struct gdbarch *gdbarch, unsigned short inst, inst_env_type *inst_env) { @@ -2889,21 +2889,21 @@ none_reg_mode_move_from_preg_op (struct gdbarch *gdbarch, unsigned short inst, check_assign (inst, inst_env); } } - } + } /* The instruction doesn't have a prefix, the only case left that we are interested in is the autoincrement mode. */ else if (cris_get_mode (inst) == AUTOINC_MODE) { if (cris_get_operand1 (inst) == REG_PC) { - /* If the PC is to be incremented it's invalid to be in a + /* If the PC is to be incremented it's invalid to be in a delay slot. */ if (inst_env->slot_needed) { inst_env->invalid = 1; return; } - + /* The increment depends on the size of the special register. */ if (cris_register_size (gdbarch, cris_get_operand2 (inst)) == 1) { @@ -2928,7 +2928,7 @@ none_reg_mode_move_from_preg_op (struct gdbarch *gdbarch, unsigned short inst, /* Handles moves from special registers (aka P-register) when the mode is register. */ -static void +static void reg_mode_move_from_preg_op (unsigned short inst, inst_env_type *inst_env) { /* Register mode move from special register can't have a prefix. */ @@ -2963,7 +2963,7 @@ reg_mode_move_from_preg_op (unsigned short inst, inst_env_type *inst_env) /* Handles the MOVEM from memory to general register instruction. */ -static void +static void move_mem_to_reg_movem_op (unsigned short inst, inst_env_type *inst_env) { if (inst_env->prefix_found) @@ -2972,13 +2972,13 @@ move_mem_to_reg_movem_op (unsigned short inst, inst_env_type *inst_env) MOVEM instruction going to change the PC? */ if (cris_get_operand2 (inst) >= REG_PC) { - inst_env->reg[REG_PC] = + inst_env->reg[REG_PC] = read_memory_unsigned_integer (inst_env->prefix_value, 4, inst_env->byte_order); } - /* The assign value is the value after the increment. Normally, the + /* The assign value is the value after the increment. Normally, the assign value is the value before the increment. */ - if ((cris_get_operand1 (inst) == REG_PC) + if ((cris_get_operand1 (inst) == REG_PC) && (cris_get_mode (inst) == PREFIX_ASSIGN_MODE)) { inst_env->reg[REG_PC] = inst_env->prefix_value; @@ -2997,7 +2997,7 @@ move_mem_to_reg_movem_op (unsigned short inst, inst_env_type *inst_env) return; } inst_env->reg[REG_PC] = - read_memory_unsigned_integer (inst_env->reg[cris_get_operand1 (inst)], + read_memory_unsigned_integer (inst_env->reg[cris_get_operand1 (inst)], 4, inst_env->byte_order); } /* The increment is not depending on the size, instead it's depending @@ -3011,7 +3011,7 @@ move_mem_to_reg_movem_op (unsigned short inst, inst_env_type *inst_env) inst_env->invalid = 1; return; } - inst_env->reg[REG_PC] += 4 * (cris_get_operand2 (inst) + 1); + inst_env->reg[REG_PC] += 4 * (cris_get_operand2 (inst) + 1); } } inst_env->slot_needed = 0; @@ -3022,7 +3022,7 @@ move_mem_to_reg_movem_op (unsigned short inst, inst_env_type *inst_env) /* Handles the MOVEM to memory from general register instruction. */ -static void +static void move_reg_to_mem_movem_op (unsigned short inst, inst_env_type *inst_env) { if (inst_env->prefix_found) @@ -3062,7 +3062,7 @@ move_reg_to_mem_movem_op (unsigned short inst, inst_env_type *inst_env) /* Handles the instructions that's not yet implemented, by setting inst_env->invalid to true. */ -static void +static void not_implemented_op (unsigned short inst, inst_env_type *inst_env) { inst_env->invalid = 1; @@ -3070,7 +3070,7 @@ not_implemented_op (unsigned short inst, inst_env_type *inst_env) /* Handles the XOR instruction. */ -static void +static void xor_op (unsigned short inst, inst_env_type *inst_env) { /* XOR can't have a prefix. */ @@ -3099,7 +3099,7 @@ xor_op (unsigned short inst, inst_env_type *inst_env) /* Handles the MULS instruction. */ -static void +static void muls_op (unsigned short inst, inst_env_type *inst_env) { /* MULS/U can't have a prefix. */ @@ -3123,7 +3123,7 @@ muls_op (unsigned short inst, inst_env_type *inst_env) /* Handles the MULU instruction. */ -static void +static void mulu_op (unsigned short inst, inst_env_type *inst_env) { /* MULS/U can't have a prefix. */ @@ -3148,17 +3148,17 @@ mulu_op (unsigned short inst, inst_env_type *inst_env) /* Calculate the result of the instruction for ADD, SUB, CMP AND, OR and MOVE. The MOVE instruction is the move from source to register. */ -static void -add_sub_cmp_and_or_move_action (unsigned short inst, inst_env_type *inst_env, +static void +add_sub_cmp_and_or_move_action (unsigned short inst, inst_env_type *inst_env, unsigned long source1, unsigned long source2) { unsigned long pc_mask; unsigned long operation_mask; - + /* Find out how many bits the operation should apply to. */ if (cris_get_size (inst) == INST_BYTE_SIZE) { - pc_mask = 0xFFFFFF00; + pc_mask = 0xFFFFFF00; operation_mask = 0xFF; } else if (cris_get_size (inst) == INST_WORD_SIZE) @@ -3230,10 +3230,10 @@ add_sub_cmp_and_or_move_action (unsigned short inst, inst_env_type *inst_env, is zero extend then the value is extended with zero. If instead the mode is signed extend the sign bit of the value is taken into consideration. */ -static unsigned long +static unsigned long do_sign_or_zero_extend (unsigned long value, unsigned short *inst) { - /* The size can be either byte or word, check which one it is. + /* The size can be either byte or word, check which one it is. Don't check the highest bit, it's indicating if it's a zero or sign extend. */ if (cris_get_size (*inst) & INST_WORD_SIZE) @@ -3246,7 +3246,7 @@ do_sign_or_zero_extend (unsigned long value, unsigned short *inst) if (cris_is_signed_extend_bit_on (*inst) && (value & SIGNED_WORD_MASK)) { value |= SIGNED_WORD_EXTEND_MASK; - } + } } else { @@ -3268,14 +3268,14 @@ do_sign_or_zero_extend (unsigned long value, unsigned short *inst) /* Handles the register mode for the ADD, SUB, CMP, AND, OR and MOVE instruction. The MOVE instruction is the move from source to register. */ -static void +static void reg_mode_add_sub_cmp_and_or_move_op (unsigned short inst, inst_env_type *inst_env) { unsigned long operand1; unsigned long operand2; - /* It's invalid to have a prefix to the instruction. This is a register + /* It's invalid to have a prefix to the instruction. This is a register mode instruction and can't have a prefix. */ if (inst_env->prefix_found) { @@ -3291,7 +3291,7 @@ reg_mode_add_sub_cmp_and_or_move_op (unsigned short inst, return; } /* The instruction has the PC as its target register. */ - operand1 = inst_env->reg[cris_get_operand1 (inst)]; + operand1 = inst_env->reg[cris_get_operand1 (inst)]; operand2 = inst_env->reg[REG_PC]; /* Check if it's a extend, signed or zero instruction. */ @@ -3301,7 +3301,7 @@ reg_mode_add_sub_cmp_and_or_move_op (unsigned short inst, } /* Calculate the PC value after the instruction, i.e. where the breakpoint should be. The order of the udw_operands is vital. */ - add_sub_cmp_and_or_move_action (inst, inst_env, operand2, operand1); + add_sub_cmp_and_or_move_action (inst, inst_env, operand2, operand1); } inst_env->slot_needed = 0; inst_env->prefix_found = 0; @@ -3313,7 +3313,7 @@ reg_mode_add_sub_cmp_and_or_move_op (unsigned short inst, the size of the operation. If the instruction is a zero or signed extend instruction, the size field is changed in instruction. */ -static unsigned long +static unsigned long get_data_from_address (unsigned short *inst, CORE_ADDR address, enum bfd_endian byte_order) { @@ -3342,8 +3342,8 @@ get_data_from_address (unsigned short *inst, CORE_ADDR address, /* Handles the assign addressing mode for the ADD, SUB, CMP, AND, OR and MOVE instructions. The MOVE instruction is the move from source to register. */ -static void -handle_prefix_assign_mode_for_aritm_op (unsigned short inst, +static void +handle_prefix_assign_mode_for_aritm_op (unsigned short inst, inst_env_type *inst_env) { unsigned long operand2; @@ -3372,8 +3372,8 @@ handle_prefix_assign_mode_for_aritm_op (unsigned short inst, OR instructions. Note that for this to work as expected, the calling function must have made sure that there is a prefix to this instruction. */ -static void -three_operand_add_sub_cmp_and_or_op (unsigned short inst, +static void +three_operand_add_sub_cmp_and_or_op (unsigned short inst, inst_env_type *inst_env) { unsigned long operand2; @@ -3401,8 +3401,8 @@ three_operand_add_sub_cmp_and_or_op (unsigned short inst, /* Handles the index addressing mode for the ADD, SUB, CMP, AND, OR and MOVE instructions. The MOVE instruction is the move from source to register. */ -static void -handle_prefix_index_mode_for_aritm_op (unsigned short inst, +static void +handle_prefix_index_mode_for_aritm_op (unsigned short inst, inst_env_type *inst_env) { if (cris_get_operand1 (inst) != cris_get_operand2 (inst)) @@ -3429,8 +3429,8 @@ handle_prefix_index_mode_for_aritm_op (unsigned short inst, CMP, AND OR and MOVE instruction. The MOVE instruction is the move from source to register. */ -static void -handle_inc_and_index_mode_for_aritm_op (unsigned short inst, +static void +handle_inc_and_index_mode_for_aritm_op (unsigned short inst, inst_env_type *inst_env) { unsigned long operand1; @@ -3442,7 +3442,7 @@ handle_inc_and_index_mode_for_aritm_op (unsigned short inst, Check if the destination register is the PC. */ if (cris_get_operand2 (inst) == REG_PC) { - /* Must be done here, get_data_from_address may change the size + /* Must be done here, get_data_from_address may change the size field. */ size = cris_get_size (inst); operand2 = inst_env->reg[REG_PC]; @@ -3453,7 +3453,7 @@ handle_inc_and_index_mode_for_aritm_op (unsigned short inst, /* Calculate the PC value after the instruction, i.e. where the breakpoint should be. The order of the udw_operands is vital. */ - add_sub_cmp_and_or_move_action (inst, inst_env, operand2, operand3); + add_sub_cmp_and_or_move_action (inst, inst_env, operand2, operand3); } /* If this is an autoincrement addressing mode, check if the increment changes the PC. */ @@ -3470,7 +3470,7 @@ handle_inc_and_index_mode_for_aritm_op (unsigned short inst, size &= ~SIGNED_EXTEND_BIT_MASK; } process_autoincrement (size, inst, inst_env); - } + } inst_env->slot_needed = 0; inst_env->prefix_found = 0; inst_env->xflag_found = 0; @@ -3480,8 +3480,8 @@ handle_inc_and_index_mode_for_aritm_op (unsigned short inst, /* Handles the two-operand addressing mode, all modes except register, for the ADD, SUB CMP, AND and OR instruction. */ -static void -none_reg_mode_add_sub_cmp_and_or_move_op (unsigned short inst, +static void +none_reg_mode_add_sub_cmp_and_or_move_op (unsigned short inst, inst_env_type *inst_env) { if (inst_env->prefix_found) @@ -3509,7 +3509,7 @@ none_reg_mode_add_sub_cmp_and_or_move_op (unsigned short inst, /* Handles the quick addressing mode for the ADD and SUB instruction. */ -static void +static void quick_mode_add_sub_op (unsigned short inst, inst_env_type *inst_env) { unsigned long operand1; @@ -3549,7 +3549,7 @@ quick_mode_add_sub_op (unsigned short inst, inst_env_type *inst_env) /* Handles the quick addressing mode for the CMP, AND and OR instruction. */ -static void +static void quick_mode_and_cmp_move_or_op (unsigned short inst, inst_env_type *inst_env) { unsigned long operand1; @@ -3763,7 +3763,7 @@ typedef cris_elf_greg_t crisv32_elf_gregset_t[CRISV32_ELF_NGREG]; /* Unpack a cris_elf_gregset_t into GDB's register cache. */ -static void +static void cris_supply_gregset (const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len) { @@ -3819,7 +3819,7 @@ static void cris_iterate_over_regset_sections (struct gdbarch *gdbarch, INIT_GDB_FILE (cris_tdep) { gdbarch_register (bfd_arch_cris, cris_gdbarch_init, cris_dump_tdep); - + /* CRIS-specific user-commands. */ add_setshow_zuinteger_cmd ("cris-version", class_support, &usr_cmd_cris_version, @@ -3833,8 +3833,8 @@ Defaults to 10."), is %s. */ &setlist, &showlist); - add_setshow_enum_cmd ("cris-mode", class_support, - cris_modes, &usr_cmd_cris_mode, + add_setshow_enum_cmd ("cris-mode", class_support, + cris_modes, &usr_cmd_cris_mode, _("Set the current CRIS mode."), _("Show the current CRIS mode."), _("\ @@ -3843,7 +3843,7 @@ Makes GDB use the NRP register instead of the ERP register in certain cases."), set_cris_mode, NULL, /* FIXME: i18n: Current CRIS version is %s. */ &setlist, &showlist); - + add_setshow_boolean_cmd ("cris-dwarf2-cfi", class_support, &usr_cmd_cris_dwarf2_cfi, _("Set the usage of Dwarf-2 CFI for CRIS."), @@ -3873,20 +3873,20 @@ cris_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file) } static void -set_cris_version (const char *ignore_args, int from_tty, +set_cris_version (const char *ignore_args, int from_tty, struct cmd_list_element *c) { struct gdbarch_info info; usr_cmd_cris_version_valid = 1; - + /* Update the current architecture, if needed. */ if (!gdbarch_update_p (current_inferior (), info)) internal_error (_("cris_gdbarch_update: failed to update architecture.")); } static void -set_cris_mode (const char *ignore_args, int from_tty, +set_cris_mode (const char *ignore_args, int from_tty, struct cmd_list_element *c) { struct gdbarch_info info; @@ -3897,7 +3897,7 @@ set_cris_mode (const char *ignore_args, int from_tty, } static void -set_cris_dwarf2_cfi (const char *ignore_args, int from_tty, +set_cris_dwarf2_cfi (const char *ignore_args, int from_tty, struct cmd_list_element *c) { struct gdbarch_info info; @@ -3914,7 +3914,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (usr_cmd_cris_version_valid) { - /* Trust the user's CRIS version setting. */ + /* Trust the user's CRIS version setting. */ cris_version = usr_cmd_cris_version; } else if (info.abfd && bfd_get_mach (info.abfd) == bfd_mach_cris_v32) @@ -3929,9 +3929,9 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Make the current settings visible to the user. */ usr_cmd_cris_version = cris_version; - + /* Find a candidate among the list of pre-declared architectures. */ - for (arches = gdbarch_list_lookup_by_info (arches, &info); + for (arches = gdbarch_list_lookup_by_info (arches, &info); arches != NULL; arches = gdbarch_list_lookup_by_info (arches->next, &info)) { @@ -3956,7 +3956,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_return_value (gdbarch, cris_return_value); set_gdbarch_sp_regnum (gdbarch, 14); - + /* Length of ordinary registers used in push_word and a few other places. register_size() is the real way to know how big a register is. */ @@ -3982,8 +3982,8 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) return 0; case 10: - case 11: - /* CRIS v10 and v11, a.k.a. ETRAX 100LX. In addition to ETRAX 100, + case 11: + /* CRIS v10 and v11, a.k.a. ETRAX 100LX. In addition to ETRAX 100, P7 (32 bits), and P15 (32 bits) have been implemented. */ set_gdbarch_pc_regnum (gdbarch, 15); set_gdbarch_register_type (gdbarch, cris_register_type); @@ -3997,7 +3997,7 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) break; case 32: - /* CRIS v32. General registers R0 - R15 (32 bits), special registers + /* CRIS v32. General registers R0 - R15 (32 bits), special registers P0 - P15 (32 bits) except P0, P1, P3 (8 bits) and P4 (16 bits) and pseudo-register PC (32 bits). */ set_gdbarch_pc_regnum (gdbarch, 32); @@ -4006,14 +4006,14 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_num_regs (gdbarch, 32 + 1 + 16); set_gdbarch_register_name (gdbarch, crisv32_register_name); - set_gdbarch_cannot_store_register + set_gdbarch_cannot_store_register (gdbarch, crisv32_cannot_store_register); set_gdbarch_cannot_fetch_register (gdbarch, crisv32_cannot_fetch_register); set_gdbarch_have_nonsteppable_watchpoint (gdbarch, 1); - set_gdbarch_single_step_through_delay + set_gdbarch_single_step_through_delay (gdbarch, crisv32_single_step_through_delay); break; @@ -4029,14 +4029,14 @@ cris_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_dummy_call (gdbarch, cris_push_dummy_call); set_gdbarch_frame_align (gdbarch, cris_frame_align); set_gdbarch_skip_prologue (gdbarch, cris_skip_prologue); - + /* The stack grows downward. */ set_gdbarch_inner_than (gdbarch, core_addr_lessthan); set_gdbarch_breakpoint_kind_from_pc (gdbarch, cris_breakpoint_kind_from_pc); set_gdbarch_sw_breakpoint_from_kind (gdbarch, cris_sw_breakpoint_from_kind); set_gdbarch_iterate_over_regset_sections (gdbarch, cris_iterate_over_regset_sections); - + if (tdep->cris_dwarf2_cfi == 1) { /* Hook in the Dwarf-2 frame sniffer. */ diff --git a/gdb/darwin-nat-info.c b/gdb/darwin-nat-info.c index 3ec49af1d95..38ace30aca9 100644 --- a/gdb/darwin-nat-info.c +++ b/gdb/darwin-nat-info.c @@ -246,7 +246,7 @@ info_mach_ports_command (const char *args, int from_tty) gdb_printf (_("%u"), ref); gdb_printf (_(" refs)")); } - + if (task == task_self ()) { if (port == task_self()) @@ -700,7 +700,7 @@ info_mach_regions_command (const char *args, int from_tty) task = get_task_from_args (args); if (task == TASK_NULL) return; - + darwin_debug_regions (task, 0, -1); } @@ -712,7 +712,7 @@ info_mach_regions_recurse_command (const char *args, int from_tty) task = get_task_from_args (args); if (task == TASK_NULL) return; - + darwin_debug_regions_recurse (task); } @@ -828,7 +828,7 @@ info_mach_exceptions_command (const char *args, int from_tty) if (inferior_ptid == null_ptid) gdb_printf (_("No inferior running\n")); inf = current_inferior (); - + darwin_inferior *priv = get_darwin_inferior (inf); kret = task_get_exception_ports diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 260f5838494..86d2cef925e 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -17,7 +17,7 @@ along with this program. If not, see . */ /* This module provides three functions: dbx_symfile_init, - which initializes to read a symbol file; dbx_new_init, which + which initializes to read a symbol file; dbx_new_init, which discards existing cached information when all symbols are being discarded; and dbx_symfile_read, which reads a symbol table from a file. @@ -73,7 +73,7 @@ explicit_lookup_type (int real_filenum, int index) #endif /* Scan and build partial symbols for a symbol file. - We have been initialized by a call to dbx_symfile_init, which + We have been initialized by a call to dbx_symfile_init, which put all the relevant info into a "struct dbx_symfile_info", hung off the objfile structure. */ diff --git a/gdb/dcache.c b/gdb/dcache.c index 7a152787cfe..2614d38770f 100644 --- a/gdb/dcache.c +++ b/gdb/dcache.c @@ -391,7 +391,7 @@ dcache_alloc (DCACHE *dcache, CORE_ADDR addr) } /* Using the data cache DCACHE, store in *PTR the contents of the byte at - address ADDR in the remote machine. + address ADDR in the remote machine. Returns 1 for success, 0 for error. */ @@ -571,7 +571,7 @@ dcache_print_line (DCACHE *dcache, int index) gdb_printf (_("No such cache line exists.\n")); return; } - + db = (struct dcache_block *) n->value; gdb_printf (_("Line %d: address %s [%d hits]\n"), diff --git a/gdb/defs.h b/gdb/defs.h index 147a8d2822f..8bf9d3dcbda 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -74,7 +74,7 @@ /* The O_BINARY flag is defined in fcntl.h on some non-Posix platforms. It is used as an access modifier in calls to open(), where it acts similarly to the "b" character in fopen()'s MODE argument. On Posix - platforms it should be a no-op, so it is defined as 0 here. This + platforms it should be a no-op, so it is defined as 0 here. This ensures that the symbol may be used freely elsewhere in gdb. */ #ifndef O_BINARY @@ -343,9 +343,9 @@ extern void (*deprecated_post_add_symbol_hook) (void); extern void (*selected_frame_level_changed_hook) (int); extern int (*deprecated_ui_loop_hook) (int signo); extern void (*deprecated_show_load_progress) (const char *section, - unsigned long section_sent, - unsigned long section_size, - unsigned long total_sent, + unsigned long section_sent, + unsigned long section_size, + unsigned long total_sent, unsigned long total_size); extern void (*deprecated_print_frame_info_listing_hook) (struct symtab * s, int line, diff --git a/gdb/dictionary.c b/gdb/dictionary.c index e53331bed45..f435ad5a47e 100644 --- a/gdb/dictionary.c +++ b/gdb/dictionary.c @@ -1,5 +1,5 @@ /* Routines for name->symbol lookups in GDB. - + Copyright (C) 2003-2025 Free Software Foundation, Inc. Contributed by David Carlton and by Kealia, @@ -43,7 +43,7 @@ is: * Add a new element DICT_ to dict_type. - + * Create a new structure dictionary_. If your new implementation is a variant of an existing one, make sure that their structs have the same initial data members. Define accessor @@ -500,7 +500,7 @@ dict_size (const struct dictionary *dict) { return (DICT_VECTOR (dict))->size (dict); } - + /* Now come functions (well, one function, currently) that are implemented generically by means of the vtable. Typically, they're rarely used. */ @@ -539,7 +539,7 @@ iterator_next_hashed (struct dict_iterator *iterator) struct symbol *next; next = DICT_ITERATOR_CURRENT (iterator)->hash_next; - + if (next == NULL) return iterator_hashed_advance (iterator); else @@ -559,7 +559,7 @@ iterator_hashed_advance (struct dict_iterator *iterator) for (i = DICT_ITERATOR_INDEX (iterator) + 1; i < nbuckets; ++i) { struct symbol *sym = DICT_HASHED_BUCKET (dict, i); - + if (sym != NULL) { DICT_ITERATOR_INDEX (iterator) = i; @@ -588,7 +588,7 @@ iter_match_first_hashed (const struct dictionary *dict, /* Loop through the symbols in the given bucket, breaking when SYM first matches. If SYM never matches, it will be set to NULL; either way, we have the right return value. */ - + for (sym = DICT_HASHED_BUCKET (dict, hash_index); sym != NULL; sym = sym->hash_next) @@ -706,7 +706,7 @@ expand_hashtable (struct dictionary *dict) struct symbol *sym, *next_sym; sym = old_buckets[i]; - if (sym != NULL) + if (sym != NULL) { for (next_sym = sym->hash_next; next_sym != NULL; @@ -733,7 +733,7 @@ language_defn::search_name_hash (const char *string0) const are lower-cased identifiers). The (which can be empty) encodes additional information about the denoted entity. This routine hashes such names to msymbol_hash_iw(Pn). It actually - does this for a superset of both valid Pi and of , but + does this for a superset of both valid Pi and of , but in other cases it simply returns msymbol_hash_iw(STRING0). */ const char *string; @@ -859,7 +859,7 @@ iter_match_next_linear (const lookup_name_info &name, } DICT_ITERATOR_INDEX (iterator) = i; - + return retval; } diff --git a/gdb/dictionary.h b/gdb/dictionary.h index 530cd99acb2..34306832ed9 100644 --- a/gdb/dictionary.h +++ b/gdb/dictionary.h @@ -1,5 +1,5 @@ /* Routines for name->symbol lookups in GDB. - + Copyright (C) 2003-2025 Free Software Foundation, Inc. Contributed by David Carlton and by Kealia, @@ -151,7 +151,7 @@ extern struct symbol * /* Advance MITERATOR to point at the next symbol in MDICT whose search_name () is NAME, as tested using COMPARE (see dict_iter_match_first), or NULL if there are no more such symbols. - Don't call this if you've previously received NULL from + Don't call this if you've previously received NULL from mdict_iterator_match_first or mdict_iterator_match_next on this iteration. And don't call it unless MITERATOR was created by a previous call to mdict_iter_match_first with the same NAME and COMPARE. */ diff --git a/gdb/doc/Makefile.in b/gdb/doc/Makefile.in index b9c79b95e8a..a2953b4d34a 100644 --- a/gdb/doc/Makefile.in +++ b/gdb/doc/Makefile.in @@ -82,7 +82,7 @@ PACKAGE = @PACKAGE@ PKGVERSION = @PKGVERSION@ BUGURL_TEXI = @REPORT_BUGS_TEXI@ -# Where is the source dir for the READLINE library doc? +# Where is the source dir for the READLINE library doc? # Traditionally readline is in .. or . READLINE_DIR = ${gdbdir}/../readline/readline/doc READLINE_TEXI_INCFLAG = @READLINE_TEXI_INCFLAG@ @@ -236,10 +236,10 @@ doxy/gdbserver/index.html: Doxyfile-gdbserver Doxyfile-base -mkdir -p doxy $(DOXYGEN) Doxyfile-gdbserver -Doxyfile-base: $(srcdir)/Doxyfile-base.in +Doxyfile-base: $(srcdir)/Doxyfile-base.in $(doxyedit) $(srcdir)/Doxyfile-base.in >Doxyfile-base -Doxyfile-gdb-api: $(srcdir)/Doxyfile-gdb-api.in +Doxyfile-gdb-api: $(srcdir)/Doxyfile-gdb-api.in $(doxyedit) $(srcdir)/Doxyfile-gdb-api.in >Doxyfile-gdb-api Doxyfile-gdb-xref: $(srcdir)/Doxyfile-gdb-xref.in @@ -517,7 +517,7 @@ gdb.info: ${GDB_DOC_FILES} # GDB MANUAL: roff translations # Try to use a recent texi2roff. v2 was put on prep in jan91. -# If you want an index, see texi2roff doc for postprocessing +# If you want an index, see texi2roff doc for postprocessing # and add -i to texi2roff invocations below. # Workarounds for texi2roff-2 (probably fixed in later texi2roff's, delete # corresponding -e lines when later texi2roff's are current) @@ -526,7 +526,7 @@ gdb.info: ${GDB_DOC_FILES} # + @ (that's at-BLANK) not recognized by texi2roff, turned into blank # + @alphaenumerate is ridiculously new, turned into @enumerate -# texi2roff doesn't have a notion of include dirs, so we have to fake +# texi2roff doesn't have a notion of include dirs, so we have to fake # it out for gdb manual's include files---but only if not configured # in main sourcedir. links2roff: $(GDB_DOC_SOURCE_INCLUDES) @@ -550,7 +550,7 @@ gdb.me: $(GDB_DOC_FILES) links2roff $(srcdir)/gdb.texinfo | \ $(TEXI2ROFF) -me | \ sed -e 's/---/\\(em/g' \ - >gdb.me + >gdb.me # gdb manual suitable for [gtn]roff -ms gdb.ms: $(GDB_DOC_FILES) links2roff @@ -565,10 +565,10 @@ gdb.ms: $(GDB_DOC_FILES) links2roff $(srcdir)/gdb.texinfo | \ $(TEXI2ROFF) -ms | \ sed -e 's/---/\\(em/g' \ - >gdb.ms + >gdb.ms # gdb manual suitable for [tn]roff -mm -# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, +# '@noindent's removed due to texi2roff-2 mm bug; if yours is newer, # try leaving them in gdb.mm: $(GDB_DOC_FILES) links2roff $(ECHO_GEN) sed -e '/\\input texinfo/d' \ @@ -583,7 +583,7 @@ gdb.mm: $(GDB_DOC_FILES) links2roff $(srcdir)/gdb.texinfo | \ $(TEXI2ROFF) -mm | \ sed -e 's/---/\\(em/g' \ - >gdb.mm + >gdb.mm # GDB MANUAL: HTML file @@ -685,7 +685,7 @@ clean: mostlyclean distclean: clean rm -f Makefile -# GDBvn.texi, the dvi files, the info files, and the postscript files, +# GDBvn.texi, the dvi files, the info files, and the postscript files, # are all part of the distribution, so it should not be removed by # "clean" or "distclean". Use maintainer-clean to remove them. diff --git a/gdb/doc/agentexpr.texi b/gdb/doc/agentexpr.texi index 970f930740c..d83435a0d34 100644 --- a/gdb/doc/agentexpr.texi +++ b/gdb/doc/agentexpr.texi @@ -118,7 +118,7 @@ operations. There are no instructions to perform side effects on the running program, or call the program's functions; we assume that these expressions are only used for unobtrusive debugging, not for patching -the running code. +the running code. Most bytecode instructions do not distinguish between the various sizes of values, and operate on full-width values; the upper bits of the diff --git a/gdb/doc/all-cfg.texi b/gdb/doc/all-cfg.texi index 5d2af66ae8d..c44cabc32d0 100644 --- a/gdb/doc/all-cfg.texi +++ b/gdb/doc/all-cfg.texi @@ -1,4 +1,4 @@ -@c GDB MANUAL configuration file. +@c GDB MANUAL configuration file. @c @c Copyright (C) 1993--2025 Free Software Foundation, Inc. @c @@ -10,8 +10,8 @@ @c @c The only automatically-varying variable is the GDB version number, @c which the Makefile rewrites based on the VERSION variable from -@c `../Makefile.in'. -@c +@c `../Makefile.in'. +@c @c GDB version number is recorded in the variable GDBVN @include GDBvn.texi @c @@ -30,7 +30,7 @@ @c @c Name of GDB program. Used also for (gdb) prompt string. @set GDBP gdb -@c +@c @c Name of GDB product. Used in running text. @set GDBN @sc{gdb} @c @@ -40,6 +40,6 @@ @c @c Name of GCC product @set NGCC @sc{gcc} -@c +@c @c Name of GCC program @set GCC gcc diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c index c6635714ec2..3f1a8e742c9 100644 --- a/gdb/dtrace-probe.c +++ b/gdb/dtrace-probe.c @@ -241,21 +241,21 @@ struct dtrace_dof_hdr /* Identification bytes (see above). */ uint8_t dofh_ident[16]; /* File attribute flags (if any). */ - uint32_t dofh_flags; + uint32_t dofh_flags; /* Size of file header in bytes. */ - uint32_t dofh_hdrsize; + uint32_t dofh_hdrsize; /* Size of section header in bytes. */ - uint32_t dofh_secsize; + uint32_t dofh_secsize; /* Number of section headers. */ - uint32_t dofh_secnum; + uint32_t dofh_secnum; /* File offset of section headers. */ - uint64_t dofh_secoff; + uint64_t dofh_secoff; /* File size of loadable portion. */ - uint64_t dofh_loadsz; + uint64_t dofh_loadsz; /* File size of entire DOF file. */ - uint64_t dofh_filesz; + uint64_t dofh_filesz; /* Reserved for future use. */ - uint64_t dofh_pad; + uint64_t dofh_pad; }; /* A DOF section, whose contents depend on its type. The several @@ -267,15 +267,15 @@ struct dtrace_dof_sect /* Section type (see the define above). */ uint32_t dofs_type; /* Section data memory alignment. */ - uint32_t dofs_align; + uint32_t dofs_align; /* Section flags (if any). */ - uint32_t dofs_flags; + uint32_t dofs_flags; /* Size of section entry (if table). */ uint32_t dofs_entsize; /* DOF + offset points to the section data. */ uint64_t dofs_offset; /* Size of section data in bytes. */ - uint64_t dofs_size; + uint64_t dofs_size; }; /* A DOF provider, which is the provider of a probe. */ @@ -283,19 +283,19 @@ struct dtrace_dof_sect struct dtrace_dof_provider { /* Link to a DTRACE_DOF_SECT_TYPE_STRTAB section. */ - uint32_t dofpv_strtab; + uint32_t dofpv_strtab; /* Link to a DTRACE_DOF_SECT_TYPE_PROBES section. */ - uint32_t dofpv_probes; + uint32_t dofpv_probes; /* Link to a DTRACE_DOF_SECT_TYPE_PRARGS section. */ - uint32_t dofpv_prargs; + uint32_t dofpv_prargs; /* Link to a DTRACE_DOF_SECT_TYPE_PROFFS section. */ - uint32_t dofpv_proffs; + uint32_t dofpv_proffs; /* Provider name string. */ - uint32_t dofpv_name; + uint32_t dofpv_name; /* Provider attributes. */ uint32_t dofpv_provattr; /* Module attributes. */ - uint32_t dofpv_modattr; + uint32_t dofpv_modattr; /* Function attributes. */ uint32_t dofpv_funcattr; /* Name attributes. */ @@ -315,33 +315,33 @@ struct dtrace_dof_provider struct dtrace_dof_probe { /* Probe base address or offset. */ - uint64_t dofpr_addr; + uint64_t dofpr_addr; /* Probe function string. */ - uint32_t dofpr_func; + uint32_t dofpr_func; /* Probe name string. */ - uint32_t dofpr_name; + uint32_t dofpr_name; /* Native argument type strings. */ - uint32_t dofpr_nargv; + uint32_t dofpr_nargv; /* Translated argument type strings. */ - uint32_t dofpr_xargv; + uint32_t dofpr_xargv; /* Index of first argument mapping. */ - uint32_t dofpr_argidx; + uint32_t dofpr_argidx; /* Index of first offset entry. */ - uint32_t dofpr_offidx; + uint32_t dofpr_offidx; /* Native argument count. */ - uint8_t dofpr_nargc; + uint8_t dofpr_nargc; /* Translated argument count. */ - uint8_t dofpr_xargc; + uint8_t dofpr_xargc; /* Number of offset entries for probe. */ - uint16_t dofpr_noffs; + uint16_t dofpr_noffs; /* Index of first is-enabled offset. */ uint32_t dofpr_enoffidx; /* Number of is-enabled offsets. */ uint16_t dofpr_nenoffs; /* Reserved for future use. */ - uint16_t dofpr_pad1; + uint16_t dofpr_pad1; /* Reserved for future use. */ - uint32_t dofpr_pad2; + uint32_t dofpr_pad2; }; /* DOF supports two different encodings: MSB (big-endian) and LSB @@ -605,7 +605,7 @@ dtrace_process_dof (asection *sect, struct objfile *objfile, } return; - + invalid_dof_data: complaint (_("skipping section '%s' which does not contain valid DOF data."), sect->name); diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c index 445a7b4d9e2..37ee60cb0e0 100644 --- a/gdb/dummy-frame.c +++ b/gdb/dummy-frame.c @@ -297,7 +297,7 @@ dummy_frame_sniffer (const struct frame_unwind *self, entry point, or some random address on the stack. Trying to use that PC to apply standard frame ID unwind techniques is just asking for trouble. */ - + /* Don't bother unless there is at least one dummy frame. */ if (dummy_frame_stack != NULL) { diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c index fbcfe8ff3b6..111dadbdbc9 100644 --- a/gdb/dwarf2/cooked-index.c +++ b/gdb/dwarf2/cooked-index.c @@ -1,4 +1,4 @@ -/* DIE indexing +/* DIE indexing Copyright (C) 2022-2025 Free Software Foundation, Inc. diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h index 90a18af971e..8d11430dd8d 100644 --- a/gdb/dwarf2/cooked-index.h +++ b/gdb/dwarf2/cooked-index.h @@ -1,4 +1,4 @@ -/* DIE indexing +/* DIE indexing Copyright (C) 2022-2025 Free Software Foundation, Inc. @@ -74,7 +74,7 @@ . v / | \ . wait (MAIN_AVAILABLE) finalization . | \ | / - . v \ | / + . v \ | / . done state = FINALIZED . | . v diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c index aa2fd9d6652..2125577bec2 100644 --- a/gdb/dwarf2/expr.c +++ b/gdb/dwarf2/expr.c @@ -1932,7 +1932,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr, result_val = fetch (offset); in_stack_memory = fetch_in_stack_memory (offset); break; - + case DW_OP_swap: { if (this->m_stack.size () < 2) @@ -2300,7 +2300,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr, result_val = value_cast (address_type, result_val); } break; - + case DW_OP_entry_value: case DW_OP_GNU_entry_value: { diff --git a/gdb/dwarf2/frame-tailcall.c b/gdb/dwarf2/frame-tailcall.c index e31ae102d5f..e65f7c2bbf2 100644 --- a/gdb/dwarf2/frame-tailcall.c +++ b/gdb/dwarf2/frame-tailcall.c @@ -352,7 +352,7 @@ tailcall_frame_sniffer (const struct frame_unwind *self, chain to create. Keep TAILCALL_CACHEP NULL if it did not find any chain, initialize it otherwise. No tail call chain is created if there are no unambiguous virtual tail call frames to report. - + ENTRY_CFA_SP_OFFSETP is NULL if no special SP handling is possible, otherwise *ENTRY_CFA_SP_OFFSETP is the number of bytes to subtract from tail call frames frame base to get the SP value there - to simulate return diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c index 525b581cf39..1570fd8d714 100644 --- a/gdb/dwarf2/frame.c +++ b/gdb/dwarf2/frame.c @@ -1162,7 +1162,7 @@ dwarf2_frame_prev_register (const frame_info_ptr &this_frame, void **this_cache, if (cache->tailcall_cache) { struct value *val; - + val = dwarf2_tailcall_prev_register_first (this_frame, &cache->tailcall_cache, regnum); @@ -1447,7 +1447,7 @@ static const registry::key dwarf2_frame_objfile_data; way. Several "pointer encodings" are supported. The encoding that's used for a particular FDE is determined by the 'R' augmentation in the associated CIE. The argument of this - augmentation is a single byte. + augmentation is a single byte. The address can be encoded as 2 bytes, 4 bytes, 8 bytes, or as a LEB128. This is encoded in bits 0, 1 and 2. Bit 3 encodes whether @@ -2034,7 +2034,7 @@ decode_frame_entry (struct gdbarch *gdbarch, This becomes a problem when you have some other producer that creates frame sections that are not as strictly aligned. That - produces a hole in the frame info that gets filled by the + produces a hole in the frame info that gets filled by the linker with zeros. The GCC behavior is arguably a bug, but it's effectively now diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index cb4a39e65ad..86e8a2f4638 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -673,7 +673,7 @@ call_site_target::iterate_over_addresses (gdbarch *call_site_gdbarch, paddress (call_site_gdbarch, call_site->pc ()), (msym.minsym == NULL ? "???" : msym.minsym->print_name ())); - + } if (caller_frame == NULL) { @@ -686,7 +686,7 @@ call_site_target::iterate_over_addresses (gdbarch *call_site_gdbarch, paddress (call_site_gdbarch, call_site->pc ()), (msym.minsym == NULL ? "???" : msym.minsym->print_name ())); - + } caller_arch = get_frame_arch (caller_frame); caller_core_addr_type = builtin_type (caller_arch)->builtin_func_ptr; @@ -720,7 +720,7 @@ call_site_target::iterate_over_addresses (gdbarch *call_site_gdbarch, physname, paddress (call_site_gdbarch, call_site->pc ()), (msym.minsym == NULL ? "???" : msym.minsym->print_name ())); - + } CORE_ADDR addr = (gdbarch_convert_from_func_ptr_addr @@ -1237,7 +1237,7 @@ dwarf_expr_reg_to_entry_parameter (const frame_info_ptr &initial_frame, throw_error (NO_ENTRY_VALUE_ERROR, _("Cannot find matching parameter " "at DW_TAG_call_site %s at %s"), paddress (gdbarch, caller_pc), - msym == NULL ? "???" : msym->print_name ()); + msym == NULL ? "???" : msym->print_name ()); } *per_cu_return = call_site->per_cu; @@ -2385,14 +2385,14 @@ access_memory (struct gdbarch *arch, struct agent_expr *expr, ULONGEST nbits) } /* Compile a DWARF location expression to an agent expression. - + EXPR is the agent expression we are building. LOC is the agent value we modify. ARCH is the architecture. ADDR_SIZE is the size of addresses, in bytes. OP_PTR is the start of the location expression. OP_END is one past the last byte of the location expression. - + This will throw an exception for various kinds of errors -- for example, if the expression cannot be compiled, or if the expression is invalid. */ @@ -3217,7 +3217,7 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream, if (base_data[0] >= DW_OP_breg0 && base_data[0] <= DW_OP_breg31) { const gdb_byte *buf_end; - + frame_reg = base_data[0] - DW_OP_breg0; buf_end = safe_read_sleb128 (base_data + 1, base_data + base_size, &base_offset); @@ -3283,7 +3283,7 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream, offset = extract_unsigned_integer (data + 1, addr_size, gdbarch_byte_order (gdbarch)); - gdb_printf (stream, + gdb_printf (stream, _("a thread-local variable at offset 0x%s " "in the thread-local storage for `%s'"), phex_nz (offset, addr_size), objfile_name (objfile)); @@ -3310,7 +3310,7 @@ locexpr_describe_location_piece (struct symbol *symbol, struct ui_file *stream, data = safe_read_uleb128 (data + 1, end, &offset); offset = (uint64_t) dwarf2_read_addr_index (per_cu, per_objfile, offset); - gdb_printf (stream, + gdb_printf (stream, _("a thread-local variable at offset 0x%s " "in the thread-local storage for `%s'"), phex_nz (offset, addr_size), objfile_name (objfile)); @@ -3791,7 +3791,7 @@ locexpr_describe_location_1 (struct symbol *symbol, CORE_ADDR addr, if (data < end) { int empty = data == here; - + if (disassemble) gdb_printf (stream, " "); if (data[0] == DW_OP_piece) diff --git a/gdb/dwarf2/parent-map.h b/gdb/dwarf2/parent-map.h index 51fe7dd3521..95e2c5688e7 100644 --- a/gdb/dwarf2/parent-map.h +++ b/gdb/dwarf2/parent-map.h @@ -1,4 +1,4 @@ -/* DIE indexing +/* DIE indexing Copyright (C) 2024-2025 Free Software Foundation, Inc. diff --git a/gdb/dwarf2/read-debug-names.c b/gdb/dwarf2/read-debug-names.c index ddf49356722..848d9f9e145 100644 --- a/gdb/dwarf2/read-debug-names.c +++ b/gdb/dwarf2/read-debug-names.c @@ -321,7 +321,7 @@ mapped_debug_names_reader::scan_entries (uint32_t index, const gdb_byte *entry) { std::vector these_entries; - + while (true) { std::optional parent; diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index b35d33b5762..431b7c9ea2c 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -3947,7 +3947,7 @@ cutu_reader::skip_one_attribute (dwarf_form form, const gdb_byte *info_ptr) INFO_PTR should point just after the initial uleb128 of a DIE, and the abbrev corresponding to that skipped uleb128 should be passed in ABBREV. - + If DO_SKIP_CHILDREN is true, or if the DIE has no children, this returns a pointer to this DIE's sibling, skipping any children. Otherwise, returns a pointer to the DIE's first child. */ @@ -8802,7 +8802,7 @@ read_call_site_scope (struct die_info *die, struct dwarf2_cu *cu) struct call_site, sizeof (*call_site) + sizeof (call_site->parameter[0]) * nparams)) struct call_site (pc, cu->per_cu, per_objfile); - + if (!cu->call_site_htab.emplace (call_site).second) { complaint (_("Duplicate PC %s for DW_TAG_call_site " diff --git a/gdb/exec.c b/gdb/exec.c index a904f5c53ad..a415abc13f4 100644 --- a/gdb/exec.c +++ b/gdb/exec.c @@ -1,4 +1,4 @@ -/* Work with executable files, for GDB. +/* Work with executable files, for GDB. Copyright (C) 1988-2025 Free Software Foundation, Inc. @@ -533,7 +533,7 @@ Use the \"file\" or \"exec-file\" command.")); Note that we have to explicitly ignore additional args, since we can be called from file_command(), which also calls symbol_file_command() which can take multiple args. - + If ARGS is NULL, we just want to close the exec file. */ static void @@ -963,8 +963,8 @@ print_section_info (const std::vector *t, bfd *abfd) styled_string (file_name_style.style (), bfd_get_filename (abfd))); - entry_point = gdbarch_addr_bits_remove (gdbarch, - bfd_get_start_address (abfd) + entry_point = gdbarch_addr_bits_remove (gdbarch, + bfd_get_start_address (abfd) + displacement); gdb_printf (_("\tEntry point: %s\n"), paddress (gdbarch, entry_point)); diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index 935bf026c8e..d05c036f73d 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -74,11 +74,11 @@ f77_get_dynamic_length_of_aggregate (struct type *type) /* Recursively go all the way down into a possibly multi-dimensional F77 array and get the bounds. For simple arrays, this is pretty - easy but when the bounds are dynamic, we must be very careful - to add up all the lengths correctly. Not doing this right + easy but when the bounds are dynamic, we must be very careful + to add up all the lengths correctly. Not doing this right will lead to horrendous-looking arrays in parameter lists. - This function also works for strings which behave very + This function also works for strings which behave very similarly to arrays. */ if (type->target_type ()->code () == TYPE_CODE_ARRAY @@ -577,7 +577,7 @@ f_language::value_print_inner (struct value *val, struct ui_file *stream, } } gdb_printf (stream, " )"); - break; + break; case TYPE_CODE_BOOL: if (options->format || options->output_format) @@ -646,7 +646,7 @@ info_common_command_for_block (const struct block *block, const char *comname, sym->print_name ()); else gdb_printf (_("Contents of blank COMMON block:\n")); - + for (index = 0; index < common->n_entries; index++) { struct value *val = NULL; @@ -672,8 +672,8 @@ info_common_command_for_block (const struct block *block, const char *comname, } } -/* This function is used to print out the values in a given COMMON - block. It will always use the most local common block of the +/* This function is used to print out the values in a given COMMON + block. It will always use the most local common block of the given name. */ static void @@ -683,14 +683,14 @@ info_common_command (const char *comname, int from_tty) const struct block *block; int values_printed = 0; - /* We have been told to display the contents of F77 COMMON - block supposedly visible in this function. Let us - first make sure that it is visible and if so, let + /* We have been told to display the contents of F77 COMMON + block supposedly visible in this function. Let us + first make sure that it is visible and if so, let us display its contents. */ fi = get_selected_frame (_("No frame selected")); - /* The following is generally ripped off from stack.c's routine + /* The following is generally ripped off from stack.c's routine print_frame_info(). */ block = get_frame_block (fi, 0); diff --git a/gdb/frv-linux-tdep.c b/gdb/frv-linux-tdep.c index 2a0fe1ba362..cf690009d32 100644 --- a/gdb/frv-linux-tdep.c +++ b/gdb/frv-linux-tdep.c @@ -202,7 +202,7 @@ frv_linux_sigcontext_reg_addr (const frame_info_ptr &this_frame, int regno, /* For a realtime sigtramp frame, SP + 12 contains a pointer to a ucontext struct. The ucontext struct contains a sigcontext struct starting 24 bytes in. (The offset of - uc_mcontext within struct ucontext is derived as follows: + uc_mcontext within struct ucontext is derived as follows: stack_t is a 12-byte struct and struct sigcontext is 8-byte aligned. This gives an offset of 8 + 12 + 4 (for padding) = 24.) */ @@ -245,7 +245,7 @@ frv_linux_sigcontext_reg_addr (const frame_info_ptr &this_frame, int regno, return sc_addr + 48; case iacc0l_regnum : return sc_addr + 52; - default : + default : if (first_gpr_regnum <= regno && regno <= last_gpr_regnum) return sc_addr + 56 + 4 * (regno - first_gpr_regnum); else if (first_fpr_regnum <= regno && regno <= last_fpr_regnum) @@ -409,7 +409,7 @@ static const struct regcache_map_entry frv_linux_fpregmap[] = /* Unpack an frv_elf_gregset_t into GDB's register cache. */ -static void +static void frv_linux_supply_gregset (const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len) @@ -460,7 +460,7 @@ frv_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) linux_init_abi (info, gdbarch, 0); /* Set the sigtramp frame sniffer. */ - frame_unwind_append_unwinder (gdbarch, &frv_linux_sigtramp_frame_unwind); + frame_unwind_append_unwinder (gdbarch, &frv_linux_sigtramp_frame_unwind); set_gdbarch_iterate_over_regset_sections (gdbarch, frv_linux_iterate_over_regset_sections); diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c index 9bd719cd2ff..e8de8440fb4 100644 --- a/gdb/frv-tdep.c +++ b/gdb/frv-tdep.c @@ -152,7 +152,7 @@ new_variant () /* By default, don't supply any general-purpose or floating-point register names. */ - var->register_names + var->register_names = (const char **) xmalloc ((frv_num_regs + frv_num_pseudo_regs) * sizeof (const char *)); for (r = 0; r < frv_num_regs + frv_num_pseudo_regs; r++) @@ -164,7 +164,7 @@ new_variant () var->register_names[pc_regnum] = "pc"; var->register_names[lr_regnum] = "lr"; var->register_names[lcr_regnum] = "lcr"; - + var->register_names[psr_regnum] = "psr"; var->register_names[ccr_regnum] = "ccr"; var->register_names[cccr_regnum] = "cccr"; @@ -794,7 +794,7 @@ frv_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, sthi GRk, @(fp, s) P KKKKKK 1010001 000010 SSSSSSSSSSSS = 0x01442000 0 000000 1111111 111111 000000000000 = 0x01fff000 - . . . . . . . . + . . . . . . . . And for 8-bit values, we use STB instructions. stbi GRk, @(fp, s) P KKKKKK 1010000 000010 SSSSSSSSSSSS = 0x01402000 @@ -1022,7 +1022,7 @@ frv_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) /* In PIC code, GR15 may be loaded from some offset off of FP prior to the call instruction. - + Skip over this instruction if present. It won't be present in non-PIC code, and even in PIC code, it might not be present. (This is due to the fact that GR15, the FDPIC register, already diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c index 860c9837032..441364a7e17 100644 --- a/gdb/ft32-tdep.c +++ b/gdb/ft32-tdep.c @@ -180,9 +180,9 @@ ft32_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr, is the address of __prolog_$rN. __prolog_$rN pushes registers from 13 through n inclusive. So for example CALL __prolog_$r15 is equivalent to: - PUSH $r13 - PUSH $r14 - PUSH $r15 + PUSH $r13 + PUSH $r14 + PUSH $r15 Note that PROLOGS[0] through PROLOGS[12] are unused. */ CORE_ADDR prologs[32]; diff --git a/gdb/gcore.c b/gdb/gcore.c index e015f448a10..59c2afdbe15 100644 --- a/gdb/gcore.c +++ b/gdb/gcore.c @@ -286,7 +286,7 @@ call_target_sbrk (int sbrk_arg) return (bfd_vma) 0; gdbarch = sbrk_objf->arch (); - target_sbrk_arg = value_from_longest (builtin_type (gdbarch)->builtin_int, + target_sbrk_arg = value_from_longest (builtin_type (gdbarch)->builtin_int, sbrk_arg); gdb_assert (target_sbrk_arg); ret = call_function_by_hand (sbrk_fn, NULL, target_sbrk_arg); diff --git a/gdb/gdb-demangle.c b/gdb/gdb-demangle.c index c285788b333..2f2548aac4e 100644 --- a/gdb/gdb-demangle.c +++ b/gdb/gdb-demangle.c @@ -115,7 +115,7 @@ set_demangling_command (const char *ignore, If we match, update the current demangling style enum. */ for (dem = libiberty_demanglers, i = 0; - dem->demangling_style != unknown_demangling; + dem->demangling_style != unknown_demangling; dem++) { if (strcmp (current_demangling_style_string, @@ -215,12 +215,12 @@ INIT_GDB_FILE (gdb_demangle) /* Fill the demangling_style_names[] array, and set the default demangling style chosen at compilation time. */ for (ndems = 0; - libiberty_demanglers[ndems].demangling_style != unknown_demangling; + libiberty_demanglers[ndems].demangling_style != unknown_demangling; ndems++) ; demangling_style_names = XCNEWVEC (const char *, ndems + 1); for (i = 0; - libiberty_demanglers[i].demangling_style != unknown_demangling; + libiberty_demanglers[i].demangling_style != unknown_demangling; i++) { demangling_style_names[i] diff --git a/gdb/gdb.c b/gdb/gdb.c index 6e4358c2320..efa6ca22338 100644 --- a/gdb/gdb.c +++ b/gdb/gdb.c @@ -1,4 +1,4 @@ -/* Main function for CLI gdb. +/* Main function for CLI gdb. Copyright (C) 2002-2025 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/gdb_buildall.sh b/gdb/gdb_buildall.sh index 20533339547..672c1756351 100644 --- a/gdb/gdb_buildall.sh +++ b/gdb/gdb_buildall.sh @@ -131,7 +131,7 @@ fi # Did the previous configure attempt fail? If it did restart from scratch if test -d ${dir} -a ! -r ${dir}/Makefile then - echo ... removing partially configured + echo ... removing partially configured rm -rf ${dir} if test -d ${dir} then @@ -209,7 +209,7 @@ mv arch gdb_archs if test "${targexp}" != "" then alltarg=`cat gdb_archs | grep ${targexp}` -else +else alltarg=`cat gdb_archs` fi rm -f gdb_archs @@ -237,7 +237,7 @@ EOF else echo " OK" fi - + # Create a sed script that cleans up the output from GDB. rm -f mbuild.sed # Rules to replace <0xNNNN> with the corresponding function's name. diff --git a/gdb/gdb_mbuild.sh b/gdb/gdb_mbuild.sh index 686af4c8884..c40ad243baf 100755 --- a/gdb/gdb_mbuild.sh +++ b/gdb/gdb_mbuild.sh @@ -266,7 +266,7 @@ do trap "exit 1" 1 2 15 fi fail "configure failed" ! -r Makefile - + # Build, if not built. if test ! -x gdb/gdb -a ! -x gdb/gdb.exe @@ -280,7 +280,7 @@ do ) 2>&1 | log 1 Build.log fi fail "compile failed" ! -x gdb/gdb -a ! -x gdb/gdb.exe - + # Check that the built GDB can at least print it's architecture. echo ... run ${target} diff --git a/gdb/gdb_wchar.h b/gdb/gdb_wchar.h index 9db0d5e043a..89e46a22a04 100644 --- a/gdb/gdb_wchar.h +++ b/gdb/gdb_wchar.h @@ -20,7 +20,7 @@ #define GDB_GDB_WCHAR_H /* We handle three different modes here. - + Capable systems have the full suite: wchar_t support and iconv (perhaps via GNU libiconv). On these machines, full functionality is available. Note that full functionality is dependent on us @@ -28,12 +28,12 @@ practice this means we look for __STDC_ISO_10646__ (where we know the name of the wchar_t encoding) or GNU libiconv, where we can use "wchar_t". - + DJGPP is known to have libiconv but not wchar_t support. On systems like this, we use the narrow character functions. The full functionality is available to the user, but many characters (those outside the narrow range) will be displayed as escapes. - + Finally, some systems do not have iconv, or are really broken (e.g., Solaris, which almost has all of this working, but where just enough is broken to make it too hard to use). Here we provide diff --git a/gdb/gdbthread.h b/gdb/gdbthread.h index 26bd9f2b7e7..28bac23cf74 100644 --- a/gdb/gdbthread.h +++ b/gdb/gdbthread.h @@ -1,7 +1,7 @@ /* Multi-process/thread control defs for GDB, the GNU debugger. Copyright (C) 1987-2025 Free Software Foundation, Inc. Contributed by Lynx Real-Time Systems, Inc. Los Gatos, CA. - + This file is part of GDB. @@ -263,7 +263,7 @@ public: void set_running (bool running); ptid_t ptid; /* "Actual process id"; - In fact, this may be overloaded with + In fact, this may be overloaded with kernel thread id, etc. */ /* Each thread has two GDB IDs. @@ -627,7 +627,7 @@ extern void init_thread_list (void); /* Add a thread to the thread list, print a message that a new thread is found, and return the pointer to - the new thread. Caller my use this pointer to + the new thread. Caller my use this pointer to initialize the private thread data. */ extern struct thread_info *add_thread (process_stratum_target *targ, ptid_t ptid); diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c index 715db74ab0e..6c366829eb8 100644 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -148,7 +148,7 @@ static bool strict_type_checking = true; static void show_opaque_type_resolution (struct ui_file *file, int from_tty, - struct cmd_list_element *c, + struct cmd_list_element *c, const char *value) { gdb_printf (file, _("Resolution of opaque struct/class/union types " @@ -162,7 +162,7 @@ static void show_overload_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) { - gdb_printf (file, _("Debugging of C++ overloading is %s.\n"), + gdb_printf (file, _("Debugging of C++ overloading is %s.\n"), value); } @@ -377,7 +377,7 @@ make_pointer_type (struct type *type, struct type **typeptr) if (ntype) { if (typeptr == 0) - return ntype; /* Don't care about alloc, + return ntype; /* Don't care about alloc, and have new type. */ else if (*typeptr == 0) { @@ -455,7 +455,7 @@ make_reference_type (struct type *type, struct type **typeptr, if (ntype) { if (typeptr == 0) - return ntype; /* Don't care about alloc, + return ntype; /* Don't care about alloc, and have new type. */ else if (*typeptr == 0) { @@ -750,8 +750,8 @@ make_type_with_address_space (struct type *type, new type we construct. */ struct type * -make_cv_type (int cnst, int voltl, - struct type *type, +make_cv_type (int cnst, int voltl, + struct type *type, struct type **typeptr) { struct type *ntype; /* New type */ @@ -782,8 +782,8 @@ make_cv_type (int cnst, int voltl, name each time you encounter them. */ gdb_assert ((*typeptr)->objfile_owner () == type->objfile_owner ()); } - - ntype = make_qualified_type (type, new_flags, + + ntype = make_qualified_type (type, new_flags, typeptr ? *typeptr : NULL); if (typeptr != NULL) @@ -1745,7 +1745,7 @@ lookup_union (const char *name, const struct block *block) return t; /* If we get here, it's not a union. */ - error (_("This context has class, struct or enum %s, not a union."), + error (_("This context has class, struct or enum %s, not a union."), name); } @@ -1764,7 +1764,7 @@ lookup_enum (const char *name, const struct block *block) } if (sym->type ()->code () != TYPE_CODE_ENUM) { - error (_("This context has class, struct or union %s, not an enum."), + error (_("This context has class, struct or union %s, not an enum."), name); } return (sym->type ()); @@ -1774,7 +1774,7 @@ lookup_enum (const char *name, const struct block *block) visible in lexical block BLOCK. */ struct type * -lookup_template_type (const char *name, struct type *type, +lookup_template_type (const char *name, struct type *type, const struct block *block) { std::string nam; @@ -2657,7 +2657,7 @@ compute_variant_fields_inner (struct type *type, for (const auto &variant : part.variants) compute_variant_fields_recurse (type, addr_stack, variant, flags, applied_variant == &variant); -} +} /* Determine which variant fields are available in TYPE. The enabled fields are stored in RESOLVED_TYPE. ADDR_STACK holds information @@ -3180,8 +3180,8 @@ check_typedef (struct type *type) types, instead of identifying them as stub types in the first place. */ - if (TYPE_IS_OPAQUE (type) - && opaque_type_resolution + if (TYPE_IS_OPAQUE (type) + && opaque_type_resolution && !currently_reading_symtab) { const char *name = type->name (); @@ -3326,7 +3326,7 @@ check_stub_method (struct type *type, int method_id, int signature_id) p = NULL; if (demangled_name == NULL || p == NULL) - error (_("Internal: Cannot demangle mangled name `%s'."), + error (_("Internal: Cannot demangle mangled name `%s'."), mangled_name); /* Now, read in the parameters that define this type. */ @@ -4311,7 +4311,7 @@ types_equal (struct type *a, struct type *b) if (a->num_fields () != b->num_fields ()) return false; - + if (!types_equal (a->target_type (), b->target_type ())) return false; @@ -5236,7 +5236,7 @@ recursive_dump_type (struct type *type, int spaces) struct type **first_dont_print = (struct type **) obstack_base (&dont_print_type_obstack); - int i = (struct type **) + int i = (struct type **) obstack_next_free (&dont_print_type_obstack) - first_dont_print; while (--i >= 0) @@ -5281,7 +5281,7 @@ recursive_dump_type (struct type *type, int spaces) host_address_to_string (TYPE_REFERENCE_TYPE (type))); gdb_printf ("%*stype_chain %s\n", spaces, "", host_address_to_string (TYPE_CHAIN (type))); - gdb_printf ("%*sinstance_flags 0x%x", spaces, "", + gdb_printf ("%*sinstance_flags 0x%x", spaces, "", (unsigned) type->instance_flags ()); if (TYPE_CONST (type)) { diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h index 0d514d036e3..5abca515ac5 100644 --- a/gdb/gdbtypes.h +++ b/gdb/gdbtypes.h @@ -995,7 +995,7 @@ struct main_type because we can allocate the space for a type before we know what to put in it. */ - union + union { struct field *fields; @@ -1027,7 +1027,7 @@ struct main_type struct type { - /* Get the type code of this type. + /* Get the type code of this type. Note that the code can be TYPE_CODE_TYPEDEF, so if you want the real type, you need to do `check_typedef (type)->code ()`. */ @@ -1633,7 +1633,7 @@ struct fn_field const char *physname; /* * The function type for the method. - + (This comment used to say "The return value of the method", but that's wrong. The function type is expected here, i.e. something with TYPE_CODE_METHOD, and *not* the return-value type). */ @@ -2199,7 +2199,7 @@ extern const struct builtin_type *builtin_type (struct gdbarch *gdbarch); /* * Return the type table for the specified objfile. */ extern const struct builtin_type *builtin_type (struct objfile *objfile); - + /* Explicit floating-point formats. See "floatformat.h". */ extern const struct floatformat *floatformats_ieee_half[BFD_ENDIAN_UNKNOWN]; extern const struct floatformat *floatformats_ieee_single[BFD_ENDIAN_UNKNOWN]; diff --git a/gdb/glibc-tdep.c b/gdb/glibc-tdep.c index 12ad3cc2505..9ba3d1f0812 100644 --- a/gdb/glibc-tdep.c +++ b/gdb/glibc-tdep.c @@ -29,7 +29,7 @@ /* See the comments for SKIP_SOLIB_RESOLVER at the top of infrun.c. This function: 1) decides whether a PLT has sent us into the linker to resolve - a function reference, and + a function reference, and 2) if so, tells us where to set a temporary breakpoint that will trigger when the dynamic linker is done. */ @@ -45,7 +45,7 @@ glibc_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) the same objfile. If we are at the entry point of `fixup', then we set a breakpoint at the return address (at the top of the stack), and continue. - + It's kind of gross to do all these checks every time we're called, since they don't change once the executable has gotten started. But this is only a temporary hack --- upcoming versions @@ -72,4 +72,4 @@ glibc_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc) } return 0; -} +} diff --git a/gdb/gmp-utils.h b/gdb/gmp-utils.h index b9d14246d11..c2c90ad1189 100644 --- a/gdb/gmp-utils.h +++ b/gdb/gmp-utils.h @@ -70,7 +70,7 @@ struct gdb_mpz mpz_swap (m_val, from.m_val); } - + gdb_mpz &operator= (const gdb_mpz &from) { mpz_set (m_val, from.m_val); diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index 41cbebfc96e..5db5dd80134 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -584,7 +584,7 @@ gnu_nat_target::make_proc (struct inf *inf, mach_port_t port, int tid) return proc; } -/* Frees PROC and any resources it uses, and returns the value of PROC's +/* Frees PROC and any resources it uses, and returns the value of PROC's next field. */ struct proc * gnu_nat_target::_proc_free (struct proc *proc) @@ -858,7 +858,7 @@ gnu_nat_target::inf_set_traced (struct inf *inf, int on) { if (on == inf->traced) return; - + if (inf->task && !inf->task->dead) /* Make it take effect immediately. */ { @@ -3134,14 +3134,14 @@ The default value is \"off\"."), add_cmd ("pause", no_class, show_thread_default_pause_cmd, _("\ Show whether new threads are suspended while gdb has control."), &show_thread_default_cmd_list); - + add_cmd ("run", class_run, set_thread_default_run_cmd, _("\ Set whether new threads are allowed to run (once gdb has noticed them)."), &set_thread_default_cmd_list); add_cmd ("run", no_class, show_thread_default_run_cmd, _("\ Show whether new threads are allowed to run (once gdb has noticed them)."), &show_thread_default_cmd_list); - + add_cmd ("detach-suspend-count", class_run, set_thread_default_detach_sc_cmd, _("Set the default detach-suspend-count value for new threads."), &set_thread_default_cmd_list); diff --git a/gdb/gnu-v3-abi.c b/gdb/gnu-v3-abi.c index e3818d9fdba..700e271903e 100644 --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -337,7 +337,7 @@ gnuv3_rtti_type (struct value *value, + vtable->embedded_offset ()).minsym; if (! vtable_symbol) return NULL; - + /* The symbol's demangled name should be something like "vtable for CLASS", where CLASS is the name of the run-time type of VALUE. If we didn't like this approach, we could instead look in the @@ -1189,14 +1189,14 @@ gnuv3_get_type_from_type_info (struct value *type_info_ptr) /* Determine if we are currently in a C++ thunk. If so, get the address of the routine we are thunking to and continue to there instead. */ -static CORE_ADDR +static CORE_ADDR gnuv3_skip_trampoline (const frame_info_ptr &frame, CORE_ADDR stop_pc) { CORE_ADDR real_stop_pc, method_stop_pc, func_addr; struct gdbarch *gdbarch = get_frame_arch (frame); struct obj_section *section; const char *thunk_name, *fn_name; - + real_stop_pc = gdbarch_skip_trampoline_code (gdbarch, frame, stop_pc); if (real_stop_pc == 0) real_stop_pc = stop_pc; diff --git a/gdb/gregset.h b/gdb/gregset.h index b77ea6b8e67..cfff9c4ed40 100644 --- a/gdb/gregset.h +++ b/gdb/gregset.h @@ -52,7 +52,7 @@ extern void supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregs); /* Copy register values from GDB's register cache into - the native target gregset/fpregset. If regno is -1, + the native target gregset/fpregset. If regno is -1, copy all the registers. */ extern void fill_gregset (const struct regcache *regcache, diff --git a/gdb/guile/scm-block.c b/gdb/guile/scm-block.c index e1b2928df18..ee25743ad07 100644 --- a/gdb/guile/scm-block.c +++ b/gdb/guile/scm-block.c @@ -537,7 +537,7 @@ bkscm_print_block_syms_progress_smob (SCM self, SCM port, { struct compunit_symtab *cust; - gdbscm_printf (port, " %s", + gdbscm_printf (port, " %s", i_smob->iter.which == GLOBAL_BLOCK ? "global" : "static"); if (i_smob->iter.idx != -1) diff --git a/gdb/guile/scm-math.c b/gdb/guile/scm-math.c index 6c4ee7933e6..959f7ecc2da 100644 --- a/gdb/guile/scm-math.c +++ b/gdb/guile/scm-math.c @@ -751,7 +751,7 @@ vlscm_convert_typed_value_from_scheme (const char *func_name, obj_arg_pos, func_name, &except_scm, gdbarch); } - else if (gdbscm_is_bool (obj)) + else if (gdbscm_is_bool (obj)) { if (type != NULL && !is_integral_type (type)) diff --git a/gdb/guile/scm-pretty-print.c b/gdb/guile/scm-pretty-print.c index 95a663704c8..1be63e77b73 100644 --- a/gdb/guile/scm-pretty-print.c +++ b/gdb/guile/scm-pretty-print.c @@ -73,7 +73,7 @@ struct pretty_printer_smob /* A procedure called to look up the printer for the given value. The procedure is called as (lookup gdb:pretty-printer value). The result should either be a gdb:pretty-printer object that will print - the value, or #f if the value is not recognized. */ + the value, or #f if the value is not recognized. */ SCM lookup; /* Note: Attaching subprinters to this smob is left to Scheme. */ @@ -572,7 +572,7 @@ ppscm_pretty_print_one_value (SCM printer, struct value **out_value, /* Return the display hint for PRINTER as a Scheme object. The caller is responsible for ensuring PRINTER is a object. */ - + static SCM ppscm_get_display_hint_scm (SCM printer) { @@ -678,7 +678,7 @@ ppscm_print_string_repr (SCM printer, enum display_hint hint, if (hint == HINT_STRING) { struct type *type = builtin_type (gdbarch)->builtin_char; - + language->printstr (stream, type, (gdb_byte *) string.get (), length, NULL, 0, options); } diff --git a/gdb/guile/scm-symbol.c b/gdb/guile/scm-symbol.c index 1d3fb2972b8..b7702c28ce5 100644 --- a/gdb/guile/scm-symbol.c +++ b/gdb/guile/scm-symbol.c @@ -537,7 +537,7 @@ gdbscm_symbol_value (SCM self, SCM rest) if (frame_info == NULL) error (_("Invalid frame")); } - + if (symbol_read_needs_frame (symbol) && frame_info == NULL) error (_("Symbol requires a frame to compute its value")); diff --git a/gdb/guile/scm-symtab.c b/gdb/guile/scm-symtab.c index 09887a41be0..6d6d1b43023 100644 --- a/gdb/guile/scm-symtab.c +++ b/gdb/guile/scm-symtab.c @@ -243,7 +243,7 @@ stscm_scm_from_symtab (struct symtab *symtab) st_smob = (symtab_smob *) SCM_SMOB_DATA (st_scm); st_smob->symtab = symtab; gdbscm_fill_eqable_gsmob_ptr_slot (slot, &st_smob->base); - + return st_scm; } diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c index b088b2a342c..89907b86d9e 100644 --- a/gdb/h8300-tdep.c +++ b/gdb/h8300-tdep.c @@ -151,7 +151,7 @@ h8300_init_frame_cache (struct gdbarch *gdbarch, from the register in which it was passed to the stack slot in which it really lives. It is a byte, word, or longword move from an argument register to a negative offset from the frame pointer. - + CV, 2003-06-16: Or, in optimized code or when the `register' qualifier is used, it could be a byte, word or long move to registers r3-r5. */ @@ -597,7 +597,7 @@ h8300_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) So, for example, on the h8/300s, if a function expects a three-byte structure and an int, the structure will go on the stack, and the int will go in r2, not r0. - + If the function returns an aggregate type (struct, union, or class) by value, the caller must allocate space to hold the return value, and pass the callee a pointer to this space as an invisible first @@ -1339,7 +1339,7 @@ h8300_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Frame unwinder. */ frame_base_set_default (gdbarch, &h8300_frame_base); - /* + /* * Miscellany */ /* Stack grows up. */ diff --git a/gdb/hppa-linux-nat.c b/gdb/hppa-linux-nat.c index 5e63e7f67eb..60a9ffc3d42 100644 --- a/gdb/hppa-linux-nat.c +++ b/gdb/hppa-linux-nat.c @@ -238,7 +238,7 @@ fetch_register (struct regcache *regcache, int regno) errno = 0; val = ptrace (PTRACE_PEEKUSER, tid, hppa_linux_register_addr (regno, 0), 0); if (errno != 0) - error (_("Couldn't read register %s (#%d): %s."), + error (_("Couldn't read register %s (#%d): %s."), gdbarch_register_name (gdbarch, regno), regno, safe_strerror (errno)); @@ -282,7 +282,7 @@ hppa_linux_nat_target::fetch_registers (struct regcache *regcache, int regno) regno++) fetch_register (regcache, regno); } - else + else { fetch_register (regcache, regno); } diff --git a/gdb/hppa-linux-tdep.c b/gdb/hppa-linux-tdep.c index d0bb56214ef..da5559c07ab 100644 --- a/gdb/hppa-linux-tdep.c +++ b/gdb/hppa-linux-tdep.c @@ -113,15 +113,15 @@ insns_match_pattern (struct gdbarch *gdbarch, CORE_ADDR pc, /* Signal frames. */ /* (This is derived from MD_FALLBACK_FRAME_STATE_FOR in gcc.) - + Unfortunately, because of various bugs and changes to the kernel, we have several cases to deal with. - In 2.4, the signal trampoline is 4 bytes, and pc should point directly at + In 2.4, the signal trampoline is 4 bytes, and pc should point directly at the beginning of the trampoline and struct rt_sigframe. In <= 2.6.5-rc2-pa3, the signal trampoline is 9 bytes, and pc points at - the 4th word in the trampoline structure. This is wrong, it should point + the 4th word in the trampoline structure. This is wrong, it should point at the 5th word. This is fixed in 2.6.5-rc2-pa4. To detect these cases, we first take pc, align it to 64-bytes @@ -150,7 +150,7 @@ hppa_linux_sigtramp_find_sigcontext (struct gdbarch *gdbarch, CORE_ADDR pc) /* rt_sigreturn trampoline: 3419000x ldi 0, %r25 or ldi 1, %r25 (x = 0 or 2) - 3414015a ldi __NR_rt_sigreturn, %r20 + 3414015a ldi __NR_rt_sigreturn, %r20 e4008200 be,l 0x100(%sr2, %r0), %sr0, %r31 08000240 nop */ @@ -168,7 +168,7 @@ hppa_linux_sigtramp_find_sigcontext (struct gdbarch *gdbarch, CORE_ADDR pc) { if (insns_match_pattern (gdbarch, pc, hppa_sigtramp, dummy)) { - /* sigaltstack case: we have no way of knowing which offset to + /* sigaltstack case: we have no way of knowing which offset to use in this case; default to new kernel handling. If this is wrong the unwinding will fail. */ attempt = 2; @@ -180,7 +180,7 @@ hppa_linux_sigtramp_find_sigcontext (struct gdbarch *gdbarch, CORE_ADDR pc) /* sp + sfoffs[try] points to a struct rt_sigframe, which contains a struct siginfo and a struct ucontext. struct ucontext contains - a struct sigcontext. Return an offset to this sigcontext here. Too + a struct sigcontext. Return an offset to this sigcontext here. Too bad we cannot include system specific headers :-(. sizeof(struct siginfo) == 128 offsetof(struct ucontext, uc_mcontext) == 24. */ @@ -213,10 +213,10 @@ hppa_linux_sigtramp_frame_unwind_cache (const frame_info_ptr &this_frame, scptr = hppa_linux_sigtramp_find_sigcontext (gdbarch, pc); /* structure of struct sigcontext: - + struct sigcontext { unsigned long sc_flags; - unsigned long sc_gr[32]; + unsigned long sc_gr[32]; unsigned long long sc_fr[32]; unsigned long sc_iasq[2]; unsigned long sc_iaoq[2]; @@ -337,7 +337,7 @@ hppa_linux_find_global_pointer (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); struct obj_section *faddr_sect; CORE_ADDR faddr; - + faddr = value_as_address (function); /* Is this a plabel? If so, dereference it to get the gp value. */ @@ -353,8 +353,8 @@ hppa_linux_find_global_pointer (struct gdbarch *gdbarch, return extract_unsigned_integer (buf, sizeof (buf), byte_order); } - /* If the address is in the plt section, then the real function hasn't - yet been fixed up by the linker so we cannot determine the gp of + /* If the address is in the plt section, then the real function hasn't + yet been fixed up by the linker so we cannot determine the gp of that function. */ if (in_plt_section (faddr)) return 0; diff --git a/gdb/hppa-netbsd-tdep.c b/gdb/hppa-netbsd-tdep.c index 90d8eb8250c..47b964129e3 100644 --- a/gdb/hppa-netbsd-tdep.c +++ b/gdb/hppa-netbsd-tdep.c @@ -35,7 +35,7 @@ static int hppanbsd_mc_reg_offset[] = /* r0 ... r31 */ -1, 1 * 4, 2 * 4, 3 * 4, 4 * 4, 5 * 4, 6 * 4, 7 * 4, - 8 * 4, 9 * 4, 10 * 4, 11 * 4, + 8 * 4, 9 * 4, 10 * 4, 11 * 4, 12 * 4, 13 * 4, 14 * 4, 15 * 4, 16 * 4, 17 * 4, 18 * 4, 19 * 4, 20 * 4, 21 * 4, 22 * 4, 23 * 4, @@ -136,7 +136,7 @@ static int hppanbsd_reg_offset[] = /* r0 ... r31 */ -1, 1 * 4, 2 * 4, 3 * 4, 4 * 4, 5 * 4, 6 * 4, 7 * 4, - 8 * 4, 9 * 4, 10 * 4, 11 * 4, + 8 * 4, 9 * 4, 10 * 4, 11 * 4, 12 * 4, 13 * 4, 14 * 4, 15 * 4, 16 * 4, 17 * 4, 18 * 4, 19 * 4, 20 * 4, 21 * 4, 22 * 4, 23 * 4, diff --git a/gdb/hppa-obsd-nat.c b/gdb/hppa-obsd-nat.c index 322b6f93d6e..01319fa8194 100644 --- a/gdb/hppa-obsd-nat.c +++ b/gdb/hppa-obsd-nat.c @@ -80,7 +80,7 @@ hppaobsd_supply_gregset (struct regcache *regcache, const void *gregs) regcache->raw_supply (HPPA_SR7_REGNUM, regs + 44 * 4); regcache->raw_supply (HPPA_CR26_REGNUM, regs + 45 * 4); regcache->raw_supply (HPPA_CR27_REGNUM, regs + 46 * 4); - } + } else { regcache->raw_supply (HPPA_SAR_REGNUM, regs); diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c index 230e9beba39..96cb797c023 100644 --- a/gdb/hppa-tdep.c +++ b/gdb/hppa-tdep.c @@ -79,8 +79,8 @@ struct hppa_objfile_private }; /* hppa-specific object data -- unwind and solib info. - TODO/maybe: think about splitting this into two parts; the unwind data is - common to all hppa targets, but is only used in this file; we can register + TODO/maybe: think about splitting this into two parts; the unwind data is + common to all hppa targets, but is only used in this file; we can register that separately and make this static. The solib data is probably hpux- specific, so we can create a separate extern objfile_data that is registered by hppa-hpux-tdep.c and shared with pa64solib.c and somsolib.c. */ @@ -97,10 +97,10 @@ static const registry::key #define UNWIND_ENTRY_SIZE 16 #define STUB_UNWIND_ENTRY_SIZE 8 -/* Routines to extract various sized constants out of hppa +/* Routines to extract various sized constants out of hppa instructions. */ -/* This assumes that no garbage lies outside of the lower bits of +/* This assumes that no garbage lies outside of the lower bits of value. */ static int @@ -191,7 +191,7 @@ hppa_extract_17 (unsigned word) (word & 0x1) << 16, 17) << 2; } -CORE_ADDR +CORE_ADDR hppa_symbol_address(const char *sym) { bound_minimal_symbol minsym @@ -204,7 +204,7 @@ hppa_symbol_address(const char *sym) -/* Compare the start address for two unwind entries returning 1 if +/* Compare the start address for two unwind entries returning 1 if the first address is larger than the second, -1 if the second is larger than the first, and zero if they are equal. */ @@ -264,7 +264,7 @@ internalize_unwinds (struct objfile *objfile, struct unwind_table_entry *table, low_text_segment_address = -1; bfd_map_over_sections (objfile->obfd.get (), - record_text_segment_lowaddr, + record_text_segment_lowaddr, &low_text_segment_address); text_offset = low_text_segment_address; @@ -549,9 +549,9 @@ find_unwind_entry (CORE_ADDR pc) /* Implement the stack_frame_destroyed_p gdbarch method. - The epilogue is defined here as the area either on the `bv' instruction + The epilogue is defined here as the area either on the `bv' instruction itself or an instruction which destroys the function's stack frame. - + We do not assume that the epilogue is at the end of a function as we can also have return sequences in the middle of a function. */ @@ -569,14 +569,14 @@ hppa_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) inst = extract_unsigned_integer (buf, 4, byte_order); - /* The most common way to perform a stack adjustment ldo X(sp),sp + /* The most common way to perform a stack adjustment ldo X(sp),sp We are destroying a stack frame if the offset is negative. */ if ((inst & 0xffffc000) == 0x37de0000 && hppa_extract_14 (inst) < 0) return 1; /* ldw,mb D(sp),X or ldd,mb D(sp),X */ - if (((inst & 0x0fc010e0) == 0x0fc010e0 + if (((inst & 0x0fc010e0) == 0x0fc010e0 || (inst & 0x0fc010e0) == 0x0fc010e0) && hppa_extract_14 (inst) < 0) return 1; @@ -692,7 +692,7 @@ hppa64_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int reg) We simply allocate the appropriate amount of stack space and put arguments into their proper slots. */ - + static CORE_ADDR hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct regcache *regcache, CORE_ADDR bp_addr, @@ -796,7 +796,7 @@ hppa32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, write_memory (param_end - param_ptr, param_val, param_len); /* There are some cases when we don't know the type - expected by the callee (e.g. for variadic functions), so + expected by the callee (e.g. for variadic functions), so pass the parameters in both general and fp regs. */ if (param_ptr <= 48) { @@ -1731,7 +1731,7 @@ restart: /* Bump the PC. */ pc += 4; - /* !stop_before_branch, so also look at the insn in the delay slot + /* !stop_before_branch, so also look at the insn in the delay slot of the branch. */ if (final_iteration) break; @@ -1795,7 +1795,7 @@ after_prologue (CORE_ADDR pc) /* To skip prologues, I use this predicate. Returns either PC itself if the code at PC does not look like a function prologue; otherwise returns an address that (if we're lucky) follows the prologue. - + hppa_skip_prologue is called by gdb to place a breakpoint in a function. It doesn't necessarily skips all the insns in the prologue. In fact we might not want to skip all the insns because a prologue insn may @@ -1894,7 +1894,7 @@ hppa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) /* Frame pointer gets saved into a special location. */ if (u->Save_SP && i == HPPA_FP_REGNUM) continue; - + saved_gr_mask |= (1 << i); } @@ -1924,12 +1924,12 @@ hppa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) int looking_for_rp = u->Save_RP; int fp_loc = -1; - /* We have to use skip_prologue_hard_way instead of just + /* We have to use skip_prologue_hard_way instead of just skip_prologue_using_sal, in case we stepped into a function without symbol information. hppa_skip_prologue also bounds the returned pc by the passed in pc, so it will not return a pc in the next function. - + We used to call hppa_skip_prologue to find the end of the prologue, but if some non-prologue instructions get scheduled into the prologue, and the program is compiled with debug information, the "easy" way @@ -1981,7 +1981,7 @@ hppa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) /* Note the interesting effects of this instruction. */ frame_size += prologue_inst_adjust_sp (inst); - + /* There are limited ways to store the return pointer into the stack. */ if (inst == 0x6bc23fd9) /* stw rp,-0x14(sr0,sp) */ @@ -1994,13 +1994,13 @@ hppa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) looking_for_rp = 0; cache->saved_regs[HPPA_RP_REGNUM].set_addr (-24); } - else if (inst == 0x0fc212c1 + else if (inst == 0x0fc212c1 || inst == 0x73c23fe1) /* std rp,-0x10(sr0,sp) */ { looking_for_rp = 0; cache->saved_regs[HPPA_RP_REGNUM].set_addr (-16); } - + /* Check to see if we saved SP into the stack. This also happens to indicate the location of the saved frame pointer. */ @@ -2014,7 +2014,7 @@ hppa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) { fp_in_r1 = 1; } - + /* Account for general and floating-point register saves. */ reg = inst_saves_gr (inst); if (reg >= 3 && reg <= 18 @@ -2031,7 +2031,7 @@ hppa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) else { CORE_ADDR offset; - + if ((inst >> 26) == 0x1c) offset = (inst & 0x1 ? -(1 << 13) : 0) | (((inst >> 4) & 0x3ff) << 3); @@ -2039,7 +2039,7 @@ hppa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) offset = hppa_low_hppa_sign_extend (inst & 0x1f, 5); else offset = hppa_extract_14 (inst); - + /* Handle code with and without frame pointers. */ if (u->Save_SP) cache->saved_regs[reg].set_addr (offset); @@ -2049,20 +2049,20 @@ hppa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) } } - /* GCC handles callee saved FP regs a little differently. - + /* GCC handles callee saved FP regs a little differently. + It emits an instruction to put the value of the start of the FP store area into %r1. It then uses fstds,ma with a basereg of %r1 for the stores. HP CC emits them at the current stack pointer modifying the stack pointer as it stores each register. */ - + /* ldo X(%r3),%r1 or ldo X(%r30),%r1. */ if ((inst & 0xffffc000) == 0x34610000 || (inst & 0xffffc000) == 0x37c10000) fp_loc = hppa_extract_14 (inst); - + reg = inst_saves_fr (inst); if (reg >= 12 && reg <= 21) { @@ -2084,7 +2084,7 @@ hppa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) fp_loc += 8; } } - + /* Quit if we hit any kind of branch the previous iteration. */ if (final_iteration) break; @@ -2112,37 +2112,37 @@ hppa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) /* Check to see if a frame pointer is available, and use it for frame unwinding if it is. - + There are some situations where we need to rely on the frame pointer to do stack unwinding. For example, if a function calls alloca (), the stack pointer can get adjusted inside the body of the function. In this case, the ABI requires that the compiler maintain a frame pointer for the function. - + The unwind record has a flag (alloca_frame) that indicates that - a function has a variable frame; unfortunately, gcc/binutils + a function has a variable frame; unfortunately, gcc/binutils does not set this flag. Instead, whenever a frame pointer is used and saved on the stack, the Save_SP flag is set. We use this to decide whether to use the frame pointer for unwinding. - - TODO: For the HP compiler, maybe we should use the alloca_frame flag + + TODO: For the HP compiler, maybe we should use the alloca_frame flag instead of Save_SP. */ - + fp = get_frame_register_unsigned (this_frame, HPPA_FP_REGNUM); if (u->alloca_frame) fp -= u->Total_frame_size << 3; - + if (get_frame_pc (this_frame) >= prologue_end && (u->Save_SP || u->alloca_frame) && fp != 0) { cache->base = fp; - + if (hppa_debug) gdb_printf (gdb_stdlog, " (base=%s) [frame pointer]", paddress (gdbarch, cache->base)); } - else if (u->Save_SP + else if (u->Save_SP && cache->saved_regs[HPPA_SP_REGNUM].is_addr ()) { /* Both we're expecting the SP to be saved and the SP has been @@ -2189,7 +2189,7 @@ hppa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) { if (cache->saved_regs[HPPA_RP_REGNUM].is_addr ()) { - cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] = + cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] = cache->saved_regs[HPPA_RP_REGNUM]; if (hppa_debug) gdb_printf (gdb_stdlog, " (pc=rp) [stack] } "); @@ -2216,7 +2216,7 @@ hppa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) So if we are at offset c, the r3 value that we want is not yet saved on the stack, but it's been overwritten. The prologue analyzer will - set fp_in_r1 when it sees the copy insn so we know to get the value + set fp_in_r1 when it sees the copy insn so we know to get the value from r1 instead. */ if (u->Save_SP && !cache->saved_regs[HPPA_FP_REGNUM].is_addr () && fp_in_r1) @@ -2361,7 +2361,7 @@ hppa_fallback_frame_cache (const frame_info_ptr &this_frame, void **this_cache) { cache->saved_regs[HPPA_RP_REGNUM].set_addr (cache->saved_regs[HPPA_RP_REGNUM].addr () + cache->base); - cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] = + cache->saved_regs[HPPA_PCOQ_HEAD_REGNUM] = cache->saved_regs[HPPA_RP_REGNUM]; } else @@ -2378,7 +2378,7 @@ static void hppa_fallback_frame_this_id (const frame_info_ptr &this_frame, void **this_cache, struct frame_id *this_id) { - struct hppa_frame_cache *info = + struct hppa_frame_cache *info = hppa_fallback_frame_cache (this_frame, this_cache); (*this_id) = frame_id_build (info->base, get_frame_func (this_frame)); @@ -2742,7 +2742,7 @@ static struct insn_pattern hppa_long_branch_stub[] = { /* ldil LR'xxx,%r1 */ { 0x20200000, 0xffe00000 }, /* be,n RR'xxx(%sr4,%r1) */ - { 0xe0202002, 0xffe02002 }, + { 0xe0202002, 0xffe02002 }, { 0, 0 } }; @@ -2752,7 +2752,7 @@ static struct insn_pattern hppa_long_branch_pic_stub[] = { /* addil LR'xxx - ($PIC_pcrel$0 - 4), %r1 */ { 0x28200000, 0xffe00000 }, /* be,n RR'xxxx - ($PIC_pcrel$0 - 8)(%sr4, %r1) */ - { 0xe0202002, 0xffe02002 }, + { 0xe0202002, 0xffe02002 }, { 0, 0 } }; @@ -3077,7 +3077,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) default: internal_error (_("bad switch")); } - + /* Struct return methods. */ switch (tdep->bytes_per_address) { @@ -3090,7 +3090,7 @@ hppa_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) default: internal_error (_("bad switch")); } - + set_gdbarch_breakpoint_kind_from_pc (gdbarch, hppa_breakpoint::kind_from_pc); set_gdbarch_sw_breakpoint_from_kind (gdbarch, hppa_breakpoint::bp_from_kind); set_gdbarch_pseudo_register_read (gdbarch, hppa_pseudo_register_read); @@ -3114,7 +3114,7 @@ hppa_dump_tdep (struct gdbarch *gdbarch, struct ui_file *file) { hppa_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - gdb_printf (file, "bytes_per_address = %d\n", + gdb_printf (file, "bytes_per_address = %d\n", tdep->bytes_per_address); gdb_printf (file, "elf = %s\n", tdep->is_elf ? "yes" : "no"); } diff --git a/gdb/hppa-tdep.h b/gdb/hppa-tdep.h index 00153210e18..07401f1e1dd 100644 --- a/gdb/hppa-tdep.h +++ b/gdb/hppa-tdep.h @@ -94,7 +94,7 @@ struct hppa_gdbarch_tdep : gdbarch_tdep_base system. */ int is_elf = 0; - /* Given a function address, try to find the global pointer for the + /* Given a function address, try to find the global pointer for the corresponding shared object. */ CORE_ADDR (*find_global_pointer) (struct gdbarch *, struct value *) = nullptr; @@ -174,7 +174,7 @@ struct unwind_table_entry }; /* HP linkers also generate unwinds for various linker-generated stubs. - GDB reads in the stubs from the $UNWIND_END$ subspace, then + GDB reads in the stubs from the $UNWIND_END$ subspace, then "converts" them into normal unwind entries using some of the reserved fields to store the stub type. */ diff --git a/gdb/i386-bsd-nat.c b/gdb/i386-bsd-nat.c index c5eda867e1d..f8a389f1cd9 100644 --- a/gdb/i386-bsd-nat.c +++ b/gdb/i386-bsd-nat.c @@ -269,7 +269,7 @@ INIT_GDB_FILE (i386bsd_nat) { warning (_("\ offsetof (struct sigcontext, sc_pc) yields %d instead of %d.\n\ -Please report this to ."), +Please report this to ."), offset, SC_PC_OFFSET); } diff --git a/gdb/i386-darwin-tdep.c b/gdb/i386-darwin-tdep.c index a91afa25d01..11b0ef4bdda 100644 --- a/gdb/i386-darwin-tdep.c +++ b/gdb/i386-darwin-tdep.c @@ -59,7 +59,7 @@ int i386_darwin_thread_state_reg_offset[] = 15 * 4 /* GS */ }; -const int i386_darwin_thread_state_num_regs = +const int i386_darwin_thread_state_num_regs = ARRAY_SIZE (i386_darwin_thread_state_reg_offset); /* Assuming THIS_FRAME is a Darwin sigtramp routine, return the @@ -204,11 +204,11 @@ i386_darwin_push_dummy_call (struct gdbarch *gdbarch, struct value *function, arg_type->length ()); /* The System V ABI says that: - + "An argument's size is increased, if necessary, to make it a multiple of [32-bit] words. This may require tail padding, depending on the size of the argument." - + This makes sure the stack stays word-aligned. */ args_space += align_up (arg_type->length (), 4); } @@ -279,7 +279,7 @@ i386_mach_o_osabi_sniffer (bfd *abfd) { if (!bfd_check_format (abfd, bfd_object)) return GDB_OSABI_UNKNOWN; - + if (bfd_get_arch (abfd) == bfd_arch_i386) return GDB_OSABI_DARWIN; diff --git a/gdb/i386-linux-nat.c b/gdb/i386-linux-nat.c index f5112d2b868..4af06c448a8 100644 --- a/gdb/i386-linux-nat.c +++ b/gdb/i386-linux-nat.c @@ -105,7 +105,7 @@ fetch_register (struct regcache *regcache, int regno) val = ptrace (PTRACE_PEEKUSER, tid, i386_linux_gregset_reg_offset[regno], 0); if (errno != 0) - error (_("Couldn't read register %s (#%d): %s."), + error (_("Couldn't read register %s (#%d): %s."), gdbarch_register_name (regcache->arch (), regno), regno, safe_strerror (errno)); @@ -221,7 +221,7 @@ store_regs (const struct regcache *regcache, int tid, int regno) perror_with_name (_("Couldn't get registers")); fill_gregset (regcache, ®s, regno); - + if (ptrace (PTRACE_SETREGS, tid, 0, (int) ®s) < 0) perror_with_name (_("Couldn't write registers")); } @@ -239,7 +239,7 @@ static void store_regs (const struct regcache *regcache, int tid, int regno) {} /* Fill GDB's register array with the floating-point register values in *FPREGSETP. */ -void +void supply_fpregset (struct regcache *regcache, const elf_fpregset_t *fpregsetp) { i387_supply_fsave (regcache, -1, fpregsetp); @@ -401,7 +401,7 @@ store_fpxregs (const struct regcache *regcache, int tid, int regno) if (have_ptrace_getfpxregs == TRIBOOL_FALSE) return 0; - + if (ptrace (PTRACE_GETFPXREGS, tid, 0, &fpxregs) == -1) { if (errno == EIO) diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c index 34e13912098..20adf169c81 100644 --- a/gdb/i386-linux-tdep.c +++ b/gdb/i386-linux-tdep.c @@ -899,7 +899,7 @@ i386_linux_intx80_sysenter_syscall_record (struct regcache *regcache) { gdb_printf (gdb_stderr, _("Process record and replay target doesn't " - "support syscall number %s\n"), + "support syscall number %s\n"), plongest (syscall_native)); return -1; } @@ -1198,7 +1198,7 @@ i386_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, /* Linux kernel shows PC value after the 'int $0x80' instruction even if inferior is still inside the syscall. On next PTRACE_SINGLESTEP it will finish the syscall but PC will not change. - + Some vDSOs contain 'int $0x80; ret' and during stepping out of the syscall i386_displaced_step_fixup would keep PC at the displaced pad location. As PC is pointing to the 'ret' instruction before the step @@ -1206,7 +1206,7 @@ i386_linux_iterate_over_regset_sections (struct gdbarch *gdbarch, and PC should not be adjusted. In reality it finished syscall instead and PC should get relocated back to its vDSO address. Hide the 'ret' instruction by 'nop' so that i386_displaced_step_fixup is not confused. - + It is not fully correct as the bytes in struct displaced_step_copy_insn_closure will not match the inferior code. But we would need some new flag in displaced_step_copy_insn_closure otherwise to diff --git a/gdb/i386-netbsd-tdep.c b/gdb/i386-netbsd-tdep.c index a1124d03e4f..d17584733e7 100644 --- a/gdb/i386-netbsd-tdep.c +++ b/gdb/i386-netbsd-tdep.c @@ -368,7 +368,7 @@ i386nbsd_sigtramp_cache_init (const struct tramp_frame *self, } -static void +static void i386nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { i386_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); diff --git a/gdb/i386-obsd-tdep.c b/gdb/i386-obsd-tdep.c index 1126597aa6b..96334c1bc03 100644 --- a/gdb/i386-obsd-tdep.c +++ b/gdb/i386-obsd-tdep.c @@ -355,7 +355,7 @@ i386obsd_trapframe_this_id (const frame_info_ptr &this_frame, { struct trad_frame_cache *cache = i386obsd_trapframe_cache (this_frame, this_cache); - + trad_frame_get_id (cache, this_id); } @@ -405,7 +405,7 @@ static const struct frame_unwind_legacy i386obsd_trapframe_unwind ( ); -static void +static void i386obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch) { i386_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); diff --git a/gdb/i387-tdep.c b/gdb/i387-tdep.c index 977edeb57dd..ff66712ed0d 100644 --- a/gdb/i387-tdep.c +++ b/gdb/i387-tdep.c @@ -85,7 +85,7 @@ print_i387_ext (struct gdbarch *gdbarch, { /* Denormal or zero. */ print_i387_value (gdbarch, raw, file); - + if (integer) /* Pseudo-denormal. */ gdb_puts (" Pseudo-denormal", file); @@ -177,7 +177,7 @@ print_i387_control_word (int control_p, gdb_puts ("Extended Precision (64-bits)\n", file); break; } - + gdb_puts (" RC: ", file); switch ((control >> 10) & 3) { @@ -638,7 +638,7 @@ i387_supply_fxsave (struct regcache *regcache, int regnum, const void *fxsave) if (val[0] & (1 << fpreg)) { - int thisreg = (fpreg + 8 - top) % 8 + int thisreg = (fpreg + 8 - top) % 8 + I387_ST0_REGNUM (tdep); tag = i387_tag (FXSAVE_ADDR (tdep, regs, thisreg)); } @@ -1368,7 +1368,7 @@ i387_supply_xsave (struct regcache *regcache, int regnum, if (val[0] & (1 << fpreg)) { - int thisreg = (fpreg + 8 - top) % 8 + int thisreg = (fpreg + 8 - top) % 8 + I387_ST0_REGNUM (tdep); tag = i387_tag (FXSAVE_ADDR (tdep, regs, thisreg)); } diff --git a/gdb/ia64-libunwind-tdep.c b/gdb/ia64-libunwind-tdep.c index 6d3b2651abe..c17e1aa66d6 100644 --- a/gdb/ia64-libunwind-tdep.c +++ b/gdb/ia64-libunwind-tdep.c @@ -185,7 +185,7 @@ libunwind_frame_cache (const frame_info_ptr &this_frame, void **this_cache) cache->func_addr = get_frame_pc (this_frame); /* Get a libunwind cursor to the previous frame. - + We do this by initializing a cursor. Libunwind treats a new cursor as the top of stack and will get the current register set via the libunwind register accessor. Now, we provide the platform-specific @@ -277,8 +277,8 @@ libunwind_frame_sniffer (const struct frame_unwind *self, return 0; } - - /* Check to see if we have libunwind info by checking if we are in a + + /* Check to see if we have libunwind info by checking if we are in a signal frame. If it doesn't return an error, we have libunwind info and can use libunwind. */ ret = unw_is_signal_frame_p (&cursor); @@ -318,7 +318,7 @@ libunwind_frame_prev_register (const frame_info_ptr &this_frame, if (cache == NULL) return frame_unwind_got_constant (this_frame, regnum, 0); - + /* Convert from gdb register number to libunwind register number. */ descr = libunwind_descr (get_frame_arch (this_frame)); uw_regnum = descr->gdb2uw (regnum); @@ -369,10 +369,10 @@ libunwind_frame_prev_register (const frame_info_ptr &this_frame, } return val; -} +} /* The following is a glue routine to call the libunwind unwind table - search function to get unwind information for a specified ip address. */ + search function to get unwind information for a specified ip address. */ int libunwind_search_unwind_table (void *as, long ip, void *di, void *pi, int need_unwind_info, void *args) @@ -486,7 +486,7 @@ libunwind_get_reg_special (struct gdbarch *gdbarch, readable_regcache *regcache, return 0; } - + static int libunwind_load (void) { @@ -564,7 +564,7 @@ libunwind_load (void) = (unw_find_dyn_list_p_ftype *) dlsym (handle, find_dyn_list_name); if (unw_find_dyn_list_p == NULL) return 0; - + return 1; } diff --git a/gdb/ia64-libunwind-tdep.h b/gdb/ia64-libunwind-tdep.h index cf83b6a005c..f5636914729 100644 --- a/gdb/ia64-libunwind-tdep.h +++ b/gdb/ia64-libunwind-tdep.h @@ -50,7 +50,7 @@ struct libunwind_descr int libunwind_frame_sniffer (const struct frame_unwind *self, const frame_info_ptr &this_frame, void **this_cache); - + int libunwind_sigtramp_frame_sniffer (const struct frame_unwind *self, const frame_info_ptr &this_frame, void **this_cache); diff --git a/gdb/ia64-linux-nat.c b/gdb/ia64-linux-nat.c index e833f9d820a..35d32ba70e6 100644 --- a/gdb/ia64-linux-nat.c +++ b/gdb/ia64-linux-nat.c @@ -372,7 +372,7 @@ static int ia64_cannot_store_register (struct gdbarch *gdbarch, int regno) { /* Rationale behind not permitting stores to bspstore... - + The IA-64 architecture provides bspstore and bsp which refer memory locations in the RSE's backing store. bspstore is the next location which will be written when the RSE needs to write diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index a626cb22fbd..42435d1b48b 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -46,7 +46,7 @@ /* Note: KERNEL_START is supposed to be an address which is not going to ever contain any valid unwind info. For ia64 linux, the choice of 0xc000000000000000 is fairly safe since that's uncached space. - + We use KERNEL_START as follows: after obtaining the kernel's unwind table via getunwind(), we project its unwind data into address-range KERNEL_START-(KERNEL_START+ktab_size) and then @@ -94,7 +94,7 @@ enum ia64_instruction_type multiplies its slot numbers (for exceptions) by one while the disassembler multiplies its slot numbers by 6. In addition, I've heard it said that the simulator uses 1 as the multiplier. - + I've fixed the disassembler so that the bytes_per_line field will be the slot multiplier. If bytes_per_line comes in as zero, it is set to six (which is how it was set up initially). -- objdump @@ -136,8 +136,8 @@ static int sp_regnum = IA64_GR12_REGNUM; register get/set interfaces. */ enum pseudo_regs { FIRST_PSEUDO_REGNUM = NUM_IA64_RAW_REGS, - VBOF_REGNUM = IA64_NAT127_REGNUM + 1, V32_REGNUM, - V127_REGNUM = V32_REGNUM + 95, + VBOF_REGNUM = IA64_NAT127_REGNUM + 1, V32_REGNUM, + V127_REGNUM = V32_REGNUM + 95, VP0_REGNUM, VP16_REGNUM = VP0_REGNUM + 16, VP63_REGNUM = VP0_REGNUM + 63, LAST_PSEUDO_REGNUM }; @@ -229,8 +229,8 @@ static const char * const ia64_register_names[] = "nat120","nat121","nat122","nat123","nat124","nat125","nat126","nat127", "bof", - - "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", + + "r32", "r33", "r34", "r35", "r36", "r37", "r38", "r39", "r40", "r41", "r42", "r43", "r44", "r45", "r46", "r47", "r48", "r49", "r50", "r51", "r52", "r53", "r54", "r55", "r56", "r57", "r58", "r59", "r60", "r61", "r62", "r63", @@ -277,7 +277,7 @@ struct ia64_frame_cache int fp_reg; /* Register number (if any) used a frame pointer for this frame. 0 if no register is being used as the frame pointer. */ - + /* Saved registers. */ CORE_ADDR saved_regs[NUM_IA64_RAW_REGS]; @@ -342,7 +342,7 @@ ia64_register_reggroup_p (struct gdbarch *gdbarch, int regnum, if (group == general_reggroup) return (!vector_p && !float_p); if (group == save_reggroup || group == restore_reggroup) - return raw_p; + return raw_p; return 0; } @@ -563,14 +563,14 @@ fetch_instruction (CORE_ADDR addr, ia64_instruction_type *it, long long *instr) break.m, break.f, and break.x), but they all have the same encoding. (The five bit template in the low five bits of the instruction bundle distinguishes one from another.) - + The runtime architecture manual specifies that break instructions used for debugging purposes must have the upper two bits of the 21 bit immediate set to a 0 and a 1 respectively. A breakpoint instruction encodes the most significant bit of its 21 bit immediate at bit 36 of the 41 bit instruction. The penultimate msb - is at bit 25 which leads to the pattern below. - + is at bit 25 which leads to the pattern below. + Originally, I had this set up to do, e.g, a "break.i 0x80000" But it turns out that 0x80000 was used as the syscall break in the early simulators. So I changed the pattern slightly to do "break.i 0x080001" @@ -615,10 +615,10 @@ fetch_instruction (CORE_ADDR addr, ia64_instruction_type *it, long long *instr) does save byte 15 of our instruction bundle (this is the tail end of slot 2, which wouldn't be saved if we were to insert the breakpoint in slot 1). - + ia64 16-byte bundle layout: | 5 bits | slot 0 with 41 bits | slot 1 with 41 bits | slot 2 with 41 bits | - + The current addressing used by the code below: original PC placed_address placed_size required covered == bp_tgt->shadow_len reqd \subset covered @@ -965,8 +965,8 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache, subtract the size of frame from it to get start of register frame. */ bsp = rse_address_add (bsp, -(cfm & 0x7f)); - - if ((cfm & 0x7f) > regnum - V32_REGNUM) + + if ((cfm & 0x7f) > regnum - V32_REGNUM) { ULONGEST reg_addr = rse_address_add (bsp, (regnum - V32_REGNUM)); reg = read_memory_integer ((CORE_ADDR)reg_addr, 8, byte_order); @@ -1008,10 +1008,10 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache, /* The bsp points at the end of the register frame so we subtract the size of frame from it to get start of register frame. */ bsp = rse_address_add (bsp, -(cfm & 0x7f)); - - if ((cfm & 0x7f) > regnum - V32_REGNUM) + + if ((cfm & 0x7f) > regnum - V32_REGNUM) gr_addr = rse_address_add (bsp, (regnum - V32_REGNUM)); - + if (gr_addr != 0) { /* Compute address of nat collection bits. */ @@ -1028,7 +1028,7 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache, nat_bit = (gr_addr >> 3) & 0x3f; natN_val = (nat_collection >> nat_bit) & 1; } - + store_unsigned_integer (buf, register_size (gdbarch, regnum), byte_order, natN_val); } @@ -1072,7 +1072,7 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache, int rrb_pr = (cfm >> 32) & 0x3f; /* Adjust the register number to account for register rotation. */ - regnum = VP16_REGNUM + regnum = VP16_REGNUM + ((regnum - VP16_REGNUM) + rrb_pr) % 48; } prN_val = (pr & (1LL << (regnum - VP0_REGNUM))) != 0; @@ -1099,8 +1099,8 @@ ia64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, regcache_cooked_read_unsigned (regcache, IA64_CFM_REGNUM, &cfm); bsp = rse_address_add (bsp, -(cfm & 0x7f)); - - if ((cfm & 0x7f) > regnum - V32_REGNUM) + + if ((cfm & 0x7f) > regnum - V32_REGNUM) { ULONGEST reg_addr = rse_address_add (bsp, (regnum - V32_REGNUM)); write_memory (reg_addr, buf, 8); @@ -1132,10 +1132,10 @@ ia64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, /* The bsp points at the end of the register frame so we subtract the size of frame from it to get start of register frame. */ bsp = rse_address_add (bsp, -(cfm & 0x7f)); - - if ((cfm & 0x7f) > regnum - V32_REGNUM) + + if ((cfm & 0x7f) > regnum - V32_REGNUM) gr_addr = rse_address_add (bsp, (regnum - V32_REGNUM)); - + natN_val = extract_unsigned_integer (buf, register_size (gdbarch, regnum), byte_order); @@ -1193,7 +1193,7 @@ ia64_pseudo_register_write (struct gdbarch *gdbarch, struct regcache *regcache, int rrb_pr = (cfm >> 32) & 0x3f; /* Adjust the register number to account for register rotation. */ - regnum = VP16_REGNUM + regnum = VP16_REGNUM + ((regnum - VP16_REGNUM) + rrb_pr) % 48; } prN_val = extract_unsigned_integer (buf, register_size (gdbarch, regnum), @@ -1296,7 +1296,7 @@ refine_prologue_limit (CORE_ADDR pc, CORE_ADDR lim_pc, int *trust_limit) found for the function. (It can be less than when the scheduler puts a body instruction before the first prologue instruction.) */ - for (i = 2 * max_skip_non_prologue_insns; + for (i = 2 * max_skip_non_prologue_insns; i > 0 && (lim_pc == 0 || addr < lim_pc); i--) { @@ -1305,7 +1305,7 @@ refine_prologue_limit (CORE_ADDR pc, CORE_ADDR lim_pc, int *trust_limit) sal = find_sal_for_pc (addr, 0); if (sal.line == 0) break; - if (sal.line <= prologue_sal.line + if (sal.line <= prologue_sal.line && sal.symtab == prologue_sal.symtab) { prologue_sal = sal; @@ -1399,7 +1399,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, /* We want to check if we have a recognizable function start before we look ahead for a prologue. */ - if (pc < lim_pc && next_pc + if (pc < lim_pc && next_pc && it == M && ((instr & 0x1ee0000003fLL) == 0x02c00000000LL)) { /* alloc - start of a regular function. */ @@ -1425,11 +1425,11 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, { /* Look for a leaf routine. */ if (pc < lim_pc && next_pc - && (it == I || it == M) + && (it == I || it == M) && ((instr & 0x1ee00000000LL) == 0x10800000000LL)) { /* adds rN = imm14, rM (or mov rN, rM when imm14 is 0) */ - int imm = (int) ((((instr & 0x01000000000LL) ? -1 : 0) << 13) + int imm = (int) ((((instr & 0x01000000000LL) ? -1 : 0) << 13) | ((instr & 0x001f8000000LL) >> 20) | ((instr & 0x000000fe000LL) >> 13)); int rM = (int) ((instr & 0x00007f00000LL) >> 20); @@ -1441,13 +1441,13 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, fp_reg = rN; last_prologue_pc = next_pc; } - } + } /* If we don't recognize a regular function or leaf routine, we are done. */ if (!fp_reg) { - pc = lim_pc; + pc = lim_pc; if (trust_limit) last_prologue_pc = lim_pc; } @@ -1463,16 +1463,16 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, if (it == B && ((instr & 0x1e1f800003fLL) != 0x04000000000LL)) { - /* Exit loop upon hitting a non-nop branch instruction. */ + /* Exit loop upon hitting a non-nop branch instruction. */ if (trust_limit) lim_pc = pc; break; } - else if (((instr & 0x3fLL) != 0LL) && + else if (((instr & 0x3fLL) != 0LL) && (frameless || ret_reg != 0)) { /* Exit loop upon hitting a predicated instruction if - we already have the return register or if we are frameless. */ + we already have the return register or if we are frameless. */ if (trust_limit) lim_pc = pc; break; @@ -1490,11 +1490,11 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, last_prologue_pc = next_pc; } } - else if ((it == I || it == M) + else if ((it == I || it == M) && ((instr & 0x1ee00000000LL) == 0x10800000000LL)) { /* adds rN = imm14, rM (or mov rN, rM when imm14 is 0) */ - int imm = (int) ((((instr & 0x01000000000LL) ? -1 : 0) << 13) + int imm = (int) ((((instr & 0x01000000000LL) ? -1 : 0) << 13) | ((instr & 0x001f8000000LL) >> 20) | ((instr & 0x000000fe000LL) >> 13)); int rM = (int) ((instr & 0x00007f00000LL) >> 20); @@ -1513,11 +1513,11 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, mem_stack_frame_size -= imm; last_prologue_pc = next_pc; } - else if (qp == 0 && rN == 2 + else if (qp == 0 && rN == 2 && ((rM == fp_reg && fp_reg != 0) || rM == 12)) { CORE_ADDR saved_sp = 0; - /* adds r2, spilloffset, rFramePointer + /* adds r2, spilloffset, rFramePointer or adds r2, spilloffset, r12 @@ -1533,19 +1533,19 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, saved_sp = get_frame_register_unsigned (this_frame, sp_regnum); spill_addr = saved_sp - + (rM == 12 ? 0 : mem_stack_frame_size) + + (rM == 12 ? 0 : mem_stack_frame_size) + imm; spill_reg = rN; last_prologue_pc = next_pc; } - else if (qp == 0 && rM >= 32 && rM < 40 && !instores[rM-32] && + else if (qp == 0 && rM >= 32 && rM < 40 && !instores[rM-32] && rN < 256 && imm == 0) { /* mov rN, rM where rM is an input register. */ reg_contents[rN] = rM; last_prologue_pc = next_pc; } - else if (frameless && qp == 0 && rN == fp_reg && imm == 0 && + else if (frameless && qp == 0 && rN == fp_reg && imm == 0 && rM == 2) { /* mov r12, r2 */ @@ -1553,7 +1553,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, break; } } - else if (it == M + else if (it == M && ( ((instr & 0x1efc0000000LL) == 0x0eec0000000LL) || ((instr & 0x1ffc8000000LL) == 0x0cec0000000LL) )) { @@ -1580,8 +1580,8 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, else if ((it == M && ((instr & 0x1eff8000000LL) == 0x02110000000LL)) || (it == I && ((instr & 0x1eff8000000LL) == 0x00050000000LL)) ) { - /* mov.m rN = arM - or + /* mov.m rN = arM + or mov.i rN = arM */ int arM = (int) ((instr & 0x00007f00000LL) >> 20); @@ -1606,11 +1606,11 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, last_prologue_pc = next_pc; } } - else if (it == M + else if (it == M && ( ((instr & 0x1ffc8000000LL) == 0x08cc0000000LL) || ((instr & 0x1efc0000000LL) == 0x0acc0000000LL))) { - /* st8 [rN] = rM + /* st8 [rN] = rM or st8 [rN] = rM, imm9 */ int rN = (int) ((instr & 0x00007f00000LL) >> 20); @@ -1649,7 +1649,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, instores[rM-32] = 1; last_prologue_pc = next_pc; } - else if (qp == 0 && 32 <= indirect && indirect < 40 && + else if (qp == 0 && 32 <= indirect && indirect < 40 && !instores[indirect-32]) { /* Allow an indirect store of an input register. */ @@ -1665,7 +1665,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, st4 [rN] = rM st8 [rN] = rM Note that the st8 case is handled in the clause above. - + Advance over stores of input registers. One store per input register is permitted. */ int rM = (int) ((instr & 0x000000fe000LL) >> 13); @@ -1676,7 +1676,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, instores[rM-32] = 1; last_prologue_pc = next_pc; } - else if (qp == 0 && 32 <= indirect && indirect < 40 && + else if (qp == 0 && 32 <= indirect && indirect < 40 && !instores[indirect-32]) { /* Allow an indirect store of an input register. */ @@ -1749,7 +1749,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, /* Find the bof (beginning of frame). */ bof = rse_address_add (cache->bsp, -sof); - + for (i = 0, addr = bof; i < sof; i++, addr += 8) @@ -1780,7 +1780,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, cfm = extract_unsigned_integer (buf, 8, byte_order); } cache->prev_cfm = cfm; - + if (cfm != 0) { sor = ((cfm >> 14) & 0xf) * 8; @@ -1792,7 +1792,7 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, locals) due to the overlap between output and input of subsequent frames. */ bof = rse_address_add (bof, -sol); - + for (i = 0, addr = bof; i < sof; i++, addr += 8) @@ -1803,15 +1803,15 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, } if (i < sor) cache->saved_regs[IA64_GR32_REGNUM - + ((i + (sor - rrb_gr)) % sor)] + + ((i + (sor - rrb_gr)) % sor)] = addr; else cache->saved_regs[IA64_GR32_REGNUM + i] = addr; } - + } } - + /* Try and trust the lim_pc value whenever possible. */ if (trust_limit && lim_pc >= last_prologue_pc) last_prologue_pc = lim_pc; @@ -1864,7 +1864,7 @@ ia64_frame_cache (const frame_info_ptr &this_frame, void **this_cache) by subtracting frame size. */ get_frame_register (this_frame, IA64_BSP_REGNUM, buf); cache->bsp = extract_unsigned_integer (buf, 8, byte_order); - + get_frame_register (this_frame, IA64_PSR_REGNUM, buf); get_frame_register (this_frame, IA64_CFM_REGNUM, buf); @@ -1880,7 +1880,7 @@ ia64_frame_cache (const frame_info_ptr &this_frame, void **this_cache) if (cache->pc != 0) examine_prologue (cache->pc, get_frame_pc (this_frame), this_frame, cache); - + cache->base = cache->saved_sp + cache->mem_stack_frame_size; return cache; @@ -1950,7 +1950,7 @@ ia64_frame_prev_register (const frame_info_ptr &this_frame, void **this_cache, else if (regnum == IA64_CFM_REGNUM) { CORE_ADDR addr = cache->saved_regs[IA64_CFM_REGNUM]; - + if (addr != 0) return frame_unwind_got_memory (this_frame, regnum, addr); @@ -1976,7 +1976,7 @@ ia64_frame_prev_register (const frame_info_ptr &this_frame, void **this_cache, { struct value *pr_val; ULONGEST prN; - + pr_val = ia64_frame_prev_register (this_frame, this_cache, IA64_PR_REGNUM); if (VP16_REGNUM <= regnum && regnum <= VP63_REGNUM) @@ -2132,7 +2132,7 @@ ia64_frame_prev_register (const frame_info_ptr &this_frame, void **this_cache, addr = rse_address_add (prev_bof, (regnum - IA64_GR32_REGNUM)); return frame_unwind_got_memory (this_frame, regnum, addr); } - + return frame_unwind_got_constant (this_frame, regnum, 0); } @@ -2157,11 +2157,11 @@ ia64_frame_prev_register (const frame_info_ptr &this_frame, void **this_cache, if (addr != 0) return frame_unwind_got_memory (this_frame, regnum, addr); /* Otherwise, punt and get the current value of the register. */ - else + else return frame_unwind_got_register (this_frame, regnum, regnum); } } - + static const struct frame_unwind_legacy ia64_frame_unwind ( "ia64 prologue", NORMAL_FRAME, @@ -2406,7 +2406,7 @@ ia64_rse_skip_regs (uint64_t addr, long num_regs) delta -= 0x3e; return addr + ((num_regs + delta/0x3f) << 3); } - + /* Gdb ia64-libunwind-tdep callback function to convert from an ia64 gdb register number to a libunwind register number. */ static int @@ -2439,7 +2439,7 @@ ia64_gdb2uw_regnum (int regnum) else return -1; } - + /* Gdb ia64-libunwind-tdep callback function to convert from a libunwind register number to a ia64 gdb register number. */ static int @@ -2481,7 +2481,7 @@ ia64_is_fpreg (int uw_regnum) /* Libunwind callback accessor function for general registers. */ static int -ia64_access_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_word_t *val, +ia64_access_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_word_t *val, int write, void *arg) { int regnum = ia64_uw2gdb_regnum (uw_regnum); @@ -2489,7 +2489,7 @@ ia64_access_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_word_t *val, struct frame_info *this_frame = (frame_info *) arg; struct gdbarch *gdbarch = get_frame_arch (this_frame); ia64_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - + /* We never call any libunwind routines that need to write registers. */ gdb_assert (!write); @@ -2502,7 +2502,7 @@ ia64_access_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_word_t *val, psr = get_frame_register_unsigned (this_frame, IA64_PSR_REGNUM); *val = ip | ((psr >> 41) & 0x3); break; - + case UNW_IA64_AR_BSP: /* Libunwind expects to see the beginning of the current register frame so we must account for the fact that @@ -2525,12 +2525,12 @@ ia64_access_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_word_t *val, *val = get_frame_register_unsigned (this_frame, regnum); break; } - + if (gdbarch_debug >= 1) - gdb_printf (gdb_stdlog, + gdb_printf (gdb_stdlog, " access_reg: from cache: %4s=%s\n", (((unsigned) regnum <= IA64_NAT127_REGNUM) - ? ia64_register_names[regnum] : "r??"), + ? ia64_register_names[regnum] : "r??"), paddress (gdbarch, *val)); return 0; } @@ -2542,7 +2542,7 @@ ia64_access_fpreg (unw_addr_space_t as, unw_regnum_t uw_regnum, { int regnum = ia64_uw2gdb_regnum (uw_regnum); frame_info_ptr this_frame = (const frame_info_ptr &) arg; - + /* We never call any libunwind routines that need to write registers. */ gdb_assert (!write); @@ -2560,7 +2560,7 @@ ia64_access_rse_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, unw_word_t bsp, sof, cfm, psr, ip; struct regcache *regcache = (struct regcache *) arg; struct gdbarch *gdbarch = regcache->arch (); - + /* We never call any libunwind routines that need to write registers. */ gdb_assert (!write); @@ -2573,7 +2573,7 @@ ia64_access_rse_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, regcache_cooked_read_unsigned (regcache, IA64_PSR_REGNUM, &psr); *val = ip | ((psr >> 41) & 0x3); break; - + case UNW_IA64_AR_BSP: /* Libunwind expects to see the beginning of the current register frame so we must account for the fact that @@ -2584,7 +2584,7 @@ ia64_access_rse_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, sof = (cfm & 0x7f); *val = ia64_rse_skip_regs (bsp, -sof); break; - + case UNW_IA64_AR_BSPSTORE: /* Libunwind wants bspstore to be after the current register frame. This is what ptrace() and gdb treats as the regular bsp value. */ @@ -2596,12 +2596,12 @@ ia64_access_rse_reg (unw_addr_space_t as, unw_regnum_t uw_regnum, regcache_cooked_read_unsigned (regcache, regnum, val); break; } - + if (gdbarch_debug >= 1) - gdb_printf (gdb_stdlog, + gdb_printf (gdb_stdlog, " access_rse_reg: from cache: %4s=%s\n", (((unsigned) regnum <= IA64_NAT127_REGNUM) - ? ia64_register_names[regnum] : "r??"), + ? ia64_register_names[regnum] : "r??"), paddress (gdbarch, *val)); return 0; @@ -2614,7 +2614,7 @@ ia64_access_rse_fpreg (unw_addr_space_t as, unw_regnum_t uw_regnum, { int regnum = ia64_uw2gdb_regnum (uw_regnum); struct regcache *regcache = (struct regcache *) arg; - + /* We never call any libunwind routines that need to write registers. */ gdb_assert (!write); @@ -2633,10 +2633,10 @@ ia64_access_mem (unw_addr_space_t as, { unw_word_t *laddr = (unw_word_t*) ((char *) ktab + (addr - KERNEL_START)); - + if (write) - *laddr = *val; - else + *laddr = *val; + else *val = *laddr; return 0; } @@ -2664,13 +2664,13 @@ getunwind_table () TARGET_OBJECT_UNWIND_TABLE, NULL); } -/* Get the kernel unwind table. */ +/* Get the kernel unwind table. */ static int get_kernel_table (unw_word_t ip, unw_dyn_info_t *di) { static struct ia64_table_entry *etab; - if (!ktab) + if (!ktab) { ktab_buf = getunwind_table (); if (!ktab_buf) @@ -2682,10 +2682,10 @@ get_kernel_table (unw_word_t ip, unw_dyn_info_t *di) for (etab = ktab; etab->start_offset; ++etab) etab->info_offset += KERNEL_START; } - + if (ip < ktab[0].start_offset || ip >= etab[-1].end_offset) return -UNW_ENOINFO; - + di->format = UNW_INFO_FORMAT_TABLE; di->gp = 0; di->start_ip = ktab[0].start_offset; @@ -2694,13 +2694,13 @@ get_kernel_table (unw_word_t ip, unw_dyn_info_t *di) di->u.ti.segbase = 0; di->u.ti.table_len = ((char *) etab - (char *) ktab) / sizeof (unw_word_t); di->u.ti.table_data = (unw_word_t *) ktab; - + if (gdbarch_debug >= 1) gdb_printf (gdb_stdlog, "get_kernel_table: found table `%s': " "segbase=%s, length=%s, gp=%s\n", - (char *) di->u.ti.name_ptr, + (char *) di->u.ti.name_ptr, hex_string (di->u.ti.segbase), - pulongest (di->u.ti.table_len), + pulongest (di->u.ti.table_len), hex_string (di->gp)); return 0; } @@ -2718,7 +2718,7 @@ ia64_find_unwind_table (struct objfile *objfile, unw_word_t ip, int i; bfd = objfile->obfd; - + ehdr = elf_tdata (bfd)->elf_header; phdr = elf_tdata (bfd)->phdr; @@ -2749,7 +2749,7 @@ ia64_find_unwind_table (struct objfile *objfile, unw_word_t ip, /* Verify that the segment that contains the IP also contains the static unwind table. If not, we may be in the Linux kernel's DSO gate page in which case the unwind table is another segment. - Otherwise, we are dealing with runtime-generated code, for which we + Otherwise, we are dealing with runtime-generated code, for which we have no info here. */ segbase = p_text->p_vaddr + load_base; @@ -2809,7 +2809,7 @@ ia64_find_proc_info_x (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi, hex_string (di.u.ti.segbase), hex_string (di.start_ip), hex_string (di.end_ip), hex_string (di.gp), - pulongest (di.u.ti.table_len), + pulongest (di.u.ti.table_len), hex_string ((CORE_ADDR)di.u.ti.table_data)); } else @@ -2826,7 +2826,7 @@ ia64_find_proc_info_x (unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi, hex_string (di.u.rti.segbase), hex_string (di.start_ip), hex_string (di.end_ip), hex_string (di.gp), - pulongest (di.u.rti.table_len), + pulongest (di.u.rti.table_len), hex_string (di.u.rti.table_data)); } @@ -2847,8 +2847,8 @@ ia64_put_unwind_info (unw_addr_space_t as, /* Nothing required for now. */ } -/* Libunwind callback accessor function to get head of the dynamic - unwind-info registration list. */ +/* Libunwind callback accessor function to get head of the dynamic + unwind-info registration list. */ static int ia64_get_dyn_info_list (unw_addr_space_t as, unw_word_t *dilap, void *arg) @@ -2910,7 +2910,7 @@ ia64_libunwind_frame_this_id (const frame_info_ptr &this_frame, void **this_cach return; } - /* We must add the bsp as the special address for frame comparison + /* We must add the bsp as the special address for frame comparison purposes. */ get_frame_register (this_frame, IA64_BSP_REGNUM, buf); bsp = extract_unsigned_integer (buf, 8, byte_order); @@ -2957,7 +2957,7 @@ ia64_libunwind_frame_prev_register (const frame_info_ptr &this_frame, marker for this frame. */ cfm = get_frame_register_unsigned (this_frame, IA64_CFM_REGNUM); rrb_pr = (cfm >> 32) & 0x3f; - + /* Adjust the register number to account for register rotation. */ regnum = VP16_REGNUM + ((regnum - VP16_REGNUM) + rrb_pr) % 48; } @@ -3041,7 +3041,7 @@ ia64_libunwind_sigtramp_frame_this_id (const frame_info_ptr &this_frame, return; } - /* We must add the bsp as the special address for frame comparison + /* We must add the bsp as the special address for frame comparison purposes. */ get_frame_register (this_frame, IA64_BSP_REGNUM, buf); bsp = extract_unsigned_integer (buf, 8, byte_order); @@ -3144,9 +3144,9 @@ unw_accessors_t ia64_unw_rse_accessors = ia64-libunwind-tdep code to use. */ struct libunwind_descr ia64_libunwind_descr = { - ia64_gdb2uw_regnum, - ia64_uw2gdb_regnum, - ia64_is_fpreg, + ia64_gdb2uw_regnum, + ia64_uw2gdb_regnum, + ia64_is_fpreg, &ia64_unw_accessors, &ia64_unw_rse_accessors, }; @@ -3254,7 +3254,7 @@ ia64_extract_return_value (struct type *type, struct regcache *regcache, } static void -ia64_store_return_value (struct type *type, struct regcache *regcache, +ia64_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { struct gdbarch *gdbarch = regcache->arch (); @@ -3302,7 +3302,7 @@ ia64_store_return_value (struct type *type, struct regcache *regcache, } } } - + static enum return_value_convention ia64_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, @@ -3428,7 +3428,7 @@ ia64_find_global_pointer_from_dynamic_section (struct gdbarch *gdbarch, { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); struct obj_section *faddr_sect; - + faddr_sect = find_pc_section (faddr); if (faddr_sect != NULL) { @@ -3577,7 +3577,7 @@ find_func_descr (struct regcache *regcache, CORE_ADDR faddr, CORE_ADDR *fdaptr) write_memory (fdesc, buf, 16); } - return fdesc; + return fdesc; } /* Use the following routine when printing out function pointers @@ -3715,7 +3715,7 @@ ia64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Allocate a new RSE frame. */ regcache_cooked_read_unsigned (regcache, IA64_BSP_REGNUM, &bsp); tdep->infcall_ops.allocate_new_rse_frame (regcache, bsp, rseslots); - + /* We will attempt to find function descriptors in the .opd segment, but if we can't we'll construct them ourselves. That being the case, we'll need to reserve space on the stack for them. */ @@ -3883,7 +3883,7 @@ ia64_dummy_id (struct gdbarch *gdbarch, const frame_info_ptr &this_frame) return frame_id_build_special (sp, get_frame_pc (this_frame), bsp); } -static CORE_ADDR +static CORE_ADDR ia64_unwind_pc (struct gdbarch *gdbarch, const frame_info_ptr &next_frame) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -3894,7 +3894,7 @@ ia64_unwind_pc (struct gdbarch *gdbarch, const frame_info_ptr &next_frame) ip = extract_unsigned_integer (buf, 8, byte_order); frame_unwind_register (next_frame, IA64_PSR_REGNUM, buf); psr = extract_unsigned_integer (buf, 8, byte_order); - + pc = (ip & ~0xf) | ((psr >> 41) & 3); return pc; } diff --git a/gdb/infcall.c b/gdb/infcall.c index 3b7542cf70c..67053ae0f08 100644 --- a/gdb/infcall.c +++ b/gdb/infcall.c @@ -1141,7 +1141,7 @@ call_function_by_hand_dummy (struct value *function, /* Still aligned? */ gdb_assert (sp == gdbarch_frame_align (gdbarch, sp)); /* NOTE: cagney/2002-09-18: - + On a RISC architecture, a void parameterless generic dummy frame (i.e., no parameters, no result) typically does not need to push anything the stack and hence can leave SP and diff --git a/gdb/infcall.h b/gdb/infcall.h index 3b02f45e270..1c789835d6a 100644 --- a/gdb/infcall.h +++ b/gdb/infcall.h @@ -32,7 +32,7 @@ struct type; type, and *RETVAL_TYPE to the target function's return type. Calls error() if the function is not valid for calling. */ -extern CORE_ADDR find_function_addr (struct value *function, +extern CORE_ADDR find_function_addr (struct value *function, struct type **retval_type, struct type **function_type = NULL); diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 4e9bdda5a6d..08cd2514d3e 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -221,7 +221,7 @@ strip_bg_char (const char *args, int *bg_char_p) void post_create_inferior (int from_tty, bool set_pspace_solib_ops) { - /* Be sure we own the terminal in case write operations are performed. */ + /* Be sure we own the terminal in case write operations are performed. */ target_terminal::ours_for_output (); infrun_debug_show_threads ("threads in the newly created inferior", @@ -527,7 +527,7 @@ static void starti_command (const char *args, int from_tty) { run_command_1 (args, from_tty, RUN_STOP_AT_FIRST_INSN); -} +} static bool proceed_thread_callback (struct thread_info *thread) @@ -2047,7 +2047,7 @@ set_environment_command (const char *arg, int from_tty) if (p != 0 && val != 0) { /* We have both a space and an equals. If the space is before the - equals, walk forward over the spaces til we see a nonspace + equals, walk forward over the spaces til we see a nonspace (possibly the equals). */ if (p > val) while (*val == ' ') diff --git a/gdb/inferior.c b/gdb/inferior.c index 77626be4ab7..8131f23b938 100644 --- a/gdb/inferior.c +++ b/gdb/inferior.c @@ -839,7 +839,7 @@ remove_inferior_command (const char *args, int from_tty) warning (_("Can not remove current inferior %d."), num); continue; } - + if (inf->pid != 0) { warning (_("Can not remove active inferior %d."), num); diff --git a/gdb/infrun.c b/gdb/infrun.c index 84c1545f06b..824479dd75a 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4939,7 +4939,7 @@ adjust_pc_after_break (struct thread_info *thread, generates these signals at breakpoints (the code has been in GDB since at least 1992) so I can not guess how to handle them here. - In earlier versions of GDB, a target with + In earlier versions of GDB, a target with gdbarch_have_nonsteppable_watchpoint would have the PC after hitting a watchpoint affected by gdbarch_decr_pc_after_break. I haven't found any target with both of these set in GDB history, and it seems unlikely to be @@ -5038,7 +5038,7 @@ adjust_pc_after_break (struct thread_info *thread, differentiate between the two, as the latter needs adjusting but the former does not. - The SIGTRAP can be due to a completed hardware single-step only if + The SIGTRAP can be due to a completed hardware single-step only if - we didn't insert software single-step breakpoints - this thread is currently being stepped @@ -7110,8 +7110,8 @@ handle_signal_stop (struct execution_control_state *ecs) /* The user issued a step when stopped at a breakpoint. Maybe we should stop, maybe we should not - the delay slot *might* correspond to a line of source. In any - case, don't decide that here, just set - ecs->stepping_over_breakpoint, making sure we + case, don't decide that here, just set + ecs->stepping_over_breakpoint, making sure we single-step again before breakpoints are re-inserted. */ ecs->event_thread->stepping_over_breakpoint = 1; } @@ -7892,7 +7892,7 @@ process_event_stop_test (struct execution_control_state *ecs) { /* Any solib trampoline code can be handled in reverse by simply continuing to single-step. We have already - executed the solib function (backwards), and a few + executed the solib function (backwards), and a few steps will take us back through the trampoline to the caller. */ keep_going (ecs); @@ -8033,7 +8033,7 @@ process_event_stop_test (struct execution_control_state *ecs) { /* Any solib trampoline code can be handled in reverse by simply continuing to single-step. We have already - executed the solib function (backwards), and a few + executed the solib function (backwards), and a few steps will take us back through the trampoline to the caller. */ keep_going (ecs); @@ -8047,7 +8047,7 @@ process_event_stop_test (struct execution_control_state *ecs) symtab_and_line sr_sal; sr_sal.pc = ecs->stop_func_start; sr_sal.pspace = get_frame_program_space (frame); - insert_step_resume_breakpoint_at_sal (gdbarch, + insert_step_resume_breakpoint_at_sal (gdbarch, sr_sal, null_frame_id); keep_going (ecs); return; @@ -8061,7 +8061,7 @@ process_event_stop_test (struct execution_control_state *ecs) stop_pc_sal = find_sal_for_pc (ecs->event_thread->stop_pc (), 0); /* NOTE: tausq/2004-05-24: This if block used to be done before all - the trampoline processing logic, however, there are some trampolines + the trampoline processing logic, however, there are some trampolines that have no names, so we should do trampoline handling first. */ if (ecs->event_thread->control.step_over_calls == STEP_OVER_UNDEBUGGABLE && ecs->stop_func_name == nullptr @@ -8992,12 +8992,12 @@ check_exception_resume (struct execution_control_state *ecs, /* The exception breakpoint is a thread-specific breakpoint on the unwinder's debug hook, declared as: - + void _Unwind_DebugHook (void *cfa, void *handler); - + The CFA argument indicates the frame to which control is about to be transferred. HANDLER is the destination PC. - + We ignore the CFA and set a temporary breakpoint at HANDLER. This is not extremely efficient but it avoids issues in gdb with computing the DWARF CFA, and it also works even in weird @@ -10773,7 +10773,7 @@ By default, the debugger will use the same inferior."), show_follow_exec_mode_string, &setlist, &showlist); - add_setshow_enum_cmd ("scheduler-locking", class_run, + add_setshow_enum_cmd ("scheduler-locking", class_run, scheduler_enums, &scheduler_mode, _("\ Set mode for locking scheduler during execution."), _("\ Show mode for locking scheduler during execution."), _("\ diff --git a/gdb/interps.c b/gdb/interps.c index b4de3c79a94..b4f564a046a 100644 --- a/gdb/interps.c +++ b/gdb/interps.c @@ -254,7 +254,7 @@ command_interp (void) return current_ui->current_interpreter; } -/* interp_exec - This executes COMMAND_STR in the current +/* interp_exec - This executes COMMAND_STR in the current interpreter. */ void diff --git a/gdb/interps.h b/gdb/interps.h index c74495bce18..f048bf59a52 100644 --- a/gdb/interps.h +++ b/gdb/interps.h @@ -360,7 +360,7 @@ extern void interps_notify_traceframe_changed (int tfnum, int tpnum); extern void interps_notify_tsv_created (const trace_state_variable *tsv); /* Notify all interpreters that trace state variable TSV was deleted. - + If TSV is nullptr, it means that all trace state variables were deleted. */ extern void interps_notify_tsv_deleted (const trace_state_variable *tsv); diff --git a/gdb/iq2000-tdep.c b/gdb/iq2000-tdep.c index 782f8b729c8..1912e9ba7b0 100644 --- a/gdb/iq2000-tdep.c +++ b/gdb/iq2000-tdep.c @@ -35,15 +35,15 @@ enum gdb_regnum { - E_R0_REGNUM, E_R1_REGNUM, E_R2_REGNUM, E_R3_REGNUM, - E_R4_REGNUM, E_R5_REGNUM, E_R6_REGNUM, E_R7_REGNUM, - E_R8_REGNUM, E_R9_REGNUM, E_R10_REGNUM, E_R11_REGNUM, - E_R12_REGNUM, E_R13_REGNUM, E_R14_REGNUM, E_R15_REGNUM, - E_R16_REGNUM, E_R17_REGNUM, E_R18_REGNUM, E_R19_REGNUM, - E_R20_REGNUM, E_R21_REGNUM, E_R22_REGNUM, E_R23_REGNUM, - E_R24_REGNUM, E_R25_REGNUM, E_R26_REGNUM, E_R27_REGNUM, - E_R28_REGNUM, E_R29_REGNUM, E_R30_REGNUM, E_R31_REGNUM, - E_PC_REGNUM, + E_R0_REGNUM, E_R1_REGNUM, E_R2_REGNUM, E_R3_REGNUM, + E_R4_REGNUM, E_R5_REGNUM, E_R6_REGNUM, E_R7_REGNUM, + E_R8_REGNUM, E_R9_REGNUM, E_R10_REGNUM, E_R11_REGNUM, + E_R12_REGNUM, E_R13_REGNUM, E_R14_REGNUM, E_R15_REGNUM, + E_R16_REGNUM, E_R17_REGNUM, E_R18_REGNUM, E_R19_REGNUM, + E_R20_REGNUM, E_R21_REGNUM, E_R22_REGNUM, E_R23_REGNUM, + E_R24_REGNUM, E_R25_REGNUM, E_R26_REGNUM, E_R27_REGNUM, + E_R28_REGNUM, E_R29_REGNUM, E_R30_REGNUM, E_R31_REGNUM, + E_PC_REGNUM, E_LR_REGNUM = E_R31_REGNUM, /* Link register. */ E_SP_REGNUM = E_R29_REGNUM, /* Stack pointer. */ E_FP_REGNUM = E_R27_REGNUM, /* Frame pointer. */ @@ -142,7 +142,7 @@ iq2000_register_name (struct gdbarch *gdbarch, int regnum) /* Prologue analysis methods: */ /* ADDIU insn (001001 rs(5) rt(5) imm(16)). */ -#define INSN_IS_ADDIU(X) (((X) & 0xfc000000) == 0x24000000) +#define INSN_IS_ADDIU(X) (((X) & 0xfc000000) == 0x24000000) #define ADDIU_REG_SRC(X) (((X) & 0x03e00000) >> 21) #define ADDIU_REG_TGT(X) (((X) & 0x001f0000) >> 16) #define ADDIU_IMMEDIATE(X) ((signed short) ((X) & 0x0000ffff)) @@ -161,7 +161,7 @@ iq2000_register_name (struct gdbarch *gdbarch, int regnum) /* Function: find_last_line_symbol Given an address range, first find a line symbol corresponding to - the starting address. Then find the last line symbol within the + the starting address. Then find the last line symbol within the range that has a line number less than or equal to the first line. For optimized code with code motion, this finds the last address @@ -224,10 +224,10 @@ iq2000_scan_prologue (struct gdbarch *gdbarch, } /* Saved registers: - We first have to save the saved register's offset, and + We first have to save the saved register's offset, and only later do we compute its actual address. Since the - offset can be zero, we must first initialize all the - saved regs to minus one (so we can later distinguish + offset can be zero, we must first initialize all the + saved regs to minus one (so we can later distinguish between one that's not saved, and one that's saved at zero). */ for (srcreg = 0; srcreg < E_NUM_REGS; srcreg ++) cache->saved_regs[srcreg] = -1; @@ -323,11 +323,11 @@ iq2000_init_frame_cache (struct iq2000_frame_cache *cache) } /* Function: iq2000_skip_prologue - If the input address is in a function prologue, + If the input address is in a function prologue, returns the address of the end of the prologue; else returns the input address. - Note: the input address is likely to be the function start, + Note: the input address is likely to be the function start, since this function is mainly used for advancing a breakpoint to the first line, or stepping to the first line when we have stepped into a function call. */ @@ -418,7 +418,7 @@ iq2000_frame_this_id (const frame_info_ptr &this_frame, void **this_cache, this_cache); /* This marks the outermost frame. */ - if (cache->base == 0) + if (cache->base == 0) return; *this_id = frame_id_build (cache->saved_sp, cache->pc); @@ -443,11 +443,11 @@ iq2000_frame_base_address (const frame_info_ptr &this_frame, void **this_cache) return cache->base; } - + static const struct frame_base iq2000_frame_base = { &iq2000_frame_unwind, iq2000_frame_base_address, - iq2000_frame_base_address, + iq2000_frame_base_address, iq2000_frame_base_address }; @@ -475,7 +475,7 @@ iq2000_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size) /* Target function return value methods: */ /* Function: store_return_value - Copy the function return value from VALBUF into the + Copy the function return value from VALBUF into the proper location for a function return. */ static void @@ -498,7 +498,7 @@ iq2000_store_return_value (struct type *type, struct regcache *regcache, } } -/* Function: use_struct_convention +/* Function: use_struct_convention Returns non-zero if the given struct type will be returned using a special convention, rather than the normal function return method. */ @@ -511,7 +511,7 @@ iq2000_use_struct_convention (struct type *type) } /* Function: extract_return_value - Copy the function's return value into VALBUF. + Copy the function's return value into VALBUF. This function is called only in the context of "target function calls", ie. when the debugger forces a function to be called in the child, and when the debugger forces a function to return prematurely via the @@ -525,7 +525,7 @@ iq2000_extract_return_value (struct type *type, struct regcache *regcache, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); /* If the function's return value is 8 bytes or less, it is - returned in a register, and if larger than 8 bytes, it is + returned in a register, and if larger than 8 bytes, it is returned in a stack location which is pointed to by the same register. */ int len = type->length (); @@ -534,7 +534,7 @@ iq2000_extract_return_value (struct type *type, struct regcache *regcache, { int regno = E_FN_RETURN_REGNUM; - /* Return values of <= 8 bytes are returned in + /* Return values of <= 8 bytes are returned in FN_RETURN_REGNUM. */ while (len > 0) { @@ -648,7 +648,7 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, typelen = type->length (); if (typelen <= 4) { - /* Scalars of up to 4 bytes, + /* Scalars of up to 4 bytes, structs of up to 4 bytes, and pointers. */ if (argreg <= E_LAST_ARGREG) @@ -658,7 +658,7 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } else if (typelen == 8 && !iq2000_pass_8bytetype_by_address (type)) { - /* long long, + /* long long, double, and possibly structs with a single field of long long or double. */ if (argreg <= E_LAST_ARGREG - 1) @@ -733,7 +733,7 @@ iq2000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } else if (typelen == 8 && !iq2000_pass_8bytetype_by_address (type)) { - /* (long long), (double), or struct consisting of + /* (long long), (double), or struct consisting of a single (long long) or (double). */ if (argreg <= E_LAST_ARGREG - 1) { diff --git a/gdb/language.c b/gdb/language.c index c070169e7b2..168b9381bee 100644 --- a/gdb/language.c +++ b/gdb/language.c @@ -573,7 +573,7 @@ add_set_language_command () any non-NULL struct language_defn.skip_trampoline() functions. Return the result from the first that returns non-zero, or 0 if all `fail'. */ -CORE_ADDR +CORE_ADDR skip_language_trampoline (const frame_info_ptr &frame, CORE_ADDR pc) { for (const auto &lang : language_defn::languages) diff --git a/gdb/language.h b/gdb/language.h index 9e9e7f04586..196dd05bb1d 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -59,7 +59,7 @@ range_check; extern enum array_ordering { array_row_major, array_column_major - } + } array_ordering; @@ -703,7 +703,7 @@ extern const char lang_frame_mismatch_warn[]; extern bool warn_frame_lang_mismatch; -/* language_mode == +/* language_mode == language_mode_auto: current_language automatically set upon selection of scope (e.g. stack frame) language_mode_manual: current_language set only by user. */ @@ -756,7 +756,7 @@ struct symbol * const char *name); -/* These macros define the behavior of the expression +/* These macros define the behavior of the expression evaluator. */ /* Should we range check values against the domain of their type? */ diff --git a/gdb/linespec.c b/gdb/linespec.c index 703af9ccdb9..459f1371de2 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1445,7 +1445,7 @@ decode_line_2 (struct linespec_state *self, if (select_mode == multiple_symbols_cancel && items.size () > 1) error (_("canceled because the command is ambiguous\n" "See set/show multiple-symbol.")); - + if (select_mode == multiple_symbols_all || items.size () == 1) { convert_results_to_lsals (self, result); @@ -1556,7 +1556,7 @@ symbol_not_found_error (const char *symbol, const char *filename) } } -/* Throw an appropriate error when an unexpected token is encountered +/* Throw an appropriate error when an unexpected token is encountered in the input. */ [[noreturn]] static void diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c index af081fca7f7..0c24e10c2c9 100644 --- a/gdb/linux-nat.c +++ b/gdb/linux-nat.c @@ -150,7 +150,7 @@ not when it is delivered. SIGCONT resumes the entire thread group and SIGKILL kills the entire thread group. A delivered SIGSTOP would stop the entire thread group, not just the thread we -tkill'd. But we never let the SIGSTOP be delivered; we always intercept and +tkill'd. But we never let the SIGSTOP be delivered; we always intercept and cancel it (by PTRACE_CONT without passing SIGSTOP). We could use a real-time signal instead. This would solve those problems; we @@ -4383,7 +4383,7 @@ linux_nat_target::can_async_p () { /* This flag should be checked in the common target.c code. */ gdb_assert (target_async_permitted); - + /* Otherwise, this targets is always able to support async mode. */ return true; } diff --git a/gdb/linux-record.h b/gdb/linux-record.h index 86cfd1856d9..51d272cc69e 100644 --- a/gdb/linux-record.h +++ b/gdb/linux-record.h @@ -547,7 +547,7 @@ enum gdb_syscall { /* Record a linux syscall. */ -extern int record_linux_system_call (enum gdb_syscall num, +extern int record_linux_system_call (enum gdb_syscall num, struct regcache *regcache, struct linux_record_tdep *tdep); diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index 77557d53fde..6e9135f576e 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -651,7 +651,7 @@ mapping_is_anonymous_p (const char *filename) be anonymous. Otherwise, GDB considers this mapping to be a file-backed mapping (because there will be a file associated with it). - + It is worth mentioning that, from all those checks described above, the most fragile is the one to see if the file name ends with " (deleted)". This does not necessarily mean that the @@ -665,7 +665,7 @@ mapping_is_anonymous_p (const char *filename) that if the file name ends with " (deleted)", then the mapping is indeed anonymous. FWIW, this is something the Linux kernel could do better: expose this information in a more direct way. - + - If we see the flag "sh" in the "VmFlags:" field (in /proc/PID/smaps), then certainly the memory mapping is shared (VM_SHARED). If we have access to the VmFlags, and we don't see @@ -1101,12 +1101,12 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, /* Implementation of `gdbarch_read_core_file_mappings', as defined in gdbarch.h. - + This function reads the NT_FILE note (which BFD turns into the section ".note.linuxcore.file"). The format of this note / section is described as follows in the Linux kernel sources in fs/binfmt_elf.c: - + long count -- how many files are mapped long page_size -- units for file_ofs array of [COUNT] elements of @@ -1114,14 +1114,14 @@ linux_info_proc (struct gdbarch *gdbarch, const char *args, long end long file_ofs followed by COUNT filenames in ASCII: "FILE1" NUL "FILE2" NUL... - + CBFD is the BFD of the core file. PRE_LOOP_CB is the callback function to invoke prior to starting the loop which processes individual entries. This callback will only be executed after the note has been examined in enough detail to verify that it's not malformed in some way. - + LOOP_CB is the callback function that will be executed once for each mapping. */ @@ -1737,7 +1737,7 @@ linux_make_mappings_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, pack_long (buf, long_type, 1); obstack_grow (&data_obstack, buf, long_type->length ()); - linux_find_memory_regions_full (gdbarch, + linux_find_memory_regions_full (gdbarch, dump_note_entry_p, linux_make_mappings_callback, &mapping_data); diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index f00e3b53375..e97eae0320f 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -516,7 +516,7 @@ thread_db_find_new_threads_silently (thread_info *stopped) where calls to td_thr_get_info fail with TD_ERR for statically linked executables if td_thr_get_info is called before glibc has initialized itself. - + If the nptl bug is NOT present in the inferior and still thread_db reports an error return 1. It means the inferior has corrupted thread list and GDB should fall back only to LWPs. diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c index cee2e517bc4..80411626621 100644 --- a/gdb/lm32-tdep.c +++ b/gdb/lm32-tdep.c @@ -121,7 +121,7 @@ lm32_analyze_prologue (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); unsigned long instruction; - /* Keep reading though instructions, until we come across an instruction + /* Keep reading though instructions, until we come across an instruction that isn't likely to be part of the prologue. */ info->size = 0; for (; pc < limit; pc += 4) @@ -134,7 +134,7 @@ lm32_analyze_prologue (struct gdbarch *gdbarch, && (LM32_REG0 (instruction) == SIM_LM32_SP_REGNUM)) { /* Any stack displaced store is likely part of the prologue. - Record that the register is being saved, and the offset + Record that the register is being saved, and the offset into the stack. */ info->saved_regs[LM32_REG1 (instruction)].set_addr (LM32_IMM16 (instruction)); } @@ -155,7 +155,7 @@ lm32_analyze_prologue (struct gdbarch *gdbarch, && (LM32_REG1 (instruction) == SIM_LM32_FP_REGNUM) && (LM32_REG0 (instruction) == SIM_LM32_R0_REGNUM))) { - /* Likely to be in the prologue for functions that require + /* Likely to be in the prologue for functions that require a frame pointer. */ } else @@ -169,7 +169,7 @@ lm32_analyze_prologue (struct gdbarch *gdbarch, return pc; } -/* Return PC of first non prologue instruction, for the function at the +/* Return PC of first non prologue instruction, for the function at the specified address. */ static CORE_ADDR @@ -210,7 +210,7 @@ constexpr gdb_byte lm32_break_insn[4] = { OP_RAISE << 2, 0, 0, 2 }; typedef BP_MANIPULATION (lm32_break_insn) lm32_breakpoint; -/* Setup registers and stack for faking a call to a function in the +/* Setup registers and stack for faking a call to a function in the inferior. */ static CORE_ADDR @@ -268,7 +268,7 @@ lm32_push_dummy_call (struct gdbarch *gdbarch, struct value *function, val = extract_unsigned_integer (contents, arg_type->length (), byte_order); - /* First num_arg_regs parameters are passed by registers, + /* First num_arg_regs parameters are passed by registers, and the rest are passed on the stack. */ if (i < num_arg_regs) regcache_cooked_write_unsigned (regcache, first_arg_reg + i, val); diff --git a/gdb/m2-lang.c b/gdb/m2-lang.c index 3533c6a94ce..a06dd489c71 100644 --- a/gdb/m2-lang.c +++ b/gdb/m2-lang.c @@ -86,7 +86,7 @@ eval_op_m2_subscript (struct type *expect_type, struct expression *exp, arg1 = value_struct_elt (&temp, {}, "_m2_contents", NULL, _("unbounded structure " "missing _m2_contents field")); - + if (arg1->type () != type) arg1 = value_cast (type, arg1); diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c index 12d3120b91f..73fb06334a4 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -578,7 +578,7 @@ m2_record_fields (struct type *type, struct ui_file *stream, int show, } gdb_printf (stream, ";\n"); } - + gdb_printf (stream, "%*sEND ", level, ""); } } diff --git a/gdb/m2-valprint.c b/gdb/m2-valprint.c index d7d1c739fce..11bdd5b4850 100644 --- a/gdb/m2-valprint.c +++ b/gdb/m2-valprint.c @@ -174,7 +174,7 @@ m2_print_unbounded_array (struct value *value, addr); len = unpack_field_as_long (type, valaddr, 1); - gdb_printf (stream, "{"); + gdb_printf (stream, "{"); m2_print_array_contents (val, stream, recurse, options, len); gdb_printf (stream, ", HIGH = %d}", (int) len); } @@ -216,7 +216,7 @@ print_unpacked_pointer (struct type *type, return val_print_string (type->target_type (), NULL, addr, -1, stream, options); } - + return 0; } @@ -234,7 +234,7 @@ print_variable_at_address (struct type *type, gdb_printf (stream, "["); gdb_puts (paddress (gdbarch, addr), stream); gdb_printf (stream, "] : "); - + if (elttype->code () != TYPE_CODE_UNDEF) { struct value *deref_val = diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index 8d99839ad0b..0b26e407fc6 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -1438,8 +1438,8 @@ m32c_is_arg_reg (struct m32c_pv_state *state, pv_t value) relative to the original value of the SP). */ static int -m32c_is_arg_spill (struct m32c_pv_state *st, - struct srcdest loc, +m32c_is_arg_spill (struct m32c_pv_state *st, + struct srcdest loc, pv_t value) { gdbarch *arch = st->arch; @@ -1451,10 +1451,10 @@ m32c_is_arg_spill (struct m32c_pv_state *st, && ! st->stack->find_reg (st->arch, value.reg, 0)); } -/* Return non-zero if a store of VALUE to LOC is probably +/* Return non-zero if a store of VALUE to LOC is probably copying the struct return address into an address register for immediate use. This is basically a "spill" into the - address register, instead of onto the stack. + address register, instead of onto the stack. The prerequisites are: - value being stored is original value of the FIRST arg register; @@ -1463,7 +1463,7 @@ m32c_is_arg_spill (struct m32c_pv_state *st, static int m32c_is_struct_return (struct m32c_pv_state *st, - struct srcdest loc, + struct srcdest loc, pv_t value) { gdbarch *arch = st->arch; @@ -2453,11 +2453,11 @@ m32c_m16c_address_to_pointer (struct gdbarch *gdbarch, below, this value might be useful if converted back into an address by GDB, but will otherwise, almost certainly, be garbage. - + Using this masked result does seem to be useful in gdb.cp/cplusfuncs.exp in which ~40 FAILs turn into PASSes. These results appear to be correct as well. - + We print a warning here so that the user can make a determination about whether the result is useful or not. */ ptrval = addr & 0xffff; @@ -2537,7 +2537,7 @@ m32c_m16c_pointer_to_address (struct gdbarch *gdbarch, for (aspace = 1; aspace <= 15; aspace++) { ptr_msym = lookup_minimal_symbol_by_pc ((aspace << 16) | ptr); - + if (ptr_msym.minsym) ptr |= aspace << 16; } @@ -2558,7 +2558,7 @@ m32c_virtual_frame_pointer (struct gdbarch *gdbarch, CORE_ADDR pc, regcache *regcache = get_thread_regcache (inferior_thread ()); m32c_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - + if (!find_pc_partial_function (pc, &name, &func_addr, &func_end)) internal_error (_("No virtual frame pointer available")); @@ -2624,7 +2624,7 @@ m32c_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) #if 0 /* I'm dropping the dwarf2 sniffer because it has a few problems. They may be in the dwarf2 cfi code in GDB, or they may be in - the debug info emitted by the upstream toolchain. I don't + the debug info emitted by the upstream toolchain. I don't know which, but I do know that the prologue analyzer works better. MVS 04/13/06 */ dwarf2_append_sniffers (gdbarch); diff --git a/gdb/m32r-tdep.c b/gdb/m32r-tdep.c index ae233a1e94d..bc5f05ed505 100644 --- a/gdb/m32r-tdep.c +++ b/gdb/m32r-tdep.c @@ -53,26 +53,26 @@ m32r_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp) /* Breakpoints - + The little endian mode of M32R is unique. In most of architectures, two 16-bit instructions, A and B, are placed as the following: - + Big endian: A0 A1 B0 B1 - + Little endian: A1 A0 B1 B0 - + In M32R, they are placed like this: - + Big endian: A0 A1 B0 B1 - + Little endian: B1 B0 A1 A0 - + This is because M32R always fetches instructions in 32-bit. - + The following functions take care of this behavior. */ static int @@ -746,7 +746,7 @@ m32r_push_dummy_call (struct gdbarch *gdbarch, struct value *function, } -/* Given a return value in `regbuf' with a type `valtype', +/* Given a return value in `regbuf' with a type `valtype', extract and copy its value into `valbuf'. */ static void diff --git a/gdb/m32r-tdep.h b/gdb/m32r-tdep.h index 3e94c0e10a7..24ba44c3969 100644 --- a/gdb/m32r-tdep.h +++ b/gdb/m32r-tdep.h @@ -1,5 +1,5 @@ /* Target-dependent code for Renesas M32R, for GDB. - + Copyright (C) 2004-2025 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index a61a49e43bb..83a57edae00 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -32,7 +32,7 @@ #include "gdbcore.h" #include "value.h" #include "inferior.h" -#include "dis-asm.h" +#include "dis-asm.h" #include "symfile.h" #include "objfiles.h" #include "arch-utils.h" @@ -49,7 +49,7 @@ For 68HC11/68HC12 we have two flags that tell which return type the function is using. This is used for prologue and frame analysis to compute correct stack frame layout. - + The MSB of the minimal symbol's "info" field is used for this purpose. MSYMBOL_SET_RTC Actually sets the "RTC" bit. @@ -75,7 +75,7 @@ enum insn_return_kind { RETURN_RTI }; - + /* Register numbers of various important registers. */ #define HARD_X_REGNUM 0 @@ -190,7 +190,7 @@ m68hc11_register_names[] = "d29", "d30", "d31", "d32" }; -struct m68hc11_soft_reg +struct m68hc11_soft_reg { const char *name; CORE_ADDR addr; @@ -239,14 +239,14 @@ m68hc11_initialize_register_info (void) if (soft_reg_initialized) return; - + soft_min_addr = INT_MAX; soft_max_addr = 0; for (i = 0; i < M68HC11_ALL_REGS; i++) { soft_regs[i].name = 0; } - + m68hc11_get_register_info (&soft_regs[SOFT_FP_REGNUM], "_.frame"); m68hc11_get_register_info (&soft_regs[SOFT_TMP_REGNUM], "_.tmp"); m68hc11_get_register_info (&soft_regs[SOFT_ZS_REGNUM], "_.z"); @@ -273,10 +273,10 @@ static int m68hc11_which_soft_register (CORE_ADDR addr) { int i; - + if (addr < soft_min_addr || addr > soft_max_addr) return -1; - + for (i = SOFT_FP_REGNUM; i < M68HC11_ALL_REGS; i++) { if (soft_regs[i].name && soft_regs[i].addr == addr) @@ -320,7 +320,7 @@ m68hc11_pseudo_register_read (struct gdbarch *gdbarch, } m68hc11_initialize_register_info (); - + /* Fetch a soft register: translate into a memory read. */ if (soft_regs[regno].name) { @@ -366,7 +366,7 @@ m68hc11_pseudo_register_write (struct gdbarch *gdbarch, regcache_cooked_write_unsigned (regcache, HARD_PC_REGNUM, pc); return; } - + m68hc11_initialize_register_info (); /* Store a soft register: translate into a memory write. */ @@ -491,7 +491,7 @@ static struct insn_sequence m6811_prologue[] = { /* Sequence of instructions in the 68HC12 function prologue. */ -static struct insn_sequence m6812_prologue[] = { +static struct insn_sequence m6812_prologue[] = { { P_SAVE_REG, 5, { M6812_OP_PAGE2, M6812_OP_MOVW, M6812_PB_PSHW, OP_IMM_HIGH, OP_IMM_LOW } }, { P_SET_FRAME, 2, { M6812_OP_STS, OP_DIRECT } }, @@ -533,10 +533,10 @@ m68hc11_analyze_instruction (struct gdbarch *gdbarch, /* Continue while we match the opcode. */ if (seq->code[j] == buffer[j]) continue; - + if ((seq->code[j] & 0xf00) == 0) break; - + /* Extract a sequence parameter (address or constant). */ switch (seq->code[j]) { @@ -638,7 +638,7 @@ m68hc11_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, m68gc11_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); seq_table = tdep->prologue; - + /* The 68hc11 stack is as follows: @@ -669,7 +669,7 @@ m68hc11_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, of locals in this function. An alternative to this is to use DWARF2 info. This would be better but I don't know how to access dwarf2 debug from this function. - + Walk from the function entry point to the point where we save the frame. While walking instructions, compute the size of bytes which are pushed. This gives us the index to access the previous @@ -1110,7 +1110,7 @@ m68hc11_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, gdb_printf (file, "\nCCR="); m68hc11_print_register (gdbarch, file, frame, HARD_CCR_REGNUM); - + gdb_printf (file, "\nD="); m68hc11_print_register (gdbarch, file, frame, HARD_D_REGNUM); @@ -1119,7 +1119,7 @@ m68hc11_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, gdb_printf (file, " Y="); m68hc11_print_register (gdbarch, file, frame, HARD_Y_REGNUM); - + m68gc11_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (tdep->use_page_register) @@ -1135,7 +1135,7 @@ m68hc11_print_registers_info (struct gdbarch *gdbarch, struct ui_file *file, /* Skip registers which are not defined in the symbol table. */ if (soft_regs[i].name == 0) continue; - + gdb_printf (file, "D%d=", i - SOFT_D1_REGNUM + 1); m68hc11_print_register (gdbarch, file, frame, i); nr++; @@ -1162,7 +1162,7 @@ m68hc11_push_dummy_call (struct gdbarch *gdbarch, struct value *function, struct type *type; const gdb_byte *val; gdb_byte buf[2]; - + first_stack_argnum = 0; if (return_method == return_method_struct) regcache_cooked_write_unsigned (regcache, HARD_D_REGNUM, struct_addr); @@ -1265,7 +1265,7 @@ m68hc11_store_return_value (struct type *type, struct regcache *regcache, } -/* Given a return value in `regcache' with a type `type', +/* Given a return value in `regcache' with a type `type', extract and copy its value into `valbuf'. */ static void @@ -1324,7 +1324,7 @@ m68hc11_return_value (struct gdbarch *gdbarch, struct value *function, /* Test whether the ELF symbol corresponds to a function using rtc or rti to return. */ - + static void m68hc11_elf_make_msymbol_special (const asymbol *sym, struct minimal_symbol *msym) @@ -1512,7 +1512,7 @@ m68hc11_gdbarch_init (struct gdbarch_info info, frame_unwind_append_unwinder (gdbarch, &m68hc11_frame_unwind); frame_base_set_default (gdbarch, &m68hc11_frame_base); - + /* Methods for saving / extracting a dummy frame's ID. The ID's stack address must match the SP value returned by PUSH_DUMMY_CALL, and saved by generic_save_dummy_frame_tos. */ @@ -1532,5 +1532,5 @@ INIT_GDB_FILE (m68hc11_tdep) gdbarch_register (bfd_arch_m68hc11, m68hc11_gdbarch_init); gdbarch_register (bfd_arch_m68hc12, m68hc11_gdbarch_init); m68hc11_init_reggroups (); -} +} diff --git a/gdb/m68k-bsd-tdep.c b/gdb/m68k-bsd-tdep.c index 37c1464b6cc..e5d80ca5429 100644 --- a/gdb/m68k-bsd-tdep.c +++ b/gdb/m68k-bsd-tdep.c @@ -41,7 +41,7 @@ int m68kbsd_fpreg_offset (struct gdbarch *gdbarch, int regnum) { int fp_len = gdbarch_register_type (gdbarch, regnum)->length (); - + if (regnum >= M68K_FPC_REGNUM) return 8 * fp_len + (regnum - M68K_FPC_REGNUM) * 4; diff --git a/gdb/m68k-linux-nat.c b/gdb/m68k-linux-nat.c index 02286ff999e..e55c8fa415a 100644 --- a/gdb/m68k-linux-nat.c +++ b/gdb/m68k-linux-nat.c @@ -129,7 +129,7 @@ fetch_register (struct regcache *regcache, int regno) memcpy (&buf[i], &val, sizeof (long)); regaddr += sizeof (long); if (errno != 0) - error (_("Couldn't read register %s (#%d): %s."), + error (_("Couldn't read register %s (#%d): %s."), gdbarch_register_name (gdbarch, regno), regno, safe_strerror (errno)); } @@ -494,7 +494,7 @@ m68k_linux_nat_target::store_registers (struct regcache *regcache, int regno) /* Fetch the thread-local storage pointer for libthread_db. */ ps_err_e -ps_get_thread_area (struct ps_prochandle *ph, +ps_get_thread_area (struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base) { if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) < 0) diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c index 94bfddb8803..3fa158a0338 100644 --- a/gdb/m68k-tdep.c +++ b/gdb/m68k-tdep.c @@ -1201,15 +1201,15 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) if (info.bfd_arch_info && info.bfd_arch_info->mach != 0) { - const bfd_arch_info_type *coldfire_arch = + const bfd_arch_info_type *coldfire_arch = bfd_lookup_arch (bfd_arch_m68k, bfd_mach_mcf_isa_a_nodiv); if (coldfire_arch - && ((*info.bfd_arch_info->compatible) + && ((*info.bfd_arch_info->compatible) (info.bfd_arch_info, coldfire_arch))) flavour = m68k_coldfire_flavour; } - + /* Try to figure out if the arch uses floating registers to return floating point values from functions. On ColdFire, floating point values are returned in D0. */ diff --git a/gdb/macroexp.c b/gdb/macroexp.c index 0ada15fb665..5fa259d3fb5 100644 --- a/gdb/macroexp.c +++ b/gdb/macroexp.c @@ -39,7 +39,7 @@ struct shared_macro_buffer /* The number of characters in the string. */ int len; - /* For detecting token splicing. + /* For detecting token splicing. This is the index in TEXT of the first character of the token that abuts the end of TEXT. If TEXT contains no tokens, then we @@ -49,7 +49,7 @@ struct shared_macro_buffer know the nature of TEXT. */ int last_token = -1; - /* If this buffer is holding the result from get_token, then this + /* If this buffer is holding the result from get_token, then this is non-zero if it is an identifier token, zero otherwise. */ int is_identifier = 0; @@ -316,7 +316,7 @@ static int get_character_constant (shared_macro_buffer *tok, const char *p, const char *end) { - /* ISO/IEC 9899:1999 (E) Section 6.4.4.4 paragraph 1 + /* ISO/IEC 9899:1999 (E) Section 6.4.4.4 paragraph 1 But of course, what really matters is that we handle it the same way GDB's C/C++ lexer does. So we call parse_escape in utils.c to handle escape sequences. */ @@ -494,7 +494,7 @@ get_token (shared_macro_buffer *tok, shared_macro_buffer *src) /* From the ISO C standard, ISO/IEC 9899:1999 (E), section 6.4: - preprocessing-token: + preprocessing-token: header-name identifier pp-number @@ -532,7 +532,7 @@ get_token (shared_macro_buffer *tok, shared_macro_buffer *src) src->len -= consumed; return 1; } - else + else { /* We have found a "non-whitespace character that cannot be one of the above." Make a token out of it. */ @@ -577,7 +577,7 @@ append_tokens_without_splicing (growable_macro_buffer *dest, gdb_assert (src->last_token != -1); gdb_assert (dest->last_token != -1); - + /* First, just try appending the two, and call get_token to see if we got a splice. */ dest->appendmem (src->text, src->len); @@ -699,7 +699,7 @@ macro_stringify (const char *str) /* Expanding macros! */ -/* A singly-linked list of the names of the macros we are currently +/* A singly-linked list of the names of the macros we are currently expanding --- for detecting expansion loops. */ struct macro_name_list { const char *name; @@ -862,7 +862,7 @@ static void scan (growable_macro_buffer *dest, const macro_scope &scope); /* A helper function for substitute_args. - + ARGV is a vector of all the arguments; ARGC is the number of arguments. IS_VARARGS is true if the macro being substituted is a varargs macro; in this case VA_ARG_NAME is the name of the @@ -883,7 +883,7 @@ find_parameter (const shared_macro_buffer *tok, return -1; for (i = 0; i < argc; ++i) - if (tok->len == strlen (argv[i]) + if (tok->len == strlen (argv[i]) && !memcmp (tok->text, argv[i], tok->len)) return i; @@ -893,7 +893,7 @@ find_parameter (const shared_macro_buffer *tok, return -1; } - + /* Helper function for substitute_args that gets the next token and updates the passed-in state variables. */ diff --git a/gdb/macrotab.c b/gdb/macrotab.c index 06f5307182a..61cc1776979 100644 --- a/gdb/macrotab.c +++ b/gdb/macrotab.c @@ -213,7 +213,7 @@ inclusion_depth (struct macro_source_file *file) sources, where all the #included files have been substituted into their places. */ static int -compare_locations (struct macro_source_file *file1, int line1, +compare_locations (struct macro_source_file *file1, int line1, struct macro_source_file *file2, int line2) { /* We want to treat positions in an #included file as coming *after* @@ -615,7 +615,7 @@ macro_tree_delete_value (void *untyped_definition) macro_bcache_free (t, (char *) d->argv[i]); macro_bcache_free (t, (char **) d->argv); } - + macro_bcache_free (t, (char *) d->replacement); macro_free (d, t); } @@ -650,7 +650,7 @@ find_definition (const char *name, use that. */ splay_tree_node pred = splay_tree_predecessor (t->definitions, (splay_tree_key) &query); - + if (pred) { /* Make sure this predecessor actually has the right name. @@ -1042,7 +1042,7 @@ new_macro_table (struct obstack *obstack, gdb::bcache *b, ((splay_tree_allocate_fn) macro_alloc), ((splay_tree_deallocate_fn) macro_free), t)); - + return t; } diff --git a/gdb/main.c b/gdb/main.c index 3b861fb3e61..58a744bb2b7 100644 --- a/gdb/main.c +++ b/gdb/main.c @@ -758,7 +758,7 @@ captured_main_1 (struct captured_main_args *context) /* There will always be an interpreter. Either the one passed into this captured main, or one specified by the user at start up, or - the console. Initialize the interpreter to the one requested by + the console. Initialize the interpreter to the one requested by the application. */ interpreter_p = context->interpreter_p; diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 9504e5e1670..90c365b85d7 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -70,8 +70,8 @@ #include /* Provide a way to test if we have both ECOFF and ELF symbol tables. - We use this define in order to know whether we should override a - symbol's ECOFF section with its ELF section. This is necessary in + We use this define in order to know whether we should override a + symbol's ECOFF section with its ELF section. This is necessary in case the symbol's ELF section could not be represented in ECOFF. */ #define ECOFF_IN_ELF(bfd) (bfd_get_flavour (bfd) == bfd_target_elf_flavour \ && bfd_get_section_by_name (bfd, ".mdebug") != NULL) @@ -342,7 +342,7 @@ mdebug_build_psymtabs (minimal_symbol_reader &reader, stabsread_new_init (); free_header_files (); init_header_files (); - + /* Make sure all the FDR information is swapped in. */ if (info->fdr == NULL) { @@ -888,7 +888,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend, (in particular constructor method names are different from the class name). There is therefore no risk that this check stops the count on the StEnd of a method. - + Also, assume that we're really at the end when tsym.iss is 0 (issNull). */ if (tsym.iss == issNull @@ -2018,7 +2018,7 @@ parse_procedure (PDR *pr, struct compunit_symtab *search_symtab, if (i) { struct mdebug_extra_func_info *e; - + e = (struct mdebug_extra_func_info *) i->value_bytes (); e->pdr = *pr; @@ -2422,14 +2422,14 @@ parse_partial_symbols (minimal_symbol_reader &reader, /* ECOFF in ELF: For ECOFF in ELF, we skip the creation of the minimal symbols. - The ECOFF symbols should be a subset of the Elf symbols, and the + The ECOFF symbols should be a subset of the Elf symbols, and the section information of the elf symbols will be more accurate. FIXME! What about Irix 5's native linker? - By default, Elf sections which don't exist in ECOFF + By default, Elf sections which don't exist in ECOFF get put in ECOFF's absolute section by the gnu linker. - Since absolute sections don't get relocated, we - end up calculating an address different from that of + Since absolute sections don't get relocated, we + end up calculating an address different from that of the symbol's minimal symbol (created earlier from the Elf symtab). @@ -2437,9 +2437,9 @@ parse_partial_symbols (minimal_symbol_reader &reader, 1) don't create the duplicate symbol (assumes ECOFF symtab is a subset of the ELF symtab; assumes no side-effects result from ignoring ECOFF symbol) - 2) create it, only if lookup for existing symbol in ELF's minimal + 2) create it, only if lookup for existing symbol in ELF's minimal symbols fails - (inefficient; + (inefficient; assumes no side-effects result from ignoring ECOFF symbol) 3) create it, but lookup ELF's minimal symbol and use it's section during relocation, then modify "uniquify" phase to merge and @@ -2447,7 +2447,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, (highly inefficient) I've implemented #1 here... - Skip the creation of the minimal symbols based on the ECOFF + Skip the creation of the minimal symbols based on the ECOFF symbol table. */ /* Pass 2 over external syms: fill in external symbols. */ @@ -2538,12 +2538,12 @@ parse_partial_symbols (minimal_symbol_reader &reader, which storage class is scData... Since these symbols are usually useless for the debugger user anyway, we just discard these symbols. */ - + if (SC_IS_TEXT (ext_in->asym.sc)) { if (objfile->sect_index_text == -1) continue; - + ms_type = mst_file_text; } else if (SC_IS_DATA (ext_in->asym.sc)) @@ -2753,7 +2753,7 @@ parse_partial_symbols (minimal_symbol_reader &reader, break; default: - /* FIXME! Shouldn't this use cases for bss, + /* FIXME! Shouldn't this use cases for bss, then have the default be abs? */ namestring = debug_info->ss + fh->issBase + sh.iss; record_minimal_symbol (reader, namestring, diff --git a/gdb/memattr.c b/gdb/memattr.c index 9d26d3106df..45bf9b99a6c 100644 --- a/gdb/memattr.c +++ b/gdb/memattr.c @@ -66,7 +66,7 @@ show_inaccessible_by_default (struct ui_file *file, int from_tty, "be treated as inaccessible.\n")); else gdb_printf (file, _("Unknown memory addresses " - "will be treated as RAM.\n")); + "will be treated as RAM.\n")); } /* This function should be called before any command which would @@ -184,7 +184,7 @@ lookup_mem_region (CORE_ADDR addr) /* Either find memory range containing ADDR, or set LO and HI to the nearest boundaries of an existing memory range. - + If we ever want to support a huge list of memory regions, this check should be replaced with a binary search (probably using VEC_lower_bound). */ @@ -216,8 +216,8 @@ lookup_mem_region (CORE_ADDR addr) region.lo = lo; region.hi = hi; - /* When no memory map is defined at all, we always return - 'default_mem_attrib', so that we do not make all memory + /* When no memory map is defined at all, we always return + 'default_mem_attrib', so that we do not make all memory inaccessible for targets that don't provide a memory map. */ if (inaccessible_by_default && !mem_region_list->empty ()) region.attrib = mem_attrib::unknown (); @@ -376,7 +376,7 @@ info_mem_command (const char *args, int from_tty) tmp = hex_string_custom (m.lo, 8); else tmp = hex_string_custom (m.lo, 16); - + gdb_printf ("%s ", tmp); if (gdbarch_addr_bit (current_inferior ()->arch ()) <= 32) diff --git a/gdb/memattr.h b/gdb/memattr.h index 0cf3b3e8b2a..b312090d0f1 100644 --- a/gdb/memattr.h +++ b/gdb/memattr.h @@ -41,7 +41,7 @@ enum mem_access_width }; /* The set of all attributes that can be set for a memory region. - + This structure was created so that memory attributes can be passed to target_ functions without exposing the details of memory region list, which would be necessary if these fields were simply added to @@ -49,8 +49,8 @@ enum mem_access_width FIXME: It would be useful if there was a mechanism for targets to add their own attributes. For example, the number of wait states. */ - -struct mem_attrib + +struct mem_attrib { static mem_attrib unknown () { @@ -68,10 +68,10 @@ struct mem_attrib /* enables hardware breakpoints */ int hwbreak = 0; - + /* enables host-side caching of memory region data */ int cache = 0; - + /* Enables memory verification. After a write, memory is re-read to verify that the write was successful. */ int verify = 0; @@ -80,7 +80,7 @@ struct mem_attrib int blocksize = -1; }; -struct mem_region +struct mem_region { /* Create a mem_region with default attributes. */ @@ -110,7 +110,7 @@ struct mem_region /* Lowest address in the region. */ CORE_ADDR lo; - /* Address past the highest address of the region. + /* Address past the highest address of the region. If 0, upper bound is "infinity". */ CORE_ADDR hi; diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index 30a6018c2f2..1821cba7e5f 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -332,7 +332,7 @@ register_name_from_keyword (CGEN_KEYWORD *keyword_table, int regnum) return ""; } - + /* Masks for option bits in the OPT special-purpose register. */ enum { MEP_OPT_DIV = 1 << 25, /* 32-bit divide instruction option */ @@ -437,7 +437,7 @@ me_module_name (CONFIG_ATTR me_module) /* The MeP spec defines the following registers: - 16 general purpose registers (r0-r15) + 16 general purpose registers (r0-r15) 32 control/special registers (csr0-csr31) 32 coprocessor general-purpose registers (c0 -- c31) 64 coprocessor control registers (ccr0 -- ccr63) @@ -946,7 +946,7 @@ mep_register_name (struct gdbarch *gdbarch, int regnr) /* Special-purpose registers. */ static const char *csr_names[] = { - "pc", "lp", "sar", "", /* 0 csr3: reserved */ + "pc", "lp", "sar", "", /* 0 csr3: reserved */ "rpb", "rpe", "rpc", "hi", /* 4 */ "lo", "", "", "", /* 8 csr9-csr11: reserved */ "mb0", "me0", "mb1", "me1", /* 12 */ @@ -1198,7 +1198,7 @@ mep_pseudo_csr_write (struct gdbarch *gdbarch, ULONGEST old_bits; ULONGEST new_bits; ULONGEST mixed_bits; - + regcache_raw_read_unsigned (regcache, r->raw, &old_bits); new_bits = extract_unsigned_integer (buf, size, byte_order); mixed_bits = ((r->writeable_bits & new_bits) @@ -1206,7 +1206,7 @@ mep_pseudo_csr_write (struct gdbarch *gdbarch, regcache_raw_write_unsigned (regcache, r->raw, mixed_bits); } } - + static void mep_pseudo_cr32_write (struct gdbarch *gdbarch, @@ -1219,7 +1219,7 @@ mep_pseudo_cr32_write (struct gdbarch *gdbarch, the pseudoregister. */ int rawnum = mep_pseudo_to_raw[cookednum]; gdb_byte buf64[8]; - + gdb_assert (register_type (gdbarch, rawnum)->length () == sizeof (buf64)); gdb_assert (register_type (gdbarch, cookednum)->length () == 4); /* Slow, but legible. */ @@ -1386,7 +1386,7 @@ mep_pc_in_vliw_section (CORE_ADDR pc) So, the *INSN values for the instruction sequence above would be the following, in either endianness: - 0xd1561234 movu $1,0x123456 + 0xd1561234 movu $1,0x123456 0xc1285678 sb $1,22136($2) 0xf1011098 clip $1,0x13 0x70020000 ret @@ -1408,7 +1408,7 @@ mep_pc_in_vliw_section (CORE_ADDR pc) significant to prologue analysis --- for the time being, anyway. */ -static CORE_ADDR +static CORE_ADDR mep_get_insn (struct gdbarch *gdbarch, CORE_ADDR pc, unsigned long *insn) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -1479,7 +1479,7 @@ mep_get_insn (struct gdbarch *gdbarch, CORE_ADDR pc, unsigned long *insn) else gdb_assert_not_reached ("unexpected vliw mode"); } - + /* Otherwise, the top two bits of the major opcode are (again) what we need to check. */ else if ((*insn & 0xc0000000) == 0xc0000000) @@ -1736,7 +1736,7 @@ mep_analyze_prologue (struct gdbarch *gdbarch, accuracy, it would be better to just quit now. */ if (stack.store_would_trash (reg[rm])) break; - + if (is_arg_spill (gdbarch, reg[rn], reg[rm], &stack)) after_last_frame_setup_insn = next_pc; @@ -1812,11 +1812,11 @@ mep_analyze_prologue (struct gdbarch *gdbarch, to this branch target and also stop the prologue scan. The instructions at and beyond the branch target should no longer be associated with the prologue. - + Note that we only consider forward branches here. We presume that a forward branch is being used to skip over a loop body. - + A backwards branch is covered by the default case below. If we were to encounter a backwards branch, that would most likely mean that we've scanned through a loop body. @@ -1842,7 +1842,7 @@ mep_analyze_prologue (struct gdbarch *gdbarch, - If the instruction just changed the FP back to its original value, then that's probably a restore instruction. The - prologue should definitely end before that. + prologue should definitely end before that. - If the instruction increased the value of the SP (that is, shrunk the frame), then it's probably part of a frame @@ -1920,7 +1920,7 @@ mep_analyze_frame_prologue (const frame_info_ptr &this_frame, { CORE_ADDR func_start, stop_addr; - *this_prologue_cache + *this_prologue_cache = FRAME_OBSTACK_ZALLOC (struct mep_prologue); func_start = get_frame_func (this_frame); @@ -2268,7 +2268,7 @@ mep_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* The address of the end of the stack area for arguments. This is just for error checking. */ CORE_ADDR arg_stack_end; - + sp = push_large_arguments (sp, argc, argv, copy); /* Reserve space for the stack arguments, if any. */ @@ -2324,7 +2324,7 @@ mep_push_dummy_call (struct gdbarch *gdbarch, struct value *function, /* Update the stack pointer. */ regcache_cooked_write_unsigned (regcache, MEP_SP_REGNUM, sp); - + return sp; } @@ -2369,7 +2369,7 @@ mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) const char *file_name = bfd_get_filename (info.abfd); const char *file_endianness = bfd_big_endian (info.abfd) ? "big" : "little"; - + gdb_putc ('\n', gdb_stderr); if (module_name) warning (_("the MeP module '%s' is %s-endian, but the executable\n" @@ -2388,7 +2388,7 @@ mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) already. info->bfd_arch_info needs to match, but we also want the right me_module: the ELF header's e_flags field needs to match as well. */ - for (arches = gdbarch_list_lookup_by_info (arches, &info); + for (arches = gdbarch_list_lookup_by_info (arches, &info); arches != NULL; arches = gdbarch_list_lookup_by_info (arches->next, &info)) { @@ -2436,7 +2436,7 @@ mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) reggroup_add (gdbarch, mep_ccr_reggroup); /* Disassembly. */ - set_gdbarch_print_insn (gdbarch, mep_gdb_print_insn); + set_gdbarch_print_insn (gdbarch, mep_gdb_print_insn); /* Breakpoints. */ set_gdbarch_breakpoint_kind_from_pc (gdbarch, mep_breakpoint::kind_from_pc); @@ -2451,7 +2451,7 @@ mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Return values. */ set_gdbarch_return_value (gdbarch, mep_return_value); - + /* Inferior function calls. */ set_gdbarch_frame_align (gdbarch, mep_frame_align); set_gdbarch_push_dummy_call (gdbarch, mep_push_dummy_call); @@ -2462,7 +2462,7 @@ mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) INIT_GDB_FILE (mep_tdep) { mep_csr_reggroup = reggroup_new ("csr", USER_REGGROUP); - mep_cr_reggroup = reggroup_new ("cr", USER_REGGROUP); + mep_cr_reggroup = reggroup_new ("cr", USER_REGGROUP); mep_ccr_reggroup = reggroup_new ("ccr", USER_REGGROUP); gdbarch_register (bfd_arch_mep, mep_gdbarch_init); diff --git a/gdb/mi/mi-cmd-break.c b/gdb/mi/mi-cmd-break.c index 1cb84354513..2c9295d45c5 100644 --- a/gdb/mi/mi-cmd-break.c +++ b/gdb/mi/mi-cmd-break.c @@ -482,8 +482,8 @@ mi_cmd_break_passcount (const char *command, const char *const *argv, } /* Insert a watchpoint. The type of watchpoint is specified by the - first argument: - -break-watch --> insert a regular wp. + first argument: + -break-watch --> insert a regular wp. -break-watch -r --> insert a read watchpoint. -break-watch -a --> insert an access wp. */ diff --git a/gdb/mi/mi-cmd-disas.c b/gdb/mi/mi-cmd-disas.c index 6051cbadefc..836a6c8b08c 100644 --- a/gdb/mi/mi-cmd-disas.c +++ b/gdb/mi/mi-cmd-disas.c @@ -38,7 +38,7 @@ disassemble the function that contains that line. HOW_MANY: Number of disassembly lines to display. With source, it is the number of disassembly lines only, not counting the source - lines. + lines. always required: diff --git a/gdb/mi/mi-cmd-env.c b/gdb/mi/mi-cmd-env.c index bc2fe77e4c6..70cf4c20bca 100644 --- a/gdb/mi/mi-cmd-env.c +++ b/gdb/mi/mi-cmd-env.c @@ -61,7 +61,7 @@ mi_cmd_env_pwd (const char *command, const char *const *argv, int argc) if (argc > 0) error (_("-environment-pwd: No arguments allowed")); - + gdb::unique_xmalloc_ptr cwd (getcwd (NULL, 0)); if (cwd == NULL) error (_("-environment-pwd: error finding name of working directory: %s"), @@ -77,7 +77,7 @@ mi_cmd_env_cd (const char *command, const char *const *argv, int argc) { if (argc == 0 || argc > 1) error (_("-environment-cd: Usage DIRECTORY")); - + env_execute_cli_command ("cd", argv[0]); } @@ -87,7 +87,7 @@ env_mod_path (const char *dirname, std::string &which_path) if (dirname == 0 || dirname[0] == '\0') return; - /* Call add_path with last arg 0 to indicate not to parse for + /* Call add_path with last arg 0 to indicate not to parse for separator characters. */ add_path (dirname, which_path, 0); } diff --git a/gdb/mi/mi-cmd-file.c b/gdb/mi/mi-cmd-file.c index cf7991f9892..69e5d0a18b7 100644 --- a/gdb/mi/mi-cmd-file.c +++ b/gdb/mi/mi-cmd-file.c @@ -26,7 +26,7 @@ #include "source.h" #include "solib.h" -/* Return to the client the absolute path and line number of the +/* Return to the client the absolute path and line number of the current file being executed. */ void @@ -34,7 +34,7 @@ mi_cmd_file_list_exec_source_file (const char *command, const char *const *argv, int argc) { struct ui_out *uiout = current_uiout; - + if (!mi_valid_noargs ("-file-list-exec-source-file", argc, argv)) error (_("-file-list-exec-source-file: Usage: No args")); diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index 52ae11b39af..6c4a0e262f2 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -400,9 +400,9 @@ mi_cmd_stack_list_args (const char *command, const char *const *argv, int argc) } } -/* Print a list of the local variables (including arguments) for the +/* Print a list of the local variables (including arguments) for the current frame. ARGC must be 1 and ARGV[0] specify if only the names, - or both names and values of the variables must be printed. See + or both names and values of the variables must be printed. See parse_print_value for possible values. */ void diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c index 09d6107c11b..f80af671c3b 100644 --- a/gdb/mi/mi-cmd-var.c +++ b/gdb/mi/mi-cmd-var.c @@ -41,7 +41,7 @@ static int mi_print_value_p (struct varobj *var, if the value should be printed. The PRINT_EXPRESSION parameter controls if the expression should be printed. */ -static void +static void print_varobj (struct varobj *var, enum print_values print_values, int print_expression) { @@ -56,7 +56,7 @@ print_varobj (struct varobj *var, enum print_values print_values, uiout->field_string ("exp", exp); } uiout->field_signed ("numchild", varobj_get_num_children (var)); - + if (mi_print_value_p (var, print_values)) { std::string val = varobj_get_value (var); @@ -114,7 +114,7 @@ mi_cmd_var_create (const char *command, const char *const *argv, int argc) if (strcmp (frame, "*") == 0) var_type = USE_CURRENT_FRAME; else if (strcmp (frame, "@") == 0) - var_type = USE_SELECTED_FRAME; + var_type = USE_SELECTED_FRAME; else { var_type = USE_SPECIFIED_FRAME; @@ -224,13 +224,13 @@ mi_cmd_var_set_format (const char *command, const char *const *argv, int argc) var = varobj_get_handle (argv[0]); format = mi_parse_format (argv[1]); - + /* Set the format of VAR to the given format. */ varobj_set_display_format (var, format); /* Report the new current format. */ uiout->field_string ("format", varobj_format_string[(int) format]); - + /* Report the value in the new format. */ std::string val = varobj_get_value (var); uiout->field_string ("value", val); @@ -363,7 +363,7 @@ mi_cmd_var_list_children (const char *command, const char *const *argv, int argc) { struct ui_out *uiout = current_uiout; - struct varobj *var; + struct varobj *var; enum print_values print_values; int from, to; @@ -443,7 +443,7 @@ mi_cmd_var_info_path_expression (const char *command, const char *const *argv, /* Get varobj handle, if a valid var obj name was specified. */ var = varobj_get_handle (argv[0]); - + const char *path_expr = varobj_get_path_expr (var); uiout->field_string ("path_expr", path_expr); @@ -507,7 +507,7 @@ mi_cmd_var_evaluate_expression (const char *command, const char *const *argv, int formatFound; int oind; const char *oarg; - + enum opt { OP_FORMAT @@ -534,7 +534,7 @@ mi_cmd_var_evaluate_expression (const char *command, const char *const *argv, case OP_FORMAT: if (formatFound) error (_("Cannot specify format more than once")); - + format = mi_parse_format (oarg); formatFound = 1; break; @@ -543,13 +543,13 @@ mi_cmd_var_evaluate_expression (const char *command, const char *const *argv, if (oind >= argc) error (_("Usage: [-f FORMAT] NAME")); - + if (oind < argc - 1) error (_("Garbage at end of command")); - + /* Get varobj handle, if a valid var obj name was specified. */ var = varobj_get_handle (argv[oind]); - + if (formatFound) { std::string val = varobj_get_formatted_value (var, format); @@ -674,7 +674,7 @@ varobj_update_one (struct varobj *var, enum print_values print_values, struct ui_out *uiout = current_uiout; std::vector changes = varobj_update (&var, is_explicit); - + for (const varobj_update_result &r : changes) { int from, to; @@ -763,7 +763,7 @@ mi_cmd_var_set_update_range (const char *command, const char *const *argv, if (argc != 3) error (_("-var-set-update-range: Usage: VAROBJ FROM TO")); - + var = varobj_get_handle (argv[0]); from = atoi (argv[1]); to = atoi (argv[2]); diff --git a/gdb/mi/mi-getopt.c b/gdb/mi/mi-getopt.c index 2c8615afafa..bc328e5dead 100644 --- a/gdb/mi/mi-getopt.c +++ b/gdb/mi/mi-getopt.c @@ -95,7 +95,7 @@ mi_getopt_allow_unknown (const char *prefix, int argc, return mi_getopt_1 (prefix, argc, argv, opts, oind, oarg, 0); } -int +int mi_valid_noargs (const char *prefix, int argc, const char *const *argv) { int oind = 0; diff --git a/gdb/mi/mi-getopt.h b/gdb/mi/mi-getopt.h index e3b0c3e9bc8..d61d97236fc 100644 --- a/gdb/mi/mi-getopt.h +++ b/gdb/mi/mi-getopt.h @@ -61,8 +61,8 @@ extern int mi_getopt_allow_unknown (const char *prefix, int argc, /* mi_valid_noargs determines if ARGC/ARGV are a valid set of parameters to satisfy an MI function that is not supposed to receive any arguments. - - An MI function that should not receive arguments can still be + + An MI function that should not receive arguments can still be passed parameters after the special option '--' such as below. Example: The MI function -exec-run takes no args. @@ -70,7 +70,7 @@ extern int mi_getopt_allow_unknown (const char *prefix, int argc, See PR-783 PREFIX is passed to mi_getopt for an error message. - + This function Returns 1 if the parameter pair ARGC/ARGV are valid for an MI function that takes no arguments. Otherwise, it returns 0 and the appropriate error message is displayed by mi_getopt. */ diff --git a/gdb/microblaze-linux-tdep.c b/gdb/microblaze-linux-tdep.c index 0fdda189ee9..01b0437dd4b 100644 --- a/gdb/microblaze-linux-tdep.c +++ b/gdb/microblaze-linux-tdep.c @@ -38,7 +38,7 @@ #include "solib-svr4-linux.h" static int -microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, +microblaze_linux_memory_remove_breakpoint (struct gdbarch *gdbarch, struct bp_target_info *bp_tgt) { CORE_ADDR addr = bp_tgt->reqstd_address; @@ -85,7 +85,7 @@ microblaze_linux_sigtramp_cache (const frame_info_ptr &next_frame, /* Registers saved on stack. */ for (regnum = 0; regnum < MICROBLAZE_BTR_REGNUM; regnum++) - trad_frame_set_reg_addr (this_cache, regnum, + trad_frame_set_reg_addr (this_cache, regnum, gpregs + regnum * MICROBLAZE_REGISTER_SIZE); trad_frame_set_id (this_cache, frame_id_build (base, func)); } @@ -103,7 +103,7 @@ microblaze_linux_sighandler_cache_init (const struct tramp_frame *self, 0); } -static struct tramp_frame microblaze_linux_sighandler_tramp_frame = +static struct tramp_frame microblaze_linux_sighandler_tramp_frame = { SIGTRAMP_FRAME, 4, @@ -135,6 +135,6 @@ microblaze_linux_init_abi (struct gdbarch_info info, INIT_GDB_FILE (microblaze_linux_tdep) { - gdbarch_register_osabi (bfd_arch_microblaze, 0, GDB_OSABI_LINUX, + gdbarch_register_osabi (bfd_arch_microblaze, 0, GDB_OSABI_LINUX, microblaze_linux_init_abi); } diff --git a/gdb/microblaze-tdep.c b/gdb/microblaze-tdep.c index 3953a96a4e1..d2641779906 100644 --- a/gdb/microblaze-tdep.c +++ b/gdb/microblaze-tdep.c @@ -186,7 +186,7 @@ microblaze_alloc_frame_cache (void) of "real" code (i.e., the end of the prologue). */ static CORE_ADDR -microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, +microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR current_pc, struct microblaze_frame_cache *cache) { @@ -232,8 +232,8 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, current pc, or the end of the function, whichever is first. */ stop = (current_pc < func_end ? current_pc : func_end); - microblaze_debug ("Scanning prologue: name=%s, func_addr=%s, stop=%s\n", - name, paddress (gdbarch, func_addr), + microblaze_debug ("Scanning prologue: name=%s, func_addr=%s, stop=%s\n", + name, paddress (gdbarch, func_addr), paddress (gdbarch, stop)); for (addr = func_addr; addr < stop; addr += INST_WORD_SIZE) @@ -243,7 +243,7 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, microblaze_debug ("%s %08lx\n", paddress (gdbarch, pc), insn); /* This code is very sensitive to what functions are present in the - prologue. It assumes that the (addi, addik, swi, sw) can be the + prologue. It assumes that the (addi, addik, swi, sw) can be the only instructions in the prologue. */ if (IS_UPDATE_SP(op, rd, ra)) { @@ -291,7 +291,7 @@ microblaze_analyze_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, } else if (IS_SETUP_FP(op, ra, rb)) { - /* We have a frame pointer. Note the register which is + /* We have a frame pointer. Note the register which is acting as the frame pointer. */ cache->fp_regnum = rd; microblaze_debug ("Found a frame pointer: r%d\n", cache->fp_regnum); @@ -406,7 +406,7 @@ microblaze_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR start_pc) start_pc = sal.end; } - ostart_pc = microblaze_analyze_prologue (gdbarch, func_start, 0xffffffffUL, + ostart_pc = microblaze_analyze_prologue (gdbarch, func_start, 0xffffffffUL, &cache); if (ostart_pc > start_pc) @@ -784,8 +784,8 @@ microblaze_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_register_type (gdbarch, microblaze_register_type); /* Register numbers of various important registers. */ - set_gdbarch_sp_regnum (gdbarch, MICROBLAZE_SP_REGNUM); - set_gdbarch_pc_regnum (gdbarch, MICROBLAZE_PC_REGNUM); + set_gdbarch_sp_regnum (gdbarch, MICROBLAZE_SP_REGNUM); + set_gdbarch_pc_regnum (gdbarch, MICROBLAZE_PC_REGNUM); /* Map Dwarf2 registers to GDB registers. */ set_gdbarch_dwarf2_reg_to_regnum (gdbarch, microblaze_dwarf2_reg_to_regnum); diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 194a016033d..90a0c601c59 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -1360,7 +1360,7 @@ struct computed_hash_values /* Build (or rebuild) the minimal symbol hash tables. This is necessary after compacting or sorting the table since the entries move around thus causing the internal minimal_symbol pointers to become jumbled. */ - + static void build_minimal_symbol_hash_tables (struct objfile *objfile, diff --git a/gdb/minsyms.h b/gdb/minsyms.h index dcab475bcd3..ed38044a38c 100644 --- a/gdb/minsyms.h +++ b/gdb/minsyms.h @@ -101,13 +101,13 @@ class minimal_symbol_reader /* Record a new minimal symbol. This is the "full" entry point; simpler convenience entry points are also provided below. - + This returns a new minimal symbol. It is ok to modify the returned minimal symbol (though generally not necessary). It is not ok, though, to stash the pointer anywhere; as minimal symbols may be moved after creation. The memory for the returned minimal symbol is still owned by the minsyms.c code, and should not be freed. - + Arguments are: NAME - the symbol's name @@ -292,9 +292,9 @@ bound_minimal_symbol lookup_minimal_symbol_by_pc_section lookup_msym_prefer prefer = lookup_msym_prefer::TEXT, bound_minimal_symbol *previous = nullptr); -/* Backward compatibility: search through the minimal symbol table +/* Backward compatibility: search through the minimal symbol table for a matching PC (no section given). - + This is a wrapper that calls lookup_minimal_symbol_by_pc_section with a NULL section argument. */ diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c index e22e904a84d..249b8d0fd4a 100644 --- a/gdb/mips-linux-nat.c +++ b/gdb/mips-linux-nat.c @@ -89,7 +89,7 @@ static mips_linux_nat_target the_mips_linux_nat_target; static int have_ptrace_regsets = 1; /* Map gdb internal register number to ptrace ``address''. - These ``addresses'' are normally defined in . + These ``addresses'' are normally defined in . ptrace does not provide a way to read (or set) MIPS_PS_REGNUM, and there's no point in reading or setting MIPS_ZERO_REGNUM. @@ -562,7 +562,7 @@ mips_linux_nat_target::can_use_hw_breakpoint (enum bptype type, default: return 0; } - + for (i = 0; i < mips_linux_watch_get_num_valid (&watch_readback) && cnt; i++) diff --git a/gdb/mips-netbsd-nat.c b/gdb/mips-netbsd-nat.c index 91b870b12e9..8c92985d526 100644 --- a/gdb/mips-netbsd-nat.c +++ b/gdb/mips-netbsd-nat.c @@ -60,7 +60,7 @@ mips_nbsd_nat_target::fetch_registers (struct regcache *regcache, int regno) if (ptrace (PT_GETREGS, pid, (PTRACE_TYPE_ARG3) ®s, 0) == -1) perror_with_name (_("Couldn't get registers")); - + mipsnbsd_supply_reg (regcache, (char *) ®s, regno); if (regno != -1) return; @@ -103,7 +103,7 @@ mips_nbsd_nat_target::store_registers (struct regcache *regcache, int regno) if (regno == -1 || regno >= gdbarch_fp0_regnum (regcache->arch ())) { - struct fpreg fpregs; + struct fpreg fpregs; if (ptrace (PT_GETFPREGS, pid, (PTRACE_TYPE_ARG3) &fpregs, 0) == -1) perror_with_name (_("Couldn't get floating point status")); diff --git a/gdb/mips-netbsd-tdep.c b/gdb/mips-netbsd-tdep.c index 3c54c32d696..208ca40764f 100644 --- a/gdb/mips-netbsd-tdep.c +++ b/gdb/mips-netbsd-tdep.c @@ -197,7 +197,7 @@ mipsnbsd_fill_fpreg (const struct regcache *regcache, char *fpregs, int regno) for (i = gdbarch_fp0_regnum (gdbarch); i <= mips_regnum (gdbarch)->fp_control_status; i++) - if ((regno == i || regno == -1) + if ((regno == i || regno == -1) && ! gdbarch_cannot_store_register (gdbarch, i)) regcache->raw_collect (i, (fpregs + ((i - gdbarch_fp0_regnum (gdbarch)) @@ -214,7 +214,7 @@ mipsnbsd_fill_fpreg (const struct regcache *regcache, char *fpregs, int regno) addu a0, sp, 16 li v0, 295 # __sigreturn14 syscall - + Each instruction has a unique encoding, so we simply attempt to match the instruction the PC is pointing to with any of the above instructions. If there is a hit, we know the offset to the start of the designated @@ -315,7 +315,7 @@ mips_nbsd_ilp32_svr4_solib_ops::fetch_link_map_offsets () const static struct link_map_offsets lmo; static struct link_map_offsets *lmp = NULL; - if (lmp == NULL) + if (lmp == NULL) { lmp = &lmo; @@ -379,7 +379,7 @@ mips_nbsd_lp64_svr4_solib_ops::fetch_link_map_offsets () const /* Everything we need is in the first 40 bytes. */ lmo.link_map_size = 48; lmo.l_addr_offset = 0; - lmo.l_name_offset = 16; + lmo.l_name_offset = 16; lmo.l_ld_offset = 24; lmo.l_next_offset = 32; lmo.l_prev_offset = 40; diff --git a/gdb/mn10300-linux-tdep.c b/gdb/mn10300-linux-tdep.c index 6c312411d01..e672ad33290 100644 --- a/gdb/mn10300-linux-tdep.c +++ b/gdb/mn10300-linux-tdep.c @@ -83,8 +83,8 @@ typedef struct If REGNUM is -1, do this for all gp registers in regset. */ static void -am33_supply_gregset_method (const struct regset *regset, - struct regcache *regcache, +am33_supply_gregset_method (const struct regset *regset, + struct regcache *regcache, int regnum, const void *gregs, size_t len) { const mn10300_elf_greg_t *regp = (const mn10300_elf_greg_t *) gregs; @@ -94,67 +94,67 @@ am33_supply_gregset_method (const struct regset *regset, switch (regnum) { case E_D0_REGNUM: - regcache->raw_supply (E_D0_REGNUM, + regcache->raw_supply (E_D0_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D0)); break; case E_D1_REGNUM: - regcache->raw_supply (E_D1_REGNUM, + regcache->raw_supply (E_D1_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D1)); break; case E_D2_REGNUM: - regcache->raw_supply (E_D2_REGNUM, + regcache->raw_supply (E_D2_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D2)); break; case E_D3_REGNUM: - regcache->raw_supply (E_D3_REGNUM, + regcache->raw_supply (E_D3_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D3)); break; case E_A0_REGNUM: - regcache->raw_supply (E_A0_REGNUM, + regcache->raw_supply (E_A0_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A0)); break; case E_A1_REGNUM: - regcache->raw_supply (E_A1_REGNUM, + regcache->raw_supply (E_A1_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A1)); break; case E_A2_REGNUM: - regcache->raw_supply (E_A2_REGNUM, + regcache->raw_supply (E_A2_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A2)); break; case E_A3_REGNUM: - regcache->raw_supply (E_A3_REGNUM, + regcache->raw_supply (E_A3_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A3)); break; case E_SP_REGNUM: - regcache->raw_supply (E_SP_REGNUM, + regcache->raw_supply (E_SP_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_SP)); break; case E_PC_REGNUM: - regcache->raw_supply (E_PC_REGNUM, + regcache->raw_supply (E_PC_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_PC)); break; case E_MDR_REGNUM: - regcache->raw_supply (E_MDR_REGNUM, + regcache->raw_supply (E_MDR_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDR)); break; case E_PSW_REGNUM: - regcache->raw_supply (E_PSW_REGNUM, + regcache->raw_supply (E_PSW_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_EPSW)); break; case E_LIR_REGNUM: - regcache->raw_supply (E_LIR_REGNUM, + regcache->raw_supply (E_LIR_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LIR)); break; case E_LAR_REGNUM: - regcache->raw_supply (E_LAR_REGNUM, + regcache->raw_supply (E_LAR_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LAR)); break; case E_MDRQ_REGNUM: - regcache->raw_supply (E_MDRQ_REGNUM, + regcache->raw_supply (E_MDRQ_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ)); break; case E_E0_REGNUM: - regcache->raw_supply (E_E0_REGNUM, + regcache->raw_supply (E_E0_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E0)); break; case E_E1_REGNUM: @@ -162,27 +162,27 @@ am33_supply_gregset_method (const struct regset *regset, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E1)); break; case E_E2_REGNUM: - regcache->raw_supply (E_E2_REGNUM, + regcache->raw_supply (E_E2_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E2)); break; case E_E3_REGNUM: - regcache->raw_supply (E_E3_REGNUM, + regcache->raw_supply (E_E3_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E3)); break; case E_E4_REGNUM: - regcache->raw_supply (E_E4_REGNUM, + regcache->raw_supply (E_E4_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E4)); break; case E_E5_REGNUM: - regcache->raw_supply (E_E5_REGNUM, + regcache->raw_supply (E_E5_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E5)); break; case E_E6_REGNUM: - regcache->raw_supply (E_E6_REGNUM, + regcache->raw_supply (E_E6_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E6)); break; case E_E7_REGNUM: - regcache->raw_supply (E_E7_REGNUM, + regcache->raw_supply (E_E7_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E7)); break; @@ -197,15 +197,15 @@ am33_supply_gregset_method (const struct regset *regset, regcache->raw_supply_zeroed (E_E10_REGNUM); break; case E_MCRH_REGNUM: - regcache->raw_supply (E_MCRH_REGNUM, + regcache->raw_supply (E_MCRH_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRH)); break; case E_MCRL_REGNUM: - regcache->raw_supply (E_MCRL_REGNUM, + regcache->raw_supply (E_MCRL_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRL)); break; case E_MCVF_REGNUM: - regcache->raw_supply (E_MCVF_REGNUM, + regcache->raw_supply (E_MCVF_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCVF)); break; case E_FPCR_REGNUM: @@ -233,8 +233,8 @@ am33_supply_gregset_method (const struct regset *regset, If REGNUM is -1, do this for all fp registers in regset. */ static void -am33_supply_fpregset_method (const struct regset *regset, - struct regcache *regcache, +am33_supply_fpregset_method (const struct regset *regset, + struct regcache *regcache, int regnum, const void *fpregs, size_t len) { const mn10300_elf_fpregset_t *fpregset @@ -249,7 +249,7 @@ am33_supply_fpregset_method (const struct regset *regset, for (i = 0; i < MN10300_ELF_NFPREG; i++) am33_supply_fpregset_method (regset, regcache, E_FS0_REGNUM + i, fpregs, len); - am33_supply_fpregset_method (regset, regcache, + am33_supply_fpregset_method (regset, regcache, E_FPCR_REGNUM, fpregs, len); } else if (regnum == E_FPCR_REGNUM) @@ -264,8 +264,8 @@ am33_supply_fpregset_method (const struct regset *regset, /* Copy register values from regcache to regset. */ static void -am33_collect_gregset_method (const struct regset *regset, - const struct regcache *regcache, +am33_collect_gregset_method (const struct regset *regset, + const struct regcache *regcache, int regnum, void *gregs, size_t len) { mn10300_elf_gregset_t *regp = (gdb_byte (*)[28][4]) gregs; @@ -279,63 +279,63 @@ am33_collect_gregset_method (const struct regset *regset, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D0)); break; case E_D1_REGNUM: - regcache->raw_collect (E_D1_REGNUM, + regcache->raw_collect (E_D1_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D1)); break; case E_D2_REGNUM: - regcache->raw_collect (E_D2_REGNUM, + regcache->raw_collect (E_D2_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D2)); break; case E_D3_REGNUM: - regcache->raw_collect (E_D3_REGNUM, + regcache->raw_collect (E_D3_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_D3)); break; case E_A0_REGNUM: - regcache->raw_collect (E_A0_REGNUM, + regcache->raw_collect (E_A0_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A0)); break; case E_A1_REGNUM: - regcache->raw_collect (E_A1_REGNUM, + regcache->raw_collect (E_A1_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A1)); break; case E_A2_REGNUM: - regcache->raw_collect (E_A2_REGNUM, + regcache->raw_collect (E_A2_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A2)); break; case E_A3_REGNUM: - regcache->raw_collect (E_A3_REGNUM, + regcache->raw_collect (E_A3_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_A3)); break; case E_SP_REGNUM: - regcache->raw_collect (E_SP_REGNUM, + regcache->raw_collect (E_SP_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_SP)); break; case E_PC_REGNUM: - regcache->raw_collect (E_PC_REGNUM, + regcache->raw_collect (E_PC_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_PC)); break; case E_MDR_REGNUM: - regcache->raw_collect (E_MDR_REGNUM, + regcache->raw_collect (E_MDR_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDR)); break; case E_PSW_REGNUM: - regcache->raw_collect (E_PSW_REGNUM, + regcache->raw_collect (E_PSW_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_EPSW)); break; case E_LIR_REGNUM: - regcache->raw_collect (E_LIR_REGNUM, + regcache->raw_collect (E_LIR_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LIR)); break; case E_LAR_REGNUM: - regcache->raw_collect (E_LAR_REGNUM, + regcache->raw_collect (E_LAR_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_LAR)); break; case E_MDRQ_REGNUM: - regcache->raw_collect (E_MDRQ_REGNUM, + regcache->raw_collect (E_MDRQ_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MDRQ)); break; case E_E0_REGNUM: - regcache->raw_collect (E_E0_REGNUM, + regcache->raw_collect (E_E0_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E0)); break; case E_E1_REGNUM: @@ -343,27 +343,27 @@ am33_collect_gregset_method (const struct regset *regset, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E1)); break; case E_E2_REGNUM: - regcache->raw_collect (E_E2_REGNUM, + regcache->raw_collect (E_E2_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E2)); break; case E_E3_REGNUM: - regcache->raw_collect (E_E3_REGNUM, + regcache->raw_collect (E_E3_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E3)); break; case E_E4_REGNUM: - regcache->raw_collect (E_E4_REGNUM, + regcache->raw_collect (E_E4_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E4)); break; case E_E5_REGNUM: - regcache->raw_collect (E_E5_REGNUM, + regcache->raw_collect (E_E5_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E5)); break; case E_E6_REGNUM: - regcache->raw_collect (E_E6_REGNUM, + regcache->raw_collect (E_E6_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E6)); break; case E_E7_REGNUM: - regcache->raw_collect (E_E7_REGNUM, + regcache->raw_collect (E_E7_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_E7)); break; @@ -378,15 +378,15 @@ am33_collect_gregset_method (const struct regset *regset, /* The gregset struct has noplace to put this: do nothing. */ break; case E_MCRH_REGNUM: - regcache->raw_collect (E_MCRH_REGNUM, + regcache->raw_collect (E_MCRH_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRH)); break; case E_MCRL_REGNUM: - regcache->raw_collect (E_MCRL_REGNUM, + regcache->raw_collect (E_MCRL_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCRL)); break; case E_MCVF_REGNUM: - regcache->raw_collect (E_MCVF_REGNUM, + regcache->raw_collect (E_MCVF_REGNUM, (regp + MN10300_ELF_GREGSET_T_REG_INDEX_MCVF)); break; case E_FPCR_REGNUM: @@ -412,8 +412,8 @@ am33_collect_gregset_method (const struct regset *regset, /* Copy fp register values from regcache to regset. */ static void -am33_collect_fpregset_method (const struct regset *regset, - const struct regcache *regcache, +am33_collect_fpregset_method (const struct regset *regset, + const struct regcache *regcache, int regnum, void *fpregs, size_t len) { mn10300_elf_fpregset_t *fpregset = (mn10300_elf_fpregset_t *) fpregs; @@ -426,7 +426,7 @@ am33_collect_fpregset_method (const struct regset *regset, for (i = 0; i < MN10300_ELF_NFPREG; i++) am33_collect_fpregset_method (regset, regcache, E_FS0_REGNUM + i, fpregs, len); - am33_collect_fpregset_method (regset, regcache, + am33_collect_fpregset_method (regset, regcache, E_FPCR_REGNUM, fpregs, len); } else if (regnum == E_FPCR_REGNUM) diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c index fbaeacfc40a..3749c65f6cf 100644 --- a/gdb/mn10300-tdep.c +++ b/gdb/mn10300-tdep.c @@ -173,7 +173,7 @@ mn10300_store_return_value (struct gdbarch *gdbarch, struct type *type, { int len = type->length (); int reg, regsz; - + if (type->code () == TYPE_CODE_PTR) reg = 4; else @@ -1132,7 +1132,7 @@ static const struct frame_unwind_legacy mn10300_frame_unwind ( NORMAL_FRAME, FRAME_UNWIND_ARCH, default_frame_unwind_stop_reason, - mn10300_frame_this_id, + mn10300_frame_this_id, mn10300_frame_prev_register, NULL, default_frame_sniffer @@ -1153,19 +1153,19 @@ mn10300_frame_unwind_init (struct gdbarch *gdbarch) */ static CORE_ADDR -mn10300_push_dummy_call (struct gdbarch *gdbarch, +mn10300_push_dummy_call (struct gdbarch *gdbarch, struct value *target_func, struct regcache *regcache, - CORE_ADDR bp_addr, + CORE_ADDR bp_addr, int nargs, struct value **args, - CORE_ADDR sp, + CORE_ADDR sp, function_call_return_method return_method, CORE_ADDR struct_addr) { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); const int push_size = register_size (gdbarch, E_PC_REGNUM); int regs_used; - int len, arg_len; + int len, arg_len; int stack_offset = 0; int argnum; const gdb_byte *val; @@ -1224,7 +1224,7 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch, while (regs_used < 2 && arg_len > 0) { - regcache_cooked_write_unsigned (regcache, regs_used, + regcache_cooked_write_unsigned (regcache, regs_used, extract_unsigned_integer (val, push_size, byte_order)); val += push_size; arg_len -= push_size; @@ -1268,14 +1268,14 @@ mn10300_push_dummy_call (struct gdbarch *gdbarch, expected to allocate any additional stack. On the other hand, if the SP values are different, the difference determines the additional stack that must be allocated. - + Note that we don't update the return value though because that's the value of the stack just after pushing the arguments, but prior to performing the call. This value is needed in order to construct the frame ID of the dummy call. */ { CORE_ADDR func_addr = find_function_addr (target_func, NULL); - CORE_ADDR unwound_sp + CORE_ADDR unwound_sp = gdbarch_unwind_sp (gdbarch, create_new_frame (sp, func_addr)); if (sp != unwound_sp) regcache_cooked_write_unsigned (regcache, E_SP_REGNUM, @@ -1389,7 +1389,7 @@ mn10300_gdbarch_init (struct gdbarch_info info, /* Stage 2 */ set_gdbarch_return_value (gdbarch, mn10300_return_value); - + /* Stage 3 -- get target calls working. */ set_gdbarch_push_dummy_call (gdbarch, mn10300_push_dummy_call); /* set_gdbarch_return_value (store, extract) */ @@ -1402,7 +1402,7 @@ mn10300_gdbarch_init (struct gdbarch_info info, return gdbarch; } - + /* Dump out the mn10300 specific architecture information. */ static void diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c index 7aa9b0536d5..831c95e0fa1 100644 --- a/gdb/moxie-tdep.c +++ b/gdb/moxie-tdep.c @@ -169,12 +169,12 @@ moxie_analyze_prologue (CORE_ADDR start_addr, CORE_ADDR end_addr, { offset = read_memory_integer (next_addr + 2, 4, byte_order); inst2 = read_memory_unsigned_integer (next_addr + 6, 2, byte_order); - + if (inst2 == 0x291e) /* sub.l $sp, $r12 */ { cache->framesize += offset; } - + return (next_addr + 8); } else if ((inst & 0xff00) == 0x9100) /* dec $sp, X */ @@ -220,10 +220,10 @@ moxie_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) struct symbol *sym; struct moxie_frame_cache cache; CORE_ADDR plg_end; - + memset (&cache, 0, sizeof cache); - - plg_end = moxie_analyze_prologue (func_addr, + + plg_end = moxie_analyze_prologue (func_addr, func_end, &cache, gdbarch); /* Found a function. */ sym = lookup_symbol (func_name, nullptr, @@ -446,7 +446,7 @@ moxie_software_single_step (struct regcache *regcache) return next_pcs; } -/* Given a return value in `regbuf' with a type `valtype', +/* Given a return value in `regbuf' with a type `valtype', extract and copy its value into `valbuf'. */ static void @@ -641,7 +641,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, { /* This is a Form 3 instruction. */ int opcode = (inst >> 10 & 0xf); - + switch (opcode) { case 0x00: /* beq */ @@ -712,7 +712,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, { regcache->raw_read ( MOXIE_SP_REGNUM, (gdb_byte *) & tmpu32); - tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, + tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, 4, byte_order); if (record_full_arch_list_add_reg (regcache, MOXIE_FP_REGNUM) || (record_full_arch_list_add_reg (regcache, @@ -740,7 +740,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, { int reg = (inst >> 4) & 0xf; regcache->raw_read (reg, (gdb_byte *) & tmpu32); - tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, + tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, 4, byte_order); if (record_full_arch_list_add_reg (regcache, reg) || record_full_arch_list_add_mem (tmpu32 - 4, 4)) @@ -765,7 +765,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, break; case 0x09: /* sta.l */ { - tmpu32 = (uint32_t) moxie_process_readu (addr+2, buf, + tmpu32 = (uint32_t) moxie_process_readu (addr+2, buf, 4, byte_order); if (record_full_arch_list_add_mem (tmpu32, 4)) return -1; @@ -782,7 +782,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, { int reg = (inst >> 4) & 0xf; regcache->raw_read (reg, (gdb_byte *) & tmpu32); - tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, + tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, 4, byte_order); if (record_full_arch_list_add_mem (tmpu32, 4)) return -1; @@ -801,7 +801,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, uint32_t offset = (((int16_t) moxie_process_readu (addr+2, buf, 2, byte_order)) << 16 ) >> 16; regcache->raw_read (reg, (gdb_byte *) & tmpu32); - tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, + tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, 4, byte_order); tmpu32 += offset; if (record_full_arch_list_add_mem (tmpu32, 4)) @@ -842,7 +842,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, { regcache->raw_read ( MOXIE_SP_REGNUM, (gdb_byte *) & tmpu32); - tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, + tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, 4, byte_order); if (record_full_arch_list_add_reg (regcache, MOXIE_FP_REGNUM) || (record_full_arch_list_add_reg (regcache, @@ -869,7 +869,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, { int reg = (inst >> 4) & 0xf; regcache->raw_read (reg, (gdb_byte *) & tmpu32); - tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, + tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, 4, byte_order); if (record_full_arch_list_add_mem (tmpu32, 1)) return -1; @@ -895,7 +895,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, { int reg = (inst >> 4) & 0xf; regcache->raw_read (reg, (gdb_byte *) & tmpu32); - tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, + tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, 4, byte_order); if (record_full_arch_list_add_mem (tmpu32, 2)) return -1; @@ -931,7 +931,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, break; case 0x30: /* swi */ { - /* We currently implement support for libgloss' + /* We currently implement support for libgloss' system calls. */ int inum = moxie_process_readu (addr+2, buf, 4, byte_order); @@ -955,13 +955,13 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, /* Read buffer pointer is in $r1. */ regcache->raw_read (3, (gdb_byte *) & ptr); - ptr = extract_unsigned_integer ((gdb_byte *) & ptr, + ptr = extract_unsigned_integer ((gdb_byte *) & ptr, 4, byte_order); /* String length is at 0x12($fp). */ regcache->raw_read ( MOXIE_FP_REGNUM, (gdb_byte *) & tmpu32); - tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, + tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, 4, byte_order); length = moxie_process_readu (tmpu32+20, buf, 4, byte_order); @@ -1006,7 +1006,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, uint32_t offset = (((int16_t) moxie_process_readu (addr+2, buf, 2, byte_order)) << 16 ) >> 16; regcache->raw_read (reg, (gdb_byte *) & tmpu32); - tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, + tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, 4, byte_order); tmpu32 += offset; if (record_full_arch_list_add_mem (tmpu32, 1)) @@ -1026,7 +1026,7 @@ moxie_process_record (struct gdbarch *gdbarch, struct regcache *regcache, uint32_t offset = (((int16_t) moxie_process_readu (addr+2, buf, 2, byte_order)) << 16 ) >> 16; regcache->raw_read (reg, (gdb_byte *) & tmpu32); - tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, + tmpu32 = extract_unsigned_integer ((gdb_byte *) & tmpu32, 4, byte_order); tmpu32 += offset; if (record_full_arch_list_add_mem (tmpu32, 2)) diff --git a/gdb/moxie-tdep.h b/gdb/moxie-tdep.h index 8088de5ea23..23463e7aec4 100644 --- a/gdb/moxie-tdep.h +++ b/gdb/moxie-tdep.h @@ -1,5 +1,5 @@ /* Target-dependent code for Moxie - + Copyright (C) 2009-2025 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/nat/linux-osdata.h b/gdb/nat/linux-osdata.h index 6b263c51887..e4a4369667c 100644 --- a/gdb/nat/linux-osdata.h +++ b/gdb/nat/linux-osdata.h @@ -1,5 +1,5 @@ /* Linux-specific functions to retrieve OS data. - + Copyright (C) 2009-2025 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/nat/windows-nat.c b/gdb/nat/windows-nat.c index 7b0fbc53413..ff6ab9c584a 100644 --- a/gdb/nat/windows-nat.c +++ b/gdb/nat/windows-nat.c @@ -895,7 +895,7 @@ bad_GetConsoleFontSize (HANDLE w, DWORD nFont) size.Y = 12; return size; } - + /* See windows-nat.h. */ bool diff --git a/gdb/nat/x86-gcc-cpuid.h b/gdb/nat/x86-gcc-cpuid.h index 9e27fd88127..978fec242ce 100644 --- a/gdb/nat/x86-gcc-cpuid.h +++ b/gdb/nat/x86-gcc-cpuid.h @@ -13,16 +13,16 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 3, or (at your option) any * later version. - * + * * This file is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. - * + * * Under Section 7 of GPL version 3, you are granted additional * permissions described in the GCC Runtime Library Exception, version * 3.1, as published by the Free Software Foundation. - * + * * You should have received a copy of the GNU General Public License and * a copy of the GCC Runtime Library Exception along with this program; * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see diff --git a/gdb/netbsd-tdep.c b/gdb/netbsd-tdep.c index 3793bd2fa3a..ea17acbc115 100644 --- a/gdb/netbsd-tdep.c +++ b/gdb/netbsd-tdep.c @@ -3,9 +3,9 @@ Copyright (C) 2002-2025 Free Software Foundation, Inc. Contributed by Wasabi Systems, Inc. - + This file is part of GDB. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c index e70dc12e201..b6f42b982eb 100644 --- a/gdb/objc-lang.c +++ b/gdb/objc-lang.c @@ -53,9 +53,9 @@ struct objc_object { }; struct objc_class { - CORE_ADDR isa; - CORE_ADDR super_class; - CORE_ADDR name; + CORE_ADDR isa; + CORE_ADDR super_class; + CORE_ADDR name; long version; long info; long instance_size; @@ -93,7 +93,7 @@ lookup_struct_typedef (const char *name, const struct block *block, int noerr) { if (noerr) return 0; - else + else error (_("No struct type named %s."), name); } if (sym->type ()->code () != TYPE_CODE_STRUCT) @@ -101,13 +101,13 @@ lookup_struct_typedef (const char *name, const struct block *block, int noerr) if (noerr) return 0; else - error (_("This context has class, union or enum %s, not a struct."), + error (_("This context has class, union or enum %s, not a struct."), name); } return sym; } -CORE_ADDR +CORE_ADDR lookup_objc_class (struct gdbarch *gdbarch, const char *classname) { struct type *char_type = builtin_type (gdbarch)->builtin_char; @@ -162,13 +162,13 @@ lookup_child_selector (struct gdbarch *gdbarch, const char *selname) return 0; } - selstring = value_coerce_array (value_string (selname, + selstring = value_coerce_array (value_string (selname, strlen (selname) + 1, char_type)); return value_as_long (call_function_by_hand (function, NULL, selstring)); } -struct value * +struct value * value_nsstring (struct gdbarch *gdbarch, const char *ptr, int len) { struct type *char_type = builtin_type (gdbarch)->builtin_char; @@ -203,9 +203,9 @@ value_nsstring (struct gdbarch *gdbarch, const char *ptr, int len) = find_function_in_inferior("+[NSString stringWithCString:]", NULL); type = builtin_type (gdbarch)->builtin_long; - stringValue[0] = value_from_longest + stringValue[0] = value_from_longest (type, lookup_objc_class (gdbarch, "NSString")); - stringValue[1] = value_from_longest + stringValue[1] = value_from_longest (type, lookup_child_selector (gdbarch, "stringWithCString:")); nsstringValue = call_function_by_hand(function, NULL, stringValue); } @@ -552,7 +552,7 @@ compare_selectors (const void *a, const void *b) * Implements the "Info selectors" command. Takes an optional regexp * arg. Lists all objective c selectors that match the regexp. Works * by grepping through all symbols for objective c methods. Output list - * is sorted and uniqued. + * is sorted and uniqued. */ static void @@ -623,10 +623,10 @@ info_selectors_command (const char *regexp, int from_tty) continue; } if (regexp == NULL || re_exec(++name) != 0) - { + { const char *mystart = name; const char *myend = strchr (mystart, ']'); - + if (myend && (myend - mystart > maxlen)) maxlen = myend - mystart; /* Get longest selector. */ matches++; @@ -636,7 +636,7 @@ info_selectors_command (const char *regexp, int from_tty) } if (matches) { - gdb_printf (_("Selectors matching \"%s\":\n\n"), + gdb_printf (_("Selectors matching \"%s\":\n\n"), regexp ? regexp : "*"); sym_arr = XALLOCAVEC (struct symbol *, matches); @@ -662,7 +662,7 @@ info_selectors_command (const char *regexp, int from_tty) } } - qsort (sym_arr, matches, sizeof (struct minimal_symbol *), + qsort (sym_arr, matches, sizeof (struct minimal_symbol *), compare_selectors); /* Prevent compare on first iteration. */ asel[0] = 0; @@ -694,7 +694,7 @@ info_selectors_command (const char *regexp, int from_tty) * Function: compare_classes (const void *, const void *) * * Comparison function for use with qsort. Arguments are symbols or - * msymbols Compares class part of objc method name alphabetically. + * msymbols Compares class part of objc method name alphabetically. */ static int @@ -717,7 +717,7 @@ compare_classes (const void *a, const void *b) * Lists all objective c classes that match the optional regexp. * Works by grepping through the list of objective c methods. List will * be sorted and uniqued (since one class may have many methods). - * BUGS: will not list a class that has no methods. + * BUGS: will not list a class that has no methods. */ static void @@ -765,11 +765,11 @@ info_classes_command (const char *regexp, int from_tty) (name[0] == '-' || name[0] == '+') && name[1] == '[') /* Got a method name. */ if (regexp == NULL || re_exec(name+2) != 0) - { + { /* Compute length of classname part. */ const char *mystart = name + 2; const char *myend = strchr (mystart, ' '); - + if (myend && (myend - mystart > maxlen)) maxlen = myend - mystart; matches++; @@ -778,7 +778,7 @@ info_classes_command (const char *regexp, int from_tty) } if (matches) { - gdb_printf (_("Classes matching \"%s\":\n\n"), + gdb_printf (_("Classes matching \"%s\":\n\n"), regexp ? regexp : "*"); sym_arr = XALLOCAVEC (struct symbol *, matches); matches = 0; @@ -796,7 +796,7 @@ info_classes_command (const char *regexp, int from_tty) } } - qsort (sym_arr, matches, sizeof (struct minimal_symbol *), + qsort (sym_arr, matches, sizeof (struct minimal_symbol *), compare_classes); /* Prevent compare on first iteration. */ aclass[0] = 0; @@ -823,7 +823,7 @@ info_classes_command (const char *regexp, int from_tty) gdb_printf (_("No classes matching \"%s\"\n"), regexp ? regexp : "*"); } -static char * +static char * parse_selector (char *method, char **selector) { char *s1 = NULL; @@ -837,13 +837,13 @@ parse_selector (char *method, char **selector) s1 = method; s1 = skip_spaces (s1); - if (*s1 == '\'') + if (*s1 == '\'') { found_quote = 1; s1++; } s1 = skip_spaces (s1); - + nselector = s1; s2 = s1; @@ -864,7 +864,7 @@ parse_selector (char *method, char **selector) s2 = skip_spaces (s2); if (found_quote) { - if (*s2 == '\'') + if (*s2 == '\'') s2++; s2 = skip_spaces (s2); } @@ -875,7 +875,7 @@ parse_selector (char *method, char **selector) return s2; } -static char * +static char * parse_method (char *method, char *type, char **theclass, char **category, char **selector) { @@ -892,17 +892,17 @@ parse_method (char *method, char *type, char **theclass, gdb_assert (theclass != NULL); gdb_assert (category != NULL); gdb_assert (selector != NULL); - + s1 = method; s1 = skip_spaces (s1); - if (*s1 == '\'') + if (*s1 == '\'') { found_quote = 1; s1++; } s1 = skip_spaces (s1); - + if ((s1[0] == '+') || (s1[0] == '-')) ntype = *s1++; @@ -915,10 +915,10 @@ parse_method (char *method, char *type, char **theclass, nclass = s1; while (c_isalnum (*s1) || (*s1 == '_')) s1++; - + s2 = s1; s2 = skip_spaces (s2); - + if (*s2 == '(') { s2++; @@ -953,7 +953,7 @@ parse_method (char *method, char *type, char **theclass, s2 = skip_spaces (s2); if (found_quote) { - if (*s2 != '\'') + if (*s2 != '\'') return NULL; s2++; s2 = skip_spaces (s2); @@ -972,7 +972,7 @@ parse_method (char *method, char *type, char **theclass, } static void -find_methods (char type, const char *theclass, const char *category, +find_methods (char type, const char *theclass, const char *category, const char *selector, std::vector *symbol_names) { @@ -1039,11 +1039,11 @@ find_methods (char type, const char *theclass, const char *category, && ((nclass == NULL) || (strcmp (theclass, nclass) != 0))) continue; - if ((category != NULL) && + if ((category != NULL) && ((ncategory == NULL) || (strcmp (category, ncategory) != 0))) continue; - if ((selector != NULL) && + if ((selector != NULL) && ((nselector == NULL) || (strcmp (selector, nselector) != 0))) continue; @@ -1071,7 +1071,7 @@ uniquify_strings (std::vector *strings) strings->end ()); } -/* +/* * Function: find_imps (const char *selector, struct symbol **sym_arr) * * Input: a string representing a selector @@ -1140,14 +1140,14 @@ find_imps (const char *method, std::vector *symbol_names) struct symbol *sym = lookup_symbol (selector, NULL, SEARCH_VFT, 0).symbol; - if (sym != NULL) + if (sym != NULL) symbol_names->push_back (sym->natural_name ()); else { bound_minimal_symbol msym = lookup_minimal_symbol (current_program_space, selector); - if (msym.minsym != NULL) + if (msym.minsym != NULL) symbol_names->push_back (msym.minsym->natural_name ()); } } @@ -1157,7 +1157,7 @@ find_imps (const char *method, std::vector *symbol_names) return method + (tmp - buf); } -static void +static void print_object_command (const char *args, int from_tty) { struct value *object, *function, *description; @@ -1240,7 +1240,7 @@ static struct objc_methcall methcalls[] = { * case the functions have moved for some reason. */ -static void +static void find_objc_msgsend (void) { unsigned int i; @@ -1256,10 +1256,10 @@ find_objc_msgsend (void) methcalls[i].name + 1); } if (func.minsym == NULL) - { + { methcalls[i].begin = 0; methcalls[i].end = 0; - continue; + continue; } methcalls[i].begin = func.value_address (); @@ -1282,9 +1282,9 @@ find_objc_msgsend (void) * dependent modules. */ -static int +static int find_objc_msgcall_submethod (int (*f) (CORE_ADDR, CORE_ADDR *), - CORE_ADDR pc, + CORE_ADDR pc, CORE_ADDR *new_pc) { try @@ -1302,7 +1302,7 @@ find_objc_msgcall_submethod (int (*f) (CORE_ADDR, CORE_ADDR *), return 0; } -int +int find_objc_msgcall (CORE_ADDR pc, CORE_ADDR *new_pc) { unsigned int i; @@ -1313,13 +1313,13 @@ find_objc_msgcall (CORE_ADDR pc, CORE_ADDR *new_pc) *new_pc = 0; } - for (i = 0; i < nmethcalls; i++) - if ((pc >= methcalls[i].begin) && (pc < methcalls[i].end)) + for (i = 0; i < nmethcalls; i++) + if ((pc >= methcalls[i].begin) && (pc < methcalls[i].end)) { - if (methcalls[i].stop_at != NULL) - return find_objc_msgcall_submethod (methcalls[i].stop_at, + if (methcalls[i].stop_at != NULL) + return find_objc_msgcall_submethod (methcalls[i].stop_at, pc, new_pc); - else + else return 0; } @@ -1338,7 +1338,7 @@ INIT_GDB_FILE (objc_language) add_com_alias ("po", print_object_cmd, class_vars, 1); } -static void +static void read_objc_method (struct gdbarch *gdbarch, CORE_ADDR addr, struct objc_method *method) { @@ -1357,15 +1357,15 @@ read_objc_methlist_nmethods (struct gdbarch *gdbarch, CORE_ADDR addr) return read_memory_unsigned_integer (addr + 4, 4, byte_order); } -static void +static void read_objc_methlist_method (struct gdbarch *gdbarch, CORE_ADDR addr, unsigned long num, struct objc_method *method) { gdb_assert (num < read_objc_methlist_nmethods (gdbarch, addr)); read_objc_method (gdbarch, addr + 8 + (12 * num), method); } - -static void + +static void read_objc_object (struct gdbarch *gdbarch, CORE_ADDR addr, struct objc_object *object) { @@ -1374,7 +1374,7 @@ read_objc_object (struct gdbarch *gdbarch, CORE_ADDR addr, object->isa = read_memory_unsigned_integer (addr, 4, byte_order); } -static void +static void read_objc_super (struct gdbarch *gdbarch, CORE_ADDR addr, struct objc_super *super) { @@ -1384,7 +1384,7 @@ read_objc_super (struct gdbarch *gdbarch, CORE_ADDR addr, super->theclass = read_memory_unsigned_integer (addr + 4, 4, byte_order); }; -static void +static void read_objc_class (struct gdbarch *gdbarch, CORE_ADDR addr, struct objc_class *theclass) { @@ -1410,7 +1410,7 @@ find_implementation_from_class (struct gdbarch *gdbarch, enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR subclass = theclass; - while (subclass != 0) + while (subclass != 0) { struct objc_class class_str; @@ -1418,27 +1418,27 @@ find_implementation_from_class (struct gdbarch *gdbarch, read_objc_class (gdbarch, subclass, &class_str); - for (;;) + for (;;) { CORE_ADDR mlist; unsigned long nmethods; unsigned long i; - - mlist = read_memory_unsigned_integer (class_str.methods + + + mlist = read_memory_unsigned_integer (class_str.methods + (4 * mlistnum), 4, byte_order); - if (mlist == 0) + if (mlist == 0) break; nmethods = read_objc_methlist_nmethods (gdbarch, mlist); - for (i = 0; i < nmethods; i++) + for (i = 0; i < nmethods; i++) { struct objc_method meth_str; read_objc_methlist_method (gdbarch, mlist, i, &meth_str); - if (meth_str.name == sel) + if (meth_str.name == sel) /* FIXME: hppa arch was doing a pointer dereference here. There needs to be a better way to do that. */ return meth_str.imp; @@ -1529,7 +1529,7 @@ resolve_msgsend_super (CORE_ADDR pc, CORE_ADDR *new_pc) read_objc_super (gdbarch, super, &sstr); if (sstr.theclass == 0) return 0; - + res = find_implementation_from_class (gdbarch, sstr.theclass, sel); if (new_pc != 0) *new_pc = res; @@ -1557,7 +1557,7 @@ resolve_msgsend_super_stret (CORE_ADDR pc, CORE_ADDR *new_pc) read_objc_super (gdbarch, super, &sstr); if (sstr.theclass == 0) return 0; - + res = find_implementation_from_class (gdbarch, sstr.theclass, sel); if (new_pc != 0) *new_pc = res; diff --git a/gdb/objfiles.c b/gdb/objfiles.c index bc909db7d0e..f131bab1dd5 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -531,7 +531,7 @@ relocate_one_symbol (struct symbol *sym, struct objfile *objfile, Return non-zero iff any change happened. */ static int -objfile_relocate1 (struct objfile *objfile, +objfile_relocate1 (struct objfile *objfile, const section_offsets &new_offsets) { section_offsets delta (objfile->section_offsets.size ()); diff --git a/gdb/osabi.h b/gdb/osabi.h index 2f359a13774..75deaf45cc5 100644 --- a/gdb/osabi.h +++ b/gdb/osabi.h @@ -1,6 +1,6 @@ /* OS ABI variant handling for GDB. Copyright (C) 2001-2025 Free Software Foundation, Inc. - + This file is part of GDB. This program is free software; you can redistribute it and/or modify diff --git a/gdb/osdata.c b/gdb/osdata.c index 788dd2a3459..c35e9ae8b12 100644 --- a/gdb/osdata.c +++ b/gdb/osdata.c @@ -209,7 +209,7 @@ info_osdata (const char *type) if (*type == '\0' && nrows == 0) error (_("Available types of OS data not reported.")); - + if (!osdata->items.empty ()) { last = &osdata->items.back (); diff --git a/gdb/parse.c b/gdb/parse.c index e24a0d01d54..d76768f41d7 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -598,16 +598,16 @@ fits_in_type (int n_sign, const gdb_mpz &n, int type_bits, bool type_signed_p) return n < max; } -/* This function avoids direct calls to fprintf +/* This function avoids direct calls to fprintf in the parser generated debug code. */ void parser_fprintf (FILE *x, const char *y, ...) -{ +{ va_list args; va_start (args, y); if (x == stderr) - gdb_vprintf (gdb_stderr, y, args); + gdb_vprintf (gdb_stderr, y, args); else { gdb_printf (gdb_stderr, " Unknown FILE used.\n"); diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index 568202ae36f..27586d9a735 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -74,7 +74,7 @@ watchpoints and hardware-accelerated condition evaluation. */ #ifndef PPC_PTRACE_GETHWDBGINFO -/* Not having PPC_PTRACE_GETHWDBGINFO defined means that the PowerPC HWDEBUG +/* Not having PPC_PTRACE_GETHWDBGINFO defined means that the PowerPC HWDEBUG ptrace interface is not present in ptrace.h, so we'll have to pretty much include it all here so that the code at least compiles on older systems. */ #define PPC_PTRACE_GETHWDBGINFO 0x89 @@ -653,7 +653,7 @@ ppc_register_u_addr (struct gdbarch *gdbarch, int regno) int wordsize = sizeof (long); /* General purpose registers occupy 1 slot each in the buffer. */ - if (regno >= tdep->ppc_gp0_regnum + if (regno >= tdep->ppc_gp0_regnum && regno < tdep->ppc_gp0_regnum + ppc_num_gprs) u_addr = ((regno - tdep->ppc_gp0_regnum + PT_R0) * wordsize); @@ -1110,7 +1110,7 @@ fetch_register (struct regcache *regcache, int tid, int regno) size_t padding = (bytes_transferred - register_size (gdbarch, regno)); regcache->raw_supply (regno, buf + padding); } - else + else internal_error (_("fetch_register: unexpected byte order: %d"), gdbarch_byte_order (gdbarch)); } @@ -1118,7 +1118,7 @@ fetch_register (struct regcache *regcache, int tid, int regno) /* This function actually issues the request to ptrace, telling it to get all general-purpose registers and put them into the specified regset. - + If the ptrace request does not exist, this function returns 0 and properly sets the have_ptrace_* flag. If the request fails, this function calls perror_with_name. Otherwise, if the request @@ -1170,7 +1170,7 @@ fetch_gp_regs (struct regcache *regcache, int tid) /* This function actually issues the request to ptrace, telling it to get all floating-point registers and put them into the specified regset. - + If the ptrace request does not exist, this function returns 0 and properly sets the have_ptrace_* flag. If the request fails, this function calls perror_with_name. Otherwise, if the request @@ -1211,7 +1211,7 @@ fetch_fp_regs (struct regcache *regcache, int tid) if (have_ptrace_getsetfpregs) if (fetch_all_fp_regs (regcache, tid)) return; - + /* If we've hit this point, it doesn't really matter which architecture we are using. We just need to read the registers in the "old-fashioned way". */ @@ -1219,7 +1219,7 @@ fetch_fp_regs (struct regcache *regcache, int tid) fetch_register (regcache, tid, tdep->ppc_fp0_regnum + i); } -static void +static void fetch_ppc_registers (struct regcache *regcache, int tid) { struct gdbarch *gdbarch = regcache->arch (); @@ -1328,7 +1328,7 @@ ppc_linux_nat_target::fetch_registers (struct regcache *regcache, int regno) if (regno == -1) fetch_ppc_registers (regcache, tid); - else + else fetch_register (regcache, tid, regno); } @@ -1647,7 +1647,7 @@ store_register (const struct regcache *regcache, int tid, int regno) ptrace (PTRACE_POKEUSER, tid, (PTRACE_TYPE_ARG3) regaddr, l); regaddr += sizeof (long); - if (errno == EIO + if (errno == EIO && (regno == tdep->ppc_fpscr_regnum || regno == PPC_ORIG_R3_REGNUM || regno == PPC_TRAP_REGNUM)) @@ -1670,7 +1670,7 @@ store_register (const struct regcache *regcache, int tid, int regno) /* This function actually issues the request to ptrace, telling it to store all general-purpose registers present in the specified regset. - + If the ptrace request does not exist, this function returns 0 and properly sets the have_ptrace_* flag. If the request fails, this function calls perror_with_name. Otherwise, if the request @@ -1732,7 +1732,7 @@ store_gp_regs (const struct regcache *regcache, int tid, int regno) /* This function actually issues the request to ptrace, telling it to store all floating-point registers present in the specified regset. - + If the ptrace request does not exist, this function returns 0 and properly sets the have_ptrace_* flag. If the request fails, this function calls perror_with_name. Otherwise, if the request @@ -1796,7 +1796,7 @@ store_ppc_registers (const struct regcache *regcache, int tid) { struct gdbarch *gdbarch = regcache->arch (); ppc_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - + store_gp_regs (regcache, tid, -1); if (tdep->ppc_fp0_regnum >= 0) store_fp_regs (regcache, tid, -1); @@ -2145,7 +2145,7 @@ ppc_linux_nat_target::region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) return 0; } /* addr+len must fall in the 8 byte watchable region for DABR-based - processors (i.e., server processors). Without the new PowerPC HWDEBUG + processors (i.e., server processors). Without the new PowerPC HWDEBUG ptrace interface, DAC-based processors (i.e., embedded processors) will use addresses aligned to 4-bytes due to the way the read/write flags are passed in the old ptrace interface. */ diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c index b5f8bbfd59e..922aa06034c 100644 --- a/gdb/ppc-linux-tdep.c +++ b/gdb/ppc-linux-tdep.c @@ -118,7 +118,7 @@ actually called, the code in the PLT is hit and the function is resolved. In order to better illustrate this, an example is in order; the following example is from the gdb testsuite. - + We start the program shmain. [kev@arroyo testsuite]$ ../gdb gdb.base/shmain @@ -142,7 +142,7 @@ Now run 'til main. (gdb) r - Starting program: gdb.base/shmain + Starting program: gdb.base/shmain Breakpoint 1 at 0xffaf790: file gdb.base/shr1.c, line 19. Breakpoint 2, main () @@ -251,7 +251,7 @@ static enum return_value_convention ppc_linux_return_value (struct gdbarch *gdbarch, struct value *function, struct type *valtype, struct regcache *regcache, struct value **read_value, const gdb_byte *writebuf) -{ +{ gdb_byte *readbuf = nullptr; if (read_value != nullptr) { @@ -1305,7 +1305,7 @@ ppc64_linux_sighandler_cache_init (const struct tramp_frame *self, static struct tramp_frame ppc32_linux_sigaction_tramp_frame = { SIGTRAMP_FRAME, 4, - { + { { 0x380000ac, ULONGEST_MAX }, /* li r0, 172 */ { 0x44000002, ULONGEST_MAX }, /* sc */ { TRAMP_SENTINEL_INSN }, @@ -1326,7 +1326,7 @@ static struct tramp_frame ppc64_linux_sigaction_tramp_frame = { static struct tramp_frame ppc32_linux_sighandler_tramp_frame = { SIGTRAMP_FRAME, 4, - { + { { 0x38000077, ULONGEST_MAX }, /* li r0,119 */ { 0x44000002, ULONGEST_MAX }, /* sc */ { TRAMP_SENTINEL_INSN }, @@ -1336,7 +1336,7 @@ static struct tramp_frame ppc32_linux_sighandler_tramp_frame = { static struct tramp_frame ppc64_linux_sighandler_tramp_frame = { SIGTRAMP_FRAME, 4, - { + { { 0x38210080, ULONGEST_MAX }, /* addi r1,r1,128 */ { 0x38000077, ULONGEST_MAX }, /* li r0,119 */ { 0x44000002, ULONGEST_MAX }, /* sc */ @@ -2302,7 +2302,7 @@ ppc_linux_init_abi (struct gdbarch_info info, set_gdbarch_skip_solib_resolver (gdbarch, glibc_skip_solib_resolver); } - + if (tdep->wordsize == 8) { if (tdep->elf_abi == POWERPC_ELF_V1) diff --git a/gdb/ppc64-tdep.c b/gdb/ppc64-tdep.c index a8dcf6fc627..7c535074893 100644 --- a/gdb/ppc64-tdep.c +++ b/gdb/ppc64-tdep.c @@ -507,7 +507,7 @@ static const struct ppc_insn_pattern ppc64_standard_linkage12[] = 10000388: 7d 69 03 a6 mtctr r11 1000038c: e8 42 80 80 ld r2,-32640(r2) 10000390: 28 22 00 00 cmpldi r2,0 - 10000394: 4c e2 04 20 bnectr+ + 10000394: 4c e2 04 20 bnectr+ 10000398: 48 00 03 a0 b 10000738 - But since this is the first time that PLT entry has been used, it @@ -754,7 +754,7 @@ ppc64_convert_from_func_ptr_addr (struct gdbarch *gdbarch, /* Check if ADDR points to a function descriptor. */ if (s && strcmp (s->the_bfd_section->name, ".opd") == 0) { - /* There may be relocations that need to be applied to the .opd + /* There may be relocations that need to be applied to the .opd section. Unfortunately, this function may be called at a time where these relocations have not yet been performed -- this can happen for example shortly after a library has been loaded with diff --git a/gdb/printcmd.c b/gdb/printcmd.c index 887c8546c42..ba761069fbd 100644 --- a/gdb/printcmd.c +++ b/gdb/printcmd.c @@ -607,7 +607,7 @@ build_address_symbolic (struct gdbarch *gdbarch, CORE_ADDR name_location = 0; struct obj_section *section = NULL; const char *name_temp = ""; - + /* Let's say it is mapped (not unmapped). */ *unmapped = 0; @@ -623,7 +623,7 @@ build_address_symbolic (struct gdbarch *gdbarch, } } - /* Try to find the address in both the symbol table and the minsyms. + /* Try to find the address in both the symbol table and the minsyms. In most cases, we'll prefer to use the symbol instead of the minsym. However, there are cases (see below) where we'll choose to use the minsym instead. */ @@ -665,7 +665,7 @@ build_address_symbolic (struct gdbarch *gdbarch, if (msymbol.minsym != NULL) { /* Use the minsym if no symbol is found. - + Additionally, use the minsym instead of a (found) symbol if the following conditions all hold: 1) The prefer_sym_over_minsym flag is false. @@ -2036,7 +2036,7 @@ undisplay_command (const char *args, int from_tty) dont_repeat (); } -/* Display a single auto-display. +/* Display a single auto-display. Do nothing if the display cannot be printed in the current context, or if the display is disabled. */ @@ -2690,7 +2690,7 @@ ui_printf (const char *arg, struct ui_file *stream) if (*s++ != '"') error (_("Bad format string, non-terminated '\"'.")); - + s = skip_spaces (s); if (*s != ',' && *s != 0) diff --git a/gdb/proc-api.c b/gdb/proc-api.c index f3d4e147a1f..5c592ddbdd8 100644 --- a/gdb/proc-api.c +++ b/gdb/proc-api.c @@ -130,12 +130,12 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line) break; if (info_verbose) - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "%s:%d -- ", file, line); switch (opcode) { case PCSET: - fprintf (procfs_file ? procfs_file : stdout, - "write (PCSET, %s) %s\n", + fprintf (procfs_file ? procfs_file : stdout, + "write (PCSET, %s) %s\n", arg[1] == PR_FORK ? "PR_FORK" : arg[1] == PR_RLC ? "PR_RLC" : arg[1] == PR_ASYNC ? "PR_ASYNC" : @@ -143,8 +143,8 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line) info_verbose ? rw_table[i].desc : ""); break; case PCUNSET: - fprintf (procfs_file ? procfs_file : stdout, - "write (PCRESET, %s) %s\n", + fprintf (procfs_file ? procfs_file : stdout, + "write (PCRESET, %s) %s\n", arg[1] == PR_FORK ? "PR_FORK" : arg[1] == PR_RLC ? "PR_RLC" : arg[1] == PR_ASYNC ? "PR_ASYNC" : @@ -152,46 +152,46 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line) info_verbose ? rw_table[i].desc : ""); break; case PCSTRACE: - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "write (PCSTRACE) "); proc_prettyfprint_signalset (procfs_file ? procfs_file : stdout, (sigset_t *) &arg[1], 0); break; case PCSFAULT: - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "write (PCSFAULT) "); proc_prettyfprint_faultset (procfs_file ? procfs_file : stdout, (fltset_t *) &arg[1], 0); break; case PCSENTRY: - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "write (PCSENTRY) "); proc_prettyfprint_syscalls (procfs_file ? procfs_file : stdout, (sysset_t *) &arg[1], 0); break; case PCSEXIT: - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "write (PCSEXIT) "); proc_prettyfprint_syscalls (procfs_file ? procfs_file : stdout, (sysset_t *) &arg[1], 0); break; case PCSHOLD: - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "write (PCSHOLD) "); proc_prettyfprint_signalset (procfs_file ? procfs_file : stdout, (sigset_t *) &arg[1], 0); break; case PCSSIG: - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "write (PCSSIG) "); proc_prettyfprint_signal (procfs_file ? procfs_file : stdout, - arg[1] ? ((siginfo_t *) &arg[1])->si_signo - : 0, + arg[1] ? ((siginfo_t *) &arg[1])->si_signo + : 0, 0); fprintf (procfs_file ? procfs_file : stdout, "\n"); break; case PCRUN: - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "write (PCRUN) "); if (arg[1] & PRCSIG) fprintf (procfs_file ? procfs_file : stdout, "clearSig "); @@ -203,11 +203,11 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line) fprintf (procfs_file ? procfs_file : stdout, "syscallAbort "); if (arg[1] & PRSTOP) fprintf (procfs_file ? procfs_file : stdout, "stopReq "); - + fprintf (procfs_file ? procfs_file : stdout, "\n"); break; case PCKILL: - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "write (PCKILL) "); proc_prettyfprint_signal (procfs_file ? procfs_file : stdout, arg[1], 0); @@ -216,19 +216,19 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line) default: { if (rw_table[i].name) - fprintf (procfs_file ? procfs_file : stdout, - "write (%s) %s\n", - rw_table[i].name, + fprintf (procfs_file ? procfs_file : stdout, + "write (%s) %s\n", + rw_table[i].name, info_verbose ? rw_table[i].desc : ""); else { if (lseek_offset != -1) - fprintf (procfs_file ? procfs_file : stdout, - "write (, %lud bytes at 0x%08lx) \n", + fprintf (procfs_file ? procfs_file : stdout, + "write (, %lud bytes at 0x%08lx) \n", (unsigned long) len, (unsigned long) lseek_offset); else - fprintf (procfs_file ? procfs_file : stdout, - "write (, %lud bytes) \n", + fprintf (procfs_file ? procfs_file : stdout, + "write (, %lud bytes) \n", (unsigned long) len); } break; @@ -241,10 +241,10 @@ write_with_trace (int fd, void *varg, size_t len, char *file, int line) ret = write (fd, (void *) arg, len); if (procfs_trace && ret != len) { - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "[write (%s) FAILED! (%s)]\n", - rw_table[i].name != NULL ? - rw_table[i].name : "", + rw_table[i].name != NULL ? + rw_table[i].name : "", safe_strerror (errno)); if (procfs_file) fflush (procfs_file); @@ -265,8 +265,8 @@ lseek_with_trace (int fd, off_t offset, int whence, char *file, int line) lseek_offset = ret; if (procfs_trace && (ret == -1 || errno != 0)) { - fprintf (procfs_file ? procfs_file : stdout, - "[lseek (0x%08lx) FAILED! (%s)]\n", + fprintf (procfs_file ? procfs_file : stdout, + "[lseek (0x%08lx) FAILED! (%s)]\n", (unsigned long) offset, safe_strerror (errno)); if (procfs_file) fflush (procfs_file); @@ -286,18 +286,18 @@ open_with_trace (char *filename, int mode, char *file, int line) if (procfs_trace) { if (info_verbose) - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "%s:%d -- ", file, line); if (errno) { - fprintf (procfs_file ? procfs_file : stdout, - "[open FAILED! (%s) line %d]\\n", + fprintf (procfs_file ? procfs_file : stdout, + "[open FAILED! (%s) line %d]\\n", safe_strerror (errno), line); } else { - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "%d = open (%s, ", ret, filename); if (mode == O_RDONLY) fprintf (procfs_file ? procfs_file : stdout, "O_RDONLY) %d\n", @@ -327,13 +327,13 @@ close_with_trace (int fd, char *file, int line) if (procfs_trace) { if (info_verbose) - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "%s:%d -- ", file, line); if (errno) - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "[close FAILED! (%s)]\n", safe_strerror (errno)); else - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "%d = close (%d)\n", ret, fd); if (procfs_file) fflush (procfs_file); @@ -351,9 +351,9 @@ wait_with_trace (int *wstat, char *file, int line) if (procfs_trace) { if (info_verbose) - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "%s:%d -- ", file, line); - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "wait (line %d) ", line); if (procfs_file) fflush (procfs_file); @@ -363,10 +363,10 @@ wait_with_trace (int *wstat, char *file, int line) if (procfs_trace) { if (errno) - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "[wait FAILED! (%s)]\n", safe_strerror (errno)); else - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "returned pid %d, status 0x%x\n", ret, lstat); if (procfs_file) fflush (procfs_file); @@ -384,7 +384,7 @@ procfs_note (const char *msg, const char *file, int line) if (procfs_trace) { if (info_verbose) - fprintf (procfs_file ? procfs_file : stdout, + fprintf (procfs_file ? procfs_file : stdout, "%s:%d -- ", file, line); fprintf (procfs_file ? procfs_file : stdout, "%s", msg); if (procfs_file) @@ -402,11 +402,11 @@ proc_prettyfprint_status (long flags, int why, int what, int thread) fprintf (procfs_file ? procfs_file : stdout, "Thread %d: ", thread); - proc_prettyfprint_flags (procfs_file ? procfs_file : stdout, + proc_prettyfprint_flags (procfs_file ? procfs_file : stdout, flags, 0); if (flags & (PR_STOPPED | PR_ISTOP)) - proc_prettyfprint_why (procfs_file ? procfs_file : stdout, + proc_prettyfprint_why (procfs_file ? procfs_file : stdout, why, what, 0); if (procfs_file) fflush (procfs_file); diff --git a/gdb/proc-events.c b/gdb/proc-events.c index c6ed1f49b26..b9dad4070cb 100644 --- a/gdb/proc-events.c +++ b/gdb/proc-events.c @@ -563,9 +563,9 @@ proc_prettyprint_syscalls (sysset_t *sysset, int verbose) other signals second, with signals in each block ordered by their numerical values on a typical POSIX platform. */ -static struct trans signal_table[] = +static struct trans signal_table[] = { - { 0, "", "no signal" }, + { 0, "", "no signal" }, /* SIGINT, SIGILL, SIGABRT, SIGFPE, SIGSEGV and SIGTERM are ANSI-standard signals and are always available. */ @@ -717,7 +717,7 @@ proc_prettyfprint_fault (FILE *file, int faultno, int verbose) return; } - fprintf (file, "Unknown hardware fault %d%c", + fprintf (file, "Unknown hardware fault %d%c", faultno, verbose ? '\n' : ' '); } diff --git a/gdb/proc-flags.c b/gdb/proc-flags.c index 522c1423c3c..faaa27486e8 100644 --- a/gdb/proc-flags.c +++ b/gdb/proc-flags.c @@ -20,7 +20,7 @@ /* * Pretty-print the prstatus flags. - * + * * Arguments: unsigned long flags, int verbose * */ diff --git a/gdb/proc-utils.h b/gdb/proc-utils.h index 85a6f40d2c9..ce403ccc78c 100644 --- a/gdb/proc-utils.h +++ b/gdb/proc-utils.h @@ -22,7 +22,7 @@ /* From proc-why.c */ /* - * Pretty-print functions for /proc data + * Pretty-print functions for /proc data */ extern void proc_prettyprint_why (unsigned long why, unsigned long what, @@ -56,7 +56,7 @@ extern void proc_prettyfprint_signal (FILE *file, int signo, int verbose); extern void proc_prettyfprint_flags (FILE *file, unsigned long flags, int verbose); -extern void proc_prettyfprint_why (FILE *file, unsigned long why, +extern void proc_prettyfprint_why (FILE *file, unsigned long why, unsigned long what, int verbose); extern void proc_prettyfprint_fault (FILE *file, int faultno, int verbose); diff --git a/gdb/proc-why.c b/gdb/proc-why.c index 2e8d33c2c06..da45cf9e53f 100644 --- a/gdb/proc-why.c +++ b/gdb/proc-why.c @@ -42,7 +42,7 @@ struct trans static struct trans pr_why_table[] = { - { PR_REQUESTED, "PR_REQUESTED", + { PR_REQUESTED, "PR_REQUESTED", "Directed to stop by debugger via P(IO)CSTOP or P(IO)CWSTOP" }, { PR_SIGNALLED, "PR_SIGNALLED", "Receipt of a traced signal" }, { PR_SYSENTRY, "PR_SYSENTRY", "Entry to a traced system call" }, diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c index 06237b6f1b3..e391fd339c5 100644 --- a/gdb/python/py-param.c +++ b/gdb/python/py-param.c @@ -297,7 +297,7 @@ set_parameter_value (parmpy_object *self, PyObject *value) { cmp = PyObject_IsTrue (value); if (cmp < 0 ) - return -1; + return -1; if (cmp == 1) self->value.autoboolval = AUTO_BOOLEAN_TRUE; else diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c index e2bfd6b7be3..f53a9028f29 100644 --- a/gdb/python/py-prettyprint.c +++ b/gdb/python/py-prettyprint.c @@ -412,7 +412,7 @@ print_children (PyObject *printer, const char *hint, print_stack_unless_memory_error (stream); /* Set a flag so we can know whether we printed all the available elements. */ - else + else done_flag = 1; break; } diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c index 5d8fab90c04..70dcb0c7ca2 100644 --- a/gdb/python/py-value.c +++ b/gdb/python/py-value.c @@ -145,7 +145,7 @@ convert_buffer_and_type_to_value (PyObject *obj, struct type *type, Py_buffer_up buffer_up; Py_buffer py_buf; - if (PyObject_CheckBuffer (obj) + if (PyObject_CheckBuffer (obj) && PyObject_GetBuffer (obj, &py_buf, PyBUF_SIMPLE) == 0) { /* Got a buffer, py_buf, out of obj. Cause it to be released diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index 51ace132ddc..e2baa6a70b5 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -1165,7 +1165,7 @@ gdbpy_type_ready (PyTypeObject *type, PyObject *mod = nullptr) # define PyType_Ready POISONED_PyType_Ready #endif -/* A class to manage lifecycle of Python objects for objects that are "owned" +/* A class to manage lifecycle of Python objects for objects that are "owned" by an objfile or a gdbarch. It keeps track of Python objects and when the "owning" object (objfile or gdbarch) is about to be freed, ensures that all Python objects "owned" by that object are properly invalidated. @@ -1175,9 +1175,9 @@ gdbpy_type_ready (PyTypeObject *type, PyObject *mod = nullptr) on demand and it is deleted when owning object is about to be freed. The storage class must provide two member types: - - * obj_type - the type of Python object whose lifecycle is managed. - * val_type - the type of GDB structure the Python objects are + + * obj_type - the type of Python object whose lifecycle is managed. + * val_type - the type of GDB structure the Python objects are representing. It must also provide following methods: @@ -1266,9 +1266,9 @@ struct gdbpy_default_invalidator }; /* A "storage" implementation suitable for temporary (on-demand) objects. */ -template > class gdbpy_tracking_registry_storage { @@ -1280,7 +1280,7 @@ public: { gdb_assert (obj != nullptr && obj->*val_slot != nullptr); - m_objects.insert (obj); + m_objects.insert (obj); } void remove (obj_type *obj) @@ -1288,7 +1288,7 @@ public: gdb_assert (obj != nullptr && obj->*val_slot != nullptr); gdb_assert (m_objects.contains (obj)); - m_objects.erase (obj); + m_objects.erase (obj); } ~gdbpy_tracking_registry_storage () @@ -1311,9 +1311,9 @@ protected: drops all their references the Python object is deallocated and removed from storage. */ -template > class gdbpy_memoizing_registry_storage { diff --git a/gdb/quick-symbol.h b/gdb/quick-symbol.h index b5308dc73d7..34dc60bc2c2 100644 --- a/gdb/quick-symbol.h +++ b/gdb/quick-symbol.h @@ -186,7 +186,7 @@ struct quick_symbol_functions /* Call FUN for every file defined in OBJFILE whose symtab is not already read in. - + FUN is passed the file's FILENAME and the file's FULLNAME (if need_fullname is true). */ virtual void map_symbol_filenames (objfile *objfile, diff --git a/gdb/record-full.c b/gdb/record-full.c index 396ba3283e1..2c79c09da74 100644 --- a/gdb/record-full.c +++ b/gdb/record-full.c @@ -104,7 +104,7 @@ struct record_full_reg_entry { unsigned short num; unsigned short len; - union + union { gdb_byte *ptr; gdb_byte buf[2 * sizeof (gdb_byte *)]; @@ -142,8 +142,8 @@ enum record_full_type Each instruction that is added to the execution log is represented by a variable number of list elements ('entries'). The instruction - will have one "reg" entry for each register that is changed by - executing the instruction (including the PC in every case). It + will have one "reg" entry for each register that is changed by + executing the instruction (including the PC in every case). It will also have one "mem" entry for each memory change. Finally, each instruction will have an "end" entry that separates it from the changes associated with the next instruction. */ @@ -872,7 +872,7 @@ record_full_exec_insn (struct regcache *regcache, entry->u.mem.mem_entry_not_accessible = 1; else { - if (target_write_memory (entry->u.mem.addr, + if (target_write_memory (entry->u.mem.addr, record_full_get_loc (entry), entry->u.mem.len)) { @@ -1152,8 +1152,8 @@ record_full_sig_handler (int signo) to know about, so the wait method just records them and keeps singlestepping. - In replay mode, this function emulates the recorded execution log, - one instruction at a time (forward or backward), and determines + In replay mode, this function emulates the recorded execution log, + one instruction at a time (forward or backward), and determines where to stop. */ static ptid_t @@ -2019,7 +2019,7 @@ record_full_goto_entry (struct record_full_entry *p) registers_changed (); reinit_frame_cache (); - + thread_info *thr = inferior_thread (); thr->set_stop_pc (regcache_read_pc (get_thread_regcache (thr))); print_stack_frame (get_selected_frame (NULL), 1, SRC_AND_LOC, 1); @@ -2319,7 +2319,7 @@ netorder64 (uint64_t input) { uint64_t ret; - store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret), + store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret), BFD_ENDIAN_BIG, input); return ret; } @@ -2329,7 +2329,7 @@ netorder32 (uint32_t input) { uint32_t ret; - store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret), + store_unsigned_integer ((gdb_byte *) &ret, sizeof (ret), BFD_ENDIAN_BIG, input); return ret; } @@ -2347,7 +2347,7 @@ record_full_restore (struct bfd &cbfd) /* "record_full_restore" can only be called when record list is empty. */ gdb_assert (record_full_first.next == NULL); - + if (record_debug) gdb_printf (gdb_stdlog, "Restoring recording from core file.\n"); @@ -2675,7 +2675,7 @@ record_full_base_target::save_record (const char *recfilename) /* Write memaddr. */ addr = netorder64 (record_full_list->u.mem.addr); - bfdcore_write (obfd.get (), osec, &addr, + bfdcore_write (obfd.get (), osec, &addr, sizeof (addr), &bfd_offset); /* Write memval. */ @@ -2688,7 +2688,7 @@ record_full_base_target::save_record (const char *recfilename) if (record_debug) gdb_printf (gdb_stdlog, " Writing record_full_end (1 + " - "%lu + %lu bytes)\n", + "%lu + %lu bytes)\n", (unsigned long) sizeof (signal), (unsigned long) sizeof (count)); /* Write signal value. */ diff --git a/gdb/regcache.h b/gdb/regcache.h index 7eb49b3ae66..3ebf12cc3d3 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -167,7 +167,7 @@ extern struct type *register_type (struct gdbarch *gdbarch, int regnum); /* Return the size of register REGNUM. All registers should have only one size. */ - + extern int register_size (struct gdbarch *gdbarch, int regnum); using register_read_ftype diff --git a/gdb/regset.h b/gdb/regset.h index f16164016ca..e7505d36b20 100644 --- a/gdb/regset.h +++ b/gdb/regset.h @@ -27,7 +27,7 @@ struct regcache; typedef void (supply_regset_ftype) (const struct regset *, struct regcache *, int, const void *, size_t); -typedef void (collect_regset_ftype) (const struct regset *, +typedef void (collect_regset_ftype) (const struct regset *, const struct regcache *, int, void *, size_t); diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c index 7f80de88d6d..ad1b33e4e19 100644 --- a/gdb/remote-fileio.c +++ b/gdb/remote-fileio.c @@ -624,7 +624,7 @@ remote_fileio_func_write (remote_target *remote, char *buf) return; } length = (size_t) num; - + buffer = (gdb_byte *) xmalloc (length); if (target_read_memory (ptrval, buffer, length) != 0) { @@ -707,7 +707,7 @@ remote_fileio_func_lseek (remote_target *remote, char *buf) remote_fileio_reply (remote, -1, FILEIO_EINVAL); return; } - + ret = lseek (fd, offset, flag); if (ret == (off_t) -1) @@ -731,14 +731,14 @@ remote_fileio_func_rename (remote_target *remote, char *buf) remote_fileio_ioerror (remote); return; } - + /* 2. Parameter: Ptr to newpath / length incl. trailing zero */ if (remote_fileio_extract_ptr_w_len (&buf, &new_ptr, &new_len)) { remote_fileio_ioerror (remote); return; } - + /* Request oldpath using 'm' packet */ oldpath = (char *) alloca (old_len); if (target_read_memory (old_ptr, (gdb_byte *) oldpath, old_len) != 0) @@ -746,7 +746,7 @@ remote_fileio_func_rename (remote_target *remote, char *buf) remote_fileio_ioerror (remote); return; } - + /* Request newpath using 'm' packet */ newpath = (char *) alloca (new_len); if (target_read_memory (new_ptr, (gdb_byte *) newpath, new_len) != 0) @@ -754,7 +754,7 @@ remote_fileio_func_rename (remote_target *remote, char *buf) remote_fileio_ioerror (remote); return; } - + /* Only operate on regular files and directories. */ of = stat (oldpath, &ost); nf = stat (newpath, &nst); @@ -872,7 +872,7 @@ remote_fileio_func_stat (remote_target *remote, char *buf) return; } statptr = (CORE_ADDR) lnum; - + /* Request pathname using 'm' packet */ pathname = (char *) alloca (namelength); if (target_read_memory (nameptr, (gdb_byte *) pathname, namelength) != 0) @@ -1078,7 +1078,7 @@ remote_fileio_func_system (remote_target *remote, char *buf) return; } } - + /* Check if system(3) has been explicitly allowed using the `set remote system-call-allowed 1' command. If length is 0, indicating a NULL parameter to the system call, return zero to diff --git a/gdb/reply_mig_hack.awk b/gdb/reply_mig_hack.awk index 9857ee0e248..c861b3b79cc 100644 --- a/gdb/reply_mig_hack.awk +++ b/gdb/reply_mig_hack.awk @@ -118,7 +118,7 @@ parse_phase == 5 && /^#if[ \t]TypeCheck/ { # The first args type checking statement; we need to insert our chunk of # code that bypasses all the type checks if this is an error return, after # which we're done until we get to the next function. Handily, the size - # of mig's Reply structure is also the size of the alternate Request + # of mig's Reply structure is also the size of the alternate Request # structure that we want to check for. print "\tif (In0P->Head.msgh_size == sizeof (Reply)"; print "\t && ! (In0P->Head.msgh_bits & MACH_MSGH_BITS_COMPLEX)"; diff --git a/gdb/reverse.c b/gdb/reverse.c index 376435deab2..bda23ed2199 100644 --- a/gdb/reverse.c +++ b/gdb/reverse.c @@ -29,7 +29,7 @@ /* User interface: reverse-step, reverse-next etc. */ -/* exec_reverse_once -- accepts an arbitrary gdb command (string), +/* exec_reverse_once -- accepts an arbitrary gdb command (string), and executes it with exec-direction set to 'reverse'. Used to implement reverse-next etc. commands. */ diff --git a/gdb/rl78-tdep.c b/gdb/rl78-tdep.c index 5c49d1f7852..846064cc3d8 100644 --- a/gdb/rl78-tdep.c +++ b/gdb/rl78-tdep.c @@ -207,7 +207,7 @@ enum RL78_NUM_PSEUDO_REGS = RL78_NUM_TOTAL_REGS - RL78_NUM_REGS }; -#define RL78_SP_ADDR 0xffff8 +#define RL78_SP_ADDR 0xffff8 /* Architecture specific data. */ @@ -306,7 +306,7 @@ rl78_register_type (struct gdbarch *gdbarch, int reg_nr) && reg_nr <= RL78_BANK3_R7_REGNUM)) return tdep->rl78_int8; else if (reg_nr == RL78_SP_REGNUM - || (RL78_BANK0_RP0_PTR_REGNUM <= reg_nr + || (RL78_BANK0_RP0_PTR_REGNUM <= reg_nr && reg_nr <= RL78_BANK3_RP3_PTR_REGNUM)) return tdep->rl78_data_pointer; else @@ -951,7 +951,7 @@ rl78_analyze_prologue (CORE_ADDR start_pc, && opc.op[0].reg == RL78_Reg_SP && opc.op[1].type == RL78_Operand_Register) { - int rsrc = (bank * RL78_REGS_PER_BANK) + int rsrc = (bank * RL78_REGS_PER_BANK) + 2 * (opc.op[1].reg - RL78_Reg_AX); reg[RL78_SP_REGNUM] = pv_add_constant (reg[RL78_SP_REGNUM], -1); diff --git a/gdb/rs6000-aix-tdep.c b/gdb/rs6000-aix-tdep.c index 536f6473f88..ae1fb958628 100644 --- a/gdb/rs6000-aix-tdep.c +++ b/gdb/rs6000-aix-tdep.c @@ -153,7 +153,7 @@ rs6000_aix_supply_vsxregset (const struct regset *regset, struct regcache *regca { int i, offset = 0; - for (i = tdep->ppc_vsr0_upper_regnum; i < tdep->ppc_vsr0_upper_regnum + for (i = tdep->ppc_vsr0_upper_regnum; i < tdep->ppc_vsr0_upper_regnum + 32; i++, offset += 8) ppc_supply_reg (regcache, i, (const gdb_byte *) vsxregs, offset, 8); @@ -544,17 +544,17 @@ rs6000_push_dummy_call (struct gdbarch *gdbarch, struct value *function, return_val example( float, int); - eabi: + eabi: float in fp0, int in r3 offset of stack on overflow 8/16 for varargs, must go by type. power open: float in r3&r4, int in r5 - offset of stack on overflow different - both: + offset of stack on overflow different + both: return in r3 or f0. If no float, must study how gcc emulates floats; pay attention to arg promotion. - User may have to cast\args to handle promotion correctly + User may have to cast\args to handle promotion correctly since gdb won't know if prototype supplied or not. */ for (argno = 0, argbytes = 0; argno < nargs && ii < 8; ++ii) @@ -641,7 +641,7 @@ ran_out_of_registers_for_arguments: /* Stack pointer must be quadword aligned. */ sp &= -16; - /* If there are more arguments, allocate space for them in + /* If there are more arguments, allocate space for them in the stack, then push them starting from the ninth one. */ if ((argno < nargs) || argbytes) @@ -675,7 +675,7 @@ ran_out_of_registers_for_arguments: regcache_raw_write_signed (regcache, gdbarch_sp_regnum (gdbarch), sp); - /* If the last argument copied into the registers didn't fit there + /* If the last argument copied into the registers didn't fit there completely, push the rest of it into stack. */ if (argbytes) @@ -1025,7 +1025,7 @@ rs6000_software_single_step (struct regcache *regcache) std::vector next_pcs = ppc_deal_with_atomic_sequence (regcache); if (!next_pcs.empty ()) return next_pcs; - + /* Here 0xfc000000 is the opcode mask to detect a P10 prefix instruction. */ if ((insn & 0xfc000000) == 1 << 26) breaks[0] = loc + 2 * PPC_INSN_SIZE; diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index 7c8a6f70ef6..fc64e3ee69e 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -226,7 +226,7 @@ int spe_register_p (struct gdbarch *gdbarch, int regno) { ppc_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - + /* Is it a reference to EV0 -- EV31, and do we have those? */ if (IS_SPE_PSEUDOREG (tdep, regno)) return 1; @@ -314,7 +314,7 @@ init_sim_regno_table (struct gdbarch *arch) /* General-purpose registers. */ for (i = 0; i < ppc_num_gprs; i++) set_sim_regno (sim_regno, tdep->ppc_gp0_regnum + i, sim_ppc_r0_regnum + i); - + /* Floating-point registers. */ if (tdep->ppc_fp0_regnum >= 0) for (i = 0; i < ppc_num_fprs; i++) @@ -414,7 +414,7 @@ rs6000_register_sim_regno (struct gdbarch *gdbarch, int reg) Write the register to REGCACHE. */ void -ppc_supply_reg (struct regcache *regcache, int regnum, +ppc_supply_reg (struct regcache *regcache, int regnum, const gdb_byte *regs, size_t offset, int regsize) { if (regnum != -1 && offset != -1) @@ -459,7 +459,7 @@ ppc_collect_reg (const struct regcache *regcache, int regnum, regcache->raw_collect (regnum, regs + offset); } } - + static int ppc_greg_offset (struct gdbarch *gdbarch, ppc_gdbarch_tdep *tdep, @@ -1146,7 +1146,7 @@ ppc_deal_with_atomic_sequence (struct regcache *regcache) int insn = read_memory_integer (loc, PPC_INSN_SIZE, byte_order); int insn_count; int index; - int last_breakpoint = 0; /* Defaults to 0 (no breakpoints placed). */ + int last_breakpoint = 0; /* Defaults to 0 (no breakpoints placed). */ const int atomic_sequence_length = 16; /* Instruction sequence length. */ int bc_insn_count = 0; /* Conditional branch instruction count. */ @@ -1154,7 +1154,7 @@ ppc_deal_with_atomic_sequence (struct regcache *regcache) if (!IS_LOAD_AND_RESERVE_INSN (insn)) return {}; - /* Assume that no atomic sequence is longer than "atomic_sequence_length" + /* Assume that no atomic sequence is longer than "atomic_sequence_length" instructions. */ for (insn_count = 0; insn_count < atomic_sequence_length; ++insn_count) { @@ -1165,7 +1165,7 @@ ppc_deal_with_atomic_sequence (struct regcache *regcache) insn = read_memory_integer (loc, PPC_INSN_SIZE, byte_order); /* Assume that there is at most one conditional branch in the atomic - sequence. If a conditional branch is found, put a breakpoint in + sequence. If a conditional branch is found, put a breakpoint in its destination address. */ if ((insn & OP_MASK) == BC_INSN) { @@ -1175,7 +1175,7 @@ ppc_deal_with_atomic_sequence (struct regcache *regcache) if (bc_insn_count >= 1) return {}; /* More than one conditional branch found, fallback to the standard single-step code. */ - + if (absolute) breaks[1] = immediate; else @@ -1262,7 +1262,7 @@ store_param_on_stack_p (unsigned long op, int framep, int *r0_contains_arg) return (rx_regno >= 3 && rx_regno <= 10); } - + /* Save a General Purpose Register on stack via the Frame Pointer. */ if (framep && @@ -1300,7 +1300,7 @@ store_param_on_stack_p (unsigned long op, int framep, int *r0_contains_arg) /* Assuming that INSN is a "bl" instruction located at PC, return nonzero if the destination of the branch is a "blrl" instruction. - + This sequence is sometimes found in certain function prologues. It allows the function to load the LR register with a value that they can use to access PIC data using PC-relative offsets. */ @@ -1366,7 +1366,7 @@ store_insn_p (unsigned long op, unsigned long rs, The former is anded with the opcode in question; if the result of this masking operation is equal to BL_INSTRUCTION, then the opcode in question is a ``bl'' instruction. - + BL_DISPLACEMENT_MASK is anded with the opcode in order to extract the branch displacement. */ @@ -1393,7 +1393,7 @@ rs6000_fetch_instruction (struct gdbarch *gdbarch, const CORE_ADDR pc) of each function prologue when compiling with -fstack-check. If one of such sequences starts at START_PC, then return the address of the instruction immediately past this sequence. Otherwise, return START_PC. */ - + static CORE_ADDR rs6000_skip_stack_check (struct gdbarch *gdbarch, const CORE_ADDR start_pc) { @@ -1403,7 +1403,7 @@ rs6000_skip_stack_check (struct gdbarch *gdbarch, const CORE_ADDR start_pc) /* First possible sequence: A small number of probes. stw 0, -(1) [repeat this instruction any (small) number of times]. */ - + if ((op & 0xffff0000) == 0x90010000) { while ((op & 0xffff0000) == 0x90010000) @@ -1533,7 +1533,7 @@ rs6000_skip_stack_check (struct gdbarch *gdbarch, const CORE_ADDR start_pc) op = rs6000_fetch_instruction (gdbarch, pc); if ((op & 0xffff0000) != 0x3d800000) break; - + /* lwz 12,(12) */ pc = pc + 4; op = rs6000_fetch_instruction (gdbarch, pc); @@ -1788,7 +1788,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, continue; } else if (op == 0x48000005) - { /* bl .+4 used in + { /* bl .+4 used in -mrelocatable */ fdata->used_bl = 1; continue; @@ -1807,7 +1807,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, } else if ((op & 0xfc000001) == 0x48000001) - { /* bl foo, + { /* bl foo, to save fprs??? */ fdata->frameless = 0; @@ -1843,7 +1843,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, was part of the function prologue. */ if (op == 0x4def7b82 || op == 0) /* crorc 15, 15, 15 */ - break; /* Don't skip over + break; /* Don't skip over this branch. */ fdata->used_bl = 1; @@ -1993,7 +1993,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, record this insn as part of the prologue yet. */ prev_insn_was_prologue_insn = 0; } - /* Store vector register S at (r31+r0) aligned to 16 bytes. */ + /* Store vector register S at (r31+r0) aligned to 16 bytes. */ /* 011111 sssss 11111 00000 00111001110 */ else if ((op & 0xfc1fffff) == 0x7c1f01ce) /* stvx Vs, R31, R0 */ { @@ -2705,7 +2705,7 @@ rs6000_register_to_value (const frame_info_ptr &frame, { struct gdbarch *gdbarch = get_frame_arch (frame); gdb_byte from[PPC_MAX_REGISTER_SIZE]; - + gdb_assert (type->code () == TYPE_CODE_FLT); /* We have an IEEE 128-bit float -- need to change regnum mapping from @@ -3375,13 +3375,13 @@ rs6000_stab_reg_to_regnum (struct gdbarch *gdbarch, int num) else switch (num) { - case 64: + case 64: return tdep->ppc_mq_regnum; case 65: return tdep->ppc_lr_regnum; - case 66: + case 66: return tdep->ppc_ctr_regnum; - case 76: + case 76: return tdep->ppc_xer_regnum; case 109: return tdep->ppc_vrsave_regnum; @@ -3391,7 +3391,7 @@ rs6000_stab_reg_to_regnum (struct gdbarch *gdbarch, int num) return tdep->ppc_acc_regnum; case 112: return tdep->ppc_spefscr_regnum; - default: + default: return num; } } @@ -8459,7 +8459,7 @@ rs6000_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Handles single stepping of atomic sequences. */ set_gdbarch_get_next_pcs (gdbarch, ppc_deal_with_atomic_sequence); - + /* Not sure on this. FIXMEmgo */ set_gdbarch_frame_args_skip (gdbarch, 8); diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c index 4626685e616..9a62f8b18ab 100644 --- a/gdb/rust-lang.c +++ b/gdb/rust-lang.c @@ -666,7 +666,7 @@ rust_language::value_print_inner case TYPE_CODE_PTR: { LONGEST low_bound, high_bound; - + if (type->target_type ()->code () == TYPE_CODE_ARRAY && rust_u8_type_p (type->target_type ()->target_type ()) && get_array_bounds (type->target_type (), &low_bound, diff --git a/gdb/rust-parse.c b/gdb/rust-parse.c index 6ad654293e7..b740d5a7b16 100644 --- a/gdb/rust-parse.c +++ b/gdb/rust-parse.c @@ -2008,7 +2008,7 @@ rust_parser::parse_path_expr () struct type *type = rust_lookup_type (path.c_str ()); if (type == nullptr) error (_("Could not find type '%s'"), path.c_str ()); - + return parse_struct_expr (type); } else if (current_token == '(') diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c index 7b110ce78d8..d11d1d26811 100644 --- a/gdb/rx-tdep.c +++ b/gdb/rx-tdep.c @@ -433,9 +433,9 @@ rx_frame_type (const frame_info_ptr &this_frame, void **this_cache) /* No cached value; scan the function. The frame type is cached in rx_analyze_prologue / rx_analyze_frame_prologue. */ - + pc = get_frame_pc (this_frame); - + /* Attempt to find the last address in the function. If it cannot be determined, set the limit to be a short ways past the frame's pc. */ diff --git a/gdb/sentinel-frame.c b/gdb/sentinel-frame.c index 410a6f496b7..950588e9a3a 100644 --- a/gdb/sentinel-frame.c +++ b/gdb/sentinel-frame.c @@ -31,7 +31,7 @@ struct frame_unwind_cache void * sentinel_frame_cache (struct regcache *regcache) { - struct frame_unwind_cache *cache = + struct frame_unwind_cache *cache = FRAME_OBSTACK_ZALLOC (struct frame_unwind_cache); cache->regcache = regcache; diff --git a/gdb/ser-base.c b/gdb/ser-base.c index 1c085cdd3fe..3b0a531b419 100644 --- a/gdb/ser-base.c +++ b/gdb/ser-base.c @@ -366,7 +366,7 @@ do_ser_base_readchar (struct serial *scb, int timeout) if (timeout > 0) timeout -= delta; - /* If we got a character or an error back from wait_for, then we can + /* If we got a character or an error back from wait_for, then we can break from the loop before the timeout is completed. */ if (status != SERIAL_TIMEOUT) break; @@ -400,7 +400,7 @@ do_ser_base_readchar (struct serial *scb, int timeout) return SERIAL_EOF; else /* Got an error from read. */ - return SERIAL_ERROR; + return SERIAL_ERROR; } scb->bufcnt = status; @@ -551,7 +551,7 @@ ser_base_set_tty_state (struct serial *scb, serial_ttystate ttystate) } void -ser_base_print_tty_state (struct serial *scb, +ser_base_print_tty_state (struct serial *scb, serial_ttystate ttystate, struct ui_file *stream) { diff --git a/gdb/ser-mingw.c b/gdb/ser-mingw.c index 086919a09df..57b0dbc9db0 100644 --- a/gdb/ser-mingw.c +++ b/gdb/ser-mingw.c @@ -432,13 +432,13 @@ select_thread_wait (struct ser_console_state *state) the started state, or that we exit this thread. */ wait_events[0] = state->start_select; wait_events[1] = state->exit_select; - if (WaitForMultipleObjects (2, wait_events, FALSE, INFINITE) + if (WaitForMultipleObjects (2, wait_events, FALSE, INFINITE) != WAIT_OBJECT_0) /* Either the EXIT_SELECT event was signaled (requesting that the thread exit) or an error has occurred. In either case, we exit the thread. */ ExitThread (0); - + /* We are now in the started state. */ SetEvent (state->have_started); } @@ -1058,7 +1058,7 @@ gdb_pipe (int pdes[2]) struct net_windows_state { struct ser_console_state base; - + HANDLE sock_event; }; diff --git a/gdb/ser-pipe.c b/gdb/ser-pipe.c index bdf3602befc..784829c13cf 100644 --- a/gdb/ser-pipe.c +++ b/gdb/ser-pipe.c @@ -81,7 +81,7 @@ pipe_open (struct serial *scb, const char *name) fork() due to the fact that autoconf will ``#define vfork fork'' on certain platforms. */ pid = vfork (); - + /* Error. */ if (pid == -1) { diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index 589b23d50ce..b72a8a5578e 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -92,8 +92,8 @@ wait_for_connect (int sock, unsigned int *polls, ULONGEST *out_error) struct timeval t; int n; - /* While we wait for the connect to complete, - poll the UI so it can update or the user can + /* While we wait for the connect to complete, + poll the UI so it can update or the user can interrupt. */ if (deprecated_ui_loop_hook && deprecated_ui_loop_hook (0)) { diff --git a/gdb/ser-unix.h b/gdb/ser-unix.h index 048ab847408..65fce49353d 100644 --- a/gdb/ser-unix.h +++ b/gdb/ser-unix.h @@ -21,7 +21,7 @@ #define GDB_SER_UNIX_H extern int ser_unix_read_prim (struct serial *scb, size_t count); -extern int ser_unix_write_prim (struct serial *scb, const void *buf, +extern int ser_unix_write_prim (struct serial *scb, const void *buf, size_t count); #endif /* GDB_SER_UNIX_H */ diff --git a/gdb/serial.h b/gdb/serial.h index 1f26dc60210..6bcb5ab6598 100644 --- a/gdb/serial.h +++ b/gdb/serial.h @@ -126,7 +126,7 @@ extern void serial_write (struct serial *scb, const void *buf, size_t count); /* Write a printf style string onto the serial port. */ -extern void serial_printf (struct serial *desc, +extern void serial_printf (struct serial *desc, const char *,...) ATTRIBUTE_PRINTF (2, 3); /* Allow pending output to drain. */ @@ -240,7 +240,7 @@ struct serial immediately forwarded to gdb_stderr. This may be -1. If != -1, this descriptor should be non-blocking or ops->avail should be non-NULL. */ - int error_fd; + int error_fd; const struct serial_ops *ops; /* Function vector */ void *state; /* Local context info for open FD */ serial_ttystate ttystate; /* Not used (yet) */ diff --git a/gdb/sh-linux-tdep.c b/gdb/sh-linux-tdep.c index 25781922e5f..45087ffb27b 100644 --- a/gdb/sh-linux-tdep.c +++ b/gdb/sh-linux-tdep.c @@ -141,7 +141,7 @@ sh_linux_rt_sigreturn_init (const struct tramp_frame *self, /* Instruction patterns. */ #define SH_MOVW 0x9305 #define SH_TRAP 0xc300 -#define SH_OR_R0_R0 0x200b +#define SH_OR_R0_R0 0x200b /* SH sigreturn syscall numbers. */ #define SH_NR_SIGRETURN 0x0077 diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c index 6bd4fd3df45..e7ab41f051f 100644 --- a/gdb/sh-tdep.c +++ b/gdb/sh-tdep.c @@ -60,7 +60,7 @@ static const char sh_cc_gcc[] = "gcc"; static const char sh_cc_renesas[] = "renesas"; static const char *const sh_cc_enum[] = { sh_cc_gcc, - sh_cc_renesas, + sh_cc_renesas, NULL }; @@ -759,7 +759,7 @@ sh_skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc) the return value from foo() will be in memory, not in R0, because there is no 3-byte integer type. - Similarly, in + Similarly, in struct s { char c[2]; } wibble; struct s foo(void) { return wibble; } @@ -833,16 +833,16 @@ sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp) manner, but using FP registers instead of GP registers. Arguments that are smaller than 4 bytes will still take up a whole - register or a whole 32-bit word on the stack, and will be + register or a whole 32-bit word on the stack, and will be right-justified in the register or the stack word. This includes chars, shorts, and small aggregate types. - Arguments that are larger than 4 bytes may be split between two or + Arguments that are larger than 4 bytes may be split between two or more registers. If there are not enough registers free, an argument may be passed partly in a register (or registers), and partly on the stack. This includes doubles, long longs, and larger aggregates. - As far as I know, there is no upper limit to the size of aggregates - that will be passed in this way; in other words, the convention of + As far as I know, there is no upper limit to the size of aggregates + that will be passed in this way; in other words, the convention of passing a pointer to a large aggregate instead of a copy is not used. MVS: The above appears to be true for the SH variants that do not @@ -851,24 +851,24 @@ sh_frame_align (struct gdbarch *ignore, CORE_ADDR sp) if it is larger than 16 bytes (four GP registers). An exceptional case exists for struct arguments (and possibly other - aggregates such as arrays) if the size is larger than 4 bytes but - not a multiple of 4 bytes. In this case the argument is never split + aggregates such as arrays) if the size is larger than 4 bytes but + not a multiple of 4 bytes. In this case the argument is never split between the registers and the stack, but instead is copied in its - entirety onto the stack, AND also copied into as many registers as - there is room for. In other words, space in registers permitting, + entirety onto the stack, AND also copied into as many registers as + there is room for. In other words, space in registers permitting, two copies of the same argument are passed in. As far as I can tell, - only the one on the stack is used, although that may be a function + only the one on the stack is used, although that may be a function of the level of compiler optimization. I suspect this is a compiler - bug. Arguments of these odd sizes are left-justified within the - word (as opposed to arguments smaller than 4 bytes, which are + bug. Arguments of these odd sizes are left-justified within the + word (as opposed to arguments smaller than 4 bytes, which are right-justified). - If the function is to return an aggregate type such as a struct, it - is either returned in the normal return value register R0 (if its + If the function is to return an aggregate type such as a struct, it + is either returned in the normal return value register R0 (if its size is no greater than one byte), or else the caller must allocate space into which the callee will copy the return value (if the size - is greater than one byte). In this case, a pointer to the return - value location is passed into the callee in register R2, which does + is greater than one byte). In this case, a pointer to the return + value location is passed into the callee in register R2, which does not displace any of the other arguments passed in via registers R4 to R7. */ @@ -917,7 +917,7 @@ sh_init_flt_argreg (void) /* This function returns the next register to use for float arg passing. It returns either a valid value between FLOAT_ARG0_REGNUM and - FLOAT_ARGLAST_REGNUM if a register is available, otherwise it returns + FLOAT_ARGLAST_REGNUM if a register is available, otherwise it returns FLOAT_ARGLAST_REGNUM + 1 to indicate that no register is available. Note that register number 0 in flt_argreg_array corresponds with the @@ -1508,9 +1508,9 @@ sh_register_reggroup_p (struct gdbarch *gdbarch, int regnum, /* On the sh4, the DRi pseudo registers are problematic if the target is little endian. When the user writes one of those registers, for instance with 'set var $dr0=1', we want the double to be stored - like this: - fr0 = 0x00 0x00 0xf0 0x3f - fr1 = 0x00 0x00 0x00 0x00 + like this: + fr0 = 0x00 0x00 0xf0 0x3f + fr1 = 0x00 0x00 0x00 0x00 This corresponds to little endian byte order & big endian word order. However if we let gdb write the register w/o conversion, it @@ -1518,7 +1518,7 @@ sh_register_reggroup_p (struct gdbarch *gdbarch, int regnum, fr0 = 0x00 0x00 0x00 0x00 fr1 = 0x00 0x00 0xf0 0x3f because it will consider fr0 and fr1 as a single LE stretch of memory. - + To achieve what we want we must force gdb to store things in floatformat_ieee_double_littlebyte_bigword (which is defined in include/floatformat.h and libiberty/floatformat.c. @@ -2403,7 +2403,7 @@ INIT_GDB_FILE (sh_tdep) _("SH specific commands."), &setshcmdlist, &showshcmdlist, &setlist, &showlist); - + add_setshow_enum_cmd ("calling-convention", class_vars, sh_cc_enum, &sh_active_calling_convention, _("Set calling convention used when calling target " diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c index d5c83f4573b..1cb063f7673 100644 --- a/gdb/solib-frv.c +++ b/gdb/solib-frv.c @@ -997,7 +997,7 @@ find_canonical_descriptor_in_load_object lm->dyn_relocs = (arelent **) xmalloc (storage_needed); /* Fetch the dynamic relocs. */ - lm->dyn_reloc_count + lm->dyn_reloc_count = bfd_canonicalize_dynamic_reloc (abfd, lm->dyn_relocs, lm->dyn_syms); } diff --git a/gdb/solib.c b/gdb/solib.c index e790ef0d530..f45e3668b89 100644 --- a/gdb/solib.c +++ b/gdb/solib.c @@ -1472,13 +1472,13 @@ reload_shared_libraries (const char *ignored, int from_tty, { reload_shared_libraries_1 (from_tty); - /* Creating inferior hooks here has two purposes. First, if we reload + /* Creating inferior hooks here has two purposes. First, if we reload shared libraries then the address of solib breakpoint we've computed previously might be no longer valid. For example, if we forgot to set solib-absolute-prefix and are setting it right now, then the previous breakpoint address is plain wrong. Second, installing solib hooks also implicitly figures were ld.so is and loads symbols for it. - Absent this call, if we've just connected to a target and set + Absent this call, if we've just connected to a target and set solib-absolute-prefix or solib-search-path, we'll lose all information about ld.so. */ if (target_has_execution ()) diff --git a/gdb/source.c b/gdb/source.c index 27fa657afb8..381e8d9609d 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -234,7 +234,7 @@ get_source_location (program_space *pspace) } /* See source.h. */ - + symtab_and_line get_current_source_symtab_and_line (program_space *pspace) { @@ -246,7 +246,7 @@ get_current_source_symtab_and_line (program_space *pspace) cursal.line = loc->line (); cursal.pc = 0; cursal.end = 0; - + return cursal; } @@ -257,7 +257,7 @@ get_current_source_symtab_and_line (program_space *pspace) process of determining a new default may call the caller! Use get_current_source_symtab_and_line only to get whatever we have without erroring out or trying to get a default. */ - + void set_default_source_symtab_and_line (void) { @@ -275,7 +275,7 @@ set_default_source_symtab_and_line (void) (the returned sal pc and end fields are not valid.) and set the current default to whatever is in SAL. NOTE: The returned sal pc and end fields are not valid. */ - + struct symtab_and_line set_current_source_symtab_and_line (const symtab_and_line &sal) { @@ -1157,7 +1157,7 @@ find_and_open_source (const char *filename, /* Open a source file given a symtab S. Returns a file descriptor or negative errno for error. - + This function is a convenience function to find_and_open_source. */ scoped_fd @@ -1278,7 +1278,7 @@ symtab_to_fullname (struct symtab *s) if (s->fullname () == nullptr) s->set_fullname (std::move (fullname)); } - } + } return s->fullname (); } @@ -1768,7 +1768,7 @@ static void show_substitute_path_command (const char *args, int from_tty) { char *from = NULL; - + gdb_argv argv (args); /* We expect zero or one argument. */ diff --git a/gdb/sparc-nat.c b/gdb/sparc-nat.c index 1219612ef35..bef44f3e51c 100644 --- a/gdb/sparc-nat.c +++ b/gdb/sparc-nat.c @@ -52,7 +52,7 @@ #ifdef HAVE_STRUCT_REG typedef struct reg gregset_t; typedef struct fpreg fpregset_t; -#else +#else typedef struct regs gregset_t; typedef struct fp_status fpregset_t; #endif diff --git a/gdb/sparc-tdep.c b/gdb/sparc-tdep.c index 6ac02def8c0..bbc33dcbad7 100644 --- a/gdb/sparc-tdep.c +++ b/gdb/sparc-tdep.c @@ -115,7 +115,7 @@ static int sparc_is_unimp_insn (CORE_ADDR pc) { const unsigned long insn = sparc_fetch_instruction (pc); - + return ((insn & 0xc1c00000) == 0); } @@ -773,7 +773,7 @@ sparc_alloc_frame_cache (void) of each function prologue when compiling with -fstack-check. If one of such sequences starts at START_PC, then return the address of the instruction immediately past this sequence. Otherwise, return START_PC. */ - + static CORE_ADDR sparc_skip_stack_check (const CORE_ADDR start_pc) { @@ -883,7 +883,7 @@ sparc_skip_stack_check (const CORE_ADDR start_pc) /* We found a valid stack-check sequence, return the new PC. */ return pc; } - + /* Third sequence: A probing loop. [first three instructions above] sub %g1, %g4, %g4 diff --git a/gdb/sparc64-netbsd-nat.c b/gdb/sparc64-netbsd-nat.c index 1036160d3d3..baf115d279c 100644 --- a/gdb/sparc64-netbsd-nat.c +++ b/gdb/sparc64-netbsd-nat.c @@ -152,7 +152,7 @@ sparc64nbsd_supply_pcb (struct regcache *regcache, struct pcb *pcb) /* If the program counter is zero, this is probably a core dump, and we can get %pc from the stack. */ if (pcb->pcb_pc == 0) - read_memory(pcb->pcb_sp + BIAS - 176 + (11 * 8), + read_memory(pcb->pcb_sp + BIAS - 176 + (11 * 8), (gdb_byte *)&pcb->pcb_pc, sizeof pcb->pcb_pc); regcache->raw_supply (SPARC_SP_REGNUM, &pcb->pcb_sp); diff --git a/gdb/sparc64-obsd-nat.c b/gdb/sparc64-obsd-nat.c index 60dd188b1ba..a0e210236b6 100644 --- a/gdb/sparc64-obsd-nat.c +++ b/gdb/sparc64-obsd-nat.c @@ -91,7 +91,7 @@ sparc64obsd_supply_pcb (struct regcache *regcache, struct pcb *pcb) /* If the program counter is zero, this is probably a core dump, and we can get %pc from the stack. */ if (pcb->pcb_pc == 0) - read_memory(pcb->pcb_sp + BIAS - 176 + (11 * 8), + read_memory(pcb->pcb_sp + BIAS - 176 + (11 * 8), (gdb_byte *)&pcb->pcb_pc, sizeof pcb->pcb_pc); regcache->raw_supply (SPARC_SP_REGNUM, &pcb->pcb_sp); diff --git a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c index a16f5c4111a..4cf60458bce 100644 --- a/gdb/sparc64-tdep.c +++ b/gdb/sparc64-tdep.c @@ -47,12 +47,12 @@ code can handle both. */ /* The M7 processor supports an Application Data Integrity (ADI) feature - that detects invalid data accesses. When software allocates memory and - enables ADI on the allocated memory, it chooses a 4-bit version number, - sets the version in the upper 4 bits of the 64-bit pointer to that data, - and stores the 4-bit version in every cacheline of the object. Hardware - saves the latter in spare bits in the cache and memory hierarchy. On each - load and store, the processor compares the upper 4 VA (virtual address) bits + that detects invalid data accesses. When software allocates memory and + enables ADI on the allocated memory, it chooses a 4-bit version number, + sets the version in the upper 4 bits of the 64-bit pointer to that data, + and stores the 4-bit version in every cacheline of the object. Hardware + saves the latter in spare bits in the cache and memory hierarchy. On each + load and store, the processor compares the upper 4 VA (virtual address) bits to the cacheline's version. If there is a mismatch, the processor generates a version mismatch trap which can be either precise or disrupting. The trap is an error condition which the kernel delivers to the process @@ -132,7 +132,7 @@ static std::forward_list adi_proc_list; /* Get ADI info for process PID, creating one if it doesn't exist. */ -static sparc64_adi_info * +static sparc64_adi_info * get_adi_info_proc (pid_t pid) { auto found = std::find_if (adi_proc_list.begin (), adi_proc_list.end (), @@ -152,7 +152,7 @@ get_adi_info_proc (pid_t pid) } } -static adi_stat_t +static adi_stat_t get_adi_info (pid_t pid) { sparc64_adi_info *proc; @@ -176,7 +176,7 @@ sparc64_forget_process (pid_t pid) { if ((*it).pid == pid) { - if ((*it).stat.tag_fd > 0) + if ((*it).stat.tag_fd > 0) target_fileio_close ((*it).stat.tag_fd, &target_errno); adi_proc_list.erase_after (pit); break; @@ -245,7 +245,7 @@ adi_normalize_address (CORE_ADDR addr) return addr; } -/* Align a normalized address - a VA with bit 59 sign extended into +/* Align a normalized address - a VA with bit 59 sign extended into ADI bits. */ static CORE_ADDR @@ -287,7 +287,7 @@ adi_tag_fd (void) char cl_name[MAX_PROC_NAME_SIZE]; snprintf (cl_name, sizeof(cl_name), "/proc/%ld/adi/tags", (long) pid); fileio_error target_errno; - proc->stat.tag_fd = target_fileio_open (NULL, cl_name, O_RDWR|O_EXCL, + proc->stat.tag_fd = target_fileio_open (NULL, cl_name, O_RDWR|O_EXCL, false, 0, &target_errno); return proc->stat.tag_fd; } diff --git a/gdb/stabsread.c b/gdb/stabsread.c index 733fc9e6ddc..c7fc626e31c 100644 --- a/gdb/stabsread.c +++ b/gdb/stabsread.c @@ -96,7 +96,7 @@ struct next_fnfieldlist struct fn_fieldlist fn_fieldlist; }; -/* The routines that read and process a complete stabs for a C struct or +/* The routines that read and process a complete stabs for a C struct or C++ class pass lists of data member fields and lists of member function fields in an instance of a field_info structure, as defined below. This is part of some reorganization of low level C++ support and is @@ -428,7 +428,7 @@ dbx_init_float_type (struct objfile *objfile, int bits) return type; } -/* for all the stabs in a given stab vector, build appropriate types +/* for all the stabs in a given stab vector, build appropriate types and fix their symbols in given symbol vector. */ static void @@ -442,7 +442,7 @@ patch_block_stabs (struct pending *symbols, struct pending_stabs *stabs, if (stabs) { - /* for all the stab entries, find their corresponding symbols and + /* for all the stab entries, find their corresponding symbols and patch their types! */ for (ii = 0; ii < stabs->count; ++ii) @@ -709,7 +709,7 @@ stabs_end_psymtab (struct objfile *objfile, psymtab_storage *partial_symtabs, return pst; } -/* Set namestring based on nlist. If the string table index is invalid, +/* Set namestring based on nlist. If the string table index is invalid, give a fake name, and print a single error message per symbol file read, rather than abort the symbol reading or flood the user with messages. */ @@ -726,7 +726,7 @@ set_namestring (struct objfile *objfile, const struct internal_nlist *nlist) complaint (_("bad string table offset in symbol %d"), symnum); namestring = ""; - } + } else namestring = (nlist->n_strx + key->ctx.file_string_table_offset + DBX_STRINGTAB (objfile)); @@ -1106,7 +1106,7 @@ record_minimal_symbol (minimal_symbol_reader &reader, case N_DATA: ms_type = mst_file_data; - /* Check for __DYNAMIC, which is used by Sun shared libraries. + /* Check for __DYNAMIC, which is used by Sun shared libraries. Record it as global even if it's local, not global, so lookup_minimal_symbol can find it. We don't check symbol_leading_char because for SunOS4 it always is '_'. */ @@ -1535,7 +1535,7 @@ read_stabs_symtab_1 (minimal_symbol_reader &reader, /* Save the directory name SOs locally, then save it into the psymtab when it's created below. */ dirname_nso = namestring; - continue; + continue; } /* Some other compilers (C++ ones in particular) emit useless @@ -2212,7 +2212,7 @@ read_stabs_symtab_1 (minimal_symbol_reader &reader, } /* Scan and build partial symbols for a symbol file. - We have been initialized by a call to dbx_symfile_init, which + We have been initialized by a call to dbx_symfile_init, which put all the relevant info into a "struct dbx_symfile_info", hung off the objfile structure. */ @@ -2982,7 +2982,7 @@ process_one_symbol (int type, int desc, CORE_ADDR valu, const char *name, #define VISIBILITY_PUBLIC '2' /* Stabs character for public field */ #define VISIBILITY_IGNORE '9' /* Optimized out or zero length */ -/* Structure for storing pointers to reference definitions for fast lookup +/* Structure for storing pointers to reference definitions for fast lookup during "process_later". */ struct ref_map @@ -3015,7 +3015,7 @@ stabsread_clear_cache (void) } /* Create array of pointers mapping refids to symbols and stab strings. - Add pointers to reference definition symbols and/or their values as we + Add pointers to reference definition symbols and/or their values as we find them, using their reference numbers as our index. These will be used later when we resolve references. */ void @@ -3032,7 +3032,7 @@ ref_add (int refnum, struct symbol *sym, const char *stabs, CORE_ADDR value) ref_map = (struct ref_map *) xrealloc (ref_map, REF_MAP_SIZE (ref_chunk + new_chunks)); - memset (ref_map + ref_chunk * MAX_CHUNK_REFS, 0, + memset (ref_map + ref_chunk * MAX_CHUNK_REFS, 0, new_chunks * REF_CHUNK_SIZE); ref_chunk += new_chunks; } @@ -3075,7 +3075,7 @@ process_reference (const char **string) return refnum; } -/* If STRING defines a reference, store away a pointer to the reference +/* If STRING defines a reference, store away a pointer to the reference definition for later use. Return the reference number. */ int @@ -3342,7 +3342,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, ind++; p += 2; } - else if (*p) + else if (*p) { string_local[ind] = (gdb_byte) (*p); ind++; @@ -3679,7 +3679,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, will be stored in the VAR_DOMAIN). If the symbol was indeed defined as 'Tt' then the STRUCT_DOMAIN symbol will be created elsewhere, so we don't need to take care of that. - + This is important to do, because of forward references: The cleanup of undefined types stored in undef_types only uses STRUCT_DOMAIN symbols to perform the replacement. */ @@ -3791,7 +3791,7 @@ define_symbol (CORE_ADDR valu, const char *string, int desc, int type, p++; sym->set_type (read_type (&p, objfile)); - + /* For a nameless type, we don't want a create a symbol, thus we did not use `sym'. Return without further processing. */ if (nameless) @@ -5114,7 +5114,7 @@ read_member_functions (struct stab_field_info *fip, const char **pp, tmp_sublist = tmp_sublist->next; continue; } - + destr_fnlist->fn_fieldlist.fn_fields[i++] = tmp_sublist->fn_field; if (last_sublist) @@ -5794,7 +5794,7 @@ attach_fields_to_type (struct stab_field_info *fip, struct type *type, /* Complain that the compiler has emitted more than one definition for the structure type TYPE. */ -static void +static void complain_about_struct_wipeout (struct type *type) { const char *name = ""; @@ -5822,7 +5822,7 @@ complain_about_struct_wipeout (struct type *type) /* Set the length for all variants of a same main_type, which are connected in the closed chain. - + This is something that needs to be done when a type is defined *after* some cross references to this type have already been read. Consider for instance the following scenario where we have the following two @@ -5868,7 +5868,7 @@ set_length_in_type_chain (struct type *type) OBJFILE points to the current objfile from which the stabs information is being read. (Note that it is redundant in that TYPE also contains a pointer - to this same objfile, so it might be a good idea to eliminate it. FIXME). + to this same objfile, so it might be a good idea to eliminate it. FIXME). */ static struct type * @@ -6824,7 +6824,7 @@ add_undefined_type_1 (struct type *type) scope? */ /* Add a type to the list of undefined types to be checked through once this file has been read in. - + In practice, we actually maintain two such lists: The first list (UNDEF_TYPES) is used for types whose name has been provided, and concerns forward references (eg 'xs' or 'xu' forward references); @@ -6889,7 +6889,7 @@ cleanup_undefined_types_1 (void) 1. It is a typedef in the STRUCT domain; 2. It has the same name, and same type code; 3. The instance flags are identical. - + It is important to check the instance flags, because we have seen examples where the debug info contained definitions such as: diff --git a/gdb/stack.c b/gdb/stack.c index add1c547b55..2c00eb2816b 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -460,7 +460,7 @@ print_frame_arg (const frame_print_options &fp_opts, just want to print their addresses. Print ??? for args whose address we do not know. We pass 2 as "recurse" to val_print because our standard indentation here is 4 spaces, and - val_print indents 2 for each recurse. */ + val_print indents 2 for each recurse. */ annotate_arg_value (arg->val->type ()); @@ -1379,7 +1379,7 @@ print_frame (struct ui_out *uiout, } else numargs = -1; - + { ui_out_emit_list list_emitter (uiout, "args"); try @@ -1399,7 +1399,7 @@ print_frame (struct ui_out *uiout, if (print_what != SHORT_LOCATION && sal.symtab) { const char *filename_display; - + filename_display = symtab_to_filename_for_display (sal.symtab); annotate_frame_source_begin (); uiout->wrap_hint (3); diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c index 6c15bce704c..5679553f516 100644 --- a/gdb/stap-probe.c +++ b/gdb/stap-probe.c @@ -682,9 +682,9 @@ stap_check_register_indirection_suffix (struct gdbarch *gdbarch, const char *s, RS = register suffix RIP = register indirection prefix RIS = register indirection suffix - + Then a register operand can be: - + [RIP] [RP] REGISTER [RS] [RIS] This function takes care of a register's indirection, displacement and diff --git a/gdb/stubs/i386-stub.c b/gdb/stubs/i386-stub.c index 74fe4767c83..cc741fb7a1e 100644 --- a/gdb/stubs/i386-stub.c +++ b/gdb/stubs/i386-stub.c @@ -765,17 +765,17 @@ handle_exception (int exceptionVector) *ptr++ = hexchars[sigval >> 4]; *ptr++ = hexchars[sigval & 0xf]; - *ptr++ = hexchars[ESP]; + *ptr++ = hexchars[ESP]; *ptr++ = ':'; ptr = mem2hex((char *)®isters[ESP], ptr, 4, 0); /* SP */ *ptr++ = ';'; - *ptr++ = hexchars[EBP]; + *ptr++ = hexchars[EBP]; *ptr++ = ':'; ptr = mem2hex((char *)®isters[EBP], ptr, 4, 0); /* FP */ *ptr++ = ';'; - *ptr++ = hexchars[PC]; + *ptr++ = hexchars[PC]; *ptr++ = ':'; ptr = mem2hex((char *)®isters[PC], ptr, 4, 0); /* PC */ *ptr++ = ';'; diff --git a/gdb/stubs/ia64vms-stub.c b/gdb/stubs/ia64vms-stub.c index 549e7f50a91..fa88acaa58a 100644 --- a/gdb/stubs/ia64vms-stub.c +++ b/gdb/stubs/ia64vms-stub.c @@ -407,7 +407,7 @@ term_fao (const char *str, unsigned int str_len, ...) term_flush (); } } - + va_end (vargs); } @@ -908,7 +908,7 @@ setreg_callback (pthreadDebugClient_t context, } static int -output_callback (pthreadDebugClient_t context, +output_callback (pthreadDebugClient_t context, pthreadDebugConstString_t line) { term_puts (line); @@ -917,7 +917,7 @@ output_callback (pthreadDebugClient_t context, } static int -error_callback (pthreadDebugClient_t context, +error_callback (pthreadDebugClient_t context, pthreadDebugConstString_t line) { term_puts (line); @@ -1114,7 +1114,7 @@ threads_init (void) (int *) &dbgext_func); if (!(status & STS$M_SUCCESS)) LIB$SIGNAL (status); - + status = lib$find_image_symbol ((void *) &pthread_rtl_desc, (void *) &dbgsymtable_desc, (int *) &dbg_symtable); @@ -1470,7 +1470,7 @@ handle_q_packet (const unsigned char *pkt, unsigned int pktlen) unsigned int pos = QSUPPORTED_LEN; pthreadDebugThreadInfo_t info; int res; - + /* Ignore gdb features. */ gdb_buf[0] = '$'; gdb_blen = 1; @@ -1626,7 +1626,7 @@ handle_packet (unsigned char *pkt, unsigned int len) int res; unsigned __int64 val; pthreadDebugThreadInfo_t info; - + pos++; val = pkt2val (pkt, &pos); if (pos != len) @@ -1844,7 +1844,7 @@ handle_packet (unsigned char *pkt, unsigned int len) int res; unsigned __int64 val; unsigned int fthr, thr; - + val = pkt2val (pkt, &pos); /* Default is error (but only after parsing is complete). */ packet_error (0); @@ -2371,7 +2371,7 @@ trace_init (void) sub_desc.dsc$w_length = i - start; for (j = 0; j < NBR_DEBUG_FLAGS; j++) - if (str$case_blind_compare (&sub_desc, + if (str$case_blind_compare (&sub_desc, (void *)&debug_flags[j].name) == 0) { debug_flags[j].val++; @@ -2460,7 +2460,7 @@ stub_start (unsigned __int64 *progxfer, void *cli_util, imcb->imcb$t_log_image_name + 1, imcb->imcb$t_log_image_name[0])) has_threads = 1; - + if (trace_images) { unsigned int j; @@ -2504,14 +2504,14 @@ stub_start (unsigned __int64 *progxfer, void *cli_util, term_puts (flags & 0x08000000 ? " Shrd" : " "); TERM_FAO (" !XA-!XA!/", ldrisd[j].ldrisd$p_base, - (unsigned __int64) ldrisd[j].ldrisd$p_base + (unsigned __int64) ldrisd[j].ldrisd$p_base + ldrisd[j].ldrisd$i_len - 1); } ldrisd = ldrimg->ldrimg$l_dyn_seg; if (ldrisd) TERM_FAO (" dynamic !XA-!XA!/", ldrisd->ldrisd$p_base, - (unsigned __int64) ldrisd->ldrisd$p_base + (unsigned __int64) ldrisd->ldrisd$p_base + ldrisd->ldrisd$i_len - 1); } } @@ -2549,7 +2549,7 @@ stub_start (unsigned __int64 *progxfer, void *cli_util, 0x00, 0x00, 0x04, 0x00 }; unsigned int entry_prot; unsigned int status; - + status = page_set_rw (entry_pc, 16, &entry_prot); if (!(status & STS$M_SUCCESS)) @@ -2564,7 +2564,7 @@ stub_start (unsigned __int64 *progxfer, void *cli_util, else LIB$SIGNAL (status); } - + if (entry_pc != 0) { ots$move (entry_saved, 16, (void *)entry_pc); diff --git a/gdb/stubs/m32r-stub.c b/gdb/stubs/m32r-stub.c index 16be231e2f4..58212efd40d 100644 --- a/gdb/stubs/m32r-stub.c +++ b/gdb/stubs/m32r-stub.c @@ -102,7 +102,7 @@ extern void exceptionHandler (); /* assign an exception handler */ /***************************************************************************** * BUFMAX defines the maximum number of characters in inbound/outbound buffers - * at least NUMREGBYTES*2 are needed for register packets + * at least NUMREGBYTES*2 are needed for register packets */ #define BUFMAX 400 @@ -490,9 +490,9 @@ handle_exception (int exceptionVector) } else /* continuing, not single-stepping */ { - /* OK, about to do a "continue". First check to see if the - target pc is on an odd boundary (second instruction in the - word). If so, we must do a single-step first, because + /* OK, about to do a "continue". First check to see if the + target pc is on an odd boundary (second instruction in the + word). If so, we must do a single-step first, because ya can't jump or return back to an odd boundary! */ if ((registers[PC] & 2) != 0) prepare_to_step (1); @@ -502,7 +502,7 @@ handle_exception (int exceptionVector) case 'D': /* Detach */ #if 0 - /* I am interpreting this to mean, release the board from control + /* I am interpreting this to mean, release the board from control by the remote stub. To do this, I am restoring the original (or at least previous) exception vectors. */ @@ -943,7 +943,7 @@ hexToInt (unsigned char **ptr, int *intValue) /* Table of branch instructions: - + 10B6 RTE return from trap or exception 1FCr JMP jump 1ECr JL jump and link @@ -1004,7 +1004,7 @@ isLongBranch (unsigned char *instr) return 0; } -/* if address is NOT on a 4-byte boundary, or high-bit of instr is zero, +/* if address is NOT on a 4-byte boundary, or high-bit of instr is zero, then it's a 2-byte instruction, else it's a 4-byte instruction. */ #define INSTRUCTION_SIZE(addr) \ @@ -1144,13 +1144,13 @@ static struct STEPPING_CONTEXT /* Function: prepare_to_step Called from handle_exception to prepare the user program to single-step. - Places a trap instruction after the target instruction, with special - extra handling for branch instructions and for instructions in the - second half-word of a word. + Places a trap instruction after the target instruction, with special + extra handling for branch instructions and for instructions in the + second half-word of a word. - Returns: True if we should actually execute the instruction; + Returns: True if we should actually execute the instruction; False if we are going to emulate executing the instruction, - in which case we simply report to GDB that the instruction + in which case we simply report to GDB that the instruction has already been executed. */ #define TRAP1 0x10f1; /* trap #1 instruction */ @@ -1167,7 +1167,7 @@ prepare_to_step (continue_p) int branchCode = isBranch ((unsigned char *) pc); unsigned char *p; - /* zero out the stepping context + /* zero out the stepping context (paranoia -- it should already be zeroed) */ for (p = (unsigned char *) &stepping; p < ((unsigned char *) &stepping) + sizeof (stepping); p++) @@ -1200,7 +1200,7 @@ prepare_to_step (continue_p) stepping.trap1_save = *(unsigned short *) stepping.trap1_addr; *(unsigned short *) stepping.trap1_addr = trap1; } - /* "continue_p" means that we are actually doing a continue, and not + /* "continue_p" means that we are actually doing a continue, and not being requested to single-step by GDB. Sometimes we have to do one single-step before continuing, because the PC is on a half-word boundary. There's no way to simply resume at such an address. */ @@ -1210,13 +1210,13 @@ prepare_to_step (continue_p) } /* Function: finish_from_step - Called from handle_exception to finish up when the user program + Called from handle_exception to finish up when the user program returns from a single-step. Replaces the instructions that had - been overwritten by traps or no-ops, + been overwritten by traps or no-ops, Returns: True if we should notify GDB that the target stopped. False if we only single-stepped because we had to before we - could continue (ie. we were trying to continue at a + could continue (ie. we were trying to continue at a half-word boundary). In that case don't notify GDB: just "continue continuing". */ diff --git a/gdb/stubs/m68k-stub.c b/gdb/stubs/m68k-stub.c index 15984229491..0a19f8e0a34 100644 --- a/gdb/stubs/m68k-stub.c +++ b/gdb/stubs/m68k-stub.c @@ -1,9 +1,9 @@ /**************************************************************************** - THIS SOFTWARE IS NOT COPYRIGHTED - + THIS SOFTWARE IS NOT COPYRIGHTED + HP offers the following for use in the public domain. HP makes no - warranty with regard to the software or it's performance and the + warranty with regard to the software or it's performance and the user accepts the software "AS IS" with all faults. HP DISCLAIMS ANY WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD @@ -13,22 +13,22 @@ ****************************************************************************/ /**************************************************************************** - * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $ + * Header: remcom.c,v 1.34 91/03/09 12:29:49 glenne Exp $ * - * Module name: remcom.c $ + * Module name: remcom.c $ * Revision: 1.34 $ * Date: 91/03/09 12:29:49 $ * Contributor: Lake Stevens Instrument Division$ - * + * * Description: low level support for gdb debugger. $ * * Considerations: only works on target hardware $ * * Written by: Glenn Engel $ - * ModuleState: Experimental $ + * ModuleState: Experimental $ * * NOTES: See Below $ - * + * * To enable debugger support, two things need to happen. One, a * call to set_debug_traps() is necessary in order to allow any breakpoints * or error conditions to be properly intercepted and reported to gdb. @@ -39,7 +39,7 @@ * there either should be a standard breakpoint instruction, or the protocol * should be extended to provide some means to communicate which breakpoint * instruction is in use (or have the stub insert the breakpoint). - * + * * Some explanation is probably necessary to explain how exceptions are * handled. When an exception is encountered the 68000 pushes the current * program counter and status register onto the supervisor stack and then @@ -47,7 +47,7 @@ * The handlers for the exception vectors are hardwired to jmp to an address * given by the relation: (exception - 256) * 6. These are descending * addresses starting from -6, -12, -18, ... By allowing 6 bytes for - * each entry, a jsr, jmp, bsr, ... can be used to enter the exception + * each entry, a jsr, jmp, bsr, ... can be used to enter the exception * handler. Using a jsr to handle an exception has an added benefit of * allowing a single handler to service several exceptions and use the * return address as the key differentiation. The vector number can be @@ -59,50 +59,50 @@ * For 68020 machines, the ability to have a return address around just * so the vector can be determined is not necessary because the '020 pushes an * extra word onto the stack containing the vector offset - * + * * Because gdb will sometimes write to the stack area to execute function * calls, this program cannot rely on using the supervisor stack so it * uses its own stack area reserved in the int array remcomStack. - * + * ************* * * The following gdb commands are supported: - * + * * command function Return value - * + * * g return the value of the CPU registers hex data or ENN * G set the value of the CPU registers OK or ENN - * + * * mAA..AA,LLLL Read LLLL bytes at address AA..AA hex data or ENN * MAA..AA,LLLL: Write LLLL bytes at address AA.AA OK or ENN - * + * * c Resume at current address SNN ( signal NN) * cAA..AA Continue at address AA..AA SNN - * + * * s Step one instruction SNN * sAA..AA Step one instruction from AA..AA SNN - * + * * k kill * * ? What was the last sigval ? SNN (signal NN) - * - * All commands and responses are sent with a packet which includes a - * checksum. A packet consists of - * + * + * All commands and responses are sent with a packet which includes a + * checksum. A packet consists of + * * $#. - * + * * where * :: * :: < two hex digits computed as modulo 256 sum of > - * + * * When a packet is received, it is first acknowledged with either '+' or '-'. * '+' indicates a successful transfer. '-' indicates a failed transfer. - * + * * Example: - * + * * Host: Reply: * $m0,10#2a +$00010203040506070809101112131415#42 - * + * ****************************************************************************/ #include @@ -111,7 +111,7 @@ /************************************************************************ * - * external low-level support routines + * external low-level support routines */ typedef void (*ExceptionHook)(int); /* pointer to function with int parm */ typedef void (*Function)(); /* pointer to a function */ @@ -136,15 +136,15 @@ initializeRemcomErrorFrame (); static char initialized; /* boolean flag. != 0 means we've been initialized */ int remote_debug; -/* debug > 0 prints ill-formed commands in valid packets & checksum errors */ +/* debug > 0 prints ill-formed commands in valid packets & checksum errors */ static const char hexchars[]="0123456789abcdef"; /* there are 180 bytes of registers on a 68020 w/68881 */ /* many of the fpa registers are 12 byte (96 bit) registers */ #define NUMREGBYTES 180 -enum regnames {D0,D1,D2,D3,D4,D5,D6,D7, - A0,A1,A2,A3,A4,A5,A6,A7, +enum regnames {D0,D1,D2,D3,D4,D5,D6,D7, + A0,A1,A2,A3,A4,A5,A6,A7, PS,PC, FP0,FP1,FP2,FP3,FP4,FP5,FP6,FP7, FPCONTROL,FPSTATUS,FPIADDR @@ -188,7 +188,7 @@ static int* stackPtr = &remcomStack[STACKSIZE/sizeof(int) - 1]; /* * In many cases, the system will want to continue exception processing - * when a continue command is given. + * when a continue command is given. * oldExceptionHook is a function to invoke in this case. */ @@ -216,7 +216,7 @@ jmp_buf remcomEnv; /* do an fsave, then remember the address to begin a restore from */ #define SAVE_FP_REGS() asm(" fsave a0@-"); \ asm(" fmovemx fp0-fp7,_registers+72"); \ - asm(" fmoveml fpcr/fpsr/fpi,_registers+168"); + asm(" fmoveml fpcr/fpsr/fpi,_registers+168"); #define RESTORE_FP_REGS() \ asm(" \n\ fmoveml _registers+168,fpcr/fpsr/fpi \n\ @@ -239,34 +239,34 @@ asm(" .text .globl _return_to_super _return_to_super: - movel _registers+60,sp /* get new stack pointer */ - movel _lastFrame,a0 /* get last frame info */ + movel _registers+60,sp /* get new stack pointer */ + movel _lastFrame,a0 /* get last frame info */ bra return_to_any .globl _return_to_user _return_to_user: - movel _registers+60,a0 /* get usp */ - movel a0,usp /* set usp */ - movel _superStack,sp /* get original stack pointer */ + movel _registers+60,a0 /* get usp */ + movel a0,usp /* set usp */ + movel _superStack,sp /* get original stack pointer */ return_to_any: - movel _lastFrame,a0 /* get last frame info */ - movel a0@+,_lastFrame /* link in previous frame */ - addql #8,a0 /* skip over pc, vector#*/ - movew a0@+,d0 /* get # of words in cpu frame */ - addw d0,a0 /* point to end of data */ - addw d0,a0 /* point to end of data */ - movel a0,a1 -# -# copy the stack frame - subql #1,d0 -copyUserLoop: - movew a1@-,sp@- - dbf d0,copyUserLoop -"); - RESTORE_FP_REGS() - asm(" moveml _registers,d0-d7/a0-a6"); - asm(" rte"); /* pop and go! */ + movel _lastFrame,a0 /* get last frame info */ + movel a0@+,_lastFrame /* link in previous frame */ + addql #8,a0 /* skip over pc, vector#*/ + movew a0@+,d0 /* get # of words in cpu frame */ + addw d0,a0 /* point to end of data */ + addw d0,a0 /* point to end of data */ + movel a0,a1 +# +# copy the stack frame + subql #1,d0 +copyUserLoop: + movew a1@-,sp@- + dbf d0,copyUserLoop +"); + RESTORE_FP_REGS() + asm(" moveml _registers,d0-d7/a0-a6"); + asm(" rte"); /* pop and go! */ #define DISABLE_INTERRUPTS() asm(" oriw #0x0700,sr"); #define BREAKPOINT() asm(" trap #1"); @@ -288,7 +288,7 @@ asm(" movew sp@(6),d0"); asm(" andiw #0x700,d0 cmpiw #0x700,d0 beq _already7 - movew sp@+,d0 + movew sp@+,d0 bra __catchException _already7: movew sp@+,d0"); @@ -309,13 +309,13 @@ extern void _catchException (); * stack on entry: stack on exit: * N bytes of junk exception # MSWord * Exception Format Word exception # MSWord - * Program counter LSWord - * Program counter MSWord - * Status Register - * - * + * Program counter LSWord + * Program counter MSWord + * Status Register + * + * */ -asm(" +asm(" .text .globl __catchException __catchException:"); @@ -324,11 +324,11 @@ asm(" moveml d0-d7/a0-a6,_registers /* save registers */ movel _lastFrame,a0 /* last frame pointer */ "); -SAVE_FP_REGS(); +SAVE_FP_REGS(); asm(" lea _registers,a5 /* get address of registers */ movew sp@,d1 /* get status register */ - movew d1,a5@(66) /* save sr */ + movew d1,a5@(66) /* save sr */ movel sp@(2),a4 /* save pc in a4 for later use */ movel a4,a5@(68) /* save pc in _regisers[] */ @@ -338,7 +338,7 @@ asm(" movew d0,d2 /* make a copy of format word */ andiw #0xf000,d0 /* mask off format type */ rolw #5,d0 /* rotate into the low byte *2 */ - lea _exceptionSize,a1 + lea _exceptionSize,a1 addw d0,a1 /* index into the table */ movew a1@,d0 /* get number of words in frame */ movew d0,d3 /* save it */ @@ -356,11 +356,11 @@ saveFrameLoop: # save the a7 in use at time of exception movel sp,_superStack /* save supervisor sp */ andiw #0x2000,d1 /* were we in supervisor mode ? */ - beq userMode + beq userMode movel a7,a5@(60) /* save a7 */ bra a7saveDone -userMode: - movel usp,a1 +userMode: + movel usp,a1 movel a1,a5@(60) /* save user stack pointer */ a7saveDone: @@ -392,14 +392,14 @@ a7saveDone: /* This function is called when an exception occurs. It translates the * return address found on the stack into an exception vector # which * is then handled by either handle_exception or a system handler. - * _catchException provides a front end for both. + * _catchException provides a front end for both. * * stack on entry: stack on exit: - * Program counter MSWord exception # MSWord + * Program counter MSWord exception # MSWord * Program counter LSWord exception # MSWord - * Status Register - * Return Address MSWord - * Return Address LSWord + * Status Register + * Return Address MSWord + * Return Address LSWord */ asm(" .text @@ -410,13 +410,13 @@ asm(" moveml d0-d7/a0-a6,_registers /* save registers */ movel _lastFrame,a0 /* last frame pointer */ "); -SAVE_FP_REGS(); +SAVE_FP_REGS(); asm(" lea _registers,a5 /* get address of registers */ movel sp@+,d2 /* pop return address */ addl #1530,d2 /* convert return addr to */ divs #6,d2 /* exception number */ - extl d2 + extl d2 moveql #3,d3 /* assume a three word frame */ @@ -425,11 +425,11 @@ asm(" movel sp@+,a0@- /* copy error info to frame buff*/ movel sp@+,a0@- /* these are never used */ moveql #7,d3 /* this is a 7 word frame */ - -normal: + +normal: movew sp@+,d1 /* pop status register */ movel sp@+,a4 /* pop program counter */ - movew d1,a5@(66) /* save sr */ + movew d1,a5@(66) /* save sr */ movel a4,a5@(68) /* save pc in _regisers[] */ movel a4,a0@- /* copy pc to frame buffer */ movew d1,a0@- /* copy sr to frame buffer */ @@ -437,9 +437,9 @@ normal: movel sp,_superStack /* save supervisor sp */ andiw #0x2000,d1 /* were we in supervisor mode ? */ - beq userMode + beq userMode movel a7,a5@(60) /* save a7 */ - bra saveDone + bra saveDone userMode: movel usp,a1 /* save user stack pointer */ movel a1,a5@(60) /* save user stack pointer */ @@ -692,7 +692,7 @@ handle_buserror () longjmp (remcomEnv, 1); } -/* this function takes the 68000 exception number and attempts to +/* this function takes the 68000 exception number and attempts to translate this number into a unix compatible signal value */ int computeSignal (exceptionVector) @@ -1044,7 +1044,7 @@ initializeRemcomErrorFrame (void) lastFrame->previous = lastFrame; } -/* this function is used to set up exception handlers for tracing and +/* this function is used to set up exception handlers for tracing and breakpoints */ void set_debug_traps () diff --git a/gdb/stubs/sh-stub.c b/gdb/stubs/sh-stub.c index 60dc0b14389..59afc36e15a 100644 --- a/gdb/stubs/sh-stub.c +++ b/gdb/stubs/sh-stub.c @@ -1,12 +1,12 @@ /* sh-stub.c -- debugging stub for the Renesas-SH. - NOTE!! This code has to be compiled with optimization, otherwise the + NOTE!! This code has to be compiled with optimization, otherwise the function inlining which generates the exception handlers won't work. */ /* This is originally based on an m68k software stub written by Glenn - Engel at HP, but has changed quite a bit. + Engel at HP, but has changed quite a bit. Modifications for the SH by Ben Lee and Steve Chamberlain @@ -38,7 +38,7 @@ '$' or '#'. If starts with two characters followed by ':', then the existing stubs interpret this as a sequence number. - CSUM1 and CSUM2 are ascii hex representation of an 8-bit + CSUM1 and CSUM2 are ascii hex representation of an 8-bit checksum of , the most significant nibble is sent first. the hex digits 0-9,a-f are used. @@ -138,10 +138,10 @@ Responses can be run-length encoded to save space. A '*' means that the next character is an ASCII encoding giving a repeat count which stands for that many repetitions of the character preceding the '*'. - The encoding is n+29, yielding a printable character where n >=3 - (which is where rle starts to win). Don't use an n > 126. + The encoding is n+29, yielding a printable character where n >=3 + (which is where rle starts to win). Don't use an n > 126. - So + So "0* " means the same as "0000". */ #include @@ -467,11 +467,11 @@ putpacket (char *buffer) int runlen; /* Do run length encoding */ - for (runlen = 0; runlen < 100; runlen ++) + for (runlen = 0; runlen < 100; runlen ++) { - if (src[0] != src[runlen]) + if (src[0] != src[runlen]) { - if (runlen > 3) + if (runlen > 3) { int encode; /* Got a useful amount */ @@ -524,19 +524,19 @@ computeSignal (int exceptionVector) { case INVALID_INSN_VEC: sigval = 4; - break; + break; case INVALID_SLOT_VEC: sigval = 4; - break; + break; case CPU_BUS_ERROR_VEC: sigval = 10; - break; + break; case DMA_BUS_ERROR_VEC: sigval = 10; - break; + break; case NMI_VEC: sigval = 2; - break; + break; case TRAP_VEC: case USER_VEC: @@ -786,7 +786,7 @@ gdb_handle_exception (int exceptionVector) } -#define GDBCOOKIE 0x5ac +#define GDBCOOKIE 0x5ac static int ingdbmode; /* We've had an exception - choose to go into the monitor or the gdb stub */ @@ -795,7 +795,7 @@ void handle_exception(int exceptionVector) #ifdef MONITOR if (ingdbmode != GDBCOOKIE) monitor_handle_exception (exceptionVector); - else + else #endif gdb_handle_exception (exceptionVector); @@ -855,7 +855,7 @@ vec_type; or wherever your vbr points. */ const vec_type vectable = -{ +{ &BINIT, /* 0: Power-on reset PC */ init_stack + init_stack_size, /* 1: Power-on reset SP */ &BINIT, /* 2: Manual reset PC */ @@ -1206,7 +1206,7 @@ L_sp: .long _init_stack + 8000"); mov.l @(L_reg, pc), r1 bra restoreRegisters mov.l r15, @r0 ! save __stub_stack - + .align 2 L_reg: .long _registers @@ -1220,7 +1220,7 @@ L_hdl_except: static void rr() { asm(" - .align 2 + .align 2 .global _resume _resume: mov r4,r1 @@ -1241,14 +1241,14 @@ restoreRegisters: mov.l @r1+, r14 ! restore R14 mov.l @r1+, r15 ! restore programs stack mov.l @r1+, r0 - add #-8, r15 ! uncover PC/SR on stack + add #-8, r15 ! uncover PC/SR on stack mov.l r0, @r15 ! restore PC onto stack lds.l @r1+, pr ! restore PR - ldc.l @r1+, gbr ! restore GBR + ldc.l @r1+, gbr ! restore GBR ldc.l @r1+, vbr ! restore VBR lds.l @r1+, mach ! restore MACH lds.l @r1+, macl ! restore MACL - mov.l @r1, r0 + mov.l @r1, r0 add #-88, r1 ! readjust reg pointer to R1 mov.l r0, @(4, r15) ! restore SR onto stack+4 mov.l r2, @-r15 @@ -1264,15 +1264,15 @@ restoreRegisters: } -static __inline__ void code_for_catch_exception(int n) +static __inline__ void code_for_catch_exception(int n) { - asm(" .globl _catch_exception_%O0" : : "i" (n) ); + asm(" .globl _catch_exception_%O0" : : "i" (n) ); asm(" _catch_exception_%O0:" :: "i" (n) ); asm(" add #-4, r15 ! reserve spot on stack "); asm(" mov.l r1, @-r15 ! push R1 "); - if (n == NMI_VEC) + if (n == NMI_VEC) { /* Special case for NMI - make sure that they don't nest */ asm(" mov.l r0, @-r15 ! push R0"); @@ -1472,7 +1472,7 @@ exceptions (void) #define PB1MD0 0x0004 #define PB0MD1 0x0002 #define PB0MD0 0x0001 - + #define PB7MD PB7MD1|PB7MD0 #define PB6MD PB6MD1|PB6MD0 #define PB5MD PB5MD1|PB5MD0 @@ -1496,7 +1496,7 @@ nop (void) { } -void +void init_serial (void) { int i; @@ -1535,7 +1535,7 @@ getDebugCharReady (void) return SSR1 & SCI_RDRF ; } -char +char getDebugChar (void) { char ch; @@ -1555,7 +1555,7 @@ getDebugChar (void) return ch; } -int +int putDebugCharReady (void) { return (SSR1 & SCI_TDRE); @@ -1574,7 +1574,7 @@ putDebugChar (char ch) SSR1 &= ~SCI_TDRE; } -void +void handleError (char theSSR) { SSR1 &= ~(SCI_ORER | SCI_PER | SCI_FER); diff --git a/gdb/symfile.c b/gdb/symfile.c index 2406c569c26..acf5edaaadb 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -3533,7 +3533,7 @@ simple_overlay_update (struct obj_section *osect) error (_("Error reading inferior's overlay table: couldn't " "find `_ovly_table' array\n" "in inferior. Use `overlay manual' mode.")); - + if (cache_ovly_table_base == minsym.value_address ()) /* Then go ahead and try to look up this single section in the cache. */ diff --git a/gdb/symtab.c b/gdb/symtab.c index fdba441ec54..13cd331064c 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -677,7 +677,7 @@ gdb_mangle_name (struct type *type, int method_id, int signature_id) is_full_physname_constructor = is_constructor_name (physname); - is_constructor = is_full_physname_constructor + is_constructor = is_full_physname_constructor || (newname && strcmp (field_name, newname) == 0); if (!is_destructor) @@ -2141,7 +2141,7 @@ lookup_local_symbol (const char *name, return {}; const char *scope = block->scope (); - + while (!block->is_global_block () && !block->is_static_block ()) { struct symbol *sym = lookup_symbol_in_block (name, match_type, @@ -2761,7 +2761,7 @@ find_compunit_symtab_for_pc_sect (CORE_ADDR pc, struct obj_section *section) && range >= best_cust_range) /* Cust doesn't have a smaller range than best_cust, skip it. */ continue; - + /* For an objfile that has its functions reordered, find_pc_psymtab will find the proper partial symbol table and we simply return its corresponding symtab. */ @@ -3309,7 +3309,7 @@ find_line_symtab (symtab *sym_tab, int line, int *index) continue; if (FILENAME_CMP (symtab_to_fullname (sym_tab), symtab_to_fullname (s)) != 0) - continue; + continue; l = s->linetable (); ind = find_line_common (l, line, &exact, 0); if (ind >= 0) diff --git a/gdb/symtab.h b/gdb/symtab.h index 6c19f138c2f..3248e585bad 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -286,7 +286,7 @@ class lookup_name_info final } /* A wrapper for ::split_name (see split-name.h) that splits this - name, and that handles any language-specific peculiarities. */ + name, and that handles any language-specific peculiarities. */ std::vector split_name (language lang) const { if (lang == language_ada) @@ -922,7 +922,7 @@ constexpr domain_search_flags SEARCH_ALL_DOMAINS extern std::string domain_name (domain_search_flags); /* Convert a symbol domain to search flags. */ -static inline domain_search_flags +static inline domain_search_flags to_search_flags (domain_enum domain) { return domain_search_flags (domain_search_flag (1 << domain)); @@ -1046,7 +1046,7 @@ enum location_class The linker might even remove the minimal symbol if the global symbol is never referenced, in which case the symbol remains unresolved. - + GDB would normally find the symbol in the minimal symbol table if it will not find it in the full symbol table. But a reference to an external symbol in a local block shadowing other definition requires full symbol @@ -2053,7 +2053,7 @@ compunit_epilogue_unwind_valid (struct compunit_symtab *cust) /* The virtual function table is now an array of structures which have the - form { int16 offset, delta; void *pfn; }. + form { int16 offset, delta; void *pfn; }. In normal virtual function tables, OFFSET is unused. DELTA is the amount which is added to the apparent object's base @@ -2233,18 +2233,18 @@ extern struct symbol *find_symbol_at_address (CORE_ADDR); function (exclusive). If the optional parameter BLOCK is non-null, then set *BLOCK to the address of the block corresponding to the function symbol, if such a symbol could be found during the lookup; - nullptr is used as a return value for *BLOCK if no block is found. + nullptr is used as a return value for *BLOCK if no block is found. This function either succeeds or fails (not halfway succeeds). If it succeeds, it sets *NAME, *ADDRESS, and *ENDADDR to real information and returns true. If it fails, it sets *NAME, *ADDRESS and *ENDADDR to zero and returns false. - + If the function in question occupies non-contiguous ranges, *ADDRESS and *ENDADDR are (subject to the conditions noted above) set to the start and end of the range in which PC is found. Thus *ADDRESS <= PC < *ENDADDR with no intervening gaps (in which ranges from other functions might be found). - + This property allows find_pc_partial_function to be used (as it had been prior to the introduction of non-contiguous range support) by various tdep files for finding a start address and limit address @@ -2255,9 +2255,9 @@ extern struct symbol *find_symbol_at_address (CORE_ADDR); argument can be made that prologue analysis ought to be performed starting from the entry pc even when PC is within some other range. This might suggest that *ADDRESS and *ENDADDR ought to be set to the - limits of the entry pc range, but that will cause the + limits of the entry pc range, but that will cause the *ADDRESS <= PC < *ENDADDR condition to be violated; many of the - callers of find_pc_partial_function expect this condition to hold. + callers of find_pc_partial_function expect this condition to hold. Callers which require the start and/or end addresses for the range containing the entry pc should instead call diff --git a/gdb/target.c b/gdb/target.c index d8633caefce..641ec1d7e72 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -1289,7 +1289,7 @@ target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset, try { CORE_ADDR lm_addr; - + /* Fetch the load module address for this objfile. */ lm_addr = gdbarch_fetch_tls_load_module_address (gdbarch, objfile); @@ -3536,7 +3536,7 @@ target_fileio_read_alloc (struct inferior *inf, const char *filename, /* See target.h. */ -gdb::unique_xmalloc_ptr +gdb::unique_xmalloc_ptr target_fileio_read_stralloc (struct inferior *inf, const char *filename) { gdb_byte *buffer; diff --git a/gdb/target.h b/gdb/target.h index 3525a430aa0..40823253a0f 100644 --- a/gdb/target.h +++ b/gdb/target.h @@ -108,7 +108,7 @@ enum thread_control_capabilities /* The structure below stores information about a system call. It is basically used in the "catch syscall" command, and in every function that gives information about a system call. - + It's also good to mention that its fields represent everything that we currently know about a syscall in GDB. */ struct syscall @@ -392,18 +392,18 @@ typedef void async_callback_ftype (enum inferior_event_type event_type, /* These defines are used to mark target_ops methods. The script make-target-delegates scans these and auto-generates the base method implementations. There are four macros that can be used: - + 1. TARGET_DEFAULT_IGNORE. There is no argument. The base method does nothing. This is only valid if the method return type is 'void'. - + 2. TARGET_DEFAULT_NORETURN. The argument is a function call, like 'tcomplain ()'. The base method simply makes this call, which is assumed not to return. - + 3. TARGET_DEFAULT_RETURN. The argument is a C expression. The base method returns this expression's value. - + 4. TARGET_DEFAULT_FUNC. The argument is the name of a function. make-target-delegates does not generate a base method in this case, but instead uses the argument function as the base method. */ diff --git a/gdb/target/waitstatus.h b/gdb/target/waitstatus.h index d87988f9b77..55dc38b638d 100644 --- a/gdb/target/waitstatus.h +++ b/gdb/target/waitstatus.h @@ -47,15 +47,15 @@ enum target_waitkind value.related_pid. I.e., if the child forks, value.related_pid is the parent's ID. */ TARGET_WAITKIND_FORKED, - + /* The program has vforked. A "related" process's PTID is in value.related_pid. */ TARGET_WAITKIND_VFORKED, - + /* The program has exec'ed a new executable file. The new file's pathname is pointed to by value.execd_pathname. */ TARGET_WAITKIND_EXECD, - + /* The program had previously vforked, and now the child is done with the shared memory region, because it exec'ed or exited. Note that the event is reported to the vfork parent. This is @@ -87,11 +87,11 @@ enum target_waitkind function. This way the event loop is responsive to other events, like for instance the user typing. */ TARGET_WAITKIND_IGNORE, - + /* The target has run out of history information, and cannot run backward any further. */ TARGET_WAITKIND_NO_HISTORY, - + /* There are no resumed children left in the program. */ TARGET_WAITKIND_NO_RESUMED, diff --git a/gdb/testsuite/config/gdbserver.exp b/gdb/testsuite/config/gdbserver.exp index 40298d68c3f..071334c8966 100644 --- a/gdb/testsuite/config/gdbserver.exp +++ b/gdb/testsuite/config/gdbserver.exp @@ -18,8 +18,8 @@ # a different host. # -# This module to be used for testing gdb with a "gdbserver" -# built either from libremote or from gdb/gdbserver. +# This module to be used for testing gdb with a "gdbserver" +# built either from libremote or from gdb/gdbserver. # # @@ -45,7 +45,7 @@ # 'O' packet. This means that tests involving printf will # fail unles you set this varibale in your baseboard # configuration file. -# +# # set_board_info gdb,no_hardware_watchpoints 1 # Unles you have a gdbserver that supports hardware watchpoints. # FIXME: gdb should detect if the target doesn't support them, @@ -57,7 +57,7 @@ # # set_board_info sockethost # The name of the host computer whose socket is being used. -# Defaults to "localhost". Note: old gdbserver requires +# Defaults to "localhost". Note: old gdbserver requires # that you define this, but libremote/gdbserver does not. # # set_board_info gdb,socketport diff --git a/gdb/testsuite/config/monitor.exp b/gdb/testsuite/config/monitor.exp index 7634510a552..7b6a0db21b6 100644 --- a/gdb/testsuite/config/monitor.exp +++ b/gdb/testsuite/config/monitor.exp @@ -43,7 +43,7 @@ proc gdb_target_cmd { targetname serialport } { verbose "Set target to $targetname" return 0 } - -re "Connected to.*$gdb_prompt" { + -re "Connected to.*$gdb_prompt" { verbose "Set target to $targetname" return 0 } @@ -120,7 +120,7 @@ proc gdb_target_monitor { exec_file } { proc gdb_target_exec { } { gdb_test "target exec" "No executable file now." "" ".*Kill it.*y or n.*" "y" - + } # # gdb_load -- load a file into the debugger. diff --git a/gdb/testsuite/config/sid.exp b/gdb/testsuite/config/sid.exp index f4a58b9e506..54825fd1254 100644 --- a/gdb/testsuite/config/sid.exp +++ b/gdb/testsuite/config/sid.exp @@ -21,10 +21,10 @@ proc sid_start {} { case [target_info multilib_flags] in { { *big-endian* *-EB* *-meb* } { set sidendian "-EB" } { *little-endian* *-EL* *-mel* } { set sidendian "-EL" } - default { + default { if {[target_info exists sim,defaultendian]} { - set sidendian [target_info sim,defaultendian] - } else { + set sidendian [target_info sim,defaultendian] + } else { # rely on endianness settings in sid configuration defaults set sidendian "" } @@ -81,7 +81,7 @@ proc sid_start {} { # Don't do the following any more; it breaks with "runtest ... < /dev/null" # expect_background { -# -re \[^\n\]*\n { +# -re \[^\n\]*\n { # regsub "\n" $expect_out(buffer) {} msg # verbose "SID: $msg" 2 # } @@ -147,7 +147,7 @@ proc gdb_target_sid { } { -re "Remote debugging using.*$gdb_prompt" { verbose "Set target to sid" } - timeout { + timeout { perror "Couldn't set target for remote simulator." gdb_exit } diff --git a/gdb/testsuite/config/sim.exp b/gdb/testsuite/config/sim.exp index b12d7ce61a0..4c86d028caf 100644 --- a/gdb/testsuite/config/sim.exp +++ b/gdb/testsuite/config/sim.exp @@ -24,7 +24,7 @@ set_board_info gdb_protocol "sim" # proc gdb_target_sim { } { global gdb_prompt - + set target_sim_options "[board_info target gdb,target_sim_options]" send_gdb "target sim $target_sim_options\n" @@ -32,7 +32,7 @@ proc gdb_target_sim { } { -re "Connected to the simulator.*$gdb_prompt $" { verbose "Set target to sim" } - timeout { + timeout { perror "Couldn't set target for simulator." return -1 } diff --git a/gdb/testsuite/config/slite.exp b/gdb/testsuite/config/slite.exp index d4ae98d04f7..83aa14900c9 100644 --- a/gdb/testsuite/config/slite.exp +++ b/gdb/testsuite/config/slite.exp @@ -31,7 +31,7 @@ load_lib remote.exp set gdb_prompt "\\(gdb\\)" # -# gdb_load -- load a file into the GDB. +# gdb_load -- load a file into the GDB. # Returns a 0 if there was an error, # 1 if it load successfully. # @@ -87,14 +87,14 @@ proc gdb_load { arg } { send_user "Set target to $targetname\n" } } - timeout { + timeout { perror "Couldn't set SLITE target." set timeout 10 verbose "Timeout is now $timeout seconds" 2 return -1 } } - + if [target_info exists gdb_load_offset] { set offset "[target_info gdb_load_offset]" } else { diff --git a/gdb/testsuite/gdb.ada/scalar_storage/storage.adb b/gdb/testsuite/gdb.ada/scalar_storage/storage.adb index 46501b19608..7aae979e820 100644 --- a/gdb/testsuite/gdb.ada/scalar_storage/storage.adb +++ b/gdb/testsuite/gdb.ada/scalar_storage/storage.adb @@ -28,7 +28,7 @@ procedure Storage is Another_Value : Another_Range; Color : Colors; end record; - + for Rec use record Value at 0 range 0..6; Another_Value at 0 range 7..10; diff --git a/gdb/testsuite/gdb.arch/aarch64-fp.c b/gdb/testsuite/gdb.arch/aarch64-fp.c index d8e62bbdb54..2bc990a9447 100644 --- a/gdb/testsuite/gdb.arch/aarch64-fp.c +++ b/gdb/testsuite/gdb.arch/aarch64-fp.c @@ -24,7 +24,7 @@ main (void) 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}; long val; void *addr; - + addr = &buf0[0]; __asm __volatile ("ldr %x0, [%1]\n\t" "ldr q0, [%x0]" @@ -38,7 +38,7 @@ main (void) : "=r" (val) : "r" (&addr) : "q1" ); - + return 1; } diff --git a/gdb/testsuite/gdb.arch/altivec-abi.c b/gdb/testsuite/gdb.arch/altivec-abi.c index 61931a04ce5..fb3b106b1d6 100644 --- a/gdb/testsuite/gdb.arch/altivec-abi.c +++ b/gdb/testsuite/gdb.arch/altivec-abi.c @@ -15,7 +15,7 @@ vector unsigned int vuint_d = {0,0,0,0}; vector char vchar_d = {'z','z','z','z','z','z','z','z','z','z','z','z','z','z','z','z'}; vector unsigned char vuchar_d = {'Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z','Z'}; vector float vfloat_d = {1.0, 1.0, 1.0, 1.0}; - + struct test_vec_struct { vector signed short vshort1; @@ -45,7 +45,7 @@ array_of_vector_func (vector signed short *matrix) matrix[0] = vec_add (matrix[0], matrix[1]); matrix[2] = vec_add (matrix[2], matrix[3]); } - + vector int vec_func (vector short vshort_f, /* goes in v2 */ vector unsigned short vushort_f, /* goes in v3 */ @@ -89,7 +89,7 @@ void marker(void) {}; int main (void) -{ +{ vector int result = {-1,-1,-1,-1}; vector short x = {1,2,3,4,5,6,7,8}; vector int y = {12, 22, 32, 42}; @@ -104,11 +104,11 @@ main (void) vector char a_d = {'q','q','q','q','q','q','q','q','q','q','q','q','q','q','q','q'}; vector float b_d = {5.0, 5.0, 5.0, 5.0}; vector float c_d = {3.0, 3.0, 3.0, 3.0}; - + int var_int = 44; short var_short = 3; struct test_vec_struct vect_struct; - + vect_struct.vshort1 = (vector signed short){1, 2, 3, 4, 5, 6, 7, 8}; vect_struct.vshort2 = (vector signed short){11, 12, 13, 14, 15, 16, 17, 18}; vect_struct.vshort3 = (vector signed short){21, 22, 23, 24, 25, 26, 27, 28}; diff --git a/gdb/testsuite/gdb.arch/altivec-regs.c b/gdb/testsuite/gdb.arch/altivec-regs.c index a838b28b9b5..6dbbc232fdb 100644 --- a/gdb/testsuite/gdb.arch/altivec-regs.c +++ b/gdb/testsuite/gdb.arch/altivec-regs.c @@ -11,13 +11,13 @@ vector_fun (volatile vector unsigned int a, volatile vector unsigned int b) c = vec_add (a, b); return c; } - + int main () { - vector unsigned int y; - vector unsigned int x; - vector unsigned int z; + vector unsigned int y; + vector unsigned int x; + vector unsigned int z; int a = 0; #ifdef _AIX @@ -34,7 +34,7 @@ main () a = 9; /* start here */ x = ((vector unsigned int) vec_splat_u8 (-2)); y = ((vector unsigned int) vec_splat_u8 (1)); - + z = vector_fun (x, y); x = vec_sld (x,y,2); diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S index bb518745765..e76feb05941 100644 --- a/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S +++ b/gdb/testsuite/gdb.arch/amd64-entry-value-inline.S @@ -37,7 +37,7 @@ fn1: movl v(%rip), %eax addl $1, %eax movl %eax, v(%rip) -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE0: @@ -109,7 +109,7 @@ fn3: popq %rbx .cfi_def_cfa_offset 8 .LVL7: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE2: @@ -134,7 +134,7 @@ main: # gdb.arch/amd64-entry-value-inline.c:50 .loc 1 50 0 xorl %eax, %eax -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE3: diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.S b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.S index a4d98ab3d09..8d31eab037b 100644 --- a/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.S +++ b/gdb/testsuite/gdb.arch/amd64-entry-value-paramref.S @@ -46,7 +46,7 @@ _ZL3barRi.constprop.0: # gdb.arch/amd64-entry-value-paramref.cc:25 .loc 1 25 0 movl (%rdi), %eax -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] # gdb.arch/amd64-entry-value-paramref.cc:26 .loc 1 26 0 ret @@ -82,7 +82,7 @@ main: .loc 1 33 0 addq $16, %rsp .cfi_def_cfa_offset 8 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE1: diff --git a/gdb/testsuite/gdb.arch/amd64-entry-value.s b/gdb/testsuite/gdb.arch/amd64-entry-value.s index d9e6a7e10bb..1afb6a8c7e0 100644 --- a/gdb/testsuite/gdb.arch/amd64-entry-value.s +++ b/gdb/testsuite/gdb.arch/amd64-entry-value.s @@ -35,7 +35,7 @@ _ZL1eid: # gdb.arch/amd64-entry-value.cc:23 .loc 1 23 0 movl $0, _ZL1v(%rip) -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] # gdb.arch/amd64-entry-value.cc:24 .loc 1 24 0 ret @@ -105,7 +105,7 @@ _ZL7locexpri: # 41 "gdb.arch/amd64-entry-value.cc" 1 breakhere_locexpr: # 0 "" 2 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] # gdb.arch/amd64-entry-value.cc:42 .loc 1 42 0 #NO_APP @@ -516,7 +516,7 @@ _ZL5datapv: # gdb.arch/amd64-entry-value.cc:164 .loc 1 164 0 movl $_ZZL5datapvE3two, %eax -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE16: @@ -534,7 +534,7 @@ _ZL11datap_inputPi: # gdb.arch/amd64-entry-value.cc:169 .loc 1 169 0 addl $1, (%rdi) -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] # gdb.arch/amd64-entry-value.cc:170 .loc 1 170 0 ret @@ -553,7 +553,7 @@ _ZL4datav: # gdb.arch/amd64-entry-value.cc:176 .loc 1 176 0 movl $10, %eax -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE18: @@ -570,7 +570,7 @@ _ZL5data2v: # gdb.arch/amd64-entry-value.cc:182 .loc 1 182 0 movl $20, %eax -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE19: @@ -613,7 +613,7 @@ _ZL9differenti: .LCFI5: .cfi_def_cfa_offset 8 .LVL63: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE20: @@ -661,7 +661,7 @@ _ZL8validityii: .LCFI7: .cfi_def_cfa_offset 8 .LVL66: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE21: @@ -689,7 +689,7 @@ _ZL7invalidi: # 206 "gdb.arch/amd64-entry-value.cc" 1 breakhere_invalid: # 0 "" 2 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] # gdb.arch/amd64-entry-value.cc:207 .loc 1 207 0 #NO_APP @@ -831,7 +831,7 @@ main: # SUCC: 4 [100.0%] (fallthru,can_fallthru) .LVL86: # BLOCK 4 freq:10000 seq:2 -# PRED: 3 [100.0%] (fallthru,can_fallthru) 5 [100.0%] +# PRED: 3 [100.0%] (fallthru,can_fallthru) 5 [100.0%] .L31: # gdb.arch/amd64-entry-value.cc:230 .loc 1 230 0 @@ -855,7 +855,7 @@ main: .LCFI11: .cfi_def_cfa_offset 8 .LVL89: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .LVL90: # BLOCK 5 freq:3900 seq:3 @@ -870,7 +870,7 @@ main: movl $1, %edi call _ZL1aid .LVL91: -# SUCC: 4 [100.0%] +# SUCC: 4 [100.0%] jmp .L31 .LBE6: .cfi_endproc diff --git a/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.S b/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.S index 81b6b9ca4d2..f9e10b9e962 100644 --- a/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.S +++ b/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.S @@ -18,7 +18,7 @@ /* This file is compiled from gdb.arch/amd64-invalid-stack-middle.c using: 'gcc -g -O0 -S -dA' and gcc version '4.7.2'. Changes were then made to the CFI entry for func2. */ - + .file "amd64-invalid-stack-middle.c" .text .Ltext0: @@ -39,7 +39,7 @@ breakpt: .loc 1 27 0 popq %rbp .LCFI2: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .LFE0: .size breakpt, .-breakpt @@ -63,7 +63,7 @@ func5: .loc 1 33 0 popq %rbp .LCFI5: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .LFE1: .size func5, .-func5 @@ -87,7 +87,7 @@ func4: .loc 1 39 0 popq %rbp .LCFI8: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .LFE2: .size func4, .-func4 @@ -111,7 +111,7 @@ func3: .loc 1 45 0 popq %rbp .LCFI11: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .LFE3: .size func3, .-func3 @@ -137,7 +137,7 @@ func2: .loc 1 51 0 leave .LCFI14: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .LFE4: .size func2, .-func2 @@ -164,7 +164,7 @@ func1: .loc 1 57 0 leave .LCFI17: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .LFE5: .size func1, .-func1 @@ -252,7 +252,7 @@ make_invalid_ptr: .loc 1 78 0 leave .LCFI20: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .LFE6: .size make_invalid_ptr, .-make_invalid_ptr @@ -285,7 +285,7 @@ main: .loc 1 89 0 leave .LCFI23: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .LFE7: .size main, .-main diff --git a/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c b/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c index 8123e70d2fc..d46774b04ad 100644 --- a/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c +++ b/gdb/testsuite/gdb.arch/amd64-invalid-stack-middle.c @@ -65,7 +65,7 @@ make_invalid_ptr (void) { int page_size, ans; void *ptr; - + page_size = getpagesize (); ptr = mmap (0, page_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, @@ -77,13 +77,13 @@ make_invalid_ptr (void) return ptr; } -int +int main (void) { void *invalid_ptr; invalid_ptr = make_invalid_ptr (); func1 (invalid_ptr); - + return 0; } diff --git a/gdb/testsuite/gdb.arch/amd64-invalid-stack-top.c b/gdb/testsuite/gdb.arch/amd64-invalid-stack-top.c index 39b1a615069..61155fbec03 100644 --- a/gdb/testsuite/gdb.arch/amd64-invalid-stack-top.c +++ b/gdb/testsuite/gdb.arch/amd64-invalid-stack-top.c @@ -49,7 +49,7 @@ make_invalid_ptr (void) { int page_size, ans; void *ptr; - + page_size = getpagesize (); ptr = mmap (0, page_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, @@ -61,13 +61,13 @@ make_invalid_ptr (void) return ptr; } -int +int main (void) { void *invalid_ptr; invalid_ptr = make_invalid_ptr (); func1 (invalid_ptr); - + return 0; } diff --git a/gdb/testsuite/gdb.arch/amd64-optimout-repeat.S b/gdb/testsuite/gdb.arch/amd64-optimout-repeat.S index 30e7ec8816f..ad41a908665 100644 --- a/gdb/testsuite/gdb.arch/amd64-optimout-repeat.S +++ b/gdb/testsuite/gdb.arch/amd64-optimout-repeat.S @@ -43,7 +43,7 @@ main: # gdb.arch/amd64-optimout-repeat.c:29 .loc 1 29 0 xorl %eax, %eax -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE0: diff --git a/gdb/testsuite/gdb.arch/amd64-prologue-xmm.s b/gdb/testsuite/gdb.arch/amd64-prologue-xmm.s index bbbdb7a620e..333f05598ea 100644 --- a/gdb/testsuite/gdb.arch/amd64-prologue-xmm.s +++ b/gdb/testsuite/gdb.arch/amd64-prologue-xmm.s @@ -1,5 +1,5 @@ /* This testcase is part of GDB, the GNU debugger. - + Copyright 2011-2025 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ - + /* This file is compiled from gdb.arch/amd64-prologue-xmm.c using -g -dA -S. */ diff --git a/gdb/testsuite/gdb.arch/amd64-pseudo.c b/gdb/testsuite/gdb.arch/amd64-pseudo.c index 982d436aec3..e42019b9648 100644 --- a/gdb/testsuite/gdb.arch/amd64-pseudo.c +++ b/gdb/testsuite/gdb.arch/amd64-pseudo.c @@ -61,7 +61,7 @@ main (int argc, char **argv) "mov 16(%0), %%esi\n\t" "mov 20(%0), %%edi\n\t" : /* no output operands */ - : "r" (data) + : "r" (data) : "eax", "ebx", "ecx", "edx", "esi", "edi"); asm ("nop"); /* first breakpoint here */ @@ -74,7 +74,7 @@ main (int argc, char **argv) "mov 48(%0), %%r14d\n\t" "mov 52(%0), %%r15d\n\t" : /* no output operands */ - : "r" (data) + : "r" (data) : "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"); asm ("nop" /* second breakpoint here */ diff --git a/gdb/testsuite/gdb.arch/amd64-stap-three-arg-disp.S b/gdb/testsuite/gdb.arch/amd64-stap-three-arg-disp.S index 17b64048082..a2f8abf45bf 100644 --- a/gdb/testsuite/gdb.arch/amd64-stap-three-arg-disp.S +++ b/gdb/testsuite/gdb.arch/amd64-stap-three-arg-disp.S @@ -48,7 +48,7 @@ _.stapsdt.base: .space 1 #NO_APP popq %rbp .cfi_def_cfa 7, 8 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE0: diff --git a/gdb/testsuite/gdb.arch/amd64-stap-triplet.S b/gdb/testsuite/gdb.arch/amd64-stap-triplet.S index 5fd18af8c87..cb00e86ba86 100644 --- a/gdb/testsuite/gdb.arch/amd64-stap-triplet.S +++ b/gdb/testsuite/gdb.arch/amd64-stap-triplet.S @@ -79,7 +79,7 @@ _.stapsdt.base: .space 1 movl $0, %eax popq %rbp .cfi_def_cfa 7, 8 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE0: diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-cxx1.S b/gdb/testsuite/gdb.arch/amd64-tailcall-cxx1.S index 5efa0f31bb6..fec131e934d 100644 --- a/gdb/testsuite/gdb.arch/amd64-tailcall-cxx1.S +++ b/gdb/testsuite/gdb.arch/amd64-tailcall-cxx1.S @@ -38,7 +38,7 @@ _Z1gi: # gdb.arch/amd64-tailcall-cxx1.cc:23 .loc 1 23 0 movl %edi, v(%rip) -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE0: @@ -66,7 +66,7 @@ main: xorl %eax, %eax addq $8, %rsp .cfi_def_cfa_offset 8 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE1: diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-noret.S b/gdb/testsuite/gdb.arch/amd64-tailcall-noret.S index 7e87c1a931d..c6fed3a777f 100644 --- a/gdb/testsuite/gdb.arch/amd64-tailcall-noret.S +++ b/gdb/testsuite/gdb.arch/amd64-tailcall-noret.S @@ -63,7 +63,7 @@ mayret: jne .L8 # BLOCK 3 freq:9996 seq:1 # PRED: 2 [100.0%] (fallthru,can_fallthru) -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] rep ret # BLOCK 4 freq:4 seq:2 @@ -126,7 +126,7 @@ main: addq $8, %rsp .LCFI3: .cfi_def_cfa_offset 8 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE12: diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-ret.S b/gdb/testsuite/gdb.arch/amd64-tailcall-ret.S index 97624f6d7b2..9daa88203c5 100644 --- a/gdb/testsuite/gdb.arch/amd64-tailcall-ret.S +++ b/gdb/testsuite/gdb.arch/amd64-tailcall-ret.S @@ -35,7 +35,7 @@ g: # gdb.arch/amd64-tailcall-ret.c:23 .loc 1 23 0 movl $2, v(%rip) -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE0: @@ -82,7 +82,7 @@ main: # gdb.arch/amd64-tailcall-ret.c:39 .loc 1 39 0 xorl %eax, %eax -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE2: diff --git a/gdb/testsuite/gdb.arch/amd64-tailcall-self.S b/gdb/testsuite/gdb.arch/amd64-tailcall-self.S index 24f4e64c08f..671399d48a1 100644 --- a/gdb/testsuite/gdb.arch/amd64-tailcall-self.S +++ b/gdb/testsuite/gdb.arch/amd64-tailcall-self.S @@ -40,7 +40,7 @@ b: # PRED: ENTRY [100.0%] (FALLTHRU) # amd64-tailcall-self.c:2 .loc 1 2 0 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE0: @@ -66,7 +66,7 @@ c: # amd64-tailcall-self.c:8 .loc 1 8 0 leal 1(%rdi), %eax -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] # amd64-tailcall-self.c:9 .loc 1 9 0 ret @@ -133,7 +133,7 @@ a: # BLOCK 6 freq:721 seq:4 # PRED: 4 [80.1%] (CAN_FALLTHRU) .L3: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE2: @@ -163,7 +163,7 @@ main: # amd64-tailcall-self.c:23 .loc 1 23 0 xorl %eax, %eax -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE3: diff --git a/gdb/testsuite/gdb.arch/arm-disp-step.S b/gdb/testsuite/gdb.arch/arm-disp-step.S index bb21d3e4964..9b690f45b0c 100644 --- a/gdb/testsuite/gdb.arch/arm-disp-step.S +++ b/gdb/testsuite/gdb.arch/arm-disp-step.S @@ -28,15 +28,15 @@ main: add sp, sp, #4 mov r7, sp - - /* Test call and return */ + + /* Test call and return */ .global test_call test_call: bl test_call_subr .global test_ret_end test_ret_end: nop @ Location test_ret_end - + /* Test branch */ bl test_branch @@ -73,7 +73,7 @@ test_ret_end: #endif bl test_pop_pc - + /* Test str in ARM mode and Thumb-2 */ #if !defined(__thumb__) bl test_str_pc @@ -89,7 +89,7 @@ test_ret_end: movs r0, #0 pop {r7, pc} .size main, .-main - + .global test_call_subr #if defined (__thumb__) .code 16 @@ -106,7 +106,7 @@ test_ret: bx lr .size test_call_subr, .-test_call_subr - + .global test_branch #if defined (__thumb__) .code 16 @@ -153,7 +153,7 @@ test_ldm_stm_pc_ret: .word test_ldm_stm_pc_ret .size test_ldm_stm_pc, .-test_ldm_stm_pc #endif - + #if !defined (__thumb__) || defined(__thumb2__) .global test_ldr_literal .type test_ldr_literal, %function @@ -296,7 +296,7 @@ test_pop_pc_3_start: push {r1} /* Push the right address so that PC will get it. */ /* Push the wrong address so r0-r7 will get the wrong a ddress. If PC is set from any of them, we can get a FAIL. */ - push {r2} + push {r2} push {r2} push {r2} push {r2} @@ -329,7 +329,7 @@ test_pop_pc_3_right: .global test_pop_pc_3_wrong test_pop_pc_3_wrong: b test_pop_pc_ret /* wrong */ - + .align 2 .L1_right: .word test_pop_pc_1_right diff --git a/gdb/testsuite/gdb.arch/e500-abi.c b/gdb/testsuite/gdb.arch/e500-abi.c index e2156124b11..2f6b200fd84 100644 --- a/gdb/testsuite/gdb.arch/e500-abi.c +++ b/gdb/testsuite/gdb.arch/e500-abi.c @@ -37,7 +37,7 @@ vec_func (vector unsigned int a_vec_f, vector float h_vec_f, vector float i_vec_f, vector unsigned int l_vec_f, - vector int m_vec_f) + vector int m_vec_f) { vector int n_vec; @@ -45,7 +45,7 @@ vec_func (vector unsigned int a_vec_f, int x,y,z; x = 2; y = 3; - + z = x + y; z++; n_vec = __ev_and(a_vec_f, b_vec_f); diff --git a/gdb/testsuite/gdb.arch/e500-regs.c b/gdb/testsuite/gdb.arch/e500-regs.c index bae5f3955b4..a90393da6dc 100644 --- a/gdb/testsuite/gdb.arch/e500-regs.c +++ b/gdb/testsuite/gdb.arch/e500-regs.c @@ -14,13 +14,13 @@ vector_fun (vector int a, vector int b) c = __ev_and (a, b); return c; } - + int main () { - vector int y; - vector int x; - vector int z; + vector int y; + vector int x; + vector int z; int a; /* This line may look unnecessary but we do need it, because we want to @@ -31,7 +31,7 @@ main () a = 9; x = (vector int) __ev_create_s32 (-2, -2); y = (vector int) __ev_create_s32 (1, 1); - + z = vector_fun (x, y); return 0; diff --git a/gdb/testsuite/gdb.arch/gdb1291.s b/gdb/testsuite/gdb.arch/gdb1291.s index f83db0f6ec8..454f1b54db4 100644 --- a/gdb/testsuite/gdb.arch/gdb1291.s +++ b/gdb/testsuite/gdb.arch/gdb1291.s @@ -22,7 +22,7 @@ ! source file: ! ! #include -! +! ! main() ! { ! printf("hello world\n"); @@ -32,13 +32,13 @@ ! sub1() ! { ! int buf[64]; -! +! ! } -! +! ! sub2() ! { ! int buf[65]; -! +! ! } ! ! We use a pregenerated assembly file as the test input to avoid possible @@ -72,7 +72,7 @@ _main: mov r14,r15 lds.l @r15+,pr mov.l @r15+,r14 - rts + rts nop .L6: .align 2 @@ -99,7 +99,7 @@ _sub1: mov r14,r15 lds.l @r15+,pr mov.l @r15+,r14 - rts + rts nop .align 1 .L8: @@ -119,7 +119,7 @@ _sub2: mov r14,r15 lds.l @r15+,pr mov.l @r15+,r14 - rts + rts nop .align 1 .L11: diff --git a/gdb/testsuite/gdb.arch/gdb1431.s b/gdb/testsuite/gdb.arch/gdb1431.s index 10482dc7455..085163a8292 100644 --- a/gdb/testsuite/gdb.arch/gdb1431.s +++ b/gdb/testsuite/gdb.arch/gdb1431.s @@ -22,7 +22,7 @@ ! source file: ! ! #include -! +! ! main() ! { ! printf("hello world\n"); @@ -32,13 +32,13 @@ ! sub1() ! { ! int buf[64]; -! +! ! } -! +! ! sub2() ! { ! int buf[65]; -! +! ! } ! ! We use a pregenerated assembly file as the test input to avoid possible @@ -72,7 +72,7 @@ _main: mov r14,r15 lds.l @r15+,pr mov.l @r15+,r14 - rts + rts nop .L6: .align 2 @@ -99,7 +99,7 @@ _sub1: mov r14,r15 lds.l @r15+,pr mov.l @r15+,r14 - rts + rts nop .align 1 .L8: @@ -119,7 +119,7 @@ _sub2: mov r14,r15 lds.l @r15+,pr mov.l @r15+,r14 - rts + rts nop .align 1 .L11: diff --git a/gdb/testsuite/gdb.arch/gdb1558.c b/gdb/testsuite/gdb.arch/gdb1558.c index 063b861c8f9..5e2a1f5dab7 100644 --- a/gdb/testsuite/gdb.arch/gdb1558.c +++ b/gdb/testsuite/gdb.arch/gdb1558.c @@ -1,5 +1,5 @@ /* Copyright 2004-2025 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or @@ -12,10 +12,10 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . - + Please email any bugs, comments, and/or additions to this file to: bug-gdb@gnu.org - + This file is part of the gdb testsuite. */ #include @@ -24,12 +24,12 @@ sub1 () { printf ("In sub1\n"); } - + sub2 () { printf ("In sub2\n"); } - + main () { sub1 (); diff --git a/gdb/testsuite/gdb.arch/i386-gnu-cfi-asm.S b/gdb/testsuite/gdb.arch/i386-gnu-cfi-asm.S index f628f82f3de..0d66be4bfdd 100644 --- a/gdb/testsuite/gdb.arch/i386-gnu-cfi-asm.S +++ b/gdb/testsuite/gdb.arch/i386-gnu-cfi-asm.S @@ -21,13 +21,13 @@ It was generated using "gcc -g -O9 -S -o gate.s gate.c -fasynchronous-unwind-tables", using the following source file: - - + + void *gate (void *(*gate) (void *data), void *data) { return 1 + (*gate) (data); } - + Changes are marked as `CHANGE' below. */ .file "gate.c" diff --git a/gdb/testsuite/gdb.arch/i386-pseudo.c b/gdb/testsuite/gdb.arch/i386-pseudo.c index 31754dc37a4..460550f7667 100644 --- a/gdb/testsuite/gdb.arch/i386-pseudo.c +++ b/gdb/testsuite/gdb.arch/i386-pseudo.c @@ -39,7 +39,7 @@ main (int argc, char **argv) "mov 8(%0), %%ecx\n\t" "mov 12(%0), %%edx\n\t" : /* no output operands */ - : "r" (data) + : "r" (data) : "eax", "ebx", "ecx", "edx"); asm ("nop" /* first breakpoint here */ diff --git a/gdb/testsuite/gdb.arch/i386-sse.c b/gdb/testsuite/gdb.arch/i386-sse.c index 592952c2ca3..dfedf12b097 100644 --- a/gdb/testsuite/gdb.arch/i386-sse.c +++ b/gdb/testsuite/gdb.arch/i386-sse.c @@ -86,7 +86,7 @@ main (int argc, char **argv) "movaps 96(%0), %%xmm6\n\t" "movaps 112(%0), %%xmm7\n\t" : /* no output operands */ - : "r" (data) + : "r" (data) : "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"); #ifdef __x86_64__ asm ("movaps 128(%0), %%xmm8\n\t" @@ -98,7 +98,7 @@ main (int argc, char **argv) "movaps 224(%0), %%xmm14\n\t" "movaps 240(%0), %%xmm15\n\t" : /* no output operands */ - : "r" (data) + : "r" (data) : "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"); #endif @@ -114,7 +114,7 @@ main (int argc, char **argv) "movaps %%xmm6, 96(%0)\n\t" "movaps %%xmm7, 112(%0)\n\t" : /* no output operands */ - : "r" (data) + : "r" (data) : "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7"); #ifdef __x86_64__ asm ( @@ -127,7 +127,7 @@ main (int argc, char **argv) "movaps %%xmm14, 224(%0)\n\t" "movaps %%xmm15, 240(%0)\n\t" : /* no output operands */ - : "r" (data) + : "r" (data) : "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"); #endif diff --git a/gdb/testsuite/gdb.arch/i386-stap-eval-lang-ada.c b/gdb/testsuite/gdb.arch/i386-stap-eval-lang-ada.c index f232a21a375..d881b84e5b1 100644 --- a/gdb/testsuite/gdb.arch/i386-stap-eval-lang-ada.c +++ b/gdb/testsuite/gdb.arch/i386-stap-eval-lang-ada.c @@ -25,5 +25,5 @@ int main () int a = 40; STAP_PROBE1 (foo, bar, a); - return 0; + return 0; } diff --git a/gdb/testsuite/gdb.arch/mips-octeon-bbit.c b/gdb/testsuite/gdb.arch/mips-octeon-bbit.c index e3df4a4fd6d..e385d73eb46 100644 --- a/gdb/testsuite/gdb.arch/mips-octeon-bbit.c +++ b/gdb/testsuite/gdb.arch/mips-octeon-bbit.c @@ -24,7 +24,7 @@ void abort (void); volatile uint64_t taken_##BRANCH_IF##_##BIT = \ BASE & (~(1ull << BIT)) | ((uint64_t) BRANCH_IF << BIT); \ volatile uint64_t not_taken_##BRANCH_IF##_##BIT = \ - BASE & (~(1ull << BIT)) | (((uint64_t) !BRANCH_IF) << BIT); + BASE & (~(1ull << BIT)) | (((uint64_t) !BRANCH_IF) << BIT); DEF_BBIT_TAKEN (0, 10); DEF_BBIT_TAKEN (0, 36); diff --git a/gdb/testsuite/gdb.arch/sparc64-adi.c b/gdb/testsuite/gdb.arch/sparc64-adi.c index b1c7eb48042..44051167778 100644 --- a/gdb/testsuite/gdb.arch/sparc64-adi.c +++ b/gdb/testsuite/gdb.arch/sparc64-adi.c @@ -52,9 +52,9 @@ memory_fill (char *addr, size_t size, int pattern) { long *aligned_addr = (long *) addr; long i; - for (i = 0; i < size / sizeof (long); i += ONEKB) - { - *aligned_addr = pattern; + for (i = 0; i < size / sizeof (long); i += ONEKB) + { + *aligned_addr = pattern; aligned_addr = aligned_addr + ONEKB; } return (0); @@ -68,57 +68,57 @@ int main () /* Test ISM. */ int shmid = shmget (IPC_PRIVATE, SHMSIZE, IPC_CREAT | 0666); - if (shmid == -1) + if (shmid == -1) exit(1); char *shmaddr = (char *)shmat (shmid, NULL, 0x666 | SHM_RND); - if (shmaddr == (char *)-1) - { - shmctl (shmid, IPC_RMID, NULL); + if (shmaddr == (char *)-1) + { + shmctl (shmid, IPC_RMID, NULL); exit(1); } /* Enable ADI on ISM segment. */ - if (mprotect (shmaddr, SHMSIZE, PROT_READ|PROT_WRITE|PROT_ADI)) - { - perror ("mprotect failed"); - goto err_out; + if (mprotect (shmaddr, SHMSIZE, PROT_READ|PROT_WRITE|PROT_ADI)) + { + perror ("mprotect failed"); + goto err_out; } if (memory_fill (shmaddr, SHMSIZE, PAT) != 0) /* line breakpoint here */ { - exit(1); + exit(1); } adi_clr_version (shmaddr, SHMSIZE); caddr_t vshmaddr = adi_set_version (shmaddr, SHMSIZE, 0x8); - if (vshmaddr == 0) + if (vshmaddr == 0) exit(1); - /* Test mmap. */ + /* Test mmap. */ int fd = open ("/dev/zero", O_RDWR); if (fd < 0) exit(1); - char *maddr = (char *)mmap (NULL, MAPSIZE, PROT_READ|PROT_WRITE, + char *maddr = (char *)mmap (NULL, MAPSIZE, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0); - if (maddr == (char *)-1) - exit(1); + if (maddr == (char *)-1) + exit(1); /* Enable ADI. */ - if (mprotect (shmaddr, MAPSIZE, PROT_READ|PROT_WRITE|PROT_ADI)) - { - perror ("mprotect failed"); + if (mprotect (shmaddr, MAPSIZE, PROT_READ|PROT_WRITE|PROT_ADI)) + { + perror ("mprotect failed"); goto err_out; - + } - if (memory_fill (maddr, MAPSIZE, PAT) != 0) - exit(1); + if (memory_fill (maddr, MAPSIZE, PAT) != 0) + exit(1); caddr_t vmaddr = adi_set_version (maddr, MAPSIZE, 0x8); /* Test heap. */ haddr = (char*) memalign (MAPSIZE, MAPSIZE); /* Enable ADI. */ - if (mprotect (shmaddr, MAPSIZE, PROT_READ|PROT_WRITE|PROT_ADI)) - { - perror ("mprotect failed"); + if (mprotect (shmaddr, MAPSIZE, PROT_READ|PROT_WRITE|PROT_ADI)) + { + perror ("mprotect failed"); goto err_out; } - if (memory_fill (haddr, MAPSIZE, PAT) != 0) + if (memory_fill (haddr, MAPSIZE, PAT) != 0) exit(1); adi_clr_version (haddr, MAPSIZE); /* Set some ADP version number. */ @@ -128,7 +128,7 @@ int main () vaddr2 = adi_clr_version (haddr+64*4, 64*2); vaddr3 = adi_set_version (haddr+64*6, 64*2, 0xa); vaddr4 = adi_set_version (haddr+64*8, 64*10, 0x3); - if (vaddr == 0) + if (vaddr == 0) exit(1); char *versioned_p = vaddr; *versioned_p = 'a'; @@ -136,8 +136,8 @@ int main () *uvp = 'b'; // version mismatch trap return (0); -err_out: - if (shmdt ((const void *)shmaddr) != 0) +err_out: + if (shmdt ((const void *)shmaddr) != 0) perror ("Detach failure"); shmctl (shmid, IPC_RMID, NULL); exit (1); diff --git a/gdb/testsuite/gdb.asm/asmsrc1.s b/gdb/testsuite/gdb.asm/asmsrc1.s index 35b39ca7e1a..55a5465eed6 100644 --- a/gdb/testsuite/gdb.asm/asmsrc1.s +++ b/gdb/testsuite/gdb.asm/asmsrc1.s @@ -5,10 +5,10 @@ comment "Be careful about changing this file without also changing" comment "asm-source.exp." - + comment "This file is not linked with crt0." comment "Provide very simplistic equivalent." - + .global _start gdbasm_declare _start gdbasm_startup diff --git a/gdb/testsuite/gdb.base/advance.c b/gdb/testsuite/gdb.base/advance.c index a72cb13be01..d6b22d71f41 100644 --- a/gdb/testsuite/gdb.base/advance.c +++ b/gdb/testsuite/gdb.base/advance.c @@ -42,7 +42,7 @@ main () int b, c; c = 5; b = 3; /* advance this location */ - + func (c); /* stop here after leaving current frame */ marker1 (); /* stop here after leaving current frame */ func3 (); /* break here */ diff --git a/gdb/testsuite/gdb.base/all-types.c b/gdb/testsuite/gdb.base/all-types.c index 570fd43a2ff..fa1208e5569 100644 --- a/gdb/testsuite/gdb.base/all-types.c +++ b/gdb/testsuite/gdb.base/all-types.c @@ -30,7 +30,7 @@ int main () extern void dummy(); dummy(); return 0; - + } void dummy() @@ -43,16 +43,16 @@ void dummy() v_short = 3; v_signed_short = 4; - v_unsigned_short = 5; + v_unsigned_short = 5; v_int = 6; v_signed_int = 7; - v_unsigned_int = 8; + v_unsigned_int = 8; v_long = 9; v_signed_long = 10; - v_unsigned_long = 11; - + v_unsigned_long = 11; + v_float = 100.343434; v_double = 200.565656; } diff --git a/gdb/testsuite/gdb.base/annota1.c b/gdb/testsuite/gdb.base/annota1.c index 424e1b83278..5f77a2f033c 100644 --- a/gdb/testsuite/gdb.base/annota1.c +++ b/gdb/testsuite/gdb.base/annota1.c @@ -13,16 +13,16 @@ int main (void) { int my_array[3] = { 1, 2, 3 }; /* break main */ - + value = 7; - + #ifdef SIGUSR1 signal (SIGUSR1, handle_USR1); #endif printf ("value is %d\n", value); printf ("my_array[2] is %d\n", my_array[2]); - + { int i; for (i = 0; i < 5; i++) diff --git a/gdb/testsuite/gdb.base/annota3.c b/gdb/testsuite/gdb.base/annota3.c index 424e1b83278..5f77a2f033c 100644 --- a/gdb/testsuite/gdb.base/annota3.c +++ b/gdb/testsuite/gdb.base/annota3.c @@ -13,16 +13,16 @@ int main (void) { int my_array[3] = { 1, 2, 3 }; /* break main */ - + value = 7; - + #ifdef SIGUSR1 signal (SIGUSR1, handle_USR1); #endif printf ("value is %d\n", value); printf ("my_array[2] is %d\n", my_array[2]); - + { int i; for (i = 0; i < 5; i++) diff --git a/gdb/testsuite/gdb.base/async.c b/gdb/testsuite/gdb.base/async.c index 9148b1913d3..4a0e59d29b6 100644 --- a/gdb/testsuite/gdb.base/async.c +++ b/gdb/testsuite/gdb.base/async.c @@ -22,7 +22,7 @@ int main (void) { int y, z; - + y = 2; z = 9; y = foo (); diff --git a/gdb/testsuite/gdb.base/average.c b/gdb/testsuite/gdb.base/average.c index 874bb1abcc6..1a8086bd269 100644 --- a/gdb/testsuite/gdb.base/average.c +++ b/gdb/testsuite/gdb.base/average.c @@ -9,7 +9,7 @@ extern int sum(int *, int, int); static int my_list[num] = {3,4,2,0,2,1,8,3,6,7}; -void print_average(int *list, int low, int high) +void print_average(int *list, int low, int high) { int total = 0, num_elements = 0, average = 0; total = sum(list, low, high); diff --git a/gdb/testsuite/gdb.base/bfp-test.c b/gdb/testsuite/gdb.base/bfp-test.c index 927621cfa81..6bfee5bdb20 100644 --- a/gdb/testsuite/gdb.base/bfp-test.c +++ b/gdb/testsuite/gdb.base/bfp-test.c @@ -27,6 +27,6 @@ int main() b32 = 1.5f; b64 = 2.25; b128 = 3.375l; - + return 0; } diff --git a/gdb/testsuite/gdb.base/bigcore.c b/gdb/testsuite/gdb.base/bigcore.c index 1c12f4e861e..e50d41b5d07 100644 --- a/gdb/testsuite/gdb.base/bigcore.c +++ b/gdb/testsuite/gdb.base/bigcore.c @@ -192,7 +192,7 @@ main () } close (fd); } - + /* Compute an initial chunk size. The math is dodgy but it works for the moment. Perhaps there's a constant around somewhere. Limit this to max_core_size bytes - no point in trying to diff --git a/gdb/testsuite/gdb.base/bitfields2.c b/gdb/testsuite/gdb.base/bitfields2.c index edb3b9fadad..b02a4c741f2 100644 --- a/gdb/testsuite/gdb.base/bitfields2.c +++ b/gdb/testsuite/gdb.base/bitfields2.c @@ -159,7 +159,7 @@ void tester () break5 (); } -int main () +int main () { int i; diff --git a/gdb/testsuite/gdb.base/break1.c b/gdb/testsuite/gdb.base/break1.c index 26c4663edc3..94cbc0f7c0b 100644 --- a/gdb/testsuite/gdb.base/break1.c +++ b/gdb/testsuite/gdb.base/break1.c @@ -55,7 +55,7 @@ int some_variable; simply as places to try setting breakpoints at. They are explicitly "one-line functions" to verify that this case works (some versions of gcc have or have had problems with this). - + These functions are in a separate source file to prevent an optimizing compiler from inlining them and optimizing them away. */ diff --git a/gdb/testsuite/gdb.base/breakpoint-shadow.c b/gdb/testsuite/gdb.base/breakpoint-shadow.c index 2a128d5bb03..fa97e041618 100644 --- a/gdb/testsuite/gdb.base/breakpoint-shadow.c +++ b/gdb/testsuite/gdb.base/breakpoint-shadow.c @@ -19,7 +19,7 @@ int main (void) { volatile int i; - + i = 1; /* break-first */ i = 2; /* break-second */ diff --git a/gdb/testsuite/gdb.base/call-ar-st.c b/gdb/testsuite/gdb.base/call-ar-st.c index 4eac3f4d4cb..c8992b11b0f 100644 --- a/gdb/testsuite/gdb.base/call-ar-st.c +++ b/gdb/testsuite/gdb.base/call-ar-st.c @@ -8,7 +8,7 @@ /************************************************************************** * TESTS : * -- function arguments that are enumerated types - * -- small structure arguments ( <= 64 bits ) + * -- small structure arguments ( <= 64 bits ) * -- stored in registers * -- stored on the stack * -- large structure arguments ( > 64 bits ) @@ -27,7 +27,7 @@ */ typedef int id_int; -typedef enum { +typedef enum { BLACK, BLUE, BROWN, @@ -52,13 +52,13 @@ typedef enum { */ struct array_rep_info_t { - int next_index[10]; + int next_index[10]; int values[10]; int head; }; /***************************************************************************** - * Small structures ( <= 64 bits). These are used to test passing small + * Small structures ( <= 64 bits). These are used to test passing small * structures as parameters and test argument size promotion. *****************************************************************************/ @@ -139,7 +139,7 @@ struct int_char_combo_t { }; /***************************************************************** - * PRINT_STUDENT_ID_SHIRT_COLOR : + * PRINT_STUDENT_ID_SHIRT_COLOR : * IN id_int student -- enumerated type * IN colors shirt -- enumerated type *****************************************************************/ @@ -149,7 +149,7 @@ void print_student_id_shirt_color (id_int student, colors shirt) printf("student id : %d\t", student); printf("shirt color : "); switch (shirt) { - case BLACK : printf("BLACK\n"); + case BLACK : printf("BLACK\n"); break; case BLUE : printf("BLUE\n"); break; @@ -189,8 +189,8 @@ void print_student_id_shirt_color (id_int student, colors shirt) } /***************************************************************** - * PRINT_CHAR_ARRAY : - * IN char array_c[] -- character array + * PRINT_CHAR_ARRAY : + * IN char array_c[] -- character array *****************************************************************/ void print_char_array (char array_c[]) { @@ -200,14 +200,14 @@ void print_char_array (char array_c[]) printf("array_c :\n"); printf("=========\n\n"); for (index = 0; index < 120; index++) { - printf("%1c", array_c[index]); + printf("%1c", array_c[index]); if ((index%50) == 0) printf("\n"); } printf("\n\n"); } /***************************************************************** - * PRINT_DOUBLE_ARRAY : + * PRINT_DOUBLE_ARRAY : * IN double array_d[] -- array of doubles *****************************************************************/ void print_double_array (double array_d[]) @@ -218,15 +218,15 @@ void print_double_array (double array_d[]) printf("array_d :\n"); printf("=========\n\n"); for (index = 0; index < 9; index++) { - printf("%f ", array_d[index]); + printf("%f ", array_d[index]); if ((index%8) == 0) printf("\n"); } printf("\n\n"); } /***************************************************************** - * PRINT_FLOAT_ARRAY: - * IN float array_f[] -- array of floats + * PRINT_FLOAT_ARRAY: + * IN float array_f[] -- array of floats *****************************************************************/ void print_float_array (float array_f[]) { @@ -236,7 +236,7 @@ void print_float_array (float array_f[]) printf("array_f :\n"); printf("=========\n\n"); for (index = 0; index < 15; index++) { - printf("%f ", array_f[index]); + printf("%f ", array_f[index]); if ((index%8) == 0) printf("\n"); } @@ -244,8 +244,8 @@ void print_float_array (float array_f[]) } /***************************************************************** - * PRINT_INT_ARRAY: - * IN int array_i[] -- array of integers + * PRINT_INT_ARRAY: + * IN int array_i[] -- array of integers *****************************************************************/ void print_int_array (int array_i[]) { @@ -255,7 +255,7 @@ void print_int_array (int array_i[]) printf("array_i :\n"); printf("=========\n\n"); for (index = 0; index < 50; index++) { - printf("%d ", array_i[index]); + printf("%d ", array_i[index]); if ((index%8) == 0) printf("\n"); } printf("\n\n"); @@ -263,11 +263,11 @@ void print_int_array (int array_i[]) } /***************************************************************** - * PRINT_ALL_ARRAYS: - * IN int array_i[] -- array of integers - * IN char array_c[] -- array of characters - * IN float array_f[] -- array of floats - * IN double array_d[] -- array of doubles + * PRINT_ALL_ARRAYS: + * IN int array_i[] -- array of integers + * IN char array_c[] -- array of characters + * IN float array_f[] -- array of floats + * IN double array_d[] -- array of doubles *****************************************************************/ void print_all_arrays(int array_i[], char array_c[], float array_f[], double array_d[]) { @@ -278,8 +278,8 @@ void print_all_arrays(int array_i[], char array_c[], float array_f[], double arr } /***************************************************************** - * LOOP_COUNT : - * A do nothing function. Used to provide a point at which calls can be made. + * LOOP_COUNT : + * A do nothing function. Used to provide a point at which calls can be made. *****************************************************************/ void loop_count () { @@ -289,8 +289,8 @@ void loop_count () { } /***************************************************************** - * COMPUTE_WITH_SMALL_STRUCTS : - * A do nothing function. Used to provide a point at which calls can be made. + * COMPUTE_WITH_SMALL_STRUCTS : + * A do nothing function. Used to provide a point at which calls can be made. * IN int seed *****************************************************************/ void compute_with_small_structs (int seed) @@ -316,12 +316,12 @@ void compute_with_small_structs (int seed) * the call command behavior when integer arguments do not fit into * registers and must be placed on the stack. * OUT struct bit_flags_t *bit_flags -- structure to be filled - * IN unsigned a -- 0 or 1 - * IN unsigned b -- 0 or 1 - * IN unsigned g -- 0 or 1 - * IN unsigned d -- 0 or 1 - * IN unsigned e -- 0 or 1 - * IN unsigned o -- 0 or 1 + * IN unsigned a -- 0 or 1 + * IN unsigned b -- 0 or 1 + * IN unsigned g -- 0 or 1 + * IN unsigned d -- 0 or 1 + * IN unsigned e -- 0 or 1 + * IN unsigned o -- 0 or 1 *****************************************************************/ void init_bit_flags (struct bit_flags_t *bit_flags, unsigned a, unsigned b, unsigned g, unsigned d, unsigned e, unsigned o) { @@ -340,14 +340,14 @@ void init_bit_flags (struct bit_flags_t *bit_flags, unsigned a, unsigned b, unsi * to see the call command behavior when integer and character arguments * do not fit into registers and must be placed on the stack. * OUT struct bit_flags_combo_t *bit_flags_combo -- structure to fill - * IN unsigned a -- 0 or 1 - * IN unsigned b -- 0 or 1 + * IN unsigned a -- 0 or 1 + * IN unsigned b -- 0 or 1 * IN char ch1 - * IN unsigned g -- 0 or 1 - * IN unsigned d -- 0 or 1 + * IN unsigned g -- 0 or 1 + * IN unsigned d -- 0 or 1 * IN char ch2 - * IN unsigned e -- 0 or 1 - * IN unsigned o -- 0 or 1 + * IN unsigned e -- 0 or 1 + * IN unsigned o -- 0 or 1 *****************************************************************/ void init_bit_flags_combo (struct bit_flags_combo_t *bit_flags_combo, unsigned a, unsigned b, char ch1, unsigned g, unsigned d, char ch2, unsigned e, unsigned o) { @@ -364,8 +364,8 @@ void init_bit_flags_combo (struct bit_flags_combo_t *bit_flags_combo, unsigned a /***************************************************************** - * INIT_ONE_DOUBLE : - * OUT struct one_double_t *one_double -- structure to fill + * INIT_ONE_DOUBLE : + * OUT struct one_double_t *one_double -- structure to fill * IN double init_val *****************************************************************/ void init_one_double (struct one_double_t *one_double, double init_val) @@ -375,10 +375,10 @@ void init_one_double (struct one_double_t *one_double, double init_val) } /***************************************************************** - * INIT_TWO_FLOATS : + * INIT_TWO_FLOATS : * OUT struct two_floats_t *two_floats -- structure to be filled - * IN float init_val1 - * IN float init_val2 + * IN float init_val1 + * IN float init_val2 *****************************************************************/ void init_two_floats (struct two_floats_t *two_floats, float init_val1, float init_val2) { @@ -387,10 +387,10 @@ void init_two_floats (struct two_floats_t *two_floats, float init_val1, float in } /***************************************************************** - * INIT_TWO_CHARS : + * INIT_TWO_CHARS : * OUT struct two_char_t *two_char -- structure to be filled - * IN char init_val1 - * IN char init_val2 + * IN char init_val1 + * IN char init_val2 *****************************************************************/ void init_two_chars (struct two_char_t *two_char, char init_val1, char init_val2) { @@ -400,11 +400,11 @@ void init_two_chars (struct two_char_t *two_char, char init_val1, char init_val2 } /***************************************************************** - * INIT_THREE_CHARS : + * INIT_THREE_CHARS : * OUT struct three_char_t *three_char -- structure to be filled - * IN char init_val1 - * IN char init_val2 - * IN char init_val3 + * IN char init_val1 + * IN char init_val2 + * IN char init_val3 *****************************************************************/ void init_three_chars (struct three_char_t *three_char, char init_val1, char init_val2, char init_val3) { @@ -415,13 +415,13 @@ void init_three_chars (struct three_char_t *three_char, char init_val1, char ini } /***************************************************************** - * INIT_FIVE_CHARS : + * INIT_FIVE_CHARS : * OUT struct five_char_t *five_char -- structure to be filled - * IN char init_val1 - * IN char init_val2 - * IN char init_val3 - * IN char init_val4 - * IN char init_val5 + * IN char init_val1 + * IN char init_val2 + * IN char init_val3 + * IN char init_val4 + * IN char init_val5 *****************************************************************/ void init_five_chars (struct five_char_t *five_char, char init_val1, char init_val2, char init_val3, char init_val4, char init_val5) { @@ -433,10 +433,10 @@ void init_five_chars (struct five_char_t *five_char, char init_val1, char init_v } /***************************************************************** - * INIT_INT_CHAR_COMBO : + * INIT_INT_CHAR_COMBO : * OUT struct int_char_combo_t *combo -- structure to be filled - * IN int init_val1 - * IN char init_val2 + * IN int init_val1 + * IN char init_val2 *****************************************************************/ void init_int_char_combo (struct int_char_combo_t *combo, int init_val1, char init_val2) { @@ -446,19 +446,19 @@ void init_int_char_combo (struct int_char_combo_t *combo, int init_val1, char in } /***************************************************************** - * INIT_STRUCT_REP : + * INIT_STRUCT_REP : * OUT struct small_rep_into_t *small_struct -- structure to be filled - * IN int seed + * IN int seed *****************************************************************/ void init_struct_rep(struct small_rep_info_t *small_struct, int seed) { - small_struct->value = 2 + (seed*2); - small_struct->head = 0; + small_struct->value = 2 + (seed*2); + small_struct->head = 0; } /***************************************************************** - * INIT_SMALL_STRUCTS : + * INIT_SMALL_STRUCTS : * Takes all the small structures as input and calls the appropriate * initialization routine for each structure *****************************************************************/ @@ -480,11 +480,11 @@ void init_small_structs ( struct two_floats_t *f3) { - init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1, - (unsigned)0, (unsigned)1, (unsigned)0 ); + init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1, + (unsigned)0, (unsigned)1, (unsigned)0 ); init_bit_flags_combo(flags_combo, (unsigned)1, (unsigned)0, 'y', (unsigned)1, (unsigned)0, 'n', - (unsigned)1, (unsigned)0 ); + (unsigned)1, (unsigned)0 ); init_three_chars(three_char, 'a', 'b', 'c'); init_five_chars(five_char, 'l', 'm', 'n', 'o', 'p'); init_int_char_combo(int_char_combo, 123, 'z'); @@ -492,16 +492,16 @@ void init_small_structs ( init_struct_rep(struct2, 4); init_struct_rep(struct3, 5); init_struct_rep(struct4, 6); - init_one_double ( d1, 10.5); - init_one_double ( d2, -3.375); - init_one_double ( d3, 675.09375); - init_two_floats ( f1, 45.234, 43.6); - init_two_floats ( f2, 78.01, 122.10); - init_two_floats ( f3, -1232.345, -199.21); + init_one_double ( d1, 10.5); + init_one_double ( d2, -3.375); + init_one_double ( d3, 675.09375); + init_two_floats ( f1, 45.234, 43.6); + init_two_floats ( f2, 78.01, 122.10); + init_two_floats ( f3, -1232.345, -199.21); } /***************************************************************** - * PRINT_TEN_DOUBLES : + * PRINT_TEN_DOUBLES : * ????????????????????????????? ****************************************************************/ void print_ten_doubles ( @@ -525,8 +525,8 @@ void print_ten_doubles ( } /***************************************************************** - * PRINT_BIT_FLAGS : - * IN struct bit_flags_t bit_flags + * PRINT_BIT_FLAGS : + * IN struct bit_flags_t bit_flags ****************************************************************/ void print_bit_flags (struct bit_flags_t bit_flags) { @@ -540,8 +540,8 @@ void print_bit_flags (struct bit_flags_t bit_flags) } /***************************************************************** - * PRINT_BIT_FLAGS_COMBO : - * IN struct bit_flags_combo_t bit_flags_combo + * PRINT_BIT_FLAGS_COMBO : + * IN struct bit_flags_combo_t bit_flags_combo ****************************************************************/ void print_bit_flags_combo (struct bit_flags_combo_t bit_flags_combo) { @@ -556,8 +556,8 @@ void print_bit_flags_combo (struct bit_flags_combo_t bit_flags_combo) } /***************************************************************** - * PRINT_ONE_DOUBLE : - * IN struct one_double_t one_double + * PRINT_ONE_DOUBLE : + * IN struct one_double_t one_double ****************************************************************/ void print_one_double (struct one_double_t one_double) { @@ -567,8 +567,8 @@ void print_one_double (struct one_double_t one_double) } /***************************************************************** - * PRINT_TWO_FLOATS : - * IN struct two_floats_t two_floats + * PRINT_TWO_FLOATS : + * IN struct two_floats_t two_floats ****************************************************************/ void print_two_floats (struct two_floats_t two_floats) { @@ -578,7 +578,7 @@ void print_two_floats (struct two_floats_t two_floats) } /***************************************************************** - * PRINT_TWO_CHARS : + * PRINT_TWO_CHARS : * IN struct two_char_t two_char ****************************************************************/ void print_two_chars (struct two_char_t two_char) @@ -589,7 +589,7 @@ void print_two_chars (struct two_char_t two_char) } /***************************************************************** - * PRINT_THREE_CHARS : + * PRINT_THREE_CHARS : * IN struct three_char_t three_char ****************************************************************/ void print_three_chars (struct three_char_t three_char) @@ -600,20 +600,20 @@ void print_three_chars (struct three_char_t three_char) } /***************************************************************** - * PRINT_FIVE_CHARS : + * PRINT_FIVE_CHARS : * IN struct five_char_t five_char ****************************************************************/ void print_five_chars (struct five_char_t five_char) { printf("Contents of five_char_t: \n\n"); - printf("%c\t%c\t%c\t%c\t%c\n", five_char.ch1, five_char.ch2, - five_char.ch3, five_char.ch4, + printf("%c\t%c\t%c\t%c\t%c\n", five_char.ch1, five_char.ch2, + five_char.ch3, five_char.ch4, five_char.ch5); } /***************************************************************** - * PRINT_INT_CHAR_COMBO : + * PRINT_INT_CHAR_COMBO : * IN struct int_char_combo_t int_char_combo ****************************************************************/ void print_int_char_combo (struct int_char_combo_t int_char_combo) @@ -621,10 +621,10 @@ void print_int_char_combo (struct int_char_combo_t int_char_combo) printf("Contents of int_char_combo_t: \n\n"); printf("%d\t%c\n", int_char_combo.int1, int_char_combo.ch1); -} +} /***************************************************************** - * PRINT_STRUCT_REP : + * PRINT_STRUCT_REP : * The last parameter must go onto the stack rather than into a register. * This is a good function to call to test small structures. * IN struct small_rep_info_t struct1 @@ -639,16 +639,16 @@ void print_struct_rep( printf("Contents of struct1: \n\n"); - printf("%10d%10d\n", struct1.value, struct1.head); + printf("%10d%10d\n", struct1.value, struct1.head); printf("Contents of struct2: \n\n"); - printf("%10d%10d\n", struct2.value, struct2.head); + printf("%10d%10d\n", struct2.value, struct2.head); printf("Contents of struct3: \n\n"); - printf("%10d%10d\n", struct3.value, struct3.head); + printf("%10d%10d\n", struct3.value, struct3.head); } /***************************************************************** - * SUM_STRUCT_PRINT : + * SUM_STRUCT_PRINT : * The last two parameters must go onto the stack rather than into a register. * This is a good function to call to test small structures. * IN struct small_rep_info_t struct1 @@ -659,7 +659,7 @@ void print_struct_rep( void sum_struct_print ( int seed, struct small_rep_info_t struct1, - struct small_rep_info_t struct2, + struct small_rep_info_t struct2, struct small_rep_info_t struct3, struct small_rep_info_t struct4) { @@ -671,7 +671,7 @@ void sum_struct_print ( } /***************************************************************** - * PRINT_SMALL_STRUCTS : + * PRINT_SMALL_STRUCTS : * This is a good function to call to test small structures. * All of the small structures of odd sizes (40 bits, 8bits, etc.) * are pushed onto the stack. @@ -709,11 +709,11 @@ void print_small_structs ( } /***************************************************************** - * PRINT_LONG_ARG_LIST : + * PRINT_LONG_ARG_LIST : * This is a good function to call to test small structures. * The first two parameters ( the doubles ) go into registers. The * remaining arguments are pushed onto the stack. Depending on where - * print_long_arg_list is called from, the size of the argument list + * print_long_arg_list is called from, the size of the argument list * may force more space to be pushed onto the stack as part of the callers * frame. ****************************************************************/ @@ -747,7 +747,7 @@ void print_long_arg_list ( printf("int : %d\n", e); printf("int : %d\n", f); print_small_structs( struct1, struct2, struct3, struct4, flags, flags_combo, - three_char, five_char, int_char_combo, d1, d2, d3, + three_char, five_char, int_char_combo, d1, d2, d3, f1, f2, f3); } @@ -761,14 +761,14 @@ void print_one_large_struct (struct array_rep_info_t linked_list1) printf(" | \n");*/ /*for (index = 0; index < 10; index++) {*/ - printf("%10d%10d\n", linked_list1.values[0], - linked_list1.next_index[0]); + printf("%10d%10d\n", linked_list1.values[0], + linked_list1.next_index[0]); /*}*/ } /***************************************************************** - * PRINT_ARRAY_REP : - * The three structure parameters should fit into registers. + * PRINT_ARRAY_REP : + * The three structure parameters should fit into registers. * IN struct array_rep_info_t linked_list1 * IN struct array_rep_info_t linked_list2 * IN struct array_rep_info_t linked_list3 @@ -787,8 +787,8 @@ void print_array_rep( printf(" | \n"); for (index = 0; index < 10; index++) { - printf("%10d%10d\n", linked_list1.values[index], - linked_list1.next_index[index]); + printf("%10d%10d\n", linked_list1.values[index], + linked_list1.next_index[index]); } printf("Contents of linked list2: \n\n"); @@ -797,8 +797,8 @@ void print_array_rep( printf(" | \n"); for (index = 0; index < 10; index++) { - printf("%10d%10d\n", linked_list2.values[index], - linked_list2.next_index[index]); + printf("%10d%10d\n", linked_list2.values[index], + linked_list2.next_index[index]); } printf("Contents of linked list3: \n\n"); @@ -807,15 +807,15 @@ void print_array_rep( printf(" | \n"); for (index = 0; index < 10; index++) { - printf("%10d%10d\n", linked_list3.values[index], - linked_list3.next_index[index]); + printf("%10d%10d\n", linked_list3.values[index], + linked_list3.next_index[index]); } } /***************************************************************** - * SUM_ARRAY_PRINT : - * The last structure parameter must be pushed onto the stack + * SUM_ARRAY_PRINT : + * The last structure parameter must be pushed onto the stack * IN int seed * IN struct array_rep_info_t linked_list1 * IN struct array_rep_info_t linked_list2 @@ -847,7 +847,7 @@ void sum_array_print ( } /***************************************************************** - * INIT_ARRAY_REP : + * INIT_ARRAY_REP : * IN struct array_rep_info_t *linked_list * IN int seed ****************************************************************/ @@ -860,10 +860,10 @@ void init_array_rep( for (index = 0; index < 10; index++) { - linked_list->values[index] = (2*index) + (seed*2); + linked_list->values[index] = (2*index) + (seed*2); linked_list->next_index[index] = index + 1; } - linked_list->head = 0; + linked_list->head = 0; } @@ -874,11 +874,11 @@ int main () { static char char_array[121]; static double double_array[9]; static float float_array[15]; - static int integer_array[50]; + static int integer_array[50]; static int index; static id_int student_id = 23; static colors my_shirt = YELLOW; - + /* variables for large structure testing */ static int number = 10; @@ -941,18 +941,18 @@ int main () { print_char_array(char_array); print_double_array(double_array); /* -tbreak2- */ print_float_array(float_array); - print_student_id_shirt_color(student_id, my_shirt); + print_student_id_shirt_color(student_id, my_shirt); print_int_array(integer_array); print_all_arrays(integer_array, char_array, float_array, double_array); /* -tbreak3- */ - /* Allocate space for large structures + /* Allocate space for large structures */ list1 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t)); list2 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t)); list3 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t)); list4 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t)); - /* Initialize large structures + /* Initialize large structures */ init_array_rep(list1, 2); init_array_rep(list2, 4); @@ -962,13 +962,13 @@ int main () { printf("BYE BYE FOR NOW\n"); /* -tbreak4- */ printf("VERY GREEN GRASS\n"); /* -next2- */ - /* Print large structures + /* Print large structures */ sum_array_print(10, *list1, *list2, *list3, *list4); /* -tbreak5- */ print_array_rep(*list1, *list2, *list3); print_one_large_struct(*list1); - /* Allocate space for small structures + /* Allocate space for small structures */ struct1 = (struct small_rep_info_t *)malloc(sizeof(struct small_rep_info_t)); struct2 = (struct small_rep_info_t *)malloc(sizeof(struct small_rep_info_t)); @@ -988,19 +988,19 @@ int main () { f2 = (struct two_floats_t *)malloc(sizeof(struct two_floats_t)); f3 = (struct two_floats_t *)malloc(sizeof(struct two_floats_t)); - /* Initialize small structures + /* Initialize small structures */ - init_small_structs ( struct1, struct2, struct3, struct4, flags, + init_small_structs ( struct1, struct2, struct3, struct4, flags, flags_combo, three_char, five_char, int_char_combo, d1, d2, d3, f1, f2, f3); - /* Print small structures + /* Print small structures */ - print_small_structs ( *struct1, *struct2, *struct3, *struct4, *flags, + print_small_structs ( *struct1, *struct2, *struct3, *struct4, *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3); - /* Print a very long arg list + /* Print a very long arg list */ a = 22.25; b = 33.375; @@ -1013,19 +1013,19 @@ int main () { *flags, *flags_combo, *three_char, *five_char, *int_char_combo, *d1, *d2, *d3, *f1, *f2, *f3); - /* Initialize small structures + /* Initialize small structures */ - init_one_double ( d1, 1.11111); - init_one_double ( d2, -345.34); - init_one_double ( d3, 546464.2); - init_two_floats ( f1, 0.234, 453.1); - init_two_floats ( f2, 78.345, 23.09); - init_two_floats ( f3, -2.345, 1.0); - init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1, - (unsigned)0, (unsigned)1, (unsigned)0 ); + init_one_double ( d1, 1.11111); + init_one_double ( d2, -345.34); + init_one_double ( d3, 546464.2); + init_two_floats ( f1, 0.234, 453.1); + init_two_floats ( f2, 78.345, 23.09); + init_two_floats ( f3, -2.345, 1.0); + init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1, + (unsigned)0, (unsigned)1, (unsigned)0 ); init_bit_flags_combo(flags_combo, (unsigned)1, (unsigned)0, 'y', /* -tbreak8- */ (unsigned)1, (unsigned)0, 'n', - (unsigned)1, (unsigned)0 ); + (unsigned)1, (unsigned)0 ); init_three_chars(three_char, 'x', 'y', 'z'); init_five_chars(five_char, 'h', 'e', 'l', 'l', 'o'); init_int_char_combo(int_char_combo, 13, '!'); /* -tbreak9- */ @@ -1040,7 +1040,7 @@ int main () { printf("BYE BYE FOR NOW\n"); printf("VERY GREEN GRASS\n"); - /* Print small structures + /* Print small structures */ print_one_double(*d1); print_one_double(*d2); diff --git a/gdb/testsuite/gdb.base/call-rt-st.c b/gdb/testsuite/gdb.base/call-rt-st.c index e4bc297bb79..82bac3d5469 100644 --- a/gdb/testsuite/gdb.base/call-rt-st.c +++ b/gdb/testsuite/gdb.base/call-rt-st.c @@ -16,13 +16,13 @@ */ struct array_rep_info_t { - int next_index[10]; + int next_index[10]; int values[10]; int head; }; /***************************************************************************** - * Small structures ( <= 64 bits). These are used to test passing small + * Small structures ( <= 64 bits). These are used to test passing small * structures as parameters and test argument size promotion. *****************************************************************************/ @@ -120,8 +120,8 @@ struct int_char_combo_t { /***************************************************************** - * LOOP_COUNT : - * A do nothing function. Used to provide a point at which calls can be made. + * LOOP_COUNT : + * A do nothing function. Used to provide a point at which calls can be made. *****************************************************************/ void loop_count () { @@ -136,12 +136,12 @@ void loop_count () { * the call command behavior when integer arguments do not fit into * registers and must be placed on the stack. * OUT struct bit_flags_char_t *bit_flags -- structure to be filled - * IN unsigned a -- 0 or 1 - * IN unsigned b -- 0 or 1 - * IN unsigned g -- 0 or 1 - * IN unsigned d -- 0 or 1 - * IN unsigned e -- 0 or 1 - * IN unsigned o -- 0 or 1 + * IN unsigned a -- 0 or 1 + * IN unsigned b -- 0 or 1 + * IN unsigned g -- 0 or 1 + * IN unsigned d -- 0 or 1 + * IN unsigned e -- 0 or 1 + * IN unsigned o -- 0 or 1 *****************************************************************/ void init_bit_flags_char ( struct bit_flags_char_t *bit_flags, @@ -167,12 +167,12 @@ unsigned o) * the call command behavior when integer arguments do not fit into * registers and must be placed on the stack. * OUT struct bit_flags_short_t *bit_flags -- structure to be filled - * IN unsigned a -- 0 or 1 - * IN unsigned b -- 0 or 1 - * IN unsigned g -- 0 or 1 - * IN unsigned d -- 0 or 1 - * IN unsigned e -- 0 or 1 - * IN unsigned o -- 0 or 1 + * IN unsigned a -- 0 or 1 + * IN unsigned b -- 0 or 1 + * IN unsigned g -- 0 or 1 + * IN unsigned d -- 0 or 1 + * IN unsigned e -- 0 or 1 + * IN unsigned o -- 0 or 1 *****************************************************************/ void init_bit_flags_short ( struct bit_flags_short_t *bit_flags, @@ -198,12 +198,12 @@ unsigned o) * the call command behavior when integer arguments do not fit into * registers and must be placed on the stack. * OUT struct bit_flags_t *bit_flags -- structure to be filled - * IN unsigned a -- 0 or 1 - * IN unsigned b -- 0 or 1 - * IN unsigned g -- 0 or 1 - * IN unsigned d -- 0 or 1 - * IN unsigned e -- 0 or 1 - * IN unsigned o -- 0 or 1 + * IN unsigned a -- 0 or 1 + * IN unsigned b -- 0 or 1 + * IN unsigned g -- 0 or 1 + * IN unsigned d -- 0 or 1 + * IN unsigned e -- 0 or 1 + * IN unsigned o -- 0 or 1 *****************************************************************/ void init_bit_flags ( struct bit_flags_t *bit_flags, @@ -229,14 +229,14 @@ unsigned o) * to see the call command behavior when integer and character arguments * do not fit into registers and must be placed on the stack. * OUT struct bit_flags_combo_t *bit_flags_combo -- structure to fill - * IN unsigned a -- 0 or 1 - * IN unsigned b -- 0 or 1 + * IN unsigned a -- 0 or 1 + * IN unsigned b -- 0 or 1 * IN char ch1 - * IN unsigned g -- 0 or 1 - * IN unsigned d -- 0 or 1 + * IN unsigned g -- 0 or 1 + * IN unsigned d -- 0 or 1 * IN char ch2 - * IN unsigned e -- 0 or 1 - * IN unsigned o -- 0 or 1 + * IN unsigned e -- 0 or 1 + * IN unsigned o -- 0 or 1 *****************************************************************/ void init_bit_flags_combo ( struct bit_flags_combo_t *bit_flags_combo, @@ -262,8 +262,8 @@ unsigned o) /***************************************************************** - * INIT_ONE_DOUBLE : - * OUT struct one_double_t *one_double -- structure to fill + * INIT_ONE_DOUBLE : + * OUT struct one_double_t *one_double -- structure to fill * IN double init_val *****************************************************************/ void init_one_double ( struct one_double_t *one_double, double init_val) @@ -273,10 +273,10 @@ void init_one_double ( struct one_double_t *one_double, double init_val) } /***************************************************************** - * INIT_TWO_FLOATS : + * INIT_TWO_FLOATS : * OUT struct two_floats_t *two_floats -- structure to be filled - * IN float init_val1 - * IN float init_val2 + * IN float init_val1 + * IN float init_val2 *****************************************************************/ void init_two_floats ( struct two_floats_t *two_floats, @@ -289,11 +289,11 @@ void init_two_floats ( } /***************************************************************** - * INIT_THREE_CHARS : + * INIT_THREE_CHARS : * OUT struct three_char_t *three_char -- structure to be filled - * IN char init_val1 - * IN char init_val2 - * IN char init_val3 + * IN char init_val1 + * IN char init_val2 + * IN char init_val3 *****************************************************************/ void init_three_chars ( struct three_char_t *three_char, @@ -308,13 +308,13 @@ char init_val3) } /***************************************************************** - * INIT_FIVE_CHARS : + * INIT_FIVE_CHARS : * OUT struct five_char_t *five_char -- structure to be filled - * IN char init_val1 - * IN char init_val2 - * IN char init_val3 - * IN char init_val4 - * IN char init_val5 + * IN char init_val1 + * IN char init_val2 + * IN char init_val3 + * IN char init_val4 + * IN char init_val5 *****************************************************************/ void init_five_chars ( struct five_char_t *five_char, @@ -333,10 +333,10 @@ char init_val5) } /***************************************************************** - * INIT_INT_CHAR_COMBO : + * INIT_INT_CHAR_COMBO : * OUT struct int_char_combo_t *combo -- structure to be filled - * IN int init_val1 - * IN char init_val2 + * IN int init_val1 + * IN char init_val2 *****************************************************************/ void init_int_char_combo ( struct int_char_combo_t *combo, @@ -349,22 +349,22 @@ char init_val2) } /***************************************************************** - * INIT_STRUCT_REP : + * INIT_STRUCT_REP : * OUT struct small_rep_into_t *small_struct -- structure to be filled - * IN int seed + * IN int seed *****************************************************************/ void init_struct_rep( struct small_rep_info_t *small_struct, int seed) { - small_struct->value = 2 + (seed*2); - small_struct->head = 0; + small_struct->value = 2 + (seed*2); + small_struct->head = 0; } /***************************************************************** - * PRINT_BIT_FLAGS_CHAR : - * IN struct bit_flags_char_t bit_flags + * PRINT_BIT_FLAGS_CHAR : + * IN struct bit_flags_char_t bit_flags ****************************************************************/ struct bit_flags_char_t print_bit_flags_char (struct bit_flags_char_t bit_flags) { @@ -376,12 +376,12 @@ struct bit_flags_char_t print_bit_flags_char (struct bit_flags_char_t bit_flags) if (bit_flags.epsilon) printf("epsilon\n"); if (bit_flags.omega) printf("omega\n"); return bit_flags; - + } /***************************************************************** - * PRINT_BIT_FLAGS_SHORT : - * IN struct bit_flags_short_t bit_flags + * PRINT_BIT_FLAGS_SHORT : + * IN struct bit_flags_short_t bit_flags ****************************************************************/ struct bit_flags_short_t print_bit_flags_short (struct bit_flags_short_t bit_flags) { @@ -393,12 +393,12 @@ struct bit_flags_short_t print_bit_flags_short (struct bit_flags_short_t bit_fla if (bit_flags.epsilon) printf("epsilon\n"); if (bit_flags.omega) printf("omega\n"); return bit_flags; - + } /***************************************************************** - * PRINT_BIT_FLAGS : - * IN struct bit_flags_t bit_flags + * PRINT_BIT_FLAGS : + * IN struct bit_flags_t bit_flags ****************************************************************/ struct bit_flags_t print_bit_flags (struct bit_flags_t bit_flags) { @@ -410,12 +410,12 @@ struct bit_flags_t print_bit_flags (struct bit_flags_t bit_flags) if (bit_flags.epsilon) printf("epsilon\n"); if (bit_flags.omega) printf("omega\n"); return bit_flags; - + } /***************************************************************** - * PRINT_BIT_FLAGS_COMBO : - * IN struct bit_flags_combo_t bit_flags_combo + * PRINT_BIT_FLAGS_COMBO : + * IN struct bit_flags_combo_t bit_flags_combo ****************************************************************/ struct bit_flags_combo_t print_bit_flags_combo (struct bit_flags_combo_t bit_flags_combo) { @@ -428,12 +428,12 @@ struct bit_flags_combo_t print_bit_flags_combo (struct bit_flags_combo_t bit_fla if (bit_flags_combo.omega) printf("omega\n"); printf("ch1: %c\tch2: %c\n", bit_flags_combo.ch1, bit_flags_combo.ch2); return bit_flags_combo; - + } /***************************************************************** - * PRINT_ONE_DOUBLE : - * IN struct one_double_t one_double + * PRINT_ONE_DOUBLE : + * IN struct one_double_t one_double ****************************************************************/ struct one_double_t print_one_double (struct one_double_t one_double) { @@ -441,12 +441,12 @@ struct one_double_t print_one_double (struct one_double_t one_double) printf("Contents of one_double_t: \n\n"); printf("%f\n", one_double.double1); return one_double; - + } /***************************************************************** - * PRINT_TWO_FLOATS : - * IN struct two_floats_t two_floats + * PRINT_TWO_FLOATS : + * IN struct two_floats_t two_floats ****************************************************************/ struct two_floats_t print_two_floats (struct two_floats_t two_floats) { @@ -454,11 +454,11 @@ struct two_floats_t print_two_floats (struct two_floats_t two_floats) printf("Contents of two_floats_t: \n\n"); printf("%f\t%f\n", two_floats.float1, two_floats.float2); return two_floats; - + } /***************************************************************** - * PRINT_THREE_CHARS : + * PRINT_THREE_CHARS : * IN struct three_char_t three_char ****************************************************************/ struct three_char_t print_three_chars (struct three_char_t three_char) @@ -467,26 +467,26 @@ struct three_char_t print_three_chars (struct three_char_t three_char) printf("Contents of three_char_t: \n\n"); printf("%c\t%c\t%c\n", three_char.ch1, three_char.ch2, three_char.ch3); return three_char; - + } /***************************************************************** - * PRINT_FIVE_CHARS : + * PRINT_FIVE_CHARS : * IN struct five_char_t five_char ****************************************************************/ struct five_char_t print_five_chars (struct five_char_t five_char) { printf("Contents of five_char_t: \n\n"); - printf("%c\t%c\t%c\t%c\t%c\n", five_char.ch1, five_char.ch2, - five_char.ch3, five_char.ch4, + printf("%c\t%c\t%c\t%c\t%c\n", five_char.ch1, five_char.ch2, + five_char.ch3, five_char.ch4, five_char.ch5); return five_char; - + } /***************************************************************** - * PRINT_INT_CHAR_COMBO : + * PRINT_INT_CHAR_COMBO : * IN struct int_char_combo_t int_char_combo ****************************************************************/ struct int_char_combo_t print_int_char_combo (struct int_char_combo_t int_char_combo) @@ -495,21 +495,21 @@ struct int_char_combo_t print_int_char_combo (struct int_char_combo_t int_char_c printf("Contents of int_char_combo_t: \n\n"); printf("%d\t%c\n", int_char_combo.int1, int_char_combo.ch1); return int_char_combo; - -} + +} /***************************************************************** - * PRINT_STRUCT_REP : + * PRINT_STRUCT_REP : ****************************************************************/ struct small_rep_info_t print_struct_rep(struct small_rep_info_t struct1) { printf("Contents of struct1: \n\n"); - printf("%10d%10d\n", struct1.value, struct1.head); + printf("%10d%10d\n", struct1.value, struct1.head); struct1.value =+5; - + return struct1; - + } @@ -518,11 +518,11 @@ struct array_rep_info_t print_one_large_struct(struct array_rep_info_t linked_li { - printf("%10d%10d\n", linked_list1.values[0], - linked_list1.next_index[0]); - + printf("%10d%10d\n", linked_list1.values[0], + linked_list1.next_index[0]); + return linked_list1; - + } /***************************************************************** @@ -545,7 +545,7 @@ void init_array_rep(struct array_rep_info_t *linked_list, int seed) int main () { - + /* variables for large structure testing */ int number = 10; @@ -566,19 +566,19 @@ int main () { gdb_unbuffer_output (); - /* Allocate space for large structures + /* Allocate space for large structures */ list1 = (struct array_rep_info_t *)malloc(sizeof(struct array_rep_info_t)); - /* Initialize large structures + /* Initialize large structures */ init_array_rep(list1, 2); - /* Print large structures + /* Print large structures */ print_one_large_struct(*list1); - /* Allocate space for small structures + /* Allocate space for small structures */ struct1 = (struct small_rep_info_t *)malloc(sizeof(struct small_rep_info_t)); cflags = (struct bit_flags_char_t *)malloc(sizeof(struct bit_flags_char_t)); @@ -592,26 +592,26 @@ int main () { d1 = (struct one_double_t *)malloc(sizeof(struct one_double_t)); f3 = (struct two_floats_t *)malloc(sizeof(struct two_floats_t)); - /* Initialize small structures + /* Initialize small structures */ - init_one_double ( d1, 1.11111); - init_two_floats ( f3, -2.345, 1.0); - init_bit_flags_char(cflags, (unsigned)1, (unsigned)0, (unsigned)1, - (unsigned)0, (unsigned)1, (unsigned)0 ); - init_bit_flags_short(sflags, (unsigned)1, (unsigned)0, (unsigned)1, - (unsigned)0, (unsigned)1, (unsigned)0 ); - init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1, - (unsigned)0, (unsigned)1, (unsigned)0 ); + init_one_double ( d1, 1.11111); + init_two_floats ( f3, -2.345, 1.0); + init_bit_flags_char(cflags, (unsigned)1, (unsigned)0, (unsigned)1, + (unsigned)0, (unsigned)1, (unsigned)0 ); + init_bit_flags_short(sflags, (unsigned)1, (unsigned)0, (unsigned)1, + (unsigned)0, (unsigned)1, (unsigned)0 ); + init_bit_flags(flags, (unsigned)1, (unsigned)0, (unsigned)1, + (unsigned)0, (unsigned)1, (unsigned)0 ); init_bit_flags_combo(flags_combo, (unsigned)1, (unsigned)0, 'y', (unsigned)1, (unsigned)0, 'n', - (unsigned)1, (unsigned)0 ); + (unsigned)1, (unsigned)0 ); init_three_chars(three_char, 'x', 'y', 'z'); init_five_chars(five_char, 'h', 'e', 'l', 'l', 'o'); init_int_char_combo(int_char_combo, 13, '!'); init_struct_rep(struct1, 10); - - - /* Print small structures + + + /* Print small structures */ print_one_double(*d1); print_two_floats(*f3); diff --git a/gdb/testsuite/gdb.base/call-sc.c b/gdb/testsuite/gdb.base/call-sc.c index 652d346946a..81a25fc2263 100644 --- a/gdb/testsuite/gdb.base/call-sc.c +++ b/gdb/testsuite/gdb.base/call-sc.c @@ -39,7 +39,7 @@ T init = '9'; T fun() { - return foo; + return foo; } void Fun(T foo) @@ -69,7 +69,7 @@ int main() zed (); while (1) { - L = fun (); + L = fun (); zed (); } diff --git a/gdb/testsuite/gdb.base/call-strs.c b/gdb/testsuite/gdb.base/call-strs.c index c734936ecbc..3a82ddaa584 100644 --- a/gdb/testsuite/gdb.base/call-strs.c +++ b/gdb/testsuite/gdb.base/call-strs.c @@ -16,7 +16,7 @@ char * str_func1(char *s1) } char * str_func( -char * s1, +char * s1, char * s2, char * s3, char * s4, diff --git a/gdb/testsuite/gdb.base/callfuncs.c b/gdb/testsuite/gdb.base/callfuncs.c index 42ab16c60e0..f3cf79638a6 100644 --- a/gdb/testsuite/gdb.base/callfuncs.c +++ b/gdb/testsuite/gdb.base/callfuncs.c @@ -266,7 +266,7 @@ cmp10 (i0, i1, i2, i3, i4, i5, i6, i7, i8, i9) (i5 == 5) && (i6 == 6) && (i7 == 7) && (i8 == 8) && (i9 == 9); } -/* Functions that expect specific values to be passed and return +/* Functions that expect specific values to be passed and return either 0 or 1, depending upon whether the values were passed incorrectly or correctly, respectively. */ @@ -335,7 +335,7 @@ long long_arg1, long_arg2; There must be one version of "t_float_values" (this one) that is not prototyped, and one (if supported) that is (following). That way GDB can be tested against both cases. */ - + int t_float_values (float_arg1, float_arg2) float float_arg1, float_arg2; { diff --git a/gdb/testsuite/gdb.base/catch-syscall.c b/gdb/testsuite/gdb.base/catch-syscall.c index 070c0122e45..d554da9c5ac 100644 --- a/gdb/testsuite/gdb.base/catch-syscall.c +++ b/gdb/testsuite/gdb.base/catch-syscall.c @@ -1,5 +1,5 @@ /* This file is used to test the 'catch syscall' feature on GDB. - + Please, if you are going to edit this file DO NOT change the syscalls being called (nor the order of them). If you really must do this, then take a look at catch-syscall.exp and modify there too. diff --git a/gdb/testsuite/gdb.base/chng-syms.c b/gdb/testsuite/gdb.base/chng-syms.c index 3394f5c3897..8811de91493 100644 --- a/gdb/testsuite/gdb.base/chng-syms.c +++ b/gdb/testsuite/gdb.base/chng-syms.c @@ -1,6 +1,6 @@ /* - * Test that GDB cleans up properly after errors that result when a - * breakpoint is reset. + * Test that GDB cleans up properly after errors that result when a + * breakpoint is reset. */ /* VARIABLE is a macro defined on the compiler command line. */ diff --git a/gdb/testsuite/gdb.base/consecutive.c b/gdb/testsuite/gdb.base/consecutive.c index 869a88c911f..9bb215a21ef 100644 --- a/gdb/testsuite/gdb.base/consecutive.c +++ b/gdb/testsuite/gdb.base/consecutive.c @@ -1,4 +1,4 @@ -/* +/* Purpose of this test: to test breakpoints on consecutive instructions. */ diff --git a/gdb/testsuite/gdb.base/constvars.c b/gdb/testsuite/gdb.base/constvars.c index 60cca2a9fc1..853491331b0 100644 --- a/gdb/testsuite/gdb.base/constvars.c +++ b/gdb/testsuite/gdb.base/constvars.c @@ -104,7 +104,7 @@ main (void) volatile unsigned long valve = 2000; volatile float vacuity = 3.0; volatile double vertigo = 10.3; - + /* pointers to volatile variables */ volatile char * vampire = &vox; @@ -176,17 +176,17 @@ main (void) const char * const volatile cove = &laconic; const unsigned char * const volatile cavity = &laggard; - + /* const volatile pointers to volatile vars */ volatile char * const volatile vagus = &vox; volatile unsigned char * const volatile vagrancy = &victuals; - + /* const volatile pointers to const volatile */ const volatile char * const volatile vagary = &victor; const volatile unsigned char * const volatile vendor = &vicar; - + /* const volatile arrays */ const volatile char vindictive[2] = {victor, victor}; const volatile unsigned char vegetation[2] = {vicar, vicar}; @@ -206,7 +206,7 @@ main (void) volatile signed char & remuneration = lemonade; */ marker1 (); - + return 0; } diff --git a/gdb/testsuite/gdb.base/coremaker2.c b/gdb/testsuite/gdb.base/coremaker2.c index 8cc3eeb4695..ca5f26b4fbe 100644 --- a/gdb/testsuite/gdb.base/coremaker2.c +++ b/gdb/testsuite/gdb.base/coremaker2.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -/* This test has two large memory areas buf_rw and buf_ro. +/* This test has two large memory areas buf_rw and buf_ro. buf_rw is written to by the program while buf_ro is initialized at compile / load time. Thus, when a core file is created, buf_rw's diff --git a/gdb/testsuite/gdb.base/ctf-constvars.c b/gdb/testsuite/gdb.base/ctf-constvars.c index e484851183c..01a8976dbd4 100644 --- a/gdb/testsuite/gdb.base/ctf-constvars.c +++ b/gdb/testsuite/gdb.base/ctf-constvars.c @@ -93,12 +93,12 @@ unsigned char * const volatile veldt; const char * const volatile cove; const unsigned char * const volatile cavity; - + /* const volatile pointers to volatile vars */ volatile char * const volatile vagus; volatile unsigned char * const volatile vagrancy; - + /* const volatile pointers to const volatile */ const volatile char * const volatile vagary; diff --git a/gdb/testsuite/gdb.base/cvexpr.c b/gdb/testsuite/gdb.base/cvexpr.c index 76703ccc6b0..2bd592481fe 100644 --- a/gdb/testsuite/gdb.base/cvexpr.c +++ b/gdb/testsuite/gdb.base/cvexpr.c @@ -217,7 +217,7 @@ t_union3 v_union3; /**** Enumerations *******/ -enum +enum /* Work around the bug for compilers which don't put out the right stabs. */ #if __GNUC__ < 2 && !defined (_AIX) primary1_tag diff --git a/gdb/testsuite/gdb.base/display.c b/gdb/testsuite/gdb.base/display.c index 67f205af0cd..c711048ca41 100644 --- a/gdb/testsuite/gdb.base/display.c +++ b/gdb/testsuite/gdb.base/display.c @@ -22,7 +22,7 @@ int do_loops() sum++; f++; force_mem (&k); } } - } + } return i; /* set breakpoint 2 here */ } @@ -41,7 +41,7 @@ int do_vars() for( j = 0; j < LOOP; j++ ) { if( p_c[j] == c ) { /* set breakpoint 3 here */ j++; - } + } else { i++; } @@ -54,6 +54,6 @@ int main() { do_loops(); - do_vars(); + do_vars(); return 0; } diff --git a/gdb/testsuite/gdb.base/dtrace-probe.c b/gdb/testsuite/gdb.base/dtrace-probe.c index 29fafbcb36a..b6be97f21cf 100644 --- a/gdb/testsuite/gdb.base/dtrace-probe.c +++ b/gdb/testsuite/gdb.base/dtrace-probe.c @@ -23,7 +23,7 @@ main () char *name = "application"; TEST_TWO_LOCATIONS (); - + int i = 0; while (i < 10) { @@ -33,6 +33,6 @@ main () else TEST_TWO_LOCATIONS (); } - + return 0; /* last break here */ } diff --git a/gdb/testsuite/gdb.base/exprs.c b/gdb/testsuite/gdb.base/exprs.c index 195b88e9142..e1cd4f255d9 100644 --- a/gdb/testsuite/gdb.base/exprs.c +++ b/gdb/testsuite/gdb.base/exprs.c @@ -3,7 +3,7 @@ int main (int argc, char **argv, char **envp) extern void dummy(); dummy(); return 0; - + } /* We put main() right up front so its line number doesn't keep changing. */ @@ -190,16 +190,16 @@ void dummy() v_short = 3; v_signed_short = 4; - v_unsigned_short = 5; + v_unsigned_short = 5; v_int = 6; v_signed_int = 7; - v_unsigned_int = 8; + v_unsigned_int = 8; v_long = 9; v_signed_long = 10; - v_unsigned_long = 11; - + v_unsigned_long = 11; + v_float = 100.0; v_double = 200.0; v_char_array[0] = v_char; diff --git a/gdb/testsuite/gdb.base/fileio.c b/gdb/testsuite/gdb.base/fileio.c index 4ba5ab0d9ae..4557cc55f7d 100644 --- a/gdb/testsuite/gdb.base/fileio.c +++ b/gdb/testsuite/gdb.base/fileio.c @@ -14,7 +14,7 @@ 1) Attempt to create file that already exists - EEXIST 2) Attempt to open a directory for writing - EISDIR 3) Pathname does not exist - ENOENT -4) Open for write but no write permission - EACCES +4) Open for write but no write permission - EACCES read(int fd, void *buf, size_t count); 1) Read using invalid file descriptor - EBADF @@ -93,7 +93,7 @@ test_open (void) ret = open (OUTDIR FILENAME, O_CREAT | O_TRUNC | O_RDWR, S_IWUSR | S_IRUSR); printf ("open 1: ret = %d, errno = %d %s\n", ret, errno, ret >= 0 ? "OK" : ""); - + if (ret >= 0) close (ret); stop (); diff --git a/gdb/testsuite/gdb.base/funcargs.c b/gdb/testsuite/gdb.base/funcargs.c index d5ff19218c6..5198248454b 100644 --- a/gdb/testsuite/gdb.base/funcargs.c +++ b/gdb/testsuite/gdb.base/funcargs.c @@ -418,7 +418,7 @@ typedef struct s short s; int i; long l; -} SVAL; +} SVAL; void hitbottom () { @@ -576,7 +576,7 @@ int main () call6a (c, s, i, l, f, d, uc, us, ui, ul); call7a (c, i, s, l, f, uc, d, us, ul, ui); - + /* Test passing structures recursively. */ test_struct_args (); diff --git a/gdb/testsuite/gdb.base/gcore.c b/gdb/testsuite/gdb.base/gcore.c index bc95fa4e05a..1c924a1c341 100644 --- a/gdb/testsuite/gdb.base/gcore.c +++ b/gdb/testsuite/gdb.base/gcore.c @@ -27,7 +27,7 @@ static int static_array[4] = {5, 6, 7, 8}; static int un_initialized_array[4]; static char *heap_string; -void +void terminal_func () { return; diff --git a/gdb/testsuite/gdb.base/gdb1090.c b/gdb/testsuite/gdb.base/gdb1090.c index fe30e44e563..9daeffeca15 100644 --- a/gdb/testsuite/gdb.base/gdb1090.c +++ b/gdb/testsuite/gdb.base/gdb1090.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . - + This file was written by Michael Elizabeth Chastain (mec@shout.net). */ struct s_2_by_4 diff --git a/gdb/testsuite/gdb.base/gdb1250.c b/gdb/testsuite/gdb.base/gdb1250.c index f520ccac3fc..06959a02af2 100644 --- a/gdb/testsuite/gdb.base/gdb1250.c +++ b/gdb/testsuite/gdb.base/gdb1250.c @@ -16,7 +16,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . - + This file was written by Michael Elizabeth Chastain (mec@shout.net). */ #include diff --git a/gdb/testsuite/gdb.base/gnu-ifunc.c b/gdb/testsuite/gdb.base/gnu-ifunc.c index 9ecfc8f2966..2d7595f43f2 100644 --- a/gdb/testsuite/gdb.base/gnu-ifunc.c +++ b/gdb/testsuite/gdb.base/gnu-ifunc.c @@ -49,7 +49,7 @@ main (void) int i; gnu_ifunc_pre (); - + i = gnu_ifunc (1); /* break-at-call */ assert (i == 2); diff --git a/gdb/testsuite/gdb.base/info-os.c b/gdb/testsuite/gdb.base/info-os.c index 3614f3bf7b3..61dde6852df 100644 --- a/gdb/testsuite/gdb.base/info-os.c +++ b/gdb/testsuite/gdb.base/info-os.c @@ -117,14 +117,14 @@ main (void) /* Lock the mutex to prevent the new thread from finishing immediately. */ pthread_mutex_lock (&mutex); pthread_create (&thread, NULL, thread_proc, 0); - + sock = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP); if (sock < 0) { printf ("Cannot create socket.\n"); return 1; } - + sock_addr.sin_family = AF_INET; sock_addr.sin_port = 0; /* Bind to a free port. */ sock_addr.sin_addr.s_addr = htonl (INADDR_ANY); diff --git a/gdb/testsuite/gdb.base/int-type.c b/gdb/testsuite/gdb.base/int-type.c index da7eec00828..8331d9656f7 100644 --- a/gdb/testsuite/gdb.base/int-type.c +++ b/gdb/testsuite/gdb.base/int-type.c @@ -8,13 +8,13 @@ int w; int main () { - + x = 14; y = 3; z = 2; w = 2; return 0; - + } diff --git a/gdb/testsuite/gdb.base/label.c b/gdb/testsuite/gdb.base/label.c index c15e3bf6c84..c8921981b2e 100644 --- a/gdb/testsuite/gdb.base/label.c +++ b/gdb/testsuite/gdb.base/label.c @@ -9,7 +9,7 @@ main (int argc, char **argv) here: printf("not here\n"); i = 1; - + there: printf("but here\n"); if (i == 0) diff --git a/gdb/testsuite/gdb.base/long_long.c b/gdb/testsuite/gdb.base/long_long.c index 2775e9677ed..762e02b26c2 100644 --- a/gdb/testsuite/gdb.base/long_long.c +++ b/gdb/testsuite/gdb.base/long_long.c @@ -63,7 +63,7 @@ int known_types() /* A union is used here as, hopefully it has well defined packing rules. */ struct { - long long bin, oct, dec, hex; + long long bin, oct, dec, hex; } val; memset (&val, 0, sizeof val); @@ -94,6 +94,6 @@ int main() { pack (ll, sizeof (long long), 2); known_types(); - + return 0; } diff --git a/gdb/testsuite/gdb.base/miscexprs.c b/gdb/testsuite/gdb.base/miscexprs.c index a9930c1da87..62528dd5633 100644 --- a/gdb/testsuite/gdb.base/miscexprs.c +++ b/gdb/testsuite/gdb.base/miscexprs.c @@ -1,7 +1,7 @@ void marker1 () { - + } int @@ -38,7 +38,7 @@ main () dbig.d[202] = 9.99999999; sbig.s[90] = 255; lbig.l[333] = 999999999; - + marker1 (); return 0; } diff --git a/gdb/testsuite/gdb.base/nextoverexit.c b/gdb/testsuite/gdb.base/nextoverexit.c index 7eaafe4f79e..7f1daf49f72 100644 --- a/gdb/testsuite/gdb.base/nextoverexit.c +++ b/gdb/testsuite/gdb.base/nextoverexit.c @@ -13,7 +13,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -#include +#include int main (void) diff --git a/gdb/testsuite/gdb.base/ovlymgr.c b/gdb/testsuite/gdb.base/ovlymgr.c index 262c2a61f02..8867a806b2d 100644 --- a/gdb/testsuite/gdb.base/ovlymgr.c +++ b/gdb/testsuite/gdb.base/ovlymgr.c @@ -22,7 +22,7 @@ static void ovly_copy (unsigned long dst, unsigned long src, long size); since libgloss is the one intended to handle low level system issues. I would suggest something like _flush_cache to avoid the user's namespace but not be completely obscure as other things may need this facility. */ - + static void FlushCache (void) { @@ -33,7 +33,7 @@ FlushCache (void) } /* _ovly_debug_event: - * Debuggers may set a breakpoint here, to be notified + * Debuggers may set a breakpoint here, to be notified * when the overlay table has been modified. */ static void @@ -63,8 +63,8 @@ OverlayLoad (unsigned long ovlyno) else if (_ovly_table[i][VMA] == _ovly_table[ovlyno][VMA]) _ovly_table[i][MAPPED] = 0; /* this one now un-mapped */ - ovly_copy (_ovly_table[ovlyno][VMA], - _ovly_table[ovlyno][LMA], + ovly_copy (_ovly_table[ovlyno][VMA], + _ovly_table[ovlyno][LMA], _ovly_table[ovlyno][SIZE]); FlushCache (); @@ -77,17 +77,17 @@ OverlayLoad (unsigned long ovlyno) * Does NOT mark overlay as "unmapped", therefore may be called * more than once for the same mapped overlay. */ - + bool OverlayUnload (unsigned long ovlyno) { if (ovlyno < 0 || ovlyno >= _novlys) exit (-1); /* fail, bad ovly number */ - + if (!_ovly_table[ovlyno][MAPPED]) exit (-1); /* error, can't copy out a segment that's not "in" */ - - ovly_copy (_ovly_table[ovlyno][LMA], + + ovly_copy (_ovly_table[ovlyno][LMA], _ovly_table[ovlyno][VMA], _ovly_table[ovlyno][SIZE]); diff --git a/gdb/testsuite/gdb.base/pointers.c b/gdb/testsuite/gdb.base/pointers.c index 96f2b52f5e8..cd4e72214c2 100644 --- a/gdb/testsuite/gdb.base/pointers.c +++ b/gdb/testsuite/gdb.base/pointers.c @@ -90,7 +90,7 @@ int main () { void dummy(); int more_code(); - + dummy(); more_code (); @@ -100,29 +100,29 @@ int main () usevar (&y); return 0; - + } void dummy() { - - + + v_char = 0; v_signed_char = 1; v_unsigned_char = 2; v_short = 3; v_signed_short = 4; - v_unsigned_short = 5; + v_unsigned_short = 5; v_int = 6; v_signed_int = 7; - v_unsigned_int = 8; + v_unsigned_int = 8; v_long = 9; v_signed_long = 10; - v_unsigned_long = 11; - + v_unsigned_long = 11; + v_float = 100.0; v_double = 200.0; @@ -148,8 +148,8 @@ void dummy() v_double_pointer = &v_double; ptr_to_ptr_to_float = &v_float_pointer; - - + + v_char_array[0] = v_char; v_signed_char_array[0] = v_signed_char; v_unsigned_char_array[0] = v_unsigned_char; @@ -160,7 +160,7 @@ void dummy() v_int_array[0] = v_int; v_int_array[1] = v_int * 3; - + v_signed_int_array[0] = v_signed_int; v_unsigned_int_array[0] = v_unsigned_int; @@ -215,7 +215,7 @@ int more_code() pUL = &UL; pF = &F; pD = &D; - + marker1(); return 0; } diff --git a/gdb/testsuite/gdb.base/ptype.c b/gdb/testsuite/gdb.base/ptype.c index 6d12c2add42..92bd624d5b2 100644 --- a/gdb/testsuite/gdb.base/ptype.c +++ b/gdb/testsuite/gdb.base/ptype.c @@ -210,7 +210,7 @@ struct highest /**** Enumerations *******/ -enum +enum /* Work around the bug for compilers which don't put out the right stabs. */ #if __GNUC__ < 2 && !defined (_AIX) primary1_tag diff --git a/gdb/testsuite/gdb.base/recurse.c b/gdb/testsuite/gdb.base/recurse.c index 821c2de6de7..cd9331043f2 100644 --- a/gdb/testsuite/gdb.base/recurse.c +++ b/gdb/testsuite/gdb.base/recurse.c @@ -1,4 +1,4 @@ -/* Trivial code used to test watchpoints in recursive code and +/* Trivial code used to test watchpoints in recursive code and auto-deletion of watchpoints as they go out of scope. */ static int diff --git a/gdb/testsuite/gdb.base/remote.c b/gdb/testsuite/gdb.base/remote.c index a43c40bc9d8..66f00db9164 100644 --- a/gdb/testsuite/gdb.base/remote.c +++ b/gdb/testsuite/gdb.base/remote.c @@ -1,14 +1,14 @@ #include #include -/************************************************************************** +/************************************************************************** * TESTS : * -- downloading of a rather large executable - ***************************************************************************/ + ***************************************************************************/ /* A large array in .data. If RLE compression becomes available during - downloads, this would have to become a bunch of real random data. + downloads, this would have to become a bunch of real random data. Here's a quick way of generating such a bunch: awk < /dev/null ' @@ -6187,7 +6187,7 @@ unsigned char random_data[RANDOM_DATA_SIZE] = { }; int -main() +main() { long size = sizeof (random_data) / sizeof (random_data[0]); printf ("%d\n", random_data [size - 1]); diff --git a/gdb/testsuite/gdb.base/restore.c b/gdb/testsuite/gdb.base/restore.c index a8f8fd39391..f02bb2343b5 100644 --- a/gdb/testsuite/gdb.base/restore.c +++ b/gdb/testsuite/gdb.base/restore.c @@ -25,7 +25,7 @@ in this file. If people modify the functions manually, instead of changing this expression and re-running it, then evaluating this expression could wipe out their work, so you probably shouldn't - re-run it. But I leave it here for reference. + re-run it. But I leave it here for reference. (defun callee (n) (format "callee%d" n)) (defun caller (n) (format "caller%d" n)) @@ -42,7 +42,7 @@ (while (<= j n) (insert " register int " (local j) " = increment (" previous ");") - (if first-end + (if first-end (progn (insert " /" "* " first-end " prologue *" "/") (setq first-end nil))) @@ -86,7 +86,7 @@ (insert " register int n;\n") (let ((j 0)) (while (<= j limit) - (insert " n = " (callee j) " (" + (insert " n = " (callee j) " (" (if (> j 0) "n + " "") last ");\n") (setq j (1+ j))))) diff --git a/gdb/testsuite/gdb.base/return2.c b/gdb/testsuite/gdb.base/return2.c index 58d85eca113..bdbe96a1470 100644 --- a/gdb/testsuite/gdb.base/return2.c +++ b/gdb/testsuite/gdb.base/return2.c @@ -73,7 +73,7 @@ int main (int argc, char **argv) double double_resultval; int i; - /* A "test load" that will insure that the function really returns + /* A "test load" that will insure that the function really returns a ${type} (as opposed to just a truncated or part of a ${type}). */ for (i = 0; i < sizeof (testval.ffff); i++) testval.ffff[i] = 0xff; @@ -102,9 +102,9 @@ int main (int argc, char **argv) throughout the value, so we'll still detect truncated values. */ testval.float_testval = 2.7182818284590452354;/* long_long_checkpoint */ - float_resultval = float_func (); + float_resultval = float_func (); testval.double_testval = 3.14159265358979323846; /* float_checkpoint */ - double_resultval = double_func (); + double_resultval = double_func (); main_test = 1; /* double_checkpoint */ return 0; } diff --git a/gdb/testsuite/gdb.base/run.c b/gdb/testsuite/gdb.base/run.c index d0e631a8457..b297821ca86 100644 --- a/gdb/testsuite/gdb.base/run.c +++ b/gdb/testsuite/gdb.base/run.c @@ -17,7 +17,7 @@ main (int argc, char **argv, char **envp) #ifdef FAKEARGV printf ("%d\n", factorial (1)); /* commands.exp: hw local_var out of scope */ -#else +#else if (argc != 2) { printf ("usage: factorial \n"); return 1; diff --git a/gdb/testsuite/gdb.base/scope1.c b/gdb/testsuite/gdb.base/scope1.c index e4a7ed20945..54019d12e2a 100644 --- a/gdb/testsuite/gdb.base/scope1.c +++ b/gdb/testsuite/gdb.base/scope1.c @@ -9,7 +9,7 @@ void foo () { void bar (); - + static int funclocal = 3; /* In Data section */ static int funclocal_bss; /* In BSS section */ static const int funclocal_ro = 203; /* RO Data */ @@ -37,7 +37,7 @@ void init1 () void usestatics1 () { void useit1 (const int *val); - + useit1 (&filelocal); useit1 (&filelocal_bss); useit1 (&filelocal_ro); diff --git a/gdb/testsuite/gdb.base/setvar.c b/gdb/testsuite/gdb.base/setvar.c index 415eb6f2aaa..eccb69b694e 100644 --- a/gdb/testsuite/gdb.base/setvar.c +++ b/gdb/testsuite/gdb.base/setvar.c @@ -207,16 +207,16 @@ dummy () v_short = 3; v_signed_short = 4; - v_unsigned_short = 5; + v_unsigned_short = 5; v_int = 6; v_signed_int = 7; - v_unsigned_int = 8; + v_unsigned_int = 8; v_long = 9; v_signed_long = 10; - v_unsigned_long = 11; - + v_unsigned_long = 11; + v_float = 100.0; v_double = 200.0; diff --git a/gdb/testsuite/gdb.base/shmain.c b/gdb/testsuite/gdb.base/shmain.c index 853352e8c45..f9da71f4204 100644 --- a/gdb/testsuite/gdb.base/shmain.c +++ b/gdb/testsuite/gdb.base/shmain.c @@ -14,7 +14,7 @@ extern float sg; int eglob; struct { - int a; + int a; int b; } s; diff --git a/gdb/testsuite/gdb.base/sigall.c b/gdb/testsuite/gdb.base/sigall.c index 81f3b08d6bc..05fdc1d146f 100644 --- a/gdb/testsuite/gdb.base/sigall.c +++ b/gdb/testsuite/gdb.base/sigall.c @@ -380,7 +380,7 @@ gen_ABRT () { kill (getpid (), SIGABRT); return 0; -} +} int x; @@ -429,7 +429,7 @@ gen_HUP () handle_HUP (0); #endif return 0; -} +} int gen_QUIT () @@ -660,7 +660,7 @@ gen_USR2 () handle_USR2 (0); #endif return 0; -} +} int gen_PWR () diff --git a/gdb/testsuite/gdb.base/solib-weak.c b/gdb/testsuite/gdb.base/solib-weak.c index 0a693ba9f7d..413787a6ccf 100644 --- a/gdb/testsuite/gdb.base/solib-weak.c +++ b/gdb/testsuite/gdb.base/solib-weak.c @@ -22,4 +22,4 @@ main() { foo (); return 0; -} +} diff --git a/gdb/testsuite/gdb.base/step-test.c b/gdb/testsuite/gdb.base/step-test.c index a1e1dc408cf..c10fb8246c6 100644 --- a/gdb/testsuite/gdb.base/step-test.c +++ b/gdb/testsuite/gdb.base/step-test.c @@ -43,7 +43,7 @@ int main () { /* Test "stepi" */ a[5] = a[3] - a[4]; callee(); /* STEPI */ - + /* Test "nexti" */ callee(); /* NEXTI */ diff --git a/gdb/testsuite/gdb.base/store.c b/gdb/testsuite/gdb.base/store.c index 545515dfc10..82d84f3b617 100644 --- a/gdb/testsuite/gdb.base/store.c +++ b/gdb/testsuite/gdb.base/store.c @@ -279,13 +279,13 @@ main () wack_struct_2 (); wack_struct_3 (); wack_struct_4 (); - + /* These calls are for up frame. */ wack_struct_1 (); wack_struct_2 (); wack_struct_3 (); wack_struct_4 (); - + wack_field_1 (); wack_field_2 (); wack_field_3 (); diff --git a/gdb/testsuite/gdb.base/structs.c b/gdb/testsuite/gdb.base/structs.c index 34ade49711b..c1cc4ef19e6 100644 --- a/gdb/testsuite/gdb.base/structs.c +++ b/gdb/testsuite/gdb.base/structs.c @@ -122,7 +122,7 @@ struct struct18 foo18 = {'a','2','c','4','e','6','g','8','i','A','k','C','m','E' struct struct1 fun1() { - return foo1; + return foo1; } struct struct2 fun2() { @@ -158,39 +158,39 @@ struct struct9 fun9() } struct struct10 fun10() { - return foo10; + return foo10; } struct struct11 fun11() { - return foo11; + return foo11; } struct struct12 fun12() { - return foo12; + return foo12; } struct struct13 fun13() { - return foo13; + return foo13; } struct struct14 fun14() { - return foo14; + return foo14; } struct struct15 fun15() { - return foo15; + return foo15; } struct struct16 fun16() { - return foo16; + return foo16; } struct struct17 fun17() { - return foo17; + return foo17; } struct struct18 fun18() { - return foo18; + return foo18; } void Fun1(struct struct1 foo1) @@ -231,39 +231,39 @@ void Fun9(struct struct9 foo9) } void Fun10(struct struct10 foo10) { - L10 = foo10; + L10 = foo10; } void Fun11(struct struct11 foo11) { - L11 = foo11; + L11 = foo11; } void Fun12(struct struct12 foo12) { - L12 = foo12; + L12 = foo12; } void Fun13(struct struct13 foo13) { - L13 = foo13; + L13 = foo13; } void Fun14(struct struct14 foo14) { - L14 = foo14; + L14 = foo14; } void Fun15(struct struct15 foo15) { - L15 = foo15; + L15 = foo15; } void Fun16(struct struct16 foo16) { - L16 = foo16; + L16 = foo16; } void Fun17(struct struct17 foo17) { - L17 = foo17; + L17 = foo17; } void Fun18(struct struct18 foo18) { - L18 = foo18; + L18 = foo18; } void @@ -317,15 +317,15 @@ int main() chartest[i].c = i; chartest[0].c = 0; /* chartest-done */ - Fun1(foo1); - Fun2(foo2); - Fun3(foo3); - Fun4(foo4); - Fun5(foo5); - Fun6(foo6); - Fun7(foo7); - Fun8(foo8); - Fun9(foo9); + Fun1(foo1); + Fun2(foo2); + Fun3(foo3); + Fun4(foo4); + Fun5(foo5); + Fun6(foo6); + Fun7(foo7); + Fun8(foo8); + Fun9(foo9); Fun10(foo10); Fun11(foo11); Fun12(foo12); @@ -346,15 +346,15 @@ int main() for (i = 0; i < 1000000; ++i) { zed (); - L1 = fun1(); - L2 = fun2(); - L3 = fun3(); - L4 = fun4(); - L5 = fun5(); - L6 = fun6(); - L7 = fun7(); - L8 = fun8(); - L9 = fun9(); + L1 = fun1(); + L2 = fun2(); + L3 = fun3(); + L4 = fun4(); + L5 = fun5(); + L6 = fun6(); + L7 = fun7(); + L8 = fun8(); + L9 = fun9(); L10 = fun10(); L11 = fun11(); L12 = fun12(); diff --git a/gdb/testsuite/gdb.base/type-opaque-lib.c b/gdb/testsuite/gdb.base/type-opaque-lib.c index a3c363d39c5..56c19776eca 100644 --- a/gdb/testsuite/gdb.base/type-opaque-lib.c +++ b/gdb/testsuite/gdb.base/type-opaque-lib.c @@ -18,37 +18,37 @@ along with this program. If not, see . */ struct struct_libtype_opaque -{ +{ int libfield_opaque; }; struct struct_libtype_opaque struct_libtype_opaque_use; struct struct_libtype_empty -{ +{ int libfield_empty; }; struct struct_libtype_empty struct_libtype_empty_use; struct struct_libtype_filled -{ +{ int libfield_filled; }; struct struct_libtype_filled struct_libtype_filled_use; union union_libtype_opaque -{ +{ int libfield_opaque; }; union union_libtype_opaque union_libtype_opaque_use; union union_libtype_empty -{ +{ int libfield_empty; }; union union_libtype_empty union_libtype_empty_use; union union_libtype_filled -{ +{ int libfield_filled; }; union union_libtype_filled union_libtype_filled_use; diff --git a/gdb/testsuite/gdb.base/type-opaque-main.c b/gdb/testsuite/gdb.base/type-opaque-main.c index 375ed70bd36..8696966a267 100644 --- a/gdb/testsuite/gdb.base/type-opaque-main.c +++ b/gdb/testsuite/gdb.base/type-opaque-main.c @@ -21,23 +21,23 @@ struct struct_libtype_opaque; struct struct_libtype_empty { - }; + }; struct struct_libtype_filled { long mainfield_filled; - }; + }; union union_libtype_opaque; union union_libtype_empty { - }; + }; union union_libtype_filled { long mainfield_filled; - }; + }; int main (void) { diff --git a/gdb/testsuite/gdb.base/unload.c b/gdb/testsuite/gdb.base/unload.c index 28b744ddf2e..7c6edfbe3d9 100644 --- a/gdb/testsuite/gdb.base/unload.c +++ b/gdb/testsuite/gdb.base/unload.c @@ -41,7 +41,7 @@ int main() const char *msg; handle = dlopen (SHLIB_NAME, RTLD_LAZY); - + if (!handle) { fprintf (stderr, "%s\n", dlerror ()); @@ -68,7 +68,7 @@ int main() /* The second library should share the same memory address. */ handle = dlopen (SHLIB_NAME2, RTLD_LAZY); - + if (!handle) { fprintf (stderr, "%s\n", dlerror ()); diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64-2.s b/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64-2.s index c141f71817c..582bb75ce48 100644 --- a/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64-2.s +++ b/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64-2.s @@ -20,7 +20,7 @@ foo: nop popq %rbp .cfi_def_cfa 7, 8 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE0: @@ -45,7 +45,7 @@ bar: nop leave .cfi_def_cfa 7, 8 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE1: diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.s b/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.s index 0def4f61457..d4d67f979d6 100644 --- a/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.s +++ b/gdb/testsuite/gdb.base/unwind-on-each-insn-amd64.s @@ -22,7 +22,7 @@ foo: nop popq %rbp #.cfi_def_cfa 7, 8 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE0: @@ -53,7 +53,7 @@ bar: nop leave #.cfi_def_cfa 7, 8 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE1: diff --git a/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.s b/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.s index d0f96bef252..17143265075 100644 --- a/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.s +++ b/gdb/testsuite/gdb.base/unwind-on-each-insn-i386.s @@ -22,7 +22,7 @@ foo: popl %ebp .cfi_restore 5 # .cfi_def_cfa 4, 4 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE0: @@ -52,7 +52,7 @@ bar: leave .cfi_restore 5 # .cfi_def_cfa 4, 4 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE1: diff --git a/gdb/testsuite/gdb.base/varargs.c b/gdb/testsuite/gdb.base/varargs.c index e0083c7d8bd..8613b056ee0 100644 --- a/gdb/testsuite/gdb.base/varargs.c +++ b/gdb/testsuite/gdb.base/varargs.c @@ -1,4 +1,4 @@ -/* varargs.c - +/* varargs.c - * (Added as part of fix for bug 15306 - "call" to varargs functions fails) * This program is intended to let me try out "call" to varargs functions * with varying numbers of declared args and various argument types. @@ -80,7 +80,7 @@ test (void) dd = 2.0; dmax_val = find_max_double(3, 1.0, 4.0, 2.0); dmax_val = find_max_double(a, db, dc, dd); - + return 0; } diff --git a/gdb/testsuite/gdb.base/watchpoint-solib.c b/gdb/testsuite/gdb.base/watchpoint-solib.c index 25114ed876a..6dda8fed0bc 100644 --- a/gdb/testsuite/gdb.base/watchpoint-solib.c +++ b/gdb/testsuite/gdb.base/watchpoint-solib.c @@ -38,7 +38,7 @@ void open_shlib () void (*foo) (int); handle = dlopen (SHLIB_NAME, RTLD_LAZY); - + if (!handle) { #ifdef __WIN32__ diff --git a/gdb/testsuite/gdb.base/watchpoints.c b/gdb/testsuite/gdb.base/watchpoints.c index d2232e13814..44bd4214373 100644 --- a/gdb/testsuite/gdb.base/watchpoints.c +++ b/gdb/testsuite/gdb.base/watchpoints.c @@ -27,7 +27,7 @@ int ival2 = -1; int ival3 = -1; int ival4 = -1; -int +int main () { for (count = 0; count < 4; count++) { diff --git a/gdb/testsuite/gdb.base/weaklib1.c b/gdb/testsuite/gdb.base/weaklib1.c index b5f949172dc..75f0742bfcb 100644 --- a/gdb/testsuite/gdb.base/weaklib1.c +++ b/gdb/testsuite/gdb.base/weaklib1.c @@ -21,4 +21,4 @@ void __attribute__((weak)) bar (void) { puts ("bar in u1"); -} +} diff --git a/gdb/testsuite/gdb.base/weaklib2.c b/gdb/testsuite/gdb.base/weaklib2.c index 2987454ceb1..c901848941d 100644 --- a/gdb/testsuite/gdb.base/weaklib2.c +++ b/gdb/testsuite/gdb.base/weaklib2.c @@ -20,12 +20,12 @@ void bar (void); void foo (void) -{ +{ bar (); -} +} void bar (void) -{ +{ puts ("bar in u2"); -} +} diff --git a/gdb/testsuite/gdb.base/whatis.c b/gdb/testsuite/gdb.base/whatis.c index 9c115ae37d7..c722cf29616 100644 --- a/gdb/testsuite/gdb.base/whatis.c +++ b/gdb/testsuite/gdb.base/whatis.c @@ -254,15 +254,15 @@ int main () v_short = 3; v_signed_short = 4; - v_unsigned_short = 5; + v_unsigned_short = 5; v_int = 6; v_signed_int = 7; - v_unsigned_int = 8; + v_unsigned_int = 8; v_long = 9; v_signed_long = 10; - v_unsigned_long = 11; + v_unsigned_long = 11; #ifndef NO_LONG_LONG v_long_long = 12; diff --git a/gdb/testsuite/gdb.cp/ambiguous.cc b/gdb/testsuite/gdb.cp/ambiguous.cc index af2198dcfbc..d73752b0ed5 100644 --- a/gdb/testsuite/gdb.cp/ambiguous.cc +++ b/gdb/testsuite/gdb.cp/ambiguous.cc @@ -109,7 +109,7 @@ int main() JVA2 jva2; JVA1V jva1v; JE je; - + int i; i += k.i + m.w + a1.x + a2.x + a3.x + x.z + l.z + n.r + j.j; diff --git a/gdb/testsuite/gdb.cp/breakpoint.cc b/gdb/testsuite/gdb.cp/breakpoint.cc index 1a64512ca58..c42129bb6f8 100644 --- a/gdb/testsuite/gdb.cp/breakpoint.cc +++ b/gdb/testsuite/gdb.cp/breakpoint.cc @@ -1,5 +1,5 @@ /* Code to go along with tests in breakpoint.exp. - + Copyright 2004-2025 Free Software Foundation, Inc. This file is part of GDB. @@ -55,7 +55,7 @@ int main () C1::Nested c1; c1.foo (); - + C1 c2 (2), c3 (3); c2.foo (); c2.bar (); diff --git a/gdb/testsuite/gdb.cp/classes.cc b/gdb/testsuite/gdb.cp/classes.cc index d41ddcea5ce..8402c4cc43b 100644 --- a/gdb/testsuite/gdb.cp/classes.cc +++ b/gdb/testsuite/gdb.cp/classes.cc @@ -283,7 +283,7 @@ void inheritance1 (void) g_anon_union.one = 1; g_anon_union.a = 2; - inheritance2 (); + inheritance2 (); } // ======================== static member functions ===================== @@ -389,7 +389,7 @@ void inheritance3 (void) g_vE.vE::ve = 27; g_vE.vE::vx = 28; - inheritance4 (); + inheritance4 (); } // ====================================================================== diff --git a/gdb/testsuite/gdb.cp/converts.cc b/gdb/testsuite/gdb.cp/converts.cc index 1224581a879..e457764c60c 100644 --- a/gdb/testsuite/gdb.cp/converts.cc +++ b/gdb/testsuite/gdb.cp/converts.cc @@ -88,10 +88,10 @@ int main() compile it: warning: the address of 'int foo1_7(bool)' will always evaluate as true - + foo1_7 (&foo1_7); // pointer to boolean */ - + foo1_7 (&A::member_); // pointer to member to boolean foo1_7 (a); // pointer to boolean foo1_7 (fp); // float to boolean diff --git a/gdb/testsuite/gdb.cp/cpcompletion.cc b/gdb/testsuite/gdb.cp/cpcompletion.cc index b854d810b11..b85f168928c 100644 --- a/gdb/testsuite/gdb.cp/cpcompletion.cc +++ b/gdb/testsuite/gdb.cp/cpcompletion.cc @@ -24,7 +24,7 @@ public: bool operator== (const Foo &other) { return foo_value == other.foo_value; } }; - + void Foo::set_foo (int value) { foo_value = value; diff --git a/gdb/testsuite/gdb.cp/cpexprs.cc b/gdb/testsuite/gdb.cp/cpexprs.cc index 7d315030a2d..f0a618558f5 100644 --- a/gdb/testsuite/gdb.cp/cpexprs.cc +++ b/gdb/testsuite/gdb.cp/cpexprs.cc @@ -175,7 +175,7 @@ public: int operator% (base const& o) const { // base::operator% return foo_ % o.foo_; } - + base operator%= (base const& o) { // base::operator%= foo_ %= o.foo_; return *this; } @@ -232,7 +232,7 @@ public: base operator|= (base const& o) { // base::operator|= foo_ |= o.foo_; return *this; } - + int operator^ (base const& o) const { // base::operator^ return foo_ ^ o.foo_; } diff --git a/gdb/testsuite/gdb.cp/cplabel.cc b/gdb/testsuite/gdb.cp/cplabel.cc index 6b99b1d3436..b21bb202350 100644 --- a/gdb/testsuite/gdb.cp/cplabel.cc +++ b/gdb/testsuite/gdb.cp/cplabel.cc @@ -75,6 +75,6 @@ int main (void) { foo f; - return f.baz (foo::bar () + 3); + return f.baz (foo::bar () + 3); } diff --git a/gdb/testsuite/gdb.cp/cttiadd.cc b/gdb/testsuite/gdb.cp/cttiadd.cc index e0f63956150..96fa59b061e 100644 --- a/gdb/testsuite/gdb.cp/cttiadd.cc +++ b/gdb/testsuite/gdb.cp/cttiadd.cc @@ -31,7 +31,7 @@ int main() extern void add1(); extern void subr2(); extern void subr3(); - + c = 'a'; i = 2; f = 4.5; diff --git a/gdb/testsuite/gdb.cp/cttiadd1.cc b/gdb/testsuite/gdb.cp/cttiadd1.cc index 2bd6f993552..97e3445ef35 100644 --- a/gdb/testsuite/gdb.cp/cttiadd1.cc +++ b/gdb/testsuite/gdb.cp/cttiadd1.cc @@ -22,7 +22,7 @@ void add1() unsigned char c; int i; float f; - + c = 'b'; i = 3; f = 6.5; diff --git a/gdb/testsuite/gdb.cp/cttiadd2.cc b/gdb/testsuite/gdb.cp/cttiadd2.cc index ee55572aaf3..0ba30130fa1 100644 --- a/gdb/testsuite/gdb.cp/cttiadd2.cc +++ b/gdb/testsuite/gdb.cp/cttiadd2.cc @@ -28,7 +28,7 @@ void subr2() unsigned char c; int i; float f; - + c = 'b'; i = 3; f = 6.5; diff --git a/gdb/testsuite/gdb.cp/cttiadd3.cc b/gdb/testsuite/gdb.cp/cttiadd3.cc index 39f120e35b6..4f0e19acaeb 100644 --- a/gdb/testsuite/gdb.cp/cttiadd3.cc +++ b/gdb/testsuite/gdb.cp/cttiadd3.cc @@ -36,7 +36,7 @@ void subr3() unsigned char c; int i; float f; - + c = 'b'; i = 3; f = 6.5; diff --git a/gdb/testsuite/gdb.cp/derivation.cc b/gdb/testsuite/gdb.cp/derivation.cc index 1a1f829fcd9..b2746d17d51 100644 --- a/gdb/testsuite/gdb.cp/derivation.cc +++ b/gdb/testsuite/gdb.cp/derivation.cc @@ -59,7 +59,7 @@ public: } A::value_type bfoo(); A::value_type foo(); - + }; @@ -76,7 +76,7 @@ public: } int cfoo(); int foo(); - + }; @@ -93,7 +93,7 @@ public: } value_type dfoo(); value_type foo(); - + }; @@ -109,7 +109,7 @@ public: } value_type efoo(); value_type foo(); - + }; @@ -125,7 +125,7 @@ public: } value_type ffoo(); value_type foo(); - + }; class G : private A, public B, protected C { @@ -143,11 +143,11 @@ public: a=15; b=16; c=17; - + } int gfoo(); int foo(); - + }; class Z : public A @@ -226,43 +226,43 @@ int G::gfoo() { A::value_type A::foo() { return 7; - + } A::value_type B::foo() { return 8; - + } A::value_type C::foo() { return 9; - + } D::value_type D::foo() { return 10; - + } E::value_type E::foo() { return 11; - + } F::value_type F::foo() { return 12; - + } int G::foo() { return 13; - + } @@ -285,7 +285,7 @@ int main(void) ZZ zz_instance; marker1(); // marker1-returns-here - + a_instance.a = 20; // marker1-returns-here a_instance.aa = 21; b_instance.b = 22; @@ -309,5 +309,5 @@ int main(void) dobj.doit (); foo2 (); return 0; - + } diff --git a/gdb/testsuite/gdb.cp/exception.cc b/gdb/testsuite/gdb.cp/exception.cc index ed22d96c63c..2c61770902f 100644 --- a/gdb/testsuite/gdb.cp/exception.cc +++ b/gdb/testsuite/gdb.cp/exception.cc @@ -26,7 +26,7 @@ int foo (int i) } extern "C" int bar (int k, unsigned long eharg, int flag); - + int bar (int k, unsigned long eharg, int flag) { return 1; @@ -47,7 +47,7 @@ int main() catch (int x) { catcher (x); } - + try { try { j = foo (20); @@ -61,6 +61,6 @@ int main() catcher (y); } - // Not caught + // Not caught foo (20); } diff --git a/gdb/testsuite/gdb.cp/formatted-ref.cc b/gdb/testsuite/gdb.cp/formatted-ref.cc index 8a107600ec7..8660f1ab548 100644 --- a/gdb/testsuite/gdb.cp/formatted-ref.cc +++ b/gdb/testsuite/gdb.cp/formatted-ref.cc @@ -21,7 +21,7 @@ enum Enum1 { Val10=10, Val11, Val12 }; struct Struct1 { - int x, y; + int x, y; }; int f1 (Struct1& s, Enum1& e, int& i) @@ -35,7 +35,7 @@ int i1 = 23; Enum1 e1 = Val11; -int main(void) +int main(void) { f1 (s1, e1, i1); diff --git a/gdb/testsuite/gdb.cp/iostream.cc b/gdb/testsuite/gdb.cp/iostream.cc index 9a8bab32f47..a58698bc39e 100644 --- a/gdb/testsuite/gdb.cp/iostream.cc +++ b/gdb/testsuite/gdb.cp/iostream.cc @@ -1,5 +1,5 @@ /* Code to go along with tests in rtti.exp. - + Copyright 2015-2025 Free Software Foundation, Inc. This file is part of GDB. diff --git a/gdb/testsuite/gdb.cp/koenig.cc b/gdb/testsuite/gdb.cp/koenig.cc index f7dd083b044..49feeab0269 100644 --- a/gdb/testsuite/gdb.cp/koenig.cc +++ b/gdb/testsuite/gdb.cp/koenig.cc @@ -293,7 +293,7 @@ main () L::A::B::O labo; foo (labo); - + M::A ma; foo(ma,'a'); ma.foo('a'); diff --git a/gdb/testsuite/gdb.cp/local.cc b/gdb/testsuite/gdb.cp/local.cc index 85fd6e14a87..35a04b981fd 100644 --- a/gdb/testsuite/gdb.cp/local.cc +++ b/gdb/testsuite/gdb.cp/local.cc @@ -1,13 +1,13 @@ // Tests for local types void marker1 (void) -{ +{ } void marker2 (void) { } - + int foobar (int x) { class Local { @@ -34,9 +34,9 @@ int foobar (int x) int main() { int c; - + c = foobar (31); - + { // inner block class InnerLocal { public: diff --git a/gdb/testsuite/gdb.cp/m-data.cc b/gdb/testsuite/gdb.cp/m-data.cc index 65e70fabfc0..b0350b02f8f 100644 --- a/gdb/testsuite/gdb.cp/m-data.cc +++ b/gdb/testsuite/gdb.cp/m-data.cc @@ -23,10 +23,10 @@ class gnu_obj_2: public virtual gnu_obj_1 { protected: antiquities value_derived; - + public: gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7), value_derived(b) { } -}; +}; // Test three. template @@ -35,10 +35,10 @@ class gnu_obj_3 protected: typedef region antiquities; gnu_obj_2 data; - + public: gnu_obj_3(antiquities b): data(etruscan) { } -}; +}; int shadow = 0; @@ -59,6 +59,6 @@ int main() C theC (1); // breakpoint: first-constructs-done theC.marker (); - + return shadow; } diff --git a/gdb/testsuite/gdb.cp/m-static.cc b/gdb/testsuite/gdb.cp/m-static.cc index cb871e8d18e..9f8caab1dc6 100644 --- a/gdb/testsuite/gdb.cp/m-static.cc +++ b/gdb/testsuite/gdb.cp/m-static.cc @@ -51,10 +51,10 @@ class gnu_obj_2: public virtual gnu_obj_1 { public: static antiquities value_derived; - + public: gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7) { } -}; +}; template typename gnu_obj_2::antiquities gnu_obj_2::value_derived = etruscan; @@ -66,10 +66,10 @@ class gnu_obj_3 public: typedef region antiquities; static gnu_obj_2 data; - + public: gnu_obj_3(antiquities b) { } -}; +}; template gnu_obj_2 gnu_obj_3::data(etruscan); diff --git a/gdb/testsuite/gdb.cp/mb-ctor.cc b/gdb/testsuite/gdb.cp/mb-ctor.cc index faa59f16459..429438da9f5 100644 --- a/gdb/testsuite/gdb.cp/mb-ctor.cc +++ b/gdb/testsuite/gdb.cp/mb-ctor.cc @@ -1,7 +1,7 @@ #include -class Base +class Base { public: Base(int k); diff --git a/gdb/testsuite/gdb.cp/member-ptr.cc b/gdb/testsuite/gdb.cp/member-ptr.cc index 6fb373b5bf7..eb6f252bc3a 100644 --- a/gdb/testsuite/gdb.cp/member-ptr.cc +++ b/gdb/testsuite/gdb.cp/member-ptr.cc @@ -177,7 +177,7 @@ int main () a.j = 121; a.jj = 1331; - + int k; a_p = &a; @@ -228,7 +228,7 @@ int main () k = (a.**pmf_p)(5); k = a.*pmi; - + k = a.bar(2); @@ -237,6 +237,6 @@ int main () B b; k += b.s; - + return 0; } diff --git a/gdb/testsuite/gdb.cp/method.cc b/gdb/testsuite/gdb.cp/method.cc index 949b027a02e..9fea5fbf1d0 100644 --- a/gdb/testsuite/gdb.cp/method.cc +++ b/gdb/testsuite/gdb.cp/method.cc @@ -67,7 +67,7 @@ int main() a.x = k * 2; k = a.foo(13); - + k += a.bar(15); // Test for CHFts23426 follows diff --git a/gdb/testsuite/gdb.cp/misc.cc b/gdb/testsuite/gdb.cp/misc.cc index 5db4619d836..bab2248ba46 100644 --- a/gdb/testsuite/gdb.cp/misc.cc +++ b/gdb/testsuite/gdb.cp/misc.cc @@ -286,7 +286,7 @@ void inheritance1 (void) g_anon_union.one = 1; g_anon_union.a = 2; - inheritance2 (); + inheritance2 (); } // ======================== static member functions ===================== @@ -392,7 +392,7 @@ void inheritance3 (void) g_vE.vE::ve = 27; g_vE.vE::vx = 28; - inheritance4 (); + inheritance4 (); } // ====================================================================== diff --git a/gdb/testsuite/gdb.cp/namespace.cc b/gdb/testsuite/gdb.cp/namespace.cc index 8c78a7e9da6..48658a908c7 100644 --- a/gdb/testsuite/gdb.cp/namespace.cc +++ b/gdb/testsuite/gdb.cp/namespace.cc @@ -112,7 +112,7 @@ namespace C namespace { int cX = 6; - + namespace F { int cXf = 7; @@ -182,11 +182,11 @@ int main () AAA::SomeEnum var = AAA::ALPHA; using namespace BBB; - + c1 = xyzq ('x'); c1 = AAA::xyzq ('x'); c1 = BBB::CCC::xyzq ('m'); - + inA ina; ina.xx = 33; @@ -201,7 +201,7 @@ int main () c1 = cl.xyzq('e'); marker1(); - + C::D::marker2 (); C::ensureRefs (); diff --git a/gdb/testsuite/gdb.cp/nextoverthrow.cc b/gdb/testsuite/gdb.cp/nextoverthrow.cc index a1ad63a71ba..2ba4eba0eda 100644 --- a/gdb/testsuite/gdb.cp/nextoverthrow.cc +++ b/gdb/testsuite/gdb.cp/nextoverthrow.cc @@ -51,7 +51,7 @@ public: { function1 (val); } - catch (...) + catch (...) { cout << "Caught and handled function1 exception" << endl; } @@ -123,8 +123,8 @@ resumebpt_test (int x) return x; } -int main () -{ +int main () +{ int testval = -1; try diff --git a/gdb/testsuite/gdb.cp/overload.cc b/gdb/testsuite/gdb.cp/overload.cc index ab015721b2b..3fe2011b9b7 100644 --- a/gdb/testsuite/gdb.cp/overload.cc +++ b/gdb/testsuite/gdb.cp/overload.cc @@ -12,7 +12,7 @@ public: const char *ccpfoo; int overload1arg (void); -int overload1arg (char); +int overload1arg (char); int overload1arg (signed char); int overload1arg (unsigned char); int overload1arg (short); @@ -104,7 +104,7 @@ int bar2 (F &, B &) { return 44; } int intintfunc (int x) { return x; } -int main () +int main () { char arg2 = 2; signed char arg3 =3; @@ -188,47 +188,47 @@ int foo::overload1arg (void* arg) { arg = 0; return 14;} int foo::overloadfnarg (void) { return ifoo * 20; } int foo::overloadfnarg (int arg) { arg = 0; return 13;} -int foo::overloadfnarg (int arg, int (*foo) (int)) { return foo(arg); } +int foo::overloadfnarg (int arg, int (*foo) (int)) { return foo(arg); } /* Some functions to test overloading by varying argument count. */ -int foo::overloadargs (int a1) -{ a1 = 0; +int foo::overloadargs (int a1) +{ a1 = 0; return 1;} -int foo::overloadargs (int a1, int a2) -{ a1 = a2 = 0; +int foo::overloadargs (int a1, int a2) +{ a1 = a2 = 0; return 2;} -int foo::overloadargs (int a1, int a2, int a3) -{ a1 = a2 = a3 = 0; +int foo::overloadargs (int a1, int a2, int a3) +{ a1 = a2 = a3 = 0; return 3;} int foo::overloadargs (int a1, int a2, int a3, int a4) -{ a1 = a2 = a3 = a4 = 0; +{ a1 = a2 = a3 = a4 = 0; return 4;} int foo::overloadargs (int a1, int a2, int a3, int a4, int a5) -{ a1 = a2 = a3 = a4 = a5 = 0; +{ a1 = a2 = a3 = a4 = a5 = 0; return 5;} int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6) -{ a1 = a2 = a3 = a4 = a5 = a6 = 0; +{ a1 = a2 = a3 = a4 = a5 = a6 = 0; return 6;} int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7) -{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0; +{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0; return 7;} int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) -{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0; +{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0; return 8;} int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9) -{ - a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0; +{ + a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0; return 9; } diff --git a/gdb/testsuite/gdb.cp/ovldbreak.cc b/gdb/testsuite/gdb.cp/ovldbreak.cc index c3cc069e8ff..adbaa16d239 100644 --- a/gdb/testsuite/gdb.cp/ovldbreak.cc +++ b/gdb/testsuite/gdb.cp/ovldbreak.cc @@ -12,7 +12,7 @@ public: const char *ccpfoo; int overload1arg (void); -int overload1arg (char); +int overload1arg (char); int overload1arg (signed char); int overload1arg (unsigned char); int overload1arg (short); @@ -44,7 +44,7 @@ int overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, void marker1() {} -int main () +int main () { char arg2 = 2; signed char arg3 =3; @@ -87,12 +87,12 @@ int main () foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9); foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); foo_instance1.overloadargs(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11); - + marker1(); - return 0; + return 0; } foo::foo (int i) { ifoo = i;} @@ -142,43 +142,43 @@ int foo::overload1arg (double arg) /* Some functions to test overloading by varying argument count. */ -int foo::overloadargs (int a1) -{ a1 = 0; +int foo::overloadargs (int a1) +{ a1 = 0; return 1;} -int foo::overloadargs (int a1, int a2) -{ a1 = a2 = 0; +int foo::overloadargs (int a1, int a2) +{ a1 = a2 = 0; return 2;} -int foo::overloadargs (int a1, int a2, int a3) -{ a1 = a2 = a3 = 0; +int foo::overloadargs (int a1, int a2, int a3) +{ a1 = a2 = a3 = 0; return 3;} int foo::overloadargs (int a1, int a2, int a3, int a4) -{ a1 = a2 = a3 = a4 = 0; +{ a1 = a2 = a3 = a4 = 0; return 4;} int foo::overloadargs (int a1, int a2, int a3, int a4, int a5) -{ a1 = a2 = a3 = a4 = a5 = 0; +{ a1 = a2 = a3 = a4 = a5 = 0; return 5;} int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6) -{ a1 = a2 = a3 = a4 = a5 = a6 = 0; +{ a1 = a2 = a3 = a4 = a5 = a6 = 0; return 6;} int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7) -{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0; +{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = 0; return 7;} int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) -{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0; +{ a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = 0; return 8;} int foo::overloadargs (int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9) -{ - a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0; +{ + a1 = a2 = a3 = a4 = a5 = a6 = a7 = a8 = a9 = 0; return 9; } diff --git a/gdb/testsuite/gdb.cp/pr10687.cc b/gdb/testsuite/gdb.cp/pr10687.cc index bc25dccff57..895645f9b4a 100644 --- a/gdb/testsuite/gdb.cp/pr10687.cc +++ b/gdb/testsuite/gdb.cp/pr10687.cc @@ -1,4 +1,4 @@ -class vec2 +class vec2 { public: vec2() { _v[0] = _v[1] = 0; } @@ -10,10 +10,10 @@ class vec2 }; vec2 vec2::axis[2] = { vec2(1,0), vec2(0,1) }; -vec2 vec2::axis6[6] = { +vec2 vec2::axis6[6] = { vec2(1,0), vec2(0,1), vec2(2,0), vec2(0,2), - vec2(3,0), vec2(0,3) + vec2(3,0), vec2(0,3) }; int main(int argc, char*argv[]) diff --git a/gdb/testsuite/gdb.cp/pr9167.cc b/gdb/testsuite/gdb.cp/pr9167.cc index a0c50021da0..4fec91e9b62 100644 --- a/gdb/testsuite/gdb.cp/pr9167.cc +++ b/gdb/testsuite/gdb.cp/pr9167.cc @@ -21,7 +21,7 @@ const DerivedType A::DEFAULT_INSTANCE; class B : public A { - + }; int main() diff --git a/gdb/testsuite/gdb.cp/ptype-cv-cp.cc b/gdb/testsuite/gdb.cp/ptype-cv-cp.cc index 34fa7b8c0eb..05f6bee6869 100644 --- a/gdb/testsuite/gdb.cp/ptype-cv-cp.cc +++ b/gdb/testsuite/gdb.cp/ptype-cv-cp.cc @@ -11,7 +11,7 @@ but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ diff --git a/gdb/testsuite/gdb.cp/ref-params.cc b/gdb/testsuite/gdb.cp/ref-params.cc index cd53adb834f..ca3ecdc0324 100644 --- a/gdb/testsuite/gdb.cp/ref-params.cc +++ b/gdb/testsuite/gdb.cp/ref-params.cc @@ -60,7 +60,7 @@ int mf2(MultiChild& C) return mf1(C); } -int main(void) +int main(void) { Child Q(42); Child& QR = Q; diff --git a/gdb/testsuite/gdb.cp/ref-types.cc b/gdb/testsuite/gdb.cp/ref-types.cc index 7dfa6274c27..ec39a61bf4b 100644 --- a/gdb/testsuite/gdb.cp/ref-types.cc +++ b/gdb/testsuite/gdb.cp/ref-types.cc @@ -19,7 +19,7 @@ int main2(void); void marker1 (void) { - + } @@ -88,5 +88,5 @@ int main2(void) I = f(); return 0; - + } diff --git a/gdb/testsuite/gdb.cp/rtti.h b/gdb/testsuite/gdb.cp/rtti.h index feb31582ad8..cf18a5e24a6 100644 --- a/gdb/testsuite/gdb.cp/rtti.h +++ b/gdb/testsuite/gdb.cp/rtti.h @@ -1,5 +1,5 @@ /* Code to go along with tests in rtti.exp. - + Copyright 2003-2025 Free Software Foundation, Inc. Contributed by David Carlton and by Kealia, @@ -37,7 +37,7 @@ namespace n2 { class D2 : public C2{ public: D2(C2 *, C2 *); - + C2* expr_1_; C2* expr_2_; }; diff --git a/gdb/testsuite/gdb.cp/rtti1.cc b/gdb/testsuite/gdb.cp/rtti1.cc index 174b5a7598f..69f26e43f9b 100644 --- a/gdb/testsuite/gdb.cp/rtti1.cc +++ b/gdb/testsuite/gdb.cp/rtti1.cc @@ -1,5 +1,5 @@ /* Code to go along with tests in rtti.exp. - + Copyright 2003-2025 Free Software Foundation, Inc. Contributed by David Carlton and by Kealia, @@ -39,11 +39,11 @@ namespace n1 { class D1 : public C1{ public: D1(C1 *, C1 *); - + C1* expr_1_; C1* expr_2_; }; - + D1::D1(C1 *expr_1, C1 *expr_2) : expr_1_(expr_1), expr_2_(expr_2) { } diff --git a/gdb/testsuite/gdb.cp/rtti2.cc b/gdb/testsuite/gdb.cp/rtti2.cc index 2666774ab67..224524752f2 100644 --- a/gdb/testsuite/gdb.cp/rtti2.cc +++ b/gdb/testsuite/gdb.cp/rtti2.cc @@ -1,5 +1,5 @@ /* Code to go along with tests in rtti.exp. - + Copyright 2003-2025 Free Software Foundation, Inc. Contributed by David Carlton and by Kealia, @@ -23,7 +23,7 @@ #include "rtti.h" namespace n2 { - + D2::D2(C2 *expr_1, C2 *expr_2) : expr_1_(expr_1), expr_2_(expr_2) { } diff --git a/gdb/testsuite/gdb.cp/templates.cc b/gdb/testsuite/gdb.cp/templates.cc index 1b9a2d48819..8ee05702435 100644 --- a/gdb/testsuite/gdb.cp/templates.cc +++ b/gdb/testsuite/gdb.cp/templates.cc @@ -364,7 +364,7 @@ public: T1& operator~() const; }; -void* +void* T1::operator new(size_t) throw () { return 0; } @@ -459,7 +459,7 @@ public: static void* operator new(size_t) throw (); static void operator delete(void *pointer); int value(); - + static T X; T x; int val; @@ -513,7 +513,7 @@ T5 t5i(2); T5 t5fi1(3); T5 t5fi2(4); - + @@ -523,7 +523,7 @@ public: int (*manage[5])(double, void *(*malloc)(unsigned size), void (*free)(void *pointer)); - int (*device[5])(int open(const char *, unsigned mode, unsigned perms, int extra), + int (*device[5])(int open(const char *, unsigned mode, unsigned perms, int extra), int *(*read)(int fd, void *place, unsigned size), int *(*write)(int fd, void *place, unsigned size), void (*close)(int fd)); @@ -797,7 +797,7 @@ int main() int x = fint.foo(33, 47); char c = fchar.foo(33, 'x'); volatile char * cp = fvpchar.foo(33, 0); - + int y = dummy (400, 600); int z = bint.bar(55, 66); @@ -805,13 +805,13 @@ int main() c = bazint2.baz(4, 'y'); c = quxint2.qux(4, 'z'); - + y = bazint.baz(4,3); y = quxint.qux(4, 22); y += qux11.qux(4, 22); y *= gf1(y) - gf2(y); - + Spec sic; Spec siip; @@ -826,13 +826,13 @@ int main() Garply > nf; nf.x = 31; - + x = f.garply (3, 4); - + fc = nf.garply (3, fc); y = x + fc.x; - + i=GetMax(x,y); n=GetMax(l,m); diff --git a/gdb/testsuite/gdb.cp/try_catch.cc b/gdb/testsuite/gdb.cp/try_catch.cc index 1c04238d42e..3200f952d19 100644 --- a/gdb/testsuite/gdb.cp/try_catch.cc +++ b/gdb/testsuite/gdb.cp/try_catch.cc @@ -42,9 +42,9 @@ class gnu_obj_2: public virtual gnu_obj_1 { public: antiquities value_derived; - + gnu_obj_2(antiquities b): gnu_obj_1(oriental, 7), value_derived(b) { } -}; +}; // Test three. template @@ -53,9 +53,9 @@ class gnu_obj_3 public: typedef region antiquities; gnu_obj_2 data; - + gnu_obj_3(antiquities b): data(etruscan) { } -}; +}; int main() { @@ -77,7 +77,7 @@ int main() if (obj.value != egyptian) // marker 1-catch test &= false; if (obj.key2 != 4589) - test &= false; + test &= false; } catch (...) { @@ -103,7 +103,7 @@ int main() if (obj.value != egyptian) // marker 2-catch test &= false; if (obj.key2 != 4589) - test &= false; + test &= false; } } catch (gnu_obj_1& obj) @@ -112,7 +112,7 @@ int main() if (obj.value != egyptian) test &= false; if (obj.key2 != 4589) - test &= false; + test &= false; } } catch (...) diff --git a/gdb/testsuite/gdb.cp/userdef.cc b/gdb/testsuite/gdb.cp/userdef.cc index 871f8eacbf8..98af6482784 100644 --- a/gdb/testsuite/gdb.cp/userdef.cc +++ b/gdb/testsuite/gdb.cp/userdef.cc @@ -65,7 +65,7 @@ A1 operator-(); int operator!(); A1 operator++(); A1 operator++(int); -A1 operator--(); +A1 operator--(); A1 operator--(int); }; @@ -76,7 +76,7 @@ A1 A1::operator+(const A1& second) A1 sum(0,0); sum.x = x + second.x; sum.y = y + second.y; - + return (sum); } @@ -85,7 +85,7 @@ A1 A1::operator*(const A1& second) A1 product(0,0); product.x = this->x * second.x; product.y = this->y * second.y; - + return product; } @@ -94,7 +94,7 @@ A1 A1::operator-(const A1& second) A1 diff(0,0); diff.x = x - second.x; diff.y = y - second.y; - + return diff; } @@ -103,7 +103,7 @@ A1 A1::operator/(const A1& second) A1 div(0,0); div.x = x / second.x; div.y = y / second.y; - + return div; } @@ -112,7 +112,7 @@ A1 A1::operator%(const A1& second) A1 rem(0,0); rem.x = x % second.x; rem.y = y % second.y; - + return rem; } @@ -120,7 +120,7 @@ int A1::operator==(const A1& second) { int a = (x == second.x); int b = (y == second.y); - + return (a && b); } @@ -128,7 +128,7 @@ int A1::operator!=(const A1& second) { int a = (x != second.x); int b = (y != second.y); - + return (a || b); } @@ -147,7 +147,7 @@ A1 A1::operator<<(int value) A1 lshft(0,0); lshft.x = x << value; lshft.y = y << value; - + return lshft; } @@ -156,7 +156,7 @@ A1 A1::operator>>(int value) A1 rshft(0,0); rshft.x = x >> value; rshft.y = y >> value; - + return rshft; } @@ -165,7 +165,7 @@ A1 A1::operator|(const A1& second) A1 abitor(0,0); abitor.x = x | second.x; abitor.y = y | second.y; - + return abitor; } @@ -174,7 +174,7 @@ A1 A1::operator^(const A1& second) A1 axor(0,0); axor.x = x ^ second.x; axor.y = y ^ second.y; - + return axor; } @@ -183,7 +183,7 @@ A1 A1::operator&(const A1& second) A1 abitand(0,0); abitand.x = x & second.x; abitand.y = y & second.y; - + return abitand; } @@ -244,28 +244,28 @@ A1 A1::operator~(void) A1 A1::operator++() // pre increment { x = x +1; - + return (*this); } A1 A1::operator++(int) // post increment { y = y +1; - + return (*this); } A1 A1::operator--() // pre decrement { x = x -1; - + return (*this); } A1 A1::operator--(int) // post decrement { y = y -1; - + return (*this); } @@ -290,7 +290,7 @@ A1 A1::operator+=(int value) ostream& operator<<(ostream& outs, A1 one) { - return (outs << endl << "x = " << one.x << endl << "y = " << one.y << endl << "-------" << endl); + return (outs << endl << "x = " << one.x << endl << "y = " << one.y << endl << "-------" << endl); } class A2 { @@ -349,7 +349,7 @@ int main (void) Member mem1, mem2; int val; Member Container::* mptr = &Container::m; - + mem1.z = 5; mem2.z = 7; c.m.z = 8; @@ -390,7 +390,7 @@ int main (void) cout << "< " << val << endl << "-----"< two; cout << "> " << val << endl << "-----"<> 2; @@ -400,7 +400,7 @@ int main (void) cout << " = "<< three; three += 5; cout << " += "<< three; - + val = (!one); cout << "! " << val << endl << "-----"<vd(), 282); TEST(pEe->fvb(), 311); - + TEST(pEe->D::vg(), 102); printf("Did %d tests, of which %d failed.\n", all_count, failed_count); } @@ -191,7 +191,7 @@ int main() test_calls(); return 0; - + } int A::f() {return 1;} diff --git a/gdb/testsuite/gdb.cp/virtfunc2.cc b/gdb/testsuite/gdb.cp/virtfunc2.cc index 9bac6764415..5122fd98973 100644 --- a/gdb/testsuite/gdb.cp/virtfunc2.cc +++ b/gdb/testsuite/gdb.cp/virtfunc2.cc @@ -19,7 +19,7 @@ class interface { virtual int do_print3() { return 111111; } }; - + class Obj : virtual public interface { public: diff --git a/gdb/testsuite/gdb.disasm/am33.s b/gdb/testsuite/gdb.disasm/am33.s index e699bcffdeb..93cf5660d94 100644 --- a/gdb/testsuite/gdb.disasm/am33.s +++ b/gdb/testsuite/gdb.disasm/am33.s @@ -287,7 +287,7 @@ bit_tests: btst 0x7ffefdfc,r2 - + dsp_add_tests: add_add r4,r1,r2,r3 add_add r4,r1,2,r3 diff --git a/gdb/testsuite/gdb.disasm/hppa.s b/gdb/testsuite/gdb.disasm/hppa.s index 12ace7d3f15..c683629b844 100644 --- a/gdb/testsuite/gdb.disasm/hppa.s +++ b/gdb/testsuite/gdb.disasm/hppa.s @@ -456,7 +456,7 @@ bb_tests bb,>= %r4,5,bb_tests bb,<,n %r4,5,bb_tests bb,>=,n %r4,5,bb_tests - + ; Computational instructions add_tests add %r4,%r5,%r6 @@ -1264,7 +1264,7 @@ probe_tests proberi (%sr0,%r5),1,%r7 probew (%sr0,%r5),%r6,%r7 probewi (%sr0,%r5),1,%r7 - + lpa_tests lpa %r4(%sr0,%r5),%r6 lpa,m %r4(%sr0,%r5),%r6 @@ -1368,7 +1368,7 @@ frnd_tests frnd,quad %fr5,%fr10 frnd,sgl %fr20,%fr24 frnd,dbl %fr20,%fr24 - + fcnvff_tests fcnvff,sgl,sgl %fr5,%fr10 fcnvff,sgl,dbl %fr5,%fr10 @@ -1639,7 +1639,7 @@ copr_tests copr,4,5,n copr,4,115,n -copr_indexing_load +copr_indexing_load cldwx,4 5(0,4),26 cldwx,4,s 5(0,4),26 cldwx,4,m 5(0,4),26 @@ -1649,7 +1649,7 @@ copr_indexing_load clddx,4,m 5(0,4),26 clddx,4,sm 5(0,4),26 -copr_indexing_store +copr_indexing_store cstwx,4 26,5(0,4) cstwx,4,s 26,5(0,4) cstwx,4,m 26,5(0,4) @@ -1659,7 +1659,7 @@ copr_indexing_store cstdx,4,m 26,5(0,4) cstdx,4,sm 26,5(0,4) -copr_short_memory +copr_short_memory cldws,4 0(0,4),26 cldws,4,mb 0(0,4),26 cldws,4,ma 0(0,4),26 diff --git a/gdb/testsuite/gdb.disasm/mn10200.s b/gdb/testsuite/gdb.disasm/mn10200.s index c48dd6431fd..55ffa313e96 100644 --- a/gdb/testsuite/gdb.disasm/mn10200.s +++ b/gdb/testsuite/gdb.disasm/mn10200.s @@ -44,7 +44,7 @@ bCC_tests: blt bCC_tests bhi bCC_tests bcc bCC_tests - bls bCC_tests + bls bCC_tests bcs bCC_tests bvc bCC_tests bvs bCC_tests @@ -61,7 +61,7 @@ bCCx_tests: bltx bCCx_tests bhix bCCx_tests bccx bCCx_tests - blsx bCCx_tests + blsx bCCx_tests bcsx bCCx_tests bvcx bCCx_tests bvsx bCCx_tests @@ -91,7 +91,7 @@ extend_tests: extxu d3 extxb d2 extxbu d1 - + logical_tests: and d1,d2 and 127,d2 diff --git a/gdb/testsuite/gdb.disasm/mn10300.s b/gdb/testsuite/gdb.disasm/mn10300.s index e7ab6e4cd85..868f72d6ab0 100644 --- a/gdb/testsuite/gdb.disasm/mn10300.s +++ b/gdb/testsuite/gdb.disasm/mn10300.s @@ -48,7 +48,7 @@ bCC_tests: blt bCC_tests bhi bCC_tests bcc bCC_tests - bls bCC_tests + bls bCC_tests bcs bCC_tests bvc bCC_tests bvs bCC_tests @@ -81,7 +81,7 @@ cmp_tests: cmp 256,a2 cmp 131071,a1 - + extend_tests: ext d1 extb d2 @@ -103,7 +103,7 @@ extended_tests: sat16 d2,d3 sat24 d3,d2 bsch d1,d2 - + logical_tests: and d1,d2 and 127,d2 @@ -129,7 +129,7 @@ loop_tests: llt lhi lcc - lls + lls lcs lra setlb diff --git a/gdb/testsuite/gdb.disasm/t01_mov.s b/gdb/testsuite/gdb.disasm/t01_mov.s index d79d8aa70f7..f3a117d7483 100644 --- a/gdb/testsuite/gdb.disasm/t01_mov.s +++ b/gdb/testsuite/gdb.disasm/t01_mov.s @@ -81,12 +81,12 @@ _start: mov.b @er3,@0x1234:16 ;017803401234 mov.b @er3,@0x12345678:32 ;0178034812345678 - mov.b @(0x1:2,er3),@er1 ;01781301 - mov.b @(0x1:2,er3),@(0x1:2,er1) ;01781311 - mov.b @(0x1:2,er3),@er1+ ;01781381 - mov.b @(0x1:2,er3),@-er1 ;017813b1 - mov.b @(0x1:2,er3),@+er1 ;01781391 - mov.b @(0x1:2,er3),@er1- ;017813a1 + mov.b @(0x1:2,er3),@er1 ;01781301 + mov.b @(0x1:2,er3),@(0x1:2,er1) ;01781311 + mov.b @(0x1:2,er3),@er1+ ;01781381 + mov.b @(0x1:2,er3),@-er1 ;017813b1 + mov.b @(0x1:2,er3),@+er1 ;01781391 + mov.b @(0x1:2,er3),@er1- ;017813a1 mov.b @(0x1:2,er3),@(0x1234:16,er1) ;017813c11234 mov.b @(0x1:2,er3),@(0x12345678:32,er1) ;017813c912345678 mov.b @(0x1:2,er3),@(0x1234:16,r1l.b) ;017813d11234 @@ -99,11 +99,11 @@ _start: mov.b @(0x1:2,er3),@0x12345678:32 ;0178134812345678 mov.b @-er3,@er1 ;0178b301 - mov.b @-er3,@(0x1:2,er1) ;0178b311 - mov.b @-er3,@er1+ ;0178b381 - mov.b @-er3,@-er1 ;0178b3b1 - mov.b @-er3,@+er1 ;0178b391 - mov.b @-er3,@er1- ;0178b3a1 + mov.b @-er3,@(0x1:2,er1) ;0178b311 + mov.b @-er3,@er1+ ;0178b381 + mov.b @-er3,@-er1 ;0178b3b1 + mov.b @-er3,@+er1 ;0178b391 + mov.b @-er3,@er1- ;0178b3a1 mov.b @-er3,@(0x1234:16,er1) ;0178b3c11234 mov.b @-er3,@(0x12345678:32,er1) ;0178b3c912345678 mov.b @-er3,@(0x1234:16,r1l.b) ;0178b3d11234 @@ -116,11 +116,11 @@ _start: mov.b @-er3,@0x12345678:32 ;0178b34812345678 mov.b @er3+,@er1 ;01788301 - mov.b @er3+,@(0x1:2,er1) ;01788311 - mov.b @er3+,@er1+ ;01788381 - mov.b @er3+,@-er1 ;017883b1 - mov.b @er3+,@+er1 ;01788391 - mov.b @er3+,@er1- ;017883a1 + mov.b @er3+,@(0x1:2,er1) ;01788311 + mov.b @er3+,@er1+ ;01788381 + mov.b @er3+,@-er1 ;017883b1 + mov.b @er3+,@+er1 ;01788391 + mov.b @er3+,@er1- ;017883a1 mov.b @er3+,@(0x1234:16,er1) ;017883c11234 mov.b @er3+,@(0x12345678:32,er1) ;017883c912345678 mov.b @er3+,@(0x1234:16,r1l.b) ;017883d11234 @@ -133,11 +133,11 @@ _start: mov.b @er3+,@0x12345678:32 ;0178834812345678 mov.b @er3-,@er1 ;0178a301 - mov.b @er3-,@(0x1:2,er1) ;0178a311 - mov.b @er3-,@er1+ ;0178a381 - mov.b @er3-,@-er1 ;0178a3b1 - mov.b @er3-,@+er1 ;0178a391 - mov.b @er3-,@er1- ;0178a3a1 + mov.b @er3-,@(0x1:2,er1) ;0178a311 + mov.b @er3-,@er1+ ;0178a381 + mov.b @er3-,@-er1 ;0178a3b1 + mov.b @er3-,@+er1 ;0178a391 + mov.b @er3-,@er1- ;0178a3a1 mov.b @er3-,@(0x1234:16,er1) ;0178a3c11234 mov.b @er3-,@(0x12345678:32,er1) ;0178a3c912345678 mov.b @er3-,@(0x1234:16,r1l.b) ;0178a3d11234 @@ -150,11 +150,11 @@ _start: mov.b @er3-,@0x12345678:32 ;0178a34812345678 mov.b @+er3,@er1 ;01789301 - mov.b @+er3,@(0x1:2,er1) ;01789311 - mov.b @+er3,@er1+ ;01789381 - mov.b @+er3,@-er1 ;017893b1 - mov.b @+er3,@+er1 ;01789391 - mov.b @+er3,@er1- ;017893a1 + mov.b @+er3,@(0x1:2,er1) ;01789311 + mov.b @+er3,@er1+ ;01789381 + mov.b @+er3,@-er1 ;017893b1 + mov.b @+er3,@+er1 ;01789391 + mov.b @+er3,@er1- ;017893a1 mov.b @+er3,@(0x1234:16,er1) ;017893c11234 mov.b @+er3,@(0x12345678:32,er1) ;017893c912345678 mov.b @+er3,@(0x1234:16,r1l.b) ;017893d11234 @@ -409,7 +409,7 @@ _start: mov.w @0x1234:16,r1 ;6b011234 mov.w @0x12345678:32,r1 ;6b2112345678 - mov.w @er2,@er1 ;01580201 + mov.w @er2,@er1 ;01580201 mov.w @er2,@(0x2:2,er1) ;01580211 mov.w @er2,@er1+ ;01580281 mov.w @er2,@-er1 ;015802b1 @@ -443,7 +443,7 @@ _start: mov.w @(0x2:2,er2),@0x1234:16 ;015812401234 mov.w @(0x2:2,er2),@0x12345678:32 ;0158124812345678 - mov.w @-er2,@er1 ;0158b201 + mov.w @-er2,@er1 ;0158b201 mov.w @-er2,@(0x2:2,er1) ;0158b211 mov.w @-er2,@er1+ ;0158b281 mov.w @-er2,@-er1 ;0158b2b1 @@ -687,12 +687,12 @@ _start: mov.l #0x1:3,er3 ;0f9b - mov.l #0x12345678:32,@er1 ;7a74123456780100 + mov.l #0x12345678:32,@er1 ;7a74123456780100 mov.l #0x12345678:32,@(0x4:2,er1) ;7a74123456781100 - mov.l #0x12345678:32,@-er1 ;7a7412345678b100 - mov.l #0x12345678:32,@er1+ ;7a74123456788100 - mov.l #0x12345678:32,@er1- ;7a7412345678a100 - mov.l #0x12345678:32,@+er1 ;7a74123456789100 + mov.l #0x12345678:32,@-er1 ;7a7412345678b100 + mov.l #0x12345678:32,@er1+ ;7a74123456788100 + mov.l #0x12345678:32,@er1- ;7a7412345678a100 + mov.l #0x12345678:32,@+er1 ;7a74123456789100 mov.l #0x12345678:32,@(0x1234:16,er1) ;7a7412345678c1001234 mov.l #0x12345678:32,@(0x12345678:32,er1) ;7a7412345678c90012345678 mov.l #0x12345678:32,@(0x1234:16,r3l.b) ;7a7412345678d3001234 @@ -704,12 +704,12 @@ _start: mov.l #0x12345678:32,@0x1234:16 ;7a741234567840001234 mov.l #0x12345678:32,@0x12345678:32 ;7a7412345678480012345678 - mov.l #0x1234:16,@er1 ;7a7c12340100 + mov.l #0x1234:16,@er1 ;7a7c12340100 mov.l #0x1234:16,@(0x4:2,er1) ;7a7c12341100 - mov.l #0x1234:16,@-er1 ;7a7c1234b100 - mov.l #0x1234:16,@er1+ ;7a7c12348100 - mov.l #0x1234:16,@er1- ;7a7c1234a100 - mov.l #0x1234:16,@+er1 ;7a7c12349100 + mov.l #0x1234:16,@-er1 ;7a7c1234b100 + mov.l #0x1234:16,@er1+ ;7a7c12348100 + mov.l #0x1234:16,@er1- ;7a7c1234a100 + mov.l #0x1234:16,@+er1 ;7a7c12349100 mov.l #0x1234:16,@(0x1234:16,er1) ;7a7c1234c1001234 mov.l #0x1234:16,@(0x12345678:32,er1) ;7a7c1234c90012345678 mov.l #0x1234:16,@(0x1234:16,r3l.b) ;7a7c1234d3001234 @@ -757,12 +757,12 @@ _start: mov.l er2,@0x1234:16 ;01006b821234 mov.l er2,@0x12345678:32 ;01006ba212345678 - mov.l @er2,er1 ;01006921 + mov.l @er2,er1 ;01006921 mov.l @(0x4:2,er2),er1 ;01016921 - mov.l @er2+,er1 ;01006d21 - mov.l @-er2,er1 ;01036d21 - mov.l @+er2,er1 ;01016d21 - mov.l @er2-,er1 ;01026d21 + mov.l @er2+,er1 ;01006d21 + mov.l @-er2,er1 ;01036d21 + mov.l @+er2,er1 ;01016d21 + mov.l @er2-,er1 ;01026d21 mov.l @(0x1234:16,er1),er1 ;01006f111234 mov.l @(0x12345678:32,er1),er1 ;78906b2112345678 mov.l @(0x1234:16,r3l.b),er1 ;01016f311234 @@ -774,7 +774,7 @@ _start: mov.l @0x1234:16,er1 ;01006b011234 mov.l @0x12345678:32,er1 ;01006b2112345678 - mov.l @er2,@er1 ;01080201 + mov.l @er2,@er1 ;01080201 mov.l @er2,@(0x4:2,er1) ;01080211 mov.l @er2,@er1+ ;01080281 mov.l @er2,@-er1 ;010802b1 @@ -825,7 +825,7 @@ _start: mov.l @-er2,@0x1234:16 ;0108b2401234 mov.l @-er2,@0x12345678:32 ;0108b24812345678 - mov.l @er2+,@er1 ;01088201 + mov.l @er2+,@er1 ;01088201 mov.l @er2+,@(0x4:2,er1) ;01088211 mov.l @er2+,@er1+ ;01088281 mov.l @er2+,@-er1 ;010882b1 @@ -842,7 +842,7 @@ _start: mov.l @er2+,@0x1234:16 ;010882401234 mov.l @er2+,@0x12345678:32 ;0108824812345678 - mov.l @er2-,@er1 ;0108a201 + mov.l @er2-,@er1 ;0108a201 mov.l @er2-,@(0x4:2,er1) ;0108a211 mov.l @er2-,@er1+ ;0108a281 mov.l @er2-,@-er1 ;0108a2b1 @@ -859,7 +859,7 @@ _start: mov.l @er2-,@0x1234:16 ;0108a2401234 mov.l @er2-,@0x12345678:32 ;0108a24812345678 - mov.l @+er2,@er1 ;01089201 + mov.l @+er2,@er1 ;01089201 mov.l @+er2,@(0x4:2,er1) ;01089211 mov.l @+er2,@er1+ ;01089281 mov.l @+er2,@-er1 ;010892b1 diff --git a/gdb/testsuite/gdb.disasm/t13_otr.s b/gdb/testsuite/gdb.disasm/t13_otr.s index 812cbcf3306..47dc465d37a 100644 --- a/gdb/testsuite/gdb.disasm/t13_otr.s +++ b/gdb/testsuite/gdb.disasm/t13_otr.s @@ -8,21 +8,21 @@ lab_12: .org 0x1234 .global _start _start: - bra 0x12+.+2 ;4012 - brn 0x12+.+2 ;4112 - bhi 0x12+.+2 ;4212 - bls 0x12+.+2 ;4312 - bcc 0x12+.+2 ;4412 - bcs 0x12+.+2 ;4512 - bne 0x12+.+2 ;4612 - beq 0x12+.+2 ;4712 - bvc 0x12+.+2 ;4812 - bvs 0x12+.+2 ;4912 - bpl 0x12+.+2 ;4a12 - bmi 0x12+.+2 ;4b12 - bge 0x12+.+2 ;4c12 - blt 0x12+.+2 ;4d12 - bgt 0x12+.+2 ;4e12 + bra 0x12+.+2 ;4012 + brn 0x12+.+2 ;4112 + bhi 0x12+.+2 ;4212 + bls 0x12+.+2 ;4312 + bcc 0x12+.+2 ;4412 + bcs 0x12+.+2 ;4512 + bne 0x12+.+2 ;4612 + beq 0x12+.+2 ;4712 + bvc 0x12+.+2 ;4812 + bvs 0x12+.+2 ;4912 + bpl 0x12+.+2 ;4a12 + bmi 0x12+.+2 ;4b12 + bge 0x12+.+2 ;4c12 + blt 0x12+.+2 ;4d12 + bgt 0x12+.+2 ;4e12 ble 0x12+.+2 ;4f12 bra 0x1234+.+4 ;58001234 @@ -73,86 +73,86 @@ _start: bsr/bs #0x7,@0xffff9abc:16,0x1234+.+8 ;6a109abc5cf01234 bsr/bs #0x7,@0x12345678:32,0x1234+.+0xa ;6a30123456785cf01234 - bra r2l.b ;5925 - bra r2.w ;5926 - bra er2.l ;5927 + bra r2l.b ;5925 + bra r2.w ;5926 + bra er2.l ;5927 bsr 0x12+.+2 ;5512 bsr 0x1234+.+4 ;5c001234 - bsr r2l.b ;5d25 - bsr r2.w ;5d26 - bsr er2.l ;5d27 + bsr r2l.b ;5d25 + bsr r2.w ;5d26 + bsr er2.l ;5d27 - jmp @er2 ;5920 + jmp @er2 ;5920 jmp @0x123456:24 ;5a123456 jmp @0x12345678:32 ;590812345678 jmp @@0x12 ;5b12 jmp @@0x234 ;598d - jsr @er2 ;5d20 + jsr @er2 ;5d20 jsr @0x123456:24 ;5e123456 jsr @0x12345678:32 ;5d0812345678 jsr @@0x12 ;5f12 jsr @@0x234 ;5d8d - rts ;5470 + rts ;5470 rts/l er3 ;5403 rts/l er1-er2 ;5412 rts/l er2-er4 ;5424 rts/l er3-er6 ;5436 - trapa #0x3 ;5730 + trapa #0x3 ;5730 - rte ;5670 + rte ;5670 rte/l er3 ;5603 rte/l er1-er2 ;5612 rte/l er2-er4 ;5624 rte/l er3-er6 ;5636 - ldc.b #0x12:8,ccr ;0712 - ldc.b r3h,ccr ;0303 - ldc.w @er3,ccr ;01406930 - ldc.w @er3+,ccr ;01406d30 + ldc.b #0x12:8,ccr ;0712 + ldc.b r3h,ccr ;0303 + ldc.w @er3,ccr ;01406930 + ldc.w @er3+,ccr ;01406d30 ldc.w @(0x1234:16,er3),ccr ;01406f301234 ldc.w @(0x12345678:32,er3),ccr ;014078306b2012345678 ldc.w @0x1234:16,ccr ;01406b001234 ldc.w @0x12345678:32,ccr ;01406b2012345678 - ldc.b #0x12:8,exr ;01410712 - ldc.b r3h,exr ;0313 - ldc.w @er3,exr ;01416930 - ldc.w @er3+,exr ;01416d30 + ldc.b #0x12:8,exr ;01410712 + ldc.b r3h,exr ;0313 + ldc.w @er3,exr ;01416930 + ldc.w @er3+,exr ;01416d30 ldc.w @(0x1234:16,er3),exr ;01416f301234 - ldc.w @(0x12345678:32,er3),exr ;014178306b2012345678 + ldc.w @(0x12345678:32,er3),exr ;014178306b2012345678 ldc.w @0x1234:16,exr ;01416b001234 ldc.w @0x12345678:32,exr ;01416b2012345678 - stc.b ccr,r1h ;0201 - stc.w ccr,@er1 ;01406990 - stc.w ccr,@-er1 ;01406d90 + stc.b ccr,r1h ;0201 + stc.w ccr,@er1 ;01406990 + stc.w ccr,@-er1 ;01406d90 stc.w ccr,@(0x1234:16,er1) ;01406f901234 stc.w ccr,@(0x12345678:32,er1) ;014078106ba012345678 stc.w ccr,@0x1234:16 ;01406b801234 stc.w ccr,@0x12345678:32 ;01406ba012345678 - stc.b exr,r1h ;0211 - stc.w exr,@er1 ;01416990 - stc.w exr,@-er1 ;01416d90 + stc.b exr,r1h ;0211 + stc.w exr,@er1 ;01416990 + stc.w exr,@-er1 ;01416d90 stc.w exr,@(0x1234:16,er1) ;01416f901234 stc.w exr,@(0x12345678:32,er1) ;014178106ba012345678 stc.w exr,@0x1234:16 ;01416b801234 stc.w exr,@0x12345678:32 ;01416ba012345678 - orc.b #0x12:8,ccr ;0412 - orc.b #0x12:8,exr ;01410412 + orc.b #0x12:8,ccr ;0412 + orc.b #0x12:8,exr ;01410412 - xorc.b #0x12:8,ccr ;0512 - xorc.b #0x12:8,exr ;01410512 + xorc.b #0x12:8,ccr ;0512 + xorc.b #0x12:8,exr ;01410512 - andc.b #0x12:8,ccr ;0612 - andc.b #0x12:8,exr ;01410612 + andc.b #0x12:8,ccr ;0612 + andc.b #0x12:8,exr ;01410612 - sleep ;0180 + sleep ;0180 nop ;0000 diff --git a/gdb/testsuite/gdb.dwarf2/clztest.S b/gdb/testsuite/gdb.dwarf2/clztest.S index 1528eac78bf..d44aab1dd9c 100644 --- a/gdb/testsuite/gdb.dwarf2/clztest.S +++ b/gdb/testsuite/gdb.dwarf2/clztest.S @@ -49,7 +49,7 @@ foo: movl vv(%rip), %edx addl $1, %edx movl %edx, vv(%rip) -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] # clztest.c:14 .LM5: ret @@ -79,7 +79,7 @@ bar: movl vv(%rip), %edx addl $1, %edx movl %edx, vv(%rip) -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] # clztest.c:24 .LM10: ret @@ -119,7 +119,7 @@ _start: popq %rbx .LCFI1: .LVL10: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .LFE2: .size _start, .-_start diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-2.c b/gdb/testsuite/gdb.dwarf2/dw2-ranges-2.c index 746441f6d9c..ec7276f0668 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-2.c +++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-2.c @@ -1,16 +1,16 @@ /* Copyright 2007-2025 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges-3.c b/gdb/testsuite/gdb.dwarf2/dw2-ranges-3.c index 46eeaba1099..bd27ca43440 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ranges-3.c +++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges-3.c @@ -1,16 +1,16 @@ /* Copyright 2007-2025 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ diff --git a/gdb/testsuite/gdb.dwarf2/dw2-ranges.c b/gdb/testsuite/gdb.dwarf2/dw2-ranges.c index 28094d4e2e3..f65f5bae212 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-ranges.c +++ b/gdb/testsuite/gdb.dwarf2/dw2-ranges.c @@ -1,16 +1,16 @@ /* Copyright 2007-2025 Free Software Foundation, Inc. - + This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see . */ diff --git a/gdb/testsuite/gdb.dwarf2/dw2-restore.S b/gdb/testsuite/gdb.dwarf2/dw2-restore.S index 50f7b374c74..c04540ec911 100644 --- a/gdb/testsuite/gdb.dwarf2/dw2-restore.S +++ b/gdb/testsuite/gdb.dwarf2/dw2-restore.S @@ -33,7 +33,7 @@ foo: .cfi_startproc .cfi_remember_state jmp 2f - + 1: mov %rbp,%rsp .cfi_restore %rbp pop %rbp diff --git a/gdb/testsuite/gdb.dwarf2/fission-loclists-pie.S b/gdb/testsuite/gdb.dwarf2/fission-loclists-pie.S index 3748907fc09..abd313fb2e5 100644 --- a/gdb/testsuite/gdb.dwarf2/fission-loclists-pie.S +++ b/gdb/testsuite/gdb.dwarf2/fission-loclists-pie.S @@ -23,9 +23,9 @@ __attribute__((noinline)) int init (int *b) - { - return 0; - } + { + return 0; + } int main (int argc, char *argv[]) @@ -51,7 +51,7 @@ init: # testsuite/gdb.dwarf2/fission-loclists-pie.c:24 .loc 1 24 0 movl $0, %eax -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE0: @@ -78,7 +78,7 @@ main: .loc 1 30 0 addq $8, %rsp .cfi_def_cfa_offset 8 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE1: diff --git a/gdb/testsuite/gdb.dwarf2/fission-loclists.S b/gdb/testsuite/gdb.dwarf2/fission-loclists.S index daa6945cf0f..e5726bb6c06 100644 --- a/gdb/testsuite/gdb.dwarf2/fission-loclists.S +++ b/gdb/testsuite/gdb.dwarf2/fission-loclists.S @@ -52,7 +52,7 @@ foo: .loc 1 3 0 movl (%rdi), %eax movl %eax, v(%rip) -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE0: @@ -85,7 +85,7 @@ main: xorl %eax, %eax addq $8, %rsp .cfi_def_cfa_offset 8 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE1: diff --git a/gdb/testsuite/gdb.dwarf2/implptr.c b/gdb/testsuite/gdb.dwarf2/implptr.c index 14315e6bb6f..952ab339736 100644 --- a/gdb/testsuite/gdb.dwarf2/implptr.c +++ b/gdb/testsuite/gdb.dwarf2/implptr.c @@ -56,8 +56,8 @@ typedef int *intp; typedef intp *intpp; typedef intpp *intppp; -int __attribute__ ((noinline, used, noclone)) -bar (int i) +int __attribute__ ((noinline, used, noclone)) +bar (int i) { intp j = &i; intpp k = &j; diff --git a/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.c b/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.c index a22efc7c1e2..5f608be38d9 100644 --- a/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.c +++ b/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.c @@ -30,7 +30,7 @@ struct str int __attribute__ ((noinline)) foo (int arg) -{ +{ return arg; } diff --git a/gdb/testsuite/gdb.dwarf2/pieces.S b/gdb/testsuite/gdb.dwarf2/pieces.S index 6f14e4dce02..f2df27333f1 100644 --- a/gdb/testsuite/gdb.dwarf2/pieces.S +++ b/gdb/testsuite/gdb.dwarf2/pieces.S @@ -17,7 +17,7 @@ /* This was compiled with a version of gcc modified to emit better debuginfo for SRA'd structures. See: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43983 - + The original program is "pieces.c", in this directory. */ diff --git a/gdb/testsuite/gdb.dwarf2/pr10770.c b/gdb/testsuite/gdb.dwarf2/pr10770.c index 64dfc91ce75..be944ebeb6c 100644 --- a/gdb/testsuite/gdb.dwarf2/pr10770.c +++ b/gdb/testsuite/gdb.dwarf2/pr10770.c @@ -329,7 +329,7 @@ __attribute__((noinline)) static void doit () } int main() -{ +{ doit (); abort (); } diff --git a/gdb/testsuite/gdb.dwarf2/typeddwarf.S b/gdb/testsuite/gdb.dwarf2/typeddwarf.S index 7f440cdd9fd..262c75f73db 100644 --- a/gdb/testsuite/gdb.dwarf2/typeddwarf.S +++ b/gdb/testsuite/gdb.dwarf2/typeddwarf.S @@ -41,7 +41,7 @@ f1: movl vv, %eax addl $1, %eax movl %eax, vv -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] # typeddwarf.c:30 .LM3: ret @@ -164,7 +164,7 @@ f2: .LM30: addl $12, %esp .LCFI1: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .LFE1: .size f2, .-f2 @@ -183,7 +183,7 @@ f3: movl vv, %eax addl $1, %eax movl %eax, vv -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] # typeddwarf.c:74 .LM33: ret @@ -204,7 +204,7 @@ f4: movl vv, %eax addl $1, %eax movl %eax, vv -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] # typeddwarf.c:83 .LM36: ret @@ -311,7 +311,7 @@ main: .LCFI8: popl %ebp .LCFI9: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .LFE4: .size main, .-main diff --git a/gdb/testsuite/gdb.dwarf2/valop.S b/gdb/testsuite/gdb.dwarf2/valop.S index 37cdd49a995..b4906a5315f 100644 --- a/gdb/testsuite/gdb.dwarf2/valop.S +++ b/gdb/testsuite/gdb.dwarf2/valop.S @@ -44,7 +44,7 @@ } Then it was compiled with: - + gcc -fvar-tracking{,-assignments} -gdwarf-3 -fno-inline{,-functions,-small-functions,-functions-called-once} -O2 diff --git a/gdb/testsuite/gdb.fortran/derived-type.f90 b/gdb/testsuite/gdb.fortran/derived-type.f90 index 6bcbaa8392f..44c85164083 100644 --- a/gdb/testsuite/gdb.fortran/derived-type.f90 +++ b/gdb/testsuite/gdb.fortran/derived-type.f90 @@ -4,12 +4,12 @@ ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3 of the License, or ! (at your option) any later version. -! +! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. -! +! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see . ! @@ -25,7 +25,7 @@ program main type foo real :: a type(bar) :: x - character*7 :: b + character*7 :: b end type foo type(foo) :: q type(bar) :: p diff --git a/gdb/testsuite/gdb.fortran/library-module-lib.f90 b/gdb/testsuite/gdb.fortran/library-module-lib.f90 index e50df7766cf..b93138eb9ec 100644 --- a/gdb/testsuite/gdb.fortran/library-module-lib.f90 +++ b/gdb/testsuite/gdb.fortran/library-module-lib.f90 @@ -1,15 +1,15 @@ ! Copyright 2010-2025 Free Software Foundation, Inc. -! +! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3 of the License, or ! (at your option) any later version. -! +! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. -! +! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see . diff --git a/gdb/testsuite/gdb.fortran/library-module-main.f90 b/gdb/testsuite/gdb.fortran/library-module-main.f90 index c7d8b84bb1a..40cb0f77ebd 100644 --- a/gdb/testsuite/gdb.fortran/library-module-main.f90 +++ b/gdb/testsuite/gdb.fortran/library-module-main.f90 @@ -1,15 +1,15 @@ ! Copyright 2010-2025 Free Software Foundation, Inc. -! +! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3 of the License, or ! (at your option) any later version. -! +! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. -! +! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see . diff --git a/gdb/testsuite/gdb.fortran/module.f90 b/gdb/testsuite/gdb.fortran/module.f90 index 186bd1cc8f1..98485d10c45 100644 --- a/gdb/testsuite/gdb.fortran/module.f90 +++ b/gdb/testsuite/gdb.fortran/module.f90 @@ -1,15 +1,15 @@ ! Copyright 2009-2025 Free Software Foundation, Inc. -! +! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3 of the License, or ! (at your option) any later version. -! +! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. -! +! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see . diff --git a/gdb/testsuite/gdb.fortran/multi-dim.f90 b/gdb/testsuite/gdb.fortran/multi-dim.f90 index 1e5e2985fe6..0ebf1aed6bd 100644 --- a/gdb/testsuite/gdb.fortran/multi-dim.f90 +++ b/gdb/testsuite/gdb.fortran/multi-dim.f90 @@ -4,12 +4,12 @@ ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3 of the License, or ! (at your option) any later version. -! +! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. -! +! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see . diff --git a/gdb/testsuite/gdb.guile/scm-breakpoint.c b/gdb/testsuite/gdb.guile/scm-breakpoint.c index 8ad3cd279d2..dfb0fa4f09c 100644 --- a/gdb/testsuite/gdb.guile/scm-breakpoint.c +++ b/gdb/testsuite/gdb.guile/scm-breakpoint.c @@ -28,7 +28,7 @@ int multiply (int i) int add (int i) { - return i + i; + return i + i; } diff --git a/gdb/testsuite/gdb.guile/scm-pretty-print.c b/gdb/testsuite/gdb.guile/scm-pretty-print.c index cada6b74489..ff0fc95e3ae 100644 --- a/gdb/testsuite/gdb.guile/scm-pretty-print.c +++ b/gdb/testsuite/gdb.guile/scm-pretty-print.c @@ -70,16 +70,16 @@ struct SSS }; SSS::SSS (int x, const S& r) : a(x), b(r) { } -class VirtualTest -{ - private: - int value; - - public: - VirtualTest () - { +class VirtualTest +{ + private: + int value; + + public: + VirtualTest () + { value = 1; - } + } }; class Vbase1 : public virtual VirtualTest { }; @@ -87,21 +87,21 @@ class Vbase2 : public virtual VirtualTest { }; class Vbase3 : public virtual VirtualTest { }; class Derived : public Vbase1, public Vbase2, public Vbase3 -{ - private: - int value; - +{ + private: + int value; + public: - Derived () - { - value = 2; + Derived () + { + value = 2; } }; class Fake { int sname; - + public: Fake (const int name = 0): sname (name) @@ -130,7 +130,7 @@ substruct_test (void) outer.s.a = 3; /* MI outer breakpoint here */ - return outer; + return outer; } typedef struct string_repr @@ -321,7 +321,7 @@ main () SSS& ref (sss); Derived derived; - + Fake fake (42); #endif @@ -343,7 +343,7 @@ main () nstype.elements[0] = 7; nstype.elements[1] = 42; nstype.len = 2; - + nstype2 = nstype; eval_sub (); diff --git a/gdb/testsuite/gdb.guile/scm-type.c b/gdb/testsuite/gdb.guile/scm-type.c index cab4c714407..bf217f50ae4 100644 --- a/gdb/testsuite/gdb.guile/scm-type.c +++ b/gdb/testsuite/gdb.guile/scm-type.c @@ -75,7 +75,7 @@ main () d.f = 4; #endif enum E e; - + st.a = 3; st.b = 5; @@ -84,6 +84,6 @@ main () struct flex_member *f = (struct flex_member *) malloc (100); f->items[0] = 111; f->items[1] = 222; - + return 0; /* break to inspect struct and array. */ } diff --git a/gdb/testsuite/gdb.linespec/break-asm-file0.S b/gdb/testsuite/gdb.linespec/break-asm-file0.S index 05af2aff3aa..2324b8186f0 100644 --- a/gdb/testsuite/gdb.linespec/break-asm-file0.S +++ b/gdb/testsuite/gdb.linespec/break-asm-file0.S @@ -215,7 +215,7 @@ func: .uleb128 5 .byte 2 .4byte .Lfunc_2 - + .byte 3 /* DW_LNS_advance_line */ .sleb128 1 /* ... to 8 */ diff --git a/gdb/testsuite/gdb.mi/gdb792.cc b/gdb/testsuite/gdb.mi/gdb792.cc index a698a12e0fb..f6658d7c42b 100644 --- a/gdb/testsuite/gdb.mi/gdb792.cc +++ b/gdb/testsuite/gdb.mi/gdb792.cc @@ -28,11 +28,11 @@ class A }; int x; char buffer[10]; - + protected: int y; B b; - + private: float z; }; diff --git a/gdb/testsuite/gdb.mi/mi-fortran-modules.f90 b/gdb/testsuite/gdb.mi/mi-fortran-modules.f90 index d35e8859b0d..241186aaffd 100644 --- a/gdb/testsuite/gdb.mi/mi-fortran-modules.f90 +++ b/gdb/testsuite/gdb.mi/mi-fortran-modules.f90 @@ -1,15 +1,15 @@ ! Copyright 2009-2025 Free Software Foundation, Inc. -! +! ! This program is free software; you can redistribute it and/or modify ! it under the terms of the GNU General Public License as published by ! the Free Software Foundation; either version 3 of the License, or ! (at your option) any later version. -! +! ! This program is distributed in the hope that it will be useful, ! but WITHOUT ANY WARRANTY; without even the implied warranty of ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ! GNU General Public License for more details. -! +! ! You should have received a copy of the GNU General Public License ! along with this program. If not, see . diff --git a/gdb/testsuite/gdb.mi/mi-syn-frame.c b/gdb/testsuite/gdb.mi/mi-syn-frame.c index b6ab6e8d88a..e3c9b743f71 100644 --- a/gdb/testsuite/gdb.mi/mi-syn-frame.c +++ b/gdb/testsuite/gdb.mi/mi-syn-frame.c @@ -24,7 +24,7 @@ foo (void) { } -void +void bar (void) { *(volatile char *)0 = 0; /* try to cause a segfault */ @@ -47,7 +47,7 @@ handler (int sig) subroutine (sig); } -/* The first statement in subroutine () is a place for a breakpoint. +/* The first statement in subroutine () is a place for a breakpoint. Without it, the breakpoint is put on the while comparison and will be hit at each iteration. */ diff --git a/gdb/testsuite/gdb.mi/mi-var-child.c b/gdb/testsuite/gdb.mi/mi-var-child.c index 692f9f54864..6d173d16686 100644 --- a/gdb/testsuite/gdb.mi/mi-var-child.c +++ b/gdb/testsuite/gdb.mi/mi-var-child.c @@ -251,7 +251,7 @@ do_children_tests (void) struct_declarations.long_array[11] = 5678; /* Struct/pointer/array tests */ - a0[0] = '0'; + a0[0] = '0'; a1 = a0; a2 = &a1; a3 = &a2; @@ -322,7 +322,7 @@ do_special_tests (void) int array[21]; int a; - a = 1; + a = 1; incr_a(2); } @@ -341,12 +341,12 @@ do_child_deletion (void) mi_create_varobj S s "create varobj for s" mi_list_varobj_children S {{S.a a 0 int} {S.b b 0 int}} \ "list children of S" - mi_delete_varobj S.a "delete S.a" + mi_delete_varobj S.a "delete S.a" mi_delete_varobj S.b "delete S.b" mi_delete_varobj S "delete S" :*/ return 99; - /*: END: child_deletion :*/ + /*: END: child_deletion :*/ } int @@ -360,4 +360,4 @@ main (int argc, char *argv []) exit (0); } - + diff --git a/gdb/testsuite/gdb.mi/mi-var-cp.cc b/gdb/testsuite/gdb.mi/mi-var-cp.cc index 5c4320e7bd0..3f99e1e3ff2 100644 --- a/gdb/testsuite/gdb.mi/mi-var-cp.cc +++ b/gdb/testsuite/gdb.mi/mi-var-cp.cc @@ -25,25 +25,25 @@ void reference_update_tests () x = 567; /*: mi_varobj_update RX {RX} "update RX, 2" mi_check_varobj_value RX 567 "check RX: expect 567" - :*/ + :*/ x = 567; /*: mi_varobj_update RX {} "update RX, 3" mi_delete_varobj RX "delete RX" :*/ /* Dummy assignment to keep 'x' in scope. */ - x = 444; + x = 444; /*: END: reference_update :*/ } struct S { int i; int j; }; struct S2 : S {}; - + int base_in_reference_test (S2& s2) { /*: BEGIN: base_in_reference :*/ int x = s2.i + s2.j; - /*: + /*: mi_create_varobj "S2" "s2" "create varobj for s2" mi_list_varobj_children "S2" { {"S2.S" "S" "1" "S"} @@ -59,12 +59,12 @@ int base_in_reference_test (S2& s2) mi_check_varobj_value "S2.S.public.i" "67" "check S2.S.public.i" mi_check_varobj_value "S2.S.public.j" "89" "check S2.S.public.j" mi_delete_varobj S2 "delete S2" - + :*/ /*: END: base_in_reference :*/ return x; } - + void base_in_reference_test_main () { S2 s; @@ -75,12 +75,12 @@ void base_in_reference_test_main () int reference_to_pointer () { - /*: BEGIN: reference_to_pointer :*/ + /*: BEGIN: reference_to_pointer :*/ S s, *ptr_s, *& rptr_s = ptr_s; s.i = 67; s.j = 89; ptr_s = &s; - /*: + /*: mi_create_varobj RPTR rptr_s "create varobj for rptr_s" mi_list_varobj_children RPTR {{RPTR.public public 2}} \ @@ -158,7 +158,7 @@ int path_expression () {DP.public public 1}} "list children of DP" mi_gdb_test "-var-info-path-expression DP.Base1" \ "\\^done,path_expr=\"\\(\\*\\(class Base1\\*\\) dp\\)\"" \ - "-var-info-path-expression DP.Base1" + "-var-info-path-expression DP.Base1" mi_list_varobj_children DP.public { \ {DP.public.i i 0 int} \ } "list children of DP.public" diff --git a/gdb/testsuite/gdb.mi/mi-var-rtti.cc b/gdb/testsuite/gdb.mi/mi-var-rtti.cc index 8e44c24953e..c0c3973bcea 100644 --- a/gdb/testsuite/gdb.mi/mi-var-rtti.cc +++ b/gdb/testsuite/gdb.mi/mi-var-rtti.cc @@ -61,7 +61,7 @@ void use_rtti_for_ref_test () Derived d; Base& ref = d; const Base& constRef = d; - /*: + /*: set testname use_rtti_for_ref set_print_object off $testname check_new_derived_without_rtti ref {Base \&} $testname @@ -80,7 +80,7 @@ void use_rtti_for_ptr_child_test () { /*: BEGIN: use_rtti_for_ptr_child :*/ Derived d; - struct S { + struct S { Base* ptr; const Base* constPtr; Base* const ptrConst; @@ -91,7 +91,7 @@ void use_rtti_for_ptr_child_test () ptrConst ( v ), constPtrConst ( v ) {} } s ( &d ); - /*: + /*: set testname use_rtti_for_ptr_child set_print_object off $testname @@ -139,14 +139,14 @@ void use_rtti_for_ref_child_test () { /*: BEGIN: use_rtti_for_ref_child :*/ Derived d; - struct S { + struct S { Base& ref; const Base& constRef; S ( Base& v ) : ref ( v ), constRef ( v ) {} } s ( d ); - /*: + /*: set testname use_rtti_for_ref_child set_print_object off $testname @@ -248,7 +248,7 @@ void type_update_when_use_rtti_test () ptr ( v ) {} } s ( ptr ); Derived d; - /*: + /*: set testname type_update_when_use_rtti set_print_object on $testname @@ -304,7 +304,7 @@ void skip_type_update_when_not_use_rtti_test () ptr ( v ) {} } s ( ptr ); Derived d; - /*: + /*: set testname skip_type_update_when_not_use_rtti with_test_prefix "ptr is nullptr" { @@ -326,7 +326,7 @@ void skip_type_update_when_not_use_rtti_test () ptr = &d; s.ptr = &d; - /*: + /*: with_test_prefix "ptr points at d" { mi_varobj_update PTR {PTR PTR.public.A} \ "update ptr to derived type in $testname" diff --git a/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.s b/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.s index bcc7775a7f5..f2960f6c7b2 100644 --- a/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.s +++ b/gdb/testsuite/gdb.mi/mi2-amd64-entry-value.s @@ -35,7 +35,7 @@ e: # gdb.mi/mi2-amd64-entry-value.c:23 .loc 1 23 0 movl $0, v(%rip) -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] # gdb.mi/mi2-amd64-entry-value.c:24 .loc 1 24 0 ret @@ -54,7 +54,7 @@ data: # gdb.mi/mi2-amd64-entry-value.c:30 .loc 1 30 0 movl $10, %eax -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE1: @@ -71,7 +71,7 @@ data2: # gdb.mi/mi2-amd64-entry-value.c:36 .loc 1 36 0 movl $20, %eax -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE2: @@ -114,7 +114,7 @@ different: .LCFI1: .cfi_def_cfa_offset 8 .LVL4: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE3: @@ -162,7 +162,7 @@ validity: .LCFI3: .cfi_def_cfa_offset 8 .LVL7: -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE4: @@ -190,7 +190,7 @@ invalid: # 60 "gdb.mi/mi2-amd64-entry-value.c" 1 breakhere_invalid: # 0 "" 2 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] # gdb.mi/mi2-amd64-entry-value.c:61 .loc 1 61 0 #NO_APP @@ -233,7 +233,7 @@ main: .loc 1 70 0 xorl %eax, %eax .p2align 4,,1 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE6: diff --git a/gdb/testsuite/gdb.mi/non-stop-exit.c b/gdb/testsuite/gdb.mi/non-stop-exit.c index d9ef9701fd7..8eebee4eaa6 100644 --- a/gdb/testsuite/gdb.mi/non-stop-exit.c +++ b/gdb/testsuite/gdb.mi/non-stop-exit.c @@ -47,7 +47,7 @@ main () for (i = 0; i < NTHREADS; ++i) { - pthread_join (thread_id[i], NULL); + pthread_join (thread_id[i], NULL); } return 0; diff --git a/gdb/testsuite/gdb.mi/non-stop.c b/gdb/testsuite/gdb.mi/non-stop.c index 03192c04915..0f31dad9cca 100644 --- a/gdb/testsuite/gdb.mi/non-stop.c +++ b/gdb/testsuite/gdb.mi/non-stop.c @@ -32,7 +32,7 @@ worker (void *arg) { int id = *(int *)arg; int i = 0; - + /* When gdb is running, it sets hidden breakpoints in the thread library. The signals caused by these hidden breakpoints can cause system calls such as 'sleep' to return early. Pay attention diff --git a/gdb/testsuite/gdb.mi/var-cmd.c b/gdb/testsuite/gdb.mi/var-cmd.c index 5171ae7aa17..fa17f69b0d2 100644 --- a/gdb/testsuite/gdb.mi/var-cmd.c +++ b/gdb/testsuite/gdb.mi/var-cmd.c @@ -344,7 +344,7 @@ do_special_tests (void) int array[21]; int a; - a = 1; + a = 1; u.integer = a; anonu.a = a; s.integer = a; @@ -366,7 +366,7 @@ void do_frozen_tests () } v1 = {1, {2, 3}}; int v2 = 4; - /*: + /*: with_test_prefix "create varobj V1 and V2" { mi_create_varobj V1 v1 "create varobj for v1" mi_create_varobj V2 v2 "create varobj for v2" @@ -388,12 +388,12 @@ void do_frozen_tests () } :*/ v2 = 5; - /*: + /*: mi_varobj_update * {V2} "update varobjs: V2 changed" set_frozen V2 1 :*/ v2 = 6; - /*: + /*: mi_varobj_update * {} "update varobjs: nothing changed" mi_check_varobj_value V2 5 "check V2: 5" mi_varobj_update V2 {V2} "update V2 explicitly" @@ -447,8 +447,8 @@ void do_frozen_tests () mi_check_varobj_value V1.nested.j 11 "check V1.nested.j: 11" mi_check_varobj_value V1.nested.k 12 "check V1.nested.k: 12" } - :*/ - + :*/ + /*: END: frozen :*/ } @@ -460,7 +460,7 @@ void do_at_tests_callee () and then try to reevaluate it in other frame without reparsing the expression, we will access local variables using DWARF location expression from the original frame, and are likely - to grab wrong symbol. To reliably reproduce this bug, we need + to grab wrong symbol. To reliably reproduce this bug, we need to wrap our variable with a bunch of buffers, so that those buffers are accessed instead of the real one. */ int buffer1 = 10; @@ -546,7 +546,7 @@ void do_bitfield_tests () mi_check_varobj_value V.sharable 3 "access bitfield" :*/ return; - /*: END: bitfield :*/ + /*: END: bitfield :*/ } void @@ -663,4 +663,4 @@ main (int argc, char *argv []) exit (0); } - + diff --git a/gdb/testsuite/gdb.modula2/unbounded1.c b/gdb/testsuite/gdb.modula2/unbounded1.c index 1629d0e3424..0a0a82d822d 100644 --- a/gdb/testsuite/gdb.modula2/unbounded1.c +++ b/gdb/testsuite/gdb.modula2/unbounded1.c @@ -41,7 +41,7 @@ main () t._m2_contents = (char *)&data; t._m2_high = 4; /* include the in the string, even though high is set to 4. */ - + for (i=0; i<6; i++) data[i] = input[i]; return foo (t); diff --git a/gdb/testsuite/gdb.python/amd64-py-framefilter-invalidarg.S b/gdb/testsuite/gdb.python/amd64-py-framefilter-invalidarg.S index 02805913aaa..1e5d8ac7937 100644 --- a/gdb/testsuite/gdb.python/amd64-py-framefilter-invalidarg.S +++ b/gdb/testsuite/gdb.python/amd64-py-framefilter-invalidarg.S @@ -46,7 +46,7 @@ main: .loc 1 3 0 popq %rbp .cfi_def_cfa 7, 8 -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE0: diff --git a/gdb/testsuite/gdb.python/py-explore.c b/gdb/testsuite/gdb.python/py-explore.c index 5546eaf90b0..cd64a57d467 100644 --- a/gdb/testsuite/gdb.python/py-explore.c +++ b/gdb/testsuite/gdb.python/py-explore.c @@ -64,7 +64,7 @@ main (void) ss.a = 10; ss.d = 100.01; ss_t = ss; - + su.d = 100.1; cs.s = ss; diff --git a/gdb/testsuite/gdb.python/py-pp-maint.c b/gdb/testsuite/gdb.python/py-pp-maint.c index f40bbe5f8c1..4221539cefc 100644 --- a/gdb/testsuite/gdb.python/py-pp-maint.c +++ b/gdb/testsuite/gdb.python/py-pp-maint.c @@ -81,6 +81,6 @@ main () init_flt (&flt, 42, 43); init_ss (&ss, 1, 2); - + return 0; /* break to inspect */ } diff --git a/gdb/testsuite/gdb.python/py-pp-registration.c b/gdb/testsuite/gdb.python/py-pp-registration.c index 5a95917bfec..e7dfd6026b4 100644 --- a/gdb/testsuite/gdb.python/py-pp-registration.c +++ b/gdb/testsuite/gdb.python/py-pp-registration.c @@ -50,6 +50,6 @@ main () init_flt (&flt, 42, 43); init_s (&s, 1); - + return 0; /* break to inspect */ } diff --git a/gdb/testsuite/gdb.python/py-prettyprint.c b/gdb/testsuite/gdb.python/py-prettyprint.c index 56c19ad40d0..3951b19ab3b 100644 --- a/gdb/testsuite/gdb.python/py-prettyprint.c +++ b/gdb/testsuite/gdb.python/py-prettyprint.c @@ -72,16 +72,16 @@ struct SSS }; SSS::SSS (int x, const S& r) : a(x), b(r) { } -class VirtualTest -{ - private: - int value; - - public: - VirtualTest () - { +class VirtualTest +{ + private: + int value; + + public: + VirtualTest () + { value = 1; - } + } }; class Vbase1 : public virtual VirtualTest { }; @@ -89,21 +89,21 @@ class Vbase2 : public virtual VirtualTest { }; class Vbase3 : public virtual VirtualTest { }; class Derived : public Vbase1, public Vbase2, public Vbase3 -{ - private: - int value; - +{ + private: + int value; + public: - Derived () - { - value = 2; + Derived () + { + value = 2; } }; class Fake { int sname; - + public: Fake (const int name = 0): sname (name) @@ -150,7 +150,7 @@ substruct_test (void) outer.s.a = 3; /* MI outer breakpoint here */ - return outer; + return outer; } typedef struct string_repr @@ -362,7 +362,7 @@ main () SSS& ref (sss); Derived derived; - + Fake fake (42); init_s (&has_static_member::global, 23); @@ -387,7 +387,7 @@ main () nstype.elements[0] = 7; nstype.elements[1] = 42; nstype.len = 2; - + nstype2 = nstype; eval_sub (); diff --git a/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.S b/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.S index 72c3691526e..78f40d12c39 100644 --- a/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.S +++ b/gdb/testsuite/gdb.reverse/amd64-tailcall-reverse.S @@ -35,7 +35,7 @@ g: # gdb.reverse/amd64-tailcall-reverse.c:23 .loc 1 23 0 movl $2, v(%rip) -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE0: @@ -81,7 +81,7 @@ main: # gdb.reverse/amd64-tailcall-reverse.c:39 .loc 1 39 0 xorl %eax, %eax -# SUCC: EXIT [100.0%] +# SUCC: EXIT [100.0%] ret .cfi_endproc .LFE2: diff --git a/gdb/testsuite/gdb.reverse/consecutive-reverse.c b/gdb/testsuite/gdb.reverse/consecutive-reverse.c index 1d01d16029a..c8054a81ea3 100644 --- a/gdb/testsuite/gdb.reverse/consecutive-reverse.c +++ b/gdb/testsuite/gdb.reverse/consecutive-reverse.c @@ -15,7 +15,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . */ -/* +/* Purpose of this test: to test breakpoints on consecutive instructions. */ diff --git a/gdb/testsuite/gdb.reverse/finish-reverse.c b/gdb/testsuite/gdb.reverse/finish-reverse.c index f4487dfe3a4..1bcf834271e 100644 --- a/gdb/testsuite/gdb.reverse/finish-reverse.c +++ b/gdb/testsuite/gdb.reverse/finish-reverse.c @@ -90,7 +90,7 @@ int main (int argc, char **argv) double double_resultval; int i; - /* A "test load" that will insure that the function really returns + /* A "test load" that will insure that the function really returns a ${type} (as opposed to just a truncated or part of a ${type}). */ for (i = 0; i < sizeof (testval.ffff); i++) testval.ffff[i] = 0xff; @@ -119,9 +119,9 @@ int main (int argc, char **argv) throughout the value, so we'll still detect truncated values. */ testval.float_testval = 2.7182818284590452354;/* long_long_checkpoint */ - float_resultval = float_func (); + float_resultval = float_func (); testval.double_testval = 3.14159265358979323846; /* float_checkpoint */ - double_resultval = double_func (); + double_resultval = double_func (); main_test = 1; /* double_checkpoint */ return 0; /* end of main */ } diff --git a/gdb/testsuite/gdb.reverse/i386-reverse.c b/gdb/testsuite/gdb.reverse/i386-reverse.c index 3dd89d945f6..6d9acda35ad 100644 --- a/gdb/testsuite/gdb.reverse/i386-reverse.c +++ b/gdb/testsuite/gdb.reverse/i386-reverse.c @@ -17,7 +17,7 @@ /* Architecture tests for intel i386 platform. */ -void +void inc_dec_tests (void) { asm ("inc %eax"); @@ -38,7 +38,7 @@ inc_dec_tests (void) asm ("dec %edi"); } /* end inc_dec_tests */ -int +int main () { inc_dec_tests (); diff --git a/gdb/testsuite/gdb.reverse/i387-env-reverse.c b/gdb/testsuite/gdb.reverse/i387-env-reverse.c index c346879a4b3..e95c092672a 100644 --- a/gdb/testsuite/gdb.reverse/i387-env-reverse.c +++ b/gdb/testsuite/gdb.reverse/i387-env-reverse.c @@ -4,7 +4,7 @@ float no1,no2,no3,no4,no5,no6,no7; -float result,resultd,resultld; +float result,resultd,resultld; float *float_memory; long double ldx = 88888888888888888888.88, ldy = 9999999999999999999.99; double x = 100.345, y = 25.7789; @@ -18,7 +18,7 @@ void empty_fpu_stack() "ffree %st(5) \n\t" "ffree %st(6) \n\t" "ffree %st(7)"); -} +} /* initialization of floats */ void init_floats() @@ -40,10 +40,10 @@ void init_floats() int main() { init_floats(); - empty_fpu_stack(); /* BEGIN I387-FLOAT-REVERSE */ - + empty_fpu_stack(); /* BEGIN I387-FLOAT-REVERSE */ + asm("nop"); /* TEST ENV */ - asm ("fsave %0" : "=m"(*float_memory) : ); + asm ("fsave %0" : "=m"(*float_memory) : ); asm ("frstor %0" : : "m"(*float_memory)); asm ("fstsw %ax"); /* test eax register */ @@ -55,6 +55,6 @@ int main() asm ("fldln2"); asm ("fldz"); asm ("nop"); - + return 1; /* END I387-FLOAT-REVERSE */ } diff --git a/gdb/testsuite/gdb.reverse/i387-stack-reverse.c b/gdb/testsuite/gdb.reverse/i387-stack-reverse.c index 93d3f4629ad..9ae4dc78b82 100644 --- a/gdb/testsuite/gdb.reverse/i387-stack-reverse.c +++ b/gdb/testsuite/gdb.reverse/i387-stack-reverse.c @@ -12,18 +12,18 @@ void empty_fpu_stack() "ffree %st(5) \n\t" "ffree %st(6) \n\t" "ffree %st(7)"); -} +} /* tests floating point arithmetic */ void test_arith_floats() { - + } int main() { empty_fpu_stack(); /* BEGIN I387-FLOAT-REVERSE */ - + asm ("fld1"); /* test st0 register */ asm ("fldl2t"); /* test st0, st1 */ asm ("fldl2e"); /* test st0, st1, st2 */ @@ -33,6 +33,6 @@ int main() asm ("fldz"); /* test st0, st1, st2, st3, st4, st5, st6 */ asm ("fld1"); /* test st0, st1, st2, st3, st4, st5, st6, st7 */ asm ("nop"); - + return 1; /* END I387-FLOAT-REVERSE */ } diff --git a/gdb/testsuite/gdb.reverse/machinestate.c b/gdb/testsuite/gdb.reverse/machinestate.c index bf4d95b5c3b..fd0822e90ff 100644 --- a/gdb/testsuite/gdb.reverse/machinestate.c +++ b/gdb/testsuite/gdb.reverse/machinestate.c @@ -24,7 +24,7 @@ extern void hide (int); /* Test register variable Requires -- compiler honors 'register'. */ -void +void register_state (void) { register int a = 0; @@ -88,7 +88,7 @@ module_global_state (void) /* main test driver */ -int +int main (int argc, char **argv) { register_state (); /* begin main */ @@ -96,6 +96,6 @@ main (int argc, char **argv) function_static_state (); module_static_state (); module_global_state (); - + return 0; /* end main */ } diff --git a/gdb/testsuite/gdb.reverse/ms1.c b/gdb/testsuite/gdb.reverse/ms1.c index 4c4dda5b0e6..d2b1b861631 100644 --- a/gdb/testsuite/gdb.reverse/ms1.c +++ b/gdb/testsuite/gdb.reverse/ms1.c @@ -19,7 +19,7 @@ * Aux function for machine state test. */ -void +void hide (int x) { } diff --git a/gdb/testsuite/gdb.reverse/sigall-reverse.c b/gdb/testsuite/gdb.reverse/sigall-reverse.c index 70536004f56..035d2558f11 100644 --- a/gdb/testsuite/gdb.reverse/sigall-reverse.c +++ b/gdb/testsuite/gdb.reverse/sigall-reverse.c @@ -397,7 +397,7 @@ gen_ABRT (void) { kill (getpid (), SIGABRT); return 0; -} +} int x; @@ -446,7 +446,7 @@ gen_HUP (void) handle_HUP (0); #endif return 0; -} +} int gen_QUIT (void) @@ -677,7 +677,7 @@ gen_USR2 (void) handle_USR2 (0); #endif return 0; -} +} int gen_PWR (void) diff --git a/gdb/testsuite/gdb.reverse/ur1.c b/gdb/testsuite/gdb.reverse/ur1.c index 3b1bb5f9f5c..782f0d8cae9 100644 --- a/gdb/testsuite/gdb.reverse/ur1.c +++ b/gdb/testsuite/gdb.reverse/ur1.c @@ -22,7 +22,7 @@ simply as places to try setting breakpoints at. They are explicitly "one-line functions" to verify that this case works (some versions of gcc have or have had problems with this). - + These functions are in a separate source file to prevent an optimizing compiler from inlining them and optimizing them away. */ diff --git a/gdb/testsuite/gdb.stabs/exclfwd1.c b/gdb/testsuite/gdb.stabs/exclfwd1.c index 45fbd65b76b..23700ecb507 100644 --- a/gdb/testsuite/gdb.stabs/exclfwd1.c +++ b/gdb/testsuite/gdb.stabs/exclfwd1.c @@ -20,7 +20,7 @@ #include "exclfwd.h" -struct a +struct a { int x, y; }; diff --git a/gdb/testsuite/gdb.stabs/weird.exp b/gdb/testsuite/gdb.stabs/weird.exp index 3bc6e0d8ac9..0ea9fd9c623 100644 --- a/gdb/testsuite/gdb.stabs/weird.exp +++ b/gdb/testsuite/gdb.stabs/weird.exp @@ -188,7 +188,7 @@ field3 = 0x77888877\}" "print struct constant" gdb_test "p common0var0" "= 42" # GDB seems to only understand common blocks local to a function. - # These variables never get relocated to be relative to the common + # These variables never get relocated to be relative to the common # block. # I'm not sure whether it is valid to have a common block which # is not local to a function. @@ -203,7 +203,7 @@ proc print_weird_var { var } { # Make sure that the variable gets printed out correctly, without # any sort of warning message. - gdb_test_multiple "print $var" "variable $var printed property" { + gdb_test_multiple "print $var" "variable $var printed property" { -re "^print $var\r*\n.\[0-9\]* = 42.*$gdb_prompt $" { pass "variable $var printed properly" } diff --git a/gdb/testsuite/gdb.threads/linux-dp.c b/gdb/testsuite/gdb.threads/linux-dp.c index 6458920aa6e..1d771548edf 100644 --- a/gdb/testsuite/gdb.threads/linux-dp.c +++ b/gdb/testsuite/gdb.threads/linux-dp.c @@ -69,7 +69,7 @@ shared_printf (char *format, ...) va_end (ap); } -int +int shared_random () { int result; @@ -84,7 +84,7 @@ void my_usleep (long usecs) { struct timeval timeout; - + timeout.tv_sec = usecs / 1000000; timeout.tv_usec = usecs % 1000000; @@ -185,14 +185,14 @@ main (int argc, char **argv) philosophers = xmalloc (num_philosophers * sizeof (*philosophers)); pthread_attr_init (&ta); - + for (i = 0; i < num_philosophers; i++) { numbers[i] = i; /* linuxthreads.exp: create philosopher */ pthread_create (&philosophers[i], &ta, philosopher, &numbers[i]); } - + pthread_attr_destroy (&ta); } diff --git a/gdb/testsuite/gdb.threads/manythreads.c b/gdb/testsuite/gdb.threads/manythreads.c index 97a91de6b96..1d5c080db6b 100644 --- a/gdb/testsuite/gdb.threads/manythreads.c +++ b/gdb/testsuite/gdb.threads/manythreads.c @@ -1,7 +1,7 @@ /* Manythreads test program. Copyright 2004-2025 Free Software Foundation, Inc. - Written by Jeff Johnston + Written by Jeff Johnston Contributed by Red Hat This file is part of GDB. @@ -37,7 +37,7 @@ thread_function (void *arg) return NULL; } -int +int main (int argc, char **argv) { pthread_attr_t attr; @@ -53,7 +53,7 @@ main (int argc, char **argv) /* Create a ton of quick-executing threads, then wait for them to complete. */ - for (i = 0; i < 1000; ++i) + for (i = 0; i < 1000; ++i) { for (j = 0; j < 256; ++j) { diff --git a/gdb/testsuite/gdb.threads/multi-create.c b/gdb/testsuite/gdb.threads/multi-create.c index 2706f37efb2..1ac0a46230f 100644 --- a/gdb/testsuite/gdb.threads/multi-create.c +++ b/gdb/testsuite/gdb.threads/multi-create.c @@ -63,7 +63,7 @@ create_function (void *arg) return NULL; } -int +int main (int argc, char **argv) { pthread_attr_t attr; diff --git a/gdb/testsuite/gdb.threads/pthreads.c b/gdb/testsuite/gdb.threads/pthreads.c index f84f2731798..1909405aaf6 100644 --- a/gdb/testsuite/gdb.threads/pthreads.c +++ b/gdb/testsuite/gdb.threads/pthreads.c @@ -172,6 +172,6 @@ main (int argc, char **argv) sleep (1); t += j; } - + exit (0); } diff --git a/gdb/testsuite/gdb.threads/staticthreads.c b/gdb/testsuite/gdb.threads/staticthreads.c index 579f59dd78b..ef6b2bbae36 100644 --- a/gdb/testsuite/gdb.threads/staticthreads.c +++ b/gdb/testsuite/gdb.threads/staticthreads.c @@ -50,7 +50,7 @@ thread_function (void *arg) return NULL; } -int +int main (int argc, char **argv) { pthread_attr_t attr; diff --git a/gdb/testsuite/gdb.threads/switch-threads.c b/gdb/testsuite/gdb.threads/switch-threads.c index cfc670392f0..2da0bc30f0b 100644 --- a/gdb/testsuite/gdb.threads/switch-threads.c +++ b/gdb/testsuite/gdb.threads/switch-threads.c @@ -40,5 +40,5 @@ int main() pthread_create (&thr, NULL, thread_func, NULL); pthread_join (thr, &ret); for (x = 0; x < 10; x++) - foo (); + foo (); } diff --git a/gdb/testsuite/gdb.threads/threadapply.c b/gdb/testsuite/gdb.threads/threadapply.c index 5dccaa427e3..62c7639c4c9 100644 --- a/gdb/testsuite/gdb.threads/threadapply.c +++ b/gdb/testsuite/gdb.threads/threadapply.c @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . - + This file is copied from schedlock.c. */ #include @@ -58,9 +58,9 @@ int main() { all_started = 0; break; } - } + } } - + args[i] = 1; /* Break here */ thread_function ((void *) i); diff --git a/gdb/testsuite/gdb.threads/tls.c b/gdb/testsuite/gdb.threads/tls.c index 9a87e91baa2..ee333cb16c3 100644 --- a/gdb/testsuite/gdb.threads/tls.c +++ b/gdb/testsuite/gdb.threads/tls.c @@ -66,7 +66,7 @@ void print_error () default: fprintf (stderr, "Unknown error\n"); break; - } + } } /* Routine for each thread to run, does nothing. */ @@ -74,7 +74,7 @@ void *spin( void *vp ) { int me = (long) vp; int i; - + /* Use a_global. */ a_global++; @@ -113,7 +113,7 @@ void *spin( void *vp ) continue; } else - { + { fprintf (stderr, "th %d wait on sem tell_thread failed\n", me); print_error (); return NULL; @@ -145,7 +145,7 @@ do_pass() thread_local_val[i] = 0; another_thread_local_val[i] = 0; } - + if (sem_init (&tell_main, 0, 0) == -1) { fprintf (stderr, "tell_main semaphore init failed\n"); @@ -216,13 +216,13 @@ do_pass() { err = pthread_join(t[i], NULL ); if( err != 0 ) - { + { fprintf (stderr, "error in thread %d join\n", i ); } } i = 10; /* Null line for setting bpts on. */ - + } int diff --git a/gdb/testsuite/gdb.threads/watchthreads.c b/gdb/testsuite/gdb.threads/watchthreads.c index 0c2877d316d..d9e18891885 100644 --- a/gdb/testsuite/gdb.threads/watchthreads.c +++ b/gdb/testsuite/gdb.threads/watchthreads.c @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program. If not, see . - + This file is copied from schedlock.c. */ #include diff --git a/gdb/testsuite/gdb.trace/actions.c b/gdb/testsuite/gdb.trace/actions.c index 0ecae5962c9..03630aa01aa 100644 --- a/gdb/testsuite/gdb.trace/actions.c +++ b/gdb/testsuite/gdb.trace/actions.c @@ -54,12 +54,12 @@ void gdb_recursion_test (int, int, int, int, int, int, int); typedef void (*gdb_recursion_test_fp) (int, int, int, int, int, int, int); gdb_recursion_test_fp gdb_recursion_test_ptr = gdb_recursion_test; -void gdb_recursion_test (int depth, - int q1, - int q2, - int q3, - int q4, - int q5, +void gdb_recursion_test (int depth, + int q1, + int q2, + int q3, + int q4, + int q5, int q6) { /* gdb_recursion_test line 0 */ int q = q1; /* gdbtestline 1 */ @@ -86,13 +86,13 @@ unsigned long gdb_c_test( unsigned long *parm ) unsigned long *stack_ptr; unsigned long end_of_stack; - ridiculously_long_variable_name_with_equally_long_string_assignment = + ridiculously_long_variable_name_with_equally_long_string_assignment = "ridiculously long variable name with equally long string assignment"; local_static = 9; local_static_sizeof = sizeof (struct GDB_STRUCT_TEST); local_long = local_reg + 1; stack_ptr = (unsigned long *) &local_long; - end_of_stack = + end_of_stack = (unsigned long) &stack_ptr + sizeof(stack_ptr) + sizeof(end_of_stack) - 1; gdb_char_test = gdb_struct1_test.c = (char) ((long) parm[1] & 0xff); diff --git a/gdb/testsuite/gdb.trace/collection.c b/gdb/testsuite/gdb.trace/collection.c index 660d7c84fdb..1b6c97c6928 100644 --- a/gdb/testsuite/gdb.trace/collection.c +++ b/gdb/testsuite/gdb.trace/collection.c @@ -35,7 +35,7 @@ typedef struct TEST_STRUCT { typedef int test_array [4]; -/* +/* * Global variables to be collected */ @@ -61,7 +61,7 @@ struct global_pieces { * Additional globals used in arithmetic tests */ -signed char c0, c1, c2, c3, c4, c5, c6, c7, +signed char c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, c11, c12, c13, c14, c15, cminus; signed short s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14, s15, sminus; @@ -101,7 +101,7 @@ int args_test_func (argc, argi, argf, argd, argstruct, argarray) int argstruct_test_func (argstruct) test_struct argstruct; { - return (int) argstruct.memberc + argstruct.memberi + + return (int) argstruct.memberc + argstruct.memberi + argstruct.memberf + argstruct.memberd; } diff --git a/gdb/testsuite/gdb.trace/tspeed.c b/gdb/testsuite/gdb.trace/tspeed.c index edd90520a68..d05213fc02c 100644 --- a/gdb/testsuite/gdb.trace/tspeed.c +++ b/gdb/testsuite/gdb.trace/tspeed.c @@ -122,11 +122,11 @@ trace_speed_test (void) for (i = 0; i < iters; ++i) { globfoo2 *= 45; - globfoo2 += globfoo + globfoo3; - globfoo2 *= globfoo + globfoo3; - globfoo2 -= globarr[4] + globfoo3; - globfoo2 *= globfoo + globfoo3; - globfoo2 += globfoo + globfoo3; + globfoo2 += globfoo + globfoo3; + globfoo2 *= globfoo + globfoo3; + globfoo2 -= globarr[4] + globfoo3; + globfoo2 *= globfoo + globfoo3; + globfoo2 += globfoo + globfoo3; } now3 = myclock (); total1 = now3 - now2; @@ -137,10 +137,10 @@ trace_speed_test (void) { globfoo2 *= 45; globfoo2 += globfoo + globfoo3; /* set tracepoint here */ - globfoo2 *= globfoo + globfoo3; - globfoo2 -= globarr[4] + globfoo3; - globfoo2 *= globfoo + globfoo3; - globfoo2 += globfoo + globfoo3; + globfoo2 *= globfoo + globfoo3; + globfoo2 -= globarr[4] + globfoo3; + globfoo2 *= globfoo + globfoo3; + globfoo2 += globfoo + globfoo3; } now5 = myclock (); total2 = now5 - now4; diff --git a/gdb/testsuite/lib/ton.tcl b/gdb/testsuite/lib/ton.tcl index a9013b91ccf..6a1c9dbdf56 100644 --- a/gdb/testsuite/lib/ton.tcl +++ b/gdb/testsuite/lib/ton.tcl @@ -57,13 +57,13 @@ namespace eval ton { namespace export json2ton variable version 0.4 - + } proc ton::json2ton json { # Parse JSON string json # # return: TON - + set i [trr $json [string length $json]] if {!$i} {return ""} lassign [jscan $json $i] i ton @@ -75,7 +75,7 @@ proc ton::json2ton json { proc ton::trr {s i} { # Trim righthand whitespace on the first i characters of s. # return: number of remaining characters in s - + while {[set j $i] && ([string is space [set c [string index $s [incr i -1]]]] || $c eq "\n")} {} @@ -115,7 +115,7 @@ proc ton::num {json i c d} { # return list: # - remaining string length # - TON of number - + set float [expr {$c eq "."}] for {set j $i} {$i} {incr i -1} { if {[string match $d [set c [string index $json $i-1]]]} break @@ -152,7 +152,7 @@ proc ton::str {json i} { # return list: # - remaining string length # - TON of string - + for {set j $i} {$i} {incr i -1} { set i [string last \" $json $i] if {[string index $json $i-1] ne "\\"} break @@ -167,7 +167,7 @@ proc ton::arr {json i} { # return list: # - remaining string length # - TON of array - + set i [trr $json $i] if {!$i} { error "json string invalid:0: exhausted while parsing array." @@ -224,7 +224,7 @@ proc ton::obj {json i} { set i [trr $json $i] continue } elseif {$c eq "\{"} break - error "json string invalid:$i: parsing object." + error "json string invalid:$i: parsing object." } lappend r o return [list $i [join [lreverse $r]]] diff --git a/gdb/tilegx-tdep.c b/gdb/tilegx-tdep.c index a153f6542ee..c525644017d 100644 --- a/gdb/tilegx-tdep.c +++ b/gdb/tilegx-tdep.c @@ -456,9 +456,9 @@ tilegx_analyze_prologue (struct gdbarch* gdbarch, = (unsigned) reverse_frame[operands[1]].value; cache->saved_regs[saved_register].set_addr (saved_address); - } + } else if (cache - && (operands[0] == TILEGX_SP_REGNUM) + && (operands[0] == TILEGX_SP_REGNUM) && (operands[1] == TILEGX_LR_REGNUM)) lr_saved_on_stack_p = 1; break; diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 9b84fbe384a..6dc2f36c938 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -73,7 +73,7 @@ large. (400 - 31)/2 == 184 */ #define MAX_AGENT_EXPR_LEN 184 -/* +/* Tracepoint.c: This module defines the following debugger commands: @@ -486,8 +486,8 @@ save_trace_state_variables (struct ui_file *fp) /* ACTIONS functions: */ /* The three functions: - collect_pseudocommand, - while_stepping_pseudocommand, and + collect_pseudocommand, + while_stepping_pseudocommand, and end_actions_pseudocommand are placeholders for "commands" that are actually ONLY to be used within a tracepoint action list. If the actual function is ever called, @@ -1170,7 +1170,7 @@ collection_list::stringify () QUIT; /* Allow user to bail out with ^C. */ if (info_verbose) { - gdb_printf ("(%d, %s, %ld)\n", + gdb_printf ("(%d, %s, %ld)\n", m_memranges[i].type, paddress (current_inferior ()->arch (), m_memranges[i].start), @@ -1638,7 +1638,7 @@ start_tracing (const char *notes) /* Send down all the trace state variables too. */ for (const trace_state_variable &tsv : tvariables) target_download_trace_state_variable (tsv); - + /* Tell target to treat text-like sections as transparent. */ target_trace_set_readonly_regions (); /* Set some mode flags. */ @@ -1740,7 +1740,7 @@ tstatus_command (const char *args, int from_tty) { struct trace_status *ts = current_trace_status (); int status; - + status = target_get_trace_status (ts); if (status == -1) @@ -1963,7 +1963,7 @@ trace_status_mi (int on_stop) stopping_tracepoint = ts->stopping_tracepoint; break; } - + if (stop_reason) { uiout->field_string ("stop-reason", stop_reason); @@ -2083,7 +2083,7 @@ tfind_1 (enum trace_find_type type, int num, target_frameno = target_trace_find (type, num, addr1, addr2, &target_tracept); - + if (type == tfind_number && num == -1 && target_frameno == -1) @@ -2095,12 +2095,12 @@ tfind_1 (enum trace_find_type type, int num, /* A request for a non-existent trace frame has failed. Our response will be different, depending on FROM_TTY: - If FROM_TTY is true, meaning that this command was + If FROM_TTY is true, meaning that this command was typed interactively by the user, then give an error and DO NOT change the state of traceframe_number etc. However if FROM_TTY is false, meaning that we're either - in a script, a loop, or a user-defined command, then + in a script, a loop, or a user-defined command, then DON'T give an error, but DO change the state of traceframe_number etc. to invalid. @@ -2112,7 +2112,7 @@ tfind_1 (enum trace_find_type type, int num, failed WITHOUT aborting. This allows you to write scripts that search through the trace buffer until the end, and then continue on to do something else. */ - + if (from_tty) error (_("Target failed to find requested trace frame.")); else @@ -2126,7 +2126,7 @@ tfind_1 (enum trace_find_type type, int num, #endif } } - + tp = get_tracepoint_by_number_on_target (target_tracept); reinit_frame_cache (); @@ -2203,13 +2203,13 @@ check_trace_running (struct trace_status *status) error (_("May not look at trace frames while trace is running.")); } -/* trace_find_command takes a trace frame number n, - sends "QTFrame:" to the target, +/* trace_find_command takes a trace frame number n, + sends "QTFrame:" to the target, and accepts a reply that may contain several optional pieces of information: a frame number, a tracepoint number, and an indication of whether this is a trap frame or a stepping frame. - The minimal response is just "OK" (which indicates that the + The minimal response is just "OK" (which indicates that the target does not give us a frame number or a tracepoint number). Instead of that, the target may send us a string containing any combination of: @@ -2224,7 +2224,7 @@ tfind_command_1 (const char *args, int from_tty) int frameno = -1; check_trace_running (current_trace_status ()); - + if (args == 0 || *args == 0) { /* TFIND with no args means find NEXT trace frame. */ if (traceframe_number == -1) @@ -2238,7 +2238,7 @@ tfind_command_1 (const char *args, int from_tty) error (_("not debugging trace buffer")); else if (from_tty && traceframe_number == 0) error (_("already at start of trace buffer")); - + frameno = traceframe_number - 1; } /* A hack to work around eval's need for fp to have been collected. */ @@ -2323,7 +2323,7 @@ tfind_tracepoint_command (const char *args, int from_tty) This command will take a sourceline for argument, just like BREAK or TRACE (ie. anything that "decode_line_1" can handle). - With no argument, this command will find the next trace frame + With no argument, this command will find the next trace frame corresponding to a source line OTHER THAN THE CURRENT ONE. */ static void diff --git a/gdb/tramp-frame.c b/gdb/tramp-frame.c index 0e31ad37dae..5fea5bbbd69 100644 --- a/gdb/tramp-frame.c +++ b/gdb/tramp-frame.c @@ -159,7 +159,7 @@ frame_unwind_trampoline::sniff (const frame_info_ptr &this_frame, CORE_ADDR func; struct tramp_frame_cache *tramp_cache; - /* tausq/2004-12-12: We used to assume if pc has a name or is in a valid + /* tausq/2004-12-12: We used to assume if pc has a name or is in a valid section, then this is not a trampoline. However, this assumption is false on HPUX which has a signal trampoline that has a name; it can also be false when using an alternative signal stack. */ diff --git a/gdb/tui/tui-disasm.h b/gdb/tui/tui-disasm.h index 173cc8be57b..9ebcdf9b26c 100644 --- a/gdb/tui/tui-disasm.h +++ b/gdb/tui/tui-disasm.h @@ -1,7 +1,7 @@ /* Disassembly display. Copyright (C) 1998-2025 Free Software Foundation, Inc. - + Contributed by Hewlett-Packard Company. This file is part of GDB. diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c index 024fedd9955..0f83f74d4b5 100644 --- a/gdb/tui/tui-hooks.c +++ b/gdb/tui/tui-hooks.c @@ -142,7 +142,7 @@ tui_refresh_frame_and_register_information () static void tui_dummy_print_frame_info_listing_hook (struct symtab *s, int line, - int stopline, + int stopline, int noerror) { } diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c index 84cad9366d5..df10d369952 100644 --- a/gdb/tui/tui-io.c +++ b/gdb/tui/tui-io.c @@ -612,7 +612,7 @@ tui_redisplay_readline (void) prompt = ""; else prompt = rl_display_prompt; - + int c_pos = -1; int c_line = -1; WINDOW *w = tui_cmd_win ()->handle.get (); @@ -626,7 +626,7 @@ tui_redisplay_readline (void) for (int in = 0; in <= rl_end; in++) { unsigned char c; - + if (in == rl_point) { getyx (w, c_line, c_pos); diff --git a/gdb/tui/tui-regs.c b/gdb/tui/tui-regs.c index ac2757aa895..9b3e0a802ea 100644 --- a/gdb/tui/tui-regs.c +++ b/gdb/tui/tui-regs.c @@ -422,7 +422,7 @@ tui_register_info::rerender (WINDOW *handle, int field_width) to code that causes the compiler to generate an unused-value warning. */ (void) wstandout (handle); - + mvwaddnstr (handle, y, x, content.c_str (), field_width - 1); if (content.size () < field_width) waddstr (handle, n_spaces (field_width - content.size ())); diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c index b411d074ffe..724df450076 100644 --- a/gdb/tui/tui-win.c +++ b/gdb/tui/tui-win.c @@ -56,8 +56,8 @@ static void tui_scroll_forward_command (const char *, int); static void tui_scroll_backward_command (const char *, int); static void tui_scroll_left_command (const char *, int); static void tui_scroll_right_command (const char *, int); -static void parse_scrolling_args (const char *, - struct tui_win_info **, +static void parse_scrolling_args (const char *, + struct tui_win_info **, int *); @@ -145,7 +145,7 @@ static const char *tui_active_border_mode = "bold-standout"; static void show_tui_active_border_mode (struct ui_file *file, int from_tty, - struct cmd_list_element *c, + struct cmd_list_element *c, const char *value) { gdb_printf (file, _("\ @@ -155,9 +155,9 @@ The attribute mode to use for the active TUI window border is \"%s\".\n"), static const char *tui_border_mode = "normal"; static void -show_tui_border_mode (struct ui_file *file, +show_tui_border_mode (struct ui_file *file, int from_tty, - struct cmd_list_element *c, + struct cmd_list_element *c, const char *value) { gdb_printf (file, _("\ @@ -167,9 +167,9 @@ The attribute mode to use for the TUI window borders is \"%s\".\n"), static const char *tui_border_kind = "acs"; static void -show_tui_border_kind (struct ui_file *file, +show_tui_border_kind (struct ui_file *file, int from_tty, - struct cmd_list_element *c, + struct cmd_list_element *c, const char *value) { gdb_printf (file, _("The kind of border for TUI windows is \"%s\".\n"), @@ -499,7 +499,7 @@ tui_resize_all (void) { #ifdef HAVE_RESIZE_TERM resize_term (screenheight, screenwidth); -#endif +#endif /* Turn keypad off while we resize. */ keypad (tui_cmd_win ()->handle.get (), FALSE); tui_update_gdb_sizes (); @@ -1023,7 +1023,7 @@ tui_win_info::max_width () const } static void -parse_scrolling_args (const char *arg, +parse_scrolling_args (const char *arg, struct tui_win_info **win_to_scroll, int *num_to_scroll) { diff --git a/gdb/tui/tui-wingeneral.c b/gdb/tui/tui-wingeneral.c index de4ef52e6ce..b6cd430de7d 100644 --- a/gdb/tui/tui-wingeneral.c +++ b/gdb/tui/tui-wingeneral.c @@ -66,7 +66,7 @@ tui_win_info::refresh_window () /* Draw a border around the window. */ static void -box_win (struct tui_win_info *win_info, +box_win (struct tui_win_info *win_info, bool highlight_flag) { WINDOW *win; @@ -113,7 +113,7 @@ box_win (struct tui_win_info *win_info, void tui_unhighlight_win (struct tui_win_info *win_info) { - if (win_info != NULL + if (win_info != NULL && win_info->can_box () && win_info->handle != NULL) { diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index 01aee2f1788..1bae093732f 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -620,12 +620,12 @@ tui_is_window_visible (enum tui_win_type type) } bool -tui_get_command_dimension (unsigned int *width, +tui_get_command_dimension (unsigned int *width, unsigned int *height) { if (!tui_active || (tui_cmd_win () == NULL)) return false; - + *width = tui_cmd_win ()->width; *height = tui_cmd_win ()->height; return true; diff --git a/gdb/typeprint.c b/gdb/typeprint.c index 42fbf381c0b..1609e53a10e 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -282,7 +282,7 @@ typedef_hash_table::find_typedef (const struct type_print_options *flags, -/* Print a description of a type in the format of a +/* Print a description of a type in the format of a typedef for the current language. NEW is the new name for a type TYPE. */ @@ -491,7 +491,7 @@ whatis_exp (const char *exp, int show) type_print (real_type, "", gdb_stdout, -1); if (! full) gdb_printf (" (incomplete object)"); - gdb_printf (" */\n"); + gdb_printf (" */\n"); } current_language->print_type (type, "", gdb_stdout, show, 0, &flags); diff --git a/gdb/unittests/scoped_fd-selftests.c b/gdb/unittests/scoped_fd-selftests.c index da59a181f9a..58c1ffbee95 100644 --- a/gdb/unittests/scoped_fd-selftests.c +++ b/gdb/unittests/scoped_fd-selftests.c @@ -74,7 +74,7 @@ test_to_file () SELF_CHECK (sfd.get () >= 0); unlink (filename); - + gdb_file_up file = sfd.to_file ("rw"); SELF_CHECK (file != nullptr); SELF_CHECK (sfd.get () == -1); diff --git a/gdb/user-regs.h b/gdb/user-regs.h index 298ce3cb409..ca972990961 100644 --- a/gdb/user-regs.h +++ b/gdb/user-regs.h @@ -66,7 +66,7 @@ extern void user_reg_add_builtin (const char *name, const void *baton); /* Add a per-architecture frame register. */ -extern void user_reg_add (struct gdbarch *gdbarch, const char *name, +extern void user_reg_add (struct gdbarch *gdbarch, const char *name, user_reg_read_ftype *read, const void *baton); #endif /* GDB_USER_REGS_H */ diff --git a/gdb/utils.c b/gdb/utils.c index 57c739ee530..8f00badfd78 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -3203,7 +3203,7 @@ strcmp_iw_ordered (const char *string1, const char *string2) if (case_pass == case_sensitive_on) return 0; - + /* Otherwise the strings were equal in case insensitive way, make a more fine grained comparison in a case sensitive way. */ diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c index 0b77cf38d3f..c544fe18ff2 100644 --- a/gdb/v850-tdep.c +++ b/gdb/v850-tdep.c @@ -277,15 +277,15 @@ struct v850_gdbarch_tdep : gdbarch_tdep_base }; struct v850_frame_cache -{ +{ /* Base address. */ CORE_ADDR base; LONGEST sp_offset; CORE_ADDR pc; - + /* Flag showing that a frame has been created in the prologue code. */ int uses_fp; - + /* Saved registers. */ trad_frame_saved_reg *saved_regs; }; @@ -302,9 +302,9 @@ static const char * v850_register_name (struct gdbarch *gdbarch, int regnum) { static const char *v850_reg_names[] = - { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", - "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", - "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", + { "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", + "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", + "r16", "r17", "r18", "r19", "r20", "r21", "r22", "r23", "r24", "r25", "r26", "r27", "r28", "r29", "r30", "r31", "eipc", "eipsw", "fepc", "fepsw", "ecr", "psw", "sr6", "sr7", "sr8", "sr9", "sr10", "sr11", "sr12", "sr13", "sr14", "sr15", @@ -566,7 +566,7 @@ v850_use_struct_convention (struct gdbarch *gdbarch, struct type *type) } return 0; } - + /* The value is a union which contains at least one field which would be returned in registers according to these rules -> returned in register. */ @@ -903,7 +903,7 @@ v850_analyze_prologue (struct gdbarch *gdbarch, else if (insn == ((E_EP_REGNUM << 11) | 0x0000 | E_R1_REGNUM)) /* mov r1,ep */ ep_used = 0; - else if (((insn & 0x07ff) == (0x0760 | E_SP_REGNUM) + else if (((insn & 0x07ff) == (0x0760 | E_SP_REGNUM) || (pi->uses_fp && (insn & 0x07ff) == (0x0760 | E_FP_REGNUM))) && pifsr diff --git a/gdb/valarith.c b/gdb/valarith.c index 582fe6cc945..37fbaad96ec 100644 --- a/gdb/valarith.c +++ b/gdb/valarith.c @@ -39,7 +39,7 @@ static struct value *value_subscripted_rvalue (struct value *array, /* Given a pointer, return the size of its target. If the pointer type is void *, then return 1. If the target type is incomplete, then error out. - This isn't a general purpose function, but just a + This isn't a general purpose function, but just a helper for value_ptradd. */ static LONGEST @@ -59,7 +59,7 @@ find_size_for_pointer_math (struct type *ptr_type) else { const char *name; - + name = ptr_target->name (); if (name == NULL) error (_("Cannot perform pointer math on incomplete types, " @@ -117,7 +117,7 @@ value_ptrdiff (struct value *arg1, struct value *arg2) "an integer nor a pointer of the same type.")); sz = type_length_units (check_typedef (type1->target_type ())); - if (sz == 0) + if (sz == 0) { warning (_("Type size unknown, assuming 1. " "Try casting to a known type, or void *.")); @@ -308,7 +308,7 @@ binop_user_defined_p (enum exp_opcode op, } /* Check to see if argument is a structure. This is called so - we know whether to go ahead with the normal unop or look for a + we know whether to go ahead with the normal unop or look for a user defined function instead. For now, we do not overload the `&' operator. */ @@ -384,7 +384,7 @@ value_user_defined_op (struct value **argp, gdb::array_view args, } /* We know either arg1 or arg2 is a structure, so try to find the right - user defined function. Create an argument vector that calls + user defined function. Create an argument vector that calls arg1.operator @ (arg1,arg2) and return that value (where '@' is any binary operator which is legal for GNU C++). @@ -1202,11 +1202,11 @@ scalar_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) case BINOP_BITWISE_XOR: v = v1 ^ v2; break; - + case BINOP_EQUAL: v = v1 == v2; break; - + case BINOP_NOTEQUAL: v = v1 != v2; break; @@ -1494,7 +1494,7 @@ value_binop (struct value *arg1, struct value *arg2, enum exp_opcode op) /* Widen the scalar operand to a vector. */ struct value **v = t1_is_vec ? &arg2 : &arg1; struct type *t = t1_is_vec ? type2 : type1; - + if (t->code () != TYPE_CODE_FLT && t->code () != TYPE_CODE_DECFLOAT && !is_integral_type (t)) diff --git a/gdb/valops.c b/gdb/valops.c index fa87546770a..0be0288e6aa 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -45,7 +45,7 @@ /* Local functions. */ -static struct value *search_struct_field (const char *, struct value *, +static struct value *search_struct_field (const char *, struct value *, struct type *, int); static struct value *search_struct_method (const char *, struct value **, @@ -98,7 +98,7 @@ static struct value *cast_into_complex (struct type *, struct value *); bool overload_resolution = false; static void show_overload_resolution (struct ui_file *file, int from_tty, - struct cmd_list_element *c, + struct cmd_list_element *c, const char *value) { gdb_printf (file, _("Overload resolution in evaluating " @@ -428,7 +428,7 @@ value_cast (struct type *type, struct value *arg2) if (TYPE_IS_REFERENCE (check_typedef (type))) { /* We dereference type; then we recurse and finally - we generate value of the given reference. Nothing wrong with + we generate value of the given reference. Nothing wrong with that. */ struct type *t1 = check_typedef (type); struct type *dereftype = check_typedef (t1->target_type ()); @@ -439,7 +439,7 @@ value_cast (struct type *type, struct value *arg2) if (TYPE_IS_REFERENCE (check_typedef (arg2->type ()))) /* We deref the value and then do the cast. */ - return value_cast (type, coerce_ref (arg2)); + return value_cast (type, coerce_ref (arg2)); /* Strip typedefs / resolve stubs in order to get at the type's code/length, but remember the original type, to use as the @@ -455,7 +455,7 @@ value_cast (struct type *type, struct value *arg2) instead. */ gdb_assert (!TYPE_IS_REFERENCE (type)); - /* A cast to an undetermined-length array_type, such as + /* A cast to an undetermined-length array_type, such as (TYPE [])OBJECT, is treated like a cast to (TYPE [N])OBJECT, where N is sizeof(OBJECT)/sizeof(TYPE). */ if (code1 == TYPE_CODE_ARRAY) @@ -483,7 +483,7 @@ value_cast (struct type *type, struct value *arg2) low_bound, new_length + low_bound - 1); arg2->deprecated_set_type (create_array_type (alloc, - element_type, + element_type, range_type)); return arg2; } @@ -580,8 +580,8 @@ value_cast (struct type *type, struct value *arg2) return value_from_mpz (to_type, longest); } - else if (code1 == TYPE_CODE_PTR && (code2 == TYPE_CODE_INT - || code2 == TYPE_CODE_ENUM + else if (code1 == TYPE_CODE_PTR && (code2 == TYPE_CODE_INT + || code2 == TYPE_CODE_ENUM || code2 == TYPE_CODE_RANGE)) { /* type->length () is the length of a pointer, but we really @@ -1309,7 +1309,7 @@ value_assign (struct value *toval, struct value *fromval) default: break; } - + /* If the field does not entirely fill a LONGEST, then zero the sign bits. If the field is signed, and is negative, then sign extend. */ @@ -1320,7 +1320,7 @@ value_assign (struct value *toval, struct value *fromval) LONGEST valmask = (((ULONGEST) 1) << toval->bitsize ()) - 1; fieldval &= valmask; - if (!type->is_unsigned () + if (!type->is_unsigned () && (fieldval & (valmask ^ (valmask >> 1)))) fieldval |= ~valmask; @@ -2084,7 +2084,7 @@ struct_field_searcher::search (struct value *arg1, LONGEST offset, base_addr = arg1->address () + boffset; v2 = value_at_lazy (basetype, base_addr); - if (target_read_memory (base_addr, + if (target_read_memory (base_addr, v2->contents_raw ().data (), v2->type ()->length ()) != 0) error (_("virtual baseclass botch")); @@ -2227,14 +2227,14 @@ search_struct_method (const char *name, struct value **arg1p, TYPE_FN_FIELD_ARGS (f, j), *args)) { if (TYPE_FN_FIELD_VIRTUAL_P (f, j)) - return value_virtual_fn_field (arg1p, f, j, + return value_virtual_fn_field (arg1p, f, j, type, offset); - if (TYPE_FN_FIELD_STATIC_P (f, j) + if (TYPE_FN_FIELD_STATIC_P (f, j) && static_memfuncp) *static_memfuncp = 1; v = value_fn_field (arg1p, f, j, type, offset); if (v != NULL) - return v; + return v; } j--; } @@ -2673,7 +2673,7 @@ incomplete_type_hint (gdb::array_view args) non-standard coercions, 100 -> incompatible. If a method is being searched for, VALP will hold the value. - If a non-method is being searched for, SYMP will hold the symbol + If a non-method is being searched for, SYMP will hold the symbol for it. If a method is being searched for, and it is a static method, @@ -2697,7 +2697,7 @@ int find_overload_match (gdb::array_view args, const char *name, enum oload_search_type method, struct value **objp, struct symbol *fsym, - struct value **valp, struct symbol **symp, + struct value **valp, struct symbol **symp, int *staticp, const int no_adl, const enum noside noside) { @@ -3428,11 +3428,11 @@ value_aggregate_elt (struct type *curtype, const char *name, { case TYPE_CODE_STRUCT: case TYPE_CODE_UNION: - return value_struct_elt_for_reference (curtype, 0, curtype, + return value_struct_elt_for_reference (curtype, 0, curtype, name, expect_type, want_address, noside); case TYPE_CODE_NAMESPACE: - return value_namespace_elt (curtype, name, + return value_namespace_elt (curtype, name, want_address, noside); case TYPE_CODE_ENUM: @@ -3443,7 +3443,7 @@ value_aggregate_elt (struct type *curtype, const char *name, } } -/* Compares the two method/function types T1 and T2 for "equality" +/* Compares the two method/function types T1 and T2 for "equality" with respect to the methods' parameters. If the types of the two parameter lists are the same, returns 1; 0 otherwise. This comparison may ignore any artificial parameters in T1 if @@ -3548,7 +3548,7 @@ get_baseclass_offset (struct type *vt, struct type *cls, static struct value * value_struct_elt_for_reference (struct type *domain, int offset, struct type *curtype, const char *name, - struct type *intype, + struct type *intype, int want_address, enum noside noside) { @@ -3704,7 +3704,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, if (TYPE_FN_FIELD_STATIC_P (f, j)) { - struct symbol *s = + struct symbol *s = lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j), 0, SEARCH_FUNCTION_DOMAIN, 0).symbol; @@ -3735,7 +3735,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, } else { - struct symbol *s = + struct symbol *s = lookup_symbol (TYPE_FN_FIELD_PHYSNAME (f, j), 0, SEARCH_FUNCTION_DOMAIN, 0).symbol; @@ -3768,7 +3768,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, v = value_struct_elt_for_reference (domain, offset + base_offset, TYPE_BASECLASS (t, i), - name, intype, + name, intype, want_address, noside); if (v) return v; @@ -3778,7 +3778,7 @@ value_struct_elt_for_reference (struct type *domain, int offset, it up that way; this (frequently) works for types nested inside classes. */ - return value_maybe_namespace_elt (curtype, name, + return value_maybe_namespace_elt (curtype, name, want_address, noside); } @@ -3791,11 +3791,11 @@ value_namespace_elt (const struct type *curtype, enum noside noside) { struct value *retval = value_maybe_namespace_elt (curtype, name, - want_address, + want_address, noside); if (retval == NULL) - error (_("No symbol \"%s\" in namespace \"%s\"."), + error (_("No symbol \"%s\" in namespace \"%s\"."), name, curtype->name ()); return retval; @@ -3839,7 +3839,7 @@ value_maybe_namespace_elt (const struct type *curtype, and refer to the values computed for the object pointed to. */ struct type * -value_rtti_indirect_type (struct value *v, int *full, +value_rtti_indirect_type (struct value *v, int *full, LONGEST *top, int *using_enc) { struct value *target = NULL; @@ -3905,8 +3905,8 @@ value_rtti_indirect_type (struct value *v, int *full, NULL if they're not available. */ struct value * -value_full_object (struct value *argp, - struct type *rtype, +value_full_object (struct value *argp, + struct type *rtype, int xfull, int xtop, int xusing_enc) { @@ -3951,7 +3951,7 @@ value_full_object (struct value *argp, if (argp->lval () != lval_memory) { warning (_("Couldn't retrieve complete object of RTTI " - "type %s; object may be in register(s)."), + "type %s; object may be in register(s)."), real_type->name ()); return argp; @@ -4151,8 +4151,8 @@ cast_into_complex (struct type *type, struct value *val) } else if (val->type ()->code () == TYPE_CODE_FLT || val->type ()->code () == TYPE_CODE_INT) - return value_literal_complex (val, - value::zero (real_type, not_lval), + return value_literal_complex (val, + value::zero (real_type, not_lval), type); else error (_("cannot cast non-number to complex")); @@ -4163,7 +4163,7 @@ INIT_GDB_FILE (valops) add_setshow_boolean_cmd ("overload-resolution", class_support, &overload_resolution, _("\ Set overload resolution in evaluating C++ functions."), _("\ -Show overload resolution in evaluating C++ functions."), +Show overload resolution in evaluating C++ functions."), NULL, NULL, show_overload_resolution, &setlist, &showlist); diff --git a/gdb/valprint.c b/gdb/valprint.c index b8c1c06ec87..91f225c4e60 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -141,7 +141,7 @@ get_user_print_options (struct value_print_options *opts) pretty-formatting disabled. */ void get_no_prettyformat_print_options (struct value_print_options *opts) -{ +{ *opts = user_print_options; opts->prettyformat = Val_no_prettyformat; } @@ -1381,15 +1381,15 @@ value_print_scalar_formatted (struct value *val, } /* Print a number according to FORMAT which is one of d,u,x,o,b,h,w,g. - The raison d'etre of this function is to consolidate printing of - LONG_LONG's into this one function. The format chars b,h,w,g are + The raison d'etre of this function is to consolidate printing of + LONG_LONG's into this one function. The format chars b,h,w,g are from print_scalar_formatted(). Numbers are printed using C format. - USE_C_FORMAT means to use C format in all cases. Without it, + USE_C_FORMAT means to use C format in all cases. Without it, 'o' and 'x' format do not include the standard C radix prefix - (leading 0 or 0x). - + (leading 0 or 0x). + Hilfinger/2004-09-09: USE_C_FORMAT was originally called USE_LOCAL and was intended to request formatting according to the current language and would be used for most integers that GDB prints. The @@ -1426,7 +1426,7 @@ print_longest (struct ui_file *stream, int format, int use_c_format, val = int_string (val_long, 8, 0, 0, use_c_format); break; default: internal_error (_("failed internal consistency check")); - } + } gdb_puts (val, stream); } @@ -1991,14 +1991,14 @@ print_function_pointer_address (const struct value_print_options *options, /* Print on STREAM using the given OPTIONS the index for the element at INDEX of an array whose index type is INDEX_TYPE. */ - -void + +void maybe_print_array_index (struct type *index_type, LONGEST index, struct ui_file *stream, const struct value_print_options *options) { if (!options->print_array_indexes) - return; + return; current_language->print_array_index (index_type, index, stream, options); } @@ -2601,8 +2601,8 @@ print_converted_chars_to_obstack (struct obstack *obstack, omitted. */ void -generic_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, +generic_printstr (struct ui_file *stream, struct type *type, + const gdb_byte *string, unsigned int length, const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options) diff --git a/gdb/valprint.h b/gdb/valprint.h index dd355865b65..04d510072c4 100644 --- a/gdb/valprint.h +++ b/gdb/valprint.h @@ -260,8 +260,8 @@ extern void generic_value_print (struct value *val, struct ui_file *stream, extern void generic_emit_char (int c, struct type *type, struct ui_file *stream, int quoter, const char *encoding); -extern void generic_printstr (struct ui_file *stream, struct type *type, - const gdb_byte *string, unsigned int length, +extern void generic_printstr (struct ui_file *stream, struct type *type, + const gdb_byte *string, unsigned int length, const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options); diff --git a/gdb/value.c b/gdb/value.c index c78bb98cb7e..ea24275c4f6 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -3734,7 +3734,7 @@ value_from_history_ref (const char *h, const char **endp) { if (len == 2) { - /* For some bizarre reason, "$$" is equivalent to "$$1", + /* For some bizarre reason, "$$" is equivalent to "$$1", rather than to "$$0" as it ought to be! */ index = -1; *endp += len; diff --git a/gdb/value.h b/gdb/value.h index b9d2809bead..67c12a9ac62 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -167,7 +167,7 @@ public: type *type = nullptr); /* Same as `allocate_register_lazy`, but make the value non-lazy. - + The caller is responsible for filling the value's contents. */ static struct value *allocate_register (const frame_info_ptr &next_frame, int regnum, type *type = nullptr); diff --git a/gdb/varobj.c b/gdb/varobj.c index 4dc986aafb5..6cfb536aead 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -305,7 +305,7 @@ varobj_create (const char *objname, innermost_block_tracker tracker (INNERMOST_BLOCK_FOR_SYMBOLS | INNERMOST_BLOCK_FOR_REGISTERS); - /* Wrap the call to parse expression, so we can + /* Wrap the call to parse expression, so we can return a sensible error. */ try { @@ -339,7 +339,7 @@ varobj_create (const char *objname, /* For a root var, the name and the expr are the same. */ var->path_expr = expression; - /* When the frame is different from the current frame, + /* When the frame is different from the current frame, we must select the appropriate frame before parsing the expression, otherwise the value will not be current. Since select_frame is so benign, just call it for all cases. */ @@ -355,7 +355,7 @@ varobj_create (const char *objname, var->root->frame = get_frame_id (fi); var->root->thread_id = inferior_thread ()->global_num; old_id = get_frame_id (get_selected_frame (NULL)); - select_frame (fi); + select_frame (fi); } /* We definitely need to catch errors here. If evaluation of @@ -484,7 +484,7 @@ varobj_set_display_format (struct varobj *var, { var->format = format; - if (varobj_value_is_changeable_p (var) + if (varobj_value_is_changeable_p (var) && var->value != nullptr && !var->value->lazy ()) { var->print_value = varobj_value_get_print_value (var->value.get (), @@ -1049,7 +1049,7 @@ install_default_visualizer (struct varobj *var) if (pretty_printer == Py_None) pretty_printer.reset (nullptr); - + install_visualizer (var->dynamic, NULL, pretty_printer.release ()); } } @@ -1157,7 +1157,7 @@ update_type_if_necessary (struct varobj *var, struct value *new_value) /* Assign a new value to a variable object. If INITIAL is true, this is the first assignment after the variable object was just - created, or changed type. In that case, just assign the value + created, or changed type. In that case, just assign the value and return false. Otherwise, assign the new value, and return true if the value is different from the current one, false otherwise. The comparison is @@ -1170,7 +1170,7 @@ update_type_if_necessary (struct varobj *var, struct value *new_value) take care of releasing it when needed. */ static bool install_new_value (struct varobj *var, struct value *value, bool initial) -{ +{ bool changeable; bool need_to_fetch; bool changed = false; @@ -1361,7 +1361,7 @@ varobj_set_child_range (struct varobj *var, int from, int to) var->to = to; } -void +void varobj_set_visualizer (struct varobj *var, const char *visualizer) { #if HAVE_PYTHON @@ -1437,7 +1437,7 @@ varobj_value_has_mutated (const struct varobj *var, struct value *new_value, changed. The IS_EXPLICIT parameter specifies if this call is result - of MI request to update this specific variable, or + of MI request to update this specific variable, or result of implicit -var-update *. For implicit request, we don't update frozen variables. @@ -1473,7 +1473,7 @@ varobj_update (struct varobj **varp, bool is_explicit) /* Update the root variable. value_of_root can return NULL if the variable is no longer around, i.e. we stepped out of - the frame in which a local existed. We are letting the + the frame in which a local existed. We are letting the value_of_root variable dispose of the varobj if the type has changed. */ newobj = value_of_root (varp, &type_changed); @@ -1483,7 +1483,7 @@ varobj_update (struct varobj **varp, bool is_explicit) r.type_changed = type_changed; if (install_new_value ((*varp), newobj, type_changed)) r.changed = true; - + if (newobj == NULL) r.status = VAROBJ_NOT_IN_SCOPE; r.value_installed = true; @@ -1676,7 +1676,7 @@ delete_variable_1 (int *delcountp, struct varobj *var, bool only_children_p, { /* Delete any children of this variable, too. */ for (varobj *child : var->children) - { + { if (!child) continue; @@ -1700,7 +1700,7 @@ delete_variable_1 (int *delcountp, struct varobj *var, bool only_children_p, } /* If this variable has a parent, remove it from its parent's list. */ - /* OPTIMIZATION: if the parent of this variable is also being deleted, + /* OPTIMIZATION: if the parent of this variable is also being deleted, (as indicated by remove_from_parent_p) we don't bother doing an expensive list search to find the element to remove when we are discarding the list afterwards. */ @@ -1934,7 +1934,7 @@ value_of_root_1 (struct varobj **var_handle) struct value *new_val = NULL; struct varobj *var = *var_handle; bool within_scope = false; - + /* Only root variables can be updated... */ if (!is_root_p (var)) /* Not a root var. */ @@ -1951,7 +1951,7 @@ value_of_root_1 (struct varobj **var_handle) created. Technically, it's possible that the program became multi-threaded since then, but we don't support such scenario yet. */ - within_scope = check_scope (var); + within_scope = check_scope (var); } else { @@ -1988,7 +1988,7 @@ value_of_root_1 (struct varobj **var_handle) - *type_changed will be set to 1 - old varobj will be freed, and new one will be created, with the same name. - - *var_handle will be set to the new varobj + - *var_handle will be set to the new varobj Otherwise, *type_changed will be set to 0. */ static struct value * value_of_root (struct varobj **var_handle, bool *type_changed) @@ -2350,7 +2350,7 @@ varobj_re_set_iter (struct varobj *var) /* See varobj.h. */ -void +void varobj_re_set (void) { all_root_varobjs (varobj_re_set_iter); diff --git a/gdb/varobj.h b/gdb/varobj.h index 00e776f1fa9..558efadcf78 100644 --- a/gdb/varobj.h +++ b/gdb/varobj.h @@ -120,7 +120,7 @@ struct varobj /* The value of this expression or subexpression. A NULL value indicates there was an error getting this value. - Invariant: if varobj_value_is_changeable_p (this) is non-zero, + Invariant: if varobj_value_is_changeable_p (this) is non-zero, the value is either NULL, or not lazy. */ value_ref_ptr value; @@ -147,7 +147,7 @@ struct varobj std::string print_value; /* Is this variable frozen. Frozen variables are never implicitly - updated by -var-update * + updated by -var-update * or -var-update . */ bool frozen = false; diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c index e6571c71976..f77b21cef93 100644 --- a/gdb/windows-tdep.c +++ b/gdb/windows-tdep.c @@ -474,7 +474,7 @@ display_one_tib (ptid_t ptid) tib_size = FULL_TIB_SIZE; max = tib_size / size; } - + tib = (gdb_byte *) alloca (tib_size); if (!target_get_tib_address (ptid, &thread_local_base)) @@ -489,7 +489,7 @@ display_one_tib (ptid_t ptid) { gdb_printf (_("Unable to read thread information " "block for %s at address %s\n"), - target_pid_to_str (ptid).c_str (), + target_pid_to_str (ptid).c_str (), paddress (current_inferior ()->arch (), thread_local_base)); return -1; } @@ -500,7 +500,7 @@ display_one_tib (ptid_t ptid) index = (gdb_byte *) tib; - /* All fields have the size of a pointer, this allows to iterate + /* All fields have the size of a pointer, this allows to iterate using the same for loop for both layouts. */ for (i = 0; i < max; i++) { @@ -511,8 +511,8 @@ display_one_tib (ptid_t ptid) gdb_printf (_("TIB[0x%s] is 0x%s\n"), phex (i * size, 2), phex (val, size)); index += size; - } - return 1; + } + return 1; } /* Display thread information block of the current thread. */ diff --git a/gdb/x86-nat.h b/gdb/x86-nat.h index 619721851b3..02663c52d4b 100644 --- a/gdb/x86-nat.h +++ b/gdb/x86-nat.h @@ -31,7 +31,7 @@ /* Use this function to set x86_dr_low debug_register_length field rather than setting it directly to check that the length is only - set once. It also enables the 'maint set/show show-debug-regs' + set once. It also enables the 'maint set/show show-debug-regs' command. */ extern void x86_set_debug_register_length (int len); diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index d8b99a05911..7ce06a2a4ef 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -378,7 +378,7 @@ add_stab_to_list (char *stabname, struct pending_stabs **stabvector) static foo2() 40 0x700 50 0x800 - 60 0x900 + 60 0x900 and that breaks gdb's binary search on line numbers, if the above table is not sorted on line numbers. And that sort @@ -472,7 +472,7 @@ arrange_linetable (std::vector &old_linetable) old_linetable = std::move (new_linetable); } -/* include file support: C_BINCL/C_EINCL pairs will be kept in the +/* include file support: C_BINCL/C_EINCL pairs will be kept in the following `IncludeChain'. At the end of each symtab (end_compunit_symtab), we will determine if we should create additional symtab's to represent if (the include files. */ @@ -732,7 +732,7 @@ aix_process_linenos (struct objfile *objfile) can be called in the following two ways: enter_line_range (subfile, beginoffset, endoffset, startaddr, 0, firstLine) or - enter_line_range (subfile, beginoffset, 0, + enter_line_range (subfile, beginoffset, 0, startaddr, endaddr, firstLine) endoffset points to the last line table entry that we should pay @@ -1371,7 +1371,7 @@ read_xcoff_symtab (struct objfile *objfile, legacy_psymtab *pst) /* beginning of include file */ /* In xlc output, C_BINCL/C_EINCL pair doesn't show up in sorted order. Thus, when we see them, we might not know enough info - to process them. Thus, we'll be saving them into a table + to process them. Thus, we'll be saving them into a table (inclTable) and postpone their processing. */ record_include_begin (cs); @@ -2167,7 +2167,7 @@ scan_xcoff_symtab (minimal_symbol_reader &reader, } /* Activate the misc_func_recorded mechanism for compiler- and linker-generated CSECTs like ".strcmp" - and "@FIX1". */ + and "@FIX1". */ if (namestring && (namestring[0] == '.' || namestring[0] == '@')) { @@ -2771,7 +2771,7 @@ xcoff_get_toc_offset (struct objfile *objfile) } /* Scan and build partial symbols for a symbol file. - We have been initialized by a call to dbx_symfile_init, which + We have been initialized by a call to dbx_symfile_init, which put all the relevant info into a "struct dbx_symfile_info", hung off the objfile structure. diff --git a/gdb/xml-syscall.c b/gdb/xml-syscall.c index b58fe5d0d2f..3640fd386f5 100644 --- a/gdb/xml-syscall.c +++ b/gdb/xml-syscall.c @@ -308,7 +308,7 @@ syscall_parse_xml (const char *document, xml_fetch_another fetcher) /* Function responsible for initializing the information about the syscalls. It reads the XML file and fills the struct syscalls_info with the values. - + Returns the struct syscalls_info if the file is valid, NULL otherwise. */ static struct syscalls_info * xml_init_syscalls_info (const char *filename) diff --git a/gdb/xml-syscall.h b/gdb/xml-syscall.h index 77ff9280a44..543840144d2 100644 --- a/gdb/xml-syscall.h +++ b/gdb/xml-syscall.h @@ -24,7 +24,7 @@ /* Function used to set the name of the file which contains information about the system calls present in the current architecture. - + This function *should* be called before anything else, otherwise GDB won't be able to find the correct XML file to open and get the syscalls definitions. */ diff --git a/gdb/xml-tdesc.c b/gdb/xml-tdesc.c index 2f213dc973d..06a53fcbcd8 100644 --- a/gdb/xml-tdesc.c +++ b/gdb/xml-tdesc.c @@ -578,7 +578,7 @@ static const struct gdb_xml_element feature_children[] = { tdesc_start_union, NULL }, { "flags", flags_attributes, struct_union_children, GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE, - tdesc_start_flags, NULL }, + tdesc_start_flags, NULL }, { "enum", enum_attributes, enum_children, GDB_XML_EF_OPTIONAL | GDB_XML_EF_REPEATABLE, tdesc_start_enum, NULL }, diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c index 64aa16f5a13..819c54ba4ba 100644 --- a/gdb/xstormy16-tdep.c +++ b/gdb/xstormy16-tdep.c @@ -133,18 +133,18 @@ xstormy16_type_is_scalar (struct type *t) && t->code () != TYPE_CODE_ARRAY); } -/* Function: xstormy16_use_struct_convention +/* Function: xstormy16_use_struct_convention Returns non-zero if the given struct type will be returned using a special convention, rather than the normal function return method. 7sed in the contexts of the "return" command, and of - target function calls from the debugger. */ + target function calls from the debugger. */ static int xstormy16_use_struct_convention (struct type *type) { return !xstormy16_type_is_scalar (type) || type->length () > E_MAX_RETTYPE_SIZE_IN_REGS; -} +} /* Function: xstormy16_extract_return_value Find a function's return value in the appropriate registers (in @@ -163,15 +163,15 @@ xstormy16_extract_return_value (struct type *type, struct regcache *regcache, /* Function: xstormy16_store_return_value Copy the function return value from VALBUF into the - proper location for a function return. + proper location for a function return. Called only in the context of the "return" command. */ -static void +static void xstormy16_store_return_value (struct type *type, struct regcache *regcache, const gdb_byte *valbuf) { if (type->length () == 1) - { + { /* Add leading zeros to the value. */ gdb_byte buf[xstormy16_reg_size]; memset (buf, 0, xstormy16_reg_size); @@ -368,7 +368,7 @@ xstormy16_analyze_prologue (struct gdbarch *gdbarch, ; /* Optional copying of args in r2-r7 to stack. */ - /* 72DS HHHH mov.b (rD, 0xHHHH), r(S-8) + /* 72DS HHHH mov.b (rD, 0xHHHH), r(S-8) (bit3 always 1, bit2-0 = reg) */ /* 73DS HHHH mov.w (rD, 0xHHHH), r(S-8) */ else if ((inst & 0xfed8) == 0x72d8 && (inst & 0x0007) >= 2) @@ -392,11 +392,11 @@ xstormy16_analyze_prologue (struct gdbarch *gdbarch, } /* Function: xstormy16_skip_prologue - If the input address is in a function prologue, + If the input address is in a function prologue, returns the address of the end of the prologue; else returns the input address. - Note: the input address is likely to be the function start, + Note: the input address is likely to be the function start, since this function is mainly used for advancing a breakpoint to the first line, or stepping to the first line when we have stepped into a function call. */ diff --git a/gdb/xtensa-linux-nat.c b/gdb/xtensa-linux-nat.c index 4a50f387c2f..cf16c93b94a 100644 --- a/gdb/xtensa-linux-nat.c +++ b/gdb/xtensa-linux-nat.c @@ -190,7 +190,7 @@ fill_fpregset (const struct regcache *regcache, return; } -void +void supply_fpregset (struct regcache *regcache, const gdb_fpregset_t *fpregsetp) { @@ -205,17 +205,17 @@ fetch_gregs (struct regcache *regcache, int regnum) { int tid = regcache->ptid ().lwp (); gdb_gregset_t regs; - + if (ptrace (PTRACE_GETREGS, tid, 0, (long) ®s) < 0) { perror_with_name (_("Couldn't get registers")); return; } - + supply_gregset_reg (regcache, ®s, regnum); } -/* Store greg-register(s) in GDB's register +/* Store greg-register(s) in GDB's register array into the process/thread specified by TID. */ static void diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index 19bec106364..88ad81511c6 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -155,7 +155,7 @@ areg_number (struct gdbarch *gdbarch, int ar_regnum, unsigned int wb) return (areg > 15) ? -1 : areg; } -/* Read Xtensa register directly from the hardware. */ +/* Read Xtensa register directly from the hardware. */ static unsigned long xtensa_read_register (int regnum) { @@ -166,7 +166,7 @@ xtensa_read_register (int regnum) return (unsigned long) value; } -/* Write Xtensa register directly to the hardware. */ +/* Write Xtensa register directly to the hardware. */ static void xtensa_write_register (int regnum, ULONGEST value) { @@ -564,7 +564,7 @@ xtensa_pseudo_register_read (struct gdbarch *gdbarch, /* We have to find out how to deal with privileged registers. Let's treat them as pseudo-registers, but we cannot read/write them. */ - + else if (tdep->call_abi == CallAbiCall0Only || regnum < tdep->a0_base) { @@ -740,7 +740,7 @@ xtensa_add_reggroups (struct gdbarch *gdbarch) reggroup_add (gdbarch, xtensa_cp[i]); } -static int +static int xtensa_coprocessor_register_group (const struct reggroup *group) { int i; @@ -919,7 +919,7 @@ typedef struct xtensa_windowed_frame_cache A-register where the current content of the reg came from (in terms of an original reg and a constant). Negative values of c0_rt[n].fp_reg mean that the original content of the register was saved to the stack. - c0_rt[n].fr.ofs is NOT the offset from the frame base because we don't + c0_rt[n].fr.ofs is NOT the offset from the frame base because we don't know where SP will end up until the entire prologue has been analyzed. */ #define C0_CONST -1 /* fr_reg value if register contains a constant. */ @@ -948,11 +948,11 @@ typedef struct xtensa_call0_frame_cache pointer. It's an AND mask. Zero, if alignment was not adjusted. */ int c0_old_sp; /* In case of dynamic adjustment, it is - a register holding unaligned sp. + a register holding unaligned sp. C0_INEXP, when undefined. */ int c0_sp_ofs; /* If "c0_old_sp" was spilled it's a stack offset. C0_NOSTK otherwise. */ - + xtensa_c0reg_t c0_rt[C0_NREGS]; /* Register tracking information. */ } xtensa_call0_frame_cache_t; @@ -1031,7 +1031,7 @@ xtensa_unwind_pc (struct gdbarch *gdbarch, const frame_info_ptr &next_frame) gdb_byte buf[8]; CORE_ADDR pc; - DEBUGTRACE ("xtensa_unwind_pc (next_frame = %s)\n", + DEBUGTRACE ("xtensa_unwind_pc (next_frame = %s)\n", host_address_to_string (next_frame.get ())); frame_unwind_register (next_frame, gdbarch_pc_regnum (gdbarch), buf); @@ -1145,16 +1145,16 @@ xtensa_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR current_pc) islots = xtensa_format_num_slots (isa, ifmt); if (islots == XTENSA_UNDEFINED) RETURN_FP; - + for (is = 0; is < islots; ++is) { if (xtensa_format_get_slot (isa, ifmt, is, ins, slot)) RETURN_FP; - + opc = xtensa_opcode_decode (isa, ifmt, is, slot); - if (opc == XTENSA_UNDEFINED) + if (opc == XTENSA_UNDEFINED) RETURN_FP; - + opcname = xtensa_opcode_name (isa, opc); if (strcasecmp (opcname, "mov.n") == 0 @@ -1165,14 +1165,14 @@ xtensa_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR current_pc) /* Possible candidate for setting frame pointer from A1. This is what we are looking for. */ - if (xtensa_operand_get_field (isa, opc, 1, ifmt, + if (xtensa_operand_get_field (isa, opc, 1, ifmt, is, slot, ®ister_operand) != 0) RETURN_FP; if (xtensa_operand_decode (isa, opc, 1, ®ister_operand) != 0) RETURN_FP; if (register_operand == 1) /* Mov{.n} FP A1. */ { - if (xtensa_operand_get_field (isa, opc, 0, ifmt, is, slot, + if (xtensa_operand_get_field (isa, opc, 0, ifmt, is, slot, ®ister_operand) != 0) RETURN_FP; if (xtensa_operand_decode (isa, opc, 0, @@ -1187,7 +1187,7 @@ xtensa_scan_prologue (struct gdbarch *gdbarch, CORE_ADDR current_pc) if ( /* We have problems decoding the memory. */ - opcname == NULL + opcname == NULL || strcasecmp (opcname, "ill") == 0 || strcasecmp (opcname, "ill.n") == 0 /* Hit planted breakpoint. */ @@ -1210,7 +1210,7 @@ done: return fp_regnum; } -/* The key values to identify the frame using "cache" are +/* The key values to identify the frame using "cache" are cache->base = SP (or best guess about FP) of this frame; cache->pc = entry-PC (entry point of the frame function); @@ -1255,7 +1255,7 @@ xtensa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) xtensa_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); /* Get WINDOWBASE, WINDOWSTART, and PS registers. */ - wb = get_frame_register_unsigned (this_frame, + wb = get_frame_register_unsigned (this_frame, tdep->wb_regnum); ws = get_frame_register_unsigned (this_frame, tdep->ws_regnum); @@ -1266,7 +1266,7 @@ xtensa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) int callinc = CALLINC (ps); ra = get_frame_register_unsigned (this_frame, tdep->a0_base + callinc * 4); - + /* ENTRY hasn't been executed yet, therefore callsize is still 0. */ cache->wd.callsize = 0; cache->wd.wb = wb; @@ -1310,7 +1310,7 @@ xtensa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) /* Set A0...A3. */ sp = get_frame_register_unsigned (this_frame, tdep->a0_base + 1) - 16; - + for (i = 0; i < 4; i++, sp += 4) { cache->wd.aregs[i] = sp; @@ -1365,7 +1365,7 @@ xtensa_frame_cache (const frame_info_ptr &this_frame, void **this_cache) } else /* Call0 framework. */ { - call0_frame_cache (this_frame, cache, pc); + call0_frame_cache (this_frame, cache, pc); fp_regnum = cache->c0.fp_regnum; } @@ -1600,7 +1600,7 @@ xtensa_store_return_value (struct type *type, xtensa_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); if (tdep->call_abi != CallAbiCall0Only) { - regcache_raw_read_unsigned + regcache_raw_read_unsigned (regcache, tdep->wb_regnum, &wb); regcache_raw_read_unsigned (regcache, gdbarch_pc_regnum (gdbarch), &pc); callsize = extract_call_winsize (gdbarch, pc); @@ -1978,7 +1978,7 @@ xtensa_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size) /* Call0 ABI support routines. */ -/* Return true, if PC points to "ret" or "ret.n". */ +/* Return true, if PC points to "ret" or "ret.n". */ static int call0_ret (CORE_ADDR start_pc, CORE_ADDR finish_pc) @@ -2021,18 +2021,18 @@ call0_ret (CORE_ADDR start_pc, CORE_ADDR finish_pc) islots = xtensa_format_num_slots (isa, ifmt); if (islots == XTENSA_UNDEFINED) RETURN_RET; - + for (is = 0; is < islots; ++is) { if (xtensa_format_get_slot (isa, ifmt, is, ins, slot)) RETURN_RET; - + opc = xtensa_opcode_decode (isa, ifmt, is, slot); - if (opc == XTENSA_UNDEFINED) + if (opc == XTENSA_UNDEFINED) RETURN_RET; - + opcname = xtensa_opcode_name (isa, opc); - + if ((strcasecmp (opcname, "ret.n") == 0) || (strcasecmp (opcname, "ret") == 0)) { @@ -2049,7 +2049,7 @@ call0_ret (CORE_ADDR start_pc, CORE_ADDR finish_pc) /* Call0 opcode class. Opcodes are preclassified according to what they mean for Call0 prologue analysis, and their number of significant operands. - The purpose of this is to simplify prologue analysis by separating + The purpose of this is to simplify prologue analysis by separating instruction decoding (libisa) from the semantics of prologue analysis. */ enum xtensa_insn_kind @@ -2081,7 +2081,7 @@ static int rwx_special_register (const char *opcname) { char ch = *opcname++; - + if ((ch != 'r') && (ch != 'w') && (ch != 'x')) return 0; if (*opcname++ != 's') @@ -2108,7 +2108,7 @@ call0_classify_opcode (xtensa_isa isa, xtensa_opcode opc) opcname = xtensa_opcode_name (isa, opc); - if (opcname == NULL + if (opcname == NULL || strcasecmp (opcname, "ill") == 0 || strcasecmp (opcname, "ill.n") == 0) opclass = c0opc_illegal; @@ -2130,12 +2130,12 @@ call0_classify_opcode (xtensa_isa isa, xtensa_opcode opc) opclass = c0opc_flow; /* Also, classify specific opcodes that need to be tracked. */ - else if (strcasecmp (opcname, "add") == 0 + else if (strcasecmp (opcname, "add") == 0 || strcasecmp (opcname, "add.n") == 0) opclass = c0opc_add; else if (strcasecmp (opcname, "and") == 0) opclass = c0opc_and; - else if (strcasecmp (opcname, "addi") == 0 + else if (strcasecmp (opcname, "addi") == 0 || strcasecmp (opcname, "addi.n") == 0 || strcasecmp (opcname, "addmi") == 0) opclass = c0opc_addi; @@ -2144,12 +2144,12 @@ call0_classify_opcode (xtensa_isa isa, xtensa_opcode opc) else if (strcasecmp (opcname, "mov.n") == 0 || strcasecmp (opcname, "or") == 0) /* Could be 'mov' asm macro. */ opclass = c0opc_mov; - else if (strcasecmp (opcname, "movi") == 0 + else if (strcasecmp (opcname, "movi") == 0 || strcasecmp (opcname, "movi.n") == 0) opclass = c0opc_movi; else if (strcasecmp (opcname, "l32r") == 0) opclass = c0opc_l32r; - else if (strcasecmp (opcname, "s32i") == 0 + else if (strcasecmp (opcname, "s32i") == 0 || strcasecmp (opcname, "s32i.n") == 0) opclass = c0opc_s32i; else if (strcasecmp (opcname, "l32e") == 0) @@ -2188,7 +2188,7 @@ call0_track_op (struct gdbarch *gdbarch, xtensa_c0reg_t dst[], xtensa_c0reg_t sr break; case c0opc_add: /* 3 operands: dst, src1, src2. */ - gdb_assert (nods == 3); + gdb_assert (nods == 3); if (src[odv[1]].fr_reg == C0_CONST) { dst[odv[0]].fr_reg = src[odv[2]].fr_reg; @@ -2323,7 +2323,7 @@ call0_track_op (struct gdbarch *gdbarch, xtensa_c0reg_t dst[], xtensa_c0reg_t sr is guaranteed valid only at the point in the function indicated by the PC. May be used to skip the prologue or identify the ABI, w/o tracking. - Returns: Address of first instruction after prologue, or PC (whichever + Returns: Address of first instruction after prologue, or PC (whichever is first), or 0, if decoding failed (in libisa). Input args: start Start address of function/prologue. @@ -2362,7 +2362,7 @@ call0_analyze_prologue (struct gdbarch *gdbarch, struct symtab_and_line prologue_sal; - DEBUGTRACE ("call0_analyze_prologue (start = 0x%08x, pc = 0x%08x, ...)\n", + DEBUGTRACE ("call0_analyze_prologue (start = 0x%08x, pc = 0x%08x, ...)\n", (int)start, (int)pc); /* Try to limit the scan to the end of the function if a non-zero pc @@ -2436,7 +2436,7 @@ call0_analyze_prologue (struct gdbarch *gdbarch, goto done; } - /* Analyze a bundle or a single instruction, using a snapshot of + /* Analyze a bundle or a single instruction, using a snapshot of the register tracking info as input for the entire bundle so that register changes do not take effect within this bundle. */ @@ -2452,9 +2452,9 @@ call0_analyze_prologue (struct gdbarch *gdbarch, goto done; opc = xtensa_opcode_decode (isa, ifmt, is, slot); - DEBUGVERB ("[call0_analyze_prologue] instr addr = 0x%08x, opc = %d\n", + DEBUGVERB ("[call0_analyze_prologue] instr addr = 0x%08x, opc = %d\n", (unsigned)ia, opc); - if (opc == XTENSA_UNDEFINED) + if (opc == XTENSA_UNDEFINED) opclass = c0opc_illegal; else opclass = call0_classify_opcode (isa, opc); @@ -2496,7 +2496,7 @@ call0_analyze_prologue (struct gdbarch *gdbarch, for (j = 0; j < nods && j < C0_MAXOPDS; ++j) { - fail = xtensa_operand_get_field (isa, opc, j, ifmt, + fail = xtensa_operand_get_field (isa, opc, j, ifmt, is, slot, &odv[j]); if (fail) goto done; @@ -2552,7 +2552,7 @@ call0_frame_cache (const frame_info_ptr &this_frame, CORE_ADDR sp, fp, ra; int fp_regnum = C0_SP, c0_hasfp = 0, c0_frmsz = 0, prev_sp = 0, to_stk; xtensa_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); - + sp = get_frame_register_unsigned (this_frame, tdep->a0_base + 1); fp = sp; /* Assume FP == SP until proven otherwise. */ @@ -2571,7 +2571,7 @@ call0_frame_cache (const frame_info_ptr &this_frame, goto finish_frame_analysis; } } - + /* Get the frame information and FP (if used) at the current PC. If PC is in the prologue, the prologue analysis is more reliable than DWARF info. We don't not know for sure, if PC is in the prologue, @@ -2628,7 +2628,7 @@ call0_frame_cache (const frame_info_ptr &this_frame, else prev_sp = fp + c0_frmsz; - /* Frame size from debug info or prologue tracking does not account for + /* Frame size from debug info or prologue tracking does not account for alloca() and other dynamic allocations. Adjust frame size by FP - SP. */ if (c0_hasfp) { @@ -2643,7 +2643,7 @@ call0_frame_cache (const frame_info_ptr &this_frame, to_stk = cache->c0.c0_rt[C0_RA].to_stk; if (to_stk != C0_NOSTK) - ra = (CORE_ADDR) + ra = (CORE_ADDR) read_memory_integer (sp + c0_frmsz + cache->c0.c0_rt[C0_RA].to_stk, 4, byte_order); @@ -2681,7 +2681,7 @@ call0_frame_cache (const frame_info_ptr &this_frame, } else ra = 0; } - + finish_frame_analysis: cache->pc = start_pc; cache->ra = ra; @@ -2772,8 +2772,8 @@ execute_code (struct gdbarch *gdbarch, CORE_ADDR current_pc, CORE_ADDR wb) uint32_t at, as, offset; - /* WindowUnderflow12 = true, when inside _WindowUnderflow12. */ - int WindowUnderflow12 = (current_pc & 0x1ff) >= 0x140; + /* WindowUnderflow12 = true, when inside _WindowUnderflow12. */ + int WindowUnderflow12 = (current_pc & 0x1ff) >= 0x140; isa = xtensa_default_isa; gdb_assert (XTENSA_ISA_BSZ >= xtensa_isa_maxlength (isa)); @@ -2811,7 +2811,7 @@ execute_code (struct gdbarch *gdbarch, CORE_ADDR current_pc, CORE_ADDR wb) if (xtensa_format_get_slot (isa, ifmt, is, ins, slot)) return xtNoExceptionHandler; opc = xtensa_opcode_decode (isa, ifmt, is, slot); - if (opc == XTENSA_UNDEFINED) + if (opc == XTENSA_UNDEFINED) return xtNoExceptionHandler; switch (call0_classify_opcode (isa, opc)) { @@ -2953,19 +2953,19 @@ Unable to decode Xtensa Window Interrupt Handler's code.")); Return the pc of the first instruction after prologue. GDB calls this to find the address of the first line of the function or (if there is no line - number information) to skip the prologue for planting breakpoints on - function entries. Use debug info (if present) or prologue analysis to skip - the prologue to achieve reliable debugging behavior. For windowed ABI, - only the 'entry' instruction is skipped. It is not strictly necessary to + number information) to skip the prologue for planting breakpoints on + function entries. Use debug info (if present) or prologue analysis to skip + the prologue to achieve reliable debugging behavior. For windowed ABI, + only the 'entry' instruction is skipped. It is not strictly necessary to skip the prologue (Call0) or 'entry' (Windowed) because xt-gdb knows how to - backtrace at any point in the prologue, however certain potential hazards - are avoided and a more "normal" debugging experience is ensured by + backtrace at any point in the prologue, however certain potential hazards + are avoided and a more "normal" debugging experience is ensured by skipping the prologue (can be disabled by defining DONT_SKIP_PROLOG). For example, if we don't skip the prologue: - Some args may not yet have been saved to the stack where the debug info expects to find them (true anyway when only 'entry' is skipped); - - Software breakpoints ('break' instrs) may not have been unplanted - when the prologue analysis is done on initializing the frame cache, + - Software breakpoints ('break' instrs) may not have been unplanted + when the prologue analysis is done on initializing the frame cache, and breaks in the prologue will throw off the analysis. If we have debug info ( line-number info, in particular ) we simply skip diff --git a/gdb/xtensa-tdep.h b/gdb/xtensa-tdep.h index 2e7e19bd2fa..5bc70ed7a35 100644 --- a/gdb/xtensa-tdep.h +++ b/gdb/xtensa-tdep.h @@ -89,14 +89,14 @@ enum xtensa_target_flags_t /* Mask. */ -typedef struct +typedef struct { int reg_num; int bit_start; int bit_size; } xtensa_reg_mask_t; -typedef struct +typedef struct { int count; xtensa_reg_mask_t *mask; @@ -105,7 +105,7 @@ typedef struct /* Xtensa register representation. */ -typedef struct +typedef struct { const char *name; /* Register name. */ int offset; /* Offset. */ @@ -244,9 +244,9 @@ struct xtensa_gdbarch_tdep : gdbarch_tdep_base #define WB_SHIFT 2 -/* We assign fixed numbers to the registers of the "current" window - (i.e., relative to WB). The registers get remapped via the reg_map - data structure to their corresponding register in the AR register +/* We assign fixed numbers to the registers of the "current" window + (i.e., relative to WB). The registers get remapped via the reg_map + data structure to their corresponding register in the AR register file (see xtensa-tdep.c). */ #endif /* GDB_XTENSA_TDEP_H */ diff --git a/gdbserver/gdbthread.h b/gdbserver/gdbthread.h index 5e6130106f5..07f0bd799be 100644 --- a/gdbserver/gdbthread.h +++ b/gdbserver/gdbthread.h @@ -87,7 +87,7 @@ struct thread_info : public intrusive_list_node /* Thread options GDB requested with QThreadOptions. */ gdb_thread_options thread_options = 0; - + private: process_info *m_process; std::unique_ptr m_regcache = nullptr; diff --git a/gdbserver/i387-fp.cc b/gdbserver/i387-fp.cc index 90824bdaee5..afa8687d124 100644 --- a/gdbserver/i387-fp.cc +++ b/gdbserver/i387-fp.cc @@ -336,7 +336,7 @@ i387_cache_to_xsave (struct regcache *regcache, void *buf) { int xmm0_regnum = find_regno (regcache->tdesc, "xmm0"); - for (i = 0; i < num_xmm_registers; i++) + for (i = 0; i < num_xmm_registers; i++) { collect_register (regcache, i + xmm0_regnum, raw); p = fp->xmm_space + i * 16; @@ -353,7 +353,7 @@ i387_cache_to_xsave (struct regcache *regcache, void *buf) { int ymm0h_regnum = find_regno (regcache->tdesc, "ymm0h"); - for (i = 0; i < num_xmm_registers; i++) + for (i = 0; i < num_xmm_registers; i++) { collect_register (regcache, i + ymm0h_regnum, raw); p = fp->ymmh_space () + i * 16; diff --git a/gdbserver/linux-i386-ipa.cc b/gdbserver/linux-i386-ipa.cc index 4f8398df2a1..bb12895826d 100644 --- a/gdbserver/linux-i386-ipa.cc +++ b/gdbserver/linux-i386-ipa.cc @@ -131,7 +131,7 @@ initialize_fast_tracepoint_trampoline_buffer (void) FILE *f = fopen ("/proc/sys/vm/mmap_min_addr", "r"); if (!f) - { + { snprintf (buf, sizeof (buf), "mmap_min_addr open failed: %s", safe_strerror (errno)); set_trampoline_buffer_space (0, 0, buf); @@ -140,9 +140,9 @@ initialize_fast_tracepoint_trampoline_buffer (void) if (fgets (buf, IPA_BUFSIZ, f)) sscanf (buf, "%llu", &mmap_min_addr); - + fclose (f); - + buffer_size = buffer_end - mmap_min_addr; if (buffer_size >= min_buffer_size) diff --git a/gdbserver/linux-low.h b/gdbserver/linux-low.h index 5710e49d950..77ea0cea353 100644 --- a/gdbserver/linux-low.h +++ b/gdbserver/linux-low.h @@ -562,7 +562,7 @@ private: process_info *add_linux_process_no_mem_file (int pid, int attached); /* Free resources associated to PROC and remove it. */ - void remove_linux_process (process_info *proc); + void remove_linux_process (process_info *proc); /* Add a new thread. */ lwp_info *add_lwp (ptid_t ptid); diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc index 44257d5d1ce..2aa85ec3d9c 100644 --- a/gdbserver/linux-x86-low.cc +++ b/gdbserver/linux-x86-low.cc @@ -211,7 +211,7 @@ struct arch_process_info /* Mapping between the general-purpose registers in `struct user' format and GDB's register array layout. Note that the transfer layout uses 64-bit regs. */ -static /*const*/ int i386_regmap[] = +static /*const*/ int i386_regmap[] = { RAX * 8, RCX * 8, RDX * 8, RBX * 8, RSP * 8, RBP * 8, RSI * 8, RDI * 8, @@ -264,7 +264,7 @@ static const int x86_64_regmap[] = /* Mapping between the general-purpose registers in `struct user' format and GDB's register array layout. */ -static /*const*/ int i386_regmap[] = +static /*const*/ int i386_regmap[] = { EAX * 4, ECX * 4, EDX * 4, EBX * 4, UESP * 4, EBP * 4, ESI * 4, EDI * 4, diff --git a/gdbserver/server.h b/gdbserver/server.h index 1bf3e7757a6..6d0c86da5b5 100644 --- a/gdbserver/server.h +++ b/gdbserver/server.h @@ -130,7 +130,7 @@ extern unsigned long signal_pid; struct client_state { client_state (): - own_buf ((char *) xmalloc (PBUFSIZ + 1)) + own_buf ((char *) xmalloc (PBUFSIZ + 1)) {} /* The thread set with an `Hc' packet. `Hc' is deprecated in favor of diff --git a/gdbserver/tracepoint.cc b/gdbserver/tracepoint.cc index e1044dca558..5052390da1c 100644 --- a/gdbserver/tracepoint.cc +++ b/gdbserver/tracepoint.cc @@ -2850,7 +2850,7 @@ have_fast_tracepoint_trampoline_buffer (char *buf) { internal_error ("error extracting trampoline_buffer_end"); } - + if (buf) { buf[0] = '\0'; diff --git a/gdbsupport/event-loop.cc b/gdbsupport/event-loop.cc index e7b21e786db..cb86b746e5f 100644 --- a/gdbsupport/event-loop.cc +++ b/gdbsupport/event-loop.cc @@ -247,7 +247,7 @@ gdb_do_one_event (int mstimeout) std::optional timer_id; - SCOPE_EXIT + SCOPE_EXIT { if (timer_id.has_value ()) delete_timer (*timer_id); @@ -397,7 +397,7 @@ get_next_file_handler_to_handle_and_advance (void) return curr_next; } -/* Remove the file descriptor FD from the list of monitored fd's: +/* Remove the file descriptor FD from the list of monitored fd's: i.e. we don't care anymore about events on the FD. */ void delete_file_handler (int fd) @@ -455,7 +455,7 @@ delete_file_handler (int fd) } } - /* Deactivate the file descriptor, by clearing its mask, + /* Deactivate the file descriptor, by clearing its mask, so that it will not fire again. */ file_ptr->mask = 0; diff --git a/gdbsupport/event-loop.h b/gdbsupport/event-loop.h index 375f85e6e2f..6a47ee149bc 100644 --- a/gdbsupport/event-loop.h +++ b/gdbsupport/event-loop.h @@ -92,8 +92,8 @@ extern void add_file_handler (int fd, handler_func *proc, gdb_client_data client_data, std::string &&name, bool is_ui = false); -extern int create_timer (int milliseconds, - timer_handler_func *proc, +extern int create_timer (int milliseconds, + timer_handler_func *proc, gdb_client_data client_data); extern void delete_timer (int id); diff --git a/gdbsupport/gdb_vecs.cc b/gdbsupport/gdb_vecs.cc index f74b1dd7ab1..a36b4453bdd 100644 --- a/gdbsupport/gdb_vecs.cc +++ b/gdbsupport/gdb_vecs.cc @@ -59,7 +59,7 @@ std::vector> delim_string_to_char_ptr_vec (const char *str, char delimiter) { std::vector> retval; - + delim_string_to_char_ptr_vec_append (&retval, str, delimiter); return retval; @@ -80,7 +80,7 @@ std::vector> dirnames_to_char_ptr_vec (const char *dirnames) { std::vector> retval; - + dirnames_to_char_ptr_vec_append (&retval, dirnames); return retval; diff --git a/gdbsupport/print-utils.h b/gdbsupport/print-utils.h index dc5011c8c2f..14513d988c7 100644 --- a/gdbsupport/print-utils.h +++ b/gdbsupport/print-utils.h @@ -78,9 +78,9 @@ extern const char *hex_string_custom (LONGEST num, int width); /* Convert VAL to a numeral in the given radix. For * radix 10, IS_SIGNED may be true, indicating a signed quantity; - * otherwise VAL is interpreted as unsigned. If WIDTH is supplied, + * otherwise VAL is interpreted as unsigned. If WIDTH is supplied, * it is the minimum width (0-padded if needed). USE_C_FORMAT means - * to use C format in all cases. If it is false, then 'x' + * to use C format in all cases. If it is false, then 'x' * and 'o' formats do not include a prefix (0x or leading 0). */ extern const char *int_string (LONGEST val, int radix, int is_signed, int width, diff --git a/gdbsupport/ptid.cc b/gdbsupport/ptid.cc index 62efc3dbaa5..c195e073543 100644 --- a/gdbsupport/ptid.cc +++ b/gdbsupport/ptid.cc @@ -1,7 +1,7 @@ /* The ptid_t type and common functions operating on it. Copyright (C) 1986-2025 Free Software Foundation, Inc. - + This file is part of GDB. This program is free software; you can redistribute it and/or modify