Commit Graph

76 Commits

Author SHA1 Message Date
Ivan Krysak 705e4a5955 auto [...] -> auto &&[...] 2025-02-13 13:10:51 +02:00
Ivan Krysak 288448f009 Never include model::VerifyHelper from headers 2025-02-13 13:09:50 +02:00
Ivan Krysak 8e3c9c0788 Model: remove obsolete name methods 2024-11-06 15:43:13 +02:00
Alessandro Di Federico 2cdedc71f4 s/serialize/toString/
We keep serialize for method dealing with streams.
If it returns a `std::string`, let's use `toString`.
2024-09-27 12:07:17 +02:00
Ivan Krysak 4a2db0ba4f UpcastablePointer: streamline empty behavior 2024-06-27 11:05:52 +02:00
Ivan Krysak dfa7478685 Adopt reworked model::Type 2024-06-27 11:05:51 +02:00
Ivan Krysak 277cba213c Model: separate verification 2024-06-27 11:05:49 +02:00
Ivan Krysak 9e6bf29f74 TTG: pull dump helper into the template 2024-06-27 11:05:49 +02:00
Ivan Krysak 927e8006b9 Model: rename TypePath to DefinitionReference 2024-06-27 11:05:49 +02:00
Ivan Krysak ac587cbb4f Model: rename Type into TypeDefinition 2024-06-27 11:05:48 +02:00
Alessandro Di Federico f60c1bb4ad s/TrackGuard/DisableTracking/ 2024-06-20 10:24:51 +02:00
Alessandro Di Federico bce1d6c0f3 Adopt invalidation along the core pipeline 2024-06-20 10:24:50 +02:00
Alessandro Di Federico b5f7576573 Rework TupleTreeGenerator tracking 2024-06-20 10:24:50 +02:00
Alessandro Di Federico d07d6c4f1f Drop leftover Section.h 2024-06-20 10:24:49 +02:00
Lauri Vasama 3e33a300d5 Introduce RawFunctionType::Architecture 2024-05-29 15:42:15 +02:00
Alessandro Di Federico 47c3dd8f0f Drop model::Segment::Sections 2024-05-22 10:25:25 +02:00
Alessandro Di Federico bf6cefc05a Externalize functions to improve build times 2024-05-03 21:52:40 +02:00
Alessandro Di Federico fe1dffcffd Add some missing includes
This is in preparation of reducing headers in Debug.h.
2024-05-03 21:52:40 +02:00
Alessandro Di Federico ffe93548c5 Model ::size(): do not suspend tracking 2024-03-01 14:53:07 +01:00
Alessandro Di Federico db4e5c4a5e Introduce dumpModel 2024-03-01 14:53:07 +01:00
Alessandro Di Federico c73e88a8d8 Model: handle missing function prototype 2024-02-09 10:04:20 +01:00
Massimo Fioravanti f6ff8e544d Add tracking debug infrastructure
Add a mechanism to make the program crash when a given element of the
model is read or written.
2024-01-02 11:14:56 +01:00
Massimo Fioravanti c276a439b5 Add pipeline invalidation
Replace the stub implementation of invalidation with the proper
implementation. A ReadPathCache is added to each global so that it can
keep tracks of what target are associated to which read paths.
2024-01-02 11:14:56 +01:00
Pietro Fezzardi 48b27af795 Make Segment::Type a TupleTreeReference
This is homogeneous with all other nullable reference to types in the
model, like the StackFrameType in model::Function, and others.
2023-12-05 16:19:38 +01:00
Pietro Fezzardi ef8a9699f1 Improve model::Function::verify 2023-12-05 16:19:38 +01:00
Alessandro Di Federico 79c5f59449 DwarfImporter: handle invalid function addresses 2023-10-06 17:16:04 +02:00
Alessandro Di Federico bf66ecc389 {,Dynamic}Function::Prototype: support typedefs 2023-10-05 10:19:44 +02:00
Alessandro Di Federico f51af94e8f TupleTreeReference::isValid is for assertions only 2023-08-23 16:14:05 +02:00
Alessandro Di Federico a5b380b201 Model: rework how we name things
This commit improves the formalization of how we handle names.

The main changes are:

* Now `_` is a reserved prefix and all the generated names start with
  `_`.
* The model verification routine now checks that `CustomName`s in the
  global scope do not collide with any local namespace (e.g., fields of
  a `StructType`).
* We changed the prefix `prefix_` to `unreserved_` to better convey the
  fact that the prefix has been introduce to use an non-reserved name.
2023-08-23 16:14:04 +02:00
Alessandro Di Federico 247879f7fc model::Type::ID: switch to progressive IDs
This commit switches `model::Type::ID` from being a GUID to be a
progressive number, in order to make things easier for humans.

On top of this, this commit introduces the following changes:

* TypeCopier: import all the necessary PrimitiveTypes and improve
  handling of CustomName.
* Move Kind as the last field of the key of each TupleTree type used in
  an `UpcastablePointer`.
* Update the ground truth of tests to ignore the `CustomName` in favor
  of focusing on `OriginalName`.
* Increase adoption of `model::Binary::makeType`, equivalent to
  `Binary.recordNewType(makeType<model::*Type>())`.
2023-08-23 16:14:04 +02:00
Ivan Krysak 7d235f4fd0 Enforce licence header consistency
Also do some basic cleanup: capitalize first letters, add `.`
at the end of the sentences, and so on.
2023-07-03 15:23:10 +00:00
Ivan Krysak bc98e0079f Formatting: change PenaltyReturnTypeOnItsOwnLine
The new value is 21.
2023-07-02 13:20:49 +02:00
Ivan Krysak 02978910b0 STLExtras: introduce zip_pairs skip flavour
I found that it leads to better looking code when the check of whether
the range in question even has enough elements to skip is inside
the helper.

As such a separate type of skip entry point was introduced: one that
allows to iterate over the container pairwise

Now, instead of asserting, the loop just does nothing in cases like
```cpp
for (const auto &Element : zip_pairs(make_empty_range())
  do_stuff();
```
2023-05-25 06:25:07 +00:00
Ivan Krysak 0170c0dfeb Model: add segment overlap check to verification 2023-05-17 14:08:06 +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
Alessandro Di Federico 19d59ffd73 Implement Segment::dump 2023-04-08 08:42:24 +02:00
Ivan Krysak 726baf5318 Model: make Binary::recordNewType stricter 2023-03-15 10:19:02 +01:00
Djordje Todorovic 24a5705e12 Importer: Attach attributes when copying types 2023-02-16 11:07:52 +01:00
Massimo Fioravanti 4dc2e92782 Introduce DocumentError
`DocumentError`s are the inteded way of propagating errors from the
pipeline to the frontend when a location is required to inform the user
of the error whereabouts.
2023-02-09 13:42:50 +01:00
Antonio Frighetto ea0a06a876 revng.daemon: accept no arguments for analysis
Let GraphQL accept zero or more parameters for analyses.
2023-02-06 09:37:23 +01:00
Massimo Fioravanti 742e1a0c56 TupleTree: switch from public fields to accessors 2022-12-12 18:36:57 +01:00
Alvise de Faveri 999df25246 Add revng model export type-graph tool
This tools dumps a type, a function or an entire type-system to a
dot file,representing dependencies between types as edges.
2022-09-19 08:35:06 +02:00
Djordje Todorovic 098f864d8d Model: Add parsing of dyn syms to PECOFFImporter
This parses symbols similar to ELF's .dynsym.
2022-07-28 14:52:02 +02:00
Giacomo Vercesi 09009836a1 PipelineC: expose globals verification 2022-07-28 08:47:46 +02:00
Alessandro Di Federico d42fb9bb13 Segment::verify(): relocations can be out segment
We used to check that the target address of a relocation needs to be
within the `model::Segment` it's referring to.
However this is not correct.
2022-07-27 18:57:21 +02:00
Antonio Frighetto 4bc21328d8 Model: reserve type prefixes 2022-07-22 16:10:51 +02:00
Antonio Frighetto 186d907be3 Model: extend model::Segment
`Segment` now includes a `Type` of struct kind. This is intended to
emit the segment as a struct later in decompilation. The implementation
of name has also been added.
2022-07-22 16:10:51 +02:00
Giacomo Vercesi 039f7db93e model::*: ensure Kind -> Class correspondence 2022-04-08 17:31:05 +02:00
Antonio Frighetto 20cdfe668a EFA: take the control-flow graph out of the model
The control-flow graph and all its hierarchy components
have been moved from `model` to `efa`. The CFG is now
serialized onto the LLVM IR module as a metadata.
2022-04-05 15:37:57 +02:00
Alessandro Di Federico 1a57229693 Introduce model::Binary::DefaultPrototype 2022-03-08 15:04:34 +01:00