util/DwarfReader, ElfImporter: use unsigned addresses

This change alters DwarfReader and import-trace's ElfImporter so that they use
unsigned int for static address and line numbers instead of signed int.

Change-Id: I84ebbb500afd7cd4d93b137a35dcf736dc679fab
This commit is contained in:
Michael Lenz
2014-10-15 17:11:06 +02:00
parent 8fcbc7eeae
commit d94b005be2
3 changed files with 6 additions and 6 deletions

View File

@ -234,7 +234,7 @@ bool DwarfReader::read_mapping(std::string fileName, std::list<addrToLine>& addr
}
if (lineNo&&isCode) {
struct addrToLine newLine = { (int) addr, (int) lineNo, normalize(lineSource) };
struct addrToLine newLine = { addr, lineNo, normalize(lineSource) };
addrToLineList.push_back(newLine);
}

View File

@ -16,8 +16,8 @@ namespace fail {
*/
struct addrToLine {
int absoluteAddr;
int lineNumber;
unsigned absoluteAddr;
unsigned lineNumber;
std::string lineSource;
};

View File

@ -40,7 +40,7 @@ bool ElfImporter::create_database()
create_statement.str("");
create_statement << "CREATE TABLE IF NOT EXISTS objdump ("
" variant_id int(11) NOT NULL,"
" instr_address int(11) NOT NULL,"
" instr_address int(11) UNSIGNED NOT NULL,"
" opcode varchar(32) NOT NULL,"
" disassemble VARCHAR(64),"
" comment VARCHAR(128),"
@ -77,8 +77,8 @@ bool ElfImporter::create_database()
create_statement.str("");
create_statement << "CREATE TABLE IF NOT EXISTS dbg_mapping ("
" variant_id int(11) NOT NULL,"
" instr_absolute int(11) NOT NULL,"
" linenumber int(11) NOT NULL,"
" instr_absolute int(11) UNSIGNED NOT NULL,"
" linenumber int(11) UNSIGNED NOT NULL,"
" file_id int(11) NOT NULL,"
" PRIMARY KEY (variant_id, instr_absolute ,linenumber)"
") engine=MyISAM ";