proj: Allow exclutions of functions
This commit is contained in:
@@ -829,10 +829,20 @@ static void init(void) {
|
|||||||
for (int i = 0; func_names[i] != NULL; i++) {
|
for (int i = 0; func_names[i] != NULL; i++) {
|
||||||
const char *name1 = func_names[i];
|
const char *name1 = func_names[i];
|
||||||
const int wildcard = name1[strlen(name1) - 1] == '*';
|
const int wildcard = name1[strlen(name1) - 1] == '*';
|
||||||
|
int not = 0;
|
||||||
|
if (name1[0] == '-') {
|
||||||
|
name1++;
|
||||||
|
not = 1;
|
||||||
|
}
|
||||||
for (int j = 0; j < sizeof(func_names_ordered) / sizeof(char *); j++) {
|
for (int j = 0; j < sizeof(func_names_ordered) / sizeof(char *); j++) {
|
||||||
const char *name2 = func_names_ordered[j];
|
const char *name2 = func_names_ordered[j];
|
||||||
if (strcmp(name1, name2) == 0 || (wildcard && strncmp(name1, name2, strlen(name1) - 1) == 0))
|
if (strcmp(name1, name2) == 0 || (wildcard && strncmp(name1, name2, strlen(name1) - 1) == 0)) {
|
||||||
func_flags[j] |= 1;
|
if (not) {
|
||||||
|
func_flags[j] &= ~1;
|
||||||
|
} else {
|
||||||
|
func_flags[j] |= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -1158,7 +1168,7 @@ int sym(sigaction)(int sig, const struct sigaction *restrict act, struct sigacti
|
|||||||
if (maskstr[0] != 0) strcat(maskstr, ",");
|
if (maskstr[0] != 0) strcat(maskstr, ",");
|
||||||
strcat(maskstr, getsigstr(i));
|
strcat(maskstr, getsigstr(i));
|
||||||
}
|
}
|
||||||
msg("return %i; errno %s; oact={sa_flags: 0x%x:%s, %s: %p, sa-mask: [%s]}", ret, strerrorname_np(errno), oact->sa_flags, flgstr, name, ptr, maskstr);
|
msg("return %i; errno %s; oact={sa_flags: 0x%x:%s, %s: %p, sa_mask: [%s]}", ret, strerrorname_np(errno), oact->sa_flags, flgstr, name, ptr, maskstr);
|
||||||
} else {
|
} else {
|
||||||
msg("return %i; errno %s", ret, strerrorname_np(errno));
|
msg("return %i; errno %s", ret, strerrorname_np(errno));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ def main() -> None:
|
|||||||
subprocess.run(extra, env={
|
subprocess.run(extra, env={
|
||||||
'LD_PRELOAD': os.getcwd() + '/../../intercept/intercept.so',
|
'LD_PRELOAD': os.getcwd() + '/../../intercept/intercept.so',
|
||||||
'INTERCEPT': 'unix:' + socket_name,
|
'INTERCEPT': 'unix:' + socket_name,
|
||||||
|
'INTERCEPT_FUNCTIONS': ','.join(['*', '-malloc', '-calloc', '-realloc', '-reallocarray', '-free']),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ def main() -> None:
|
|||||||
subprocess.run(extra, stdin=stdin, env={
|
subprocess.run(extra, stdin=stdin, env={
|
||||||
'LD_PRELOAD': os.getcwd() + '/../../intercept/intercept.so',
|
'LD_PRELOAD': os.getcwd() + '/../../intercept/intercept.so',
|
||||||
'INTERCEPT': 'unix:' + socket_name,
|
'INTERCEPT': 'unix:' + socket_name,
|
||||||
|
'INTERCEPT_FUNCTIONS': ','.join(['*', '-malloc', '-calloc', '-realloc', '-reallocarray', '-free']),
|
||||||
})
|
})
|
||||||
for i, name in enumerate(ctx['call_sequence']):
|
for i, name in enumerate(ctx['call_sequence']):
|
||||||
errors = [r[1] for r in ctx['results'] if r[0] == i]
|
errors = [r[1] for r in ctx['results'] if r[0] == i]
|
||||||
|
|||||||
Reference in New Issue
Block a user