degate  0.1.2
debug.cc
Go to the documentation of this file.
00001 /*
00002 
00003  This file is part of the IC reverse engineering tool degate.
00004 
00005  Copyright 2008, 2009, 2010 by Martin Schobert
00006 
00007  Degate is free software: you can redistribute it and/or modify
00008  it under the terms of the GNU General Public License as published by
00009  the Free Software Foundation, either version 3 of the License, or
00010  any later version.
00011 
00012  Degate is distributed in the hope that it will be useful,
00013  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  GNU General Public License for more details.
00016 
00017  You should have received a copy of the GNU General Public License
00018  along with degate. If not, see <http://www.gnu.org/licenses/>.
00019 
00020 */
00021 
00022 #include "globals.h"
00023 
00024 #include <stdio.h>
00025 #include <stdarg.h>
00026 
00027 using namespace degate;
00028 
00029 #ifdef DEBUG
00030 void debug(const char * const module, int line, const char * const format, ...) {
00031 
00032   va_list args;
00033   printf("[%s:%d] ", module, line);
00034 
00035   va_start(args, format);
00036   vfprintf(stdout, format, args);
00037   va_end(args);
00038   puts("");
00039 
00040 }
00041 
00042 #endif
00043 
00044 
00045 std::string degate::gen_tabs(int n) {
00046   std::string ret;
00047   for(int i = 0; i < n; i++)
00048     ret += "\t";
00049   return ret;
00050 }