From: Andrew Burgess <aburgess@redhat.com>
To: Simon Marchi <simon.marchi@efficios.com>, gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: Re: [PATCH] gdb, gdbserver, gdbsupport: replace many uses of strcmp with streq
Date: Mon, 16 Mar 2026 17:18:35 +0000 [thread overview]
Message-ID: <87h5qf7kwk.fsf@redhat.com> (raw)
In-Reply-To: <20260316152335.66981-1-simon.marchi@efficios.com>
Simon Marchi <simon.marchi@efficios.com> writes:
> Replace all occurrences of:
>
> strcmp (...) == 0
> strcmp (...) != 0
> !strcmp (...)
> 0 == strcmp (...)
> strcmp (...) directly used as a boolean predicate
>
> with the equivalent expression using streq.
>
> This is for consistency (we already use streq as some places in the
> testsuite) but also for clarity. I think that streq is clearer on the
> intent than strcmp. It's also a bit shorter.
I haven't looked through every line of this patch, life's too short :)
But I took a random sampling and it all looked good. I agree with the
intent here, so:
Approved-By: Andrew Burgess <aburgess@redhat.com>
Thanks,
Andrew
>
> Change-Id: Ibbf5261b1872c240bc0c982c147f6a5477275a91
> ---
> gdb/aarch64-tdep.c | 11 +-
> gdb/ada-exp.y | 4 +-
> gdb/ada-lang.c | 91 ++++++++--------
> gdb/amd64-dicos-tdep.c | 3 +-
> gdb/amd64-gnu-tdep.c | 2 +-
> gdb/amd64-linux-tdep.c | 2 +-
> gdb/amd64-obsd-tdep.c | 7 +-
> gdb/amd64-windows-tdep.c | 4 +-
> gdb/arch-utils.c | 4 +-
> gdb/arm-pikeos-tdep.c | 6 +-
> gdb/arm-tdep.c | 18 ++--
> gdb/arm-wince-tdep.c | 4 +-
> gdb/auto-load.c | 15 ++-
> gdb/avr-tdep.c | 2 +-
> gdb/ax-gdb.c | 6 +-
> gdb/bfin-tdep.c | 2 +-
> gdb/break-catch-sig.c | 2 +-
> gdb/break-cond-parse.c | 4 +-
> gdb/breakpoint.c | 13 ++-
> gdb/bt-utils.c | 2 +-
> gdb/btrace.c | 10 +-
> gdb/c-lang.c | 6 +-
> gdb/c-typeprint.c | 8 +-
> gdb/c-valprint.c | 9 +-
> gdb/charset.c | 36 +++----
> gdb/cli/cli-cmds.c | 7 +-
> gdb/cli/cli-decode.c | 9 +-
> gdb/cli/cli-dump.c | 4 +-
> gdb/cli/cli-option.c | 4 +-
> gdb/cli/cli-script.c | 2 +-
> gdb/cli/cli-style.c | 6 +-
> gdb/coff-pe-read.c | 48 ++++-----
> gdb/compile/compile-object-load.c | 6 +-
> gdb/compile/compile.c | 4 +-
> gdb/completer.c | 4 +-
> gdb/corelow.c | 4 +-
> gdb/cp-abi.c | 4 +-
> gdb/cp-name-parser.y | 2 +-
> gdb/cp-namespace.c | 14 +--
> gdb/cp-support.c | 24 ++---
> gdb/cp-valprint.c | 4 +-
> gdb/csky-tdep.c | 33 +++---
> gdb/ctfread.c | 8 +-
> gdb/d-namespace.c | 13 +--
> gdb/d-valprint.c | 4 +-
> gdb/darwin-nat-info.c | 6 +-
> gdb/dicos-tdep.c | 2 +-
> gdb/dictionary.c | 2 +-
> gdb/disasm.c | 4 +-
> gdb/dtrace-probe.c | 2 +-
> gdb/dwarf2/cooked-index-shard.c | 2 +-
> gdb/dwarf2/cooked-index.c | 2 +-
> gdb/dwarf2/cooked-indexer.c | 2 +-
> gdb/dwarf2/cu.c | 2 +-
> gdb/dwarf2/index-write.c | 5 +-
> gdb/dwarf2/read-gdb-index.c | 2 +-
> gdb/dwarf2/read.c | 39 ++++---
> gdb/dwarf2/sect-names.h | 4 +-
> gdb/elfread.c | 12 +--
> gdb/eval.c | 2 +-
> gdb/event-top.c | 2 +-
> gdb/exec.c | 6 +-
> gdb/extension.c | 2 +-
> gdb/f-typeprint.c | 2 +-
> gdb/f-valprint.c | 5 +-
> gdb/fbsd-nat.c | 2 +-
> gdb/fbsd-tdep.c | 2 +-
> gdb/frame.c | 2 +-
> gdb/frv-tdep.c | 6 +-
> gdb/ft32-tdep.c | 2 +-
> gdb/gcore-elf.c | 2 +-
> gdb/gcore.c | 2 +-
> gdb/gdb-demangle.c | 5 +-
> gdb/gdb_bfd.c | 2 +-
> gdb/gdbtypes.c | 16 +--
> gdb/gnu-nat.c | 8 +-
> gdb/gnu-v2-abi.c | 9 +-
> gdb/go-lang.c | 19 ++--
> gdb/go32-nat.c | 6 +-
> gdb/guile/scm-lazy-string.c | 2 +-
> gdb/guile/scm-param.c | 2 +-
> gdb/hppa-bsd-tdep.c | 2 +-
> gdb/hppa-linux-tdep.c | 2 +-
> gdb/hppa-tdep.c | 10 +-
> gdb/i386-dicos-tdep.c | 3 +-
> gdb/i386-gnu-tdep.c | 2 +-
> gdb/i386-go32-tdep.c | 4 +-
> gdb/i386-linux-tdep.c | 3 +-
> gdb/i386-obsd-tdep.c | 9 +-
> gdb/i386-tdep.c | 39 +++----
> gdb/i386-windows-tdep.c | 2 +-
> gdb/ia64-tdep.c | 8 +-
> gdb/infrun.c | 4 +-
> gdb/interps.c | 8 +-
> gdb/language.c | 27 +++--
> gdb/linespec.c | 7 +-
> gdb/linux-tdep.c | 22 ++--
> gdb/linux-thread-db.c | 7 +-
> gdb/m2-typeprint.c | 9 +-
> gdb/m32c-tdep.c | 6 +-
> gdb/m32r-linux-tdep.c | 3 +-
> gdb/machoread.c | 6 +-
> gdb/macrocmd.c | 2 +-
> gdb/macroexp.c | 7 +-
> gdb/macrotab.c | 4 +-
> gdb/main.c | 4 +-
> gdb/memattr.c | 2 +-
> gdb/mi/mi-cmd-disas.c | 6 +-
> gdb/mi/mi-cmd-var.c | 14 +--
> gdb/mi/mi-getopt.c | 4 +-
> gdb/mi/mi-main.c | 46 ++++-----
> gdb/mi/mi-parse.c | 33 +++---
> gdb/minsyms.c | 24 ++---
> gdb/mips-sde-tdep.c | 5 +-
> gdb/mips-tdep.c | 12 +--
> gdb/namespace.c | 10 +-
> gdb/nat/linux-btrace.c | 2 +-
> gdb/nat/linux-osdata.c | 4 +-
> gdb/nat/linux-procfs.c | 2 +-
> gdb/nds32-tdep.c | 2 +-
> gdb/objc-lang.c | 10 +-
> gdb/objfiles.c | 4 +-
> gdb/opencl-lang.c | 8 +-
> gdb/osabi.c | 18 ++--
> gdb/p-exp.y | 14 +--
> gdb/p-lang.c | 8 +-
> gdb/p-valprint.c | 9 +-
> gdb/ppc-linux-tdep.c | 20 ++--
> gdb/ppc64-tdep.c | 2 +-
> gdb/probe.c | 5 +-
> gdb/python/py-breakpoint.c | 2 +-
> gdb/python/py-lazy-string.c | 2 +-
> gdb/python/py-micmd.c | 5 +-
> gdb/python/py-param.c | 6 +-
> gdb/python/py-prettyprint.c | 6 +-
> gdb/python/py-style.c | 11 +-
> gdb/python/python.c | 2 +-
> gdb/record.c | 16 +--
> gdb/regformats/regdef.h | 2 +-
> gdb/reggroups.c | 2 +-
> gdb/remote-fileio.c | 2 +-
> gdb/remote.c | 114 ++++++++++-----------
> gdb/riscv-tdep.c | 14 +--
> gdb/rs6000-tdep.c | 16 ++-
> gdb/rust-lang.c | 28 ++---
> gdb/rust-parse.c | 2 +-
> gdb/s390-tdep.c | 2 +-
> gdb/selftest-arch.c | 20 ++--
> gdb/serial.c | 2 +-
> gdb/sh-tdep.c | 2 +-
> gdb/sol2-tdep.c | 7 +-
> gdb/solib-aix.c | 10 +-
> gdb/solib-darwin.c | 2 +-
> gdb/solib-dsbt.c | 2 +-
> gdb/solib-frv.c | 4 +-
> gdb/solib-svr4.c | 23 ++---
> gdb/solib-target.c | 2 +-
> gdb/solib.c | 4 +-
> gdb/source.c | 8 +-
> gdb/sparc64-fbsd-tdep.c | 2 +-
> gdb/sparc64-obsd-tdep.c | 2 +-
> gdb/stack.c | 5 +-
> gdb/stap-probe.c | 3 +-
> gdb/symfile.c | 30 +++---
> gdb/symmisc.c | 12 +--
> gdb/symtab.c | 14 +--
> gdb/target.c | 2 +-
> gdb/top.c | 4 +-
> gdb/tracectf.c | 31 +++---
> gdb/tracefile-tfile.c | 2 +-
> gdb/tracefile.c | 4 +-
> gdb/tracepoint.c | 6 +-
> gdb/tui/tui-layout.c | 12 +--
> gdb/tui/tui-win.c | 4 +-
> gdb/tui/tui.c | 2 +-
> gdb/ui-style.c | 4 +-
> gdb/unittests/child-path-selftests.c | 2 +-
> gdb/unittests/cli-utils-selftests.c | 14 +--
> gdb/unittests/copy_bitwise-selftests.c | 2 +-
> gdb/unittests/environ-selftests.c | 34 +++---
> gdb/unittests/intrusive_list-selftests.c | 4 +-
> gdb/unittests/lookup_name_info-selftests.c | 2 +-
> gdb/unittests/scoped_mmap-selftests.c | 2 +-
> gdb/unittests/unique_xmalloc_ptr_char.c | 4 +-
> gdb/utils.c | 10 +-
> gdb/valops.c | 18 ++--
> gdb/varobj.c | 2 +-
> gdb/windows-tdep.c | 8 +-
> gdb/x86-tdep.c | 4 +-
> gdb/xcoffread.c | 11 +-
> gdb/xml-support.c | 10 +-
> gdb/xml-syscall.c | 8 +-
> gdb/xml-tdesc.c | 17 ++-
> gdb/xstormy16-tdep.c | 6 +-
> gdbserver/gdbreplay.cc | 2 +-
> gdbserver/linux-arc-low.cc | 2 +-
> gdbserver/linux-low.cc | 4 +-
> gdbserver/linux-x86-low.cc | 2 +-
> gdbserver/linux-x86-tdesc.cc | 3 +-
> gdbserver/regcache.cc | 2 +-
> gdbserver/remote-utils.cc | 6 +-
> gdbserver/server.cc | 105 +++++++++----------
> gdbserver/thread-db.cc | 2 +-
> gdbserver/tracepoint.cc | 26 ++---
> gdbsupport/common-exceptions.h | 2 +-
> gdbsupport/osabi.cc | 2 +-
> gdbsupport/signals.cc | 3 +-
> 207 files changed, 923 insertions(+), 984 deletions(-)
>
> diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
> index de0d7ddb73b9..ce00f5182992 100644
> --- a/gdb/aarch64-tdep.c
> +++ b/gdb/aarch64-tdep.c
> @@ -355,8 +355,7 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch,
> break;
>
> if (inst.opcode->iclass == addsub_imm
> - && (inst.opcode->op == OP_ADD
> - || strcmp ("sub", inst.opcode->name) == 0))
> + && (inst.opcode->op == OP_ADD || streq ("sub", inst.opcode->name)))
> {
> unsigned rd = inst.operands[0].reg.regno;
> unsigned rn = inst.operands[1].reg.regno;
> @@ -382,7 +381,7 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch,
> seen_stack_set = true;
> }
> else if (inst.opcode->iclass == addsub_ext
> - && strcmp ("sub", inst.opcode->name) == 0)
> + && streq ("sub", inst.opcode->name))
> {
> unsigned rd = inst.operands[0].reg.regno;
> unsigned rn = inst.operands[1].reg.regno;
> @@ -433,7 +432,7 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch,
> << inst.operands[1].shifter.amount);
> }
> else if (inst.opcode->iclass == log_shift
> - && strcmp (inst.opcode->name, "orr") == 0)
> + && streq (inst.opcode->name, "orr"))
> {
> unsigned rd = inst.operands[0].reg.regno;
> unsigned rn = inst.operands[1].reg.regno;
> @@ -477,7 +476,7 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch,
> else if ((inst.opcode->iclass == ldstpair_off
> || (inst.opcode->iclass == ldstpair_indexed
> && inst.operands[2].addr.preind))
> - && strcmp ("stp", inst.opcode->name) == 0)
> + && streq ("stp", inst.opcode->name))
> {
> /* STP with addressing mode Pre-indexed and Base register. */
> unsigned rt1;
> @@ -526,7 +525,7 @@ aarch64_analyze_prologue (struct gdbarch *gdbarch,
> && (inst.opcode->op == OP_STR_POS
> || inst.opcode->op == OP_STRF_POS)))
> && inst.operands[1].addr.base_regno == AARCH64_SP_REGNUM
> - && strcmp ("str", inst.opcode->name) == 0)
> + && streq ("str", inst.opcode->name))
> {
> /* STR (immediate) */
> unsigned int rt = inst.operands[0].reg.regno;
> diff --git a/gdb/ada-exp.y b/gdb/ada-exp.y
> index 0663de01fda1..7c691d5a0990 100644
> --- a/gdb/ada-exp.y
> +++ b/gdb/ada-exp.y
> @@ -563,7 +563,7 @@ exp1 : exp
>
> primary : primary DOT_ID
> {
> - if (strcmp ($2.ptr, "all") == 0)
> + if (streq ($2.ptr, "all"))
> ada_wrap<ada_unop_ind_operation> ();
> else
> {
> @@ -1553,7 +1553,7 @@ find_primitive_type (struct parser_state *par_state, const char *name)
> type = language_lookup_primitive_type (par_state->language (),
> par_state->gdbarch (),
> name);
> - if (type == NULL && strcmp ("system__address", name) == 0)
> + if (type == NULL && streq ("system__address", name))
> type = type_system_address (par_state);
>
> if (type != NULL)
> diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
> index 908b33d9c72a..ddffc2973e45 100644
> --- a/gdb/ada-lang.c
> +++ b/gdb/ada-lang.c
> @@ -454,12 +454,11 @@ field_name_match (const char *field_name, const char *target)
> {
> int len = strlen (target);
>
> - return
> - (strncmp (field_name, target, len) == 0
> - && (field_name[len] == '\0'
> - || (startswith (field_name + len, "___")
> - && strcmp (field_name + strlen (field_name) - 6,
> - "___XVN") != 0)));
> + return (strncmp (field_name, target, len) == 0
> + && (field_name[len] == '\0'
> + || (startswith (field_name + len, "___")
> + && !streq (field_name + strlen (field_name) - 6,
> + "___XVN"))));
> }
>
>
> @@ -519,7 +518,7 @@ is_suffix (const char *str, const char *suffix)
> return false;
> len1 = strlen (str);
> len2 = strlen (suffix);
> - return len1 >= len2 && strcmp (str + len1 - len2, suffix) == 0;
> + return len1 >= len2 && streq (str + len1 - len2, suffix);
> }
>
> /* The contents of value VAL, treated as a value of type TYPE. The
> @@ -1699,8 +1698,8 @@ ada_fixup_array_indexes_type (struct type *index_desc_type)
> the field type should be a meaningless integer type whose name
> is not equal to the field name. */
> if (index_desc_type->field (0).type ()->name () != NULL
> - && strcmp (index_desc_type->field (0).type ()->name (),
> - index_desc_type->field (0).name ()) == 0)
> + && streq (index_desc_type->field (0).type ()->name (),
> + index_desc_type->field (0).name ()))
> return;
>
> /* Fixup each field of INDEX_DESC_TYPE. */
> @@ -3850,7 +3849,7 @@ ada_resolve_enum (std::vector<struct block_symbol> &syms,
> /* We let an anonymous enum type match a non-anonymous one. */
> if (type1->name () != nullptr
> && type2->name () != nullptr
> - && strcmp (type1->name (), type2->name ()) != 0)
> + && !streq (type1->name (), type2->name ()))
> continue;
> if (ada_identical_enum_types_p (type1, type2))
> return i;
> @@ -4847,10 +4846,9 @@ equiv_types (struct type *type0, struct type *type1)
> if (type0 == NULL || type1 == NULL
> || type0->code () != type1->code ())
> return false;
> - if ((type0->code () == TYPE_CODE_STRUCT
> - || type0->code () == TYPE_CODE_ENUM)
> + if ((type0->code () == TYPE_CODE_STRUCT || type0->code () == TYPE_CODE_ENUM)
> && ada_type_name (type0) != NULL && ada_type_name (type1) != NULL
> - && strcmp (ada_type_name (type0), ada_type_name (type1)) == 0)
> + && streq (ada_type_name (type0), ada_type_name (type1)))
> return true;
>
> return false;
> @@ -4894,7 +4892,7 @@ lesseq_defined_than (struct symbol *sym0, struct symbol *sym1)
> {
> const char *name0 = sym0->linkage_name ();
> const char *name1 = sym1->linkage_name ();
> - return (strcmp (name0, name1) == 0
> + return (streq (name0, name1)
> && sym0->value_address () == sym1->value_address ());
> }
>
> @@ -4983,7 +4981,7 @@ is_nondebugging_type (struct type *type)
> {
> const char *name = ada_type_name (type);
>
> - return (name != NULL && strcmp (name, "<variable, no debug info>") == 0);
> + return (name != NULL && streq (name, "<variable, no debug info>"));
> }
>
> /* Return true if TYPE1 and TYPE2 are two enumeration types
> @@ -5112,8 +5110,8 @@ remove_extra_symbols (std::vector<struct block_symbol> &syms)
> if (j != i
> && !syms[j].symbol->type ()->is_stub ()
> && syms[j].symbol->linkage_name () != NULL
> - && strcmp (syms[i].symbol->linkage_name (),
> - syms[j].symbol->linkage_name ()) == 0)
> + && streq (syms[i].symbol->linkage_name (),
> + syms[j].symbol->linkage_name ()))
> remove_p = true;
> }
> }
> @@ -5129,12 +5127,12 @@ remove_extra_symbols (std::vector<struct block_symbol> &syms)
> {
> if (i != j
> && syms[j].symbol->linkage_name () != NULL
> - && strcmp (syms[i].symbol->linkage_name (),
> - syms[j].symbol->linkage_name ()) == 0
> + && streq (syms[i].symbol->linkage_name (),
> + syms[j].symbol->linkage_name ())
> && (syms[i].symbol->loc_class ()
> == syms[j].symbol->loc_class ())
> - && syms[i].symbol->value_address ()
> - == syms[j].symbol->value_address ())
> + && (syms[i].symbol->value_address ()
> + == syms[j].symbol->value_address ()))
> remove_p = true;
> }
> }
> @@ -5820,7 +5818,7 @@ is_name_suffix (const char *str)
>
> /* "TKB" suffixes are used for subprograms implementing task bodies. */
>
> - if (strcmp (str, "TKB") == 0)
> + if (streq (str, "TKB"))
> return true;
>
> #if 0
> @@ -5876,14 +5874,14 @@ is_name_suffix (const char *str)
> return false;
> if (str[2] == '_')
> {
> - if (strcmp (str + 3, "JM") == 0)
> + if (streq (str + 3, "JM"))
> return true;
> /* FIXME: brobecker/2004-09-30: GNAT will soon stop using
> the LJM suffix in favor of the JM one. But we will
> still accept LJM as a valid suffix for a reasonable
> amount of time, just to allow ourselves to debug programs
> compiled using an older version of GNAT. */
> - if (strcmp (str + 3, "LJM") == 0)
> + if (streq (str + 3, "LJM"))
> return true;
> if (str[3] != 'X')
> return false;
> @@ -6211,7 +6209,7 @@ ada_is_dispatch_table_ptr_type (struct type *type)
> if (name == NULL)
> return false;
>
> - return (strcmp (name, "ada__tags__dispatch_table") == 0);
> + return (streq (name, "ada__tags__dispatch_table"));
> }
>
> /* Return true if TYPE is an interface tag. */
> @@ -6224,7 +6222,7 @@ ada_is_interface_tag (struct type *type)
> if (name == nullptr)
> return false;
>
> - return (strcmp (name, "ada__tags__interface_tag") == 0);
> + return (streq (name, "ada__tags__interface_tag"));
> }
>
> /* True if field number FIELD_NUM in struct or union type TYPE is supposed
> @@ -6304,8 +6302,7 @@ ada_is_tag_type (struct type *type)
> {
> const char *name = ada_type_name (type->target_type ());
>
> - return (name != NULL
> - && strcmp (name, "ada__tags__dispatch_table") == 0);
> + return name != nullptr && streq (name, "ada__tags__dispatch_table");
> }
> }
>
> @@ -6654,7 +6651,7 @@ ada_is_wrapper_field (struct type *type, int field_num)
> {
> const char *name = type->field (field_num).name ();
>
> - if (name != NULL && strcmp (name, "RETVAL") == 0)
> + if (name != NULL && streq (name, "RETVAL"))
> {
> /* This happens in functions with "out" or "in out" parameters
> which are passed by copy. For such functions, GNAT describes
> @@ -6667,7 +6664,7 @@ ada_is_wrapper_field (struct type *type, int field_num)
>
> return (name != NULL
> && (startswith (name, "PARENT")
> - || strcmp (name, "REP") == 0
> + || streq (name, "REP")
> || startswith (name, "_parent")
> || name[0] == 'S' || name[0] == 'R' || name[0] == 'O'));
> }
> @@ -7565,7 +7562,7 @@ find_parallel_type_by_descriptive_type (struct type *type, const char *name)
> }
>
> /* If the names match, stop. */
> - if (strcmp (result_name, name) == 0)
> + if (streq (result_name, name))
> break;
>
> /* Otherwise, look at the next item on the list, if any. */
> @@ -7652,7 +7649,7 @@ dynamic_template_type (struct type *type)
> {
> int len = strlen (ada_type_name (type));
>
> - if (len > 6 && strcmp (ada_type_name (type) + len - 6, "___XVE") == 0)
> + if (len > 6 && streq (ada_type_name (type) + len - 6, "___XVE"))
> return type;
> else
> return ada_find_parallel_type (type, "___XVE");
> @@ -8873,10 +8870,10 @@ ada_is_character_type (struct type *type)
> return (name != NULL
> && (type->code () == TYPE_CODE_INT
> || type->code () == TYPE_CODE_RANGE)
> - && (strcmp (name, "character") == 0
> - || strcmp (name, "wide_character") == 0
> - || strcmp (name, "wide_wide_character") == 0
> - || strcmp (name, "unsigned char") == 0));
> + && (streq (name, "character")
> + || streq (name, "wide_character")
> + || streq (name, "wide_wide_character")
> + || streq (name, "unsigned char")));
> }
>
> /* True if TYPE appears to be an Ada string type. */
> @@ -8924,7 +8921,7 @@ ada_is_aligner_type (struct type *type)
>
> return (type->code () == TYPE_CODE_STRUCT
> && type->num_fields () == 1
> - && strcmp (type->field (0).name (), "F") == 0);
> + && streq (type->field (0).name (), "F"));
> }
>
> /* If there is an ___XVS-convention type parallel to SUBTYPE, return
> @@ -10646,7 +10643,7 @@ convert_char_literal (struct type *type, LONGEST val)
> const char *ename = field.name ();
> size_t elen = strlen (ename);
>
> - if (elen >= len && strcmp (name, ename + elen - len) == 0)
> + if (elen >= len && streq (name, ename + elen - len))
> return field.loc_enumval ();
> }
> return val;
> @@ -11432,7 +11429,7 @@ ada_ternop_slice_operation::resolve (struct expression *exp,
> bool
> ada_is_system_address_type (struct type *type)
> {
> - return (type->name () && strcmp (type->name (), "system__address") == 0);
> + return (type->name () && streq (type->name (), "system__address"));
> }
>
> \f
> @@ -12020,8 +12017,8 @@ ada_unhandled_exception_name_addr_from_raise (void)
> = find_frame_funname (fi, &func_lang, NULL);
> if (func_name != NULL)
> {
> - if (strcmp (func_name.get (),
> - data->exception_info->catch_exception_sym) == 0)
> + if (streq (func_name.get (),
> + data->exception_info->catch_exception_sym))
> break; /* We found the frame we were looking for... */
> }
> fi = get_prev_frame (fi);
> @@ -12773,7 +12770,7 @@ ada_exception_catchpoint_cond_string (const char *excep_string,
>
> for (const char *name : standard_exc)
> {
> - if (strcmp (name, excep_string) == 0)
> + if (streq (name, excep_string))
> {
> is_standard_exc = true;
> break;
> @@ -12981,7 +12978,7 @@ ada_is_exception_sym (struct symbol *sym)
> && sym->loc_class () != LOC_BLOCK
> && sym->loc_class () != LOC_CONST
> && sym->loc_class () != LOC_UNRESOLVED
> - && type_name != NULL && strcmp (type_name, "exception") == 0);
> + && type_name != nullptr && streq (type_name, "exception"));
> }
>
> /* Given a global symbol SYM, return non-zero iff SYM is a non-standard
> @@ -12995,13 +12992,13 @@ ada_is_non_standard_exception_sym (struct symbol *sym)
> return false;
>
> for (const char *name : standard_exc)
> - if (strcmp (sym->linkage_name (), name) == 0)
> + if (streq (sym->linkage_name (), name))
> return false; /* A standard exception. */
>
> /* Numeric_Error is also a standard exception, so exclude it.
> See the STANDARD_EXC description for more details as to why
> this exception is not listed in that array. */
> - if (strcmp (sym->linkage_name (), "numeric_error") == 0)
> + if (streq (sym->linkage_name (), "numeric_error"))
> return false;
>
> return true;
> @@ -13029,7 +13026,7 @@ ada_exc_info::operator< (const ada_exc_info &other) const
> bool
> ada_exc_info::operator== (const ada_exc_info &other) const
> {
> - return addr == other.addr && strcmp (name, other.name) == 0;
> + return addr == other.addr && streq (name, other.name);
> }
>
> /* Sort EXCEPTIONS using compare_ada_exception_info as the comparison
> @@ -13373,7 +13370,7 @@ do_exact_match (const char *symbol_search_name,
> const lookup_name_info &lookup_name,
> completion_match_result *comp_match_res)
> {
> - return strcmp (symbol_search_name, ada_lookup_name (lookup_name)) == 0;
> + return streq (symbol_search_name, ada_lookup_name (lookup_name));
> }
>
> /* Build the Ada lookup name for LOOKUP_NAME. */
> diff --git a/gdb/amd64-dicos-tdep.c b/gdb/amd64-dicos-tdep.c
> index 915d1141110a..259d4e86c003 100644
> --- a/gdb/amd64-dicos-tdep.c
> +++ b/gdb/amd64-dicos-tdep.c
> @@ -38,8 +38,7 @@ amd64_dicos_osabi_sniffer (bfd *abfd)
>
> /* On amd64-DICOS, the Load Module's "header" section is 72
> bytes. */
> - if (strcmp (target_name, "elf64-x86-64") == 0
> - && dicos_load_module_p (abfd, 72))
> + if (streq (target_name, "elf64-x86-64") && dicos_load_module_p (abfd, 72))
> return GDB_OSABI_DICOS;
>
> return GDB_OSABI_UNKNOWN;
> diff --git a/gdb/amd64-gnu-tdep.c b/gdb/amd64-gnu-tdep.c
> index 963ca791b100..366cc4584ada 100644
> --- a/gdb/amd64-gnu-tdep.c
> +++ b/gdb/amd64-gnu-tdep.c
> @@ -90,7 +90,7 @@ amd64_gnu_sigtramp_p (const frame_info_ptr &this_frame)
> find_pc_partial_function (pc, &name, NULL, NULL);
>
> /* If we have a NAME, we can check for the trampoline function */
> - if (name != NULL && strcmp (name, "trampoline") == 0)
> + if (name != NULL && streq (name, "trampoline"))
> return 1;
>
> return amd64_gnu_sigtramp_start (this_frame) != 0;
> diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
> index ff0c58464f25..17d9f78f32d1 100644
> --- a/gdb/amd64-linux-tdep.c
> +++ b/gdb/amd64-linux-tdep.c
> @@ -206,7 +206,7 @@ amd64_linux_sigtramp_p (const frame_info_ptr &this_frame)
> if (name == NULL || strstr (name, "sigaction") != NULL)
> return (amd64_linux_sigtramp_start (this_frame) != 0);
>
> - return (strcmp ("__restore_rt", name) == 0);
> + return (streq ("__restore_rt", name));
> }
>
> /* Offset to struct sigcontext in ucontext, from <asm/ucontext.h>. */
> diff --git a/gdb/amd64-obsd-tdep.c b/gdb/amd64-obsd-tdep.c
> index 81bc5f5d93ca..0dbc47be6f9a 100644
> --- a/gdb/amd64-obsd-tdep.c
> +++ b/gdb/amd64-obsd-tdep.c
> @@ -396,10 +396,9 @@ amd64obsd_trapframe_sniffer (const struct frame_unwind *self,
> return 0;
>
> find_pc_partial_function (get_frame_pc (this_frame), &name, NULL, NULL);
> - return (name && ((strcmp (name, "calltrap") == 0)
> - || (strcmp (name, "osyscall1") == 0)
> - || (strcmp (name, "Xsyscall") == 0)
> - || (startswith (name, "Xintr"))));
> + return (name != nullptr
> + && (streq (name, "calltrap") || streq (name, "osyscall1")
> + || streq (name, "Xsyscall") || startswith (name, "Xintr")));
> }
>
> static const struct frame_unwind_legacy amd64obsd_trapframe_unwind (
> diff --git a/gdb/amd64-windows-tdep.c b/gdb/amd64-windows-tdep.c
> index a9ca7b2ac79b..85f7ac51a4f9 100644
> --- a/gdb/amd64-windows-tdep.c
> +++ b/gdb/amd64-windows-tdep.c
> @@ -444,7 +444,7 @@ amd64_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
> bound_minimal_symbol s = lookup_minimal_symbol_by_pc (call_dest);
> if (s.minsym != NULL
> && s.minsym->linkage_name () != NULL
> - && strcmp (s.minsym->linkage_name (), "__main") == 0)
> + && streq (s.minsym->linkage_name (), "__main"))
> pc += 5;
> }
> }
> @@ -1379,7 +1379,7 @@ amd64_cygwin_core_osabi_sniffer (bfd *abfd)
>
> /* Cygwin uses elf core dumps. Do not claim all ELF executables,
> check whether there is a .reg section of proper size. */
> - if (strcmp (target_name, "elf64-x86-64") == 0)
> + if (streq (target_name, "elf64-x86-64"))
> {
> asection *section = bfd_get_section_by_name (abfd, ".reg");
> if (section != nullptr
> diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
> index 8de7655e6384..ea0b3c111f99 100644
> --- a/gdb/arch-utils.c
> +++ b/gdb/arch-utils.c
> @@ -295,7 +295,7 @@ default_floatformat_for_type (struct gdbarch *gdbarch,
> /* Check if this is a bfloat16 type. It has the same size as the
> IEEE half float type, so we use the base type name to tell them
> apart. */
> - if (name != nullptr && strcmp (name, "__bf16") == 0
> + if (name != nullptr && streq (name, "__bf16")
> && len == gdbarch_bfloat16_bit (gdbarch))
> format = gdbarch_bfloat16_format (gdbarch);
> else if (len == gdbarch_half_bit (gdbarch))
> @@ -553,7 +553,7 @@ set_architecture (const char *ignore_args,
> {
> struct gdbarch_info info;
>
> - if (strcmp (set_architecture_string, "auto") == 0)
> + if (streq (set_architecture_string, "auto"))
> {
> target_architecture_user = NULL;
> if (!gdbarch_update_p (current_inferior (), info))
> diff --git a/gdb/arm-pikeos-tdep.c b/gdb/arm-pikeos-tdep.c
> index ce7297d51bea..8b84cc3f68a1 100644
> --- a/gdb/arm-pikeos-tdep.c
> +++ b/gdb/arm-pikeos-tdep.c
> @@ -58,12 +58,10 @@ arm_pikeos_osabi_sniffer (bfd *abfd)
> {
> const char *name = bfd_asymbol_name (sym);
>
> - if (strcmp (name, "_vm_stack") == 0
> - || strcmp (name, "__p4_stack") == 0)
> + if (streq (name, "_vm_stack") || streq (name, "__p4_stack"))
> pikeos_stack_found = 1;
>
> - if (strcmp (name, "_vm_stack_size") == 0
> - || strcmp (name, "__p4_stack_end") == 0)
> + if (streq (name, "_vm_stack_size") || streq (name, "__p4_stack_end"))
> pikeos_stack_size_found = 1;
> }
>
> diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
> index dabae0aec0f0..83dc71cc9da8 100644
> --- a/gdb/arm-tdep.c
> +++ b/gdb/arm-tdep.c
> @@ -734,9 +734,9 @@ arm_pc_is_thumb (struct gdbarch *gdbarch, CORE_ADDR memaddr)
> return 1;
>
> /* If the user wants to override the symbol table, let him. */
> - if (strcmp (arm_force_mode_string, "arm") == 0)
> + if (streq (arm_force_mode_string, "arm"))
> return 0;
> - if (strcmp (arm_force_mode_string, "thumb") == 0)
> + if (streq (arm_force_mode_string, "thumb"))
> return 1;
>
> /* ARM v6-M and v7-M are always in Thumb mode. */
> @@ -754,9 +754,9 @@ arm_pc_is_thumb (struct gdbarch *gdbarch, CORE_ADDR memaddr)
> return (MSYMBOL_IS_SPECIAL (sym.minsym));
>
> /* If the user wants to override the fallback mode, let them. */
> - if (strcmp (arm_fallback_mode_string, "arm") == 0)
> + if (streq (arm_fallback_mode_string, "arm"))
> return 0;
> - if (strcmp (arm_fallback_mode_string, "thumb") == 0)
> + if (streq (arm_fallback_mode_string, "thumb"))
> return 1;
>
> /* If we couldn't find any symbol, but we're talking to a running
> @@ -9408,7 +9408,7 @@ arm_skip_stub (const frame_info_ptr &frame, CORE_ADDR pc)
> int offset = strlen (name) - 2;
>
> for (regno = 0; regno <= 14; regno++)
> - if (strcmp (&name[offset], table[regno]) == 0)
> + if (streq (&name[offset], table[regno]))
> return get_frame_register_unsigned (frame, regno);
> }
>
> @@ -9476,7 +9476,7 @@ set_fp_model_sfunc (const char *args, int from_tty,
> int fp_model;
>
> for (fp_model = ARM_FLOAT_AUTO; fp_model != ARM_FLOAT_LAST; fp_model++)
> - if (strcmp (current_fp_model, fp_model_strings[fp_model]) == 0)
> + if (streq (current_fp_model, fp_model_strings[fp_model]))
> {
> arm_fp_model = (enum arm_float_model) fp_model;
> break;
> @@ -9516,7 +9516,7 @@ arm_set_abi (const char *args, int from_tty,
> int arm_abi;
>
> for (arm_abi = ARM_ABI_AUTO; arm_abi != ARM_ABI_LAST; arm_abi++)
> - if (strcmp (arm_abi_string, arm_abi_strings[arm_abi]) == 0)
> + if (streq (arm_abi_string, arm_abi_strings[arm_abi]))
> {
> arm_abi_global = (enum arm_abi_kind) arm_abi;
> break;
> @@ -10043,7 +10043,7 @@ arm_code_of_frame_writable (struct gdbarch *gdbarch, const frame_info_ptr &frame
> static const char *
> arm_gnu_triplet_regexp (struct gdbarch *gdbarch)
> {
> - if (strcmp (gdbarch_bfd_arch_info (gdbarch)->arch_name, "arm") == 0)
> + if (streq (gdbarch_bfd_arch_info (gdbarch)->arch_name, "arm"))
> return "arm(v[^- ]*)?";
> return gdbarch_bfd_arch_info (gdbarch)->arch_name;
> }
> @@ -11010,7 +11010,7 @@ INIT_GDB_FILE (arm_tdep)
> size_t offset = strlen ("reg-names-");
> const char *style = disasm_options->name[i];
> valid_disassembly_styles[j++] = &style[offset];
> - if (strcmp (&style[offset], "std") == 0)
> + if (streq (&style[offset], "std"))
> disassembly_style = &style[offset];
> length = snprintf (rdptr, rest, "%s - %s\n", &style[offset],
> disasm_options->description[i]);
> diff --git a/gdb/arm-wince-tdep.c b/gdb/arm-wince-tdep.c
> index 39593f4c3f37..1a03e63bb681 100644
> --- a/gdb/arm-wince-tdep.c
> +++ b/gdb/arm-wince-tdep.c
> @@ -103,7 +103,7 @@ arm_wince_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
>
> if (s.minsym != NULL
> && s.minsym->linkage_name () != NULL
> - && strcmp (s.minsym->linkage_name (), "__gccmain") == 0)
> + && streq (s.minsym->linkage_name (), "__gccmain"))
> pc += 4;
> }
>
> @@ -143,7 +143,7 @@ arm_wince_osabi_sniffer (bfd *abfd)
> {
> const char *target_name = bfd_get_target (abfd);
>
> - if (strcmp (target_name, "pei-arm-wince-little") == 0)
> + if (streq (target_name, "pei-arm-wince-little"))
> return GDB_OSABI_WINCE;
>
> return GDB_OSABI_UNKNOWN;
> diff --git a/gdb/auto-load.c b/gdb/auto-load.c
> index b5fec13743cb..7bb062ed4322 100644
> --- a/gdb/auto-load.c
> +++ b/gdb/auto-load.c
> @@ -279,7 +279,7 @@ auto_load_safe_path_vec_update (void)
>
> if (debug_auto_load)
> {
> - if (strcmp (in_vec.get (), original.get ()) == 0)
> + if (streq (in_vec.get (), original.get ()))
> auto_load_debug_printf ("Using directory \"%s\".",
> in_vec.get ());
> else
> @@ -288,7 +288,7 @@ auto_load_safe_path_vec_update (void)
> }
>
> /* If gdb_realpath returns a different content, append it. */
> - if (strcmp (real_path.get (), in_vec.get ()) != 0)
> + if (!streq (real_path.get (), in_vec.get ()))
> {
> auto_load_debug_printf ("And canonicalized as \"%s\".",
> real_path.get ());
> @@ -468,12 +468,12 @@ filename_is_in_auto_load_safe_path_vec (const char *filename,
> if (*filename_realp == NULL)
> {
> *filename_realp = gdb_realpath (filename);
> - if (debug_auto_load && strcmp (filename_realp->get (), filename) != 0)
> + if (debug_auto_load && !streq (filename_realp->get (), filename))
> auto_load_debug_printf ("Resolved file \"%s\" as \"%s\".",
> filename, filename_realp->get ());
> }
>
> - if (strcmp (filename_realp->get (), filename) != 0)
> + if (!streq (filename_realp->get (), filename))
> for (const gdb::unique_xmalloc_ptr<char> &p : auto_load_safe_path_vec)
> if (filename_is_in_pattern (filename_realp->get (), p.get ()))
> {
> @@ -629,7 +629,7 @@ eq_loaded_script_entry (const void *a, const void *b)
> const struct loaded_script *ea = (const struct loaded_script *) a;
> const struct loaded_script *eb = (const struct loaded_script *) b;
>
> - return strcmp (ea->name, eb->name) == 0 && ea->language == eb->language;
> + return streq (ea->name, eb->name) && ea->language == eb->language;
> }
>
> /* Initialize the table to track loaded scripts.
> @@ -915,7 +915,7 @@ auto_load_objfile_script (struct objfile *objfile,
> (bfd_get_debug_link_info (parent->obfd.get (), &crc32));
>
> if (debuglink.get () != nullptr
> - && strcmp (debuglink.get (), lbasename (realname.get ())) != 0)
> + && !streq (debuglink.get (), lbasename (realname.get ())))
> {
> /* Replace the last component of the parent's path with the
> debuglink name. */
> @@ -1261,8 +1261,7 @@ print_script (struct loaded_script *script)
> uiout->text ("\n");
>
> /* If the name isn't the full path, print it too. */
> - if (script->full_path != NULL
> - && strcmp (script->name, script->full_path) != 0)
> + if (script->full_path != NULL && !streq (script->name, script->full_path))
> {
> uiout->text ("\tfull name: ");
> uiout->field_string ("full_path", script->full_path);
> diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
> index 8b88f69a04f2..f445a2db6ba7 100644
> --- a/gdb/avr-tdep.c
> +++ b/gdb/avr-tdep.c
> @@ -1412,7 +1412,7 @@ avr_address_class_name_to_type_flags (struct gdbarch *gdbarch,
> const char* name,
> type_instance_flags *type_flags_ptr)
> {
> - if (strcmp (name, "flash") == 0)
> + if (streq (name, "flash"))
> {
> *type_flags_ptr = AVR_TYPE_INSTANCE_FLAG_ADDRESS_CLASS_FLASH;
> return true;
> diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
> index 2a96ff1c6213..498a307c8688 100644
> --- a/gdb/ax-gdb.c
> +++ b/gdb/ax-gdb.c
> @@ -1345,7 +1345,7 @@ gen_struct_ref_recursive (struct agent_expr *ax, struct axs_value *value,
>
> if (this_name)
> {
> - if (strcmp (field, this_name) == 0)
> + if (streq (field, this_name))
> {
> /* Note that bytecodes for the struct's base (aka
> "this") will have been generated already, which will
> @@ -1486,7 +1486,7 @@ gen_struct_elt_for_reference (struct agent_expr *ax, struct axs_value *value,
> {
> const char *t_field_name = t->field (i).name ();
>
> - if (t_field_name && strcmp (t_field_name, fieldname) == 0)
> + if (t_field_name && streq (t_field_name, fieldname))
> {
> if (t->field (i).is_static ())
> {
> @@ -2478,7 +2478,7 @@ agent_eval_command_one (const char *exp, int eval, CORE_ADDR pc)
> agent_expr_up agent;
>
> arg = exp;
> - if (!eval && strcmp (arg, "$_ret") == 0)
> + if (!eval && streq (arg, "$_ret"))
> {
> agent = gen_trace_for_return_address (pc, get_current_arch (),
> trace_string);
> diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c
> index 5e1330166458..2a9e458e51cd 100644
> --- a/gdb/bfin-tdep.c
> +++ b/gdb/bfin-tdep.c
> @@ -597,7 +597,7 @@ bfin_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
>
> *size = kind;
>
> - if (strcmp (target_shortname (), "sim") == 0)
> + if (streq (target_shortname (), "sim"))
> return bfin_sim_breakpoint;
> else
> return bfin_breakpoint;
> diff --git a/gdb/break-catch-sig.c b/gdb/break-catch-sig.c
> index fbc4458145a2..ea85083b6f86 100644
> --- a/gdb/break-catch-sig.c
> +++ b/gdb/break-catch-sig.c
> @@ -87,7 +87,7 @@ signal_to_name_or_int (enum gdb_signal sig)
> {
> const char *result = gdb_signal_to_name (sig);
>
> - if (strcmp (result, "?") == 0)
> + if (streq (result, "?"))
> result = plongest (sig);
>
> return result;
> diff --git a/gdb/break-cond-parse.c b/gdb/break-cond-parse.c
> index e2283a8d59f4..4fec4dbef94f 100644
> --- a/gdb/break-cond-parse.c
> +++ b/gdb/break-cond-parse.c
> @@ -588,9 +588,9 @@ test (const char *input, const char *condition, int thread = -1,
>
> if ((condition == nullptr) != (extracted_condition.get () == nullptr)
> || (condition != nullptr
> - && strcmp (condition, extracted_condition.get ()) != 0)
> + && !streq (condition, extracted_condition.get ()))
> || (rest == nullptr) != (extracted_rest.get () == nullptr)
> - || (rest != nullptr && strcmp (rest, extracted_rest.get ()) != 0)
> + || (rest != nullptr && !streq (rest, extracted_rest.get ()))
> || thread != extracted_thread
> || inferior != extracted_inferior
> || task != extracted_task
> diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
> index a48a2ceb4f3b..d7be1b44229e 100644
> --- a/gdb/breakpoint.c
> +++ b/gdb/breakpoint.c
> @@ -4836,7 +4836,7 @@ breakpoint_about_to_proceed (void)
> static bool
> command_line_is_silent (struct command_line *cmd)
> {
> - return cmd && (strcmp ("silent", cmd->line) == 0);
> + return cmd && (streq ("silent", cmd->line));
> }
>
> /* Sets the $_hit_bpnum and $_hit_locno to bpnum and locno.
> @@ -6325,7 +6325,7 @@ wrap_indent_at_field (struct ui_out *uiout, const char *col_name)
> total_width = 0;
> for (i = 1; uiout->query_table_field (i, &width, &align, &text); i++)
> {
> - if (strcmp (text, col_name) == 0)
> + if (streq (text, col_name))
> return total_width;
>
> total_width += width + 1;
> @@ -8723,9 +8723,9 @@ update_dprintf_command_list (struct breakpoint *b)
> if (*dprintf_args != '"')
> error (_("Bad format string, missing '\"'."));
>
> - if (strcmp (dprintf_style, dprintf_style_gdb) == 0)
> + if (streq (dprintf_style, dprintf_style_gdb))
> printf_line = xstrprintf ("printf %s", dprintf_args);
> - else if (strcmp (dprintf_style, dprintf_style_call) == 0)
> + else if (streq (dprintf_style, dprintf_style_call))
> {
> if (dprintf_function.empty ())
> error (_("No function supplied for dprintf call"));
> @@ -8740,7 +8740,7 @@ update_dprintf_command_list (struct breakpoint *b)
> dprintf_function.c_str (),
> dprintf_args);
> }
> - else if (strcmp (dprintf_style, dprintf_style_agent) == 0)
> + else if (streq (dprintf_style, dprintf_style_agent))
> {
> if (target_can_run_breakpoint_commands ())
> printf_line = xstrprintf ("agent-printf %s", dprintf_args);
> @@ -13102,8 +13102,7 @@ update_breakpoint_locations (code_breakpoint *b,
> {
> for (bp_location &l : b->locations ())
> if (l.function_name
> - && strcmp (e.function_name.get (),
> - l.function_name.get ()) == 0)
> + && streq (e.function_name.get (), l.function_name.get ()))
> {
> l.enabled = e.enabled;
> break;
> diff --git a/gdb/bt-utils.c b/gdb/bt-utils.c
> index c2566931bf2f..7fc8d04f306b 100644
> --- a/gdb/bt-utils.c
> +++ b/gdb/bt-utils.c
> @@ -104,7 +104,7 @@ libbacktrace_print (void *data, uintptr_t pc, const char *filename,
> }
> sig_write ("\n");
>
> - return function != nullptr && strcmp (function, "main") == 0;
> + return function != nullptr && streq (function, "main");
> }
>
> /* Write a backtrace to GDB's stderr in an async safe manner. This is a
> diff --git a/gdb/btrace.c b/gdb/btrace.c
> index 27487f526ab5..6a8f0f549d1a 100644
> --- a/gdb/btrace.c
> +++ b/gdb/btrace.c
> @@ -196,7 +196,7 @@ ftrace_function_switched (const struct btrace_function *bfun,
>
> /* If the minimal symbol changed, we certainly switched functions. */
> if (mfun != NULL && msym != NULL
> - && strcmp (mfun->linkage_name (), msym->linkage_name ()) != 0)
> + && !streq (mfun->linkage_name (), msym->linkage_name ()))
> return 1;
>
> /* If the symbol changed, we certainly switched functions. */
> @@ -205,7 +205,7 @@ ftrace_function_switched (const struct btrace_function *bfun,
> const char *bfname, *fname;
>
> /* Check the function name. */
> - if (strcmp (fun->linkage_name (), sym->linkage_name ()) != 0)
> + if (!streq (fun->linkage_name (), sym->linkage_name ()))
> return 1;
>
> /* Check the location of those functions, as well. */
> @@ -604,7 +604,7 @@ ftrace_update_function (struct btrace_thread_info *btinfo,
> create a stack back trace with the same function names but
> different frame id's. This will confuse stepping. */
> fname = ftrace_print_function_name (bfun);
> - if (strcmp (fname, "_dl_runtime_resolve") == 0)
> + if (streq (fname, "_dl_runtime_resolve"))
> return ftrace_new_tailcall (btinfo, mfun, fun);
>
> return ftrace_new_return (btinfo, mfun, fun);
> @@ -3316,7 +3316,7 @@ maint_btrace_packet_history_cmd (const char *arg, int from_tty)
> return;
> }
>
> - if (arg == NULL || *arg == 0 || strcmp (arg, "+") == 0)
> + if (arg == NULL || *arg == 0 || streq (arg, "+"))
> {
> from = to;
>
> @@ -3324,7 +3324,7 @@ maint_btrace_packet_history_cmd (const char *arg, int from_tty)
> size = end - from;
> to = from + size;
> }
> - else if (strcmp (arg, "-") == 0)
> + else if (streq (arg, "-"))
> {
> to = from;
>
> diff --git a/gdb/c-lang.c b/gdb/c-lang.c
> index a8e3a467bec4..fdb5be7b2b7a 100644
> --- a/gdb/c-lang.c
> +++ b/gdb/c-lang.c
> @@ -90,19 +90,19 @@ classify_type (struct type *elttype, struct gdbarch *gdbarch,
> goto done;
> }
>
> - if (!strcmp (name, "wchar_t"))
> + if (streq (name, "wchar_t"))
> {
> result = C_WIDE_CHAR;
> goto done;
> }
>
> - if (!strcmp (name, "char16_t"))
> + if (streq (name, "char16_t"))
> {
> result = C_CHAR_16;
> goto done;
> }
>
> - if (!strcmp (name, "char32_t"))
> + if (streq (name, "char32_t"))
> {
> result = C_CHAR_32;
> goto done;
> diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
> index 76472c23254f..821b78becf41 100644
> --- a/gdb/c-typeprint.c
> +++ b/gdb/c-typeprint.c
> @@ -128,7 +128,7 @@ c_print_type_1 (struct type *type,
> || code == TYPE_CODE_METHODPTR
> || TYPE_IS_REFERENCE (type))))
> gdb_puts (" ", stream);
> - need_post_space = (varstring != NULL && strcmp (varstring, "") != 0);
> + need_post_space = (varstring != NULL && !streq (varstring, ""));
> c_type_print_varspec_prefix (type, stream, show, 0, need_post_space,
> language, flags, podata);
> }
> @@ -181,8 +181,7 @@ c_print_typedef (struct type *type,
> gdb_printf (stream, "typedef ");
> type_print (type, "", stream, -1);
> if ((new_symbol->type ())->name () == 0
> - || strcmp ((new_symbol->type ())->name (),
> - new_symbol->linkage_name ()) != 0
> + || !streq ((new_symbol->type ())->name (), new_symbol->linkage_name ())
> || new_symbol->type ()->code () == TYPE_CODE_TYPEDEF)
> gdb_printf (stream, " %s", new_symbol->print_name ());
> gdb_printf (stream, ";");
> @@ -1100,8 +1099,7 @@ c_type_print_base_struct_union (struct type *type, struct ui_file *stream,
> int j, len2 = TYPE_FN_FIELDLIST_LENGTH (type, i);
> const char *method_name = TYPE_FN_FIELDLIST_NAME (type, i);
> const char *name = type->name ();
> - int is_constructor = name && strcmp (method_name,
> - name) == 0;
> + int is_constructor = name != nullptr && streq (method_name, name);
>
> for (j = 0; j < len2; j++)
> {
> diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c
> index 522b42497d12..9f9f61ea2e0d 100644
> --- a/gdb/c-valprint.c
> +++ b/gdb/c-valprint.c
> @@ -38,9 +38,9 @@
> static int
> textual_name (const char *name)
> {
> - return (!strcmp (name, "wchar_t")
> - || !strcmp (name, "char16_t")
> - || !strcmp (name, "char32_t"));
> + return (streq (name, "wchar_t")
> + || streq (name, "char16_t")
> + || streq (name, "char32_t"));
> }
>
> /* Apply a heuristic to decide whether an array of TYPE or a pointer
> @@ -500,8 +500,7 @@ c_value_print (struct value *val, struct ui_file *stream,
> if (original_type->code () == TYPE_CODE_PTR
> && original_type->name () == NULL
> && original_type->target_type ()->name () != NULL
> - && (strcmp (original_type->target_type ()->name (),
> - "char") == 0
> + && (streq (original_type->target_type ()->name (), "char")
> || textual_name (original_type->target_type ()->name ())))
> {
> /* Print nothing. */
> diff --git a/gdb/charset.c b/gdb/charset.c
> index 2f0ceafd57d0..1b0725b50783 100644
> --- a/gdb/charset.c
> +++ b/gdb/charset.c
> @@ -106,16 +106,16 @@
> static iconv_t
> phony_iconv_open (const char *to, const char *from)
> {
> - if (strcmp (to, "wchar_t") && strcmp (to, GDB_DEFAULT_HOST_CHARSET))
> + if (!streq (to, "wchar_t") && !streq (to, GDB_DEFAULT_HOST_CHARSET))
> return -1;
>
> - if (!strcmp (from, "UTF-32BE") || !strcmp (from, "UTF-32"))
> + if (streq (from, "UTF-32BE") || streq (from, "UTF-32"))
> return 1;
>
> - if (!strcmp (from, "UTF-32LE"))
> + if (streq (from, "UTF-32LE"))
> return 2;
>
> - if (strcmp (from, "wchar_t") && strcmp (from, GDB_DEFAULT_HOST_CHARSET))
> + if (!streq (from, "wchar_t") && !streq (from, GDB_DEFAULT_HOST_CHARSET))
> return -1;
>
> return 0;
> @@ -232,7 +232,7 @@ show_host_charset_name (struct ui_file *file, int from_tty,
> struct cmd_list_element *c,
> const char *value)
> {
> - if (!strcmp (value, "auto"))
> + if (streq (value, "auto"))
> gdb_printf (file,
> _("The host character set is \"auto; currently %s\".\n"),
> auto_host_charset_name);
> @@ -245,7 +245,7 @@ static void
> show_target_charset_name (struct ui_file *file, int from_tty,
> struct cmd_list_element *c, const char *value)
> {
> - if (!strcmp (value, "auto"))
> + if (streq (value, "auto"))
> gdb_printf (file,
> _("The target character set is \"auto; "
> "currently %s\".\n"),
> @@ -262,7 +262,7 @@ show_target_wide_charset_name (struct ui_file *file,
> struct cmd_list_element *c,
> const char *value)
> {
> - if (!strcmp (value, "auto"))
> + if (streq (value, "auto"))
> gdb_printf (file,
> _("The target wide character set is \"auto; "
> "currently %s\".\n"),
> @@ -311,7 +311,7 @@ set_be_le_names (struct gdbarch *gdbarch)
> target_wide_charset_be_name = NULL;
>
> target_wide = target_wide_charset_name;
> - if (!strcmp (target_wide, "auto"))
> + if (streq (target_wide, "auto"))
> target_wide = gdbarch_auto_wide_charset (gdbarch);
>
> len = strlen (target_wide);
> @@ -344,7 +344,7 @@ validate (struct gdbarch *gdbarch)
> const char *target_cset = target_charset (gdbarch);
> const char *target_wide_cset = target_wide_charset_name;
>
> - if (!strcmp (target_wide_cset, "auto"))
> + if (streq (target_wide_cset, "auto"))
> target_wide_cset = gdbarch_auto_wide_charset (gdbarch);
>
> desc = iconv_open (target_wide_cset, host_cset);
> @@ -416,7 +416,7 @@ show_charset (struct ui_file *file, int from_tty,
> const char *
> host_charset (void)
> {
> - if (!strcmp (host_charset_name, "auto"))
> + if (streq (host_charset_name, "auto"))
> return auto_host_charset_name;
> return host_charset_name;
> }
> @@ -424,7 +424,7 @@ host_charset (void)
> const char *
> target_charset (struct gdbarch *gdbarch)
> {
> - if (!strcmp (target_charset_name, "auto"))
> + if (streq (target_charset_name, "auto"))
> return default_auto_charset ();
> return target_charset_name;
> }
> @@ -446,7 +446,7 @@ target_wide_charset (struct gdbarch *gdbarch)
> return target_wide_charset_le_name;
> }
>
> - if (!strcmp (target_wide_charset_name, "auto"))
> + if (streq (target_wide_charset_name, "auto"))
> return gdbarch_auto_wide_charset (gdbarch);
>
> return target_wide_charset_name;
> @@ -505,7 +505,7 @@ convert_between_encodings (const char *from, const char *to,
> unsigned int space_request;
>
> /* Often, the host and target charsets will be the same. */
> - if (!strcmp (from, to))
> + if (streq (from, to))
> {
> obstack_grow (output, bytes, num_bytes);
> return;
> @@ -1004,7 +1004,7 @@ INIT_GDB_FILE (charset)
> /* Solaris will return `646' here -- but the Solaris iconv then does
> not accept this. Darwin (and maybe FreeBSD) may return "" here,
> which GNU libiconv doesn't like (infinite loop). */
> - if (!strcmp (auto_host_charset_name, "646") || !*auto_host_charset_name)
> + if (streq (auto_host_charset_name, "646") || !*auto_host_charset_name)
> auto_host_charset_name = "ASCII";
> auto_target_charset_name = auto_host_charset_name;
> #elif defined (USE_WIN32API)
> @@ -1031,7 +1031,7 @@ INIT_GDB_FILE (charset)
> auto_target_charset_name = auto_host_charset_name;
>
> /* Windows Terminal supports Emoji when using UTF-8 output. */
> - if (strcmp (w32_host_default_charset, "UTF-8") != 0)
> + if (!streq (w32_host_default_charset, "UTF-8"))
> no_emojis ();
> }
> #endif
> @@ -1039,7 +1039,7 @@ INIT_GDB_FILE (charset)
>
> /* Recall that the first element is always "auto". */
> host_charset_name = charset_enum[0];
> - gdb_assert (strcmp (host_charset_name, "auto") == 0);
> + gdb_assert (streq (host_charset_name, "auto"));
> add_setshow_enum_cmd ("charset", class_support,
> charset_enum, &host_charset_name, _("\
> Set the host and target character sets."), _("\
> @@ -1070,7 +1070,7 @@ To see a list of the character sets GDB supports, type `set host-charset <TAB>'.
>
> /* Recall that the first element is always "auto". */
> target_charset_name = charset_enum[0];
> - gdb_assert (strcmp (target_charset_name, "auto") == 0);
> + gdb_assert (streq (target_charset_name, "auto"));
> add_setshow_enum_cmd ("target-charset", class_support,
> charset_enum, &target_charset_name, _("\
> Set the target character set."), _("\
> @@ -1085,7 +1085,7 @@ To see a list of the character sets GDB supports, type `set target-charset'<TAB>
>
> /* Recall that the first element is always "auto". */
> target_wide_charset_name = charset_enum[0];
> - gdb_assert (strcmp (target_wide_charset_name, "auto") == 0);
> + gdb_assert (streq (target_wide_charset_name, "auto"));
> add_setshow_enum_cmd ("target-wide-charset", class_support,
> charset_enum, &target_wide_charset_name,
> _("\
> diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
> index 760889fbc720..e58553245b31 100644
> --- a/gdb/cli/cli-cmds.c
> +++ b/gdb/cli/cli-cmds.c
> @@ -497,7 +497,7 @@ pwd_command (const char *args, int from_tty)
> error (_("Error finding name of working directory: %s"),
> safe_strerror (errno));
>
> - if (strcmp (cwd.get (), current_directory) != 0)
> + if (!streq (cwd.get (), current_directory))
> gdb_printf (_("Working directory %ps\n (canonically %ps).\n"),
> styled_string (file_name_style.style (),
> current_directory),
> @@ -2193,13 +2193,12 @@ alias_command (const char *args, int from_tty)
>
> if (alias_cmd != nullptr
> && alias_cmd->prefix == prefix_cmd
> - && strcmp (alias_name, alias_cmd->name) == 0)
> + && streq (alias_name, alias_cmd->name))
> error (_("Alias already exists: %s"), alias);
>
> /* Check ALIAS differs from the found CMD. */
>
> - if (cmd->prefix == prefix_cmd
> - && strcmp (alias_name, cmd->name) == 0)
> + if (cmd->prefix == prefix_cmd && streq (alias_name, cmd->name))
> error (_("Alias %s is the name of an existing command"), alias);
> }
> }
> diff --git a/gdb/cli/cli-decode.c b/gdb/cli/cli-decode.c
> index 285f5f1f0c40..de40faeed591 100644
> --- a/gdb/cli/cli-decode.c
> +++ b/gdb/cli/cli-decode.c
> @@ -1528,7 +1528,7 @@ delete_cmd (const char *name, struct cmd_list_element **list,
>
> for (iter = *previous_chain_ptr; iter; iter = *previous_chain_ptr)
> {
> - if (strcmp (iter->name, name) == 0)
> + if (streq (iter->name, name))
> {
> if (iter->destroyer)
> iter->destroyer (iter, iter->context ());
> @@ -1638,8 +1638,7 @@ user_documented_alias (const cmd_list_element &alias)
> gdb_assert (alias.is_alias ());
> /* Alias is user documented if it has an allocated documentation
> that differs from the aliased command. */
> - return (alias.doc_allocated
> - && strcmp (alias.doc, alias.alias_target->doc) != 0);
> + return alias.doc_allocated && !streq (alias.doc, alias.alias_target->doc);
> }
>
> /* Print the definition of alias C using title style for alias
> @@ -1838,7 +1837,7 @@ help_cmd (const char *command, struct ui_file *stream)
> return;
> }
>
> - if (strcmp (command, "all") == 0)
> + if (streq (command, "all"))
> {
> help_all (stream);
> return;
> @@ -2502,7 +2501,7 @@ lookup_cmd_exact (const char *name,
> const char *tem = name;
> struct cmd_list_element *cmd = lookup_cmd (&tem, list, "", NULL, -1,
> ignore_help_classes);
> - if (cmd != nullptr && strcmp (name, cmd->name) != 0)
> + if (cmd != nullptr && !streq (name, cmd->name))
> cmd = nullptr;
> return cmd;
> }
> diff --git a/gdb/cli/cli-dump.c b/gdb/cli/cli-dump.c
> index 3084aa111288..59c5827c0939 100644
> --- a/gdb/cli/cli-dump.c
> +++ b/gdb/cli/cli-dump.c
> @@ -193,7 +193,7 @@ dump_memory_to_file (const char *cmd, const char *mode, const char *file_format)
> read_memory (lo, buf.data (), count);
>
> /* Have everything. Open/write the data. */
> - if (file_format == NULL || strcmp (file_format, "binary") == 0)
> + if (file_format == NULL || streq (file_format, "binary"))
> dump_binary_file (filename.get (), mode, buf.data (), count);
> else
> dump_bfd_file (filename.get (), mode, file_format, lo, buf.data (), count);
> @@ -221,7 +221,7 @@ dump_value_to_file (const char *cmd, const char *mode, const char *file_format)
> error (_("Invalid expression."));
>
> /* Have everything. Open/write the data. */
> - if (file_format == NULL || strcmp (file_format, "binary") == 0)
> + if (file_format == NULL || streq (file_format, "binary"))
> dump_binary_file (filename.get (), mode, val->contents ().data (),
> val->type ()->length ());
> else
> diff --git a/gdb/cli/cli-option.c b/gdb/cli/cli-option.c
> index 24409d0e0075..ded79adaa141 100644
> --- a/gdb/cli/cli-option.c
> +++ b/gdb/cli/cli-option.c
> @@ -588,12 +588,12 @@ complete_options (completion_tracker &tracker,
> *args = skip_spaces (*args);
> completion_info.word = *args;
>
> - if (strcmp (*args, "-") == 0)
> + if (streq (*args, "-"))
> {
> complete_on_options (options_group, tracker, *args + 1,
> completion_info.word);
> }
> - else if (strcmp (*args, "--") == 0)
> + else if (streq (*args, "--"))
> {
> tracker.add_completion (make_unique_xstrdup (*args));
> }
> diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
> index e403f7e9b5e7..253e63af570f 100644
> --- a/gdb/cli/cli-script.c
> +++ b/gdb/cli/cli-script.c
> @@ -1662,7 +1662,7 @@ commands_equal (const command_line *a, const command_line *b)
> }
>
> /* Check lines are identical. */
> - if (a->line != nullptr && strcmp (a->line, b->line) != 0)
> + if (a->line != nullptr && !streq (a->line, b->line))
> return false;
>
> /* Check body_list_0. */
> diff --git a/gdb/cli/cli-style.c b/gdb/cli/cli-style.c
> index ac4fb27e725b..272e857c2a5e 100644
> --- a/gdb/cli/cli-style.c
> +++ b/gdb/cli/cli-style.c
> @@ -89,13 +89,13 @@ terminal_supports_styling ()
> /* Windows doesn't by default define $TERM, but can support styles
> regardless. */
> #ifndef _WIN32
> - if (term == nullptr || strcmp (term, "dumb") == 0)
> + if (term == nullptr || streq (term, "dumb"))
> return false;
> #else
> /* But if they do define $TERM, let us behave the same as on Posix
> platforms, for the benefit of programs which invoke GDB as their
> back-end. */
> - if (term != nullptr && strcmp (term, "dumb") == 0)
> + if (term != nullptr && streq (term, "dumb"))
> return false;
> #endif
>
> @@ -438,7 +438,7 @@ emojis_ok ()
> return false;
> if (emoji_styling == AUTO_BOOLEAN_TRUE)
> return true;
> - return strcmp (host_charset (), "UTF-8") == 0;
> + return streq (host_charset (), "UTF-8");
> }
>
> /* See cli-style.h. */
> diff --git a/gdb/coff-pe-read.c b/gdb/coff-pe-read.c
> index 5073a4b0c4b7..48963ff8d054 100644
> --- a/gdb/coff-pe-read.c
> +++ b/gdb/coff-pe-read.c
> @@ -71,17 +71,17 @@ struct read_pe_section_data
> static int
> read_pe_section_index (const char *section_name)
> {
> - if (strcmp (section_name, ".text") == 0)
> + if (streq (section_name, ".text"))
> {
> return PE_SECTION_INDEX_TEXT;
> }
>
> - else if (strcmp (section_name, ".data") == 0)
> + else if (streq (section_name, ".data"))
> {
> return PE_SECTION_INDEX_DATA;
> }
>
> - else if (strcmp (section_name, ".bss") == 0)
> + else if (streq (section_name, ".bss"))
> {
> return PE_SECTION_INDEX_BSS;
> }
> @@ -336,15 +336,15 @@ read_pe_exported_syms (minimal_symbol_reader &reader,
> section_data[PE_SECTION_INDEX_BSS].ms_type = mst_bss;
> section_data[PE_SECTION_INDEX_BSS].section_name = ".bss";
>
> - is_pe64 = (strcmp (target, "pe-x86-64") == 0
> - || strcmp (target, "pei-x86-64") == 0
> - || strcmp (target, "pe-aarch64") == 0
> - || strcmp (target, "pei-aarch64") == 0
> - || strcmp (target, "pei-aarch64-little") == 0);
> - is_pe32 = (strcmp (target, "pe-i386") == 0
> - || strcmp (target, "pei-i386") == 0
> - || strcmp (target, "pe-arm-wince-little") == 0
> - || strcmp (target, "pei-arm-wince-little") == 0);
> + is_pe64 = (streq (target, "pe-x86-64")
> + || streq (target, "pei-x86-64")
> + || streq (target, "pe-aarch64")
> + || streq (target, "pei-aarch64")
> + || streq (target, "pei-aarch64-little"));
> + is_pe32 = (streq (target, "pe-i386")
> + || streq (target, "pei-i386")
> + || streq (target, "pe-arm-wince-little")
> + || streq (target, "pei-arm-wince-little"));
>
> /* Possibly print a debug message about DLL not having a valid format. */
> auto maybe_print_debug_msg = [&] () -> void {
> @@ -406,10 +406,10 @@ read_pe_exported_syms (minimal_symbol_reader &reader,
> || bfd_read (sname, sizeof (sname), dll) != sizeof (sname))
> return maybe_print_debug_msg ();
>
> - if ((strcmp (sname, ".edata") == 0)
> + if (streq (sname, ".edata")
> || (vaddr <= export_opthdrrva && export_opthdrrva < vaddr + vsize))
> {
> - if (strcmp (sname, ".edata") != 0)
> + if (!streq (sname, ".edata"))
> {
> if (debug_coff_pe_read)
> gdb_printf (gdb_stdlog, _("Export RVA for dll "
> @@ -636,15 +636,15 @@ pe_text_section_offset (struct bfd *abfd)
>
> target = bfd_get_target (abfd);
>
> - is_pe64 = (strcmp (target, "pe-x86-64") == 0
> - || strcmp (target, "pei-x86-64") == 0
> - || strcmp (target, "pe-aarch64") == 0
> - || strcmp (target, "pei-aarch64") == 0
> - || strcmp (target, "pei-aarch64-little") == 0);
> - is_pe32 = (strcmp (target, "pe-i386") == 0
> - || strcmp (target, "pei-i386") == 0
> - || strcmp (target, "pe-arm-wince-little") == 0
> - || strcmp (target, "pei-arm-wince-little") == 0);
> + is_pe64 = (streq (target, "pe-x86-64")
> + || streq (target, "pei-x86-64")
> + || streq (target, "pe-aarch64")
> + || streq (target, "pei-aarch64")
> + || streq (target, "pei-aarch64-little"));
> + is_pe32 = (streq (target, "pe-i386")
> + || streq (target, "pei-i386")
> + || streq (target, "pe-arm-wince-little")
> + || streq (target, "pei-arm-wince-little"));
>
> if (!is_pe32 && !is_pe64)
> {
> @@ -677,7 +677,7 @@ pe_text_section_offset (struct bfd *abfd)
> || bfd_read (sname, SCNNMLEN, abfd) != SCNNMLEN)
> return DEFAULT_COFF_PE_TEXT_SECTION_OFFSET;
> sname[SCNNMLEN] = '\0';
> - if (strcmp (sname, ".text") == 0)
> + if (streq (sname, ".text"))
> return vaddr;
> }
>
> diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object-load.c
> index bbee2f7cc560..fe48979e4f68 100644
> --- a/gdb/compile/compile-object-load.c
> +++ b/gdb/compile/compile-object-load.c
> @@ -561,7 +561,7 @@ store_regs (struct type *regs_type, CORE_ADDR regs_base)
> struct value *regval;
> CORE_ADDR inferior_addr;
>
> - if (strcmp (reg_name, COMPILE_I_SIMPLE_REGISTER_DUMMY) == 0)
> + if (streq (reg_name, COMPILE_I_SIMPLE_REGISTER_DUMMY))
> continue;
>
> if ((reg_bitpos % 8) != 0 || reg_bitsize != 0)
> @@ -694,7 +694,7 @@ compile_object_load (const compile_file_names &file_names,
> continue;
> sym->flags = BSF_GLOBAL;
> sym->section = bfd_abs_section_ptr;
> - if (strcmp (sym->name, "_GLOBAL_OFFSET_TABLE_") == 0)
> + if (streq (sym->name, "_GLOBAL_OFFSET_TABLE_"))
> {
> if (compile_debug)
> gdb_printf (gdb_stdlog,
> @@ -707,7 +707,7 @@ compile_object_load (const compile_file_names &file_names,
> sym->value = 0;
> continue;
> }
> - if (strcmp (sym->name, ".TOC.") == 0)
> + if (streq (sym->name, ".TOC."))
> {
> /* Handle the .TOC. symbol as the linker would do. Set the .TOC.
> sections value to 0x8000 (see bfd/elf64-ppc.c TOC_BASE_OFF);
> diff --git a/gdb/compile/compile.c b/gdb/compile/compile.c
> index 2a9702ee8526..a64297bcbe1c 100644
> --- a/gdb/compile/compile.c
> +++ b/gdb/compile/compile.c
> @@ -462,7 +462,7 @@ filter_args (char **argv)
> for (destv = argv; *argv != NULL; argv++)
> {
> /* -fpreprocessed may get in commonly from ccache. */
> - if (strcmp (*argv, "-fpreprocessed") == 0)
> + if (streq (*argv, "-fpreprocessed"))
> {
> xfree (*argv);
> continue;
> @@ -767,7 +767,7 @@ compile_register_name_demangle (struct gdbarch *gdbarch,
> regname += 2;
>
> for (regnum = 0; regnum < gdbarch_num_regs (gdbarch); regnum++)
> - if (strcmp (regname, gdbarch_register_name (gdbarch, regnum)) == 0)
> + if (streq (regname, gdbarch_register_name (gdbarch, regnum)))
> return regnum;
>
> error (_("Cannot find gdbarch register \"%s\"."), regname);
> diff --git a/gdb/completer.c b/gdb/completer.c
> index 01c607c3850c..8c70a61cdec6 100644
> --- a/gdb/completer.c
> +++ b/gdb/completer.c
> @@ -90,7 +90,7 @@ class completion_tracker::completion_hash_entry
> /* Return true of the name in this hash entry is STR. */
> bool is_name_eq (const char *str) const
> {
> - return strcmp (m_name.get (), str) == 0;
> + return streq (m_name.get (), str);
> }
>
> /* Return the hash value based on the name of the entry. */
> @@ -2200,7 +2200,7 @@ signal_completer (struct cmd_list_element *ignore,
> signame = gdb_signal_to_name ((enum gdb_signal) signum);
>
> /* Ignore the unknown signal case. */
> - if (!signame || strcmp (signame, "?") == 0)
> + if (!signame || streq (signame, "?"))
> continue;
>
> if (strncasecmp (signame, word, len) == 0)
> diff --git a/gdb/corelow.c b/gdb/corelow.c
> index f6e8179d1f40..79b902118fab 100644
> --- a/gdb/corelow.c
> +++ b/gdb/corelow.c
> @@ -1345,13 +1345,13 @@ get_core_registers_cb (const char *sect_name, int supply_size, int collect_size,
> if (!variable_size_section)
> gdb_assert (supply_size == collect_size);
>
> - if (strcmp (sect_name, ".reg") == 0)
> + if (streq (sect_name, ".reg"))
> {
> required = true;
> if (human_name == NULL)
> human_name = "general-purpose";
> }
> - else if (strcmp (sect_name, ".reg2") == 0)
> + else if (streq (sect_name, ".reg2"))
> {
> if (human_name == NULL)
> human_name = "floating-point";
> diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c
> index 4c2429dafc7b..a2189579cb5e 100644
> --- a/gdb/cp-abi.c
> +++ b/gdb/cp-abi.c
> @@ -284,7 +284,7 @@ set_cp_abi_as_auto_default (const char *short_name)
> /* Since we copy the current ABI into current_cp_abi instead of
> using a pointer, if auto is currently the default, we need to
> reset it. */
> - if (strcmp (current_cp_abi.shortname, "auto") == 0)
> + if (streq (current_cp_abi.shortname, "auto"))
> switch_to_cp_abi ("auto");
> }
>
> @@ -296,7 +296,7 @@ find_cp_abi (const char *short_name)
> int i;
>
> for (i = 0; i < num_cp_abis; i++)
> - if (strcmp (cp_abis[i]->shortname, short_name) == 0)
> + if (streq (cp_abis[i]->shortname, short_name))
> return cp_abis[i];
>
> return NULL;
> diff --git a/gdb/cp-name-parser.y b/gdb/cp-name-parser.y
> index fe3c6dce8ca4..4be50599762e 100644
> --- a/gdb/cp-name-parser.y
> +++ b/gdb/cp-name-parser.y
> @@ -2092,7 +2092,7 @@ should_be_the_same (const char *one, const char *two)
> if (cptwo != nullptr)
> two = cptwo.get ();
>
> - SELF_CHECK (strcmp (one, two) == 0);
> + SELF_CHECK (streq (one, two));
> }
>
> static void
> diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c
> index efdb2a2c850a..c8cd5c245aa7 100644
> --- a/gdb/cp-namespace.c
> +++ b/gdb/cp-namespace.c
> @@ -431,7 +431,7 @@ cp_lookup_symbol_via_imports (const char *scope,
> && (len == 0
> || scope[len] == ':'
> || scope[len] == '\0'))
> - : strcmp (scope, current->import_dest) == 0);
> + : streq (scope, current->import_dest));
>
> /* If the import destination is the current scope or one of its
> ancestors then it is applicable. */
> @@ -447,9 +447,10 @@ cp_lookup_symbol_via_imports (const char *scope,
> with the sought out name. If there is a match pass
> current->import_src as NAMESPACE to direct the search
> towards the imported namespace. */
> - if (current->declaration
> - && strcmp (name, current->alias
> - ? current->alias : current->declaration) == 0)
> + if (current->declaration != nullptr
> + && streq (name, (current->alias != nullptr
> + ? current->alias
> + : current->declaration)))
> sym = cp_lookup_symbol_in_namespace (current->import_src,
> current->declaration,
> block, domain, 1);
> @@ -467,13 +468,12 @@ cp_lookup_symbol_via_imports (const char *scope,
>
> /* Do not follow CURRENT if NAME matches its EXCLUDES. */
> for (excludep = current->excludes; *excludep; excludep++)
> - if (strcmp (name, *excludep) == 0)
> + if (streq (name, *excludep))
> break;
> if (*excludep)
> continue;
>
> - if (current->alias != NULL
> - && strcmp (name, current->alias) == 0)
> + if (current->alias != nullptr && streq (name, current->alias))
> /* If the import is creating an alias and the alias matches
> the sought name. Pass current->import_src as the NAME to
> direct the search towards the aliased namespace. */
> diff --git a/gdb/cp-support.c b/gdb/cp-support.c
> index 5dfb2a785055..d321986f72da 100644
> --- a/gdb/cp-support.c
> +++ b/gdb/cp-support.c
> @@ -110,9 +110,9 @@ cp_already_canonical (const char *string)
> /* These are the only two identifiers which canonicalize to other
> than themselves or an error: unsigned -> unsigned int and
> signed -> int. */
> - if (string[0] == 'u' && strcmp (&string[1], "nsigned") == 0)
> + if (string[0] == 'u' && streq (&string[1], "nsigned"))
> return 0;
> - else if (string[0] == 's' && strcmp (&string[1], "igned") == 0)
> + else if (string[0] == 's' && streq (&string[1], "igned"))
> return 0;
>
> /* Identifier character [a-zA-Z0-9_]. */
> @@ -165,7 +165,7 @@ inspect_type (struct demangle_parse_info *info,
> {
> const char *new_name = (*finder) (otype, data);
>
> - if (new_name != nullptr && strcmp (new_name, name) != 0)
> + if (new_name != nullptr && !streq (new_name, name))
> {
> ret_comp->u.s_name.s = new_name;
> ret_comp->u.s_name.len = strlen (new_name);
> @@ -200,8 +200,7 @@ inspect_type (struct demangle_parse_info *info,
>
> If the symbol is typedef and its type name is the same
> as the symbol's name, e.g., "typedef struct foo foo;". */
> - if (type->name () != nullptr
> - && strcmp (type->name (), name) == 0)
> + if (type->name () != nullptr && streq (type->name (), name))
> return 0;
>
> is_anon = (type->name () == NULL
> @@ -617,7 +616,7 @@ cp_canonicalize_string_full (const char *string,
>
> /* Finally, compare the original string with the computed
> name, returning NULL if they are the same. */
> - if (strcmp (us.get (), string) == 0)
> + if (streq (us.get (), string))
> return nullptr;
>
> return us;
> @@ -666,7 +665,7 @@ cp_canonicalize_string (const char *string)
> if (info->added_parens)
> maybe_strip_parens (us.get ());
>
> - if (strcmp (us.get (), string) == 0)
> + if (streq (us.get (), string))
> return nullptr;
>
> return us;
> @@ -1239,7 +1238,7 @@ overload_list_add_symbol (struct symbol *sym,
>
> /* skip any symbols that we've already considered. */
> for (symbol *listed_sym : *overload_list)
> - if (strcmp (sym->linkage_name (), listed_sym->linkage_name ()) == 0)
> + if (streq (sym->linkage_name (), listed_sym->linkage_name ()))
> return;
>
> /* Get the demangled name without parameters */
> @@ -1249,7 +1248,7 @@ overload_list_add_symbol (struct symbol *sym,
> return;
>
> /* skip symbols that cannot match */
> - if (strcmp (sym_name.get (), oload_name) != 0)
> + if (!streq (sym_name.get (), oload_name))
> return;
>
> overload_list->push_back (sym);
> @@ -1429,7 +1428,7 @@ add_symbol_overload_list_using (const char *func_name,
> if (current->alias != NULL || current->declaration != NULL)
> continue;
>
> - if (strcmp (the_namespace, current->import_dest) == 0)
> + if (streq (the_namespace, current->import_dest))
> {
> /* Mark this import as searched so that the recursive call
> does not search it again. */
> @@ -2206,9 +2205,8 @@ check_remove_params (const char *file, int line,
> gdb::unique_xmalloc_ptr<char> result
> = cp_remove_params_if_any (name, completion_mode);
>
> - if ((expected == NULL) != (result == NULL)
> - || (expected != NULL
> - && strcmp (result.get (), expected) != 0))
> + if ((expected == nullptr) != (result == nullptr)
> + || (expected != nullptr && !streq (result.get (), expected)))
> {
> error (_("%s:%d: make-paramless self-test failed: (completion=%d) "
> "\"%s\" -> %s, expected %s"),
> diff --git a/gdb/cp-valprint.c b/gdb/cp-valprint.c
> index 54b992b3b21e..349a0d6bf9e9 100644
> --- a/gdb/cp-valprint.c
> +++ b/gdb/cp-valprint.c
> @@ -66,7 +66,7 @@ cp_is_vtbl_ptr_type (struct type *type)
> {
> const char *type_name = type->name ();
>
> - return (type_name != NULL && !strcmp (type_name, vtbl_ptr_name));
> + return (type_name != NULL && streq (type_name, vtbl_ptr_name));
> }
>
> /* Return truth value for the assertion that TYPE is of the type
> @@ -247,7 +247,7 @@ cp_print_value_fields (struct value *val, struct ui_file *stream,
>
> /* Do not print leading '=' in case of anonymous
> unions. */
> - if (strcmp (type->field (i).name (), ""))
> + if (!streq (type->field (i).name (), ""))
> gdb_puts (" = ", stream);
> else
> {
> diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c
> index 33b99bb35e62..e86f79a42eaf 100644
> --- a/gdb/csky-tdep.c
> +++ b/gdb/csky-tdep.c
> @@ -2455,14 +2455,11 @@ csky_dwarf_reg_to_regnum (struct gdbarch *gdbarch, int dw_reg)
> static int
> csky_essential_reg_check (const struct csky_supported_tdesc_register *reg)
> {
> - if ((strcmp (reg->name , "pc") == 0)
> - && (reg->num == CSKY_PC_REGNUM))
> + if (streq (reg->name, "pc") && reg->num == CSKY_PC_REGNUM)
> return CSKY_TDESC_REGS_PC_NUMBERED;
> - else if ((strcmp (reg->name , "r14") == 0)
> - && (reg->num == CSKY_SP_REGNUM))
> + else if (streq (reg->name, "r14") && reg->num == CSKY_SP_REGNUM)
> return CSKY_TDESC_REGS_SP_NUMBERED;
> - else if ((strcmp (reg->name , "r15") == 0)
> - && (reg->num == CSKY_LR_REGNUM))
> + else if (streq (reg->name, "r15") && reg->num == CSKY_LR_REGNUM)
> return CSKY_TDESC_REGS_LR_NUMBERED;
> else
> return 0;
> @@ -2474,11 +2471,9 @@ static int
> csky_fr0_fr15_reg_check (const struct csky_supported_tdesc_register *reg) {
> int i = 0;
> for (i = 0; i < 16; i++)
> - {
> - if ((strcmp (reg->name, csky_supported_fpu_regs[i].name) == 0)
> - && (csky_supported_fpu_regs[i].num == reg->num))
> - return (1 << i);
> - }
> + if (streq (reg->name, csky_supported_fpu_regs[i].name)
> + && csky_supported_fpu_regs[i].num == reg->num)
> + return 1 << i;
>
> return 0;
> };
> @@ -2489,11 +2484,9 @@ static int
> csky_fr16_fr31_reg_check (const struct csky_supported_tdesc_register *reg) {
> int i = 0;
> for (i = 0; i < 16; i++)
> - {
> - if ((strcmp (reg->name, csky_supported_fpu_regs[i + 16].name) == 0)
> - && (csky_supported_fpu_regs[i + 16].num == reg->num))
> - return (1 << i);
> - }
> + if (streq (reg->name, csky_supported_fpu_regs[i + 16].name)
> + && csky_supported_fpu_regs[i + 16].num == reg->num)
> + return (1 << i);
>
> return 0;
> };
> @@ -2504,11 +2497,9 @@ static int
> csky_vr0_vr15_reg_check (const struct csky_supported_tdesc_register *reg) {
> int i = 0;
> for (i = 0; i < 16; i++)
> - {
> - if ((strcmp (reg->name, csky_supported_fpu_regs[i + 32].name) == 0)
> - && (csky_supported_fpu_regs[i + 32].num == reg->num))
> - return (1 << i);
> - }
> + if (streq (reg->name, csky_supported_fpu_regs[i + 32].name)
> + && csky_supported_fpu_regs[i + 32].num == reg->num)
> + return (1 << i);
>
> return 0;
> };
> diff --git a/gdb/ctfread.c b/gdb/ctfread.c
> index 3de7e8d54efa..b95cdbed33c9 100644
> --- a/gdb/ctfread.c
> +++ b/gdb/ctfread.c
> @@ -543,7 +543,7 @@ read_base_type (struct ctf_context *ccp, ctf_id_t tid)
> type = alloc.new_type (TYPE_CODE_ERROR, cet.cte_bits, name);
> }
>
> - if (name != nullptr && strcmp (name, "char") == 0)
> + if (name != nullptr && streq (name, "char"))
> type->set_has_no_signedness (true);
>
> return set_tid_type (ccp, tid, type);
> @@ -1139,7 +1139,7 @@ ctf_add_var_cb (const char *name, ctf_id_t id, void *arg)
> if (kind == CTF_K_FUNCTION)
> {
> sym->set_domain (FUNCTION_DOMAIN);
> - if (name != nullptr && strcmp (name, "main") == 0)
> + if (name != nullptr && streq (name, "main"))
> set_objfile_main_name (objfile, name, language_c);
> }
> else
> @@ -1233,12 +1233,12 @@ build_ctf_archive_member (ctf_dict_t *dict, const char *name, void *arg)
> auto *iter_data = static_cast<ctf_archive_iter_data *> (arg);
> ctf_per_objfile &per_objfile = iter_data->per_objfile;
>
> - if (strcmp (name, ".ctf") != 0)
> + if (!streq (name, ".ctf"))
> ctf_import (dict, per_objfile.parent_dict.get ());
>
> objfile *objfile = per_objfile.objfile;
>
> - if (strcmp (name, ".ctf") == 0)
> + if (streq (name, ".ctf"))
> {
> name = bfd_get_filename (objfile->obfd.get ());
> ctf_debug_printf ("is parent, using name='%s'", name);
> diff --git a/gdb/d-namespace.c b/gdb/d-namespace.c
> index 575db0c08b70..34b90c0ed938 100644
> --- a/gdb/d-namespace.c
> +++ b/gdb/d-namespace.c
> @@ -378,7 +378,7 @@ d_lookup_symbol_imports (const char *scope, const char *name,
> const char **excludep;
>
> /* If the import destination is the current scope then search it. */
> - if (!current->searched && strcmp (scope, current->import_dest) == 0)
> + if (!current->searched && streq (scope, current->import_dest))
> {
> /* Mark this import as searched so that the recursive call
> does not search it again. */
> @@ -390,9 +390,10 @@ d_lookup_symbol_imports (const char *scope, const char *name,
> with the sought out name. If there is a match pass
> current->import_src as MODULE to direct the search towards
> the imported module. */
> - if (current->declaration
> - && strcmp (name, current->alias
> - ? current->alias : current->declaration) == 0)
> + if (current->declaration != nullptr
> + && streq (name, (current->alias != nullptr
> + ? current->alias
> + : current->declaration)))
> sym = d_lookup_symbol_in_module (current->import_src,
> current->declaration,
> block, domain, 1);
> @@ -409,7 +410,7 @@ d_lookup_symbol_imports (const char *scope, const char *name,
>
> /* Do not follow CURRENT if NAME matches its EXCLUDES. */
> for (excludep = current->excludes; *excludep; excludep++)
> - if (strcmp (name, *excludep) == 0)
> + if (streq (name, *excludep))
> break;
> if (*excludep)
> continue;
> @@ -417,7 +418,7 @@ d_lookup_symbol_imports (const char *scope, const char *name,
> /* If the import statement is creating an alias. */
> if (current->alias != NULL)
> {
> - if (strcmp (name, current->alias) == 0)
> + if (streq (name, current->alias))
> {
> /* If the alias matches the sought name. Pass
> current->import_src as the NAME to direct the
> diff --git a/gdb/d-valprint.c b/gdb/d-valprint.c
> index a3dd80a10ec0..6e5757192da7 100644
> --- a/gdb/d-valprint.c
> +++ b/gdb/d-valprint.c
> @@ -35,8 +35,8 @@ dynamic_array_type (struct type *type,
> {
> if (type->num_fields () == 2
> && type->field (0).type ()->code () == TYPE_CODE_INT
> - && strcmp (type->field (0).name (), "length") == 0
> - && strcmp (type->field (1).name (), "ptr") == 0
> + && streq (type->field (0).name (), "length")
> + && streq (type->field (1).name (), "ptr")
> && !val->bits_any_optimized_out (TARGET_CHAR_BIT * embedded_offset,
> TARGET_CHAR_BIT * type->length ()))
> {
> diff --git a/gdb/darwin-nat-info.c b/gdb/darwin-nat-info.c
> index d274c4a4fcc4..d1befa7d8c36 100644
> --- a/gdb/darwin-nat-info.c
> +++ b/gdb/darwin-nat-info.c
> @@ -123,7 +123,7 @@ get_task_from_args (const char *args)
>
> return priv->task;
> }
> - if (strcmp (args, "gdb") == 0)
> + if (streq (args, "gdb"))
> return mach_task_self ();
> task = strtoul (args, &eptr, 0);
> if (*eptr)
> @@ -799,7 +799,7 @@ info_mach_exceptions_command (const char *args, int from_tty)
>
> if (args != NULL)
> {
> - if (strcmp (args, "saved") == 0)
> + if (streq (args, "saved"))
> {
> if (inferior_ptid == null_ptid)
> gdb_printf (_("No inferior running\n"));
> @@ -809,7 +809,7 @@ info_mach_exceptions_command (const char *args, int from_tty)
> disp_exception (&priv->exception_info);
> return;
> }
> - else if (strcmp (args, "host") == 0)
> + else if (streq (args, "host"))
> {
> /* FIXME: This needs a privileged host port! */
> kret = host_get_exception_ports
> diff --git a/gdb/dicos-tdep.c b/gdb/dicos-tdep.c
> index f6a071184d66..805889174d13 100644
> --- a/gdb/dicos-tdep.c
> +++ b/gdb/dicos-tdep.c
> @@ -80,7 +80,7 @@ dicos_load_module_p (bfd *abfd, int header_size)
> {
> if (sym->name != NULL
> && symname[0] == sym->name[0]
> - && strcmp (symname + 1, sym->name + 1) == 0)
> + && streq (symname + 1, sym->name + 1))
> {
> ret = 1;
> break;
> diff --git a/gdb/dictionary.c b/gdb/dictionary.c
> index e3ff053504ee..4c3d87823680 100644
> --- a/gdb/dictionary.c
> +++ b/gdb/dictionary.c
> @@ -791,7 +791,7 @@ language_defn::search_name_hash (const char *string0) const
> ignore the "TKB" suffix because searches for this task body
> subprogram are going to be performed using `pck__t' (the encoded
> version of the natural name `pck.t'). */
> - if (strcmp (string, "TKB") == 0)
> + if (streq (string, "TKB"))
> return hash;
> break;
> }
> diff --git a/gdb/disasm.c b/gdb/disasm.c
> index 17f281138b2c..81c466c188af 100644
> --- a/gdb/disasm.c
> +++ b/gdb/disasm.c
> @@ -1311,7 +1311,7 @@ set_disassembler_options (const char *prospective_options)
> if (valid_options->arg[i]->values == NULL)
> break;
> for (j = 0; valid_options->arg[i]->values[j] != NULL; j++)
> - if (strcmp (arg, valid_options->arg[i]->values[j]) == 0)
> + if (streq (arg, valid_options->arg[i]->values[j]))
> {
> found = true;
> break;
> @@ -1319,7 +1319,7 @@ set_disassembler_options (const char *prospective_options)
> if (found)
> break;
> }
> - else if (strcmp (opt, valid_options->name[i]) == 0)
> + else if (streq (opt, valid_options->name[i]))
> break;
> if (valid_options->name[i] == NULL)
> {
> diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c
> index b42afea5a173..e69e6f754b4b 100644
> --- a/gdb/dtrace-probe.c
> +++ b/gdb/dtrace-probe.c
> @@ -846,7 +846,7 @@ dtrace_static_probe_ops::get_probes
> that sh_type == SHT_SUNW_dof. Therefore, in addition to the sh_type
> check, we need to check for sections named .sframe. */
> if (elf_section_data (sect)->this_hdr.sh_type == SHT_SUNW_dof
> - && strcmp (bfd_section_name (sect), ".sframe") != 0)
> + && !streq (bfd_section_name (sect), ".sframe"))
> {
> bfd_byte *dof;
>
> diff --git a/gdb/dwarf2/cooked-index-shard.c b/gdb/dwarf2/cooked-index-shard.c
> index 938ee8f29694..91dc9ab89455 100644
> --- a/gdb/dwarf2/cooked-index-shard.c
> +++ b/gdb/dwarf2/cooked-index-shard.c
> @@ -104,7 +104,7 @@ cooked_index_shard::add (sect_offset die_offset, enum dwarf_tag tag,
> && parent_entry.resolved == nullptr
> && m_main == nullptr
> && language_may_use_plain_main (lang)
> - && strcmp (name, "main") == 0)
> + && streq (name, "main"))
> m_main = result;
>
> return result;
> diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c
> index 9e84e5e65faf..167e39ffc89a 100644
> --- a/gdb/dwarf2/cooked-index.c
> +++ b/gdb/dwarf2/cooked-index.c
> @@ -197,7 +197,7 @@ cooked_index::get_main () const
> exception. */
> if ((entry->lang != language_ada
> && entry->lang != language_cplus)
> - || strcmp (entry->name, "main") == 0)
> + || streq (entry->name, "main"))
> {
> /* There won't be one better than this. */
> return entry;
> diff --git a/gdb/dwarf2/cooked-indexer.c b/gdb/dwarf2/cooked-indexer.c
> index 1848b92e2cab..302b4a6d6a0b 100644
> --- a/gdb/dwarf2/cooked-indexer.c
> +++ b/gdb/dwarf2/cooked-indexer.c
> @@ -554,7 +554,7 @@ cooked_indexer::index_dies (cutu_reader *reader,
>
> if (abbrev->tag == DW_TAG_namespace
> && m_language == language_cplus
> - && strcmp (name, "::") == 0)
> + && streq (name, "::"))
> {
> /* GCC 4.0 and 4.1 had a bug (PR c++/28460) where they
> generated bogus DW_TAG_namespace DIEs with a name of "::"
> diff --git a/gdb/dwarf2/cu.c b/gdb/dwarf2/cu.c
> index 7dca05b3a810..c3bfd15f14a1 100644
> --- a/gdb/dwarf2/cu.c
> +++ b/gdb/dwarf2/cu.c
> @@ -178,7 +178,7 @@ dwarf2_cu::get_builder ()
> void
> dwarf2_cu::set_producer (const char *producer)
> {
> - gdb_assert (m_producer == nullptr || strcmp (producer, m_producer) == 0);
> + gdb_assert (m_producer == nullptr || streq (producer, m_producer));
> m_producer = producer;
>
> int major, minor;
> diff --git a/gdb/dwarf2/index-write.c b/gdb/dwarf2/index-write.c
> index c4e75898f4c0..f40e9636a0b2 100644
> --- a/gdb/dwarf2/index-write.c
> +++ b/gdb/dwarf2/index-write.c
> @@ -284,8 +284,7 @@ mapped_symtab::find_slot (const char *name)
>
> for (;;)
> {
> - if (m_data[index].name == NULL
> - || strcmp (name, m_data[index].name) == 0)
> + if (m_data[index].name == nullptr || streq (name, m_data[index].name))
> return m_data[index];
> index = (index + step) & (m_data.size () - 1);
> }
> @@ -443,7 +442,7 @@ class c_str_view
>
> bool operator== (const c_str_view &other) const
> {
> - return strcmp (m_cstr, other.m_cstr) == 0;
> + return streq (m_cstr, other.m_cstr);
> }
>
> bool operator< (const c_str_view &other) const
> diff --git a/gdb/dwarf2/read-gdb-index.c b/gdb/dwarf2/read-gdb-index.c
> index ddbac684675f..48d1200270be 100644
> --- a/gdb/dwarf2/read-gdb-index.c
> +++ b/gdb/dwarf2/read-gdb-index.c
> @@ -315,7 +315,7 @@ mapped_gdb_index::build_name_components (dwarf2_per_objfile *per_objfile)
> flags |= IS_STATIC;
> if (main_name != nullptr
> && tag == DW_TAG_subprogram
> - && strcmp (name, main_name) == 0)
> + && streq (name, main_name))
> {
> flags |= IS_MAIN;
> this_lang = main_lang;
> diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
> index e41f06890d74..29c601ef2c32 100644
> --- a/gdb/dwarf2/read.c
> +++ b/gdb/dwarf2/read.c
> @@ -433,7 +433,7 @@ dwo_file_eq::operator() (const dwo_file_search &search,
> if (search.comp_dir == nullptr || dwo_file->comp_dir == nullptr)
> return search.comp_dir == dwo_file->comp_dir;
>
> - return std::strcmp (search.comp_dir, dwo_file->comp_dir) == 0;
> + return streq (search.comp_dir, dwo_file->comp_dir);
> }
>
> /* See dwarf2/read.h. */
> @@ -4114,7 +4114,7 @@ fixup_go_packaging (struct dwarf2_cu *cu)
> {
> objfile *objfile = cu->per_objfile->objfile;
>
> - if (strcmp (package_name.get (), this_package_name.get ()) != 0)
> + if (!streq (package_name.get (), this_package_name.get ()))
> complaint (_("Symtab %s has objects from two different Go "
> "packages: %s and %s"),
> (sym->symtab () != NULL
> @@ -4361,8 +4361,7 @@ quirk_rust_enum (struct type *type, struct objfile *objfile)
> /* Could be data-less variant, so keep going. */
> disr_type = nullptr;
> }
> - else if (strcmp (disr_type->field (0).name (),
> - "RUST$ENUM$DISR") != 0)
> + else if (!streq (disr_type->field (0).name (), "RUST$ENUM$DISR"))
> {
> /* Not a Rust enum. */
> return;
> @@ -5418,7 +5417,7 @@ dwarf2_physname (const char *name, struct die_info *die, struct dwarf2_cu *cu)
> {
> const char *physname = dwarf2_compute_name (name, die, cu, 1);
>
> - if (canon != NULL && strcmp (physname, canon) != 0)
> + if (canon != NULL && !streq (physname, canon))
> {
> /* It may not mean a bug in GDB. The compiler could also
> compute DW_AT_linkage_name incorrectly. But in such case
> @@ -7219,8 +7218,8 @@ open_and_init_dwp_file (dwarf2_per_objfile *per_objfile)
> dwp_name += ".dwp";
>
> gdb_bfd_ref_ptr dbfd (open_dwp_file (per_bfd, dwp_name.c_str ()));
> - if (dbfd == NULL
> - && strcmp (objfile->original_name, objfile_name (objfile)) != 0)
> + if (dbfd == nullptr
> + && !streq (objfile->original_name, objfile_name (objfile)))
> {
> /* Try to find .dwp for the binary file after gdb_realpath resolving. */
> dwp_name = objfile_name (objfile);
> @@ -9947,7 +9946,7 @@ dwarf2_add_member_fn (struct field_info *fip, struct die_info *die,
> /* Look up member function name in fieldlist. */
> for (i = 0; i < fip->fnfieldlists.size (); i++)
> {
> - if (strcmp (fip->fnfieldlists[i].name, fieldname) == 0)
> + if (streq (fip->fnfieldlists[i].name, fieldname))
> {
> flp = &fip->fnfieldlists[i];
> break;
> @@ -10183,9 +10182,9 @@ quirk_gcc_member_function_pointer (struct type *type, struct objfile *objfile)
>
> /* Check for __pfn and __delta members. */
> if (type->field (0).name () == NULL
> - || strcmp (type->field (0).name (), "__pfn") != 0
> + || !streq (type->field (0).name (), "__pfn")
> || type->field (1).name () == NULL
> - || strcmp (type->field (1).name (), "__delta") != 0)
> + || !streq (type->field (1).name (), "__delta"))
> return;
>
> /* Find the type of the method. */
> @@ -10271,9 +10270,9 @@ quirk_ada_thick_pointer_struct (struct die_info *die, struct dwarf2_cu *cu,
>
> /* Check for P_ARRAY and P_BOUNDS members. */
> if (type->field (0).name () == NULL
> - || strcmp (type->field (0).name (), "P_ARRAY") != 0
> + || !streq (type->field (0).name (), "P_ARRAY")
> || type->field (1).name () == NULL
> - || strcmp (type->field (1).name (), "P_BOUNDS") != 0)
> + || !streq (type->field (1).name (), "P_BOUNDS"))
> return;
>
> /* Make sure we're looking at a pointer to an array. */
> @@ -10843,7 +10842,7 @@ process_structure_scope (struct die_info *die, struct dwarf2_cu *cu)
> i >= TYPE_N_BASECLASSES (type);
> --i)
> {
> - if (strcmp (type->field (i).name (), "__vfp") == 0)
> + if (streq (type->field (i).name (), "__vfp"))
> {
> set_type_vptr_fieldno (type, i);
> set_type_vptr_basetype (type, type);
> @@ -12653,7 +12652,7 @@ read_subroutine_type (struct die_info *die, struct dwarf2_cu *cu)
> if (follow_die_ref (die, attr, &arg_cu) == child_die)
> is_this = 1;
> }
> - else if (name && strcmp (name, "this") == 0)
> + else if (name && streq (name, "this"))
> /* Function definitions will have the argument names. */
> is_this = 1;
> else if (name == NULL && iparams == 0)
> @@ -13038,7 +13037,7 @@ dwarf2_init_integer_type (struct dwarf2_cu *cu, int bits, int unsigned_p,
> at least versions 14, 17, and 18. */
> type_allocator alloc (objfile, cu->lang ());
> if (bits == 0 && cu->producer_is_icc () && name != nullptr
> - && strcmp (name, "void") == 0)
> + && streq (name, "void"))
> type = alloc.copy_type (builtin_type (objfile)->builtin_void);
> else
> type = init_integer_type (alloc, bits, unsigned_p, name);
> @@ -13329,7 +13328,7 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu)
>
> if (type->code () == TYPE_CODE_INT
> && name != nullptr
> - && strcmp (name, "char") == 0)
> + && streq (name, "char"))
> type->set_has_no_signedness (true);
>
> maybe_set_alignment (cu, die, type);
> @@ -16375,7 +16374,7 @@ guess_full_die_structure_name (struct die_info *die, struct dwarf2_cu *cu)
> const char *die_name = dwarf2_name (die, cu);
>
> if (die_name != NULL
> - && strcmp (die_name, actual_name.get ()) != 0)
> + && !streq (die_name, actual_name.get ()))
> {
> /* Strip off the class name from the full name.
> We want the prefix. */
> @@ -16554,7 +16553,7 @@ determine_prefix (struct die_info *die, struct dwarf2_cu *cu)
> DW_TAG_namespace DIEs with a name of "::" for the global namespace.
> Work around this problem here. */
> if (cu->lang () == language_cplus
> - && strcmp (parent_type->name (), "::") == 0)
> + && streq (parent_type->name (), "::"))
> return "";
> /* We give a name to even anonymous namespaces. */
> return parent_type->name ();
> @@ -16638,7 +16637,7 @@ typename_concat (const char *prefix, const char *suffix, int physname,
> {
> /* For D, the 'main' function could be defined in any module, but it
> should never be prefixed. */
> - if (strcmp (suffix, "D main") == 0)
> + if (streq (suffix, "D main"))
> {
> prefix = "";
> sep = "";
> @@ -18179,7 +18178,7 @@ cutu_reader::prepare_one_comp_unit (struct dwarf2_cu *cu,
> if (attr != nullptr
> && cu->producer_is_gcc ()
> && attr->as_string () != nullptr
> - && strcmp (attr->as_string (), "<artificial>") == 0)
> + && streq (attr->as_string (), "<artificial>"))
> cu->per_cu->lto_artificial = true;
>
> switch (m_top_level_die->tag)
> diff --git a/gdb/dwarf2/sect-names.h b/gdb/dwarf2/sect-names.h
> index 54e29c2a106a..a2c007f7e690 100644
> --- a/gdb/dwarf2/sect-names.h
> +++ b/gdb/dwarf2/sect-names.h
> @@ -35,8 +35,8 @@ struct dwarf2_section_names {
> /* Return true if NAME matches either of this section's names. */
> bool matches (const char *name) const
> {
> - return ((normal != nullptr && strcmp (name, normal) == 0)
> - || (compressed != nullptr && strcmp (name, compressed) == 0));
> + return ((normal != nullptr && streq (name, normal))
> + || (compressed != nullptr && streq (name, compressed)));
> }
> };
>
> diff --git a/gdb/elfread.c b/gdb/elfread.c
> index 8924bb6ba245..7e2f4fe8f3f6 100644
> --- a/gdb/elfread.c
> +++ b/gdb/elfread.c
> @@ -191,15 +191,15 @@ elf_symfile_segments (bfd *abfd)
> static void
> elf_locate_sections (asection *sectp, struct elfinfo *ei)
> {
> - if (strcmp (sectp->name, ".stab") == 0)
> + if (streq (sectp->name, ".stab"))
> {
> ei->stabsect = sectp;
> }
> - else if (strcmp (sectp->name, ".mdebug") == 0)
> + else if (streq (sectp->name, ".mdebug"))
> {
> ei->mdebugsect = sectp;
> }
> - else if (strcmp (sectp->name, ".ctf") == 0)
> + else if (streq (sectp->name, ".ctf"))
> {
> ei->ctfsect = sectp;
> }
> @@ -508,7 +508,7 @@ elf_symtab_read (minimal_symbol_reader &reader,
> {
> const char *atsign = strchr (sym->name, '@');
> bool is_at_symbol = atsign != nullptr && atsign > sym->name;
> - bool is_plt = is_at_symbol && strcmp (atsign, "@plt") == 0;
> + bool is_plt = is_at_symbol && streq (atsign, "@plt");
> int len = is_at_symbol ? atsign - sym->name : 0;
>
> if (is_at_symbol
> @@ -708,14 +708,14 @@ elf_gnu_ifunc_record_cache (const char *name, CORE_ADDR addr)
> /* Note we check the symbol's name instead of checking whether the
> symbol is in the .plt section because some systems have @plt
> symbols in the .text section. */
> - if (len > 4 && strcmp (target_name + len - 4, "@plt") == 0)
> + if (len > 4 && streq (target_name + len - 4, "@plt"))
> {
> gnu_ifunc_debug_printf ("target \"%s\" is a PLT stub, not caching",
> target_name);
> return 0;
> }
>
> - if (strcmp (target_name, "_PROCEDURE_LINKAGE_TABLE_") == 0)
> + if (streq (target_name, "_PROCEDURE_LINKAGE_TABLE_"))
> {
> gnu_ifunc_debug_printf ("target is _PROCEDURE_LINKAGE_TABLE_, "
> "not caching");
> diff --git a/gdb/eval.c b/gdb/eval.c
> index c13f3cb170d3..c47ac2614c5e 100644
> --- a/gdb/eval.c
> +++ b/gdb/eval.c
> @@ -1015,7 +1015,7 @@ add_struct_fields (struct type *type, completion_list &output,
> computed_type_name = 1;
> }
> /* Omit constructors from the completion list. */
> - if (!type_name || strcmp (type_name, name))
> + if (!type_name || !streq (type_name, name))
> output.emplace_back (concat (prefix, name, nullptr));
> }
> }
> diff --git a/gdb/event-top.c b/gdb/event-top.c
> index d27ce02e61cb..48dfb34c47fe 100644
> --- a/gdb/event-top.c
> +++ b/gdb/event-top.c
> @@ -821,7 +821,7 @@ command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl)
> Which we will get with a newer readline, but this really is the
> best we can do with older versions of readline. */
> const char *value = rl_variable_value ("enable-bracketed-paste");
> - if (value != nullptr && strcmp (value, "on") == 0
> + if (value != nullptr && streq (value, "on")
> && ((rl_readline_version >> 8) & 0xff) > 0x07)
> printf_unfiltered ("\n");
> printf_unfiltered ("quit\n");
> diff --git a/gdb/exec.c b/gdb/exec.c
> index 94051ddab232..5d297bfee563 100644
> --- a/gdb/exec.c
> +++ b/gdb/exec.c
> @@ -114,7 +114,7 @@ set_exec_file_mismatch_command (const char *ignore,
> ;
> mode = static_cast<enum exec_file_mismatch_mode>(1 + (int) mode))
> {
> - if (strcmp (exec_file_mismatch, exec_file_mismatch_names[mode]) == 0)
> + if (streq (exec_file_mismatch, exec_file_mismatch_names[mode]))
> {
> exec_file_mismatch_mode = mode;
> return;
> @@ -512,8 +512,8 @@ exec_file_attach (const char *filename, int from_tty)
> bfd *curr_bfd = current_program_space->exec_bfd ();
> bool reload_p = (((prev_bfd != nullptr) == (curr_bfd != nullptr))
> && (prev_bfd == nullptr
> - || (strcmp (bfd_get_filename (prev_bfd),
> - bfd_get_filename (curr_bfd)) == 0)));
> + || (streq (bfd_get_filename (prev_bfd),
> + bfd_get_filename (curr_bfd)))));
>
> gdb::observers::executable_changed.notify (current_program_space, reload_p);
> }
> diff --git a/gdb/extension.c b/gdb/extension.c
> index 2560ff91e893..d8ef8123ab59 100644
> --- a/gdb/extension.c
> +++ b/gdb/extension.c
> @@ -123,7 +123,7 @@ has_extension (const char *file, const char *extension)
> int extension_len = strlen (extension);
>
> return (file_len > extension_len
> - && strcmp (&file[file_len - extension_len], extension) == 0);
> + && streq (&file[file_len - extension_len], extension));
> }
>
> /* Return the extension language of FILE, or NULL if
> diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c
> index f93090669361..123d9995c39c 100644
> --- a/gdb/f-typeprint.c
> +++ b/gdb/f-typeprint.c
> @@ -378,7 +378,7 @@ f_language::f_type_print_base (struct type *type, struct ui_file *stream,
> through as TYPE_CODE_INT since dbxstclass.h is so
> C-oriented, we must change these to "character" from "char". */
>
> - if (strcmp (type->name (), "char") == 0)
> + if (streq (type->name (), "char"))
> gdb_printf (stream, "%*scharacter", level, "");
> else
> goto default_case;
> diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c
> index c66e90c04029..13921c03a48d 100644
> --- a/gdb/f-valprint.c
> +++ b/gdb/f-valprint.c
> @@ -634,8 +634,9 @@ info_common_command_for_block (const struct block *block, const char *comname,
>
> gdb_assert (sym->loc_class () == LOC_COMMON_BLOCK);
>
> - if (comname && (!sym->linkage_name ()
> - || strcmp (comname, sym->linkage_name ()) != 0))
> + if (comname != nullptr
> + && (sym->linkage_name () == nullptr
> + || !streq (comname, sym->linkage_name ())))
> continue;
>
> if (*any_printed)
> diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
> index 80116553d9be..dc486139861a 100644
> --- a/gdb/fbsd-nat.c
> +++ b/gdb/fbsd-nat.c
> @@ -897,7 +897,7 @@ fbsd_nat_target::thread_name (struct thread_info *thr)
> return nullptr;
> if (ptrace (PT_LWPINFO, lwp, (caddr_t) &pl, sizeof pl) == -1)
> return nullptr;
> - if (strcmp (kp.ki_comm, pl.pl_tdname) == 0)
> + if (streq (kp.ki_comm, pl.pl_tdname))
> return NULL;
> xsnprintf (buf, sizeof buf, "%s", pl.pl_tdname);
> return buf;
> diff --git a/gdb/fbsd-tdep.c b/gdb/fbsd-tdep.c
> index e3c78aaff5dd..4bbe0c120e6a 100644
> --- a/gdb/fbsd-tdep.c
> +++ b/gdb/fbsd-tdep.c
> @@ -573,7 +573,7 @@ fbsd_core_thread_name (struct gdbarch *gdbarch, bfd &cbfd,
> as its thread name instead of an empty name if a name
> has not been set explicitly. Return a NULL name in
> that case. */
> - if (strcmp (buf, elf_tdata (&cbfd)->core->program) != 0)
> + if (!streq (buf, elf_tdata (&cbfd)->core->program))
> return buf;
> }
> }
> diff --git a/gdb/frame.c b/gdb/frame.c
> index 746d7d06ec1f..70621cf6e206 100644
> --- a/gdb/frame.c
> +++ b/gdb/frame.c
> @@ -2439,7 +2439,7 @@ get_prev_frame_always_1 (const frame_info_ptr &this_frame)
> morestack_msym = lookup_minimal_symbol_by_pc (this_pc_in_block).minsym;
> if (morestack_msym)
> morestack_name = morestack_msym->linkage_name ();
> - if (!morestack_name || strcmp (morestack_name, "__morestack") != 0)
> + if (!morestack_name || !streq (morestack_name, "__morestack"))
> {
> frame_debug_printf (" -> nullptr // this frame ID is inner");
> this_frame->stop_reason = UNWIND_INNER_ID;
> diff --git a/gdb/frv-tdep.c b/gdb/frv-tdep.c
> index 94d3db68ae9c..33a270497f3c 100644
> --- a/gdb/frv-tdep.c
> +++ b/gdb/frv-tdep.c
> @@ -1071,9 +1071,9 @@ frv_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
> call_dest = pc + 4 * displ;
> bound_minimal_symbol s = lookup_minimal_symbol_by_pc (call_dest);
>
> - if (s.minsym != NULL
> - && s.minsym->linkage_name () != NULL
> - && strcmp (s.minsym->linkage_name (), "__main") == 0)
> + if (s.minsym != nullptr
> + && s.minsym->linkage_name () != nullptr
> + && streq (s.minsym->linkage_name (), "__main"))
> {
> pc += 4;
> return pc;
> diff --git a/gdb/ft32-tdep.c b/gdb/ft32-tdep.c
> index 5a1f3315c7f2..ba0a0882a0ad 100644
> --- a/gdb/ft32-tdep.c
> +++ b/gdb/ft32-tdep.c
> @@ -377,7 +377,7 @@ ft32_address_class_name_to_type_flags (struct gdbarch *gdbarch,
> const char* name,
> type_instance_flags *type_flags_ptr)
> {
> - if (strcmp (name, "flash") == 0)
> + if (streq (name, "flash"))
> {
> *type_flags_ptr = TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1;
> return true;
> diff --git a/gdb/gcore-elf.c b/gdb/gcore-elf.c
> index 2157fea18dc3..f7c9003a0df8 100644
> --- a/gdb/gcore-elf.c
> +++ b/gdb/gcore-elf.c
> @@ -85,7 +85,7 @@ gcore_elf_collect_regset_section_cb (const char *sect_name,
> collect_size);
>
> /* PRSTATUS still needs to be treated specially. */
> - if (strcmp (sect_name, ".reg") == 0)
> + if (streq (sect_name, ".reg"))
> data->note_data->reset (elfcore_write_prstatus
> (data->obfd, data->note_data->release (),
> data->note_size, data->lwp,
> diff --git a/gdb/gcore.c b/gdb/gcore.c
> index 2bf300c0d29f..98883a0fd4c1 100644
> --- a/gdb/gcore.c
> +++ b/gdb/gcore.c
> @@ -336,7 +336,7 @@ derive_heap_segment (bfd *abfd, bfd_vma *bottom, bfd_vma *top)
> for (sec = abfd->sections; sec; sec = sec->next)
> {
> if (bfd_section_flags (sec) & SEC_DATA
> - || strcmp (".bss", bfd_section_name (sec)) == 0)
> + || streq (".bss", bfd_section_name (sec)))
> {
> sec_vaddr = bfd_section_vma (sec);
> sec_size = bfd_section_size (sec);
> diff --git a/gdb/gdb-demangle.c b/gdb/gdb-demangle.c
> index 1f1d672a8379..d02b80ab621d 100644
> --- a/gdb/gdb-demangle.c
> +++ b/gdb/gdb-demangle.c
> @@ -118,8 +118,7 @@ set_demangling_command (const char *ignore,
> dem->demangling_style != unknown_demangling;
> dem++)
> {
> - if (strcmp (current_demangling_style_string,
> - dem->demangling_style_name) == 0)
> + if (streq (current_demangling_style_string, dem->demangling_style_name))
> {
> current_demangling_style = dem->demangling_style;
> current_demangling_style_string = demangling_style_names[i];
> @@ -227,7 +226,7 @@ INIT_GDB_FILE (gdb_demangle)
> = xstrdup (libiberty_demanglers[i].demangling_style_name);
>
> if (current_demangling_style_string == NULL
> - && strcmp (DEFAULT_DEMANGLING_STYLE, demangling_style_names[i]) == 0)
> + && streq (DEFAULT_DEMANGLING_STYLE, demangling_style_names[i]))
> current_demangling_style_string = demangling_style_names[i];
> }
>
> diff --git a/gdb/gdb_bfd.c b/gdb/gdb_bfd.c
> index bada133da801..342957273cd7 100644
> --- a/gdb/gdb_bfd.c
> +++ b/gdb/gdb_bfd.c
> @@ -230,7 +230,7 @@ struct bfd_cache_eq
> && gdata->size == s.size
> && gdata->inode == s.inode
> && gdata->device_id == s.device_id
> - && strcmp (bfd_get_filename (abfd), s.filename) == 0);
> + && streq (bfd_get_filename (abfd), s.filename));
> }
> };
>
> diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
> index 5e07e290f67e..0ad06f56c30d 100644
> --- a/gdb/gdbtypes.c
> +++ b/gdb/gdbtypes.c
> @@ -545,9 +545,9 @@ address_space_name_to_type_instance_flags (struct gdbarch *gdbarch,
> type_instance_flags type_flags;
>
> /* Check for known address space delimiters. */
> - if (!strcmp (space_identifier, "code"))
> + if (streq (space_identifier, "code"))
> return TYPE_INSTANCE_FLAG_CODE_SPACE;
> - else if (!strcmp (space_identifier, "data"))
> + else if (streq (space_identifier, "data"))
> return TYPE_INSTANCE_FLAG_DATA_SPACE;
> else if (gdbarch_address_class_name_to_type_flags_p (gdbarch)
> && gdbarch_address_class_name_to_type_flags (gdbarch,
> @@ -3616,8 +3616,9 @@ int
> class_types_same_p (const struct type *a, const struct type *b)
> {
> return (TYPE_MAIN_TYPE (a) == TYPE_MAIN_TYPE (b)
> - || (a->name () && b->name ()
> - && !strcmp (a->name (), b->name ())));
> + || (a->name () != nullptr
> + && b->name () != nullptr
> + && streq (a->name (), b->name ())));
> }
>
> /* If BASE is an ancestor of DCLASS return the distance between them.
> @@ -4008,8 +4009,9 @@ types_equal (struct type *a, struct type *b)
> stubs. The types won't point to the same address, but they
> really are the same. */
>
> - if (a->name () && b->name ()
> - && strcmp (a->name (), b->name ()) == 0)
> + if (a->name () != nullptr
> + && b->name () != nullptr
> + && streq (a->name (), b->name ()))
> return true;
>
> /* Two function types are equal if their argument and return types
> @@ -4070,7 +4072,7 @@ compare_maybe_null_strings (const char *s, const char *t)
> {
> if (s == NULL || t == NULL)
> return s == t;
> - return strcmp (s, t) == 0;
> + return streq (s, t);
> }
>
> /* A helper function for check_types_worklist that checks two types for
> diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c
> index e5706b75b1cd..123f237b7217 100644
> --- a/gdb/gnu-nat.c
> +++ b/gdb/gnu-nat.c
> @@ -2708,9 +2708,9 @@ static int
> _parse_bool_arg (const char *args, const char *t_val, const char *f_val,
> const char *cmd_prefix)
> {
> - if (!args || strcmp (args, t_val) == 0)
> + if (!args || streq (args, t_val))
> return 1;
> - else if (strcmp (args, f_val) == 0)
> + else if (streq (args, f_val))
> return 0;
> else
> error (_("Illegal argument for \"%s\" command, "
> @@ -2925,11 +2925,11 @@ set_sig_thread_cmd (const char *args, int from_tty)
> {
> struct inf *inf = cur_inf ();
>
> - if (!args || (!c_isdigit (*args) && strcmp (args, "none") != 0))
> + if (!args || (!c_isdigit (*args) && !streq (args, "none")))
> error (_("Illegal argument to \"set signal-thread\" command.\n"
> "Should be a thread ID, or \"none\"."));
>
> - if (strcmp (args, "none") == 0)
> + if (streq (args, "none"))
> inf->signal_thread = 0;
> else
> {
> diff --git a/gdb/gnu-v2-abi.c b/gdb/gnu-v2-abi.c
> index e5dcbd69c0bf..4e98f7d06fff 100644
> --- a/gdb/gnu-v2-abi.c
> +++ b/gdb/gnu-v2-abi.c
> @@ -316,12 +316,9 @@ vb_match (struct type *type, int index, struct type *basetype)
> if (fieldtype->target_type () == basetype)
> return 1;
>
> - if (basetype->name () != NULL
> - && fieldtype->target_type ()->name () != NULL
> - && strcmp (basetype->name (),
> - fieldtype->target_type ()->name ()) == 0)
> - return 1;
> - return 0;
> + return (basetype->name () != nullptr
> + && fieldtype->target_type ()->name () != nullptr
> + && streq (basetype->name (), fieldtype->target_type ()->name ()));
> }
>
> /* Compute the offset of the baseclass which is the INDEXth baseclass
> diff --git a/gdb/go-lang.c b/gdb/go-lang.c
> index 60033c8eca7d..3b388c961fab 100644
> --- a/gdb/go-lang.c
> +++ b/gdb/go-lang.c
> @@ -79,9 +79,9 @@ gccgo_string_p (struct type *type)
> type1 = check_typedef (type1);
>
> if (type0->code () == TYPE_CODE_PTR
> - && strcmp (type->field (0).name (), "__data") == 0
> + && streq (type->field (0).name (), "__data")
> && type1->code () == TYPE_CODE_INT
> - && strcmp (type->field (1).name (), "__length") == 0)
> + && streq (type->field (1).name (), "__length"))
> {
> struct type *target_type = type0->target_type ();
>
> @@ -89,7 +89,7 @@ gccgo_string_p (struct type *type)
>
> if (target_type->code () == TYPE_CODE_INT
> && target_type->length () == 1
> - && strcmp (target_type->name (), "uint8") == 0)
> + && streq (target_type->name (), "uint8"))
> return 1;
> }
> }
> @@ -103,12 +103,9 @@ gccgo_string_p (struct type *type)
> static int
> sixg_string_p (struct type *type)
> {
> - if (type->num_fields () == 2
> - && type->name () != NULL
> - && strcmp (type->name (), "string") == 0)
> - return 1;
> -
> - return 0;
> + return (type->num_fields () == 2
> + && type->name () != nullptr
> + && streq (type->name (), "string"));
> }
>
> /* Classify the kind of Go object that TYPE is.
> @@ -201,7 +198,7 @@ unpack_mangled_go_symbol (const char *mangled_name,
> *method_type_is_pointerp = 0;
>
> /* main.init is mangled specially. */
> - if (strcmp (mangled_name, "__go_init_main") == 0)
> + if (streq (mangled_name, "__go_init_main"))
> {
> gdb::unique_xmalloc_ptr<char> package
> = make_unique_xstrdup ("main");
> @@ -212,7 +209,7 @@ unpack_mangled_go_symbol (const char *mangled_name,
> }
>
> /* main.main is mangled specially (missing prefix). */
> - if (strcmp (mangled_name, "main.main") == 0)
> + if (streq (mangled_name, "main.main"))
> {
> gdb::unique_xmalloc_ptr<char> package
> = make_unique_xstrdup ("main");
> diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c
> index d0d0c6f2a74b..b3ea5c1fd5ce 100644
> --- a/gdb/go32-nat.c
> +++ b/gdb/go32-nat.c
> @@ -1141,9 +1141,9 @@ go32_sysinfo (const char *arg, int from_tty)
> char cpu_string[80];
> char cpu_brand[20];
> unsigned brand_idx;
> - int intel_p = strcmp (cpuid_vendor, "GenuineIntel") == 0;
> - int amd_p = strcmp (cpuid_vendor, "AuthenticAMD") == 0;
> - int hygon_p = strcmp (cpuid_vendor, "HygonGenuine") == 0;
> + int intel_p = streq (cpuid_vendor, "GenuineIntel");
> + int amd_p = streq (cpuid_vendor, "AuthenticAMD");
> + int hygon_p = streq (cpuid_vendor, "HygonGenuine");
> unsigned cpu_family, cpu_model;
>
> #if 0
> diff --git a/gdb/guile/scm-lazy-string.c b/gdb/guile/scm-lazy-string.c
> index 0c9dd7c967e9..a13567eaa32b 100644
> --- a/gdb/guile/scm-lazy-string.c
> +++ b/gdb/guile/scm-lazy-string.c
> @@ -119,7 +119,7 @@ lsscm_make_lazy_string_smob (CORE_ADDR address, int length,
>
> ls_smob->address = address;
> ls_smob->length = length;
> - if (encoding == NULL || strcmp (encoding, "") == 0)
> + if (encoding == NULL || streq (encoding, ""))
> ls_smob->encoding = NULL;
> else
> ls_smob->encoding = xstrdup (encoding);
> diff --git a/gdb/guile/scm-param.c b/gdb/guile/scm-param.c
> index b31efbf529f2..ee7432178282 100644
> --- a/gdb/guile/scm-param.c
> +++ b/gdb/guile/scm-param.c
> @@ -795,7 +795,7 @@ pascm_set_param_value_x (param_smob *p_smob,
> gdbscm_throw (exception);
> for (i = 0; enumeration[i]; ++i)
> {
> - if (strcmp (enumeration[i], str.get ()) == 0)
> + if (streq (enumeration[i], str.get ()))
> break;
> }
> if (enumeration[i] == nullptr)
> diff --git a/gdb/hppa-bsd-tdep.c b/gdb/hppa-bsd-tdep.c
> index c0e984ab0349..c24e246cecc7 100644
> --- a/gdb/hppa-bsd-tdep.c
> +++ b/gdb/hppa-bsd-tdep.c
> @@ -56,7 +56,7 @@ hppabsd_find_global_pointer (struct gdbarch *gdbarch, struct value *function)
> {
> for (struct obj_section &sec : faddr_sec->objfile->sections ())
> {
> - if (strcmp (sec.the_bfd_section->name, ".dynamic") == 0)
> + if (streq (sec.the_bfd_section->name, ".dynamic"))
> {
> CORE_ADDR addr = sec.addr ();
> CORE_ADDR endaddr = sec.endaddr ();
> diff --git a/gdb/hppa-linux-tdep.c b/gdb/hppa-linux-tdep.c
> index e99e39578759..2141841d1c80 100644
> --- a/gdb/hppa-linux-tdep.c
> +++ b/gdb/hppa-linux-tdep.c
> @@ -363,7 +363,7 @@ hppa_linux_find_global_pointer (struct gdbarch *gdbarch,
> {
> for (obj_section &osect : faddr_sect->objfile->sections ())
> {
> - if (strcmp (osect.the_bfd_section->name, ".dynamic") == 0)
> + if (streq (osect.the_bfd_section->name, ".dynamic"))
> {
> CORE_ADDR addr, endaddr;
>
> diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
> index 140e31422582..a2df05b4d293 100644
> --- a/gdb/hppa-tdep.c
> +++ b/gdb/hppa-tdep.c
> @@ -369,8 +369,8 @@ read_unwind_info (struct objfile *objfile)
> unwind_sec;
> unwind_sec = unwind_sec->next)
> {
> - if (strcmp (unwind_sec->name, "$UNWIND_START$") == 0
> - || strcmp (unwind_sec->name, ".PARISC.unwind") == 0)
> + if (streq (unwind_sec->name, "$UNWIND_START$")
> + || streq (unwind_sec->name, ".PARISC.unwind"))
> {
> unwind_size = bfd_section_size (unwind_sec);
> unwind_entries = unwind_size / UNWIND_ENTRY_SIZE;
> @@ -411,8 +411,8 @@ read_unwind_info (struct objfile *objfile)
> unwind_sec;
> unwind_sec = unwind_sec->next)
> {
> - if (strcmp (unwind_sec->name, "$UNWIND_START$") == 0
> - || strcmp (unwind_sec->name, ".PARISC.unwind") == 0)
> + if (streq (unwind_sec->name, "$UNWIND_START$")
> + || streq (unwind_sec->name, ".PARISC.unwind"))
> {
> unwind_size = bfd_section_size (unwind_sec);
> unwind_entries = unwind_size / UNWIND_ENTRY_SIZE;
> @@ -925,7 +925,7 @@ hppa64_convert_code_addr_to_fptr (struct gdbarch *gdbarch, CORE_ADDR code)
>
> for (obj_section &opd : sec->objfile->sections ())
> {
> - if (strcmp (opd.the_bfd_section->name, ".opd") == 0)
> + if (streq (opd.the_bfd_section->name, ".opd"))
> {
> for (CORE_ADDR addr = opd.addr ();
> addr < opd.endaddr ();
> diff --git a/gdb/i386-dicos-tdep.c b/gdb/i386-dicos-tdep.c
> index a61a376796a6..e5defef92c5b 100644
> --- a/gdb/i386-dicos-tdep.c
> +++ b/gdb/i386-dicos-tdep.c
> @@ -33,8 +33,7 @@ i386_dicos_osabi_sniffer (bfd *abfd)
> const char *target_name = bfd_get_target (abfd);
>
> /* On x86-DICOS, the Load Module's "header" section is 36 bytes. */
> - if (strcmp (target_name, "elf32-i386") == 0
> - && dicos_load_module_p (abfd, 36))
> + if (streq (target_name, "elf32-i386") && dicos_load_module_p (abfd, 36))
> return GDB_OSABI_DICOS;
>
> return GDB_OSABI_UNKNOWN;
> diff --git a/gdb/i386-gnu-tdep.c b/gdb/i386-gnu-tdep.c
> index 5774aaf8dfa2..c351debff07a 100644
> --- a/gdb/i386-gnu-tdep.c
> +++ b/gdb/i386-gnu-tdep.c
> @@ -84,7 +84,7 @@ i386_gnu_sigtramp_p (const frame_info_ptr &this_frame)
> find_pc_partial_function (pc, &name, NULL, NULL);
>
> /* If we have a NAME, we can check for the trampoline function */
> - if (name != NULL && strcmp (name, "trampoline") == 0)
> + if (name != NULL && streq (name, "trampoline"))
> return 1;
>
> return i386_gnu_sigtramp_start (this_frame) != 0;
> diff --git a/gdb/i386-go32-tdep.c b/gdb/i386-go32-tdep.c
> index 13c4b51c3f9e..7a6294d4133e 100644
> --- a/gdb/i386-go32-tdep.c
> +++ b/gdb/i386-go32-tdep.c
> @@ -46,8 +46,8 @@ i386_go32_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
> static enum gdb_osabi
> i386_coff_osabi_sniffer (bfd *abfd)
> {
> - if (strcmp (bfd_get_target (abfd), "coff-go32-exe") == 0
> - || strcmp (bfd_get_target (abfd), "coff-go32") == 0)
> + if (streq (bfd_get_target (abfd), "coff-go32-exe")
> + || streq (bfd_get_target (abfd), "coff-go32"))
> return GDB_OSABI_GO32;
>
> return GDB_OSABI_UNKNOWN;
> diff --git a/gdb/i386-linux-tdep.c b/gdb/i386-linux-tdep.c
> index dae4a7b7eeba..23aeccac9fc6 100644
> --- a/gdb/i386-linux-tdep.c
> +++ b/gdb/i386-linux-tdep.c
> @@ -246,8 +246,7 @@ i386_linux_sigtramp_p (const frame_info_ptr &this_frame)
> return (i386_linux_sigtramp_start (this_frame) != 0
> || i386_linux_rt_sigtramp_start (this_frame) != 0);
>
> - return (strcmp ("__restore", name) == 0
> - || strcmp ("__restore_rt", name) == 0);
> + return streq ("__restore", name) || streq ("__restore_rt", name);
> }
>
> /* Return true if the PC of THIS_FRAME is in a signal trampoline which
> diff --git a/gdb/i386-obsd-tdep.c b/gdb/i386-obsd-tdep.c
> index a361ab1ae6a9..0fc2fab3ed84 100644
> --- a/gdb/i386-obsd-tdep.c
> +++ b/gdb/i386-obsd-tdep.c
> @@ -384,10 +384,11 @@ i386obsd_trapframe_sniffer (const struct frame_unwind *self,
> return 0;
>
> find_pc_partial_function (get_frame_pc (this_frame), &name, NULL, NULL);
> - return (name && (strcmp (name, "calltrap") == 0
> - || strcmp (name, "syscall1") == 0
> - || startswith (name, "Xintr")
> - || startswith (name, "Xsoft")));
> + return (name != nullptr
> + && (streq (name, "calltrap")
> + || streq (name, "syscall1")
> + || startswith (name, "Xintr")
> + || startswith (name, "Xsoft")));
> }
>
> static const struct frame_unwind_legacy i386obsd_trapframe_unwind (
> diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
> index 9cee112facd8..b9013e183c29 100644
> --- a/gdb/i386-tdep.c
> +++ b/gdb/i386-tdep.c
> @@ -1869,9 +1869,9 @@ i386_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
> call_dest = pc + 5 + extract_signed_integer (buf, 4, byte_order);
> call_dest = call_dest & 0xffffffffU;
> bound_minimal_symbol s = lookup_minimal_symbol_by_pc (call_dest);
> - if (s.minsym != NULL
> - && s.minsym->linkage_name () != NULL
> - && strcmp (s.minsym->linkage_name (), "__main") == 0)
> + if (s.minsym != nullptr
> + && s.minsym->linkage_name () != nullptr
> + && streq (s.minsym->linkage_name (), "__main"))
> pc += 5;
> }
> }
> @@ -3772,7 +3772,7 @@ i386_sigtramp_p (const frame_info_ptr &this_frame)
> const char *name;
>
> find_pc_partial_function (pc, &name, NULL, NULL);
> - return (name && strcmp ("_sigtramp", name) == 0);
> + return (name && streq ("_sigtramp", name));
> }
> \f
>
> @@ -3809,8 +3809,9 @@ i386_svr4_sigtramp_p (const frame_info_ptr &this_frame)
>
> /* The origin of these symbols is currently unknown. */
> find_pc_partial_function (pc, &name, NULL, NULL);
> - return (name && (strcmp ("_sigreturn", name) == 0
> - || strcmp ("sigvechandler", name) == 0));
> + return (name != nullptr
> + && (streq ("_sigreturn", name)
> + || streq ("sigvechandler", name)));
> }
>
> /* Assuming THIS_FRAME is for a SVR4 sigtramp routine, return the
> @@ -8450,19 +8451,19 @@ static const struct floatformat **
> i386_floatformat_for_type (struct gdbarch *gdbarch,
> const char *name, int len)
> {
> - if (len == 128 && name)
> - if (strcmp (name, "__float128") == 0
> - || strcmp (name, "_Float128") == 0
> - || strcmp (name, "complex _Float128") == 0
> - || strcmp (name, "complex(kind=16)") == 0
> - || strcmp (name, "COMPLEX(16)") == 0
> - || strcmp (name, "complex*32") == 0
> - || strcmp (name, "COMPLEX*32") == 0
> - || strcmp (name, "quad complex") == 0
> - || strcmp (name, "real(kind=16)") == 0
> - || strcmp (name, "real*16") == 0
> - || strcmp (name, "REAL*16") == 0
> - || strcmp (name, "REAL(16)") == 0)
> + if (len == 128 && name != nullptr)
> + if (streq (name, "__float128")
> + || streq (name, "_Float128")
> + || streq (name, "complex _Float128")
> + || streq (name, "complex(kind=16)")
> + || streq (name, "COMPLEX(16)")
> + || streq (name, "complex*32")
> + || streq (name, "COMPLEX*32")
> + || streq (name, "quad complex")
> + || streq (name, "real(kind=16)")
> + || streq (name, "real*16")
> + || streq (name, "REAL*16")
> + || streq (name, "REAL(16)"))
> return floatformats_ieee_quad;
>
> return default_floatformat_for_type (gdbarch, name, len);
> diff --git a/gdb/i386-windows-tdep.c b/gdb/i386-windows-tdep.c
> index daaa556d171b..b66483c4b960 100644
> --- a/gdb/i386-windows-tdep.c
> +++ b/gdb/i386-windows-tdep.c
> @@ -210,7 +210,7 @@ i386_cygwin_core_osabi_sniffer (bfd *abfd)
>
> /* Cygwin uses elf core dumps. Do not claim all ELF executables,
> check whether there is a .reg section of proper size. */
> - if (strcmp (target_name, "elf32-i386") == 0)
> + if (streq (target_name, "elf32-i386"))
> {
> asection *section = bfd_get_section_by_name (abfd, ".reg");
> if (section != nullptr
> diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c
> index 2b918b87bbc5..43f2f4e10bca 100644
> --- a/gdb/ia64-tdep.c
> +++ b/gdb/ia64-tdep.c
> @@ -3433,7 +3433,7 @@ ia64_find_global_pointer_from_dynamic_section (struct gdbarch *gdbarch,
> {
> for (obj_section &osect : faddr_sect->objfile->sections ())
> {
> - if (strcmp (osect.the_bfd_section->name, ".dynamic") == 0)
> + if (streq (osect.the_bfd_section->name, ".dynamic"))
> {
> CORE_ADDR addr = osect.addr ();
> CORE_ADDR endaddr = osect.endaddr ();
> @@ -3507,14 +3507,14 @@ find_extant_func_descr (struct gdbarch *gdbarch, CORE_ADDR faddr)
>
> /* Return early if faddr is already a function descriptor. */
> faddr_sect = find_pc_section (faddr);
> - if (faddr_sect && strcmp (faddr_sect->the_bfd_section->name, ".opd") == 0)
> + if (faddr_sect && streq (faddr_sect->the_bfd_section->name, ".opd"))
> return faddr;
>
> if (faddr_sect != NULL)
> {
> for (obj_section &osect : faddr_sect->objfile->sections ())
> {
> - if (strcmp (osect.the_bfd_section->name, ".opd") == 0)
> + if (streq (osect.the_bfd_section->name, ".opd"))
> {
> CORE_ADDR addr = osect.addr ();
> CORE_ADDR endaddr = osect.endaddr ();
> @@ -3593,7 +3593,7 @@ ia64_convert_from_func_ptr_addr (struct gdbarch *gdbarch, CORE_ADDR addr,
> s = find_pc_section (addr);
>
> /* check if ADDR points to a function descriptor. */
> - if (s && strcmp (s->the_bfd_section->name, ".opd") == 0)
> + if (s && streq (s->the_bfd_section->name, ".opd"))
> return read_memory_unsigned_integer (addr, 8, byte_order);
>
> /* Normally, functions live inside a section that is executable.
> diff --git a/gdb/infrun.c b/gdb/infrun.c
> index c05c2b0f42f3..592f9197cd5e 100644
> --- a/gdb/infrun.c
> +++ b/gdb/infrun.c
> @@ -10463,9 +10463,9 @@ set_exec_direction_func (const char *args, int from_tty,
> {
> if (target_can_execute_reverse ())
> {
> - if (!strcmp (exec_direction, exec_forward))
> + if (streq (exec_direction, exec_forward))
> execution_direction = EXEC_FORWARD;
> - else if (!strcmp (exec_direction, exec_reverse))
> + else if (streq (exec_direction, exec_reverse))
> execution_direction = EXEC_REVERSE;
> }
> else
> diff --git a/gdb/interps.c b/gdb/interps.c
> index 23663cb5ef53..0b05a3f277d2 100644
> --- a/gdb/interps.c
> +++ b/gdb/interps.c
> @@ -85,7 +85,7 @@ interp_factory_register (const char *name, interp_factory_func func)
> {
> /* Assert that no factory for NAME is already registered. */
> for (const interp_factory &f : interpreter_factories)
> - if (strcmp (f.name, name) == 0)
> + if (streq (f.name, name))
> {
> internal_error (_("interpreter factory already registered: \"%s\"\n"),
> name);
> @@ -157,7 +157,7 @@ static struct interp *
> interp_lookup_existing (struct ui *ui, const char *name)
> {
> for (interp &interp : ui->interp_list)
> - if (strcmp (interp.name (), name) == 0)
> + if (streq (interp.name (), name))
> return &interp;
>
> return nullptr;
> @@ -177,7 +177,7 @@ interp_lookup (struct ui *ui, const char *name)
> return interp;
>
> for (const interp_factory &factory : interpreter_factories)
> - if (strcmp (factory.name, name) == 0)
> + if (streq (factory.name, name))
> {
> interp = factory.func (factory.name);
> interp_add (ui, interp);
> @@ -224,7 +224,7 @@ current_interp_named_p (const char *interp_name)
> interp *interp = current_ui->current_interpreter;
>
> if (interp != NULL)
> - return (strcmp (interp->name (), interp_name) == 0);
> + return (streq (interp->name (), interp_name));
>
> return 0;
> }
> diff --git a/gdb/language.c b/gdb/language.c
> index ac718b0bf07b..439ef293622d 100644
> --- a/gdb/language.c
> +++ b/gdb/language.c
> @@ -191,8 +191,7 @@ set_language (const char *language)
> enum language flang = language_unknown;
>
> /* "local" is a synonym of "auto". */
> - if (strcmp (language, "auto") == 0
> - || strcmp (language, "local") == 0)
> + if (streq (language, "auto") || streq (language, "local"))
> {
> /* Enter auto mode. Set to the current frame's language, if
> known, or fallback to the initial language. */
> @@ -221,7 +220,7 @@ set_language (const char *language)
> /* Search the list of languages for a match. */
> for (const auto &lang : language_defn::languages)
> {
> - if (strcmp (lang->name (), language) != 0)
> + if (!streq (lang->name (), language))
> continue;
>
> /* Found it! Go into manual mode, and use this language. */
> @@ -293,22 +292,22 @@ static void
> set_range_command (const char *ignore,
> int from_tty, struct cmd_list_element *c)
> {
> - if (strcmp (range, "on") == 0)
> + if (streq (range, "on"))
> {
> range_check = range_check_on;
> range_mode = range_mode_manual;
> }
> - else if (strcmp (range, "warn") == 0)
> + else if (streq (range, "warn"))
> {
> range_check = range_check_warn;
> range_mode = range_mode_manual;
> }
> - else if (strcmp (range, "off") == 0)
> + else if (streq (range, "off"))
> {
> range_check = range_check_off;
> range_mode = range_mode_manual;
> }
> - else if (strcmp (range, "auto") == 0)
> + else if (streq (range, "auto"))
> {
> range_mode = range_mode_auto;
> set_range_case ();
> @@ -367,17 +366,17 @@ show_case_command (struct ui_file *file, int from_tty,
> static void
> set_case_command (const char *ignore, int from_tty, struct cmd_list_element *c)
> {
> - if (strcmp (case_sensitive, "on") == 0)
> + if (streq (case_sensitive, "on"))
> {
> case_sensitivity = case_sensitive_on;
> case_mode = case_mode_manual;
> }
> - else if (strcmp (case_sensitive, "off") == 0)
> + else if (streq (case_sensitive, "off"))
> {
> case_sensitivity = case_sensitive_off;
> case_mode = case_mode_manual;
> }
> - else if (strcmp (case_sensitive, "auto") == 0)
> + else if (streq (case_sensitive, "auto"))
> {
> case_mode = case_mode_auto;
> set_range_case ();
> @@ -478,7 +477,7 @@ enum language
> language_enum (const char *str)
> {
> for (const auto &lang : language_defn::languages)
> - if (strcmp (lang->name (), str) == 0)
> + if (streq (lang->name (), str))
> return lang->la_language;
>
> return language_unknown;
> @@ -977,7 +976,7 @@ language_arch_info::lookup_primitive_type_and_symbol (const char *name)
> {
> for (struct type_and_symbol &tas : primitive_types_and_symbols)
> {
> - if (strcmp (tas.type ()->name (), name) == 0)
> + if (streq (tas.type ()->name (), name))
> return &tas;
> }
>
> @@ -1107,7 +1106,7 @@ INIT_GDB_FILE (language)
> add_alias_cmd ("ch", setshow_check_cmds.show, no_class, 1, &showlist);
>
> range = type_or_range_names[3];
> - gdb_assert (strcmp (range, "auto") == 0);
> + gdb_assert (streq (range, "auto"));
> add_setshow_enum_cmd ("range", class_support, type_or_range_names,
> &range,
> _("Set range checking (on/warn/off/auto)."),
> @@ -1117,7 +1116,7 @@ INIT_GDB_FILE (language)
> &setchecklist, &showchecklist);
>
> case_sensitive = case_sensitive_names[2];
> - gdb_assert (strcmp (case_sensitive, "auto") == 0);
> + gdb_assert (streq (case_sensitive, "auto"));
> add_setshow_enum_cmd ("case-sensitive", class_support, case_sensitive_names,
> &case_sensitive, _("\
> Set case sensitivity in name search (on/off/auto)."), _("\
> diff --git a/gdb/linespec.c b/gdb/linespec.c
> index 024358c65f59..7624c92ab257 100644
> --- a/gdb/linespec.c
> +++ b/gdb/linespec.c
> @@ -1742,8 +1742,7 @@ linespec_parse_basic (linespec_parser *parser)
> completions, advance the stream past the colon token and make
> it part of the function name/token. */
>
> - if (!parser->completion_quote_char
> - && strcmp (parser->lexer.stream, ":") == 0)
> + if (!parser->completion_quote_char && streq (parser->lexer.stream, ":"))
> {
> completion_tracker tmp_tracker (false);
> const char *source_filename
> @@ -4217,8 +4216,8 @@ search_minsyms_for_name (struct collect_info *info,
> if (msymbol_type_is_static (item2.minsym->type ()))
> continue;
>
> - if (strcmp (item.minsym->linkage_name (),
> - item2.minsym->linkage_name ()) != 0)
> + if (!streq (item.minsym->linkage_name (),
> + item2.minsym->linkage_name ()))
> continue;
>
> /* Found a global minsym with the same name as the
> diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c
> index 3f2bab166304..da92c6a3af27 100644
> --- a/gdb/linux-tdep.c
> +++ b/gdb/linux-tdep.c
> @@ -498,17 +498,17 @@ decode_vmflags (char *p, struct smaps_vmflags *v)
> s != NULL;
> s = strtok_r (NULL, " ", &saveptr))
> {
> - if (strcmp (s, "io") == 0)
> + if (streq (s, "io"))
> v->io_page = 1;
> - else if (strcmp (s, "ht") == 0)
> + else if (streq (s, "ht"))
> v->uses_huge_tlb = 1;
> - else if (strcmp (s, "dd") == 0)
> + else if (streq (s, "dd"))
> v->exclude_coredump = 1;
> - else if (strcmp (s, "sh") == 0)
> + else if (streq (s, "sh"))
> v->shared_mapping = 1;
> - else if (strcmp (s, "mt") == 0)
> + else if (streq (s, "mt"))
> v->memory_tagging = 1;
> - else if (strcmp (s, "ss") == 0)
> + else if (streq (s, "ss"))
> v->shadow_stack_memory = 1;
> }
> }
> @@ -591,7 +591,7 @@ mapping_is_anonymous_p (const char *filename)
> If we managed to find it, then we assume the mapping is
> anonymous. */
> return (filename_len >= del_len
> - && strcmp (filename + filename_len - del_len, deleted) == 0);
> + && streq (filename + filename_len - del_len, deleted));
> }
>
> if (*filename == '\0'
> @@ -1420,17 +1420,17 @@ parse_smaps_data (const char *data,
> break;
> }
>
> - if (strcmp (keyword, "Anonymous:") == 0)
> + if (streq (keyword, "Anonymous:"))
> {
> /* Older Linux kernels did not support the
> "Anonymous:" counter. Check it here. */
> has_anonymous = 1;
> }
> - else if (strcmp (keyword, "VmFlags:") == 0)
> + else if (streq (keyword, "VmFlags:"))
> decode_vmflags (line, &v);
>
> - if (strcmp (keyword, "AnonHugePages:") == 0
> - || strcmp (keyword, "Anonymous:") == 0)
> + if (streq (keyword, "AnonHugePages:")
> + || streq (keyword, "Anonymous:"))
> {
> unsigned long number;
>
> diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c
> index bd45a2f29785..f276031184c4 100644
> --- a/gdb/linux-thread-db.c
> +++ b/gdb/linux-thread-db.c
> @@ -1154,7 +1154,7 @@ thread_db_load_search (void)
> if (rc)
> break;
> }
> - else if (strcmp (this_dir, "$sdir") == 0)
> + else if (streq (this_dir, "$sdir"))
> {
> if (try_thread_db_load_from_sdir ())
> {
> @@ -1905,7 +1905,7 @@ info_auto_load_libthread_db (const char *args, int from_tty)
> for (this_pid_len = 0; pid != 0; pid /= 10)
> this_pid_len++;
>
> - if (i == 0 || strcmp (array[i - 1]->filename, array[i]->filename) != 0)
> + if (i == 0 || !streq (array[i - 1]->filename, array[i]->filename))
> {
> unique_filenames++;
> max_filename_len = std::max (max_filename_len,
> @@ -1943,8 +1943,7 @@ info_auto_load_libthread_db (const char *args, int from_tty)
> file_name_style.style ());
>
> std::string pids;
> - while (i < array.size () && strcmp (info->filename,
> - array[i]->filename) == 0)
> + while (i < array.size () && streq (info->filename, array[i]->filename))
> {
> if (!pids.empty ())
> pids += ", ";
> diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c
> index 8971e4b5ec12..59616e7f2d66 100644
> --- a/gdb/m2-typeprint.c
> +++ b/gdb/m2-typeprint.c
> @@ -162,8 +162,7 @@ m2_language::print_typedef (struct type *type, struct symbol *new_symbol,
> type = check_typedef (type);
> gdb_printf (stream, "TYPE ");
> if (!new_symbol->type ()->name ()
> - || strcmp ((new_symbol->type ())->name (),
> - new_symbol->linkage_name ()) != 0)
> + || !streq ((new_symbol->type ())->name (), new_symbol->linkage_name ()))
> gdb_printf (stream, "%s = ", new_symbol->print_name ());
> else
> gdb_printf (stream, "<builtin> = ");
> @@ -352,7 +351,7 @@ m2_is_long_set (struct type *type)
> if (type->field (i).type ()->code () != TYPE_CODE_SET)
> return 0;
> if (type->field (i).name () != NULL
> - && (strcmp (type->field (i).name (), "") != 0))
> + && (!streq (type->field (i).name (), "")))
> return 0;
> range = type->field (i).type ()->index_type ();
> if ((i > TYPE_N_BASECLASSES (type))
> @@ -490,9 +489,9 @@ m2_is_unbounded_array (struct type *type)
> */
> if (type->num_fields () != 2)
> return 0;
> - if (strcmp (type->field (0).name (), "_m2_contents") != 0)
> + if (!streq (type->field (0).name (), "_m2_contents"))
> return 0;
> - if (strcmp (type->field (1).name (), "_m2_high") != 0)
> + if (!streq (type->field (1).name (), "_m2_high"))
> return 0;
> if (type->field (0).type ()->code () != TYPE_CODE_PTR)
> return 0;
> diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c
> index 4c4aa19185f0..f9d46c00b9ca 100644
> --- a/gdb/m32c-tdep.c
> +++ b/gdb/m32c-tdep.c
> @@ -2327,8 +2327,7 @@ m32c_skip_trampoline_code (const frame_info_ptr &frame, CORE_ADDR stop_pc)
> if (find_pc_partial_function (stop_pc, &name, &start, &end))
> {
> /* Are we stopped at the beginning of the trampoline function? */
> - if (strcmp (name, "m32c_jsri16") == 0
> - && stop_pc == start)
> + if (streq (name, "m32c_jsri16") && stop_pc == start)
> {
> /* Get the stack pointer. The return address is at the top,
> and the target function's address is just below that. We
> @@ -2508,8 +2507,7 @@ m32c_m16c_pointer_to_address (struct gdbarch *gdbarch,
> const char *ptr_msym_name = ptr_msym.minsym->linkage_name ();
> int len = strlen (ptr_msym_name);
>
> - if (len > 4
> - && strcmp (ptr_msym_name + len - 4, ".plt") == 0)
> + if (len > 4 && streq (ptr_msym_name + len - 4, ".plt"))
> {
> /* We have a .plt symbol; try to find the symbol for the
> corresponding function.
> diff --git a/gdb/m32r-linux-tdep.c b/gdb/m32r-linux-tdep.c
> index 75e112edc6ea..1068783565ce 100644
> --- a/gdb/m32r-linux-tdep.c
> +++ b/gdb/m32r-linux-tdep.c
> @@ -185,8 +185,7 @@ m32r_linux_pc_in_sigtramp (CORE_ADDR pc, const char *name,
> return (m32r_linux_sigtramp_start (pc, this_frame) != 0
> || m32r_linux_rt_sigtramp_start (pc, this_frame) != 0);
>
> - return (strcmp ("__restore", name) == 0
> - || strcmp ("__restore_rt", name) == 0);
> + return streq ("__restore", name) || streq ("__restore_rt", name);
> }
>
> /* From <asm/sigcontext.h>. */
> diff --git a/gdb/machoread.c b/gdb/machoread.c
> index 416eb6766fdb..6bd063a89e93 100644
> --- a/gdb/machoread.c
> +++ b/gdb/machoread.c
> @@ -835,7 +835,7 @@ macho_symfile_read (struct objfile *objfile, symfile_add_flags symfile_flags)
> asect && dsect;
> asect = asect->next, dsect = dsect->next)
> {
> - if (strcmp (asect->name, dsect->name) != 0)
> + if (!streq (asect->name, dsect->name))
> break;
> bfd_set_section_size (dsect, bfd_section_size (asect));
> }
> @@ -912,8 +912,8 @@ macho_symfile_offsets (struct objfile *objfile,
>
> if (startswith (bfd_sect_name, "LC_SEGMENT."))
> bfd_sect_name += 11;
> - if (strcmp (bfd_sect_name, "__TEXT") == 0
> - || strcmp (bfd_sect_name, "__TEXT.__text") == 0)
> + if (streq (bfd_sect_name, "__TEXT")
> + || streq (bfd_sect_name, "__TEXT.__text"))
> objfile->sect_index_text = sect_index;
> }
> }
> diff --git a/gdb/macrocmd.c b/gdb/macrocmd.c
> index d700dd37108d..c0af31c2b6ed 100644
> --- a/gdb/macrocmd.c
> +++ b/gdb/macrocmd.c
> @@ -210,7 +210,7 @@ info_macro_command (const char *args, int from_tty)
> macro_source_file *source,
> int line)
> {
> - if (strcmp (name, macro_name) == 0)
> + if (streq (name, macro_name))
> print_macro_definition (name, macro, source, line);
> });
> else
> diff --git a/gdb/macroexp.c b/gdb/macroexp.c
> index 79d45457e001..82f1378e1535 100644
> --- a/gdb/macroexp.c
> +++ b/gdb/macroexp.c
> @@ -721,7 +721,7 @@ static int
> currently_rescanning (struct macro_name_list *list, const char *name)
> {
> for (; list; list = list->next)
> - if (strcmp (name, list->name) == 0)
> + if (streq (name, list->name))
> return 1;
>
> return 0;
> @@ -1231,7 +1231,7 @@ expand (const char *id,
>
> if (def->argc >= 1)
> {
> - if (strcmp (def->argv[def->argc - 1], "...") == 0)
> + if (streq (def->argv[def->argc - 1], "..."))
> {
> /* In C99-style varargs, substitution is done using
> __VA_ARGS__. */
> @@ -1242,8 +1242,7 @@ expand (const char *id,
> {
> int len = strlen (def->argv[def->argc - 1]);
>
> - if (len > 3
> - && strcmp (def->argv[def->argc - 1] + len - 3, "...") == 0)
> + if (len > 3 && streq (def->argv[def->argc - 1] + len - 3, "..."))
> {
> /* In GNU-style varargs, the name of the
> substitution parameter is the name of the formal
> diff --git a/gdb/macrotab.c b/gdb/macrotab.c
> index 688d1e3fff3e..078eb5cb5aa7 100644
> --- a/gdb/macrotab.c
> +++ b/gdb/macrotab.c
> @@ -657,7 +657,7 @@ find_definition (const char *name,
> We just want to search within a given name's definitions. */
> struct macro_key *found = (struct macro_key *) pred->key;
>
> - if (strcmp (found->name, name) == 0)
> + if (streq (found->name, name))
> n = pred;
> }
> }
> @@ -707,7 +707,7 @@ check_for_redefinition (macro_source_file *source, int line, const char *name,
> definition changes). */
> if (kind != found_def->kind)
> same = 0;
> - else if (strcmp (replacement, found_def->replacement))
> + else if (!streq (replacement, found_def->replacement))
> same = 0;
> else if (kind == macro_function_like)
> {
> diff --git a/gdb/main.c b/gdb/main.c
> index a4e6cddef702..df40ee0b005d 100644
> --- a/gdb/main.c
> +++ b/gdb/main.c
> @@ -1240,9 +1240,7 @@ captured_main_1 (struct captured_main_args *context)
> save_auto_load = global_auto_load;
> global_auto_load = 0;
>
> - if (execarg != NULL
> - && symarg != NULL
> - && strcmp (execarg, symarg) == 0)
> + if (execarg != nullptr && symarg != nullptr && streq (execarg, symarg))
> {
> /* The exec file and the symbol-file are the same. If we can't
> open it, better only print one error message.
> diff --git a/gdb/memattr.c b/gdb/memattr.c
> index aa0ca17008d9..bea33f6df6d4 100644
> --- a/gdb/memattr.c
> +++ b/gdb/memattr.c
> @@ -257,7 +257,7 @@ mem_command (const char *args, int from_tty)
> error_no_arg (_("No mem"));
>
> /* For "mem auto", switch back to using a target provided list. */
> - if (strcmp (args, "auto") == 0)
> + if (streq (args, "auto"))
> {
> if (mem_use_target ())
> return;
> diff --git a/gdb/mi/mi-cmd-disas.c b/gdb/mi/mi-cmd-disas.c
> index 1059e366d7be..bc4bd52dfff0 100644
> --- a/gdb/mi/mi-cmd-disas.c
> +++ b/gdb/mi/mi-cmd-disas.c
> @@ -145,11 +145,11 @@ mi_cmd_disassemble (const char *command, const char *const *argv, int argc)
> break;
> case OPCODES_OPT:
> opcodes_seen = true;
> - if (strcmp (oarg, "none") == 0)
> + if (streq (oarg, "none"))
> opcodes_mode = OPCODES_NONE;
> - else if (strcmp (oarg, "display") == 0)
> + else if (streq (oarg, "display"))
> opcodes_mode = OPCODES_DISPLAY;
> - else if (strcmp (oarg, "bytes") == 0)
> + else if (streq (oarg, "bytes"))
> opcodes_mode = OPCODES_BYTES;
> else
> error (_("-data-disassemble: unknown value for -opcodes argument"));
> diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
> index 22736f568ef3..f1f1637b74b2 100644
> --- a/gdb/mi/mi-cmd-var.c
> +++ b/gdb/mi/mi-cmd-var.c
> @@ -103,7 +103,7 @@ mi_cmd_var_create (const char *command, const char *const *argv, int argc)
>
> const char *name = argv[0];
> std::string gen_name;
> - if (strcmp (name, "-") == 0)
> + if (streq (name, "-"))
> {
> gen_name = varobj_gen_name ();
> name = gen_name.c_str ();
> @@ -111,9 +111,9 @@ mi_cmd_var_create (const char *command, const char *const *argv, int argc)
> else if (!c_isalpha (name[0]))
> error (_("-var-create: name of object must begin with a letter"));
>
> - if (strcmp (frame, "*") == 0)
> + if (streq (frame, "*"))
> var_type = USE_CURRENT_FRAME;
> - else if (strcmp (frame, "@") == 0)
> + else if (streq (frame, "@"))
> var_type = USE_SELECTED_FRAME;
> else
> {
> @@ -154,7 +154,7 @@ mi_cmd_var_delete (const char *command, const char *const *argv, int argc)
> starting with '-'. */
> if (argc == 1)
> {
> - if (strcmp (name, "-c") == 0)
> + if (streq (name, "-c"))
> error (_("-var-delete: Missing required "
> "argument after '-c': variable object name"));
> if (*name == '-')
> @@ -165,7 +165,7 @@ mi_cmd_var_delete (const char *command, const char *const *argv, int argc)
> which would be the variable name. */
> if (argc == 2)
> {
> - if (strcmp (name, "-c") != 0)
> + if (!streq (name, "-c"))
> error (_("-var-delete: Invalid option."));
> children_only_p = 1;
> name = argv[1];
> @@ -264,9 +264,9 @@ mi_cmd_var_set_frozen (const char *command, const char *const *argv, int argc)
>
> var = varobj_get_handle (argv[0]);
>
> - if (strcmp (argv[1], "0") == 0)
> + if (streq (argv[1], "0"))
> frozen = false;
> - else if (strcmp (argv[1], "1") == 0)
> + else if (streq (argv[1], "1"))
> frozen = true;
> else
> error (_("Invalid flag value"));
> diff --git a/gdb/mi/mi-getopt.c b/gdb/mi/mi-getopt.c
> index c005263243ef..865bba9abf8e 100644
> --- a/gdb/mi/mi-getopt.c
> +++ b/gdb/mi/mi-getopt.c
> @@ -37,7 +37,7 @@ mi_getopt_1 (const char *prefix, int argc, const char *const *argv,
> return -1;
> arg = argv[*oind];
> /* ``--''? */
> - if (strcmp (arg, "--") == 0)
> + if (streq (arg, "--"))
> {
> *oind += 1;
> *oarg = NULL;
> @@ -52,7 +52,7 @@ mi_getopt_1 (const char *prefix, int argc, const char *const *argv,
> /* Look the option up. */
> for (opt = opts; opt->name != NULL; opt++)
> {
> - if (strcmp (opt->name, arg + 1) != 0)
> + if (!streq (opt->name, arg + 1))
> continue;
> if (opt->arg_p)
> {
> diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
> index 77e56bc9fc8d..c03cbfe51173 100644
> --- a/gdb/mi/mi-main.c
> +++ b/gdb/mi/mi-main.c
> @@ -161,7 +161,7 @@ void
> mi_cmd_exec_next (const char *command, const char *const *argv, int argc)
> {
> /* FIXME: Should call a libgdb function, not a cli wrapper. */
> - if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
> + if (argc > 0 && streq (argv[0], "--reverse"))
> mi_execute_async_cli_command ("reverse-next", argv + 1, argc - 1);
> else
> mi_execute_async_cli_command ("next", argv, argc);
> @@ -172,7 +172,7 @@ mi_cmd_exec_next_instruction (const char *command, const char *const *argv,
> int argc)
> {
> /* FIXME: Should call a libgdb function, not a cli wrapper. */
> - if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
> + if (argc > 0 && streq (argv[0], "--reverse"))
> mi_execute_async_cli_command ("reverse-nexti", argv + 1, argc - 1);
> else
> mi_execute_async_cli_command ("nexti", argv, argc);
> @@ -182,7 +182,7 @@ void
> mi_cmd_exec_step (const char *command, const char *const *argv, int argc)
> {
> /* FIXME: Should call a libgdb function, not a cli wrapper. */
> - if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
> + if (argc > 0 && streq (argv[0], "--reverse"))
> mi_execute_async_cli_command ("reverse-step", argv + 1, argc - 1);
> else
> mi_execute_async_cli_command ("step", argv, argc);
> @@ -193,7 +193,7 @@ mi_cmd_exec_step_instruction (const char *command, const char *const *argv,
> int argc)
> {
> /* FIXME: Should call a libgdb function, not a cli wrapper. */
> - if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
> + if (argc > 0 && streq (argv[0], "--reverse"))
> mi_execute_async_cli_command ("reverse-stepi", argv + 1, argc - 1);
> else
> mi_execute_async_cli_command ("stepi", argv, argc);
> @@ -203,7 +203,7 @@ void
> mi_cmd_exec_finish (const char *command, const char *const *argv, int argc)
> {
> /* FIXME: Should call a libgdb function, not a cli wrapper. */
> - if (argc > 0 && strcmp(argv[0], "--reverse") == 0)
> + if (argc > 0 && streq (argv[0], "--reverse"))
> mi_execute_async_cli_command ("reverse-finish", argv + 1, argc - 1);
> else
> mi_execute_async_cli_command ("finish", argv, argc);
> @@ -329,7 +329,7 @@ exec_reverse_continue (const char *const *argv, int argc)
> void
> mi_cmd_exec_continue (const char *command, const char *const *argv, int argc)
> {
> - if (argc > 0 && strcmp (argv[0], "--reverse") == 0)
> + if (argc > 0 && streq (argv[0], "--reverse"))
> exec_reverse_continue (argv + 1, argc - 1);
> else
> exec_continue (argv, argc);
> @@ -759,9 +759,9 @@ mi_cmd_list_thread_groups (const char *command, const char *const *argv,
> available = 1;
> break;
> case RECURSE_OPT:
> - if (strcmp (oarg, "0") == 0)
> + if (streq (oarg, "0"))
> ;
> - else if (strcmp (oarg, "1") == 0)
> + else if (streq (oarg, "1"))
> recurse = 1;
> else
> error (_("only '0' and '1' are valid values "
> @@ -1589,9 +1589,9 @@ mi_cmd_enable_timings (const char *command, const char *const *argv, int argc)
> do_timings = 1;
> else if (argc == 1)
> {
> - if (strcmp (argv[0], "yes") == 0)
> + if (streq (argv[0], "yes"))
> do_timings = 1;
> - else if (strcmp (argv[0], "no") == 0)
> + else if (streq (argv[0], "no"))
> do_timings = 0;
> else
> goto usage_error;
> @@ -1795,8 +1795,10 @@ captured_mi_execute_command (struct mi_interp *mi, struct ui_out *uiout,
> gdb_puts (context->token.c_str (), mi->raw_stdout);
> /* There's no particularly good reason why target-connect results
> in not ^done. Should kill ^connected for MI3. */
> - gdb_puts (strcmp (context->command.get (), "target-select") == 0
> - ? "^connected" : "^done", mi->raw_stdout);
> + gdb_puts ((streq (context->command.get (), "target-select")
> + ? "^connected"
> + : "^done"),
> + mi->raw_stdout);
> mi_out_put (uiout, mi->raw_stdout);
> mi_out_rewind (uiout);
> mi_print_timing_maybe (mi->raw_stdout);
> @@ -2150,7 +2152,6 @@ mi_load_progress (const char *section_name,
> using namespace std::chrono;
> static steady_clock::time_point last_update;
> static char *previous_sect_name = NULL;
> - int new_section;
> struct mi_interp *mi = as_mi_interp (current_interpreter ());
>
> /* If the current interpreter is not an MI interpreter, then just
> @@ -2169,9 +2170,8 @@ mi_load_progress (const char *section_name,
> scoped_restore save_uiout
> = make_scoped_restore (¤t_uiout, uiout.get ());
>
> - new_section = (previous_sect_name ?
> - strcmp (previous_sect_name, section_name) : 1);
> - if (new_section)
> + if (previous_sect_name == nullptr
> + || !streq (previous_sect_name, section_name))
> {
> xfree (previous_sect_name);
> previous_sect_name = xstrdup (section_name);
> @@ -2301,7 +2301,7 @@ mi_cmd_trace_find (const char *command, const char *const *argv, int argc)
>
> mode = argv[0];
>
> - if (strcmp (mode, "none") == 0)
> + if (streq (mode, "none"))
> {
> tfind_1 (tfind_number, -1, 0, 0, 0);
> return;
> @@ -2309,39 +2309,39 @@ mi_cmd_trace_find (const char *command, const char *const *argv, int argc)
>
> check_trace_running (current_trace_status ());
>
> - if (strcmp (mode, "frame-number") == 0)
> + if (streq (mode, "frame-number"))
> {
> if (argc != 2)
> error (_("frame number is required"));
> tfind_1 (tfind_number, atoi (argv[1]), 0, 0, 0);
> }
> - else if (strcmp (mode, "tracepoint-number") == 0)
> + else if (streq (mode, "tracepoint-number"))
> {
> if (argc != 2)
> error (_("tracepoint number is required"));
> tfind_1 (tfind_tp, atoi (argv[1]), 0, 0, 0);
> }
> - else if (strcmp (mode, "pc") == 0)
> + else if (streq (mode, "pc"))
> {
> if (argc != 2)
> error (_("PC is required"));
> tfind_1 (tfind_pc, 0, parse_and_eval_address (argv[1]), 0, 0);
> }
> - else if (strcmp (mode, "pc-inside-range") == 0)
> + else if (streq (mode, "pc-inside-range"))
> {
> if (argc != 3)
> error (_("Start and end PC are required"));
> tfind_1 (tfind_range, 0, parse_and_eval_address (argv[1]),
> parse_and_eval_address (argv[2]), 0);
> }
> - else if (strcmp (mode, "pc-outside-range") == 0)
> + else if (streq (mode, "pc-outside-range"))
> {
> if (argc != 3)
> error (_("Start and end PC are required"));
> tfind_1 (tfind_outside, 0, parse_and_eval_address (argv[1]),
> parse_and_eval_address (argv[2]), 0);
> }
> - else if (strcmp (mode, "line") == 0)
> + else if (streq (mode, "line"))
> {
> if (argc != 2)
> error (_("Line is required"));
> diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c
> index 886d093c62cb..68c56c9b57f5 100644
> --- a/gdb/mi/mi-parse.c
> +++ b/gdb/mi/mi-parse.c
> @@ -349,7 +349,7 @@ mi_parse::mi_parse (const char *cmd, std::string *token)
> chp += as;
> }
> /* See if --all is the last token in the input. */
> - if (strcmp (chp, "--all") == 0)
> + if (streq (chp, "--all"))
> {
> this->all = 1;
> chp += strlen (chp);
> @@ -429,32 +429,32 @@ mi_parse::mi_parse (gdb::unique_xmalloc_ptr<char> command,
> const char *chp = args[i].get ();
>
> /* See if --all is the last token in the input. */
> - if (strcmp (chp, "--all") == 0)
> + if (streq (chp, "--all"))
> {
> this->all = 1;
> }
> - else if (strcmp (chp, "--thread-group") == 0)
> + else if (streq (chp, "--thread-group"))
> {
> ++i;
> if (i == args.size ())
> error ("No argument to '--thread-group'");
> this->set_thread_group (args[i].get (), nullptr);
> }
> - else if (strcmp (chp, "--thread") == 0)
> + else if (streq (chp, "--thread"))
> {
> ++i;
> if (i == args.size ())
> error ("No argument to '--thread'");
> this->set_thread (args[i].get (), nullptr);
> }
> - else if (strcmp (chp, "--frame") == 0)
> + else if (streq (chp, "--frame"))
> {
> ++i;
> if (i == args.size ())
> error ("No argument to '--frame'");
> this->set_frame (args[i].get (), nullptr);
> }
> - else if (strcmp (chp, "--language") == 0)
> + else if (streq (chp, "--language"))
> {
> ++i;
> if (i == args.size ())
> @@ -472,17 +472,14 @@ mi_parse::mi_parse (gdb::unique_xmalloc_ptr<char> command,
> enum print_values
> mi_parse_print_values (const char *name)
> {
> - if (strcmp (name, "0") == 0
> - || strcmp (name, mi_no_values) == 0)
> - return PRINT_NO_VALUES;
> - else if (strcmp (name, "1") == 0
> - || strcmp (name, mi_all_values) == 0)
> - return PRINT_ALL_VALUES;
> - else if (strcmp (name, "2") == 0
> - || strcmp (name, mi_simple_values) == 0)
> - return PRINT_SIMPLE_VALUES;
> - else
> - error (_("Unknown value for PRINT_VALUES: must be: \
> + if (streq (name, "0") || streq (name, mi_no_values))
> + return PRINT_NO_VALUES;
> + else if (streq (name, "1") || streq (name, mi_all_values))
> + return PRINT_ALL_VALUES;
> + else if (streq (name, "2") || streq (name, mi_simple_values))
> + return PRINT_SIMPLE_VALUES;
> + else
> + error (_("Unknown value for PRINT_VALUES: must be: \
> 0 or \"%s\", 1 or \"%s\", 2 or \"%s\""),
> - mi_no_values, mi_all_values, mi_simple_values);
> + mi_no_values, mi_all_values, mi_simple_values);
> }
> diff --git a/gdb/minsyms.c b/gdb/minsyms.c
> index 71cd1bb4c2bd..0d6ea53aecf6 100644
> --- a/gdb/minsyms.c
> +++ b/gdb/minsyms.c
> @@ -557,7 +557,7 @@ lookup_minimal_symbol_linkage (const char *name, struct objfile *objf,
> msymbol != NULL;
> msymbol = msymbol->hash_next)
> {
> - if (strcmp (msymbol->linkage_name (), name) == 0
> + if (streq (msymbol->linkage_name (), name)
> && (msymbol->type () == mst_data
> || msymbol->type () == mst_bss
> || (match_static_type
> @@ -611,10 +611,10 @@ lookup_minimal_symbol_text (program_space *pspace, const char *name,
> msymbol != NULL && found_symbol.minsym == NULL;
> msymbol = msymbol->hash_next)
> {
> - if (strcmp (msymbol->linkage_name (), name) == 0 &&
> - (msymbol->type () == mst_text
> - || msymbol->type () == mst_text_gnu_ifunc
> - || msymbol->type () == mst_file_text))
> + if (streq (msymbol->linkage_name (), name)
> + && (msymbol->type () == mst_text
> + || msymbol->type () == mst_text_gnu_ifunc
> + || msymbol->type () == mst_file_text))
> {
> switch (msymbol->type ())
> {
> @@ -678,7 +678,7 @@ lookup_minimal_symbol_by_pc_name (CORE_ADDR pc, const char *name,
> msymbol = msymbol->hash_next)
> {
> if (msymbol->value_address (&objfile) == pc
> - && strcmp (msymbol->linkage_name (), name) == 0)
> + && streq (msymbol->linkage_name (), name))
> return msymbol;
> }
> }
> @@ -1229,12 +1229,12 @@ compact_minimal_symbols (struct minimal_symbol *msymbol, int mcount,
> copyfrom = copyto = msymbol;
> while (copyfrom < msymbol + mcount - 1)
> {
> - if (copyfrom->unrelocated_address ()
> - == (copyfrom + 1)->unrelocated_address ()
> + if ((copyfrom->unrelocated_address ()
> + == (copyfrom + 1)->unrelocated_address ())
> && (copyfrom->section_index ()
> == (copyfrom + 1)->section_index ())
> - && strcmp (copyfrom->linkage_name (),
> - (copyfrom + 1)->linkage_name ()) == 0)
> + && streq (copyfrom->linkage_name (),
> + (copyfrom + 1)->linkage_name ()))
> {
> if ((copyfrom + 1)->type () == mst_unknown)
> (copyfrom + 1)->set_type (copyfrom->type ());
> @@ -1498,8 +1498,8 @@ find_solib_trampoline_target (const frame_info_ptr &frame, CORE_ADDR pc)
> || msymbol->type () == mst_text_gnu_ifunc
> || msymbol->type () == mst_data
> || msymbol->type () == mst_data_gnu_ifunc)
> - && strcmp (msymbol->linkage_name (),
> - tsymbol->linkage_name ()) == 0)
> + && streq (msymbol->linkage_name (),
> + tsymbol->linkage_name ()))
> {
> CORE_ADDR func;
>
> diff --git a/gdb/mips-sde-tdep.c b/gdb/mips-sde-tdep.c
> index 727d092b6312..036fc4c45a70 100644
> --- a/gdb/mips-sde-tdep.c
> +++ b/gdb/mips-sde-tdep.c
> @@ -153,9 +153,8 @@ mips_sde_frame_sniffer (const struct frame_unwind *self,
> const char *name;
>
> find_pc_partial_function (pc, &name, NULL, NULL);
> - return (name
> - && (strcmp (name, "_xcptcall") == 0
> - || strcmp (name, "_sigtramp") == 0));
> + return (name != nullptr
> + && (streq (name, "_xcptcall") || streq (name, "_sigtramp")));
> }
>
> /* Data structure for the SDE frame unwinder. */
> diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c
> index 3ecf5283a900..995a3b10915e 100644
> --- a/gdb/mips-tdep.c
> +++ b/gdb/mips-tdep.c
> @@ -7964,17 +7964,17 @@ mips_find_abi_from_sections (bfd *abfd)
> if (!startswith (name, ".mdebug."))
> continue;
>
> - if (strcmp (name, ".mdebug.abi32") == 0)
> + if (streq (name, ".mdebug.abi32"))
> return MIPS_ABI_O32;
> - else if (strcmp (name, ".mdebug.abiN32") == 0)
> + else if (streq (name, ".mdebug.abiN32"))
> return MIPS_ABI_N32;
> - else if (strcmp (name, ".mdebug.abi64") == 0)
> + else if (streq (name, ".mdebug.abi64"))
> return MIPS_ABI_N64;
> - else if (strcmp (name, ".mdebug.abiO64") == 0)
> + else if (streq (name, ".mdebug.abiO64"))
> return MIPS_ABI_O64;
> - else if (strcmp (name, ".mdebug.eabi32") == 0)
> + else if (streq (name, ".mdebug.eabi32"))
> return MIPS_ABI_EABI32;
> - else if (strcmp (name, ".mdebug.eabi64") == 0)
> + else if (streq (name, ".mdebug.eabi64"))
> return MIPS_ABI_EABI64;
> else
> warning (_("unsupported ABI %s."), name + 8);
> diff --git a/gdb/namespace.c b/gdb/namespace.c
> index b4a96c753775..5b5749369eeb 100644
> --- a/gdb/namespace.c
> +++ b/gdb/namespace.c
> @@ -53,25 +53,25 @@ add_using_directive (struct using_direct **using_directives,
> {
> int ix;
>
> - if (strcmp (current->import_src, src) != 0)
> + if (!streq (current->import_src, src))
> continue;
> - if (strcmp (current->import_dest, dest) != 0)
> + if (!streq (current->import_dest, dest))
> continue;
> if ((alias == NULL && current->alias != NULL)
> || (alias != NULL && current->alias == NULL)
> || (alias != NULL && current->alias != NULL
> - && strcmp (alias, current->alias) != 0))
> + && !streq (alias, current->alias)))
> continue;
> if ((declaration == NULL && current->declaration != NULL)
> || (declaration != NULL && current->declaration == NULL)
> || (declaration != NULL && current->declaration != NULL
> - && strcmp (declaration, current->declaration) != 0))
> + && !streq (declaration, current->declaration)))
> continue;
>
> /* Compare the contents of EXCLUDES. */
> for (ix = 0; ix < excludes.size (); ++ix)
> if (current->excludes[ix] == NULL
> - || strcmp (excludes[ix], current->excludes[ix]) != 0)
> + || !streq (excludes[ix], current->excludes[ix]))
> break;
> if (ix < excludes.size () || current->excludes[ix] != NULL)
> continue;
> diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c
> index 46aa2b730a78..046372da7457 100644
> --- a/gdb/nat/linux-btrace.c
> +++ b/gdb/nat/linux-btrace.c
> @@ -210,7 +210,7 @@ linux_determine_kernel_start (void)
> if (match != 2)
> continue;
>
> - if (strcmp (symbol, "_text") == 0)
> + if (streq (symbol, "_text"))
> {
> kernel_start = addr;
> break;
> diff --git a/gdb/nat/linux-osdata.c b/gdb/nat/linux-osdata.c
> index 57ac60175875..248dbab94289 100644
> --- a/gdb/nat/linux-osdata.c
> +++ b/gdb/nat/linux-osdata.c
> @@ -586,7 +586,7 @@ linux_xfer_osdata_cpus ()
>
> value[i] = '\0';
>
> - if (strcmp (key, "processor") == 0)
> + if (streq (key, "processor"))
> {
> if (first_item)
> buffer += "<item>";
> @@ -1392,7 +1392,7 @@ linux_common_xfer_osdata (const char *annex, gdb_byte *readbuf,
>
> for (i = 0; osdata_table[i].type; ++i)
> {
> - if (strcmp (annex, osdata_table[i].type) == 0)
> + if (streq (annex, osdata_table[i].type))
> return common_getter (&osdata_table[i],
> readbuf, offset, len);
> }
> diff --git a/gdb/nat/linux-procfs.c b/gdb/nat/linux-procfs.c
> index 90db9fad6b55..6281581aeeac 100644
> --- a/gdb/nat/linux-procfs.c
> +++ b/gdb/nat/linux-procfs.c
> @@ -105,7 +105,7 @@ parse_proc_status_state (const char *state)
> return PROC_STATE_TRACING_STOP;
> case 'T':
> /* Before Linux 2.6.33, tracing stop used uppercase T. */
> - if (strcmp (state, "T (stopped)\n") == 0)
> + if (streq (state, "T (stopped)\n"))
> return PROC_STATE_STOPPED;
> else /* "T (tracing stop)\n" */
> return PROC_STATE_TRACING_STOP;
> diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c
> index 3da3c3b61957..3640b31ec274 100644
> --- a/gdb/nds32-tdep.c
> +++ b/gdb/nds32-tdep.c
> @@ -2031,7 +2031,7 @@ nds32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
> {
> const char *regname = gdbarch_register_name (gdbarch, j);
>
> - if (strcmp (regname, nds32_register_aliases[i].name) == 0)
> + if (streq (regname, nds32_register_aliases[i].name))
> {
> regnum = j;
> break;
> diff --git a/gdb/objc-lang.c b/gdb/objc-lang.c
> index f14d7f16d376..2af438de6599 100644
> --- a/gdb/objc-lang.c
> +++ b/gdb/objc-lang.c
> @@ -1070,15 +1070,15 @@ find_methods (char type, const char *theclass, const char *category,
> continue;
>
> if ((theclass != NULL)
> - && ((nclass == NULL) || (strcmp (theclass, nclass) != 0)))
> + && ((nclass == NULL) || (!streq (theclass, nclass))))
> continue;
>
> - if ((category != NULL) &&
> - ((ncategory == NULL) || (strcmp (category, ncategory) != 0)))
> + if (category != nullptr
> + && ((ncategory == nullptr) || !streq (category, ncategory)))
> continue;
>
> - if ((selector != NULL) &&
> - ((nselector == NULL) || (strcmp (selector, nselector) != 0)))
> + if (selector != nullptr
> + && (nselector == nullptr || !streq (selector, nselector)))
> continue;
>
> symbol_names->push_back (symname);
> diff --git a/gdb/objfiles.c b/gdb/objfiles.c
> index ff98cf28ca6b..387434153e9a 100644
> --- a/gdb/objfiles.c
> +++ b/gdb/objfiles.c
> @@ -141,7 +141,7 @@ set_objfile_main_name (struct objfile *objfile,
> const char *name, enum language lang)
> {
> if (objfile->per_bfd->name_of_main == NULL
> - || strcmp (objfile->per_bfd->name_of_main, name) != 0)
> + || !streq (objfile->per_bfd->name_of_main, name))
> objfile->per_bfd->name_of_main
> = obstack_strdup (&objfile->per_bfd->storage_obstack, name);
> objfile->per_bfd->language_of_main = lang;
> @@ -982,7 +982,7 @@ pc_in_section (CORE_ADDR pc, const char *name)
> struct obj_section *s = find_pc_section (pc);
> return (s != nullptr
> && s->the_bfd_section->name != nullptr
> - && strcmp (s->the_bfd_section->name, name) == 0);
> + && streq (s->the_bfd_section->name, name));
> }
>
> /* See objfiles.h. */
> diff --git a/gdb/opencl-lang.c b/gdb/opencl-lang.c
> index 0ec7cf861ae9..8576f4224a29 100644
> --- a/gdb/opencl-lang.c
> +++ b/gdb/opencl-lang.c
> @@ -346,28 +346,28 @@ opencl_component_ref (struct expression *exp, struct value *val,
> && src_len != 16)
> error (_("Invalid OpenCL vector size"));
>
> - if (strcmp (comps, "lo") == 0 )
> + if (streq (comps, "lo"))
> {
> dst_len = (src_len == 3) ? 2 : src_len / 2;
>
> for (i = 0; i < dst_len; i++)
> indices[i] = i;
> }
> - else if (strcmp (comps, "hi") == 0)
> + else if (streq (comps, "hi"))
> {
> dst_len = (src_len == 3) ? 2 : src_len / 2;
>
> for (i = 0; i < dst_len; i++)
> indices[i] = dst_len + i;
> }
> - else if (strcmp (comps, "even") == 0)
> + else if (streq (comps, "even"))
> {
> dst_len = (src_len == 3) ? 2 : src_len / 2;
>
> for (i = 0; i < dst_len; i++)
> indices[i] = i*2;
> }
> - else if (strcmp (comps, "odd") == 0)
> + else if (streq (comps, "odd"))
> {
> dst_len = (src_len == 3) ? 2 : src_len / 2;
>
> diff --git a/gdb/osabi.c b/gdb/osabi.c
> index d00da1349a0e..49f618610b08 100644
> --- a/gdb/osabi.c
> +++ b/gdb/osabi.c
> @@ -353,7 +353,7 @@ check_note (bfd *abfd, asection *sect, char *note, unsigned int *sectsize,
>
> /* Check the note name. */
> if (bfd_h_get_32 (abfd, note) != (strlen (name) + 1)
> - || strcmp (note + 12, name) != 0)
> + || !streq (note + 12, name))
> return 0;
>
> /* Check the descriptor size. */
> @@ -391,7 +391,7 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect,
> char note[MAX_NOTESZ];
>
> /* .note.ABI-tag notes, used by GNU/Linux and FreeBSD. */
> - if (strcmp (name, ".note.ABI-tag") == 0)
> + if (streq (name, ".note.ABI-tag"))
> {
> /* GNU. */
> if (check_note (abfd, sect, note, §size, "GNU", 16, NT_GNU_ABI_TAG))
> @@ -440,7 +440,7 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect,
> }
>
> /* .note.netbsd.ident notes, used by NetBSD. */
> - if (strcmp (name, ".note.netbsd.ident") == 0
> + if (streq (name, ".note.netbsd.ident")
> && check_note (abfd, sect, note, §size, "NetBSD", 4, NT_NETBSD_IDENT))
> {
> /* There is no need to check the version yet. */
> @@ -449,7 +449,7 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect,
> }
>
> /* .note.openbsd.ident notes, used by OpenBSD. */
> - if (strcmp (name, ".note.openbsd.ident") == 0
> + if (streq (name, ".note.openbsd.ident")
> && check_note (abfd, sect, note, §size, "OpenBSD", 4,
> NT_OPENBSD_IDENT))
> {
> @@ -459,7 +459,7 @@ generic_elf_osabi_sniff_abi_tag_sections (bfd *abfd, asection *sect,
> }
>
> /* .note.netbsdcore.procinfo notes, used by NetBSD. */
> - if (strcmp (name, ".note.netbsdcore.procinfo") == 0)
> + if (streq (name, ".note.netbsdcore.procinfo"))
> {
> *osabi = GDB_OSABI_NETBSD;
> return;
> @@ -557,9 +557,9 @@ gdbarch_osabi_enum_name (enum gdb_osabi osabi)
> static void
> set_osabi (const char *args, int from_tty, struct cmd_list_element *c)
> {
> - if (strcmp (set_osabi_string, "auto") == 0)
> + if (streq (set_osabi_string, "auto"))
> user_osabi_state = osabi_auto;
> - else if (strcmp (set_osabi_string, "default") == 0)
> + else if (streq (set_osabi_string, "default"))
> {
> user_selected_osabi = GDB_OSABI_DEFAULT;
> user_osabi_state = osabi_user;
> @@ -572,7 +572,7 @@ set_osabi (const char *args, int from_tty, struct cmd_list_element *c)
> {
> enum gdb_osabi osabi = (enum gdb_osabi) i;
>
> - if (strcmp (set_osabi_string, gdbarch_osabi_name (osabi)) == 0)
> + if (streq (set_osabi_string, gdbarch_osabi_name (osabi)))
> {
> user_selected_osabi = osabi;
> user_osabi_state = osabi_user;
> @@ -619,7 +619,7 @@ INIT_GDB_FILE (gdb_osabi)
> /* Register the "set osabi" command. */
> user_osabi_state = osabi_auto;
> set_osabi_string = gdb_osabi_available_names[0];
> - gdb_assert (strcmp (set_osabi_string, "auto") == 0);
> + gdb_assert (streq (set_osabi_string, "auto"));
> add_setshow_enum_cmd ("osabi", class_support, gdb_osabi_available_names,
> &set_osabi_string,
> _("Set OS ABI of target."),
> diff --git a/gdb/p-exp.y b/gdb/p-exp.y
> index 00b67647fc56..37831be90748 100644
> --- a/gdb/p-exp.y
> +++ b/gdb/p-exp.y
> @@ -1374,29 +1374,29 @@ yylex (void)
> switch (namelen)
> {
> case 6:
> - if (strcmp (uptokstart, "OBJECT") == 0)
> + if (streq (uptokstart, "OBJECT"))
> {
> free (uptokstart);
> return CLASS;
> }
> - if (strcmp (uptokstart, "RECORD") == 0)
> + if (streq (uptokstart, "RECORD"))
> {
> free (uptokstart);
> return STRUCT;
> }
> - if (strcmp (uptokstart, "SIZEOF") == 0)
> + if (streq (uptokstart, "SIZEOF"))
> {
> free (uptokstart);
> return SIZEOF;
> }
> break;
> case 5:
> - if (strcmp (uptokstart, "CLASS") == 0)
> + if (streq (uptokstart, "CLASS"))
> {
> free (uptokstart);
> return CLASS;
> }
> - if (strcmp (uptokstart, "FALSE") == 0)
> + if (streq (uptokstart, "FALSE"))
> {
> yylval.lval = 0;
> free (uptokstart);
> @@ -1404,13 +1404,13 @@ yylex (void)
> }
> break;
> case 4:
> - if (strcmp (uptokstart, "TRUE") == 0)
> + if (streq (uptokstart, "TRUE"))
> {
> yylval.lval = 1;
> free (uptokstart);
> return TRUEKEYWORD;
> }
> - if (strcmp (uptokstart, "SELF") == 0)
> + if (streq (uptokstart, "SELF"))
> {
> /* Here we search for 'this' like
> inserted in FPC stabs debug info. */
> diff --git a/gdb/p-lang.c b/gdb/p-lang.c
> index f509f26e6ac2..3703e0247860 100644
> --- a/gdb/p-lang.c
> +++ b/gdb/p-lang.c
> @@ -99,9 +99,9 @@ pascal_is_string_type (struct type *type,int *length_pos, int *length_size,
> /* Two fields: length and st. */
> if (type->num_fields () == 2
> && type->field (0).name ()
> - && strcmp (type->field (0).name (), "length") == 0
> + && streq (type->field (0).name (), "length")
> && type->field (1).name ()
> - && strcmp (type->field (1).name (), "st") == 0)
> + && streq (type->field (1).name (), "st"))
> {
> if (length_pos)
> *length_pos = type->field (0).loc_bitpos () / TARGET_CHAR_BIT;
> @@ -119,9 +119,9 @@ pascal_is_string_type (struct type *type,int *length_pos, int *length_size,
> /* Three fields: Capacity, length and schema$ or _p_schema. */
> if (type->num_fields () == 3
> && type->field (0).name ()
> - && strcmp (type->field (0).name (), "Capacity") == 0
> + && streq (type->field (0).name (), "Capacity")
> && type->field (1).name ()
> - && strcmp (type->field (1).name (), "length") == 0)
> + && streq (type->field (1).name (), "length"))
> {
> if (length_pos)
> *length_pos = type->field (1).loc_bitpos () / TARGET_CHAR_BIT;
> diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c
> index 3e9b1c259b83..f64c1069b531 100644
> --- a/gdb/p-valprint.c
> +++ b/gdb/p-valprint.c
> @@ -426,9 +426,9 @@ pascal_language::value_print (struct value *val, struct ui_file *stream,
> /* Hack: remove (char *) for char strings. Their
> type is indicated by the quoted string anyway. */
> if (type->code () == TYPE_CODE_PTR
> - && type->name () == NULL
> - && type->target_type ()->name () != NULL
> - && strcmp (type->target_type ()->name (), "char") == 0)
> + && type->name () == nullptr
> + && type->target_type ()->name () != nullptr
> + && streq (type->target_type ()->name (), "char"))
> {
> /* Print nothing. */
> }
> @@ -474,8 +474,7 @@ pascal_object_is_vtbl_ptr_type (struct type *type)
> {
> const char *type_name = type->name ();
>
> - return (type_name != NULL
> - && strcmp (type_name, pascal_vtbl_ptr_name) == 0);
> + return type_name != nullptr && streq (type_name, pascal_vtbl_ptr_name);
> }
>
> /* Return truth value for the assertion that TYPE is of the type
> diff --git a/gdb/ppc-linux-tdep.c b/gdb/ppc-linux-tdep.c
> index 2dd36786bd3b..19698eaacbe5 100644
> --- a/gdb/ppc-linux-tdep.c
> +++ b/gdb/ppc-linux-tdep.c
> @@ -341,8 +341,8 @@ ppc_linux_ilp32_svr4_solib_ops::in_dynsym_resolve_code (CORE_ADDR pc) const
> if (sym.minsym == nullptr)
> return false;
>
> - return (strcmp (sym.minsym->linkage_name (), "__glink") == 0
> - || strcmp (sym.minsym->linkage_name (), "__glink_PLTresolve") == 0);
> + return (streq (sym.minsym->linkage_name (), "__glink")
> + || streq (sym.minsym->linkage_name (), "__glink_PLTresolve"));
> }
>
> /* Follow PLT stub to actual routine.
> @@ -2009,14 +2009,14 @@ ppc_floatformat_for_type (struct gdbarch *gdbarch,
> {
> if (len == 128 && name)
> {
> - if (strcmp (name, "__float128") == 0
> - || strcmp (name, "_Float128") == 0
> - || strcmp (name, "_Float64x") == 0
> - || strcmp (name, "complex _Float128") == 0
> - || strcmp (name, "complex _Float64x") == 0)
> + if (streq (name, "__float128")
> + || streq (name, "_Float128")
> + || streq (name, "_Float64x")
> + || streq (name, "complex _Float128")
> + || streq (name, "complex _Float64x"))
> return floatformats_ieee_quad;
>
> - if (strcmp (name, "__ibm128") == 0)
> + if (streq (name, "__ibm128"))
> return floatformats_ibm_long_double;
> }
>
> @@ -2033,8 +2033,8 @@ linux_dwarf2_omit_typedef_p (struct type *target_type,
> {
> if ((target_type->code () == TYPE_CODE_FLT
> || target_type->code () == TYPE_CODE_COMPLEX)
> - && (strcmp (name, "long double") == 0
> - || strcmp (name, "complex long double") == 0))
> + && (streq (name, "long double")
> + || streq (name, "complex long double")))
> {
> /* IEEE 128-bit floating point and IBM long double are two
> encodings for 128-bit values. The DWARF debug data can't
> diff --git a/gdb/ppc64-tdep.c b/gdb/ppc64-tdep.c
> index 74044097c6bd..9011a3546127 100644
> --- a/gdb/ppc64-tdep.c
> +++ b/gdb/ppc64-tdep.c
> @@ -752,7 +752,7 @@ ppc64_convert_from_func_ptr_addr (struct gdbarch *gdbarch,
> const struct target_section *s = target_section_by_addr (targ, addr);
>
> /* Check if ADDR points to a function descriptor. */
> - if (s && strcmp (s->the_bfd_section->name, ".opd") == 0)
> + if (s && streq (s->the_bfd_section->name, ".opd"))
> {
> /* There may be relocations that need to be applied to the .opd
> section. Unfortunately, this function may be called at a time
> diff --git a/gdb/probe.c b/gdb/probe.c
> index 08c613bd9c7f..f9eb94d18829 100644
> --- a/gdb/probe.c
> +++ b/gdb/probe.c
> @@ -729,7 +729,7 @@ ignore_probes_command (const char *arg, int from_tty)
> const char *idx = arg;
> std::string s = extract_arg (&idx);
>
> - if (strcmp (s.c_str (), "-reset") == 0)
> + if (streq (s.c_str (), "-reset"))
> {
> if (*idx != '\0')
> error (_("-reset: no arguments allowed"));
> @@ -739,8 +739,7 @@ ignore_probes_command (const char *arg, int from_tty)
> return;
> }
>
> - if (strcmp (s.c_str (), "-verbose") == 0
> - || strcmp (s.c_str (), "-v") == 0)
> + if (streq (s.c_str (), "-verbose") || streq (s.c_str (), "-v"))
> {
> verbose_p = true;
> arg = idx;
> diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
> index c5d3d7e2d7e7..03388812ff89 100644
> --- a/gdb/python/py-breakpoint.c
> +++ b/gdb/python/py-breakpoint.c
> @@ -1410,7 +1410,7 @@ local_setattro (PyObject *self, PyObject *name, PyObject *v)
> /* If the attribute trying to be set is the "stop" method,
> but we already have a condition set in the CLI or other extension
> language, disallow this operation. */
> - if (strcmp (attr.get (), stop_func) == 0)
> + if (streq (attr.get (), stop_func))
> {
> const struct extension_language_defn *extlang = NULL;
>
> diff --git a/gdb/python/py-lazy-string.c b/gdb/python/py-lazy-string.c
> index 26998064206e..fe191451e548 100644
> --- a/gdb/python/py-lazy-string.c
> +++ b/gdb/python/py-lazy-string.c
> @@ -231,7 +231,7 @@ gdbpy_create_lazy_string_object (CORE_ADDR address, long length,
>
> str_obj->address = address;
> str_obj->length = length;
> - if (encoding == NULL || !strcmp (encoding, ""))
> + if (encoding == NULL || streq (encoding, ""))
> str_obj->encoding = NULL;
> else
> str_obj->encoding = xstrdup (encoding);
> diff --git a/gdb/python/py-micmd.c b/gdb/python/py-micmd.c
> index 0c820751c567..ab06e197d841 100644
> --- a/gdb/python/py-micmd.c
> +++ b/gdb/python/py-micmd.c
> @@ -144,8 +144,7 @@ struct mi_command_py : public mi_command
> than changing the value of mi_command::m_name (which is not accessible
> from here) to point to the name owned by the new object, swap the names
> of the two objects, since we know they are identical strings. */
> - gdb_assert (strcmp (new_pyobj->mi_command_name,
> - m_pyobj->mi_command_name) == 0);
> + gdb_assert (streq (new_pyobj->mi_command_name, m_pyobj->mi_command_name));
> std::swap (new_pyobj->mi_command_name, m_pyobj->mi_command_name);
>
> /* Take a reference to the new object, drop the reference to the current
> @@ -385,7 +384,7 @@ micmdpy_init (PyObject *self, PyObject *args, PyObject *kwargs)
>
> So, for now at least, we don't allow this. This doesn't seem like
> an excessive restriction. */
> - if (strcmp (cmd->mi_command_name, name) != 0)
> + if (!streq (cmd->mi_command_name, name))
> {
> PyErr_SetString
> (PyExc_ValueError,
> diff --git a/gdb/python/py-param.c b/gdb/python/py-param.c
> index 8765b1b383d1..bc028f1746c6 100644
> --- a/gdb/python/py-param.c
> +++ b/gdb/python/py-param.c
> @@ -242,7 +242,7 @@ set_parameter_value (parmpy_object *self, PyObject *value)
> if (str == NULL)
> return -1;
> for (i = 0; self->enumeration[i]; ++i)
> - if (! strcmp (self->enumeration[i], str.get ()))
> + if (streq (self->enumeration[i], str.get ()))
> break;
> if (! self->enumeration[i])
> {
> @@ -328,8 +328,8 @@ set_parameter_value (parmpy_object *self, PyObject *value)
> buffer += ", ";
> buffer = buffer + "'" + l->literal + "'";
> if (allowed == TRIBOOL_UNKNOWN
> - && ((value == Py_None && !strcmp ("unlimited", l->literal))
> - || (s != nullptr && !strcmp (s, l->literal))))
> + && ((value == Py_None && streq ("unlimited", l->literal))
> + || (s != nullptr && streq (s, l->literal))))
> {
> val = l->use;
> allowed = TRIBOOL_TRUE;
> diff --git a/gdb/python/py-prettyprint.c b/gdb/python/py-prettyprint.c
> index 3dcb4fba1e48..0cf0cde881c4 100644
> --- a/gdb/python/py-prettyprint.c
> +++ b/gdb/python/py-prettyprint.c
> @@ -323,7 +323,7 @@ print_string_repr (PyObject *printer, const char *hint,
> length = PyBytes_Size (string.get ());
> type = builtin_type (gdbarch)->builtin_char;
>
> - if (hint && !strcmp (hint, "string"))
> + if (hint && streq (hint, "string"))
> language->printstr (stream, type, (gdb_byte *) output,
> length, NULL, 0, options);
> else
> @@ -370,8 +370,8 @@ print_children (PyObject *printer, const char *hint,
>
> /* If we are printing a map or an array, we want some special
> formatting. */
> - is_map = hint && ! strcmp (hint, "map");
> - is_array = hint && ! strcmp (hint, "array");
> + is_map = hint && streq (hint, "map");
> + is_array = hint && streq (hint, "array");
>
> gdbpy_ref<> children (PyObject_CallMethodObjArgs (printer, gdbpy_children_cst,
> NULL));
> diff --git a/gdb/python/py-style.c b/gdb/python/py-style.c
> index aa6eccaadbe3..d149d90aaa9f 100644
> --- a/gdb/python/py-style.c
> +++ b/gdb/python/py-style.c
> @@ -135,28 +135,27 @@ stylepy_style_from_name (const char *name, bool *has_intensity_ptr = nullptr,
> if (!sub->var.has_value ())
> continue;
>
> - if (strcmp (sub->name, "foreground") == 0)
> + if (streq (sub->name, "foreground"))
> {
> const ui_file_style::color &color
> = sub->var->get<ui_file_style::color> ();
> style.set_fg (color);
> has_fg = true;
> }
> - else if (strcmp (sub->name, "background") == 0)
> + else if (streq (sub->name, "background"))
> {
> const ui_file_style::color &color
> = sub->var->get<ui_file_style::color> ();
> style.set_bg (color);
> has_bg = true;
> }
> - else if (strcmp (sub->name, "intensity") == 0
> - && sub->var->type () == var_enum)
> + else if (streq (sub->name, "intensity") && sub->var->type () == var_enum)
> {
> const char *intensity_str = sub->var->get<const char *> ();
> ui_file_style::intensity intensity = ui_file_style::NORMAL;
> - if (strcmp (intensity_str, "bold") == 0)
> + if (streq (intensity_str, "bold"))
> intensity = ui_file_style::BOLD;
> - else if (strcmp (intensity_str, "dim") == 0)
> + else if (streq (intensity_str, "dim"))
> intensity = ui_file_style::DIM;
> style.set_intensity (intensity);
> has_intensity = true;
> diff --git a/gdb/python/python.c b/gdb/python/python.c
> index 5474b8d644f8..6e13ab5bb3f7 100644
> --- a/gdb/python/python.c
> +++ b/gdb/python/python.c
> @@ -552,7 +552,7 @@ gdbpy_parameter_value (const setting &var)
> l++)
> if (value == l->use)
> {
> - if (strcmp (l->literal, "unlimited") == 0)
> + if (streq (l->literal, "unlimited"))
> {
> /* Compatibility hack for API brokenness. */
> if (var.type () == var_pinteger
> diff --git a/gdb/record.c b/gdb/record.c
> index 84a649c9e4e9..c01a1fd2bcf1 100644
> --- a/gdb/record.c
> +++ b/gdb/record.c
> @@ -103,20 +103,20 @@ record_start (const char *method, const char *format, int from_tty)
> else
> error (_("Invalid format."));
> }
> - else if (strcmp (method, "full") == 0)
> + else if (streq (method, "full"))
> {
> if (format == NULL)
> execute_command_to_string ("record full", from_tty, false);
> else
> error (_("Invalid format."));
> }
> - else if (strcmp (method, "btrace") == 0)
> + else if (streq (method, "btrace"))
> {
> if (format == NULL)
> execute_command_to_string ("record btrace", from_tty, false);
> - else if (strcmp (format, "bts") == 0)
> + else if (streq (format, "bts"))
> execute_command_to_string ("record btrace bts", from_tty, false);
> - else if (strcmp (format, "pt") == 0)
> + else if (streq (format, "pt"))
> execute_command_to_string ("record btrace pt", from_tty, false);
> else
> error (_("Invalid format."));
> @@ -561,9 +561,9 @@ cmd_record_insn_history (const char *arg, int from_tty)
>
> int size = command_size_to_target_size (record_insn_history_size);
>
> - if (arg == NULL || *arg == 0 || strcmp (arg, "+") == 0)
> + if (arg == NULL || *arg == 0 || streq (arg, "+"))
> target_insn_history (size, flags);
> - else if (strcmp (arg, "-") == 0)
> + else if (streq (arg, "-"))
> target_insn_history (-size, flags);
> else
> {
> @@ -678,9 +678,9 @@ cmd_record_call_history (const char *arg, int from_tty)
>
> int size = command_size_to_target_size (record_call_history_size);
>
> - if (arg == NULL || *arg == 0 || strcmp (arg, "+") == 0)
> + if (arg == NULL || *arg == 0 || streq (arg, "+"))
> target_call_history (size, flags);
> - else if (strcmp (arg, "-") == 0)
> + else if (streq (arg, "-"))
> target_call_history (-size, flags);
> else
> {
> diff --git a/gdb/regformats/regdef.h b/gdb/regformats/regdef.h
> index e2ef0a0b6905..dc6d8f97126f 100644
> --- a/gdb/regformats/regdef.h
> +++ b/gdb/regformats/regdef.h
> @@ -51,7 +51,7 @@ struct reg
>
> bool operator== (const reg &other) const
> {
> - return (strcmp (name, other.name) == 0
> + return (streq (name, other.name)
> && offset == other.offset
> && size == other.size);
> }
> diff --git a/gdb/reggroups.c b/gdb/reggroups.c
> index d5af2ce0736b..9619aac2b8c6 100644
> --- a/gdb/reggroups.c
> +++ b/gdb/reggroups.c
> @@ -170,7 +170,7 @@ reggroup_find (struct gdbarch *gdbarch, const char *name)
> {
> for (const struct reggroup *group : gdbarch_reggroups (gdbarch))
> {
> - if (strcmp (name, group->name ()) == 0)
> + if (streq (name, group->name ()))
> return group;
> }
> return NULL;
> diff --git a/gdb/remote-fileio.c b/gdb/remote-fileio.c
> index 30afc3737ab8..0b56e1ddca93 100644
> --- a/gdb/remote-fileio.c
> +++ b/gdb/remote-fileio.c
> @@ -1072,7 +1072,7 @@ do_remote_fileio_request (remote_target *remote, char *buf)
> else
> c = strchr (buf, '\0');
> for (idx = 0; remote_fio_func_map[idx].name; ++idx)
> - if (!strcmp (remote_fio_func_map[idx].name, buf))
> + if (streq (remote_fio_func_map[idx].name, buf))
> break;
> if (!remote_fio_func_map[idx].name)
> remote_fileio_reply (remote, -1, FILEIO_ENOSYS);
> diff --git a/gdb/remote.c b/gdb/remote.c
> index 88b06e688bc6..46bc584b27dc 100644
> --- a/gdb/remote.c
> +++ b/gdb/remote.c
> @@ -2432,11 +2432,9 @@ set_memory_packet_size (const char *args, struct memory_packet_config *config,
>
> if (args == NULL)
> error (_("Argument required (integer, \"fixed\" or \"limit\")."));
> - else if (strcmp (args, "hard") == 0
> - || strcmp (args, "fixed") == 0)
> + else if (streq (args, "hard") || streq (args, "fixed"))
> fixed_p = 1;
> - else if (strcmp (args, "soft") == 0
> - || strcmp (args, "limit") == 0)
> + else if (streq (args, "soft") || streq (args, "limit"))
> fixed_p = 0;
> else
> {
> @@ -3053,7 +3051,7 @@ remote_target::remote_query_attached (int pid)
> switch (result.status ())
> {
> case PACKET_OK:
> - if (strcmp (rs->buf.data (), "1") == 0)
> + if (streq (rs->buf.data (), "1"))
> return 1;
> break;
> case PACKET_ERROR:
> @@ -3351,7 +3349,7 @@ remote_target::pass_signals (gdb::array_view<const unsigned char> pass_signals)
> }
> }
> *p = 0;
> - if (!rs->last_pass_packet || strcmp (rs->last_pass_packet, pass_packet))
> + if (!rs->last_pass_packet || !streq (rs->last_pass_packet, pass_packet))
> {
> putpkt (pass_packet);
> getpkt (&rs->buf);
> @@ -3471,7 +3469,7 @@ remote_target::program_signals (gdb::array_view<const unsigned char> signals)
> }
> *p = 0;
> if (!rs->last_program_signals_packet
> - || strcmp (rs->last_program_signals_packet, packet) != 0)
> + || !streq (rs->last_program_signals_packet, packet))
> {
> putpkt (packet);
> getpkt (&rs->buf);
> @@ -5531,12 +5529,12 @@ remote_target::start_remote_1 (int from_tty, int extended_p)
>
> putpkt (v_mustreplyempty);
> getpkt (&rs->buf);
> - if (strcmp (rs->buf.data (), "OK") == 0)
> + if (streq (rs->buf.data (), "OK"))
> {
> m_features.m_protocol_packets[PACKET_vFile_setfs].support
> = PACKET_DISABLE;
> }
> - else if (strcmp (rs->buf.data (), "") != 0)
> + else if (!streq (rs->buf.data (), ""))
> error (_("Remote replied unexpectedly to '%s': %s"), v_mustreplyempty,
> rs->buf.data ());
> }
> @@ -5631,7 +5629,7 @@ remote_target::start_remote_1 (int from_tty, int extended_p)
> putpkt ("QNonStop:1");
> getpkt (&rs->buf);
>
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Remote refused setting non-stop mode with: %s"),
> rs->buf.data ());
>
> @@ -5648,7 +5646,7 @@ remote_target::start_remote_1 (int from_tty, int extended_p)
> putpkt ("QNonStop:0");
> getpkt (&rs->buf);
>
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Remote refused setting all-stop mode with: %s"),
> rs->buf.data ());
> }
> @@ -5775,7 +5773,7 @@ remote_target::start_remote_1 (int from_tty, int extended_p)
> reply. In the latter case, there may be more than one thread
> stopped --- we pull them all out using the vStopped
> mechanism. */
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> {
> const notif_client *notif = ¬if_client_stop;
>
> @@ -6015,7 +6013,7 @@ remote_target::set_permissions ()
>
> /* If the target didn't like the packet, warn the user. Do not try
> to undo the user's settings, that would just be maddening. */
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> warning (_("Remote refused setting permissions with: %s"),
> rs->buf.data ());
> }
> @@ -6284,7 +6282,7 @@ register_remote_support_xml (const char *xml)
>
> do
> {
> - if (strcmp (p, xml) == 0)
> + if (streq (p, xml))
> {
> /* already there */
> xfree (copy);
> @@ -6473,7 +6471,7 @@ remote_target::remote_query_supported ()
> }
>
> for (i = 0; i < ARRAY_SIZE (remote_protocol_features); i++)
> - if (strcmp (remote_protocol_features[i].name, p) == 0)
> + if (streq (remote_protocol_features[i].name, p))
> {
> const struct protocol_feature *feature;
>
> @@ -7086,7 +7084,7 @@ extended_remote_target::attach (const char *args, int from_tty)
> wait_status = (char *) alloca (strlen (rs->buf.data ()) + 1);
> strcpy (wait_status, rs->buf.data ());
> }
> - else if (strcmp (rs->buf.data (), "OK") != 0)
> + else if (!streq (rs->buf.data (), "OK"))
> error (_("Attaching to %s failed with: %s"),
> target_pid_to_str (ptid_t (pid)).c_str (),
> rs->buf.data ());
> @@ -7457,7 +7455,7 @@ remote_target::remote_resume_with_vcont (ptid_t scope_ptid, int step,
> reply will be reported asynchronously by means of a `%Stop'
> notification. */
> getpkt (&rs->buf);
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Unexpected vCont reply in non-stop mode: %s"),
> rs->buf.data ());
> }
> @@ -7609,7 +7607,7 @@ vcont_builder::flush ()
> rs = m_remote->get_remote_state ();
> m_remote->putpkt (rs->buf);
> m_remote->getpkt (&rs->buf);
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Unexpected vCont reply in non-stop mode: %s"), rs->buf.data ());
> }
>
> @@ -7973,7 +7971,7 @@ remote_target::remote_stop_ns (ptid_t ptid)
> come in asynchronously by notification. */
> putpkt (rs->buf);
> getpkt (&rs->buf);
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Stopping %s failed: %s"), target_pid_to_str (ptid).c_str (),
> rs->buf.data ());
> }
> @@ -8841,7 +8839,7 @@ remote_target::remote_notif_get_pending_events (const notif_client *nc)
> while (1)
> {
> getpkt (&rs->buf);
> - if (strcmp (rs->buf.data (), "OK") == 0)
> + if (streq (rs->buf.data (), "OK"))
> break;
> else
> remote_notif_ack (this, nc, rs->buf.data ());
> @@ -11237,7 +11235,7 @@ remote_target::extended_remote_disable_randomization (int val)
> reply = remote_get_noisy_reply ();
> if (*reply == '\0')
> error (_("Target does not support QDisableRandomization."));
> - if (strcmp (reply, "OK") != 0)
> + if (!streq (reply, "OK"))
> error (_("Bogus QDisableRandomization reply from target: %s"), reply);
> }
>
> @@ -11332,7 +11330,7 @@ remote_target::send_environment_packet (const char *action,
>
> putpkt (rs->buf);
> getpkt (&rs->buf);
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> warning (_("Unable to %s environment variable '%s' on remote."),
> action, value);
> }
> @@ -11348,7 +11346,7 @@ remote_target::extended_remote_environment_support ()
> {
> putpkt ("QEnvironmentReset");
> getpkt (&rs->buf);
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> warning (_("Unable to reset environment on remote."));
> }
>
> @@ -11525,7 +11523,7 @@ extended_remote_target::create_inferior (const char *exec_file,
> "QStartupWithShell:%d", startup_with_shell ? 1 : 0);
> putpkt (rs->buf);
> getpkt (&rs->buf);
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> error (_("\
> Remote replied unexpectedly while setting startup-with-shell: %s"),
> rs->buf.data ());
> @@ -12083,7 +12081,7 @@ compare_sections_command (const char *args, int from_tty)
> if (!current_program_space->exec_bfd ())
> error (_("command cannot be used without an exec file"));
>
> - if (args != NULL && strcmp (args, "-r") == 0)
> + if (args != NULL && streq (args, "-r"))
> {
> read_only = 1;
> args = NULL;
> @@ -12102,7 +12100,7 @@ compare_sections_command (const char *args, int from_tty)
> continue; /* Skip zero-length section. */
>
> sectname = bfd_section_name (s);
> - if (args && strcmp (args, sectname) != 0)
> + if (args && !streq (args, sectname))
> continue; /* Not the section selected by user. */
>
> matched = 1; /* Do this section. */
> @@ -12203,8 +12201,8 @@ remote_target::remote_read_qxfer (const char *object_name,
> this request. */
> if (rs->finished_object)
> {
> - if (strcmp (object_name, rs->finished_object) == 0
> - && strcmp (annex ? annex : "", rs->finished_annex) == 0
> + if (streq (object_name, rs->finished_object)
> + && streq (annex ? annex : "", rs->finished_annex)
> && offset == rs->finished_offset)
> return TARGET_XFER_EOF;
>
> @@ -12633,7 +12631,7 @@ remote_target::rcmd (const char *command, struct ui_file *outbuf)
> break;
> }
>
> - if (strcmp (buf, "OK") != 0)
> + if (!streq (buf, "OK"))
> {
> for (p = buf; p[0] != '\0' && p[1] != '\0'; p += 2)
> {
> @@ -14241,7 +14239,7 @@ remote_target::trace_init ()
>
> putpkt ("QTinit");
> remote_get_noisy_reply ();
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Target does not support this command."));
> }
>
> @@ -14264,7 +14262,7 @@ remote_target::remote_download_command_source (int num, ULONGEST addr,
> rs->buf.size () - strlen (rs->buf.data ()));
> putpkt (rs->buf);
> remote_get_noisy_reply ();
> - if (strcmp (rs->buf.data (), "OK"))
> + if (!streq (rs->buf.data (), "OK"))
> warning (_("Target does not support source download."));
>
> if (cmd->control_type == while_control
> @@ -14279,7 +14277,7 @@ remote_target::remote_download_command_source (int num, ULONGEST addr,
> rs->buf.size () - strlen (rs->buf.data ()));
> putpkt (rs->buf);
> remote_get_noisy_reply ();
> - if (strcmp (rs->buf.data (), "OK"))
> + if (!streq (rs->buf.data (), "OK"))
> warning (_("Target does not support source download."));
> }
> }
> @@ -14426,7 +14424,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
>
> putpkt (buf.data ());
> remote_get_noisy_reply ();
> - if (strcmp (rs->buf.data (), "OK"))
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Target does not support tracepoints."));
>
> /* do_single_steps (t); */
> @@ -14448,7 +14446,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
>
> putpkt (buf.data ());
> remote_get_noisy_reply ();
> - if (strcmp (rs->buf.data (), "OK"))
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Error on target while setting tracepoints."));
> }
>
> @@ -14471,7 +14469,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
>
> putpkt (buf.data ());
> remote_get_noisy_reply ();
> - if (strcmp (rs->buf.data (), "OK"))
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Error on target while setting tracepoints."));
> }
>
> @@ -14490,7 +14488,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
> buf.size () - strlen (buf.data ()));
> putpkt (buf.data ());
> remote_get_noisy_reply ();
> - if (strcmp (rs->buf.data (), "OK"))
> + if (!streq (rs->buf.data (), "OK"))
> warning (_("Target does not support source download."));
> }
> if (b->cond_string)
> @@ -14506,7 +14504,7 @@ remote_target::download_tracepoint (struct bp_location *loc)
> buf.size () - strlen (buf.data ()));
> putpkt (buf.data ());
> remote_get_noisy_reply ();
> - if (strcmp (rs->buf.data (), "OK"))
> + if (!streq (rs->buf.data (), "OK"))
> warning (_("Target does not support source download."));
> }
> remote_download_command_source (b->number, loc->address,
> @@ -14561,7 +14559,7 @@ remote_target::download_trace_state_variable (const trace_state_variable &tsv)
> remote_get_noisy_reply ();
> if (rs->buf[0] == '\0')
> error (_("Target does not support this command."));
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Error on target while downloading trace state variable."));
> }
>
> @@ -14577,7 +14575,7 @@ remote_target::enable_tracepoint (struct bp_location *location)
> remote_get_noisy_reply ();
> if (rs->buf[0] == '\0')
> error (_("Target does not support enabling tracepoints while a trace run is ongoing."));
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Error on target while enabling tracepoint."));
> }
>
> @@ -14593,7 +14591,7 @@ remote_target::disable_tracepoint (struct bp_location *location)
> remote_get_noisy_reply ();
> if (rs->buf[0] == '\0')
> error (_("Target does not support disabling tracepoints while a trace run is ongoing."));
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Error on target while disabling tracepoint."));
> }
>
> @@ -14658,7 +14656,7 @@ remote_target::trace_start ()
> remote_get_noisy_reply ();
> if (rs->buf[0] == '\0')
> error (_("Target does not support this command."));
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Bogus reply from target: %s"), rs->buf.data ());
> }
>
> @@ -14770,7 +14768,7 @@ remote_target::trace_stop ()
> remote_get_noisy_reply ();
> if (rs->buf[0] == '\0')
> error (_("Target does not support this command."));
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Bogus reply from target: %s"), rs->buf.data ());
> }
>
> @@ -14898,7 +14896,7 @@ remote_target::save_trace_data (const char *filename)
> reply = remote_get_noisy_reply ();
> if (*reply == '\0')
> error (_("Target does not support this command."));
> - if (strcmp (reply, "OK") != 0)
> + if (!streq (reply, "OK"))
> error (_("Bogus reply from target: %s"), reply);
> return 0;
> }
> @@ -14962,7 +14960,7 @@ remote_target::set_disconnected_tracing (int val)
> reply = remote_get_noisy_reply ();
> if (*reply == '\0')
> error (_("Target does not support this command."));
> - if (strcmp (reply, "OK") != 0)
> + if (!streq (reply, "OK"))
> error (_("Bogus reply from target: %s"), reply);
> }
> else if (val)
> @@ -14992,7 +14990,7 @@ remote_target::set_circular_trace_buffer (int val)
> reply = remote_get_noisy_reply ();
> if (*reply == '\0')
> error (_("Target does not support this command."));
> - if (strcmp (reply, "OK") != 0)
> + if (!streq (reply, "OK"))
> error (_("Bogus reply from target: %s"), reply);
> }
>
> @@ -15117,7 +15115,7 @@ remote_target::set_trace_notes (const char *user, const char *notes,
> if (*reply == '\0')
> return false;
>
> - if (strcmp (reply, "OK") != 0)
> + if (!streq (reply, "OK"))
> error (_("Bogus reply from target: %s"), reply);
>
> return true;
> @@ -15135,7 +15133,7 @@ remote_target::use_agent (bool use)
> putpkt (rs->buf);
> getpkt (&rs->buf);
>
> - if (strcmp (rs->buf.data (), "OK") == 0)
> + if (streq (rs->buf.data (), "OK"))
> {
> ::use_agent = use;
> return true;
> @@ -15164,7 +15162,7 @@ check_xml_btrace_version (struct gdb_xml_parser *parser,
> const char *version
> = (const char *) xml_find_attribute (attributes, "version")->value.get ();
>
> - if (strcmp (version, "1.0") != 0)
> + if (!streq (version, "1.0"))
> gdb_xml_error (parser, _("Unsupported btrace version: \"%s\""), version);
> }
>
> @@ -15260,7 +15258,7 @@ parse_xml_btrace_pt_config_cpu (struct gdb_xml_parser *parser,
>
> btrace = (struct btrace_data *) user_data;
>
> - if (strcmp (vendor, "GenuineIntel") == 0)
> + if (streq (vendor, "GenuineIntel"))
> btrace->variant.pt.config.cpu.vendor = CV_INTEL;
>
> btrace->variant.pt.config.cpu.family = *family;
> @@ -16017,7 +16015,7 @@ remote_target::thread_events (bool enable)
> switch (result.status ())
> {
> case PACKET_OK:
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Remote refused setting thread events: %s"), rs->buf.data ());
> rs->last_thread_events = enable;
> break;
> @@ -16073,7 +16071,7 @@ remote_target::commit_requested_thread_options ()
> switch (result.status ())
> {
> case PACKET_OK:
> - if (strcmp (rs->buf.data (), "OK") != 0)
> + if (!streq (rs->buf.data (), "OK"))
> error (_("Remote refused setting thread options: %s"), rs->buf.data ());
> break;
> case PACKET_ERROR:
> @@ -16150,7 +16148,7 @@ show_remote_cmd (const char *args, int from_tty)
> ui_out_emit_tuple tuple_emitter (uiout, "showlist");
> const ui_file_style cmd_style = command_style.style ();
> for (; list != NULL; list = list->next)
> - if (strcmp (list->name, "Z-packet") == 0)
> + if (streq (list->name, "Z-packet"))
> continue;
> else if (list->type == not_set_cmd)
> /* Alias commands are exactly like the original, except they
> @@ -16562,11 +16560,11 @@ test_memory_tagging_functions ()
>
> expected = "qMemTags:0,0:0";
> create_fetch_memtags_request (packet, 0x0, 0x0, 0);
> - SELF_CHECK (strcmp (packet.data (), expected.c_str ()) == 0);
> + SELF_CHECK (streq (packet.data (), expected.c_str ()));
>
> expected = "qMemTags:deadbeef,10:1";
> create_fetch_memtags_request (packet, 0xdeadbeef, 16, 1);
> - SELF_CHECK (strcmp (packet.data (), expected.c_str ()) == 0);
> + SELF_CHECK (streq (packet.data (), expected.c_str ()));
>
> /* Test parsing a qMemTags reply. */
>
> @@ -16614,7 +16612,7 @@ test_memory_tagging_functions ()
> /* Test creating a qIsAddressTagged request. */
> expected = "qIsAddressTagged:deadbeef";
> create_is_address_tagged_request (gdbarch, packet, 0xdeadbeef);
> - SELF_CHECK (strcmp (packet.data (), expected.c_str ()) == 0);
> + SELF_CHECK (streq (packet.data (), expected.c_str ()));
>
> /* Test error reply on qIsAddressTagged request. */
> reply = "E00";
> @@ -16684,11 +16682,11 @@ test_packet_check_result ()
> packet_result result = packet_check_result (buf.data ());
>
> SELF_CHECK (result.status () == PACKET_ERROR);
> - SELF_CHECK (strcmp(result.err_msg (), "msg") == 0);
> + SELF_CHECK (streq (result.err_msg (), "msg"));
>
> result = packet_check_result ("E01");
> SELF_CHECK (result.status () == PACKET_ERROR);
> - SELF_CHECK (strcmp(result.err_msg (), "01") == 0);
> + SELF_CHECK (streq (result.err_msg (), "01"));
>
> SELF_CHECK (packet_check_result ("E1").status () == PACKET_OK);
>
> @@ -16696,7 +16694,7 @@ test_packet_check_result ()
>
> result = packet_check_result ("E.");
> SELF_CHECK (result.status () == PACKET_ERROR);
> - SELF_CHECK (strcmp(result.err_msg (), "no error provided") == 0);
> + SELF_CHECK (streq (result.err_msg (), "no error provided"));
>
> SELF_CHECK (packet_check_result ("some response").status () == PACKET_OK);
>
> diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c
> index 8b06566582c5..4dfbd2ec2b86 100644
> --- a/gdb/riscv-tdep.c
> +++ b/gdb/riscv-tdep.c
> @@ -1114,8 +1114,8 @@ riscv_register_type (struct gdbarch *gdbarch, int regnum)
> if (flen == 8
> && type->code () == TYPE_CODE_FLT
> && type->length () == flen
> - && (strcmp (type->name (), "builtin_type_ieee_double") == 0
> - || strcmp (type->name (), "double") == 0))
> + && (streq (type->name (), "builtin_type_ieee_double")
> + || streq (type->name (), "double")))
> type = riscv_fpreg_d_type (gdbarch);
> }
>
> @@ -4103,16 +4103,16 @@ riscv_tdesc_unknown_reg (struct gdbarch *gdbarch, tdesc_feature *feature,
> number that GDB has assigned them. Then in riscv_register_name we will
> return no name for the three duplicates, this hides the duplicates from
> the user. */
> - if (strcmp (tdesc_feature_name (feature), riscv_freg_feature.name ()) == 0)
> + if (streq (tdesc_feature_name (feature), riscv_freg_feature.name ()))
> {
> riscv_gdbarch_tdep *tdep = gdbarch_tdep<riscv_gdbarch_tdep> (gdbarch);
> int *regnum_ptr = nullptr;
>
> - if (strcmp (reg_name, "fflags") == 0)
> + if (streq (reg_name, "fflags"))
> regnum_ptr = &tdep->duplicate_fflags_regnum;
> - else if (strcmp (reg_name, "frm") == 0)
> + else if (streq (reg_name, "frm"))
> regnum_ptr = &tdep->duplicate_frm_regnum;
> - else if (strcmp (reg_name, "fcsr") == 0)
> + else if (streq (reg_name, "fcsr"))
> regnum_ptr = &tdep->duplicate_fcsr_regnum;
>
> if (regnum_ptr != nullptr)
> @@ -4134,7 +4134,7 @@ riscv_tdesc_unknown_reg (struct gdbarch *gdbarch, tdesc_feature *feature,
> /* Any unknown registers in the CSR feature are recorded within a single
> block so we can easily identify these registers when making choices
> about register groups in riscv_register_reggroup_p. */
> - if (strcmp (tdesc_feature_name (feature), riscv_csr_feature.name ()) == 0)
> + if (streq (tdesc_feature_name (feature), riscv_csr_feature.name ()))
> {
> riscv_gdbarch_tdep *tdep = gdbarch_tdep<riscv_gdbarch_tdep> (gdbarch);
> if (tdep->unknown_csrs_first_regnum == -1)
> diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
> index 2c628408b41d..e135df94a406 100644
> --- a/gdb/rs6000-tdep.c
> +++ b/gdb/rs6000-tdep.c
> @@ -2173,7 +2173,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc,
>
> tmp = find_pc_misc_function (pc);
> if (tmp >= 0
> - && strcmp (misc_function_vector[tmp].name, main_name ()) == 0)
> + && streq (misc_function_vector[tmp].name, main_name ()))
> return pc + 8;
> }
> }
> @@ -2250,10 +2250,10 @@ rs6000_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR pc)
> /* We check for ___eabi (three leading underscores) in addition
> to __eabi in case the GCC option "-fleading-underscore" was
> used to compile the program. */
> - if (s.minsym != NULL
> - && s.minsym->linkage_name () != NULL
> - && (strcmp (s.minsym->linkage_name (), "__eabi") == 0
> - || strcmp (s.minsym->linkage_name (), "___eabi") == 0))
> + if (s.minsym != nullptr
> + && s.minsym->linkage_name () != nullptr
> + && (streq (s.minsym->linkage_name (), "__eabi")
> + || streq (s.minsym->linkage_name (), "___eabi")))
> pc += 4;
> }
> return pc;
> @@ -4098,8 +4098,7 @@ bfd_uses_spe_extensions (bfd *abfd)
> ptr += 12;
>
> /* The name must be "APUinfo\0". */
> - if (name_len != 8
> - && strcmp ((const char *) ptr, "APUinfo") != 0)
> + if (name_len != 8 && !streq ((const char *) ptr, "APUinfo"))
> break;
> ptr += name_len;
>
> @@ -8549,8 +8548,7 @@ powerpc_set_vector_abi (const char *args, int from_tty,
> for (vector_abi = POWERPC_VEC_AUTO;
> vector_abi != POWERPC_VEC_LAST;
> vector_abi++)
> - if (strcmp (powerpc_vector_abi_string,
> - powerpc_vector_strings[vector_abi]) == 0)
> + if (streq (powerpc_vector_abi_string, powerpc_vector_strings[vector_abi]))
> {
> powerpc_vector_abi_global = (enum powerpc_vector_abi) vector_abi;
> break;
> diff --git a/gdb/rust-lang.c b/gdb/rust-lang.c
> index 9f5c01afda49..522b20c97ff4 100644
> --- a/gdb/rust-lang.c
> +++ b/gdb/rust-lang.c
> @@ -138,7 +138,7 @@ rust_underscore_fields (struct type *type)
> const char *field_name = field.name ();
> if (startswith (field_name, "__"))
> field_name += 2;
> - if (strcmp (buf, field_name) != 0)
> + if (!streq (buf, field_name))
> return false;
> field_number++;
> }
> @@ -192,7 +192,7 @@ rust_range_type_p (struct type *type)
> return true;
>
> int field_num = 0;
> - if (strcmp (type->field (0).name (), "start") == 0)
> + if (streq (type->field (0).name (), "start"))
> {
> if (type->num_fields () == 1)
> return true;
> @@ -204,7 +204,7 @@ rust_range_type_p (struct type *type)
> return false;
> }
>
> - return strcmp (type->field (field_num).name (), "end") == 0;
> + return streq (type->field (field_num).name (), "end");
> }
>
> /* Return true if TYPE is an inclusive range type, otherwise false.
> @@ -254,9 +254,9 @@ rust_get_trait_object_pointer (struct value *value)
> int vtable_field = 0;
> for (int i = 0; i < 2; ++i)
> {
> - if (strcmp (type->field (i).name (), "vtable") == 0)
> + if (streq (type->field (i).name (), "vtable"))
> vtable_field = i;
> - else if (strcmp (type->field (i).name (), "pointer") != 0)
> + else if (!streq (type->field (i).name (), "pointer"))
> return NULL;
> }
>
> @@ -379,7 +379,7 @@ rust_array_like_element_type (struct type *type)
> gdb_assert (rust_slice_type_p (type));
> for (const auto &field : type->fields ())
> {
> - if (strcmp (field.name (), "data_ptr") == 0)
> + if (streq (field.name (), "data_ptr"))
> {
> struct type *base_type = field.type ()->target_type ();
> if (rewrite_slice_type (base_type, nullptr, 0, nullptr))
> @@ -527,8 +527,7 @@ rust_language::val_print_slice
>
> /* &str is handled here; but for all other slice types it is fine to
> simply print the contents. */
> - if (orig_type->name () != nullptr
> - && strcmp (orig_type->name (), "&str") == 0)
> + if (orig_type->name () != nullptr && streq (orig_type->name (), "&str"))
> {
> LONGEST low_bound, high_bound;
> if (get_array_bounds (type, &low_bound, &high_bound))
> @@ -760,8 +759,10 @@ rust_language::value_print_inner
>
> case TYPE_CODE_INT:
> /* Recognize the unit type. */
> - if (type->is_unsigned () && type->length () == 0
> - && type->name () != NULL && strcmp (type->name (), "()") == 0)
> + if (type->is_unsigned ()
> + && type->length () == 0
> + && type->name () != nullptr
> + && streq (type->name (), "()"))
> {
> gdb_puts ("()", stream);
> break;
> @@ -1323,14 +1324,13 @@ rust_compute_range (struct type *type, struct value *range,
> return;
>
> i = 0;
> - if (strcmp (type->field (0).name (), "start") == 0)
> + if (streq (type->field (0).name (), "start"))
> {
> *kind = RANGE_HIGH_BOUND_DEFAULT;
> *low = value_as_long (range->field (0));
> ++i;
> }
> - if (type->num_fields () > i
> - && strcmp (type->field (i).name (), "end") == 0)
> + if (type->num_fields () > i && streq (type->field (i).name (), "end"))
> {
> *kind = (*kind == (RANGE_LOW_BOUND_DEFAULT | RANGE_HIGH_BOUND_DEFAULT)
> ? RANGE_LOW_BOUND_DEFAULT : RANGE_STANDARD);
> @@ -1874,7 +1874,7 @@ rust_language::is_string_type_p (struct type *type) const
> || (type->code () == TYPE_CODE_STRUCT
> && !rust_enum_p (type)
> && rust_slice_type_p (type)
> - && strcmp (type->name (), "&str") == 0));
> + && streq (type->name (), "&str")));
> }
>
> /* See language.h. */
> diff --git a/gdb/rust-parse.c b/gdb/rust-parse.c
> index 9fc9a438a489..0c4f2a501abc 100644
> --- a/gdb/rust-parse.c
> +++ b/gdb/rust-parse.c
> @@ -2211,7 +2211,7 @@ rust_lex_exception_test (rust_parser *parser, const char *input,
> }
> catch (const gdb_exception_error &except)
> {
> - SELF_CHECK (strcmp (except.what (), err) == 0);
> + SELF_CHECK (streq (except.what (), err));
> }
> }
>
> diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
> index aed7ae6b9b4c..f9d7bdd04e41 100644
> --- a/gdb/s390-tdep.c
> +++ b/gdb/s390-tdep.c
> @@ -1638,7 +1638,7 @@ s390_address_class_name_to_type_flags (struct gdbarch *gdbarch,
> const char *name,
> type_instance_flags *type_flags_ptr)
> {
> - if (strcmp (name, "mode32") == 0)
> + if (streq (name, "mode32"))
> {
> *type_flags_ptr = TYPE_INSTANCE_FLAG_ADDRESS_CLASS_1;
> return true;
> diff --git a/gdb/selftest-arch.c b/gdb/selftest-arch.c
> index f52864e99fa4..f8e28f89eca9 100644
> --- a/gdb/selftest-arch.c
> +++ b/gdb/selftest-arch.c
> @@ -27,13 +27,13 @@ namespace selftests {
>
> static bool skip_arch (const char *arch)
> {
> - if (strcmp ("powerpc:EC603e", arch) == 0
> - || strcmp ("powerpc:e500mc", arch) == 0
> - || strcmp ("powerpc:e500mc64", arch) == 0
> - || strcmp ("powerpc:titan", arch) == 0
> - || strcmp ("powerpc:vle", arch) == 0
> - || strcmp ("powerpc:e5500", arch) == 0
> - || strcmp ("powerpc:e6500", arch) == 0)
> + if (streq ("powerpc:EC603e", arch)
> + || streq ("powerpc:e500mc", arch)
> + || streq ("powerpc:e500mc64", arch)
> + || streq ("powerpc:titan", arch)
> + || streq ("powerpc:vle", arch)
> + || streq ("powerpc:e5500", arch)
> + || streq ("powerpc:e6500", arch))
> {
> /* PR 19797 */
> return true;
> @@ -122,9 +122,9 @@ selftest_skip_warning_arch (struct gdbarch *gdbarch)
> Stack backtrace will not work.
> We could instead capture the output and then filter out the warning, but
> that seems more trouble than it's worth. */
> - return (strcmp (name, "m68hc11") == 0
> - || strcmp (name, "m68hc12") == 0
> - || strcmp (name, "m68hc12:HCS12") == 0);
> + return (streq (name, "m68hc11")
> + || streq (name, "m68hc12")
> + || streq (name, "m68hc12:HCS12"));
> }
>
> } /* namespace selftests */
> diff --git a/gdb/serial.c b/gdb/serial.c
> index f034c1c94ebb..5624f84e996b 100644
> --- a/gdb/serial.c
> +++ b/gdb/serial.c
> @@ -142,7 +142,7 @@ static const struct serial_ops *
> serial_interface_lookup (const char *name)
> {
> for (const serial_ops *ops : serial_ops_list)
> - if (strcmp (name, ops->name) == 0)
> + if (streq (name, ops->name))
> return ops;
>
> return NULL;
> diff --git a/gdb/sh-tdep.c b/gdb/sh-tdep.c
> index 0b6dc1111945..8ef2ae5e7da5 100644
> --- a/gdb/sh-tdep.c
> +++ b/gdb/sh-tdep.c
> @@ -392,7 +392,7 @@ sh_sw_breakpoint_from_kind (struct gdbarch *gdbarch, int kind, int *size)
> *size = kind;
>
> /* For remote stub targets, trapa #20 is used. */
> - if (strcmp (target_shortname (), "remote") == 0)
> + if (streq (target_shortname (), "remote"))
> {
> static unsigned char big_remote_breakpoint[] = { 0xc3, 0x20 };
> static unsigned char little_remote_breakpoint[] = { 0x20, 0xc3 };
> diff --git a/gdb/sol2-tdep.c b/gdb/sol2-tdep.c
> index 8545ae60da47..d45de5016660 100644
> --- a/gdb/sol2-tdep.c
> +++ b/gdb/sol2-tdep.c
> @@ -43,9 +43,10 @@
> static int
> sol2_pc_in_sigtramp (CORE_ADDR pc, const char *name)
> {
> - return (name && (strcmp (name, "sigacthandler") == 0
> - || strcmp (name, "ucbsigvechandler") == 0
> - || strcmp (name, "__sighndlr") == 0));
> + return (name != nullptr
> + && (streq (name, "sigacthandler")
> + || streq (name, "ucbsigvechandler")
> + || streq (name, "__sighndlr")));
> }
>
> /* Return whether THIS_FRAME corresponds to a Solaris sigtramp routine. */
> diff --git a/gdb/solib-aix.c b/gdb/solib-aix.c
> index b7daec8ff90b..d4367973ad59 100644
> --- a/gdb/solib-aix.c
> +++ b/gdb/solib-aix.c
> @@ -167,7 +167,7 @@ library_list_start_list (struct gdb_xml_parser *parser,
> char *version
> = (char *) xml_find_attribute (attributes, "version")->value.get ();
>
> - if (strcmp (version, "1.0") != 0)
> + if (!streq (version, "1.0"))
> gdb_xml_error (parser,
> _("Library list has unsupported version \"%s\""),
> version);
> @@ -329,7 +329,7 @@ aix_solib_ops::relocate_section_addresses (solib &so,
> const char *section_name = bfd_section_name (bfd_sect);
> auto *info = gdb::checked_static_cast<lm_info_aix *> (so.lm_info.get ());
>
> - if (strcmp (section_name, ".text") == 0)
> + if (streq (section_name, ".text"))
> {
> sec->addr = info->text_addr;
> sec->endaddr = sec->addr + info->text_size;
> @@ -338,12 +338,12 @@ aix_solib_ops::relocate_section_addresses (solib &so,
> XCOFF headers, so we need to adjust by this much. */
> sec->addr += bfd_sect->filepos;
> }
> - else if (strcmp (section_name, ".data") == 0)
> + else if (streq (section_name, ".data"))
> {
> sec->addr = info->data_addr;
> sec->endaddr = sec->addr + info->data_size;
> }
> - else if (strcmp (section_name, ".bss") == 0)
> + else if (streq (section_name, ".bss"))
> {
> /* The information provided by the loader does not include
> the address of the .bss section, but we know that it gets
> @@ -615,7 +615,7 @@ static struct obj_section *
> data_obj_section_from_objfile (struct objfile *objfile)
> {
> for (obj_section &osect : objfile->sections ())
> - if (strcmp (bfd_section_name (osect.the_bfd_section), ".data") == 0)
> + if (streq (bfd_section_name (osect.the_bfd_section), ".data"))
> return &osect;
>
> return NULL;
> diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c
> index aaa34ec0764e..3412f6629102 100644
> --- a/gdb/solib-darwin.c
> +++ b/gdb/solib-darwin.c
> @@ -174,7 +174,7 @@ lookup_symbol_from_bfd (bfd *abfd, const char *symname)
>
> for (const asymbol *sym : symbol_table)
> {
> - if (strcmp (sym->name, symname) == 0
> + if (streq (sym->name, symname)
> && (sym->section->flags & (SEC_CODE | SEC_DATA)) != 0)
> {
> /* BFD symbols are section relative. */
> diff --git a/gdb/solib-dsbt.c b/gdb/solib-dsbt.c
> index 3ad6f5ab2f3e..052b170fd9a6 100644
> --- a/gdb/solib-dsbt.c
> +++ b/gdb/solib-dsbt.c
> @@ -756,7 +756,7 @@ enable_break (void)
> (tmp_bfd.get (),
> [] (const asymbol *sym)
> {
> - return strcmp (sym->name, "_dl_debug_state") == 0;
> + return streq (sym->name, "_dl_debug_state");
> }));
>
> if (addr != 0)
> diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
> index 997cc175e586..4f0aac31e733 100644
> --- a/gdb/solib-frv.c
> +++ b/gdb/solib-frv.c
> @@ -595,7 +595,7 @@ enable_break2 (void)
> (tmp_bfd.get (),
> [] (const asymbol *sym)
> {
> - return strcmp (sym->name, "_dl_debug_addr") == 0;
> + return streq (sym->name, "_dl_debug_addr");
> }));
>
> if (addr == 0)
> @@ -1015,7 +1015,7 @@ find_canonical_descriptor_in_load_object
> address according to the link map and then dereferencing
> this address (which is a GOT entry) to obtain a descriptor
> address. */
> - if ((name == 0 || strcmp (name, (*rel->sym_ptr_ptr)->name) == 0)
> + if ((name == 0 || streq (name, (*rel->sym_ptr_ptr)->name))
> && rel->howto->type == R_FRV_FUNCDESC)
> {
> gdb_byte buf [FRV_PTR_SIZE];
> diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
> index aeb6cd30f423..8e3de4d3ea1a 100644
> --- a/gdb/solib-svr4.c
> +++ b/gdb/solib-svr4.c
> @@ -124,7 +124,7 @@ get_lm_info_svr4 (const solib &solib)
> static bool
> svr4_same_name (const char *gdb_so_name, const char *inferior_so_name)
> {
> - if (strcmp (gdb_so_name, inferior_so_name) == 0)
> + if (streq (gdb_so_name, inferior_so_name))
> return 1;
>
> /* On Solaris, when starting inferior we think that dynamic linker is
> @@ -133,18 +133,18 @@ svr4_same_name (const char *gdb_so_name, const char *inferior_so_name)
> sometimes they have identical content, but are not linked to each
> other. We don't restrict this check for Solaris, but the chances
> of running into this situation elsewhere are very low. */
> - if (strcmp (gdb_so_name, "/usr/lib/ld.so.1") == 0
> - && strcmp (inferior_so_name, "/lib/ld.so.1") == 0)
> + if (streq (gdb_so_name, "/usr/lib/ld.so.1")
> + && streq (inferior_so_name, "/lib/ld.so.1"))
> return 1;
>
> /* Similarly, we observed the same issue with amd64 and sparcv9, but with
> different locations. */
> - if (strcmp (gdb_so_name, "/usr/lib/amd64/ld.so.1") == 0
> - && strcmp (inferior_so_name, "/lib/amd64/ld.so.1") == 0)
> + if (streq (gdb_so_name, "/usr/lib/amd64/ld.so.1")
> + && streq (inferior_so_name, "/lib/amd64/ld.so.1"))
> return 1;
>
> - if (strcmp (gdb_so_name, "/usr/lib/sparcv9/ld.so.1") == 0
> - && strcmp (inferior_so_name, "/lib/sparcv9/ld.so.1") == 0)
> + if (streq (gdb_so_name, "/usr/lib/sparcv9/ld.so.1")
> + && streq (inferior_so_name, "/lib/sparcv9/ld.so.1"))
> return 1;
>
> return 0;
> @@ -1136,7 +1136,7 @@ svr4_library_list_start_list (struct gdb_xml_parser *parser,
> = (const char *) xml_find_attribute (attributes, "version")->value.get ();
> struct gdb_xml_value *main_lm = xml_find_attribute (attributes, "main-lm");
>
> - if (strcmp (version, "1.0") != 0)
> + if (!streq (version, "1.0"))
> gdb_xml_error (parser,
> _("SVR4 Library list has unsupported version \"%s\""),
> version);
> @@ -1607,8 +1607,7 @@ svr4_fetch_objfile_link_map (struct objfile *objfile)
> static bool
> is_thread_local_section (struct bfd_section *bfd_sect)
> {
> - return ((strcmp (bfd_sect->name, ".tdata") == 0
> - || strcmp (bfd_sect->name, ".tbss") == 0)
> + return ((streq (bfd_sect->name, ".tdata") || streq (bfd_sect->name, ".tbss"))
> && bfd_sect->size != 0);
> }
>
> @@ -1815,7 +1814,7 @@ match_main (const char *soname)
>
> for (mainp = main_name_list; *mainp != NULL; mainp++)
> {
> - if (strcmp (soname, *mainp) == 0)
> + if (streq (soname, *mainp))
> return (1);
> }
>
> @@ -2727,7 +2726,7 @@ svr4_solib_ops::enable_break (svr4_info *info, int from_tty) const
> (tmp_bfd.get (),
> [=] (const asymbol *sym)
> {
> - return (strcmp (sym->name, *bkpt_namep) == 0
> + return (streq (sym->name, *bkpt_namep)
> && ((sym->section->flags & (SEC_CODE | SEC_DATA))
> != 0));
> }));
> diff --git a/gdb/solib-target.c b/gdb/solib-target.c
> index 981e86b7d90d..ac965df20e94 100644
> --- a/gdb/solib-target.c
> +++ b/gdb/solib-target.c
> @@ -161,7 +161,7 @@ library_list_start_list (struct gdb_xml_parser *parser,
> {
> const char *string = (const char *) version->value.get ();
>
> - if (strcmp (string, "1.0") != 0)
> + if (!streq (string, "1.0"))
> gdb_xml_error (parser,
> _("Library list has unsupported version \"%s\""),
> string);
> diff --git a/gdb/solib.c b/gdb/solib.c
> index 0750d48f7476..22937c0fc067 100644
> --- a/gdb/solib.c
> +++ b/gdb/solib.c
> @@ -197,7 +197,7 @@ solib_find_1 (const char *in_pathname, int *fd, bool is_solib)
> There's no need to check for drive spec explicitly, as we only
> get here if IN_PATHNAME is considered an absolute path. */
> need_dir_separator = !(IS_DIR_SEPARATOR (in_pathname[0])
> - || strcmp (TARGET_SYSROOT_PREFIX, sysroot) == 0);
> + || streq (TARGET_SYSROOT_PREFIX, sysroot));
>
> /* Cat the prefixed pathname together. */
> temp_pathname.reset (concat (sysroot,
> @@ -551,7 +551,7 @@ solib_map_sections (solib &so)
> range of the shared object, assume we want the location of
> the .text section. */
> if (so.addr_low == 0 && so.addr_high == 0
> - && strcmp (p.the_bfd_section->name, ".text") == 0)
> + && streq (p.the_bfd_section->name, ".text"))
> {
> so.addr_low = p.addr;
> so.addr_high = p.endaddr;
> diff --git a/gdb/source.c b/gdb/source.c
> index 0f74a0ebd0dd..a4bced1296fc 100644
> --- a/gdb/source.c
> +++ b/gdb/source.c
> @@ -341,8 +341,8 @@ select_source_symtab ()
> const char *name = symtab->filename ();
> int len = strlen (name);
>
> - if (!(len > 2 && (strcmp (&name[len - 2], ".h") == 0
> - || strcmp (name, "<<C++-namespaces>>") == 0)))
> + if (!(len > 2 && (streq (&name[len - 2], ".h")
> + || streq (name, "<<C++-namespaces>>"))))
> new_symtab = symtab;
> }
> }
> @@ -836,7 +836,7 @@ openp (const char *path, openp_flags opts, const char *string,
> char *dir = dir_up.get ();
> int reg_file_errno;
>
> - if (strcmp (dir, "$cwd") == 0)
> + if (streq (dir, "$cwd"))
> {
> /* Name is $cwd -- insert current directory name instead. */
> filename = cwd;
> @@ -855,7 +855,7 @@ openp (const char *path, openp_flags opts, const char *string,
> contexts. If the user really has '$cdir' one can use './$cdir'.
> We can get $cdir when loading scripts. When loading source files
> $cdir must have already been expanded to the correct value. */
> - if (strcmp (dir, "$cdir") == 0)
> + if (streq (dir, "$cdir"))
> continue;
>
> /* Normal file name in path -- just use it. */
> diff --git a/gdb/sparc64-fbsd-tdep.c b/gdb/sparc64-fbsd-tdep.c
> index 5c526df65be6..9d9c18a71831 100644
> --- a/gdb/sparc64-fbsd-tdep.c
> +++ b/gdb/sparc64-fbsd-tdep.c
> @@ -84,7 +84,7 @@ sparc64fbsd_collect_fpregset (const struct regset *regset,
> static int
> sparc64fbsd_pc_in_sigtramp (CORE_ADDR pc, const char *name)
> {
> - return (name && strcmp (name, "__sigtramp") == 0);
> + return (name && streq (name, "__sigtramp"));
> }
>
> static struct sparc_frame_cache *
> diff --git a/gdb/sparc64-obsd-tdep.c b/gdb/sparc64-obsd-tdep.c
> index 0a4763d117ad..b39b519725e9 100644
> --- a/gdb/sparc64-obsd-tdep.c
> +++ b/gdb/sparc64-obsd-tdep.c
> @@ -298,7 +298,7 @@ sparc64obsd_trapframe_sniffer (const struct frame_unwind *self,
>
> pc = get_frame_address_in_block (this_frame);
> find_pc_partial_function (pc, &name, NULL, NULL);
> - if (name && strcmp (name, "Lslowtrap_reenter") == 0)
> + if (name && streq (name, "Lslowtrap_reenter"))
> return 1;
>
> return 0;
> diff --git a/gdb/stack.c b/gdb/stack.c
> index f1e3e8975f4f..3ab0090ea8a0 100644
> --- a/gdb/stack.c
> +++ b/gdb/stack.c
> @@ -635,8 +635,9 @@ read_frame_arg (const frame_print_options &fp_opts,
> /* Try to remove possibly duplicate error message for ENTRYARGP even
> in MI mode. */
>
> - if (val_error && entryval_error
> - && strcmp (val_error, entryval_error) == 0)
> + if (val_error != nullptr
> + && entryval_error != nullptr
> + && streq (val_error, entryval_error))
> {
> entryval_error = NULL;
>
> diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c
> index 2607371c39ff..d28cee8168c3 100644
> --- a/gdb/stap-probe.c
> +++ b/gdb/stap-probe.c
> @@ -1635,7 +1635,8 @@ get_stap_base_address (bfd *obfd, bfd_vma *base)
>
> for (asection *sect : gdb_bfd_sections (obfd))
> if ((sect->flags & (SEC_DATA | SEC_ALLOC | SEC_HAS_CONTENTS))
> - && sect->name && !strcmp (sect->name, STAP_BASE_SECTION_NAME))
> + && sect->name != nullptr
> + && streq (sect->name, STAP_BASE_SECTION_NAME))
> ret = sect;
>
> if (ret == NULL)
> diff --git a/gdb/symfile.c b/gdb/symfile.c
> index 44a9480d9d90..0d77d97b3afe 100644
> --- a/gdb/symfile.c
> +++ b/gdb/symfile.c
> @@ -409,9 +409,9 @@ relative_addr_info_to_section_offsets (std::vector<CORE_ADDR> §ion_offsets,
> static const char *
> addr_section_name (const char *s)
> {
> - if (strcmp (s, ".dynbss") == 0)
> + if (streq (s, ".dynbss"))
> return ".bss";
> - if (strcmp (s, ".sdynbss") == 0)
> + if (streq (s, ".sdynbss"))
> return ".sbss";
>
> return s;
> @@ -511,8 +511,8 @@ addr_info_make_relative (section_addr_info *addrs, bfd *abfd)
> abfd_sorted_iter++;
>
> if (abfd_sorted_iter != abfd_addrs_sorted.end ()
> - && strcmp (addr_section_name ((*abfd_sorted_iter)->name.c_str ()),
> - sect_name) == 0)
> + && streq (addr_section_name ((*abfd_sorted_iter)->name.c_str ()),
> + sect_name))
> {
> int index_in_addrs;
>
> @@ -1574,11 +1574,11 @@ symbol_file_command (const char *args, int from_tty)
> else
> error (_("Unrecognized argument \"%s\""), arg);
> }
> - else if (strcmp (arg, "-readnow") == 0)
> + else if (streq (arg, "-readnow"))
> flags |= OBJF_READNOW;
> - else if (strcmp (arg, "-readnever") == 0)
> + else if (streq (arg, "-readnever"))
> flags |= OBJF_READNEVER;
> - else if (strcmp (arg, "-o") == 0)
> + else if (streq (arg, "-o"))
> {
> arg = built_argv[++idx];
> if (arg == NULL)
> @@ -1586,7 +1586,7 @@ symbol_file_command (const char *args, int from_tty)
>
> offset = parse_and_eval_address (arg);
> }
> - else if (strcmp (arg, "--") == 0)
> + else if (streq (arg, "--"))
> stop_processing_options = true;
> else
> error (_("Unrecognized argument \"%s\""), arg);
> @@ -2214,11 +2214,11 @@ add_symbol_file_command (const char *args, int from_tty)
> else
> error (_("Unrecognized argument \"%s\""), arg);
> }
> - else if (strcmp (arg, "-readnow") == 0)
> + else if (streq (arg, "-readnow"))
> flags |= OBJF_READNOW;
> - else if (strcmp (arg, "-readnever") == 0)
> + else if (streq (arg, "-readnever"))
> flags |= OBJF_READNEVER;
> - else if (strcmp (arg, "-s") == 0)
> + else if (streq (arg, "-s"))
> {
> if (argv[argcnt + 1] == NULL)
> error (_("Missing section name after \"-s\""));
> @@ -2230,7 +2230,7 @@ add_symbol_file_command (const char *args, int from_tty)
> sect_opts.push_back (sect);
> argcnt += 2;
> }
> - else if (strcmp (arg, "-o") == 0)
> + else if (streq (arg, "-o"))
> {
> arg = argv[++argcnt];
> if (arg == NULL)
> @@ -2239,7 +2239,7 @@ add_symbol_file_command (const char *args, int from_tty)
> offset = parse_and_eval_address (arg);
> seen_offset = true;
> }
> - else if (strcmp (arg, "--") == 0)
> + else if (streq (arg, "--"))
> stop_processing_options = true;
> else
> error (_("Unrecognized argument \"%s\""), arg);
> @@ -3217,7 +3217,7 @@ map_overlay_command (const char *args, int from_tty)
> /* First, find a section matching the user supplied argument. */
> for (objfile &obj_file : current_program_space->objfiles ())
> for (obj_section &sec : obj_file.sections ())
> - if (!strcmp (bfd_section_name (sec.the_bfd_section), args))
> + if (streq (bfd_section_name (sec.the_bfd_section), args))
> {
> /* Now, check to see if the section is an overlay. */
> if (!section_is_overlay (&sec))
> @@ -3261,7 +3261,7 @@ unmap_overlay_command (const char *args, int from_tty)
> /* First, find a section matching the user supplied argument. */
> for (objfile &objfile : current_program_space->objfiles ())
> for (obj_section &sec : objfile.sections ())
> - if (!strcmp (bfd_section_name (sec.the_bfd_section), args))
> + if (streq (bfd_section_name (sec.the_bfd_section), args))
> {
> if (!sec.ovly_mapped)
> error (_("Section %s is not mapped"), args);
> diff --git a/gdb/symmisc.c b/gdb/symmisc.c
> index 258489fe8f07..a6dbb3b0603c 100644
> --- a/gdb/symmisc.c
> +++ b/gdb/symmisc.c
> @@ -403,25 +403,25 @@ maintenance_print_symbols (const char *args, int from_tty)
>
> for (i = 0; argv != NULL && argv[i] != NULL; ++i)
> {
> - if (strcmp (argv[i], "-pc") == 0)
> + if (streq (argv[i], "-pc"))
> {
> if (argv[i + 1] == NULL)
> error (_("Missing pc value"));
> address_arg = argv[++i];
> }
> - else if (strcmp (argv[i], "-source") == 0)
> + else if (streq (argv[i], "-source"))
> {
> if (argv[i + 1] == NULL)
> error (_("Missing source file"));
> source_arg = argv[++i];
> }
> - else if (strcmp (argv[i], "-objfile") == 0)
> + else if (streq (argv[i], "-objfile"))
> {
> if (argv[i + 1] == NULL)
> error (_("Missing objfile name"));
> objfile_arg = argv[++i];
> }
> - else if (strcmp (argv[i], "--") == 0)
> + else if (streq (argv[i], "--"))
> {
> /* End of options. */
> ++i;
> @@ -683,13 +683,13 @@ maintenance_print_msymbols (const char *args, int from_tty)
>
> for (i = 0; argv != NULL && argv[i] != NULL; ++i)
> {
> - if (strcmp (argv[i], "-objfile") == 0)
> + if (streq (argv[i], "-objfile"))
> {
> if (argv[i + 1] == NULL)
> error (_("Missing objfile name"));
> objfile_arg = argv[++i];
> }
> - else if (strcmp (argv[i], "--") == 0)
> + else if (streq (argv[i], "--"))
> {
> /* End of options. */
> ++i;
> diff --git a/gdb/symtab.c b/gdb/symtab.c
> index 51a049836b04..812f9bcc5404 100644
> --- a/gdb/symtab.c
> +++ b/gdb/symtab.c
> @@ -378,7 +378,7 @@ search_symbol_list (const char *name, int num, struct symbol **syms)
> {
> for (int i = 0; i < num; ++i)
> {
> - if (strcmp (name, syms[i]->natural_name ()) == 0)
> + if (streq (name, syms[i]->natural_name ()))
> return syms[i];
> }
> return nullptr;
> @@ -738,8 +738,8 @@ 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
> - || (newname && strcmp (field_name, newname) == 0);
> + is_constructor = (is_full_physname_constructor
> + || (newname != nullptr && streq (field_name, newname)));
>
> if (!is_destructor)
> is_destructor = (startswith (physname, "__dt"));
> @@ -1189,9 +1189,9 @@ matching_obj_sections (struct obj_section *obj_first,
> != bfd_section_vma (second) - bfd_get_start_address (second->owner))
> return false;
>
> - if (bfd_section_name (first) == NULL
> - || bfd_section_name (second) == NULL
> - || strcmp (bfd_section_name (first), bfd_section_name (second)) != 0)
> + if (bfd_section_name (first) == nullptr
> + || bfd_section_name (second) == nullptr
> + || !streq (bfd_section_name (first), bfd_section_name (second)))
> return false;
>
> /* Otherwise check that they are in corresponding objfiles. */
> @@ -1276,7 +1276,7 @@ eq_symbol_entry (const struct symbol_cache_slot *slot,
>
> if (slot->state == SYMBOL_SLOT_NOT_FOUND)
> {
> - if (strcmp (slot_name, name) != 0)
> + if (!streq (slot_name, name))
> return 0;
> }
> else
> diff --git a/gdb/target.c b/gdb/target.c
> index 77a562aa919d..34d18952dc16 100644
> --- a/gdb/target.c
> +++ b/gdb/target.c
> @@ -1542,7 +1542,7 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object,
>
> auto match_cb = [=] (const struct target_section *s)
> {
> - return (strcmp (section_name, s->the_bfd_section->name) == 0);
> + return streq (section_name, s->the_bfd_section->name);
> };
>
> return section_table_xfer_memory_partial (readbuf, writebuf,
> diff --git a/gdb/top.c b/gdb/top.c
> index 76dc2d27fc5b..510e65c1d094 100644
> --- a/gdb/top.c
> +++ b/gdb/top.c
> @@ -1190,7 +1190,7 @@ gdb_add_history (const char *command)
> if (temp == NULL)
> break;
>
> - if (strcmp (temp->line, command) == 0)
> + if (streq (temp->line, command))
> {
> HIST_ENTRY *prev = remove_history (where_history ());
> command_count--;
> @@ -1413,7 +1413,7 @@ There is NO WARRANTY, to the extent permitted by law.",
> /* After the required info we print the configuration information. */
>
> gdb_printf (stream, "This GDB was configured as \"");
> - if (strcmp (host_name, target_name) != 0)
> + if (!streq (host_name, target_name))
> {
> gdb_printf (stream, "--host=%s --target=%s",
> host_name, target_name);
> diff --git a/gdb/tracectf.c b/gdb/tracectf.c
> index 3c6bf6cb5a98..aff2da55d66a 100644
> --- a/gdb/tracectf.c
> +++ b/gdb/tracectf.c
> @@ -913,7 +913,7 @@ ctf_open_dir (const char *dirname)
>
> bt_ctf_get_event_decl_list (handle_id, ctx, &list, &count);
> for (i = 0; i < count; i++)
> - if (strcmp ("register", bt_ctf_get_decl_event_name (list[i])) == 0)
> + if (streq ("register", bt_ctf_get_decl_event_name (list[i])))
> {
> const struct bt_ctf_field_decl * const *field_list;
> const struct bt_declaration *decl;
> @@ -922,8 +922,8 @@ ctf_open_dir (const char *dirname)
> &count);
>
> gdb_assert (count == 1);
> - gdb_assert (0 == strcmp ("contents",
> - bt_ctf_get_decl_field_name (field_list[0])));
> + gdb_assert (streq ("contents",
> + bt_ctf_get_decl_field_name (field_list[0])));
> decl = bt_ctf_get_decl_from_field_decl (field_list[0]);
> trace_regblock_size = bt_ctf_get_array_len (decl);
>
> @@ -1231,9 +1231,9 @@ ctf_target::fetch_registers (struct regcache *regcache, int regno)
>
> name = bt_ctf_event_name (event1);
>
> - if (name == NULL || strcmp (name, "frame") == 0)
> + if (name == NULL || streq (name, "frame"))
> break;
> - else if (strcmp (name, "register") == 0)
> + else if (streq (name, "register"))
> {
> event = event1;
> break;
> @@ -1329,9 +1329,9 @@ ctf_target::xfer_partial (enum target_object object,
> = bt_ctf_iter_read_event (ctf_iter);
> const char *name = bt_ctf_event_name (event);
>
> - if (name == NULL || strcmp (name, "frame") == 0)
> + if (name == NULL || streq (name, "frame"))
> break;
> - else if (strcmp (name, "memory") != 0)
> + else if (!streq (name, "memory"))
> {
> if (bt_iter_next (bt_ctf_get_iter (ctf_iter)) < 0)
> break;
> @@ -1445,9 +1445,9 @@ ctf_target::get_trace_state_variable_value (int tsvnum, LONGEST *val)
> = bt_ctf_iter_read_event (ctf_iter);
> const char *name = bt_ctf_event_name (event);
>
> - if (name == NULL || strcmp (name, "frame") == 0)
> + if (name == NULL || streq (name, "frame"))
> break;
> - else if (strcmp (name, "tsv") == 0)
> + else if (streq (name, "tsv"))
> {
> const struct bt_definition *scope;
> const struct bt_definition *def;
> @@ -1513,7 +1513,7 @@ ctf_get_traceframe_address (void)
>
> if (name == NULL)
> break;
> - else if (strcmp (name, "frame") == 0)
> + else if (streq (name, "frame"))
> {
> event = event1;
> break;
> @@ -1573,7 +1573,7 @@ ctf_target::trace_find (enum trace_find_type type, int num,
> if (event == NULL || name == NULL)
> break;
>
> - if (strcmp (name, "frame") == 0)
> + if (streq (name, "frame"))
> {
> CORE_ADDR tfaddr;
>
> @@ -1664,10 +1664,9 @@ ctf_target::traceframe_info ()
>
> name = bt_ctf_event_name (event);
>
> - if (name == NULL || strcmp (name, "register") == 0
> - || strcmp (name, "frame") == 0)
> + if (name == nullptr || streq (name, "register") || streq (name, "frame"))
> ;
> - else if (strcmp (name, "memory") == 0)
> + else if (streq (name, "memory"))
> {
> const struct bt_definition *scope
> = bt_ctf_get_top_level_scope (event,
> @@ -1682,7 +1681,7 @@ ctf_target::traceframe_info ()
>
> info->memory.emplace_back (start, length);
> }
> - else if (strcmp (name, "tsv") == 0)
> + else if (streq (name, "tsv"))
> {
> int vnum;
> const struct bt_definition *scope
> @@ -1704,7 +1703,7 @@ ctf_target::traceframe_info ()
> if (bt_iter_next (bt_ctf_get_iter (ctf_iter)) < 0)
> break;
> }
> - while (name != NULL && strcmp (name, "frame") != 0);
> + while (name != NULL && !streq (name, "frame"));
>
> /* Restore the position. */
> bt_iter_set_pos (bt_ctf_get_iter (ctf_iter), pos);
> diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c
> index 6fa1909fcec0..a6f5ae16b916 100644
> --- a/gdb/tracefile-tfile.c
> +++ b/gdb/tracefile-tfile.c
> @@ -896,7 +896,7 @@ tfile_xfer_partial_features (const char *annex,
> ULONGEST offset, ULONGEST len,
> ULONGEST *xfered_len)
> {
> - if (strcmp (annex, "target.xml"))
> + if (!streq (annex, "target.xml"))
> return TARGET_XFER_E_IO;
>
> if (readbuf == NULL)
> diff --git a/gdb/tracefile.c b/gdb/tracefile.c
> index 28080e26218c..6dc699f3efe8 100644
> --- a/gdb/tracefile.c
> +++ b/gdb/tracefile.c
> @@ -333,9 +333,9 @@ tsave_command (const char *args, int from_tty)
>
> for (; *argv; ++argv)
> {
> - if (strcmp (*argv, "-r") == 0)
> + if (streq (*argv, "-r"))
> target_does_save = 1;
> - else if (strcmp (*argv, "-ctf") == 0)
> + else if (streq (*argv, "-ctf"))
> generate_ctf = 1;
> else if (**argv == '-')
> error (_("unknown option `%s'"), *argv);
> diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
> index 2b6fbcbf5ae9..7f078684b142 100644
> --- a/gdb/tracepoint.c
> +++ b/gdb/tracepoint.c
> @@ -2231,7 +2231,7 @@ tfind_command_1 (const char *args, int from_tty)
> else
> frameno = traceframe_number + 1;
> }
> - else if (0 == strcmp (args, "-"))
> + else if (streq (args, "-"))
> {
> if (traceframe_number == -1)
> error (_("not debugging trace buffer"));
> @@ -2241,7 +2241,7 @@ tfind_command_1 (const char *args, int from_tty)
> frameno = traceframe_number - 1;
> }
> /* A hack to work around eval's need for fp to have been collected. */
> - else if (0 == strcmp (args, "-1"))
> + else if (streq (args, "-1"))
> frameno = -1;
> else
> frameno = parse_and_eval_long (args);
> @@ -3006,7 +3006,7 @@ cond_string_is_same (char *str1, char *str2)
> if (str1 == NULL || str2 == NULL)
> return (str1 == str2);
>
> - return (strcmp (str1, str2) == 0);
> + return (streq (str1, str2));
> }
>
> /* Look for an existing tracepoint that seems similar enough to the
> diff --git a/gdb/tui/tui-layout.c b/gdb/tui/tui-layout.c
> index 272f5134d853..40db5f160ca8 100644
> --- a/gdb/tui/tui-layout.c
> +++ b/gdb/tui/tui-layout.c
> @@ -253,7 +253,7 @@ tui_remove_some_windows ()
> {
> tui_win_info *focus = tui_win_with_focus ();
>
> - if (strcmp (focus->name (), CMD_NAME) == 0)
> + if (streq (focus->name (), CMD_NAME))
> {
> /* Try leaving the source or disassembly window. If neither
> exists, just do nothing. */
> @@ -506,7 +506,7 @@ tui_layout_window::specification (ui_file *output, int depth)
> std::string
> tui_layout_window::layout_fingerprint () const
> {
> - if (strcmp (get_name (), "cmd") == 0)
> + if (streq (get_name (), "cmd"))
> return "C";
> else
> return "";
> @@ -824,7 +824,7 @@ tui_layout_split::apply (int x_, int y_, int width_, int height_,
> if (preserve_cmd_win_size_p
> && cmd_win_already_exists
> && m_splits[i].layout->get_name () != nullptr
> - && strcmp (m_splits[i].layout->get_name (), "cmd") == 0)
> + && streq (m_splits[i].layout->get_name (), "cmd"))
> {
> /* Save the old cmd window information, in case we need to
> restore it later. */
> @@ -1042,9 +1042,9 @@ tui_layout_split::remove_windows (const char *name)
> const char *this_name = m_splits[i].layout->get_name ();
> if (this_name == nullptr)
> m_splits[i].layout->remove_windows (name);
> - else if (strcmp (this_name, name) == 0
> - || strcmp (this_name, CMD_NAME) == 0
> - || strcmp (this_name, STATUS_NAME) == 0)
> + else if (streq (this_name, name)
> + || streq (this_name, CMD_NAME)
> + || streq (this_name, STATUS_NAME))
> {
> /* Keep. */
> }
> diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
> index 6d57d8fb62d2..c5cca2fdd003 100644
> --- a/gdb/tui/tui-win.c
> +++ b/gdb/tui/tui-win.c
> @@ -220,7 +220,7 @@ translate (const char *name, struct tui_translate *table)
> {
> while (table->name)
> {
> - if (name && strcmp (table->name, name) == 0)
> + if (name && streq (table->name, name))
> return table->value;
> table++;
> }
> @@ -235,7 +235,7 @@ translate_acs (const char *name, struct tui_translate *table, int acs_char)
> {
> /* The ACS characters are determined at run time by curses terminal
> management. */
> - if (strcmp (name, "acs") == 0)
> + if (streq (name, "acs"))
> return acs_char;
>
> return translate (name, table);
> diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c
> index fb94823f0fe8..181d5ef4fd66 100644
> --- a/gdb/tui/tui.c
> +++ b/gdb/tui/tui.c
> @@ -428,7 +428,7 @@ tui_enable (void)
> /* If the top level interpreter is not the console/tui (e.g.,
> MI), enabling curses will certainly lose. */
> interp = top_level_interpreter ()->name ();
> - if (strcmp (interp, INTERP_TUI) != 0)
> + if (!streq (interp, INTERP_TUI))
> error (_("Cannot enable the TUI when the interpreter is '%s'"), interp);
>
> /* Don't try to setup curses (and print funny control
> diff --git a/gdb/ui-style.c b/gdb/ui-style.c
> index a191c753b088..ab2b0ad5de4e 100644
> --- a/gdb/ui-style.c
> +++ b/gdb/ui-style.c
> @@ -602,8 +602,8 @@ colorsupport ()
> const char *colorterm = getenv ("COLORTERM");
> if (colors >= 16777216
> || (colorterm != nullptr
> - && (!strcmp (colorterm, "truecolor")
> - || !strcmp (colorterm, "24bit"))))
> + && (streq (colorterm, "truecolor")
> + || streq (colorterm, "24bit"))))
> result.push_back (color_space::RGB_24BIT);
>
> return result;
> diff --git a/gdb/unittests/child-path-selftests.c b/gdb/unittests/child-path-selftests.c
> index 6f4d9990a9b8..3861e2dfde8f 100644
> --- a/gdb/unittests/child-path-selftests.c
> +++ b/gdb/unittests/child-path-selftests.c
> @@ -31,7 +31,7 @@ child_path_check (const char *parent, const char *child, const char *expected)
> const char *result = ::child_path (parent, child);
> if (result == NULL || expected == NULL)
> return result == expected;
> - return strcmp (result, expected) == 0;
> + return streq (result, expected);
> }
>
> /* Test child_path. */
> diff --git a/gdb/unittests/cli-utils-selftests.c b/gdb/unittests/cli-utils-selftests.c
> index f2d0bfe4da34..2e4cfc4dec3e 100644
> --- a/gdb/unittests/cli-utils-selftests.c
> +++ b/gdb/unittests/cli-utils-selftests.c
> @@ -33,7 +33,7 @@ test_number_or_range_parser ()
> SELF_CHECK (!one.finished ());
> SELF_CHECK (one.get_number () == 1);
> SELF_CHECK (one.finished ());
> - SELF_CHECK (strcmp (one.cur_tok (), "") == 0);
> + SELF_CHECK (streq (one.cur_tok (), ""));
> }
>
> /* Test parsing an integer followed by a non integer. */
> @@ -43,7 +43,7 @@ test_number_or_range_parser ()
> SELF_CHECK (!one_after.finished ());
> SELF_CHECK (one_after.get_number () == 1);
> SELF_CHECK (one_after.finished ());
> - SELF_CHECK (strcmp (one_after.cur_tok (), "after") == 0);
> + SELF_CHECK (streq (one_after.cur_tok (), "after"));
> }
>
> /* Test parsing a range. */
> @@ -56,7 +56,7 @@ test_number_or_range_parser ()
> SELF_CHECK (one_three.get_number () == i);
> }
> SELF_CHECK (one_three.finished ());
> - SELF_CHECK (strcmp (one_three.cur_tok (), "") == 0);
> + SELF_CHECK (streq (one_three.cur_tok (), ""));
> }
>
> /* Test parsing a range followed by a non-integer. */
> @@ -69,7 +69,7 @@ test_number_or_range_parser ()
> SELF_CHECK (one_three_after.get_number () == i);
> }
> SELF_CHECK (one_three_after.finished ());
> - SELF_CHECK (strcmp (one_three_after.cur_tok (), "after") == 0);
> + SELF_CHECK (streq (one_three_after.cur_tok (), "after"));
> }
>
> /* Test a negative integer gives an error. */
> @@ -86,8 +86,8 @@ test_number_or_range_parser ()
> {
> SELF_CHECK (ex.reason == RETURN_ERROR);
> SELF_CHECK (ex.error == GENERIC_ERROR);
> - SELF_CHECK (strcmp (ex.what (), "negative value") == 0);
> - SELF_CHECK (strcmp (minus_one.cur_tok (), "-1") == 0);
> + SELF_CHECK (streq (ex.what (), "negative value"));
> + SELF_CHECK (streq (minus_one.cur_tok (), "-1"));
> }
> }
>
> @@ -96,7 +96,7 @@ test_number_or_range_parser ()
> number_or_range_parser nan ("-whatever");
>
> SELF_CHECK (nan.finished ());
> - SELF_CHECK (strcmp (nan.cur_tok (), "-whatever") == 0);
> + SELF_CHECK (streq (nan.cur_tok (), "-whatever"));
> }
> }
>
> diff --git a/gdb/unittests/copy_bitwise-selftests.c b/gdb/unittests/copy_bitwise-selftests.c
> index 2a8ded1a2243..e818db09226b 100644
> --- a/gdb/unittests/copy_bitwise-selftests.c
> +++ b/gdb/unittests/copy_bitwise-selftests.c
> @@ -82,7 +82,7 @@ check_copy_bitwise (const gdb_byte *dest, unsigned int dest_offset,
>
> /* Compare the resulting strings. */
> expected[len] = actual[len] = '\0';
> - if (strcmp (expected, actual) != 0)
> + if (!streq (expected, actual))
> error (_("copy_bitwise %s != %s (%u+%u -> %u)"),
> expected, actual, source_offset, nbits, dest_offset);
> }
> diff --git a/gdb/unittests/environ-selftests.c b/gdb/unittests/environ-selftests.c
> index 0bfbb8140eb0..b643876b1440 100644
> --- a/gdb/unittests/environ-selftests.c
> +++ b/gdb/unittests/environ-selftests.c
> @@ -63,7 +63,7 @@ test_init_from_host_environ ()
>
> /* Our test environment variable should be present at the
> vector. */
> - SELF_CHECK (strcmp (env.get (gdb_selftest_env_var), "1") == 0);
> + SELF_CHECK (streq (env.get (gdb_selftest_env_var), "1"));
> }
>
> /* Test reinitialization using the host's environ. */
> @@ -80,7 +80,7 @@ test_reinit_from_host_environ ()
> int num_found = 0;
>
> for (size_t i = 0; envp[i] != NULL; ++i)
> - if (strcmp (envp[i], "GDB_SELFTEST_ENVIRON=1") == 0)
> + if (streq (envp[i], "GDB_SELFTEST_ENVIRON=1"))
> ++num_found;
> SELF_CHECK (num_found == 1);
> }
> @@ -95,18 +95,18 @@ test_set_A_unset_B_unset_A_cannot_find_A_can_find_B ()
> gdb_environ env;
>
> env.set ("GDB_SELFTEST_ENVIRON_1", "aaa");
> - SELF_CHECK (strcmp (env.get ("GDB_SELFTEST_ENVIRON_1"), "aaa") == 0);
> + SELF_CHECK (streq (env.get ("GDB_SELFTEST_ENVIRON_1"), "aaa"));
> /* User-set environ var list must contain one element. */
> SELF_CHECK (env.user_set_env ().size () == 1);
> SELF_CHECK (set_contains (env.user_set_env (),
> std::string ("GDB_SELFTEST_ENVIRON_1=aaa")));
>
> env.set ("GDB_SELFTEST_ENVIRON_2", "bbb");
> - SELF_CHECK (strcmp (env.get ("GDB_SELFTEST_ENVIRON_2"), "bbb") == 0);
> + SELF_CHECK (streq (env.get ("GDB_SELFTEST_ENVIRON_2"), "bbb"));
>
> env.unset ("GDB_SELFTEST_ENVIRON_1");
> SELF_CHECK (env.get ("GDB_SELFTEST_ENVIRON_1") == NULL);
> - SELF_CHECK (strcmp (env.get ("GDB_SELFTEST_ENVIRON_2"), "bbb") == 0);
> + SELF_CHECK (streq (env.get ("GDB_SELFTEST_ENVIRON_2"), "bbb"));
>
> /* The user-set environ var list must contain only one element
> now. */
> @@ -123,7 +123,7 @@ test_unset_set_empty_vector ()
> gdb_environ env;
>
> env.set ("PWD", "test");
> - SELF_CHECK (strcmp (env.get ("PWD"), "test") == 0);
> + SELF_CHECK (streq (env.get ("PWD"), "test"));
> SELF_CHECK (set_contains (env.user_set_env (), std::string ("PWD=test")));
> SELF_CHECK (env.user_unset_env ().size () == 0);
> /* The second element must be NULL. */
> @@ -164,19 +164,19 @@ test_std_move ()
> gdb_environ env2;
>
> env.set ("A", "1");
> - SELF_CHECK (strcmp (env.get ("A"), "1") == 0);
> + SELF_CHECK (streq (env.get ("A"), "1"));
> SELF_CHECK (set_contains (env.user_set_env (), std::string ("A=1")));
> SELF_CHECK (env.user_set_env ().size () == 1);
>
> env2 = std::move (env);
> SELF_CHECK (env.envp ()[0] == NULL);
> - SELF_CHECK (strcmp (env2.get ("A"), "1") == 0);
> + SELF_CHECK (streq (env2.get ("A"), "1"));
> SELF_CHECK (env2.envp ()[1] == NULL);
> SELF_CHECK (env.user_set_env ().size () == 0);
> SELF_CHECK (set_contains (env2.user_set_env (), std::string ("A=1")));
> SELF_CHECK (env2.user_set_env ().size () == 1);
> env.set ("B", "2");
> - SELF_CHECK (strcmp (env.get ("B"), "2") == 0);
> + SELF_CHECK (streq (env.get ("B"), "2"));
> SELF_CHECK (env.envp ()[1] == NULL);
> }
>
> @@ -189,19 +189,19 @@ test_move_constructor ()
> gdb_environ env;
>
> env.set ("A", "1");
> - SELF_CHECK (strcmp (env.get ("A"), "1") == 0);
> + SELF_CHECK (streq (env.get ("A"), "1"));
> SELF_CHECK (set_contains (env.user_set_env (), std::string ("A=1")));
>
> gdb_environ env2 = std::move (env);
> SELF_CHECK (env.envp ()[0] == NULL);
> SELF_CHECK (env.user_set_env ().size () == 0);
> - SELF_CHECK (strcmp (env2.get ("A"), "1") == 0);
> + SELF_CHECK (streq (env2.get ("A"), "1"));
> SELF_CHECK (env2.envp ()[1] == NULL);
> SELF_CHECK (set_contains (env2.user_set_env (), std::string ("A=1")));
> SELF_CHECK (env2.user_set_env ().size () == 1);
>
> env.set ("B", "2");
> - SELF_CHECK (strcmp (env.get ("B"), "2") == 0);
> + SELF_CHECK (streq (env.get ("B"), "2"));
> SELF_CHECK (env.envp ()[1] == NULL);
> SELF_CHECK (set_contains (env.user_set_env (), std::string ("B=2")));
> SELF_CHECK (env.user_set_env ().size () == 1);
> @@ -216,7 +216,7 @@ test_self_move ()
>
> /* Test self-move. */
> env.set ("A", "1");
> - SELF_CHECK (strcmp (env.get ("A"), "1") == 0);
> + SELF_CHECK (streq (env.get ("A"), "1"));
> SELF_CHECK (set_contains (env.user_set_env (), std::string ("A=1")));
> SELF_CHECK (env.user_set_env ().size () == 1);
>
> @@ -227,8 +227,8 @@ test_self_move ()
> env = std::move (env);
> DIAGNOSTIC_POP
>
> - SELF_CHECK (strcmp (env.get ("A"), "1") == 0);
> - SELF_CHECK (strcmp (env.envp ()[0], "A=1") == 0);
> + SELF_CHECK (streq (env.get ("A"), "1"));
> + SELF_CHECK (streq (env.envp ()[0], "A=1"));
> SELF_CHECK (env.envp ()[1] == NULL);
> SELF_CHECK (set_contains (env.user_set_env (), std::string ("A=1")));
> SELF_CHECK (env.user_set_env ().size () == 1);
> @@ -246,7 +246,7 @@ test_set_unset_reset ()
>
> /* Set our test variable to another value. */
> env.set ("GDB_SELFTEST_ENVIRON", "test");
> - SELF_CHECK (strcmp (env.get ("GDB_SELFTEST_ENVIRON"), "test") == 0);
> + SELF_CHECK (streq (env.get ("GDB_SELFTEST_ENVIRON"), "test"));
> SELF_CHECK (env.user_set_env ().size () == 1);
> SELF_CHECK (env.user_unset_env ().size () == 0);
>
> @@ -261,7 +261,7 @@ test_set_unset_reset ()
>
> /* Re-set the test variable. */
> env.set ("GDB_SELFTEST_ENVIRON", "1");
> - SELF_CHECK (strcmp (env.get ("GDB_SELFTEST_ENVIRON"), "1") == 0);
> + SELF_CHECK (streq (env.get ("GDB_SELFTEST_ENVIRON"), "1"));
> }
>
> static void
> diff --git a/gdb/unittests/intrusive_list-selftests.c b/gdb/unittests/intrusive_list-selftests.c
> index 398ca04a5198..aa68b7d21ec2 100644
> --- a/gdb/unittests/intrusive_list-selftests.c
> +++ b/gdb/unittests/intrusive_list-selftests.c
> @@ -95,7 +95,7 @@ verify_items (const ListType &list,
> SELF_CHECK (&item == expected[i]);
>
> /* Access the item, to make sure the object is still alive. */
> - SELF_CHECK (strcmp (item.name, expected[i]->name) == 0);
> + SELF_CHECK (streq (item.name, expected[i]->name));
>
> ++i;
> }
> @@ -113,7 +113,7 @@ verify_items (const ListType &list,
> SELF_CHECK (&item == expected[i]);
>
> /* Access the item, to make sure the object is still alive. */
> - SELF_CHECK (strcmp (item.name, expected[i]->name) == 0);
> + SELF_CHECK (streq (item.name, expected[i]->name));
> }
>
> SELF_CHECK (i == 0);
> diff --git a/gdb/unittests/lookup_name_info-selftests.c b/gdb/unittests/lookup_name_info-selftests.c
> index 6d56ecd4df49..8eae34d91f81 100644
> --- a/gdb/unittests/lookup_name_info-selftests.c
> +++ b/gdb/unittests/lookup_name_info-selftests.c
> @@ -38,7 +38,7 @@ check_make_paramless (const char *file, int line,
> completion_mode, true /* ignore_parameters */);
> const char *result = lookup_name.language_lookup_name (lang);
>
> - if (strcmp (result, expected) != 0)
> + if (!streq (result, expected))
> {
> error (_("%s:%d: make-paramless self-test failed: (completion=%d, lang=%d) "
> "\"%s\" -> \"%s\", expected \"%s\""),
> diff --git a/gdb/unittests/scoped_mmap-selftests.c b/gdb/unittests/scoped_mmap-selftests.c
> index a89f94dd47a9..06026b459cda 100644
> --- a/gdb/unittests/scoped_mmap-selftests.c
> +++ b/gdb/unittests/scoped_mmap-selftests.c
> @@ -102,7 +102,7 @@ test_normal ()
>
> SELF_CHECK (m.get () != MAP_FAILED);
> SELF_CHECK (m.size () == 7);
> - SELF_CHECK (0 == strcmp ((char *) m.get (), "Hello!"));
> + SELF_CHECK (streq ((char *) m.get (), "Hello!"));
> }
> }
>
> diff --git a/gdb/unittests/unique_xmalloc_ptr_char.c b/gdb/unittests/unique_xmalloc_ptr_char.c
> index 3618ee52d42c..cd11a05e275d 100644
> --- a/gdb/unittests/unique_xmalloc_ptr_char.c
> +++ b/gdb/unittests/unique_xmalloc_ptr_char.c
> @@ -30,8 +30,8 @@ unique_xmalloc_ptr_char ()
> gdb::unique_xmalloc_ptr<char> a = make_unique_xstrdup ("abc");
> gdb::unique_xmalloc_ptr<char> b = make_unique_xstrndup ("defghi", 3);
>
> - SELF_CHECK (strcmp (a.get (), "abc") == 0);
> - SELF_CHECK (strcmp (b.get (), "def") == 0);
> + SELF_CHECK (streq (a.get (), "abc"));
> + SELF_CHECK (streq (b.get (), "def"));
>
> std::string str = "xxx";
>
> diff --git a/gdb/utils.c b/gdb/utils.c
> index ef8ef87bc5b8..bbb6bcb41624 100644
> --- a/gdb/utils.c
> +++ b/gdb/utils.c
> @@ -1359,7 +1359,7 @@ maintenance_info_screen (const char *args, int from_tty)
> = rl_variable_value ("horizontal-scroll-mode");
> bool force_horizontal_scroll_mode
> = (horizontal_scroll_mode_value != nullptr
> - && strcmp (horizontal_scroll_mode_value, "on") == 0);
> + && streq (horizontal_scroll_mode_value, "on"));
>
> const char *mode = nullptr;
> const char *reason = nullptr;
> @@ -3341,7 +3341,7 @@ gdb_realpath_check_trailer (const char *input, const char *trailer)
> size_t trail_len = strlen (trailer);
>
> SELF_CHECK (len >= trail_len
> - && strcmp (result.get () + len - trail_len, trailer) == 0);
> + && streq (result.get () + len - trail_len, trailer));
> }
>
> static void
> @@ -3383,9 +3383,9 @@ gdb_argv_as_array_view_test ()
> gdb::array_view<char *> view = argv.as_array_view ();
>
> SELF_CHECK (view.size () == 3);
> - SELF_CHECK (strcmp (view[0], "une") == 0);
> - SELF_CHECK (strcmp (view[1], "bonne") == 0);
> - SELF_CHECK (strcmp (view[2], "50") == 0);
> + SELF_CHECK (streq (view[0], "une"));
> + SELF_CHECK (streq (view[1], "bonne"));
> + SELF_CHECK (streq (view[2], "50"));
> }
> }
>
> diff --git a/gdb/valops.c b/gdb/valops.c
> index 494ed9aaa985..a5f16dc88f0a 100644
> --- a/gdb/valops.c
> +++ b/gdb/valops.c
> @@ -212,10 +212,10 @@ value_cast_structs (struct type *type, struct value *v2)
> || t2->code () == TYPE_CODE_UNION)
> && !!"Precondition is that value is of STRUCT or UNION kind");
>
> - if (t1->name () != NULL
> - && t2->name () != NULL
> - && !strcmp (t1->name (), t2->name ()))
> - return NULL;
> + if (t1->name () != nullptr
> + && t2->name () != nullptr
> + && streq (t1->name (), t2->name ()))
> + return nullptr;
>
> /* Upcasting: look in the type of the source to see if it contains the
> type of the target as a superclass. If so, we'll need to
> @@ -248,7 +248,7 @@ value_cast_structs (struct type *type, struct value *v2)
> /* We might be trying to cast to the outermost enclosing
> type, in which case search_struct_field won't work. */
> if (real_type->name () != NULL
> - && !strcmp (real_type->name (), t1->name ()))
> + && streq (real_type->name (), t1->name ()))
> return v;
>
> v = search_struct_field (t2->name (), v, real_type, 1);
> @@ -2877,7 +2877,7 @@ find_overload_match (gdb::array_view<value *> args,
> probably a C-style function. */
> if (temp_func != nullptr)
> {
> - if (strcmp (temp_func.get (), qualified_name) == 0)
> + if (streq (temp_func.get (), qualified_name))
> func_name = NULL;
> else
> func_name = temp_func.get ();
> @@ -3402,7 +3402,7 @@ enum_constant_from_type (struct type *type, const char *name)
> if (len + 2 >= name_len
> && fname[len - name_len - 2] == ':'
> && fname[len - name_len - 1] == ':'
> - && strcmp (&fname[len - name_len], name) == 0)
> + && streq (&fname[len - name_len], name))
> return value_from_longest (type, type->field (i).loc_enumval ());
> }
>
> @@ -3562,7 +3562,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
> {
> const char *t_field_name = t->field (i).name ();
>
> - if (t_field_name && strcmp (t_field_name, name) == 0)
> + if (t_field_name && streq (t_field_name, name))
> {
> if (t->field (i).is_static ())
> {
> @@ -3639,7 +3639,7 @@ value_struct_elt_for_reference (struct type *domain, int offset,
> {
> const char *t_field_name = TYPE_FN_FIELDLIST_NAME (t, i);
>
> - if (t_field_name && strcmp (t_field_name, name) == 0)
> + if (t_field_name && streq (t_field_name, name))
> {
> int j;
> int len = TYPE_FN_FIELDLIST_LENGTH (t, i);
> diff --git a/gdb/varobj.c b/gdb/varobj.c
> index 6a0ba6c93ab8..edd94ea49630 100644
> --- a/gdb/varobj.c
> +++ b/gdb/varobj.c
> @@ -2181,7 +2181,7 @@ varobj_value_get_print_value (struct value *value,
> = gdbpy_get_display_hint (value_formatter);
> if (hint)
> {
> - if (!strcmp (hint.get (), "string"))
> + if (streq (hint.get (), "string"))
> string_print = true;
> }
>
> diff --git a/gdb/windows-tdep.c b/gdb/windows-tdep.c
> index a79d1b5e02e9..38ee1d7275e8 100644
> --- a/gdb/windows-tdep.c
> +++ b/gdb/windows-tdep.c
> @@ -1378,10 +1378,10 @@ cygwin_sigwrapper_frame_unwind::sniff (const frame_info_ptr &this_frame,
> if (name == nullptr)
> return 0;
>
> - if (strcmp (name, "_sigbe") != 0
> - && strcmp (name, "__sigbe") != 0
> - && strcmp (name, "sigdelayed") != 0
> - && strcmp (name, "_sigdelayed") != 0)
> + if (!streq (name, "_sigbe")
> + && !streq (name, "__sigbe")
> + && !streq (name, "sigdelayed")
> + && !streq (name, "_sigdelayed"))
> return 0;
>
> frame_debug_printf ("name=%s, start=%s, end=%s",
> diff --git a/gdb/x86-tdep.c b/gdb/x86-tdep.c
> index aa7b1213482f..1f34a6a0ffbd 100644
> --- a/gdb/x86-tdep.c
> +++ b/gdb/x86-tdep.c
> @@ -51,7 +51,7 @@ x86_is_thunk_register_name (const char *name, const char * const *names,
> {
> int reg;
> for (reg = lo; reg < hi; ++reg)
> - if (strcmp (name, names[reg]) == 0)
> + if (streq (name, names[reg]))
> return true;
>
> return false;
> @@ -72,7 +72,7 @@ x86_in_indirect_branch_thunk (CORE_ADDR pc, const char * const *register_names,
> return false;
>
> /* Check the indirect return thunk first. */
> - if (strcmp (name, "__x86_return_thunk") == 0)
> + if (streq (name, "__x86_return_thunk"))
> return true;
>
> /* Then check a family of indirect call/jump thunks. */
> diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
> index aec959e13751..b3d9bb97b621 100644
> --- a/gdb/xcoffread.c
> +++ b/gdb/xcoffread.c
> @@ -262,20 +262,17 @@ xcoff_symfile_offsets (objfile *objfile, const section_addr_info &addrs)
> const char *first_section_name
> = bfd_section_name (objfile->sections_start[0].the_bfd_section);
>
> - if (objfile->sect_index_text == 0
> - && strcmp (first_section_name, ".text") != 0)
> + if (objfile->sect_index_text == 0 && !streq (first_section_name, ".text"))
> objfile->sect_index_text = -1;
>
> - if (objfile->sect_index_data == 0
> - && strcmp (first_section_name, ".data") != 0)
> + if (objfile->sect_index_data == 0 && !streq (first_section_name, ".data"))
> objfile->sect_index_data = -1;
>
> - if (objfile->sect_index_bss == 0
> - && strcmp (first_section_name, ".bss") != 0)
> + if (objfile->sect_index_bss == 0 && !streq (first_section_name, ".bss"))
> objfile->sect_index_bss = -1;
>
> if (objfile->sect_index_rodata == 0
> - && strcmp (first_section_name, ".rodata") != 0)
> + && !streq (first_section_name, ".rodata"))
> objfile->sect_index_rodata = -1;
> }
>
> diff --git a/gdb/xml-support.c b/gdb/xml-support.c
> index 76ce84122fb3..a538c16f926c 100644
> --- a/gdb/xml-support.c
> +++ b/gdb/xml-support.c
> @@ -229,7 +229,7 @@ xml_find_attribute (std::vector<gdb_xml_value> &attributes,
> const char *name)
> {
> for (gdb_xml_value &value : attributes)
> - if (strcmp (value.name, name) == 0)
> + if (streq (value.name, name))
> return &value;
>
> return NULL;
> @@ -270,7 +270,7 @@ gdb_xml_parser::start_element (const XML_Char *name,
> seen = 1;
> for (element = scope.elements; element && element->name;
> element++, seen <<= 1)
> - if (strcmp (element->name, name) == 0)
> + if (streq (element->name, name))
> break;
>
> if (element == NULL || element->name == NULL)
> @@ -307,7 +307,7 @@ gdb_xml_parser::start_element (const XML_Char *name,
> void *parsed_value;
>
> for (p = attrs; *p != NULL; p += 2)
> - if (!strcmp (attribute->name, p[0]))
> + if (streq (attribute->name, p[0]))
> {
> val = p[1];
> break;
> @@ -352,7 +352,7 @@ gdb_xml_parser::start_element (const XML_Char *name,
> for (attribute = element->attributes;
> attribute != NULL && attribute->name != NULL;
> attribute++)
> - if (strcmp (attribute->name, *p) == 0)
> + if (streq (attribute->name, *p))
> break;
>
> if (attribute == NULL || attribute->name == NULL)
> @@ -914,7 +914,7 @@ fetch_xml_builtin (const char *filename)
> const char *const (*p)[2];
>
> for (p = xml_builtin; (*p)[0]; p++)
> - if (strcmp ((*p)[0], filename) == 0)
> + if (streq ((*p)[0], filename))
> return (*p)[1];
>
> return NULL;
> diff --git a/gdb/xml-syscall.c b/gdb/xml-syscall.c
> index c169e8c1b211..56fb7cff57a0 100644
> --- a/gdb/xml-syscall.c
> +++ b/gdb/xml-syscall.c
> @@ -244,13 +244,13 @@ syscall_start_syscall (struct gdb_xml_parser *parser,
>
> for (const gdb_xml_value &attr : attributes)
> {
> - if (strcmp (attr.name, "name") == 0)
> + if (streq (attr.name, "name"))
> name = (char *) attr.value.get ();
> - else if (strcmp (attr.name, "number") == 0)
> + else if (streq (attr.name, "number"))
> number = * (ULONGEST *) attr.value.get ();
> - else if (strcmp (attr.name, "alias") == 0)
> + else if (streq (attr.name, "alias"))
> alias = (char *) attr.value.get ();
> - else if (strcmp (attr.name, "groups") == 0)
> + else if (streq (attr.name, "groups"))
> groups = (char *) attr.value.get ();
> else
> internal_error (_("Unknown attribute name '%s'."), attr.name);
> diff --git a/gdb/xml-tdesc.c b/gdb/xml-tdesc.c
> index 472c604254a8..c0b1b6353157 100644
> --- a/gdb/xml-tdesc.c
> +++ b/gdb/xml-tdesc.c
> @@ -147,7 +147,7 @@ tdesc_start_target (struct gdb_xml_parser *parser,
> char *version
> = (char *) xml_find_attribute (attributes, "version")->value.get ();
>
> - if (strcmp (version, "1.0") != 0)
> + if (!streq (version, "1.0"))
> gdb_xml_error (parser,
> _("Target description has unsupported version \"%s\""),
> version);
> @@ -185,28 +185,27 @@ tdesc_start_reg (struct gdb_xml_parser *parser,
> name = (char *) attributes[ix++].value.get ();
> bitsize = * (ULONGEST *) attributes[ix++].value.get ();
>
> - if (ix < length && strcmp (attributes[ix].name, "regnum") == 0)
> + if (ix < length && streq (attributes[ix].name, "regnum"))
> regnum = * (ULONGEST *) attributes[ix++].value.get ();
> else
> regnum = data->next_regnum;
>
> - if (ix < length && strcmp (attributes[ix].name, "type") == 0)
> + if (ix < length && streq (attributes[ix].name, "type"))
> type = (char *) attributes[ix++].value.get ();
> else
> type = "int";
>
> - if (ix < length && strcmp (attributes[ix].name, "group") == 0)
> + if (ix < length && streq (attributes[ix].name, "group"))
> group = (char *) attributes[ix++].value.get ();
> else
> group = NULL;
>
> - if (ix < length && strcmp (attributes[ix].name, "save-restore") == 0)
> + if (ix < length && streq (attributes[ix].name, "save-restore"))
> save_restore = * (ULONGEST *) attributes[ix++].value.get ();
> else
> save_restore = 1;
>
> - if (strcmp (type, "int") != 0
> - && strcmp (type, "float") != 0
> + if (!streq (type, "int") && !streq (type, "float")
> && tdesc_named_type (data->current_feature, type) == NULL)
> gdb_xml_error (parser, _("Register \"%s\" has unknown type \"%s\""),
> name, type);
> @@ -381,8 +380,8 @@ tdesc_start_field (struct gdb_xml_parser *parser,
> gdb_xml_error (parser,
> _("Bitfields must live in explicitly sized types"));
>
> - if (field_type_id != NULL
> - && strcmp (field_type_id, "bool") == 0
> + if (field_type_id != nullptr
> + && streq (field_type_id, "bool")
> && start != end)
> {
> gdb_xml_error (parser,
> diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
> index 1916b8cfdfe4..20cb849f1f1d 100644
> --- a/gdb/xstormy16-tdep.c
> +++ b/gdb/xstormy16-tdep.c
> @@ -515,7 +515,7 @@ xstormy16_resolve_jmp_table_entry (struct gdbarch *gdbarch, CORE_ADDR faddr)
> gdb_byte buf[2 * xstormy16_inst_size];
>
> /* Return faddr if it's not pointing into the jump table. */
> - if (strcmp (faddr_sect->the_bfd_section->name, ".plt"))
> + if (!streq (faddr_sect->the_bfd_section->name, ".plt"))
> return faddr;
>
> if (!target_read_memory (faddr, buf, sizeof buf))
> @@ -543,12 +543,12 @@ xstormy16_find_jmp_table_entry (struct gdbarch *gdbarch, CORE_ADDR faddr)
> if (faddr_sect)
> {
> /* Return faddr if it's already a pointer to a jump table entry. */
> - if (!strcmp (faddr_sect->the_bfd_section->name, ".plt"))
> + if (streq (faddr_sect->the_bfd_section->name, ".plt"))
> return faddr;
>
> for (obj_section &osect : faddr_sect->objfile->sections ())
> {
> - if (!strcmp (osect.the_bfd_section->name, ".plt"))
> + if (streq (osect.the_bfd_section->name, ".plt"))
> {
> CORE_ADDR addr, endaddr;
>
> diff --git a/gdbserver/gdbreplay.cc b/gdbserver/gdbreplay.cc
> index d2cf3977359a..50ad3be34b0f 100644
> --- a/gdbserver/gdbreplay.cc
> +++ b/gdbserver/gdbreplay.cc
> @@ -109,7 +109,7 @@ static void
> remote_open (const char *name)
> {
> #ifndef USE_WIN32API
> - if (strcmp (name, "-") == 0)
> + if (streq (name, "-"))
> {
> remote_desc_in = 0;
> remote_desc_out = 1;
> diff --git a/gdbserver/linux-arc-low.cc b/gdbserver/linux-arc-low.cc
> index f3ccbbc61427..9c56af36fec7 100644
> --- a/gdbserver/linux-arc-low.cc
> +++ b/gdbserver/linux-arc-low.cc
> @@ -299,7 +299,7 @@ is_reg_name_available_p (const struct target_desc *tdesc,
> const char *name)
> {
> for (const gdb::reg ® : tdesc->reg_defs)
> - if (strcmp (name, reg.name) == 0)
> + if (streq (name, reg.name))
> return true;
> return false;
> }
> diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
> index ca20a5bca168..0246217db86c 100644
> --- a/gdbserver/linux-low.cc
> +++ b/gdbserver/linux-low.cc
> @@ -6146,9 +6146,9 @@ linux_process_target::read_loadmap (const char *annex, CORE_ADDR offset,
> struct target_loadmap *data = NULL;
> unsigned int actual_length, copy_length;
>
> - if (strcmp (annex, "exec") == 0)
> + if (streq (annex, "exec"))
> addr = (int) LINUX_LOADMAP_EXEC;
> - else if (strcmp (annex, "interp") == 0)
> + else if (streq (annex, "interp"))
> addr = (int) LINUX_LOADMAP_INTERP;
> else
> return -1;
> diff --git a/gdbserver/linux-x86-low.cc b/gdbserver/linux-x86-low.cc
> index cc7c05da3074..28a3d78f747b 100644
> --- a/gdbserver/linux-x86-low.cc
> +++ b/gdbserver/linux-x86-low.cc
> @@ -1084,7 +1084,7 @@ x86_target::process_qsupported (gdb::array_view<const char * const> features)
> p != NULL;
> p = strtok_r (NULL, ",", &saveptr))
> {
> - if (strcmp (p, "i386") == 0)
> + if (streq (p, "i386"))
> {
> use_xml = 1;
> break;
> diff --git a/gdbserver/linux-x86-tdesc.cc b/gdbserver/linux-x86-tdesc.cc
> index e405612be985..1ff6936ff287 100644
> --- a/gdbserver/linux-x86-tdesc.cc
> +++ b/gdbserver/linux-x86-tdesc.cc
> @@ -33,8 +33,7 @@ x86_linux_post_init_tdesc (target_desc *tdesc, bool is_64bit)
> However, init_target_desc requires us to override the already set
> value. That's fine, out new string should match the old one. */
> gdb_assert (tdesc_osabi_name (tdesc) != nullptr);
> - gdb_assert (strcmp (tdesc_osabi_name (tdesc),
> - gdbarch_osabi_name (osabi)) == 0);
> + gdb_assert (streq (tdesc_osabi_name (tdesc), gdbarch_osabi_name (osabi)));
> #endif /* ! IN_PROCESS_AGENT */
>
> #ifdef __x86_64__
> diff --git a/gdbserver/regcache.cc b/gdbserver/regcache.cc
> index f50c77275db8..4ace68869e50 100644
> --- a/gdbserver/regcache.cc
> +++ b/gdbserver/regcache.cc
> @@ -221,7 +221,7 @@ find_regno_no_throw (const struct target_desc *tdesc, const char *name)
> {
> for (int i = 0; i < tdesc->reg_defs.size (); ++i)
> {
> - if (strcmp (name, find_register_by_number (tdesc, i).name) == 0)
> + if (streq (name, find_register_by_number (tdesc, i).name))
> return i;
> }
> return {};
> diff --git a/gdbserver/remote-utils.cc b/gdbserver/remote-utils.cc
> index 7671206ebc1a..34801d0b76fe 100644
> --- a/gdbserver/remote-utils.cc
> +++ b/gdbserver/remote-utils.cc
> @@ -221,7 +221,7 @@ remote_prepare (const char *name)
> socklen_t tmp;
>
> remote_is_stdio = 0;
> - if (strcmp (name, STDIO_CONNECTION_NAME) == 0)
> + if (streq (name, STDIO_CONNECTION_NAME))
> {
> /* We need to record fact that we're using stdio sooner than the
> call to remote_open so start_inferior knows the connection is
> @@ -322,7 +322,7 @@ remote_open (const char *name)
> error ("Only HOST:PORT is supported on this platform.");
> #endif
>
> - if (strcmp (name, STDIO_CONNECTION_NAME) == 0)
> + if (streq (name, STDIO_CONNECTION_NAME))
> {
> fprintf (stderr, "Remote debugging using stdio\n");
>
> @@ -1508,7 +1508,7 @@ look_up_one_symbol (const char *name, CORE_ADDR *addrp, int may_ask_gdb)
>
> /* Check the cache first. */
> for (sym = proc->symbol_cache; sym; sym = sym->next)
> - if (strcmp (name, sym->name) == 0)
> + if (streq (name, sym->name))
> {
> *addrp = sym->addr;
> return 1;
> diff --git a/gdbserver/server.cc b/gdbserver/server.cc
> index 793af6354087..ebde831d6031 100644
> --- a/gdbserver/server.cc
> +++ b/gdbserver/server.cc
> @@ -467,11 +467,11 @@ handle_btrace_general_set (char *own_buf)
>
> try
> {
> - if (strcmp (op, "bts") == 0)
> + if (streq (op, "bts"))
> handle_btrace_enable_bts (thread);
> - else if (strcmp (op, "pt") == 0)
> + else if (streq (op, "pt"))
> handle_btrace_enable_pt (thread);
> - else if (strcmp (op, "off") == 0)
> + else if (streq (op, "off"))
> handle_btrace_disable (thread);
> else
> error (_("Bad Qbtrace operation. Use bts, pt, or off."));
> @@ -720,7 +720,7 @@ handle_general_set (char *own_buf)
> return;
> }
>
> - if (strcmp (p, "0") == 0)
> + if (streq (p, "0"))
> enabled = 0;
> else if (p[0] == '1' && (p[1] == ';' || p[1] == '\0'))
> enabled = 1;
> @@ -755,7 +755,7 @@ handle_general_set (char *own_buf)
> return;
> }
>
> - if (strcmp (own_buf, "QEnvironmentReset") == 0)
> + if (streq (own_buf, "QEnvironmentReset"))
> {
> our_environ = gdb_environ::from_host_environ ();
>
> @@ -808,7 +808,7 @@ handle_general_set (char *own_buf)
> return;
> }
>
> - if (strcmp (own_buf, "QStartNoAckMode") == 0)
> + if (streq (own_buf, "QStartNoAckMode"))
> {
> remote_debug_printf ("[noack mode enabled]");
>
> @@ -823,9 +823,9 @@ handle_general_set (char *own_buf)
> int req = -1;
> const char *req_str;
>
> - if (strcmp (mode, "0") == 0)
> + if (streq (mode, "0"))
> req = 0;
> - else if (strcmp (mode, "1") == 0)
> + else if (streq (mode, "1"))
> req = 1;
> else
> {
> @@ -878,9 +878,9 @@ handle_general_set (char *own_buf)
> char *mode = own_buf + strlen ("QAgent:");
> int req = 0;
>
> - if (strcmp (mode, "0") == 0)
> + if (streq (mode, "0"))
> req = 0;
> - else if (strcmp (mode, "1") == 0)
> + else if (streq (mode, "1"))
> req = 1;
> else
> {
> @@ -907,9 +907,9 @@ handle_general_set (char *own_buf)
> char *mode = own_buf + strlen ("QThreadEvents:");
> enum tribool req = TRIBOOL_UNKNOWN;
>
> - if (strcmp (mode, "0") == 0)
> + if (streq (mode, "0"))
> req = TRIBOOL_FALSE;
> - else if (strcmp (mode, "1") == 0)
> + else if (streq (mode, "1"))
> req = TRIBOOL_TRUE;
> else
> {
> @@ -1037,9 +1037,9 @@ handle_general_set (char *own_buf)
> {
> const char *value = own_buf + strlen ("QStartupWithShell:");
>
> - if (strcmp (value, "1") == 0)
> + if (streq (value, "1"))
> startup_with_shell = true;
> - else if (strcmp (value, "0") == 0)
> + else if (streq (value, "0"))
> startup_with_shell = false;
> else
> {
> @@ -1128,7 +1128,7 @@ get_features_xml (const char *annex)
> This variable is set up from the auto-generated
> init_registers_... routine for the current target. */
>
> - if (strcmp (annex, "target.xml") == 0)
> + if (streq (annex, "target.xml"))
> {
> const char *ret = tdesc_get_features_xml (desc);
>
> @@ -1144,7 +1144,7 @@ get_features_xml (const char *annex)
>
> /* Look for the annex. */
> for (i = 0; xml_builtin[i][0] != NULL; i++)
> - if (strcmp (annex, xml_builtin[i][0]) == 0)
> + if (streq (annex, xml_builtin[i][0]))
> break;
>
> if (xml_builtin[i][0] != NULL)
> @@ -1433,19 +1433,19 @@ parse_debug_format_options (const char *arg, int is_monitor)
>
> for (const gdb::unique_xmalloc_ptr<char> &option : options)
> {
> - if (strcmp (option.get (), "all") == 0)
> + if (streq (option.get (), "all"))
> {
> debug_timestamp = 1;
> if (is_monitor)
> monitor_output ("All extra debug format options enabled.\n");
> }
> - else if (strcmp (option.get (), "none") == 0)
> + else if (streq (option.get (), "none"))
> {
> debug_timestamp = 0;
> if (is_monitor)
> monitor_output ("All extra debug format options disabled.\n");
> }
> - else if (strcmp (option.get (), "timestamp") == 0)
> + else if (streq (option.get (), "timestamp"))
> {
> debug_timestamp = 1;
> if (is_monitor)
> @@ -1727,12 +1727,12 @@ handle_monitor_command (const char *mon, char *own_buf)
> write_enn (own_buf);
> }
> }
> - else if (strcmp (mon, "set debug-hw-points 1") == 0)
> + else if (streq (mon, "set debug-hw-points 1"))
> {
> show_debug_regs = 1;
> monitor_output ("H/W point debugging output enabled.\n");
> }
> - else if (strcmp (mon, "set debug-hw-points 0") == 0)
> + else if (streq (mon, "set debug-hw-points 0"))
> {
> show_debug_regs = 0;
> monitor_output ("H/W point debugging output disabled.\n");
> @@ -1750,13 +1750,13 @@ handle_monitor_command (const char *mon, char *own_buf)
> write_enn (own_buf);
> }
> }
> - else if (strcmp (mon, "set debug-file") == 0)
> + else if (streq (mon, "set debug-file"))
> debug_set_output (nullptr);
> else if (startswith (mon, "set debug-file "))
> debug_set_output (mon + sizeof ("set debug-file ") - 1);
> - else if (strcmp (mon, "help") == 0)
> + else if (streq (mon, "help"))
> monitor_show_help ();
> - else if (strcmp (mon, "exit") == 0)
> + else if (streq (mon, "exit"))
> exit_requested = true;
> else
> {
> @@ -2179,11 +2179,11 @@ handle_qxfer_btrace (const char *annex,
> return -3;
> }
>
> - if (strcmp (annex, "all") == 0)
> + if (streq (annex, "all"))
> type = BTRACE_READ_ALL;
> - else if (strcmp (annex, "new") == 0)
> + else if (streq (annex, "new"))
> type = BTRACE_READ_NEW;
> - else if (strcmp (annex, "delta") == 0)
> + else if (streq (annex, "delta"))
> type = BTRACE_READ_DELTA;
> else
> {
> @@ -2336,9 +2336,9 @@ handle_qxfer (char *own_buf, int packet_len, int *new_packet_len_p)
> {
> const struct qxfer *q = &qxfer_packets[i];
>
> - if (strcmp (object, q->object) == 0)
> + if (streq (object, q->object))
> {
> - if (strcmp (rw, "read") == 0)
> + if (streq (rw, "read"))
> {
> unsigned char *data;
> int n;
> @@ -2382,7 +2382,7 @@ handle_qxfer (char *own_buf, int packet_len, int *new_packet_len_p)
> free (data);
> return 1;
> }
> - else if (strcmp (rw, "write") == 0)
> + else if (streq (rw, "write"))
> {
> int n;
> unsigned int len;
> @@ -2538,7 +2538,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
> };
>
> /* Reply the current thread id. */
> - if (strcmp ("qC", own_buf) == 0 && !disable_packet_qC)
> + if (streq ("qC", own_buf) && !disable_packet_qC)
> {
> ptid_t ptid;
> require_running_or_return (own_buf);
> @@ -2557,7 +2557,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
> return;
> }
>
> - if (strcmp ("qSymbol::", own_buf) == 0)
> + if (streq ("qSymbol::", own_buf))
> {
> scoped_restore_current_thread restore_thread;
>
> @@ -2605,7 +2605,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
>
> if (!disable_packet_qfThreadInfo)
> {
> - if (strcmp ("qfThreadInfo", own_buf) == 0)
> + if (streq ("qfThreadInfo", own_buf))
> {
> require_running_or_return (own_buf);
> init_thread_iter ();
> @@ -2617,7 +2617,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
> return;
> }
>
> - if (strcmp ("qsThreadInfo", own_buf) == 0)
> + if (streq ("qsThreadInfo", own_buf))
> {
> require_running_or_return (own_buf);
> /* We're done if the process iterator hits the end of the
> @@ -2638,8 +2638,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
> }
> }
>
> - if (the_target->supports_read_offsets ()
> - && strcmp ("qOffsets", own_buf) == 0)
> + if (the_target->supports_read_offsets () && streq ("qOffsets", own_buf))
> {
> CORE_ADDR text, data;
>
> @@ -3010,8 +3009,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
> return;
> }
>
> - if (strcmp (own_buf, "qAttached") == 0
> - || startswith (own_buf, "qAttached:"))
> + if (streq (own_buf, "qAttached") || startswith (own_buf, "qAttached:"))
> {
> struct process_info *process;
>
> @@ -3094,7 +3092,7 @@ handle_query (char *own_buf, int packet_len, int *new_packet_len_p)
> return;
> }
>
> - if (strcmp ("qExecAndArgs", own_buf) == 0)
> + if (streq ("qExecAndArgs", own_buf))
> {
> if (program_path.get () == nullptr)
> sprintf (own_buf, "U");
> @@ -3568,7 +3566,7 @@ handle_v_requests (char *own_buf, int packet_len, int *new_packet_len)
> client_state &cs = get_client_state ();
> if (!disable_packet_vCont)
> {
> - if (strcmp (own_buf, "vCtrlC") == 0)
> + if (streq (own_buf, "vCtrlC"))
> {
> the_target->request_interrupt ();
> write_ok (own_buf);
> @@ -4100,7 +4098,7 @@ test_memory_tagging_functions (void)
>
> expected = "m0001020304";
> SELF_CHECK (create_fetch_memtags_reply (packet.data (), bv) == true);
> - SELF_CHECK (strcmp (packet.data (), expected.c_str ()) == 0);
> + SELF_CHECK (streq (packet.data (), expected.c_str ()));
>
> /* Test parsing a QMemTags request. */
>
> @@ -4269,8 +4267,8 @@ captured_main (int argc, char *argv[])
> gdb_assert (optarg != nullptr);
>
> if (optarg == nullptr
> - || strcmp (optarg, "-") == 0
> - || strcmp (optarg, STDIO_CONNECTION_NAME) == 0
> + || streq (optarg, "-")
> + || streq (optarg, STDIO_CONNECTION_NAME)
> || startswith (optarg, "--")
> || strchr (optarg, ':') != nullptr)
> {
> @@ -4310,8 +4308,7 @@ captured_main (int argc, char *argv[])
> {
> int original_optind = optind;
>
> - while (argv[optind] != nullptr
> - && strcmp (argv[optind], "--") != 0)
> + while (argv[optind] != nullptr && !streq (argv[optind], "--"))
> {
> wrapper_argv += argv[optind];
> wrapper_argv += ' ';
> @@ -4385,19 +4382,19 @@ captured_main (int argc, char *argv[])
> tok != nullptr;
> tok = strtok_r (nullptr, ",", &saveptr))
> {
> - if (strcmp ("vCont", tok) == 0)
> + if (streq ("vCont", tok))
> disable_packet_vCont = true;
> - else if (strcmp ("vConts", tok) == 0)
> + else if (streq ("vConts", tok))
> disable_packet_vCont_step = true;
> - else if (strcmp ("Tthread", tok) == 0)
> + else if (streq ("Tthread", tok))
> disable_packet_Tthread = true;
> - else if (strcmp ("qC", tok) == 0)
> + else if (streq ("qC", tok))
> disable_packet_qC = true;
> - else if (strcmp ("qfThreadInfo", tok) == 0)
> + else if (streq ("qfThreadInfo", tok))
> disable_packet_qfThreadInfo = true;
> - else if (strcmp ("T", tok) == 0)
> + else if (streq ("T", tok))
> disable_packet_T = true;
> - else if (strcmp ("threads", tok) == 0)
> + else if (streq ("threads", tok))
> {
> disable_packet_vCont = true;
> disable_packet_Tthread = true;
> @@ -4495,7 +4492,7 @@ captured_main (int argc, char *argv[])
>
> const char *port = argv[optind];
> ++optind;
> - if (port != nullptr && strcmp (port, "-") == 0)
> + if (port != nullptr && streq (port, "-"))
> {
> port = STDIO_CONNECTION_NAME;
>
> @@ -4529,7 +4526,7 @@ captured_main (int argc, char *argv[])
>
> /* --attach used to come after PORT, so allow it there for
> compatibility. */
> - if (*next_arg != NULL && strcmp (*next_arg, "--attach") == 0)
> + if (*next_arg != NULL && streq (*next_arg, "--attach"))
> {
> attach = true;
> next_arg++;
> diff --git a/gdbserver/thread-db.cc b/gdbserver/thread-db.cc
> index 7f29788d7d79..0bdcda2ced8b 100644
> --- a/gdbserver/thread-db.cc
> +++ b/gdbserver/thread-db.cc
> @@ -696,7 +696,7 @@ thread_db_load_search (void)
> where libpthread lives. We *could* fetch the info, but we don't
> do that yet. Ignore it. */
> }
> - else if (strcmp (this_dir, "$sdir") == 0)
> + else if (streq (this_dir, "$sdir"))
> {
> if (try_thread_db_load_from_sdir ())
> {
> diff --git a/gdbserver/tracepoint.cc b/gdbserver/tracepoint.cc
> index 9bedd13567a3..25a3e8ceadfe 100644
> --- a/gdbserver/tracepoint.cc
> +++ b/gdbserver/tracepoint.cc
> @@ -2497,7 +2497,7 @@ cmd_qtdp (char *own_buf)
> if (tpoint->type == trap_tracepoint || tp == NULL)
> {
> install_tracepoint (tpoint, own_buf);
> - if (strcmp (own_buf, "OK") != 0)
> + if (!streq (own_buf, "OK"))
> remove_tracepoint (tpoint);
> }
> else
> @@ -2685,7 +2685,7 @@ cmd_qtv (char *own_buf)
> /* Only make tsv's be undefined before the first trace run. After a
> trace run is over, the user might want to see the last value of
> the tsv, and it might not be available in a traceframe. */
> - else if (!tracing && strcmp (tracing_stop_reason, "tnotrun") == 0)
> + else if (!tracing && streq (tracing_stop_reason, "tnotrun"))
> {
> strcpy (own_buf, "U");
> return;
> @@ -3438,7 +3438,7 @@ cmd_qtstatus (char *packet)
> }
>
> /* If this was a forced stop, include any stop note that was supplied. */
> - if (strcmp (stop_reason_rsp, "tstop") == 0)
> + if (streq (stop_reason_rsp, "tstop"))
> {
> stop_reason_rsp = (char *) alloca (strlen ("tstop:") + strlen (buf3) + 1);
> strcpy (stop_reason_rsp, "tstop:");
> @@ -3803,7 +3803,7 @@ cmd_bigqtbuffer_size (char *own_buf)
> packet += strlen ("QTBuffer:size:");
>
> /* -1 is sent as literal "-1". */
> - if (strcmp (packet, "-1") == 0)
> + if (streq (packet, "-1"))
> sval = DEFAULT_TRACE_BUFFER_SIZE;
> else
> {
> @@ -3880,7 +3880,7 @@ cmd_qtnotes (char *own_buf)
> int
> handle_tracepoint_general_set (char *packet)
> {
> - if (strcmp ("QTinit", packet) == 0)
> + if (streq ("QTinit", packet))
> {
> cmd_qtinit (packet);
> return 1;
> @@ -3915,12 +3915,12 @@ handle_tracepoint_general_set (char *packet)
> cmd_qtro (packet);
> return 1;
> }
> - else if (strcmp ("QTStart", packet) == 0)
> + else if (streq ("QTStart", packet))
> {
> cmd_qtstart (packet);
> return 1;
> }
> - else if (strcmp ("QTStop", packet) == 0)
> + else if (streq ("QTStop", packet))
> {
> cmd_qtstop (packet);
> return 1;
> @@ -3957,7 +3957,7 @@ handle_tracepoint_general_set (char *packet)
> int
> handle_tracepoint_query (char *packet)
> {
> - if (strcmp ("qTStatus", packet) == 0)
> + if (streq ("qTStatus", packet))
> {
> cmd_qtstatus (packet);
> return 1;
> @@ -3967,22 +3967,22 @@ handle_tracepoint_query (char *packet)
> cmd_qtp (packet);
> return 1;
> }
> - else if (strcmp ("qTfP", packet) == 0)
> + else if (streq ("qTfP", packet))
> {
> cmd_qtfp (packet);
> return 1;
> }
> - else if (strcmp ("qTsP", packet) == 0)
> + else if (streq ("qTsP", packet))
> {
> cmd_qtsp (packet);
> return 1;
> }
> - else if (strcmp ("qTfV", packet) == 0)
> + else if (streq ("qTfV", packet))
> {
> cmd_qtfv (packet);
> return 1;
> }
> - else if (strcmp ("qTsV", packet) == 0)
> + else if (streq ("qTsV", packet))
> {
> cmd_qtsv (packet);
> return 1;
> @@ -3997,7 +3997,7 @@ handle_tracepoint_query (char *packet)
> cmd_qtbuffer (packet);
> return 1;
> }
> - else if (strcmp ("qTMinFTPILen", packet) == 0)
> + else if (streq ("qTMinFTPILen", packet))
> {
> cmd_qtminftpilen (packet);
> return 1;
> diff --git a/gdbsupport/common-exceptions.h b/gdbsupport/common-exceptions.h
> index b34f44a66087..040419e30df9 100644
> --- a/gdbsupport/common-exceptions.h
> +++ b/gdbsupport/common-exceptions.h
> @@ -179,7 +179,7 @@ struct gdb_exception
>
> return (reason == other.reason
> && error == other.error
> - && strcmp (msg1, msg2) == 0);
> + && streq (msg1, msg2));
> }
>
> /* Compare two exceptions. */
> diff --git a/gdbsupport/osabi.cc b/gdbsupport/osabi.cc
> index d91bbcdb7ec3..806a15997dce 100644
> --- a/gdbsupport/osabi.cc
> +++ b/gdbsupport/osabi.cc
> @@ -71,7 +71,7 @@ osabi_from_tdesc_string (const char *name)
> int i;
>
> for (i = 0; i < ARRAY_SIZE (gdb_osabi_names); i++)
> - if (strcmp (name, gdb_osabi_names[i].pretty) == 0)
> + if (streq (name, gdb_osabi_names[i].pretty))
> {
> /* See note above: the name table matches the indices assigned
> to enum gdb_osabi. */
> diff --git a/gdbsupport/signals.cc b/gdbsupport/signals.cc
> index eb321805c6d3..367ca571f3db 100644
> --- a/gdbsupport/signals.cc
> +++ b/gdbsupport/signals.cc
> @@ -98,8 +98,7 @@ gdb_signal_from_name (const char *name)
> for (sig = GDB_SIGNAL_HUP;
> sig < GDB_SIGNAL_LAST;
> sig = (enum gdb_signal) ((int) sig + 1))
> - if (signals[sig].name != NULL
> - && strcmp (name, signals[sig].name) == 0)
> + if (signals[sig].name != nullptr && streq (name, signals[sig].name))
> return sig;
> return GDB_SIGNAL_UNKNOWN;
> }
>
> base-commit: 07caff21f90c2f0c9b7b0e79b00b774be668594c
> --
> 2.53.0
next prev parent reply other threads:[~2026-03-16 17:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 15:23 Simon Marchi
2026-03-16 17:18 ` Andrew Burgess [this message]
2026-03-16 17:29 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h5qf7kwk.fsf@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox