From e636924d0fc6e0a687b866d8bb44e4de6e417ea9 Mon Sep 17 00:00:00 2001 From: Horst Schirmeier Date: Mon, 14 Oct 2013 14:42:40 +0200 Subject: [PATCH] import-trace: reparse parameters after importer instantiation Without this change, import-trace won't recognize, e.g., the -e and -t parameters if they come after a parameter that was added by the Importer: import-trace -i objdump --objdump arm-none-eabi-objdump -e B.elf -t C.tc [...] [import-trace 14:37:32] couldn't open trace.pb Change-Id: I9532b01e432055479c79d801b1ca2736a8fd21cc --- tools/import-trace/main.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/import-trace/main.cc b/tools/import-trace/main.cc index 299a81ae..7290636e 100644 --- a/tools/import-trace/main.cc +++ b/tools/import-trace/main.cc @@ -156,12 +156,11 @@ int main(int argc, char *argv[]) { std::cerr << "Cannot call importers command line initialization!" << std::endl; exit(-1); } + // Since the importer might have added command line options, we need to + // reparse all arguments. + cmd.parse(); if (cmd[HELP]) { - // Since the importer might have added command line options, - // we need to reparse all arguments in order to prevent a - // segfault within optionparser - cmd.parse(); cmd.printUsage(); exit(0); }