Print this page
new smatch

Split Close
Expand all
Collapse all
          --- old/usr/src/tools/smatch/src/check_debug.c
          +++ new/usr/src/tools/smatch/src/check_debug.c
↓ open down ↓ 14 lines elided ↑ open up ↑
  15   15   * along with this program; if not, see http://www.gnu.org/copyleft/gpl.txt
  16   16   */
  17   17  
  18   18  #include "smatch.h"
  19   19  #include "smatch_slist.h"
  20   20  #include "smatch_extra.h"
  21   21  
  22   22  void show_sname_alloc(void);
  23   23  void show_data_range_alloc(void);
  24   24  void show_ptrlist_alloc(void);
       25 +void show_rl_ptrlist_alloc(void);
  25   26  void show_sm_state_alloc(void);
  26   27  
  27   28  int local_debug;
  28   29  static int my_id;
  29   30  char *trace_variable;
  30   31  
  31   32  static void match_all_values(const char *fn, struct expression *expr, void *info)
  32   33  {
  33   34          struct stree *stree;
  34   35  
↓ open down ↓ 162 lines elided ↑ open up ↑
 197  198          else
 198  199                  sm_msg("implied max: %s = <unknown>", name);
 199  200  
 200  201          free_string(name);
 201  202  }
 202  203  
 203  204  static void match_user_rl(const char *fn, struct expression *expr, void *info)
 204  205  {
 205  206          struct expression *arg;
 206  207          struct range_list *rl = NULL;
      208 +        bool capped = false;
 207  209          char *name;
 208  210  
 209  211          arg = get_argument_from_call_expr(expr->args, 0);
 210  212          name = expr_to_str(arg);
 211  213  
 212  214          get_user_rl(arg, &rl);
 213      -        sm_msg("user rl: '%s' = '%s'", name, show_rl(rl));
      215 +        if (rl)
      216 +                capped = user_rl_capped(arg);
      217 +        sm_msg("user rl: '%s' = '%s'%s", name, show_rl(rl), capped ? " (capped)" : "");
 214  218  
 215  219          free_string(name);
 216  220  }
 217  221  
 218  222  static void match_capped(const char *fn, struct expression *expr, void *info)
 219  223  {
 220  224          struct expression *arg;
 221  225          char *name;
 222  226  
 223  227          arg = get_argument_from_call_expr(expr->args, 0);
↓ open down ↓ 456 lines elided ↑ open up ↑
 680  684  }
 681  685  
 682  686  static void match_state_count(const char *fn, struct expression *expr, void *info)
 683  687  {
 684  688          sm_msg("state_count = %d\n", sm_state_counter);
 685  689  }
 686  690  
 687  691  static void match_mem(const char *fn, struct expression *expr, void *info)
 688  692  {
 689  693          show_sname_alloc();
      694 +        show_data_range_alloc();
      695 +        show_rl_ptrlist_alloc();
 690  696          show_ptrlist_alloc();
 691  697          sm_msg("%lu pools", get_pool_count());
 692  698          sm_msg("%d strees", unfree_stree);
 693  699          show_smatch_state_alloc();
 694  700          show_sm_state_alloc();
 695  701  }
 696  702  
 697  703  static void match_exit(const char *fn, struct expression *expr, void *info)
 698  704  {
 699  705          exit(0);
↓ open down ↓ 85 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX