MCPcopy Create free account
hub / github.com/GJDuck/e9patch / parseExclude

Function parseExclude

src/e9tool/e9tool.cpp:395–418  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

393 return bound;
394}
395static Exclude parseExclude(const ELF &elf, const char *str)
396{
397 Parser parser(str, "exclusion", elf);
398
399 Exclude lb = parseExcludeBound(parser, str, elf);
400 if (lb.lo == INTPTR_MAX && lb.hi == INTPTR_MIN)
401 return lb;
402 Exclude ub = lb;
403 if (parser.peekToken() == TOKEN_DOTDOT)
404 {
405 parser.getToken();
406 ub = parseExcludeBound(parser, str, elf);
407 if (ub.lo == INTPTR_MAX && lb.hi == INTPTR_MIN)
408 return ub;
409 }
410 parser.expectToken(TOKEN_EOF);
411 Exclude exclude = {std::min(lb.lo, ub.hi), std::max(lb.lo, ub.hi)};
412 if (exclude.lo == exclude.hi)
413 warning("ignoring empty exclusion \"%s\" (0x%lx..0x%lx)",
414 str, exclude.lo, exclude.hi);
415 else
416 debug("excluding \"%s\" (0x%lx..0x%lx)", str, exclude.lo, exclude.hi);
417 return exclude;
418}
419
420/*
421 * Matching.

Callers 1

main_2Function · 0.85

Calls 5

parseExcludeBoundFunction · 0.85
warningFunction · 0.85
peekTokenMethod · 0.80
getTokenMethod · 0.80
expectTokenMethod · 0.80

Tested by

no test coverage detected