1// vi:set ft=cpp: -*- Mode: C++ -*- 2/** 3 * \file 4 * \brief Debug interface 5 */ 6/* 7 * (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>, 8 * Alexander Warg <warg@os.inf.tu-dresden.de> 9 * economic rights: Technische Universität Dresden (Germany) 10 * 11 * This file is part of TUD:OS and distributed under the terms of the 12 * GNU General Public License 2. 13 * Please see the COPYING-GPL-2 file for details. 14 * 15 * As a special exception, you may use this file as part of a free software 16 * library without restriction. Specifically, if other files instantiate 17 * templates or use macros or inline functions from this file, or you compile 18 * this file and link it with other files to produce an executable, this 19 * file does not by itself cause the resulting executable to be covered by 20 * the GNU General Public License. This exception does not however 21 * invalidate any other reasons why the executable file might be covered by 22 * the GNU General Public License. 23 */ 24#pragma once 25 26#include <l4/sys/capability> 27#include <l4/re/protocols.h> 28#include <l4/sys/cxx/ipc_iface> 29 30namespace L4Re { 31/** 32 * \defgroup api_l4re_debug Debugging API 33 * \ingroup api_l4re 34 * \brief Debugging Interface 35 * 36 * The debugging interface can be provided to retrieve, or log debugging 37 * information for an object. 38 * Each class may realize the debug interface to provide debugging 39 * functionality. For example, the region map objects provide a facility to 40 * dump the currently established memory regions. 41 * 42 * \see L4::Debug_obj for more information. 43 */ 44 45/** 46 * \brief Debug interface. 47 * \ingroup api_l4re_debug 48 * 49 * \see \link api_l4re_debug Debugging API \endlink. 50 */ 51class L4_EXPORT Debug_obj : 52 public L4::Kobject_t<Debug_obj, L4::Kobject, L4RE_PROTO_DEBUG> 53{ 54public: 55 56 /** 57 * \brief Debug call. 58 * 59 * \param function Function to call. 60 * \return - L4_EOK 61 * - IPC errors 62 * 63 * An object can provide a number of debug functions, each identified by some 64 * integer. This method is used to fan out to these functions from a common 65 * entry point. 66 */ 67 L4_INLINE_RPC(long, debug, (unsigned long function)); 68 typedef L4::Typeid::Rpc_nocode<debug_t> Rpcs; 69}; 70 71template<typename BASE> 72class Debug_obj_t : 73 public L4::Kobject_2t<Debug_obj_t<BASE>, BASE, Debug_obj, L4::PROTO_EMPTY> 74{ 75 typedef L4::Typeid::Rpcs<> Rpcs; 76}; 77} 78