406 Commits

Author SHA1 Message Date
Giacomo Vercesi 97b471c888 Add Lift to pypeline 2025-11-18 17:47:54 +01:00
Alessandro Di Federico a99edd93f8 st0_x86: fix deserialization 2025-11-13 17:06:38 +01:00
Alessandro Di Federico d50c25a47b Binary: limit ExecutableRanges to FileSize 2025-11-13 14:16:09 +01:00
Alessandro Di Federico 5d3973b111 Model verify: allow / in most places
`/` is now supported in names except for the parts of the model that use
the name as the key, i.e., `DynamicFunction` and `LocalIdentifier`.

Eventually, `/` should be allowed there as well, but we first need to
make sure that when they end up in a location they are properly
escaped/unescaped.
2025-11-11 17:56:54 +01:00
Alessandro Di Federico 21d9cb56a0 Ban functions in .bss 2025-11-05 12:02:58 +01:00
Alessandro Di Federico c883bed765 Drop Logger's StaticEnabled feature 2025-10-31 17:25:03 +01:00
Alessandro Di Federico 6b78293b22 RawBinaryView: outline to .cpp 2025-10-31 17:25:03 +01:00
Alessandro Di Federico 1429b526ab Introduce libtcg
This commit drops libptc in favor of its new form libtcg.

It brings several improvements, among which:

* The QEMU version we work on has been upgraded.
* CPUStateAccessAnalysis has been reimplemented in a way that makes it
  easier to debug and solves some limitations (e.g., tracking leaking
  pointers).
* Identification of pieces of the CPU state that are read by each helper
  and fixing access to the CPU state is now performed at build-time.
* We no longer mmap the code we need to translate, dropping all the
  issues related to code that needed to be mapped where something is
  already present.
* We now have two distinct flavors of helper modules: the full one and
  the "slim" one. The latter contains the definition only of functions
  we intend to inline. It is used in most of the pipeline, a good thing
  since we spend less time optimizing code we don't really care about.
  The full module is only used on the re-compilation branch of the
  pipeline.
* We no longer split the `cpu_loop` function.
* We change MetaAddress to rely on architectures from `model::` as
  opposed to the LLVM ones.
* We no longer attach debug info to LLVM IR containing the original
  assembly.
* We now verify that the lifted code only contains code we expect.
2025-10-31 17:25:03 +01:00
Lauri Vasama 086dc9fbc9 Remove RecursiveCoroutine operator*
* Add rc_eval to force evaluation.
2025-10-31 17:23:52 +01:00
Alessandro Di Federico 4fb6b5f4e1 Minor changes 2025-10-24 18:20:48 +02:00
Alessandro Di Federico f8bd4c3bac Move around some files in preparation for libtcg
* Make the following private headers public:
  * Lift/CPUStateAccessAnalysisPass.h
  * Lift/CSVOffsets.h
  * Lift/PTCDump.h
  * Lift/VariableManager.h
* Move from revngSupport to revngLift:
  * IRAnnotators.{h,cpp}
  * SelfReferencingDbgAnnotationWriter.{h,cpp}
* Move from revngSupport to revngModel:
  * FunctionTags.{h,cpp}
  * ProgramCounterHandler.{h,cpp}
* Move from revngSupport to revngRecompile:
  * OriginalAssemblyAnnotationWriter.{h,cpp}
2025-10-24 15:34:11 +02:00
Lauri Vasama bf5adce413 Overhaul Clift loop syntax, add break/continue 2025-10-21 09:15:40 +02:00
Giacomo Vercesi 40da49548b Add Binaries list to the model
Add to the model an entry detailing the list of input binaries under
`Binaries`. This will be referenced by `Segments` when needed.
2025-10-16 17:48:45 +02:00
Giacomo Vercesi bb0709effc Introduce compile_time::callWithIndexSequence
Add a helper function that given a `size_t` or a tuple-like type, allows
calling a lambda with the expanded sequence pack. This avoids having to
manually create the index sequence and defining the lambda accepting it.
2025-10-15 11:58:41 +02:00
Ivan Krysak ecb9d76c64 Model: drop obsolete default value handling 2025-10-13 18:33:10 +03:00
Ivan Krysak fd1c9115c0 Model: set default values where viable 2025-10-13 18:33:10 +03:00
Ivan Krysak 6c0c758e67 Model: make TTG verification more strict
Some stuff that was before implicitly checked during deserialization
now need explicit checks, those are introduced here.

This also fixes test failures related to the changed serialization
format (which fields can or cannot be omitted when they have
the default value).
2025-10-13 18:33:10 +03:00
Ivan Krysak 89282f31da Minor improvements 2025-10-13 18:33:10 +03:00
Ivan Krysak 256d2310b0 DwarfImporter: drop an unnecessary check 2025-10-13 10:26:41 +03:00
Ivan Krysak df681aa573 Ensure consumed errors are printed somewhere 2025-10-13 10:26:41 +03:00
Ivan Krysak 9bf93d3a30 Importers: add TODOs on diagnostic candidates 2025-10-13 10:26:41 +03:00
Ivan Krysak 5717d835f8 Add missing llvm::Error checks 2025-10-13 10:26:37 +03:00
Ivan Krysak a88747cf99 Drop unused includes 2025-10-08 12:22:34 +03:00
Ivan Krysak 77ea07c364 Minor improvements 2025-10-08 12:22:30 +03:00
Lauri Vasama 653d451e6c Remove undef name configuration support
Also adds a model migration removing
Configuration.Naming.UndefinedValuePrefix.
2025-09-29 18:05:55 +03:00
Giacomo Vercesi 18509a4ca0 Add missing string to VH.fail
Add missing string to invocations of `VH.fail` that do not depend on a
child's `verify` method.
2025-09-09 12:27:33 +02:00
Ivan Krysak e6d8ac2c87 Model: improve RFT verification output 2025-07-23 11:38:53 +02:00
Ivan Krysak 97aa3c8247 std::string: use implicit default constructor 2025-07-23 11:38:53 +02:00
Ivan Krysak 9e5053d9fd CMakeLists: remove unused variables 2025-07-23 11:38:52 +02:00
Ivan Krysak f391392fe9 Use explicit separator strings 2025-07-23 11:38:52 +02:00
Ivan Krysak 99476b249e NamespaceBuilder: add variable and label support 2025-07-23 11:38:52 +02:00
Ivan Krysak 0572de8990 TypePathHelpers: fix incorrect return value paths 2025-07-23 11:38:52 +02:00
Ivan Krysak 554ffa376a model::Function: introduce GotoLabels field 2025-07-23 11:38:51 +02:00
Ivan Krysak 1ebeb8f493 model::Function: introduce LocalVariables field 2025-07-23 11:38:50 +02:00
Ivan Krysak 4e3c6cccd0 Model: introduce LocalIdentifier struct 2025-07-23 11:38:50 +02:00
Ivan Krysak d7c089799c StatementComment: separate location verification 2025-07-23 11:38:50 +02:00
Ivan Krysak b982ae68d0 NamingConfiguration: add UnnamedGotoLabelPrefix 2025-07-23 11:38:50 +02:00
Giacomo Vercesi d62b7b6b1a TTG: inline root type in schema
Move the root type inside the schema definition, as it is a property of
it and not of the generator.
2025-06-25 15:40:13 +02:00
Lauri Vasama a7eb86174b Add revng/Support/Identifier.h for id validation 2025-06-04 15:13:47 +02:00
Pietro Fezzardi 2f6c8b6f67 TypeSystemPrinter: fix CABIFT with empty return 2025-05-29 09:31:26 +02:00
Pietro Fezzardi b441fc9916 CABIFunctionDefinition: no pointer-to-array return
This commit bans from the model pointer-to-array return types in
CABIFunctionDefinition.
CABIFunctionDefinition implies we're decompiling towards C, and C does
not support such return types, because it doesn't have valid syntax to
express them without using typedefs.
2025-05-28 17:11:11 +02:00
Pietro Fezzardi 0426c773b2 CABIFunctionDefinition: drop array argument/return
This commit bans from the model array types in as argument or return
types in CABIFunctionDefinition.
CABIFunctionDefinition implies we're decompiling towards C, and C does
not support array arguments (passed by copy) nor array return types.

Banning these from the model reduces the number of situations where we
have to emit artificial array wrappers (not present in the model) around
types when printing C code, simplifying the handling of such situations
when translating to clift and in general in the decompilation pipeline.
2025-05-28 17:11:11 +02:00
Pietro Fezzardi 7741e00e29 TypeSystemPrinter: fix CABIFT with empty return 2025-05-13 16:18:34 +02:00
Ivan Krysak 0d868894a2 model::Function: switch to indices as comment keys 2025-05-08 15:42:00 +02:00
Giacomo Vercesi 3e3779498e Implement python interface for revng
Add a python interface (`revng.profile`) for interacting with the rev.ng
infrastructure as a whole; either through the CLI (`CLIProject`) or the
GraphQL API (`DaemonProject`).
2025-05-07 10:48:51 +02:00
Khaled Ismaeel 030becfeba Adapt the build to the new schema version field
This is a followup to the commit where we introduced the `version`
field in the schema YAML.
2025-04-30 15:08:45 +02:00
Khaled Ismaeel 531d9b866c Remove the now-redundant HEADERS list 2025-04-30 15:08:45 +02:00
Khaled Ismaeel 63469c9cd6 Use unified YAML schemas in the build process
In this commit we instruct the build system to use the unified schema
files  instead of collecting the `TUPLE-TREE-YAML` comments.

The fixes to C++ files are necessary because they depend on the order
of the fields in the schema, which was changed.
2025-04-30 15:08:45 +02:00
Ivan Krysak 1622bb91a1 Introduce automatic names for dynamic functions 2025-04-24 13:22:14 +02:00
Ivan Krysak 79964eac74 Avoid ' misuse in error messages and comments 2025-04-17 16:41:21 +02:00