Hi Steve,

I'm not sure I understand what you are suggesting. I have merely moved the 
definition from the namespace into the RemoteGBD class, and done so for both 
ARM and X86. It is never used outside the class in any case.

Andreas

-----
On Apr 23, 2015 at 7:00 PM, Steve Reinhardt <[email protected]> wrote:


Thanks for tracking this down, Andreas.

As far as GDB_REG_BYTES, would it make more sense to tack M5_VAR_USED in
front of it rather than replicating the definition?  If that works, we
could even put it inside a gcc version-dependent ifdef to make it clear
that it's a bug workaround and not really needed.

Steve


On Thu, Apr 23, 2015 at 10:47 AM, Andreas Hansson <[email protected]>
wrote:

> changeset 1e8e6c141372 in /z/repo/gem5
> details: http://repo.gem5.org/gem5?cmd=changeset;node=1e8e6c141372
> description:
>         misc: Appease gcc 5.1
>
>         This patch fixes a few small issues to ensure gem5 compiles when
> using
>         gcc 5.1.
>
>         First, the GDB_REG_BYTES in the RemoteGDB header are, rather
>         surprisingly, flagged as unused for both ARM and X86. Removing
> them,
>         however, causes compilation errors as they are actually used in the
>         source file. Moving the constant into the class definition fixes
> the
>         issue. Possibly a gcc bug.
>
>         Second, we have an unused EthPktData constructor using auto_ptr,
> and
>         the latter is deprecated. Since the code is never used it is simply
>         removed.
>
> diffstat:
>
>  src/arch/arm/remote_gdb.hh |  6 +++---
>  src/arch/x86/remote_gdb.hh |  8 ++++----
>  src/dev/etherpkt.hh        |  4 ----
>  3 files changed, 7 insertions(+), 11 deletions(-)
>
> diffs (62 lines):
>
> diff -r 74e3c7359393 -r 1e8e6c141372 src/arch/arm/remote_gdb.hh
> --- a/src/arch/arm/remote_gdb.hh        Wed Apr 22 20:22:29 2015 -0700
> +++ b/src/arch/arm/remote_gdb.hh        Thu Apr 23 13:37:46 2015 -0400
> @@ -76,9 +76,6 @@
>      GDB64_NUMREGS = 98
>  };
>
> -const int GDB_REG_BYTES = std::max(GDB64_NUMREGS * sizeof(uint64_t),
> -                                   GDB32_NUMREGS * sizeof(uint32_t));
> -
>  class RemoteGDB : public BaseRemoteGDB
>  {
>    protected:
> @@ -89,6 +86,9 @@
>      void setregs();
>
>    public:
> +    const int GDB_REG_BYTES = std::max(GDB64_NUMREGS * sizeof(uint64_t),
> +                                       GDB32_NUMREGS * sizeof(uint32_t));
> +
>      RemoteGDB(System *_system, ThreadContext *tc);
>  };
>  } // namespace ArmISA
> diff -r 74e3c7359393 -r 1e8e6c141372 src/arch/x86/remote_gdb.hh
> --- a/src/arch/x86/remote_gdb.hh        Wed Apr 22 20:22:29 2015 -0700
> +++ b/src/arch/x86/remote_gdb.hh        Thu Apr 23 13:37:46 2015 -0400
> @@ -111,6 +111,10 @@
>          GDB64_NUMREGS = (GDB64_GS_32 + 1) / 2 + 1
>      };
>
> +    const int GDB_REG_BYTES =
> +        std::max(RemoteGDB::GDB32_NUMREGS * sizeof(uint32_t),
> +                 RemoteGDB::GDB64_NUMREGS * sizeof(uint64_t));
> +
>      RemoteGDB(System *system, ThreadContext *context);
>
>      bool acc(Addr addr, size_t len);
> @@ -122,10 +126,6 @@
>      bool checkBpLen(size_t len) { return len == 1; }
>  };
>
> -const int GDB_REG_BYTES =
> -    std::max(RemoteGDB::GDB32_NUMREGS * sizeof(uint32_t),
> -             RemoteGDB::GDB64_NUMREGS * sizeof(uint64_t));
> -
>  }
>
>  #endif // __ARCH_X86_REMOTEGDB_HH__
> diff -r 74e3c7359393 -r 1e8e6c141372 src/dev/etherpkt.hh
> --- a/src/dev/etherpkt.hh       Wed Apr 22 20:22:29 2015 -0700
> +++ b/src/dev/etherpkt.hh       Thu Apr 23 13:37:46 2015 -0400
> @@ -68,10 +68,6 @@
>          : data(new uint8_t[size]), length(0)
>      { }
>
> -    EthPacketData(std::auto_ptr<uint8_t> d, int l)
> -        : data(d.release()), length(l)
> -    { }
> -
>      ~EthPacketData() { if (data) delete [] data; }
>
>    public:
> _______________________________________________
> gem5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/gem5-dev
>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev


_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to