mem.cc revision 6307
16253Sgblack@eecs.umich.edu/* Copyright (c) 2007-2008 The Florida State University 26253Sgblack@eecs.umich.edu * All rights reserved. 36253Sgblack@eecs.umich.edu * 46253Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without 56253Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are 66253Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright 76253Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer; 86253Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright 96253Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the 106253Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution; 116253Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its 126253Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from 136253Sgblack@eecs.umich.edu * this software without specific prior written permission. 146253Sgblack@eecs.umich.edu * 156253Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 166253Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 176253Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 186253Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 196253Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 206253Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 216253Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 226253Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 236253Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 246253Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 256253Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 266253Sgblack@eecs.umich.edu * 276253Sgblack@eecs.umich.edu * Authors: Stephen Hines 286253Sgblack@eecs.umich.edu */ 296253Sgblack@eecs.umich.edu 306253Sgblack@eecs.umich.edu#include "arch/arm/insts/mem.hh" 316253Sgblack@eecs.umich.edu#include "base/loader/symtab.hh" 326253Sgblack@eecs.umich.edu 336253Sgblack@eecs.umich.edunamespace ArmISA 346253Sgblack@eecs.umich.edu{ 356253Sgblack@eecs.umich.edustd::string 366253Sgblack@eecs.umich.eduMemory::generateDisassembly(Addr pc, const SymbolTable *symtab) const 376253Sgblack@eecs.umich.edu{ 386262Sgblack@eecs.umich.edu std::stringstream ss; 396262Sgblack@eecs.umich.edu printMnemonic(ss); 406307Sgblack@eecs.umich.edu printReg(ss, machInst.rd); 416307Sgblack@eecs.umich.edu ss << ", ["; 426307Sgblack@eecs.umich.edu printReg(ss, machInst.rn); 436307Sgblack@eecs.umich.edu ss << ", "; 446307Sgblack@eecs.umich.edu if (machInst.puswl.prepost == 1) 456307Sgblack@eecs.umich.edu printOffset(ss); 466307Sgblack@eecs.umich.edu ss << "]"; 476307Sgblack@eecs.umich.edu if (machInst.puswl.prepost == 0) 486307Sgblack@eecs.umich.edu printOffset(ss); 496307Sgblack@eecs.umich.edu else if (machInst.puswl.writeback) 506307Sgblack@eecs.umich.edu ss << "!"; 516262Sgblack@eecs.umich.edu return ss.str(); 526253Sgblack@eecs.umich.edu} 536253Sgblack@eecs.umich.edu} 54