summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/analysis/analysis.cpp7
-rw-r--r--src/command.h3
-rw-r--r--src/plugin.cpp7
3 files changed, 15 insertions, 2 deletions
diff --git a/src/analysis/analysis.cpp b/src/analysis/analysis.cpp
index 18120b8..6e08867 100644
--- a/src/analysis/analysis.cpp
+++ b/src/analysis/analysis.cpp
@@ -79,6 +79,13 @@ WalkItem analyseNode(Node *node, WalkItem wi)
if (!node)
return wi;
+ if (command == Command::DumpNullPointers)
+ {
+ Log::log("%s %s\n",
+ node->nodeTypeName.c_str(),
+ node->label.c_str());
+ }
+
// searching function declaration
switch (node->nodeType)
{
diff --git a/src/command.h b/src/command.h
index 17a5586..177d301 100644
--- a/src/command.h
+++ b/src/command.h
@@ -28,7 +28,8 @@ enum Command : int
DumpUnsupported,
MemoryUsage,
FindArgs,
- DetectNullPointers
+ DetectNullPointers,
+ DumpNullPointers
};
extern Command command;
diff --git a/src/plugin.cpp b/src/plugin.cpp
index e52c030..71f195b 100644
--- a/src/plugin.cpp
+++ b/src/plugin.cpp
@@ -41,7 +41,8 @@ static void pre_generic(void *gcc_data,
{
Node *node = Generic::parseNodes((tree)gcc_data);
if (command == Command::FindArgs ||
- command == Command::DetectNullPointers)
+ command == Command::DetectNullPointers ||
+ command == Command::DumpNullPointers)
{
Analysis::startWalkTree(node);
}
@@ -87,6 +88,10 @@ int plugin_init (struct plugin_name_args *plugin_info,
{
command = Command::DetectNullPointers;
}
+ else if (cmd == "dumpnullpointers")
+ {
+ command = Command::DumpNullPointers;
+ }
else
{
error("Plugin %s. Unknown command: %s",