| 393 | return bound; |
| 394 | } |
| 395 | static 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. |
no test coverage detected