Print this page
12166 resync smatch to 0.6.1-rc1-il-3

@@ -13,10 +13,12 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, see http://www.gnu.org/copyleft/gpl.txt
  */
 
+#include <string.h>
+
 #include "smatch.h"
 #include "smatch_slist.h"
 #include "smatch_extra.h"
 
 void show_sname_alloc(void);

@@ -84,11 +86,11 @@
                 sm_error("the check_name argument to %s is supposed to be a string literal", fn);
                 return;
         }
 
         FOR_EACH_SM(__get_cur_stree(), sm) {
-                if (strcmp(check_name(sm->owner), check_arg->string->data) != 0)
+                if (!strstr(check_name(sm->owner), check_arg->string->data))
                         continue;
                 sm_msg("%s", show_sm(sm));
                 found = 1;
         } END_FOR_EACH_SM(sm);
 

@@ -512,10 +514,20 @@
 static void match_local_debug_off(const char *fn, struct expression *expr, void *info)
 {
         local_debug = 0;
 }
 
+static void match_debug_db_on(const char *fn, struct expression *expr, void *info)
+{
+        debug_db = 1;
+}
+
+static void match_debug_db_off(const char *fn, struct expression *expr, void *info)
+{
+        debug_db = 0;
+}
+
 static void match_about(const char *fn, struct expression *expr, void *info)
 {
         struct expression *arg;
         struct sm_state *sm;
         char *name;

@@ -771,10 +783,12 @@
         add_function_hook("__smatch_debug_on", &match_debug_on, NULL);
         add_function_hook("__smatch_debug_check", &match_debug_check, NULL);
         add_function_hook("__smatch_debug_off", &match_debug_off, NULL);
         add_function_hook("__smatch_local_debug_on", &match_local_debug_on, NULL);
         add_function_hook("__smatch_local_debug_off", &match_local_debug_off, NULL);
+        add_function_hook("__smatch_debug_db_on", &match_debug_db_on, NULL);
+        add_function_hook("__smatch_debug_db_off", &match_debug_db_off, NULL);
         add_function_hook("__smatch_intersection", &match_intersection, NULL);
         add_function_hook("__smatch_type", &match_type, NULL);
         add_implied_return_hook("__smatch_type_rl_helper", &match_type_rl_return, NULL);
         add_function_hook("__smatch_merge_tree", &match_print_merge_tree, NULL);
         add_function_hook("__smatch_stree_id", &match_print_stree_id, NULL);