- case ICMD_DUP2_X2:
- if (stage >= SHOW_STACK) {
- SHOW_STACKVAR(iptr->dst.dupslots[0]);
- SHOW_STACKVAR(iptr->dst.dupslots[1]);
- SHOW_STACKVAR(iptr->dst.dupslots[2]);
- SHOW_STACKVAR(iptr->dst.dupslots[4]);
- printf("=> ");
- SHOW_STACKVAR(iptr->dst.dupslots[4+0]);
- SHOW_STACKVAR(iptr->dst.dupslots[4+1]);
- SHOW_STACKVAR(iptr->dst.dupslots[4+2]);
- SHOW_STACKVAR(iptr->dst.dupslots[4+3]);
- SHOW_STACKVAR(iptr->dst.dupslots[4+4]);
- SHOW_STACKVAR(iptr->dst.dupslots[4+5]);
+void show_filters_init(void) {
+
+ show_filter_init(
+ show_filters + 0,
+ opt_filter_verbosecall_include,
+ SHOW_FILTER_FLAG_VERBOSECALL_INCLUDE,
+ SHOW_FILTER_FLAG_VERBOSECALL_INCLUDE,
+ "verbose call include filter"
+ );
+
+ show_filter_init(
+ show_filters + 1,
+ opt_filter_verbosecall_exclude,
+ SHOW_FILTER_FLAG_VERBOSECALL_EXCLUDE,
+ 0,
+ "verbose call exclude filter"
+ );
+
+ show_filter_init(
+ show_filters + 2,
+ opt_filter_show_method,
+ SHOW_FILTER_FLAG_SHOW_METHOD,
+ SHOW_FILTER_FLAG_SHOW_METHOD,
+ "show method filter"
+ );
+}
+
+/*
+
+ (Pseudo)State machine:
+
+ States are INITIAL, INCLUDE1, INCLUDE2, ..., EXCLUDE1, ..., EXCLUDE2, ...
+
+ Enter Enter
+ Enter Include Include
+ Exclude | | | |
+ | | Enter Enter Enter | | Enter | |
+ | | Include Include Exclude | | Exclude | |
+ | v ---------> ----------> ----------> | v ----------> | v
+INITIAL INCLUDE1 INCLUDE2 EXCLUDE1 EXCLUDE2
+ | ^ <--------- <---------- <---------- | ^ <---------- | ^
+ | | Exit Exit Exit | | Exit | |
+ | | Include Include Exclude | | Exclude | |
+ | | | | | |
+ Exit Exit Exit
+ Exclude Include Include
+
+ Verbose call scope is active if we are in a INCLUDE state.
+
+ State encoding:
+
+ INITIAL: ctr[0] == 0, ctr[1] == 0
+ INCLUDEN: ctr[1] == N, ctr[1] == 0
+ EXCLUDEN: ctr[1] == N
+*/
+
+void show_filters_apply(methodinfo *m) {
+ int i;
+ int res;
+ char *method_name;
+ s4 len;
+ int32_t dumpmarker;
+
+ /* compose full name of method */
+
+ len =
+ utf_bytes(m->class->name) +
+ 1 +
+ utf_bytes(m->name) +
+ utf_bytes(m->descriptor) +
+ 1;
+
+ DMARKER;
+
+ method_name = DMNEW(char, len);
+
+ utf_cat_classname(method_name, m->class->name);
+ strcat(method_name, ".");
+ utf_cat(method_name, m->name);
+ utf_cat(method_name, m->descriptor);
+
+ /* reset all flags */
+
+ m->filtermatches = 0;
+
+ for (i = 0; i < SHOW_FILTERS_SIZE; ++i) {
+ if (show_filters[i].enabled) {
+
+ res = regexec(&show_filters[i].regex, method_name, 0, NULL, 0);
+
+ if (res == 0) {
+ m->filtermatches |= show_filters[i].flag;
+ }
+ } else {
+ /* Default is to show all */
+ m->filtermatches |= show_filters[i].flag;