From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1726) id E401F38BE680; Wed, 8 Jun 2022 19:04:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E401F38BE680 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Andrew Burgess To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: remove trailing '.' from perror_with_name calls X-Act-Checkin: binutils-gdb X-Git-Author: Andrew Burgess X-Git-Refname: refs/heads/master X-Git-Oldrev: 5ca5b31d6381ba6d0309e6ae0b1527a852d08a4b X-Git-Newrev: deb70aa0322c4c43b68fa859b52a0ccf2d904b0f Message-Id: <20220608190450.E401F38BE680@sourceware.org> Date: Wed, 8 Jun 2022 19:04:50 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Jun 2022 19:04:51 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Ddeb70aa0322c= 4c43b68fa859b52a0ccf2d904b0f commit deb70aa0322c4c43b68fa859b52a0ccf2d904b0f Author: Andrew Burgess Date: Tue Jun 7 17:18:20 2022 +0100 gdb: remove trailing '.' from perror_with_name calls =20 I ran into this error while working on AArch64 GDB: =20 Unable to fetch VFP registers.: Invalid argument. =20 Notice the '.:' in the middle of this error message. =20 This is because of this call in aarch64-linux-nat.c: =20 perror_with_name (_("Unable to fetch VFP registers.")); =20 The perror_with_name function take a string, and adds ': ' to the end the string, so I don't think the string that we pass to perror_with_name should end in '.'. =20 This commit removes all of the trailing '.' characters from perror_with_name calls, which give more readable error messages. =20 I don't believe that any of these errors are tested in the testsuite (after a little grepping). Diff: --- gdb/aarch64-linux-nat.c | 30 +++++++++++++++--------------- gdb/arm-linux-nat.c | 24 ++++++++++++------------ gdb/fbsd-nat.c | 2 +- gdb/netbsd-nat.c | 2 +- gdb/ppc-linux-nat.c | 12 ++++++------ gdb/procfs.c | 2 +- 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/gdb/aarch64-linux-nat.c b/gdb/aarch64-linux-nat.c index 9cde72b247b..ff5c4c0a212 100644 --- a/gdb/aarch64-linux-nat.c +++ b/gdb/aarch64-linux-nat.c @@ -145,7 +145,7 @@ fetch_gregs_from_thread (struct regcache *regcache) =20 ret =3D ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, &iovec); if (ret < 0) - perror_with_name (_("Unable to fetch general registers.")); + perror_with_name (_("Unable to fetch general registers")); =20 if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word =3D=3D 32) aarch32_gp_regcache_supply (regcache, (uint32_t *) regs, 1); @@ -182,7 +182,7 @@ store_gregs_to_thread (const struct regcache *regcache) =20 ret =3D ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, &iovec); if (ret < 0) - perror_with_name (_("Unable to fetch general registers.")); + perror_with_name (_("Unable to fetch general registers")); =20 if (gdbarch_bfd_arch_info (gdbarch)->bits_per_word =3D=3D 32) aarch32_gp_regcache_collect (regcache, (uint32_t *) regs, 1); @@ -197,7 +197,7 @@ store_gregs_to_thread (const struct regcache *regcache) =20 ret =3D ptrace (PTRACE_SETREGSET, tid, NT_PRSTATUS, &iovec); if (ret < 0) - perror_with_name (_("Unable to store general registers.")); + perror_with_name (_("Unable to store general registers")); } =20 /* Fill GDB's register array with the fp/simd register values @@ -225,7 +225,7 @@ fetch_fpregs_from_thread (struct regcache *regcache) =20 ret =3D ptrace (PTRACE_GETREGSET, tid, NT_ARM_VFP, &iovec); if (ret < 0) - perror_with_name (_("Unable to fetch VFP registers.")); + perror_with_name (_("Unable to fetch VFP registers")); =20 aarch32_vfp_regcache_supply (regcache, (gdb_byte *) ®s, 32); } @@ -237,7 +237,7 @@ fetch_fpregs_from_thread (struct regcache *regcache) =20 ret =3D ptrace (PTRACE_GETREGSET, tid, NT_FPREGSET, &iovec); if (ret < 0) - perror_with_name (_("Unable to fetch vFP/SIMD registers.")); + perror_with_name (_("Unable to fetch vFP/SIMD registers")); =20 for (regno =3D AARCH64_V0_REGNUM; regno <=3D AARCH64_V31_REGNUM; reg= no++) regcache->raw_supply (regno, ®s.vregs[regno - AARCH64_V0_REGNUM]); @@ -271,7 +271,7 @@ store_fpregs_to_thread (const struct regcache *regcache) =20 ret =3D ptrace (PTRACE_GETREGSET, tid, NT_ARM_VFP, &iovec); if (ret < 0) - perror_with_name (_("Unable to fetch VFP registers.")); + perror_with_name (_("Unable to fetch VFP registers")); =20 aarch32_vfp_regcache_collect (regcache, (gdb_byte *) ®s, 32); } @@ -283,7 +283,7 @@ store_fpregs_to_thread (const struct regcache *regcache) =20 ret =3D ptrace (PTRACE_GETREGSET, tid, NT_FPREGSET, &iovec); if (ret < 0) - perror_with_name (_("Unable to fetch FP/SIMD registers.")); + perror_with_name (_("Unable to fetch FP/SIMD registers")); =20 for (regno =3D AARCH64_V0_REGNUM; regno <=3D AARCH64_V31_REGNUM; reg= no++) if (REG_VALID =3D=3D regcache->get_register_status (regno)) @@ -300,13 +300,13 @@ store_fpregs_to_thread (const struct regcache *regcac= he) { ret =3D ptrace (PTRACE_SETREGSET, tid, NT_ARM_VFP, &iovec); if (ret < 0) - perror_with_name (_("Unable to store VFP registers.")); + perror_with_name (_("Unable to store VFP registers")); } else { ret =3D ptrace (PTRACE_SETREGSET, tid, NT_FPREGSET, &iovec); if (ret < 0) - perror_with_name (_("Unable to store FP/SIMD registers.")); + perror_with_name (_("Unable to store FP/SIMD registers")); } } =20 @@ -334,7 +334,7 @@ store_sveregs_to_thread (struct regcache *regcache) /* First store vector length to the thread. This is done first to ensur= e the ptrace buffers read from the kernel are the correct size. */ if (!aarch64_sve_set_vq (tid, regcache)) - perror_with_name (_("Unable to set VG register.")); + perror_with_name (_("Unable to set VG register")); =20 /* Obtain a dump of SVE registers from ptrace. */ std::unique_ptr base =3D aarch64_sve_get_sveregs (tid); @@ -369,7 +369,7 @@ fetch_pauth_masks_from_thread (struct regcache *regcach= e) =20 ret =3D ptrace (PTRACE_GETREGSET, tid, NT_ARM_PAC_MASK, &iovec); if (ret !=3D 0) - perror_with_name (_("unable to fetch pauth registers.")); + perror_with_name (_("unable to fetch pauth registers")); =20 regcache->raw_supply (AARCH64_PAUTH_DMASK_REGNUM (tdep->pauth_reg_base), &pauth_regset[0]); @@ -397,7 +397,7 @@ fetch_mteregs_from_thread (struct regcache *regcache) =20 int tid =3D get_ptrace_pid (regcache->ptid ()); if (ptrace (PTRACE_GETREGSET, tid, NT_ARM_TAGGED_ADDR_CTRL, &iovec) !=3D= 0) - perror_with_name (_("unable to fetch MTE registers.")); + perror_with_name (_("unable to fetch MTE registers")); =20 regcache->raw_supply (regno, &tag_ctl); } @@ -428,7 +428,7 @@ store_mteregs_to_thread (struct regcache *regcache) =20 int tid =3D get_ptrace_pid (regcache->ptid ()); if (ptrace (PTRACE_SETREGSET, tid, NT_ARM_TAGGED_ADDR_CTRL, &iovec) !=3D= 0) - perror_with_name (_("unable to store MTE registers.")); + perror_with_name (_("unable to store MTE registers")); } =20 /* Fill GDB's register array with the TLS register values from @@ -451,7 +451,7 @@ fetch_tlsregs_from_thread (struct regcache *regcache) =20 int tid =3D get_ptrace_pid (regcache->ptid ()); if (ptrace (PTRACE_GETREGSET, tid, NT_ARM_TLS, &iovec) !=3D 0) - perror_with_name (_("unable to fetch TLS register.")); + perror_with_name (_("unable to fetch TLS register")); =20 regcache->raw_supply (regno, &tpidr); } @@ -482,7 +482,7 @@ store_tlsregs_to_thread (struct regcache *regcache) =20 int tid =3D get_ptrace_pid (regcache->ptid ()); if (ptrace (PTRACE_SETREGSET, tid, NT_ARM_TLS, &iovec) !=3D 0) - perror_with_name (_("unable to store TLS register.")); + perror_with_name (_("unable to store TLS register")); } =20 /* Implement the "fetch_registers" target_ops method. */ diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c index 2abaf5a675d..8dac8456282 100644 --- a/gdb/arm-linux-nat.c +++ b/gdb/arm-linux-nat.c @@ -135,7 +135,7 @@ fetch_fpregs (struct regcache *regcache) ret =3D ptrace (PT_GETFPREGS, tid, 0, fp); =20 if (ret < 0) - perror_with_name (_("Unable to fetch the floating point registers.")); + perror_with_name (_("Unable to fetch the floating point registers")); =20 /* Fetch fpsr. */ regcache->raw_supply (ARM_FPS_REGNUM, fp + NWFPE_FPSR_OFFSET); @@ -172,7 +172,7 @@ store_fpregs (const struct regcache *regcache) ret =3D ptrace (PT_GETFPREGS, tid, 0, fp); =20 if (ret < 0) - perror_with_name (_("Unable to fetch the floating point registers.")); + perror_with_name (_("Unable to fetch the floating point registers")); =20 /* Store fpsr. */ if (REG_VALID =3D=3D regcache->get_register_status (ARM_FPS_REGNUM)) @@ -196,7 +196,7 @@ store_fpregs (const struct regcache *regcache) ret =3D ptrace (PTRACE_SETFPREGS, tid, 0, fp); =20 if (ret < 0) - perror_with_name (_("Unable to store floating point registers.")); + perror_with_name (_("Unable to store floating point registers")); } =20 /* Fetch all general registers of the process and store into @@ -224,7 +224,7 @@ fetch_regs (struct regcache *regcache) ret =3D ptrace (PTRACE_GETREGS, tid, 0, ®s); =20 if (ret < 0) - perror_with_name (_("Unable to fetch general registers.")); + perror_with_name (_("Unable to fetch general registers")); =20 aarch32_gp_regcache_supply (regcache, (uint32_t *) regs, arm_apcs_32); } @@ -252,7 +252,7 @@ store_regs (const struct regcache *regcache) ret =3D ptrace (PTRACE_GETREGS, tid, 0, ®s); =20 if (ret < 0) - perror_with_name (_("Unable to fetch general registers.")); + perror_with_name (_("Unable to fetch general registers")); =20 aarch32_gp_regcache_collect (regcache, (uint32_t *) regs, arm_apcs_32); =20 @@ -269,7 +269,7 @@ store_regs (const struct regcache *regcache) ret =3D ptrace (PTRACE_SETREGS, tid, 0, ®s); =20 if (ret < 0) - perror_with_name (_("Unable to store general registers.")); + perror_with_name (_("Unable to store general registers")); } =20 /* Fetch all WMMX registers of the process and store into @@ -286,7 +286,7 @@ fetch_wmmx_regs (struct regcache *regcache) =20 ret =3D ptrace (PTRACE_GETWMMXREGS, tid, 0, regbuf); if (ret < 0) - perror_with_name (_("Unable to fetch WMMX registers.")); + perror_with_name (_("Unable to fetch WMMX registers")); =20 for (regno =3D 0; regno < 16; regno++) regcache->raw_supply (regno + ARM_WR0_REGNUM, ®buf[regno * 8]); @@ -311,7 +311,7 @@ store_wmmx_regs (const struct regcache *regcache) =20 ret =3D ptrace (PTRACE_GETWMMXREGS, tid, 0, regbuf); if (ret < 0) - perror_with_name (_("Unable to fetch WMMX registers.")); + perror_with_name (_("Unable to fetch WMMX registers")); =20 for (regno =3D 0; regno < 16; regno++) if (REG_VALID =3D=3D regcache->get_register_status (regno + ARM_WR0_RE= GNUM)) @@ -330,7 +330,7 @@ store_wmmx_regs (const struct regcache *regcache) ret =3D ptrace (PTRACE_SETWMMXREGS, tid, 0, regbuf); =20 if (ret < 0) - perror_with_name (_("Unable to store WMMX registers.")); + perror_with_name (_("Unable to store WMMX registers")); } =20 static void @@ -356,7 +356,7 @@ fetch_vfp_regs (struct regcache *regcache) ret =3D ptrace (PTRACE_GETVFPREGS, tid, 0, regbuf); =20 if (ret < 0) - perror_with_name (_("Unable to fetch VFP registers.")); + perror_with_name (_("Unable to fetch VFP registers")); =20 aarch32_vfp_regcache_supply (regcache, regbuf, tdep->vfp_register_count); @@ -385,7 +385,7 @@ store_vfp_regs (const struct regcache *regcache) ret =3D ptrace (PTRACE_GETVFPREGS, tid, 0, regbuf); =20 if (ret < 0) - perror_with_name (_("Unable to fetch VFP registers (for update).")); + perror_with_name (_("Unable to fetch VFP registers (for update)")); =20 aarch32_vfp_regcache_collect (regcache, regbuf, tdep->vfp_register_count); @@ -402,7 +402,7 @@ store_vfp_regs (const struct regcache *regcache) ret =3D ptrace (PTRACE_SETVFPREGS, tid, 0, regbuf); =20 if (ret < 0) - perror_with_name (_("Unable to store VFP registers.")); + perror_with_name (_("Unable to store VFP registers")); } =20 /* Fetch registers from the child process. Fetch all registers if diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c index 281b034b115..32b289f3bbc 100644 --- a/gdb/fbsd-nat.c +++ b/gdb/fbsd-nat.c @@ -94,7 +94,7 @@ fbsd_nat_target::find_memory_regions (find_memory_region_= ftype func, gdb::unique_xmalloc_ptr vmentl (kinfo_getvmmap (pid, &nitems)); if (vmentl =3D=3D NULL) - perror_with_name (_("Couldn't fetch VM map entries.")); + perror_with_name (_("Couldn't fetch VM map entries")); =20 for (i =3D 0, kve =3D vmentl.get (); i < nitems; i++, kve++) { diff --git a/gdb/netbsd-nat.c b/gdb/netbsd-nat.c index 2ccd0e014c2..c45df391afc 100644 --- a/gdb/netbsd-nat.c +++ b/gdb/netbsd-nat.c @@ -221,7 +221,7 @@ nbsd_nat_target::find_memory_regions (find_memory_regio= n_ftype func, gdb::unique_xmalloc_ptr vmentl =3D nbsd_kinfo_get_vmmap (pid, &nitems); if (vmentl =3D=3D NULL) - perror_with_name (_("Couldn't fetch VM map entries.")); + perror_with_name (_("Couldn't fetch VM map entries")); =20 for (size_t i =3D 0; i < nitems; i++) { diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index 588dd7df9c0..f959bb0c1ad 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -1138,7 +1138,7 @@ fetch_all_gp_regs (struct regcache *regcache, int tid) have_ptrace_getsetregs =3D 0; return 0; } - perror_with_name (_("Couldn't get general-purpose registers.")); + perror_with_name (_("Couldn't get general-purpose registers")); } =20 supply_gregset (regcache, (const gdb_gregset_t *) &gregset); @@ -1190,7 +1190,7 @@ fetch_all_fp_regs (struct regcache *regcache, int tid) have_ptrace_getsetfpregs =3D 0; return 0; } - perror_with_name (_("Couldn't get floating-point registers.")); + perror_with_name (_("Couldn't get floating-point registers")); } =20 supply_fpregset (regcache, (const gdb_fpregset_t *) &fpregs); @@ -1690,7 +1690,7 @@ store_all_gp_regs (const struct regcache *regcache, i= nt tid, int regno) have_ptrace_getsetregs =3D 0; return 0; } - perror_with_name (_("Couldn't get general-purpose registers.")); + perror_with_name (_("Couldn't get general-purpose registers")); } =20 fill_gregset (regcache, &gregset, regno); @@ -1702,7 +1702,7 @@ store_all_gp_regs (const struct regcache *regcache, i= nt tid, int regno) have_ptrace_getsetregs =3D 0; return 0; } - perror_with_name (_("Couldn't set general-purpose registers.")); + perror_with_name (_("Couldn't set general-purpose registers")); } =20 return 1; @@ -1752,7 +1752,7 @@ store_all_fp_regs (const struct regcache *regcache, i= nt tid, int regno) have_ptrace_getsetfpregs =3D 0; return 0; } - perror_with_name (_("Couldn't get floating-point registers.")); + perror_with_name (_("Couldn't get floating-point registers")); } =20 fill_fpregset (regcache, &fpregs, regno); @@ -1764,7 +1764,7 @@ store_all_fp_regs (const struct regcache *regcache, i= nt tid, int regno) have_ptrace_getsetfpregs =3D 0; return 0; } - perror_with_name (_("Couldn't set floating-point registers.")); + perror_with_name (_("Couldn't set floating-point registers")); } =20 return 1; diff --git a/gdb/procfs.c b/gdb/procfs.c index d290505d8c3..ffb4d180290 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -2704,7 +2704,7 @@ procfs_set_exec_trap (void) =20 pi =3D create_procinfo (getpid (), 0); if (pi =3D=3D NULL) - perror_with_name (_("procfs: create_procinfo failed in child.")); + perror_with_name (_("procfs: create_procinfo failed in child")); =20 if (open_procinfo_files (pi, FD_CTL) =3D=3D 0) {