From c38ffbfc751eceb016da279cf7492dcc81a65585 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 7 Jun 2015 20:57:45 +0300 Subject: Add plugin command for dump unsupported node types. New plugin command: dumpunsupported --- src/command.h | 1 + src/parsers/generic.cpp | 18 +++++++++++++----- src/plugin.cpp | 4 ++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/src/command.h b/src/command.h index 2b1cf7a..0666464 100644 --- a/src/command.h +++ b/src/command.h @@ -25,6 +25,7 @@ enum Command : int Parse = 0, Dump, SmallDump, + DumpUnsupported, MemoryUsage }; diff --git a/src/parsers/generic.cpp b/src/parsers/generic.cpp index 5f53843..0e3f1ac 100644 --- a/src/parsers/generic.cpp +++ b/src/parsers/generic.cpp @@ -61,11 +61,19 @@ Node *createParseNode(Node *parent, break; #include "includes/nodeshandling.inc" default: - Log::log(parent, - 1, - "Not supported node type: %s - %s", - get_tree_code_name(TREE_CODE(gccNode)), - tag.c_str()); + if (command == Command::DumpUnsupported) + { + Log::error("Unsupported node type: %s", + get_tree_code_name(TREE_CODE(gccNode))); + } + else + { + Log::log(parent, + 1, + "Unsupported node type: %s - %s", + get_tree_code_name(TREE_CODE(gccNode)), + tag.c_str()); + } break; } if (node) diff --git a/src/plugin.cpp b/src/plugin.cpp index 19ed8b0..7499a54 100644 --- a/src/plugin.cpp +++ b/src/plugin.cpp @@ -69,6 +69,10 @@ int plugin_init (struct plugin_name_args *plugin_info, { command = Command::MemoryUsage; } + else if (cmd == "dumpunsupported") + { + command = Command::DumpUnsupported; + } else { error("Plugin %s. Unknown command: %s", -- cgit v1.2.3-70-g09d2