debug.hh revision 11164
110995Sandreas.sandberg@arm.com/* 210995Sandreas.sandberg@arm.com * Copyright (c) 2003-2005 The Regents of The University of Michigan 310995Sandreas.sandberg@arm.com * All rights reserved. 410995Sandreas.sandberg@arm.com * 510995Sandreas.sandberg@arm.com * Redistribution and use in source and binary forms, with or without 610995Sandreas.sandberg@arm.com * modification, are permitted provided that the following conditions are 710995Sandreas.sandberg@arm.com * met: redistributions of source code must retain the above copyright 810995Sandreas.sandberg@arm.com * notice, this list of conditions and the following disclaimer; 910995Sandreas.sandberg@arm.com * redistributions in binary form must reproduce the above copyright 1010995Sandreas.sandberg@arm.com * notice, this list of conditions and the following disclaimer in the 1110995Sandreas.sandberg@arm.com * documentation and/or other materials provided with the distribution; 1210995Sandreas.sandberg@arm.com * neither the name of the copyright holders nor the names of its 1310995Sandreas.sandberg@arm.com * contributors may be used to endorse or promote products derived from 1410995Sandreas.sandberg@arm.com * this software without specific prior written permission. 1510995Sandreas.sandberg@arm.com * 1610995Sandreas.sandberg@arm.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1710995Sandreas.sandberg@arm.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1810995Sandreas.sandberg@arm.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1910995Sandreas.sandberg@arm.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2010995Sandreas.sandberg@arm.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2110995Sandreas.sandberg@arm.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2210995Sandreas.sandberg@arm.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2310995Sandreas.sandberg@arm.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2410995Sandreas.sandberg@arm.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2510995Sandreas.sandberg@arm.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2610995Sandreas.sandberg@arm.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2710995Sandreas.sandberg@arm.com * 2810995Sandreas.sandberg@arm.com * Authors: Nathan Binkert 2910995Sandreas.sandberg@arm.com */ 3010995Sandreas.sandberg@arm.com 3110995Sandreas.sandberg@arm.com#ifndef __SIM_DEBUG_HH__ 3210995Sandreas.sandberg@arm.com#define __SIM_DEBUG_HH__ 3310995Sandreas.sandberg@arm.com 3410995Sandreas.sandberg@arm.com#include "base/types.hh" 3510995Sandreas.sandberg@arm.com 3610995Sandreas.sandberg@arm.com/** @file This file provides the definitions for some useful debugging 3710995Sandreas.sandberg@arm.com * functions. These are intended to be called from a debugger such as 3810995Sandreas.sandberg@arm.com * gdb. 3910995Sandreas.sandberg@arm.com */ 4010995Sandreas.sandberg@arm.com 4110995Sandreas.sandberg@arm.com 4210995Sandreas.sandberg@arm.com/** Cause the simulator to execute a breakpoint 4310995Sandreas.sandberg@arm.com * @param when the tick to break 4410995Sandreas.sandberg@arm.com */ 4510995Sandreas.sandberg@arm.comvoid schedBreak(Tick when); 4610995Sandreas.sandberg@arm.com 4710995Sandreas.sandberg@arm.com/** 4810995Sandreas.sandberg@arm.com * Cause the simulator to execute a breakpoint 4910995Sandreas.sandberg@arm.com * relative to the current tick. 5010995Sandreas.sandberg@arm.com * @param delta the number of ticks to execute until breaking 5110995Sandreas.sandberg@arm.com */ 5210995Sandreas.sandberg@arm.comvoid schedRelBreak(Tick delta); 5310995Sandreas.sandberg@arm.com 5410995Sandreas.sandberg@arm.com/** 5511168Sandreas.hansson@arm.com * Cause the simulator to execute a breakpoint when 5610995Sandreas.sandberg@arm.com * the given kernel function is reached 5710995Sandreas.sandberg@arm.com * @param funcName the name of the kernel function at which to break 5811168Sandreas.hansson@arm.com */ 5910995Sandreas.sandberg@arm.comvoid breakAtKernelFunction(const char* funcName); 6010995Sandreas.sandberg@arm.com 6110995Sandreas.sandberg@arm.com/** Cause the simulator to return to python to create a checkpoint 6210995Sandreas.sandberg@arm.com * @param when the cycle to break 6310995Sandreas.sandberg@arm.com */ 6410995Sandreas.sandberg@arm.comvoid takeCheckpoint(Tick when); 6510995Sandreas.sandberg@arm.com 6610995Sandreas.sandberg@arm.com/** Dump all the events currently on the event queue 6710995Sandreas.sandberg@arm.com */ 6810995Sandreas.sandberg@arm.comvoid eventqDump(); 6910995Sandreas.sandberg@arm.com 7010995Sandreas.sandberg@arm.comint getRemoteGDBPort(); 7110995Sandreas.sandberg@arm.com// Remote gdb base port. 0 disables remote gdb. 7210995Sandreas.sandberg@arm.comvoid setRemoteGDBPort(int port); 7310995Sandreas.sandberg@arm.com 7410995Sandreas.sandberg@arm.com#endif // __SIM_DEBUG_HH__ 7510995Sandreas.sandberg@arm.com