Merge commit 'dcd2c021a5ac91d38187d397914e5f51e2fc8819'
Conflicts: tools/import-trace/RegisterImporter.cc Change-Id: I4f49c976bd60badba73c15746aa03c420cb9f77b
This commit is contained in:
@ -8,7 +8,15 @@ static fail::Logger LOG("Database", true);
|
||||
|
||||
using namespace fail;
|
||||
|
||||
#ifndef __puma
|
||||
boost::mutex Database::m_global_lock;
|
||||
#endif
|
||||
|
||||
Database::Database(const std::string &username, const std::string &host, const std::string &database) {
|
||||
#ifndef __puma
|
||||
boost::lock_guard<boost::mutex> guard(m_global_lock);
|
||||
#endif
|
||||
|
||||
handle = mysql_init(0);
|
||||
last_result = 0;
|
||||
mysql_options(handle, MYSQL_READ_DEFAULT_FILE, "~/.my.cnf");
|
||||
@ -26,6 +34,9 @@ Database::~Database()
|
||||
// flush cached INSERTs if available
|
||||
insert_multiple();
|
||||
|
||||
#ifndef __puma
|
||||
boost::lock_guard<boost::mutex> guard(m_global_lock);
|
||||
#endif
|
||||
mysql_close(handle);
|
||||
}
|
||||
|
||||
@ -217,7 +228,7 @@ void Database::cmdline_setup() {
|
||||
HOSTNAME = cmd.addOption("H", "hostname", Arg::Required,
|
||||
"-h/--hostname \tMYSQL Hostname (default: taken from ~/.my.cnf)");
|
||||
USERNAME = cmd.addOption("u", "username", Arg::Required,
|
||||
"-u/--username \tMYSQL Username (default: taken from ~/.my.cnf, or your current user)");
|
||||
"-u/--username \tMYSQL Username (default: taken from ~/.my.cnf, or your current user)\n");
|
||||
}
|
||||
|
||||
Database * Database::cmdline_connect() {
|
||||
|
||||
@ -23,6 +23,7 @@ namespace fail {
|
||||
MYSQL_RES *last_result; // !< Used for mysql_result_free
|
||||
#ifndef __puma
|
||||
boost::mutex m_handle_lock;
|
||||
static boost::mutex m_global_lock;
|
||||
#endif
|
||||
std::string m_insertquery;
|
||||
std::vector<std::string> m_insertquery_values;
|
||||
|
||||
@ -105,6 +105,7 @@ void LLVMDisassembler::disassemble()
|
||||
instr_info.opcode = Inst.getOpcode();
|
||||
instr_info.length = Size;
|
||||
instr_info.address = SectionAddr + Index;
|
||||
instr_info.conditional_branch = desc.isConditionalBranch();
|
||||
|
||||
unsigned int pos = 0;
|
||||
for (MCInst::iterator it = Inst.begin(); it != Inst.end(); ++it) {
|
||||
|
||||
@ -42,6 +42,7 @@ public:
|
||||
unsigned int opcode;
|
||||
unsigned int address;
|
||||
unsigned char length;
|
||||
bool conditional_branch;
|
||||
std::vector<register_t> reg_uses;
|
||||
std::vector<register_t> reg_defs;
|
||||
};
|
||||
|
||||
@ -62,6 +62,10 @@ int main(int argc, char* argv[]) {
|
||||
it != instr.reg_defs.end(); ++it) {
|
||||
std::cout << reg_info.getName(*it) << "(" << *it << ") ";
|
||||
}
|
||||
|
||||
if (instr.conditional_branch) {
|
||||
std::cout << "(conditional branch)";
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user