00001 /* 00002 * See the dyninst/COPYRIGHT file for copyright information. 00003 * 00004 * We provide the Paradyn Tools (below described as "Paradyn") 00005 * on an AS IS basis, and do not warrant its validity or performance. 00006 * We reserve the right to update, modify, or discontinue this 00007 * software at any time. We shall have no obligation to supply such 00008 * updates or modifications or any other form of support to you. 00009 * 00010 * By your use of Paradyn, you understand and agree that we (or any 00011 * other person or entity with proprietary rights in Paradyn) are 00012 * under no obligation to provide either maintenance services, 00013 * update services, notices of latent defects, or correction of 00014 * defects for Paradyn. 00015 * 00016 * This library is free software; you can redistribute it and/or 00017 * modify it under the terms of the GNU Lesser General Public 00018 * License as published by the Free Software Foundation; either 00019 * version 2.1 of the License, or (at your option) any later version. 00020 * 00021 * This library is distributed in the hope that it will be useful, 00022 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00024 * Lesser General Public License for more details. 00025 * 00026 * You should have received a copy of the GNU Lesser General Public 00027 * License along with this library; if not, write to the Free Software 00028 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00029 */ 00030 00031 #ifndef COMMON_DEBUG_H 00032 #define COMMON_DEBUG_H 00033 00034 #include <string> 00035 00036 extern int common_debug_dwarf; 00037 extern int common_debug_addrtranslate; 00038 00039 #if defined(__GNUC__) 00040 #define dwarf_printf(format, ...) \ 00041 do { \ 00042 dwarf_printf_int("[%s:%u] " format, __FILE__, __LINE__, ## __VA_ARGS__); \ 00043 } while (0) 00044 #else 00045 #define dwarf_printf dwarf_printf_int 00046 #endif 00047 00048 int dwarf_printf_int(const char *format, ...); 00049 00050 #if defined(__GNUC__) 00051 #define translate_printf(format, ...) \ 00052 do { \ 00053 translate_printf_int("[%s:%u] " format, __FILE__, __LINE__, ## __VA_ARGS__); \ 00054 } while (0) 00055 #else 00056 #define translate_printf translate_printf_int 00057 #endif 00058 00059 int translate_printf_int(const char *format, ...); 00060 00061 // And initialization 00062 bool init_debug_common(); 00063 00064 #endif /* COMMON_DEBUG_H */
1.6.1