Revision: 1984
Author:
chrsc...@googlemail.com
Date: Fri Jun 21 06:02:41 2013
Log: The "list functions" command now supports to filter for module
names.
http://code.google.com/p/insight-vmi/source/detail?r=1984
Modified:
/trunk/insightd/shell.cpp
/trunk/insightd/shell.h
=======================================
--- /trunk/insightd/shell.cpp Wed Jun 19 06:57:11 2013
+++ /trunk/insightd/shell.cpp Fri Jun 21 06:02:41 2013
@@ -1005,10 +1005,12 @@
return cmdListSources(args);
}
else if (QString("functions").startsWith(s)) {
- return cmdListTypes(args, rtFunction);
+ FunctionFilter filter;
+ return cmdListTypes(args, filter, rtFunction);
}
else if (s.length() <= 5 && QString("types").startsWith(s)) {
- return cmdListTypes(args, ~rtFunction);
+ TypeFilter filter;
+ return cmdListTypes(args, filter, ~rtFunction);
}
else if (s.length() >= 7 && QString("types-using").startsWith(s)) {
return cmdListTypesUsing(args);
@@ -1083,12 +1085,15 @@
}
-int Shell::cmdListTypes(QStringList args, int typeFilter)
+int Shell::cmdListTypes(QStringList args, TypeFilter& filter, int
typeFilter)
{
- if (!args.isEmpty() && args.first() == "help")
- return printFilterHelp(TypeFilter::supportedFilters());
+ if (!args.isEmpty() && args.first() == "help") {
+ return printFilterHelp(
+ dynamic_cast<FunctionFilter*>(&filter)
+ ? FunctionFilter::supportedFilters()
+ : TypeFilter::supportedFilters());
+ }
- TypeFilter filter;
try {
filter.parseOptions(args);
if (filter.filterActive(Filter::ftRealType))
@@ -3097,7 +3102,6 @@
{
Detect d(_sym);
QString type;
- int index = 0;
if (args.size() < 1)
return cmdHelp(QStringList("memory"));
@@ -3107,11 +3111,7 @@
args.pop_front();
// Did the user provie an index?
- if (args.size() >= 1)
- {
- index = parseMemDumpIndex(args);
- }
-
+ int index = parseMemDumpIndex(args);
if (index < 0)
return index;
=======================================
--- /trunk/insightd/shell.h Wed Jun 19 06:57:11 2013
+++ /trunk/insightd/shell.h Fri Jun 21 06:02:41 2013
@@ -238,7 +238,7 @@
int cmdList(QStringList args);
int cmdListSources(QStringList args);
- int cmdListTypes(QStringList args, int typeFilter = -1);
+ int cmdListTypes(QStringList args, TypeFilter &filter, int typeFilter
= -1);
int cmdListVars(QStringList args);
int cmdListVarsUsing(QStringList args);
int cmdListTypesUsing(QStringList args);