Commit Graph

61 Commits

Author SHA1 Message Date
Ivan Krysak ac587cbb4f Model: rename Type into TypeDefinition 2024-06-27 11:05:48 +02:00
Massimo Fioravanti 43349943a7 Stop serializing the model in the IR 2024-06-20 09:57:36 +02:00
Ivan Krysak 8ecdd76e68 ABI-tests: improve ABI mismatch error message 2024-03-15 19:05:10 +01:00
Ivan Krysak b73d4934c8 ABI-tests: extend register comparison
It now accounts for endianness.
2024-02-09 15:09:37 +00:00
Ivan Krysak 16feb420c3 ABI-tests: handle stack argument offset gracefully 2024-02-09 15:09:37 +00:00
Ivan Krysak 654e0958e9 ABI-tests: remove obsolete abi replacement
See the `replace-abi.py` script for how it's done now.
2024-02-09 15:09:37 +00:00
Ivan Krysak b75406f711 ABI-tests: make ID matching more robust 2024-02-09 15:09:37 +00:00
Ivan Krysak 5fcdfebbaf ABI-tests: support pointers-to-copy on the stack 2024-02-09 15:09:37 +00:00
Ivan Krysak 24e907525e ABI-tests: support pointers-to-copy in registers 2024-02-09 15:09:37 +00:00
Ivan Krysak a1ddbe5d83 ABI-tests: improve reported errors 2024-02-09 15:09:37 +00:00
Ivan Krysak d1a78d903b ABI-tests: make tested function set leaner 2024-02-09 15:09:37 +00:00
Ivan Krysak 43c6780baf ABI-tests: introduce ID list deduplication 2024-02-09 15:09:37 +00:00
Ivan Krysak f08d1a2f81 ABI-tests: prefer model::Type::Key to RFT * 2024-02-09 15:09:37 +00:00
Ivan Krysak cf0ce66674 ABI-tests: use updated stdout.yml file format
This also allows to simplify the resulting datastructure somewhat.
2024-02-09 15:09:37 +00:00
Ivan Krysak 4a8455e994 ABI-tests: separate value preservation verifier 2024-02-09 15:09:37 +00:00
Ivan Krysak d13e83163d Minor improvements 2024-02-09 15:09:37 +00:00
Ivan Krysak 77b1acaf00 Prefer uint64_t to size_t wherever relevant 2024-01-29 11:57:54 +02:00
Ivan Krysak b25a32de2a Stop using std:: prefix for std::size_t 2024-01-29 11:57:54 +02:00
Alessandro Di Federico d648f9b970 s/Layout::returnsAggregateType/Layout::hasSPTAR/ 2023-12-12 12:04:34 +01:00
Alessandro Di Federico 10dcb7be11 Fix semantics of model::Types purging passes
One of the two passes to purge unused types from the model had a
ill-defined semantics.

This commit simplifies them in two passes: one that purges all the types
unreachable from outside `Binary::Types` and one that does the same but
also preserves types with a `CustomName` or an `OriginalName`.
2023-12-05 16:19:39 +01:00
Pietro Fezzardi 1285c6e7af Make RawFunctionType::StackArgumentsType a TTR
This is homogeneous with all other nullable references to types in the
model, such as the StackFrameType in model::Function, and others.
2023-12-05 16:19:38 +01:00
Ivan Krysak f3acdcdef3 ABI: rewrite the testing suite documentation 2023-11-02 17:10:04 +01:00
Ivan Krysak ca3d3fe5f1 ABI-testing: rework the layout verification
Following the switch in the testing approach on the revng-qa side,
the logic here also needed to be updated.
2023-11-02 17:10:04 +01:00
Ivan Krysak 65fa67df84 YAMLTraits: specialize for std::byte 2023-11-02 17:10:04 +01:00
Ivan Krysak dcc8fd16c5 ABI-testing: rename the parser file
Since `artifact` is so ambiguous, a more explicit name was given.
2023-11-02 17:10:04 +01:00
Ivan Krysak cfe28d8e56 Stop using std:: prefix for u?int\d+_t types 2023-11-02 17:10:03 +01:00
Alessandro Di Federico 8ab26f8d7f Adopt TupleTreeReference::empty() 2023-10-05 10:19:44 +02:00
Alessandro Di Federico b67e2ac13a Minor changes 2023-10-04 17:47:50 +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
Alessandro Di Federico f68185abc9 Push ParseCommandLineOptions into InitRevng 2023-04-28 14:34:35 +02:00
Ivan Krysak 1f439cbb8c ABI-testing: extend to support unusual alignment
Because it's often hard to predict the specific location of an argument when
non-natural alignment is concerned, this adds an extra check allowing
the cases to pass if they would be well-formed if only some pesky
"extra" bytes were to disappear.
2023-03-15 10:19:03 +01:00
Ivan Krysak 750b6361a8 ABI-testing: add SPTARV support 2023-03-15 10:19:03 +01:00
Ivan Krysak d65ed50e0b ABI-testing: allow explicit abi overrides
Since dwarf sometimes misdetects abi pretty badly, to maintain
the usefulness of the test, it's beneficial to sometimes discard
the "detected" ABI by overriding it by the known value.

This also add a check ensuring that all the functions presents in
the artifact are also present in the binary.
2023-03-15 10:19:03 +01:00
Ivan Krysak a7be2cd11b ABI-testing: improve robustness against padding
Some cases of irregular padding were causing issues when verifying
arguments which varanted a bit of the rework of the main verification
loop.
2023-03-15 10:19:03 +01:00
Ivan Krysak 15f8999fce ABI-testing: simplify compatibility checker
The complicated error handling logic turned out to be more of
a nuisance than a useful debugging tool. This commit removes it
in favour of `revng_abort`'ing or `revng_check`'ing to make sure
the actual state is consistent with the expectations.

It also adds namespace to `std::size_t` mentions.
2023-03-15 10:19:03 +01:00
Ivan Krysak 89b3def533 ABI: move RegisterOrder onto the runtime trait 2023-03-15 10:19:02 +01:00
Ivan Krysak 9e393578c9 ABI: move state deduction onto the runtime trait 2023-03-15 10:19:02 +01:00
Ivan Krysak 58b33ea7af ABI-testing: make rtf-equivalence id-independent 2023-03-15 10:19:02 +01:00
Ivan Krysak 7daa187107 ABI-testing: support returning values as a pointer 2023-03-15 10:19:02 +01:00
Ivan Krysak ad0fc079b8 ABI-testing: rename verify-abi
The new name is `check-compatibility-with-abi`
2023-03-15 10:19:02 +01:00
Ivan Krysak 01a05e2037 ABI: separate convertions based on the direction 2023-03-15 10:19:02 +01:00
Massimo Fioravanti 742e1a0c56 TupleTree: switch from public fields to accessors 2022-12-12 18:36:57 +01:00
Ivan Krysak 535c9dd346 ABI: remove MinimumStackArgumentSize value
The architecture-specific pointer (generic register) size is used
instead.

For all the ABIs we support the value of this parameter was already
set to its pointer size. We might need to reintroduce the parameter
in the future if we want to support a super-exotic ABI with different
stack alignment requirements, but that seems highly unlikely.

This also introduces the argument extension helper for one stop all
treating small arguments when they are put into a register or pushed
into the stack.
2022-11-30 15:06:54 +01:00
Alessandro Di Federico 85d574b305 test-abi: various fixes 2022-09-21 18:39:28 +02:00
Ivan Krysak 240f334d78 Fix minor wording issues 2022-08-05 17:27:56 +03:00
Davide Depau 8d89be44fc Add initialization utility to all main functions 2022-07-22 21:04:03 +02:00
Alessandro Di Federico f4684e244d Switch to new testsuite 2022-06-20 19:04:18 +02:00
Giacomo Vercesi d81dc49809 revng-check-conventions: license check 2022-04-20 09:55:18 +02:00
Giacomo Vercesi 52a5c700e1 revng-check-conventions: add shellcheck
Add bash script checks with shellcheck + `set` rule.
Also, all existing bash scripts have been fixed.
2022-04-20 09:54:51 +02:00