Commit Graph

2609 Commits

Author SHA1 Message Date
Alessandro Di Federico dcc795c424 Drop Logger's StaticEnabled feature 2025-10-31 14:49:05 +01:00
Alessandro Di Federico aa796af917 VariableManager: move fields declarations to top 2025-10-31 14:49:05 +01:00
Alessandro Di Federico 1cafd2288d RawBinaryView: outline to .cpp 2025-10-31 14:49:05 +01:00
Alessandro Di Federico b1feb5b989 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 14:49:05 +01:00
Alessandro Di Federico 8f21f3b5e1 check-conventions for older commits 2025-10-31 13:23:45 +01:00
Lauri Vasama 7311f3d665 Remove RecursiveCoroutine operator*
* Add rc_eval to force evaluation.
2025-10-31 09:30:54 +01:00
Lauri Vasama febf08188e RecursiveCoroutine improvements 2025-10-31 09:30:54 +01:00
Lauri Vasama 4689e4c4ec Add UniqueCoroutineHandle 2025-10-31 09:30:54 +01:00
Ivan Krysak 5b419540cc Disable IRBuilder checks in some additional places 2025-10-31 09:04:59 +01:00
Alessandro Di Federico 0d5e05688d collectTuple: add non-recursive implementation 2025-10-29 15:10:18 +01:00
Alessandro Di Federico dfbe005307 ReadFields: switch to vectors 2025-10-29 15:10:18 +01:00
Alessandro Di Federico 46a0af46c8 TupleTree visits: improve handling of upcast 2025-10-29 15:10:18 +01:00
Alessandro Di Federico 724703910c QuickMetadata: add support for bool 2025-10-29 10:57:41 +01:00
Alessandro Di Federico 97e75d0019 MetaAddress: improve verify 2025-10-29 10:56:59 +01:00
Alessandro Di Federico e81dbfd898 Minor changes 2025-10-29 10:56:50 +01:00
Alessandro Di Federico c9e7ba7943 TupleTree visits: bypass access tracking
Use non-`const` version to bypass tracking.
2025-10-28 09:18:27 +01:00
Alessandro Di Federico db8eb227b9 TupleTreePath: rewrite with TraitfulAny 2025-10-28 09:18:27 +01:00
Alessandro Di Federico 97415b5ffe TupleTree visits: fix handling of upcast
We now suspend tracking before calling `.upcast`.
2025-10-24 18:24:25 +02:00
Alessandro Di Federico 0d066767f2 mips: fix f register size 2025-10-24 18:24:03 +02:00
Alessandro Di Federico 8cef543257 MFP: improve logging 2025-10-24 18:23:44 +02:00
Alessandro Di Federico 1e55635b65 Introduce efa::FunctionEdgeType::Unexpected 2025-10-24 18:23:23 +02:00
Alessandro Di Federico fb80f4b8bd FunctionCallIdentification: handle delay slot 2025-10-24 18:21:07 +02:00
Alessandro Di Federico ed3fc26166 MaterializedValue: handle loading mutable data 2025-10-24 18:20:54 +02: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
Ivan Krysak 2ba5ca3e3d Suppress selected IRBuilder checks 2025-10-21 19:17:37 +03:00
Ivan Krysak 3561c2b907 Adopt IRBuilder wrapper 2025-10-21 19:17:01 +03:00
Ivan Krysak 50823caaf6 Introduce IRBuilder wrapper 2025-10-21 19:16:58 +03:00
Lauri Vasama 7980e57fb5 Add Clift C legalization pass 2025-10-21 09:15:40 +02:00
Lauri Vasama 02d3c82887 Add support for Clift for-loop initializers 2025-10-21 09:15:40 +02:00
Lauri Vasama bf5adce413 Overhaul Clift loop syntax, add break/continue 2025-10-21 09:15:40 +02:00
Lauri Vasama 16589c935c Add BranchOpInterface for if and switch 2025-10-21 09:15:40 +02:00
Lauri Vasama 3d9df0f50d Add then marker for Clift if-statement assembly 2025-10-21 09:15:40 +02:00
Lauri Vasama 34cd63e60c Add CliftOpHelpers.h 2025-10-21 09:15:40 +02:00
Lauri Vasama 7da5792f0a Add Clift label and jump operation interfaces 2025-10-21 09:15:40 +02:00
Lauri Vasama f3be99f317 Use keyword for attr dicts of ops with regions 2025-10-21 09:15:40 +02:00
Lauri Vasama 26e6b9086c Simplify Clift pass declarations 2025-10-21 09:15:40 +02:00
Giacomo Vercesi 6abba05d7e Introduce ImportFiles pipe
Introduce the `ImportFiles` pipe which leverages the newly-introduced
`FileStorage` to fetch the required files and store them in the
`BinariesContainer`.
2025-10-16 17:48:45 +02:00
Giacomo Vercesi b622fe8f19 Implement FileProvider interface
Implement the `FileProvider` interface, this allows pipes to request
files given a `FileRequest` (hash and optional size/name).
2025-10-16 17:48:45 +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 e57442fafe Introduce Tar.h
Split off the `GzipTarReader` into `Tar.h`, include a normal
`TarWriter` class which leverages libarchive to generate the tar file.
2025-10-16 16:08:05 +02:00
Giacomo Vercesi 2f83d8f5c9 Introduce CUniquePtr
Add a helper using of `std::unique_ptr` that allows easier wrapping of
C pointer with destructors.
2025-10-16 16:08:05 +02:00
Giacomo Vercesi ca0f312b1e Pipebox: remove const from ArrayRef
Remove the `const` from `ArrayRef<const char>` as the `ArrayRef` already
implies the underlying type will be accessed only in `const`.
2025-10-16 16:07:09 +02:00
Giacomo Vercesi 18f0bd88f9 pypeline::Model: fix serialize
The `serialize` function of `revng::pypeline::Model` erroneously
returned a buffer instead of `bytes`, fix the function so that `bytes`
are returned instead.
2025-10-16 12:51:52 +02:00
Giacomo Vercesi f165f99392 pypeline.Model: make deserialize to static
Change the `Model.deserialize` to a static function, which will return
a new instance of the Model.
2025-10-16 10:30:01 +02:00
Giacomo Vercesi d92f4cdca3 ObjectID: introduce byte (de)serialization
Add the `to_bytes` and `from_bytes` to `ObjectID`. This allows
serializing an `ObjectID` instance to raw bytes with a specific binary
format.
2025-10-15 11:58:41 +02:00
Giacomo Vercesi 10a396a3b5 PipeboxCommon: rework {Analysis,Pipe}Runner
Rework the `AnalysisRunner` and `PipeRunner` structs into single
functions, these do not need to have a template parameter specifying how
to extract containers as that logic has been delegated to a newly
introduced trait called `ExtractContainerFromList`.
2025-10-15 11:58:41 +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 855f929041 Yield: set default values where viable 2025-10-13 18:33:10 +03:00