From 99f5d2833eb6c011f5bff977dd0d13194a497a6f Mon Sep 17 00:00:00 2001 From: Michael Lenz Date: Tue, 7 Oct 2014 12:18:22 +0200 Subject: [PATCH] ElfImporter: removed --debug, refactored code This change removes the "--debug" parameter, which previously imported the mapping of source code lines to static instructions into the database. This mapping is useless by itself (i.e. without "--sources"), which is why its code was refactored into the code handling "--sources". Change-Id: I4700eb0a98661f4df9eb3c190f00dcbe4df0e200 --- tools/import-trace/ElfImporter.cc | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/tools/import-trace/ElfImporter.cc b/tools/import-trace/ElfImporter.cc index ead360ac..84c89435 100644 --- a/tools/import-trace/ElfImporter.cc +++ b/tools/import-trace/ElfImporter.cc @@ -27,9 +27,7 @@ bool ElfImporter::cb_commandline_init() { OBJDUMP = cmd.addOption("", "objdump", Arg::Required, "--objdump \tObjdump: location of objdump binary, otherwise LLVM Disassembler is used"); SOURCECODE = cmd.addOption("", "sources", Arg::None, - "--sources \timport all source files into the database"); - DEBUGINFO = cmd.addOption("", "debug", Arg::None, - "--debug \timport some debug informations into the database"); + "--sources \timport all source files and the mapping of code line<->static instruction into the database"); return true; } @@ -73,9 +71,7 @@ bool ElfImporter::create_database() { if (!db->query(create_statement.str().c_str())) { return false; } - } - if (cmd[DEBUGINFO]) { create_statement.str(""); create_statement << "CREATE TABLE IF NOT EXISTS dbg_mapping (" " variant_id int(11) NOT NULL," @@ -125,9 +121,8 @@ bool ElfImporter::copy_to_database(ProtoIStream &ps) { return false; } } - } - if (cmd[DEBUGINFO]) { // import debug informations + // import debug information if(!import_mapping(m_elf->getFilename())) { return false; } @@ -410,10 +405,8 @@ bool ElfImporter::clear_database() { ret = db->query(ss.str().c_str()) == 0 ? false : true; } LOG << "deleted " << db->affected_rows() << " rows from dbg_source table" << std::endl; - } - //ToDo: Reset auto increment value to 1 - if (cmd[DEBUGINFO]) { + //ToDo: Reset auto increment value to 1 ss.str(""); ss << "DELETE FROM dbg_mapping WHERE variant_id = " << m_variant_id;