Commit Graph

6113 Commits

Author SHA1 Message Date
Alessandro Di Federico 5d3d2e84ad Merge branch 'feature/rcc-additional-features' 2023-05-11 10:33:01 +02:00
Giacomo Vercesi 52d20ffc36 rcc: add commit check
Add the command-line flag `--check-commit` to `revng-check-conventions`,
this will introduce additional checks related to commits message
conformity.
2023-05-11 10:05:32 +02:00
Giacomo Vercesi 31cd2b53f9 rcc: add codespell
Add codespell to the list of checks performed by
revng-check-conventions. This should reduce the amount of typos present
in the revng codebase.
2023-05-11 10:05:32 +02:00
Giacomo Vercesi a4ad571e61 rcc: Fix typos
Fix the typos detected by `codespell`
2023-05-11 10:04:32 +02:00
Giacomo Vercesi a13c3e5ac2 revng: fix executable/shebang in scripts
Some files had discordant executable bit presence and shebang presence.
This commit fixes these occurrences by adding removing the required
feautures where needed.
2023-05-11 10:02:46 +02:00
Giacomo Vercesi 9d5b6d1f34 revng cli: migrate legacy scripts to _commands
Move the remaining commands in the `scripts` to be used by the `revng`
command line driver.
2023-05-11 10:02:46 +02:00
Giacomo Vercesi fdd07f640a revng cli: drop old code
Remove code for the `revng` command line entrypoint that was needed
before python became an orchestra component.
2023-05-11 10:02:46 +02:00
Giacomo Vercesi 471b9c8396 rcc: fix issues with mypy>=1.0
Add additional config options to the `revng-check-conventions` config to
make mypy work with the revng codebase (mainly related to untyped
functions now causing a warning in mypy).
2023-05-11 10:02:46 +02:00
Pietro Fezzardi 833d509df1 Merge branch 'feature/well-known-prototypes' 2023-05-10 17:38:47 +02:00
Alessandro Di Federico 7b2e7a9312 Adopt new revng-qa sources handling 2023-05-10 14:23:32 +02:00
Alessandro Di Federico bd9828ea8f TypeFlowGraph: adopt GenericGraph constructors 2023-05-10 14:23:07 +02:00
Alessandro Di Federico beef559395 Merge branch 'feature/well-known-prototypes' 2023-05-10 11:41:09 +02:00
Alessandro Di Federico 92c028235f Introduce WellKnownModels analysis 2023-05-10 11:16:08 +02:00
Alessandro Di Federico b112d51154 LDDTree: rewrite findLibrary
`findLibrary` has been rewritten to adhere more strictly to `man ld.so`.
Also, `lddtree` no longer relies on sections headers.
2023-05-10 11:04:52 +02:00
Alessandro Di Federico abc380017b {ELF,Dwarf}Importer: fix ExportedNames
Under certain conditions, upon import, functions where not being added
`ExportedNames`, which was preventing them from finding the prototypes
from dynamic libraries' debug information.
2023-05-10 09:21:43 +02:00
Alessandro Di Federico f562d0373f Importers: fix usage of BaseAddress
This commit ensure the BaseAddress is propagate as appropriate to all
levels of the importers and that it is ignored for executables
(non-PIC).

This was a recurring source of importing the same function twice, once
relocated, once not.
2023-05-10 09:20:40 +02:00
Alessandro Di Federico 5fbaebe153 DwarfImporter: handle DW_AT_abstract_origin 2023-05-10 09:20:15 +02:00
Alessandro Di Federico 73fb1a31c9 Outline TypeCopier
This commit also drop the suggestion that it should be used for copying
prototypes only.
2023-05-10 09:20:15 +02:00
Alessandro Di Federico 579b9a749f Introduce GenericGraph::operator= 2023-05-10 09:17:35 +02:00
Alessandro Di Federico 4c0f809626 Introduce PathList::list 2023-05-10 09:17:35 +02:00
Alessandro Di Federico 5542382bdb revng-qa tests: adopt full paths 2023-05-10 09:15:18 +02:00
Alessandro Di Federico 680c706771 DetectABI: introduce extra assertions 2023-05-10 09:15:04 +02:00
Alessandro Di Federico 0890251c9b Merge branch 'feature/better-daemon-self-test' 2023-05-09 17:27:19 +02:00
Giacomo Vercesi 472710c100 daemon-self-test: Improve usability
Allow debugging commands (e.g. `--gdb`) to be passed through to the
invoked daemon when running `revng daemon-self-test`.
2023-05-09 17:27:00 +02:00
Giacomo Vercesi 41662b0a43 revng.support: Rework process invocation
Refactor the `run` and `try_run` functions in 4 separate functions:
* `try_run`: Run the process and return the exit code
* `run`: Run the process and assert the exit code was 0
* `exec_run`: exec the process, stopping execution of the python
              interpreter
* `popen`: Wrapper around `subprocess.Popen`, allows the most
           flexibility
2023-05-09 17:27:00 +02:00
Giacomo Vercesi 6ab8099531 revng daemon: disable CORS without --production
Set the `REVNG_ALLOWED_ORIGINS` to `*` when not in production mode. This
should avoid cors issues while developing.
2023-05-09 17:27:00 +02:00
Giacomo Vercesi fcc0d2176c model.ts: format with new prettier
Apply the formatting changes imposed by the updated prettier version.
2023-05-08 16:03:03 +02:00
Pietro Fezzardi 1fe2e1614b Merge branch 'feature/inline-types' 2023-05-03 16:31:28 +02:00
Djordje Todorovic 9d94216dc5 ModelToHeader: Add testing infrastructure
Test structs, unions and primitive types.
Also add tests for inline types.
2023-05-03 13:13:28 +02:00
Djordje Todorovic ca7bc2e442 c-backend: Generate Inline Types in PTML
In ModelToHeader generate Inline Types in PTML by handling
Structs, Unions and Enums.

In addition, during the ModelToHeader we avoid producing
Structs that describe stacks, and in the DecompileFunction we
produce the definition of it inline if it is safe (referenced
only once).
2023-05-03 13:13:28 +02:00
Djordje Todorovic 41678f8cb6 compile-flags: Avoid warnings on unused local typedefs
Before inline types, majority of typedefs were global,
so  we did not have this problem. But from now on, we have
some typedefs that are local to functions that may be
unused, and it is recognized by compilers as a warning.
2023-05-03 13:13:28 +02:00
Pietro Fezzardi f77fd64912 Merge branch feature/improve-pipeline-performance 2023-04-28 15:17:09 +02:00
Alessandro Di Federico 6b051ea1c2 Merge branch 'feature/improve-pipeline-performance' 2023-04-28 15:15:17 +02:00
Alessandro Di Federico eca3e49b77 LLVMContainer: reduce verifications 2023-04-28 14:35:00 +02:00
Alessandro Di Federico da25162d74 JumpTargetManager: drop assertNoUnreachable
The assertion cannot really hold under certain CFG forms.
2023-04-28 14:34:58 +02:00
Alessandro Di Federico 4b2e067574 rcc: ban functions we wrap 2023-04-28 14:34:52 +02:00
Alessandro Di Federico 0434249297 rcc: introduce NOLINTNEXTLINE 2023-04-28 14:34:50 +02:00
Alessandro Di Federico 4eeb942afb LLVMContainer: outline methods to .cpp 2023-04-28 14:34:49 +02:00
Alessandro Di Federico 8b3f641a29 Rename LLVMGlobalKindBase to LLVMKind 2023-04-28 14:34:49 +02:00
Massimo Fioravanti 4d4b587e1d Drop LLVMGlobalKindBase template argument 2023-04-28 14:34:47 +02:00
Alessandro Di Federico a0dcd176b2 Purge useless headers 2023-04-28 14:34:40 +02:00
Alessandro Di Federico 58b50e6b2a Dismiss LLVMContainerBase 2023-04-28 14:34:39 +02:00
Alessandro Di Federico f9e6852311 Adopt revng_add_test 2023-04-28 14:34:39 +02:00
Alessandro Di Federico 596fa25a1b Introduce revng_add_test
This enables us to pass --debug-log=verify to tests.
2023-04-28 14:34:38 +02:00
Alessandro Di Federico f68185abc9 Push ParseCommandLineOptions into InitRevng 2023-04-28 14:34:35 +02:00
Alessandro Di Federico 50f396c43d Drop revng.csv in favor of a Tag 2023-04-28 14:04:32 +02:00
Alessandro Di Federico 82aae6fa2a Give a name to SegmentBoundaries global
Unnamed globals are evil.
2023-04-28 14:04:32 +02:00
Alessandro Di Federico 1d8382187c Dismiss ConstantStringsPool, use getUniqueString 2023-04-28 14:04:32 +02:00
Alessandro Di Federico 8af3fd7fa3 LLVMContainer: do not duplicate appending globals
`llvm.global_ctors` and llvm.global_dtors were being cloned
exponentially many times. This was due to their `appending` linkage.
2023-04-28 14:04:32 +02:00
Alessandro Di Federico 2f917a2772 Introduce ModuleStatistics 2023-04-28 14:04:32 +02:00