diff --git a/python/revng/internal/cli/_commands/translate.py b/python/revng/internal/cli/_commands/translate.py index f95bc3729..4c347ff58 100644 --- a/python/revng/internal/cli/_commands/translate.py +++ b/python/revng/internal/cli/_commands/translate.py @@ -41,17 +41,17 @@ class TranslateCommand(Command): args = options.parsed_args out_file = args.output if args.output else args.input[0] + ".translated" - step_name = "Recompile" + step_name = "recompile" if args.isolate: - step_name = step_name + "Isolated" + step_name = step_name + "-isolated" command = [ "pipeline", ] - command.append("--analyze=Import/ImportBinary/input/:Binary") - command.append("--analyze=Import/AddPrimitiveTypes/") - command.append("--analyze=Lift/DetectABI/module.ll/:Root") + command.append("--analyze=initial/import-binary/input/:Binary") + command.append("--analyze=initial/add-primitive-types/") + command.append("--analyze=lift/detect-abi/module.ll/:Root") command = command + [ f"--produce={step_name}/output/:Translated", diff --git a/share/revng/pipelines/revng-pipelines.yml b/share/revng/pipelines/revng-pipelines.yml index bd47e6f29..b2ff18b7a 100644 --- a/share/revng/pipelines/revng-pipelines.yml +++ b/share/revng/pipelines/revng-pipelines.yml @@ -29,33 +29,30 @@ Containers: Type: FunctionControlFlowGraphSVG Branches: - Steps: - - Name: GlobalAnalyses + - Name: initial Analyses: - - Name: ApplyDiff + - Name: apply-diff Type: ApplyDiff UsedContainers: [] - - Name: VerifyDiff + - Name: verify-diff Type: VerifyDiff UsedContainers: [] - - Name: SetGlobal + - Name: set-global Type: SetGlobal UsedContainers: [] - - Name: VerifyGlobal + - Name: verify-global Type: VerifyGlobal UsedContainers: [] - - Steps: - - Name: Import - Analyses: - - Name: AddPrimitiveTypes + - Name: add-primitive-types Type: AddPrimitiveTypes UsedContainers: [] - - Name: ImportBinary + - Name: import-binary Type: ImportBinary UsedContainers: [input] - - Name: ImportWellKnownModels + - Name: import-well-known-models Type: ImportWellKnownModels UsedContainers: [] - - Name: Lift + - Name: lift Pipes: - Type: Lift UsedContainers: [input, module.ll] @@ -67,10 +64,10 @@ Branches: Kind: Root SingleTargetFilename: module_lifted.ll Analyses: - - Name: DetectABI + - Name: detect-abi Type: DetectABI UsedContainers: [module.ll] - - Name: Isolate + - Name: isolate Pipes: - Type: LLVMPipe UsedContainers: [module.ll] @@ -81,7 +78,7 @@ Branches: Container: module.ll Kind: Isolated SingleTargetFilename: module_isolated.ll - - Name: EnforceABI + - Name: enforce-abi Pipes: - Type: LLVMPipe UsedContainers: [module.ll] @@ -105,9 +102,9 @@ Branches: Container: module.ll Kind: CSVsPromoted SingleTargetFilename: module_abienforced.ll - - From: Isolate + - From: isolate Steps: - - Name: HexDump + - Name: hexdump Pipes: - Type: HexDump UsedContainers: [input, module.ll, hex.dump] @@ -115,9 +112,9 @@ Branches: Container: hex.dump Kind: HexDump SingleTargetFilename: hex_dump.hex - - From: Isolate + - From: isolate Steps: - - Name: YieldCallGraph + - Name: render-svg-call-graph Pipes: - Type: YieldCallGraph UsedContainers: [cross-relations.yml, call-graph.svg.yml] @@ -125,9 +122,9 @@ Branches: Container: call-graph.svg.yml Kind: CallGraphSVG SingleTargetFilename: call-graph.svg - - From: Isolate + - From: isolate Steps: - - Name: YieldCallGraphSlice + - Name: render-svg-call-graph-slice Pipes: - Type: YieldCallGraphSlice UsedContainers: [module.ll, cross-relations.yml, call-graph-slice.svg.tar.gz] @@ -135,13 +132,13 @@ Branches: Container: call-graph-slice.svg.tar.gz Kind: CallGraphSliceSVG SingleTargetFilename: call-graph-slice.svg - - From: Isolate + - From: isolate Steps: - - Name: ProcessAssembly + - Name: process-assembly Pipes: - Type: ProcessAssembly UsedContainers: [input, module.ll, assembly-internal.yml.tar.gz] - - Name: YieldAssembly + - Name: disassemble Pipes: - Type: YieldAssembly UsedContainers: [assembly-internal.yml.tar.gz, assembly.ptml.tar.gz] @@ -149,9 +146,9 @@ Branches: Container: assembly.ptml.tar.gz Kind: FunctionAssemblyPTML SingleTargetFilename: disassembly.S - - From: ProcessAssembly + - From: process-assembly Steps: - - Name: YieldCFG + - Name: render-svg-cfg Pipes: - Type: YieldCFG UsedContainers: [assembly-internal.yml.tar.gz, cfg.svg.tar.gz] @@ -159,9 +156,9 @@ Branches: Container: cfg.svg.tar.gz Kind: FunctionControlFlowGraphSVG SingleTargetFilename: cfg.svg - - From: Lift + - From: lift Steps: - - Name: Recompile + - Name: recompile Pipes: - Type: LinkSupport UsedContainers: [module.ll] @@ -177,9 +174,9 @@ Branches: Container: output Kind: Translated SingleTargetFilename: translated_binary - - From: Isolate + - From: isolate Steps: - - Name: RecompileIsolated + - Name: recompile-isolated Pipes: - Type: LinkSupport UsedContainers: [module.ll] @@ -198,7 +195,7 @@ Branches: AnalysesLists: - Name: revng-initial-auto-analysis Analyses: - - AddPrimitiveTypes - - ImportBinary - - ImportWellKnownModels - - DetectABI + - add-primitive-types + - import-binary + - import-well-known-models + - detect-abi diff --git a/share/revng/test/configuration/revng/for-collect-cfg.yml b/share/revng/test/configuration/revng/for-collect-cfg.yml index b1e4dff59..d34c884eb 100644 --- a/share/revng/test/configuration/revng/for-collect-cfg.yml +++ b/share/revng/test/configuration/revng/for-collect-cfg.yml @@ -10,10 +10,10 @@ commands: command: |- RESUME=$$(temp -d); MODEL=$$(temp); - revng analyze --resume "$$RESUME" AddPrimitiveTypes "$INPUT" -o /dev/null; - revng analyze --resume "$$RESUME" ImportBinary "$INPUT" -o /dev/null; - revng analyze --resume "$$RESUME" DetectABI "$INPUT" -o "$$MODEL"; - revng artifact --resume "$$RESUME" EnforceABI "$INPUT" | + revng analyze --resume "$$RESUME" add-primitive-types "$INPUT" -o /dev/null; + revng analyze --resume "$$RESUME" import-binary "$INPUT" -o /dev/null; + revng analyze --resume "$$RESUME" detect-abi "$INPUT" -o "$$MODEL"; + revng artifact --resume "$$RESUME" enforce-abi "$INPUT" | revng model inject "$$MODEL" | revng efa-extractcfg | revng model to-json --remap | diff --git a/share/revng/test/configuration/revng/for-import-types.yml b/share/revng/test/configuration/revng/for-import-types.yml index 90cca9e55..b7b0e08b8 100644 --- a/share/revng/test/configuration/revng/for-import-types.yml +++ b/share/revng/test/configuration/revng/for-import-types.yml @@ -8,5 +8,5 @@ commands: - type: revng-qa.compiled-with-debug-info filter: for-import-types command: |- - revng analyze ImportBinary "$INPUT" + revng analyze import-binary "$INPUT" | revng model compare "${SOURCE}.model.yml"; diff --git a/share/revng/test/configuration/revng/for-propagated-prototypes.yml b/share/revng/test/configuration/revng/for-propagated-prototypes.yml index e15fa7a57..1298350f0 100644 --- a/share/revng/test/configuration/revng/for-propagated-prototypes.yml +++ b/share/revng/test/configuration/revng/for-propagated-prototypes.yml @@ -9,8 +9,8 @@ commands: filter: for-propagated-prototypes command: |- RESUME=$$(temp -d); - revng analyze --resume "$$RESUME" ImportBinary "$INPUT" -o /dev/null --debug-info=no; - revng analyze --resume "$$RESUME" AddPrimitiveTypes "$INPUT" -o /dev/null; + revng analyze --resume "$$RESUME" import-binary "$INPUT" -o /dev/null --debug-info=no; + revng analyze --resume "$$RESUME" add-primitive-types "$INPUT" -o /dev/null; revng model apply "$$RESUME/context/model.yml" "$SOURCE.add-puts.yml" -o "$$RESUME/context/model.yml"; - revng analyze --resume "$$RESUME" DetectABI "$INPUT" | + revng analyze --resume "$$RESUME" detect-abi "$INPUT" | revng model compare "$SOURCE".model.yml diff --git a/share/revng/test/configuration/revng/revng.yml b/share/revng/test/configuration/revng/revng.yml index 184b2e346..15d79eaa3 100644 --- a/share/revng/test/configuration/revng/revng.yml +++ b/share/revng/test/configuration/revng/revng.yml @@ -19,9 +19,9 @@ commands: MODEL="$$(temp)"; TMP="$$(temp -d)"; revng model dump "$INPUT2" -o "$$MODEL"; - revng analyze DetectABI "$INPUT1" --resume "$$TMP" -m "$$MODEL" -o /dev/null; - revng artifact EnforceABI "$INPUT1" --resume "$$TMP" -o /dev/null; - revng model inject "$$TMP"/context/model.yml "$$TMP"/EnforceABI/module.ll -o "$OUTPUT"; + revng analyze detect-abi "$INPUT1" --resume "$$TMP" -m "$$MODEL" -o /dev/null; + revng artifact enforce-abi "$INPUT1" --resume "$$TMP" -o /dev/null; + revng model inject "$$TMP"/context/model.yml "$$TMP"/enforce-abi/module.ll -o "$OUTPUT"; - type: revng.test-python-model-serialization-roundtrip from: - type: revng.abi-enforced-for-decompilation diff --git a/share/revng/test/configuration/revng/yields.yml b/share/revng/test/configuration/revng/yields.yml index 607e7b3fb..9998c7ada 100644 --- a/share/revng/test/configuration/revng/yields.yml +++ b/share/revng/test/configuration/revng/yields.yml @@ -15,9 +15,9 @@ commands: revng pipeline -m "$$MODEL" -i "$INPUT1:begin/input" - -i "$INPUT2:EnforceABI/module.ll" - -o "$OUTPUT:ProcessAssembly/assembly-internal.yml.tar.gz" - --produce ProcessAssembly/assembly-internal.yml.tar.gz/*:FunctionAssemblyInternal + -i "$INPUT2:enforce-abi/module.ll" + -o "$OUTPUT:process-assembly/assembly-internal.yml.tar.gz" + --produce process-assembly/assembly-internal.yml.tar.gz/*:FunctionAssemblyInternal - type: revng.assembly-ptml from: @@ -29,9 +29,9 @@ commands: revng model dump "$INPUT2" > "$$MODEL"; revng pipeline -m "$$MODEL" - -i "$INPUT1:ProcessAssembly/assembly-internal.yml.tar.gz" - -o "$OUTPUT:YieldAssembly/assembly.ptml.tar.gz" - --produce YieldAssembly/assembly.ptml.tar.gz/*:FunctionAssemblyPTML + -i "$INPUT1:process-assembly/assembly-internal.yml.tar.gz" + -o "$OUTPUT:disassemble/assembly.ptml.tar.gz" + --produce disassemble/assembly.ptml.tar.gz/*:FunctionAssemblyPTML - type: revng.cfg-svg from: @@ -43,9 +43,9 @@ commands: revng model dump "$INPUT2" > "$$MODEL"; revng pipeline -m "$$MODEL" - -i "$INPUT1:ProcessAssembly/assembly-internal.yml.tar.gz" - -o "$OUTPUT:YieldCFG/cfg.svg.tar.gz" - --produce YieldCFG/cfg.svg.tar.gz/*:FunctionControlFlowGraphSVG + -i "$INPUT1:process-assembly/assembly-internal.yml.tar.gz" + -o "$OUTPUT:render-svg-cfg/cfg.svg.tar.gz" + --produce render-svg-cfg/cfg.svg.tar.gz/*:FunctionControlFlowGraphSVG - type: revng.cross-relations from: @@ -59,9 +59,9 @@ commands: revng pipeline -m "$$MODEL" -i "$INPUT1:begin/input" - -i "$INPUT2:EnforceABI/module.ll" - -o "$OUTPUT:Isolate/cross-relations.yml" - --produce Isolate/cross-relations.yml/:BinaryCrossRelations + -i "$INPUT2:enforce-abi/module.ll" + -o "$OUTPUT:isolate/cross-relations.yml" + --produce isolate/cross-relations.yml/:BinaryCrossRelations - type: revng.call-graph-svg from: @@ -73,9 +73,9 @@ commands: revng model dump "$INPUT2" > "$$MODEL"; revng pipeline -m "$$MODEL" - -i "$INPUT1:Isolate/cross-relations.yml" - -o "$OUTPUT:YieldCallGraph/call-graph.svg.yml" - --produce YieldCallGraph/call-graph.svg.yml/:CallGraphSVG + -i "$INPUT1:isolate/cross-relations.yml" + -o "$OUTPUT:render-svg-call-graph/call-graph.svg.yml" + --produce render-svg-call-graph/call-graph.svg.yml/:CallGraphSVG - type: revng.call-graph-slice-svg from: @@ -89,8 +89,8 @@ commands: revng model dump "$INPUT2" > "$$MODEL"; revng pipeline -m "$$MODEL" - -i "$INPUT1:Isolate/cross-relations.yml" - -i "$INPUT2:EnforceABI/module.ll" + -i "$INPUT1:isolate/cross-relations.yml" + -i "$INPUT2:enforce-abi/module.ll" -i "$INPUT3:begin/input" - -o "$OUTPUT:YieldCallGraphSlice/call-graph-slice.svg.tar.gz" - --produce YieldCallGraphSlice/call-graph-slice.svg.tar.gz/*:CallGraphSliceSVG + -o "$OUTPUT:render-svg-call-graph-slice/call-graph-slice.svg.tar.gz" + --produce render-svg-call-graph-slice/call-graph-slice.svg.tar.gz/*:CallGraphSliceSVG diff --git a/share/revng/test/tests/abi/README.md b/share/revng/test/tests/abi/README.md index abc2e1de6..486c4db32 100644 --- a/share/revng/test/tests/abi/README.md +++ b/share/revng/test/tests/abi/README.md @@ -32,7 +32,7 @@ graph TB ensure-rft-equivalence(ensure-rft-equivalence) class check-compatibility-with-abi,ensure-rft-equivalence purple - fb -- "[ImportBinary + some extra processing]" --> reference_binary.yml + fb -- "[import-binary + some extra processing]" --> reference_binary.yml reference_binary.yml -- "[ConvertToRawFunctionType]" --> downgraded_reference_binary.yml downgraded_reference_binary.yml -- "[ConvertToCABIFunctionType]" --> upgraded_downgraded_reference_binary.yml upgraded_downgraded_reference_binary.yml -- "[ConvertToRawFunctionType]" --> downgraded_upgraded_downgraded_reference_binary.yml @@ -59,7 +59,7 @@ strict digraph { "mmap'ed binary" [color=red] "runner binary" [color=red] - "functions binary" -> "reference_binary.yml" [label="[ImportBinary + some extra processing]"] + "functions binary" -> "reference_binary.yml" [label="[import-binary + some extra processing]"] "reference_binary.yml" -> "downgraded_reference_binary.yml" [label="[ConvertToRawFunctionType]"] "downgraded_reference_binary.yml" -> "upgraded_downgraded_reference_binary.yml" [label="[ConvertToCABIFunctionType]"] "upgraded_downgraded_reference_binary.yml" -> "downgraded_upgraded_downgraded_reference_binary.yml" [label="[ConvertToRawFunctionType]"] @@ -94,7 +94,7 @@ Legend: The order of the operations done by the pipeline can be found in `test-conversion.sh` (`test-layout.sh` is a stripped down version of that assumes no `raw->cabi` analysis). Let me elaborate a bit further on every command: -### `revng analyze ImportBinary` +### `revng analyze import-binary` The abi testing reference binary is imported into a model using the normal means. The code for generating this "pure" is located in the [revng-qa](https://github.com/revng/revng-qa) repository. @@ -102,7 +102,7 @@ The abi testing reference binary is imported into a model using the normal means Because sometimes it's impossible to detect ABI correctly based on dwarf data alone, and because having the right ABI is _really_ important for the integrity of this test, if for any CABI-FT inside the binary the recorded ABI doesn't exactly match the expected ABI, this script overrides it. -### `revng analyze AddPrimitiveTypes` +### `revng analyze add-primitive-types` Eventually this will have to go away, but for now manually make sure each primitive type is present in the model, to avoid any surprises. Let's call the model after this step a `reference_binary.yml`. diff --git a/share/revng/test/tests/abi/verify-abi-test-binaries.sh b/share/revng/test/tests/abi/verify-abi-test-binaries.sh index 099ac4a37..178d3a7ff 100755 --- a/share/revng/test/tests/abi/verify-abi-test-binaries.sh +++ b/share/revng/test/tests/abi/verify-abi-test-binaries.sh @@ -26,7 +26,7 @@ orc shell \ # Import DWARF information revng \ analyze \ - ImportBinary \ + import-binary \ "$BINARY" \ -o="${TEMPORARY_DIRECTORY}/imported_binary.yml" @@ -40,7 +40,7 @@ python3 \ # Make sure all the primitive types are available revng \ analyze \ - AddPrimitiveTypes \ + add-primitive-types \ "$BINARY" \ -m="${TEMPORARY_DIRECTORY}/corrected_binary.yml" \ -o="${TEMPORARY_DIRECTORY}/reference_binary.yml" diff --git a/share/revng/test/tests/daemon/test.py b/share/revng/test/tests/daemon/test.py index 33305586f..813ff1cd4 100755 --- a/share/revng/test/tests/daemon/test.py +++ b/share/revng/test/tests/daemon/test.py @@ -205,9 +205,9 @@ async def test_info(client): assert function_rank.Parent == "binary" begin_step = next(s for s in desc.Steps if s.Name == "begin") - import_step = next(s for s in desc.Steps if s.Name == "Import") + initial_step = next(s for s in desc.Steps if s.Name == "initial") assert begin_step.Parent == "" - assert import_step.Parent == "begin" + assert initial_step.Parent == "begin" container_names = [c.Name for c in desc.Containers] assert "module.ll" in container_names @@ -242,7 +242,7 @@ async def run_preliminary_analyses(client): await client.execute( gql( """mutation($ctt: String!, $index: BigInt!) { - runAnalysis(step: "Import", analysis: "ImportBinary", + runAnalysis(step: "initial", analysis: "import-binary", containerToTargets: $ctt, index: $index) { __typename } @@ -255,7 +255,7 @@ async def run_preliminary_analyses(client): await client.execute( gql( "mutation {" - + f'runAnalysis(step: "Import", analysis: "AddPrimitiveTypes", index: "{index}")' + + f'runAnalysis(step: "initial", analysis: "add-primitive-types", index: "{index}")' + "{ __typename } }" ) ) @@ -265,7 +265,7 @@ async def test_lift(client): await run_preliminary_analyses(client) index = await get_index(client) result = await client.execute( - gql(f'{{ produceArtifacts(step: "Lift", paths: "", index: "{index}") {{ __typename }} }}') + gql(f'{{ produceArtifacts(step: "lift", paths: "", index: "{index}") {{ __typename }} }}') ) assert result["produceArtifacts"]["__typename"] == "Produced" @@ -274,7 +274,7 @@ async def test_lift_ready_fail(client): await run_preliminary_analyses(client) index = await get_index(client) q = gql( - f'{{ produceArtifacts(step: "Lift", paths: ":Binary", onlyIfReady: true, index: "{index}")' + f'{{ produceArtifacts(step: "lift", paths: ":Binary", onlyIfReady: true, index: "{index}")' + "{ __typename } }" ) @@ -290,7 +290,7 @@ async def test_get_model(client): await run_preliminary_analyses(client) index = await get_index(client) await client.execute( - gql(f'{{ produceArtifacts(step: "Lift", paths: "", index: "{index}") {{ __typename }} }}') + gql(f'{{ produceArtifacts(step: "lift", paths: "", index: "{index}") {{ __typename }} }}') ) result = await client.execute(gql('{ getGlobal(name: "model.yml") }')) @@ -306,7 +306,7 @@ async def test_targets(client): ready } - lift: targets(step: "Lift", container: "module.ll") { + lift: targets(step: "lift", container: "module.ll") { kind ready } @@ -325,7 +325,7 @@ async def test_produce(client): await run_preliminary_analyses(client) index = await get_index(client) q = gql( - f'{{ produce(step: "Lift", container: "module.ll", targetList: ":Root", index: "{index}")' + f'{{ produce(step: "lift", container: "module.ll", targetList: ":Root", index: "{index}")' + "{ __typename } }" ) result = await client.execute(q) @@ -336,7 +336,7 @@ async def test_produce(client): async def test_produce_artifact(client): await run_preliminary_analyses(client) index = await get_index(client) - q = gql(f'{{ produceArtifacts(step: "Lift", index: "{index}") {{ __typename }} }}') + q = gql(f'{{ produceArtifacts(step: "lift", index: "{index}") {{ __typename }} }}') result = await client.execute(q) assert "produceArtifacts" in result @@ -348,7 +348,7 @@ async def test_function_endpoint(client): index = await get_index(client) q = gql( """mutation($ctt: String!, $index: BigInt!) { - runAnalysis(step: "Lift", analysis: "DetectABI", + runAnalysis(step: "lift", analysis: "detect-abi", containerToTargets: $ctt, index: $index) { __typename } @@ -358,7 +358,7 @@ async def test_function_endpoint(client): q = gql( """{ - targets(step: "Isolate", container: "module.ll") { + targets(step: "isolate", container: "module.ll") { serialized } }""" @@ -369,7 +369,7 @@ async def test_function_endpoint(client): index = await get_index(client) q = gql( """query function($param1: String!, $index: BigInt!) { - produceArtifacts(step: "Isolate", paths: $param1, index: $index) { __typename } + produceArtifacts(step: "isolate", paths: $param1, index: $index) { __typename } }""" ) result = await client.execute( @@ -384,7 +384,7 @@ async def test_analysis_kind_check(client): index = await get_index(client) q = gql( """mutation($ctt: String!, $index: BigInt!) { - runAnalysis(step: "Lift", analysis: "DetectABI", + runAnalysis(step: "lift", analysis: "detect-abi", containerToTargets: $ctt, index: $index) { __typename } diff --git a/share/revng/test/tests/storage.sh b/share/revng/test/tests/storage.sh index 824e88778..f80ee35b3 100755 --- a/share/revng/test/tests/storage.sh +++ b/share/revng/test/tests/storage.sh @@ -20,7 +20,7 @@ revng artifact \ --resume="s3://S3RVER:S3RVER@region+127.0.0.1:$S3_PORT/test/project-test-dir" \ --analyses-list=revng-initial-auto-analysis \ -o /dev/null \ - YieldAssembly "$1" + disassemble "$1" # Simple file check, this looks into the persistence directory of s3rver and # checks that the input file and the file in 'begin/input' have the same