-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.cpp
More file actions
32 lines (24 loc) · 816 Bytes
/
debug.cpp
File metadata and controls
32 lines (24 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include <climits>
#include <iostream>
#include <vector>
using namespace std;
#include "debug.h"
debugflags::flagset_ debugflags::flags_ {};
void debugflags::setflags (const string& initflags) {
for (const unsigned char flag: initflags) {
if (flag == '@') flags_.set();
else flags_.set (flag, true);
}
}
// getflag -
// Check to see if a certain flag is on.
bool debugflags::getflag (char flag) {
// WARNING: Don't TRACE this function or the stack will blow up.
return flags_.test (static_cast<unsigned char> (flag));
}
void debugflags::where (char flag, const char* file, int line,
const char* pretty_function) {
cerr << "DEBUG(" << flag << ") "
<< file << "[" << line << "] " << endl
<< "... " << pretty_function << endl;
}