| 2509 | } |
| 2510 | |
| 2511 | Result ReadBinaryObjdump(const uint8_t* data, |
| 2512 | size_t size, |
| 2513 | ObjdumpOptions* options, |
| 2514 | ObjdumpState* state) { |
| 2515 | Features features; |
| 2516 | features.EnableAll(); |
| 2517 | const bool kReadDebugNames = true; |
| 2518 | const bool kStopOnFirstError = false; |
| 2519 | const bool kFailOnCustomSectionError = false; |
| 2520 | ReadBinaryOptions read_options(features, options->log_stream, kReadDebugNames, |
| 2521 | kStopOnFirstError, kFailOnCustomSectionError); |
| 2522 | |
| 2523 | switch (options->mode) { |
| 2524 | case ObjdumpMode::Prepass: { |
| 2525 | read_options.skip_function_bodies = true; |
| 2526 | BinaryReaderObjdumpPrepass reader(data, size, options, state); |
| 2527 | return ReadBinary(data, size, &reader, read_options); |
| 2528 | } |
| 2529 | case ObjdumpMode::Disassemble: { |
| 2530 | BinaryReaderObjdumpDisassemble reader(data, size, options, state); |
| 2531 | return ReadBinary(data, size, &reader, read_options); |
| 2532 | } |
| 2533 | default: { |
| 2534 | read_options.skip_function_bodies = true; |
| 2535 | BinaryReaderObjdump reader(data, size, options, state); |
| 2536 | return ReadBinary(data, size, &reader, read_options); |
| 2537 | } |
| 2538 | } |
| 2539 | } |
| 2540 | |
| 2541 | } // namespace wabt |
no test coverage detected