debug.ccGo to the documentation of this file.00001
00002
00003 #include <stream.h>
00004
00005 #include "Listable.h"
00006 #include "debug.h"
00007 #include "BinRep.h"
00008
00009 int
00010 dbx_warn_overflow = 1,
00011 dbx_warn_use_def_size_for_Type = 0,
00012 dbx_symtab_debug_level = 0,
00013 dbx_equivalence_debug_level = 0,
00014 dbx_common_block_debug_level = 0,
00015 dbx_namelist_debug_level = 0,
00016 dbx_format_debug_level = 0,
00017 dbx_program_debug_level = 0,
00018 dbx_wildcards_debug_level = 0,
00019 dbx_full_parenthesization = 0,
00020 dbx_statement_cloning_debug_level = 0
00021 ;
00022
00023 void
00024 warn_overflow_map(const char *class_name, const BinRep &binstr)
00025 {
00026 if (dbx_warn_overflow) {
00027 cerr << "Note: " << class_name
00028 << ": Adding field to overflow: "
00029 << binstr << endl;
00030 }
00031 }
00032
00033 int
00034 print(const void *l)
00035 {
00036 static int marker = 0;
00037
00038 if (l == 0) {
00039 cout << "ERROR: NULL reference.\n";
00040 return 0;
00041 }
00042 else if (((unsigned int) l < (unsigned int) &marker)) {
00043 cout << "ERROR: Reference to the TEXT SEGMENT.\n";
00044 return 0;
00045 }
00046 else {
00047 Listable &listable = *(Listable *)l;
00048
00049 if (listable.fingerprint_ok())
00050 cout << listable << endl;
00051 else {
00052 cout << "ERROR: " << hex<<(int) l<<dec
00053 << " is not an allocated Listable object." << endl;
00054 return 0;
00055 }
00056 }
00057
00058 return 1;
00059 }
00060
|