cpn/database: include data_width in the fsppilot during prune step

During the prune step the data_width of the injected location was not
propagated before. It is now stored in fsppilot (database layout change!) and
sent in the fsppilot protobuf message.

Change-Id: I0562f6fc8957adea0f8a9fb63469ca5e3f4b7b2d
This commit is contained in:
Christian Dietrich
2013-09-10 14:54:33 +02:00
parent 60bf0bae69
commit d26fc28fa4
5 changed files with 16 additions and 10 deletions

View File

@ -15,9 +15,9 @@ bool BasicPruner::prune_all() {
std::string injection_instr = this->use_instr1 ? "instr1" : "instr2";
std::string injection_instr_absolute = this->use_instr1 ? "instr1_absolute" : "instr2_absolute";
ss << "INSERT INTO fsppilot (known_outcome, variant_id, instr2, injection_instr, injection_instr_absolute, data_address, fspmethod_id) "
ss << "INSERT INTO fsppilot (known_outcome, variant_id, instr2, injection_instr, injection_instr_absolute, data_address, data_width, fspmethod_id) "
"SELECT 0, variant_id, instr2, " << injection_instr << ", " << injection_instr_absolute << ", "
" data_address, " << m_method_id << " "
" data_address, width, " << m_method_id << " "
"FROM trace "
"WHERE variant_id IN (" << m_variant_id_query << ") AND accesstype = 'R'";
if (!db->query(ss.str().c_str())) return false;
@ -30,9 +30,9 @@ bool BasicPruner::prune_all() {
MYSQL_ROW row;
while ((row = mysql_fetch_row(res))) {
// single entry for known outcome (write access)
ss << "INSERT INTO fsppilot (known_outcome, variant_id, instr2, injection_instr, injection_instr_absolute, data_address, fspmethod_id) "
ss << "INSERT INTO fsppilot (known_outcome, variant_id, instr2, injection_instr, injection_instr_absolute, data_address, data_width, fspmethod_id) "
"SELECT 1, variant_id, instr2, " << injection_instr << ", " << injection_instr_absolute << ", "
" data_address, " << m_method_id << " "
" data_address, width, " << m_method_id << " "
"FROM trace "
"WHERE variant_id = " << row[0] << " AND accesstype = 'W' "
"LIMIT 1";

View File

@ -57,6 +57,7 @@ bool Pruner::create_database() {
" injection_instr int(10) unsigned NOT NULL,"
" injection_instr_absolute int(10) unsigned,"
" data_address int(10) unsigned NOT NULL,"
" data_width int(10) unsigned NOT NULL,"
" fspmethod_id int(11) NOT NULL,"
" PRIMARY KEY (id),"
" KEY fspmethod_id (fspmethod_id,variant_id,data_address,instr2)"