Move arm_apcs_32 extern declaration to header
Commit Message
Instead of having several extern declarations for arm_apcs_32
in a few .c files, declare it in arm-tdep.h. This file is already
included from these .c files.
gdb/ChangeLog:
2019-09-19 Christian Biesinger <cbiesinger@google.com>
* arm-linux-nat.c: Remove extern declaration for arm_apcs_32.
* arm-linux-tdep.c: Likewise.
* arm-nbsd-nat.c: Likewise.
* arm-tdep.h: Declare arm_apcs_32.
---
gdb/arm-linux-nat.c | 2 --
gdb/arm-linux-tdep.c | 1 -
gdb/arm-nbsd-nat.c | 2 --
gdb/arm-tdep.h | 2 ++
4 files changed, 2 insertions(+), 5 deletions(-)
Comments
On 2019-09-19 12:35 a.m., Christian Biesinger via gdb-patches wrote:
> Instead of having several extern declarations for arm_apcs_32
> in a few .c files, declare it in arm-tdep.h. This file is already
> included from these .c files.
LGTM. If you want, you can also move the documentation of the variable
to the .h and use /* See arm-tdep.h. */ in the .c.
Simon
On Thu, Sep 19, 2019 at 8:04 PM Simon Marchi <simark@simark.ca> wrote:
>
> On 2019-09-19 12:35 a.m., Christian Biesinger via gdb-patches wrote:
> > Instead of having several extern declarations for arm_apcs_32
> > in a few .c files, declare it in arm-tdep.h. This file is already
> > included from these .c files.
>
> LGTM. If you want, you can also move the documentation of the variable
> to the .h and use /* See arm-tdep.h. */ in the .c.
Thanks, made that change and pushed.
To ssh://sourceware.org/git/binutils-gdb.git
e86f08d28f4..c7ae7675cf7 HEAD -> master
Christian
@@ -66,8 +66,6 @@
#define PTRACE_SETHBPREGS 30
#endif
-extern bool arm_apcs_32;
-
class arm_linux_nat_target final : public linux_nat_target
{
public:
@@ -56,7 +56,6 @@
#include "user-regs.h"
#include <ctype.h>
#include "elf/common.h"
-extern bool arm_apcs_32;
/* Under ARM GNU/Linux the traditional way of performing a breakpoint
is to execute a particular software interrupt, rather than use a
@@ -40,8 +40,6 @@ public:
static arm_netbsd_nat_target the_arm_netbsd_nat_target;
-extern bool arm_apcs_32;
-
static void
arm_supply_gregset (struct regcache *regcache, struct reg *gregset)
{
@@ -26,6 +26,8 @@ struct get_next_pcs;
struct arm_get_next_pcs;
struct gdb_get_next_pcs;
+extern bool arm_apcs_32;
+
#include "gdbarch.h"
#include "arch/arm.h"
#include "infrun.h"