13536Sgblack@eecs.umich.edu/* 211274Sshingarov@labware.com * Copyright (c) 2015 LabWare 33536Sgblack@eecs.umich.edu * Copyright (c) 2002-2005 The Regents of The University of Michigan 43536Sgblack@eecs.umich.edu * All rights reserved. 53536Sgblack@eecs.umich.edu * 63536Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without 73536Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are 83536Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright 93536Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer; 103536Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright 113536Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the 123536Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution; 133536Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its 143536Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from 153536Sgblack@eecs.umich.edu * this software without specific prior written permission. 163536Sgblack@eecs.umich.edu * 173536Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 183536Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 193536Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 203536Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 213536Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 223536Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 233536Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 243536Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 253536Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 263536Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 273536Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 283536Sgblack@eecs.umich.edu * 293536Sgblack@eecs.umich.edu * Authors: Nathan Binkert 3011274Sshingarov@labware.com * Boris Shingarov 313536Sgblack@eecs.umich.edu */ 323536Sgblack@eecs.umich.edu 333536Sgblack@eecs.umich.edu#ifndef __ARCH_ALPHA_REMOTE_GDB_HH__ 343536Sgblack@eecs.umich.edu#define __ARCH_ALPHA_REMOTE_GDB_HH__ 353536Sgblack@eecs.umich.edu 363536Sgblack@eecs.umich.edu#include <map> 373536Sgblack@eecs.umich.edu 383536Sgblack@eecs.umich.edu#include "arch/alpha/types.hh" 398229Snate@binkert.org#include "base/pollevent.hh" 403536Sgblack@eecs.umich.edu#include "base/remote_gdb.hh" 418229Snate@binkert.org#include "base/socket.hh" 423536Sgblack@eecs.umich.edu#include "cpu/pc_event.hh" 433536Sgblack@eecs.umich.edu 443536Sgblack@eecs.umich.educlass System; 453536Sgblack@eecs.umich.educlass ThreadContext; 463536Sgblack@eecs.umich.edu 475569Snate@binkert.orgnamespace AlphaISA { 485569Snate@binkert.org 495569Snate@binkert.orgclass RemoteGDB : public BaseRemoteGDB 503536Sgblack@eecs.umich.edu{ 515569Snate@binkert.org protected: 525569Snate@binkert.org // Machine memory 5312173Sandreas.sandberg@arm.com bool acc(Addr addr, size_t len) override; 548700Ssteve.reinhardt@amd.com 5511274Sshingarov@labware.com class AlphaGdbRegCache : public BaseGdbRegCache 5611274Sshingarov@labware.com { 5711274Sshingarov@labware.com using BaseGdbRegCache::BaseGdbRegCache; 5811274Sshingarov@labware.com private: 5911274Sshingarov@labware.com struct { 6011274Sshingarov@labware.com uint64_t gpr[32]; 6111274Sshingarov@labware.com uint64_t fpr[32]; 6211274Sshingarov@labware.com uint64_t pc; 6311274Sshingarov@labware.com uint64_t vfp; 6411274Sshingarov@labware.com } r; 6511274Sshingarov@labware.com public: 6611274Sshingarov@labware.com char *data() const { return (char *)&r; } 6711274Sshingarov@labware.com size_t size() const { return sizeof(r); } 6811274Sshingarov@labware.com void getRegs(ThreadContext*); 6911274Sshingarov@labware.com void setRegs(ThreadContext*) const; 7012449Sgabeblack@google.com const std::string 7112449Sgabeblack@google.com name() const 7212449Sgabeblack@google.com { 7312449Sgabeblack@google.com return gdb->name() + ".AlphaGdbRegCache"; 7412449Sgabeblack@google.com } 7511274Sshingarov@labware.com }; 7611274Sshingarov@labware.com 775569Snate@binkert.org public: 7812449Sgabeblack@google.com RemoteGDB(System *system, ThreadContext *context, int _port); 7912173Sandreas.sandberg@arm.com BaseGdbRegCache *gdbRegs() override; 805569Snate@binkert.org}; 813536Sgblack@eecs.umich.edu 825569Snate@binkert.org} // namespace AlphaISA 833536Sgblack@eecs.umich.edu 845569Snate@binkert.org#endif // __ARCH_ALPHA_REMOTE_GDB_HH__ 85